bi-components-library 1.1.21 → 1.1.23
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/bi-components-library.css +1 -1
- package/dist/index.es.js +20756 -3035
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +44 -26
- package/dist/index.umd.js.map +1 -1
- package/package.json +7 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,39 +1,57 @@
|
|
|
1
|
-
(function(le,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],w):(le=typeof globalThis<"u"?globalThis:le||self,w(le.SealSeekBIComponents={},le.React,le.React,le.antd,le.AntdIcons,le.ReactDOM))})(this,function(le,w,c,oe,Te,Xe){"use strict";const ft=({variant:t="primary",loading:f=!1,children:i,...d})=>{const v=D=>{switch(D){case"primary":return"primary";case"ghost":return"default";case"dashed":return"dashed";case"link":return"link";case"text":return"text";default:return"primary"}};return w.jsx(oe.Button,{...d,type:v(t),loading:f,ghost:t==="ghost",children:i})};ft.__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 mt=({title:t,children:f,bordered:i=!0,hoverable:d=!1,size:v="default",...D})=>w.jsx(oe.Card,{...D,title:t,bordered:i,hoverable:d,size:v,children:f});mt.__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 yt=({showDefaultFooter:t=!0,...f})=>{const i=f.footer!==void 0?f.footer:t?(d,{OkBtn:v,CancelBtn:D})=>w.jsxs(w.Fragment,{children:[w.jsx(v,{}),w.jsx(D,{})]}):null;return w.jsx(oe.Modal,{...f,footer:i})};yt.__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 ht=({scrollX:t,showPagination:f=!0,defaultPageSize:i=10,...d})=>w.jsx(oe.Table,{...d,scroll:{x:t||"max-content",y:"50vh"},pagination:f?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:i,...d.pagination}:!1});ht.__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 Xt=Te.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),gt=({name:t,size:f,color:i,style:d,...v})=>{const D={fontSize:f,color:i,...d};return w.jsx(Xt,{...v,type:t,style:D})};gt.__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 bt=({loading:t,description:f="暂无数据",className:i,emptyChildren:d,loadingText:v,emptyImage:D})=>t?w.jsxs(oe.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",vertical:!0,children:[w.jsx(oe.Spin,{size:"large"}),v&&w.jsx("div",{className:"mt-4 text-gray-500",children:v})]}):w.jsx(oe.Flex,{className:`pt-10 w-full ${i||""}`,align:"center",justify:"center",children:w.jsx(oe.Empty,{image:D,description:f,imageStyle:{height:180},children:d})});bt.__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 xt=({onClick:t,showText:f=!1,className:i,size:d="small",type:v="default"})=>w.jsx(oe.Button,{size:d,type:v,icon:w.jsx(Te.LeftOutlined,{}),className:`cursor-pointer ${i||""}`,onClick:t,children:f&&"返回"});xt.__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 vt=({removePadding:t=!0,className:f,...i})=>{const d=t?`px-0 h-auto ${f||""}`:f;return w.jsx(oe.Button,{type:"link",...i,className:d,children:i.children})};vt.__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:Jt}=oe.Select,wt=({columns:t,request:f,searchFields:i=[],showSearch:d=!0,showRefresh:v=!0,defaultPageSize:D=10,pageSizeOptions:P=["10","20","50","100"],autoLoad:B=!0,externalParams:M={},...L})=>{const[q,j]=c.useState([]),[S,N]=c.useState(!1),[e,n]=c.useState({current:1,pageSize:D,total:0}),[s,u]=c.useState({}),[E,H]=c.useState({}),[F]=oe.Form.useForm(),T=c.useRef(e);T.current=e;const ne=c.useRef(M);ne.current=M;const K=c.useRef(!1),R=c.useMemo(()=>t.map(y=>{const{sortable:b,render:x,...I}=y;return{...I,sorter:b?!0:void 0,render:x||(A=>A)}}),[t]),G=c.useCallback(async(y={})=>{if(f){N(!0);try{const b={page:T.current.current,pageSize:T.current.pageSize,sortField:E.field,sortOrder:E.order,searchParams:{...s,...ne.current},...y},x=await f(b);x.success&&(j(x.data),n(I=>({...I,total:x.total,current:b.page||I.current})))}catch(b){console.error("加载数据失败:",b)}finally{N(!1)}}},[f,E,s]),l=c.useCallback(y=>{u(y),n(b=>({...b,current:1}))},[]),_=c.useCallback(()=>{F.resetFields(),u({}),n(y=>({...y,current:1}))},[F]),U=c.useCallback(()=>{G()},[G]),V=c.useCallback((y,b,x)=>{const I={current:y.current||1,pageSize:y.pageSize||D,total:y.total||0},A={field:x?.field,order:x?.order};n(I),H(A)},[D]);return c.useEffect(()=>{const y=Object.keys(M).length>0;(B&&!K.current||y)&&(G(),K.current=!0)},[B,M,G]),w.jsxs("div",{children:[d&&i.length>0&&w.jsx(oe.Card,{size:"small",style:{marginBottom:16},children:w.jsxs(oe.Form,{form:F,layout:"inline",onFinish:l,initialValues:i.reduce((y,b)=>(b.defaultValue!==void 0&&(y[b.key]=b.defaultValue),y),{}),children:[i.map(y=>w.jsx(oe.Form.Item,{name:y.key,label:y.label,children:y.type==="input"?w.jsx(oe.Input,{placeholder:y.placeholder||`请输入${y.label}`,style:{width:200}}):w.jsx(oe.Select,{placeholder:y.placeholder||`请选择${y.label}`,style:{width:200},allowClear:!0,children:y.options?.map(b=>w.jsx(Jt,{value:b.value,children:b.label},b.value))})},y.key)),w.jsx(oe.Form.Item,{children:w.jsxs(oe.Space,{children:[w.jsx(oe.Button,{type:"primary",htmlType:"submit",icon:w.jsx(Te.SearchOutlined,{}),children:"查询"}),w.jsx(oe.Button,{onClick:_,children:"重置"}),v&&w.jsx(oe.Button,{icon:w.jsx(Te.ReloadOutlined,{}),onClick:U,children:"刷新"})]})})]})}),w.jsx(oe.Table,{...L,columns:R,dataSource:q,loading:S,pagination:{...e,showSizeChanger:!0,showQuickJumper:!0,showTotal:(y,b)=>`第 ${b[0]}-${b[1]} 条/共 ${y} 条`,pageSizeOptions:P},onChange:V,scroll:{x:"max-content",y:"50vh"}})]})};wt.__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:"{}"}}}};function Je(t,f,i){if(!t.current)return;const d=S=>{S.classList.contains("rte-richtext-host-expanded")&&(S.style.setProperty("display","flex","important"),S.style.setProperty("flex-direction","column","important"),S.style.setProperty("flex","1 1 auto","important"),S.style.setProperty("min-height","0","important"),S.style.setProperty("width","100%","important"),S.style.setProperty("align-self","stretch","important"))},v=new Set,D={};for(const S of f)S.exclusionGroup&&S.exclusionGroup!=="separator"&&(v.add(S.exclusionGroup),D[S.exclusionGroup]||(D[S.exclusionGroup]=[]),D[S.exclusionGroup].push({type:S.type,key:S.key,exclusionGroup:S.exclusionGroup}));const P={};for(const S of v){P[S]=!1;for(const N of D[S])if(N.type==="upload"&&N.key){if(i[N.key]!==null&&i[N.key]!==void 0){P[S]=!0;break}const e=f.find(n=>n.type==="upload"&&n.key===N.key);if(e&&typeof e.maxCount=="number")for(let n=0;n<e.maxCount;n++){const s=`${N.key}-${n}`;if(i[s]!==null&&i[s]!==void 0){P[S]=!0;break}}if(P[S])break}else if((N.type==="variable"||N.type==="multi-variable")&&N.key){const e=N.type==="multi-variable"?t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${N.key}"]`):[t.current.querySelector(`[data-type="variable"][data-key="${N.key}"]`)].filter(Boolean);for(const n of e)if(!n.classList.contains("show-placeholder")&&n.innerText.replace(/[\u200B\n]/g,"").trim().length>0){P[S]=!0;break}if(P[S])break}}const B=f.some(S=>S.exclusionGroup==="separator"),L=Object.keys(P).filter(S=>P[S]).length>0;let q=null;if(L&&B){for(const S of f)if(S.exclusionGroup&&S.exclusionGroup!=="separator"&&P[S.exclusionGroup]){q=S.exclusionGroup;break}}for(const S of v){const N=t.current.querySelectorAll(`[data-group="${S}"]`);B&&L&&q?S===q?N.forEach(e=>{if(!e.closest('[data-rte-force-hidden="1"]')){if(e.classList.contains("rte-richtext-host-expanded")){d(e);return}e.classList.contains("required-upload-group")?e.style.setProperty("display","inline-flex","important"):(e.classList.contains("exclusion-wrapper"),e.style.setProperty("display","inline-block","important"))}}):N.forEach(e=>{e.closest('[data-rte-force-hidden="1"]')||(e.style.display="none",e.style.setProperty("display","none","important"))}):N.forEach(e=>{if(!e.closest('[data-rte-force-hidden="1"]')){if(e.classList.contains("rte-richtext-host-expanded")){d(e);return}e.classList.contains("required-upload-group")?e.style.setProperty("display","inline-flex","important"):(e.classList.contains("exclusion-wrapper"),e.style.setProperty("display","inline-block","important"))}})}t.current.querySelectorAll('[data-group="separator"]').forEach(S=>{S.style.display=L?"none":"inline"})}function Qe(t,f,i,d){if(!t.current){d(!1);return}const v=e=>{const n=e.getAttribute("data-node-type")||"";if(n!=="report-module"&&n!=="markdown-module")return(e.textContent||"").replace(/[\u200B]/g,"").trim();const s=(e.textContent||"").replace(/[\u200B]/g,"").trim(),u=Array.from(e.querySelectorAll(":scope > div"));if(u.length===0)return s;let E=-1;for(let T=0;T<u.length;T++)if((u[T].textContent||"").replace(/[\u200B]/g,"").trim().length>0){E=T;break}return u.filter((T,ne)=>ne!==E).map(T=>(T.textContent||"").replace(/[\u200B]/g,"").trim()).join(`
|
|
2
|
-
`).trim()||s},D=e=>e?!!e.closest('[data-rte-force-hidden="1"]'):!1,P=[];for(let e=0;e<f.length;e++){const n=f[e];if((n.type==="variable"||n.type==="report-url"||n.type==="markdown"||n.type==="upload"||n.type==="multi-variable"||n.type==="select"||n.type==="textarea"||n.type==="richtext"||n.type==="report-module"||n.type==="markdown-module"||n.type==="datepicker"||n.type==="number-input")&&n.required&&n.key){P.push({exclusionGroup:n.exclusionGroup||"",key:n.key,type:n.type==="multi-variable"||n.type==="report-url"||n.type==="markdown"?"variable":n.type==="report-module"||n.type==="markdown-module"?"richtext":n.type,isMultiVariable:n.type==="multi-variable",minCount:n.type==="multi-variable"||n.type==="upload"&&typeof n.minCount=="number"?n.minCount:void 0,moduleIndex:n.type==="report-module"||n.type==="markdown-module"?n.moduleIndex:void 0,__index:e});continue}if(n.type==="text"&&n.className?.includes("rte-text-required"))if(n.exclusionGroup)for(let s=e+1;s<f.length;s++){const u=f[s];if(u.exclusionGroup===n.exclusionGroup&&(u.type==="variable"||u.type==="markdown"||u.type==="upload"||u.type==="select"||u.type==="textarea"||u.type==="richtext"||u.type==="datepicker"||u.type==="number-input")&&u.key){P.push({exclusionGroup:n.exclusionGroup,key:u.key,type:u.type==="markdown"?"variable":u.type,__index:s});break}}else for(let s=e+1;s<f.length;s++){const u=f[s];if((u.type==="variable"||u.type==="markdown"||u.type==="upload"||u.type==="select"||u.type==="textarea"||u.type==="richtext"||u.type==="datepicker"||u.type==="number-input")&&u.key){P.push({exclusionGroup:u.exclusionGroup||"",key:u.key,type:u.type==="markdown"?"variable":u.type,__index:s});break}}}const B=f.some(e=>e.exclusionGroup==="separator"),M=[];if(B&&P.length>1){const e=[];f.forEach((n,s)=>{n.exclusionGroup==="separator"&&e.push(s)});for(const n of e){const u=P.filter(F=>typeof F.__index=="number"&&F.__index<n).sort((F,T)=>(T.__index??0)-(F.__index??0))[0],H=P.filter(F=>typeof F.__index=="number"&&F.__index>n).sort((F,T)=>(F.__index??0)-(T.__index??0))[0];u&&H&&M.push([u,H])}}if(P.length===0){if(f.length===0){if(!t.current){d(!1);return}const e=t.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";d(e.length>0);return}d(!0);return}const L=P.filter(e=>{if(!t.current)return!1;if(e.exclusionGroup){const n=t.current.querySelectorAll(`[data-group="${e.exclusionGroup}"]`);if(n.length>0){const s=n[0];return D(s)?!0:s.style.display!=="none"}}if(e.type==="upload"&&e.key){const n=t.current.querySelector(`[data-type="upload"][data-key="${e.key}"]`)||t.current.querySelector(`[data-type="upload"][data-batch-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);if(n.length>0){const s=n[0],u=s.closest("[data-group]")||s.parentElement;return D(u)?!0:u?u.style.display!=="none":!0}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="select"&&e.key){const n=t.current.querySelector(`[data-type="select"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="textarea"&&e.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="richtext"&&e.key){const n=typeof e.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"]`:`[data-type="richtext"][data-key="${e.key}"]`,s=t.current.querySelector(n);if(s){const u=s.closest("[data-group]")||s.parentElement;return D(u)?!0:u?u.style.display!=="none":!0}}else if(e.type==="datepicker"&&e.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}else if(e.type==="number-input"&&e.key){const n=t.current.querySelector(`[data-type="number-input"][data-key="${e.key}"]`);if(n){const s=n.closest("[data-group]")||n.parentElement;return D(s)?!0:s?s.style.display!=="none":!0}}return!1});if(L.length===0){d(!0);return}const q=new Set;M.forEach(e=>{e.forEach(n=>{n.key&&q.add(n.key)})});const j=L.filter(e=>!e.key||!q.has(e.key));let S=(M.length===0,!0);for(const e of M){const n=e.filter(u=>{if(!t.current)return!1;if(u.exclusionGroup){const E=t.current.querySelectorAll(`[data-group="${u.exclusionGroup}"]`);if(E.length>0){const H=E[0];return D(H)?!0:H.style.display!=="none"}}return!0});if(n.length===0)continue;let s=!1;for(const u of n)if(u.type==="upload"&&u.key){if(u.minCount&&u.minCount>0){let E=0;const H=t.current.querySelectorAll(`[data-type="upload"][data-batch-key="${u.key}"]`);if(H.length===0)continue;for(let F=0;F<H.length;F++){const ne=H[F].dataset.key;ne&&i[ne]!=null&&(E+=1)}if(E>=u.minCount){s=!0;break}}else if(i[u.key]!==null&&i[u.key]!==void 0){s=!0;break}}else if(u.type==="variable"&&u.key)if(u.isMultiVariable){const E=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${u.key}"]`);let H=0;for(const T of Array.from(E)){if(T.classList.contains("show-placeholder"))continue;T.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(H+=1)}const F=u.minCount&&u.minCount>0?u.minCount:1;if(H>=F){s=!0;break}}else{const E=t.current.querySelector(`[data-type="variable"][data-key="${u.key}"]`);if(E){if(E.classList.contains("show-placeholder"))continue;if(E.innerText.replace(/[\u200B\n]/g,"").trim().length>0){s=!0;break}}}else if(u.type==="select"&&u.key){const E=t.current.querySelector(`[data-type="select"][data-key="${u.key}"]`);if(E&&(E.getAttribute("data-value")||"").trim().length>0){s=!0;break}}else if(u.type==="textarea"&&u.key){const E=t.current.querySelector(`[data-type="textarea"][data-key="${u.key}"]`);if(E&&(E.value||"").trim().length>0){s=!0;break}}else if(u.type==="richtext"&&u.key){const E=typeof u.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"]`:`[data-type="richtext"][data-key="${u.key}"]`,H=t.current.querySelector(E);if(H&&v(H).length>0){s=!0;break}}else if(u.type==="datepicker"&&u.key){const E=t.current.querySelector(`[data-type="datepicker"][data-key="${u.key}"]`);if(E&&(E.getAttribute("data-value")||"").trim().length>0){s=!0;break}}else if(u.type==="number-input"&&u.key){const E=t.current.querySelector(`[data-type="number-input"][data-key="${u.key}"]`);if(E&&(E.value||"").trim().length>0){s=!0;break}}if(!s){S=!1;break}}let N=!0;for(const e of j)if(e.type==="upload"&&e.key){if(e.minCount&&e.minCount>0){let n=0;const s=t.current.querySelectorAll(`[data-type="upload"][data-batch-key="${e.key}"]`);if(s.length===0){N=!1;break}for(let u=0;u<s.length;u++){const H=s[u].dataset.key;H&&i[H]!=null&&(n+=1)}if(n<e.minCount){N=!1;break}}else if(i[e.key]===null||i[e.key]===void 0){N=!1;break}}else if(e.type==="variable"&&e.key)if(e.isMultiVariable){const n=t.current.querySelectorAll(`[data-type="variable"][data-multi-key="${e.key}"]`);let s=0;for(const E of Array.from(n)){if(E.classList.contains("show-placeholder"))continue;E.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(s+=1)}const u=e.minCount&&e.minCount>0?e.minCount:1;if(s<u){N=!1;break}}else{const n=t.current.querySelector(`[data-type="variable"][data-key="${e.key}"]`);if(!n){N=!1;break}if(n.classList.contains("show-placeholder")){N=!1;break}if(n.innerText.replace(/[\u200B\n]/g,"").trim().length===0){N=!1;break}}else if(e.type==="select"&&e.key){const n=t.current.querySelector(`[data-type="select"][data-key="${e.key}"]`);if(!n||(n.getAttribute("data-value")||"").trim().length===0){N=!1;break}}else if(e.type==="textarea"&&e.key){const n=t.current.querySelector(`[data-type="textarea"][data-key="${e.key}"]`);if(!n||(n.value||"").trim().length===0){N=!1;break}}else if(e.type==="richtext"&&e.key){const n=typeof e.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"]`:`[data-type="richtext"][data-key="${e.key}"]`,s=t.current.querySelector(n);if(!s||v(s).length===0){N=!1;break}}else if(e.type==="datepicker"&&e.key){const n=t.current.querySelector(`[data-type="datepicker"][data-key="${e.key}"]`);if(!n||(n.getAttribute("data-value")||"").trim().length===0){N=!1;break}}else if(e.type==="number-input"&&e.key){const n=t.current.querySelector(`[data-type="number-input"][data-key="${e.key}"]`);if(!n||(n.value||"").trim().length===0){N=!1;break}}d(S&&N)}function Ze(t,f){if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(d=>{const v=d.innerText;v.replace(/\u200B/g,"").trim().length===0?(v!==""&&(d.innerText=""),d.classList.add("show-placeholder")):d.classList.remove("show-placeholder")})}const Qt=({host:t,onChange:f})=>{const i=t.dataset.key,d=t.dataset.placeholder,v=t.dataset.options?decodeURIComponent(t.dataset.options):"[]",D=t.dataset.required==="true",P=t.dataset.value||"",B=c.useMemo(()=>{try{return JSON.parse(v)}catch{return[]}},[v]),[M,L]=c.useState(P||void 0),[q,j]=c.useState(64),S=c.useRef(null),N=s=>{L(s),t.setAttribute("data-value",s),f(i,s)};c.useEffect(()=>{L(P||void 0)},[P]);const e=c.useCallback(()=>{if(M!=null&&M!==""){const s=B.find(u=>String(u.value)===String(M));return s?typeof s.label=="string"?s.label:String(s.label??M):String(M)}return d||"请选择"},[M,B,d]),n=c.useCallback(()=>{const s=S.current;if(!s)return;const u=s.querySelector(".ant-select-selection-item"),E=s.querySelector(".ant-select-selection-placeholder"),H=u||E,F=(H?.textContent||"").trim()||e(),T=s.querySelector(".ant-select-selector"),ne=H||T||s,K=window.getComputedStyle(ne),R=H?K.fontSize:"16px",G=K.fontFamily||"sans-serif",l=K.fontWeight||"400",U=`${K.fontStyle||"normal"} ${l} ${R} ${G}`,y=document.createElement("canvas").getContext("2d"),b=y?Math.ceil((y.font=U,y.measureText(F).width||0)):0;let x=0;if(T){const ee=window.getComputedStyle(T);x=(Number.parseFloat(ee.paddingLeft)||0)+(Number.parseFloat(ee.paddingRight)||0)}const I=s.querySelector(".ant-select-arrow"),A=I?Math.ceil(I.getBoundingClientRect().width):12,X=s.querySelector(".ant-select-clear");let J=0;if(X){const ee=window.getComputedStyle(X);ee.display!=="none"&&ee.visibility!=="hidden"&&(J=Math.ceil(X.getBoundingClientRect().width))}const Z=Math.max(36,b+x+A+J+6);j(ee=>ee===Z?ee:Z)},[e]);return c.useLayoutEffect(()=>{const s=window.requestAnimationFrame(()=>{n()}),u=window.setTimeout(()=>{n()},60);return()=>{window.cancelAnimationFrame(s),window.clearTimeout(u)}},[n]),c.useEffect(()=>{if(!("fonts"in document))return;let s=!1;const u=document.fonts;if(u?.ready)return u.ready.then(()=>{s||n()}),()=>{s=!0}},[n]),Xe.createPortal(w.jsx("div",{className:"rte-select-wrapper",contentEditable:!1,ref:S,style:{display:"inline-block",width:q},children:w.jsx(oe.Select,{value:M,onChange:N,placeholder:d||"请选择",style:{width:"100%"},options:B,allowClear:!D,size:"small",dropdownClassName:"rte-select-dropdown",getPopupContainer:()=>document.body,dropdownMatchSelectWidth:!1,suffixIcon:w.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})}),t)},Zt=t=>{const[f,i]=c.useState([]);return c.useEffect(()=>{const d=t.current;if(!d)return;const v=()=>{const P=d.querySelectorAll(".rte-select-host"),B=[];P.forEach(M=>{const L=M.getAttribute("data-key");L&&B.push(w.jsx(Qt,{host:M,onChange:()=>{if(t.current){const q=new Event("input",{bubbles:!0});t.current.dispatchEvent(q)}}},`select-${L}`))}),i(B)};v();const D=new MutationObserver(P=>{let B=!1;for(const M of P)if(M.type==="childList"){let L=!1;if(M.addedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-select-host")||j.querySelector?.(".rte-select-host"))&&(L=!0)}}),M.removedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-select-host")||j.querySelector?.(".rte-select-host"))&&(L=!0)}}),L){B=!0;break}}B&&v()});return D.observe(d,{childList:!0,subtree:!0}),()=>D.disconnect()},[t]),f},ve=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");function Rt(t,f,i,d,v,D={},P,B){if(!t.current)return;const M=/[;;,,。.!!??::、]/,L=e=>{const n=(e??"").trim();return n.length===1&&M.test(n)},q=e=>{const n=e??"",s=n.match(new RegExp(`^\\s*(${M.source})`));if(!s)return null;const u=s[1],E=n.replace(new RegExp(`^\\s*${M.source}`),"");return{punct:u,rest:E}},j=e=>`<span data-type="text" class="rte-inline-punct" contenteditable="false">${e}</span>`,S=[];let N=0;for(;N<f.length;){const e=f[N],n=N+1<f.length?f[N+1]:null;let s=!1;if(e.type==="text"&&(e.text?.includes("icon-bitian")||e.className==="rte-text-required")&&n){const K=n.type==="upload"&&n.exclusionGroup==="fileInput"&&e.exclusionGroup==="fileInput"&&e.exclusionGroup===n.exclusionGroup,R=n.type==="variable"&&n.exclusionGroup==="textInput"&&e.exclusionGroup==="textInput"&&e.exclusionGroup===n.exclusionGroup;if(K){const G=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",l=`<span ${G} class="exclusion-wrapper required-upload-group">`,_="</span>";let U="";e.className?U=`<span class="${e.className}">${e.text??""}</span>`:U=e.text??"";const V=n,y=i[V.key]!==null&&i[V.key]!==void 0,b=y?i[V.key]:null,x=y?i[V.key]?.name:V.text,I=y?"":"hidden",A=V.tooltip&&!y?"":"hidden",X=y?"has-file":"",J=y&&x?` data-file-name="${x.replace(/"/g,""")}"`:"";let Z="";y&&b?b.type?.startsWith("image/")?Z=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(b)}" alt="preview" />`:Z="<i class='iconfont icon-exlwenjian'></i>":Z="<i class='iconfont icon-shangchuan1'></i>";const ee=(V.text||"").trim(),ie=y&&ee.length>=12?`<span ${G} contenteditable="false" class="exclusion-wrapper upload-hint">${ee}</span>`:"",ue=`<span contenteditable="false" data-type="upload" data-key="${V.key}" class="upload-chip"><span class="upload-inner-wrapper ${X}"><span class="upload-icon">${Z}</span><span class="upload-label"${J}>${x||V.text}</span>${V.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${V.key}" data-tooltip="${V.tooltip}"></i>`:""}<span class="file-remove-btn ${I}" title="移除文件">×</span></span></span>`;S.push(l+U+ue+_+ie),N+=2;continue}if(R){const l=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,_="</span>";let U="";e.className?U=`<span class="${e.className}">${e.text??""}</span>`:U=e.text??"";const V=n,b=(V.key?v[V.key]:void 0)||V.text||"",x=!b,I=x?"":b,A=x?"show-placeholder":"",X=V.exclusionGroup?` data-group="${V.exclusionGroup}"`:"",J=V.tooltip?` data-tooltip="${V.tooltip.replace(/"/g,""")}" data-variable-key="${V.key||""}"`:"",Z=V.tooltip&&x?"":"hidden",ee=`<span contenteditable="true" data-type="variable" data-key="${V.key}" data-placeholder="${V.placeholder||""}"${X}${J} class="variable-chip ${A}">${I}${V.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${Z}" data-variable-key="${V.key}" data-tooltip="${V.tooltip.replace(/"/g,""")}" ></i>`:""}</span>`;S.push(l+U+ee+_),N+=2;continue}}const E=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"",H=e.exclusionGroup?`<span ${E} class="exclusion-wrapper">`:"",F=e.exclusionGroup?"</span>":"";let T="";if(e.type==="tag"){const R=d||P==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',G=d?' data-locked="true"':"",l=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-tag-key="${e.key||""}"`:"";T=`<span contenteditable="false" class="tag-node group"${G}${l}><span class="tag-label">${e.text}</span>${R}</span>`}else if(e.type==="text"){const K=d?' data-locked="true" contenteditable="false"':' contenteditable="false"',G=(e.text??"").replace(/\n/g,"<br/>");e.className?T=`<span data-type="text" class="${e.className}"${K}>${G}</span>`:T=d?`<span data-type="text"${K}>${G}</span>`:`<span data-type="text" contenteditable="false">${G}</span>`}else if(e.type==="variable"&&e.key){const R=v[e.key]||e.text||"",G=!R,l=G?"":R,_=G?"show-placeholder":"",U=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",V=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-variable-key="${e.key||""}"`:"",y=e.tooltip&&G?"":"hidden",b=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder||""}"${U}${V} class="variable-chip ${_}">${l}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${y}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,""")}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${b}</span>`:T=b}else if(e.type==="report-url"&&e.key){const K=`${e.key}__url`,G=Object.prototype.hasOwnProperty.call(v,K)?v[K]:void 0,l=v[e.key],_=G??l??e.text??"",U=!_,V=U?"":_,y=U?"show-placeholder":"",b=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",x=e.tooltip?` data-tooltip="${ve(e.tooltip)}" data-variable-key="${e.key||""}"`:"",I=e.tooltip&&U?"":"hidden",A=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="report-url" data-placeholder="${ve(e.placeholder||"")}"${b}${x} class="variable-chip rte-report-url ${y}">${V}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${I}" data-variable-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${A}</span>`:T=A}else if(e.type==="markdown"&&e.key){const K=e.sourceTextKey||`${e.key}__sourceText`,G=Object.prototype.hasOwnProperty.call(v,K)?v[K]:void 0,l=v[e.key],_=G??l??e.text??"",U=!_,V=U?"":_,y=U?"show-placeholder":"",b=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",x=e.sourceTextKey?` data-source-text-key="${ve(e.sourceTextKey)}"`:"",I=e.tooltip?` data-tooltip="${ve(e.tooltip)}" data-variable-key="${e.key||""}"`:"",A=e.tooltip&&U?"":"hidden",X=`<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="markdown" data-placeholder="${ve(e.placeholder||"")}"${b}${x}${I} class="variable-chip rte-markdown-input ${y}">${V}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${A}" data-variable-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}</span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${X}</span>`:T=X}else if(e.type==="upload"&&e.key){const K=!!n&&n.type==="text"&&!n.className&&!n.exclusionGroup&&L(n.text),R=K?(n.text??"").trim():"",G=R?j(R):"";if(K&&(s=!0),typeof e.maxCount=="number"&&typeof e.minCount=="number"&&e.maxCount>1){const _=e.tooltip?` data-tooltip="${ve(e.tooltip)}"`:"",U=e.minCount||1,V=e.maxCount||3;let y=0;for(let I=0;I<V;I++){const A=`${e.key}-${I}`;i[A]!=null&&(y+=1)}const b=Math.min(V,Math.max(U,y+(y<V?1:0)));let x="";for(let I=0;I<b;I++){const A=`${e.key}-${I}`,X=i[A]!==null&&i[A]!==void 0,J=X?i[A]:null,Z=X?i[A]?.name:e.text,ee=X?"":"hidden",se=e.tooltip&&!X?"":"hidden",ie=X?"has-file":"",ue=X&&Z?` data-file-name="${Z.replace(/"/g,""")}"`:"";let he="";X&&J?J.type?.startsWith("image/")?he=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(J)}" alt="preview" />`:he="<i class='iconfont icon-exlwenjian'></i>":he="<i class='iconfont icon-shangchuan1'></i>";const re=` data-batch-key="${e.key}"`,me=` data-batch-index="${I}"`,ge=`<span contenteditable="false" data-type="upload" data-key="${A}"${re}${me}${_} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${ie}"><span class="upload-icon">${he}</span><span class="upload-label"${ue}>${Z||e.text}</span>${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${se}" data-upload-key="${A}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}<span class="file-remove-btn ${ee}" title="移除文件">×</span></span></span>`;x+=ge}e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-required-upload-batch"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span><span class="rte-upload-batch-chips">${x}${G}</span></span>`:T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-upload-batch-chips">${x}${G}</span>`}else{const _=e.tooltip?` data-tooltip="${ve(e.tooltip)}"`:"",U=i[e.key]!==null&&i[e.key]!==void 0,V=U?i[e.key]:null,y=U?i[e.key]?.name:e.text,b=U?"":"hidden",x=e.tooltip&&!U?"":"hidden",I=U?"has-file":"",A=U&&y?` data-file-name="${y.replace(/"/g,""")}"`:"";let X="";U&&V?V.type?.startsWith("image/")?X=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(V)}" alt="preview" />`:X="<i class='iconfont icon-exlwenjian'></i>":X="<i class='iconfont icon-shangchuan1'></i>";const J=(e.text||"").trim(),ee=U&&e.showHint===!0&&J.length>=12?`<span ${E} contenteditable="false" class="exclusion-wrapper upload-hint">${J}</span>`:"",se=`<span contenteditable="false" data-type="upload" data-key="${e.key}"${_} class="upload-chip"><span class="upload-inner-wrapper ${I}"><span class="upload-icon">${X}</span><span class="upload-label"${A}>${y||e.text}</span>${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${ve(e.tooltip)}" ></i>`:""}<span class="file-remove-btn ${b}" title="移除文件">×</span></span></span>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${se}${G}</span>${ee}`:T=se+G+ee}}else if(e.type==="select"&&e.key){const K=v[e.key]||e.defaultValue||"",R=encodeURIComponent(JSON.stringify(e.options||[])),G=e.placeholder?` data-placeholder="${e.placeholder}"`:"",l=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",_=e.required?' data-required="true"':"",U=`<div data-type="select" data-key="${e.key}" data-value="${K}" data-options="${R}"${G}${l}${_} class="rte-select-host"></div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${U}</span>`:T=U}else if(e.type==="textarea"&&e.key){const K=v[e.key]||"",R=typeof e.maxHeight=="number"?e.maxHeight:252,G=e.placeholder?` placeholder="${e.placeholder}"`:"",l=`<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" style="max-height:${R}px;"${G}>${K}</textarea>`,_=`<div class="rte-textarea-wrapper" data-key="${e.key}">${l}</div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>`:T=_}else if(e.type==="richtext"&&e.key){const K=v[e.key]||e.text||"",R=typeof e.minHeight=="number"?e.minHeight:40,G=typeof e.maxHeight=="number"?e.maxHeight:160,l=Math.max(G,R),_=e.placeholder?` data-placeholder="${e.placeholder}"`:"",U=e.expandable!==!1,V=K,y=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${_} style="min-height:${R}px;max-height:${l}px;overflow:auto;">${V}</div>`,b=U?`<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>`:"",x=`<div class="rte-richtext-wrapper${U?" rte-richtext-toggleable":""}" data-key="${e.key}">${y}${b}</div>`,I=`<div class="rte-richtext-container" data-key="${e.key}">${x}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${I}</div>`:T=I}else if(e.type==="report-module"&&e.key){const K=typeof e.moduleIndex=="number"?e.moduleIndex:0,R=`${e.key}__module_${K}`,l=Object.prototype.hasOwnProperty.call(v,R)?v[R]:e.text||"",_=typeof e.minHeight=="number"?e.minHeight:80,U=typeof e.maxHeight=="number"?e.maxHeight:240,V=Math.max(U,_),y=e.placeholder?` data-placeholder="${ve(e.placeholder)}"`:"",b=l,x=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="report-module" data-module-index="${K}" class="rte-richtext rte-report-module"${y} style="min-height:${_}px;max-height:${V}px;overflow:auto;">${b}</div>`,I=`<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${e.key}">${x}</div>`,A=`<div class="rte-richtext-container rte-report-module-container" data-key="${e.key}">${I}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${A}</div>`:T=A}else if(e.type==="markdown-module"&&e.key){const K=typeof e.moduleIndex=="number"?e.moduleIndex:0,R=`${e.key}__module_${K}`,l=Object.prototype.hasOwnProperty.call(v,R)?v[R]:e.text||"",_=typeof e.minHeight=="number"?e.minHeight:80,U=typeof e.maxHeight=="number"?e.maxHeight:240,V=Math.max(U,_),y=e.placeholder?` data-placeholder="${ve(e.placeholder)}"`:"",b=l,x=`<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="markdown-module" data-module-index="${K}" class="rte-richtext rte-markdown-module"${y} style="min-height:${_}px;max-height:${V}px;overflow:auto;">${b}</div>`,I=`<div class="rte-richtext-wrapper rte-markdown-module-wrapper" data-key="${e.key}">${x}</div>`,A=`<div class="rte-richtext-container rte-markdown-module-container" data-key="${e.key}">${I}</div>`;e.required?T=`<div ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${A}</div>`:T=A}else if(e.type==="datepicker"&&e.key){const K=v[e.key]||"",R=e.placeholder?` data-placeholder="${e.placeholder}"`:"",G=e.limitRange?` data-limit-range="${e.limitRange}"`:"",l=e.disableFuture?' data-disable-future="true"':"",_=`<div data-type="datepicker" data-key="${e.key}" data-value="${K}" class="rte-datepicker-host"${R}${G}${l}></div>`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>`:T=_}else if(e.type==="number-input"&&e.key){const K=v[e.key]||(typeof e.defaultNumber=="number"?String(e.defaultNumber):""),R=typeof e.min=="number"?` min="${e.min}"`:"",G=typeof e.max=="number"?` max="${e.max}"`:"",l=e.placeholder?` placeholder="${e.placeholder}"`:"",_=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",U=' step="1"',V=K||e.placeholder||"";let y=0;for(let I=0;I<V.length;I++){const A=V.charCodeAt(I);A>19968||A>=65280&&A<=65519?y+=16:y+=8}const b=Math.max(44,Math.min(600,y+28)),x=`<input type="number" data-type="number-input" data-key="${e.key}" class="rte-number-input" value="${K}" style="width: ${b}px;"${R}${G}${U}${l}${_} />`;e.required?T=`<span ${e.exclusionGroup?`data-group="${e.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${x}</span>`:T=x}else if(e.type==="multi-variable"&&e.key){const K=e.maxCount||9,R=D[e.key]||1,G=Math.min(R,K);if(e.required){const l=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,_=e.exclusionGroup?`data-group="${e.exclusionGroup}"`:"";let U="";for(let V=0;V<G;V++){const y=`${e.key}_${V}`,b=v[y]||"",x=!b,I=x?"":b,A=x?"show-placeholder":"",X=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-variable-key="${e.key||""}"`:"",J=e.tooltip&&x?"":"hidden",Z=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",ee=`<span contenteditable="true" data-type="variable" data-key="${y}" data-multi-key="${e.key}" data-index="${V}" data-placeholder="${e.placeholder||""}"${Z}${X} class="variable-chip ${A}">${I}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${J}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,""")}" ></i>`:""}</span>`;V===0?U+=`<span ${_} class="exclusion-wrapper required-upload-group required-multi-first">${l}${ee}</span>`:U+=ee}T=U}else{let l="";for(let _=0;_<G;_++){const U=`${e.key}_${_}`,V=v[U]||"",y=!V,b=y?"":V,x=y?"show-placeholder":"",I=e.tooltip?` data-tooltip="${e.tooltip.replace(/"/g,""")}" data-variable-key="${e.key||""}"`:"",A=e.tooltip&&y?"":"hidden",X=e.exclusionGroup?` data-group="${e.exclusionGroup}"`:"",J=`<span contenteditable="true" data-type="variable" data-key="${U}" data-multi-key="${e.key}" data-index="${_}" data-placeholder="${e.placeholder||""}"${X}${I} class="variable-chip ${x}">${b}${e.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${A}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g,""")}" ></i>`:""}</span>`;l+=J}T=l}}const ne=H+T+F;if(e.type==="text"&&!e.className&&!e.exclusionGroup){if(L(e.text)&&S.length>0){const R=S[S.length-1],G=(e.text??"").trim();S[S.length-1]=`<span class="rte-inline-group">${R}${j(G)}</span>`,N++;continue}const K=q(e.text);if(K&&S.length>0){const R=S[S.length-1];S[S.length-1]=`<span class="rte-inline-group">${R}${j(K.punct)}</span>`;const G=K.rest;if(G){const l=G.replace(/\n/g,"<br/>");S.push(`<span data-type="text" contenteditable="false">${l}</span>`)}N++;continue}}S.push(ne),N+=s?2:1}t.current&&(t.current.innerHTML=S.join(""),setTimeout(()=>{if(!t.current)return;t.current.querySelectorAll('[data-type="variable"]').forEach(n=>{const s=n.innerText.replace(/\n/g,"");s.replace(/\u200B/g,"")?n.classList.remove("show-placeholder"):(s!==""&&(n.innerText=""),n.classList.add("show-placeholder"))})},0))}function en(t,f,i,d,v={},D,P,B,M){const L=c.useCallback(()=>{if(!t.current)return;if(f.length===0){t.current.innerHTML="";return}let q={};const S=t.current.__tempVariableValues;if(S?(q=S,setTimeout(()=>{if(t.current){const N=t.current;N.__tempVariableValues===S&&delete N.__tempVariableValues}},100)):(t.current.querySelectorAll('[data-type="variable"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.innerText.replace(/[\u200B\n]/g,"").trim();T&&(H.getAttribute("data-node-type")==="report-url"?q[`${F}__url`]=T:q[F]=T)}}),t.current.querySelectorAll('[data-type="select"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.getAttribute("data-value")||"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="textarea"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.value.replace(/[\u200B]/g,"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="richtext"]').forEach(H=>{const F=H.dataset.key;if(F){const T=H.getAttribute("data-node-type")||"",ne=T==="report-module"?(H.innerHTML||"").replace(/[\u200B]/g,"").trim():(H.textContent||"").replace(/[\u200B]/g,"").trim();if(T==="report-module"){const K=Number.parseInt(H.getAttribute("data-module-index")||"0",10);q[`${F}__module_${Number.isFinite(K)?K:0}`]=ne}else ne&&(q[F]=ne)}}),t.current.querySelectorAll('[data-type="datepicker"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.getAttribute("data-value")||"").trim();T&&(q[F]=T)}}),t.current.querySelectorAll('[data-type="number-input"]').forEach(H=>{const F=H.dataset.key;if(F){const T=(H.value||"").trim();T&&(q[F]=T)}})),Rt(t,f,i,d,q,v,B),D?.current){const{key:N,offset:e}=D.current;setTimeout(()=>{if(!t.current)return;const n=t.current.querySelector(`[data-type="variable"][data-key="${N}"]`);if(n){try{const s=document.createRange(),u=document.createTreeWalker(n,NodeFilter.SHOW_TEXT,null);let E=0,H=null,F=0;for(;u.nextNode();){const T=u.currentNode,ne=T.textContent?.length||0;if(E+ne>=e){H=T,F=e-E;break}E+=ne}if(H){s.setStart(H,Math.min(F,H.textContent?.length||0)),s.collapse(!0);const T=window.getSelection();T&&(T.removeAllRanges(),T.addRange(s),n.focus())}else{s.selectNodeContents(n),s.collapse(!1);const T=window.getSelection();T&&(T.removeAllRanges(),T.addRange(s),n.focus())}}catch{const s=document.createRange();s.selectNodeContents(n),s.collapse(!1);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(s),n.focus())}D.current=null}},0)}},[f,i,d,t,v,D,P,B,M]);c.useEffect(()=>{L()},[L])}function tn(t,f,i,d){c.useEffect(()=>{const v=t.current;if(!v)return;const D=M=>M.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(M.name||""),P=M=>{const L=M.target?.closest(".upload-info-icon");if(L&&L.classList.contains("upload-info-icon")){const j=L.dataset.uploadKey;if(j){const S=L.closest('[data-type="upload"]');d(S?{key:j,anchorEl:S,type:"upload"}:{key:j,anchorEl:L,type:"upload"})}return}const q=M.target?.closest('[data-type="upload"]');if(q){const j=q.dataset.key;if(j){const S=i[j];S&&D(S)&&d({key:j,anchorEl:q,type:"upload-preview"})}}},B=M=>{const L=M.target?.closest(".upload-info-icon"),q=M.relatedTarget;if(L&&L.classList.contains("upload-info-icon")){const S=L.closest('[data-type="upload"]');if(q&&S&&S.contains(q))return;if(!q||!v.contains(q))d(null);else{const N=q.closest('[data-type="upload"]');(!N||N!==S)&&d(null)}return}const j=M.target?.closest('[data-type="upload"]');if(j){const S=q;if(S&&j.contains(S))return;d(null)}};return v.addEventListener("mouseover",P,!0),v.addEventListener("mouseout",B,!0),()=>{v.removeEventListener("mouseover",P,!0),v.removeEventListener("mouseout",B,!0)}},[f,i,t,d])}function nn(t,f,i,d){c.useEffect(()=>{if(!t.current)return;const v=M=>{if(d==="hideTagClose")return;const L=M.currentTarget,q=L.dataset.tooltip,j=L.dataset.tagKey||"";q&&i({key:j,anchorEl:L,type:"tag"})},D=()=>{i(null)};let P;const B=()=>{if(!t.current)return;t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(L=>{L.addEventListener("mouseenter",v),L.addEventListener("mouseleave",D)})};return P=requestAnimationFrame(()=>{P=requestAnimationFrame(B)}),()=>{cancelAnimationFrame(P),t.current&&t.current.querySelectorAll(".tag-node[data-tooltip]").forEach(L=>{L.removeEventListener("mouseenter",v),L.removeEventListener("mouseleave",D)})}},[f,t,i,d])}function rn(t,f,i){c.useEffect(()=>{const d=t.current;if(!d)return;const v=P=>{const B=P.target?.closest(".variable-info-icon");if(B&&B.classList.contains("variable-info-icon")){const L=B.dataset.variableKey;L&&i({key:L,anchorEl:B,type:"variable"});return}const M=P.target?.closest('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(M){const L=M.dataset.key;L&&i({key:L,anchorEl:M,type:"variable"})}},D=P=>{const B=P.target,M=P.relatedTarget,L=B?.closest?.(".variable-info-icon"),q=B?.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(L||q){if(!M||!d.contains(M)){i(null);return}const j=!!M.closest?.(".variable-info-icon"),S=!!M.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');!j&&!S&&i(null)}};return d.addEventListener("mouseover",v,!0),d.addEventListener("mouseout",D,!0),()=>{d.removeEventListener("mouseover",v,!0),d.removeEventListener("mouseout",D,!0)}},[f,t,i])}function an(t,f,i,d){c.useEffect(()=>{if(!t.current)return;const v=L=>L.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(L.name||""),D=L=>{const q=L.currentTarget,j=q.dataset.fileName,S=q.closest('[data-type="upload"]'),N=S?.dataset.key||"",e=N?i[N]:null;if(e&&v(e)){d({key:N,anchorEl:S||q,type:"upload-preview"});return}j&&d({key:N,anchorEl:S||q,type:"upload-label"})},P=()=>{d(null)};let B;const M=()=>{if(!t.current)return;t.current.querySelectorAll(".upload-label[data-file-name]").forEach(q=>{q.addEventListener("mouseenter",D),q.addEventListener("mouseleave",P)})};return B=requestAnimationFrame(()=>{B=requestAnimationFrame(M)}),()=>{cancelAnimationFrame(B),t.current&&t.current.querySelectorAll(".upload-label[data-file-name]").forEach(q=>{q.removeEventListener("mouseenter",D),q.removeEventListener("mouseleave",P)})}},[f,i,t,d])}function on(t,f,i,d){c.useEffect(()=>{const v=setTimeout(()=>{Je(t,f,i),Qe(t,f,i,d)},0);return()=>clearTimeout(v)},[i,f,t,d])}function sn(t,f){const i=c.useRef(0),d=c.useRef(0);c.useEffect(()=>{if(!t.current)return;let v=!1,D=0;const P=E=>E instanceof HTMLElement?!!(E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host")||E.closest(".ant-picker")||E.closest(".ant-picker-dropdown")):!1,B=E=>E instanceof HTMLElement?!!(E.closest(".rte-select-wrapper")||E.closest(".rte-select-host")||E.closest(".ant-select")||E.closest(".ant-select-dropdown")):!1,M=E=>{v=!0,P(E.target)&&(i.current=Date.now(),console.log("[SelectionCtrl] mousedown on datepicker target")),B(E.target)&&(d.current=Date.now(),console.log("[SelectionCtrl] mousedown on select target"))},L=()=>{v=!1,D=Date.now()};let q=!1,j=0;const S=()=>{q=!0},N=()=>{q=!1,j=Date.now()},e=()=>{j=Date.now()},n=E=>{P(E.target)&&(i.current=Date.now(),console.log("[SelectionCtrl] focusin datepicker target")),B(E.target)&&(d.current=Date.now(),console.log("[SelectionCtrl] focusin select target"))},s=()=>{if(Date.now()-i.current<800||Date.now()-d.current<800){console.log("[SelectionCtrl] skip selectionchange due to recent picker/select interaction");return}const E=document.activeElement;if(E&&(E.closest(".rte-datepicker-wrapper")||E.closest(".rte-datepicker-host")||E.closest(".ant-picker-dropdown")||E.tagName==="INPUT"&&E.closest(".ant-picker")||E.closest(".rte-select-wrapper")||E.closest(".rte-select-host")||E.closest(".ant-select")||E.closest(".ant-select-dropdown"))){console.log("[SelectionCtrl] activeElement is picker/select; skip");return}if(!t.current)return;const H=window.getSelection();if(!H||H.rangeCount===0||f.current||v||q||Date.now()-j<500)return;const F=H.getRangeAt(0);if(!F.collapsed)return t.current.contains(F.commonAncestorContainer),void 0;const T=H.anchorNode;if(!T||!t.current.contains(T))return;let ne=!1,K=!1;if(T.nodeType===Node.ELEMENT_NODE){const G=T;(G.closest('[data-type="datepicker"]')||G.closest(".rte-datepicker-wrapper")||G.closest(".rte-datepicker-host"))&&(ne=!0),(G.closest('[data-type="select"]')||G.closest(".rte-select-wrapper")||G.closest(".rte-select-host"))&&(K=!0)}else if(T.parentElement){const G=T.parentElement;(G.closest('[data-type="datepicker"]')||G.closest(".rte-datepicker-wrapper")||G.closest(".rte-datepicker-host"))&&(ne=!0),(G.closest('[data-type="select"]')||G.closest(".rte-select-wrapper")||G.closest(".rte-select-host"))&&(K=!0)}if(ne||K)return;let R=null;if(T.nodeType===Node.ELEMENT_NODE?R=T.closest('[data-type="variable"]'):T.nodeType===Node.TEXT_NODE&&T.parentElement&&(R=T.parentElement.closest('[data-type="variable"]')),!R){if(Date.now()-D>500)return;const G=t.current.querySelectorAll('[data-type="variable"]');if(G.length>0){let l=null;for(const _ of Array.from(G))if(_.style.display!=="none"){l=_;break}if(!l&&G.length>0&&(l=G[0]),l){const _=document.createRange();_.selectNodeContents(l),_.collapse(!1),H.removeAllRanges(),H.addRange(_),l.focus()}else H.removeAllRanges()}else H.removeAllRanges()}},u=t.current;return u&&(u.addEventListener("compositionstart",S),u.addEventListener("compositionend",N),u.addEventListener("input",e)),document.addEventListener("mousedown",M),document.addEventListener("mouseup",L),document.addEventListener("focusin",n),document.addEventListener("selectionchange",s),()=>{const E=t.current;E&&(E.removeEventListener("compositionstart",S),E.removeEventListener("compositionend",N),E.removeEventListener("input",e)),document.removeEventListener("mousedown",M),document.removeEventListener("mouseup",L),document.removeEventListener("focusin",n),document.removeEventListener("selectionchange",s)}},[t,f])}function ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fe={exports:{}},cn=Fe.exports,kt;function $t(){return kt||(kt=1,function(t,f){(function(i,d){t.exports=d()})(cn,function(){var i=1e3,d=6e4,v=36e5,D="millisecond",P="second",B="minute",M="hour",L="day",q="week",j="month",S="quarter",N="year",e="date",n="Invalid Date",s=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,u=/\[([^\]]+)]|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,E={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(y){var b=["th","st","nd","rd"],x=y%100;return"["+y+(b[(x-20)%10]||b[x]||b[0])+"]"}},H=function(y,b,x){var I=String(y);return!I||I.length>=b?y:""+Array(b+1-I.length).join(x)+y},F={s:H,z:function(y){var b=-y.utcOffset(),x=Math.abs(b),I=Math.floor(x/60),A=x%60;return(b<=0?"+":"-")+H(I,2,"0")+":"+H(A,2,"0")},m:function y(b,x){if(b.date()<x.date())return-y(x,b);var I=12*(x.year()-b.year())+(x.month()-b.month()),A=b.clone().add(I,j),X=x-A<0,J=b.clone().add(I+(X?-1:1),j);return+(-(I+(x-A)/(X?A-J:J-A))||0)},a:function(y){return y<0?Math.ceil(y)||0:Math.floor(y)},p:function(y){return{M:j,y:N,w:q,d:L,D:e,h:M,m:B,s:P,ms:D,Q:S}[y]||String(y||"").toLowerCase().replace(/s$/,"")},u:function(y){return y===void 0}},T="en",ne={};ne[T]=E;var K="$isDayjsObject",R=function(y){return y instanceof U||!(!y||!y[K])},G=function y(b,x,I){var A;if(!b)return T;if(typeof b=="string"){var X=b.toLowerCase();ne[X]&&(A=X),x&&(ne[X]=x,A=X);var J=b.split("-");if(!A&&J.length>1)return y(J[0])}else{var Z=b.name;ne[Z]=b,A=Z}return!I&&A&&(T=A),A||!I&&T},l=function(y,b){if(R(y))return y.clone();var x=typeof b=="object"?b:{};return x.date=y,x.args=arguments,new U(x)},_=F;_.l=G,_.i=R,_.w=function(y,b){return l(y,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var U=function(){function y(x){this.$L=G(x.locale,null,!0),this.parse(x),this.$x=this.$x||x.x||{},this[K]=!0}var b=y.prototype;return b.parse=function(x){this.$d=function(I){var A=I.date,X=I.utc;if(A===null)return new Date(NaN);if(_.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var J=A.match(s);if(J){var Z=J[2]-1||0,ee=(J[7]||"0").substring(0,3);return X?new Date(Date.UTC(J[1],Z,J[3]||1,J[4]||0,J[5]||0,J[6]||0,ee)):new Date(J[1],Z,J[3]||1,J[4]||0,J[5]||0,J[6]||0,ee)}}return new Date(A)}(x),this.init()},b.init=function(){var x=this.$d;this.$y=x.getFullYear(),this.$M=x.getMonth(),this.$D=x.getDate(),this.$W=x.getDay(),this.$H=x.getHours(),this.$m=x.getMinutes(),this.$s=x.getSeconds(),this.$ms=x.getMilliseconds()},b.$utils=function(){return _},b.isValid=function(){return this.$d.toString()!==n},b.isSame=function(x,I){var A=l(x);return this.startOf(I)<=A&&A<=this.endOf(I)},b.isAfter=function(x,I){return l(x)<this.startOf(I)},b.isBefore=function(x,I){return this.endOf(I)<l(x)},b.$g=function(x,I,A){return _.u(x)?this[I]:this.set(A,x)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(x,I){var A=this,X=!!_.u(I)||I,J=_.p(x),Z=function(ge,be){var ke=_.w(A.$u?Date.UTC(A.$y,be,ge):new Date(A.$y,be,ge),A);return X?ke:ke.endOf(L)},ee=function(ge,be){return _.w(A.toDate()[ge].apply(A.toDate("s"),(X?[0,0,0,0]:[23,59,59,999]).slice(be)),A)},se=this.$W,ie=this.$M,ue=this.$D,he="set"+(this.$u?"UTC":"");switch(J){case N:return X?Z(1,0):Z(31,11);case j:return X?Z(1,ie):Z(0,ie+1);case q:var re=this.$locale().weekStart||0,me=(se<re?se+7:se)-re;return Z(X?ue-me:ue+(6-me),ie);case L:case e:return ee(he+"Hours",0);case M:return ee(he+"Minutes",1);case B:return ee(he+"Seconds",2);case P:return ee(he+"Milliseconds",3);default:return this.clone()}},b.endOf=function(x){return this.startOf(x,!1)},b.$set=function(x,I){var A,X=_.p(x),J="set"+(this.$u?"UTC":""),Z=(A={},A[L]=J+"Date",A[e]=J+"Date",A[j]=J+"Month",A[N]=J+"FullYear",A[M]=J+"Hours",A[B]=J+"Minutes",A[P]=J+"Seconds",A[D]=J+"Milliseconds",A)[X],ee=X===L?this.$D+(I-this.$W):I;if(X===j||X===N){var se=this.clone().set(e,1);se.$d[Z](ee),se.init(),this.$d=se.set(e,Math.min(this.$D,se.daysInMonth())).$d}else Z&&this.$d[Z](ee);return this.init(),this},b.set=function(x,I){return this.clone().$set(x,I)},b.get=function(x){return this[_.p(x)]()},b.add=function(x,I){var A,X=this;x=Number(x);var J=_.p(I),Z=function(ie){var ue=l(X);return _.w(ue.date(ue.date()+Math.round(ie*x)),X)};if(J===j)return this.set(j,this.$M+x);if(J===N)return this.set(N,this.$y+x);if(J===L)return Z(1);if(J===q)return Z(7);var ee=(A={},A[B]=d,A[M]=v,A[P]=i,A)[J]||1,se=this.$d.getTime()+x*ee;return _.w(se,this)},b.subtract=function(x,I){return this.add(-1*x,I)},b.format=function(x){var I=this,A=this.$locale();if(!this.isValid())return A.invalidDate||n;var X=x||"YYYY-MM-DDTHH:mm:ssZ",J=_.z(this),Z=this.$H,ee=this.$m,se=this.$M,ie=A.weekdays,ue=A.months,he=A.meridiem,re=function(be,ke,qe,Ie){return be&&(be[ke]||be(I,X))||qe[ke].slice(0,Ie)},me=function(be){return _.s(Z%12||12,be,"0")},ge=he||function(be,ke,qe){var Ie=be<12?"AM":"PM";return qe?Ie.toLowerCase():Ie};return X.replace(u,function(be,ke){return ke||function(qe){switch(qe){case"YY":return String(I.$y).slice(-2);case"YYYY":return _.s(I.$y,4,"0");case"M":return se+1;case"MM":return _.s(se+1,2,"0");case"MMM":return re(A.monthsShort,se,ue,3);case"MMMM":return re(ue,se);case"D":return I.$D;case"DD":return _.s(I.$D,2,"0");case"d":return String(I.$W);case"dd":return re(A.weekdaysMin,I.$W,ie,2);case"ddd":return re(A.weekdaysShort,I.$W,ie,3);case"dddd":return ie[I.$W];case"H":return String(Z);case"HH":return _.s(Z,2,"0");case"h":return me(1);case"hh":return me(2);case"a":return ge(Z,ee,!0);case"A":return ge(Z,ee,!1);case"m":return String(ee);case"mm":return _.s(ee,2,"0");case"s":return String(I.$s);case"ss":return _.s(I.$s,2,"0");case"SSS":return _.s(I.$ms,3,"0");case"Z":return J}return null}(be)||J.replace(":","")})},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(x,I,A){var X,J=this,Z=_.p(I),ee=l(x),se=(ee.utcOffset()-this.utcOffset())*d,ie=this-ee,ue=function(){return _.m(J,ee)};switch(Z){case N:X=ue()/12;break;case j:X=ue();break;case S:X=ue()/3;break;case q:X=(ie-se)/6048e5;break;case L:X=(ie-se)/864e5;break;case M:X=ie/v;break;case B:X=ie/d;break;case P:X=ie/i;break;default:X=ie}return A?X:_.a(X)},b.daysInMonth=function(){return this.endOf(j).$D},b.$locale=function(){return ne[this.$L]},b.locale=function(x,I){if(!x)return this.$L;var A=this.clone(),X=G(x,I,!0);return X&&(A.$L=X),A},b.clone=function(){return _.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},y}(),V=U.prototype;return l.prototype=V,[["$ms",D],["$s",P],["$m",B],["$H",M],["$W",L],["$M",j],["$y",N],["$D",e]].forEach(function(y){V[y[1]]=function(b){return this.$g(b,y[0],y[1])}}),l.extend=function(y,b){return y.$i||(y(b,U,l),y.$i=!0),l},l.locale=G,l.isDayjs=R,l.unix=function(y){return l(1e3*y)},l.en=ne[T],l.Ls=ne,l.p={},l})}(Fe)),Fe.exports}var un=$t();const Ge=ln(un);var ze={exports:{}},dn=ze.exports,Et;function pn(){return Et||(Et=1,function(t,f){(function(i,d){t.exports=d($t())})(dn,function(i){function d(P){return P&&typeof P=="object"&&"default"in P?P:{default:P}}var v=d(i),D={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(P,B){return B==="W"?P+"周":P+"日"},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(P,B){var M=100*P+B;return M<600?"凌晨":M<900?"早上":M<1100?"上午":M<1300?"中午":M<1800?"下午":"晚上"}};return v.default.locale(D,null,!0),D})}(ze)),ze.exports}pn();function Pe(t){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},Pe(t)}function fn(t,f){if(Pe(t)!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var d=i.call(t,f);if(Pe(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(t)}function mn(t){var f=fn(t,"string");return Pe(f)=="symbol"?f:f+""}function yn(t,f,i){return(f=mn(f))in t?Object.defineProperty(t,f,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[f]=i,t}function Ct(t,f){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);f&&(d=d.filter(function(v){return Object.getOwnPropertyDescriptor(t,v).enumerable})),i.push.apply(i,d)}return i}function St(t){for(var f=1;f<arguments.length;f++){var i=arguments[f]!=null?arguments[f]:{};f%2?Ct(Object(i),!0).forEach(function(d){yn(t,d,i[d])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ct(Object(i)).forEach(function(d){Object.defineProperty(t,d,Object.getOwnPropertyDescriptor(i,d))})}return t}var hn={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},gn=St(St({},hn),{},{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 bn={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Tt={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},gn),timePickerLocale:Object.assign({},bn)};Tt.lang.ok="确定",Ge.locale("zh-cn");const{RangePicker:xn}=oe.DatePicker,vn=({host:t,onChange:f})=>{const i=t.dataset.key,d=t.dataset.value,v=t.dataset.placeholder,D=t.dataset.limitRange?parseInt(t.dataset.limitRange,10):void 0,P=t.dataset.disableFuture==="true",[B,M]=c.useState(()=>{if(!d)return null;const n=d.split(",");return n.length===2&&n[0]&&n[1]?[Ge(n[0]),Ge(n[1])]:null}),[L,q]=c.useState(null),j=n=>n?P&&n.isAfter(Ge(),"day")?!0:!D||!L||!L[0]?!1:Math.abs(n.diff(L[0],"days"))>D:!1,S=n=>{console.log("[DatePicker] onCalendarChange",n?.map(s=>s?.format("YYYY-MM-DD")||null)),q(n)},N=n=>{if(console.log("[DatePicker] onChange",n?.map(s=>s?.format("YYYY-MM-DD")||null)),M(n),q(null),n&&n[0]&&n[1]){const s=`${n[0].format("YYYY-MM-DD")},${n[1].format("YYYY-MM-DD")}`;t.setAttribute("data-value",s),f(i,s)}else t.setAttribute("data-value",""),f(i,"")},e=n=>{console.log("[DatePicker] onOpenChange",n),q(n?B:null)};return Xe.createPortal(w.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:w.jsx(xn,{value:B,disabledDate:j,onCalendarChange:S,onChange:N,onOpenChange:e,placeholder:[v||"开始日期",v||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:Tt,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),t)},wn=t=>{const[f,i]=c.useState([]);return c.useEffect(()=>{const d=t.current;if(!d)return;const v=()=>{const P=d.querySelectorAll(".rte-datepicker-host"),B=[];P.forEach(M=>{const L=M.getAttribute("data-key");L&&B.push(w.jsx(vn,{host:M,onChange:()=>{if(t.current){const q=new Event("input",{bubbles:!0});t.current.dispatchEvent(q)}}},`datepicker-${L}`))}),i(B)};v();const D=new MutationObserver(P=>{let B=!1;for(const M of P)if(M.type==="childList"){let L=!1;if(M.addedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-datepicker-host")||j.querySelector?.(".rte-datepicker-host"))&&(L=!0)}}),M.removedNodes.forEach(q=>{if(q.nodeType===Node.ELEMENT_NODE){const j=q;(j.classList?.contains("rte-datepicker-host")||j.querySelector?.(".rte-datepicker-host"))&&(L=!0)}}),L){B=!0;break}}B&&v()});return D.observe(d,{childList:!0,subtree:!0}),()=>D.disconnect()},[t]),f},He=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),At=t=>`\`\`\`
|
|
3
|
-
|
|
1
|
+
(function(ve,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react/jsx-runtime"),require("react"),require("antd"),require("@ant-design/icons"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","antd","@ant-design/icons","react-dom"],K):(ve=typeof globalThis<"u"?globalThis:ve||self,K(ve.SealSeekBIComponents={},ve.React,ve.React,ve.antd,ve.AntdIcons,ve.ReactDOM))})(this,function(ve,K,P,ye,Lt,zr){"use strict";const Ca=({variant:e="primary",loading:t=!1,children:n,...r})=>{const i=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 K.jsx(ye.Button,{...r,type:i(e),loading:t,ghost:e==="ghost",children:n})};Ca.__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 Sa=({title:e,children:t,bordered:n=!0,hoverable:r=!1,size:i="default",...a})=>K.jsx(ye.Card,{...a,title:e,bordered:n,hoverable:r,size:i,children:t});Sa.__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 _a=({showDefaultFooter:e=!0,...t})=>{const n=t.footer!==void 0?t.footer:e?(r,{OkBtn:i,CancelBtn:a})=>K.jsxs(K.Fragment,{children:[K.jsx(i,{}),K.jsx(a,{})]}):null;return K.jsx(ye.Modal,{...t,footer:n})};_a.__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 Ia=({scrollX:e,showPagination:t=!0,defaultPageSize:n=10,...r})=>K.jsx(ye.Table,{...r,scroll:{x:e||"max-content",y:"50vh"},pagination:t?{hideOnSinglePage:!0,showSizeChanger:!0,showQuickJumper:!0,defaultPageSize:n,...r.pagination}:!1});Ia.__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 Tl=Lt.createFromIconfontCN({scriptUrl:["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]}),Na=({name:e,size:t,color:n,style:r,...i})=>{const a={fontSize:t,color:n,...r};return K.jsx(Tl,{...i,type:e,style:a})};Na.__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 ka=({loading:e,description:t="暂无数据",className:n,emptyChildren:r,loadingText:i,emptyImage:a})=>e?K.jsxs(ye.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",vertical:!0,children:[K.jsx(ye.Spin,{size:"large"}),i&&K.jsx("div",{className:"mt-4 text-gray-500",children:i})]}):K.jsx(ye.Flex,{className:`pt-10 w-full ${n||""}`,align:"center",justify:"center",children:K.jsx(ye.Empty,{image:a,description:t,imageStyle:{height:180},children:r})});ka.__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 va=({onClick:e,showText:t=!1,className:n,size:r="small",type:i="default"})=>K.jsx(ye.Button,{size:r,type:i,icon:K.jsx(Lt.LeftOutlined,{}),className:`cursor-pointer ${n||""}`,onClick:e,children:t&&"返回"});va.__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 wa=({removePadding:e=!0,className:t,...n})=>{const r=e?`px-0 h-auto ${t||""}`:t;return K.jsx(ye.Button,{type:"link",...n,className:r,children:n.children})};wa.__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:yl}=ye.Select,La=({columns:e,request:t,searchFields:n=[],showSearch:r=!0,showRefresh:i=!0,defaultPageSize:a=10,pageSizeOptions:s=["10","20","50","100"],autoLoad:u=!0,externalParams:o={},...d})=>{const[f,h]=P.useState([]),[g,p]=P.useState(!1),[c,E]=P.useState({current:1,pageSize:a,total:0}),[b,m]=P.useState({}),[x,A]=P.useState({}),[v]=ye.Form.useForm(),N=P.useRef(c);N.current=c;const F=P.useRef(o);F.current=o;const V=P.useRef(!1),O=P.useMemo(()=>e.map(I=>{const{sortable:T,render:$,...Q}=I;return{...Q,sorter:T?!0:void 0,render:$||(z=>z)}}),[e]),w=P.useCallback(async(I={})=>{if(t){p(!0);try{const T={page:N.current.current,pageSize:N.current.pageSize,sortField:x.field,sortOrder:x.order,searchParams:{...b,...F.current},...I},$=await t(T);$.success&&(h($.data),E(Q=>({...Q,total:$.total,current:T.page||Q.current})))}catch(T){console.error("加载数据失败:",T)}finally{p(!1)}}},[t,x,b]),H=P.useCallback(I=>{m(I),E(T=>({...T,current:1}))},[]),y=P.useCallback(()=>{v.resetFields(),m({}),E(I=>({...I,current:1}))},[v]),M=P.useCallback(()=>{w()},[w]),U=P.useCallback((I,T,$)=>{const Q={current:I.current||1,pageSize:I.pageSize||a,total:I.total||0},z={field:$?.field,order:$?.order};E(Q),A(z)},[a]);return P.useEffect(()=>{const I=Object.keys(o).length>0;(u&&!V.current||I)&&(w(),V.current=!0)},[u,o,w]),K.jsxs("div",{children:[r&&n.length>0&&K.jsx(ye.Card,{size:"small",style:{marginBottom:16},children:K.jsxs(ye.Form,{form:v,layout:"inline",onFinish:H,initialValues:n.reduce((I,T)=>(T.defaultValue!==void 0&&(I[T.key]=T.defaultValue),I),{}),children:[n.map(I=>K.jsx(ye.Form.Item,{name:I.key,label:I.label,children:I.type==="input"?K.jsx(ye.Input,{placeholder:I.placeholder||`请输入${I.label}`,style:{width:200}}):K.jsx(ye.Select,{placeholder:I.placeholder||`请选择${I.label}`,style:{width:200},allowClear:!0,children:I.options?.map(T=>K.jsx(yl,{value:T.value,children:T.label},T.value))})},I.key)),K.jsx(ye.Form.Item,{children:K.jsxs(ye.Space,{children:[K.jsx(ye.Button,{type:"primary",htmlType:"submit",icon:K.jsx(Lt.SearchOutlined,{}),children:"查询"}),K.jsx(ye.Button,{onClick:y,children:"重置"}),i&&K.jsx(ye.Button,{icon:K.jsx(Lt.ReloadOutlined,{}),onClick:M,children:"刷新"})]})})]})}),K.jsx(ye.Table,{...d,columns:O,dataSource:f,loading:g,pagination:{...c,showSizeChanger:!0,showQuickJumper:!0,showTotal:(I,T)=>`第 ${T[0]}-${T[1]} 条/共 ${I} 条`,pageSizeOptions:s},onChange:U,scroll:{x:"max-content",y:"50vh"}})]})};La.__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:"{}"}}}};function Oa(e){return e!==null&&typeof e=="object"&&"constructor"in e&&e.constructor===Object}function Vr(e={},t={}){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Oa(t[r])&&Oa(e[r])&&Object.keys(t[r]).length>0&&Vr(e[r],t[r])})}const Da={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector(){return null},querySelectorAll(){return[]},getElementById(){return null},createEvent(){return{initEvent(){}}},createElement(){return{children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName(){return[]}}},createElementNS(){return{}},importNode(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Vt(){const e=typeof document<"u"?document:{};return Vr(e,Da),e}const xl={document:Da,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle(){return{getPropertyValue(){return""}}},Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia(){return{}},requestAnimationFrame(e){return typeof setTimeout>"u"?(e(),null):setTimeout(e,0)},cancelAnimationFrame(e){typeof setTimeout>"u"||clearTimeout(e)}};function Je(){const e=typeof window<"u"?window:{};return Vr(e,xl),e}function Al(e=""){return e.trim().split(" ").filter(t=>!!t.trim())}function Cl(e){const t=e;Object.keys(t).forEach(n=>{try{t[n]=null}catch{}try{delete t[n]}catch{}})}function Pa(e,t=0){return setTimeout(e,t)}function ir(){return Date.now()}function Sl(e){const t=Je();let n;return t.getComputedStyle&&(n=t.getComputedStyle(e,null)),!n&&e.currentStyle&&(n=e.currentStyle),n||(n=e.style),n}function _l(e,t="x"){const n=Je();let r,i,a;const s=Sl(e);return n.WebKitCSSMatrix?(i=s.transform||s.webkitTransform,i.split(",").length>6&&(i=i.split(", ").map(u=>u.replace(",",".")).join(", ")),a=new n.WebKitCSSMatrix(i==="none"?"":i)):(a=s.MozTransform||s.OTransform||s.MsTransform||s.msTransform||s.transform||s.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),r=a.toString().split(",")),t==="x"&&(n.WebKitCSSMatrix?i=a.m41:r.length===16?i=parseFloat(r[12]):i=parseFloat(r[4])),t==="y"&&(n.WebKitCSSMatrix?i=a.m42:r.length===16?i=parseFloat(r[13]):i=parseFloat(r[5])),i||0}function ar(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"}function Il(e){return typeof window<"u"&&typeof window.HTMLElement<"u"?e instanceof HTMLElement:e&&(e.nodeType===1||e.nodeType===11)}function nt(...e){const t=Object(e[0]),n=["__proto__","constructor","prototype"];for(let r=1;r<e.length;r+=1){const i=e[r];if(i!=null&&!Il(i)){const a=Object.keys(Object(i)).filter(s=>n.indexOf(s)<0);for(let s=0,u=a.length;s<u;s+=1){const o=a[s],d=Object.getOwnPropertyDescriptor(i,o);d!==void 0&&d.enumerable&&(ar(t[o])&&ar(i[o])?i[o].__swiper__?t[o]=i[o]:nt(t[o],i[o]):!ar(t[o])&&ar(i[o])?(t[o]={},i[o].__swiper__?t[o]=i[o]:nt(t[o],i[o])):t[o]=i[o])}}}return t}function tn(e,t,n){e.style.setProperty(t,n)}function Ma({swiper:e,targetPosition:t,side:n}){const r=Je(),i=-e.translate;let a=null,s;const u=e.params.speed;e.wrapperEl.style.scrollSnapType="none",r.cancelAnimationFrame(e.cssModeFrameID);const o=t>i?"next":"prev",d=(h,g)=>o==="next"&&h>=g||o==="prev"&&h<=g,f=()=>{s=new Date().getTime(),a===null&&(a=s);const h=Math.max(Math.min((s-a)/u,1),0),g=.5-Math.cos(h*Math.PI)/2;let p=i+g*(t-i);if(d(p,t)&&(p=t),e.wrapperEl.scrollTo({[n]:p}),d(p,t)){e.wrapperEl.style.overflow="hidden",e.wrapperEl.style.scrollSnapType="",setTimeout(()=>{e.wrapperEl.style.overflow="",e.wrapperEl.scrollTo({[n]:p})}),r.cancelAnimationFrame(e.cssModeFrameID);return}e.cssModeFrameID=r.requestAnimationFrame(f)};f()}function mt(e,t=""){const n=Je(),r=[...e.children];return n.HTMLSlotElement&&e instanceof HTMLSlotElement&&r.push(...e.assignedElements()),t?r.filter(i=>i.matches(t)):r}function Nl(e,t){const n=[t];for(;n.length>0;){const r=n.shift();if(e===r)return!0;n.push(...r.children,...r.shadowRoot?r.shadowRoot.children:[],...r.assignedElements?r.assignedElements():[])}}function kl(e,t){const n=Je();let r=t.contains(e);return!r&&n.HTMLSlotElement&&t instanceof HTMLSlotElement&&(r=[...t.assignedElements()].includes(e),r||(r=Nl(e,t))),r}function sr(e){try{console.warn(e);return}catch{}}function or(e,t=[]){const n=document.createElement(e);return n.classList.add(...Array.isArray(t)?t:Al(t)),n}function vl(e,t){const n=[];for(;e.previousElementSibling;){const r=e.previousElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function wl(e,t){const n=[];for(;e.nextElementSibling;){const r=e.nextElementSibling;t?r.matches(t)&&n.push(r):n.push(r),e=r}return n}function Ot(e,t){return Je().getComputedStyle(e,null).getPropertyValue(t)}function ur(e){let t=e,n;if(t){for(n=0;(t=t.previousSibling)!==null;)t.nodeType===1&&(n+=1);return n}}function Ra(e,t){const n=[];let r=e.parentElement;for(;r;)t?r.matches(t)&&n.push(r):n.push(r),r=r.parentElement;return n}function Yr(e,t,n){const r=Je();return e[t==="width"?"offsetWidth":"offsetHeight"]+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-right":"margin-top"))+parseFloat(r.getComputedStyle(e,null).getPropertyValue(t==="width"?"margin-left":"margin-bottom"))}function Ve(e){return(Array.isArray(e)?e:[e]).filter(t=>!!t)}function Cn(e,t=""){typeof trustedTypes<"u"?e.innerHTML=trustedTypes.createPolicy("html",{createHTML:n=>n}).createHTML(t):e.innerHTML=t}let Gr;function Ll(){const e=Je(),t=Vt();return{smoothScroll:t.documentElement&&t.documentElement.style&&"scrollBehavior"in t.documentElement.style,touch:!!("ontouchstart"in e||e.DocumentTouch&&t instanceof e.DocumentTouch)}}function Ba(){return Gr||(Gr=Ll()),Gr}let Wr;function Ol({userAgent:e}={}){const t=Ba(),n=Je(),r=n.navigator.platform,i=e||n.navigator.userAgent,a={ios:!1,android:!1},s=n.screen.width,u=n.screen.height,o=i.match(/(Android);?[\s\/]+([\d.]+)?/);let d=i.match(/(iPad)(?!\1).*OS\s([\d_]+)/);const f=i.match(/(iPod)(.*OS\s([\d_]+))?/),h=!d&&i.match(/(iPhone\sOS|iOS)\s([\d_]+)/),g=r==="Win32";let p=r==="MacIntel";const c=["1024x1366","1366x1024","834x1194","1194x834","834x1112","1112x834","768x1024","1024x768","820x1180","1180x820","810x1080","1080x810"];return!d&&p&&t.touch&&c.indexOf(`${s}x${u}`)>=0&&(d=i.match(/(Version)\/([\d.]+)/),d||(d=[0,1,"13_0_0"]),p=!1),o&&!g&&(a.os="android",a.android=!0),(d||h||f)&&(a.os="ios",a.ios=!0),a}function Fa(e={}){return Wr||(Wr=Ol(e)),Wr}let jr;function Dl(){const e=Je(),t=Fa();let n=!1;function r(){const u=e.navigator.userAgent.toLowerCase();return u.indexOf("safari")>=0&&u.indexOf("chrome")<0&&u.indexOf("android")<0}if(r()){const u=String(e.navigator.userAgent);if(u.includes("Version/")){const[o,d]=u.split("Version/")[1].split(" ")[0].split(".").map(f=>Number(f));n=o<16||o===16&&d<2}}const i=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e.navigator.userAgent),a=r(),s=a||i&&t.ios;return{isSafari:n||a,needPerspectiveFix:n,need3dFix:s,isWebView:i}}function Ha(){return jr||(jr=Dl()),jr}function Pl({swiper:e,on:t,emit:n}){const r=Je();let i=null,a=null;const s=()=>{!e||e.destroyed||!e.initialized||(n("beforeResize"),n("resize"))},u=()=>{!e||e.destroyed||!e.initialized||(i=new ResizeObserver(f=>{a=r.requestAnimationFrame(()=>{const{width:h,height:g}=e;let p=h,c=g;f.forEach(({contentBoxSize:E,contentRect:b,target:m})=>{m&&m!==e.el||(p=b?b.width:(E[0]||E).inlineSize,c=b?b.height:(E[0]||E).blockSize)}),(p!==h||c!==g)&&s()})}),i.observe(e.el))},o=()=>{a&&r.cancelAnimationFrame(a),i&&i.unobserve&&e.el&&(i.unobserve(e.el),i=null)},d=()=>{!e||e.destroyed||!e.initialized||n("orientationchange")};t("init",()=>{if(e.params.resizeObserver&&typeof r.ResizeObserver<"u"){u();return}r.addEventListener("resize",s),r.addEventListener("orientationchange",d)}),t("destroy",()=>{o(),r.removeEventListener("resize",s),r.removeEventListener("orientationchange",d)})}function Ml({swiper:e,extendParams:t,on:n,emit:r}){const i=[],a=Je(),s=(d,f={})=>{const h=a.MutationObserver||a.WebkitMutationObserver,g=new h(p=>{if(e.__preventObserver__)return;if(p.length===1){r("observerUpdate",p[0]);return}const c=function(){r("observerUpdate",p[0])};a.requestAnimationFrame?a.requestAnimationFrame(c):a.setTimeout(c,0)});g.observe(d,{attributes:typeof f.attributes>"u"?!0:f.attributes,childList:e.isElement||(typeof f.childList>"u"?!0:f).childList,characterData:typeof f.characterData>"u"?!0:f.characterData}),i.push(g)},u=()=>{if(e.params.observer){if(e.params.observeParents){const d=Ra(e.hostEl);for(let f=0;f<d.length;f+=1)s(d[f])}s(e.hostEl,{childList:e.params.observeSlideChildren}),s(e.wrapperEl,{attributes:!1})}},o=()=>{i.forEach(d=>{d.disconnect()}),i.splice(0,i.length)};t({observer:!1,observeParents:!1,observeSlideChildren:!1}),n("init",u),n("destroy",o)}var Rl={on(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const i=n?"unshift":"push";return e.split(" ").forEach(a=>{r.eventsListeners[a]||(r.eventsListeners[a]=[]),r.eventsListeners[a][i](t)}),r},once(e,t,n){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;function i(...a){r.off(e,i),i.__emitterProxy&&delete i.__emitterProxy,t.apply(r,a)}return i.__emitterProxy=t,r.on(e,i,n)},onAny(e,t){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const r=t?"unshift":"push";return n.eventsAnyListeners.indexOf(e)<0&&n.eventsAnyListeners[r](e),n},offAny(e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsAnyListeners)return t;const n=t.eventsAnyListeners.indexOf(e);return n>=0&&t.eventsAnyListeners.splice(n,1),t},off(e,t){const n=this;return!n.eventsListeners||n.destroyed||!n.eventsListeners||e.split(" ").forEach(r=>{typeof t>"u"?n.eventsListeners[r]=[]:n.eventsListeners[r]&&n.eventsListeners[r].forEach((i,a)=>{(i===t||i.__emitterProxy&&i.__emitterProxy===t)&&n.eventsListeners[r].splice(a,1)})}),n},emit(...e){const t=this;if(!t.eventsListeners||t.destroyed||!t.eventsListeners)return t;let n,r,i;return typeof e[0]=="string"||Array.isArray(e[0])?(n=e[0],r=e.slice(1,e.length),i=t):(n=e[0].events,r=e[0].data,i=e[0].context||t),r.unshift(i),(Array.isArray(n)?n:n.split(" ")).forEach(s=>{t.eventsAnyListeners&&t.eventsAnyListeners.length&&t.eventsAnyListeners.forEach(u=>{u.apply(i,[s,...r])}),t.eventsListeners&&t.eventsListeners[s]&&t.eventsListeners[s].forEach(u=>{u.apply(i,r)})}),t}};function Bl(){const e=this;let t,n;const r=e.el;typeof e.params.width<"u"&&e.params.width!==null?t=e.params.width:t=r.clientWidth,typeof e.params.height<"u"&&e.params.height!==null?n=e.params.height:n=r.clientHeight,!(t===0&&e.isHorizontal()||n===0&&e.isVertical())&&(t=t-parseInt(Ot(r,"padding-left")||0,10)-parseInt(Ot(r,"padding-right")||0,10),n=n-parseInt(Ot(r,"padding-top")||0,10)-parseInt(Ot(r,"padding-bottom")||0,10),Number.isNaN(t)&&(t=0),Number.isNaN(n)&&(n=0),Object.assign(e,{width:t,height:n,size:e.isHorizontal()?t:n}))}function Fl(){const e=this;function t(H,y){return parseFloat(H.getPropertyValue(e.getDirectionLabel(y))||0)}const n=e.params,{wrapperEl:r,slidesEl:i,rtlTranslate:a,wrongRTL:s}=e,u=e.virtual&&n.virtual.enabled,o=u?e.virtual.slides.length:e.slides.length,d=mt(i,`.${e.params.slideClass}, swiper-slide`),f=u?e.virtual.slides.length:d.length;let h=[];const g=[],p=[];let c=n.slidesOffsetBefore;typeof c=="function"&&(c=n.slidesOffsetBefore.call(e));let E=n.slidesOffsetAfter;typeof E=="function"&&(E=n.slidesOffsetAfter.call(e));const b=e.snapGrid.length,m=e.slidesGrid.length,x=e.size-c-E;let A=n.spaceBetween,v=-c,N=0,F=0;if(typeof x>"u")return;typeof A=="string"&&A.indexOf("%")>=0?A=parseFloat(A.replace("%",""))/100*x:typeof A=="string"&&(A=parseFloat(A)),e.virtualSize=-A-c-E,d.forEach(H=>{a?H.style.marginLeft="":H.style.marginRight="",H.style.marginBottom="",H.style.marginTop=""}),n.centeredSlides&&n.cssMode&&(tn(r,"--swiper-centered-offset-before",""),tn(r,"--swiper-centered-offset-after","")),n.cssMode&&(tn(r,"--swiper-slides-offset-before",`${c}px`),tn(r,"--swiper-slides-offset-after",`${E}px`));const V=n.grid&&n.grid.rows>1&&e.grid;V?e.grid.initSlides(d):e.grid&&e.grid.unsetSlides();let O;const w=n.slidesPerView==="auto"&&n.breakpoints&&Object.keys(n.breakpoints).filter(H=>typeof n.breakpoints[H].slidesPerView<"u").length>0;for(let H=0;H<f;H+=1){O=0;const y=d[H];if(!(y&&(V&&e.grid.updateSlide(H,y,d),Ot(y,"display")==="none"))){if(u&&n.slidesPerView==="auto")n.virtual.slidesPerViewAutoSlideSize&&(O=n.virtual.slidesPerViewAutoSlideSize),O&&y&&(n.roundLengths&&(O=Math.floor(O)),y.style[e.getDirectionLabel("width")]=`${O}px`);else if(n.slidesPerView==="auto"){w&&(y.style[e.getDirectionLabel("width")]="");const M=getComputedStyle(y),U=y.style.transform,I=y.style.webkitTransform;if(U&&(y.style.transform="none"),I&&(y.style.webkitTransform="none"),n.roundLengths)O=e.isHorizontal()?Yr(y,"width"):Yr(y,"height");else{const T=t(M,"width"),$=t(M,"padding-left"),Q=t(M,"padding-right"),z=t(M,"margin-left"),te=t(M,"margin-right"),S=M.getPropertyValue("box-sizing");if(S&&S==="border-box")O=T+z+te;else{const{clientWidth:fe,offsetWidth:ce}=y;O=T+$+Q+z+te+(ce-fe)}}U&&(y.style.transform=U),I&&(y.style.webkitTransform=I),n.roundLengths&&(O=Math.floor(O))}else O=(x-(n.slidesPerView-1)*A)/n.slidesPerView,n.roundLengths&&(O=Math.floor(O)),y&&(y.style[e.getDirectionLabel("width")]=`${O}px`);y&&(y.swiperSlideSize=O),p.push(O),n.centeredSlides?(v=v+O/2+N/2+A,N===0&&H!==0&&(v=v-x/2-A),H===0&&(v=v-x/2-A),Math.abs(v)<1/1e3&&(v=0),n.roundLengths&&(v=Math.floor(v)),F%n.slidesPerGroup===0&&h.push(v),g.push(v)):(n.roundLengths&&(v=Math.floor(v)),(F-Math.min(e.params.slidesPerGroupSkip,F))%e.params.slidesPerGroup===0&&h.push(v),g.push(v),v=v+O+A),e.virtualSize+=O+A,N=O,F+=1}}if(e.virtualSize=Math.max(e.virtualSize,x)+E,a&&s&&(n.effect==="slide"||n.effect==="coverflow")&&(r.style.width=`${e.virtualSize+A}px`),n.setWrapperSize&&(r.style[e.getDirectionLabel("width")]=`${e.virtualSize+A}px`),V&&e.grid.updateWrapperSize(O,h),!n.centeredSlides){const H=n.slidesPerView!=="auto"&&n.slidesPerView%1!==0,y=n.snapToSlideEdge&&!n.loop&&(n.slidesPerView==="auto"||H);let M=h.length;if(y){let I;if(n.slidesPerView==="auto"){I=1;let T=0;for(let $=p.length-1;$>=0&&(T+=p[$]+($<p.length-1?A:0),T<=x);$-=1)I=p.length-$}else I=Math.floor(n.slidesPerView);M=Math.max(f-I,0)}const U=[];for(let I=0;I<h.length;I+=1){let T=h[I];n.roundLengths&&(T=Math.floor(T)),y?I<=M&&U.push(T):h[I]<=e.virtualSize-x&&U.push(T)}h=U,Math.floor(e.virtualSize-x)-Math.floor(h[h.length-1])>1&&(y||h.push(e.virtualSize-x))}if(u&&n.loop){const H=p[0]+A;if(n.slidesPerGroup>1){const y=Math.ceil((e.virtual.slidesBefore+e.virtual.slidesAfter)/n.slidesPerGroup),M=H*n.slidesPerGroup;for(let U=0;U<y;U+=1)h.push(h[h.length-1]+M)}for(let y=0;y<e.virtual.slidesBefore+e.virtual.slidesAfter;y+=1)n.slidesPerGroup===1&&h.push(h[h.length-1]+H),g.push(g[g.length-1]+H),e.virtualSize+=H}if(h.length===0&&(h=[0]),A!==0){const H=e.isHorizontal()&&a?"marginLeft":e.getDirectionLabel("marginRight");d.filter((y,M)=>!n.cssMode||n.loop?!0:M!==d.length-1).forEach(y=>{y.style[H]=`${A}px`})}if(n.centeredSlides&&n.centeredSlidesBounds){let H=0;p.forEach(M=>{H+=M+(A||0)}),H-=A;const y=H>x?H-x:0;h=h.map(M=>M<=0?-c:M>y?y+E:M)}if(n.centerInsufficientSlides){let H=0;p.forEach(M=>{H+=M+(A||0)}),H-=A;const y=(c||0)+(E||0);if(H+y<x){const M=(x-H-y)/2;h.forEach((U,I)=>{h[I]=U-M}),g.forEach((U,I)=>{g[I]=U+M})}}if(Object.assign(e,{slides:d,snapGrid:h,slidesGrid:g,slidesSizesGrid:p}),n.centeredSlides&&n.cssMode&&!n.centeredSlidesBounds){tn(r,"--swiper-centered-offset-before",`${-h[0]}px`),tn(r,"--swiper-centered-offset-after",`${e.size/2-p[p.length-1]/2}px`);const H=-e.snapGrid[0],y=-e.slidesGrid[0];e.snapGrid=e.snapGrid.map(M=>M+H),e.slidesGrid=e.slidesGrid.map(M=>M+y)}if(f!==o&&e.emit("slidesLengthChange"),h.length!==b&&(e.params.watchOverflow&&e.checkOverflow(),e.emit("snapGridLengthChange")),g.length!==m&&e.emit("slidesGridLengthChange"),n.watchSlidesProgress&&e.updateSlidesOffset(),e.emit("slidesUpdated"),!u&&!n.cssMode&&(n.effect==="slide"||n.effect==="fade")){const H=`${n.containerModifierClass}backface-hidden`,y=e.el.classList.contains(H);f<=n.maxBackfaceHiddenSlides?y||e.el.classList.add(H):y&&e.el.classList.remove(H)}}function Hl(e){const t=this,n=[],r=t.virtual&&t.params.virtual.enabled;let i=0,a;typeof e=="number"?t.setTransition(e):e===!0&&t.setTransition(t.params.speed);const s=u=>r?t.slides[t.getSlideIndexByData(u)]:t.slides[u];if(t.params.slidesPerView!=="auto"&&t.params.slidesPerView>1)if(t.params.centeredSlides)(t.visibleSlides||[]).forEach(u=>{n.push(u)});else for(a=0;a<Math.ceil(t.params.slidesPerView);a+=1){const u=t.activeIndex+a;if(u>t.slides.length&&!r)break;n.push(s(u))}else n.push(s(t.activeIndex));for(a=0;a<n.length;a+=1)if(typeof n[a]<"u"){const u=n[a].offsetHeight;i=u>i?u:i}(i||i===0)&&(t.wrapperEl.style.height=`${i}px`)}function Ul(){const e=this,t=e.slides,n=e.isElement?e.isHorizontal()?e.wrapperEl.offsetLeft:e.wrapperEl.offsetTop:0;for(let r=0;r<t.length;r+=1)t[r].swiperSlideOffset=(e.isHorizontal()?t[r].offsetLeft:t[r].offsetTop)-n-e.cssOverflowAdjustment()}const Ua=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function $l(e=this&&this.translate||0){const t=this,n=t.params,{slides:r,rtlTranslate:i,snapGrid:a}=t;if(r.length===0)return;typeof r[0].swiperSlideOffset>"u"&&t.updateSlidesOffset();let s=-e;i&&(s=e),t.visibleSlidesIndexes=[],t.visibleSlides=[];let u=n.spaceBetween;typeof u=="string"&&u.indexOf("%")>=0?u=parseFloat(u.replace("%",""))/100*t.size:typeof u=="string"&&(u=parseFloat(u));for(let o=0;o<r.length;o+=1){const d=r[o];let f=d.swiperSlideOffset;n.cssMode&&n.centeredSlides&&(f-=r[0].swiperSlideOffset);const h=(s+(n.centeredSlides?t.minTranslate():0)-f)/(d.swiperSlideSize+u),g=(s-a[0]+(n.centeredSlides?t.minTranslate():0)-f)/(d.swiperSlideSize+u),p=-(s-f),c=p+t.slidesSizesGrid[o],E=p>=0&&p<=t.size-t.slidesSizesGrid[o],b=p>=0&&p<t.size-1||c>1&&c<=t.size||p<=0&&c>=t.size;b&&(t.visibleSlides.push(d),t.visibleSlidesIndexes.push(o)),Ua(d,b,n.slideVisibleClass),Ua(d,E,n.slideFullyVisibleClass),d.progress=i?-h:h,d.originalProgress=i?-g:g}}function ql(e){const t=this;if(typeof e>"u"){const f=t.rtlTranslate?-1:1;e=t&&t.translate&&t.translate*f||0}const n=t.params,r=t.maxTranslate()-t.minTranslate();let{progress:i,isBeginning:a,isEnd:s,progressLoop:u}=t;const o=a,d=s;if(r===0)i=0,a=!0,s=!0;else{i=(e-t.minTranslate())/r;const f=Math.abs(e-t.minTranslate())<1,h=Math.abs(e-t.maxTranslate())<1;a=f||i<=0,s=h||i>=1,f&&(i=0),h&&(i=1)}if(n.loop){const f=t.getSlideIndexByData(0),h=t.getSlideIndexByData(t.slides.length-1),g=t.slidesGrid[f],p=t.slidesGrid[h],c=t.slidesGrid[t.slidesGrid.length-1],E=Math.abs(e);E>=g?u=(E-g)/c:u=(E+c-p)/c,u>1&&(u-=1)}Object.assign(t,{progress:i,progressLoop:u,isBeginning:a,isEnd:s}),(n.watchSlidesProgress||n.centeredSlides&&n.autoHeight)&&t.updateSlidesProgress(e),a&&!o&&t.emit("reachBeginning toEdge"),s&&!d&&t.emit("reachEnd toEdge"),(o&&!a||d&&!s)&&t.emit("fromEdge"),t.emit("progress",i)}const Xr=(e,t,n)=>{t&&!e.classList.contains(n)?e.classList.add(n):!t&&e.classList.contains(n)&&e.classList.remove(n)};function zl(){const e=this,{slides:t,params:n,slidesEl:r,activeIndex:i}=e,a=e.virtual&&n.virtual.enabled,s=e.grid&&n.grid&&n.grid.rows>1,u=h=>mt(r,`.${n.slideClass}${h}, swiper-slide${h}`)[0];let o,d,f;if(a)if(n.loop){let h=i-e.virtual.slidesBefore;h<0&&(h=e.virtual.slides.length+h),h>=e.virtual.slides.length&&(h-=e.virtual.slides.length),o=u(`[data-swiper-slide-index="${h}"]`)}else o=u(`[data-swiper-slide-index="${i}"]`);else s?(o=t.find(h=>h.column===i),f=t.find(h=>h.column===i+1),d=t.find(h=>h.column===i-1)):o=t[i];o&&(s||(f=wl(o,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!f&&(f=t[0]),d=vl(o,`.${n.slideClass}, swiper-slide`)[0],n.loop&&!d===0&&(d=t[t.length-1]))),t.forEach(h=>{Xr(h,h===o,n.slideActiveClass),Xr(h,h===f,n.slideNextClass),Xr(h,h===d,n.slidePrevClass)}),e.emitSlidesClasses()}const lr=(e,t)=>{if(!e||e.destroyed||!e.params)return;const n=()=>e.isElement?"swiper-slide":`.${e.params.slideClass}`,r=t.closest(n());if(r){let i=r.querySelector(`.${e.params.lazyPreloaderClass}`);!i&&e.isElement&&(r.shadowRoot?i=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{r.shadowRoot&&(i=r.shadowRoot.querySelector(`.${e.params.lazyPreloaderClass}`),i&&!i.lazyPreloaderManaged&&i.remove())})),i&&!i.lazyPreloaderManaged&&i.remove()}},Kr=(e,t)=>{if(!e.slides[t])return;const n=e.slides[t].querySelector('[loading="lazy"]');n&&n.removeAttribute("loading")},Qr=e=>{if(!e||e.destroyed||!e.params)return;let t=e.params.lazyPreloadPrevNext;const n=e.slides.length;if(!n||!t||t<0)return;t=Math.min(t,n);const r=e.params.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(e.params.slidesPerView),i=e.activeIndex;if(e.params.grid&&e.params.grid.rows>1){const s=i,u=[s-t];u.push(...Array.from({length:t}).map((o,d)=>s+r+d)),e.slides.forEach((o,d)=>{u.includes(o.column)&&Kr(e,d)});return}const a=i+r-1;if(e.params.rewind||e.params.loop)for(let s=i-t;s<=a+t;s+=1){const u=(s%n+n)%n;(u<i||u>a)&&Kr(e,u)}else for(let s=Math.max(i-t,0);s<=Math.min(a+t,n-1);s+=1)s!==i&&(s>a||s<i)&&Kr(e,s)};function Vl(e){const{slidesGrid:t,params:n}=e,r=e.rtlTranslate?e.translate:-e.translate;let i;for(let a=0;a<t.length;a+=1)typeof t[a+1]<"u"?r>=t[a]&&r<t[a+1]-(t[a+1]-t[a])/2?i=a:r>=t[a]&&r<t[a+1]&&(i=a+1):r>=t[a]&&(i=a);return n.normalizeSlideIndex&&(i<0||typeof i>"u")&&(i=0),i}function Yl(e){const t=this,n=t.rtlTranslate?t.translate:-t.translate,{snapGrid:r,params:i,activeIndex:a,realIndex:s,snapIndex:u}=t;let o=e,d;const f=p=>{let c=p-t.virtual.slidesBefore;return c<0&&(c=t.virtual.slides.length+c),c>=t.virtual.slides.length&&(c-=t.virtual.slides.length),c};if(typeof o>"u"&&(o=Vl(t)),r.indexOf(n)>=0)d=r.indexOf(n);else{const p=Math.min(i.slidesPerGroupSkip,o);d=p+Math.floor((o-p)/i.slidesPerGroup)}if(d>=r.length&&(d=r.length-1),o===a&&!t.params.loop){d!==u&&(t.snapIndex=d,t.emit("snapIndexChange"));return}if(o===a&&t.params.loop&&t.virtual&&t.params.virtual.enabled){t.realIndex=f(o);return}const h=t.grid&&i.grid&&i.grid.rows>1;let g;if(t.virtual&&i.virtual.enabled)i.loop?g=f(o):g=o;else if(h){const p=t.slides.find(E=>E.column===o);let c=parseInt(p.getAttribute("data-swiper-slide-index"),10);Number.isNaN(c)&&(c=Math.max(t.slides.indexOf(p),0)),g=Math.floor(c/i.grid.rows)}else if(t.slides[o]){const p=t.slides[o].getAttribute("data-swiper-slide-index");p?g=parseInt(p,10):g=o}else g=o;Object.assign(t,{previousSnapIndex:u,snapIndex:d,previousRealIndex:s,realIndex:g,previousIndex:a,activeIndex:o}),t.initialized&&Qr(t),t.emit("activeIndexChange"),t.emit("snapIndexChange"),(t.initialized||t.params.runCallbacksOnInit)&&(s!==g&&t.emit("realIndexChange"),t.emit("slideChange"))}function Gl(e,t){const n=this,r=n.params;let i=e.closest(`.${r.slideClass}, swiper-slide`);!i&&n.isElement&&t&&t.length>1&&t.includes(e)&&[...t.slice(t.indexOf(e)+1,t.length)].forEach(u=>{!i&&u.matches&&u.matches(`.${r.slideClass}, swiper-slide`)&&(i=u)});let a=!1,s;if(i){for(let u=0;u<n.slides.length;u+=1)if(n.slides[u]===i){a=!0,s=u;break}}if(i&&a)n.clickedSlide=i,n.virtual&&n.params.virtual.enabled?n.clickedIndex=parseInt(i.getAttribute("data-swiper-slide-index"),10):n.clickedIndex=s;else{n.clickedSlide=void 0,n.clickedIndex=void 0;return}r.slideToClickedSlide&&n.clickedIndex!==void 0&&n.clickedIndex!==n.activeIndex&&n.slideToClickedSlide()}var Wl={updateSize:Bl,updateSlides:Fl,updateAutoHeight:Hl,updateSlidesOffset:Ul,updateSlidesProgress:$l,updateProgress:ql,updateSlidesClasses:zl,updateActiveIndex:Yl,updateClickedSlide:Gl};function jl(e=this.isHorizontal()?"x":"y"){const t=this,{params:n,rtlTranslate:r,translate:i,wrapperEl:a}=t;if(n.virtualTranslate)return r?-i:i;if(n.cssMode)return i;let s=_l(a,e);return s+=t.cssOverflowAdjustment(),r&&(s=-s),s||0}function Xl(e,t){const n=this,{rtlTranslate:r,params:i,wrapperEl:a,progress:s}=n;let u=0,o=0;const d=0;n.isHorizontal()?u=r?-e:e:o=e,i.roundLengths&&(u=Math.floor(u),o=Math.floor(o)),n.previousTranslate=n.translate,n.translate=n.isHorizontal()?u:o,i.cssMode?a[n.isHorizontal()?"scrollLeft":"scrollTop"]=n.isHorizontal()?-u:-o:i.virtualTranslate||(n.isHorizontal()?u-=n.cssOverflowAdjustment():o-=n.cssOverflowAdjustment(),a.style.transform=`translate3d(${u}px, ${o}px, ${d}px)`);let f;const h=n.maxTranslate()-n.minTranslate();h===0?f=0:f=(e-n.minTranslate())/h,f!==s&&n.updateProgress(e),n.emit("setTranslate",n.translate,t)}function Kl(){return-this.snapGrid[0]}function Ql(){return-this.snapGrid[this.snapGrid.length-1]}function Jl(e=0,t=this.params.speed,n=!0,r=!0,i){const a=this,{params:s,wrapperEl:u}=a;if(a.animating&&s.preventInteractionOnTransition)return!1;const o=a.minTranslate(),d=a.maxTranslate();let f;if(r&&e>o?f=o:r&&e<d?f=d:f=e,a.updateProgress(f),s.cssMode){const h=a.isHorizontal();if(t===0)u[h?"scrollLeft":"scrollTop"]=-f;else{if(!a.support.smoothScroll)return Ma({swiper:a,targetPosition:-f,side:h?"left":"top"}),!0;u.scrollTo({[h?"left":"top"]:-f,behavior:"smooth"})}return!0}return t===0?(a.setTransition(0),a.setTranslate(f),n&&(a.emit("beforeTransitionStart",t,i),a.emit("transitionEnd"))):(a.setTransition(t),a.setTranslate(f),n&&(a.emit("beforeTransitionStart",t,i),a.emit("transitionStart")),a.animating||(a.animating=!0,a.onTranslateToWrapperTransitionEnd||(a.onTranslateToWrapperTransitionEnd=function(g){!a||a.destroyed||g.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onTranslateToWrapperTransitionEnd),a.onTranslateToWrapperTransitionEnd=null,delete a.onTranslateToWrapperTransitionEnd,a.animating=!1,n&&a.emit("transitionEnd"))}),a.wrapperEl.addEventListener("transitionend",a.onTranslateToWrapperTransitionEnd))),!0}var Zl={getTranslate:jl,setTranslate:Xl,minTranslate:Kl,maxTranslate:Ql,translateTo:Jl};function ec(e,t){const n=this;n.params.cssMode||(n.wrapperEl.style.transitionDuration=`${e}ms`,n.wrapperEl.style.transitionDelay=e===0?"0ms":""),n.emit("setTransition",e,t)}function $a({swiper:e,runCallbacks:t,direction:n,step:r}){const{activeIndex:i,previousIndex:a}=e;let s=n;s||(i>a?s="next":i<a?s="prev":s="reset"),e.emit(`transition${r}`),t&&s==="reset"?e.emit(`slideResetTransition${r}`):t&&i!==a&&(e.emit(`slideChangeTransition${r}`),s==="next"?e.emit(`slideNextTransition${r}`):e.emit(`slidePrevTransition${r}`))}function tc(e=!0,t){const n=this,{params:r}=n;r.cssMode||(r.autoHeight&&n.updateAutoHeight(),$a({swiper:n,runCallbacks:e,direction:t,step:"Start"}))}function nc(e=!0,t){const n=this,{params:r}=n;n.animating=!1,!r.cssMode&&(n.setTransition(0),$a({swiper:n,runCallbacks:e,direction:t,step:"End"}))}var rc={setTransition:ec,transitionStart:tc,transitionEnd:nc};function ic(e=0,t,n=!0,r,i){typeof e=="string"&&(e=parseInt(e,10));const a=this;let s=e;s<0&&(s=0);const{params:u,snapGrid:o,slidesGrid:d,previousIndex:f,activeIndex:h,rtlTranslate:g,wrapperEl:p,enabled:c}=a;if(!c&&!r&&!i||a.destroyed||a.animating&&u.preventInteractionOnTransition)return!1;typeof t>"u"&&(t=a.params.speed);const E=Math.min(a.params.slidesPerGroupSkip,s);let b=E+Math.floor((s-E)/a.params.slidesPerGroup);b>=o.length&&(b=o.length-1);const m=-o[b];if(u.normalizeSlideIndex)for(let V=0;V<d.length;V+=1){const O=-Math.floor(m*100),w=Math.floor(d[V]*100),H=Math.floor(d[V+1]*100);typeof d[V+1]<"u"?O>=w&&O<H-(H-w)/2?s=V:O>=w&&O<H&&(s=V+1):O>=w&&(s=V)}if(a.initialized&&s!==h&&(!a.allowSlideNext&&(g?m>a.translate&&m>a.minTranslate():m<a.translate&&m<a.minTranslate())||!a.allowSlidePrev&&m>a.translate&&m>a.maxTranslate()&&(h||0)!==s))return!1;s!==(f||0)&&n&&a.emit("beforeSlideChangeStart"),a.updateProgress(m);let x;s>h?x="next":s<h?x="prev":x="reset";const A=a.virtual&&a.params.virtual.enabled;if(!(A&&i)&&(g&&-m===a.translate||!g&&m===a.translate))return a.updateActiveIndex(s),u.autoHeight&&a.updateAutoHeight(),a.updateSlidesClasses(),u.effect!=="slide"&&a.setTranslate(m),x!=="reset"&&(a.transitionStart(n,x),a.transitionEnd(n,x)),!1;if(u.cssMode){const V=a.isHorizontal(),O=g?m:-m;if(t===0)A&&(a.wrapperEl.style.scrollSnapType="none",a._immediateVirtual=!0),A&&!a._cssModeVirtualInitialSet&&a.params.initialSlide>0?(a._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{p[V?"scrollLeft":"scrollTop"]=O})):p[V?"scrollLeft":"scrollTop"]=O,A&&requestAnimationFrame(()=>{a.wrapperEl.style.scrollSnapType="",a._immediateVirtual=!1});else{if(!a.support.smoothScroll)return Ma({swiper:a,targetPosition:O,side:V?"left":"top"}),!0;p.scrollTo({[V?"left":"top"]:O,behavior:"smooth"})}return!0}const F=Ha().isSafari;return A&&!i&&F&&a.isElement&&a.virtual.update(!1,!1,s),a.setTransition(t),a.setTranslate(m),a.updateActiveIndex(s),a.updateSlidesClasses(),a.emit("beforeTransitionStart",t,r),a.transitionStart(n,x),t===0?a.transitionEnd(n,x):a.animating||(a.animating=!0,a.onSlideToWrapperTransitionEnd||(a.onSlideToWrapperTransitionEnd=function(O){!a||a.destroyed||O.target===this&&(a.wrapperEl.removeEventListener("transitionend",a.onSlideToWrapperTransitionEnd),a.onSlideToWrapperTransitionEnd=null,delete a.onSlideToWrapperTransitionEnd,a.transitionEnd(n,x))}),a.wrapperEl.addEventListener("transitionend",a.onSlideToWrapperTransitionEnd)),!0}function ac(e=0,t,n=!0,r){typeof e=="string"&&(e=parseInt(e,10));const i=this;if(i.destroyed)return;typeof t>"u"&&(t=i.params.speed);const a=i.grid&&i.params.grid&&i.params.grid.rows>1;let s=e;if(i.params.loop)if(i.virtual&&i.params.virtual.enabled)s=s+i.virtual.slidesBefore;else{let u;if(a){const E=s*i.params.grid.rows;u=i.slides.find(b=>b.getAttribute("data-swiper-slide-index")*1===E).column}else u=i.getSlideIndexByData(s);const o=a?Math.ceil(i.slides.length/i.params.grid.rows):i.slides.length,{centeredSlides:d,slidesOffsetBefore:f,slidesOffsetAfter:h}=i.params,g=d||!!f||!!h;let p=i.params.slidesPerView;p==="auto"?p=i.slidesPerViewDynamic():(p=Math.ceil(parseFloat(i.params.slidesPerView,10)),g&&p%2===0&&(p=p+1));let c=o-u<p;if(g&&(c=c||u<Math.ceil(p/2)),r&&g&&i.params.slidesPerView!=="auto"&&!a&&(c=!1),c){const E=g?u<i.activeIndex?"prev":"next":u-i.activeIndex-1<i.params.slidesPerView?"next":"prev";i.loopFix({direction:E,slideTo:!0,activeSlideIndex:E==="next"?u+1:u-o+1,slideRealIndex:E==="next"?i.realIndex:void 0})}if(a){const E=s*i.params.grid.rows;s=i.slides.find(b=>b.getAttribute("data-swiper-slide-index")*1===E).column}else s=i.getSlideIndexByData(s)}return requestAnimationFrame(()=>{i.slideTo(s,t,n,r)}),i}function sc(e,t=!0,n){const r=this,{enabled:i,params:a,animating:s}=r;if(!i||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);let u=a.slidesPerGroup;a.slidesPerView==="auto"&&a.slidesPerGroup===1&&a.slidesPerGroupAuto&&(u=Math.max(r.slidesPerViewDynamic("current",!0),1));const o=r.activeIndex<a.slidesPerGroupSkip?1:u,d=r.virtual&&a.virtual.enabled;if(a.loop){if(s&&!d&&a.loopPreventsSliding)return!1;if(r.loopFix({direction:"next"}),r._clientLeft=r.wrapperEl.clientLeft,r.activeIndex===r.slides.length-1&&a.cssMode)return requestAnimationFrame(()=>{r.slideTo(r.activeIndex+o,e,t,n)}),!0}return a.rewind&&r.isEnd?r.slideTo(0,e,t,n):r.slideTo(r.activeIndex+o,e,t,n)}function oc(e,t=!0,n){const r=this,{params:i,snapGrid:a,slidesGrid:s,rtlTranslate:u,enabled:o,animating:d}=r;if(!o||r.destroyed)return r;typeof e>"u"&&(e=r.params.speed);const f=r.virtual&&i.virtual.enabled;if(i.loop){if(d&&!f&&i.loopPreventsSliding)return!1;r.loopFix({direction:"prev"}),r._clientLeft=r.wrapperEl.clientLeft}const h=u?r.translate:-r.translate;function g(x){return x<0?-Math.floor(Math.abs(x)):Math.floor(x)}const p=g(h),c=a.map(x=>g(x)),E=i.freeMode&&i.freeMode.enabled;let b=a[c.indexOf(p)-1];if(typeof b>"u"&&(i.cssMode||E)){let x;a.forEach((A,v)=>{p>=A&&(x=v)}),typeof x<"u"&&(b=E?a[x]:a[x>0?x-1:x])}let m=0;if(typeof b<"u"&&(m=s.indexOf(b),m<0&&(m=r.activeIndex-1),i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(m=m-r.slidesPerViewDynamic("previous",!0)+1,m=Math.max(m,0))),i.rewind&&r.isBeginning){const x=r.params.virtual&&r.params.virtual.enabled&&r.virtual?r.virtual.slides.length-1:r.slides.length-1;return r.slideTo(x,e,t,n)}else if(i.loop&&r.activeIndex===0&&i.cssMode)return requestAnimationFrame(()=>{r.slideTo(m,e,t,n)}),!0;return r.slideTo(m,e,t,n)}function uc(e,t=!0,n){const r=this;if(!r.destroyed)return typeof e>"u"&&(e=r.params.speed),r.slideTo(r.activeIndex,e,t,n)}function lc(e,t=!0,n,r=.5){const i=this;if(i.destroyed)return;typeof e>"u"&&(e=i.params.speed);let a=i.activeIndex;const s=Math.min(i.params.slidesPerGroupSkip,a),u=s+Math.floor((a-s)/i.params.slidesPerGroup),o=i.rtlTranslate?i.translate:-i.translate;if(o>=i.snapGrid[u]){const d=i.snapGrid[u],f=i.snapGrid[u+1];o-d>(f-d)*r&&(a+=i.params.slidesPerGroup)}else{const d=i.snapGrid[u-1],f=i.snapGrid[u];o-d<=(f-d)*r&&(a-=i.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,i.slidesGrid.length-1),i.slideTo(a,e,t,n)}function cc(){const e=this;if(e.destroyed)return;const{params:t,slidesEl:n}=e,r=t.slidesPerView==="auto"?e.slidesPerViewDynamic():t.slidesPerView;let i=e.getSlideIndexWhenGrid(e.clickedIndex),a;const s=e.isElement?"swiper-slide":`.${t.slideClass}`,u=e.grid&&e.params.grid&&e.params.grid.rows>1;if(t.loop){if(e.animating)return;a=parseInt(e.clickedSlide.getAttribute("data-swiper-slide-index"),10),t.centeredSlides?e.slideToLoop(a):i>(u?(e.slides.length-r)/2-(e.params.grid.rows-1):e.slides.length-r)?(e.loopFix(),i=e.getSlideIndex(mt(n,`${s}[data-swiper-slide-index="${a}"]`)[0]),Pa(()=>{e.slideTo(i)})):e.slideTo(i)}else e.slideTo(i)}var dc={slideTo:ic,slideToLoop:ac,slideNext:sc,slidePrev:oc,slideReset:uc,slideToClosest:lc,slideToClickedSlide:cc};function fc(e,t){const n=this,{params:r,slidesEl:i}=n;if(!r.loop||n.virtual&&n.params.virtual.enabled)return;const a=()=>{mt(i,`.${r.slideClass}, swiper-slide`).forEach((c,E)=>{c.setAttribute("data-swiper-slide-index",E)})},s=()=>{const p=mt(i,`.${r.slideBlankClass}`);p.forEach(c=>{c.remove()}),p.length>0&&(n.recalcSlides(),n.updateSlides())},u=n.grid&&r.grid&&r.grid.rows>1;r.loopAddBlankSlides&&(r.slidesPerGroup>1||u)&&s();const o=r.slidesPerGroup*(u?r.grid.rows:1),d=n.slides.length%o!==0,f=u&&n.slides.length%r.grid.rows!==0,h=p=>{for(let c=0;c<p;c+=1){const E=n.isElement?or("swiper-slide",[r.slideBlankClass]):or("div",[r.slideClass,r.slideBlankClass]);n.slidesEl.append(E)}};if(d){if(r.loopAddBlankSlides){const p=o-n.slides.length%o;h(p),n.recalcSlides(),n.updateSlides()}else sr("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");a()}else if(f){if(r.loopAddBlankSlides){const p=r.grid.rows-n.slides.length%r.grid.rows;h(p),n.recalcSlides(),n.updateSlides()}else sr("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");a()}else a();const g=r.centeredSlides||!!r.slidesOffsetBefore||!!r.slidesOffsetAfter;n.loopFix({slideRealIndex:e,direction:g?void 0:"next",initial:t})}function pc({slideRealIndex:e,slideTo:t=!0,direction:n,setTranslate:r,activeSlideIndex:i,initial:a,byController:s,byMousewheel:u}={}){const o=this;if(!o.params.loop)return;o.emit("beforeLoopFix");const{slides:d,allowSlidePrev:f,allowSlideNext:h,slidesEl:g,params:p}=o,{centeredSlides:c,slidesOffsetBefore:E,slidesOffsetAfter:b,initialSlide:m}=p,x=c||!!E||!!b;if(o.allowSlidePrev=!0,o.allowSlideNext=!0,o.virtual&&p.virtual.enabled){t&&(!x&&o.snapIndex===0?o.slideTo(o.virtual.slides.length,0,!1,!0):x&&o.snapIndex<p.slidesPerView?o.slideTo(o.virtual.slides.length+o.snapIndex,0,!1,!0):o.snapIndex===o.snapGrid.length-1&&o.slideTo(o.virtual.slidesBefore,0,!1,!0)),o.allowSlidePrev=f,o.allowSlideNext=h,o.emit("loopFix");return}let A=p.slidesPerView;A==="auto"?A=o.slidesPerViewDynamic():(A=Math.ceil(parseFloat(p.slidesPerView,10)),x&&A%2===0&&(A=A+1));const v=p.slidesPerGroupAuto?A:p.slidesPerGroup;let N=x?Math.max(v,Math.ceil(A/2)):v;N%v!==0&&(N+=v-N%v),N+=p.loopAdditionalSlides,o.loopedSlides=N;const F=o.grid&&p.grid&&p.grid.rows>1;d.length<A+N||o.params.effect==="cards"&&d.length<A+N*2?sr("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):F&&p.grid.fill==="row"&&sr("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const V=[],O=[],w=F?Math.ceil(d.length/p.grid.rows):d.length,H=a&&w-m<A&&!x;let y=H?m:o.activeIndex;typeof i>"u"?i=o.getSlideIndex(d.find(z=>z.classList.contains(p.slideActiveClass))):y=i;const M=n==="next"||!n,U=n==="prev"||!n;let I=0,T=0;const Q=(F?d[i].column:i)+(x&&typeof r>"u"?-A/2+.5:0);if(Q<N){I=Math.max(N-Q,v);for(let z=0;z<N-Q;z+=1){const te=z-Math.floor(z/w)*w;if(F){const S=w-te-1;for(let fe=d.length-1;fe>=0;fe-=1)d[fe].column===S&&V.push(fe)}else V.push(w-te-1)}}else if(Q+A>w-N){T=Math.max(Q-(w-N*2),v),H&&(T=Math.max(T,A-w+m+1));for(let z=0;z<T;z+=1){const te=z-Math.floor(z/w)*w;F?d.forEach((S,fe)=>{S.column===te&&O.push(fe)}):O.push(te)}}if(o.__preventObserver__=!0,requestAnimationFrame(()=>{o.__preventObserver__=!1}),o.params.effect==="cards"&&d.length<A+N*2&&(O.includes(i)&&O.splice(O.indexOf(i),1),V.includes(i)&&V.splice(V.indexOf(i),1)),U&&V.forEach(z=>{d[z].swiperLoopMoveDOM=!0,g.prepend(d[z]),d[z].swiperLoopMoveDOM=!1}),M&&O.forEach(z=>{d[z].swiperLoopMoveDOM=!0,g.append(d[z]),d[z].swiperLoopMoveDOM=!1}),o.recalcSlides(),p.slidesPerView==="auto"?o.updateSlides():F&&(V.length>0&&U||O.length>0&&M)&&o.slides.forEach((z,te)=>{o.grid.updateSlide(te,z,o.slides)}),p.watchSlidesProgress&&o.updateSlidesOffset(),t){if(V.length>0&&U){if(typeof e>"u"){const z=o.slidesGrid[y],S=o.slidesGrid[y+I]-z;u?o.setTranslate(o.translate-S):(o.slideTo(y+Math.ceil(I),0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-S,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-S))}else if(r){const z=F?V.length/p.grid.rows:V.length;o.slideTo(o.activeIndex+z,0,!1,!0),o.touchEventsData.currentTranslate=o.translate}}else if(O.length>0&&M)if(typeof e>"u"){const z=o.slidesGrid[y],S=o.slidesGrid[y-T]-z;u?o.setTranslate(o.translate-S):(o.slideTo(y-T,0,!1,!0),r&&(o.touchEventsData.startTranslate=o.touchEventsData.startTranslate-S,o.touchEventsData.currentTranslate=o.touchEventsData.currentTranslate-S))}else{const z=F?O.length/p.grid.rows:O.length;o.slideTo(o.activeIndex-z,0,!1,!0)}}if(o.allowSlidePrev=f,o.allowSlideNext=h,o.controller&&o.controller.control&&!s){const z={slideRealIndex:e,direction:n,setTranslate:r,activeSlideIndex:i,byController:!0};Array.isArray(o.controller.control)?o.controller.control.forEach(te=>{!te.destroyed&&te.params.loop&&te.loopFix({...z,slideTo:te.params.slidesPerView===p.slidesPerView?t:!1})}):o.controller.control instanceof o.constructor&&o.controller.control.params.loop&&o.controller.control.loopFix({...z,slideTo:o.controller.control.params.slidesPerView===p.slidesPerView?t:!1})}o.emit("loopFix")}function hc(){const e=this,{params:t,slidesEl:n}=e;if(!t.loop||!n||e.virtual&&e.params.virtual.enabled)return;e.recalcSlides();const r=[];e.slides.forEach(i=>{const a=typeof i.swiperSlideIndex>"u"?i.getAttribute("data-swiper-slide-index")*1:i.swiperSlideIndex;r[a]=i}),e.slides.forEach(i=>{i.removeAttribute("data-swiper-slide-index")}),r.forEach(i=>{n.append(i)}),e.recalcSlides(),e.slideTo(e.realIndex,0)}var mc={loopCreate:fc,loopFix:pc,loopDestroy:hc};function gc(e){const t=this;if(!t.params.simulateTouch||t.params.watchOverflow&&t.isLocked||t.params.cssMode)return;const n=t.params.touchEventsTarget==="container"?t.el:t.wrapperEl;t.isElement&&(t.__preventObserver__=!0),n.style.cursor="move",n.style.cursor=e?"grabbing":"grab",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1})}function Ec(){const e=this;e.params.watchOverflow&&e.isLocked||e.params.cssMode||(e.isElement&&(e.__preventObserver__=!0),e[e.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1}))}var bc={setGrabCursor:gc,unsetGrabCursor:Ec};function Tc(e,t=this){function n(r){if(!r||r===Vt()||r===Je())return null;r.assignedSlot&&(r=r.assignedSlot);const i=r.closest(e);return!i&&!r.getRootNode?null:i||n(r.getRootNode().host)}return n(t)}function qa(e,t,n){const r=Je(),{params:i}=e,a=i.edgeSwipeDetection,s=i.edgeSwipeThreshold;return a&&(n<=s||n>=r.innerWidth-s)?a==="prevent"?(t.preventDefault(),!0):!1:!0}function yc(e){const t=this,n=Vt();let r=e;r.originalEvent&&(r=r.originalEvent);const i=t.touchEventsData;if(r.type==="pointerdown"){if(i.pointerId!==null&&i.pointerId!==r.pointerId)return;i.pointerId=r.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(i.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){qa(t,r,r.targetTouches[0].pageX);return}const{params:a,touches:s,enabled:u}=t;if(!u||!a.simulateTouch&&r.pointerType==="mouse"||t.animating&&a.preventInteractionOnTransition)return;!t.animating&&a.cssMode&&a.loop&&t.loopFix();let o=r.target;if(a.touchEventsTarget==="wrapper"&&!kl(o,t.wrapperEl)||"which"in r&&r.which===3||"button"in r&&r.button>0||i.isTouched&&i.isMoved)return;const d=!!a.noSwipingClass&&a.noSwipingClass!=="",f=r.composedPath?r.composedPath():r.path;d&&r.target&&r.target.shadowRoot&&f&&(o=f[0]);const h=a.noSwipingSelector?a.noSwipingSelector:`.${a.noSwipingClass}`,g=!!(r.target&&r.target.shadowRoot);if(a.noSwiping&&(g?Tc(h,o):o.closest(h))){t.allowClick=!0;return}if(a.swipeHandler&&!o.closest(a.swipeHandler))return;s.currentX=r.pageX,s.currentY=r.pageY;const p=s.currentX,c=s.currentY;if(!qa(t,r,p))return;Object.assign(i,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),s.startX=p,s.startY=c,i.touchStartTime=ir(),t.allowClick=!0,t.updateSize(),t.swipeDirection=void 0,a.threshold>0&&(i.allowThresholdMove=!1);let E=!0;o.matches(i.focusableElements)&&(E=!1,o.nodeName==="SELECT"&&(i.isTouched=!1)),n.activeElement&&n.activeElement.matches(i.focusableElements)&&n.activeElement!==o&&(r.pointerType==="mouse"||r.pointerType!=="mouse"&&!o.matches(i.focusableElements))&&n.activeElement.blur();const b=E&&t.allowTouchMove&&a.touchStartPreventDefault;(a.touchStartForcePreventDefault||b)&&!o.isContentEditable&&r.preventDefault(),a.freeMode&&a.freeMode.enabled&&t.freeMode&&t.animating&&!a.cssMode&&t.freeMode.onTouchStart(),t.emit("touchStart",r)}function xc(e){const t=Vt(),n=this,r=n.touchEventsData,{params:i,touches:a,rtlTranslate:s,enabled:u}=n;if(!u||!i.simulateTouch&&e.pointerType==="mouse")return;let o=e;if(o.originalEvent&&(o=o.originalEvent),o.type==="pointermove"&&(r.touchId!==null||o.pointerId!==r.pointerId))return;let d;if(o.type==="touchmove"){if(d=[...o.changedTouches].find(N=>N.identifier===r.touchId),!d||d.identifier!==r.touchId)return}else d=o;if(!r.isTouched){r.startMoving&&r.isScrolling&&n.emit("touchMoveOpposite",o);return}const f=d.pageX,h=d.pageY;if(o.preventedByNestedSwiper){a.startX=f,a.startY=h;return}if(!n.allowTouchMove){o.target.matches(r.focusableElements)||(n.allowClick=!1),r.isTouched&&(Object.assign(a,{startX:f,startY:h,currentX:f,currentY:h}),r.touchStartTime=ir());return}if(i.touchReleaseOnEdges&&!i.loop)if(n.isVertical()){if(h<a.startY&&n.translate<=n.maxTranslate()||h>a.startY&&n.translate>=n.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else{if(s&&(f>a.startX&&-n.translate<=n.maxTranslate()||f<a.startX&&-n.translate>=n.minTranslate()))return;if(!s&&(f<a.startX&&n.translate<=n.maxTranslate()||f>a.startX&&n.translate>=n.minTranslate()))return}if(t.activeElement&&t.activeElement.matches(r.focusableElements)&&t.activeElement!==o.target&&o.pointerType!=="mouse"&&t.activeElement.blur(),t.activeElement&&o.target===t.activeElement&&o.target.matches(r.focusableElements)){r.isMoved=!0,n.allowClick=!1;return}r.allowTouchCallbacks&&n.emit("touchMove",o),a.previousX=a.currentX,a.previousY=a.currentY,a.currentX=f,a.currentY=h;const g=a.currentX-a.startX,p=a.currentY-a.startY;if(n.params.threshold&&Math.sqrt(g**2+p**2)<n.params.threshold)return;if(typeof r.isScrolling>"u"){let N;n.isHorizontal()&&a.currentY===a.startY||n.isVertical()&&a.currentX===a.startX?r.isScrolling=!1:g*g+p*p>=25&&(N=Math.atan2(Math.abs(p),Math.abs(g))*180/Math.PI,r.isScrolling=n.isHorizontal()?N>i.touchAngle:90-N>i.touchAngle)}if(r.isScrolling&&n.emit("touchMoveOpposite",o),typeof r.startMoving>"u"&&(a.currentX!==a.startX||a.currentY!==a.startY)&&(r.startMoving=!0),r.isScrolling||o.type==="touchmove"&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;n.allowClick=!1,!i.cssMode&&o.cancelable&&o.preventDefault(),i.touchMoveStopPropagation&&!i.nested&&o.stopPropagation();let c=n.isHorizontal()?g:p,E=n.isHorizontal()?a.currentX-a.previousX:a.currentY-a.previousY;i.oneWayMovement&&(c=Math.abs(c)*(s?1:-1),E=Math.abs(E)*(s?1:-1)),a.diff=c,c*=i.touchRatio,s&&(c=-c,E=-E);const b=n.touchesDirection;n.swipeDirection=c>0?"prev":"next",n.touchesDirection=E>0?"prev":"next";const m=n.params.loop&&!i.cssMode,x=n.touchesDirection==="next"&&n.allowSlideNext||n.touchesDirection==="prev"&&n.allowSlidePrev;if(!r.isMoved){if(m&&x&&n.loopFix({direction:n.swipeDirection}),r.startTranslate=n.getTranslate(),n.setTransition(0),n.animating){const N=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});n.wrapperEl.dispatchEvent(N)}r.allowMomentumBounce=!1,i.grabCursor&&(n.allowSlideNext===!0||n.allowSlidePrev===!0)&&n.setGrabCursor(!0),n.emit("sliderFirstMove",o)}if(new Date().getTime(),i._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&b!==n.touchesDirection&&m&&x&&Math.abs(c)>=1){Object.assign(a,{startX:f,startY:h,currentX:f,currentY:h,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}n.emit("sliderMove",o),r.isMoved=!0,r.currentTranslate=c+r.startTranslate;let A=!0,v=i.resistanceRatio;if(i.touchReleaseOnEdges&&(v=0),c>0?(m&&x&&r.allowThresholdMove&&r.currentTranslate>(i.centeredSlides?n.minTranslate()-n.slidesSizesGrid[n.activeIndex+1]-(i.slidesPerView!=="auto"&&n.slides.length-i.slidesPerView>=2?n.slidesSizesGrid[n.activeIndex+1]+n.params.spaceBetween:0)-n.params.spaceBetween:n.minTranslate())&&n.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>n.minTranslate()&&(A=!1,i.resistance&&(r.currentTranslate=n.minTranslate()-1+(-n.minTranslate()+r.startTranslate+c)**v))):c<0&&(m&&x&&r.allowThresholdMove&&r.currentTranslate<(i.centeredSlides?n.maxTranslate()+n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween+(i.slidesPerView!=="auto"&&n.slides.length-i.slidesPerView>=2?n.slidesSizesGrid[n.slidesSizesGrid.length-1]+n.params.spaceBetween:0):n.maxTranslate())&&n.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:n.slides.length-(i.slidesPerView==="auto"?n.slidesPerViewDynamic():Math.ceil(parseFloat(i.slidesPerView,10)))}),r.currentTranslate<n.maxTranslate()&&(A=!1,i.resistance&&(r.currentTranslate=n.maxTranslate()+1-(n.maxTranslate()-r.startTranslate-c)**v))),A&&(o.preventedByNestedSwiper=!0),!n.allowSlideNext&&n.swipeDirection==="next"&&r.currentTranslate<r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&n.swipeDirection==="prev"&&r.currentTranslate>r.startTranslate&&(r.currentTranslate=r.startTranslate),!n.allowSlidePrev&&!n.allowSlideNext&&(r.currentTranslate=r.startTranslate),i.threshold>0)if(Math.abs(c)>i.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,r.currentTranslate=r.startTranslate,a.diff=n.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY;return}}else{r.currentTranslate=r.startTranslate;return}!i.followFinger||i.cssMode||((i.freeMode&&i.freeMode.enabled&&n.freeMode||i.watchSlidesProgress)&&(n.updateActiveIndex(),n.updateSlidesClasses()),i.freeMode&&i.freeMode.enabled&&n.freeMode&&n.freeMode.onTouchMove(),n.updateProgress(r.currentTranslate),n.setTranslate(r.currentTranslate))}function Ac(e){const t=this,n=t.touchEventsData;let r=e;r.originalEvent&&(r=r.originalEvent);let i;if(r.type==="touchend"||r.type==="touchcancel"){if(i=[...r.changedTouches].find(N=>N.identifier===n.touchId),!i||i.identifier!==n.touchId)return}else{if(n.touchId!==null||r.pointerId!==n.pointerId)return;i=r}if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(r.type)&&!(["pointercancel","contextmenu"].includes(r.type)&&(t.browser.isSafari||t.browser.isWebView)))return;n.pointerId=null,n.touchId=null;const{params:s,touches:u,rtlTranslate:o,slidesGrid:d,enabled:f}=t;if(!f||!s.simulateTouch&&r.pointerType==="mouse")return;if(n.allowTouchCallbacks&&t.emit("touchEnd",r),n.allowTouchCallbacks=!1,!n.isTouched){n.isMoved&&s.grabCursor&&t.setGrabCursor(!1),n.isMoved=!1,n.startMoving=!1;return}s.grabCursor&&n.isMoved&&n.isTouched&&(t.allowSlideNext===!0||t.allowSlidePrev===!0)&&t.setGrabCursor(!1);const h=ir(),g=h-n.touchStartTime;if(t.allowClick){const N=r.path||r.composedPath&&r.composedPath();t.updateClickedSlide(N&&N[0]||r.target,N),t.emit("tap click",r),g<300&&h-n.lastClickTime<300&&t.emit("doubleTap doubleClick",r)}if(n.lastClickTime=ir(),Pa(()=>{t.destroyed||(t.allowClick=!0)}),!n.isTouched||!n.isMoved||!t.swipeDirection||u.diff===0&&!n.loopSwapReset||n.currentTranslate===n.startTranslate&&!n.loopSwapReset){n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;return}n.isTouched=!1,n.isMoved=!1,n.startMoving=!1;let p;if(s.followFinger?p=o?t.translate:-t.translate:p=-n.currentTranslate,s.cssMode)return;if(s.freeMode&&s.freeMode.enabled){t.freeMode.onTouchEnd({currentPos:p});return}const c=p>=-t.maxTranslate()&&!t.params.loop;let E=0,b=t.slidesSizesGrid[0];for(let N=0;N<d.length;N+=N<s.slidesPerGroupSkip?1:s.slidesPerGroup){const F=N<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;typeof d[N+F]<"u"?(c||p>=d[N]&&p<d[N+F])&&(E=N,b=d[N+F]-d[N]):(c||p>=d[N])&&(E=N,b=d[d.length-1]-d[d.length-2])}let m=null,x=null;s.rewind&&(t.isBeginning?x=s.virtual&&s.virtual.enabled&&t.virtual?t.virtual.slides.length-1:t.slides.length-1:t.isEnd&&(m=0));const A=(p-d[E])/b,v=E<s.slidesPerGroupSkip-1?1:s.slidesPerGroup;if(g>s.longSwipesMs){if(!s.longSwipes){t.slideTo(t.activeIndex);return}t.swipeDirection==="next"&&(A>=s.longSwipesRatio?t.slideTo(s.rewind&&t.isEnd?m:E+v):t.slideTo(E)),t.swipeDirection==="prev"&&(A>1-s.longSwipesRatio?t.slideTo(E+v):x!==null&&A<0&&Math.abs(A)>s.longSwipesRatio?t.slideTo(x):t.slideTo(E))}else{if(!s.shortSwipes){t.slideTo(t.activeIndex);return}t.navigation&&(r.target===t.navigation.nextEl||r.target===t.navigation.prevEl)?r.target===t.navigation.nextEl?t.slideTo(E+v):t.slideTo(E):(t.swipeDirection==="next"&&t.slideTo(m!==null?m:E+v),t.swipeDirection==="prev"&&t.slideTo(x!==null?x:E))}}function za(){const e=this,{params:t,el:n}=e;if(n&&n.offsetWidth===0)return;t.breakpoints&&e.setBreakpoint();const{allowSlideNext:r,allowSlidePrev:i,snapGrid:a}=e,s=e.virtual&&e.params.virtual.enabled;e.allowSlideNext=!0,e.allowSlidePrev=!0,e.updateSize(),e.updateSlides(),e.updateSlidesClasses();const u=s&&t.loop;(t.slidesPerView==="auto"||t.slidesPerView>1)&&e.isEnd&&!e.isBeginning&&!e.params.centeredSlides&&!u?e.slideTo(e.slides.length-1,0,!1,!0):e.params.loop&&!s?e.slideToLoop(e.realIndex,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0),e.autoplay&&e.autoplay.running&&e.autoplay.paused&&(clearTimeout(e.autoplay.resizeTimeout),e.autoplay.resizeTimeout=setTimeout(()=>{e.autoplay&&e.autoplay.running&&e.autoplay.paused&&e.autoplay.resume()},500)),e.allowSlidePrev=i,e.allowSlideNext=r,e.params.watchOverflow&&a!==e.snapGrid&&e.checkOverflow()}function Cc(e){const t=this;t.enabled&&(t.allowClick||(t.params.preventClicks&&e.preventDefault(),t.params.preventClicksPropagation&&t.animating&&(e.stopPropagation(),e.stopImmediatePropagation())))}function Sc(){const e=this,{wrapperEl:t,rtlTranslate:n,enabled:r}=e;if(!r)return;e.previousTranslate=e.translate,e.isHorizontal()?e.translate=-t.scrollLeft:e.translate=-t.scrollTop,e.translate===0&&(e.translate=0),e.updateActiveIndex(),e.updateSlidesClasses();let i;const a=e.maxTranslate()-e.minTranslate();a===0?i=0:i=(e.translate-e.minTranslate())/a,i!==e.progress&&e.updateProgress(n?-e.translate:e.translate),e.emit("setTranslate",e.translate,!1)}function _c(e){const t=this;lr(t,e.target),!(t.params.cssMode||t.params.slidesPerView!=="auto"&&!t.params.autoHeight)&&t.update()}function Ic(){const e=this;e.documentTouchHandlerProceeded||(e.documentTouchHandlerProceeded=!0,e.params.touchReleaseOnEdges&&(e.el.style.touchAction="auto"))}const Va=(e,t)=>{const n=Vt(),{params:r,el:i,wrapperEl:a,device:s}=e,u=!!r.nested,o=t==="on"?"addEventListener":"removeEventListener",d=t;!i||typeof i=="string"||(n[o]("touchstart",e.onDocumentTouchStart,{passive:!1,capture:u}),i[o]("touchstart",e.onTouchStart,{passive:!1}),i[o]("pointerdown",e.onTouchStart,{passive:!1}),n[o]("touchmove",e.onTouchMove,{passive:!1,capture:u}),n[o]("pointermove",e.onTouchMove,{passive:!1,capture:u}),n[o]("touchend",e.onTouchEnd,{passive:!0}),n[o]("pointerup",e.onTouchEnd,{passive:!0}),n[o]("pointercancel",e.onTouchEnd,{passive:!0}),n[o]("touchcancel",e.onTouchEnd,{passive:!0}),n[o]("pointerout",e.onTouchEnd,{passive:!0}),n[o]("pointerleave",e.onTouchEnd,{passive:!0}),n[o]("contextmenu",e.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&i[o]("click",e.onClick,!0),r.cssMode&&a[o]("scroll",e.onScroll),r.updateOnWindowResize?e[d](s.ios||s.android?"resize orientationchange observerUpdate":"resize observerUpdate",za,!0):e[d]("observerUpdate",za,!0),i[o]("load",e.onLoad,{capture:!0}))};function Nc(){const e=this,{params:t}=e;e.onTouchStart=yc.bind(e),e.onTouchMove=xc.bind(e),e.onTouchEnd=Ac.bind(e),e.onDocumentTouchStart=Ic.bind(e),t.cssMode&&(e.onScroll=Sc.bind(e)),e.onClick=Cc.bind(e),e.onLoad=_c.bind(e),Va(e,"on")}function kc(){Va(this,"off")}var vc={attachEvents:Nc,detachEvents:kc};const Ya=(e,t)=>e.grid&&t.grid&&t.grid.rows>1;function wc(){const e=this,{realIndex:t,initialized:n,params:r,el:i}=e,a=r.breakpoints;if(!a||a&&Object.keys(a).length===0)return;const s=Vt(),u=r.breakpointsBase==="window"||!r.breakpointsBase?r.breakpointsBase:"container",o=["window","container"].includes(r.breakpointsBase)||!r.breakpointsBase?e.el:s.querySelector(r.breakpointsBase),d=e.getBreakpoint(a,u,o);if(!d||e.currentBreakpoint===d)return;const h=(d in a?a[d]:void 0)||e.originalParams,g=Ya(e,r),p=Ya(e,h),c=e.params.grabCursor,E=h.grabCursor,b=r.enabled;g&&!p?(i.classList.remove(`${r.containerModifierClass}grid`,`${r.containerModifierClass}grid-column`),e.emitContainerClasses()):!g&&p&&(i.classList.add(`${r.containerModifierClass}grid`),(h.grid.fill&&h.grid.fill==="column"||!h.grid.fill&&r.grid.fill==="column")&&i.classList.add(`${r.containerModifierClass}grid-column`),e.emitContainerClasses()),c&&!E?e.unsetGrabCursor():!c&&E&&e.setGrabCursor(),["navigation","pagination","scrollbar"].forEach(F=>{if(typeof h[F]>"u")return;const V=r[F]&&r[F].enabled,O=h[F]&&h[F].enabled;V&&!O&&e[F].disable(),!V&&O&&e[F].enable()});const m=h.direction&&h.direction!==r.direction,x=r.loop&&(h.slidesPerView!==r.slidesPerView||m),A=r.loop;m&&n&&e.changeDirection(),nt(e.params,h);const v=e.params.enabled,N=e.params.loop;Object.assign(e,{allowTouchMove:e.params.allowTouchMove,allowSlideNext:e.params.allowSlideNext,allowSlidePrev:e.params.allowSlidePrev}),b&&!v?e.disable():!b&&v&&e.enable(),e.currentBreakpoint=d,e.emit("_beforeBreakpoint",h),n&&(x?(e.loopDestroy(),e.loopCreate(t),e.updateSlides()):!A&&N?(e.loopCreate(t),e.updateSlides()):A&&!N&&e.loopDestroy()),e.emit("breakpoint",h)}function Lc(e,t="window",n){if(!e||t==="container"&&!n)return;let r=!1;const i=Je(),a=t==="window"?i.innerHeight:n.clientHeight,s=Object.keys(e).map(u=>{if(typeof u=="string"&&u.indexOf("@")===0){const o=parseFloat(u.substr(1));return{value:a*o,point:u}}return{value:u,point:u}});s.sort((u,o)=>parseInt(u.value,10)-parseInt(o.value,10));for(let u=0;u<s.length;u+=1){const{point:o,value:d}=s[u];t==="window"?i.matchMedia(`(min-width: ${d}px)`).matches&&(r=o):d<=n.clientWidth&&(r=o)}return r||"max"}var Oc={setBreakpoint:wc,getBreakpoint:Lc};function Dc(e,t){const n=[];return e.forEach(r=>{typeof r=="object"?Object.keys(r).forEach(i=>{r[i]&&n.push(t+i)}):typeof r=="string"&&n.push(t+r)}),n}function Pc(){const e=this,{classNames:t,params:n,rtl:r,el:i,device:a}=e,s=Dc(["initialized",n.direction,{"free-mode":e.params.freeMode&&n.freeMode.enabled},{autoheight:n.autoHeight},{rtl:r},{grid:n.grid&&n.grid.rows>1},{"grid-column":n.grid&&n.grid.rows>1&&n.grid.fill==="column"},{android:a.android},{ios:a.ios},{"css-mode":n.cssMode},{centered:n.cssMode&&n.centeredSlides},{"watch-progress":n.watchSlidesProgress}],n.containerModifierClass);t.push(...s),i.classList.add(...t),e.emitContainerClasses()}function Mc(){const e=this,{el:t,classNames:n}=e;!t||typeof t=="string"||(t.classList.remove(...n),e.emitContainerClasses())}var Rc={addClasses:Pc,removeClasses:Mc};function Bc(){const e=this,{isLocked:t,params:n}=e,{slidesOffsetBefore:r}=n;if(r){const i=e.slides.length-1,a=e.slidesGrid[i]+e.slidesSizesGrid[i]+r*2;e.isLocked=e.size>a}else e.isLocked=e.snapGrid.length===1;n.allowSlideNext===!0&&(e.allowSlideNext=!e.isLocked),n.allowSlidePrev===!0&&(e.allowSlidePrev=!e.isLocked),t&&t!==e.isLocked&&(e.isEnd=!1),t!==e.isLocked&&e.emit(e.isLocked?"lock":"unlock")}var Fc={checkOverflow:Bc},Jr={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};function Hc(e,t){return function(r={}){const i=Object.keys(r)[0],a=r[i];if(typeof a!="object"||a===null){nt(t,r);return}if(e[i]===!0&&(e[i]={enabled:!0}),i==="navigation"&&e[i]&&e[i].enabled&&!e[i].prevEl&&!e[i].nextEl&&(e[i].auto=!0),["pagination","scrollbar"].indexOf(i)>=0&&e[i]&&e[i].enabled&&!e[i].el&&(e[i].auto=!0),!(i in e&&"enabled"in a)){nt(t,r);return}typeof e[i]=="object"&&!("enabled"in e[i])&&(e[i].enabled=!0),e[i]||(e[i]={enabled:!1}),nt(t,r)}}const Zr={eventsEmitter:Rl,update:Wl,translate:Zl,transition:rc,slide:dc,loop:mc,grabCursor:bc,events:vc,breakpoints:Oc,checkOverflow:Fc,classes:Rc},ei={};let ti=class wt{constructor(...t){let n,r;t.length===1&&t[0].constructor&&Object.prototype.toString.call(t[0]).slice(8,-1)==="Object"?r=t[0]:[n,r]=t,r||(r={}),r=nt({},r),n&&!r.el&&(r.el=n);const i=Vt();if(r.el&&typeof r.el=="string"&&i.querySelectorAll(r.el).length>1){const o=[];return i.querySelectorAll(r.el).forEach(d=>{const f=nt({},r,{el:d});o.push(new wt(f))}),o}const a=this;a.__swiper__=!0,a.support=Ba(),a.device=Fa({userAgent:r.userAgent}),a.browser=Ha(),a.eventsListeners={},a.eventsAnyListeners=[],a.modules=[...a.__modules__],r.modules&&Array.isArray(r.modules)&&a.modules.push(...r.modules);const s={};a.modules.forEach(o=>{o({params:r,swiper:a,extendParams:Hc(r,s),on:a.on.bind(a),once:a.once.bind(a),off:a.off.bind(a),emit:a.emit.bind(a)})});const u=nt({},Jr,s);return a.params=nt({},u,ei,r),a.originalParams=nt({},a.params),a.passedParams=nt({},r),a.params&&a.params.on&&Object.keys(a.params.on).forEach(o=>{a.on(o,a.params.on[o])}),a.params&&a.params.onAny&&a.onAny(a.params.onAny),Object.assign(a,{enabled:a.params.enabled,el:n,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return a.params.direction==="horizontal"},isVertical(){return a.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:a.params.allowSlideNext,allowSlidePrev:a.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:a.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:a.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),a.emit("_swiper"),a.params.init&&a.init(),a}getDirectionLabel(t){return this.isHorizontal()?t:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[t]}getSlideIndex(t){const{slidesEl:n,params:r}=this,i=mt(n,`.${r.slideClass}, swiper-slide`),a=ur(i[0]);return ur(t)-a}getSlideIndexByData(t){return this.getSlideIndex(this.slides.find(n=>n.getAttribute("data-swiper-slide-index")*1===t))}getSlideIndexWhenGrid(t){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?t=Math.floor(t/this.params.grid.rows):this.params.grid.fill==="row"&&(t=t%Math.ceil(this.slides.length/this.params.grid.rows))),t}recalcSlides(){const t=this,{slidesEl:n,params:r}=t;t.slides=mt(n,`.${r.slideClass}, swiper-slide`)}enable(){const t=this;t.enabled||(t.enabled=!0,t.params.grabCursor&&t.setGrabCursor(),t.emit("enable"))}disable(){const t=this;t.enabled&&(t.enabled=!1,t.params.grabCursor&&t.unsetGrabCursor(),t.emit("disable"))}setProgress(t,n){const r=this;t=Math.min(Math.max(t,0),1);const i=r.minTranslate(),s=(r.maxTranslate()-i)*t+i;r.translateTo(s,typeof n>"u"?0:n),r.updateActiveIndex(),r.updateSlidesClasses()}emitContainerClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=t.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(t.params.containerModifierClass)===0);t.emit("_containerClasses",n.join(" "))}getSlideClasses(t){const n=this;return n.destroyed?"":t.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(n.params.slideClass)===0).join(" ")}emitSlidesClasses(){const t=this;if(!t.params._emitClasses||!t.el)return;const n=[];t.slides.forEach(r=>{const i=t.getSlideClasses(r);n.push({slideEl:r,classNames:i}),t.emit("_slideClass",r,i)}),t.emit("_slideClasses",n)}slidesPerViewDynamic(t="current",n=!1){const r=this,{params:i,slides:a,slidesGrid:s,slidesSizesGrid:u,size:o,activeIndex:d}=r;let f=1;if(typeof i.slidesPerView=="number")return i.slidesPerView;if(i.centeredSlides){let h=a[d]?Math.ceil(a[d].swiperSlideSize):0,g;for(let p=d+1;p<a.length;p+=1)a[p]&&!g&&(h+=Math.ceil(a[p].swiperSlideSize),f+=1,h>o&&(g=!0));for(let p=d-1;p>=0;p-=1)a[p]&&!g&&(h+=a[p].swiperSlideSize,f+=1,h>o&&(g=!0))}else if(t==="current")for(let h=d+1;h<a.length;h+=1)(n?s[h]+u[h]-s[d]<o:s[h]-s[d]<o)&&(f+=1);else for(let h=d-1;h>=0;h-=1)s[d]-s[h]<o&&(f+=1);return f}update(){const t=this;if(!t||t.destroyed)return;const{snapGrid:n,params:r}=t;r.breakpoints&&t.setBreakpoint(),[...t.el.querySelectorAll('[loading="lazy"]')].forEach(s=>{s.complete&&lr(t,s)}),t.updateSize(),t.updateSlides(),t.updateProgress(),t.updateSlidesClasses();function i(){const s=t.rtlTranslate?t.translate*-1:t.translate,u=Math.min(Math.max(s,t.maxTranslate()),t.minTranslate());t.setTranslate(u),t.updateActiveIndex(),t.updateSlidesClasses()}let a;if(r.freeMode&&r.freeMode.enabled&&!r.cssMode)i(),r.autoHeight&&t.updateAutoHeight();else{if((r.slidesPerView==="auto"||r.slidesPerView>1)&&t.isEnd&&!r.centeredSlides){const s=t.virtual&&r.virtual.enabled?t.virtual.slides:t.slides;a=t.slideTo(s.length-1,0,!1,!0)}else a=t.slideTo(t.activeIndex,0,!1,!0);a||i()}r.watchOverflow&&n!==t.snapGrid&&t.checkOverflow(),t.emit("update")}changeDirection(t,n=!0){const r=this,i=r.params.direction;return t||(t=i==="horizontal"?"vertical":"horizontal"),t===i||t!=="horizontal"&&t!=="vertical"||(r.el.classList.remove(`${r.params.containerModifierClass}${i}`),r.el.classList.add(`${r.params.containerModifierClass}${t}`),r.emitContainerClasses(),r.params.direction=t,r.slides.forEach(a=>{t==="vertical"?a.style.width="":a.style.height=""}),r.emit("changeDirection"),n&&r.update()),r}changeLanguageDirection(t){const n=this;n.rtl&&t==="rtl"||!n.rtl&&t==="ltr"||(n.rtl=t==="rtl",n.rtlTranslate=n.params.direction==="horizontal"&&n.rtl,n.rtl?(n.el.classList.add(`${n.params.containerModifierClass}rtl`),n.el.dir="rtl"):(n.el.classList.remove(`${n.params.containerModifierClass}rtl`),n.el.dir="ltr"),n.update())}mount(t){const n=this;if(n.mounted)return!0;let r=t||n.params.el;if(typeof r=="string"&&(r=document.querySelector(r)),!r)return!1;r.swiper=n,r.parentNode&&r.parentNode.host&&r.parentNode.host.nodeName===n.params.swiperElementNodeName.toUpperCase()&&(n.isElement=!0);const i=()=>`.${(n.params.wrapperClass||"").trim().split(" ").join(".")}`;let s=r&&r.shadowRoot&&r.shadowRoot.querySelector?r.shadowRoot.querySelector(i()):mt(r,i())[0];return!s&&n.params.createElements&&(s=or("div",n.params.wrapperClass),r.append(s),mt(r,`.${n.params.slideClass}`).forEach(u=>{s.append(u)})),Object.assign(n,{el:r,wrapperEl:s,slidesEl:n.isElement&&!r.parentNode.host.slideSlots?r.parentNode.host:s,hostEl:n.isElement?r.parentNode.host:r,mounted:!0,rtl:r.dir.toLowerCase()==="rtl"||Ot(r,"direction")==="rtl",rtlTranslate:n.params.direction==="horizontal"&&(r.dir.toLowerCase()==="rtl"||Ot(r,"direction")==="rtl"),wrongRTL:Ot(s,"display")==="-webkit-box"}),!0}init(t){const n=this;if(n.initialized||n.mount(t)===!1)return n;n.emit("beforeInit"),n.params.breakpoints&&n.setBreakpoint(),n.addClasses(),n.updateSize(),n.updateSlides(),n.params.watchOverflow&&n.checkOverflow(),n.params.grabCursor&&n.enabled&&n.setGrabCursor(),n.params.loop&&n.virtual&&n.params.virtual.enabled?n.slideTo(n.params.initialSlide+n.virtual.slidesBefore,0,n.params.runCallbacksOnInit,!1,!0):n.slideTo(n.params.initialSlide,0,n.params.runCallbacksOnInit,!1,!0),n.params.loop&&n.loopCreate(void 0,!0),n.attachEvents();const i=[...n.el.querySelectorAll('[loading="lazy"]')];return n.isElement&&i.push(...n.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach(a=>{a.complete?lr(n,a):a.addEventListener("load",s=>{lr(n,s.target)})}),Qr(n),n.initialized=!0,Qr(n),n.emit("init"),n.emit("afterInit"),n}destroy(t=!0,n=!0){const r=this,{params:i,el:a,wrapperEl:s,slides:u}=r;return typeof r.params>"u"||r.destroyed||(r.emit("beforeDestroy"),r.initialized=!1,r.detachEvents(),i.loop&&r.loopDestroy(),n&&(r.removeClasses(),a&&typeof a!="string"&&a.removeAttribute("style"),s&&s.removeAttribute("style"),u&&u.length&&u.forEach(o=>{o.classList.remove(i.slideVisibleClass,i.slideFullyVisibleClass,i.slideActiveClass,i.slideNextClass,i.slidePrevClass),o.removeAttribute("style"),o.removeAttribute("data-swiper-slide-index")})),r.emit("destroy"),Object.keys(r.eventsListeners).forEach(o=>{r.off(o)}),t!==!1&&(r.el&&typeof r.el!="string"&&(r.el.swiper=null),Cl(r)),r.destroyed=!0),null}static extendDefaults(t){nt(ei,t)}static get extendedDefaults(){return ei}static get defaults(){return Jr}static installModule(t){wt.prototype.__modules__||(wt.prototype.__modules__=[]);const n=wt.prototype.__modules__;typeof t=="function"&&n.indexOf(t)<0&&n.push(t)}static use(t){return Array.isArray(t)?(t.forEach(n=>wt.installModule(n)),wt):(wt.installModule(t),wt)}};Object.keys(Zr).forEach(e=>{Object.keys(Zr[e]).forEach(t=>{ti.prototype[t]=Zr[e][t]})}),ti.use([Pl,Ml]);const Ga=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function Yt(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function nn(e,t){const n=["__proto__","constructor","prototype"];Object.keys(t).filter(r=>n.indexOf(r)<0).forEach(r=>{typeof e[r]>"u"?e[r]=t[r]:Yt(t[r])&&Yt(e[r])&&Object.keys(t[r]).length>0?t[r].__swiper__?e[r]=t[r]:nn(e[r],t[r]):e[r]=t[r]})}function Wa(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function ja(e={}){return e.pagination&&typeof e.pagination.el>"u"}function Xa(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function Ka(e=""){const t=e.split(" ").map(r=>r.trim()).filter(r=>!!r),n=[];return t.forEach(r=>{n.indexOf(r)<0&&n.push(r)}),n.join(" ")}function Uc(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function $c({swiper:e,slides:t,passedParams:n,changedParams:r,nextEl:i,prevEl:a,scrollbarEl:s,paginationEl:u}){const o=r.filter(O=>O!=="children"&&O!=="direction"&&O!=="wrapperClass"),{params:d,pagination:f,navigation:h,scrollbar:g,virtual:p,thumbs:c}=e;let E,b,m,x,A,v,N,F;r.includes("thumbs")&&n.thumbs&&n.thumbs.swiper&&!n.thumbs.swiper.destroyed&&d.thumbs&&(!d.thumbs.swiper||d.thumbs.swiper.destroyed)&&(E=!0),r.includes("controller")&&n.controller&&n.controller.control&&d.controller&&!d.controller.control&&(b=!0),r.includes("pagination")&&n.pagination&&(n.pagination.el||u)&&(d.pagination||d.pagination===!1)&&f&&!f.el&&(m=!0),r.includes("scrollbar")&&n.scrollbar&&(n.scrollbar.el||s)&&(d.scrollbar||d.scrollbar===!1)&&g&&!g.el&&(x=!0),r.includes("navigation")&&n.navigation&&(n.navigation.prevEl||a)&&(n.navigation.nextEl||i)&&(d.navigation||d.navigation===!1)&&h&&!h.prevEl&&!h.nextEl&&(A=!0);const V=O=>{e[O]&&(e[O].destroy(),O==="navigation"?(e.isElement&&(e[O].prevEl.remove(),e[O].nextEl.remove()),d[O].prevEl=void 0,d[O].nextEl=void 0,e[O].prevEl=void 0,e[O].nextEl=void 0):(e.isElement&&e[O].el.remove(),d[O].el=void 0,e[O].el=void 0))};r.includes("loop")&&e.isElement&&(d.loop&&!n.loop?v=!0:!d.loop&&n.loop?N=!0:F=!0),o.forEach(O=>{if(Yt(d[O])&&Yt(n[O]))Object.assign(d[O],n[O]),(O==="navigation"||O==="pagination"||O==="scrollbar")&&"enabled"in n[O]&&!n[O].enabled&&V(O);else{const w=n[O];(w===!0||w===!1)&&(O==="navigation"||O==="pagination"||O==="scrollbar")?w===!1&&V(O):d[O]=n[O]}}),o.includes("controller")&&!b&&e.controller&&e.controller.control&&d.controller&&d.controller.control&&(e.controller.control=d.controller.control),r.includes("children")&&t&&p&&d.virtual.enabled?(p.slides=t,p.update(!0)):r.includes("virtual")&&p&&d.virtual.enabled&&(t&&(p.slides=t),p.update(!0)),r.includes("children")&&t&&d.loop&&(F=!0),E&&c.init()&&c.update(!0),b&&(e.controller.control=d.controller.control),m&&(e.isElement&&(!u||typeof u=="string")&&(u=document.createElement("div"),u.classList.add("swiper-pagination"),u.part.add("pagination"),e.el.appendChild(u)),u&&(d.pagination.el=u),f.init(),f.render(),f.update()),x&&(e.isElement&&(!s||typeof s=="string")&&(s=document.createElement("div"),s.classList.add("swiper-scrollbar"),s.part.add("scrollbar"),e.el.appendChild(s)),s&&(d.scrollbar.el=s),g.init(),g.updateSize(),g.setTranslate()),A&&(e.isElement&&((!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-next"),Cn(i,e.navigation.arrowSvg),i.part.add("button-next"),e.el.appendChild(i)),(!a||typeof a=="string")&&(a=document.createElement("div"),a.classList.add("swiper-button-prev"),Cn(a,e.navigation.arrowSvg),a.part.add("button-prev"),e.el.appendChild(a))),i&&(d.navigation.nextEl=i),a&&(d.navigation.prevEl=a),h.init(),h.update()),r.includes("allowSlideNext")&&(e.allowSlideNext=n.allowSlideNext),r.includes("allowSlidePrev")&&(e.allowSlidePrev=n.allowSlidePrev),r.includes("direction")&&e.changeDirection(n.direction,!1),(v||F)&&e.loopDestroy(),(N||F)&&e.loopCreate(),e.update()}function qc(e={},t=!0){const n={on:{}},r={},i={};nn(n,Jr),n._emitClasses=!0,n.init=!1;const a={},s=Ga.map(o=>o.replace(/_/,"")),u=Object.assign({},e);return Object.keys(u).forEach(o=>{typeof e[o]>"u"||(s.indexOf(o)>=0?Yt(e[o])?(n[o]={},i[o]={},nn(n[o],e[o]),nn(i[o],e[o])):(n[o]=e[o],i[o]=e[o]):o.search(/on[A-Z]/)===0&&typeof e[o]=="function"?t?r[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:n.on[`${o[2].toLowerCase()}${o.substr(3)}`]=e[o]:a[o]=e[o])}),["navigation","pagination","scrollbar"].forEach(o=>{n[o]===!0&&(n[o]={}),n[o]===!1&&delete n[o]}),{params:n,passedParams:i,rest:a,events:r}}function zc({el:e,nextEl:t,prevEl:n,paginationEl:r,scrollbarEl:i,swiper:a},s){Wa(s)&&t&&n&&(a.params.navigation.nextEl=t,a.originalParams.navigation.nextEl=t,a.params.navigation.prevEl=n,a.originalParams.navigation.prevEl=n),ja(s)&&r&&(a.params.pagination.el=r,a.originalParams.pagination.el=r),Xa(s)&&i&&(a.params.scrollbar.el=i,a.originalParams.scrollbar.el=i),a.init(e)}function Vc(e,t,n,r,i){const a=[];if(!t)return a;const s=o=>{a.indexOf(o)<0&&a.push(o)};if(n&&r){const o=r.map(i),d=n.map(i);o.join("")!==d.join("")&&s("children"),r.length!==n.length&&s("children")}return Ga.filter(o=>o[0]==="_").map(o=>o.replace(/_/,"")).forEach(o=>{if(o in e&&o in t)if(Yt(e[o])&&Yt(t[o])){const d=Object.keys(e[o]),f=Object.keys(t[o]);d.length!==f.length?s(o):(d.forEach(h=>{e[o][h]!==t[o][h]&&s(o)}),f.forEach(h=>{e[o][h]!==t[o][h]&&s(o)}))}else e[o]!==t[o]&&s(o)}),a}const Yc=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function cr(){return cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cr.apply(this,arguments)}function Qa(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function Ja(e){const t=[];return P.Children.toArray(e).forEach(n=>{Qa(n)?t.push(n):n.props&&n.props.children&&Ja(n.props.children).forEach(r=>t.push(r))}),t}function Gc(e){const t=[],n={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return P.Children.toArray(e).forEach(r=>{if(Qa(r))t.push(r);else if(r.props&&r.props.slot&&n[r.props.slot])n[r.props.slot].push(r);else if(r.props&&r.props.children){const i=Ja(r.props.children);i.length>0?i.forEach(a=>t.push(a)):n["container-end"].push(r)}else n["container-end"].push(r)}),{slides:t,slots:n}}function Wc(e,t,n){if(!n)return null;const r=f=>{let h=f;return f<0?h=t.length+f:h>=t.length&&(h=h-t.length),h},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${n.offset}px`}:{top:`${n.offset}px`},{from:a,to:s}=n,u=e.params.loop?-t.length:0,o=e.params.loop?t.length*2:t.length,d=[];for(let f=u;f<o;f+=1)f>=a&&f<=s&&d.push(t[r(f)]);return d.map((f,h)=>P.cloneElement(f,{swiper:e,style:i,key:f.props.virtualIndex||f.key||`slide-${h}`}))}function Sn(e,t){return typeof window>"u"?P.useEffect(e,t):P.useLayoutEffect(e,t)}const Za=P.createContext(null),jc=P.createContext(null),es=P.forwardRef(({className:e,tag:t="div",wrapperTag:n="div",children:r,onSwiper:i,...a}={},s)=>{let u=!1;const[o,d]=P.useState("swiper"),[f,h]=P.useState(null),[g,p]=P.useState(!1),c=P.useRef(!1),E=P.useRef(null),b=P.useRef(null),m=P.useRef(null),x=P.useRef(null),A=P.useRef(null),v=P.useRef(null),N=P.useRef(null),F=P.useRef(null),{params:V,passedParams:O,rest:w,events:H}=qc(a),{slides:y,slots:M}=Gc(r),U=()=>{p(!g)};Object.assign(V.on,{_containerClasses(z,te){d(te)}});const I=()=>{Object.assign(V.on,H),u=!0;const z={...V};if(delete z.wrapperClass,b.current=new ti(z),b.current.virtual&&b.current.params.virtual.enabled){b.current.virtual.slides=y;const te={cache:!1,slides:y,renderExternal:h,renderExternalUpdate:!1};nn(b.current.params.virtual,te),nn(b.current.originalParams.virtual,te)}};E.current||I(),b.current&&b.current.on("_beforeBreakpoint",U);const T=()=>{u||!H||!b.current||Object.keys(H).forEach(z=>{b.current.on(z,H[z])})},$=()=>{!H||!b.current||Object.keys(H).forEach(z=>{b.current.off(z,H[z])})};P.useEffect(()=>()=>{b.current&&b.current.off("_beforeBreakpoint",U)}),P.useEffect(()=>{!c.current&&b.current&&(b.current.emitSlidesClasses(),c.current=!0)}),Sn(()=>{if(s&&(s.current=E.current),!!E.current)return b.current.destroyed&&I(),zc({el:E.current,nextEl:A.current,prevEl:v.current,paginationEl:N.current,scrollbarEl:F.current,swiper:b.current},V),i&&!b.current.destroyed&&i(b.current),()=>{b.current&&!b.current.destroyed&&b.current.destroy(!0,!1)}},[]),Sn(()=>{T();const z=Vc(O,m.current,y,x.current,te=>te.key);return m.current=O,x.current=y,z.length&&b.current&&!b.current.destroyed&&$c({swiper:b.current,slides:y,passedParams:O,changedParams:z,nextEl:A.current,prevEl:v.current,scrollbarEl:F.current,paginationEl:N.current}),()=>{$()}}),Sn(()=>{Yc(b.current)},[f]);function Q(){return V.virtual?Wc(b.current,y,f):y.map((z,te)=>P.cloneElement(z,{swiper:b.current,swiperSlideIndex:te}))}return P.createElement(t,cr({ref:E,className:Ka(`${o}${e?` ${e}`:""}`)},w),P.createElement(jc.Provider,{value:b.current},M["container-start"],P.createElement(n,{className:Uc(V.wrapperClass)},M["wrapper-start"],Q(),M["wrapper-end"]),Wa(V)&&P.createElement(P.Fragment,null,P.createElement("div",{ref:v,className:"swiper-button-prev"}),P.createElement("div",{ref:A,className:"swiper-button-next"})),Xa(V)&&P.createElement("div",{ref:F,className:"swiper-scrollbar"}),ja(V)&&P.createElement("div",{ref:N,className:"swiper-pagination"}),M["container-end"]))});es.displayName="Swiper";const ts=P.forwardRef(({tag:e="div",children:t,className:n="",swiper:r,zoom:i,lazy:a,virtualIndex:s,swiperSlideIndex:u,...o}={},d)=>{const f=P.useRef(null),[h,g]=P.useState("swiper-slide"),[p,c]=P.useState(!1);function E(A,v,N){v===f.current&&g(N)}Sn(()=>{if(typeof u<"u"&&(f.current.swiperSlideIndex=u),d&&(d.current=f.current),!(!f.current||!r)){if(r.destroyed){h!=="swiper-slide"&&g("swiper-slide");return}return r.on("_slideClass",E),()=>{r&&r.off("_slideClass",E)}}}),Sn(()=>{r&&f.current&&!r.destroyed&&g(r.getSlideClasses(f.current))},[r]);const b={isActive:h.indexOf("swiper-slide-active")>=0,isVisible:h.indexOf("swiper-slide-visible")>=0,isPrev:h.indexOf("swiper-slide-prev")>=0,isNext:h.indexOf("swiper-slide-next")>=0},m=()=>typeof t=="function"?t(b):t,x=()=>{c(!0)};return P.createElement(e,cr({ref:f,className:Ka(`${h}${n?` ${n}`:""}`),"data-swiper-slide-index":s,onLoad:x},o),i&&P.createElement(Za.Provider,{value:b},P.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof i=="number"?i:void 0},m(),a&&!p&&P.createElement("div",{className:"swiper-lazy-preloader",ref:A=>{A&&(A.lazyPreloaderManaged=!0)}}))),!i&&P.createElement(Za.Provider,{value:b},m(),a&&!p&&P.createElement("div",{className:"swiper-lazy-preloader",ref:A=>{A&&(A.lazyPreloaderManaged=!0)}})))});ts.displayName="SwiperSlide";function ns(e,t,n,r){return e.params.createElements&&Object.keys(r).forEach(i=>{if(!n[i]&&n.auto===!0){let a=mt(e.el,`.${r[i]}`)[0];a||(a=or("div",r[i]),a.className=r[i],e.el.append(a)),n[i]=a,t[i]=a}}),n}const rs='<svg class="swiper-navigation-icon" width="11" height="20" viewBox="0 0 11 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.38296 20.0762C0.111788 19.805 0.111788 19.3654 0.38296 19.0942L9.19758 10.2796L0.38296 1.46497C0.111788 1.19379 0.111788 0.754138 0.38296 0.482966C0.654131 0.211794 1.09379 0.211794 1.36496 0.482966L10.4341 9.55214C10.8359 9.9539 10.8359 10.6053 10.4341 11.007L1.36496 20.0762C1.09379 20.3474 0.654131 20.3474 0.38296 20.0762Z" fill="currentColor"/></svg>';function Xc({swiper:e,extendParams:t,on:n,emit:r}){t({navigation:{nextEl:null,prevEl:null,addIcons:!0,hideOnClick:!1,disabledClass:"swiper-button-disabled",hiddenClass:"swiper-button-hidden",lockClass:"swiper-button-lock",navigationDisabledClass:"swiper-navigation-disabled"}}),e.navigation={nextEl:null,prevEl:null,arrowSvg:rs};function i(p){let c;return p&&typeof p=="string"&&e.isElement&&(c=e.el.querySelector(p)||e.hostEl.querySelector(p),c)?c:(p&&(typeof p=="string"&&(c=[...document.querySelectorAll(p)]),e.params.uniqueNavElements&&typeof p=="string"&&c&&c.length>1&&e.el.querySelectorAll(p).length===1?c=e.el.querySelector(p):c&&c.length===1&&(c=c[0])),p&&!c?p:c)}function a(p,c){const E=e.params.navigation;p=Ve(p),p.forEach(b=>{b&&(b.classList[c?"add":"remove"](...E.disabledClass.split(" ")),b.tagName==="BUTTON"&&(b.disabled=c),e.params.watchOverflow&&e.enabled&&b.classList[e.isLocked?"add":"remove"](E.lockClass))})}function s(){const{nextEl:p,prevEl:c}=e.navigation;if(e.params.loop){a(c,!1),a(p,!1);return}a(c,e.isBeginning&&!e.params.rewind),a(p,e.isEnd&&!e.params.rewind)}function u(p){p.preventDefault(),!(e.isBeginning&&!e.params.loop&&!e.params.rewind)&&(e.slidePrev(),r("navigationPrev"))}function o(p){p.preventDefault(),!(e.isEnd&&!e.params.loop&&!e.params.rewind)&&(e.slideNext(),r("navigationNext"))}function d(){const p=e.params.navigation;if(e.params.navigation=ns(e,e.originalParams.navigation,e.params.navigation,{nextEl:"swiper-button-next",prevEl:"swiper-button-prev"}),!(p.nextEl||p.prevEl))return;let c=i(p.nextEl),E=i(p.prevEl);Object.assign(e.navigation,{nextEl:c,prevEl:E}),c=Ve(c),E=Ve(E);const b=(m,x)=>{if(m){if(p.addIcons&&m.matches(".swiper-button-next,.swiper-button-prev")&&!m.querySelector("svg")){const A=document.createElement("div");Cn(A,rs),m.appendChild(A.querySelector("svg")),A.remove()}m.addEventListener("click",x==="next"?o:u)}!e.enabled&&m&&m.classList.add(...p.lockClass.split(" "))};c.forEach(m=>b(m,"next")),E.forEach(m=>b(m,"prev"))}function f(){let{nextEl:p,prevEl:c}=e.navigation;p=Ve(p),c=Ve(c);const E=(b,m)=>{b.removeEventListener("click",m==="next"?o:u),b.classList.remove(...e.params.navigation.disabledClass.split(" "))};p.forEach(b=>E(b,"next")),c.forEach(b=>E(b,"prev"))}n("init",()=>{e.params.navigation.enabled===!1?g():(d(),s())}),n("toEdge fromEdge lock unlock",()=>{s()}),n("destroy",()=>{f()}),n("enable disable",()=>{let{nextEl:p,prevEl:c}=e.navigation;if(p=Ve(p),c=Ve(c),e.enabled){s();return}[...p,...c].filter(E=>!!E).forEach(E=>E.classList.add(e.params.navigation.lockClass))}),n("click",(p,c)=>{let{nextEl:E,prevEl:b}=e.navigation;E=Ve(E),b=Ve(b);const m=c.target;let x=b.includes(m)||E.includes(m);if(e.isElement&&!x){const A=c.path||c.composedPath&&c.composedPath();A&&(x=A.find(v=>E.includes(v)||b.includes(v)))}if(e.params.navigation.hideOnClick&&!x){if(e.pagination&&e.params.pagination&&e.params.pagination.clickable&&(e.pagination.el===m||e.pagination.el.contains(m)))return;let A;E.length?A=E[0].classList.contains(e.params.navigation.hiddenClass):b.length&&(A=b[0].classList.contains(e.params.navigation.hiddenClass)),r(A===!0?"navigationShow":"navigationHide"),[...E,...b].filter(v=>!!v).forEach(v=>v.classList.toggle(e.params.navigation.hiddenClass))}});const h=()=>{e.el.classList.remove(...e.params.navigation.navigationDisabledClass.split(" ")),d(),s()},g=()=>{e.el.classList.add(...e.params.navigation.navigationDisabledClass.split(" ")),f()};Object.assign(e.navigation,{enable:h,disable:g,update:s,init:d,destroy:f})}function _n(e=""){return`.${e.trim().replace(/([\.:!+\/()[\]#>~*^$|=,'"@{}\\])/g,"\\$1").replace(/ /g,".")}`}function Kc({swiper:e,extendParams:t,on:n,emit:r}){const i="swiper-pagination";t({pagination:{el:null,bulletElement:"span",clickable:!1,hideOnClick:!1,renderBullet:null,renderProgressbar:null,renderFraction:null,renderCustom:null,progressbarOpposite:!1,type:"bullets",dynamicBullets:!1,dynamicMainBullets:1,formatFractionCurrent:m=>m,formatFractionTotal:m=>m,bulletClass:`${i}-bullet`,bulletActiveClass:`${i}-bullet-active`,modifierClass:`${i}-`,currentClass:`${i}-current`,totalClass:`${i}-total`,hiddenClass:`${i}-hidden`,progressbarFillClass:`${i}-progressbar-fill`,progressbarOppositeClass:`${i}-progressbar-opposite`,clickableClass:`${i}-clickable`,lockClass:`${i}-lock`,horizontalClass:`${i}-horizontal`,verticalClass:`${i}-vertical`,paginationDisabledClass:`${i}-disabled`}}),e.pagination={el:null,bullets:[]};let a,s=0;function u(){return!e.params.pagination.el||!e.pagination.el||Array.isArray(e.pagination.el)&&e.pagination.el.length===0}function o(m,x){const{bulletActiveClass:A}=e.params.pagination;m&&(m=m[`${x==="prev"?"previous":"next"}ElementSibling`],m&&(m.classList.add(`${A}-${x}`),m=m[`${x==="prev"?"previous":"next"}ElementSibling`],m&&m.classList.add(`${A}-${x}-${x}`)))}function d(m,x,A){if(m=m%A,x=x%A,x===m+1)return"next";if(x===m-1)return"previous"}function f(m){const x=m.target.closest(_n(e.params.pagination.bulletClass));if(!x)return;m.preventDefault();const A=ur(x)*e.params.slidesPerGroup;if(e.params.loop){if(e.realIndex===A)return;const v=d(e.realIndex,A,e.slides.length);v==="next"?e.slideNext():v==="previous"?e.slidePrev():e.slideToLoop(A)}else e.slideTo(A)}function h(){const m=e.rtl,x=e.params.pagination;if(u())return;let A=e.pagination.el;A=Ve(A);let v,N;const F=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.slides.length,V=e.params.loop?Math.ceil(F/e.params.slidesPerGroup):e.snapGrid.length;if(e.params.loop?(N=e.previousRealIndex||0,v=e.params.slidesPerGroup>1?Math.floor(e.realIndex/e.params.slidesPerGroup):e.realIndex):typeof e.snapIndex<"u"?(v=e.snapIndex,N=e.previousSnapIndex):(N=e.previousIndex||0,v=e.activeIndex||0),x.type==="bullets"&&e.pagination.bullets&&e.pagination.bullets.length>0){const O=e.pagination.bullets;let w,H,y;if(x.dynamicBullets&&(a=Yr(O[0],e.isHorizontal()?"width":"height"),A.forEach(M=>{M.style[e.isHorizontal()?"width":"height"]=`${a*(x.dynamicMainBullets+4)}px`}),x.dynamicMainBullets>1&&N!==void 0&&(s+=v-(N||0),s>x.dynamicMainBullets-1?s=x.dynamicMainBullets-1:s<0&&(s=0)),w=Math.max(v-s,0),H=w+(Math.min(O.length,x.dynamicMainBullets)-1),y=(H+w)/2),O.forEach(M=>{const U=[...["","-next","-next-next","-prev","-prev-prev","-main"].map(I=>`${x.bulletActiveClass}${I}`)].map(I=>typeof I=="string"&&I.includes(" ")?I.split(" "):I).flat();M.classList.remove(...U)}),A.length>1)O.forEach(M=>{const U=ur(M);U===v?M.classList.add(...x.bulletActiveClass.split(" ")):e.isElement&&M.setAttribute("part","bullet"),x.dynamicBullets&&(U>=w&&U<=H&&M.classList.add(...`${x.bulletActiveClass}-main`.split(" ")),U===w&&o(M,"prev"),U===H&&o(M,"next"))});else{const M=O[v];if(M&&M.classList.add(...x.bulletActiveClass.split(" ")),e.isElement&&O.forEach((U,I)=>{U.setAttribute("part",I===v?"bullet-active":"bullet")}),x.dynamicBullets){const U=O[w],I=O[H];for(let T=w;T<=H;T+=1)O[T]&&O[T].classList.add(...`${x.bulletActiveClass}-main`.split(" "));o(U,"prev"),o(I,"next")}}if(x.dynamicBullets){const M=Math.min(O.length,x.dynamicMainBullets+4),U=(a*M-a)/2-y*a,I=m?"right":"left";O.forEach(T=>{T.style[e.isHorizontal()?I:"top"]=`${U}px`})}}A.forEach((O,w)=>{if(x.type==="fraction"&&(O.querySelectorAll(_n(x.currentClass)).forEach(H=>{H.textContent=x.formatFractionCurrent(v+1)}),O.querySelectorAll(_n(x.totalClass)).forEach(H=>{H.textContent=x.formatFractionTotal(V)})),x.type==="progressbar"){let H;x.progressbarOpposite?H=e.isHorizontal()?"vertical":"horizontal":H=e.isHorizontal()?"horizontal":"vertical";const y=(v+1)/V;let M=1,U=1;H==="horizontal"?M=y:U=y,O.querySelectorAll(_n(x.progressbarFillClass)).forEach(I=>{I.style.transform=`translate3d(0,0,0) scaleX(${M}) scaleY(${U})`,I.style.transitionDuration=`${e.params.speed}ms`})}x.type==="custom"&&x.renderCustom?(Cn(O,x.renderCustom(e,v+1,V)),w===0&&r("paginationRender",O)):(w===0&&r("paginationRender",O),r("paginationUpdate",O)),e.params.watchOverflow&&e.enabled&&O.classList[e.isLocked?"add":"remove"](x.lockClass)})}function g(){const m=e.params.pagination;if(u())return;const x=e.virtual&&e.params.virtual.enabled?e.virtual.slides.length:e.grid&&e.params.grid.rows>1?e.slides.length/Math.ceil(e.params.grid.rows):e.slides.length;let A=e.pagination.el;A=Ve(A);let v="";if(m.type==="bullets"){let N=e.params.loop?Math.ceil(x/e.params.slidesPerGroup):e.snapGrid.length;e.params.freeMode&&e.params.freeMode.enabled&&N>x&&(N=x);for(let F=0;F<N;F+=1)m.renderBullet?v+=m.renderBullet.call(e,F,m.bulletClass):v+=`<${m.bulletElement} ${e.isElement?'part="bullet"':""} class="${m.bulletClass}"></${m.bulletElement}>`}m.type==="fraction"&&(m.renderFraction?v=m.renderFraction.call(e,m.currentClass,m.totalClass):v=`<span class="${m.currentClass}"></span> / <span class="${m.totalClass}"></span>`),m.type==="progressbar"&&(m.renderProgressbar?v=m.renderProgressbar.call(e,m.progressbarFillClass):v=`<span class="${m.progressbarFillClass}"></span>`),e.pagination.bullets=[],A.forEach(N=>{m.type!=="custom"&&Cn(N,v||""),m.type==="bullets"&&e.pagination.bullets.push(...N.querySelectorAll(_n(m.bulletClass)))}),m.type!=="custom"&&r("paginationRender",A[0])}function p(){e.params.pagination=ns(e,e.originalParams.pagination,e.params.pagination,{el:"swiper-pagination"});const m=e.params.pagination;if(!m.el)return;let x;typeof m.el=="string"&&e.isElement&&(x=e.el.querySelector(m.el)),!x&&typeof m.el=="string"&&(x=[...document.querySelectorAll(m.el)]),x||(x=m.el),!(!x||x.length===0)&&(e.params.uniqueNavElements&&typeof m.el=="string"&&Array.isArray(x)&&x.length>1&&(x=[...e.el.querySelectorAll(m.el)],x.length>1&&(x=x.find(A=>Ra(A,".swiper")[0]===e.el))),Array.isArray(x)&&x.length===1&&(x=x[0]),Object.assign(e.pagination,{el:x}),x=Ve(x),x.forEach(A=>{m.type==="bullets"&&m.clickable&&A.classList.add(...(m.clickableClass||"").split(" ")),A.classList.add(m.modifierClass+m.type),A.classList.add(e.isHorizontal()?m.horizontalClass:m.verticalClass),m.type==="bullets"&&m.dynamicBullets&&(A.classList.add(`${m.modifierClass}${m.type}-dynamic`),s=0,m.dynamicMainBullets<1&&(m.dynamicMainBullets=1)),m.type==="progressbar"&&m.progressbarOpposite&&A.classList.add(m.progressbarOppositeClass),m.clickable&&A.addEventListener("click",f),e.enabled||A.classList.add(m.lockClass)}))}function c(){const m=e.params.pagination;if(u())return;let x=e.pagination.el;x&&(x=Ve(x),x.forEach(A=>{A.classList.remove(m.hiddenClass),A.classList.remove(m.modifierClass+m.type),A.classList.remove(e.isHorizontal()?m.horizontalClass:m.verticalClass),m.clickable&&(A.classList.remove(...(m.clickableClass||"").split(" ")),A.removeEventListener("click",f))})),e.pagination.bullets&&e.pagination.bullets.forEach(A=>A.classList.remove(...m.bulletActiveClass.split(" ")))}n("changeDirection",()=>{if(!e.pagination||!e.pagination.el)return;const m=e.params.pagination;let{el:x}=e.pagination;x=Ve(x),x.forEach(A=>{A.classList.remove(m.horizontalClass,m.verticalClass),A.classList.add(e.isHorizontal()?m.horizontalClass:m.verticalClass)})}),n("init",()=>{e.params.pagination.enabled===!1?b():(p(),g(),h())}),n("activeIndexChange",()=>{typeof e.snapIndex>"u"&&h()}),n("snapIndexChange",()=>{h()}),n("snapGridLengthChange",()=>{g(),h()}),n("destroy",()=>{c()}),n("enable disable",()=>{let{el:m}=e.pagination;m&&(m=Ve(m),m.forEach(x=>x.classList[e.enabled?"remove":"add"](e.params.pagination.lockClass)))}),n("lock unlock",()=>{h()}),n("click",(m,x)=>{const A=x.target,v=Ve(e.pagination.el);if(e.params.pagination.el&&e.params.pagination.hideOnClick&&v&&v.length>0&&!A.classList.contains(e.params.pagination.bulletClass)){if(e.navigation&&(e.navigation.nextEl&&A===e.navigation.nextEl||e.navigation.prevEl&&A===e.navigation.prevEl))return;const N=v[0].classList.contains(e.params.pagination.hiddenClass);r(N===!0?"paginationShow":"paginationHide"),v.forEach(F=>F.classList.toggle(e.params.pagination.hiddenClass))}});const E=()=>{e.el.classList.remove(e.params.pagination.paginationDisabledClass);let{el:m}=e.pagination;m&&(m=Ve(m),m.forEach(x=>x.classList.remove(e.params.pagination.paginationDisabledClass))),p(),g(),h()},b=()=>{e.el.classList.add(e.params.pagination.paginationDisabledClass);let{el:m}=e.pagination;m&&(m=Ve(m),m.forEach(x=>x.classList.add(e.params.pagination.paginationDisabledClass))),c()};Object.assign(e.pagination,{enable:E,disable:b,render:g,update:h,init:p,destroy:c})}function ub(){}function lb(){}function is(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(i,r).trim();(s||!a)&&t.push(s),i=r+1,r=n.indexOf(",",i)}return t}function as(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Qc=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jc=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zc={};function ss(e,t){return(Zc.jsx?Jc:Qc).test(e)}const ed=/[ \t\n\f\r]/g;function td(e){return typeof e=="object"?e.type==="text"?os(e.value):!1:os(e)}function os(e){return e.replace(ed,"")===""}class In{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}In.prototype.normal={},In.prototype.property={},In.prototype.space=void 0;function us(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new In(n,r,t)}function Nn(e){return e.toLowerCase()}class Ze{constructor(t,n){this.attribute=n,this.property=t}}Ze.prototype.attribute="",Ze.prototype.booleanish=!1,Ze.prototype.boolean=!1,Ze.prototype.commaOrSpaceSeparated=!1,Ze.prototype.commaSeparated=!1,Ze.prototype.defined=!1,Ze.prototype.mustUseProperty=!1,Ze.prototype.number=!1,Ze.prototype.overloadedBoolean=!1,Ze.prototype.property="",Ze.prototype.spaceSeparated=!1,Ze.prototype.space=void 0;let nd=0;const be=Gt(),qe=Gt(),ni=Gt(),le=Gt(),De=Gt(),rn=Gt(),rt=Gt();function Gt(){return 2**++nd}const ri=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:qe,commaOrSpaceSeparated:rt,commaSeparated:rn,number:le,overloadedBoolean:ni,spaceSeparated:De},Symbol.toStringTag,{value:"Module"})),ii=Object.keys(ri);class ai extends Ze{constructor(t,n,r,i){let a=-1;if(super(t,n),ls(this,"space",i),typeof r=="number")for(;++a<ii.length;){const s=ii[a];ls(this,ii[a],(r&ri[s])===ri[s])}}}ai.prototype.defined=!0;function ls(e,t,n){n&&(e[t]=n)}function an(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const a=new ai(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Nn(r)]=r,n[Nn(a.attribute)]=r}return new In(t,n,e.space)}const cs=an({properties:{ariaActiveDescendant:null,ariaAtomic:qe,ariaAutoComplete:null,ariaBusy:qe,ariaChecked:qe,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:De,ariaCurrent:null,ariaDescribedBy:De,ariaDetails:null,ariaDisabled:qe,ariaDropEffect:De,ariaErrorMessage:null,ariaExpanded:qe,ariaFlowTo:De,ariaGrabbed:qe,ariaHasPopup:null,ariaHidden:qe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:De,ariaLevel:le,ariaLive:null,ariaModal:qe,ariaMultiLine:qe,ariaMultiSelectable:qe,ariaOrientation:null,ariaOwns:De,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:qe,ariaReadOnly:qe,ariaRelevant:null,ariaRequired:qe,ariaRoleDescription:De,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:qe,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ds(e,t){return t in e?e[t]:t}function fs(e,t){return ds(e,t.toLowerCase())}const rd=an({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rn,acceptCharset:De,accessKey:De,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:De,autoFocus:be,autoPlay:be,blocking:De,capture:null,charSet:null,checked:be,cite:null,className:De,cols:le,colSpan:null,content:null,contentEditable:qe,controls:be,controlsList:De,coords:le|rn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:ni,draggable:qe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:De,height:le,hidden:ni,high:le,href:null,hrefLang:null,htmlFor:De,httpEquiv:De,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:De,itemRef:De,itemScope:be,itemType:De,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,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:be,optimum:le,pattern:null,ping:De,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:De,required:be,reversed:be,rows:le,rowSpan:le,sandbox:De,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:qe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:qe,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:De,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:qe,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:fs}),id=an({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:rt,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:De,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:rn,g2:rn,glyphName:rn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:rt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:De,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rt,rev:rt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rt,requiredFeatures:rt,requiredFonts:rt,requiredFormats:rt,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:rt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rt,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ds}),ps=an({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()}}),hs=an({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fs}),ms=an({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ad={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"},sd=/[A-Z]/g,gs=/-[a-z]/g,od=/^data[-\w.:]+$/i;function dr(e,t){const n=Nn(t);let r=t,i=Ze;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&od.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(gs,ld);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!gs.test(a)){let s=a.replace(sd,ud);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=ai}return new i(r,t)}function ud(e){return"-"+e.toLowerCase()}function ld(e){return e.charAt(1).toUpperCase()}const kn=us([cs,rd,ps,hs,ms],"html"),Dt=us([cs,id,ps,hs,ms],"svg");function Es(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function bs(e){return e.join(" ").trim()}function si(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var sn={},oi,Ts;function cd(){if(Ts)return oi;Ts=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,u=/^\s+|\s+$/g,o=`
|
|
2
|
+
`,d="/",f="*",h="",g="comment",p="declaration";function c(b,m){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];m=m||{};var x=1,A=1;function v(I){var T=I.match(t);T&&(x+=T.length);var $=I.lastIndexOf(o);A=~$?I.length-$:A+I.length}function N(){var I={line:x,column:A};return function(T){return T.position=new F(I),w(),T}}function F(I){this.start=I,this.end={line:x,column:A},this.source=m.source}F.prototype.content=b;function V(I){var T=new Error(m.source+":"+x+":"+A+": "+I);if(T.reason=I,T.filename=m.source,T.line=x,T.column=A,T.source=b,!m.silent)throw T}function O(I){var T=I.exec(b);if(T){var $=T[0];return v($),b=b.slice($.length),T}}function w(){O(n)}function H(I){var T;for(I=I||[];T=y();)T!==!1&&I.push(T);return I}function y(){var I=N();if(!(d!=b.charAt(0)||f!=b.charAt(1))){for(var T=2;h!=b.charAt(T)&&(f!=b.charAt(T)||d!=b.charAt(T+1));)++T;if(T+=2,h===b.charAt(T-1))return V("End of comment missing");var $=b.slice(2,T-2);return A+=2,v($),b=b.slice(T),A+=2,I({type:g,comment:$})}}function M(){var I=N(),T=O(r);if(T){if(y(),!O(i))return V("property missing ':'");var $=O(a),Q=I({type:p,property:E(T[0].replace(e,h)),value:$?E($[0].replace(e,h)):h});return O(s),Q}}function U(){var I=[];H(I);for(var T;T=M();)T!==!1&&(I.push(T),H(I));return I}return w(),U()}function E(b){return b?b.replace(u,h):h}return oi=c,oi}var ys;function dd(){if(ys)return sn;ys=1;var e=sn&&sn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(sn,"__esModule",{value:!0}),sn.default=n;const t=e(cd());function n(r,i){let a=null;if(!r||typeof r!="string")return a;const s=(0,t.default)(r),u=typeof i=="function";return s.forEach(o=>{if(o.type!=="declaration")return;const{property:d,value:f}=o;u?i(d,f,o):f&&(a=a||{},a[d]=f)}),a}return sn}var vn={},xs;function fd(){if(xs)return vn;xs=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,a=function(d){return!d||n.test(d)||e.test(d)},s=function(d,f){return f.toUpperCase()},u=function(d,f){return"".concat(f,"-")},o=function(d,f){return f===void 0&&(f={}),a(d)?d:(d=d.toLowerCase(),f.reactCompat?d=d.replace(i,u):d=d.replace(r,u),d.replace(t,s))};return vn.camelCase=o,vn}var wn,As;function pd(){if(As)return wn;As=1;var e=wn&&wn.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(dd()),n=fd();function r(i,a){var s={};return!i||typeof i!="string"||(0,t.default)(i,function(u,o){u&&o&&(s[(0,n.camelCase)(u,a)]=o)}),s}return r.default=r,wn=r,wn}var hd=pd();const md=si(hd),fr=Cs("end"),gt=Cs("start");function Cs(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Ss(e){const t=gt(e),n=fr(e);if(t&&n)return{start:t,end:n}}function Ln(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_s(e.position):"start"in e||"end"in e?_s(e):"line"in e||"column"in e?ui(e):""}function ui(e){return Is(e&&e.line)+":"+Is(e&&e.column)}function _s(e){return ui(e&&e.start)+"-"+ui(e&&e.end)}function Is(e){return e&&typeof e=="number"?e:1}class Xe extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",a={},s=!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"?i=t:!a.cause&&t&&(s=!0,i=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const o=r.indexOf(":");o===-1?a.ruleId=r:(a.source=r.slice(0,o),a.ruleId=r.slice(o+1))}if(!a.place&&a.ancestors&&a.ancestors){const o=a.ancestors[a.ancestors.length-1];o&&(a.place=o.position)}const u=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=u?u.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=u?u.line:void 0,this.name=Ln(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=s&&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}}Xe.prototype.file="",Xe.prototype.name="",Xe.prototype.reason="",Xe.prototype.message="",Xe.prototype.stack="",Xe.prototype.column=void 0,Xe.prototype.line=void 0,Xe.prototype.ancestors=void 0,Xe.prototype.cause=void 0,Xe.prototype.fatal=void 0,Xe.prototype.place=void 0,Xe.prototype.ruleId=void 0,Xe.prototype.source=void 0;const li={}.hasOwnProperty,gd=new Map,Ed=/[A-Z]/g,bd=new Set(["table","tbody","thead","tfoot","tr"]),Td=new Set(["td","th"]),Ns="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function yd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=kd(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");r=Nd(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,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"?Dt:kn,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=ks(i,e,void 0);return a&&typeof a!="string"?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function ks(e,t,n){if(t.type==="element")return xd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ad(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Sd(e,t,n);if(t.type==="mdxjsEsm")return Cd(e,t);if(t.type==="root")return _d(e,t,n);if(t.type==="text")return Id(e,t)}function xd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Dt,e.schema=i),e.ancestors.push(t);const a=ws(e,t.tagName,!1),s=vd(e,t);let u=di(e,t);return bd.has(t.tagName)&&(u=u.filter(function(o){return typeof o=="string"?!td(o):!0})),vs(e,s,a,t),ci(s,u),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Ad(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}On(e,t.position)}function Cd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);On(e,t.position)}function Sd(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Dt,e.schema=i),e.ancestors.push(t);const a=t.name===null?e.Fragment:ws(e,t.name,!0),s=wd(e,t),u=di(e,t);return vs(e,s,a,t),ci(s,u),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function _d(e,t,n){const r={};return ci(r,di(e,t)),e.create(t,e.Fragment,r,n)}function Id(e,t){return t.value}function vs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ci(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Nd(e,t,n){return r;function r(i,a,s,u){const d=Array.isArray(s.children)?n:t;return u?d(a,s,u):d(a,s)}}function kd(e,t){return n;function n(r,i,a,s){const u=Array.isArray(a.children),o=gt(r);return t(i,a,s,u,{columnNumber:o?o.column-1:void 0,fileName:e,lineNumber:o?o.line:void 0},void 0)}}function vd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&li.call(t.properties,i)){const a=Ld(e,i,t.properties[i]);if(a){const[s,u]=a;e.tableCellAlignToStyle&&s==="align"&&typeof u=="string"&&Td.has(t.tagName)?r=u:n[s]=u}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function wd(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const u=s.properties[0];u.type,Object.assign(n,e.evaluater.evaluateExpression(u.argument))}else On(e,t.position);else{const i=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const u=r.value.data.estree.body[0];u.type,a=e.evaluater.evaluateExpression(u.expression)}else On(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function di(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:gd;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const o=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(o){const d=i.get(o)||0;s=o+"-"+d,i.set(o,d+1)}}const u=ks(e,a,s);u!==void 0&&n.push(u)}return n}function Ld(e,t,n){const r=dr(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?as(n):bs(n)),r.property==="style"){let i=typeof n=="object"?n:Od(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Dd(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?ad[r.property]||r.property:r.attribute,n]}}function Od(e,t){try{return md(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Xe("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Ns+"#cannot-parse-style-attribute",i}}function ws(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let a=-1,s;for(;++a<i.length;){const u=ss(i[a])?{type:"Identifier",name:i[a]}:{type:"Literal",value:i[a]};s=s?{type:"MemberExpression",object:s,property:u,computed:!!(a&&u.type==="Literal"),optional:!1}:u}r=s}else r=ss(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return li.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);On(e)}function On(e,t){const n=new Xe("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=Ns+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Dd(e){const t={};let n;for(n in e)li.call(e,n)&&(t[Pd(n)]=e[n]);return t}function Pd(e){let t=e.replace(Ed,Md);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function Md(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"]},Rd={};function Bd(e,t){const n=Rd,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ls(e,r,i)}function Ls(e,t,n){if(Fd(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 Os(e.children,t,n)}return Array.isArray(e)?Os(e,t,n):""}function Os(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ls(e[i],t,n);return r.join("")}function Fd(e){return!!(e&&typeof e=="object")}const Ds=document.createElement("i");function Dn(e){const t="&"+e+";";Ds.innerHTML=t;const n=Ds.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Et(e,t,n,r){const i=e.length;let a=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function ot(e,t){return e.length>0?(Et(e,e.length,0,t),e):t}const Ps={}.hasOwnProperty;function Hd(e){const t={};let n=-1;for(;++n<e.length;)Ud(t,e[n]);return t}function Ud(e,t){let n;for(n in t){const i=(Ps.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){Ps.call(i,s)||(i[s]=[]);const u=a[s];$d(i[s],Array.isArray(u)?u:u?[u]:[])}}}function $d(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Et(e,0,0,r)}function Ms(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 on(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bt=Pt(/[A-Za-z]/),it=Pt(/[\dA-Za-z]/),qd=Pt(/[#-'*+\--9=?A-Z^-~]/);function pi(e){return e!==null&&(e<32||e===127)}const hi=Pt(/\d/),zd=Pt(/[\dA-Fa-f]/),Vd=Pt(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Ue(e){return e!==null&&(e<0||e===32)}function Ne(e){return e===-2||e===-1||e===32}const Pn=Pt(new RegExp("\\p{P}|\\p{S}","u")),Mn=Pt(/\s/);function Pt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function un(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&it(e.charCodeAt(n+1))&&it(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const u=e.charCodeAt(n+1);a<56320&&u>56319&&u<57344?(s=String.fromCharCode(a,u),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(o){return Ne(o)?(e.enter(n),u(o)):t(o)}function u(o){return Ne(o)&&a++<i?(e.consume(o),u):(e.exit(n),t(o))}}const Yd={tokenize:Gd};function Gd(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),ke(e,t,"linePrefix")}function i(u){return e.enter("paragraph"),a(u)}function a(u){const o=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=o),n=o,s(u)}function s(u){if(u===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(u);return}return he(u)?(e.consume(u),e.exit("chunkText"),a):(e.consume(u),s)}}const Wd={tokenize:jd},Rs={tokenize:Xd};function jd(e){const t=this,n=[];let r=0,i,a,s;return u;function u(A){if(r<n.length){const v=n[r];return t.containerState=v[1],e.attempt(v[0].continuation,o,d)(A)}return d(A)}function o(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const v=t.events.length;let N=v,F;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){F=t.events[N][1].end;break}m(r);let V=v;for(;V<t.events.length;)t.events[V][1].end={...F},V++;return Et(t.events,N+1,0,t.events.slice(v)),t.events.length=V,d(A)}return u(A)}function d(A){if(r===n.length){if(!i)return g(A);if(i.currentConstruct&&i.currentConstruct.concrete)return c(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rs,f,h)(A)}function f(A){return i&&x(),m(r),g(A)}function h(A){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,c(A)}function g(A){return t.containerState={},e.attempt(Rs,p,c)(A)}function p(A){return r++,n.push([t.currentConstruct,t.containerState]),g(A)}function c(A){if(A===null){i&&x(),m(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:a}),E(A)}function E(A){if(A===null){b(e.exit("chunkFlow"),!0),m(0),e.consume(A);return}return he(A)?(e.consume(A),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,u):(e.consume(A),E)}function b(A,v){const N=t.sliceStream(A);if(v&&N.push(null),A.previous=a,a&&(a.next=A),a=A,i.defineSkip(A.start),i.write(N),t.parser.lazy[A.start.line]){let F=i.events.length;for(;F--;)if(i.events[F][1].start.offset<s&&(!i.events[F][1].end||i.events[F][1].end.offset>s))return;const V=t.events.length;let O=V,w,H;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){if(w){H=t.events[O][1].end;break}w=!0}for(m(r),F=V;F<t.events.length;)t.events[F][1].end={...H},F++;Et(t.events,O+1,0,t.events.slice(V)),t.events.length=F}}function m(A){let v=n.length;for(;v-- >A;){const N=n[v];t.containerState=N[1],N[0].exit.call(t,e)}n.length=A}function x(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Xd(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bs(e){if(e===null||Ue(e)||Mn(e))return 1;if(Pn(e))return 2}function mi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const gi={name:"attention",resolveAll:Kd,tokenize:Qd};function Kd(e,t){let n=-1,r,i,a,s,u,o,d,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;o=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},g={...e[n][1].start};Fs(h,-o),Fs(g,o),s={type:o>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},u={type:o>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:g},a={type:o>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:o>1?"strong":"emphasis",start:{...s.start},end:{...u.end}},e[r][1].end={...s.start},e[n][1].start={...u.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=ot(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=ot(d,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",a,t]]),d=ot(d,mi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=ot(d,[["exit",a,t],["enter",u,t],["exit",u,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,d=ot(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Et(e,r-1,n-r+3,d),n=r+d.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Qd(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Bs(r);let a;return s;function s(o){return a=o,e.enter("attentionSequence"),u(o)}function u(o){if(o===a)return e.consume(o),u;const d=e.exit("attentionSequence"),f=Bs(o),h=!f||f===2&&i||n.includes(o),g=!i||i===2&&f||n.includes(r);return d._open=!!(a===42?h:h&&(i||!g)),d._close=!!(a===42?g:g&&(f||!h)),t(o)}}function Fs(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Jd={name:"autolink",tokenize:Zd};function Zd(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return bt(p)?(e.consume(p),s):p===64?n(p):d(p)}function s(p){return p===43||p===45||p===46||it(p)?(r=1,u(p)):d(p)}function u(p){return p===58?(e.consume(p),r=0,o):(p===43||p===45||p===46||it(p))&&r++<32?(e.consume(p),u):(r=0,d(p))}function o(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||pi(p)?n(p):(e.consume(p),o)}function d(p){return p===64?(e.consume(p),f):qd(p)?(e.consume(p),d):n(p)}function f(p){return it(p)?h(p):n(p)}function h(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||it(p))&&r++<63){const c=p===45?g:h;return e.consume(p),c}return n(p)}}const pr={partial:!0,tokenize:ef};function ef(e,t,n){return r;function r(a){return Ne(a)?ke(e,i,"linePrefix")(a):i(a)}function i(a){return a===null||he(a)?t(a):n(a)}}const Hs={continuation:{tokenize:nf},exit:rf,name:"blockQuote",tokenize:tf};function tf(e,t,n){const r=this;return i;function i(s){if(s===62){const u=r.containerState;return u.open||(e.enter("blockQuote",{_container:!0}),u.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return Ne(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function nf(e,t,n){const r=this;return i;function i(s){return Ne(s)?ke(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(Hs,t,n)(s)}}function rf(e){e.exit("blockQuote")}const Us={name:"characterEscape",tokenize:af};function af(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),i}function i(a){return Vd(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const $s={name:"characterReference",tokenize:sf};function sf(e,t,n){const r=this;let i=0,a,s;return u;function u(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),o}function o(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),a=31,s=it,f(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=zd,f):(e.enter("characterReferenceValue"),a=7,s=hi,f(h))}function f(h){if(h===59&&i){const g=e.exit("characterReferenceValue");return s===it&&!Dn(r.sliceSerialize(g))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(h)&&i++<a?(e.consume(h),f):n(h)}}const qs={partial:!0,tokenize:uf},zs={concrete:!0,name:"codeFenced",tokenize:of};function of(e,t,n){const r=this,i={partial:!0,tokenize:N};let a=0,s=0,u;return o;function o(F){return d(F)}function d(F){const V=r.events[r.events.length-1];return a=V&&V[1].type==="linePrefix"?V[2].sliceSerialize(V[1],!0).length:0,u=F,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(F)}function f(F){return F===u?(s++,e.consume(F),f):s<3?n(F):(e.exit("codeFencedFenceSequence"),Ne(F)?ke(e,h,"whitespace")(F):h(F))}function h(F){return F===null||he(F)?(e.exit("codeFencedFence"),r.interrupt?t(F):e.check(qs,E,v)(F)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(F))}function g(F){return F===null||he(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(F)):Ne(F)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,p,"whitespace")(F)):F===96&&F===u?n(F):(e.consume(F),g)}function p(F){return F===null||he(F)?h(F):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),c(F))}function c(F){return F===null||he(F)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(F)):F===96&&F===u?n(F):(e.consume(F),c)}function E(F){return e.attempt(i,v,b)(F)}function b(F){return e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),m}function m(F){return a>0&&Ne(F)?ke(e,x,"linePrefix",a+1)(F):x(F)}function x(F){return F===null||he(F)?e.check(qs,E,v)(F):(e.enter("codeFlowValue"),A(F))}function A(F){return F===null||he(F)?(e.exit("codeFlowValue"),x(F)):(e.consume(F),A)}function v(F){return e.exit("codeFenced"),t(F)}function N(F,V,O){let w=0;return H;function H(T){return F.enter("lineEnding"),F.consume(T),F.exit("lineEnding"),y}function y(T){return F.enter("codeFencedFence"),Ne(T)?ke(F,M,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):M(T)}function M(T){return T===u?(F.enter("codeFencedFenceSequence"),U(T)):O(T)}function U(T){return T===u?(w++,F.consume(T),U):w>=s?(F.exit("codeFencedFenceSequence"),Ne(T)?ke(F,I,"whitespace")(T):I(T)):O(T)}function I(T){return T===null||he(T)?(F.exit("codeFencedFence"),V(T)):O(T)}}}function uf(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Ei={name:"codeIndented",tokenize:cf},lf={partial:!0,tokenize:df};function cf(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),ke(e,a,"linePrefix",5)(d)}function a(d){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(d):n(d)}function s(d){return d===null?o(d):he(d)?e.attempt(lf,s,o)(d):(e.enter("codeFlowValue"),u(d))}function u(d){return d===null||he(d)?(e.exit("codeFlowValue"),s(d)):(e.consume(d),u)}function o(d){return e.exit("codeIndented"),t(d)}}function df(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,a,"linePrefix",5)(s)}function a(s){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):he(s)?i(s):n(s)}}const ff={name:"codeText",previous:hf,resolve:pf,tokenize:mf};function pf(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function hf(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mf(e,t,n){let r=0,i,a;return s;function s(h){return e.enter("codeText"),e.enter("codeTextSequence"),u(h)}function u(h){return h===96?(e.consume(h),r++,u):(e.exit("codeTextSequence"),o(h))}function o(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),o):h===96?(a=e.enter("codeTextSequence"),i=0,f(h)):he(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),o):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||he(h)?(e.exit("codeTextData"),o(h)):(e.consume(h),d)}function f(h){return h===96?(e.consume(h),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(a.type="codeTextData",d(h))}}class gf{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 r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Rn(this.left,r),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),Rn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Rn(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);Rn(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Rn(this.left,n.reverse())}}}function Rn(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 Vs(e){const t={};let n=-1,r,i,a,s,u,o,d;const f=new gf(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(o=r[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(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ef(f,n)),n=t[n],d=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(s=f.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},u=f.slice(i,n),u.unshift(r),f.splice(i,n-i+1,u))}}return Et(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!d}function Ef(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const u=s.events,o=[],d={};let f,h,g=-1,p=n,c=0,E=0;const b=[E];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),h&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),h=p,p=p.next}for(p=n;++g<u.length;)u[g][0]==="exit"&&u[g-1][0]==="enter"&&u[g][1].type===u[g-1][1].type&&u[g][1].start.line!==u[g][1].end.line&&(E=g+1,b.push(E),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),g=b.length;g--;){const m=u.slice(b[g],b[g+1]),x=a.pop();o.push([x,x+m.length-1]),e.splice(x,2,m)}for(o.reverse(),g=-1;++g<o.length;)d[c+o[g][0]]=c+o[g][1],c+=o[g][1]-o[g][0]-1;return d}const bf={resolve:yf,tokenize:xf},Tf={partial:!0,tokenize:Af};function yf(e){return Vs(e),e}function xf(e,t){let n;return r;function r(u){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(u)}function i(u){return u===null?a(u):he(u)?e.check(Tf,s,a)(u):(e.consume(u),i)}function a(u){return e.exit("chunkContent"),e.exit("content"),t(u)}function s(u){return e.consume(u),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Af(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,a,"linePrefix")}function a(s){if(s===null||he(s))return n(s);const u=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ys(e,t,n,r,i,a,s,u,o){const d=o||Number.POSITIVE_INFINITY;let f=0;return h;function h(m){return m===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(m),e.exit(a),g):m===null||m===32||m===41||pi(m)?n(m):(e.enter(r),e.enter(s),e.enter(u),e.enter("chunkString",{contentType:"string"}),E(m))}function g(m){return m===62?(e.enter(a),e.consume(m),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===62?(e.exit("chunkString"),e.exit(u),g(m)):m===null||m===60||he(m)?n(m):(e.consume(m),m===92?c:p)}function c(m){return m===60||m===62||m===92?(e.consume(m),p):p(m)}function E(m){return!f&&(m===null||m===41||Ue(m))?(e.exit("chunkString"),e.exit(u),e.exit(s),e.exit(r),t(m)):f<d&&m===40?(e.consume(m),f++,E):m===41?(e.consume(m),f--,E):m===null||m===32||m===40||pi(m)?n(m):(e.consume(m),m===92?b:E)}function b(m){return m===40||m===41||m===92?(e.consume(m),E):E(m)}}function Gs(e,t,n,r,i,a){const s=this;let u=0,o;return d;function d(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(a),f}function f(p){return u>999||p===null||p===91||p===93&&!o||p===94&&!u&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):he(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),h(p))}function h(p){return p===null||p===91||p===93||he(p)||u++>999?(e.exit("chunkString"),f(p)):(e.consume(p),o||(o=!Ne(p)),p===92?g:h)}function g(p){return p===91||p===92||p===93?(e.consume(p),u++,h):h(p)}}function Ws(e,t,n,r,i,a){let s;return u;function u(g){return g===34||g===39||g===40?(e.enter(r),e.enter(i),e.consume(g),e.exit(i),s=g===40?41:g,o):n(g)}function o(g){return g===s?(e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):(e.enter(a),d(g))}function d(g){return g===s?(e.exit(a),o(s)):g===null?n(g):he(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),ke(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(g))}function f(g){return g===s||g===null||he(g)?(e.exit("chunkString"),d(g)):(e.consume(g),g===92?h:f)}function h(g){return g===s||g===92?(e.consume(g),f):f(g)}}function xt(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Ne(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Cf={name:"definition",tokenize:_f},Sf={partial:!0,tokenize:If};function _f(e,t,n){const r=this;let i;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return Gs.call(r,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function u(p){return i=on(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),o):n(p)}function o(p){return Ue(p)?xt(e,d)(p):d(p)}function d(p){return Ys(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt(Sf,h,h)(p)}function h(p){return Ne(p)?ke(e,g,"whitespace")(p):g(p)}function g(p){return p===null||he(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function If(e,t,n){return r;function r(u){return Ue(u)?xt(e,i)(u):n(u)}function i(u){return Ws(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function a(u){return Ne(u)?ke(e,s,"whitespace")(u):s(u)}function s(u){return u===null||he(u)?t(u):n(u)}}const Nf={name:"hardBreakEscape",tokenize:kf};function kf(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),i}function i(a){return he(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const vf={name:"headingAtx",resolve:wf,tokenize:Lf};function wf(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Et(e,r,n-r+1,[["enter",i,t],["enter",a,t],["exit",a,t],["exit",i,t]])),e}function Lf(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),a(f)}function a(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||Ue(f)?(e.exit("atxHeadingSequence"),u(f)):n(f)}function u(f){return f===35?(e.enter("atxHeadingSequence"),o(f)):f===null||he(f)?(e.exit("atxHeading"),t(f)):Ne(f)?ke(e,u,"whitespace")(f):(e.enter("atxHeadingText"),d(f))}function o(f){return f===35?(e.consume(f),o):(e.exit("atxHeadingSequence"),u(f))}function d(f){return f===null||f===35||Ue(f)?(e.exit("atxHeadingText"),u(f)):(e.consume(f),d)}}const Of=["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"],js=["pre","script","style","textarea"],Df={concrete:!0,name:"htmlFlow",resolveTo:Rf,tokenize:Bf},Pf={partial:!0,tokenize:Hf},Mf={partial:!0,tokenize:Ff};function Rf(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 Bf(e,t,n){const r=this;let i,a,s,u,o;return d;function d(L){return f(L)}function f(L){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(L),h}function h(L){return L===33?(e.consume(L),g):L===47?(e.consume(L),a=!0,E):L===63?(e.consume(L),i=3,r.interrupt?t:S):bt(L)?(e.consume(L),s=String.fromCharCode(L),b):n(L)}function g(L){return L===45?(e.consume(L),i=2,p):L===91?(e.consume(L),i=5,u=0,c):bt(L)?(e.consume(L),i=4,r.interrupt?t:S):n(L)}function p(L){return L===45?(e.consume(L),r.interrupt?t:S):n(L)}function c(L){const Te="CDATA[";return L===Te.charCodeAt(u++)?(e.consume(L),u===Te.length?r.interrupt?t:M:c):n(L)}function E(L){return bt(L)?(e.consume(L),s=String.fromCharCode(L),b):n(L)}function b(L){if(L===null||L===47||L===62||Ue(L)){const Te=L===47,_e=s.toLowerCase();return!Te&&!a&&js.includes(_e)?(i=1,r.interrupt?t(L):M(L)):Of.includes(s.toLowerCase())?(i=6,Te?(e.consume(L),m):r.interrupt?t(L):M(L)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(L):a?x(L):A(L))}return L===45||it(L)?(e.consume(L),s+=String.fromCharCode(L),b):n(L)}function m(L){return L===62?(e.consume(L),r.interrupt?t:M):n(L)}function x(L){return Ne(L)?(e.consume(L),x):H(L)}function A(L){return L===47?(e.consume(L),H):L===58||L===95||bt(L)?(e.consume(L),v):Ne(L)?(e.consume(L),A):H(L)}function v(L){return L===45||L===46||L===58||L===95||it(L)?(e.consume(L),v):N(L)}function N(L){return L===61?(e.consume(L),F):Ne(L)?(e.consume(L),N):A(L)}function F(L){return L===null||L===60||L===61||L===62||L===96?n(L):L===34||L===39?(e.consume(L),o=L,V):Ne(L)?(e.consume(L),F):O(L)}function V(L){return L===o?(e.consume(L),o=null,w):L===null||he(L)?n(L):(e.consume(L),V)}function O(L){return L===null||L===34||L===39||L===47||L===60||L===61||L===62||L===96||Ue(L)?N(L):(e.consume(L),O)}function w(L){return L===47||L===62||Ne(L)?A(L):n(L)}function H(L){return L===62?(e.consume(L),y):n(L)}function y(L){return L===null||he(L)?M(L):Ne(L)?(e.consume(L),y):n(L)}function M(L){return L===45&&i===2?(e.consume(L),$):L===60&&i===1?(e.consume(L),Q):L===62&&i===4?(e.consume(L),fe):L===63&&i===3?(e.consume(L),S):L===93&&i===5?(e.consume(L),te):he(L)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Pf,ce,U)(L)):L===null||he(L)?(e.exit("htmlFlowData"),U(L)):(e.consume(L),M)}function U(L){return e.check(Mf,I,ce)(L)}function I(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),T}function T(L){return L===null||he(L)?U(L):(e.enter("htmlFlowData"),M(L))}function $(L){return L===45?(e.consume(L),S):M(L)}function Q(L){return L===47?(e.consume(L),s="",z):M(L)}function z(L){if(L===62){const Te=s.toLowerCase();return js.includes(Te)?(e.consume(L),fe):M(L)}return bt(L)&&s.length<8?(e.consume(L),s+=String.fromCharCode(L),z):M(L)}function te(L){return L===93?(e.consume(L),S):M(L)}function S(L){return L===62?(e.consume(L),fe):L===45&&i===2?(e.consume(L),S):M(L)}function fe(L){return L===null||he(L)?(e.exit("htmlFlowData"),ce(L)):(e.consume(L),fe)}function ce(L){return e.exit("htmlFlow"),t(L)}}function Ff(e,t,n){const r=this;return i;function i(s){return he(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Hf(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(pr,t,n)}}const Uf={name:"htmlText",tokenize:$f};function $f(e,t,n){const r=this;let i,a,s;return u;function u(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),o}function o(S){return S===33?(e.consume(S),d):S===47?(e.consume(S),N):S===63?(e.consume(S),A):bt(S)?(e.consume(S),O):n(S)}function d(S){return S===45?(e.consume(S),f):S===91?(e.consume(S),a=0,c):bt(S)?(e.consume(S),x):n(S)}function f(S){return S===45?(e.consume(S),p):n(S)}function h(S){return S===null?n(S):S===45?(e.consume(S),g):he(S)?(s=h,Q(S)):(e.consume(S),h)}function g(S){return S===45?(e.consume(S),p):h(S)}function p(S){return S===62?$(S):S===45?g(S):h(S)}function c(S){const fe="CDATA[";return S===fe.charCodeAt(a++)?(e.consume(S),a===fe.length?E:c):n(S)}function E(S){return S===null?n(S):S===93?(e.consume(S),b):he(S)?(s=E,Q(S)):(e.consume(S),E)}function b(S){return S===93?(e.consume(S),m):E(S)}function m(S){return S===62?$(S):S===93?(e.consume(S),m):E(S)}function x(S){return S===null||S===62?$(S):he(S)?(s=x,Q(S)):(e.consume(S),x)}function A(S){return S===null?n(S):S===63?(e.consume(S),v):he(S)?(s=A,Q(S)):(e.consume(S),A)}function v(S){return S===62?$(S):A(S)}function N(S){return bt(S)?(e.consume(S),F):n(S)}function F(S){return S===45||it(S)?(e.consume(S),F):V(S)}function V(S){return he(S)?(s=V,Q(S)):Ne(S)?(e.consume(S),V):$(S)}function O(S){return S===45||it(S)?(e.consume(S),O):S===47||S===62||Ue(S)?w(S):n(S)}function w(S){return S===47?(e.consume(S),$):S===58||S===95||bt(S)?(e.consume(S),H):he(S)?(s=w,Q(S)):Ne(S)?(e.consume(S),w):$(S)}function H(S){return S===45||S===46||S===58||S===95||it(S)?(e.consume(S),H):y(S)}function y(S){return S===61?(e.consume(S),M):he(S)?(s=y,Q(S)):Ne(S)?(e.consume(S),y):w(S)}function M(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,U):he(S)?(s=M,Q(S)):Ne(S)?(e.consume(S),M):(e.consume(S),I)}function U(S){return S===i?(e.consume(S),i=void 0,T):S===null?n(S):he(S)?(s=U,Q(S)):(e.consume(S),U)}function I(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Ue(S)?w(S):(e.consume(S),I)}function T(S){return S===47||S===62||Ue(S)?w(S):n(S)}function $(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function Q(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),z}function z(S){return Ne(S)?ke(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):te(S)}function te(S){return e.enter("htmlTextData"),s(S)}}const bi={name:"labelEnd",resolveAll:Yf,resolveTo:Gf,tokenize:Wf},qf={tokenize:jf},zf={tokenize:Xf},Vf={tokenize:Kf};function Yf(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Et(e,0,e.length,n),e}function Gf(e,t){let n=e.length,r=0,i,a,s,u;for(;n--;)if(i=e[n][1],a){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(a=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const o={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return u=[["enter",o,t],["enter",d,t]],u=ot(u,e.slice(a+1,a+r+3)),u=ot(u,[["enter",f,t]]),u=ot(u,mi(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),u=ot(u,[["exit",f,t],e[s-2],e[s-1],["exit",d,t]]),u=ot(u,e.slice(s+1)),u=ot(u,[["exit",o,t]]),Et(e,a,e.length,u),e}function Wf(e,t,n){const r=this;let i=r.events.length,a,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){a=r.events[i][1];break}return u;function u(g){return a?a._inactive?h(g):(s=r.parser.defined.includes(on(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),o):n(g)}function o(g){return g===40?e.attempt(qf,f,s?f:h)(g):g===91?e.attempt(zf,f,s?d:h)(g):s?f(g):h(g)}function d(g){return e.attempt(Vf,f,h)(g)}function f(g){return t(g)}function h(g){return a._balanced=!0,n(g)}}function jf(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Ue(h)?xt(e,a)(h):a(h)}function a(h){return h===41?f(h):Ys(e,s,u,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function s(h){return Ue(h)?xt(e,o)(h):f(h)}function u(h){return n(h)}function o(h){return h===34||h===39||h===40?Ws(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):f(h)}function d(h){return Ue(h)?xt(e,f)(h):f(h)}function f(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function Xf(e,t,n){const r=this;return i;function i(u){return Gs.call(r,e,a,s,"reference","referenceMarker","referenceString")(u)}function a(u){return r.parser.defined.includes(on(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(u):n(u)}function s(u){return n(u)}}function Kf(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),i}function i(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const Qf={name:"labelStartImage",resolveAll:bi.resolveAll,tokenize:Jf};function Jf(e,t,n){const r=this;return i;function i(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelImage"),s):n(u)}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const Zf={name:"labelStartLink",resolveAll:bi.resolveAll,tokenize:ep};function ep(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Ti={name:"lineEnding",tokenize:tp};function tp(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const hr={name:"thematicBreak",tokenize:np};function np(e,t,n){let r=0,i;return a;function a(d){return e.enter("thematicBreak"),s(d)}function s(d){return i=d,u(d)}function u(d){return d===i?(e.enter("thematicBreakSequence"),o(d)):r>=3&&(d===null||he(d))?(e.exit("thematicBreak"),t(d)):n(d)}function o(d){return d===i?(e.consume(d),r++,o):(e.exit("thematicBreakSequence"),Ne(d)?ke(e,u,"whitespace")(d):u(d))}}const et={continuation:{tokenize:sp},exit:up,name:"list",tokenize:ap},rp={partial:!0,tokenize:lp},ip={partial:!0,tokenize:op};function ap(e,t,n){const r=this,i=r.events[r.events.length-1];let a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return u;function u(p){const c=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(c==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:hi(p)){if(r.containerState.type||(r.containerState.type=c,e.enter(c,{_container:!0})),c==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(hr,n,d)(p):d(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),o(p)}return n(p)}function o(p){return hi(p)&&++s<10?(e.consume(p),o):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),d(p)):n(p)}function d(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(pr,r.interrupt?n:f,e.attempt(rp,g,h))}function f(p){return r.containerState.initialBlankLine=!0,a++,g(p)}function h(p){return Ne(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function sp(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(pr,i,a);function i(u){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(u)}function a(u){return r.containerState.furtherBlankLines||!Ne(u)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(u)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ip,t,s)(u))}function s(u){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(et,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function op(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function up(e){e.exit(this.containerState.type)}function lp(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(a){const s=r.events[r.events.length-1];return!Ne(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Xs={name:"setextUnderline",resolveTo:cp,tokenize:dp};function cp(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",a?(e.splice(i,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function dp(e,t,n){const r=this;let i;return a;function a(d){let f=r.events.length,h;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){h=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=d,s(d)):n(d)}function s(d){return e.enter("setextHeadingLineSequence"),u(d)}function u(d){return d===i?(e.consume(d),u):(e.exit("setextHeadingLineSequence"),Ne(d)?ke(e,o,"lineSuffix")(d):o(d))}function o(d){return d===null||he(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const fp={tokenize:pp};function pp(e){const t=this,n=e.attempt(pr,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(bf,i)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const hp={resolveAll:Qs()},mp=Ks("string"),gp=Ks("text");function Ks(e){return{resolveAll:Qs(e==="text"?Ep:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],a=n.attempt(i,s,u);return s;function s(f){return d(f)?a(f):u(f)}function u(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),o}function o(f){return d(f)?(n.exit("data"),a(f)):(n.consume(f),o)}function d(f){if(f===null)return!0;const h=i[f];let g=-1;if(h)for(;++g<h.length;){const p=h[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Qs(e){return t;function t(n,r){let i=-1,a;for(;++i<=n.length;)a===void 0?n[i]&&n[i][1].type==="data"&&(a=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==a+2&&(n[a][1].end=n[i-1][1].end,n.splice(a+2,i-a-2),i=a+2),a=void 0);return e?e(n,r):n}}function Ep(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 r=e[n-1][1],i=t.sliceStream(r);let a=i.length,s=-1,u=0,o;for(;a--;){const d=i[a];if(typeof d=="string"){for(s=d.length;d.charCodeAt(s-1)===32;)u++,s--;if(s)break;s=-1}else if(d===-2)o=!0,u++;else if(d!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(u=0),u){const d={type:n===e.length||o||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-u,offset:r.end.offset-u},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const bp=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:Cf},disable:{null:[]},document:{42:et,43:et,45:et,48:et,49:et,50:et,51:et,52:et,53:et,54:et,55:et,56:et,57:et,62:Hs},flow:{35:vf,42:hr,45:[Xs,hr],60:Df,61:Xs,95:hr,96:zs,126:zs},flowInitial:{[-2]:Ei,[-1]:Ei,32:Ei},insideSpan:{null:[gi,hp]},string:{38:$s,92:Us},text:{[-5]:Ti,[-4]:Ti,[-3]:Ti,33:Qf,38:$s,42:gi,60:[Jd,Uf],91:Zf,92:[Nf,Us],93:bi,95:gi,96:ff}},Symbol.toStringTag,{value:"Module"}));function Tp(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},a=[];let s=[],u=[];const o={attempt:V(N),check:V(F),consume:x,enter:A,exit:v,interrupt:V(F,{interrupt:!0})},d={code:null,containerState:{},defineSkip:E,events:[],now:c,parser:e,previous:null,sliceSerialize:g,sliceStream:p,write:h};let f=t.tokenize.call(d,o);return t.resolveAll&&a.push(t),d;function h(y){return s=ot(s,y),b(),s[s.length-1]!==null?[]:(O(t,0),d.events=mi(a,d.events,d),d.events)}function g(y,M){return xp(p(y),M)}function p(y){return yp(s,y)}function c(){const{_bufferIndex:y,_index:M,line:U,column:I,offset:T}=r;return{_bufferIndex:y,_index:M,line:U,column:I,offset:T}}function E(y){i[y.line]=y.column,H()}function b(){let y;for(;r._index<s.length;){const M=s[r._index];if(typeof M=="string")for(y=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===y&&r._bufferIndex<M.length;)m(M.charCodeAt(r._bufferIndex));else m(M)}}function m(y){f=f(y)}function x(y){he(y)?(r.line++,r.column=1,r.offset+=y===-3?2:1,H()):y!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=y}function A(y,M){const U=M||{};return U.type=y,U.start=c(),d.events.push(["enter",U,d]),u.push(U),U}function v(y){const M=u.pop();return M.end=c(),d.events.push(["exit",M,d]),M}function N(y,M){O(y,M.from)}function F(y,M){M.restore()}function V(y,M){return U;function U(I,T,$){let Q,z,te,S;return Array.isArray(I)?ce(I):"tokenize"in I?ce([I]):fe(I);function fe(Ae){return ge;function ge(Ie){const Re=Ie!==null&&Ae[Ie],Oe=Ie!==null&&Ae.null,ze=[...Array.isArray(Re)?Re:Re?[Re]:[],...Array.isArray(Oe)?Oe:Oe?[Oe]:[]];return ce(ze)(Ie)}}function ce(Ae){return Q=Ae,z=0,Ae.length===0?$:L(Ae[z])}function L(Ae){return ge;function ge(Ie){return S=w(),te=Ae,Ae.partial||(d.currentConstruct=Ae),Ae.name&&d.parser.constructs.disable.null.includes(Ae.name)?_e():Ae.tokenize.call(M?Object.assign(Object.create(d),M):d,o,Te,_e)(Ie)}}function Te(Ae){return y(te,S),T}function _e(Ae){return S.restore(),++z<Q.length?L(Q[z]):$}}}function O(y,M){y.resolveAll&&!a.includes(y)&&a.push(y),y.resolve&&Et(d.events,M,d.events.length-M,y.resolve(d.events.slice(M),d)),y.resolveTo&&(d.events=y.resolveTo(d.events,d))}function w(){const y=c(),M=d.previous,U=d.currentConstruct,I=d.events.length,T=Array.from(u);return{from:I,restore:$};function $(){r=y,d.previous=M,d.currentConstruct=U,d.events.length=I,u=T,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function yp(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,a)];else{if(s=e.slice(n,i),r>-1){const u=s[0];typeof u=="string"?s[0]=u.slice(r):s.shift()}a>0&&s.push(e[i].slice(0,a))}return s}function xp(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
|
|
3
|
+
`;break}case-3:{s=`\r
|
|
4
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(a)}i=a===-2,r.push(s)}return r.join("")}function Ap(e){const r={constructs:Hd([bp,...(e||{}).extensions||[]]),content:i(Yd),defined:[],document:i(Wd),flow:i(fp),lazy:{},string:i(mp),text:i(gp)};return r;function i(a){return s;function s(u){return Tp(r,a,u)}}}function Cp(e){for(;!Vs(e););return e}const Js=/[\0\t\n\r]/g;function Sp(){let e=1,t="",n=!0,r;return i;function i(a,s,u){const o=[];let d,f,h,g,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),h=0,t="",n&&(a.charCodeAt(0)===65279&&h++,n=void 0);h<a.length;){if(Js.lastIndex=h,d=Js.exec(a),g=d&&d.index!==void 0?d.index:a.length,p=a.charCodeAt(g),!d){t=a.slice(h);break}if(p===10&&h===g&&r)o.push(-3),r=void 0;else switch(r&&(o.push(-5),r=void 0),h<g&&(o.push(a.slice(h,g)),e+=g-h),p){case 0:{o.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,o.push(-2);e++<f;)o.push(-1);break}case 10:{o.push(-4),e=1;break}default:r=!0,e=1}h=g+1}return u&&(r&&o.push(-5),t&&o.push(t),o.push(null)),o}}const _p=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ip(e){return e.replace(_p,Np)}function Np(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),a=i===120||i===88;return Ms(n.slice(a?2:1),a?16:10)}return Dn(n)||e}const Zs={}.hasOwnProperty;function kp(e,t,n){return typeof t!="string"&&(n=t,t=void 0),vp(n)(Cp(Ap(n).document().write(Sp()(e,t,!0))))}function vp(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(tr),autolinkProtocol:w,autolinkEmail:w,atxHeading:a(Tn),blockQuote:a(Oe),characterEscape:w,characterReference:w,codeFenced:a(ze),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(ze,s),codeText:a(pt,s),codeTextData:w,data:w,codeFlowValue:w,definition:a(Ct),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(bn),hardBreakEscape:a(Rr),hardBreakTrailing:a(Rr),htmlFlow:a(yn,s),htmlFlowData:w,htmlText:a(yn,s),htmlTextData:w,image:a(Br),label:s,link:a(tr),listItem:a(lt),listItemValue:g,listOrdered:a(nr,h),listUnordered:a(nr),paragraph:a(Ut),reference:L,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Tn),strong:a($t),thematicBreak:a(qt)},exit:{atxHeading:o(),atxHeadingSequence:N,autolink:o(),autolinkEmail:Re,autolinkProtocol:Ie,blockQuote:o(),characterEscapeValue:H,characterReferenceMarkerHexadecimal:_e,characterReferenceMarkerNumeric:_e,characterReferenceValue:Ae,characterReference:ge,codeFenced:o(b),codeFencedFence:E,codeFencedFenceInfo:p,codeFencedFenceMeta:c,codeFlowValue:H,codeIndented:o(m),codeText:o(T),codeTextData:H,data:H,definition:o(),definitionDestinationString:v,definitionLabelString:x,definitionTitleString:A,emphasis:o(),hardBreakEscape:o(M),hardBreakTrailing:o(M),htmlFlow:o(U),htmlFlowData:H,htmlText:o(I),htmlTextData:H,image:o(Q),label:te,labelText:z,lineEnding:y,link:o($),listItem:o(),listOrdered:o(),listUnordered:o(),paragraph:o(),referenceString:Te,resourceDestinationString:S,resourceTitleString:fe,resource:ce,setextHeading:o(O),setextHeadingLineSequence:V,setextHeadingText:F,strong:o(),thematicBreak:o()}};eo(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let de={type:"root",children:[]};const Ee={stack:[de],tokenStack:[],config:t,enter:u,exit:d,buffer:s,resume:f,data:n},Ce=[];let we=-1;for(;++we<ne.length;)if(ne[we][1].type==="listOrdered"||ne[we][1].type==="listUnordered")if(ne[we][0]==="enter")Ce.push(we);else{const at=Ce.pop();we=i(ne,at,we)}for(we=-1;++we<ne.length;){const at=t[ne[we][0]];Zs.call(at,ne[we][1].type)&&at[ne[we][1].type].call(Object.assign({sliceSerialize:ne[we][2].sliceSerialize},Ee),ne[we][1])}if(Ee.tokenStack.length>0){const at=Ee.tokenStack[Ee.tokenStack.length-1];(at[1]||to).call(Ee,void 0,at[0])}for(de.position={start:Mt(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:Mt(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we<t.transforms.length;)de=t.transforms[we](de)||de;return de}function i(ne,de,Ee){let Ce=de-1,we=-1,at=!1,St,ht,Jt,_t;for(;++Ce<=Ee;){const je=ne[Ce];switch(je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{je[0]==="enter"?we++:we--,_t=void 0;break}case"lineEndingBlank":{je[0]==="enter"&&(St&&!_t&&!we&&!Jt&&(Jt=Ce),_t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_t=void 0}if(!we&&je[0]==="enter"&&je[1].type==="listItemPrefix"||we===-1&&je[0]==="exit"&&(je[1].type==="listUnordered"||je[1].type==="listOrdered")){if(St){let ct=Ce;for(ht=void 0;ct--;){const st=ne[ct];if(st[1].type==="lineEnding"||st[1].type==="lineEndingBlank"){if(st[0]==="exit")continue;ht&&(ne[ht][1].type="lineEndingBlank",at=!0),st[1].type="lineEnding",ht=ct}else if(!(st[1].type==="linePrefix"||st[1].type==="blockQuotePrefix"||st[1].type==="blockQuotePrefixWhitespace"||st[1].type==="blockQuoteMarker"||st[1].type==="listItemIndent"))break}Jt&&(!ht||Jt<ht)&&(St._spread=!0),St.end=Object.assign({},ht?ne[ht][1].start:je[1].end),ne.splice(ht||Ce,0,["exit",St,je[2]]),Ce++,Ee++}if(je[1].type==="listItemPrefix"){const ct={type:"listItem",_spread:!1,start:Object.assign({},je[1].start),end:void 0};St=ct,ne.splice(Ce,0,["enter",ct,je[2]]),Ce++,Ee++,Jt=void 0,_t=!0}}}return ne[de][1]._spread=at,Ee}function a(ne,de){return Ee;function Ee(Ce){u.call(this,ne(Ce),Ce),de&&de.call(this,Ce)}}function s(){this.stack.push({type:"fragment",children:[]})}function u(ne,de,Ee){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Ee||void 0]),ne.position={start:Mt(de.start),end:void 0}}function o(ne){return de;function de(Ee){ne&&ne.call(this,Ee),d.call(this,Ee)}}function d(ne,de){const Ee=this.stack.pop(),Ce=this.tokenStack.pop();if(Ce)Ce[0].type!==ne.type&&(de?de.call(this,ne,Ce[0]):(Ce[1]||to).call(this,ne,Ce[0]));else throw new Error("Cannot close `"+ne.type+"` ("+Ln({start:ne.start,end:ne.end})+"): it’s not open");Ee.position.end=Mt(ne.end)}function f(){return Bd(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function g(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function p(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function c(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function x(ne){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=on(this.sliceSerialize(ne)).toLowerCase()}function A(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function v(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function N(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Ee=this.sliceSerialize(ne).length;de.depth=Ee}}function F(){this.data.setextHeadingSlurpLineEnding=!0}function V(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function O(){this.data.setextHeadingSlurpLineEnding=void 0}function w(ne){const Ee=this.stack[this.stack.length-1].children;let Ce=Ee[Ee.length-1];(!Ce||Ce.type!=="text")&&(Ce=Fr(),Ce.position={start:Mt(ne.start),end:void 0},Ee.push(Ce)),this.stack.push(Ce)}function H(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=Mt(ne.end)}function y(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=de.children[de.children.length-1];Ee.position.end=Mt(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&(w.call(this,ne),H.call(this,ne))}function M(){this.data.atHardBreak=!0}function U(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function I(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function T(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function $(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function z(ne){const de=this.sliceSerialize(ne),Ee=this.stack[this.stack.length-2];Ee.label=Ip(de),Ee.identifier=on(de).toLowerCase()}function te(){const ne=this.stack[this.stack.length-1],de=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Ce=ne.children;Ee.children=Ce}else Ee.alt=de}function S(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function fe(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function ce(){this.data.inReference=void 0}function L(){this.data.referenceType="collapsed"}function Te(ne){const de=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=de,Ee.identifier=on(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function _e(ne){this.data.characterReferenceType=ne.type}function Ae(ne){const de=this.sliceSerialize(ne),Ee=this.data.characterReferenceType;let Ce;Ee?(Ce=Ms(de,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ce=Dn(de);const we=this.stack[this.stack.length-1];we.value+=Ce}function ge(ne){const de=this.stack.pop();de.position.end=Mt(ne.end)}function Ie(ne){H.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function Re(ne){H.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function Oe(){return{type:"blockquote",children:[]}}function ze(){return{type:"code",lang:null,meta:null,value:""}}function pt(){return{type:"inlineCode",value:""}}function Ct(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function bn(){return{type:"emphasis",children:[]}}function Tn(){return{type:"heading",depth:0,children:[]}}function Rr(){return{type:"break"}}function yn(){return{type:"html",value:""}}function Br(){return{type:"image",title:null,url:"",alt:null}}function tr(){return{type:"link",title:null,url:"",children:[]}}function nr(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function lt(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function Ut(){return{type:"paragraph",children:[]}}function $t(){return{type:"strong",children:[]}}function Fr(){return{type:"text",value:""}}function qt(){return{type:"thematicBreak"}}}function Mt(e){return{line:e.line,column:e.column,offset:e.offset}}function eo(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eo(e,r):wp(e,r)}}function wp(e,t){let n;for(n in t)if(Zs.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function to(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ln({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ln({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ln({start:t.start,end:t.end})+") is still open")}function Lp(e){const t=this;t.parser=n;function n(r){return kp(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Op(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 Dp(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
5
|
+
`}]}function Pp(e,t){const n=t.value?t.value+`
|
|
6
|
+
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,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 Mp(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Rp(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Bp(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=un(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let s,u=e.footnoteCounts.get(r);u===void 0?(u=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=a+1,u+=1,e.footnoteCounts.set(r,u);const o={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(u>1?"-"+u:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,o);const d={type:"element",tagName:"sup",properties:{},children:[o]};return e.patch(t,d),e.applyData(t,d)}function Fp(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 Hp(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function no(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),a=i[0];a&&a.type==="text"?a.value="["+a.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function Up(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return no(e,t);const i={src:un(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function $p(e,t){const n={src:un(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 r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function qp(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function zp(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return no(e,t);const i={href:un(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Vp(e,t){const n={href:un(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yp(e,t,n){const r=e.all(t),i=n?Gp(n):ro(t),a={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let h;f&&f.type==="element"&&f.tagName==="p"?h=f:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let u=-1;for(;++u<r.length;){const f=r[u];(i||u!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
|
|
7
|
+
`}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const o=r[r.length-1];o&&(i||o.type!=="element"||o.tagName!=="p")&&s.push({type:"text",value:`
|
|
8
|
+
`});const d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)}function Gp(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=ro(n[r])}return t}function ro(e){const t=e.spread;return t??e.children.length>1}function Wp(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function jp(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Xp(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Kp(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Qp(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},u=gt(t.children[1]),o=fr(t.children[t.children.length-1]);u&&o&&(s.position={start:u,end:o}),i.push(s)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Jp(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,u=s?s.length:t.children.length;let o=-1;const d=[];for(;++o<u;){const h=t.children[o],g={},p=s?s[o]:void 0;p&&(g.align=p);let c={type:"element",tagName:a,properties:g,children:[]};h&&(c.children=e.all(h),e.patch(h,c),c=e.applyData(h,c)),d.push(c)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,f),e.applyData(t,f)}function Zp(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const io=9,ao=32;function eh(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const a=[];for(;r;)a.push(so(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(so(t.slice(i),i>0,!1)),a.join("")}function so(e,t,n){let r=0,i=e.length;if(t){let a=e.codePointAt(r);for(;a===io||a===ao;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(i-1);for(;a===io||a===ao;)i--,a=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function th(e,t){const n={type:"text",value:eh(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function nh(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const rh={blockquote:Op,break:Dp,code:Pp,delete:Mp,emphasis:Rp,footnoteReference:Bp,heading:Fp,html:Hp,imageReference:Up,image:$p,inlineCode:qp,linkReference:zp,link:Vp,listItem:Yp,list:Wp,paragraph:jp,root:Xp,strong:Kp,table:Qp,tableCell:Zp,tableRow:Jp,text:th,thematicBreak:nh,toml:mr,yaml:mr,definition:mr,footnoteDefinition:mr};function mr(){}const oo=-1,gr=0,Bn=1,Er=2,yi=3,xi=4,Ai=5,Ci=6,uo=7,lo=8,co=typeof self=="object"?self:globalThis,ih=(e,t)=>{const n=(i,a)=>(e.set(a,i),i),r=i=>{if(e.has(i))return e.get(i);const[a,s]=t[i];switch(a){case gr:case oo:return n(s,i);case Bn:{const u=n([],i);for(const o of s)u.push(r(o));return u}case Er:{const u=n({},i);for(const[o,d]of s)u[r(o)]=r(d);return u}case yi:return n(new Date(s),i);case xi:{const{source:u,flags:o}=s;return n(new RegExp(u,o),i)}case Ai:{const u=n(new Map,i);for(const[o,d]of s)u.set(r(o),r(d));return u}case Ci:{const u=n(new Set,i);for(const o of s)u.add(r(o));return u}case uo:{const{name:u,message:o}=s;return n(new co[u](o),i)}case lo:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:u}=new Uint8Array(s);return n(new DataView(u),s)}}return n(new co[a](s),i)};return r},fo=e=>ih(new Map,e)(0),ln="",{toString:ah}={},{keys:sh}=Object,Fn=e=>{const t=typeof e;if(t!=="object"||!e)return[gr,t];const n=ah.call(e).slice(8,-1);switch(n){case"Array":return[Bn,ln];case"Object":return[Er,ln];case"Date":return[yi,ln];case"RegExp":return[xi,ln];case"Map":return[Ai,ln];case"Set":return[Ci,ln];case"DataView":return[Bn,n]}return n.includes("Array")?[Bn,n]:n.includes("Error")?[uo,n]:[Er,n]},br=([e,t])=>e===gr&&(t==="function"||t==="symbol"),oh=(e,t,n,r)=>{const i=(s,u)=>{const o=r.push(s)-1;return n.set(u,o),o},a=s=>{if(n.has(s))return n.get(s);let[u,o]=Fn(s);switch(u){case gr:{let f=s;switch(o){case"bigint":u=lo,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+o);f=null;break;case"undefined":return i([oo],s)}return i([u,f],s)}case Bn:{if(o){let g=s;return o==="DataView"?g=new Uint8Array(s.buffer):o==="ArrayBuffer"&&(g=new Uint8Array(s)),i([o,[...g]],s)}const f=[],h=i([u,f],s);for(const g of s)f.push(a(g));return h}case Er:{if(o)switch(o){case"BigInt":return i([o,s.toString()],s);case"Boolean":case"Number":case"String":return i([o,s.valueOf()],s)}if(t&&"toJSON"in s)return a(s.toJSON());const f=[],h=i([u,f],s);for(const g of sh(s))(e||!br(Fn(s[g])))&&f.push([a(g),a(s[g])]);return h}case yi:return i([u,s.toISOString()],s);case xi:{const{source:f,flags:h}=s;return i([u,{source:f,flags:h}],s)}case Ai:{const f=[],h=i([u,f],s);for(const[g,p]of s)(e||!(br(Fn(g))||br(Fn(p))))&&f.push([a(g),a(p)]);return h}case Ci:{const f=[],h=i([u,f],s);for(const g of s)(e||!br(Fn(g)))&&f.push(a(g));return h}}const{message:d}=s;return i([u,{name:o,message:d}],s)};return a},po=(e,{json:t,lossy:n}={})=>{const r=[];return oh(!(t||n),!!t,new Map,r)(e),r},Wt=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fo(po(e,t)):structuredClone(e):(e,t)=>fo(po(e,t));function uh(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function lh(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ch(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||uh,r=e.options.footnoteBackLabel||lh,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},u=[];let o=-1;for(;++o<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[o]);if(!d)continue;const f=e.all(d),h=String(d.identifier).toUpperCase(),g=un(h.toLowerCase());let p=0;const c=[],E=e.footnoteCounts.get(h);for(;E!==void 0&&++p<=E;){c.length>0&&c.push({type:"text",value:" "});let x=typeof n=="string"?n:n(o,p);typeof x=="string"&&(x={type:"text",value:x}),c.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(o,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const b=f[f.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const x=b.children[b.children.length-1];x&&x.type==="text"?x.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...c)}else f.push(...c);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(f,!0)};e.patch(d,m),u.push(m)}if(u.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Wt(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
9
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(u,!0)},{type:"text",value:`
|
|
10
|
+
`}]}}const ho=function(e){if(e==null)return hh;if(typeof e=="function")return Tr(e);if(typeof e=="object")return Array.isArray(e)?dh(e):fh(e);if(typeof e=="string")return ph(e);throw new Error("Expected function, string, or object as test")};function dh(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ho(e[n]);return Tr(r);function r(...i){let a=-1;for(;++a<t.length;)if(t[a].apply(this,i))return!0;return!1}}function fh(e){const t=e;return Tr(n);function n(r){const i=r;let a;for(a in e)if(i[a]!==t[a])return!1;return!0}}function ph(e){return Tr(t);function t(n){return n&&n.type===e}}function Tr(e){return t;function t(n,r,i){return!!(mh(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function hh(){return!0}function mh(e){return e!==null&&typeof e=="object"&&"type"in e}function Tb(e){return e}const mo=[],gh=!0,go=!1,Eh="skip";function Eo(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const a=ho(i),s=r?-1:1;u(e,void 0,[])();function u(o,d,f){const h=o&&typeof o=="object"?o:{};if(typeof h.type=="string"){const p=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(o.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=mo,c,E,b;if((!t||a(o,d,f[f.length-1]||void 0))&&(p=bh(n(o,f)),p[0]===go))return p;if("children"in o&&o.children){const m=o;if(m.children&&p[0]!==Eh)for(E=(r?m.children.length:-1)+s,b=f.concat(m);E>-1&&E<m.children.length;){const x=m.children[E];if(c=u(x,E,b)(),c[0]===go)return c;E=typeof c[1]=="number"?c[1]:E+s}}return p}}}function bh(e){return Array.isArray(e)?e:typeof e=="number"?[gh,e]:e==null?mo:[e]}function yr(e,t,n,r){let i,a,s;typeof t=="function"&&typeof n!="function"?(a=void 0,s=t,i=n):(a=t,s=n,i=r),Eo(e,a,u,i);function u(o,d){const f=d[d.length-1],h=f?f.children.indexOf(o):void 0;return s(o,h,f)}}const Si={}.hasOwnProperty,Th={};function yh(e,t){const n=t||Th,r=new Map,i=new Map,a=new Map,s={...rh,...n.handlers},u={all:d,applyData:Ah,definitionById:r,footnoteById:i,footnoteCounts:a,footnoteOrder:[],handlers:s,one:o,options:n,patch:xh,wrap:Sh};return yr(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const h=f.type==="definition"?r:i,g=String(f.identifier).toUpperCase();h.has(g)||h.set(g,f)}}),u;function o(f,h){const g=f.type,p=u.handlers[g];if(Si.call(u.handlers,g)&&p)return p(u,f,h);if(u.options.passThrough&&u.options.passThrough.includes(g)){if("children"in f){const{children:E,...b}=f,m=Wt(b);return m.children=u.all(f),m}return Wt(f)}return(u.options.unknownHandler||Ch)(u,f,h)}function d(f){const h=[];if("children"in f){const g=f.children;let p=-1;for(;++p<g.length;){const c=u.one(g[p],f);if(c){if(p&&g[p-1].type==="break"&&(!Array.isArray(c)&&c.type==="text"&&(c.value=bo(c.value)),!Array.isArray(c)&&c.type==="element")){const E=c.children[0];E&&E.type==="text"&&(E.value=bo(E.value))}Array.isArray(c)?h.push(...c):h.push(c)}}}return h}}function xh(e,t){e.position&&(t.position=Ss(e))}function Ah(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,a=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&a&&Object.assign(n.properties,Wt(a)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Ch(e,t){const n=t.data||{},r="value"in t&&!(Si.call(n,"hProperties")||Si.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Sh(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
11
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
12
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
13
|
+
`}),n}function bo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function To(e,t){const n=yh(e,t),r=n.one(e,void 0),i=ch(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&a.children.push({type:"text",value:`
|
|
14
|
+
`},i),a}function _h(e,t){return e&&"run"in e?async function(n,r){const i=To(n,{file:r,...t});await e.run(i,r)}:function(n,r){return To(n,{file:r,...e||t})}}function yo(e){if(e)throw e}var _i,xo;function Ih(){if(xo)return _i;xo=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},a=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var f=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!f&&!h)return!1;var g;for(g in d);return typeof g>"u"||e.call(d,g)},s=function(d,f){n&&f.name==="__proto__"?n(d,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):d[f.name]=f.newValue},u=function(d,f){if(f==="__proto__")if(e.call(d,f)){if(r)return r(d,f).value}else return;return d[f]};return _i=function o(){var d,f,h,g,p,c,E=arguments[0],b=1,m=arguments.length,x=!1;for(typeof E=="boolean"&&(x=E,E=arguments[1]||{},b=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});b<m;++b)if(d=arguments[b],d!=null)for(f in d)h=u(E,f),g=u(d,f),E!==g&&(x&&g&&(a(g)||(p=i(g)))?(p?(p=!1,c=h&&i(h)?h:[]):c=h&&a(h)?h:{},s(E,{name:f,newValue:o(x,c,g)})):typeof g<"u"&&s(E,{name:f,newValue:g}));return E},_i}var Nh=Ih();const Ii=si(Nh);function Ni(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function kh(){const e=[],t={run:n,use:r};return t;function n(...i){let a=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);u(null,...i);function u(o,...d){const f=e[++a];let h=-1;if(o){s(o);return}for(;++h<i.length;)(d[h]===null||d[h]===void 0)&&(d[h]=i[h]);i=d,f?vh(f,u)(...d):s(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function vh(e,t){let n;return r;function r(...s){const u=e.length>s.length;let o;u&&s.push(i);try{o=e.apply(this,s)}catch(d){const f=d;if(u&&n)throw f;return i(f)}u||(o&&o.then&&typeof o.then=="function"?o.then(a,i):o instanceof Error?i(o):a(o))}function i(s,...u){n||(n=!0,t(s,...u))}function a(s){i(null,s)}}const Tt={basename:wh,dirname:Lh,extname:Oh,join:Dh,sep:"/"};function wh(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Hn(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,u=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else s<0&&(a=!0,s=i+1),u>-1&&(e.codePointAt(i)===t.codePointAt(u--)?u<0&&(r=i):(u=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Lh(e){if(Hn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Oh(e){Hn(e);let t=e.length,n=-1,r=0,i=-1,a=0,s;for(;t--;){const u=e.codePointAt(t);if(u===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),u===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Dh(...e){let t=-1,n;for(;++t<e.length;)Hn(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Ph(n)}function Ph(e){Hn(e);const t=e.codePointAt(0)===47;let n=Mh(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Mh(e,t){let n="",r=0,i=-1,a=0,s=-1,u,o;for(;++s<=e.length;){if(s<e.length)u=e.codePointAt(s);else{if(u===47)break;u=47}if(u===47){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(o=n.lastIndexOf("/"),o!==n.length-1){o<0?(n="",r=0):(n=n.slice(0,o),r=n.length-1-n.lastIndexOf("/")),i=s,a=0;continue}}else if(n.length>0){n="",r=0,i=s,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,a=0}else u===46&&a>-1?a++:a=-1}return n}function Hn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rh={cwd:Bh};function Bh(){return"/"}function ki(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Fh(e){if(typeof e=="string")e=new URL(e);else if(!ki(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Hh(e)}function Hh(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const vi=["history","path","basename","stem","extname","dirname"];class Ao{constructor(t){let n;t?ki(t)?n={path:t}:typeof t=="string"||Uh(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Rh.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<vi.length;){const a=vi[r];a in n&&n[a]!==void 0&&n[a]!==null&&(this[a]=a==="history"?[...n[a]]:n[a])}let i;for(i in n)vi.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Tt.basename(this.path):void 0}set basename(t){Li(t,"basename"),wi(t,"basename"),this.path=Tt.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Tt.dirname(this.path):void 0}set dirname(t){Co(this.basename,"dirname"),this.path=Tt.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Tt.extname(this.path):void 0}set extname(t){if(wi(t,"extname"),Co(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Tt.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ki(t)&&(t=Fh(t)),Li(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Tt.basename(this.path,this.extname):void 0}set stem(t){Li(t,"stem"),wi(t,"stem"),this.path=Tt.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Xe(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function wi(e,t){if(e&&e.includes(Tt.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Tt.sep+"`")}function Li(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Co(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Uh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $h=function(e){const r=this.constructor.prototype,i=r[e],a=function(){return i.apply(a,arguments)};return Object.setPrototypeOf(a,r),a},qh={}.hasOwnProperty;class Oi extends $h{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=kh()}copy(){const t=new Oi;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Ii(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Mi("data",this.frozen),this.namespace[t]=n,this):qh.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Mi("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=xr(t),r=this.parser||this.Parser;return Di("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Di("process",this.parser||this.Parser),Pi("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(a,s){const u=xr(t),o=r.parse(u);r.run(o,u,function(f,h,g){if(f||!h||!g)return d(f);const p=h,c=r.stringify(p,g);Yh(c)?g.value=c:g.result=c,d(f,g)});function d(f,h){f||!h?s(f):a?a(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Di("processSync",this.parser||this.Parser),Pi("processSync",this.compiler||this.Compiler),this.process(t,i),_o("processSync","process",n),r;function i(a,s){n=!0,yo(a),r=s}}run(t,n,r){So(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?a(void 0,r):new Promise(a);function a(s,u){const o=xr(n);i.run(t,o,d);function d(f,h,g){const p=h||t;f?u(f):s?s(p):r(void 0,p,g)}}}runSync(t,n){let r=!1,i;return this.run(t,n,a),_o("runSync","run",r),i;function a(s,u){yo(s),i=u,r=!0}}stringify(t,n){this.freeze();const r=xr(n),i=this.compiler||this.Compiler;return Pi("stringify",i),So(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Mi("use",this.frozen),t!=null)if(typeof t=="function")o(t,n);else if(typeof t=="object")Array.isArray(t)?u(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(d){if(typeof d=="function")o(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[f,...h]=d;o(f,h)}else s(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function s(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");u(d.plugins),d.settings&&(i.settings=Ii(!0,i.settings,d.settings))}function u(d){let f=-1;if(d!=null)if(Array.isArray(d))for(;++f<d.length;){const h=d[f];a(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function o(d,f){let h=-1,g=-1;for(;++h<r.length;)if(r[h][0]===d){g=h;break}if(g===-1)r.push([d,...f]);else if(f.length>0){let[p,...c]=f;const E=r[g][1];Ni(E)&&Ni(p)&&(p=Ii(!0,E,p)),r[g]=[d,p,...c]}}}}const zh=new Oi().freeze();function Di(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Pi(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mi(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function So(e){if(!Ni(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function _o(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function xr(e){return Vh(e)?e:new Ao(e)}function Vh(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Yh(e){return typeof e=="string"||Gh(e)}function Gh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wh="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Io=[],No={allowDangerousHtml:!0},jh=/^(https?|ircs?|mailto|xmpp)$/i,Xh=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function ko(e){const t=Kh(e),n=Qh(e);return Jh(t.runSync(t.parse(n),n),e)}function Kh(e){const t=e.rehypePlugins||Io,n=e.remarkPlugins||Io,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...No}:No;return zh().use(Lp).use(n).use(_h,r).use(t)}function Qh(e){const t=e.children||"",n=new Ao;return typeof t=="string"&&(n.value=t),n}function Jh(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,u=t.unwrapDisallowed,o=t.urlTransform||Zh;for(const f of Xh)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+Wh+f.id,void 0);return yr(e,d),yd(e,{Fragment:K.Fragment,components:i,ignoreInvalidStyle:!0,jsx:K.jsx,jsxs:K.jsxs,passKeys:!0,passNode:!0});function d(f,h,g){if(f.type==="raw"&&g&&typeof h=="number")return s?g.children.splice(h,1):g.children[h]={type:"text",value:f.value},h;if(f.type==="element"){let p;for(p in fi)if(Object.hasOwn(fi,p)&&Object.hasOwn(f.properties,p)){const c=f.properties[p],E=fi[p];(E===null||E.includes(f.tagName))&&(f.properties[p]=o(String(c||""),p,f))}}if(f.type==="element"){let p=n?!n.includes(f.tagName):a?a.includes(f.tagName):!1;if(!p&&r&&typeof h=="number"&&(p=!r(f,h,g)),p&&g&&typeof h=="number")return u&&f.children?g.children.splice(h,1,...f.children):g.children.splice(h,1),h}}}function Zh(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||jh.test(e.slice(0,t))?e:""}const vo=/[#.]/g;function e0(e,t){const n=e||"",r={};let i=0,a,s;for(;i<n.length;){vo.lastIndex=i;const u=vo.exec(n),o=n.slice(i,u?u.index:n.length);o&&(a?a==="#"?r.id=o:Array.isArray(r.className)?r.className.push(o):r.className=[o]:s=o,i+=o.length),u&&(a=u[0],i++)}return{type:"element",tagName:s||t||"div",properties:r,children:[]}}function wo(e,t,n){const r=n?i0(n):void 0;function i(a,s,...u){let o;if(a==null){o={type:"root",children:[]};const d=s;u.unshift(d)}else{o=e0(a,t);const d=o.tagName.toLowerCase(),f=r?r.get(d):void 0;if(o.tagName=f||d,t0(s))u.unshift(s);else for(const[h,g]of Object.entries(s))n0(e,o.properties,h,g)}for(const d of u)Ri(o.children,d);return o.type==="element"&&o.tagName==="template"&&(o.content={type:"root",children:o.children},o.children=[]),o}return i}function t0(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const i=t[r];if(i&&typeof i=="object"){if(!Array.isArray(i))return!0;const a=i;for(const s of a)if(typeof s!="number"&&typeof s!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function n0(e,t,n,r){const i=dr(e,n);let a;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;a=r}else typeof r=="boolean"?a=r:typeof r=="string"?i.spaceSeparated?a=Es(r):i.commaSeparated?a=is(r):i.commaOrSpaceSeparated?a=Es(is(r).join(" ")):a=Lo(i,i.property,r):Array.isArray(r)?a=[...r]:a=i.property==="style"?r0(r):String(r);if(Array.isArray(a)){const s=[];for(const u of a)s.push(Lo(i,i.property,u));a=s}i.property==="className"&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Ri(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Ri(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Ri(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function Lo(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Nn(n)===Nn(t)))return!0}return n}function r0(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function i0(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const a0=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],s0=wo(kn,"div"),o0=wo(Dt,"g",a0);function u0(e){const t=String(e),n=[];return{toOffset:i,toPoint:r};function r(a){if(typeof a=="number"&&a>-1&&a<=t.length){let s=0;for(;;){let u=n[s];if(u===void 0){const o=Oo(t,n[s-1]);u=o===-1?t.length+1:o+1,n[s]=u}if(u>a)return{line:s+1,column:a-(s>0?n[s-1]:0)+1,offset:a};s++}}}function i(a){if(a&&typeof a.line=="number"&&typeof a.column=="number"&&!Number.isNaN(a.line)&&!Number.isNaN(a.column)){for(;n.length<a.line;){const u=n[n.length-1],o=Oo(t,u),d=o===-1?t.length+1:o+1;if(u===d)break;n.push(d)}const s=(a.line>1?n[a.line-2]:0)+a.column-1;if(s<n[a.line-1])return s}}}function Oo(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
|
|
15
|
+
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const jt={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},Do={}.hasOwnProperty,l0=Object.prototype;function c0(e,t){const n=t||{};return Bi({file:n.file||void 0,location:!1,schema:n.space==="svg"?Dt:kn,verbose:n.verbose||!1},e)}function Bi(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Ar(e,r,n),n}case"#document":case"#document-fragment":{const r=t,i="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:Po(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){const a=String(e.file),s=u0(a),u=s.toPoint(0),o=s.toPoint(a.length);n.position={start:u,end:o}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Ar(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Ar(e,r,n),n}default:return n=d0(e,t),n}}function Po(e,t){let n=-1;const r=[];for(;++n<t.length;){const i=Bi(e,t[n]);r.push(i)}return r}function d0(e,t){const n=e.schema;e.schema=t.namespaceURI===jt.svg?Dt:kn;let r=-1;const i={};for(;++r<t.attrs.length;){const u=t.attrs[r],o=(u.prefix?u.prefix+":":"")+u.name;Do.call(l0,o)||(i[o]=u.value)}const s=(e.schema.space==="svg"?o0:s0)(t.tagName,i,Po(e,t.childNodes));if(Ar(e,t,s),s.tagName==="template"){const u=t,o=u.sourceCodeLocation,d=o&&o.startTag&&cn(o.startTag),f=o&&o.endTag&&cn(o.endTag),h=Bi(e,u.content);d&&f&&e.file&&(h.position={start:d.end,end:f.start}),s.content=h}return e.schema=n,s}function Ar(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=f0(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function f0(e,t,n){const r=cn(n);if(t.type==="element"){const i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){const a={};let s;if(n.attrs)for(s in n.attrs)Do.call(n.attrs,s)&&(a[dr(e.schema,s).property]=cn(n.attrs[s]));n.startTag;const u=cn(n.startTag),o=n.endTag?cn(n.endTag):void 0,d={opening:u};o&&(d.closing=o),d.properties=a,t.data={position:d}}}return r}function cn(e){const t=Mo({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=Mo({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function Mo(e){return e.line&&e.column?e:void 0}const Ro={}.hasOwnProperty;function Bo(e,t){const n=t||{};function r(i,...a){let s=r.invalid;const u=r.handlers;if(i&&Ro.call(i,e)){const o=String(i[e]);s=Ro.call(u,o)?u[o]:r.unknown}if(s)return s.call(this,i,...a)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const p0={},h0={}.hasOwnProperty,Fo=Bo("type",{handlers:{root:g0,element:x0,text:T0,comment:y0,doctype:b0}});function m0(e,t){const r=(t||p0).space;return Fo(e,r==="svg"?Dt:kn)}function g0(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=Fi(e.children,n,t),dn(e,n),n}function E0(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=Fi(e.children,n,t),dn(e,n),n}function b0(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return dn(e,t),t}function T0(e){const t={nodeName:"#text",value:e.value,parentNode:null};return dn(e,t),t}function y0(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return dn(e,t),t}function x0(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=Dt);const i=[];let a;if(e.properties){for(a in e.properties)if(a!=="children"&&h0.call(e.properties,a)){const o=A0(r,a,e.properties[a]);o&&i.push(o)}}const s=r.space,u={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:jt[s],childNodes:[],parentNode:null};return u.childNodes=Fi(e.children,u,r),dn(e,u),e.tagName==="template"&&e.content&&(u.content=E0(e.content,r)),u}function A0(e,t,n){const r=dr(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?as(n):bs(n));const i={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const a=i.name.indexOf(":");a<0?i.prefix="":(i.name=i.name.slice(a+1),i.prefix=r.attribute.slice(0,a)),i.namespace=jt[r.space]}return i}function Fi(e,t,n){let r=-1;const i=[];if(e)for(;++r<e.length;){const a=Fo(e[r],n);a.parentNode=t,i.push(a)}return i}function dn(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const C0=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],S0=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Be="�";var C;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(C||(C={}));const tt={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Ho(e){return e>=55296&&e<=57343}function _0(e){return e>=56320&&e<=57343}function I0(e,t){return(e-55296)*1024+9216+t}function Uo(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function $o(e){return e>=64976&&e<=65007||S0.has(e)}var J;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(J||(J={}));const N0=65536;class k0{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=N0,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:i,offset:a}=this,s=i+n,u=a+n;return{code:t,startLine:r,endLine:r,startCol:s,endCol:s,startOffset:u,endOffset:u}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(_0(n))return this.pos++,this._addGap(),I0(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,C.EOF;return this._err(J.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,C.EOF;const r=this.html.charCodeAt(n);return r===C.CARRIAGE_RETURN?C.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,C.EOF;let t=this.html.charCodeAt(this.pos);return t===C.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,C.LINE_FEED):t===C.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Ho(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===C.LINE_FEED||t===C.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){Uo(t)?this._err(J.controlCharacterInInputStream):$o(t)&&this._err(J.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var xe;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(xe||(xe={}));function qo(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const v0=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),w0=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function L0(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=w0.get(e))!==null&&t!==void 0?t:e}var Ye;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(Ye||(Ye={}));const O0=32;var Rt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Rt||(Rt={}));function Hi(e){return e>=Ye.ZERO&&e<=Ye.NINE}function D0(e){return e>=Ye.UPPER_A&&e<=Ye.UPPER_F||e>=Ye.LOWER_A&&e<=Ye.LOWER_F}function P0(e){return e>=Ye.UPPER_A&&e<=Ye.UPPER_Z||e>=Ye.LOWER_A&&e<=Ye.LOWER_Z||Hi(e)}function M0(e){return e===Ye.EQUALS||P0(e)}var Ge;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(Ge||(Ge={}));var At;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(At||(At={}));class R0{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=Ge.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=At.Strict}startEntity(t){this.decodeMode=t,this.state=Ge.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case Ge.EntityStart:return t.charCodeAt(n)===Ye.NUM?(this.state=Ge.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=Ge.NamedEntity,this.stateNamedEntity(t,n));case Ge.NumericStart:return this.stateNumericStart(t,n);case Ge.NumericDecimal:return this.stateNumericDecimal(t,n);case Ge.NumericHex:return this.stateNumericHex(t,n);case Ge.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|O0)===Ye.LOWER_X?(this.state=Ge.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=Ge.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const a=r-n;this.result=this.result*Math.pow(i,a)+Number.parseInt(t.substr(n,a),i),this.consumed+=a}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Hi(i)||D0(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Hi(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===Ye.SEMI)this.consumed+=1;else if(this.decodeMode===At.Strict)return 0;return this.emitCodePoint(L0(this.result),this.consumed),this.errors&&(t!==Ye.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],a=(i&Rt.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const s=t.charCodeAt(n);if(this.treeIndex=B0(r,i,this.treeIndex+Math.max(1,a),s),this.treeIndex<0)return this.result===0||this.decodeMode===At.Attribute&&(a===0||M0(s))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],a=(i&Rt.VALUE_LENGTH)>>14,a!==0){if(s===Ye.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==At.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Rt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Rt.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case Ge.NamedEntity:return this.result!==0&&(this.decodeMode!==At.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Ge.NumericDecimal:return this.emitNumericEntity(0,2);case Ge.NumericHex:return this.emitNumericEntity(0,3);case Ge.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Ge.EntityStart:return 0}}}function B0(e,t,n,r){const i=(t&Rt.BRANCH_LENGTH)>>7,a=t&Rt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=i?-1:e[n+o]-1}let s=n,u=s+i-1;for(;s<=u;){const o=s+u>>>1,d=e[o];if(d<r)s=o+1;else if(d>r)u=o-1;else return e[o+i]}return-1}var se;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(se||(se={}));var Xt;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Xt||(Xt={}));var ut;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(ut||(ut={}));var Y;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(Y||(Y={}));var l;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(l||(l={}));const F0=new Map([[Y.A,l.A],[Y.ADDRESS,l.ADDRESS],[Y.ANNOTATION_XML,l.ANNOTATION_XML],[Y.APPLET,l.APPLET],[Y.AREA,l.AREA],[Y.ARTICLE,l.ARTICLE],[Y.ASIDE,l.ASIDE],[Y.B,l.B],[Y.BASE,l.BASE],[Y.BASEFONT,l.BASEFONT],[Y.BGSOUND,l.BGSOUND],[Y.BIG,l.BIG],[Y.BLOCKQUOTE,l.BLOCKQUOTE],[Y.BODY,l.BODY],[Y.BR,l.BR],[Y.BUTTON,l.BUTTON],[Y.CAPTION,l.CAPTION],[Y.CENTER,l.CENTER],[Y.CODE,l.CODE],[Y.COL,l.COL],[Y.COLGROUP,l.COLGROUP],[Y.DD,l.DD],[Y.DESC,l.DESC],[Y.DETAILS,l.DETAILS],[Y.DIALOG,l.DIALOG],[Y.DIR,l.DIR],[Y.DIV,l.DIV],[Y.DL,l.DL],[Y.DT,l.DT],[Y.EM,l.EM],[Y.EMBED,l.EMBED],[Y.FIELDSET,l.FIELDSET],[Y.FIGCAPTION,l.FIGCAPTION],[Y.FIGURE,l.FIGURE],[Y.FONT,l.FONT],[Y.FOOTER,l.FOOTER],[Y.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[Y.FORM,l.FORM],[Y.FRAME,l.FRAME],[Y.FRAMESET,l.FRAMESET],[Y.H1,l.H1],[Y.H2,l.H2],[Y.H3,l.H3],[Y.H4,l.H4],[Y.H5,l.H5],[Y.H6,l.H6],[Y.HEAD,l.HEAD],[Y.HEADER,l.HEADER],[Y.HGROUP,l.HGROUP],[Y.HR,l.HR],[Y.HTML,l.HTML],[Y.I,l.I],[Y.IMG,l.IMG],[Y.IMAGE,l.IMAGE],[Y.INPUT,l.INPUT],[Y.IFRAME,l.IFRAME],[Y.KEYGEN,l.KEYGEN],[Y.LABEL,l.LABEL],[Y.LI,l.LI],[Y.LINK,l.LINK],[Y.LISTING,l.LISTING],[Y.MAIN,l.MAIN],[Y.MALIGNMARK,l.MALIGNMARK],[Y.MARQUEE,l.MARQUEE],[Y.MATH,l.MATH],[Y.MENU,l.MENU],[Y.META,l.META],[Y.MGLYPH,l.MGLYPH],[Y.MI,l.MI],[Y.MO,l.MO],[Y.MN,l.MN],[Y.MS,l.MS],[Y.MTEXT,l.MTEXT],[Y.NAV,l.NAV],[Y.NOBR,l.NOBR],[Y.NOFRAMES,l.NOFRAMES],[Y.NOEMBED,l.NOEMBED],[Y.NOSCRIPT,l.NOSCRIPT],[Y.OBJECT,l.OBJECT],[Y.OL,l.OL],[Y.OPTGROUP,l.OPTGROUP],[Y.OPTION,l.OPTION],[Y.P,l.P],[Y.PARAM,l.PARAM],[Y.PLAINTEXT,l.PLAINTEXT],[Y.PRE,l.PRE],[Y.RB,l.RB],[Y.RP,l.RP],[Y.RT,l.RT],[Y.RTC,l.RTC],[Y.RUBY,l.RUBY],[Y.S,l.S],[Y.SCRIPT,l.SCRIPT],[Y.SEARCH,l.SEARCH],[Y.SECTION,l.SECTION],[Y.SELECT,l.SELECT],[Y.SOURCE,l.SOURCE],[Y.SMALL,l.SMALL],[Y.SPAN,l.SPAN],[Y.STRIKE,l.STRIKE],[Y.STRONG,l.STRONG],[Y.STYLE,l.STYLE],[Y.SUB,l.SUB],[Y.SUMMARY,l.SUMMARY],[Y.SUP,l.SUP],[Y.TABLE,l.TABLE],[Y.TBODY,l.TBODY],[Y.TEMPLATE,l.TEMPLATE],[Y.TEXTAREA,l.TEXTAREA],[Y.TFOOT,l.TFOOT],[Y.TD,l.TD],[Y.TH,l.TH],[Y.THEAD,l.THEAD],[Y.TITLE,l.TITLE],[Y.TR,l.TR],[Y.TRACK,l.TRACK],[Y.TT,l.TT],[Y.U,l.U],[Y.UL,l.UL],[Y.SVG,l.SVG],[Y.VAR,l.VAR],[Y.WBR,l.WBR],[Y.XMP,l.XMP]]);function fn(e){var t;return(t=F0.get(e))!==null&&t!==void 0?t:l.UNKNOWN}const ue=l,H0={[se.HTML]:new Set([ue.ADDRESS,ue.APPLET,ue.AREA,ue.ARTICLE,ue.ASIDE,ue.BASE,ue.BASEFONT,ue.BGSOUND,ue.BLOCKQUOTE,ue.BODY,ue.BR,ue.BUTTON,ue.CAPTION,ue.CENTER,ue.COL,ue.COLGROUP,ue.DD,ue.DETAILS,ue.DIR,ue.DIV,ue.DL,ue.DT,ue.EMBED,ue.FIELDSET,ue.FIGCAPTION,ue.FIGURE,ue.FOOTER,ue.FORM,ue.FRAME,ue.FRAMESET,ue.H1,ue.H2,ue.H3,ue.H4,ue.H5,ue.H6,ue.HEAD,ue.HEADER,ue.HGROUP,ue.HR,ue.HTML,ue.IFRAME,ue.IMG,ue.INPUT,ue.LI,ue.LINK,ue.LISTING,ue.MAIN,ue.MARQUEE,ue.MENU,ue.META,ue.NAV,ue.NOEMBED,ue.NOFRAMES,ue.NOSCRIPT,ue.OBJECT,ue.OL,ue.P,ue.PARAM,ue.PLAINTEXT,ue.PRE,ue.SCRIPT,ue.SECTION,ue.SELECT,ue.SOURCE,ue.STYLE,ue.SUMMARY,ue.TABLE,ue.TBODY,ue.TD,ue.TEMPLATE,ue.TEXTAREA,ue.TFOOT,ue.TH,ue.THEAD,ue.TITLE,ue.TR,ue.TRACK,ue.UL,ue.WBR,ue.XMP]),[se.MATHML]:new Set([ue.MI,ue.MO,ue.MN,ue.MS,ue.MTEXT,ue.ANNOTATION_XML]),[se.SVG]:new Set([ue.TITLE,ue.FOREIGN_OBJECT,ue.DESC]),[se.XLINK]:new Set,[se.XML]:new Set,[se.XMLNS]:new Set},Ui=new Set([ue.H1,ue.H2,ue.H3,ue.H4,ue.H5,ue.H6]);Y.STYLE,Y.SCRIPT,Y.XMP,Y.IFRAME,Y.NOEMBED,Y.NOFRAMES,Y.PLAINTEXT;var _;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(_||(_={}));const $e={DATA:_.DATA,RCDATA:_.RCDATA,RAWTEXT:_.RAWTEXT,SCRIPT_DATA:_.SCRIPT_DATA,PLAINTEXT:_.PLAINTEXT,CDATA_SECTION:_.CDATA_SECTION};function U0(e){return e>=C.DIGIT_0&&e<=C.DIGIT_9}function Un(e){return e>=C.LATIN_CAPITAL_A&&e<=C.LATIN_CAPITAL_Z}function $0(e){return e>=C.LATIN_SMALL_A&&e<=C.LATIN_SMALL_Z}function Bt(e){return $0(e)||Un(e)}function zo(e){return Bt(e)||U0(e)}function Cr(e){return e+32}function Vo(e){return e===C.SPACE||e===C.LINE_FEED||e===C.TABULATION||e===C.FORM_FEED}function Yo(e){return Vo(e)||e===C.SOLIDUS||e===C.GREATER_THAN_SIGN}function q0(e){return e===C.NULL?J.nullCharacterReference:e>1114111?J.characterReferenceOutsideUnicodeRange:Ho(e)?J.surrogateCharacterReference:$o(e)?J.noncharacterCharacterReference:Uo(e)||e===C.CARRIAGE_RETURN?J.controlCharacterReference:null}class z0{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=_.DATA,this.returnState=_.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new k0(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new R0(v0,(r,i)=>{this.preprocessor.pos=this.entityStartPos+i-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(J.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(J.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const i=q0(r);i&&this._err(i,1)}}:void 0)}_err(t,n=0){var r,i;(i=(r=this.handler).onParseError)===null||i===void 0||i.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t?.())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r?.()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:xe.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:xe.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:xe.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:xe.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(qo(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const i=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);i[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(J.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=fn(t.tagName),t.type===xe.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(J.endTagWithAttributes),t.selfClosing&&this._err(J.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case xe.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case xe.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case xe.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:xe.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=Vo(t)?xe.WHITESPACE_CHARACTER:t===C.NULL?xe.NULL_CHARACTER:xe.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(xe.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=_.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?At.Attribute:At.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===_.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===_.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case _.DATA:{this._stateData(t);break}case _.RCDATA:{this._stateRcdata(t);break}case _.RAWTEXT:{this._stateRawtext(t);break}case _.SCRIPT_DATA:{this._stateScriptData(t);break}case _.PLAINTEXT:{this._statePlaintext(t);break}case _.TAG_OPEN:{this._stateTagOpen(t);break}case _.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case _.TAG_NAME:{this._stateTagName(t);break}case _.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case _.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case _.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case _.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case _.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case _.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case _.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case _.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case _.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case _.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case _.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case _.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case _.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case _.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case _.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case _.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case _.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case _.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case _.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case _.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case _.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case _.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case _.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case _.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case _.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case _.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case _.BOGUS_COMMENT:{this._stateBogusComment(t);break}case _.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case _.COMMENT_START:{this._stateCommentStart(t);break}case _.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case _.COMMENT:{this._stateComment(t);break}case _.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case _.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case _.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case _.COMMENT_END:{this._stateCommentEnd(t);break}case _.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case _.DOCTYPE:{this._stateDoctype(t);break}case _.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case _.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case _.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case _.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case _.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case _.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case _.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case _.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case _.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case _.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case _.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case _.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case _.CDATA_SECTION:{this._stateCdataSection(t);break}case _.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case _.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case _.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case _.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.TAG_OPEN;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitCodePoint(t);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case C.AMPERSAND:{this._startCharacterReference();break}case C.LESS_THAN_SIGN:{this.state=_.RCDATA_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.RAWTEXT_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(Bt(t))this._createStartTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case C.EXCLAMATION_MARK:{this.state=_.MARKUP_DECLARATION_OPEN;break}case C.SOLIDUS:{this.state=_.END_TAG_OPEN;break}case C.QUESTION_MARK:{this._err(J.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t);break}case C.EOF:{this._err(J.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(J.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=_.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(Bt(t))this._createEndTagToken(),this.state=_.TAG_NAME,this._stateTagName(t);else switch(t){case C.GREATER_THAN_SIGN:{this._err(J.missingEndTagName),this.state=_.DATA;break}case C.EOF:{this._err(J.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(J.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.tagName+=Be;break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Un(t)?Cr(t):t)}}_stateRcdataLessThanSign(t){t===C.SOLIDUS?this.state=_.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){Bt(t)?(this.state=_.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=_.BEFORE_ATTRIBUTE_NAME,!1;case C.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=_.SELF_CLOSING_START_TAG,!1;case C.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=_.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===C.SOLIDUS?this.state=_.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){Bt(t)?(this.state=_.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case C.SOLIDUS:{this.state=_.SCRIPT_DATA_END_TAG_OPEN;break}case C.EXCLAMATION_MARK:{this.state=_.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=_.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){Bt(t)?(this.state=_.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===C.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===C.HYPHEN_MINUS?(this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=_.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case C.HYPHEN_MINUS:{this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case C.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===C.SOLIDUS?this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Bt(t)?(this._emitChars("<"),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){Bt(t)?(this.state=_.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(tt.SCRIPT,!1)&&Yo(this.preprocessor.peek(tt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<tt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.NULL:{this._err(J.unexpectedNullCharacter),this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case C.HYPHEN_MINUS:{this._emitChars("-");break}case C.LESS_THAN_SIGN:{this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case C.GREATER_THAN_SIGN:{this.state=_.SCRIPT_DATA,this._emitChars(">");break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Be);break}case C.EOF:{this._err(J.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===C.SOLIDUS?(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(tt.SCRIPT,!1)&&Yo(this.preprocessor.peek(tt.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<tt.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=_.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=_.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.SOLIDUS:case C.GREATER_THAN_SIGN:case C.EOF:{this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case C.EQUALS_SIGN:{this._err(J.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=_.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:case C.SOLIDUS:case C.GREATER_THAN_SIGN:case C.EOF:{this._leaveAttrName(),this.state=_.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case C.EQUALS_SIGN:{this._leaveAttrName(),this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case C.QUOTATION_MARK:case C.APOSTROPHE:case C.LESS_THAN_SIGN:{this._err(J.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.currentAttr.name+=Be;break}default:this.currentAttr.name+=String.fromCodePoint(Un(t)?Cr(t):t)}}_stateAfterAttributeName(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.SOLIDUS:{this.state=_.SELF_CLOSING_START_TAG;break}case C.EQUALS_SIGN:{this.state=_.BEFORE_ATTRIBUTE_VALUE;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=_.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{this.state=_.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this.state=_.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(J.missingAttributeValue),this.state=_.DATA,this.emitCurrentTagToken();break}default:this.state=_.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case C.APOSTROPHE:{this.state=_.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.AMPERSAND:{this._startCharacterReference();break}case C.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case C.NULL:{this._err(J.unexpectedNullCharacter),this.currentAttr.value+=Be;break}case C.QUOTATION_MARK:case C.APOSTROPHE:case C.LESS_THAN_SIGN:case C.EQUALS_SIGN:case C.GRAVE_ACCENT:{this._err(J.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this._leaveAttrValue(),this.state=_.BEFORE_ATTRIBUTE_NAME;break}case C.SOLIDUS:{this._leaveAttrValue(),this.state=_.SELF_CLOSING_START_TAG;break}case C.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this._err(J.missingWhitespaceBetweenAttributes),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case C.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=_.DATA,this.emitCurrentTagToken();break}case C.EOF:{this._err(J.eofInTag),this._emitEOFToken();break}default:this._err(J.unexpectedSolidusInTag),this.state=_.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.data+=Be;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(tt.DASH_DASH,!0)?(this._createCommentToken(tt.DASH_DASH.length+1),this.state=_.COMMENT_START):this._consumeSequenceIfMatch(tt.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(tt.DOCTYPE.length+1),this.state=_.DOCTYPE):this._consumeSequenceIfMatch(tt.CDATA_START,!0)?this.inForeignNode?this.state=_.CDATA_SECTION:(this._err(J.cdataInHtmlContent),this._createCommentToken(tt.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=_.BOGUS_COMMENT):this._ensureHibernation()||(this._err(J.incorrectlyOpenedComment),this._createCommentToken(2),this.state=_.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_START_DASH;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptClosingOfEmptyComment),this.state=_.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptClosingOfEmptyComment),this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this._err(J.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END_DASH;break}case C.LESS_THAN_SIGN:{n.data+="<",this.state=_.COMMENT_LESS_THAN_SIGN;break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.data+=Be;break}case C.EOF:{this._err(J.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case C.EXCLAMATION_MARK:{n.data+="!",this.state=_.COMMENT_LESS_THAN_SIGN_BANG;break}case C.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=_.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===C.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=_.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===C.HYPHEN_MINUS?this.state=_.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=_.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==C.GREATER_THAN_SIGN&&t!==C.EOF&&this._err(J.nestedComment),this.state=_.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{this.state=_.COMMENT_END;break}case C.EOF:{this._err(J.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentComment(n);break}case C.EXCLAMATION_MARK:{this.state=_.COMMENT_END_BANG;break}case C.HYPHEN_MINUS:{n.data+="-";break}case C.EOF:{this._err(J.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=_.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case C.HYPHEN_MINUS:{n.data+="--!",this.state=_.COMMENT_END_DASH;break}case C.GREATER_THAN_SIGN:{this._err(J.incorrectlyClosedComment),this.state=_.DATA,this.emitCurrentComment(n);break}case C.EOF:{this._err(J.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=_.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case C.EOF:{this._err(J.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingWhitespaceBeforeDoctypeName),this.state=_.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Un(t))this._createDoctypeToken(String.fromCharCode(Cr(t))),this.state=_.DOCTYPE_NAME;else switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.NULL:{this._err(J.unexpectedNullCharacter),this._createDoctypeToken(Be),this.state=_.DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this._err(J.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=_.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.AFTER_DOCTYPE_NAME;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.name+=Be;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Un(t)?Cr(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(tt.PUBLIC,!1)?this.state=_.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(tt.SYSTEM,!1)?this.state=_.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(J.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.QUOTATION_MARK:{this._err(J.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(J.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(J.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.publicId="",this.state=_.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(J.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.publicId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case C.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.publicId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case C.GREATER_THAN_SIGN:{this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.QUOTATION_MARK:{this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(J.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:{this.state=_.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.QUOTATION_MARK:{this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{this._err(J.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(J.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.QUOTATION_MARK:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case C.APOSTROPHE:{n.systemId="",this.state=_.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case C.GREATER_THAN_SIGN:{this._err(J.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.DATA,this.emitCurrentDoctype(n);break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case C.QUOTATION_MARK:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.systemId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case C.APOSTROPHE:{this.state=_.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case C.NULL:{this._err(J.unexpectedNullCharacter),n.systemId+=Be;break}case C.GREATER_THAN_SIGN:{this._err(J.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case C.SPACE:case C.LINE_FEED:case C.TABULATION:case C.FORM_FEED:break;case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.EOF:{this._err(J.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(J.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=_.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case C.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=_.DATA;break}case C.NULL:{this._err(J.unexpectedNullCharacter);break}case C.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case C.RIGHT_SQUARE_BRACKET:{this.state=_.CDATA_SECTION_BRACKET;break}case C.EOF:{this._err(J.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===C.RIGHT_SQUARE_BRACKET?this.state=_.CDATA_SECTION_END:(this._emitChars("]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case C.GREATER_THAN_SIGN:{this.state=_.DATA;break}case C.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=_.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(C.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&zo(this.preprocessor.peek(1))?_.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){zo(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===C.SEMICOLON&&this._err(J.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const Go=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),Wo=new Set([...Go,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),Sr=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),V0=new Set([...Sr,l.OL,l.UL]),Y0=new Set([...Sr,l.BUTTON]),jo=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),Xo=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),G0=new Set([l.TR,l.TEMPLATE,l.HTML]),W0=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),j0=new Set([l.TABLE,l.TEMPLATE,l.HTML]),X0=new Set([l.TD,l.TH]);class K0{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=l.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===se.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const i=this._indexOf(t)+1;this.items.splice(i,0,n),this.tagIDs.splice(i,0,r),this.stackTop++,i===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,i===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==se.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ui,se.HTML)}popUntilTableCellPopped(){this.popUntilPopped(X0,se.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(j0,se.HTML)}clearBackToTableBodyContext(){this.clearBackTo(W0,se.HTML)}clearBackToTableRowContext(){this.clearBackTo(G0,se.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===l.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===l.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const i=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case se.HTML:{if(i===t)return!0;if(n.has(i))return!1;break}case se.SVG:{if(Xo.has(i))return!1;break}case se.MATHML:{if(jo.has(i))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Sr)}hasInListItemScope(t){return this.hasInDynamicScope(t,V0)}hasInButtonScope(t){return this.hasInDynamicScope(t,Y0)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case se.HTML:{if(Ui.has(n))return!0;if(Sr.has(n))return!1;break}case se.SVG:{if(Xo.has(n))return!1;break}case se.MATHML:{if(jo.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===se.HTML)switch(this.tagIDs[n]){case t:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===se.HTML)switch(this.tagIDs[t]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===se.HTML)switch(this.tagIDs[n]){case t:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Go.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&Wo.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&Wo.has(this.currentTagId);)this.pop()}}const $i=3;var yt;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(yt||(yt={}));const Ko={type:yt.Marker};class Q0{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],i=n.length,a=this.treeAdapter.getTagName(t),s=this.treeAdapter.getNamespaceURI(t);for(let u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===yt.Marker)break;const{element:d}=o;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===s){const f=this.treeAdapter.getAttrList(d);f.length===i&&r.push({idx:u,attrs:f})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<$i)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<$i)return;const i=new Map(n.map(s=>[s.name,s.value]));let a=0;for(let s=0;s<r.length;s++){const u=r[s];u.attrs.every(o=>i.get(o.name)===o.value)&&(a+=1,a>=$i&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(Ko)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:yt.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:yt.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(Ko);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===yt.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===yt.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===yt.Element&&n.element===t)}}const Ft={createDocument(){return{nodeName:"#document",mode:ut.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const i=e.childNodes.find(a=>a.nodeName==="#documentType");if(i)i.name=t,i.publicId=n,i.systemId=r;else{const a={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};Ft.appendChild(e,a)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(Ft.isTextNode(n)){n.value+=t;return}}Ft.appendChild(e,Ft.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&Ft.isTextNode(r)?r.value+=t:Ft.insertBefore(e,Ft.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Qo="html",J0="about:legacy-compat",Z0="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",Jo=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],em=[...Jo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],tm=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Zo=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],nm=[...Zo,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function eu(e,t){return t.some(n=>e.startsWith(n))}function rm(e){return e.name===Qo&&e.publicId===null&&(e.systemId===null||e.systemId===J0)}function im(e){if(e.name!==Qo)return ut.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===Z0)return ut.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),tm.has(n))return ut.QUIRKS;let r=t===null?em:Jo;if(eu(n,r))return ut.QUIRKS;if(r=t===null?Zo:nm,eu(n,r))return ut.LIMITED_QUIRKS}return ut.NO_QUIRKS}const tu={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},am="definitionurl",sm="definitionURL",om=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),um=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:se.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:se.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:se.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:se.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:se.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:se.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:se.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:se.XML}],["xml:space",{prefix:"xml",name:"space",namespace:se.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:se.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:se.XMLNS}]]),lm=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),cm=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function dm(e){const t=e.tagID;return t===l.FONT&&e.attrs.some(({name:r})=>r===Xt.COLOR||r===Xt.SIZE||r===Xt.FACE)||cm.has(t)}function nu(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===am){e.attrs[t].name=sm;break}}function ru(e){for(let t=0;t<e.attrs.length;t++){const n=om.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function qi(e){for(let t=0;t<e.attrs.length;t++){const n=um.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function fm(e){const t=lm.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=fn(e.tagName))}function pm(e,t){return t===se.MATHML&&(e===l.MI||e===l.MO||e===l.MN||e===l.MS||e===l.MTEXT)}function hm(e,t,n){if(t===se.MATHML&&e===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Xt.ENCODING){const i=n[r].value.toLowerCase();return i===tu.TEXT_HTML||i===tu.APPLICATION_XML}}return t===se.SVG&&(e===l.FOREIGN_OBJECT||e===l.DESC||e===l.TITLE)}function mm(e,t,n,r){return(!r||r===se.HTML)&&hm(e,t,n)||(!r||r===se.MATHML)&&pm(e,t)}const gm="hidden",Em=8,bm=3;var k;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(k||(k={}));const Tm={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},iu=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),au={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:Ft,onParseError:null};class su{constructor(t,n,r=null,i=null){this.fragmentContext=r,this.scriptHandler=i,this.currentToken=null,this.stopped=!1,this.insertionMode=k.INITIAL,this.originalInsertionMode=k.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...au,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new z0(this.options,this),this.activeFormattingElements=new Q0(this.treeAdapter),this.fragmentContextID=r?fn(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new K0(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...au,...n};t??(t=r.treeAdapter.createElement(Y.TEMPLATE,se.HTML,[]));const i=r.treeAdapter.createElement("documentmock",se.HTML,[]),a=new this(r,i,t);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(k.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var i;if(!this.onParseError)return;const a=(i=t.location)!==null&&i!==void 0?i:Tm,s={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(s)}onItemPush(t,n,r){var i,a;(a=(i=this.treeAdapter).onItemPush)===null||a===void 0||a.call(i,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,i;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(i=(r=this.treeAdapter).onItemPop)===null||i===void 0||i.call(r,t,this.openElements.current),n){let a,s;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,s=this.fragmentContextID):{current:a,currentTagId:s}=this.openElements,this._setContextModes(a,s)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===se.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,se.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=k.TEXT}switchToPlaintextParsing(){this.insertionMode=k.TEXT,this.originalInsertionMode=k.IN_BODY,this.tokenizer.state=$e.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===Y.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==se.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=$e.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=$e.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=$e.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=$e.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",i=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,i),t.location){const s=this.treeAdapter.getChildNodes(this.document).find(u=>this.treeAdapter.isDocumentTypeNode(u));s&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,se.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,se.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(Y.HTML,se.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,l.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const i=this.treeAdapter.getChildNodes(n),a=r?i.lastIndexOf(r):i.length,s=i[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(s)){const{endLine:o,endCol:d,endOffset:f}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(s,{endLine:o,endCol:d,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(s,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,i=this.treeAdapter.getTagName(t),a=n.type===xe.END_TAG&&i===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,a)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===l.SVG&&this.treeAdapter.getTagName(n)===Y.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===se.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===l.MGLYPH||t.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,se.HTML)}_processToken(t){switch(t.type){case xe.CHARACTER:{this.onCharacter(t);break}case xe.NULL_CHARACTER:{this.onNullCharacter(t);break}case xe.COMMENT:{this.onComment(t);break}case xe.DOCTYPE:{this.onDoctype(t);break}case xe.START_TAG:{this._processStartTag(t);break}case xe.END_TAG:{this.onEndTag(t);break}case xe.EOF:{this.onEof(t);break}case xe.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const i=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return mm(t,i,a,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(i=>i.type===yt.Marker||this.openElements.contains(i.element)),r=n===-1?t-1:n-1;for(let i=r;i>=0;i--){const a=this.activeFormattingElements.entries[i];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=k.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case l.TR:{this.insertionMode=k.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=k.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=k.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=k.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=k.IN_TABLE;return}case l.BODY:{this.insertionMode=k.IN_BODY;return}case l.FRAMESET:{this.insertionMode=k.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(t);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?k.AFTER_HEAD:k.BEFORE_HEAD;return}case l.TD:case l.TH:{if(t>0){this.insertionMode=k.IN_CELL;return}break}case l.HEAD:{if(t>0){this.insertionMode=k.IN_HEAD;return}break}}this.insertionMode=k.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=k.IN_SELECT_IN_TABLE;return}}this.insertionMode=k.IN_SELECT}_isElementCausesFosterParenting(t){return iu.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===se.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return H0[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Xg(this,t);return}switch(this.insertionMode){case k.INITIAL:{$n(this,t);break}case k.BEFORE_HTML:{qn(this,t);break}case k.BEFORE_HEAD:{zn(this,t);break}case k.IN_HEAD:{Vn(this,t);break}case k.IN_HEAD_NO_SCRIPT:{Yn(this,t);break}case k.AFTER_HEAD:{Gn(this,t);break}case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:{uu(this,t);break}case k.TEXT:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Gi(this,t);break}case k.IN_TABLE_TEXT:{gu(this,t);break}case k.IN_COLUMN_GROUP:{Nr(this,t);break}case k.AFTER_BODY:{wr(this,t);break}case k.AFTER_AFTER_BODY:{Lr(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){jg(this,t);return}switch(this.insertionMode){case k.INITIAL:{$n(this,t);break}case k.BEFORE_HTML:{qn(this,t);break}case k.BEFORE_HEAD:{zn(this,t);break}case k.IN_HEAD:{Vn(this,t);break}case k.IN_HEAD_NO_SCRIPT:{Yn(this,t);break}case k.AFTER_HEAD:{Gn(this,t);break}case k.TEXT:{this._insertCharacters(t);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Gi(this,t);break}case k.IN_COLUMN_GROUP:{Nr(this,t);break}case k.AFTER_BODY:{wr(this,t);break}case k.AFTER_AFTER_BODY:{Lr(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){Vi(this,t);return}switch(this.insertionMode){case k.INITIAL:case k.BEFORE_HTML:case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_TEMPLATE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:{Vi(this,t);break}case k.IN_TABLE_TEXT:{Xn(this,t);break}case k.AFTER_BODY:{Im(this,t);break}case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{Nm(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case k.INITIAL:{km(this,t);break}case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:{this._err(t,J.misplacedDoctype);break}case k.IN_TABLE_TEXT:{Xn(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,J.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?Kg(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case k.INITIAL:{$n(this,t);break}case k.BEFORE_HTML:{vm(this,t);break}case k.BEFORE_HEAD:{Lm(this,t);break}case k.IN_HEAD:{ft(this,t);break}case k.IN_HEAD_NO_SCRIPT:{Pm(this,t);break}case k.AFTER_HEAD:{Rm(this,t);break}case k.IN_BODY:{Ke(this,t);break}case k.IN_TABLE:{pn(this,t);break}case k.IN_TABLE_TEXT:{Xn(this,t);break}case k.IN_CAPTION:{Og(this,t);break}case k.IN_COLUMN_GROUP:{Wi(this,t);break}case k.IN_TABLE_BODY:{kr(this,t);break}case k.IN_ROW:{vr(this,t);break}case k.IN_CELL:{Mg(this,t);break}case k.IN_SELECT:{Tu(this,t);break}case k.IN_SELECT_IN_TABLE:{Bg(this,t);break}case k.IN_TEMPLATE:{Hg(this,t);break}case k.AFTER_BODY:{$g(this,t);break}case k.IN_FRAMESET:{qg(this,t);break}case k.AFTER_FRAMESET:{Vg(this,t);break}case k.AFTER_AFTER_BODY:{Gg(this,t);break}case k.AFTER_AFTER_FRAMESET:{Wg(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?Qg(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case k.INITIAL:{$n(this,t);break}case k.BEFORE_HTML:{wm(this,t);break}case k.BEFORE_HEAD:{Om(this,t);break}case k.IN_HEAD:{Dm(this,t);break}case k.IN_HEAD_NO_SCRIPT:{Mm(this,t);break}case k.AFTER_HEAD:{Bm(this,t);break}case k.IN_BODY:{Ir(this,t);break}case k.TEXT:{Ag(this,t);break}case k.IN_TABLE:{Wn(this,t);break}case k.IN_TABLE_TEXT:{Xn(this,t);break}case k.IN_CAPTION:{Dg(this,t);break}case k.IN_COLUMN_GROUP:{Pg(this,t);break}case k.IN_TABLE_BODY:{ji(this,t);break}case k.IN_ROW:{bu(this,t);break}case k.IN_CELL:{Rg(this,t);break}case k.IN_SELECT:{yu(this,t);break}case k.IN_SELECT_IN_TABLE:{Fg(this,t);break}case k.IN_TEMPLATE:{Ug(this,t);break}case k.AFTER_BODY:{Au(this,t);break}case k.IN_FRAMESET:{zg(this,t);break}case k.AFTER_FRAMESET:{Yg(this,t);break}case k.AFTER_AFTER_BODY:{Lr(this,t);break}}}onEof(t){switch(this.insertionMode){case k.INITIAL:{$n(this,t);break}case k.BEFORE_HTML:{qn(this,t);break}case k.BEFORE_HEAD:{zn(this,t);break}case k.IN_HEAD:{Vn(this,t);break}case k.IN_HEAD_NO_SCRIPT:{Yn(this,t);break}case k.AFTER_HEAD:{Gn(this,t);break}case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:{hu(this,t);break}case k.TEXT:{Cg(this,t);break}case k.IN_TABLE_TEXT:{Xn(this,t);break}case k.IN_TEMPLATE:{xu(this,t);break}case k.AFTER_BODY:case k.IN_FRAMESET:case k.AFTER_FRAMESET:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{Yi(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===C.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.TEXT:case k.IN_COLUMN_GROUP:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:{this._insertCharacters(t);break}case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:case k.AFTER_BODY:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{ou(this,t);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Gi(this,t);break}case k.IN_TABLE_TEXT:{mu(this,t);break}}}}function ym(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):pu(e,t),n}function xm(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Am(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,s=i;s!==n;a++,s=i){i=e.openElements.getCommonAncestor(s);const u=e.activeFormattingElements.getElementEntry(s),o=u&&a>=bm;!u||o?(o&&e.activeFormattingElements.removeEntry(u),e.openElements.remove(s)):(s=Cm(e,u),r===t&&(e.activeFormattingElements.bookmark=u),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(s,r),r=s)}return r}function Cm(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function Sm(e,t,n){const r=e.treeAdapter.getTagName(t),i=fn(r);if(e._isElementCausesFosterParenting(i))e._fosterParentElement(n);else{const a=e.treeAdapter.getNamespaceURI(t);i===l.TEMPLATE&&a===se.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function _m(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function zi(e,t){for(let n=0;n<Em;n++){const r=ym(e,t);if(!r)break;const i=xm(e,r);if(!i)break;e.activeFormattingElements.bookmark=r;const a=Am(e,i,r.element),s=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(a),s&&Sm(e,s,a),_m(e,i,r)}}function Vi(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Im(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Nm(e,t){e._appendCommentNode(t,e.document)}function Yi(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],i=e.treeAdapter.getNodeSourceCodeLocation(r);if(i&&!i.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const a=e.openElements.items[1],s=e.treeAdapter.getNodeSourceCodeLocation(a);s&&!s.endTag&&e._setEndLocation(a,t)}}}}function km(e,t){e._setDocumentType(t);const n=t.forceQuirks?ut.QUIRKS:im(t);rm(t)||e._err(t,J.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=k.BEFORE_HTML}function $n(e,t){e._err(t,J.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,ut.QUIRKS),e.insertionMode=k.BEFORE_HTML,e._processToken(t)}function vm(e,t){t.tagID===l.HTML?(e._insertElement(t,se.HTML),e.insertionMode=k.BEFORE_HEAD):qn(e,t)}function wm(e,t){const n=t.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&qn(e,t)}function qn(e,t){e._insertFakeRootElement(),e.insertionMode=k.BEFORE_HEAD,e._processToken(t)}function Lm(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.HEAD:{e._insertElement(t,se.HTML),e.headElement=e.openElements.current,e.insertionMode=k.IN_HEAD;break}default:zn(e,t)}}function Om(e,t){const n=t.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?zn(e,t):e._err(t,J.endTagWithoutMatchingOpenElement)}function zn(e,t){e._insertFakeElement(Y.HEAD,l.HEAD),e.headElement=e.openElements.current,e.insertionMode=k.IN_HEAD,e._processToken(t)}function ft(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{e._appendElement(t,se.HTML),t.ackSelfClosing=!0;break}case l.TITLE:{e._switchToTextParsing(t,$e.RCDATA);break}case l.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,$e.RAWTEXT):(e._insertElement(t,se.HTML),e.insertionMode=k.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{e._switchToTextParsing(t,$e.RAWTEXT);break}case l.SCRIPT:{e._switchToTextParsing(t,$e.SCRIPT_DATA);break}case l.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=k.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(k.IN_TEMPLATE);break}case l.HEAD:{e._err(t,J.misplacedStartTagForHeadElement);break}default:Vn(e,t)}}function Dm(e,t){switch(t.tagID){case l.HEAD:{e.openElements.pop(),e.insertionMode=k.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{Vn(e,t);break}case l.TEMPLATE:{Kt(e,t);break}default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function Kt(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==l.TEMPLATE&&e._err(t,J.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,J.endTagWithoutMatchingOpenElement)}function Vn(e,t){e.openElements.pop(),e.insertionMode=k.AFTER_HEAD,e._processToken(t)}function Pm(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{ft(e,t);break}case l.NOSCRIPT:{e._err(t,J.nestedNoscriptInHead);break}default:Yn(e,t)}}function Mm(e,t){switch(t.tagID){case l.NOSCRIPT:{e.openElements.pop(),e.insertionMode=k.IN_HEAD;break}case l.BR:{Yn(e,t);break}default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function Yn(e,t){const n=t.type===xe.EOF?J.openElementsLeftAfterEof:J.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=k.IN_HEAD,e._processToken(t)}function Rm(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.BODY:{e._insertElement(t,se.HTML),e.framesetOk=!1,e.insertionMode=k.IN_BODY;break}case l.FRAMESET:{e._insertElement(t,se.HTML),e.insertionMode=k.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{e._err(t,J.abandonedHeadElementChild),e.openElements.push(e.headElement,l.HEAD),ft(e,t),e.openElements.remove(e.headElement);break}case l.HEAD:{e._err(t,J.misplacedStartTagForHeadElement);break}default:Gn(e,t)}}function Bm(e,t){switch(t.tagID){case l.BODY:case l.HTML:case l.BR:{Gn(e,t);break}case l.TEMPLATE:{Kt(e,t);break}default:e._err(t,J.endTagWithoutMatchingOpenElement)}}function Gn(e,t){e._insertFakeElement(Y.BODY,l.BODY),e.insertionMode=k.IN_BODY,_r(e,t)}function _r(e,t){switch(t.type){case xe.CHARACTER:{uu(e,t);break}case xe.WHITESPACE_CHARACTER:{ou(e,t);break}case xe.COMMENT:{Vi(e,t);break}case xe.START_TAG:{Ke(e,t);break}case xe.END_TAG:{Ir(e,t);break}case xe.EOF:{hu(e,t);break}}}function ou(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function uu(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Fm(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function Hm(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Um(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_FRAMESET)}function $m(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML)}function qm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Ui.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,se.HTML)}function zm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Vm(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML),n||(e.formElement=e.openElements.current))}function Ym(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const i=e.openElements.tagIDs[r];if(n===l.LI&&i===l.LI||(n===l.DD||n===l.DT)&&(i===l.DD||i===l.DT)){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(i!==l.ADDRESS&&i!==l.DIV&&i!==l.P&&e._isSpecialElement(e.openElements.items[r],i))break}e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML)}function Gm(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML),e.tokenizer.state=$e.PLAINTEXT}function Wm(e,t){e.openElements.hasInScope(l.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML),e.framesetOk=!1}function jm(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(Y.A);n&&(zi(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Xm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Km(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(l.NOBR)&&(zi(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,se.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function Qm(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function Jm(e,t){e.treeAdapter.getDocumentMode(e.document)!==ut.QUIRKS&&e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._insertElement(t,se.HTML),e.framesetOk=!1,e.insertionMode=k.IN_TABLE}function lu(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function cu(e){const t=qo(e,Xt.TYPE);return t!=null&&t.toLowerCase()===gm}function Zm(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,se.HTML),cu(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function eg(e,t){e._appendElement(t,se.HTML),t.ackSelfClosing=!0}function tg(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._appendElement(t,se.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function ng(e,t){t.tagName=Y.IMG,t.tagID=l.IMG,lu(e,t)}function rg(e,t){e._insertElement(t,se.HTML),e.skipNextNewLine=!0,e.tokenizer.state=$e.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=k.TEXT}function ig(e,t){e.openElements.hasInButtonScope(l.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function ag(e,t){e.framesetOk=!1,e._switchToTextParsing(t,$e.RAWTEXT)}function du(e,t){e._switchToTextParsing(t,$e.RAWTEXT)}function sg(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===k.IN_TABLE||e.insertionMode===k.IN_CAPTION||e.insertionMode===k.IN_TABLE_BODY||e.insertionMode===k.IN_ROW||e.insertionMode===k.IN_CELL?k.IN_SELECT_IN_TABLE:k.IN_SELECT}function og(e,t){e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML)}function ug(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,se.HTML)}function lg(e,t){e.openElements.hasInScope(l.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(l.RTC),e._insertElement(t,se.HTML)}function cg(e,t){e._reconstructActiveFormattingElements(),nu(t),qi(t),t.selfClosing?e._appendElement(t,se.MATHML):e._insertElement(t,se.MATHML),t.ackSelfClosing=!0}function dg(e,t){e._reconstructActiveFormattingElements(),ru(t),qi(t),t.selfClosing?e._appendElement(t,se.SVG):e._insertElement(t,se.SVG),t.ackSelfClosing=!0}function fu(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,se.HTML)}function Ke(e,t){switch(t.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{Xm(e,t);break}case l.A:{jm(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{qm(e,t);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{$m(e,t);break}case l.LI:case l.DD:case l.DT:{Ym(e,t);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{lu(e,t);break}case l.HR:{tg(e,t);break}case l.RB:case l.RTC:{ug(e,t);break}case l.RT:case l.RP:{lg(e,t);break}case l.PRE:case l.LISTING:{zm(e,t);break}case l.XMP:{ig(e,t);break}case l.SVG:{dg(e,t);break}case l.HTML:{Fm(e,t);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{ft(e,t);break}case l.BODY:{Hm(e,t);break}case l.FORM:{Vm(e,t);break}case l.NOBR:{Km(e,t);break}case l.MATH:{cg(e,t);break}case l.TABLE:{Jm(e,t);break}case l.INPUT:{Zm(e,t);break}case l.PARAM:case l.TRACK:case l.SOURCE:{eg(e,t);break}case l.IMAGE:{ng(e,t);break}case l.BUTTON:{Wm(e,t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{Qm(e,t);break}case l.IFRAME:{ag(e,t);break}case l.SELECT:{sg(e,t);break}case l.OPTION:case l.OPTGROUP:{og(e,t);break}case l.NOEMBED:case l.NOFRAMES:{du(e,t);break}case l.FRAMESET:{Um(e,t);break}case l.TEXTAREA:{rg(e,t);break}case l.NOSCRIPT:{e.options.scriptingEnabled?du(e,t):fu(e,t);break}case l.PLAINTEXT:{Gm(e,t);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:fu(e,t)}}function fg(e,t){if(e.openElements.hasInScope(l.BODY)&&(e.insertionMode=k.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function pg(e,t){e.openElements.hasInScope(l.BODY)&&(e.insertionMode=k.AFTER_BODY,Au(e,t))}function hg(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function mg(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(l.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(l.FORM):n&&e.openElements.remove(n))}function gg(e){e.openElements.hasInButtonScope(l.P)||e._insertFakeElement(Y.P,l.P),e._closePElement()}function Eg(e){e.openElements.hasInListItemScope(l.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(l.LI),e.openElements.popUntilTagNamePopped(l.LI))}function bg(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function Tg(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function yg(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function xg(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(Y.BR,l.BR),e.openElements.pop(),e.framesetOk=!1}function pu(e,t){const n=t.tagName,r=t.tagID;for(let i=e.openElements.stackTop;i>0;i--){const a=e.openElements.items[i],s=e.openElements.tagIDs[i];if(r===s&&(r!==l.UNKNOWN||e.treeAdapter.getTagName(a)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=i&&e.openElements.shortenToLength(i);break}if(e._isSpecialElement(a,s))break}}function Ir(e,t){switch(t.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{zi(e,t);break}case l.P:{gg(e);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{hg(e,t);break}case l.LI:{Eg(e);break}case l.DD:case l.DT:{bg(e,t);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{Tg(e);break}case l.BR:{xg(e);break}case l.BODY:{fg(e,t);break}case l.HTML:{pg(e,t);break}case l.FORM:{mg(e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{yg(e,t);break}case l.TEMPLATE:{Kt(e,t);break}default:pu(e,t)}}function hu(e,t){e.tmplInsertionModeStack.length>0?xu(e,t):Yi(e,t)}function Ag(e,t){var n;t.tagID===l.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function Cg(e,t){e._err(t,J.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Gi(e,t){if(e.openElements.currentTagId!==void 0&&iu.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=k.IN_TABLE_TEXT,t.type){case xe.CHARACTER:{gu(e,t);break}case xe.WHITESPACE_CHARACTER:{mu(e,t);break}}else jn(e,t)}function Sg(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_CAPTION}function _g(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_COLUMN_GROUP}function Ig(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.COLGROUP,l.COLGROUP),e.insertionMode=k.IN_COLUMN_GROUP,Wi(e,t)}function Ng(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_TABLE_BODY}function kg(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(Y.TBODY,l.TBODY),e.insertionMode=k.IN_TABLE_BODY,kr(e,t)}function vg(e,t){e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function wg(e,t){cu(t)?e._appendElement(t,se.HTML):jn(e,t),t.ackSelfClosing=!0}function Lg(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,se.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function pn(e,t){switch(t.tagID){case l.TD:case l.TH:case l.TR:{kg(e,t);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{ft(e,t);break}case l.COL:{Ig(e,t);break}case l.FORM:{Lg(e,t);break}case l.TABLE:{vg(e,t);break}case l.TBODY:case l.TFOOT:case l.THEAD:{Ng(e,t);break}case l.INPUT:{wg(e,t);break}case l.CAPTION:{Sg(e,t);break}case l.COLGROUP:{_g(e,t);break}default:jn(e,t)}}function Wn(e,t){switch(t.tagID){case l.TABLE:{e.openElements.hasInTableScope(l.TABLE)&&(e.openElements.popUntilTagNamePopped(l.TABLE),e._resetInsertionMode());break}case l.TEMPLATE:{Kt(e,t);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:jn(e,t)}}function jn(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,_r(e,t),e.fosterParentingEnabled=n}function mu(e,t){e.pendingCharacterTokens.push(t)}function gu(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function Xn(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)jn(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const Eu=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function Og(e,t){const n=t.tagID;Eu.has(n)?e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_TABLE,pn(e,t)):Ke(e,t)}function Dg(e,t){const n=t.tagID;switch(n){case l.CAPTION:case l.TABLE:{e.openElements.hasInTableScope(l.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(l.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_TABLE,n===l.TABLE&&Wn(e,t));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Ir(e,t)}}function Wi(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.COL:{e._appendElement(t,se.HTML),t.ackSelfClosing=!0;break}case l.TEMPLATE:{ft(e,t);break}default:Nr(e,t)}}function Pg(e,t){switch(t.tagID){case l.COLGROUP:{e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=k.IN_TABLE);break}case l.TEMPLATE:{Kt(e,t);break}case l.COL:break;default:Nr(e,t)}}function Nr(e,t){e.openElements.currentTagId===l.COLGROUP&&(e.openElements.pop(),e.insertionMode=k.IN_TABLE,e._processToken(t))}function kr(e,t){switch(t.tagID){case l.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_ROW;break}case l.TH:case l.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(Y.TR,l.TR),e.insertionMode=k.IN_ROW,vr(e,t);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE,pn(e,t));break}default:pn(e,t)}}function ji(e,t){const n=t.tagID;switch(t.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE);break}case l.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE,Wn(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Wn(e,t)}}function vr(e,t){switch(t.tagID){case l.TH:case l.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,se.HTML),e.insertionMode=k.IN_CELL,e.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,kr(e,t));break}default:pn(e,t)}}function bu(e,t){switch(t.tagID){case l.TR:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY);break}case l.TABLE:{e.openElements.hasInTableScope(l.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,ji(e,t));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(l.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=k.IN_TABLE_BODY,ji(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Wn(e,t)}}function Mg(e,t){const n=t.tagID;Eu.has(n)?(e.openElements.hasInTableScope(l.TD)||e.openElements.hasInTableScope(l.TH))&&(e._closeTableCell(),vr(e,t)):Ke(e,t)}function Rg(e,t){const n=t.tagID;switch(n){case l.TD:case l.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=k.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),bu(e,t));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Ir(e,t)}}function Tu(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e._insertElement(t,se.HTML);break}case l.OPTGROUP:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._insertElement(t,se.HTML);break}case l.HR:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop(),e._appendElement(t,se.HTML),t.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),t.tagID!==l.SELECT&&e._processStartTag(t));break}case l.SCRIPT:case l.TEMPLATE:{ft(e,t);break}}}function yu(e,t){switch(t.tagID){case l.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===l.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===l.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===l.OPTGROUP&&e.openElements.pop();break}case l.OPTION:{e.openElements.currentTagId===l.OPTION&&e.openElements.pop();break}case l.SELECT:{e.openElements.hasInSelectScope(l.SELECT)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode());break}case l.TEMPLATE:{Kt(e,t);break}}}function Bg(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e._processStartTag(t)):Tu(e,t)}function Fg(e,t){const n=t.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(l.SELECT),e._resetInsertionMode(),e.onEndTag(t)):yu(e,t)}function Hg(e,t){switch(t.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{ft(e,t);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{e.tmplInsertionModeStack[0]=k.IN_TABLE,e.insertionMode=k.IN_TABLE,pn(e,t);break}case l.COL:{e.tmplInsertionModeStack[0]=k.IN_COLUMN_GROUP,e.insertionMode=k.IN_COLUMN_GROUP,Wi(e,t);break}case l.TR:{e.tmplInsertionModeStack[0]=k.IN_TABLE_BODY,e.insertionMode=k.IN_TABLE_BODY,kr(e,t);break}case l.TD:case l.TH:{e.tmplInsertionModeStack[0]=k.IN_ROW,e.insertionMode=k.IN_ROW,vr(e,t);break}default:e.tmplInsertionModeStack[0]=k.IN_BODY,e.insertionMode=k.IN_BODY,Ke(e,t)}}function Ug(e,t){t.tagID===l.TEMPLATE&&Kt(e,t)}function xu(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(l.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Yi(e,t)}function $g(e,t){t.tagID===l.HTML?Ke(e,t):wr(e,t)}function Au(e,t){var n;if(t.tagID===l.HTML){if(e.fragmentContext||(e.insertionMode=k.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===l.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else wr(e,t)}function wr(e,t){e.insertionMode=k.IN_BODY,_r(e,t)}function qg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.FRAMESET:{e._insertElement(t,se.HTML);break}case l.FRAME:{e._appendElement(t,se.HTML),t.ackSelfClosing=!0;break}case l.NOFRAMES:{ft(e,t);break}}}function zg(e,t){t.tagID===l.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==l.FRAMESET&&(e.insertionMode=k.AFTER_FRAMESET))}function Vg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.NOFRAMES:{ft(e,t);break}}}function Yg(e,t){t.tagID===l.HTML&&(e.insertionMode=k.AFTER_AFTER_FRAMESET)}function Gg(e,t){t.tagID===l.HTML?Ke(e,t):Lr(e,t)}function Lr(e,t){e.insertionMode=k.IN_BODY,_r(e,t)}function Wg(e,t){switch(t.tagID){case l.HTML:{Ke(e,t);break}case l.NOFRAMES:{ft(e,t);break}}}function jg(e,t){t.chars=Be,e._insertCharacters(t)}function Xg(e,t){e._insertCharacters(t),e.framesetOk=!1}function Cu(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==se.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Kg(e,t){if(dm(t))Cu(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===se.MATHML?nu(t):r===se.SVG&&(fm(t),ru(t)),qi(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Qg(e,t){if(t.tagID===l.P||t.tagID===l.BR){Cu(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===se.HTML){e._endTagOutsideForeignContent(t);break}const i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}Y.AREA,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BR,Y.COL,Y.EMBED,Y.FRAME,Y.HR,Y.IMG,Y.INPUT,Y.KEYGEN,Y.LINK,Y.META,Y.PARAM,Y.SOURCE,Y.TRACK,Y.WBR;const Jg=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Zg=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),Su={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function _u(e,t){const n=l1(e),r=Bo("type",{handlers:{root:e1,element:t1,text:n1,comment:Nu,doctype:r1,raw:a1},unknown:s1}),i={parser:n?new su(Su):su.getFragmentParser(void 0,Su),handle(u){r(u,i)},stitches:!1,options:t||{}};r(e,i),hn(i,gt());const a=n?i.parser.document:i.parser.getFragment(),s=c0(a,{file:i.options.file});return i.stitches&&yr(s,"comment",function(u,o,d){const f=u;if(f.value.stitch&&d&&o!==void 0){const h=d.children;return h[o]=f.value.stitch,o}}),s.type==="root"&&s.children.length===1&&s.children[0].type===e.type?s.children[0]:s}function Iu(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function e1(e,t){Iu(e.children,t)}function t1(e,t){o1(e,t),Iu(e.children,t),u1(e,t)}function n1(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:xe.CHARACTER,chars:e.value,location:Kn(e)};hn(t,gt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function r1(e,t){const n={type:xe.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:Kn(e)};hn(t,gt(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function i1(e,t){t.stitches=!0;const n=c1(e);if("children"in e&&"children"in n){const r=_u({type:"root",children:e.children},t.options);n.children=r.children}Nu({type:"comment",value:{stitch:n}},t)}function Nu(e,t){const n=e.value,r={type:xe.COMMENT,data:n,location:Kn(e)};hn(t,gt(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function a1(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,ku(t,gt(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Jg,"<$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function s1(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))i1(n,t);else{let r="";throw Zg.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function hn(e,t){ku(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=$e.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function ku(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function o1(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===$e.PLAINTEXT)return;hn(t,gt(e));const r=t.parser.openElements.current;let i="namespaceURI"in r?r.namespaceURI:jt.html;i===jt.html&&n==="svg"&&(i=jt.svg);const a=m0({...e,children:[]},{space:i===jt.svg?"svg":"html"}),s={type:xe.START_TAG,tagName:n,tagID:fn(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in a?a.attrs:[],location:Kn(e)};t.parser.currentToken=s,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function u1(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&C0.includes(n)||t.parser.tokenizer.state===$e.PLAINTEXT)return;hn(t,fr(e));const r={type:xe.END_TAG,tagName:n,tagID:fn(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:Kn(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===$e.RCDATA||t.parser.tokenizer.state===$e.RAWTEXT||t.parser.tokenizer.state===$e.SCRIPT_DATA)&&(t.parser.tokenizer.state=$e.DATA)}function l1(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function Kn(e){const t=gt(e)||{line:void 0,column:void 0,offset:void 0},n=fr(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function c1(e){return"children"in e?Wt({...e,children:[]}):Wt(e)}function vu(e){return function(t,n){return _u(t,{...e,file:n})}}const Qt=["ariaDescribedBy","ariaLabel","ariaLabelledBy"],mn={ancestors:{tbody:["table"],td:["table"],th:["table"],thead:["table"],tfoot:["table"],tr:["table"]},attributes:{a:[...Qt,"dataFootnoteBackref","dataFootnoteRef",["className","data-footnote-backref"],"href"],blockquote:["cite"],code:[["className",/^language-./]],del:["cite"],div:["itemScope","itemType"],dl:[...Qt],h2:[["className","sr-only"]],img:[...Qt,"longDesc","src"],input:[["disabled",!0],["type","checkbox"]],ins:["cite"],li:[["className","task-list-item"]],ol:[...Qt,["className","contains-task-list"]],q:["cite"],section:["dataFootnotes",["className","footnotes"]],source:["srcSet"],summary:[...Qt],table:[...Qt],ul:[...Qt,["className","contains-task-list"]],"*":["abbr","accept","acceptCharset","accessKey","action","align","alt","axis","border","cellPadding","cellSpacing","char","charOff","charSet","checked","clear","colSpan","color","cols","compact","coords","dateTime","dir","encType","frame","hSpace","headers","height","hrefLang","htmlFor","id","isMap","itemProp","label","lang","maxLength","media","method","multiple","name","noHref","noShade","noWrap","open","prompt","readOnly","rev","rowSpan","rows","rules","scope","selected","shape","size","span","start","summary","tabIndex","title","useMap","vAlign","value","width"]},clobber:["ariaDescribedBy","ariaLabelledBy","id","name"],clobberPrefix:"user-content-",protocols:{cite:["http","https"],href:["http","https","irc","ircs","mailto","xmpp"],longDesc:["http","https"],src:["http","https"]},required:{input:{disabled:!0,type:"checkbox"}},strip:["script"],tagNames:["a","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","input","ins","kbd","li","ol","p","picture","pre","q","rp","rt","ruby","s","samp","section","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","tt","ul","var"]},Ht={}.hasOwnProperty;function d1(e,t){let n={type:"root",children:[]};const r={schema:t?{...mn,...t}:mn,stack:[]},i=wu(r,e);return i&&(Array.isArray(i)?i.length===1?n=i[0]:n.children=i:n=i),n}function wu(e,t){if(t&&typeof t=="object"){const n=t;switch(typeof n.type=="string"?n.type:""){case"comment":return f1(e,n);case"doctype":return p1(e,n);case"element":return h1(e,n);case"root":return m1(e,n);case"text":return g1(e,n)}}}function f1(e,t){if(e.schema.allowComments){const n=typeof t.value=="string"?t.value:"",r=n.indexOf("-->"),a={type:"comment",value:r<0?n:n.slice(0,r)};return Qn(a,t),a}}function p1(e,t){if(e.schema.allowDoctypes){const n={type:"doctype"};return Qn(n,t),n}}function h1(e,t){const n=typeof t.tagName=="string"?t.tagName:"";e.stack.push(n);const r=Lu(e,t.children),i=E1(e,t.properties);e.stack.pop();let a=!1;if(n&&n!=="*"&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Ht.call(e.schema.ancestors,n))){const u=e.schema.ancestors[n];let o=-1;for(a=!1;++o<u.length;)e.stack.includes(u[o])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;const s={type:"element",tagName:n,properties:i,children:r};return Qn(s,t),s}function m1(e,t){const r={type:"root",children:Lu(e,t.children)};return Qn(r,t),r}function g1(e,t){const r={type:"text",value:typeof t.value=="string"?t.value:""};return Qn(r,t),r}function Lu(e,t){const n=[];if(Array.isArray(t)){const r=t;let i=-1;for(;++i<r.length;){const a=wu(e,r[i]);a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}function E1(e,t){const n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Ht.call(r,n)?r[n]:void 0,s=r&&Ht.call(r,"*")?r["*"]:void 0,u=t&&typeof t=="object"?t:{},o={};let d;for(d in u)if(Ht.call(u,d)){const f=u[d];let h=Ou(e,Pu(a,d),d,f);h==null&&(h=Ou(e,Pu(s,d),d,f)),h!=null&&(o[d]=h)}if(i&&Ht.call(i,n)){const f=i[n];for(d in f)Ht.call(f,d)&&!Ht.call(o,d)&&(o[d]=f[d])}return o}function Ou(e,t,n,r){return t?Array.isArray(r)?b1(e,t,n,r):Du(e,t,n,r):void 0}function b1(e,t,n,r){let i=-1;const a=[];for(;++i<r.length;){const s=Du(e,t,n,r[i]);(typeof s=="number"||typeof s=="string")&&a.push(s)}return a}function Du(e,t,n,r){if(!(typeof r!="boolean"&&typeof r!="number"&&typeof r!="string")&&T1(e,n,r)){if(typeof t=="object"&&t.length>1){let i=!1,a=0;for(;++a<t.length;){const s=t[a];if(s&&typeof s=="object"&&"flags"in s){if(s.test(String(r))){i=!0;break}}else if(s===r){i=!0;break}}if(!i)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function T1(e,t,n){const r=e.schema.protocols&&Ht.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;const i=String(n),a=i.indexOf(":"),s=i.indexOf("?"),u=i.indexOf("#"),o=i.indexOf("/");if(a<0||o>-1&&a>o||s>-1&&a>s||u>-1&&a>u)return!0;let d=-1;for(;++d<r.length;){const f=r[d];if(a===f.length&&i.slice(0,f.length)===f)return!0}return!1}function Qn(e,t){const n=Ss(t);t.data&&(e.data=Wt(t.data)),n&&(e.position=n)}function Pu(e,t){let n,r=-1;if(e)for(;++r<e.length;){const i=e[r],a=typeof i=="string"?i:i[0];if(a===t)return i;a==="data*"&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()==="data")return n}function Mu(e){return function(t){return d1(t,e)}}function Ru(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const y1=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Bu={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function Fu(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function x1(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function A1(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Hu(e){return A1(e)||Fu(e)}const C1=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Xi(e,t){const n=t||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let a=0,s=-1,u="",o,d;n.position&&("start"in n.position||"indent"in n.position?(d=n.position.indent,o=n.position.start):o=n.position);let f=(o?o.line:0)||1,h=(o?o.column:0)||1,g=c(),p;for(a--;++a<=e.length;)if(p===10&&(h=(d?d[s]:0)||1),p=e.charCodeAt(a),p===38){const m=e.charCodeAt(a+1);if(m===9||m===10||m===12||m===32||m===38||m===60||Number.isNaN(m)||r&&m===r){u+=String.fromCharCode(p),h++;continue}const x=a+1;let A=x,v=x,N;if(m===35){v=++A;const U=e.charCodeAt(v);U===88||U===120?(N="hexadecimal",v=++A):N="decimal"}else N="named";let F="",V="",O="";const w=N==="named"?Hu:N==="decimal"?Fu:x1;for(v--;++v<=e.length;){const U=e.charCodeAt(v);if(!w(U))break;O+=String.fromCharCode(U),N==="named"&&y1.includes(O)&&(F=O,V=Dn(O))}let H=e.charCodeAt(v)===59;if(H){v++;const U=N==="named"?Dn(O):!1;U&&(F=O,V=U)}let y=1+v-x,M="";if(!(!H&&n.nonTerminated===!1))if(!O)N!=="named"&&E(4,y);else if(N==="named"){if(H&&!V)E(5,1);else if(F!==O&&(v=A+F.length,y=1+v-A,H=!1),!H){const U=F?1:3;if(n.attribute){const I=e.charCodeAt(v);I===61?(E(U,y),V=""):Hu(I)?V="":E(U,y)}else E(U,y)}M=V}else{H||E(2,y);let U=Number.parseInt(O,N==="hexadecimal"?16:10);if(S1(U))E(7,y),M="�";else if(U in Bu)E(6,y),M=Bu[U];else{let I="";_1(U)&&E(6,y),U>65535&&(U-=65536,I+=String.fromCharCode(U>>>10|55296),U=56320|U&1023),M=I+String.fromCharCode(U)}}if(M){b(),g=c(),a=v-1,h+=v-x+1,i.push(M);const U=c();U.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,M,{start:g,end:U},e.slice(x-1,v)),g=U}else O=e.slice(x-1,v),u+=O,h+=O.length,a=v-1}else p===10&&(f++,s++,h=0),Number.isNaN(p)?b():(u+=String.fromCharCode(p),h++);return i.join("");function c(){return{line:f,column:h,offset:a+((o?o.offset:0)||0)}}function E(m,x){let A;n.warning&&(A=c(),A.column+=x,A.offset+=x,n.warning.call(n.warningContext||void 0,C1[m],A,m))}function b(){u&&(i.push(u),n.text&&n.text.call(n.textContext||void 0,u,{start:g,end:c()}),u="")}}function S1(e){return e>=55296&&e<=57343||e>1114111}function _1(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}const I1=/["&'<>`]/g,N1=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,k1=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,v1=/[|\\{}()[\]^$+*?.]/g,Uu=new WeakMap;function w1(e,t){if(e=e.replace(t.subset?L1(t.subset):I1,r),t.subset||t.escapeOnly)return e;return e.replace(N1,n).replace(k1,r);function n(i,a,s){return t.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(a+2),t)}function r(i,a,s){return t.format(i.charCodeAt(0),s.charCodeAt(a+1),t)}}function L1(e){let t=Uu.get(e);return t||(t=O1(e),Uu.set(e,t)),t}function O1(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(v1,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}function D1(e){return"&#x"+e.toString(16).toUpperCase()+";"}function P1(e,t){return w1(e,Object.assign({format:D1},t))}const M1={}.hasOwnProperty,R1={},$u=/^[^\t\n\r "#'.<=>`}]+$/,B1=/^[^\t\n\r "'<=>`}]+$/;function F1(){return{canContainEols:["textDirective"],enter:{directiveContainer:U1,directiveContainerAttributes:Ji,directiveContainerLabel:z1,directiveLeaf:$1,directiveLeafAttributes:Ji,directiveText:q1,directiveTextAttributes:Ji},exit:{directiveContainer:ia,directiveContainerAttributeClassValue:ea,directiveContainerAttributeIdValue:Zi,directiveContainerAttributeName:na,directiveContainerAttributeValue:ta,directiveContainerAttributes:ra,directiveContainerLabel:V1,directiveContainerName:Qi,directiveLeaf:ia,directiveLeafAttributeClassValue:ea,directiveLeafAttributeIdValue:Zi,directiveLeafAttributeName:na,directiveLeafAttributeValue:ta,directiveLeafAttributes:ra,directiveLeafName:Qi,directiveText:ia,directiveTextAttributeClassValue:ea,directiveTextAttributeIdValue:Zi,directiveTextAttributeName:na,directiveTextAttributeValue:ta,directiveTextAttributes:ra,directiveTextName:Qi}}}function H1(e){const t=R1;if(t.quote!=='"'&&t.quote!=="'"&&t.quote!==null&&t.quote!==void 0)throw new Error("Invalid quote `"+t.quote+"`, expected `'` or `\"`");return n.peek=Y1,{handlers:{containerDirective:n,leafDirective:n,textDirective:n},unsafe:[{character:"\r",inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{character:`
|
|
16
|
+
`,inConstruct:["leafDirectiveLabel","containerDirectiveLabel"]},{before:"[^:]",character:":",after:"[A-Za-z]",inConstruct:["phrasing"]},{atBreak:!0,character:":",after:":"}]};function n(a,s,u,o){const d=u.createTracker(o),f=G1(a),h=u.enter(a.type);let g=d.move(f+(a.name||"")),p;if(a.type==="containerDirective"){const c=(a.children||[])[0];p=qu(c)?c:void 0}else p=a;if(p&&p.children&&p.children.length>0){const c=u.enter("label"),E=`${a.type}Label`,b=u.enter(E);g+=d.move("["),g+=d.move(u.containerPhrasing(p,{...d.current(),before:g,after:"]"})),g+=d.move("]"),b(),c()}if(g+=d.move(r(a,u)),a.type==="containerDirective"){const c=(a.children||[])[0];let E=a;qu(c)&&(E=Object.assign({},a,{children:a.children.slice(1)})),E&&E.children&&E.children.length>0&&(g+=d.move(`
|
|
17
|
+
`),g+=d.move(u.containerFlow(E,d.current()))),g+=d.move(`
|
|
18
|
+
`+f)}return h(),g}function r(a,s){const u=a.attributes||{},o=[];let d,f,h,g;for(g in u)if(M1.call(u,g)&&u[g]!==void 0&&u[g]!==null){const p=String(u[g]);if(g==="id")h=t.preferShortcut!==!1&&$u.test(p)?"#"+p:i("id",p,a,s);else if(g==="class"){const c=p.split(/[\t\n\r ]+/g),E=[],b=[];let m=-1;for(;++m<c.length;)(t.preferShortcut!==!1&&$u.test(c[m])?b:E).push(c[m]);d=E.length>0?i("class",E.join(" "),a,s):"",f=b.length>0?"."+b.join("."):""}else o.push(i(g,p,a,s))}return d&&o.unshift(d),f&&o.unshift(f),h&&o.unshift(h),o.length>0?"{"+o.join(" ")+"}":""}function i(a,s,u,o){if(t.collapseEmptyAttributes!==!1&&!s)return a;if(t.preferUnquoted&&B1.test(s))return a+"="+s;const d=t.quote||o.options.quote||'"',f=d==='"'?"'":'"',h=t.quoteSmart&&Ru(s,d)>Ru(s,f)?f:d,g=u.type==="textDirective"?[h]:[h,`
|
|
19
|
+
`,"\r"];return a+"="+h+P1(s,{subset:g})+h}}function U1(e){Ki.call(this,"containerDirective",e)}function $1(e){Ki.call(this,"leafDirective",e)}function q1(e){Ki.call(this,"textDirective",e)}function Ki(e,t){this.enter({type:e,name:"",attributes:{},children:[]},t)}function Qi(e){const t=this.stack[this.stack.length-1];t.type==="containerDirective"||t.type==="leafDirective"||t.type,t.name=this.sliceSerialize(e)}function z1(e){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},e)}function V1(e){this.exit(e)}function Ji(){this.data.directiveAttributes=[],this.buffer()}function Zi(e){this.data.directiveAttributes.push(["id",Xi(this.sliceSerialize(e),{attribute:!0})])}function ea(e){this.data.directiveAttributes.push(["class",Xi(this.sliceSerialize(e),{attribute:!0})])}function ta(e){const t=this.data.directiveAttributes;t[t.length-1][1]=Xi(this.sliceSerialize(e),{attribute:!0})}function na(e){this.data.directiveAttributes.push([this.sliceSerialize(e),""])}function ra(){const e=this.data.directiveAttributes,t={};let n=-1;for(;++n<e.length;){const i=e[n];i[0]==="class"&&t.class?t.class+=" "+i[1]:t[i[0]]=i[1]}this.data.directiveAttributes=void 0,this.resume();const r=this.stack[this.stack.length-1];r.type==="containerDirective"||r.type==="leafDirective"||r.type,r.attributes=t}function ia(e){this.exit(e)}function Y1(){return":"}function qu(e){return!!(e&&e.type==="paragraph"&&e.data&&e.data.directiveLabel)}function G1(e){let t=0;return e.type==="containerDirective"?(Eo(e,function(n,r){if(n.type==="containerDirective"){let i=r.length,a=0;for(;i--;)r[i].type==="containerDirective"&&a++;a>t&&(t=a)}}),t+=3):e.type==="leafDirective"?t=2:t=1,":".repeat(t)}function aa(e,t,n,r,i,a,s,u,o,d,f,h,g,p,c){let E,b;return m;function m(T){return e.enter(r),e.enter(i),e.consume(T),e.exit(i),x}function x(T){return T===35?(E=s,A(T)):T===46?(E=u,A(T)):c&&Ne(T)?ke(e,x,"whitespace")(T):!c&&Ue(T)?xt(e,x)(T):T===null||he(T)||Mn(T)||Pn(T)&&T!==45&&T!==95?I(T):(e.enter(a),e.enter(o),e.consume(T),F)}function A(T){const $=E+"Marker";return e.enter(a),e.enter(E),e.enter($),e.consume(T),e.exit($),v}function v(T){if(T===null||T===34||T===35||T===39||T===46||T===60||T===61||T===62||T===96||T===125||Ue(T))return n(T);const $=E+"Value";return e.enter($),e.consume(T),N}function N(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||Ue(T)){const $=E+"Value";return e.exit($),e.exit(E),e.exit(a),x(T)}return e.consume(T),N}function F(T){return T===null||he(T)||Mn(T)||Pn(T)&&T!==45&&T!==46&&T!==58&&T!==95?(e.exit(o),c&&Ne(T)?ke(e,V,"whitespace")(T):!c&&Ue(T)?xt(e,V)(T):V(T)):(e.consume(T),F)}function V(T){return T===61?(e.enter(d),e.consume(T),e.exit(d),O):(e.exit(a),x(T))}function O(T){return T===null||T===60||T===61||T===62||T===96||T===125||c&&he(T)?n(T):T===34||T===39?(e.enter(f),e.enter(g),e.consume(T),e.exit(g),b=T,H):c&&Ne(T)?ke(e,O,"whitespace")(T):!c&&Ue(T)?xt(e,O)(T):(e.enter(h),e.enter(p),e.consume(T),b=void 0,w)}function w(T){return T===null||T===34||T===39||T===60||T===61||T===62||T===96?n(T):T===125||Ue(T)?(e.exit(p),e.exit(h),e.exit(a),x(T)):(e.consume(T),w)}function H(T){return T===b?(e.enter(g),e.consume(T),e.exit(g),e.exit(f),e.exit(a),U):(e.enter(h),y(T))}function y(T){return T===b?(e.exit(h),H(T)):T===null?n(T):he(T)?c?n(T):xt(e,y)(T):(e.enter(p),e.consume(T),M)}function M(T){return T===b||T===null||he(T)?(e.exit(p),y(T)):(e.consume(T),M)}function U(T){return T===125||Ue(T)?x(T):I(T)}function I(T){return T===125?(e.enter(i),e.consume(T),e.exit(i),e.exit(r),t):n(T)}}function sa(e,t,n,r,i,a,s){let u=0,o=0,d;return f;function f(b){return e.enter(r),e.enter(i),e.consume(b),e.exit(i),h}function h(b){return b===93?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(a),g(b))}function g(b){if(b===93&&!o)return E(b);const m=e.enter("chunkText",{_contentTypeTextTrailing:!0,contentType:"text",previous:d});return d&&(d.next=m),d=m,p(b)}function p(b){return b===null||u>999||b===91&&++o>32?n(b):b===93&&!o--?(e.exit("chunkText"),E(b)):he(b)?s?n(b):(e.consume(b),e.exit("chunkText"),g):(e.consume(b),b===92?c:p)}function c(b){return b===91||b===92||b===93?(e.consume(b),u++,p):p(b)}function E(b){return e.exit(a),e.enter(i),e.consume(b),e.exit(i),e.exit(r),t}}function oa(e,t,n,r){const i=this;return a;function a(u){return u===null||he(u)||Pn(u)||Mn(u)?n(u):(e.enter(r),e.consume(u),s)}function s(u){return u===null||he(u)||Mn(u)||Pn(u)&&u!==45&&u!==95?(e.exit(r),i.previous===45||i.previous===95?n(u):t(u)):(e.consume(u),s)}}const W1={tokenize:K1,concrete:!0},j1={tokenize:Q1,partial:!0},X1={tokenize:J1,partial:!0},Or={tokenize:Z1,partial:!0};function K1(e,t,n){const r=this,i=r.events[r.events.length-1],a=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let s=0,u;return o;function o(w){return e.enter("directiveContainer"),e.enter("directiveContainerFence"),e.enter("directiveContainerSequence"),d(w)}function d(w){return w===58?(e.consume(w),s++,d):s<3?n(w):(e.exit("directiveContainerSequence"),oa.call(r,e,f,n,"directiveContainerName")(w))}function f(w){return w===91?e.attempt(j1,h,h)(w):h(w)}function h(w){return w===123?e.attempt(X1,g,g)(w):g(w)}function g(w){return ke(e,p,"whitespace")(w)}function p(w){return e.exit("directiveContainerFence"),w===null?V(w):he(w)?r.interrupt?t(w):e.attempt(Or,c,V)(w):n(w)}function c(w){return w===null?V(w):he(w)?e.check(Or,A,V)(w):(e.enter("directiveContainerContent"),E(w))}function E(w){return e.attempt({tokenize:O,partial:!0},F,a?ke(e,b,"linePrefix",a+1):b)(w)}function b(w){return w===null?F(w):he(w)?e.check(Or,x,F)(w):x(w)}function m(w){if(w===null){const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,F(w)}return he(w)?e.check(Or,v,N)(w):(e.consume(w),m)}function x(w){const H=e.enter("chunkDocument",{contentType:"document",previous:u});return u&&(u.next=H),u=H,m(w)}function A(w){return e.enter("directiveContainerContent"),E(w)}function v(w){e.consume(w);const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,E}function N(w){const H=e.exit("chunkDocument");return r.parser.lazy[H.start.line]=!1,F(w)}function F(w){return e.exit("directiveContainerContent"),V(w)}function V(w){return e.exit("directiveContainer"),t(w)}function O(w,H,y){let M=0;return ke(w,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function U($){return w.enter("directiveContainerFence"),w.enter("directiveContainerSequence"),I($)}function I($){return $===58?(w.consume($),M++,I):M<s?y($):(w.exit("directiveContainerSequence"),ke(w,T,"whitespace")($))}function T($){return $===null||he($)?(w.exit("directiveContainerFence"),H($)):y($)}}}function Q1(e,t,n){return sa(e,t,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function J1(e,t,n){return aa(e,t,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function Z1(e,t,n){const r=this;return i;function i(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const eE={tokenize:rE},tE={tokenize:iE,partial:!0},nE={tokenize:aE,partial:!0};function rE(e,t,n){const r=this;return i;function i(f){return e.enter("directiveLeaf"),e.enter("directiveLeafSequence"),e.consume(f),a}function a(f){return f===58?(e.consume(f),e.exit("directiveLeafSequence"),oa.call(r,e,s,n,"directiveLeafName")):n(f)}function s(f){return f===91?e.attempt(tE,u,u)(f):u(f)}function u(f){return f===123?e.attempt(nE,o,o)(f):o(f)}function o(f){return ke(e,d,"whitespace")(f)}function d(f){return f===null||he(f)?(e.exit("directiveLeaf"),t(f)):n(f)}}function iE(e,t,n){return sa(e,t,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function aE(e,t,n){return aa(e,t,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const sE={tokenize:cE,previous:lE},oE={tokenize:dE,partial:!0},uE={tokenize:fE,partial:!0};function lE(e){return e!==58||this.events[this.events.length-1][1].type==="characterEscape"}function cE(e,t,n){const r=this;return i;function i(o){return e.enter("directiveText"),e.enter("directiveTextMarker"),e.consume(o),e.exit("directiveTextMarker"),oa.call(r,e,a,n,"directiveTextName")}function a(o){return o===58?n(o):o===91?e.attempt(oE,s,s)(o):s(o)}function s(o){return o===123?e.attempt(uE,u,u)(o):u(o)}function u(o){return e.exit("directiveText"),t(o)}}function dE(e,t,n){return sa(e,t,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function fE(e,t,n){return aa(e,t,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function pE(){return{text:{58:sE},flow:{58:[W1,eE]}}}function zu(){const t=this.data(),n=t.micromarkExtensions||(t.micromarkExtensions=[]),r=t.fromMarkdownExtensions||(t.fromMarkdownExtensions=[]),i=t.toMarkdownExtensions||(t.toMarkdownExtensions=[]);n.push(pE()),r.push(F1()),i.push(H1())}function ua(e,t,n){if(!e.current)return;const r=g=>{g.classList.contains("rte-richtext-host-expanded")&&(g.style.setProperty("display","flex","important"),g.style.setProperty("flex-direction","column","important"),g.style.setProperty("flex","1 1 auto","important"),g.style.setProperty("min-height","0","important"),g.style.setProperty("width","100%","important"),g.style.setProperty("align-self","stretch","important"))},i=new Set,a={};for(const g of t)g.exclusionGroup&&g.exclusionGroup!=="separator"&&(i.add(g.exclusionGroup),a[g.exclusionGroup]||(a[g.exclusionGroup]=[]),a[g.exclusionGroup].push({type:g.type,key:g.key,exclusionGroup:g.exclusionGroup}));const s={};for(const g of i){s[g]=!1;for(const p of a[g])if(p.type==="upload"&&p.key){if(n[p.key]!==null&&n[p.key]!==void 0){s[g]=!0;break}const c=t.find(E=>E.type==="upload"&&E.key===p.key);if(c&&typeof c.maxCount=="number")for(let E=0;E<c.maxCount;E++){const b=`${p.key}-${E}`;if(n[b]!==null&&n[b]!==void 0){s[g]=!0;break}}if(s[g])break}else if((p.type==="variable"||p.type==="multi-variable")&&p.key){const c=p.type==="multi-variable"?e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${p.key}"]`):[e.current.querySelector(`[data-type="variable"][data-key="${p.key}"]`)].filter(Boolean);for(const E of c)if(!E.classList.contains("show-placeholder")&&E.innerText.replace(/[\u200B\n]/g,"").trim().length>0){s[g]=!0;break}if(s[g])break}}const u=t.some(g=>g.exclusionGroup==="separator"),d=Object.keys(s).filter(g=>s[g]).length>0;let f=null;if(d&&u){for(const g of t)if(g.exclusionGroup&&g.exclusionGroup!=="separator"&&s[g.exclusionGroup]){f=g.exclusionGroup;break}}for(const g of i){const p=e.current.querySelectorAll(`[data-group="${g}"]`);u&&d&&f?g===f?p.forEach(c=>{if(!c.closest('[data-rte-force-hidden="1"]')){if(c.classList.contains("rte-richtext-host-expanded")){r(c);return}c.classList.contains("required-upload-group")?c.style.setProperty("display","inline-flex","important"):(c.classList.contains("exclusion-wrapper"),c.style.setProperty("display","inline-block","important"))}}):p.forEach(c=>{c.closest('[data-rte-force-hidden="1"]')||(c.style.display="none",c.style.setProperty("display","none","important"))}):p.forEach(c=>{if(!c.closest('[data-rte-force-hidden="1"]')){if(c.classList.contains("rte-richtext-host-expanded")){r(c);return}c.classList.contains("required-upload-group")?c.style.setProperty("display","inline-flex","important"):(c.classList.contains("exclusion-wrapper"),c.style.setProperty("display","inline-block","important"))}})}e.current.querySelectorAll('[data-group="separator"]').forEach(g=>{g.style.display=d?"none":"inline"})}function la(e,t,n,r){if(!e.current){r(!1);return}const i=c=>{const E=c.getAttribute("data-node-type")||"";if(E!=="report-module"&&E!=="markdown-module")return(c.textContent||"").replace(/[\u200B]/g,"").trim();const b=(c.textContent||"").replace(/[\u200B]/g,"").trim(),m=Array.from(c.querySelectorAll(":scope > div"));if(m.length===0)return b;let x=-1;for(let N=0;N<m.length;N++)if((m[N].textContent||"").replace(/[\u200B]/g,"").trim().length>0){x=N;break}return m.filter((N,F)=>F!==x).map(N=>(N.textContent||"").replace(/[\u200B]/g,"").trim()).join(`
|
|
20
|
+
`).trim()||b},a=c=>c?!!c.closest('[data-rte-force-hidden="1"]'):!1,s=[];for(let c=0;c<t.length;c++){const E=t[c];if((E.type==="variable"||E.type==="report-url"||E.type==="markdown"||E.type==="upload"||E.type==="multi-variable"||E.type==="select"||E.type==="textarea"||E.type==="richtext"||E.type==="report-module"||E.type==="markdown-module"||E.type==="datepicker"||E.type==="number-input")&&E.required&&E.key){s.push({exclusionGroup:E.exclusionGroup||"",key:E.key,type:E.type==="multi-variable"||E.type==="report-url"||E.type==="markdown"?"variable":E.type==="report-module"||E.type==="markdown-module"?"richtext":E.type,isMultiVariable:E.type==="multi-variable",minCount:E.type==="multi-variable"||E.type==="upload"&&typeof E.minCount=="number"?E.minCount:void 0,moduleIndex:E.type==="report-module"||E.type==="markdown-module"?E.moduleIndex:void 0,__index:c});continue}if(E.type==="text"&&E.className?.includes("rte-text-required"))if(E.exclusionGroup)for(let b=c+1;b<t.length;b++){const m=t[b];if(m.exclusionGroup===E.exclusionGroup&&(m.type==="variable"||m.type==="markdown"||m.type==="upload"||m.type==="select"||m.type==="textarea"||m.type==="richtext"||m.type==="datepicker"||m.type==="number-input")&&m.key){s.push({exclusionGroup:E.exclusionGroup,key:m.key,type:m.type==="markdown"?"variable":m.type,__index:b});break}}else for(let b=c+1;b<t.length;b++){const m=t[b];if((m.type==="variable"||m.type==="markdown"||m.type==="upload"||m.type==="select"||m.type==="textarea"||m.type==="richtext"||m.type==="datepicker"||m.type==="number-input")&&m.key){s.push({exclusionGroup:m.exclusionGroup||"",key:m.key,type:m.type==="markdown"?"variable":m.type,__index:b});break}}}const u=t.some(c=>c.exclusionGroup==="separator"),o=[];if(u&&s.length>1){const c=[];t.forEach((E,b)=>{E.exclusionGroup==="separator"&&c.push(b)});for(const E of c){const m=s.filter(v=>typeof v.__index=="number"&&v.__index<E).sort((v,N)=>(N.__index??0)-(v.__index??0))[0],A=s.filter(v=>typeof v.__index=="number"&&v.__index>E).sort((v,N)=>(v.__index??0)-(N.__index??0))[0];m&&A&&o.push([m,A])}}if(s.length===0){if(t.length===0){if(!e.current){r(!1);return}const c=e.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";r(c.length>0);return}r(!0);return}const d=s.filter(c=>{if(!e.current)return!1;if(c.exclusionGroup){const E=e.current.querySelectorAll(`[data-group="${c.exclusionGroup}"]`);if(E.length>0){const b=E[0];return a(b)?!0:b.style.display!=="none"}}if(c.type==="upload"&&c.key){const E=e.current.querySelector(`[data-type="upload"][data-key="${c.key}"]`)||e.current.querySelector(`[data-type="upload"][data-batch-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="variable"&&c.key)if(c.isMultiVariable){const E=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${c.key}"]`);if(E.length>0){const b=E[0],m=b.closest("[data-group]")||b.parentElement;return a(m)?!0:m?m.style.display!=="none":!0}}else{const E=e.current.querySelector(`[data-type="variable"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="select"&&c.key){const E=e.current.querySelector(`[data-type="select"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="textarea"&&c.key){const E=e.current.querySelector(`[data-type="textarea"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="richtext"&&c.key){const E=typeof c.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"]`:`[data-type="richtext"][data-key="${c.key}"]`,b=e.current.querySelector(E);if(b){const m=b.closest("[data-group]")||b.parentElement;return a(m)?!0:m?m.style.display!=="none":!0}}else if(c.type==="datepicker"&&c.key){const E=e.current.querySelector(`[data-type="datepicker"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}else if(c.type==="number-input"&&c.key){const E=e.current.querySelector(`[data-type="number-input"][data-key="${c.key}"]`);if(E){const b=E.closest("[data-group]")||E.parentElement;return a(b)?!0:b?b.style.display!=="none":!0}}return!1});if(d.length===0){r(!0);return}const f=new Set;o.forEach(c=>{c.forEach(E=>{E.key&&f.add(E.key)})});const h=d.filter(c=>!c.key||!f.has(c.key));let g=(o.length===0,!0);for(const c of o){const E=c.filter(m=>{if(!e.current)return!1;if(m.exclusionGroup){const x=e.current.querySelectorAll(`[data-group="${m.exclusionGroup}"]`);if(x.length>0){const A=x[0];return a(A)?!0:A.style.display!=="none"}}return!0});if(E.length===0)continue;let b=!1;for(const m of E)if(m.type==="upload"&&m.key){if(m.minCount&&m.minCount>0){let x=0;const A=e.current.querySelectorAll(`[data-type="upload"][data-batch-key="${m.key}"]`);if(A.length===0)continue;for(let v=0;v<A.length;v++){const F=A[v].dataset.key;F&&n[F]!=null&&(x+=1)}if(x>=m.minCount){b=!0;break}}else if(n[m.key]!==null&&n[m.key]!==void 0){b=!0;break}}else if(m.type==="variable"&&m.key)if(m.isMultiVariable){const x=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${m.key}"]`);let A=0;for(const N of Array.from(x)){if(N.classList.contains("show-placeholder"))continue;N.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(A+=1)}const v=m.minCount&&m.minCount>0?m.minCount:1;if(A>=v){b=!0;break}}else{const x=e.current.querySelector(`[data-type="variable"][data-key="${m.key}"]`);if(x){if(x.classList.contains("show-placeholder"))continue;if(x.innerText.replace(/[\u200B\n]/g,"").trim().length>0){b=!0;break}}}else if(m.type==="select"&&m.key){const x=e.current.querySelector(`[data-type="select"][data-key="${m.key}"]`);if(x&&(x.getAttribute("data-value")||"").trim().length>0){b=!0;break}}else if(m.type==="textarea"&&m.key){const x=e.current.querySelector(`[data-type="textarea"][data-key="${m.key}"]`);if(x&&(x.value||"").trim().length>0){b=!0;break}}else if(m.type==="richtext"&&m.key){const x=typeof m.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${m.key}"][data-module-index="${m.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${m.key}"][data-module-index="${m.moduleIndex}"]`:`[data-type="richtext"][data-key="${m.key}"]`,A=e.current.querySelector(x);if(A&&i(A).length>0){b=!0;break}}else if(m.type==="datepicker"&&m.key){const x=e.current.querySelector(`[data-type="datepicker"][data-key="${m.key}"]`);if(x&&(x.getAttribute("data-value")||"").trim().length>0){b=!0;break}}else if(m.type==="number-input"&&m.key){const x=e.current.querySelector(`[data-type="number-input"][data-key="${m.key}"]`);if(x&&(x.value||"").trim().length>0){b=!0;break}}if(!b){g=!1;break}}let p=!0;for(const c of h)if(c.type==="upload"&&c.key){if(c.minCount&&c.minCount>0){let E=0;const b=e.current.querySelectorAll(`[data-type="upload"][data-batch-key="${c.key}"]`);if(b.length===0){p=!1;break}for(let m=0;m<b.length;m++){const A=b[m].dataset.key;A&&n[A]!=null&&(E+=1)}if(E<c.minCount){p=!1;break}}else if(n[c.key]===null||n[c.key]===void 0){p=!1;break}}else if(c.type==="variable"&&c.key)if(c.isMultiVariable){const E=e.current.querySelectorAll(`[data-type="variable"][data-multi-key="${c.key}"]`);let b=0;for(const x of Array.from(E)){if(x.classList.contains("show-placeholder"))continue;x.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&(b+=1)}const m=c.minCount&&c.minCount>0?c.minCount:1;if(b<m){p=!1;break}}else{const E=e.current.querySelector(`[data-type="variable"][data-key="${c.key}"]`);if(!E){p=!1;break}if(E.classList.contains("show-placeholder")){p=!1;break}if(E.innerText.replace(/[\u200B\n]/g,"").trim().length===0){p=!1;break}}else if(c.type==="select"&&c.key){const E=e.current.querySelector(`[data-type="select"][data-key="${c.key}"]`);if(!E||(E.getAttribute("data-value")||"").trim().length===0){p=!1;break}}else if(c.type==="textarea"&&c.key){const E=e.current.querySelector(`[data-type="textarea"][data-key="${c.key}"]`);if(!E||(E.value||"").trim().length===0){p=!1;break}}else if(c.type==="richtext"&&c.key){const E=typeof c.moduleIndex=="number"?`[data-type="richtext"][data-node-type="report-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"], [data-type="richtext"][data-node-type="markdown-module"][data-key="${c.key}"][data-module-index="${c.moduleIndex}"]`:`[data-type="richtext"][data-key="${c.key}"]`,b=e.current.querySelector(E);if(!b||i(b).length===0){p=!1;break}}else if(c.type==="datepicker"&&c.key){const E=e.current.querySelector(`[data-type="datepicker"][data-key="${c.key}"]`);if(!E||(E.getAttribute("data-value")||"").trim().length===0){p=!1;break}}else if(c.type==="number-input"&&c.key){const E=e.current.querySelector(`[data-type="number-input"][data-key="${c.key}"]`);if(!E||(E.value||"").trim().length===0){p=!1;break}}r(g&&p)}function ca(e,t){if(!e.current)return;e.current.querySelectorAll('[data-type="variable"]').forEach(r=>{const i=r.innerText;i.replace(/\u200B/g,"").trim().length===0?(i!==""&&(r.innerText=""),r.classList.add("show-placeholder")):r.classList.remove("show-placeholder")})}const hE=({host:e,onChange:t})=>{const n=e.dataset.key,r=e.dataset.placeholder,i=e.dataset.options?decodeURIComponent(e.dataset.options):"[]",a=e.dataset.required==="true",s=e.dataset.value||"",u=P.useMemo(()=>{try{return JSON.parse(i)}catch{return[]}},[i]),[o,d]=P.useState(s||void 0),[f,h]=P.useState(64),g=P.useRef(null),p=b=>{d(b),e.setAttribute("data-value",b),t(n,b)};P.useEffect(()=>{d(s||void 0)},[s]);const c=P.useCallback(()=>{if(o!=null&&o!==""){const b=u.find(m=>String(m.value)===String(o));return b?typeof b.label=="string"?b.label:String(b.label??o):String(o)}return r||"请选择"},[o,u,r]),E=P.useCallback(()=>{const b=g.current;if(!b)return;const m=b.querySelector(".ant-select-selection-item"),x=b.querySelector(".ant-select-selection-placeholder"),A=m||x,v=(A?.textContent||"").trim()||c(),N=b.querySelector(".ant-select-selector"),F=A||N||b,V=window.getComputedStyle(F),O=A?V.fontSize:"16px",w=V.fontFamily||"sans-serif",H=V.fontWeight||"400",M=`${V.fontStyle||"normal"} ${H} ${O} ${w}`,I=document.createElement("canvas").getContext("2d"),T=I?Math.ceil((I.font=M,I.measureText(v).width||0)):0;let $=0;if(N){const ce=window.getComputedStyle(N);$=(Number.parseFloat(ce.paddingLeft)||0)+(Number.parseFloat(ce.paddingRight)||0)}const Q=b.querySelector(".ant-select-arrow"),z=Q?Math.ceil(Q.getBoundingClientRect().width):12,te=b.querySelector(".ant-select-clear");let S=0;if(te){const ce=window.getComputedStyle(te);ce.display!=="none"&&ce.visibility!=="hidden"&&(S=Math.ceil(te.getBoundingClientRect().width))}const fe=Math.max(36,T+$+z+S+6);h(ce=>ce===fe?ce:fe)},[c]);return P.useLayoutEffect(()=>{const b=window.requestAnimationFrame(()=>{E()}),m=window.setTimeout(()=>{E()},60);return()=>{window.cancelAnimationFrame(b),window.clearTimeout(m)}},[E]),P.useEffect(()=>{if(!("fonts"in document))return;let b=!1;const m=document.fonts;if(m?.ready)return m.ready.then(()=>{b||E()}),()=>{b=!0}},[E]),zr.createPortal(K.jsx("div",{className:"rte-select-wrapper",contentEditable:!1,ref:g,style:{display:"inline-block",width:f},children:K.jsx(ye.Select,{value:o,onChange:p,placeholder:r||"请选择",style:{width:"100%"},options:u,allowClear:!a,size:"small",dropdownClassName:"rte-select-dropdown",getPopupContainer:()=>document.body,dropdownMatchSelectWidth:!1,suffixIcon:K.jsx("i",{className:"iconfont icon-qiehuan-xiayizhang",style:{fontSize:"10px",color:"#7C3AED"}})})}),e)},mE=e=>{const[t,n]=P.useState([]);return P.useEffect(()=>{const r=e.current;if(!r)return;const i=()=>{const s=r.querySelectorAll(".rte-select-host"),u=[];s.forEach(o=>{const d=o.getAttribute("data-key");d&&u.push(K.jsx(hE,{host:o,onChange:()=>{if(e.current){const f=new Event("input",{bubbles:!0});e.current.dispatchEvent(f)}}},`select-${d}`))}),n(u)};i();const a=new MutationObserver(s=>{let u=!1;for(const o of s)if(o.type==="childList"){let d=!1;if(o.addedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-select-host")||h.querySelector?.(".rte-select-host"))&&(d=!0)}}),o.removedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-select-host")||h.querySelector?.(".rte-select-host"))&&(d=!0)}}),d){u=!0;break}}u&&i()});return a.observe(r,{childList:!0,subtree:!0}),()=>a.disconnect()},[e]),t},gn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),We=e=>{if(!e)return"";const t=typeof e=="string"?e:JSON.stringify(e);return gn(t)};function gE(e,t,n,r,i,a={},s,u){if(!e.current)return;const o=/[;;,,。.!!??::、]/,d=c=>{const E=(c??"").trim();return E.length===1&&o.test(E)},f=c=>{const E=c??"",b=E.match(new RegExp(`^\\s*(${o.source})`));if(!b)return null;const m=b[1],x=E.replace(new RegExp(`^\\s*${o.source}`),"");return{punct:m,rest:x}},h=c=>`<span data-type="text" class="rte-inline-punct" contenteditable="false">${c}</span>`,g=[];let p=0;for(;p<t.length;){const c=t[p],E=p+1<t.length?t[p+1]:null;let b=!1;if(c.type==="text"&&(c.text?.includes("icon-bitian")||c.className==="rte-text-required")&&E){const V=E.type==="upload"&&E.exclusionGroup==="fileInput"&&c.exclusionGroup==="fileInput"&&c.exclusionGroup===E.exclusionGroup,O=E.type==="variable"&&E.exclusionGroup==="textInput"&&c.exclusionGroup==="textInput"&&c.exclusionGroup===E.exclusionGroup;if(V){const w=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"",H=`<span ${w} class="exclusion-wrapper required-upload-group">`,y="</span>";let M="";c.className?M=`<span class="${c.className}">${c.text??""}</span>`:M=c.text??"";const U=E,I=n[U.key]!==null&&n[U.key]!==void 0,T=I?n[U.key]:null,$=I?n[U.key]?.name:U.text,Q=I?"":"hidden",z=U.tooltip&&!I?"":"hidden",te=I?"has-file":"",S=I&&$?` data-file-name="${$.replace(/"/g,""")}"`:"";let fe="";I&&T?T.type?.startsWith("image/")?fe=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(T)}" alt="preview" />`:fe="<i class='iconfont icon-exlwenjian'></i>":fe="<i class='iconfont icon-shangchuan1'></i>";const ce=(U.text||"").trim(),Te=I&&ce.length>=12?`<span ${w} contenteditable="false" class="exclusion-wrapper upload-hint">${ce}</span>`:"",_e=`<span contenteditable="false" data-type="upload" data-key="${U.key}" class="upload-chip"><span class="upload-inner-wrapper ${te}"><span class="upload-icon">${fe}</span><span class="upload-label"${S}>${$||U.text}</span>${U.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${z}" data-upload-key="${U.key}" data-tooltip="${We(U.tooltip)}"></i>`:""}<span class="file-remove-btn ${Q}" title="移除文件">×</span></span></span>`;g.push(H+M+_e+y+Te),p+=2;continue}if(O){const H=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group">`,y="</span>";let M="";c.className?M=`<span class="${c.className}">${c.text??""}</span>`:M=c.text??"";const U=E,T=(U.key?i[U.key]:void 0)||U.text||"",$=!T,Q=$?"":T,z=$?"show-placeholder":"",te=U.exclusionGroup?` data-group="${U.exclusionGroup}"`:"",S=U.tooltip?` data-tooltip="${We(U.tooltip)}" data-variable-key="${U.key||""}"`:"",fe=U.tooltip&&$?"":"hidden",ce=`<span contenteditable="true" data-type="variable" data-key="${U.key}" data-placeholder="${U.placeholder||""}"${te}${S} class="variable-chip ${z}">${Q}${U.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${fe}" data-variable-key="${U.key}" data-tooltip="${We(U.tooltip)}" ></i>`:""}</span>`;g.push(H+M+ce+y),p+=2;continue}}const x=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"",A=c.exclusionGroup?`<span ${x} class="exclusion-wrapper">`:"",v=c.exclusionGroup?"</span>":"";let N="";if(c.type==="tag"){const O=r||s==="hideTagClose"?"":'<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>',w=r?' data-locked="true"':"",H=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-tag-key="${c.key||""}"`:"";N=`<span contenteditable="false" class="tag-node group"${w}${H}><span class="tag-label">${c.text}</span>${O}</span>`}else if(c.type==="text"){const V=r?' data-locked="true" contenteditable="false"':' contenteditable="false"',w=(c.text??"").replace(/\n/g,"<br/>");c.className?N=`<span data-type="text" class="${c.className}"${V}>${w}</span>`:N=r?`<span data-type="text"${V}>${w}</span>`:`<span data-type="text" contenteditable="false">${w}</span>`}else if(c.type==="variable"&&c.key){const O=i[c.key]||c.text||"",w=!O,H=w?"":O,y=w?"show-placeholder":"",M=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",U=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-variable-key="${c.key||""}"`:"",I=c.tooltip&&w?"":"hidden",T=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-placeholder="${c.placeholder||""}"${M}${U} class="variable-chip ${y}">${H}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${I}" data-variable-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${T}</span>`:N=T}else if(c.type==="report-url"&&c.key){const V=`${c.key}__url`,w=Object.prototype.hasOwnProperty.call(i,V)?i[V]:void 0,H=i[c.key],y=w??H??c.text??"",M=!y,U=M?"":y,I=M?"show-placeholder":"",T=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",$=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-variable-key="${c.key||""}"`:"",Q=c.tooltip&&M?"":"hidden",z=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-node-type="report-url" data-placeholder="${gn(c.placeholder||"")}"${T}${$} class="variable-chip rte-report-url ${I}">${U}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${z}</span>`:N=z}else if(c.type==="markdown"&&c.key){const V=c.sourceTextKey||`${c.key}__sourceText`,w=Object.prototype.hasOwnProperty.call(i,V)?i[V]:void 0,H=i[c.key],y=w??H??c.text??"",M=!y,U=M?"":y,I=M?"show-placeholder":"",T=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",$=c.sourceTextKey?` data-source-text-key="${gn(c.sourceTextKey)}"`:"",Q=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-variable-key="${c.key||""}"`:"",z=c.tooltip&&M?"":"hidden",te=`<span contenteditable="true" data-type="variable" data-key="${c.key}" data-node-type="markdown" data-placeholder="${gn(c.placeholder||"")}"${T}${$}${Q} class="variable-chip rte-markdown-input ${I}">${U}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${z}" data-variable-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}</span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${te}</span>`:N=te}else if(c.type==="upload"&&c.key){const V=!!E&&E.type==="text"&&!E.className&&!E.exclusionGroup&&d(E.text),O=V?(E.text??"").trim():"",w=O?h(O):"";if(V&&(b=!0),typeof c.maxCount=="number"&&typeof c.minCount=="number"&&c.maxCount>1){const y=c.tooltip?` data-tooltip="${We(c.tooltip)}"`:"",M=c.minCount||1,U=c.maxCount||3;let I=0;for(let Q=0;Q<U;Q++){const z=`${c.key}-${Q}`;n[z]!=null&&(I+=1)}const T=Math.min(U,Math.max(M,I+(I<U?1:0)));let $="";for(let Q=0;Q<T;Q++){const z=`${c.key}-${Q}`,te=n[z]!==null&&n[z]!==void 0,S=te?n[z]:null,fe=te?n[z]?.name:c.text,ce=te?"":"hidden",L=c.tooltip&&!te?"":"hidden",Te=te?"has-file":"",_e=te&&fe?` data-file-name="${fe.replace(/"/g,""")}"`:"";let Ae="";te&&S?S.type?.startsWith("image/")?Ae=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(S)}" alt="preview" />`:Ae="<i class='iconfont icon-exlwenjian'></i>":Ae="<i class='iconfont icon-shangchuan1'></i>";const ge=` data-batch-key="${c.key}"`,Ie=` data-batch-index="${Q}"`,Re=`<span contenteditable="false" data-type="upload" data-key="${z}"${ge}${Ie}${y} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${Te}"><span class="upload-icon">${Ae}</span><span class="upload-label"${_e}>${fe||c.text}</span>${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${L}" data-upload-key="${z}" data-tooltip="${We(c.tooltip)}" ></i>`:""}<span class="file-remove-btn ${ce}" title="移除文件">×</span></span></span>`;$+=Re}c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group rte-required-upload-batch"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span><span class="rte-upload-batch-chips">${$}${w}</span></span>`:N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-upload-batch-chips">${$}${w}</span>`}else{const y=c.tooltip?` data-tooltip="${We(c.tooltip)}"`:"",M=n[c.key]!==null&&n[c.key]!==void 0,U=M?n[c.key]:null,I=M?n[c.key]?.name:c.text,T=M?"":"hidden",$=c.tooltip&&!M?"":"hidden",Q=M?"has-file":"",z=M&&I?` data-file-name="${I.replace(/"/g,""")}"`:"";let te="";M&&U?U.type?.startsWith("image/")?te=`<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(U)}" alt="preview" />`:te="<i class='iconfont icon-exlwenjian'></i>":te="<i class='iconfont icon-shangchuan1'></i>";const S=(c.text||"").trim(),ce=M&&c.showHint===!0&&S.length>=12?`<span ${x} contenteditable="false" class="exclusion-wrapper upload-hint">${S}</span>`:"",L=`<span contenteditable="false" data-type="upload" data-key="${c.key}"${y} class="upload-chip"><span class="upload-inner-wrapper ${Q}"><span class="upload-icon">${te}</span><span class="upload-label"${z}>${I||c.text}</span>${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}<span class="file-remove-btn ${T}" title="移除文件">×</span></span></span>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${L}${w}</span>${ce}`:N=L+w+ce}}else if(c.type==="select"&&c.key){const V=i[c.key]||c.defaultValue||"",O=encodeURIComponent(JSON.stringify(c.options||[])),w=c.placeholder?` data-placeholder="${c.placeholder}"`:"",H=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",y=c.required?' data-required="true"':"",M=`<div data-type="select" data-key="${c.key}" data-value="${V}" data-options="${O}"${w}${H}${y} class="rte-select-host"></div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${M}</span>`:N=M}else if(c.type==="textarea"&&c.key){const V=i[c.key]||"",O=typeof c.maxHeight=="number"?c.maxHeight:252,w=c.placeholder?` placeholder="${c.placeholder}"`:"",H=`<textarea data-type="textarea" data-key="${c.key}" class="rte-textarea" style="max-height:${O}px;"${w}>${V}</textarea>`,y=`<div class="rte-textarea-wrapper" data-key="${c.key}">${H}</div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${y}</span>`:N=y}else if(c.type==="richtext"&&c.key){const V=i[c.key]||c.text||"",O=typeof c.minHeight=="number"?c.minHeight:40,w=typeof c.maxHeight=="number"?c.maxHeight:160,H=Math.max(w,O),y=c.placeholder?` data-placeholder="${c.placeholder}"`:"",M=c.expandable!==!1,U=V,I=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" class="rte-richtext"${y} style="min-height:${O}px;max-height:${H}px;overflow:auto;">${U}</div>`,T=M?`<button type="button" class="rte-richtext-toggle" data-key="${c.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>`:"",$=`<div class="rte-richtext-wrapper${M?" rte-richtext-toggleable":""}" data-key="${c.key}">${I}${T}</div>`,Q=`<div class="rte-richtext-container" data-key="${c.key}">${$}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${Q}</div>`:N=Q}else if(c.type==="report-module"&&c.key){const V=typeof c.moduleIndex=="number"?c.moduleIndex:0,O=`${c.key}__module_${V}`,H=Object.prototype.hasOwnProperty.call(i,O)?i[O]:c.text||"",y=typeof c.minHeight=="number"?c.minHeight:80,M=typeof c.maxHeight=="number"?c.maxHeight:240,U=Math.max(M,y),I=c.placeholder?` data-placeholder="${gn(c.placeholder)}"`:"",T=H,$=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" data-node-type="report-module" data-module-index="${V}" class="rte-richtext rte-report-module"${I} style="min-height:${y}px;max-height:${U}px;overflow:auto;">${T}</div>`,Q=`<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${c.key}">${$}</div>`,z=`<div class="rte-richtext-container rte-report-module-container" data-key="${c.key}">${Q}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${z}</div>`:N=z}else if(c.type==="markdown-module"&&c.key){const V=typeof c.moduleIndex=="number"?c.moduleIndex:0,O=`${c.key}__module_${V}`,H=Object.prototype.hasOwnProperty.call(i,O)?i[O]:c.text||"",y=typeof c.minHeight=="number"?c.minHeight:80,M=typeof c.maxHeight=="number"?c.maxHeight:240,U=Math.max(M,y),I=c.placeholder?` data-placeholder="${gn(c.placeholder)}"`:"",T=H,$=`<div contenteditable="true" data-type="richtext" data-key="${c.key}" data-node-type="markdown-module" data-module-index="${V}" class="rte-richtext rte-markdown-module"${I} style="min-height:${y}px;max-height:${U}px;overflow:auto;">${T}</div>`,Q=`<div class="rte-richtext-wrapper rte-markdown-module-wrapper" data-key="${c.key}">${$}</div>`,z=`<div class="rte-richtext-container rte-markdown-module-container" data-key="${c.key}">${Q}</div>`;c.required?N=`<div ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper rte-richtext-required">${z}</div>`:N=z}else if(c.type==="datepicker"&&c.key){const V=i[c.key]||"",O=c.placeholder?` data-placeholder="${c.placeholder}"`:"",w=c.limitRange?` data-limit-range="${c.limitRange}"`:"",H=c.disableFuture?' data-disable-future="true"':"",y=`<div data-type="datepicker" data-key="${c.key}" data-value="${V}" class="rte-datepicker-host"${O}${w}${H}></div>`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${y}</span>`:N=y}else if(c.type==="number-input"&&c.key){const V=i[c.key]||(typeof c.defaultNumber=="number"?String(c.defaultNumber):""),O=typeof c.min=="number"?` min="${c.min}"`:"",w=typeof c.max=="number"?` max="${c.max}"`:"",H=c.placeholder?` placeholder="${c.placeholder}"`:"",y=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",M=' step="1"',U=V||c.placeholder||"";let I=0;for(let Q=0;Q<U.length;Q++){const z=U.charCodeAt(Q);z>19968||z>=65280&&z<=65519?I+=16:I+=8}const T=Math.max(24,Math.min(600,I+28)),$=`<input type="number" data-type="number-input" data-key="${c.key}" class="rte-number-input" value="${V}" style="width: ${T}px;"${O}${w}${M}${H}${y} />`;c.required?N=`<span ${c.exclusionGroup?`data-group="${c.exclusionGroup}"`:""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${$}</span>`:N=$}else if(c.type==="multi-variable"&&c.key){const V=c.maxCount||9,O=a[c.key]||1,w=Math.min(O,V);if(c.required){const H=`<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`,y=c.exclusionGroup?`data-group="${c.exclusionGroup}"`:"";let M="";for(let U=0;U<w;U++){const I=`${c.key}_${U}`,T=i[I]||"",$=!T,Q=$?"":T,z=$?"show-placeholder":"",te=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-variable-key="${c.key||""}"`:"",S=c.tooltip&&$?"":"hidden",fe=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",ce=`<span contenteditable="true" data-type="variable" data-key="${I}" data-multi-key="${c.key}" data-index="${U}" data-placeholder="${c.placeholder||""}"${fe}${te} class="variable-chip ${z}">${Q}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${S}" data-variable-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}</span>`;U===0?M+=`<span ${y} class="exclusion-wrapper required-upload-group required-multi-first">${H}${ce}</span>`:M+=ce}N=M}else{let H="";for(let y=0;y<w;y++){const M=`${c.key}_${y}`,U=i[M]||"",I=!U,T=I?"":U,$=I?"show-placeholder":"",Q=c.tooltip?` data-tooltip="${We(c.tooltip)}" data-variable-key="${c.key||""}"`:"",z=c.tooltip&&I?"":"hidden",te=c.exclusionGroup?` data-group="${c.exclusionGroup}"`:"",S=`<span contenteditable="true" data-type="variable" data-key="${M}" data-multi-key="${c.key}" data-index="${y}" data-placeholder="${c.placeholder||""}"${te}${Q} class="variable-chip ${$}">${T}${c.tooltip?`<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${z}" data-variable-key="${c.key}" data-tooltip="${We(c.tooltip)}" ></i>`:""}</span>`;H+=S}N=H}}const F=A+N+v;if(c.type==="text"&&!c.className&&!c.exclusionGroup){if(d(c.text)&&g.length>0){const O=g[g.length-1],w=(c.text??"").trim();g[g.length-1]=`<span class="rte-inline-group">${O}${h(w)}</span>`,p++;continue}const V=f(c.text);if(V&&g.length>0){const O=g[g.length-1];g[g.length-1]=`<span class="rte-inline-group">${O}${h(V.punct)}</span>`;const w=V.rest;if(w){const H=w.replace(/\n/g,"<br/>");g.push(`<span data-type="text" contenteditable="false">${H}</span>`)}p++;continue}}g.push(F),p+=b?2:1}e.current&&(e.current.innerHTML=g.join(""),setTimeout(()=>{if(!e.current)return;e.current.querySelectorAll('[data-type="variable"]').forEach(E=>{const b=E.innerText.replace(/\n/g,"");b.replace(/\u200B/g,"")?E.classList.remove("show-placeholder"):(b!==""&&(E.innerText=""),E.classList.add("show-placeholder"))})},0))}function EE(e,t,n,r,i={},a,s,u,o){const d=P.useCallback(()=>{if(!e.current)return;if(t.length===0){e.current.innerHTML="";return}let f={};const g=e.current.__tempVariableValues;if(g?(f=g,setTimeout(()=>{if(e.current){const p=e.current;p.__tempVariableValues===g&&delete p.__tempVariableValues}},100)):(e.current.querySelectorAll('[data-type="variable"]').forEach(A=>{const v=A.dataset.key;if(v){const N=A.innerText.replace(/[\u200B\n]/g,"").trim();N&&(A.getAttribute("data-node-type")==="report-url"?f[`${v}__url`]=N:f[v]=N)}}),e.current.querySelectorAll('[data-type="select"]').forEach(A=>{const v=A.dataset.key;if(v){const N=(A.getAttribute("data-value")||"").trim();N&&(f[v]=N)}}),e.current.querySelectorAll('[data-type="textarea"]').forEach(A=>{const v=A.dataset.key;if(v){const N=A.value.replace(/[\u200B]/g,"").trim();N&&(f[v]=N)}}),e.current.querySelectorAll('[data-type="richtext"]').forEach(A=>{const v=A.dataset.key;if(v){const N=A.getAttribute("data-node-type")||"",F=N==="report-module"?(A.innerHTML||"").replace(/[\u200B]/g,"").trim():(A.textContent||"").replace(/[\u200B]/g,"").trim();if(N==="report-module"){const V=Number.parseInt(A.getAttribute("data-module-index")||"0",10);f[`${v}__module_${Number.isFinite(V)?V:0}`]=F}else F&&(f[v]=F)}}),e.current.querySelectorAll('[data-type="datepicker"]').forEach(A=>{const v=A.dataset.key;if(v){const N=(A.getAttribute("data-value")||"").trim();N&&(f[v]=N)}}),e.current.querySelectorAll('[data-type="number-input"]').forEach(A=>{const v=A.dataset.key;if(v){const N=(A.value||"").trim();N&&(f[v]=N)}})),gE(e,t,n,r,f,i,u),a?.current){const{key:p,offset:c}=a.current;setTimeout(()=>{if(!e.current)return;const E=e.current.querySelector(`[data-type="variable"][data-key="${p}"]`);if(E){try{const b=document.createRange(),m=document.createTreeWalker(E,NodeFilter.SHOW_TEXT,null);let x=0,A=null,v=0;for(;m.nextNode();){const N=m.currentNode,F=N.textContent?.length||0;if(x+F>=c){A=N,v=c-x;break}x+=F}if(A){b.setStart(A,Math.min(v,A.textContent?.length||0)),b.collapse(!0);const N=window.getSelection();N&&(N.removeAllRanges(),N.addRange(b),E.focus())}else{b.selectNodeContents(E),b.collapse(!1);const N=window.getSelection();N&&(N.removeAllRanges(),N.addRange(b),E.focus())}}catch{const b=document.createRange();b.selectNodeContents(E),b.collapse(!1);const m=window.getSelection();m&&(m.removeAllRanges(),m.addRange(b),E.focus())}a.current=null}},0)}},[t,n,r,e,i,a,s,u,o]);P.useEffect(()=>{d()},[d])}function bE(e,t,n,r,i){P.useEffect(()=>{const a=e.current;if(!a)return;const s=d=>d.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(d.name||""),u=d=>{const f=d.target?.closest(".upload-info-icon");if(f&&f.classList.contains("upload-info-icon")){const g=f.dataset.uploadKey;if(g){const p=f.dataset.tooltip||"";let c=!1;try{const b=JSON.parse(p);b&&b.type==="steps"&&Array.isArray(b.images)&&(c=!0)}catch{}if(c)r({key:g,anchorEl:f,type:"upload"});else{const E=f.closest('[data-type="upload"]');r({key:g,anchorEl:E||f,type:"upload"})}}return}const h=d.target?.closest('[data-type="upload"]');if(h){const g=h.dataset.key;if(g){const p=n[g];p&&s(p)&&r({key:g,anchorEl:h,type:"upload-preview"})}}},o=d=>{if(i)return;const f=d.target?.closest(".upload-info-icon"),h=d.relatedTarget;if(h?.closest?.(".rte-tooltip-overlay"))return;if(f&&f.classList.contains("upload-info-icon")){const p=f.closest('[data-type="upload"]');if(h&&p&&p.contains(h))return;if(!h||!a.contains(h))r(null);else{const c=h.closest('[data-type="upload"]');(!c||c!==p)&&r(null)}return}const g=d.target?.closest('[data-type="upload"]');if(g){const p=h;if(p?.closest?.(".rte-tooltip-overlay")||p&&g.contains(p))return;r(null)}};return a.addEventListener("mouseover",u,!0),a.addEventListener("mouseout",o,!0),()=>{a.removeEventListener("mouseover",u,!0),a.removeEventListener("mouseout",o,!0)}},[t,n,e,r,i])}function TE(e,t,n,r,i){P.useEffect(()=>{const a=e.current;if(!a)return;const s=f=>{if(r==="hideTagClose")return;const h=f.currentTarget,g=h.dataset.tooltip,p=h.dataset.tagKey||"";g&&n({key:p,anchorEl:h,type:"tag"})},u=f=>{i||f.relatedTarget?.closest?.(".rte-tooltip-overlay")||n(null)};let o;const d=()=>{a.querySelectorAll(".tag-node[data-tooltip]").forEach(h=>{h.addEventListener("mouseenter",s),h.addEventListener("mouseleave",u)})};return o=requestAnimationFrame(()=>{o=requestAnimationFrame(d)}),()=>{cancelAnimationFrame(o),a.querySelectorAll(".tag-node[data-tooltip]").forEach(h=>{h.removeEventListener("mouseenter",s),h.removeEventListener("mouseleave",u)})}},[t,e,n,r,i])}function yE(e,t,n,r){P.useEffect(()=>{const i=e.current;if(!i)return;const a=u=>{const o=u.target?.closest(".variable-info-icon");if(o&&o.classList.contains("variable-info-icon")){const f=o.dataset.variableKey;f&&n({key:f,anchorEl:o,type:"variable"});return}const d=u.target?.closest('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(d){const f=d.dataset.key;f&&n({key:f,anchorEl:d,type:"variable"})}},s=u=>{if(r)return;const o=u.target,d=u.relatedTarget;if(d?.closest?.(".rte-tooltip-overlay"))return;const f=o?.closest?.(".variable-info-icon"),h=o?.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');if(f||h){if(!d||!i.contains(d)){n(null);return}const g=!!d.closest?.(".variable-info-icon"),p=!!d.closest?.('[data-type="variable"][data-node-type="report-url"][data-tooltip]');!g&&!p&&n(null)}};return i.addEventListener("mouseover",a,!0),i.addEventListener("mouseout",s,!0),()=>{i.removeEventListener("mouseover",a,!0),i.removeEventListener("mouseout",s,!0)}},[t,e,n,r])}function xE(e,t,n,r,i){P.useEffect(()=>{const a=e.current;if(!a)return;const s=h=>h.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(h.name||""),u=h=>{const g=h.currentTarget,p=g.dataset.fileName,c=g.closest('[data-type="upload"]'),E=c?.dataset.key||"",b=E?n[E]:null;if(b&&s(b)){r({key:E,anchorEl:c||g,type:"upload-preview"});return}p&&r({key:E,anchorEl:c||g,type:"upload-label"})},o=h=>{i||h.relatedTarget?.closest?.(".rte-tooltip-overlay")||r(null)};let d;const f=()=>{a.querySelectorAll(".upload-label[data-file-name]").forEach(g=>{g.addEventListener("mouseenter",u),g.addEventListener("mouseleave",o)})};return d=requestAnimationFrame(()=>{d=requestAnimationFrame(f)}),()=>{cancelAnimationFrame(d),a.querySelectorAll(".upload-label[data-file-name]").forEach(g=>{g.removeEventListener("mouseenter",u),g.removeEventListener("mouseleave",o)})}},[t,n,e,r,i])}function AE(e,t,n,r){P.useEffect(()=>{const i=setTimeout(()=>{ua(e,t,n),la(e,t,n,r)},0);return()=>clearTimeout(i)},[n,t,e,r])}function CE(e,t){const n=P.useRef(0),r=P.useRef(0);P.useEffect(()=>{if(!e.current)return;let i=!1,a=0;const s=x=>x instanceof HTMLElement?!!(x.closest(".rte-datepicker-wrapper")||x.closest(".rte-datepicker-host")||x.closest(".ant-picker")||x.closest(".ant-picker-dropdown")):!1,u=x=>x instanceof HTMLElement?!!(x.closest(".rte-select-wrapper")||x.closest(".rte-select-host")||x.closest(".ant-select")||x.closest(".ant-select-dropdown")):!1,o=x=>{i=!0,s(x.target)&&(n.current=Date.now(),console.log("[SelectionCtrl] mousedown on datepicker target")),u(x.target)&&(r.current=Date.now(),console.log("[SelectionCtrl] mousedown on select target"))},d=()=>{i=!1,a=Date.now()};let f=!1,h=0;const g=()=>{f=!0},p=()=>{f=!1,h=Date.now()},c=()=>{h=Date.now()},E=x=>{s(x.target)&&(n.current=Date.now(),console.log("[SelectionCtrl] focusin datepicker target")),u(x.target)&&(r.current=Date.now(),console.log("[SelectionCtrl] focusin select target"))},b=()=>{if(Date.now()-n.current<800||Date.now()-r.current<800){console.log("[SelectionCtrl] skip selectionchange due to recent picker/select interaction");return}const x=document.activeElement;if(x&&(x.closest(".rte-datepicker-wrapper")||x.closest(".rte-datepicker-host")||x.closest(".ant-picker-dropdown")||x.tagName==="INPUT"&&x.closest(".ant-picker")||x.closest(".rte-select-wrapper")||x.closest(".rte-select-host")||x.closest(".ant-select")||x.closest(".ant-select-dropdown"))){console.log("[SelectionCtrl] activeElement is picker/select; skip");return}if(!e.current)return;const A=window.getSelection();if(!A||A.rangeCount===0||t.current||i||f||Date.now()-h<500)return;const v=A.getRangeAt(0);if(!v.collapsed)return e.current.contains(v.commonAncestorContainer),void 0;const N=A.anchorNode;if(!N||!e.current.contains(N))return;let F=!1,V=!1;if(N.nodeType===Node.ELEMENT_NODE){const w=N;(w.closest('[data-type="datepicker"]')||w.closest(".rte-datepicker-wrapper")||w.closest(".rte-datepicker-host"))&&(F=!0),(w.closest('[data-type="select"]')||w.closest(".rte-select-wrapper")||w.closest(".rte-select-host"))&&(V=!0)}else if(N.parentElement){const w=N.parentElement;(w.closest('[data-type="datepicker"]')||w.closest(".rte-datepicker-wrapper")||w.closest(".rte-datepicker-host"))&&(F=!0),(w.closest('[data-type="select"]')||w.closest(".rte-select-wrapper")||w.closest(".rte-select-host"))&&(V=!0)}if(F||V)return;let O=null;if(N.nodeType===Node.ELEMENT_NODE?O=N.closest('[data-type="variable"]'):N.nodeType===Node.TEXT_NODE&&N.parentElement&&(O=N.parentElement.closest('[data-type="variable"]')),!O){if(Date.now()-a>500)return;const w=e.current.querySelectorAll('[data-type="variable"]');if(w.length>0){let H=null;for(const y of Array.from(w))if(y.style.display!=="none"){H=y;break}if(!H&&w.length>0&&(H=w[0]),H){const y=document.createRange();y.selectNodeContents(H),y.collapse(!1),A.removeAllRanges(),A.addRange(y),H.focus()}else A.removeAllRanges()}else A.removeAllRanges()}},m=e.current;return m&&(m.addEventListener("compositionstart",g),m.addEventListener("compositionend",p),m.addEventListener("input",c)),document.addEventListener("mousedown",o),document.addEventListener("mouseup",d),document.addEventListener("focusin",E),document.addEventListener("selectionchange",b),()=>{m&&(m.removeEventListener("compositionstart",g),m.removeEventListener("compositionend",p),m.removeEventListener("input",c)),document.removeEventListener("mousedown",o),document.removeEventListener("mouseup",d),document.removeEventListener("focusin",E),document.removeEventListener("selectionchange",b)}},[e,t])}var Dr={exports:{}},SE=Dr.exports,Vu;function Yu(){return Vu||(Vu=1,function(e,t){(function(n,r){e.exports=r()})(SE,function(){var n=1e3,r=6e4,i=36e5,a="millisecond",s="second",u="minute",o="hour",d="day",f="week",h="month",g="quarter",p="year",c="date",E="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|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,x={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(I){var T=["th","st","nd","rd"],$=I%100;return"["+I+(T[($-20)%10]||T[$]||T[0])+"]"}},A=function(I,T,$){var Q=String(I);return!Q||Q.length>=T?I:""+Array(T+1-Q.length).join($)+I},v={s:A,z:function(I){var T=-I.utcOffset(),$=Math.abs(T),Q=Math.floor($/60),z=$%60;return(T<=0?"+":"-")+A(Q,2,"0")+":"+A(z,2,"0")},m:function I(T,$){if(T.date()<$.date())return-I($,T);var Q=12*($.year()-T.year())+($.month()-T.month()),z=T.clone().add(Q,h),te=$-z<0,S=T.clone().add(Q+(te?-1:1),h);return+(-(Q+($-z)/(te?z-S:S-z))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:h,y:p,w:f,d,D:c,h:o,m:u,s,ms:a,Q:g}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},N="en",F={};F[N]=x;var V="$isDayjsObject",O=function(I){return I instanceof M||!(!I||!I[V])},w=function I(T,$,Q){var z;if(!T)return N;if(typeof T=="string"){var te=T.toLowerCase();F[te]&&(z=te),$&&(F[te]=$,z=te);var S=T.split("-");if(!z&&S.length>1)return I(S[0])}else{var fe=T.name;F[fe]=T,z=fe}return!Q&&z&&(N=z),z||!Q&&N},H=function(I,T){if(O(I))return I.clone();var $=typeof T=="object"?T:{};return $.date=I,$.args=arguments,new M($)},y=v;y.l=w,y.i=O,y.w=function(I,T){return H(I,{locale:T.$L,utc:T.$u,x:T.$x,$offset:T.$offset})};var M=function(){function I($){this.$L=w($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[V]=!0}var T=I.prototype;return T.parse=function($){this.$d=function(Q){var z=Q.date,te=Q.utc;if(z===null)return new Date(NaN);if(y.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var S=z.match(b);if(S){var fe=S[2]-1||0,ce=(S[7]||"0").substring(0,3);return te?new Date(Date.UTC(S[1],fe,S[3]||1,S[4]||0,S[5]||0,S[6]||0,ce)):new Date(S[1],fe,S[3]||1,S[4]||0,S[5]||0,S[6]||0,ce)}}return new Date(z)}($),this.init()},T.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},T.$utils=function(){return y},T.isValid=function(){return this.$d.toString()!==E},T.isSame=function($,Q){var z=H($);return this.startOf(Q)<=z&&z<=this.endOf(Q)},T.isAfter=function($,Q){return H($)<this.startOf(Q)},T.isBefore=function($,Q){return this.endOf(Q)<H($)},T.$g=function($,Q,z){return y.u($)?this[Q]:this.set(z,$)},T.unix=function(){return Math.floor(this.valueOf()/1e3)},T.valueOf=function(){return this.$d.getTime()},T.startOf=function($,Q){var z=this,te=!!y.u(Q)||Q,S=y.p($),fe=function(Re,Oe){var ze=y.w(z.$u?Date.UTC(z.$y,Oe,Re):new Date(z.$y,Oe,Re),z);return te?ze:ze.endOf(d)},ce=function(Re,Oe){return y.w(z.toDate()[Re].apply(z.toDate("s"),(te?[0,0,0,0]:[23,59,59,999]).slice(Oe)),z)},L=this.$W,Te=this.$M,_e=this.$D,Ae="set"+(this.$u?"UTC":"");switch(S){case p:return te?fe(1,0):fe(31,11);case h:return te?fe(1,Te):fe(0,Te+1);case f:var ge=this.$locale().weekStart||0,Ie=(L<ge?L+7:L)-ge;return fe(te?_e-Ie:_e+(6-Ie),Te);case d:case c:return ce(Ae+"Hours",0);case o:return ce(Ae+"Minutes",1);case u:return ce(Ae+"Seconds",2);case s:return ce(Ae+"Milliseconds",3);default:return this.clone()}},T.endOf=function($){return this.startOf($,!1)},T.$set=function($,Q){var z,te=y.p($),S="set"+(this.$u?"UTC":""),fe=(z={},z[d]=S+"Date",z[c]=S+"Date",z[h]=S+"Month",z[p]=S+"FullYear",z[o]=S+"Hours",z[u]=S+"Minutes",z[s]=S+"Seconds",z[a]=S+"Milliseconds",z)[te],ce=te===d?this.$D+(Q-this.$W):Q;if(te===h||te===p){var L=this.clone().set(c,1);L.$d[fe](ce),L.init(),this.$d=L.set(c,Math.min(this.$D,L.daysInMonth())).$d}else fe&&this.$d[fe](ce);return this.init(),this},T.set=function($,Q){return this.clone().$set($,Q)},T.get=function($){return this[y.p($)]()},T.add=function($,Q){var z,te=this;$=Number($);var S=y.p(Q),fe=function(Te){var _e=H(te);return y.w(_e.date(_e.date()+Math.round(Te*$)),te)};if(S===h)return this.set(h,this.$M+$);if(S===p)return this.set(p,this.$y+$);if(S===d)return fe(1);if(S===f)return fe(7);var ce=(z={},z[u]=r,z[o]=i,z[s]=n,z)[S]||1,L=this.$d.getTime()+$*ce;return y.w(L,this)},T.subtract=function($,Q){return this.add(-1*$,Q)},T.format=function($){var Q=this,z=this.$locale();if(!this.isValid())return z.invalidDate||E;var te=$||"YYYY-MM-DDTHH:mm:ssZ",S=y.z(this),fe=this.$H,ce=this.$m,L=this.$M,Te=z.weekdays,_e=z.months,Ae=z.meridiem,ge=function(Oe,ze,pt,Ct){return Oe&&(Oe[ze]||Oe(Q,te))||pt[ze].slice(0,Ct)},Ie=function(Oe){return y.s(fe%12||12,Oe,"0")},Re=Ae||function(Oe,ze,pt){var Ct=Oe<12?"AM":"PM";return pt?Ct.toLowerCase():Ct};return te.replace(m,function(Oe,ze){return ze||function(pt){switch(pt){case"YY":return String(Q.$y).slice(-2);case"YYYY":return y.s(Q.$y,4,"0");case"M":return L+1;case"MM":return y.s(L+1,2,"0");case"MMM":return ge(z.monthsShort,L,_e,3);case"MMMM":return ge(_e,L);case"D":return Q.$D;case"DD":return y.s(Q.$D,2,"0");case"d":return String(Q.$W);case"dd":return ge(z.weekdaysMin,Q.$W,Te,2);case"ddd":return ge(z.weekdaysShort,Q.$W,Te,3);case"dddd":return Te[Q.$W];case"H":return String(fe);case"HH":return y.s(fe,2,"0");case"h":return Ie(1);case"hh":return Ie(2);case"a":return Re(fe,ce,!0);case"A":return Re(fe,ce,!1);case"m":return String(ce);case"mm":return y.s(ce,2,"0");case"s":return String(Q.$s);case"ss":return y.s(Q.$s,2,"0");case"SSS":return y.s(Q.$ms,3,"0");case"Z":return S}return null}(Oe)||S.replace(":","")})},T.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},T.diff=function($,Q,z){var te,S=this,fe=y.p(Q),ce=H($),L=(ce.utcOffset()-this.utcOffset())*r,Te=this-ce,_e=function(){return y.m(S,ce)};switch(fe){case p:te=_e()/12;break;case h:te=_e();break;case g:te=_e()/3;break;case f:te=(Te-L)/6048e5;break;case d:te=(Te-L)/864e5;break;case o:te=Te/i;break;case u:te=Te/r;break;case s:te=Te/n;break;default:te=Te}return z?te:y.a(te)},T.daysInMonth=function(){return this.endOf(h).$D},T.$locale=function(){return F[this.$L]},T.locale=function($,Q){if(!$)return this.$L;var z=this.clone(),te=w($,Q,!0);return te&&(z.$L=te),z},T.clone=function(){return y.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()},I}(),U=M.prototype;return H.prototype=U,[["$ms",a],["$s",s],["$m",u],["$H",o],["$W",d],["$M",h],["$y",p],["$D",c]].forEach(function(I){U[I[1]]=function(T){return this.$g(T,I[0],I[1])}}),H.extend=function(I,T){return I.$i||(I(T,M,H),I.$i=!0),H},H.locale=w,H.isDayjs=O,H.unix=function(I){return H(1e3*I)},H.en=F[N],H.Ls=F,H.p={},H})}(Dr)),Dr.exports}var _E=Yu();const Pr=si(_E);var Mr={exports:{}},IE=Mr.exports,Gu;function NE(){return Gu||(Gu=1,function(e,t){(function(n,r){e.exports=r(Yu())})(IE,function(n){function r(s){return s&&typeof s=="object"&&"default"in s?s:{default:s}}var i=r(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(s,u){return u==="W"?s+"周":s+"日"},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(s,u){var o=100*s+u;return o<600?"凌晨":o<900?"早上":o<1100?"上午":o<1300?"中午":o<1800?"下午":"晚上"}};return i.default.locale(a,null,!0),a})}(Mr)),Mr.exports}NE();function Jn(e){"@babel/helpers - typeof";return Jn=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},Jn(e)}function kE(e,t){if(Jn(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jn(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vE(e){var t=kE(e,"string");return Jn(t)=="symbol"?t:t+""}function wE(e,t,n){return(t=vE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ju(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Wu(Object(n),!0).forEach(function(r){wE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Wu(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var LE={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},OE=ju(ju({},LE),{},{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 DE={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Xu={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},OE),timePickerLocale:Object.assign({},DE)};Xu.lang.ok="确定",Pr.locale("zh-cn");const{RangePicker:PE}=ye.DatePicker,ME=({host:e,onChange:t})=>{const n=e.dataset.key,r=e.dataset.value,i=e.dataset.placeholder,a=e.dataset.limitRange?parseInt(e.dataset.limitRange,10):void 0,s=e.dataset.disableFuture==="true",[u,o]=P.useState(()=>{if(!r)return null;const E=r.split(",");return E.length===2&&E[0]&&E[1]?[Pr(E[0]),Pr(E[1])]:null}),[d,f]=P.useState(null),h=E=>E?s&&E.isAfter(Pr(),"day")?!0:!a||!d||!d[0]?!1:Math.abs(E.diff(d[0],"days"))>a:!1,g=E=>{console.log("[DatePicker] onCalendarChange",E?.map(b=>b?.format("YYYY-MM-DD")||null)),f(E)},p=E=>{if(console.log("[DatePicker] onChange",E?.map(b=>b?.format("YYYY-MM-DD")||null)),o(E),f(null),E&&E[0]&&E[1]){const b=`${E[0].format("YYYY-MM-DD")},${E[1].format("YYYY-MM-DD")}`;e.setAttribute("data-value",b),t(n,b)}else e.setAttribute("data-value",""),t(n,"")},c=E=>{console.log("[DatePicker] onOpenChange",E),f(E?u:null)};return zr.createPortal(K.jsx("div",{className:"rte-datepicker-wrapper",contentEditable:!1,style:{display:"inline-block",verticalAlign:"middle",width:"260px",marginLeft:"4px",marginRight:"4px",fontSize:"16px",height:"30px",lineHeight:"30px"},children:K.jsx(PE,{value:u,disabledDate:h,onCalendarChange:g,onChange:p,onOpenChange:c,placeholder:[i||"开始日期",i||"结束日期"],style:{width:"100%"},size:"small",allowClear:!0,locale:Xu,getPopupContainer:()=>document.body,popupClassName:"rte-datepicker-dropdown"})}),e)},RE=e=>{const[t,n]=P.useState([]);return P.useEffect(()=>{const r=e.current;if(!r)return;const i=()=>{const s=r.querySelectorAll(".rte-datepicker-host"),u=[];s.forEach(o=>{const d=o.getAttribute("data-key");d&&u.push(K.jsx(ME,{host:o,onChange:()=>{if(e.current){const f=new Event("input",{bubbles:!0});e.current.dispatchEvent(f)}}},`datepicker-${d}`))}),n(u)};i();const a=new MutationObserver(s=>{let u=!1;for(const o of s)if(o.type==="childList"){let d=!1;if(o.addedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-datepicker-host")||h.querySelector?.(".rte-datepicker-host"))&&(d=!0)}}),o.removedNodes.forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE){const h=f;(h.classList?.contains("rte-datepicker-host")||h.querySelector?.(".rte-datepicker-host"))&&(d=!0)}}),d){u=!0;break}}u&&i()});return a.observe(r,{childList:!0,subtree:!0}),()=>a.disconnect()},[e]),t},Zn=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Ku=e=>`\`\`\`
|
|
21
|
+
${(e||"").replace(/\r\n/g,`
|
|
4
22
|
`)}
|
|
5
|
-
\`\`\``,
|
|
6
|
-
`).trim(),
|
|
7
|
-
`}),
|
|
8
|
-
`}),
|
|
9
|
-
`}))}if(
|
|
10
|
-
`})):
|
|
11
|
-
`}),
|
|
12
|
-
`})):(
|
|
13
|
-
`}):
|
|
14
|
-
`}),
|
|
15
|
-
`}))}}return
|
|
16
|
-
(reportId=${
|
|
23
|
+
\`\`\``,Qu=e=>{const t=(e||"").replace(/\r\n/g,`
|
|
24
|
+
`).trim(),n=t.match(/^```[a-zA-Z0-9_-]*\n([\s\S]*?)\n```$/);return n?`<pre><code>${Zn(n[1]||"")}</code></pre>`:`<div style="white-space:pre-wrap;">${Zn(t)}</div>`},Ju={...mn,attributes:{...mn.attributes||{},span:[...(mn.attributes||{}).span||[],"style"],font:[...(mn.attributes||{}).font||[],"color"]}},Zu=()=>e=>{yr(e,t=>{const n=t;if(!n||n.type!=="textDirective"&&n.type!=="leafDirective"&&n.type!=="containerDirective"||n.name!=="color")return;const r=n.attributes||{},i=r.hex??r.color??r.value,a=typeof i=="string"?i.trim():"",s=/^#([0-9a-fA-F]{6})$/.test(a)?a:"#7C3AED",u=r.bold,d=`${u===!0||u==="true"||u===1||u==="1"?"font-weight:700;":""}color:${s};`;n.data=n.data||{},n.data.hName="span",n.data.hProperties={style:d}})},BE=e=>{const t=(e??"").trim();if(!t)return null;if(!(t.startsWith("{")&&t.endsWith("}")))return{kind:"text",text:t};try{const n=JSON.parse(t);if(!n||typeof n!="object")return{kind:"text",text:t};const r=n;return r.type==="steps"&&typeof r.title=="string"&&Array.isArray(r.images)&&Array.isArray(r.stepDescriptions)?{kind:"steps",data:n}:{kind:"text",text:t}}catch{return{kind:"text",text:t}}},el=({config:e,onSend:t,isProcessing:n=!1,disabled:r=!1,width:i,lockStructure:a=!1,agentOptions:s=[],onAgentSelect:u,onAgentExit:o,loading:d=!1,placeholder:f,border:h,background:g="transparent",hideButtons:p,maxHeight:c,minHeight:E,collapsed:b=!1,reportAnalyze:m,markdownAnalyze:x,onCollapsedChange:A,collapseTransitionMs:v=260,debugTooltipSticky:N=!1})=>{const[F,V]=ye.message.useMessage(),O=P.useRef(null),w=P.useRef(null),H=P.useRef(null),y=P.useRef(null),M=P.useRef(null),U=P.useRef("");if(!U.current){const D=Math.random().toString(36).slice(2,8);U.current=`rte_${D}`}const[I,T]=P.useState({}),[$,Q]=P.useState(null),[z,te]=P.useState(null),[S,fe]=P.useState(null),[ce,L]=P.useState(null),[Te,_e]=P.useState(!1),Ae=P.useRef(null),ge=P.useRef(null),Ie=P.useRef(null),Re=200,Oe=200,ze=P.useCallback(()=>{Ae.current&&(window.clearTimeout(Ae.current),Ae.current=null),ge.current&&(window.clearTimeout(ge.current),ge.current=null),Ie.current!==null&&(window.cancelAnimationFrame(Ie.current),Ie.current=null)},[]),pt=P.useCallback(()=>{ze(),_e(!0)},[ze]),[Ct,bn]=P.useState(0),Tn=P.useRef(null),[Rr,yn]=P.useState(!1),Br=P.useRef(new Map),[tr,nr]=P.useState(357),lt=P.useCallback(D=>{if(ze(),D){L(D),_e(!1),Ie.current=window.requestAnimationFrame(()=>{Ie.current=null,_e(!0)});return}Ae.current=window.setTimeout(()=>{Ae.current=null,_e(!1),ge.current=window.setTimeout(()=>{L(null),ge.current=null},Oe)},Re)},[ze]);P.useEffect(()=>()=>{ze()},[ze]);const Ut=P.useRef(!1),$t=P.useRef(null),[Fr,qt]=P.useState(!1),ne=P.useRef(null),[de,Ee]=P.useState(!0),Ce=P.useRef(0),[we,at]=P.useState(58),[St,ht]=P.useState(58),[Jt,_t]=P.useState(!1),[je,ct]=P.useState({}),st=P.useRef(()=>{}),[It,Nt]=P.useState({}),Hr=P.useRef(()=>{}),ll=P.useRef({}),pa=P.useRef(It);P.useEffect(()=>{pa.current=It},[It]),P.useEffect(()=>{bn(0),yn(!1)},[ce?.key,ce?.type]),P.useEffect(()=>{const D=Br.current,R=new Set,B=j=>{if(!j||R.has(j)||D.has(j))return;R.add(j);const G=new window.Image;G.decoding="async",G.onload=()=>{const W=G.naturalWidth||G.width||0,q=G.naturalHeight||G.height||0;W>0&&q>0&&D.set(j,`${W} / ${q}`)},G.src=j};e.forEach(j=>{const G=j.tooltip;if(!G)return;const q=typeof G=="string"?(()=>{try{return JSON.parse(G)}catch{return null}})():G;if(!q||q.type!=="steps")return;const Z=q.images;Array.isArray(Z)&&Z.forEach(ee=>{typeof ee=="string"&&B(ee)})})},[e]),P.useLayoutEffect(()=>{if(!Te)return;if(ce?.type!=="upload"&&ce?.type!=="tag"&&ce?.type!=="variable"){nr(null);return}const D=requestAnimationFrame(()=>{const R=document.querySelector(".rte-steps-tooltip"),B=document.querySelector(".rte-steps-tooltip-title"),j=document.querySelector(".rte-steps-tooltip-step-badge");if(!R||!B||!j)return;const G=window.getComputedStyle(R),W=Number.parseFloat(G.paddingLeft)||0,q=Number.parseFloat(G.paddingRight)||0,Z=Math.ceil(B.getBoundingClientRect().width||0),ee=Math.ceil(j.getBoundingClientRect().width||0),re=Z+16+ee+Math.ceil(W+q),X=357,oe=Math.max(240,Math.floor(window.innerWidth-32));nr(Math.min(Math.max(re,X),oe))});return()=>cancelAnimationFrame(D)},[Te,ce?.key,ce?.type,Ct]),P.useEffect(()=>{if(!N)return;const D=R=>{R.key==="Escape"&<(null)};return window.addEventListener("keydown",D,!0),()=>window.removeEventListener("keydown",D,!0)},[N,lt]);const[kt,zt]=P.useState(()=>{const D={};return e.forEach(R=>{R.type==="multi-variable"&&R.key&&(D[R.key]=1)}),D}),ha=P.useRef({}),cl=P.useRef({}),dl=P.useRef({});P.useEffect(()=>{cl.current=I},[I]),P.useEffect(()=>{dl.current=kt},[kt]);const ma=P.useCallback(D=>D.find(B=>B.type==="tag")?.text||null,[]),fl=P.useRef(e),Zt=P.useRef(null);P.useEffect(()=>{const D=ma(fl.current),R=ma(e);if(D&&D!==R&&y.current){const B={};y.current.querySelectorAll('[data-type="variable"]').forEach(q=>{const Z=q.dataset.key;if(Z){const ee=q.innerText.replace(/[\u200B\n]/g,"").trim();ee&&(B[Z]=ee)}}),y.current.querySelectorAll('[data-type="select"]').forEach(q=>{const Z=q.dataset.key;if(Z){const ee=(q.getAttribute("data-value")||"").trim();ee&&(B[Z]=ee)}}),y.current.querySelectorAll('[data-type="textarea"]').forEach(q=>{const Z=q.dataset.key;if(Z){const ee=q.value.replace(/[\u200B]/g,"").trim();ee&&(B[Z]=ee)}}),ha.current[D]={variableValues:B,files:{...cl.current},multiVariableCounts:{...dl.current}}}if(R&&ha.current[R]){const B=ha.current[R];Zt.current=B,T(B.files),zt(B.multiVariableCounts)}else if(R){Zt.current=null;const B={};e.forEach(j=>{j.type==="multi-variable"&&j.key&&(B[j.key]=1)}),zt(B),T({})}else Zt.current=null,zt({}),T({});fl.current=e},[e,ma]),P.useLayoutEffect(()=>{Zt.current&&y.current&&(y.current.__tempVariableValues=Zt.current.variableValues,setTimeout(()=>{Zt.current&&(Zt.current=null)},0))});const Qe=P.useMemo(()=>{if(e.length===0)return e;const D=[];for(const R of e){if(R.type==="markdown"&&R.key==="tableData"||D.push(R),R.type==="report-url"&&R.key){const B=je[R.key],j=B?.status??"idle",G=B?.modules??[];j==="loading"&&D.push({type:"text",className:"rte-report-parsing",text:`解析中...
|
|
25
|
+
`}),j==="error"&&B?.error&&D.push({type:"text",className:"rte-report-error",text:`解析失败:${Zn(B.error)}
|
|
26
|
+
`}),G.length>0&&(G.forEach((W,q)=>{D.push({type:"report-module",key:R.key,moduleIndex:q,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:W.content})}),D.push({type:"text",text:`
|
|
27
|
+
`}))}if(R.type==="markdown"&&R.key){const B=It[R.key],j=B?.status??"idle",G=B?.modules??[];R.key==="tableData"?j==="loading"?(D.push({type:"text",className:"rte-markdown-parsing",text:"解析中..."}),D.push({type:"text",text:`
|
|
28
|
+
`})):j==="success"&&G.length>0?G.forEach((q,Z)=>{D.push({type:"markdown-module",key:R.key,moduleIndex:Z,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:q.content})}):(D.push(R),j==="error"&&B?.error&&D.push({type:"text",className:"rte-markdown-error",text:`解析失败:${Zn(B.error)}
|
|
29
|
+
`}),D.push({type:"text",text:`
|
|
30
|
+
`})):(j==="loading"?D.push({type:"text",className:"rte-markdown-parsing",text:`解析中...
|
|
31
|
+
`}):j==="error"&&B?.error&&D.push({type:"text",className:"rte-markdown-error",text:`解析失败:${Zn(B.error)}
|
|
32
|
+
`}),G.length>0&&j!=="loading"&&G.forEach((q,Z)=>{D.push({type:"markdown-module",key:R.key,moduleIndex:Z,placeholder:"可编辑,内容不能为空",required:!0,minHeight:80,maxHeight:260,text:q.content})}),j!=="loading"&&D.push({type:"text",text:`
|
|
33
|
+
`}))}}return D},[e,It,je]),pl=P.useCallback(D=>{const R=D.trim();if(!R)return{url:""};let B=null;try{B=new URL(R)}catch{try{B=new URL(`https://${R}`)}catch{return{url:R}}}const j=B.pathname.split("/").filter(Boolean),G=j.findIndex(ee=>ee==="report"),W=G>=0?j[G+1]:void 0,q=j[0]&&j[0].length<=5?j[0]:void 0,Z=B.searchParams.get("agentId")||void 0;return{url:R,reportId:W,agentId:Z,lang:q}},[]),rr=P.useCallback(()=>{const D={};if(!y.current)return D;const R=y.current;return R.querySelectorAll('[data-type="variable"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=B.innerText.replace(/[\u200B\n]/g,"").trim();G&&(D[j]=G)}),R.querySelectorAll('[data-type="select"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=(B.getAttribute("data-value")||"").trim();G&&(D[j]=G)}),R.querySelectorAll('[data-type="textarea"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=B.value.replace(/[\u200B]/g,"").trim();G&&(D[j]=G)}),R.querySelectorAll('[data-type="richtext"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=B.getAttribute("data-node-type")||"";if(G==="report-module"||G==="markdown-module"){const q=Number.parseInt(B.getAttribute("data-module-index")||"0",10),Z=(B.innerHTML||"").replace(/[\u200B]/g,"").trim();D[`${j}__module_${Number.isFinite(q)?q:0}`]=Z;return}const W=(B.textContent||"").replace(/[\u200B]/g,"").trim();W&&(D[j]=W)}),R.querySelectorAll('[data-type="datepicker"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=(B.getAttribute("data-value")||"").trim();G&&(D[j]=G)}),R.querySelectorAll('[data-type="number-input"]').forEach(B=>{const j=B.dataset.key;if(!j)return;const G=(B.value||"").trim();G&&(D[j]=G)}),D},[]),hl=P.useCallback(D=>(D?.modules||[]).map((R,B)=>{const j=(R?.title||`模块${B+1}`).trim()||`模块${B+1}`,G=(R?.content||"").trim();return{title:j,content:G.length>0?G:`请补充:${j}`}}),[]),ga=P.useCallback(D=>(D?.modules||[]).map((R,B)=>{const j=(R?.title||`模块${B+1}`).trim()||`模块${B+1}`,G=(R?.markdown||"").trim(),W=(R?.content||"").trim()||(G?Qu(G):"");return{title:j,content:W.length>0?W:`请补充:${j}`,markdown:G}}),[]),ml=P.useCallback((D,R)=>{const B=(R||"").trim();if(!D)return;if(!B){ct(q=>({...q,[D]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}));return}const j=je[D];if(j?.lastParsedUrl&&j.lastParsedUrl===B&&j.status==="loading")return;ct(q=>({...q,[D]:{...q[D],status:"loading",error:void 0,lastParsedUrl:B}}));const G=pl(B);(m||(async q=>({modules:[{title:"第1张:人群+场景直击图",content:`视觉要求:养宠人在客厅场景中,宠物(猫/狗)自然趴在旁;画面聚焦“人+宠+整洁氛围”。
|
|
34
|
+
(reportId=${q.reportId||"unknown"}, agentId=${q.agentId||"1"})`},{title:"第2张:痛点放大对比图",content:"左侧:杂乱堆放、难清理;右侧:分区收纳、拿取方便。文案≤15字,绑定人群+场景+需求。"}]})))(G).then(q=>{const Z=hl(q);if(y.current){const ee=rr();Z.forEach((ae,re)=>{ee[`${D}__module_${re}`]=ae.content}),y.current.__tempVariableValues=ee}ct(ee=>({...ee,[D]:{status:"success",error:void 0,lastParsedUrl:B,modules:Z}}))}).catch(q=>{const Z=q instanceof Error?q.message:String(q);ct(ee=>({...ee,[D]:{...ee[D]||{modules:[]},status:"error",error:Z||"解析失败",lastParsedUrl:B,modules:[]}}))})},[rr,hl,pl,m,je]),gl=P.useCallback((D,R)=>{const B=(R||"").trim();if(!D)return;if(!B){Nt(ee=>({...ee,[D]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}));return}const j=It[D];if(j?.lastParsedText&&j.lastParsedText===B&&j.status==="success")return;if(!x){const ee=Ku(B),ae=ga({modules:[{title:"内容",content:Qu(ee),markdown:ee}]});if(y.current){const re=rr();ae.forEach((X,oe)=>{re[`${D}__module_${oe}`]=X.content}),y.current.__tempVariableValues=re}Nt(re=>({...re,[D]:{status:"success",error:void 0,lastParsedText:B,modules:ae}}));return}const G=pa.current[D]?.status==="loading";G||Nt(ee=>({...ee,[D]:{...ee[D],status:"loading",error:void 0,lastParsedText:B}}));const W=500,q=Date.now();setTimeout(()=>{x({text:B}).then(ae=>{const re=ga(ae),X=Date.now()-q,oe=Math.max(0,W-X);setTimeout(()=>{if(y.current){const pe=rr();re.forEach((ie,me)=>{pe[`${D}__module_${me}`]=ie.content}),y.current.__tempVariableValues=pe}Nt(pe=>({...pe,[D]:{status:"success",error:void 0,lastParsedText:B,modules:re}}))},oe)}).catch(ae=>{const re=ae instanceof Error?ae.message:String(ae);Nt(X=>({...X,[D]:{...X[D]||{modules:[]},status:"error",error:re,lastParsedText:B}}))})},G?0:50)},[rr,x,It,ga]);P.useEffect(()=>{st.current=ml},[ml]),P.useEffect(()=>{Hr.current=gl},[gl]),P.useLayoutEffect(()=>{if(!y.current)return;const D=new Map,R=window.setTimeout(()=>{if(!y.current)return;D.forEach((G,W)=>W.removeEventListener("blur",G,!1)),D.clear();const B=y.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]'),j=G=>{G.stopPropagation(),G.stopImmediatePropagation();const W=G.target?.closest('[data-type="variable"][data-node-type="report-url"], [data-type="variable"][data-node-type="markdown"]');if(!W||!y.current||!y.current.contains(W))return;const q=W.dataset.key;if(!q)return;const Z=W.innerText.replace(/[\u200B\n]/g,"").trim(),ee=W.getAttribute("data-node-type")||"";ee==="report-url"?st.current(q,Z):ee==="markdown"&&Hr.current(q,Z)};B.forEach(G=>{G.addEventListener("blur",j,!1),D.set(G,j)})},0);return()=>{window.clearTimeout(R),D.forEach((B,j)=>j.removeEventListener("blur",B,!1)),D.clear()}},[Qe]),P.useLayoutEffect(()=>{if(!y.current)return;const D=new Map,R=new Map,B=ae=>{const re=ae.value||ae.placeholder||"",X=window.getComputedStyle(ae),oe=Number.parseFloat(X.paddingLeft)||0,pe=Number.parseFloat(X.paddingRight)||0,ie=document.createElement("span");ie.style.cssText=`
|
|
17
35
|
position: absolute;
|
|
18
36
|
visibility: hidden;
|
|
19
37
|
white-space: nowrap;
|
|
20
|
-
font-size: ${
|
|
21
|
-
font-family: ${
|
|
22
|
-
font-weight: ${
|
|
23
|
-
letter-spacing: ${
|
|
24
|
-
padding-left: ${
|
|
25
|
-
padding-right: ${
|
|
26
|
-
`,Q.textContent=$||"0",document.body.appendChild(Q);const W=Math.max(44,Math.min(600,Q.offsetWidth+8));return document.body.removeChild(Q),W},m=C=>{const $=C.target;if(!$)return;let z=$.value;if(z=z.replace(/[^\d]/g,""),z!==""&&z!=="0"){const g=parseInt(z,10);if(Number.isNaN(g))$.value="";else{const Y=$.getAttribute("min"),Q=$.getAttribute("max"),W=Y!==null?parseInt(Y,10):0,te=Q!==null?parseInt(Q,10):1/0,ae=Math.min(Math.max(g,W),te);$.value=String(ae)}}else if(z==="0"){const g=$.getAttribute("min");0<(g!==null?parseInt(g,10):0)?$.value="":$.value="0"}$.style.width=`${o($)}px`},h=C=>{const $=C.key;($==="-"||$==="."||$===","||$==="e"||$==="E"||$==="+"||$==="="||$===" ")&&C.preventDefault()},k=()=>{if(!l.current)return;l.current.querySelectorAll('[data-type="number-input"]').forEach($=>{const z=$.style.width,g=`${o($)}px`;z!==g&&($.style.width=g),r.has($)||($.addEventListener("input",m,!1),$.addEventListener("keydown",h,!1),r.set($,m),a.set($,h))})},p=window.setTimeout(()=>{k()},0),O=new MutationObserver(C=>{let $=!1;C.forEach(z=>{z.type==="childList"&&z.addedNodes.forEach(g=>{if(g.nodeType===Node.ELEMENT_NODE){const Y=g;Y.matches&&(Y.matches('[data-type="number-input"]')||Y.querySelector('[data-type="number-input"]'))&&($=!0)}})}),$&&setTimeout(k,10)});return l.current&&O.observe(l.current,{childList:!0,subtree:!0}),()=>{window.clearTimeout(p),O.disconnect(),r.forEach((C,$)=>{$.removeEventListener("input",C,!1)}),r.clear(),a.forEach((C,$)=>{$.removeEventListener("keydown",C,!1)}),a.clear()}},[xe]),en(l,xe,V,D,Ce,re,void 0,N),tn(l,xe,V,ee),nn(l,xe,ee,N),an(l,xe,V,ee),rn(l,xe,ee),on(l,xe,V,he),sn(l,se);const lt=Zt(l);c.useEffect(()=>{if(!l.current)return;l.current.querySelectorAll(".rte-richtext-toggle").forEach(a=>{const o=a.getAttribute("data-expanded")==="true";a.innerHTML=o?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[xe,l]);const it=wn(l),ct=c.useCallback(()=>{const r=G.current;if(!r)return;const a=Math.max(0,Math.ceil(r.scrollHeight||0));!Number.isFinite(a)||a<=0||Ln(o=>o===a?o:a)},[]);c.useLayoutEffect(()=>{if(!s)return;const r=R.current,a=l.current;if(!(!r||!a))try{const o=window.getComputedStyle(a),m=Number.parseFloat(o.paddingTop)||0,h=Number.parseFloat(o.lineHeight)||34,k=Math.max(0,Math.ceil(m+h)),p=a.getBoundingClientRect(),O=document.createRange();O.selectNodeContents(a);const C=Array.from(O.getClientRects());let $=k>0?k:58;if(C.length>0){const z=Math.min(...C.map(Q=>Q.top)),g=2;let Y=0;for(const Q of C)Math.abs(Q.top-z)<=g&&(Y=Math.max(Y,Q.bottom));if(Y>0){const Q=Math.max(0,Math.ceil(Y-p.top));$=k>0?Math.max(Q,k):Q}}else $=k>0?k:58;if(!Number.isFinite($)||$<=0)return;qe(z=>z===$?z:$)}catch{}},[s,xe,V,Ce,lt.length,it.length]);const Ye=c.useRef({ts:0,contentScrollTop:0,bodyScrollTop:0,editorScrollTop:0});c.useEffect(()=>{if(s)return;const r=R.current,a=G.current,o=l.current;if(!r)return;const m=()=>{Ye.current={ts:Date.now(),contentScrollTop:r.scrollTop||0,bodyScrollTop:a?.scrollTop||0,editorScrollTop:o?.scrollTop||0}};m();const h=()=>{m(),console.log(`[RTE collapse debug][${U.current}] (expanded) content scroll`,Ye.current)},k=()=>{m(),console.log(`[RTE collapse debug][${U.current}] (expanded) body scroll`,Ye.current)};return r.addEventListener("scroll",h,{passive:!0}),a?.addEventListener("scroll",k,{passive:!0}),()=>{r.removeEventListener("scroll",h),a?.removeEventListener("scroll",k)}},[s]),c.useEffect(()=>{if(typeof window>"u")return;const r=U.current,a=window;return a.__rteDebug=a.__rteDebug||{},a.__rteDebug[r]={contentEl:R.current,contentBodyEl:G.current,editorEl:l.current},()=>{a.__rteDebug&&a.__rteDebug[r]&&delete a.__rteDebug[r]}},[]),c.useLayoutEffect(()=>{if(!s)return;const r=R.current,a=G.current,o=l.current;if(!r)return;const m=()=>({content:{scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,scrollHeight:r.scrollHeight,clientHeight:r.clientHeight},body:a?{scrollTop:a.scrollTop,scrollLeft:a.scrollLeft,scrollHeight:a.scrollHeight,clientHeight:a.clientHeight}:void 0,editor:o?{scrollTop:o.scrollTop,scrollLeft:o.scrollLeft,scrollHeight:o.scrollHeight,clientHeight:o.clientHeight}:void 0,style:(()=>{try{const W=window.getComputedStyle(r),te=a?window.getComputedStyle(a):void 0;return{contentOverflow:`${W.overflow}/${W.overflowY}`,bodyOverflow:te?`${te.overflow}/${te.overflowY}`:void 0,bodyMaxHeight:te?.maxHeight,bodyHeight:te?.height}}catch{return}})()}),h=()=>{r.scrollTop=0,r.scrollLeft=0,a&&(a.scrollTop=0,a.scrollLeft=0),o&&(o.scrollTop=0,o.scrollLeft=0)},p=(typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260)+220;console.log(`[RTE collapse debug][${U.current}] pre-collapse lastScrollStateRef`,Ye.current),console.log(`[RTE collapse debug][${U.current}] lock start (before reset)`,m()),h(),console.log(`[RTE collapse debug][${U.current}] lock start (after reset)`,m()),window.requestAnimationFrame(()=>{console.log(`[RTE collapse debug][${U.current}] lock start (after rAF)`,m())});const O=W=>{W.preventDefault(),W.stopPropagation(),h(),console.log(`[RTE collapse debug][${U.current}] prevented scroll event`,{type:W.type},m())},C=()=>console.log(`[RTE collapse debug][${U.current}] content scroll event`,m()),$=()=>console.log(`[RTE collapse debug][${U.current}] body scroll event`,m());r.addEventListener("wheel",O,{passive:!1}),r.addEventListener("touchmove",O,{passive:!1}),r.addEventListener("scroll",C,{passive:!0}),a&&(a.addEventListener("wheel",O,{passive:!1}),a.addEventListener("touchmove",O,{passive:!1}),a.addEventListener("scroll",$,{passive:!0}));const z=performance.now();let g=0;const Y=W=>{h(),W-z<p&&(g=window.requestAnimationFrame(Y))};g=window.requestAnimationFrame(Y);const Q=window.setTimeout(()=>{h(),console.log(`[RTE collapse debug][${U.current}] lock end (after timeout)`,m())},p);return()=>{r.removeEventListener("wheel",O),r.removeEventListener("touchmove",O),r.removeEventListener("scroll",C),a&&(a.removeEventListener("wheel",O),a.removeEventListener("touchmove",O),a.removeEventListener("scroll",$)),window.cancelAnimationFrame(g),window.clearTimeout(Q),console.log(`[RTE collapse debug][${U.current}] lock cleanup`,m())}},[s,F]),c.useEffect(()=>{if(s)return;let r=0;return r=window.requestAnimationFrame(()=>{ct()}),()=>window.cancelAnimationFrame(r)},[s,xe,V,Ce,lt.length,it.length,ct]),c.useEffect(()=>{const r=typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260;if(r<=0){tt(!1);return}tt(!0);const a=window.setTimeout(()=>tt(!1),r);return()=>window.clearTimeout(a)},[s,F]),c.useEffect(()=>{if(t.length>0){ge(!1);return}const r=()=>{if(!l.current){ge(!0);return}const o=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",m=l.current.querySelectorAll('[data-type="variable"]'),h=l.current.querySelectorAll('[data-type="upload"]');let k=!1;m.forEach(O=>{(O.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(k=!0)}),h.forEach(O=>{O.querySelector(".upload-inner-wrapper.has-file")&&(k=!0)});const p=!o&&!k;ge(p),t.length===0&&he(!p)};r();const a=new MutationObserver(r);return l.current&&a.observe(l.current,{childList:!0,subtree:!0,characterData:!0}),()=>{a.disconnect()}},[t]);const Mn=r=>{if(d){r.preventDefault();return}r.preventDefault();const a=r.clipboardData.getData("text/plain"),o=window.getSelection();if(o&&o.rangeCount>0){const p=o.anchorNode;if(p){let O=null;if(p.nodeType===Node.ELEMENT_NODE?O=p.closest('[data-type="variable"]'):p.nodeType===Node.TEXT_NODE&&p.parentElement&&(O=p.parentElement.closest('[data-type="variable"]')),O){const C=O.dataset.multiKey;if(C){const $=/[、,,\s\n\r\t]+/,z=a.split($).map(g=>g.trim()).filter(g=>g.length>0);if(z.length>1){const g=parseInt(O.dataset.index||"0",10),Y=t.find(ye=>ye.type==="multi-variable"&&ye.key===C)?.maxCount||9,Q=Ce[C]||1,W=Math.min(g+z.length,Y);W>Q&&Ae(pe=>({...pe,[C]:W}));const te=[];for(let pe=0;pe<Q;pe++){const ye=`${C}_${pe}`,Se=l.current.querySelector(`[data-type="variable"][data-key="${ye}"][data-multi-key="${C}"]`);if(Se){const Me=Se.innerText.replace(/[\u200B\n]/g,"").trim();te.push(Me)}}te.splice(g,1,...z.slice(0,Y-g));const ae=te.slice(0,Y);ae.length>0&&ae[ae.length-1]!==""&&ae.length<Y&&ae.push("");const ce=Math.max(ae.length,1),de={};ae.forEach((pe,ye)=>{pe&&(de[`${C}_${ye}`]=pe)}),l.current.querySelectorAll('[data-type="variable"]').forEach(pe=>{const ye=pe.dataset.key,Se=pe.dataset.multiKey;if(ye&&Se!==C){const Me=pe.innerText.replace(/[\u200B\n]/g,"").trim();Me&&(de[ye]=Me)}}),l.current.__tempVariableValues=de,Ae(pe=>({...pe,[C]:ce}));return}}}}}let m=!1,h="";const k=window.getSelection();if(k&&k.rangeCount>0){const p=k.anchorNode;if(p){let O=null;if(p.nodeType===Node.ELEMENT_NODE?O=p.closest('[data-type="variable"]'):p.nodeType===Node.TEXT_NODE&&p.parentElement&&(O=p.parentElement.closest('[data-type="variable"]')),O){const C=O.getAttribute("data-node-type")||"",$=O.dataset.key;if(C==="markdown"&&$&&/20\d{2}-\d{2}-\d{2}/.test(a))m=!0,h=$,Vt.current[$]=a,Ee(z=>({...z,[$]:{...z[$],status:"loading",error:void 0}}));else if(C==="report-url"&&$){document.execCommand("insertText",!1,a),ut(),setTimeout(()=>{const z=O.innerText.replace(/[\u200B\n]/g,"").trim();nt.current($,z)},0);return}}}}if(m&&h){setTimeout(()=>{We.current(h,a)},0);return}document.execCommand("insertText",!1,a),ut(),setTimeout(()=>{/20\d{2}-\d{2}-\d{2}/.test(a)&&rt.current.tableData?.status==="success"&&(Ee(O=>({...O,tableData:{status:"loading",modules:[],lastParsedText:a,error:void 0}})),setTimeout(()=>{Vt.current.tableData=a,We.current("tableData",a)},0))},0)},Dn=r=>{if(!r.target.files){r.target&&(r.target.value=""),x(null),A(null),J(null);return}const a=10*1024*1024,o=h=>h.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(h.name||""),m=h=>o(h)&&h.size>a;if(I&&r.target.files&&r.target.files.length>0){const h=I,k=t.find($=>$.type==="upload"&&$.key===h),p=Array.from(r.target.files),O=p.filter($=>!m($)),C=p.length-O.length;if(C>0&&T.error(`已自动过滤 ${C} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`),k&&typeof k.maxCount=="number"&&typeof k.minCount=="number"){const $=k.maxCount,z=typeof X=="number"?X:0;y(g=>{const Y={...g};let Q=Math.min(Math.max(z,0),$-1);for(const W of O){for(;Q<$&&Y[`${h}-${Q}`]!=null;)Q+=1;if(Q>=$)break;Y[`${h}-${Q}`]=W,Q+=1}return Y})}}else if(b&&r.target.files[0]){const h=r.target.files[0],k=b;m(h)?T.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)"):y(p=>({...p,[k]:h}))}r.target&&(r.target.value=""),x(null),A(null),J(null)},Ut=r=>{y(a=>{const o={...a};return delete o[r],o})},Pn=r=>{const a=r.target;if(a.closest(".rte-datepicker-wrapper")||a.closest(".rte-datepicker-host")||a.closest(".rte-select-wrapper")||a.closest(".rte-select-host")||a.closest(".ant-select-dropdown"))return;if(a.closest(".tag-close-btn")){if(r.preventDefault(),r.stopPropagation(),D)return;ee(null),M?M():l.current&&(l.current.innerHTML="",l.current.focus());return}if(D){const h=a.closest(".tag-node"),k=a.closest('[data-type="text"]');if(h||k){r.preventDefault(),r.stopPropagation();const p=window.getSelection();p&&p.removeAllRanges();return}}a.closest('[data-type="variable"]')||(ie.current={x:r.clientX,y:r.clientY},se.current=!1,a.closest(".file-remove-btn")&&(r.preventDefault(),r.stopPropagation()))},Hn=r=>{if(!r.target.closest('[data-type="variable"]')&&ie.current){const m=Math.abs(r.clientX-ie.current.x),h=Math.abs(r.clientY-ie.current.y);(m>3||h>3)&&(se.current=!0)}},Bn=r=>{if(r.target.closest('[data-type="variable"]')){ie.current=null,se.current=!1;return}ie.current=null,se.current=!1},Vn=r=>{if(d)return;s&&H?.(!1);const a=r.target;if(a.closest('[data-type="datepicker"]'))return;if(a.closest(".tag-close-btn")){r.preventDefault(),r.stopPropagation();return}if(t.length===0)return;const h=(g,Y)=>{if(!l.current)return;Array.from(l.current.children).forEach(W=>{if(W!==g)if(Y)W.dataset.prevDisplay===void 0&&(W.dataset.prevDisplay=W.style.display||""),W.dataset.rteForceHidden="1",W.style.setProperty("display","none","important");else{if(W.dataset.prevDisplay!==void 0){const te=W.dataset.prevDisplay;te?W.style.display=te:W.style.removeProperty("display"),delete W.dataset.prevDisplay}else W.style.removeProperty("display");delete W.dataset.rteForceHidden}})},k=a.closest(".rte-textarea-toggle");if(k){r.preventDefault(),r.stopPropagation();const g=k.closest(".rte-textarea-wrapper"),Y=g?.querySelector('[data-type="textarea"]'),W=!(k.getAttribute("data-expanded")==="true");k.setAttribute("data-expanded",String(W)),k.textContent=W?"收起":"展开",g&&g.classList.toggle("rte-textarea-expanded",W);const te=g?.closest(".rte-textarea-required");if(te?te.classList.toggle("rte-textarea-overlay",W):g&&g.classList.toggle("rte-textarea-overlay",W),Y)if(W)Y.classList.add("rte-textarea-expanded"),Y.style.maxHeight="none",Y.style.height="100%";else{Y.classList.remove("rte-textarea-expanded");const ae=Y.dataset.maxHeight||"252";Y.style.maxHeight=`${ae}px`,Y.style.height="auto"}l.current&&(W?l.current.classList.add("rte-overlay-active"):l.current.classList.remove("rte-overlay-active"));return}const p=a.closest(".rte-richtext-toggle");if(p){r.preventDefault(),r.stopPropagation();const g=p.closest(".rte-richtext-wrapper"),Y=g?.querySelector('[data-type="richtext"]'),W=!(p.getAttribute("data-expanded")==="true");((de,fe)=>{de.setAttribute("data-expanded",String(fe)),de.innerHTML=fe?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(p,W);const ae=g?.closest(".rte-richtext-required");ae?ae.classList.toggle("rte-richtext-expanded",W):g&&g.classList.toggle("rte-richtext-expanded",W);const ce=g?.closest(".exclusion-wrapper")||g?.parentElement;if(Y&&(W?(Y.style.height="100%",Y.style.overflow="auto"):(Y.style.height="",Y.style.overflow="")),ce&&(ce.classList.toggle("rte-richtext-host-expanded",W),h(ce,W)),l.current){if(l.current.classList.toggle("rte-richtext-fullscreen-active",W),K.current?.classList.toggle("rte-richtext-container-expanded",W),K.current)if(W){const de=Math.ceil(K.current.getBoundingClientRect().height||0);de>0&&K.current.style.setProperty("--rte-richtext-fullscreen-height",`${de}px`)}else K.current.style.removeProperty("--rte-richtext-fullscreen-height");if(W)be.current=l.current.scrollTop||0,setTimeout(()=>{l.current&&(l.current.scrollTop=0,l.current.scrollLeft=0)},0);else{const de=be.current||0;setTimeout(()=>{l.current&&(l.current.scrollTop=de)},0)}}return}if(a.closest('[data-type="text"]')){r.preventDefault(),r.stopPropagation();const g=window.getSelection();g&&g.removeAllRanges();return}if(D&&a.closest(".tag-node")){r.preventDefault(),r.stopPropagation();const Y=window.getSelection();Y&&Y.removeAllRanges();return}if(a.closest('[data-type="variable"]')){if(se.current)return;setTimeout(()=>{const g=window.getSelection();g&&!g.isCollapsed||Ze(l)},10);return}const $=a.closest(".file-remove-btn");if($){r.preventDefault(),r.stopPropagation();const g=$.closest('[data-type="upload"]'),Y=g?.dataset.key,Q=g?.dataset.batchKey;if(Y)if(Q){const W=t.find(te=>te.type==="upload"&&te.key===Q);if(W&&typeof W.maxCount=="number"&&typeof W.minCount=="number"){const te=W.maxCount;y(ae=>{const ce={...ae},de=[];for(let fe=0;fe<te;fe++){const pe=`${Q}-${fe}`,ye=ce[pe];ye!=null&&pe!==Y&&de.push(ye)}for(let fe=0;fe<te;fe++)delete ce[`${Q}-${fe}`];return de.forEach((fe,pe)=>{ce[`${Q}-${pe}`]=fe}),ce})}else Ut(Y)}else Ut(Y);return}const z=a.closest('[data-type="upload"]');if(z){const g=z.dataset.key,Y=z.dataset.batchKey,Q=z.dataset.batchIndex;if(g){const W=Y||g,te=t.find(ae=>ae.type==="upload"&&ae.key===W);if(_.current&&(te?.accept?_.current.accept=te.accept:te?.acceptType==="image"?_.current.accept="image/*":te?.acceptType==="file"?_.current.accept=".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json":_.current.accept=""),Y){const ae=t.find(ce=>ce.type==="upload"&&ce.key===Y);if(ae&&typeof ae.maxCount=="number"&&typeof ae.minCount=="number"){const ce=ae.maxCount,de=V[g]!=null,fe=Q!=null?Number.parseInt(Q,10):NaN;if(de){_.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click();return}let pe=0;for(let ye=0;ye<ce;ye++)V[`${Y}-${ye}`]!=null&&(pe+=1);pe<ce&&_.current?(_.current.multiple=!0,A(Y),J(Number.isFinite(fe)?fe:null),x(null),_.current.click()):(_.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click())}else _.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click()}else _.current&&(_.current.multiple=!1),A(null),J(null),x(g),_.current?.click()}return}},On=r=>{const o=r.target.closest('[data-type="variable"]');if(o){const m=window.getSelection();if(m){const h=document.createRange(),k=o.textContent||"";if(k.replace(/\u200B/g,"")){let O=0,C=k.length;k.startsWith("")&&(O=1),k.endsWith("")&&k.length>1&&(C=k.length-1);const $=o.firstChild;$&&$.nodeType===Node.TEXT_NODE?(h.setStart($,O),h.setEnd($,C)):h.selectNodeContents(o)}else h.selectNodeContents(o),h.collapse(!0);m.removeAllRanges(),m.addRange(h)}}},ut=()=>{if(t.length===0){if(l.current){const o=!(l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");ge(o),he(!o)}return}if(Ze(l),l.current&&l.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ve(k=>{const p=k[m];return!p||p.status==="idle"&&(!p.modules||p.modules.length===0)?k:{...k,[m]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="variable"][data-node-type="markdown"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ee(k=>{const p=k[m];return!p||p.status==="idle"&&(!p.modules||p.modules.length===0)?k:{...k,[m]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="richtext"][data-node-type="markdown-module"]').forEach(o=>{const m=o.dataset.key;if(!m)return;o.innerText.replace(/[\u200B\n]/g,"").trim()||Ee(k=>{const p=k[m];return!p||p.status==="idle"?k:{...k,[m]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),l.current&&l.current.querySelectorAll('[data-type="variable"]').forEach(o=>{const m=o.querySelector(".variable-info-icon");if(m){let h=!1;const k=document.createTreeWalker(o,NodeFilter.SHOW_TEXT,{acceptNode:p=>m.contains(p)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;k.nextNode();)if(k.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){h=!0;break}h?m.classList.add("hidden"):m.classList.remove("hidden")}}),s||window.requestAnimationFrame(()=>{ct()}),Je(l,xe,V),Qe(l,xe,V,he),!l.current)return;t.filter(a=>a.type==="multi-variable"&&a.key).forEach(a=>{if(!a.key)return;const o=a.maxCount||9,m=Ce[a.key]||1,h=[];for(let $=0;$<m;$++){const z=`${a.key}_${$}`,g=l.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${a.key}"]`);if(g){const Y=g.innerText.replace(/[\u200B\n]/g,"").trim();h.push(Y)}}const p=(h[h.length-1]||"")==="";let O=!1,C=-1;for(let $=0;$<h.length-1;$++)if(h[$]===""){O=!0,C=$;break}if(O&&C>=0){const $=window.getSelection();if($&&$.rangeCount>0){const W=$.getRangeAt(0),te=W.startContainer,ae=te.nodeType===Node.ELEMENT_NODE?te.closest('[data-type="variable"][data-multi-key]'):te.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ae){const ce=ae.dataset.key;if(ce){const de=document.createRange();de.setStartBefore(ae),de.setEnd(W.startContainer,W.startOffset);const fe=de.toString().length;re.current={key:ce,offset:fe}}}}const z=[...h];for(let W=C;W<z.length-1;W++)z[W]=z[W+1];z.pop();const g={};z.forEach((W,te)=>{W&&(g[`${a.key}_${te}`]=W)});const Y=Math.max(p?z.length:z.length+1,1);l.current.querySelectorAll('[data-type="variable"]').forEach(W=>{const te=W.dataset.key,ae=W.dataset.multiKey;if(te&&ae!==a.key){const ce=W.innerText.replace(/[\u200B\n]/g,"").trim();ce&&(g[te]=ce)}}),l.current.__tempVariableValues=g,Ae(W=>({...W,[a.key]:Y}));return}if(!p){const $=m-1,z=`${a.key}_${$}`,g=l.current.querySelector(`[data-type="variable"][data-key="${z}"][data-multi-key="${a.key}"]`);if(g&&g.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&m<o){const Q=window.getSelection();if(Q&&Q.rangeCount>0){const W=Q.getRangeAt(0),te=W.startContainer,ae=te.nodeType===Node.ELEMENT_NODE?te.closest('[data-type="variable"][data-multi-key]'):te.parentElement?.closest('[data-type="variable"][data-multi-key]');if(ae){const ce=ae.dataset.key;if(ce){const de=document.createRange();de.setStartBefore(ae),de.setEnd(W.startContainer,W.startOffset);const fe=de.toString().length;re.current={key:ce,offset:fe}}}}Ae(W=>({...W,[a.key]:m+1}))}}})};c.useLayoutEffect(()=>{const r=l.current;if(!r)return;const a=new Map,o=k=>{const p=k.target,O=k.relatedTarget;!p||!l.current||!l.current.contains(p)||O&&l.current.contains(O)||setTimeout(()=>{if(l.current){if(t.length===0){const C=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";he(C.length>0);return}Ze(l),Je(l,xe,V),Qe(l,xe,V,he)}},0)};r.addEventListener("blur",o,!0);const m=()=>{if(!l.current)return;a.forEach((O,C)=>{C.removeEventListener("blur",O,!1)}),a.clear();const k=l.current.querySelectorAll('[data-type="variable"][data-multi-key]'),p=O=>{O.stopPropagation(),O.stopImmediatePropagation();const C=O.target;if(!C||!l.current||!l.current.contains(C))return;const $=C.closest('[data-type="variable"][data-multi-key]');if(!$||!l.current.contains($))return;let z=!1;if(a.forEach((de,fe)=>{(fe===$||fe.contains(C))&&(z=!0)}),!z)return;const g=$.dataset.multiKey,Y=$.dataset.key,Q=$.dataset.index;if(!g||!Y||Q===void 0)return;const W=O.relatedTarget;if(!(!W||!l.current.contains(W)))return;const ae=$.innerText.replace(/[\u200B\n]/g,"").trim(),ce=/[、,,\s]+/;if(ce.test(ae)){const pe=ae.split(ce).map(ye=>ye.trim()).filter(ye=>ye.length>0).slice(0,9);if(pe.length>1){const ye=t.find(Se=>Se.type==="multi-variable"&&Se.key===g);if(ye){const Se=Ce[g]||1,Me=parseInt(Q,10),Kt=ye.maxCount||9,dt=[];for(let we=0;we<Se;we++){const De=`${g}_${we}`,Ue=l.current.querySelector(`[data-type="variable"][data-key="${De}"][data-multi-key="${g}"]`);if(Ue){const Ke=Ue.innerText.replace(/[\u200B\n]/g,"").trim();dt.push(Ke)}}dt.splice(Me,1,...pe);const _e=dt.slice(0,Kt);_e.length>0&&_e[_e.length-1]!==""&&_e.length<Kt&&_e.push("");const Un=Math.max(_e.length,1),pt={};_e.forEach((we,De)=>{we&&(pt[`${g}_${De}`]=we)}),l.current.querySelectorAll('[data-type="variable"]').forEach(we=>{const De=we.dataset.key,Ue=we.dataset.multiKey;if(De&&Ue!==g){const Ke=we.innerText.replace(/[\u200B\n]/g,"").trim();Ke&&(pt[De]=Ke)}}),l.current.__tempVariableValues=pt,Ae(we=>({...we,[g]:Un}))}}}};k.forEach(O=>{O.addEventListener("blur",p,!1),a.set(O,p)})},h=setTimeout(()=>{m()},0);return()=>{clearTimeout(h),r.removeEventListener("blur",o,!0),a.forEach((k,p)=>{p.removeEventListener("blur",k,!1)}),a.clear()}},[t,xe,Ce,V]);const Fn=r=>{if(d){r.preventDefault();return}if(r.key==="Enter"){const o=r.target,m=!!o?.closest?.('[data-type="richtext"]'),h=o?.tagName==="TEXTAREA"||!!o?.closest?.('[data-type="textarea"]');if(!m&&!h){r.preventDefault();return}}const a=window.getSelection();if(a&&a.rangeCount>0){const o=a.anchorNode;let m=null;if(o&&(o.nodeType===Node.ELEMENT_NODE?m=o.closest('[data-type="text"]'):o.nodeType===Node.TEXT_NODE&&o.parentElement&&(m=o.parentElement.closest('[data-type="text"]'))),m){if(r.preventDefault(),r.stopPropagation(),l.current){const h=l.current.querySelector('[data-type="variable"], [data-type="upload"]');h&&h.focus()}return}}if(D&&a&&a.rangeCount>0){const o=a.anchorNode;let m=null;if(o&&(o.nodeType===Node.ELEMENT_NODE?m=o.closest(".tag-node"):o.nodeType===Node.TEXT_NODE&&o.parentElement&&(m=o.parentElement.closest(".tag-node"))),m){if(r.preventDefault(),r.stopPropagation(),l.current){const h=l.current.querySelector('[data-type="variable"], [data-type="upload"]');h&&h.focus()}return}}if(r.key==="Escape"&&l.current){if(D){r.preventDefault();return}l.current.innerHTML="",l.current.focus()}if(r.key==="Backspace"){const o=window.getSelection();if(o&&o.rangeCount>0){const m=o.getRangeAt(0),h=o.anchorNode;if(D){let p=null,O=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?(p=h.closest(".tag-node"),O=h.closest('[data-type="text"]')):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(p=h.parentElement.closest(".tag-node"),O=h.parentElement.closest('[data-type="text"]'))),(p||O)&&m.collapsed&&m.startOffset===0){r.preventDefault();return}}let k=null;if(h&&(h.nodeType===Node.ELEMENT_NODE?k=h.closest('[data-type="variable"]'):h.nodeType===Node.TEXT_NODE&&h.parentElement&&(k=h.parentElement.closest('[data-type="variable"]'))),k){if(!m.collapsed)return;const p=k.innerText;if(p===""||p===""){r.preventDefault();return}if(m.startOffset===0){r.preventDefault();return}if(p.startsWith("")&&m.startOffset===1){r.preventDefault();return}}}}},Gn=()=>{if(i||d||L||!ue||!l.current)return;if(t.length===0){const k=l.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!k)return;if(f(k,k),l.current){l.current.textContent="";const p=new Event("input",{bubbles:!0});l.current.dispatchEvent(p)}return}const r=l.current;let a="";const o={},m=k=>{if(!(k.nodeType===Node.ELEMENT_NODE&&k.style.display==="none")){if(k.nodeType===Node.TEXT_NODE)a+=(k.textContent||"").replace(/\u200B/g,"");else if(k.nodeType===Node.ELEMENT_NODE){const p=k,O=p.dataset.type,C=p.dataset.key;if(O==="variable"&&C){let $="";const z=document.createTreeWalker(p,NodeFilter.SHOW_TEXT,{acceptNode:Y=>{const Q=p.querySelector(".variable-info-icon");return Q&&Q.contains(Y)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;z.nextNode();)$+=z.currentNode.textContent||"";const g=$.replace(/[\u200B\n]/g,"").trim();if(g){const Y=p.dataset.multiKey;if(Y){(!o[Y]||!Array.isArray(o[Y]))&&(o[Y]=[]);const Q=o[Y];Q.push(g),Q.length>1&&(a+=" "),a+=g}else o[C]=g,a+=g;if(p.dataset.nodeType==="report-url")if(o.url===void 0)o.url=g;else{const Q=o.url;Array.isArray(Q)?Q.push(g):o.url=[String(Q),g]}if(p.dataset.nodeType==="markdown"){const Q=p.dataset.sourceTextKey||`${C}__sourceText`;if(o[Q]===void 0)o[Q]=g;else{const te=o[Q];Array.isArray(te)?te.push(g):o[Q]=[String(te),g]}const W=`${C}__markdown`;o[W]===void 0&&(o[W]=[At(g)])}}}else if(O==="select"&&C){const $=(p.getAttribute("data-value")||"").trim();$&&(o[C]=$,a+=$)}else if(O==="textarea"&&C){const z=(p.value||"").replace(/\u200B/g,"").trim();z&&(o[C]=z,a+=z)}else if(O==="richtext"&&C){const $=p,z=$.dataset.nodeType,g=($.textContent||"").replace(/\u200B/g,"").trim();if(g)if(z==="report-module"||z==="markdown-module"){(!o[C]||!Array.isArray(o[C]))&&(o[C]=[]);const Y=o[C];Y.push(g),Y.length>1&&(a+=" "),a+=g}else o[C]=g,a+=g}else if(O==="datepicker"&&C){const z=(p.getAttribute("data-value")||"").trim();if(z)if(z.includes(",")){const g=z.split(",");g.length===2?(o[C]=g,a+=`[${g[0]}, ${g[1]}]`):(o[C]=z,a+=z)}else o[C]=z,a+=z}else if(O==="number-input"&&C){const z=(p.value||"").trim();z&&(o[C]=z,a+=z)}else if(O==="upload"&&C){const $=p.dataset.batchKey;if($){const z=t.find(g=>g.type==="upload"&&g.key===$);if(z&&typeof z.maxCount=="number"&&typeof z.minCount=="number"){const g=[];for(let Y=0;Y<z.maxCount;Y++){const Q=`${$}-${Y}`,W=V[Q];W&&g.push(W)}o[$]||(o[$]=g.length>0?g:null,g.length>0&&(a+=` [附带${g.length}个文件: ${g.map(Y=>Y.name).join(", ")}] `))}else o[C]=V[C]??null,V[C]&&(a+=` [附带文件: ${V[C]?.name}] `)}else o[C]=V[C]??null,V[C]&&(a+=` [附带文件: ${V[C]?.name}] `)}else{if(p.classList.contains("tag-close-btn")||p.classList.contains("file-remove-btn"))return;p.getAttribute("contenteditable")==="false"&&!O&&p.classList.contains("tag-node")?a+=p.innerText:p.childNodes.forEach(m)}}}};if(r.childNodes.forEach(m),a=a.trim(),!a)return;Object.keys($e).forEach(k=>{const p=$e[k];if(!p||!p.modules||p.modules.length===0)return;const O=p.modules.map(C=>(C?.markdown||"").trim()).filter(C=>C.length>0);O.length!==0&&(o[`${k}__markdown`]=O)});const h=new FormData;h.append("fullPrompt",a),Object.keys(o).forEach(k=>{const p=o[k];if(p!=null)if(p instanceof File)h.append(k,p);else if(Array.isArray(p)){const O=t.some(g=>g.type==="multi-variable"&&g.key===k),C=t.some(g=>g.type==="report-url"&&g.key===k),$=k.endsWith("__markdown");O||C||$||k==="url"?p.forEach(g=>{g!=null&&g!==""&&h.append(k,String(g))}):p.forEach((g,Y)=>{g!=null&&(g instanceof File?h.append(`${k}[${Y}]`,g):typeof g=="string"?h.append(`${k}[${Y}]`,g):h.append(`${k}[${Y}]`,String(g)))})}else typeof p=="string"?h.append(k,p):h.append(k,String(p))}),f(h,a)},zn={...v?{width:typeof v=="number"?`${v}px`:v}:{},...j?{border:j}:{},...S?{background:S}:{},...e?{maxHeight:typeof e=="number"?`${e}px`:e}:{},...n?{minHeight:typeof n=="number"?`${n}px`:n}:{},...e?{"--rte-richtext-fullscreen-height":typeof e=="number"?`${e}px`:e}:{}},jn=typeof F=="number"&&Number.isFinite(F)&&F>=0?F:260,Wn={overflow:"hidden"},Yn={maxHeight:s?`${ke}px`:`${Math.max(Ie,ke)}px`,overflow:s||In?"hidden":"auto",transition:`max-height ${jn}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height"};return w.jsxs("div",{className:"rich-text-editor",style:zn,"data-disabled":d,ref:K,children:[ne,w.jsx("div",{className:"rich-text-editor-content",ref:R,style:Wn,children:w.jsxs("div",{ref:G,className:"rich-text-editor-content-body",style:Yn,children:[w.jsx("div",{ref:l,className:`rte-editor ${t.length===0?"rte-editor-default":""} ${me&&q?"rte-editor-empty":""}`,contentEditable:t.length===0,suppressContentEditableWarning:!0,"data-placeholder":q,onMouseDown:Pn,onMouseMove:Hn,onMouseUp:Bn,onClick:Vn,onDoubleClick:On,onInput:ut,onKeyDown:Fn,onPaste:Mn}),w.jsx("input",{type:"file",ref:_,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:Dn})]})}),w.jsxs("div",{className:"rich-text-editor-footer",children:[w.jsx("div",{className:"rich-text-editor-footer-left",children:w.jsxs("div",{className:"rich-text-editor-brand",children:[w.jsxs("div",{className:"rte-brand-badge",children:[w.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),w.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),N!=="hideAgent"&&w.jsx(oe.Dropdown,{placement:"topLeft",menu:{items:P.filter(r=>r.isShowNew!==1).map(r=>({key:r.key,label:w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[r.icon&&w.jsx("i",{className:r.icon}),w.jsx("span",{children:r.label})]}),onClick:()=>{B?.(r)}}))},trigger:["click"],disabled:d||i,overlayClassName:"rte-agent-dropdown",children:w.jsxs("div",{className:"rte-agent-badge",style:{cursor:P.length>0?"pointer":"default"},children:[w.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),w.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),w.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const r=t.find(o=>o.type==="tag");if(!r||!r.text)return null;const a=P.find(o=>o.label===r.text);return!a||a.points===void 0||a.points===null?null:w.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[w.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),w.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(a.points)]}),a.labelValue===2&&w.jsx("div",{className:"rte-limited-free-badge",children:w.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})})(),w.jsx("button",{type:"button",onClick:Gn,disabled:i||d||L||!ue,className:"rich-text-editor-send-button",children:i||L?w.jsx("span",{className:"rte-send-spinner"}):w.jsx("i",{className:"iconfont icon-fasong"})})]})]}),Z?.anchorEl&&(()=>{if(!document.body.contains(Z.anchorEl))return null;let r="",a={background:"var(--neutral-800, #262626)"};if(Z.type==="upload"){const m=Z.anchorEl.dataset.tooltip;m?r=m:r=t.find(k=>k.type==="upload"&&k.key===Z.key)?.tooltip||""}else if(Z.type==="tag")r=Z.anchorEl.dataset.tooltip||"";else if(Z.type==="upload-label")r=Z.anchorEl.querySelector(".upload-label[data-file-name]")?.dataset.fileName||Z.anchorEl.dataset.fileName||"";else if(Z.type==="variable")r=Z.anchorEl.dataset.tooltip||"";else if(Z.type==="upload-preview"){const m=V[Z.key],h=!!m&&(m.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(m.name||""));if(m&&h){const k=URL.createObjectURL(m);r=w.jsx("div",{className:"rte-upload-preview",children:w.jsx("img",{className:"rte-upload-preview-img",src:k,alt:m.name})}),a={background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},setTimeout(()=>URL.revokeObjectURL(k),1e3)}else r=""}if(!r)return null;const o=Z.type==="upload-preview"?"#0A0A0A":"#fff";return Xe.createPortal(w.jsx(oe.Tooltip,{arrow:!1,title:Z.type==="upload-preview"?r:w.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:o},children:r}),open:!0,placement:Z.type==="upload-preview"?"topLeft":"top",getPopupContainer:()=>document.body,overlayInnerStyle:a,children:w.jsx("div",{style:{position:"fixed",left:`${Z.anchorEl.getBoundingClientRect().left}px`,top:`${Z.anchorEl.getBoundingClientRect().top-(Z.type==="upload-label"?4:0)}px`,width:`${Z.anchorEl.offsetWidth}px`,height:`${Z.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)})(),it,lt]})};Nt.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const _t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",kn=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],$n=({autoLoading:t,batchSize:f,loadingProgress:i,loadIcon:d,onBatchSizeChange:v,onLoadNextPage:D,onStartAutoLoad:P,onStopLoad:B})=>t&&i?w.jsxs("div",{className:"auto_load_progress",children:[d||w.jsx("img",{src:_t,alt:"自动加载",width:14,height:14}),w.jsxs("span",{children:["正在加载第",i.currentPage,"/",i.totalPages,"页"]}),w.jsx(oe.Progress,{percent:i.percentage,type:"line",size:[160,8]}),w.jsx("span",{onClick:B,className:"auto_load_stop_btn",children:"停止加载"})]}):w.jsxs("div",{className:"auto_load_container",children:[w.jsx("div",{onClick:D,className:"auto_load_next_btn",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:"加载下一页"}),w.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:t?"#f5f5f5":"#2563eb"},children:[w.jsxs("div",{className:"auto_load_btn",onClick:t?void 0:P,children:[d||w.jsx("img",{src:_t,alt:"自动加载",width:14,height:14}),w.jsx("span",{children:"自动加载"})]}),w.jsx(oe.Select,{value:f,onChange:v,options:kn,disabled:t,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),En=({current:t,loadIcon:f,pageSize:i,total:d,cachedPages:v,loadedCount:D,autoLoading:P=!1,loadingProgress:B,onChange:M,onLoadNextPage:L,onStartAutoLoad:q,onStopLoading:j})=>{const[S,N]=c.useState(5),e=Math.ceil(d/i),n=c.useMemo(()=>v.length>=e,[v,e]),s=()=>Array.from({length:e},(H,F)=>F+1).filter(H=>!v.includes(H)).slice(0,S),u=(E,H,F)=>{const T=v.includes(E);return H==="prev"||H==="next"||H==="jump-prev"||H==="jump-next"?w.jsx("div",{className:"pageBox",children:F}):w.jsxs("div",{className:"pageBox",style:{backgroundColor:t===E?"#2563EB":"#f5f5f5",color:t===E?"#fff":T?"#171717":"#a3a3a3"},children:[E,!T&&w.jsx("span",{className:"unload_spot"})]})};return w.jsxs("div",{className:"pagination_footer",children:[w.jsxs("div",{className:"pagination_leftWrap",children:[w.jsxs("span",{className:"pagination_total",children:[w.jsx(Te.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",D,"/",d,"条数据"]}),!n&&w.jsx($n,{loadIcon:f||void 0,autoLoading:P,batchSize:S,loadingProgress:B,disabled:!L||!q,onBatchSizeChange:N,onLoadNextPage:()=>L?.(),onStartAutoLoad:()=>{const E=s();q?.(E)},onStopLoad:()=>j?.()})]}),w.jsx(oe.Pagination,{current:t,pageSize:i,total:d,onChange:E=>M(E),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:u})]})},Lt=t=>{const{loading:f,autoLoading:i,loadingProgress:d,columns:v=[],dataSource:D=[],total:P,current:B,pageSize:M,cachedPages:L,onChangePage:q,onLoadNextPage:j,onStartAutoLoad:S,onStopLoading:N,...e}=t,n=c.useRef(null),s=c.useCallback(u=>{q(u),L.includes(u)&&n.current?.scrollTo({key:`${(u-1)*M+1}`})},[L,q,M]);return w.jsxs("div",{className:"flex flex-col",children:[w.jsx(oe.Table,{ref:n,...e,columns:v,dataSource:D,pagination:!1,virtual:!0}),w.jsx(En,{loading:f,autoLoading:i,loadingProgress:d,current:B,pageSize:M,total:P,loadedCount:D.length,cachedPages:L,onChange:s,onLoadNextPage:j,onStartAutoLoad:S,onStopLoading:N})]})};Lt.__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 It=({texts:t=[],placeholder:f="请输入内容",animationSpeed:i=100,autoPlay:d=!0,value:v,onChange:D,...P})=>{const[B,M]=c.useState(""),[L,q]=c.useState(0),[j,S]=c.useState(!1),[N,e]=c.useState(!1),[n,s]=c.useState(!1),u=c.useRef(void 0),E=c.useRef(void 0),H=c.useRef(t),F=c.useRef(L),T=c.useRef(N),ne=c.useRef(B);c.useEffect(()=>{H.current=t,F.current=L,T.current=N,ne.current=B});const K=c.useCallback((y,b)=>{let x=0;s(!0);const I=()=>{x<y.length?(M(y.slice(0,x+1)),x++,E.current=window.setTimeout(I,i)):(s(!1),b?.())};I()},[i]),R=c.useCallback(y=>{let b=ne.current.length;const x=()=>{b>0?(M(ne.current.slice(0,b-1)),b--,E.current=window.setTimeout(x,i/2)):y?.()};x()},[i]),G=c.useCallback(()=>{if(H.current.length===0||T.current)return;S(!0);const y=H.current[F.current];ne.current?R(()=>{K(y,()=>{u.current=window.setTimeout(()=>{q(b=>(b+1)%H.current.length),S(!1)},2e3)})}):K(y,()=>{u.current=window.setTimeout(()=>{q(b=>(b+1)%H.current.length),S(!1)},2e3)})},[R,K]);c.useEffect(()=>(d&&t.length>0&&!N&&G(),()=>{u.current&&window.clearTimeout(u.current),E.current&&window.clearTimeout(E.current)}),[L,N,d,t.length,G]),c.useEffect(()=>{!j&&d&&t.length>0&&!N&&G()},[L,j,d,t.length,N,G]);const l=y=>{e(!0),u.current&&window.clearTimeout(u.current),E.current&&window.clearTimeout(E.current),S(!1),s(!1),P.onFocus?.(y)},_=y=>{e(!1),!v&&t.length>0&&(M(""),q(0)),P.onBlur?.(y)},U=y=>{D?.(y.target.value),P.onChange?.(y)},V=()=>N||v?f:B||f;return w.jsxs("div",{style:{position:"relative"},children:[w.jsx(oe.Input,{...P,value:v,onChange:U,onFocus:l,onBlur:_,placeholder:V(),style:{...P.style,position:"relative",zIndex:1}}),!N&&!v&&B&&w.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:[w.jsx("span",{children:B}),n&&w.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),w.jsx("style",{children:`
|
|
38
|
+
font-size: ${X.fontSize||"16px"};
|
|
39
|
+
font-family: ${X.fontFamily||"inherit"};
|
|
40
|
+
font-weight: ${X.fontWeight||"inherit"};
|
|
41
|
+
letter-spacing: ${X.letterSpacing||"normal"};
|
|
42
|
+
padding-left: ${oe}px;
|
|
43
|
+
padding-right: ${pe}px;
|
|
44
|
+
`,ie.textContent=re||"0",document.body.appendChild(ie);const me=Math.max(24,Math.min(600,ie.offsetWidth+8));return document.body.removeChild(ie),me},j=ae=>{const re=ae.target;if(!re)return;let X=re.value;if(X=X.replace(/[^\d]/g,""),X!==""&&X!=="0"){const oe=parseInt(X,10);if(Number.isNaN(oe))re.value="";else{const pe=re.getAttribute("min"),ie=re.getAttribute("max"),me=pe!==null?parseInt(pe,10):0,Se=ie!==null?parseInt(ie,10):1/0,Le=Math.min(Math.max(oe,me),Se);re.value=String(Le)}}else if(X==="0"){const oe=re.getAttribute("min");0<(oe!==null?parseInt(oe,10):0)?re.value="":re.value="0"}re.style.width=`${B(re)}px`},G=ae=>{const re=ae.key;(re==="-"||re==="."||re===","||re==="e"||re==="E"||re==="+"||re==="="||re===" ")&&ae.preventDefault()},W=()=>{if(!y.current)return;y.current.querySelectorAll('[data-type="number-input"]').forEach(re=>{const X=document.activeElement===re,oe=B(re),pe=Number.parseFloat(re.style.width||""),ie=Number.isFinite(pe),me=ie?Math.abs(pe-oe):1/0;!X&&(!ie||me>1)&&(re.style.width=`${oe}px`),D.has(re)||(re.addEventListener("input",j,!1),re.addEventListener("keydown",G,!1),D.set(re,j),R.set(re,G))})};W();let q=null;const Z=()=>{q===null&&(q=window.requestAnimationFrame(()=>{q=null,W()}))},ee=new MutationObserver(ae=>{let re=!1;ae.forEach(X=>{X.type==="childList"&&X.addedNodes.forEach(oe=>{if(oe.nodeType===Node.ELEMENT_NODE){const pe=oe;pe.matches&&(pe.matches('[data-type="number-input"]')||pe.querySelector('[data-type="number-input"]'))&&(re=!0)}})}),re&&Z()});return y.current&&ee.observe(y.current,{childList:!0,subtree:!0}),()=>{q!==null&&(window.cancelAnimationFrame(q),q=null),ee.disconnect(),D.forEach((ae,re)=>{re.removeEventListener("input",ae,!1)}),D.clear(),R.forEach((ae,re)=>{re.removeEventListener("keydown",ae,!1)}),R.clear()}},[Qe]),EE(y,Qe,I,a,kt,ne,void 0,p),bE(y,Qe,I,lt,N),TE(y,Qe,lt,p,N),xE(y,Qe,I,lt,N),yE(y,Qe,lt,N),AE(y,Qe,I,qt),CE(y,Ut);const Ea=mE(y);P.useEffect(()=>{if(!y.current)return;y.current.querySelectorAll(".rte-richtext-toggle").forEach(R=>{const B=R.getAttribute("data-expanded")==="true";R.innerHTML=B?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})},[Qe,y]);const ba=RE(y),Ta=P.useCallback(()=>{const D=H.current;if(!D)return;const R=Math.max(0,Math.ceil(D.scrollHeight||0));!Number.isFinite(R)||R<=0||ht(B=>B===R?B:R)},[]);P.useLayoutEffect(()=>{if(!b)return;const D=w.current,R=y.current;if(!(!D||!R))try{const B=window.getComputedStyle(R),j=Number.parseFloat(B.paddingTop)||0,G=Number.parseFloat(B.lineHeight)||34,W=Math.max(0,Math.ceil(j+G)),q=R.getBoundingClientRect(),Z=document.createRange();Z.selectNodeContents(R);const ee=Array.from(Z.getClientRects());let ae=W>0?W:58;if(ee.length>0){const re=Math.min(...ee.map(pe=>pe.top)),X=2;let oe=0;for(const pe of ee)Math.abs(pe.top-re)<=X&&(oe=Math.max(oe,pe.bottom));if(oe>0){const pe=Math.max(0,Math.ceil(oe-q.top));ae=W>0?Math.max(pe,W):pe}}else ae=W>0?W:58;if(!Number.isFinite(ae)||ae<=0)return;at(re=>re===ae?re:ae)}catch{}},[b,Qe,I,kt,Ea.length,ba.length]);const Ur=P.useRef({ts:0,contentScrollTop:0,bodyScrollTop:0,editorScrollTop:0});P.useEffect(()=>{if(b)return;const D=w.current,R=H.current,B=y.current;if(!D)return;const j=()=>{Ur.current={ts:Date.now(),contentScrollTop:D.scrollTop||0,bodyScrollTop:R?.scrollTop||0,editorScrollTop:B?.scrollTop||0}};j();const G=()=>{j(),console.log(`[RTE collapse debug][${U.current}] (expanded) content scroll`,Ur.current)},W=()=>{j(),console.log(`[RTE collapse debug][${U.current}] (expanded) body scroll`,Ur.current)};return D.addEventListener("scroll",G,{passive:!0}),R?.addEventListener("scroll",W,{passive:!0}),()=>{D.removeEventListener("scroll",G),R?.removeEventListener("scroll",W)}},[b]),P.useEffect(()=>{if(typeof window>"u")return;const D=U.current,R=window;return R.__rteDebug=R.__rteDebug||{},R.__rteDebug[D]={contentEl:w.current,contentBodyEl:H.current,editorEl:y.current},()=>{R.__rteDebug&&R.__rteDebug[D]&&delete R.__rteDebug[D]}},[]),P.useLayoutEffect(()=>{if(!b)return;const D=w.current,R=H.current,B=y.current;if(!D)return;const j=()=>({content:{scrollTop:D.scrollTop,scrollLeft:D.scrollLeft,scrollHeight:D.scrollHeight,clientHeight:D.clientHeight},body:R?{scrollTop:R.scrollTop,scrollLeft:R.scrollLeft,scrollHeight:R.scrollHeight,clientHeight:R.clientHeight}:void 0,editor:B?{scrollTop:B.scrollTop,scrollLeft:B.scrollLeft,scrollHeight:B.scrollHeight,clientHeight:B.clientHeight}:void 0,style:(()=>{try{const ie=window.getComputedStyle(D),me=R?window.getComputedStyle(R):void 0;return{contentOverflow:`${ie.overflow}/${ie.overflowY}`,bodyOverflow:me?`${me.overflow}/${me.overflowY}`:void 0,bodyMaxHeight:me?.maxHeight,bodyHeight:me?.height}}catch{return}})()}),G=()=>{D.scrollTop=0,D.scrollLeft=0,R&&(R.scrollTop=0,R.scrollLeft=0),B&&(B.scrollTop=0,B.scrollLeft=0)},q=(typeof v=="number"&&Number.isFinite(v)&&v>=0?v:260)+220;console.log(`[RTE collapse debug][${U.current}] pre-collapse lastScrollStateRef`,Ur.current),console.log(`[RTE collapse debug][${U.current}] lock start (before reset)`,j()),G(),console.log(`[RTE collapse debug][${U.current}] lock start (after reset)`,j()),window.requestAnimationFrame(()=>{console.log(`[RTE collapse debug][${U.current}] lock start (after rAF)`,j())});const Z=ie=>{ie.preventDefault(),ie.stopPropagation(),G(),console.log(`[RTE collapse debug][${U.current}] prevented scroll event`,{type:ie.type},j())},ee=()=>console.log(`[RTE collapse debug][${U.current}] content scroll event`,j()),ae=()=>console.log(`[RTE collapse debug][${U.current}] body scroll event`,j());D.addEventListener("wheel",Z,{passive:!1}),D.addEventListener("touchmove",Z,{passive:!1}),D.addEventListener("scroll",ee,{passive:!0}),R&&(R.addEventListener("wheel",Z,{passive:!1}),R.addEventListener("touchmove",Z,{passive:!1}),R.addEventListener("scroll",ae,{passive:!0}));const re=performance.now();let X=0;const oe=ie=>{G(),ie-re<q&&(X=window.requestAnimationFrame(oe))};X=window.requestAnimationFrame(oe);const pe=window.setTimeout(()=>{G(),console.log(`[RTE collapse debug][${U.current}] lock end (after timeout)`,j())},q);return()=>{D.removeEventListener("wheel",Z),D.removeEventListener("touchmove",Z),D.removeEventListener("scroll",ee),R&&(R.removeEventListener("wheel",Z),R.removeEventListener("touchmove",Z),R.removeEventListener("scroll",ae)),window.cancelAnimationFrame(X),window.clearTimeout(pe),console.log(`[RTE collapse debug][${U.current}] lock cleanup`,j())}},[b,v]),P.useEffect(()=>{if(b)return;let D=0;return D=window.requestAnimationFrame(()=>{Ta()}),()=>window.cancelAnimationFrame(D)},[b,Qe,I,kt,Ea.length,ba.length,Ta]),P.useEffect(()=>{const D=typeof v=="number"&&Number.isFinite(v)&&v>=0?v:260;if(D<=0){_t(!1);return}_t(!0);const R=window.setTimeout(()=>_t(!1),D);return()=>window.clearTimeout(R)},[b,v]),P.useEffect(()=>{if(e.length>0){Ee(!1);return}const D=()=>{if(!y.current){Ee(!0);return}const B=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"",j=y.current.querySelectorAll('[data-type="variable"]'),G=y.current.querySelectorAll('[data-type="upload"]');let W=!1;j.forEach(Z=>{(Z.textContent?.replace(/[\u200B\n]/g,"").trim()||"")&&(W=!0)}),G.forEach(Z=>{Z.querySelector(".upload-inner-wrapper.has-file")&&(W=!0)});const q=!B&&!W;Ee(q),e.length===0&&qt(!q)};D();const R=new MutationObserver(D);return y.current&&R.observe(y.current,{childList:!0,subtree:!0,characterData:!0}),()=>{R.disconnect()}},[e]);const jE=D=>{if(r){D.preventDefault();return}D.preventDefault();const R=D.clipboardData.getData("text/plain"),B=window.getSelection();if(B&&B.rangeCount>0){const q=B.anchorNode;if(q){let Z=null;if(q.nodeType===Node.ELEMENT_NODE?Z=q.closest('[data-type="variable"]'):q.nodeType===Node.TEXT_NODE&&q.parentElement&&(Z=q.parentElement.closest('[data-type="variable"]')),Z){const ee=Z.dataset.multiKey;if(ee){const ae=/[、,,\s\n\r\t]+/,re=R.split(ae).map(X=>X.trim()).filter(X=>X.length>0);if(re.length>1){const X=parseInt(Z.dataset.index||"0",10),oe=e.find(He=>He.type==="multi-variable"&&He.key===ee)?.maxCount||9,pe=kt[ee]||1,ie=Math.min(X+re.length,oe);ie>pe&&zt(Me=>({...Me,[ee]:ie}));const me=[];for(let Me=0;Me<pe;Me++){const He=`${ee}_${Me}`,vt=y.current.querySelector(`[data-type="variable"][data-key="${He}"][data-multi-key="${ee}"]`);if(vt){const xn=vt.innerText.replace(/[\u200B\n]/g,"").trim();me.push(xn)}}me.splice(X,1,...re.slice(0,oe-X));const Se=me.slice(0,oe);Se.length>0&&Se[Se.length-1]!==""&&Se.length<oe&&Se.push("");const Le=Math.max(Se.length,1),Pe={};Se.forEach((Me,He)=>{Me&&(Pe[`${ee}_${He}`]=Me)}),y.current.querySelectorAll('[data-type="variable"]').forEach(Me=>{const He=Me.dataset.key,vt=Me.dataset.multiKey;if(He&&vt!==ee){const xn=Me.innerText.replace(/[\u200B\n]/g,"").trim();xn&&(Pe[He]=xn)}}),y.current.__tempVariableValues=Pe,zt(Me=>({...Me,[ee]:Le}));return}}}}}let j=!1,G="";const W=window.getSelection();if(W&&W.rangeCount>0){const q=W.anchorNode;if(q){let Z=null;if(q.nodeType===Node.ELEMENT_NODE?Z=q.closest('[data-type="variable"]'):q.nodeType===Node.TEXT_NODE&&q.parentElement&&(Z=q.parentElement.closest('[data-type="variable"]')),Z){const ee=Z.getAttribute("data-node-type")||"",ae=Z.dataset.key;if(ee==="markdown"&&ae&&/20\d{2}-\d{2}-\d{2}/.test(R))j=!0,G=ae,ll.current[ae]=R,Nt(re=>({...re,[ae]:{...re[ae],status:"loading",error:void 0}}));else if(ee==="report-url"&&ae){document.execCommand("insertText",!1,R),ya(),setTimeout(()=>{const re=Z.innerText.replace(/[\u200B\n]/g,"").trim();st.current(ae,re)},0);return}}}}if(j&&G){setTimeout(()=>{Hr.current(G,R)},0);return}document.execCommand("insertText",!1,R),ya(),setTimeout(()=>{/20\d{2}-\d{2}-\d{2}/.test(R)&&pa.current.tableData?.status==="success"&&(Nt(Z=>({...Z,tableData:{status:"loading",modules:[],lastParsedText:R,error:void 0}})),setTimeout(()=>{ll.current.tableData=R,Hr.current("tableData",R)},0))},0)},XE=D=>{if(!D.target.files){D.target&&(D.target.value=""),Q(null),te(null),fe(null);return}const R=10*1024*1024,B=G=>G.type?.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(G.name||""),j=G=>B(G)&&G.size>R;if(z&&D.target.files&&D.target.files.length>0){const G=z,W=e.find(ae=>ae.type==="upload"&&ae.key===G),q=Array.from(D.target.files),Z=q.filter(ae=>!j(ae)),ee=q.length-Z.length;if(ee>0&&F.error(`已自动过滤 ${ee} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`),W&&typeof W.maxCount=="number"&&typeof W.minCount=="number"){const ae=W.maxCount,re=typeof S=="number"?S:0;T(X=>{const oe={...X};let pe=Math.min(Math.max(re,0),ae-1);for(const ie of Z){for(;pe<ae&&oe[`${G}-${pe}`]!=null;)pe+=1;if(pe>=ae)break;oe[`${G}-${pe}`]=ie,pe+=1}return oe})}}else if($&&D.target.files[0]){const G=D.target.files[0],W=$;j(G)?F.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)"):T(q=>({...q,[W]:G}))}D.target&&(D.target.value=""),Q(null),te(null),fe(null)},El=D=>{T(R=>{const B={...R};return delete B[D],B})},KE=D=>{const R=D.target;if(R.closest(".rte-datepicker-wrapper")||R.closest(".rte-datepicker-host")||R.closest(".rte-select-wrapper")||R.closest(".rte-select-host")||R.closest(".ant-select-dropdown"))return;if(R.closest(".tag-close-btn")){if(D.preventDefault(),D.stopPropagation(),a)return;lt(null),o?o():y.current&&(y.current.innerHTML="",y.current.focus());return}if(a){const G=R.closest(".tag-node"),W=R.closest('[data-type="text"]');if(G||W){D.preventDefault(),D.stopPropagation();const q=window.getSelection();q&&q.removeAllRanges();return}}R.closest('[data-type="variable"]')||($t.current={x:D.clientX,y:D.clientY},Ut.current=!1,R.closest(".file-remove-btn")&&(D.preventDefault(),D.stopPropagation()))},QE=D=>{if(!D.target.closest('[data-type="variable"]')&&$t.current){const j=Math.abs(D.clientX-$t.current.x),G=Math.abs(D.clientY-$t.current.y);(j>3||G>3)&&(Ut.current=!0)}},JE=D=>{if(D.target.closest('[data-type="variable"]')){$t.current=null,Ut.current=!1;return}$t.current=null,Ut.current=!1},ZE=D=>{if(r)return;b&&A?.(!1);const R=D.target;if(R.closest('[data-type="datepicker"]'))return;if(R.closest(".tag-close-btn")){D.preventDefault(),D.stopPropagation();return}if(e.length===0)return;const G=(X,oe)=>{if(!y.current)return;Array.from(y.current.children).forEach(ie=>{if(ie!==X)if(oe)ie.dataset.prevDisplay===void 0&&(ie.dataset.prevDisplay=ie.style.display||""),ie.dataset.rteForceHidden="1",ie.style.setProperty("display","none","important");else{if(ie.dataset.prevDisplay!==void 0){const me=ie.dataset.prevDisplay;me?ie.style.display=me:ie.style.removeProperty("display"),delete ie.dataset.prevDisplay}else ie.style.removeProperty("display");delete ie.dataset.rteForceHidden}})},W=R.closest(".rte-textarea-toggle");if(W){D.preventDefault(),D.stopPropagation();const X=W.closest(".rte-textarea-wrapper"),oe=X?.querySelector('[data-type="textarea"]'),ie=!(W.getAttribute("data-expanded")==="true");W.setAttribute("data-expanded",String(ie)),W.textContent=ie?"收起":"展开",X&&X.classList.toggle("rte-textarea-expanded",ie);const me=X?.closest(".rte-textarea-required");if(me?me.classList.toggle("rte-textarea-overlay",ie):X&&X.classList.toggle("rte-textarea-overlay",ie),oe)if(ie)oe.classList.add("rte-textarea-expanded"),oe.style.maxHeight="none",oe.style.height="100%";else{oe.classList.remove("rte-textarea-expanded");const Se=oe.dataset.maxHeight||"252";oe.style.maxHeight=`${Se}px`,oe.style.height="auto"}y.current&&(ie?y.current.classList.add("rte-overlay-active"):y.current.classList.remove("rte-overlay-active"));return}const q=R.closest(".rte-richtext-toggle");if(q){D.preventDefault(),D.stopPropagation();const X=q.closest(".rte-richtext-wrapper"),oe=X?.querySelector('[data-type="richtext"]'),ie=!(q.getAttribute("data-expanded")==="true");((Pe,Fe)=>{Pe.setAttribute("data-expanded",String(Fe)),Pe.innerHTML=Fe?'<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>':'<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>'})(q,ie);const Se=X?.closest(".rte-richtext-required");Se?Se.classList.toggle("rte-richtext-expanded",ie):X&&X.classList.toggle("rte-richtext-expanded",ie);const Le=X?.closest(".exclusion-wrapper")||X?.parentElement;if(oe&&(ie?(oe.style.height="100%",oe.style.overflow="auto"):(oe.style.height="",oe.style.overflow="")),Le&&(Le.classList.toggle("rte-richtext-host-expanded",ie),G(Le,ie)),y.current){if(y.current.classList.toggle("rte-richtext-fullscreen-active",ie),O.current?.classList.toggle("rte-richtext-container-expanded",ie),O.current)if(ie){const Pe=Math.ceil(O.current.getBoundingClientRect().height||0);Pe>0&&O.current.style.setProperty("--rte-richtext-fullscreen-height",`${Pe}px`)}else O.current.style.removeProperty("--rte-richtext-fullscreen-height");if(ie)Ce.current=y.current.scrollTop||0,setTimeout(()=>{y.current&&(y.current.scrollTop=0,y.current.scrollLeft=0)},0);else{const Pe=Ce.current||0;setTimeout(()=>{y.current&&(y.current.scrollTop=Pe)},0)}}return}if(R.closest('[data-type="text"]')){D.preventDefault(),D.stopPropagation();const X=window.getSelection();X&&X.removeAllRanges();return}if(a&&R.closest(".tag-node")){D.preventDefault(),D.stopPropagation();const oe=window.getSelection();oe&&oe.removeAllRanges();return}if(R.closest('[data-type="variable"]')){if(Ut.current)return;setTimeout(()=>{const X=window.getSelection();X&&!X.isCollapsed||ca(y)},10);return}const ae=R.closest(".file-remove-btn");if(ae){D.preventDefault(),D.stopPropagation();const X=ae.closest('[data-type="upload"]'),oe=X?.dataset.key,pe=X?.dataset.batchKey;if(oe)if(pe){const ie=e.find(me=>me.type==="upload"&&me.key===pe);if(ie&&typeof ie.maxCount=="number"&&typeof ie.minCount=="number"){const me=ie.maxCount;T(Se=>{const Le={...Se},Pe=[];for(let Fe=0;Fe<me;Fe++){const Me=`${pe}-${Fe}`,He=Le[Me];He!=null&&Me!==oe&&Pe.push(He)}for(let Fe=0;Fe<me;Fe++)delete Le[`${pe}-${Fe}`];return Pe.forEach((Fe,Me)=>{Le[`${pe}-${Me}`]=Fe}),Le})}else El(oe)}else El(oe);return}const re=R.closest('[data-type="upload"]');if(re){const X=re.dataset.key,oe=re.dataset.batchKey,pe=re.dataset.batchIndex;if(X){const ie=oe||X,me=e.find(Se=>Se.type==="upload"&&Se.key===ie);if(M.current&&(me?.accept?M.current.accept=me.accept:me?.acceptType==="image"?M.current.accept="image/*":me?.acceptType==="file"?M.current.accept=".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json":M.current.accept=""),oe){const Se=e.find(Le=>Le.type==="upload"&&Le.key===oe);if(Se&&typeof Se.maxCount=="number"&&typeof Se.minCount=="number"){const Le=Se.maxCount,Pe=I[X]!=null,Fe=pe!=null?Number.parseInt(pe,10):NaN;if(Pe){M.current&&(M.current.multiple=!1),te(null),fe(null),Q(X),M.current?.click();return}let Me=0;for(let He=0;He<Le;He++)I[`${oe}-${He}`]!=null&&(Me+=1);Me<Le&&M.current?(M.current.multiple=!0,te(oe),fe(Number.isFinite(Fe)?Fe:null),Q(null),M.current.click()):(M.current&&(M.current.multiple=!1),te(null),fe(null),Q(X),M.current?.click())}else M.current&&(M.current.multiple=!1),te(null),fe(null),Q(X),M.current?.click()}else M.current&&(M.current.multiple=!1),te(null),fe(null),Q(X),M.current?.click()}return}},eb=D=>{const B=D.target.closest('[data-type="variable"]');if(B){const j=window.getSelection();if(j){const G=document.createRange(),W=B.textContent||"";if(W.replace(/\u200B/g,"")){let Z=0,ee=W.length;W.startsWith("")&&(Z=1),W.endsWith("")&&W.length>1&&(ee=W.length-1);const ae=B.firstChild;ae&&ae.nodeType===Node.TEXT_NODE?(G.setStart(ae,Z),G.setEnd(ae,ee)):G.selectNodeContents(B)}else G.selectNodeContents(B),G.collapse(!0);j.removeAllRanges(),j.addRange(G)}}},ya=()=>{if(e.length===0){if(y.current){const B=!(y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"");Ee(B),qt(!B)}return}if(ca(y),y.current&&y.current.querySelectorAll('[data-type="variable"][data-node-type="report-url"]').forEach(B=>{const j=B.dataset.key;if(!j)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||ct(W=>{const q=W[j];return!q||q.status==="idle"&&(!q.modules||q.modules.length===0)?W:{...W,[j]:{status:"idle",modules:[],lastParsedUrl:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="variable"][data-node-type="markdown"]').forEach(B=>{const j=B.dataset.key;if(!j)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||Nt(W=>{const q=W[j];return!q||q.status==="idle"&&(!q.modules||q.modules.length===0)?W:{...W,[j]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="richtext"][data-node-type="markdown-module"]').forEach(B=>{const j=B.dataset.key;if(!j)return;B.innerText.replace(/[\u200B\n]/g,"").trim()||Nt(W=>{const q=W[j];return!q||q.status==="idle"?W:{...W,[j]:{status:"idle",modules:[],lastParsedText:void 0,error:void 0}}})}),y.current&&y.current.querySelectorAll('[data-type="variable"]').forEach(B=>{const j=B.querySelector(".variable-info-icon");if(j){let G=!1;const W=document.createTreeWalker(B,NodeFilter.SHOW_TEXT,{acceptNode:q=>j.contains(q)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});for(;W.nextNode();)if(W.currentNode.textContent?.replace(/[\u200B\n]/g,"").trim()){G=!0;break}G?j.classList.add("hidden"):j.classList.remove("hidden")}}),b||window.requestAnimationFrame(()=>{Ta()}),ua(y,Qe,I),la(y,Qe,I,qt),!y.current)return;e.filter(R=>R.type==="multi-variable"&&R.key).forEach(R=>{if(!R.key)return;const B=R.maxCount||9,j=kt[R.key]||1,G=[];for(let ae=0;ae<j;ae++){const re=`${R.key}_${ae}`,X=y.current.querySelector(`[data-type="variable"][data-key="${re}"][data-multi-key="${R.key}"]`);if(X){const oe=X.innerText.replace(/[\u200B\n]/g,"").trim();G.push(oe)}}const q=(G[G.length-1]||"")==="";let Z=!1,ee=-1;for(let ae=0;ae<G.length-1;ae++)if(G[ae]===""){Z=!0,ee=ae;break}if(Z&&ee>=0){const ae=window.getSelection();if(ae&&ae.rangeCount>0){const ie=ae.getRangeAt(0),me=ie.startContainer,Se=me.nodeType===Node.ELEMENT_NODE?me.closest('[data-type="variable"][data-multi-key]'):me.parentElement?.closest('[data-type="variable"][data-multi-key]');if(Se){const Le=Se.dataset.key;if(Le){const Pe=document.createRange();Pe.setStartBefore(Se),Pe.setEnd(ie.startContainer,ie.startOffset);const Fe=Pe.toString().length;ne.current={key:Le,offset:Fe}}}}const re=[...G];for(let ie=ee;ie<re.length-1;ie++)re[ie]=re[ie+1];re.pop();const X={};re.forEach((ie,me)=>{ie&&(X[`${R.key}_${me}`]=ie)});const oe=Math.max(q?re.length:re.length+1,1);y.current.querySelectorAll('[data-type="variable"]').forEach(ie=>{const me=ie.dataset.key,Se=ie.dataset.multiKey;if(me&&Se!==R.key){const Le=ie.innerText.replace(/[\u200B\n]/g,"").trim();Le&&(X[me]=Le)}}),y.current.__tempVariableValues=X,zt(ie=>({...ie,[R.key]:oe}));return}if(!q){const ae=j-1,re=`${R.key}_${ae}`,X=y.current.querySelector(`[data-type="variable"][data-key="${re}"][data-multi-key="${R.key}"]`);if(X&&X.innerText.replace(/[\u200B\n]/g,"").trim().length>0&&j<B){const pe=window.getSelection();if(pe&&pe.rangeCount>0){const ie=pe.getRangeAt(0),me=ie.startContainer,Se=me.nodeType===Node.ELEMENT_NODE?me.closest('[data-type="variable"][data-multi-key]'):me.parentElement?.closest('[data-type="variable"][data-multi-key]');if(Se){const Le=Se.dataset.key;if(Le){const Pe=document.createRange();Pe.setStartBefore(Se),Pe.setEnd(ie.startContainer,ie.startOffset);const Fe=Pe.toString().length;ne.current={key:Le,offset:Fe}}}}zt(ie=>({...ie,[R.key]:j+1}))}}})};P.useLayoutEffect(()=>{const D=y.current;if(!D)return;const R=new Map,B=W=>{const q=W.target,Z=W.relatedTarget;!q||!y.current||!y.current.contains(q)||Z&&y.current.contains(Z)||setTimeout(()=>{if(y.current){if(e.length===0){const ee=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";qt(ee.length>0);return}ca(y),ua(y,Qe,I),la(y,Qe,I,qt)}},0)};D.addEventListener("blur",B,!0);const j=()=>{if(!y.current)return;R.forEach((Z,ee)=>{ee.removeEventListener("blur",Z,!1)}),R.clear();const W=y.current.querySelectorAll('[data-type="variable"][data-multi-key]'),q=Z=>{Z.stopPropagation(),Z.stopImmediatePropagation();const ee=Z.target;if(!ee||!y.current||!y.current.contains(ee))return;const ae=ee.closest('[data-type="variable"][data-multi-key]');if(!ae||!y.current.contains(ae))return;let re=!1;if(R.forEach((Pe,Fe)=>{(Fe===ae||Fe.contains(ee))&&(re=!0)}),!re)return;const X=ae.dataset.multiKey,oe=ae.dataset.key,pe=ae.dataset.index;if(!X||!oe||pe===void 0)return;const ie=Z.relatedTarget;if(!(!ie||!y.current.contains(ie)))return;const Se=ae.innerText.replace(/[\u200B\n]/g,"").trim(),Le=/[、,,\s]+/;if(Le.test(Se)){const Me=Se.split(Le).map(He=>He.trim()).filter(He=>He.length>0).slice(0,9);if(Me.length>1){const He=e.find(vt=>vt.type==="multi-variable"&&vt.key===X);if(He){const vt=kt[X]||1,xn=parseInt(pe,10),bl=He.maxCount||9,xa=[];for(let dt=0;dt<vt;dt++){const An=`${X}_${dt}`,$r=y.current.querySelector(`[data-type="variable"][data-key="${An}"][data-multi-key="${X}"]`);if($r){const qr=$r.innerText.replace(/[\u200B\n]/g,"").trim();xa.push(qr)}}xa.splice(xn,1,...Me);const en=xa.slice(0,bl);en.length>0&&en[en.length-1]!==""&&en.length<bl&&en.push("");const ob=Math.max(en.length,1),Aa={};en.forEach((dt,An)=>{dt&&(Aa[`${X}_${An}`]=dt)}),y.current.querySelectorAll('[data-type="variable"]').forEach(dt=>{const An=dt.dataset.key,$r=dt.dataset.multiKey;if(An&&$r!==X){const qr=dt.innerText.replace(/[\u200B\n]/g,"").trim();qr&&(Aa[An]=qr)}}),y.current.__tempVariableValues=Aa,zt(dt=>({...dt,[X]:ob}))}}}};W.forEach(Z=>{Z.addEventListener("blur",q,!1),R.set(Z,q)})},G=setTimeout(()=>{j()},0);return()=>{clearTimeout(G),D.removeEventListener("blur",B,!0),R.forEach((W,q)=>{q.removeEventListener("blur",W,!1)}),R.clear()}},[e,Qe,kt,I]);const tb=D=>{if(r){D.preventDefault();return}if(D.key==="Enter"){const B=D.target,j=!!B?.closest?.('[data-type="richtext"]'),G=B?.tagName==="TEXTAREA"||!!B?.closest?.('[data-type="textarea"]');if(!j&&!G){D.preventDefault();return}}const R=window.getSelection();if(R&&R.rangeCount>0){const B=R.anchorNode;let j=null;if(B&&(B.nodeType===Node.ELEMENT_NODE?j=B.closest('[data-type="text"]'):B.nodeType===Node.TEXT_NODE&&B.parentElement&&(j=B.parentElement.closest('[data-type="text"]'))),j){if(D.preventDefault(),D.stopPropagation(),y.current){const G=y.current.querySelector('[data-type="variable"], [data-type="upload"]');G&&G.focus()}return}}if(a&&R&&R.rangeCount>0){const B=R.anchorNode;let j=null;if(B&&(B.nodeType===Node.ELEMENT_NODE?j=B.closest(".tag-node"):B.nodeType===Node.TEXT_NODE&&B.parentElement&&(j=B.parentElement.closest(".tag-node"))),j){if(D.preventDefault(),D.stopPropagation(),y.current){const G=y.current.querySelector('[data-type="variable"], [data-type="upload"]');G&&G.focus()}return}}if(D.key==="Escape"&&y.current){if(a){D.preventDefault();return}y.current.innerHTML="",y.current.focus()}if(D.key==="Backspace"){const B=window.getSelection();if(B&&B.rangeCount>0){const j=B.getRangeAt(0),G=B.anchorNode;if(a){let q=null,Z=null;if(G&&(G.nodeType===Node.ELEMENT_NODE?(q=G.closest(".tag-node"),Z=G.closest('[data-type="text"]')):G.nodeType===Node.TEXT_NODE&&G.parentElement&&(q=G.parentElement.closest(".tag-node"),Z=G.parentElement.closest('[data-type="text"]'))),(q||Z)&&j.collapsed&&j.startOffset===0){D.preventDefault();return}}let W=null;if(G&&(G.nodeType===Node.ELEMENT_NODE?W=G.closest('[data-type="variable"]'):G.nodeType===Node.TEXT_NODE&&G.parentElement&&(W=G.parentElement.closest('[data-type="variable"]'))),W){if(!j.collapsed)return;const q=W.innerText;if(q===""||q===""){D.preventDefault();return}if(j.startOffset===0){D.preventDefault();return}if(q.startsWith("")&&j.startOffset===1){D.preventDefault();return}}}}},nb=()=>{if(n||r||d||!Fr||!y.current)return;if(e.length===0){const W=y.current.textContent?.replace(/[\u200B\n]/g,"").trim()||"";if(!W)return;if(t(W,W),y.current){y.current.textContent="";const q=new Event("input",{bubbles:!0});y.current.dispatchEvent(q)}return}const D=y.current;let R="";const B={},j=W=>{if(!(W.nodeType===Node.ELEMENT_NODE&&W.style.display==="none")){if(W.nodeType===Node.TEXT_NODE)R+=(W.textContent||"").replace(/\u200B/g,"");else if(W.nodeType===Node.ELEMENT_NODE){const q=W,Z=q.dataset.type,ee=q.dataset.key;if(Z==="variable"&&ee){let ae="";const re=document.createTreeWalker(q,NodeFilter.SHOW_TEXT,{acceptNode:oe=>{const pe=q.querySelector(".variable-info-icon");return pe&&pe.contains(oe)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}});for(;re.nextNode();)ae+=re.currentNode.textContent||"";const X=ae.replace(/[\u200B\n]/g,"").trim();if(X){const oe=q.dataset.multiKey;if(oe){(!B[oe]||!Array.isArray(B[oe]))&&(B[oe]=[]);const pe=B[oe];pe.push(X),pe.length>1&&(R+=" "),R+=X}else B[ee]=X,R+=X;if(q.dataset.nodeType==="report-url")if(B.url===void 0)B.url=X;else{const pe=B.url;Array.isArray(pe)?pe.push(X):B.url=[String(pe),X]}if(q.dataset.nodeType==="markdown"){const pe=q.dataset.sourceTextKey||`${ee}__sourceText`;if(B[pe]===void 0)B[pe]=X;else{const me=B[pe];Array.isArray(me)?me.push(X):B[pe]=[String(me),X]}const ie=`${ee}__markdown`;B[ie]===void 0&&(B[ie]=[Ku(X)])}}}else if(Z==="select"&&ee){const ae=(q.getAttribute("data-value")||"").trim();ae&&(B[ee]=ae,R+=ae)}else if(Z==="textarea"&&ee){const re=(q.value||"").replace(/\u200B/g,"").trim();re&&(B[ee]=re,R+=re)}else if(Z==="richtext"&&ee){const ae=q,re=ae.dataset.nodeType,X=(ae.textContent||"").replace(/\u200B/g,"").trim();if(X)if(re==="report-module"||re==="markdown-module"){(!B[ee]||!Array.isArray(B[ee]))&&(B[ee]=[]);const oe=B[ee];oe.push(X),oe.length>1&&(R+=" "),R+=X}else B[ee]=X,R+=X}else if(Z==="datepicker"&&ee){const re=(q.getAttribute("data-value")||"").trim();if(re)if(re.includes(",")){const X=re.split(",");X.length===2?(B[ee]=X,R+=`[${X[0]}, ${X[1]}]`):(B[ee]=re,R+=re)}else B[ee]=re,R+=re}else if(Z==="number-input"&&ee){const re=(q.value||"").trim();re&&(B[ee]=re,R+=re)}else if(Z==="upload"&&ee){const ae=q.dataset.batchKey;if(ae){const re=e.find(X=>X.type==="upload"&&X.key===ae);if(re&&typeof re.maxCount=="number"&&typeof re.minCount=="number"){const X=[];for(let oe=0;oe<re.maxCount;oe++){const pe=`${ae}-${oe}`,ie=I[pe];ie&&X.push(ie)}B[ae]||(B[ae]=X.length>0?X:null,X.length>0&&(R+=` [附带${X.length}个文件: ${X.map(oe=>oe.name).join(", ")}] `))}else B[ee]=I[ee]??null,I[ee]&&(R+=` [附带文件: ${I[ee]?.name}] `)}else B[ee]=I[ee]??null,I[ee]&&(R+=` [附带文件: ${I[ee]?.name}] `)}else{if(q.classList.contains("tag-close-btn")||q.classList.contains("file-remove-btn"))return;q.getAttribute("contenteditable")==="false"&&!Z&&q.classList.contains("tag-node")?R+=q.innerText:q.childNodes.forEach(j)}}}};if(D.childNodes.forEach(j),R=R.trim(),!R)return;Object.keys(It).forEach(W=>{const q=It[W];if(!q||!q.modules||q.modules.length===0)return;const Z=q.modules.map(ee=>(ee?.markdown||"").trim()).filter(ee=>ee.length>0);Z.length!==0&&(B[`${W}__markdown`]=Z)});const G=new FormData;G.append("fullPrompt",R),Object.keys(B).forEach(W=>{const q=B[W];if(q!=null)if(q instanceof File)G.append(W,q);else if(Array.isArray(q)){const Z=e.some(X=>X.type==="multi-variable"&&X.key===W),ee=e.some(X=>X.type==="report-url"&&X.key===W),ae=W.endsWith("__markdown");Z||ee||ae||W==="url"?q.forEach(X=>{X!=null&&X!==""&&G.append(W,String(X))}):q.forEach((X,oe)=>{X!=null&&(X instanceof File?G.append(`${W}[${oe}]`,X):typeof X=="string"?G.append(`${W}[${oe}]`,X):G.append(`${W}[${oe}]`,String(X)))})}else typeof q=="string"?G.append(W,q):G.append(W,String(q))}),t(G,R)},rb={...i?{width:typeof i=="number"?`${i}px`:i}:{},...h?{border:h}:{},...g?{background:g}:{},...c?{maxHeight:typeof c=="number"?`${c}px`:c}:{},...E?{minHeight:typeof E=="number"?`${E}px`:E}:{},...c?{"--rte-richtext-fullscreen-height":typeof c=="number"?`${c}px`:c}:{}},ib=typeof v=="number"&&Number.isFinite(v)&&v>=0?v:260,ab={overflow:"hidden"},sb={maxHeight:b?`${we}px`:`${Math.max(St,we)}px`,overflow:b||Jt?"hidden":"auto",transition:`max-height ${ib}ms cubic-bezier(0.4, 0, 0.2, 1)`,willChange:"max-height"};return K.jsxs("div",{className:"rich-text-editor",style:rb,"data-disabled":r,ref:O,children:[V,K.jsx("div",{className:"rich-text-editor-content",ref:w,style:ab,children:K.jsxs("div",{ref:H,className:"rich-text-editor-content-body",style:sb,children:[K.jsx("div",{ref:y,className:`rte-editor ${e.length===0?"rte-editor-default":""} ${de&&f?"rte-editor-empty":""}`,contentEditable:e.length===0,suppressContentEditableWarning:!0,"data-placeholder":f,onMouseDown:KE,onMouseMove:QE,onMouseUp:JE,onClick:ZE,onDoubleClick:eb,onInput:ya,onKeyDown:tb,onPaste:jE}),K.jsx("input",{type:"file",ref:M,className:"rte-file-input",accept:".csv,.xlsx,.xls,.txt,.pdf,image/*",onChange:XE})]})}),K.jsxs("div",{className:"rich-text-editor-footer",children:[K.jsx("div",{className:"rich-text-editor-footer-left",children:K.jsxs("div",{className:"rich-text-editor-brand",children:[K.jsxs("div",{className:"rte-brand-badge",children:[K.jsx("img",{src:"https://oospublic.sealseek.cn/file/website/ball.png",alt:""}),K.jsx("span",{className:"rte-brand-text",children:"SealSeek 1.0"})]}),p!=="hideAgent"&&K.jsx(ye.Dropdown,{placement:"topLeft",menu:{items:s.filter(D=>D.isShowNew!==1).map(D=>({key:D.key,label:K.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[D.icon&&K.jsx("i",{className:D.icon}),K.jsx("span",{children:D.label})]}),onClick:()=>{u?.(D)}}))},trigger:["click"],disabled:r||n,overlayClassName:"rte-agent-dropdown",children:K.jsxs("div",{className:"rte-agent-badge",style:{cursor:s.length>0?"pointer":"default"},children:[K.jsx("i",{className:"iconfont icon-zhinengti",style:{fontSize:"16px"}}),K.jsx("span",{className:"rte-agent-text",children:"智能体"})]})})]})}),K.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(()=>{const D=e.find(B=>B.type==="tag");if(!D||!D.text)return null;const R=s.find(B=>B.label===D.text);return!R||R.points===void 0||R.points===null?null:K.jsxs("div",{className:"rte-points-badge",style:{position:"relative"},children:[K.jsx("i",{className:"iconfont icon-jifen",style:{marginRight:"4px",fontSize:"16px"}}),K.jsxs("span",{style:{fontSize:"16px",lineHeight:"22px"},children:["-",String(R.points)]}),R.labelValue===2&&K.jsx("div",{className:"rte-limited-free-badge",children:K.jsx("span",{className:"rte-limited-free-text",children:"限时免费"})})]})})(),K.jsx("button",{type:"button",onClick:nb,disabled:n||r||d||!Fr,className:"rich-text-editor-send-button",children:n||d?K.jsx("span",{className:"rte-send-spinner"}):K.jsx("i",{className:"iconfont icon-fasong"})})]})]}),ce?.anchorEl&&(()=>{if(!document.body.contains(ce.anchorEl))return null;let D="",R={background:"#fff",padding:12,borderRadius:8,border:"0.5px solid #E5E5E5",boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)"},B=!1;const j=W=>{const q=BE(W);if(!q)return null;if(q.kind==="text")return{node:q.text,steps:!1};const Z=q.data,ee=Math.max(0,Z.images?.length||0);if(ee<=0)return{node:Z.title,steps:!1};const ae=Math.min(Math.max(Ct,0),ee-1),re=Array.isArray(Z.stepDescriptions)&&Z.stepDescriptions[ae]||"",X=Array.isArray(Z.images)?Z.images[ae]:void 0,oe=typeof X=="string"?Br.current.get(X):void 0;return{node:K.jsxs("div",{className:"rte-steps-tooltip",style:tr?{width:`${tr}px`}:void 0,onMouseEnter:()=>pt(),onMouseLeave:()=>{N||lt(null)},onClick:ie=>{ie.preventDefault(),ie.stopPropagation()},children:[K.jsxs("div",{className:"rte-steps-tooltip-header",children:[K.jsx("div",{className:"rte-steps-tooltip-title",children:Z.title}),K.jsxs("div",{className:"rte-steps-tooltip-step-badge",children:["步骤 ",ae+1,"/",ee]})]}),Z.description?K.jsx("div",{className:"rte-steps-tooltip-desc",children:K.jsx(ko,{remarkPlugins:[zu,Zu],rehypePlugins:[vu,[Mu,Ju]],components:{p:({children:ie})=>K.jsx("p",{style:{margin:0},children:ie})},children:Z.description})}):null,K.jsx("div",{className:"rte-steps-tooltip-media",style:oe?{"--rte-steps-tooltip-aspect":oe}:void 0,children:K.jsx(ye.Image.PreviewGroup,{preview:{visible:Rr,current:ae,onVisibleChange:ie=>yn(ie),onChange:ie=>{const me=Math.min(Math.max(ie,0),ee-1);bn(me),Tn.current?.slideTo(me)}},children:K.jsx(es,{className:"rte-steps-tooltip-swiper",modules:[Xc,Kc],navigation:!0,pagination:{clickable:!0},initialSlide:ae,onSwiper:ie=>{Tn.current=ie},onSlideChange:ie=>bn(ie.activeIndex),children:Z.images.map((ie,me)=>K.jsx(ts,{children:K.jsx(ye.Image,{className:"rte-steps-tooltip-img",src:ie,alt:`step-${me+1}`,width:"100%",style:{width:"100%",display:"block"},imgStyle:{width:"100%",height:"100%",objectFit:"contain",display:"block"},preview:{mask:null},onClick:()=>{bn(me),Tn.current?.slideTo(me),yn(!0)}})},`${ie}-${me}`))},`${ce.key}-${ce.type}`)})}),K.jsx("div",{className:"rte-steps-tooltip-footer",children:K.jsx("div",{className:"rte-steps-tooltip-step-text",children:K.jsx(ko,{remarkPlugins:[zu,Zu],rehypePlugins:[vu,[Mu,Ju]],components:{p:({children:ie})=>K.jsx("p",{style:{margin:0},children:ie})},children:re})})})]}),steps:!0}};if(ce.type==="upload"){const W=ce.anchorEl.dataset.tooltip,q=j(W);if(q)D=q.node,B=q.steps;else{const Z=e.find(ae=>ae.type==="upload"&&ae.key===ce.key),ee=j(typeof Z?.tooltip=="string"?Z?.tooltip:Z?.tooltip?JSON.stringify(Z.tooltip):"");D=ee?.node||"",B=ee?.steps||!1}}else if(ce.type==="tag"){const W=ce.anchorEl.dataset.tooltip,q=j(W);D=q?.node||"",B=q?.steps||!1}else if(ce.type==="upload-label")D=ce.anchorEl.querySelector(".upload-label[data-file-name]")?.dataset.fileName||ce.anchorEl.dataset.fileName||"";else if(ce.type==="variable"){const W=ce.anchorEl.dataset.tooltip,q=j(W);D=q?.node||"",B=q?.steps||!1}else if(ce.type==="upload-preview"){const W=I[ce.key],q=!!W&&(W.type?.startsWith("image/")||/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(W.name||""));if(W&&q){const Z=URL.createObjectURL(W);D=K.jsx("div",{className:"rte-upload-preview",children:K.jsx("img",{className:"rte-upload-preview-img",src:Z,alt:W.name})}),R={background:"#fff",padding:0,borderRadius:4,boxShadow:"0 2px 12px 0 rgba(153, 153, 153, 0.25)"},setTimeout(()=>URL.revokeObjectURL(Z),1e3)}else D=""}return D?(B&&(R={background:"#fff",padding:0,borderRadius:12,boxShadow:"0 4px 20px 0 rgba(129, 124, 143, 0.2)",border:"0.5px solid #E5E5E5"}),zr.createPortal(K.jsx(ye.Tooltip,{arrow:!1,zIndex:999,destroyTooltipOnHide:!1,autoAdjustOverflow:!B,align:B?{points:["bc","tc"]}:void 0,title:ce.type==="upload-preview"?K.jsx("div",{onMouseEnter:()=>pt(),onMouseLeave:()=>{N||lt(null)},onClick:W=>{W.preventDefault(),W.stopPropagation()},children:D}):B?D:K.jsx("div",{style:{maxWidth:"200px",fontSize:"12px",color:"#0A0A0A"},onMouseEnter:()=>pt(),onMouseLeave:()=>{N||lt(null)},onClick:W=>{W.preventDefault(),W.stopPropagation()},children:D}),open:Te,placement:ce.type==="upload-preview"?"topLeft":"top",getPopupContainer:()=>document.body,overlayInnerStyle:R,overlayClassName:"rte-tooltip-overlay",children:K.jsx("div",{style:{position:"fixed",left:`${(()=>{const W=ce.anchorEl.getBoundingClientRect();return B?W.left+W.width/2:W.left})()}px`,top:`${ce.anchorEl.getBoundingClientRect().top-(ce.type==="upload-label"?4:0)}px`,width:`${B?1:ce.anchorEl.offsetWidth}px`,height:`${ce.anchorEl.offsetHeight}px`,pointerEvents:"none"}})}),document.body)):null})(),ba,Ea]})};el.__docgenInfo={displayName:"RichTextEditor",description:"结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",props:{config:{name:"config",required:!0,description:"结构化输入配置节点数组",type:{name:"InputNode[]",raw:"InputNode[]"}},onSend:{name:"onSend",required:!0,description:"点击发送按钮时的回调,返回数据与拼接后的 Prompt",type:{name:"function",raw:"(data: Record<string, any>, fullPrompt: string) => void"}},isProcessing:{name:"isProcessing",required:!1,description:"是否处于处理状态(禁用输入与发送)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}}}};const tl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==",FE=[{label:"5页",value:5},{label:"10页",value:10},{label:"15页",value:15},{label:"30页",value:30}],HE=({autoLoading:e,batchSize:t,loadingProgress:n,loadIcon:r,onBatchSizeChange:i,onLoadNextPage:a,onStartAutoLoad:s,onStopLoad:u})=>e&&n?K.jsxs("div",{className:"auto_load_progress",children:[r||K.jsx("img",{src:tl,alt:"自动加载",width:14,height:14}),K.jsxs("span",{children:["正在加载第",n.currentPage,"/",n.totalPages,"页"]}),K.jsx(ye.Progress,{percent:n.percentage,type:"line",size:[160,8]}),K.jsx("span",{onClick:u,className:"auto_load_stop_btn",children:"停止加载"})]}):K.jsxs("div",{className:"auto_load_container",children:[K.jsx("div",{onClick:a,className:"auto_load_next_btn",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:"加载下一页"}),K.jsxs("div",{className:"right_control_wrap",style:{backgroundColor:e?"#f5f5f5":"#2563eb"},children:[K.jsxs("div",{className:"auto_load_btn",onClick:e?void 0:s,children:[r||K.jsx("img",{src:tl,alt:"自动加载",width:14,height:14}),K.jsx("span",{children:"自动加载"})]}),K.jsx(ye.Select,{value:t,onChange:i,options:FE,disabled:e,size:"small",className:"auto_load_select",popupMatchSelectWidth:84})]})]}),UE=({current:e,loadIcon:t,pageSize:n,total:r,cachedPages:i,loadedCount:a,autoLoading:s=!1,loadingProgress:u,onChange:o,onLoadNextPage:d,onStartAutoLoad:f,onStopLoading:h})=>{const[g,p]=P.useState(5),c=Math.ceil(r/n),E=P.useMemo(()=>i.length>=c,[i,c]),b=()=>Array.from({length:c},(A,v)=>v+1).filter(A=>!i.includes(A)).slice(0,g),m=(x,A,v)=>{const N=i.includes(x);return A==="prev"||A==="next"||A==="jump-prev"||A==="jump-next"?K.jsx("div",{className:"pageBox",children:v}):K.jsxs("div",{className:"pageBox",style:{backgroundColor:e===x?"#2563EB":"#f5f5f5",color:e===x?"#fff":N?"#171717":"#a3a3a3"},children:[x,!N&&K.jsx("span",{className:"unload_spot"})]})};return K.jsxs("div",{className:"pagination_footer",children:[K.jsxs("div",{className:"pagination_leftWrap",children:[K.jsxs("span",{className:"pagination_total",children:[K.jsx(Lt.InfoCircleOutlined,{style:{color:"#2563EB",marginRight:"4px"}}),"已加载: ",a,"/",r,"条数据"]}),!E&&K.jsx(HE,{loadIcon:t||void 0,autoLoading:s,batchSize:g,loadingProgress:u,disabled:!d||!f,onBatchSizeChange:p,onLoadNextPage:()=>d?.(),onStartAutoLoad:()=>{const x=b();f?.(x)},onStopLoad:()=>h?.()})]}),K.jsx(ye.Pagination,{current:e,pageSize:n,total:r,onChange:x=>o(x),showSizeChanger:!1,showQuickJumper:!1,showTotal:()=>"",itemRender:m})]})},nl=e=>{const{loading:t,autoLoading:n,loadingProgress:r,columns:i=[],dataSource:a=[],total:s,current:u,pageSize:o,cachedPages:d,onChangePage:f,onLoadNextPage:h,onStartAutoLoad:g,onStopLoading:p,...c}=e,E=P.useRef(null),b=P.useCallback(m=>{f(m),d.includes(m)&&E.current?.scrollTo({key:`${(m-1)*o+1}`})},[d,f,o]);return K.jsxs("div",{className:"flex flex-col",children:[K.jsx(ye.Table,{ref:E,...c,columns:i,dataSource:a,pagination:!1,virtual:!0}),K.jsx(UE,{loading:t,autoLoading:n,loadingProgress:r,current:u,pageSize:o,total:s,loadedCount:a.length,cachedPages:d,onChange:b,onLoadNextPage:h,onStartAutoLoad:g,onStopLoading:p})]})};nl.__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 rl=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:r=!0,value:i,onChange:a,...s})=>{const[u,o]=P.useState(""),[d,f]=P.useState(0),[h,g]=P.useState(!1),[p,c]=P.useState(!1),[E,b]=P.useState(!1),m=P.useRef(void 0),x=P.useRef(void 0),A=P.useRef(e),v=P.useRef(d),N=P.useRef(p),F=P.useRef(u);P.useEffect(()=>{A.current=e,v.current=d,N.current=p,F.current=u});const V=P.useCallback((I,T)=>{let $=0;b(!0);const Q=()=>{$<I.length?(o(I.slice(0,$+1)),$++,x.current=window.setTimeout(Q,n)):(b(!1),T?.())};Q()},[n]),O=P.useCallback(I=>{let T=F.current.length;const $=()=>{T>0?(o(F.current.slice(0,T-1)),T--,x.current=window.setTimeout($,n/2)):I?.()};$()},[n]),w=P.useCallback(()=>{if(A.current.length===0||N.current)return;g(!0);const I=A.current[v.current];F.current?O(()=>{V(I,()=>{m.current=window.setTimeout(()=>{f(T=>(T+1)%A.current.length),g(!1)},2e3)})}):V(I,()=>{m.current=window.setTimeout(()=>{f(T=>(T+1)%A.current.length),g(!1)},2e3)})},[O,V]);P.useEffect(()=>(r&&e.length>0&&!p&&w(),()=>{m.current&&window.clearTimeout(m.current),x.current&&window.clearTimeout(x.current)}),[d,p,r,e.length,w]),P.useEffect(()=>{!h&&r&&e.length>0&&!p&&w()},[d,h,r,e.length,p,w]);const H=I=>{c(!0),m.current&&window.clearTimeout(m.current),x.current&&window.clearTimeout(x.current),g(!1),b(!1),s.onFocus?.(I)},y=I=>{c(!1),!i&&e.length>0&&(o(""),f(0)),s.onBlur?.(I)},M=I=>{a?.(I.target.value),s.onChange?.(I)},U=()=>p||i?t:u||t;return K.jsxs("div",{style:{position:"relative"},children:[K.jsx(ye.Input,{...s,value:i,onChange:M,onFocus:H,onBlur:y,placeholder:U(),style:{...s.style,position:"relative",zIndex:1}}),!p&&!i&&u&&K.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:[K.jsx("span",{children:u}),E&&K.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),K.jsx("style",{children:`
|
|
27
45
|
@keyframes blink {
|
|
28
46
|
0%, 50% { opacity: 1; }
|
|
29
47
|
51%, 100% { opacity: 0; }
|
|
30
48
|
}
|
|
31
|
-
`})]})};
|
|
49
|
+
`})]})};rl.__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 il=({texts:e=[],placeholder:t="请输入内容",animationSpeed:n=100,autoPlay:r=!0,value:i="",onChange:a,onSubmit:s,maxLength:u=500,showCount:o=!0,submitText:d="发送",disabled:f=!1,rows:h=4,style:g,...p})=>{const[c,E]=P.useState(""),[b,m]=P.useState(0),[x,A]=P.useState(!1),[v,N]=P.useState(!1),[F,V]=P.useState(!1),[O,w]=P.useState(i||""),H=P.useRef(void 0),y=P.useRef(void 0),M=P.useRef(e),U=P.useRef(b),I=P.useRef(v),T=P.useRef(c),$=P.useRef(null);P.useEffect(()=>{M.current=e,U.current=b,I.current=v,T.current=c});const Q=P.useCallback((ge,Ie)=>{let Re=0;V(!0);const Oe=()=>{Re<ge.length?(E(ge.slice(0,Re+1)),Re++,y.current=window.setTimeout(Oe,n)):(V(!1),Ie?.())};Oe()},[n]),z=P.useCallback(ge=>{let Ie=T.current.length;const Re=()=>{Ie>0?(E(T.current.slice(0,Ie-1)),Ie--,y.current=window.setTimeout(Re,n/2)):ge?.()};Re()},[n]),te=P.useCallback(()=>{if(M.current.length===0||I.current)return;A(!0);const ge=M.current[U.current];T.current?z(()=>{Q(ge,()=>{H.current=window.setTimeout(()=>{m(Ie=>(Ie+1)%M.current.length),A(!1)},2e3)})}):Q(ge,()=>{H.current=window.setTimeout(()=>{m(Ie=>(Ie+1)%M.current.length),A(!1)},2e3)})},[z,Q]);P.useEffect(()=>(r&&e.length>0&&!v&&te(),()=>{H.current&&window.clearTimeout(H.current),y.current&&window.clearTimeout(y.current)}),[b,v,r,e.length,te]),P.useEffect(()=>{!x&&r&&e.length>0&&!v&&te()},[b,x,r,e.length,v,te]);const S=ge=>{N(!0),H.current&&window.clearTimeout(H.current),y.current&&window.clearTimeout(y.current),A(!1),V(!1),p.onFocus?.(ge)},fe=ge=>{N(!1),!i&&e.length>0&&(E(""),m(0)),p.onBlur?.(ge)},ce=ge=>{const Ie=ge.target.value;u&&Ie.length>u||(a?a(Ie):w(Ie),p.onChange?.(ge))},L=()=>{const ge=a?i:O;ge.trim()&&!f&&(s?.(ge),a||w(""))},Te=ge=>{(ge.ctrlKey||ge.metaKey)&&ge.key==="Enter"&&(ge.preventDefault(),L()),p.onKeyDown?.(ge)},_e=a?i:O,Ae=f||!_e.trim()||(u?_e.length>u:!1);return K.jsxs("div",{style:{position:"relative",...g},children:[K.jsxs("div",{style:{position:"relative"},children:[K.jsx("textarea",{ref:$,value:a?i:O,onChange:ce,onFocus:ge=>{ge.target.style.borderColor="#1890ff",ge.target.style.boxShadow="0 0 0 2px rgba(24, 144, 255, 0.2)",S(ge)},onBlur:ge=>{ge.target.style.borderColor="#d9d9d9",ge.target.style.boxShadow="none",fe(ge)},onKeyDown:Te,placeholder:v||_e?t:"",maxLength:u,rows:h,disabled:f,style:{width:"100%",minHeight:`${h*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",...p.style},...p}),!v&&!_e&&c&&K.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:[K.jsx("span",{children:c}),F&&K.jsx("span",{style:{display:"inline-block",width:1,height:"1.2em",backgroundColor:"#1890ff",marginLeft:2,animation:"blink 1s infinite"}})]}),K.jsx("div",{style:{position:"absolute",bottom:8,right:8,zIndex:3},children:K.jsx(ye.Button,{type:"primary",size:"small",icon:K.jsx(Lt.SendOutlined,{}),onClick:L,disabled:Ae,style:{borderRadius:6,minWidth:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:d})})]}),o&&K.jsxs("div",{style:{marginTop:4,textAlign:"right",fontSize:"12px",color:"#999"},children:[_e.length,"/",u]}),K.jsx("style",{children:`
|
|
32
50
|
@keyframes blink {
|
|
33
51
|
0%, 50% { opacity: 1; }
|
|
34
52
|
51%, 100% { opacity: 0; }
|
|
35
53
|
}
|
|
36
|
-
`})]})};Mt.__docgenInfo={displayName:"DynamicTextArea",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"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const Re=({src:t,poster:f,width:i=300,height:d,videoWidth:v,videoHeight:D,showPlayButton:P=!0,autoPlayOnHover:B=!0,onClick:M,onVideoLoaded:L,onVideoPlay:q,onVideoPause:j,onVideoEnded:S,className:N,style:e,...n})=>{const s=c.useRef(null),[u,E]=c.useState(!1),[H,F]=c.useState(!1),[T,ne]=c.useState(!1),K=c.useCallback(()=>{s.current&&(s.current.play(),E(!0),q?.())},[q]),R=c.useCallback(()=>{s.current&&(s.current.pause(),E(!1),j?.())},[j]),G=c.useCallback(I=>{I.stopPropagation(),u?R():K()},[u,K,R]),l=c.useCallback(()=>{F(!0),B&&!u&&K()},[B,u,K]),_=c.useCallback(()=>{F(!1),B&&u&&R()},[B,u,R]),U=c.useCallback(()=>{ne(!0),L?.()},[L]),V=c.useCallback(()=>{E(!0),q?.()},[q]),y=c.useCallback(()=>{E(!1),j?.()},[j]),b=c.useCallback(()=>{E(!1),S?.()},[S]),x=c.useCallback(I=>{M?.(I)},[M]);return w.jsx(oe.Card,{...n,className:`video-card ${N||""}`,style:{width:i,height:d,padding:0,overflow:"hidden",cursor:M?"pointer":"default",border:"none",borderRadius:0,...e},bordered:!1,onMouseEnter:l,onMouseLeave:_,onClick:x,children:w.jsxs("div",{className:"video-card-container",children:[w.jsx("video",{ref:s,src:t,poster:f,preload:"metadata",onLoadedData:U,onPlay:V,onPause:y,onEnded:b,muted:!0,loop:!0}),P&&w.jsx("div",{className:`video-play-button ${H?"hovered":""}`,onClick:G,children:u?w.jsx(Te.PauseCircleOutlined,{className:"play-icon"}):w.jsx(Te.PlayCircleOutlined,{className:"play-icon"})}),!T&&w.jsx("div",{className:"video-loading-mask",children:w.jsx("div",{className:"loading-spinner"})})]})})};Re.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const Cn=t=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(i=>t.toLowerCase().includes(i)),Sn=t=>t.type?t.type:Cn(t.url)?"video":"image",Dt=({items:t,columns:f,gap:i=0,responsive:d=!0,breakpoints:v={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:D,style:P,onClick:B})=>{const M=c.useRef(null),[L,q]=c.useState(f||v.md||3),j=c.useRef(new Map),S=c.useCallback(()=>{if(!d||f)return f||v.md||3;const s=window.innerWidth;return s<576?v.xs||1:s<768?v.sm||2:s<992?v.md||3:s<1200?v.lg||4:s<1600?v.xl||5:v.xxl||6},[d,f,v]),N=c.useCallback(()=>{if(!M.current)return;const s=L,u=M.current,H=(u.offsetWidth-i*(s-1))/s,F=new Array(s).fill(0);t.forEach((ne,K)=>{const R=ne.id||K,G=j.current.get(R);if(!G)return;const l=Math.min(...F),_=F.indexOf(l),U=_*(H+i),V=F[_];G.style.position="absolute",G.style.left=`${U}px`,G.style.top=`${V}px`,G.style.width=`${H}px`,F[_]+=G.offsetHeight+i});const T=Math.max(...F);u.style.height=`${T}px`},[t,L,i]);c.useEffect(()=>{const s=()=>{const u=S();u!==L&&q(u)};if(d)return window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)},[d,S,L]),c.useEffect(()=>{const s=setTimeout(()=>{N()},100);return()=>clearTimeout(s)},[t,L,N]);const e=c.useCallback(()=>{N()},[N]),n=c.useCallback(s=>{B&&B(s),s.onClick?.(s)},[B]);return w.jsx("div",{ref:M,className:`waterfall-container ${D||""}`,style:{position:"relative",width:"100%",...P},children:t.map((s,u)=>{const E=s.id||u,H=Sn(s);return w.jsx("div",{ref:F=>{F?j.current.set(E,F):j.current.delete(E)},className:"waterfall-item",children:H==="video"?w.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:B||s.onClick?"pointer":"default"},children:w.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:w.jsx(Re,{src:s.url,poster:s.poster,width:"100%",height:"100%",onClick:()=>n(s),onVideoLoaded:e,autoPlayOnHover:!0,showPlayButton:!1})})}):w.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>n(s),style:{cursor:B||s.onClick?"pointer":"default"},children:w.jsx("img",{src:s.url,alt:`瀑布流图片 ${u+1}`,className:"waterfall-image",onLoad:e,onError:e,style:{display:"block",width:"100%",height:"auto"}})})},E)})})};Dt.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const Be=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),Le={日期:"date",展现量:"impressions",点击量:"clicks","花费(元)":"cost",点击率:"clickRate","平均点击花费(元)":"avgClickCost","千次展现花费(元)":"cpm","总成交金额(元)":"totalTransactionAmount",总成交笔数:"totalTransactionCount",点击转化率:"clickConversionRate","直接成交金额(元)":"directTransactionAmount","间接成交金额(元)":"indirectTransactionAmount",直接成交笔数:"directTransactionCount",间接成交笔数:"indirectTransactionCount",投入产出比:"roi",含预售投产比:"roiWithPresale","总成交成本(元)":"totalTransactionCost","总预售成交金额(元)":"totalPresaleAmount",总预售成交笔数:"totalPresaleCount","直接预售成交金额(元)":"directPresaleAmount",直接预售成交笔数:"directPresaleCount","间接预售成交金额(元)":"indirectPresaleAmount",间接预售成交笔数:"indirectPresaleCount",拍下订单笔数:"orderCount","拍下订单金额(元)":"orderAmount",总购物车数:"totalCartCount",直接购物车数:"directCartCount",间接购物车数:"indirectCartCount",加购率:"addToCartRate","加购成本(元)":"addToCartCost",收藏宝贝数:"productCollectionCount",收藏店铺数:"shopCollectionCount",总收藏数:"totalCollectionCount",直接收藏宝贝数:"directProductCollectionCount",间接收藏宝贝数:"indirectProductCollectionCount",宝贝收藏率:"productCollectionRate","宝贝收藏成本(元)":"productCollectionCost","店铺收藏成本(元)":"shopCollectionCost",总收藏加购数:"totalCollectionAndCartCount","总收藏加购成本(元)":"totalCollectionAndCartCost",宝贝收藏加购数:"productCollectionAndCartCount","宝贝收藏加购成本(元)":"productCollectionAndCartCost",引导访问量:"guidedVisitCount",引导访问人数:"guidedVisitorCount",引导访问潜客数:"guidedPotentialCustomerCount",引导访问潜客占比:"guidedPotentialCustomerRate",引导访问率:"guidedVisitRate",深度访问量:"deepVisitCount",平均访问页面数:"avgPageViews",成交人数:"transactionCustomerCount",成交新客数:"newCustomerCount",成交新客占比:"newCustomerRate",人均成交笔数:"avgTransactionPerCustomer",人均成交金额:"avgAmountPerCustomer",优惠券领取量:"couponClaimCount",购物金充值笔数:"shoppingCreditRechargeCount","购物金充值金额(元)":"shoppingCreditRechargeAmount",旺旺咨询量:"wangwangConsultationCount",自然流量转化金额:"organicTrafficAmount",自然流量曝光量:"organicTrafficImpressions"},et=["日期","展现量","点击量","花费(元)","点击率","平均点击花费(元)","总成交金额(元)","总成交笔数","点击转化率","总购物车数","收藏宝贝数","收藏店铺数","总收藏数","宝贝收藏成本(元)","千次展现花费(元)","总预售成交金额(元)","总预售成交笔数","直接预售成交金额(元)","直接预售成交笔数","间接预售成交金额(元)","间接预售成交笔数","拍下订单笔数","拍下订单金额(元)","直接成交金额(元)","间接成交金额(元)","直接成交笔数","间接成交笔数","投入产出比","含预售投产比","总成交成本(元)","引导访问潜客数","成交人数","人均成交笔数","人均成交金额","直接购物车数","间接购物车数","加购率","店铺收藏成本(元)","总收藏加购数","总收藏加购成本(元)","宝贝收藏加购数","宝贝收藏加购成本(元)","宝贝收藏率","加购成本(元)","直接收藏宝贝数","间接收藏宝贝数","优惠券领取量","购物金充值笔数","购物金充值金额(元)","旺旺咨询量","引导访问量","引导访问人数","引导访问潜客占比","引导访问率","深度访问量","平均访问页面数","成交新客数","成交新客占比","自然流量转化金额","自然流量曝光量"],Tn=t=>{if(!t||t.trim()==="")return"";const f=t.trim();if(f.toLowerCase()==="nan")return"NaN";const i=f.match(/^(.+?)([+-]\d)/);return i?i[1].trim():f},An=t=>t.replace(/[\u00a0\u3000]/g," ").replace(/[–—]/g,"-").replace(/%(\d)/g,"% $1").replace(/NaN(\d)/gi,"NaN $1").replace(/(\.\d+)(\d,\d{3})/g,"$1 $2").replace(/(\.\d+)(\d+\.)/g,"$1 $2").replace(/(\.\d{2})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").replace(/(,\d{3})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").split(/\s+/).map(i=>i.trim()).filter(i=>i!==""),Pt=t=>{const f=(t||"").replace(/[\u00a0\u3000]/g," "),i=/20\d{2}-\d{2}-\d{2}/g,d=f.match(i)||[];if(d.length===0)return{markdown:"",jsonData:[]};const v=f.split(i).filter(N=>N.trim()!=="");let D=0;v.length>0&&v[0].includes("展现量")&&(D=1);const P=et.length-1,B=[];d.forEach((N,e)=>{const n=e+D;if(n>=v.length)return;const s=v[n];let u=s.split(/[\r\n]+/).map(H=>H.trim()).filter(H=>H!=="");u.length<P&&(u=An(s));const E={};E[Le.日期]=N,et.slice(1).forEach((H,F)=>{const T=u[F]||"",ne=Tn(T),K=Le[H];K&&(E[K]=ne)}),B.push(E)});const M=et.filter(N=>{const e=Le[N];return B.some(n=>n[e])}),L=`| ${M.join(" | ")} |`,q=`| ${M.map(()=>"---").join(" | ")} |`,j=B.map(N=>`| ${M.map(n=>{const s=Le[n];return N[s]||"-"}).join(" | ")} |`);return{markdown:[L,q,...j].join(`
|
|
37
|
-
`),jsonData:
|
|
38
|
-
`);if(
|
|
54
|
+
`})]})};il.__docgenInfo={displayName:"DynamicTextArea",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"}},onSubmit:{name:"onSubmit",required:!1,description:"提交回调",type:{name:"function",raw:"(value: string) => void"}},maxLength:{name:"maxLength",required:!1,description:"最大输入字数",type:{name:"number",raw:"number"},defaultValue:{value:"500"}},showCount:{name:"showCount",required:!1,description:"是否显示字数统计",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},submitText:{name:"submitText",required:!1,description:"提交按钮文本",type:{name:"string",raw:"string"},defaultValue:{value:'"发送"'}},disabled:{name:"disabled",required:!1,description:"是否禁用提交按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"false"}},rows:{name:"rows",required:!1,description:"文本域行数",type:{name:"number",raw:"number"},defaultValue:{value:"4"}}}};const da=({src:e,poster:t,width:n=300,height:r,videoWidth:i,videoHeight:a,showPlayButton:s=!0,autoPlayOnHover:u=!0,onClick:o,onVideoLoaded:d,onVideoPlay:f,onVideoPause:h,onVideoEnded:g,className:p,style:c,...E})=>{const b=P.useRef(null),[m,x]=P.useState(!1),[A,v]=P.useState(!1),[N,F]=P.useState(!1),V=P.useCallback(()=>{b.current&&(b.current.play(),x(!0),f?.())},[f]),O=P.useCallback(()=>{b.current&&(b.current.pause(),x(!1),h?.())},[h]),w=P.useCallback(Q=>{Q.stopPropagation(),m?O():V()},[m,V,O]),H=P.useCallback(()=>{v(!0),u&&!m&&V()},[u,m,V]),y=P.useCallback(()=>{v(!1),u&&m&&O()},[u,m,O]),M=P.useCallback(()=>{F(!0),d?.()},[d]),U=P.useCallback(()=>{x(!0),f?.()},[f]),I=P.useCallback(()=>{x(!1),h?.()},[h]),T=P.useCallback(()=>{x(!1),g?.()},[g]),$=P.useCallback(Q=>{o?.(Q)},[o]);return K.jsx(ye.Card,{...E,className:`video-card ${p||""}`,style:{width:n,height:r,padding:0,overflow:"hidden",cursor:o?"pointer":"default",border:"none",borderRadius:0,...c},bordered:!1,onMouseEnter:H,onMouseLeave:y,onClick:$,children:K.jsxs("div",{className:"video-card-container",children:[K.jsx("video",{ref:b,src:e,poster:t,preload:"metadata",onLoadedData:M,onPlay:U,onPause:I,onEnded:T,muted:!0,loop:!0}),s&&K.jsx("div",{className:`video-play-button ${A?"hovered":""}`,onClick:w,children:m?K.jsx(Lt.PauseCircleOutlined,{className:"play-icon"}):K.jsx(Lt.PlayCircleOutlined,{className:"play-icon"})}),!N&&K.jsx("div",{className:"video-loading-mask",children:K.jsx("div",{className:"loading-spinner"})})]})})};da.__docgenInfo={displayName:"VideoCard",description:"视频卡片组件,支持鼠标悬浮播放控制",props:{src:{name:"src",required:!0,description:"视频源地址",type:{name:"string",raw:"string"}},poster:{name:"poster",required:!1,description:"视频海报图片",type:{name:"string",raw:"string"}},width:{name:"width",required:!1,description:"卡片宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:"300"}},height:{name:"height",required:!1,description:"卡片高度",type:{name:"number | string",raw:"number | string"}},videoWidth:{name:"videoWidth",required:!1,description:"视频宽度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},videoHeight:{name:"videoHeight",required:!1,description:"视频高度",type:{name:"number | string",raw:"number | string"},defaultValue:{value:'"100%"'}},showPlayButton:{name:"showPlayButton",required:!1,description:"是否显示播放按钮",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},autoPlayOnHover:{name:"autoPlayOnHover",required:!1,description:"是否自动播放(鼠标悬浮时)",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},onClick:{name:"onClick",required:!1,description:"点击事件",type:{name:"function",raw:"(event: React.MouseEvent<HTMLDivElement>) => void"}},onVideoLoaded:{name:"onVideoLoaded",required:!1,description:"视频加载完成事件",type:{name:"function",raw:"() => void"}},onVideoPlay:{name:"onVideoPlay",required:!1,description:"视频播放事件",type:{name:"function",raw:"() => void"}},onVideoPause:{name:"onVideoPause",required:!1,description:"视频暂停事件",type:{name:"function",raw:"() => void"}},onVideoEnded:{name:"onVideoEnded",required:!1,description:"视频结束事件",type:{name:"function",raw:"() => void"}},className:{name:"className",required:!1,description:"自定义样式类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}}}};const $E=e=>[".mp4",".webm",".ogg",".mov",".avi",".wmv",".flv",".mkv"].some(n=>e.toLowerCase().includes(n)),qE=e=>e.type?e.type:$E(e.url)?"video":"image",al=({items:e,columns:t,gap:n=0,responsive:r=!0,breakpoints:i={xs:1,sm:2,md:3,lg:4,xl:5,xxl:6},className:a,style:s,onClick:u})=>{const o=P.useRef(null),[d,f]=P.useState(t||i.md||3),h=P.useRef(new Map),g=P.useCallback(()=>{if(!r||t)return t||i.md||3;const b=window.innerWidth;return b<576?i.xs||1:b<768?i.sm||2:b<992?i.md||3:b<1200?i.lg||4:b<1600?i.xl||5:i.xxl||6},[r,t,i]),p=P.useCallback(()=>{if(!o.current)return;const b=d,m=o.current,A=(m.offsetWidth-n*(b-1))/b,v=new Array(b).fill(0);e.forEach((F,V)=>{const O=F.id||V,w=h.current.get(O);if(!w)return;const H=Math.min(...v),y=v.indexOf(H),M=y*(A+n),U=v[y];w.style.position="absolute",w.style.left=`${M}px`,w.style.top=`${U}px`,w.style.width=`${A}px`,v[y]+=w.offsetHeight+n});const N=Math.max(...v);m.style.height=`${N}px`},[e,d,n]);P.useEffect(()=>{const b=()=>{const m=g();m!==d&&f(m)};if(r)return window.addEventListener("resize",b),b(),()=>window.removeEventListener("resize",b)},[r,g,d]),P.useEffect(()=>{const b=setTimeout(()=>{p()},100);return()=>clearTimeout(b)},[e,d,p]);const c=P.useCallback(()=>{p()},[p]),E=P.useCallback(b=>{u&&u(b),b.onClick?.(b)},[u]);return K.jsx("div",{ref:o,className:`waterfall-container ${a||""}`,style:{position:"relative",width:"100%",...s},children:e.map((b,m)=>{const x=b.id||m,A=qE(b);return K.jsx("div",{ref:v=>{v?h.current.set(x,v):h.current.delete(x)},className:"waterfall-item",children:A==="video"?K.jsx("div",{style:{width:"100%",position:"relative",paddingBottom:"56.25%",cursor:u||b.onClick?"pointer":"default"},children:K.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:K.jsx(da,{src:b.url,poster:b.poster,width:"100%",height:"100%",onClick:()=>E(b),onVideoLoaded:c,autoPlayOnHover:!0,showPlayButton:!1})})}):K.jsx("div",{className:"waterfall-image-wrapper",onClick:()=>E(b),style:{cursor:u||b.onClick?"pointer":"default"},children:K.jsx("img",{src:b.url,alt:`瀑布流图片 ${m+1}`,className:"waterfall-image",onLoad:c,onError:c,style:{display:"block",width:"100%",height:"auto"}})})},x)})})};al.__docgenInfo={displayName:"Waterfall",description:"瀑布流布局组件,支持图片和视频混合展示",props:{items:{name:"items",required:!0,description:"媒体资源数组",type:{name:"WaterfallItem[]",raw:"WaterfallItem[]"}},columns:{name:"columns",required:!1,description:"列数(默认会根据屏幕宽度自动响应)",type:{name:"number",raw:"number"}},gap:{name:"gap",required:!1,description:"间隔大小",type:{name:"number",raw:"number"},defaultValue:{value:"0"}},responsive:{name:"responsive",required:!1,description:"是否启用响应式布局",type:{name:"boolean",raw:"boolean"},defaultValue:{value:"true"}},breakpoints:{name:"breakpoints",required:!1,description:"响应式断点配置",type:{name:"object",raw:"{ xs?: number; sm?: number; md?: number; lg?: number; xl?: number; xxl?: number; }"}},className:{name:"className",required:!1,description:"自定义类名",type:{name:"string",raw:"string"}},style:{name:"style",required:!1,description:"自定义样式",type:{name:"CSSProperties",raw:"React.CSSProperties"}},onClick:{name:"onClick",required:!1,description:"点击回调",type:{name:"function",raw:"(item: any) => void"}}}};const er=e=>e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),En={日期:"date",展现量:"impressions",点击量:"clicks","花费(元)":"cost",点击率:"clickRate","平均点击花费(元)":"avgClickCost","千次展现花费(元)":"cpm","总成交金额(元)":"totalTransactionAmount",总成交笔数:"totalTransactionCount",点击转化率:"clickConversionRate","直接成交金额(元)":"directTransactionAmount","间接成交金额(元)":"indirectTransactionAmount",直接成交笔数:"directTransactionCount",间接成交笔数:"indirectTransactionCount",投入产出比:"roi",含预售投产比:"roiWithPresale","总成交成本(元)":"totalTransactionCost","总预售成交金额(元)":"totalPresaleAmount",总预售成交笔数:"totalPresaleCount","直接预售成交金额(元)":"directPresaleAmount",直接预售成交笔数:"directPresaleCount","间接预售成交金额(元)":"indirectPresaleAmount",间接预售成交笔数:"indirectPresaleCount",拍下订单笔数:"orderCount","拍下订单金额(元)":"orderAmount",总购物车数:"totalCartCount",直接购物车数:"directCartCount",间接购物车数:"indirectCartCount",加购率:"addToCartRate","加购成本(元)":"addToCartCost",收藏宝贝数:"productCollectionCount",收藏店铺数:"shopCollectionCount",总收藏数:"totalCollectionCount",直接收藏宝贝数:"directProductCollectionCount",间接收藏宝贝数:"indirectProductCollectionCount",宝贝收藏率:"productCollectionRate","宝贝收藏成本(元)":"productCollectionCost","店铺收藏成本(元)":"shopCollectionCost",总收藏加购数:"totalCollectionAndCartCount","总收藏加购成本(元)":"totalCollectionAndCartCost",宝贝收藏加购数:"productCollectionAndCartCount","宝贝收藏加购成本(元)":"productCollectionAndCartCost",引导访问量:"guidedVisitCount",引导访问人数:"guidedVisitorCount",引导访问潜客数:"guidedPotentialCustomerCount",引导访问潜客占比:"guidedPotentialCustomerRate",引导访问率:"guidedVisitRate",深度访问量:"deepVisitCount",平均访问页面数:"avgPageViews",成交人数:"transactionCustomerCount",成交新客数:"newCustomerCount",成交新客占比:"newCustomerRate",人均成交笔数:"avgTransactionPerCustomer",人均成交金额:"avgAmountPerCustomer",优惠券领取量:"couponClaimCount",购物金充值笔数:"shoppingCreditRechargeCount","购物金充值金额(元)":"shoppingCreditRechargeAmount",旺旺咨询量:"wangwangConsultationCount",自然流量转化金额:"organicTrafficAmount",自然流量曝光量:"organicTrafficImpressions"},fa=["日期","展现量","点击量","花费(元)","点击率","平均点击花费(元)","总成交金额(元)","总成交笔数","点击转化率","总购物车数","收藏宝贝数","收藏店铺数","总收藏数","宝贝收藏成本(元)","千次展现花费(元)","总预售成交金额(元)","总预售成交笔数","直接预售成交金额(元)","直接预售成交笔数","间接预售成交金额(元)","间接预售成交笔数","拍下订单笔数","拍下订单金额(元)","直接成交金额(元)","间接成交金额(元)","直接成交笔数","间接成交笔数","投入产出比","含预售投产比","总成交成本(元)","引导访问潜客数","成交人数","人均成交笔数","人均成交金额","直接购物车数","间接购物车数","加购率","店铺收藏成本(元)","总收藏加购数","总收藏加购成本(元)","宝贝收藏加购数","宝贝收藏加购成本(元)","宝贝收藏率","加购成本(元)","直接收藏宝贝数","间接收藏宝贝数","优惠券领取量","购物金充值笔数","购物金充值金额(元)","旺旺咨询量","引导访问量","引导访问人数","引导访问潜客占比","引导访问率","深度访问量","平均访问页面数","成交新客数","成交新客占比","自然流量转化金额","自然流量曝光量"],zE=e=>{if(!e||e.trim()==="")return"";const t=e.trim();if(t.toLowerCase()==="nan")return"NaN";const n=t.match(/^(.+?)([+-]\d)/);return n?n[1].trim():t},VE=e=>e.replace(/[\u00a0\u3000]/g," ").replace(/[–—]/g,"-").replace(/%(\d)/g,"% $1").replace(/NaN(\d)/gi,"NaN $1").replace(/(\.\d+)(\d,\d{3})/g,"$1 $2").replace(/(\.\d+)(\d+\.)/g,"$1 $2").replace(/(\.\d{2})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").replace(/(,\d{3})(\d+[+-]\d+\.?\d*%)/g,"$1 $2").split(/\s+/).map(n=>n.trim()).filter(n=>n!==""),sl=e=>{const t=(e||"").replace(/[\u00a0\u3000]/g," "),n=/20\d{2}-\d{2}-\d{2}/g,r=t.match(n)||[];if(r.length===0)return{markdown:"",jsonData:[]};const i=t.split(n).filter(p=>p.trim()!=="");let a=0;i.length>0&&i[0].includes("展现量")&&(a=1);const s=fa.length-1,u=[];r.forEach((p,c)=>{const E=c+a;if(E>=i.length)return;const b=i[E];let m=b.split(/[\r\n]+/).map(A=>A.trim()).filter(A=>A!=="");m.length<s&&(m=VE(b));const x={};x[En.日期]=p,fa.slice(1).forEach((A,v)=>{const N=m[v]||"",F=zE(N),V=En[A];V&&(x[V]=F)}),u.push(x)});const o=fa.filter(p=>{const c=En[p];return u.some(E=>E[c])}),d=`| ${o.join(" | ")} |`,f=`| ${o.map(()=>"---").join(" | ")} |`,h=u.map(p=>`| ${o.map(E=>{const b=En[E];return p[b]||"-"}).join(" | ")} |`);return{markdown:[d,f,...h].join(`
|
|
55
|
+
`),jsonData:u}},ol=e=>{if(!e)return"";const t=e.trim().split(`
|
|
56
|
+
`);if(t.length<2)return er(e);const n=t[1],i=/^\|[\s-|]+\|$/.test(n.trim());if(!n||!i)return er(e);const s=t[0].split("|").map(h=>h.trim()).filter(h=>h!==""),u=t.slice(2).map(h=>h.split("|").map(g=>g.trim()).filter((g,p,c)=>p>0&&p<c.length)),o="border:1px solid #d9d9d9;padding:8px 12px;background-color:#fafafa;font-weight:600;text-align:left;white-space:nowrap;",d="border:1px solid #d9d9d9;padding:6px 12px;text-align:left;white-space:nowrap;";let f='<div style="overflow-x:auto;max-width:100%;">';return f+='<table style="border-collapse:collapse;width:100%;font-size:12px;margin:8px 0;">',f+="<thead><tr>",s.forEach(h=>{f+=`<th style="${o}">${er(h)}</th>`}),f+="</tr></thead>",f+="<tbody>",u.forEach(h=>{f+="<tr>",s.forEach((g,p)=>{const c=h[p]||"-";f+=`<td style="${d}">${er(c)}</td>`}),f+="</tr>"}),f+="</tbody></table></div>",f},ul=e=>{const t=[],n=e.querySelector("thead tr");if(!n)return t;const r=[];return n.querySelectorAll("th").forEach(a=>{r.push(a.textContent?.trim()||"")}),e.querySelectorAll("tbody tr").forEach(a=>{const s={};a.querySelectorAll("td").forEach((o,d)=>{const f=r[d],h=En[f];if(h){const g=o.textContent?.trim()||"";s[h]=g==="-"?"":g}}),Object.keys(s).length>0&&t.push(s)}),t},YE=e=>async t=>{const n=sl(t.text);return e&&e(n.jsonData),{modules:[{title:"推广分析表格",content:ol(n.markdown),markdown:n.markdown}]}},GE=(e,t,n)=>{const r=parseFloat(String(e.get("grossProfitMargin")||"0"))||0,i=parseFloat(String(e.get("refundRate")||"0"))||0;let a=[];if(t){const s=ul(t);s.length>0&&(a=s)}return a.length===0&&n&&n.length>0&&(a=n),{grossProfitMargin:r,refundRate:i,tableData:a}},WE={algorithm:ye.theme.defaultAlgorithm,token:{colorPrimary:"#3b82f6",colorSuccess:"#10b981",colorWarning:"#f59e0b",colorError:"#ef4444",colorInfo:"#3b82f6",colorBgBase:"#ffffff",colorBgContainer:"#ffffff",colorBgElevated:"#ffffff",colorBgLayout:"#f8fafc",colorTextBase:"#1e293b",colorText:"#1e293b",colorTextSecondary:"#64748b",colorTextTertiary:"#94a3b8",colorTextQuaternary:"#cbd5e1",colorBorder:"#e2e8f0",colorBorderSecondary:"#f1f5f9",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",boxShadowSecondary:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",borderRadius:8,borderRadiusLG:12,borderRadiusSM:6,fontFamily:"Inter, system-ui, Arial, sans-serif",fontSize:14,fontSizeLG:16,fontSizeSM:12,padding:16,paddingLG:24,paddingSM:12,paddingXS:8,controlHeight:32,controlHeightLG:40,controlHeightSM:24},components:{Button:{borderRadius:8,controlHeight:32,fontWeight:500},Card:{borderRadiusLG:12,boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)"},Input:{borderRadius:8,controlHeight:32},Table:{borderRadiusLG:8,headerBg:"#f8fafc",headerColor:"#374151"}}};ve.AdvancedTable=La,ve.AppModal=_a,ve.BackButton=va,ve.Button=Ca,ve.Card=Sa,ve.DynamicInput=rl,ve.DynamicTextArea=il,ve.EmptyAndSpin=ka,ve.HEADER_TO_FIELD=En,ve.LinkButton=wa,ve.PageTable=Ia,ve.RichTextEditor=el,ve.VideoCard=da,ve.VirtualTable=nl,ve.Waterfall=al,ve.XcIcon=Na,ve.buildPromotionSendPayload=GE,ve.createMarkdownAnalyze=YE,ve.escapeHtml=er,ve.extractTableDataFromHtml=ul,ve.lightTheme=WE,ve.parsePromotionTableMarkdown=sl,ve.renderMarkdownToHtml=ol,Object.defineProperty(ve,Symbol.toStringTag,{value:"Module"})});
|
|
39
57
|
//# sourceMappingURL=index.umd.js.map
|