unione-form-vue 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,13 +1,120 @@
1
- (function(ee,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("@ant-design/icons-vue"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","@ant-design/icons-vue","uuid"],K):(ee=typeof globalThis<"u"?globalThis:ee||self,K(ee.index={},ee.UnioneBaseVue,ee.Vue,ee.antDesignVue,ee.lodashEs,ee.vueCodemirror,ee.langJavascript,ee.iconsVue,ee.uuid))})(this,function(ee,K,i,J,na,Lt,la,He,sa){"use strict";const oa={isDebug:!0,axios:{form:"/portal"},listPageUrl:"/unione/page/list",addPageUrl:"/unione/page/add",editPageUrl:"/unione/page/edit",viewPageUrl:"/unione/page/view",formRules:[]},Ji=i.ref(oa);function Ie(o){return o&&(Ji.value=K.utils.obj.ext(Ji.value,o)),Ji.value}const aa={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},ra={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},da=i.ref([aa,ra]);function ca(o,e){return K.locales.loadLanguage(o,()=>new Promise((t,n)=>{const l=da.value.filter(s=>s.localeName==o);if(e)if(typeof e=="function")e().then(s=>{if(l.length==0){const a={...s,localeName:o};t(a)}else{const a={...l[0],...s};t(a)}});else if(l.length==0){const s={...e,localeName:o};t(s)}else{const s={...l[0],...e};t(s)}else l.length>0?t(l[0]):n("local language not defined ,lang:"+o)}))}const Zi={...K.locales};Zi.loadLanguage=ca;class ha{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(e,t){this.$psn=i.ref(e),this.$pid=i.ref(""),this.$store=i.ref({}),this.$forms=i.ref({}),this.$params=i.ref({}),this.$refObj=i.ref({}),this.$refData=i.ref({}),this.$model=t}params(e){if(e){this.$params.value=e,e.id&&(this.$pid.value=e.id,this.$psn.value&&this.use(this.$psn.value,"form").detail(this.$pid.value));for(const t in this.$store.value)this.$store.value[t].$params=e}return this.$params.value}psn(e){return e&&(this.$psn.value=e),this.$psn.value}regRef(e,t){}setRefData(e,t,n){}use(e,t,n){let l=this.$store.value[e];return l||(l=new en(e,t,this.$model),this.$store.value[e]=l,l.$params=this.$params.value),n&&(l.$form=n,this.$forms.value[e]=n),l}useForm(e,t,n){const l=this.use(e,"form",t);return this.$psn.value==e&&this.$pid.value&&l.detail(this.$pid.value).then(s=>{n&&n(s)}),l}data(e){return this.$store.value[e]}form(e){return e?this.$forms.value[e]:this.$forms.value}primary(){return this.data(this.$psn.value)}dsnList(){return Object.keys(this.$store.value)}}class en{$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(e,t,n){typeof e=="string"?(this.$dsn=e,this.$store={controller:"/api/data/storage/v1"}):(this.$store=e,this.$dsn=""),this.$type=t,this.$data=i.ref(t=="form"?{}:{body:[],total:0}),this.$dialog=K.useDialog(),this.$model=n||i.ref("run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(e){return e&&(this.$store=e),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(e){this.$data.value=e,this.$form?.setValue(e)}$processParams(e,t){if(t)t.forEach(n=>{e[n.name]==null&&e[n.name]==null&&(this.$params[n.name]!=null&&this.$params[n.name]!=null?e[n.alias||n.name]=this.$params[n.name]:n.value!=null&&n.value!=null&&(e[n.alias||n.name]=n.value))});else if(this.$params)for(const n in this.$params)e[n]==null&&e[n]==null&&this.$params[n]!=null&&this.$params[n]!=null&&(e[n]=this.$params[n]);return e}request(e){return new Promise((t,n)=>{const l=J.message.loading("数据请求中..."),s=this.$store.controller+e.url;K.axios.form({method:"post",...e,url:s}).then(a=>{a.success?t(a):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+s,options:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+s,options:e,err:a})}).finally(()=>{l()})})}find(e){const t=this.$store.controller+(this.$store.findUrl||"/find");return!e&&this.$store.findParams&&(e={dsn:this.$dsn}),this.$isStorage()&&(e.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),e&&(e.body=this.$processParams(e.body,this.$store.findParams)),new Promise((n,l)=>{const s=J.message.loading("数据加载中...");K.axios.form({url:t,method:"post",data:e}).then(a=>{a.success?(this.$data.value=a,n(a)):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,err:a})}).finally(()=>{s()})})}save(e){const t=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(e.dsn=this.$dsn+(this.$model!="run"?"@dev":""),e.params=this.$processParams(e.params,this.$store.saveParams)):e.data=this.$processParams(e.data,this.$store.saveParams),new Promise((n,l)=>{const s=J.message.loading("数据提交中...");K.axios.form({url:t,method:"post",data:this.$isStorage()?e:e.data}).then(a=>{a.success?(this.$type=="form"&&(this.$data.value=a.body||{}),a.silence||J.message.success(a.message),n(a)):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,err:a})}).finally(()=>{s()})})}loadByIds(e){return new Promise((t,n)=>{const l=J.message.loading("数据加载中..."),s=this.$store.controller+"/loadByIds";K.axios.form({url:s,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(a=>{a.success?t(a):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,err:a})}).finally(()=>{l()})})}detail(e){return new Promise((t,n)=>{const l=J.message.loading("数据加载中..."),s=this.$store.controller+"/detail";K.axios.form({url:s,method:"post",data:this.$isStorage()?{id:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(a=>{a.success?(this.$type=="form"&&(this.$data.value=a.body),t(a)):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:s,id:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:s,id:e,err:a})}).finally(()=>{l()})})}deleteByIds(e){return new Promise((t,n)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+e.length+"条。",onOk:()=>{const l=J.message.loading("数据处理中..."),s=this.$store.controller+"/delete";K.axios.form({url:s,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(a=>{a.success?t(a):(a.silence||this.$dialog.error({content:a.message||"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:s,ids:e,result:a}))}).catch(a=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:s,ids:e,err:a})}).finally(()=>{l()})}})})}}class fa{$event;$onces;$delayEmit;constructor(){this.$event=i.ref({}),this.$onces=i.ref({}),this.$delayEmit=i.ref({})}$on(e,t){if(this.$event.value[e]=t,this.$delayEmit.value[e]){const n=this.$delayEmit.value[e];t(n)}}$emit(e,t){if(this.$onces.value[e]){const n=this.$onces.value[e];delete this.$onces.value[e],n(t)}this.$event.value[e]?this.$event.value[e](t):(this.$delayEmit.value[e]=t,setTimeout(()=>{delete this.$delayEmit.value[e]},1e3*10))}$once(e,t){this.$onces.value[e]=t}$off(e){delete this.$event.value[e]}}class ct{define;ebus;model;type;$widgetList;$widgetMap;$dataManager;$axiosProccess;$dialog;constructor(e={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}}){const t=e.configs||{};this.model=i.ref("run"),this.type=i.ref(e.types||"setting"),this.define=i.ref(e),this.ebus=new fa,this.$widgetList=i.ref([]),this.$widgetMap=i.ref({}),this.$dataManager=new ha(t.dsnList?t.dsnList[0]:"",this.model),this.$axiosProccess=i.ref({}),this.$dialog=K.useDialog(),this.loadConfig(t)}sn(){return this.define.value.sn}load(e,t){if(!e)return;if(this.define.value.sn=e,e=="new_"){console.log("新建/本地页面sn:"+e+",define:",t),t&&t.configs&&(this.define.value=t,this.type.value=this.define.value.types||"setting",this.loadConfig(t.configs));return}const n=sessionStorage.getItem("PAGE_DEFINE:"+e);if(n&&this.model.value=="run"){this.define.value=JSON.parse(n),this.type.value=this.define.value.types||"setting",this.loadConfig(this.define.value.configs),console.log("从会话缓存中加载页面sn:"+e+",define:",this.define.value);return}K.axios.form({url:"/api/page/define/load/"+e,method:"post"}).then(l=>{l.success?(this.define.value=l.body,this.type.value=this.define.value.types||"setting",l.body.configs?this.define.value.configs=l.body.configs:this.define.value.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.value.configs),sessionStorage.setItem("PAGE_DEFINE:"+e,JSON.stringify(this.define.value)),console.log("从远程服务加载页面sn:"+e+",define:",this.define.value)):t&&t.configs&&(this.define.value=t,this.loadConfig(t.configs))})}save(){return new Promise((e,t)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.value.sn),t();return}this.$axiosProccess.value.save=!0;const n={...this.define.value.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},l={...this.define.value};l.configs=JSON.stringify(n),K.axios.form({url:"/api/page/define/save",method:"post",data:l}).then(s=>{this.$axiosProccess.value.save=!1,s.success?(J.message.success(s.message),this.define.value=s.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.value.sn,JSON.stringify(this.define.value)),this.load(this.define.value.sn,this.define.value),e(s.body)):(this.$dialog.error({content:s.message}),t())}).catch(s=>{console.error("页面配置保存失败",s),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(e){e.dsnList?.length&&this.$dataManager.psn(e.dsnList[0]),this.$widgetList.value=e.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value)}setModel(e){this.model.value=e}widget(e,t){if(t){const n={...t,wid:e};this.$widgetMap.value[e]||(this.$widgetList.value.push(n),n.configs?.widgets&&this.$processWidget(n.configs.widgets)),this.$widgetMap.value[e]=n}else return this.$widgetMap.value[e]}widgets(e){if(e)this.$widgetList.value=e,this.$widgetMap.value={},this.$processWidget(e);else return this.$widgetList.value}$processWidget(e){e.forEach(t=>{t.wid||(t.wid="w:"+na.uniqueId()),this.$widgetMap.value[t.wid]=t,t.configs?.widgets&&this.$processWidget(t.configs.widgets)})}dataManager(){return this.$dataManager}}const ua={class:"widget-setting-dialog"},pa=i.defineComponent({__name:"widget",props:{model:{type:String,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1}},emits:["setting","saving"],setup(o,{emit:e}){const t=e,n=i.ref(),l=i.ref(!1);function s(){n.value&&(l.value=!0),t("setting")}function a(){t("saving"),l.value=!1}return(r,d)=>{const h=i.resolveComponent("SettingOutlined"),f=i.resolveComponent("a-tooltip"),c=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["unione-widget",o.model])},[i.createVNode(f,{title:o.settingTitle},{default:i.withCtx(()=>[o.model=="edit"&&(r.$slots["widget-setting"]||o.custome)?(i.openBlock(),i.createBlock(h,{key:0,class:"widget-setting",onClick:s})):i.createCommentVNode("",!0)]),_:1},8,["title"]),i.renderSlot(r.$slots,"default",{},void 0,!0),o.model=="edit"&&r.$slots["widget-setting"]?(i.openBlock(),i.createBlock(c,{key:0,title:o.settingTitle,ref_key:"settingModal",ref:n,open:l.value,"onUpdate:open":d[0]||(d[0]=u=>l.value=u),centered:"",width:"80%",onOk:a},{default:i.withCtx(()=>[i.createElementVNode("div",ua,[i.renderSlot(r.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):i.createCommentVNode("",!0)],2)}}}),ne=(o,e)=>{const t=o.__vccOpts||o;for(const[n,l]of e)t[n]=l;return t},ht=ne(pa,[["__scopeId","data-v-3a88c0c0"]]),ma={key:0},ga=["onClick"],ci=ne(i.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(o,{expose:e}){const t=o,n=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:g})=>g+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),l=i.ref({selectedRowKeys:[],columnWidth:"25px",onChange:g=>{l.value.selectedRowKeys=g}}),s={mounted:g=>g.focus()},a=i.ref({});function r(){const g=Object.keys(a.value);if(g.length)for(let p in g){const N=y.value.form.action.params[p];N&&a.value[p]&&Object.keys(a.value[p]).forEach(V=>{N[V]=a.value[p][V]})}a.value={}}function d(g,p,N){r();const V={};V[N]=p[N]||"",N=="showIndex"&&(V[N]=p.show?.query?.index),a.value[g]=V}function h(g,p,N){if(!p||!N){a.value={};return}const V=a.value[g][N];p[N]=V,a.value={}}function f(){y.value.form.action.params.push({title:"新建",name:"",value:""})}function c(){}const u=i.ref(""),m=i.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(g,p)=>u.value!=p&&t.preset.includes(p)?Promise.reject("预设按钮名称,请使用其他名称,["+t.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),b=i.ref([la.javascript()]),y=i.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),k=i.ref();function v(g,p,N={}){g=JSON.parse(JSON.stringify(g)),g.event||(g.event={}),g.props||(g.props={}),g.action||(g.action={}),Object.keys(g.action).includes("maskClosable")||(g.action.maskClosable=!0),g.action.params||(g.action.params=[]),u.value=g.name,y.value.form=g,y.value.helps=N,y.value.visible=!0,k.value=p}const w=i.ref(null);function O(){w.value&&w.value.validate().then(()=>{y.value.visible=!1,k.value(y.value.form)})}return e({open:v,close}),(g,p)=>{const N=i.resolveComponent("a-input"),V=i.resolveComponent("a-form-item"),C=i.resolveComponent("a-select"),x=i.resolveComponent("a-input-number"),S=i.resolveComponent("a-checkbox"),M=i.resolveComponent("a-tab-pane"),T=i.resolveComponent("a-switch"),E=i.resolveComponent("a-button"),I=i.resolveComponent("a-divider"),L=i.resolveComponent("ToolOutlined"),A=i.resolveComponent("a-tooltip"),U=i.resolveComponent("a-table"),P=i.resolveComponent("a-tabs"),G=i.resolveComponent("a-form"),j=i.resolveComponent("a-modal");return i.openBlock(),i.createBlock(j,{visible:y.value.visible,"onUpdate:visible":p[23]||(p[23]=B=>y.value.visible=B),title:y.value.title,centered:"",width:"50%",onOk:O},{default:i.withCtx(()=>[i.createVNode(G,{name:"basic",ref_key:"form",ref:w,rules:m.value,model:y.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:i.withCtx(()=>[i.createVNode(P,null,{default:i.withCtx(()=>[i.createVNode(M,{key:"base",tab:"基本设置"},{default:i.withCtx(()=>[i.createVNode(V,{label:"操作标题",required:"",name:"title"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.title,"onUpdate:value":p[0]||(p[0]=B=>y.value.form.title=B)},null,8,["value"])]),_:1}),i.createVNode(V,{label:"操作名称",name:"name",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.name,"onUpdate:value":p[1]||(p[1]=B=>y.value.form.name=B),disabled:t.preset.includes(y.value.form.name)},null,8,["value","disabled"])]),_:1}),i.createVNode(V,{label:"操作图标"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.icon,"onUpdate:value":p[2]||(p[2]=B=>y.value.form.icon=B)},null,8,["value"])]),_:1}),i.createVNode(V,{label:"按钮类型"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.type,"onUpdate:value":p[3]||(p[3]=B=>y.value.form.type=B),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),i.createVNode(V,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(x,{value:y.value.form.index,"onUpdate:value":p[4]||(p[4]=B=>y.value.form.index=B)},null,8,["value"])]),_:1}),i.createVNode(V,{label:"按钮大小"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.size,"onUpdate:value":p[5]||(p[5]=B=>y.value.form.size=B),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),i.createVNode(V,{label:"按钮特性"},{default:i.withCtx(()=>[i.createVNode(S,{checked:y.value.form.props.block,"onUpdate:checked":p[6]||(p[6]=B=>y.value.form.props.block=B)},{default:i.withCtx(()=>p[24]||(p[24]=[i.createTextVNode("自适应 ")])),_:1},8,["checked"]),i.createVNode(S,{checked:y.value.form.props.danger,"onUpdate:checked":p[7]||(p[7]=B=>y.value.form.props.danger=B)},{default:i.withCtx(()=>p[25]||(p[25]=[i.createTextVNode("危险 ")])),_:1},8,["checked"]),i.createVNode(S,{checked:y.value.form.props.ghost,"onUpdate:checked":p[8]||(p[8]=B=>y.value.form.props.ghost=B)},{default:i.withCtx(()=>p[26]||(p[26]=[i.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),i.createVNode(M,{key:"action",tab:"响应设置"},{default:i.withCtx(()=>[i.createVNode(V,{label:"响应方式",required:""},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.type,"onUpdate:value":p[9]||(p[9]=B=>y.value.form.action.type=B),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.psn,"onUpdate:value":p[10]||(p[10]=B=>y.value.form.action.psn=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.component,"onUpdate:value":p[11]||(p[11]=B=>y.value.form.action.component=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(V,{label:"连接地址"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.href,"onUpdate:value":p[12]||(p[12]=B=>y.value.form.action.href=B)},null,8,["value"])]),_:1}),["link","route"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:2,label:"连接方式"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.target,"onUpdate:value":p[13]||(p[13]=B=>y.value.form.action.target=B),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:3,label:"抽屉位置"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.position,"onUpdate:value":p[14]||(p[14]=B=>y.value.form.action.position=B),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:4,label:"显示标题",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.title,"onUpdate:value":p[15]||(p[15]=B=>y.value.form.action.title=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:5,label:"蒙层关闭"},{default:i.withCtx(()=>[i.createVNode(T,{checked:y.value.form.action.maskClosable,"onUpdate:checked":p[16]||(p[16]=B=>y.value.form.action.maskClosable=B),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:6,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(x,{value:y.value.form.action.width,"onUpdate:value":p[17]||(p[17]=B=>y.value.form.action.width=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(V,{key:7,label:"显示高度"},{default:i.withCtx(()=>[i.createVNode(x,{value:y.value.form.action.height,"onUpdate:value":p[18]||(p[18]=B=>y.value.form.action.height=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(I,{orientation:"left"},{default:i.withCtx(()=>[p[29]||(p[29]=i.createTextVNode("参数列表 ")),i.createVNode(E,{size:"small",class:"param-btn",onClick:f},{default:i.withCtx(()=>p[27]||(p[27]=[i.createTextVNode("添加")])),_:1}),i.createVNode(E,{size:"small",class:"param-btn",danger:"",onClick:c},{default:i.withCtx(()=>p[28]||(p[28]=[i.createTextVNode("删除")])),_:1})]),_:1}),i.createVNode(U,{columns:n.value,"data-source":y.value.form.action.params,bordered:"",pagination:!1,"row-selection":l.value,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:B})=>[["name","title"].includes(B.key)?(i.openBlock(),i.createElementBlock("span",ma,[i.createVNode(L),i.createTextVNode(" "+i.toDisplayString(B.title),1)])):i.createCommentVNode("",!0),["value"].includes(B.key)?(i.openBlock(),i.createBlock(A,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:i.withCtx(()=>[i.createElementVNode("span",null,[i.createVNode(L),i.createTextVNode(" "+i.toDisplayString(B.title),1)])]),_:2},1024)):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:B,text:F,record:_,index:D})=>[["name","title","value"].includes(B.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!a.value[D]||!Object.keys(a.value[D]).includes(B.dataIndex))&&!F&&"empty"]),onClick:$=>d(D,_,B.dataIndex)},[a.value[D]&&Object.keys(a.value[D]).includes(B.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(N,{key:0,value:a.value[D][B.dataIndex],"onUpdate:value":$=>a.value[D][B.dataIndex]=$,onBlur:$=>h(D,_,B.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[s]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(F),1)],64))],10,ga)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),i.createVNode(M,{key:"event",tab:"事件设置"},{default:i.withCtx(()=>[i.createVNode(V,{label:"点击事件",help:y.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:i.withCtx(()=>[i.createVNode(i.unref(Lt.Codemirror),{modelValue:y.value.form.event.clickScript,"onUpdate:modelValue":p[19]||(p[19]=B=>y.value.form.event.clickScript=B),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(V,{label:"禁用逻辑",help:y.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:i.withCtx(()=>[i.createVNode(i.unref(Lt.Codemirror),{modelValue:y.value.form.event.disableScript,"onUpdate:modelValue":p[20]||(p[20]=B=>y.value.form.event.disableScript=B),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(V,{label:"显示逻辑",help:y.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:i.withCtx(()=>[i.createVNode(i.unref(Lt.Codemirror),{modelValue:y.value.form.event.visibleScript,"onUpdate:modelValue":p[21]||(p[21]=B=>y.value.form.event.visibleScript=B),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(V,{label:"动态标题",help:y.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:i.withCtx(()=>[i.createVNode(i.unref(Lt.Codemirror),{modelValue:y.value.form.event.titleScript,"onUpdate:modelValue":p[22]||(p[22]=B=>y.value.form.event.titleScript=B),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),[["__scopeId","data-v-75055a2b"]]),ka=["src"],ba=["src"],ya=ne(i.defineComponent({__name:"btn",props:{editor:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(o,{emit:e}){const t=Ie(),n=o,l=K.useSession();i.watch(()=>n.widget?.event,()=>{a()}),i.onMounted(()=>{a()});const s=i.ref({});function a(){n.widget?.event&&(n.widget.event.clickScript?s.value.click=new Function("ctx","btn","event",n.widget.event.clickScript):n.widget.event.click&&(s.value.click=n.widget.event.click),n.widget.event.disableScript?s.value.disable=new Function("ctx","btn",n.widget.event.disableScript):n.widget.event.disable&&(s.value.disable=n.widget.event.disable),n.widget.event.visibleScript?s.value.visible=new Function("ctx","btn",n.widget.event.visibleScript):n.widget.event.visible&&(s.value.visible=n.widget.event.visible),n.widget.event.titleScript?s.value.title=new Function("ctx","btn",n.widget.event.titleScript):n.widget.event.title&&(s.value.title=n.widget.event.title)),typeof n.widget.click=="function"&&(s.value.click=n.widget.click),typeof n.widget.title=="function"&&(s.value.title=n.widget.title),typeof n.widget.visible=="function"&&(s.value.visible=n.widget.visible),typeof n.widget.disabled=="function"&&(s.value.disable=n.widget.disabled)}const r=i.computed(()=>s.value.title?s.value.title(u.value,n.widget):n.widget.title),d=i.computed(()=>s.value.visible?s.value.visible(u.value,n.widget)!=!1:n.widget.visible!=!1),h=i.computed(()=>n.disabled==!0?!0:s.value.disable?s.value.disable(u.value,n.widget):n.widget.disable==!0),f=i.ref(null);function c(){f.value?.open(n.widget,g=>{console.log("btn props",g),Object.keys(g).forEach(p=>{n.widget[p]=g[p]}),console.log("props btn",n.widget)})}const u=i.computed(()=>({...n.ctx,user:l.getPrincipal(),token:l.getToken()})),m=i.ref({open:!1}),b=i.computed(()=>{if(n.widget.action?.href){let g=n.widget.action.href;const p=g.matchAll("{[a-zA-Z.]*}"),N=[];let V=null;for(;V=p.next();){if(V&&V.value&&V.value[0]){let C=V.value[0].substring(1,V.value[0].length-1);N.includes(C)||N.push(C)}if(V.done)break}if(N.length>0)for(let C=0;C<N.length;C++){let x=N[C],S=K.utils.obj.getValue(u.value,x);S?S instanceof Object?g=g.replaceAll("{"+x+"}",JSON.stringify(S)):Array.isArray(S)?g=g.replaceAll("{"+x+"}",S.join(",")):g=g.replaceAll("{"+x+"}",S):g=g.replaceAll("{"+x+"}","")}return g}return""}),y=i.computed(()=>{const g={};let p=n.widget.action?.href||n.widget.action?.link;if(p){const N=p.matchAll("{[a-zA-Z0-9.]*}"),V=[];let C=null;for(;C=N.next();){if(C&&C.value&&C.value[0]){let S=C.value[0].substring(1,C.value[0].length-1);V.includes(S)||V.push(S)}if(C.done)break}if(V.length>0)for(let S=0;S<V.length;S++){let M=V[S],T=K.utils.obj.getValue(u.value,M);T?T instanceof Object?p=p.replaceAll("{"+M+"}",JSON.stringify(T)):Array.isArray(T)?p=p.replaceAll("{"+M+"}",T.join(",")):p=p.replaceAll("{"+M+"}",T):p=p.replaceAll("{"+M+"}","")}const x=p.split("?")[1];x&&x.split("&").forEach(S=>{const M=S.split("=");M[0]&&M[1]&&(g[M[0]]=M[1])})}return n.widget.action?.params&&n.widget.action.params.filter(N=>N.value+"").forEach(N=>{if(new RegExp("{[a-zA-Z0-9.]*}").test(N.value)){let C=K.utils.obj.getValue(u.value,N.value);g[N.name]=C}else g[N.name]=N.value}),g}),k=e,v=i.inject("router");function w(g){if(t.isDebug&&console.log("unione btn click",n.widget,g),!(s.value.click&&s.value.click(u.value,n.widget,g)==!1)){if(n.widget.action?.type=="drawer"||n.widget.action?.type=="dialog")m.value.open=!0;else if(n.widget.action?.type=="route"&&(n.widget.action?.href||n.widget.action?.link)){if(n.widget.action.link&&n.editor?.type.value=="code")return;v.push({path:n.widget.action.href||n.widget.action?.link,query:y.value})}k("click",{btn:n.widget,event:g})}}function O(g){k("click",g)}return(g,p)=>{const N=i.resolveComponent("a-button"),V=i.resolveComponent("unione-btn"),C=i.resolveComponent("a-dropdown"),x=i.resolveComponent("a-drawer"),S=i.resolveComponent("a-modal");return d.value?(i.openBlock(),i.createBlock(ht,{key:0,class:i.normalizeClass(["unione-btn",o.widget.props?.block&&"unione-btn-block"]),model:o.editor?.model.value,onSetting:c,custome:!0,"setting-title":"按钮设置"},{default:i.withCtx(()=>[!o.widget.widget||o.widget.widget=="button"?(i.openBlock(),i.createBlock(N,i.mergeProps({key:0,disabled:h.value,size:o.widget.size||"small",type:o.type||o.widget.type,shape:o.widget.shape,class:"unione-btn-"+o.widget.name,loading:o.widget.loading,target:o.widget.action?.target,title:o.widget.tooltip,onClick:w},o.widget.props),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value)+" ",1)]),_:2},[o.widget.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.widget.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):i.createCommentVNode("",!0),o.widget.widget=="dropdown"?(i.openBlock(),i.createBlock(C,{key:1,trigger:[o.widget.trigger||"hover"],class:i.normalizeClass([o.widget.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["dropdown-overlay",o.widget.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.widget.items,M=>(i.openBlock(),i.createBlock(V,{key:M.name,class:"item",widget:M,editor:o.editor,preset:o.preset,ctx:o.ctx,onClick:O},null,8,["widget","editor","preset","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode(N,{size:o.widget.size||"small"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):i.createCommentVNode("",!0),o.widget.action?.type=="drawer"?(i.openBlock(),i.createBlock(x,{key:2,open:m.value.open,"onUpdate:open":p[0]||(p[0]=M=>m.value.open=M),title:o.widget.action?.title,placement:o.widget.action?.position,maskClosable:o.widget.action?.maskClosable,width:o.widget.action?.width,bodyStyle:{padding:0,overflow:!o.widget.action.component||o.widget.action.component=="iframe"?"hidden":"auto"}},{default:i.withCtx(()=>[!o.widget.action.component||o.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value},null,8,ka)):i.createCommentVNode("",!0)]),_:1},8,["open","title","placement","maskClosable","width","bodyStyle"])):i.createCommentVNode("",!0),o.widget.action?.type=="dialog"?(i.openBlock(),i.createBlock(S,{key:3,open:m.value.open,"onUpdate:open":p[1]||(p[1]=M=>m.value.open=M),title:o.widget.action?.title,width:o.widget.action?.width,maskClosable:o.widget.action?.maskClosable,centered:"",footer:null},{default:i.withCtx(()=>[!o.widget.action.component||o.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value,style:i.normalizeStyle({height:o.widget.action?.height?o.widget.action?.height+"px":""})},null,12,ba)):i.createCommentVNode("",!0)]),_:1},8,["open","title","width","maskClosable"])):i.createCommentVNode("",!0),i.createVNode(ci,{ref_key:"btnSetting",ref:f,preset:n.preset},null,8,["preset"])]),_:1},8,["class","model"])):i.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b868da76"]]),wa={key:0,class:"unione-widget-empty-tip"},xa=ne(i.defineComponent({__name:"tabs",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},setup(o){const e=o,t=i.ref(),n=i.computed(()=>e.editor?.widget(e.wid)||e.widget);return(l,s)=>{const a=i.resolveComponent("a-tab-pane"),r=i.resolveComponent("a-tabs");return i.openBlock(),i.createBlock(ht,{class:i.normalizeClass(["unione-layout-tabs"]),model:e.editor?.model},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(r,{key:0,activeKey:t.value,"onUpdate:activeKey":s[0]||(s[0]=d=>t.value=d)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.chidlren,(d,h)=>(i.openBlock(),i.createBlock(a,{key:h,class:"unione-layout-tab-pane"},{tab:i.withCtx(()=>[i.createElementVNode("span",null,[d.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(d.icon),{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(d.title),1)])]),default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.chidlren,(f,c)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(f.widget),{key:c,wid:f.wid,editor:e.editor,widget:f},null,8,["wid","editor","widget"]))),128)),!d.chidlren||!d.chidlren.length?(i.openBlock(),i.createElementBlock("div",wa,i.toDisplayString(d.emptyTips),1)):i.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["activeKey"])):i.createCommentVNode("",!0)]),_:1},8,["model"])}}}),[["__scopeId","data-v-7b565c89"]]),va={class:"title"},Ca={class:"text"},Sa={key:0,class:"reactive"},Na={key:1,class:"opts"},Ba={class:"warp"},Oa=ne(i.defineComponent({__name:"section",props:i.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const e=o,t=i.computed(()=>e.editor?.widget(e.wid)||e.widget),n=i.computed(()=>t.value?.title||e.title),l=i.computed(()=>t.value?.icon||e.icon),s=i.computed(()=>t.value?.type||e.type),a=i.useModel(o,"modelValue");function r(){e.reactive&&(a.value=!a.value)}return(d,h)=>(i.openBlock(),i.createBlock(ht,{class:i.normalizeClass(["unione-layout-section",a.value?"open":"close"]),model:e.editor?.model},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["head",o.location,o.reactive&&"reactive"]),onClick:r},[i.createElementVNode("div",va,[s.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["type",s.value])},null,2)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.value),{key:1,class:"icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",Ca,i.toDisplayString(n.value),1)]),o.reactive?(i.openBlock(),i.createElementBlock("div",Sa,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.value?"UpOutlined":"DownOutlined")))])):i.createCommentVNode("",!0),o.location=="left"?(i.openBlock(),i.createElementBlock("div",Na,[i.renderSlot(d.$slots,"opts",{},void 0,!0)])):i.createCommentVNode("",!0)],2),i.withDirectives(i.createElementVNode("div",Ba,[i.renderSlot(d.$slots,"default",{},void 0,!0)],512),[[i.vShow,a.value]])]),_:3},8,["class","model"]))}}),[["__scopeId","data-v-e75e9a84"]]),Va={class:"unione-props-setting unione-form-setting"},_a={class:"unione-form-btns"},Ma={key:0},Ta=["onClick"],Aa={class:"field-txt"},Ea=["onClick"],Ia={key:1,class:"field-txt"},Da=["onClick"],Pa={key:0,class:"field-txt"},Fa={key:3,class:"edit-field"},$a={key:0},Ra=["onClick"],La=ne(i.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(o){const e=o,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:C})=>C+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),n=i.computed(()=>{const C=e.editor.widget(e.wid)||{};return C.configs||(C.configs={}),C.configs.settings||(C.configs.settings={}),C.configs.settings.btns||(C.configs.settings.btns=[]),C}),l=i.computed(()=>(e.editor.dataModels()||[]).map(x=>({value:x.sn,label:x.title+"("+x.name+")"}))),s=i.computed(()=>{const C=n.value.configs.settings.btns,x=C.map(S=>S.name);if(!x.includes("save")){const S={title:"保存",type:"primary",index:0,visible:!0,name:"save"};C.splice(S.index,0,S)}if(!x.includes("submit")){const S={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let M=S.index||1;C.splice(M,0,S)}if(!x.includes("reset")){const S={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};C.splice(S.index,0,S)}if(!x.includes("back")){const S={title:"返回",type:"default",index:3,visible:!0,name:"back"};C.splice(S.index,0,S)}return C}),a=i.ref(null);function r(C){a.value&&a.value.open(C,x=>{x.visible=!0,Object.keys(x).forEach(S=>{C[S]=x[S]}),n.value.configs.settings.btns.sort((S,M)=>{const T=S.index||1,E=M.index||1;return T-E}),n.value.configs.settings.btns=[...n.value.configs.btns]})}function d(){const C=n.value.configs.settings.btns.length+1;let x={title:"新增",name:"new_"+C,index:C,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};x.name="new_"+n.value.configs.settings.btns.length;const S=n.value.configs.settings.btns.filter(M=>M.name==x.name).length;S>0&&(x.name=x.name+S),n.value.configs.settings.btns.push(x),e.editor.widget(e.wid,n.value),a.value.open(x,M=>{Object.keys(M).forEach(T=>{x[T]=M[T]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(C){const x=()=>{if(["save","submit","reset","back"].includes(C.name))C.visible=!1,n.value.configs.settings.btns=[...n.value.configs.settings.btns];else{const S=[];n.value.configs.settings.btns.forEach(M=>{M.name!=C.name&&S.push(M)}),n.value.configs.settings.btns=S}};J.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{x()}})}const f=i.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:C=>{const x=f.value.widgets.filter(S=>S.value==C);return x[0]?x[0].label:C},toSetting:()=>{}}),c=i.ref({visible:!1,field:{},props:{},showInfo:C=>{let x="";return C.rules&&(x=C.rules.filter(S=>S.enable).length||""),x&&(x="("+x+")"),x},toSetting:()=>{const C=c.value.props,x={name:"range",trigger:C.trigger,whitespace:C.whitespace,message:C.rangeMessage};C.rangeMin!=null&&C.rangeMin!=null&&(x.min=C.rangeMin,x.enable=!0),C.rangeMax!=null&&C.rangeMax!=null&&(x.max=C.rangeMax,x.enable=!0);const S={name:"reg",trigger:C.trigger,whitespace:C.whitespace,message:C.regMessage};C.regExpress&&(S.pattern=C.regExpress,S.enable=!0),c.value.field.rules=[x,S],c.value.visible=!1,c.value.props={},console.log("rule",c.value.field.rules)}});function u(C){c.value.visible=!0,c.value.field=C;const x=C.rules||[],S={trigger:"change",whitespace:!0};x.forEach(M=>{M.name=="reg"&&(S.trigger=M.trigger,S.whitespace=M.whitespace,S.regExpress=M.pattern,S.regMessage=M.message),M.name=="range"&&(S.rangeMin=M.min,S.rangeMax=M.max,S.rangeMessage=M.message)}),c.value.props=S}const m=i.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{m.value.visible=!1}});function b(C,x){const S=w.value.filter(T=>T.name==C.name);S.forEach(T=>{x!="isSort"?T[x]=!0:T[x]=!T[x]});const M=S[0];if(!(!M||x=="isSort")){switch(m.value.prop=x,m.value.field=C,M.show||(M.show={}),x){case"isQuery":M.show.query||(M.show.query={}),m.value.show=M.show.query,m.value.title=`查询设置/${C.title}(${C.name})`;break;case"isForm":M.show.form||(M.show.form={}),m.value.show=M.show.form,m.value.title=`表单设置/${C.title}(${C.name})`;break;case"isView":M.show.view||(M.show.view={}),m.value.show=M.show.view,m.value.title=`详情设置/${C.title}(${C.name})`;break;case"isList":M.show.list||(M.show.list={}),m.value.show=M.show.list,m.value.title=`列头设置/${C.title}(${C.name})`;break}m.value.visible=!0}}const y=i.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{y.value.convert.options||(y.value.convert.options=[]),y.value.convert.options.push({label:"",value:""})},toDelOption:(C,x)=>{y.value.convert.options.splice(C,1)},toSetting:()=>{y.value.visible=!1}});function k(C){y.value.visible=!0,y.value.field=C,y.value.convert=C.convert||{}}const v=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),w=i.computed(()=>v.value.fields?.length?v.value.fields:[]),O={mounted:C=>C.focus()},g=i.ref({});function p(C,x){const S={};x=="convertName"?S[x]=C.convert?.type:S[x]=C[x]||"",g.value={},g.value[C.name]=S}function N(C,x){{g.value={};return}}function V(C,x){w.value.filter(M=>M.name==C.name).forEach(M=>{M[x]=!M[x]})}return(C,x)=>{const S=i.resolveComponent("a-divider"),M=i.resolveComponent("CloseOutlined"),T=i.resolveComponent("a-button"),E=i.resolveComponent("PlusOutlined"),I=i.resolveComponent("a-select"),L=i.resolveComponent("ToolOutlined"),A=i.resolveComponent("a-checkbox"),U=i.resolveComponent("a-table"),P=i.resolveComponent("a-select-option"),G=i.resolveComponent("a-form-item"),j=i.resolveComponent("a-form"),B=i.resolveComponent("a-modal"),F=i.resolveComponent("a-checkbox-group"),_=i.resolveComponent("a-input-number"),D=i.resolveComponent("a-input"),$=i.resolveComponent("a-col"),Q=i.resolveComponent("a-row");return i.openBlock(),i.createElementBlock("div",Va,[i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[23]||(x[23]=[i.createTextVNode("按钮设置")])),_:1}),i.createElementVNode("div",_a,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,R=>(i.openBlock(),i.createBlock(T,i.mergeProps({key:R.name,class:["btn",R.name,!R.visible&&"deleted"],type:R.visible?R.type:"default",size:R.size,ref_for:!0},R.props||{},{onClick:X=>r(R)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(R.title)+" ",1),R.visible?(i.openBlock(),i.createBlock(M,{key:0,class:"btn-del",onClick:i.withModifiers(X=>h(R),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[R.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(R.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(T,{class:i.normalizeClass(["btn","btn-add"]),size:"small",onClick:x[0]||(x[0]=R=>d())},{default:i.withCtx(()=>[i.createVNode(E)]),_:1})]),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[24]||(x[24]=[i.createTextVNode("表单设置")])),_:1}),x[36]||(x[36]=i.createTextVNode(" 数据模型:")),i.createVNode(I,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":x[1]||(x[1]=R=>n.value.dataModel=R)},null,8,["options","value"]),i.createVNode(U,{columns:t.value,"data-source":w.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:R})=>[["widget","rules","convertName"].includes(R.key)?(i.openBlock(),i.createElementBlock("span",Ma,[i.createVNode(L),i.createTextVNode(" "+i.toDisplayString(R.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:R,text:X,record:Z})=>[["rules"].includes(R.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",!c.value.showInfo(Z)&&"empty"]),onClick:ge=>u(Z)},[i.createElementVNode("span",Aa,i.toDisplayString(c.value.showInfo(Z)),1),c.value.showInfo(Z)?(i.openBlock(),i.createBlock(T,{key:0,type:"link"},{default:i.withCtx(()=>x[25]||(x[25]=[i.createTextVNode("设置")])),_:1})):i.createCommentVNode("",!0)],10,Ta)):["widget"].includes(R.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!g.value[Z.name]||!Object.keys(g.value[Z.name]).includes(R.dataIndex))&&!X&&"empty"]),onClick:ge=>p(Z,R.dataIndex)},[g.value[Z.name]&&Object.keys(g.value[Z.name]).includes(R.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(I,{key:0,value:Z[R.dataIndex],"onUpdate:value":ge=>Z[R.dataIndex]=ge,options:f.value.widgets,onBlur:x[2]||(x[2]=ge=>N())},null,8,["value","onUpdate:value","options"])),[[O]]):(i.openBlock(),i.createElementBlock("span",Ia,i.toDisplayString(f.value.widgetName(X)),1))],10,Ea)):["convertName"].includes(R.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!g.value[Z.name]||!Object.keys(g.value[Z.name]).includes(R.dataIndex))&&!Z.convert?.type&&"empty"]),onClick:ge=>p(Z,R.dataIndex)},[g.value[Z.name]&&Object.keys(g.value[Z.name]).includes(R.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(I,{key:0,value:Z[R.dataIndex],"onUpdate:value":ge=>Z[R.dataIndex]=ge,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:x[3]||(x[3]=ge=>N())},null,8,["value","onUpdate:value"])),[[O]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[Z.convert?.type?(i.openBlock(),i.createElementBlock("span",Pa,i.toDisplayString(Z.convert.type=="dict"?"字典":"静态"),1)):i.createCommentVNode("",!0),Z.convert?.type?(i.openBlock(),i.createBlock(T,{key:1,type:"link",onClick:i.withModifiers(ge=>k(Z),["stop"])},{default:i.withCtx(()=>x[26]||(x[26]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])):i.createCommentVNode("",!0)],64))],10,Da)):["isForm","isView"].includes(R.dataIndex)?(i.openBlock(),i.createElementBlock("div",Fa,[i.createVNode(A,{checked:Z[R.dataIndex],onClick:ge=>V(Z,R.dataIndex)},null,8,["checked","onClick"]),i.createVNode(T,{type:"link",onClick:ge=>b(Z,R.dataIndex)},{default:i.withCtx(()=>x[27]||(x[27]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(B,{visible:f.value.visible,"onUpdate:visible":x[5]||(x[5]=R=>f.value.visible=R),title:"控件设置",onOk:f.value.toSetting},{default:i.withCtx(()=>[i.createVNode(j,{model:f.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[f.value.field.widget=="a-select"?(i.openBlock(),i.createBlock(G,{key:0,label:"下拉框类型"},{default:i.withCtx(()=>[i.createVNode(I,{value:f.value.props.mode,"onUpdate:value":x[4]||(x[4]=R=>f.value.props.mode=R),allowClear:!0},{default:i.withCtx(()=>[i.createVNode(P,{value:"multiple"},{default:i.withCtx(()=>x[28]||(x[28]=[i.createTextVNode("多选")])),_:1}),i.createVNode(P,{value:"tags"},{default:i.withCtx(()=>x[29]||(x[29]=[i.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(B,{visible:c.value.visible,"onUpdate:visible":x[13]||(x[13]=R=>c.value.visible=R),title:"规则设置",onOk:c.value.toSetting},{default:i.withCtx(()=>[i.createVNode(j,{model:c.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[30]||(x[30]=[i.createTextVNode("基本设置")])),_:1}),i.createVNode(G,{label:"触发时机"},{default:i.withCtx(()=>[i.createVNode(F,{value:c.value.props.trigger,"onUpdate:value":x[6]||(x[6]=R=>c.value.props.trigger=R),options:["change","blur"]},null,8,["value"])]),_:1}),c.value.field.isNull?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(G,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:i.withCtx(()=>[i.createVNode(A,{value:c.value.props.whitespace,"onUpdate:value":x[7]||(x[7]=R=>c.value.props.whitespace=R),checked:c.value.props.whitespace},{default:i.withCtx(()=>x[31]||(x[31]=[i.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[32]||(x[32]=[i.createTextVNode("数值区间")])),_:1}),i.createVNode(G,{label:"有效区间"},{default:i.withCtx(()=>[i.createVNode(_,{value:c.value.props.rangeMin,"onUpdate:value":x[8]||(x[8]=R=>c.value.props.rangeMin=R)},null,8,["value"]),x[33]||(x[33]=i.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),i.createVNode(_,{value:c.value.props.rangeMax,"onUpdate:value":x[9]||(x[9]=R=>c.value.props.rangeMax=R)},null,8,["value"])]),_:1}),i.createVNode(G,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(D,{value:c.value.props.rangeMessage,"onUpdate:value":x[10]||(x[10]=R=>c.value.props.rangeMessage=R)},null,8,["value"])]),_:1}),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[34]||(x[34]=[i.createTextVNode("正则验证")])),_:1}),i.createVNode(G,{label:"表达式"},{default:i.withCtx(()=>[i.createVNode(D,{value:c.value.props.regExpress,"onUpdate:value":x[11]||(x[11]=R=>c.value.props.regExpress=R)},null,8,["value"])]),_:1}),i.createVNode(G,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(D,{value:c.value.props.regMessage,"onUpdate:value":x[12]||(x[12]=R=>c.value.props.regMessage=R)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(B,{visible:m.value.visible,"onUpdate:visible":x[20]||(x[20]=R=>m.value.visible=R),title:m.value.title,onOk:m.value.toSetting},{default:i.withCtx(()=>[i.createVNode(j,{model:m.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(G,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.index,"onUpdate:value":x[14]||(x[14]=R=>m.value.show.index=R)},null,8,["value"])]),_:1}),["isQuery"].includes(m.value.prop)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(G,{key:0,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(D,{value:m.value.show.width,"onUpdate:value":x[15]||(x[15]=R=>m.value.show.width=R)},null,8,["value"])]),_:1})),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(G,{key:1,label:"标题宽度"},{default:i.withCtx(()=>[i.createVNode(D,{value:m.value.show.labelWidth,"onUpdate:value":x[16]||(x[16]=R=>m.value.show.labelWidth=R)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(G,{key:2,label:"控件宽度"},{default:i.withCtx(()=>[i.createVNode(D,{value:m.value.show.valueWidth,"onUpdate:value":x[17]||(x[17]=R=>m.value.show.valueWidth=R)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(G,{key:3,label:"固定位置"},{default:i.withCtx(()=>[i.createVNode(I,{value:m.value.show.fixed,"onUpdate:value":x[18]||(x[18]=R=>m.value.show.fixed=R),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(G,{key:4,label:"对齐方式"},{default:i.withCtx(()=>[i.createVNode(I,{value:m.value.show.align,"onUpdate:value":x[19]||(x[19]=R=>m.value.show.align=R),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),i.createVNode(B,{visible:y.value.visible,"onUpdate:visible":x[22]||(x[22]=R=>y.value.visible=R),title:y.value.convert.type=="dict"?"字典设置":"选项设置",onOk:y.value.toSetting},{default:i.withCtx(()=>[y.value.convert.type!="dict"?(i.openBlock(),i.createElementBlock("div",$a,[i.createVNode(T,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:y.value.toAddOption},{default:i.withCtx(()=>x[35]||(x[35]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode(U,{columns:y.value.optionColumn,"data-source":y.value.convert.options,size:"small"},{bodyCell:i.withCtx(({column:R,record:X,index:Z})=>[R.dataIndex==="label"?(i.openBlock(),i.createBlock(D,{key:0,value:X.label,"onUpdate:value":ge=>X.label=ge,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),R.dataIndex==="value"?(i.openBlock(),i.createBlock(D,{key:1,value:X.value,"onUpdate:value":ge=>X.value=ge,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),R.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:2,onClick:ge=>y.value.toDelOption(Z,X)},"删除",8,Ra)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):i.createCommentVNode("",!0),y.value.convert.type=="dict"?(i.openBlock(),i.createBlock(j,{key:1,model:y.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(Q,{type:"flex",style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode($,{span:24,order:1},{default:i.withCtx(()=>[i.createVNode(G,{label:"字典名称:"},{default:i.withCtx(()=>[i.createVNode(D,{value:y.value.convert.dict,"onUpdate:value":x[21]||(x[21]=R=>y.value.convert.dict=R)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):i.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),i.createVNode(ci,{ref_key:"btnSetting",ref:a},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),ja=ne(i.defineComponent({__name:"form",props:{editor:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1}},setup(o,{expose:e}){const t=o,n=i.ref(!1),l=i.ref(),s=i.ref({}),a=i.ref(null);i.onMounted(()=>{if(d.value.dsn){const w=r.value.dataManager();d.value.primary&&w.psn(d.value.dsn),a.value.setDisabled=v,a.value.getValue=u,a.value.setValue=m,a.value.reset=b,l.value=w.useForm(d.value.dsn,a.value,O=>{s.value=O.body||{}})}t.editor||r.value.loadConfig({widgets:h.value}),t.form?.model&&r.value.setModel(t.form.model),y()});const r=i.computed(()=>t.editor||new ct),d=i.computed(()=>t.widget||t.form||{}),h=i.computed(()=>{let w=d.value.widgets||[];return!w.length&&t.form?.fields&&(w=t.form.fields),w.forEach(O=>{O.widget||(O.widget="unione-form-item"),O.control||(O.control="a-input")}),w}),f=i.inject("pageSetting"),c=i.computed(()=>d.value.setting||f?.form||{});i.provide("formSetting",c.value);function u(){return s.value}function m(w){s.value=w,y()}function b(){s.value={},y()}function y(){const w=O=>{O.widget=="unione-form-item"&&O.name&&(O.value!=null&&O.value!=null&&O.value!=""||O.value==0)&&(s.value[O.name]==null||s.value[O.name]==null||s.value[O.name]=="")&&(s.value[O.name]=O.value),O.widgets?.forEach(g=>{w(g)})};h.value.forEach(O=>{w(O)})}function k(){return a.value.validate()}function v(w=!0){n.value=w}return e({validate:k,getValue:u,setValue:m,reset:b,setDisabled:v}),(w,O)=>{const g=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(ht,{class:"unione-form-widget","setting-title":"表单设置",model:r.value.model.value},i.createSlots({default:i.withCtx(()=>[i.createVNode(g,{ref_key:"formObj",ref:a,model:s.value,class:i.normalizeClass(["unione-form",r.value.model.value,"form-layout-col-"+(c.value.showColumn||3)])},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(p,N)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(p.widget),{key:N,widget:p,editor:r.value,value:s.value[p.name],"onUpdate:value":V=>s.value[p.name]=V,disabled:n.value,formValue:s.value},null,40,["widget","editor","value","onUpdate:value","disabled","formValue"]))),128))]),_:1},8,["model","class"])]),_:2},[o.editor&&d.value.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(La,{wid:d.value.wid,editor:o.editor},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-9a034019"]]);function yl(o,e=!1){const t=Ie();if(!o)return Promise.reject("字典名称不能为空");const n=localStorage.getItem("UNIONE-DICT-"+o);return n&&e==!1?Promise.resolve(JSON.parse(n)):(t.isDebug&&console.log("进入:加载字典数据方法,dict name:"+o+",force:"+e),new Promise((l,s)=>{K.axios.admin({url:"/api/system/dict/load/"+o}).then(a=>{if(a.success){const r=a.body.filter(d=>d.dictName!=d.dictKey);r.forEach(d=>{d.value=d.dictKey,d.label=d.dictValue}),r.length?(localStorage.setItem("UNIONE-DICT-"+o,JSON.stringify(r)),l(r)):s("字典加载失败,dict:"+o+",字典项列表为空")}else t.isDebug&&console.error("字典加载失败,dict:"+o,a),s("字典加载失败,dict:"+o+",error:"+a.message)})}))}async function wl(o,e){const t=Ie();if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("字典key为空");const n=await yl(o),l=n.filter(s=>s.dictKey==e);return l.length>0?Promise.resolve(l[0]):(t.isDebug&&console.log("字典项匹配失败,name:"+o+",key:"+e+"options:",n),Promise.reject("字典项匹配失败,name:"+o+",key:"+e))}async function za(o,e){const t=await wl(o,e);return Promise.resolve(t.dictValue)}const xl={load:yl,getLabel:za,getOption:wl};class Ke{convertObj;config;options;constructor(e){(!e||!e.types)&&console.error("转换器定义不能为空,type不能为空",e),e.valueField||(e.valueField="id"),e.labelField||(e.labelField="title"),this.convertObj=e,this.options=e.options||[],this.config=Ie()}load(e,t=!1){return!(e==null||e==null||e=="undefined"||!(e+"").length)&&this.options?.length&&this.options.filter(n=>n.value==e).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((n,l)=>{if(!this.convertObj.dictName){l("字典名称不能为空,id:"+this.convertObj.id);return}xl.load(this.convertObj.dictName,t).then(s=>{this.options=s,typeof e=="number"&&this.options.forEach(a=>{a.value=parseInt(a.value)}),n(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject("静态转换器选项为空,id:"+this.convertObj.id))):!this.convertObj.id&&this.convertObj.types!="local"?Promise.reject("转换器id不能为空,type:"+this.convertObj.types):new Promise((n,l)=>{const s=this.convertObj.params||{body:{}};this.convertObj.pidField&&(s.pid=-1);const a=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;K.axios.admin({url:a,data:s,method:"POST"}).then(r=>{r.success?(this.options=r.body,this.$processOptions(this.options),typeof e=="number"&&this.options.forEach(d=>{d.value=parseInt(d.value)}),e==null||e==null||e=="undefined"||!(e+"").length?this.options.length?n(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(h=>h.value==e).length?n(this.options):(s.body||(s.body={}),s.body[this.convertObj.valueField||"id"]=e,K.axios.admin({url:a,data:s,method:"POST"}).then(h=>{if(h.success){const f={};this.options.forEach(c=>{f[e]=!0}),h.body.forEach(c=>{f[c.value]||this.options.push(c)}),n(this.options)}else l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+r.message))})})}convert(e){if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?xl.getLabel(this.convertObj.dictName,e):Promise.reject("字典名称不能为空");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const t=this.convertObj.options.filter(n=>n.value==e);return t.length?Promise.resolve(t[0].label):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e,this.convertObj),Promise.reject("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e))}return Promise.reject("静态转换器选项为空,id:"+this.convertObj.id)}if(this.options?.length){const t=this.options.filter(n=>n.value==e);if(t.length)return Promise.resolve(t[0].label)}return new Promise((t,n)=>{this.load(e).then(l=>{const s=l.filter(a=>a.value==e);if(s.length)return t(s[0].label);n()})})}children(e=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+e),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.reject("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id):new Promise((n,l)=>{const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;K.axios.admin({url:s,data:e,method:"POST"}).then(a=>{a.success?(this.$processOptions(a.body),this.options=[...this.options,...a.body],n(a.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e,a),l("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e+",error:"+a.message))})}):Promise.reject("转换器未设置parentField,id:"+this.convertObj.id)}search(e){return this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+e),this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.resolve(this.options.filter(t=>t.label.indexOf(e)>=0)):new Promise(t=>{const n=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;K.axios.admin({url:n,data:{body:{keywords:e}},method:"POST"}).then(l=>{l.success?(this.$processOptions(l.body),t(l.body)):t([])})})}$processOptions(e){return this.convertObj.types=="local"&&e.forEach(t=>{this.convertObj.idField&&(t.id=t[this.convertObj.idField]),this.convertObj.pidField&&(t.pid=t[this.convertObj.pidField]),t.value=t[this.convertObj.valueField||"id"],t.label=t[this.convertObj.labelField||"title"]}),e}}const qa=["innerHTML"],Ua={key:2,class:"text-view"},Wa=ne(i.defineComponent({__name:"formItem",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(o){const e=o,t=i.useModel(o,"value"),n=i.inject("formSetting");i.onMounted(()=>{s.value.value!=null&&typeof s.value.value<"u"&&(e.formValue[s.value.name]==null||e.formValue[s.value.name]==null||typeof e.formValue[s.value.name]>"u")&&(t.value=s.value.value,s.value.widget=="unione-check-box"&&(Array.isArray(s.value.value)||(typeof s.value.value=="string"?t.value=s.value.value.split(","):t.value=[s.value.value])))});const l=i.ref({}),s=i.computed(()=>{const k=e.editor?.widget(e.wid)||e.widget||{};return k.event&&Object.keys(k.event).forEach(v=>{const w=k.event[v];w&&(l.value[v]=null,typeof w=="function"?l.value[v]=w:w.enable&&w.scriptText&&(l.value[v]=new Function("value","ctx",w.scriptText)))}),k}),a=i.computed(()=>!(l.value.visible&&l.value.visible(e.formValue[s.value.name],e.formValue)==!1)),r=i.computed(()=>l.value.title&&l.value.title(e.formValue[s.value.name],e.formValue)||s.value.title),d=i.computed(()=>l.value.change&&l.value.change(e.formValue[s.value.name],e.formValue)||s.value.change),h=i.ref({}),f=i.computed(()=>{const k=[],v=s.value.rule||{};let w=s.value.props?.required||s.value.required;if(l.value.required&&(w=l.value.required(e.formValue[s.value.name],e.formValue)),w&&k.push({required:!0,whitespace:v?.whitespace||!1,trigger:v?.trigger||n.ruleTrigger||"change",validator:(O,g)=>(v?.whitespace&&g&&typeof g=="string"&&(g=g.trim()),g!=null&&g!=null&&(g+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(r.value+"不能为空!"))}),v.advance&&h.value[v.advance]){const O=h.value[v.advance];k.push({pattern:O.pattern,message:O.message||"表单验证不通过!",trigger:v.trigger||n.ruleTrigger||"change"})}return v.regExpress&&k.push({pattern:v.regExpress,message:v.regMessage||"表单验证不通过!",trigger:v.trigger||n.ruleTrigger||"change"}),s.value.dataLen&&k.push({validator:(O,g)=>g&&(g+"").length>s.value.dataLen?Promise.reject("最大长度["+s.value.dataLen+"],当前:["+(g+"").length+"]"):Promise.resolve(),trigger:v?.trigger||n.ruleTrigger||"change"}),k}),c=i.computed(()=>{const k=s.value.props||{};if(s.value.control=="a-input-number"){const v=s.value.rule||{};v.rangeMin!=null&&v.rangeMin!=null&&(k.min=v.rangeMin),v.rangeMax!=null&&v.rangeMax!=null&&(k.max=v.rangeMax)}return s.value.control=="a-date-picker"&&s.value.view?.dataFormat&&(k.format=s.value.view.dataFormat,k.valueFormat=s.value.view.dataFormat),s.value.required&&(k.required=s.value.required),k}),u=i.computed(()=>{const k=s.value.css||{},v=["form-item-"+s.value.name];return k.cssName&&v.push(k.cssName),n.platform=="app"?k.cssName?typeof k.cssName=="string"&&k.cssName.indexOf("all-line")<0&&v.push("all-line"):v.push("all-line"):s.value.view?.width&&(s.value.view.width>=3?(!k.cssName||typeof k.cssName=="string"&&k.cssName.indexOf("all-line")<0)&&v.push("all-line"):s.value.view.width==2&&v.push("2in-line")),v}),m=i.computed(()=>{const k=n.showColumn||3;let v=s.value.view?.labelWidth||n.labelWidth||9;return s.value.css?.cssName&&k>1&&typeof s.value.css.cssName=="string"&&s.value.css.cssName.indexOf("all-line")>=0?{span:Math.round(v/k)}:s.value.view?.width>=3&&k>1?{span:Math.round(v/k)}:{span:v}}),b=i.computed(()=>{const k=n.showColumn||3;let v=s.value.view?.valueWidth||n.valueWidth||19;return s.value.css?.cssName&&k>1&&u.value.includes("all-line")?{}:{span:v}}),y=i.ref();return i.watch(t,()=>{t.value&&e.editor?.model.value=="view"&&s.value.convert&&new Ke(s.value.convert).convert(t.value.toString()).then(k=>{y.value=k})}),(k,v)=>{const w=i.resolveComponent("a-form-item");return i.openBlock(),i.createBlock(ht,{class:i.normalizeClass(["unione-form-item",u.value]),style:i.normalizeStyle(s.value.css?.cssText)},{default:i.withCtx(()=>[a.value?(i.openBlock(),i.createBlock(w,{key:0,label:r.value,name:s.value.name,labelCol:m.value,wrapperCol:b.value,required:s.value.props?.required,rules:f.value,help:(!e.editor||e.editor.model.value!="view")&&s.value.props?.help,tooltip:s.value.props?.tooltip},{default:i.withCtx(()=>[!o.editor||o.editor.model.value!="view"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value.control||"a-input"),i.mergeProps({key:0,wid:s.value.wid,widget:s.value,editor:e.editor,disabled:o.disabled,onChange:d.value,value:t.value,"onUpdate:value":v[0]||(v[0]=O=>t.value=O)},c.value,{style:s.value.css?.props}),null,16,["wid","widget","editor","disabled","onChange","value","style"])):s.value.view=="html"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"text-view",innerHTML:y.value?y.value:t.value},null,8,qa)):(i.openBlock(),i.createElementBlock("div",Ua,i.toDisplayString(y.value?y.value:t.value),1))]),_:1},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip"])):i.createCommentVNode("",!0)]),_:1},8,["class","style"])}}}),[["__scopeId","data-v-c8c92250"]]);function tn(o,e=350){let t=null;return n=>{clearTimeout(t),t=setTimeout(()=>{o(n)},e)}}const Ha=ne(i.defineComponent({__name:"selectBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(o){Ie();const e=o,t=i.useModel(o,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]),s=i.computed(()=>(d.value.convert||e.convert||{}).search||!1),a=tn(f=>{h.value.search(f).then(c=>{n.value=c})},500);i.onMounted(()=>{h.value.load(t.value).then(f=>{n.value=f})});const r=i.ref({}),d=i.computed(()=>{const f=e.editor?.widget(e.wid)||e.widget||{};return f.event&&Object.keys(f.event).forEach(c=>{const u=f.event[c];r.value[c]=null,u.enable&&u.scriptText&&(r.value[c]=new Function("value","ctx",u.scriptText))}),f}),h=i.computed(()=>{const f=d.value.convert||e.convert||{};return new Ke(f)});return i.watch(t,()=>{t.value&&h.value.load(t.value).then(f=>{n.value=f})}),i.watch(()=>d.value.convert||e.convert||{},()=>{h.value.load().then(f=>{n.value=f})}),(f,c)=>{const u=i.resolveComponent("a-select");return i.openBlock(),i.createBlock(u,{class:"unione-form-select",options:l.value,showSearch:s.value,value:t.value,"onUpdate:value":c[0]||(c[0]=m=>t.value=m),onSearch:i.unref(a)},null,8,["options","showSearch","value","onSearch"])}}}),[["__scopeId","data-v-d885ca4f"]]),Ka=ne(i.defineComponent({__name:"switchBox",props:i.mergeModels({editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(o){const e=o,t=i.useModel(o,"value"),n=i.ref({});i.onMounted(()=>{a.value?.load(t.value).then(r=>{r.forEach(d=>{d.value&&(d.value=="1"||d.value=="true"||d.value=="TRUE")?(n.value.checkedChildren=d.label,d.value=="true"||d.value=="TRUE"?n.value.checkedValue=!0:n.value.checkedValue=1):(n.value.unCheckedChildren=d.label,d.value=="false"||d.value=="FALSE"?n.value.unCheckedValue=!1:n.value.unCheckedValue=0)})})});const l=i.ref({}),s=i.computed(()=>{const r=e.widget||{};return r.event&&Object.keys(r.event).forEach(d=>{const h=r.event[d];l.value[d]=null,h.enable&&h.scriptText&&(l.value[d]=new Function("value","ctx",h.scriptText))}),r}),a=i.computed(()=>{const r=s.value.convert||e.convert;return r?new Ke(r):null});return(r,d)=>{const h=i.resolveComponent("a-switch");return i.openBlock(),i.createBlock(h,i.mergeProps({class:"unione-form-switch"},n.value,{checked:t.value,"onUpdate:checked":d[0]||(d[0]=f=>t.value=f)}),null,16,["checked"])}}}),[["__scopeId","data-v-a56d945e"]]),Qa=ne(i.defineComponent({__name:"radioBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(o){const e=o,t=i.useModel(o,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]);i.onMounted(()=>{r.value.load(t.value||a.value.value).then(d=>{n.value=d})});const s=i.ref({}),a=i.computed(()=>{const d=e.editor?.widget(e.wid)||e.widget||{};return d.event&&Object.keys(d.event).forEach(h=>{const f=d.event[h];s.value[h]=null,f.enable&&f.scriptText&&(s.value[h]=new Function("value","ctx",f.scriptText))}),d}),r=i.computed(()=>{const d=a.value.convert||e.convert||{};return new Ke(d)});return(d,h)=>{const f=i.resolveComponent("a-radio-group");return i.openBlock(),i.createBlock(f,{class:"unione-form-radio",options:l.value,value:t.value,"onUpdate:value":h[0]||(h[0]=c=>t.value=c)},null,8,["options","value"])}}}),[["__scopeId","data-v-761054e0"]]),Ga=ne(i.defineComponent({__name:"checkBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(o){const e=o,t=i.useModel(o,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]);i.onMounted(()=>{r.value.load(t.value||a.value.value).then(d=>{n.value=d})});const s=i.ref({}),a=i.computed(()=>{const d=e.editor?.widget(e.wid)||e.widget||{};return d.event&&Object.keys(d.event).forEach(h=>{const f=d.event[h];s.value[h]=null,f.enable&&f.scriptText&&(s.value[h]=new Function("value","ctx",f.scriptText))}),d}),r=i.computed(()=>{const d=a.value.convert||e.convert||{};return new Ke(d)});return(d,h)=>{const f=i.resolveComponent("a-checkbox-group");return i.openBlock(),i.createBlock(f,{class:"unione-form-checkbox",options:l.value,value:t.value,"onUpdate:value":h[0]||(h[0]=c=>t.value=c)},null,8,["options","value"])}}}),[["__scopeId","data-v-e2f0f7fc"]]),Ya=ne(i.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(o){const e=i.ref(),t=i.useModel(o,"value");return i.watch(()=>e.value,()=>{e.value?t.value=K.utils.sm2Encrypt(e.value):t.value=""}),(n,l)=>{const s=i.resolveComponent("a-input-password");return i.openBlock(),i.createBlock(s,{class:"unione-form-password",value:e.value,"onUpdate:value":l[0]||(l[0]=a=>e.value=a)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]),Xa={class:"unione-props-setting unione-query-setting"},Ja={class:"unione-query-opts"},Za={key:0},er=["onClick"],tr={key:1},ir={key:1,class:"edit-field"},nr=["onClick"],lr=ne(i.defineComponent({__name:"querySetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(o){const e=o,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:O})=>O+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"30px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"55px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"}]),n=i.computed(()=>{const O=e.editor.widget(e.wid)||{};return O.configs||(O.configs={}),O.configs.btns||(O.configs.btns=[]),O}),l=i.computed(()=>(e.editor.dataModels()||[]).map(g=>({value:g.sn,label:g.title+"("+g.name+")"}))),s=i.computed(()=>{const O=[],g=[];return n.value.configs.btns||(n.value.configs.btns=[]),n.value.configs.btns.forEach(p=>{O.push(p),g.push(p.name)}),g.includes("query")||O.splice(0,0,{visible:!0,name:"query",title:"搜索",type:"primary"}),g.includes("reset")||O.splice(1,0,{visible:!0,name:"reset",title:"重置",type:"default"}),g.includes("reset")||O.splice(1,0,{visible:!0,name:"advanced",title:"高级搜索",type:"default"}),O.sort((p,N)=>{const V=p.index||1,C=N.index||1;return V-C}),O}),a=i.ref(null);function r(O){a.value&&a.value.open(O,g=>{g.visible=!0,Object.keys(g).forEach(p=>{O[p]=g[p]}),n.value.configs.btns.sort((p,N)=>{const V=p.index||1,C=N.index||1;return V-C}),n.value.configs.btns=[...n.value.configs.btns]})}function d(){const O=n.value.configs.btns.length+1;let g={title:"新增",name:"new_"+O,size:"default",index:O,visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.btns.push(g),e.editor.widget(e.wid,n.value),a.value.open(g,p=>{Object.keys(p).forEach(N=>{g[N]=p[N]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(O){const g=()=>{if(["query","reset","advanced"].includes(O.name))O.visible=!1,n.value.configs.btns=[...n.value.configs.btns];else{const p=[];n.value.configs.btns.forEach(N=>{N.name!=O.name&&p.push(N)}),n.value.configs.btns=p}};J.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{g()}})}const f=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),c=i.computed(()=>f.value.fields?.length?f.value.fields:[]),u={mounted:O=>O.focus()},m=i.ref({});function b(){const O=Object.keys(m.value);if(O.length)for(let g in O){const p=c.value.filter(N=>N.name==g);if(p&&p[0]){let N=m.value[g];Object.keys(N).forEach(V=>{if(V=="showIndex"){const C=p[0].show?.query||{};p[0].show||(p[0].show={}),p[0].show.query={...C,index:N[V]}}else p[0][V]=N[V]})}}m.value={}}function y(O,g){b();const p={};p[g]=O[g]||"",g=="showIndex"&&(p[g]=O.show?.query?.index),m.value[O.name]=p}function k(O,g){if(!O||!g){m.value={};return}const p=m.value[O.name][g];if(g=="showIndex"){const N=O.show?.query||{};O.show||(O.show={}),O.show.query={...N,index:p}}else O[g]=p;m.value={}}function v(O,g){c.value.filter(N=>N.name==O.name).forEach(N=>{N[g]=!N[g]})}const w=i.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:O=>{const g=w.value.options.filter(p=>p.value==O);return g[0]?g[0].label:O}});return(O,g)=>{const p=i.resolveComponent("a-divider"),N=i.resolveComponent("CloseOutlined"),V=i.resolveComponent("a-button"),C=i.resolveComponent("PlusOutlined"),x=i.resolveComponent("a-select"),S=i.resolveComponent("ToolOutlined"),M=i.resolveComponent("a-checkbox"),T=i.resolveComponent("a-input-number"),E=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",Xa,[i.createVNode(p,{orientation:"left"},{default:i.withCtx(()=>g[3]||(g[3]=[i.createTextVNode("查询按钮")])),_:1}),i.createElementVNode("div",Ja,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,I=>(i.openBlock(),i.createBlock(V,i.mergeProps({key:I.name,class:["btn",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size||"default",ref_for:!0},I.props||{},{onClick:L=>r(I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(N,{key:0,class:"btn-del",onClick:i.withModifiers(L=>h(I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(V,{class:i.normalizeClass(["btn","btn-add"]),onClick:g[0]||(g[0]=I=>d()),size:"small"},{default:i.withCtx(()=>[i.createVNode(C)]),_:1})]),i.createVNode(p,{orientation:"left"},{default:i.withCtx(()=>g[4]||(g[4]=[i.createTextVNode("查询字段")])),_:1}),g[5]||(g[5]=i.createTextVNode(" 数据模型:")),i.createVNode(x,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":g[1]||(g[1]=I=>n.value.dataModel=I)},null,8,["options","value"]),i.createVNode(E,{columns:t.value,"data-source":c.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:I})=>[["showIndex","queryType"].includes(I.key)?(i.openBlock(),i.createElementBlock("span",Za,[i.createVNode(S),i.createTextVNode(" "+i.toDisplayString(I.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:I,text:L,record:A})=>[["queryType"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!m.value[A.name]||!Object.keys(m.value[A.name]).includes(I.dataIndex))&&!L&&"empty"]),onClick:U=>y(A,I.dataIndex)},[m.value[A.name]&&Object.keys(m.value[A.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(x,{key:0,value:A[I.dataIndex],"onUpdate:value":U=>A[I.dataIndex]=U,allowClear:!0,options:w.value.options,onBlur:g[2]||(g[2]=U=>k())},null,8,["value","onUpdate:value","options"])),[[u]]):(i.openBlock(),i.createElementBlock("span",tr,i.toDisplayString(w.value.showLabel(L)),1))],10,er)):["isQuery"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",ir,[i.createVNode(M,{checked:A[I.dataIndex],onClick:U=>v(A,I.dataIndex)},null,8,["checked","onClick"])])):I.dataIndex=="showIndex"?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!m.value[A.name]||!Object.keys(m.value[A.name]).includes(I.dataIndex))&&!L&&"empty"]),onClick:U=>y(A,I.dataIndex)},[m.value[A.name]&&Object.keys(m.value[A.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(T,{key:0,value:m.value[A.name][I.dataIndex],"onUpdate:value":U=>m.value[A.name][I.dataIndex]=U,onBlur:U=>k(A,I.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[u]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(A.show?.query?.index||" "),1)],64))],10,nr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(ci,{ref_key:"btnSetting",ref:a},null,512)])}}}),[["__scopeId","data-v-ce575063"]]),sr={class:"query-btn"},or={class:"btn-advanced-overlay"},vl=ne(i.defineComponent({__name:"queryForm",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},fields:{type:Array},params:{type:Object,default(){return{}}}},emits:["query","reset","btnClick"],setup(o,{emit:e}){const t=o,n=i.computed(()=>{const k=t.editor?.widget(t.wid)||t.widget||{};return k.btns||(k.btns=[]),k}),l=i.computed(()=>({visible:!0,name:"keywords",title:"关键字",placeholder:"请输入搜索内容",...n.value.keywords||{}})),s=i.computed(()=>{let k=[];return n.value.fields?.length&&(k=n.value.fields),k.length==0&&t.fields?.length&&(k=t.fields),k.sort((v,w)=>{const O=v.show?.query?.index||1,g=w.show?.query?.index||1;return O-g}),k.forEach(v=>{!v.widget&&!v.control&&v.convert&&(v.widget="unione-select-box"),v.widget=v.widget||v.control||"a-input",v.defaultValue!=null&&v.defaultValue!="undefined"&&typeof v.defaultValue<"u"&&(f.value[v.name]=v.defaultValue,v.value=v.defaultValue)}),k}),a=i.computed(()=>n.value.labelWidth||7),r=i.computed(()=>{const k=n.value.btns.filter(v=>v.name=="advanced")[0]||{};return k.event?.clickScript&&(k.event.click=new Function("ctx","btn","event",k.event.clickScript)),k.event?.disableScript&&(k.event.disable=new Function("ctx","btn",k.event.disableScript)),k.event?.visibleScript&&(k.event.visible=new Function("ctx","btn",k.event.visibleScript)),{visible:!0,name:"advanced",title:"高级搜索",...k}}),d=["query","reset","advanced"],h=i.computed(()=>{const k=n.value.btns.filter(w=>w.name!="advanced"),v=[];return k.forEach(w=>{w.size||(w.size="default"),v.push(w.name)}),v.includes("query")||k.splice(0,0,{visible:!0,name:"query",title:"查询",size:"default",type:"primary"}),v.includes("reset")||k.splice(1,0,{visible:!0,name:"reset",title:"重置",size:"default",type:"default"}),k.sort((w,O)=>{const g=w.index||1,p=O.index||1;return g-p}),k}),f=i.ref({}),c=i.computed(()=>{const k={};return n.value.params?Object.keys(n.value.params).forEach(v=>{k[v]=n.value.params[v]}):t.params&&Object.keys(t.params).forEach(v=>{k[v]=t.params[v]}),k});i.onMounted(()=>{t.editor?.ebus.$on("query-form-params",k=>{n.value.params=k}),b()});const u=e;function m({btn:k,event:v}){console.log("unione query form btn click",k,v),k.name=="query"&&b(),k.name=="reset"&&y(),u("btnClick",{btn:k,event:v})}function b(){const k=[];s.value.forEach(w=>{w.visible&&k.push(w.name)});const v={params:{...c.value},keywords:""};Object.keys(f.value).forEach(w=>{k.includes(w)&&(v.params[w]=f.value[w])}),l.value.visible&&f.value[l.value.name]&&(v.keywords=f.value[l.value.name]),u("query",v),t.editor?.ebus.$emit("table-list-search",v)}function y(){f.value={},s.value.forEach(v=>{v.visible=!1});const k={params:{...c.value},keywords:""};u("reset",k),t.editor?.ebus.$emit("table-list-reset",k)}return(k,v)=>{const w=i.resolveComponent("a-input"),O=i.resolveComponent("a-form-item"),g=i.resolveComponent("unione-btn"),p=i.resolveComponent("a-checkbox"),N=i.resolveComponent("DownOutlined"),V=i.resolveComponent("a-button"),C=i.resolveComponent("a-dropdown"),x=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(ht,{class:"unione-query-form",model:t.editor?.model.value,"setting-title":"查询设置"},i.createSlots({default:i.withCtx(()=>[i.createVNode(x,{model:f.value,layout:"horizontal","label-col":{span:a.value}},{default:i.withCtx(()=>[l.value.visible?(i.openBlock(),i.createBlock(O,{key:0,label:l.value.title,class:"query-field keywords",name:l.value.name,style:i.normalizeStyle({width:a.value})},{default:i.withCtx(()=>[i.createVNode(w,{placeholder:l.value.placeholder,value:f.value[l.value.name],"onUpdate:value":v[0]||(v[0]=S=>f.value[l.value.name]=S),allowClear:"",onKeyup:i.withKeys(b,["enter"])},null,8,["placeholder","value"])]),_:1},8,["label","name","style"])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,S=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:S.name},[S.visible?(i.openBlock(),i.createBlock(O,{key:0,label:S.title,class:i.normalizeClass(["query-field",S.name]),style:i.normalizeStyle({width:a.value}),name:S.name},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(S.widget),i.mergeProps({placeholder:S.placeholder,value:f.value[S.name],"onUpdate:value":M=>f.value[S.name]=M,ref_for:!0},S.props||{},{allowClear:"",widget:S}),null,16,["placeholder","value","onUpdate:value","widget"]))]),_:2},1032,["label","class","style","name"])):i.createCommentVNode("",!0)],64))),128)),i.createElementVNode("div",sr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,S=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:S.name},[S.visible!=!1?(i.openBlock(),i.createBlock(g,{key:0,widget:S,editor:o.editor,onClick:m,preset:d},null,8,["widget","editor"])):i.createCommentVNode("",!0)],64))),128)),r.value.visible&&s.value.length?(i.openBlock(),i.createBlock(C,{key:0,class:"btn btn-advanced",trigger:[r.value.trigger||"hover"]},{overlay:i.withCtx(()=>[i.createElementVNode("div",or,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,S=>(i.openBlock(),i.createBlock(p,{key:S.name,class:"item",checked:S.visible,onClick:M=>S.visible=!S.visible},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(S.title),1)]),_:2},1032,["checked","onClick"]))),128))])]),default:i.withCtx(()=>[i.createVNode(V,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value.title)+" ",1),i.createVNode(N)]),_:1})]),_:1},8,["trigger"])):i.createCommentVNode("",!0)])]),_:1},8,["model","label-col"])]),_:2},[t.editor&&t.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(lr,{editor:t.editor,wid:t.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-05f95e36"]]),ar={class:"unione-props-setting unione-table-setting"},rr={class:"unione-table-tools"},dr={key:1,class:"unione-table-opts"},cr={key:0},hr=["onClick"],fr={key:1,class:"edit-field"},ur=["onClick"],pr={key:1},mr=ne(i.defineComponent({__name:"tableSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(o){const e=o,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:C})=>C+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"显示",dataIndex:"isList",key:"isList",width:"30px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"30px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"},{title:"对齐方式",dataIndex:"align",key:"align",width:"55px",align:"center",options:[{value:"left",label:"居左"},{value:"center",label:"居中"},{value:"right",label:"居右"}],showLabel(C,x){let S=C.filter(M=>M.value==x);return S&&S[0]&&S[0].label||x}},{title:"固定位置",dataIndex:"fixed",key:"fixed",width:"55px",align:"center",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}],showLabel(C,x){let S=C.filter(M=>M.value==x);return S&&S[0]&&S[0].label||x}},{title:"列宽",dataIndex:"showWidth",key:"showWidth",width:"50px",align:"center"}]),n=i.computed(()=>{const C=e.editor.widget(e.wid)||{};return C.configs||(C.configs={}),C.configs.leftBtns||(C.configs.leftBtns=[]),C.configs.rightBtns||(C.configs.rightBtns=[]),C.configs.operation||(C.configs.operation={}),C.configs.operation.btns||(C.configs.operation.btns=[]),C.configs.operation.more||(C.configs.operation.more={}),C}),l=i.computed(()=>(e.editor.dataModels()||[]).map(x=>({value:x.sn,label:x.title+"("+x.name+")"}))),s=i.computed(()=>{if(!n.value)return[];const C=[],x=n.value.configs.leftBtns;if(x.forEach(S=>{C.push(S.name)}),!C.includes("add")){const S={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};x.splice(0,0,S)}if(!C.includes("delBatch")){const S={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};x.splice(1,0,S)}return x}),a=i.computed(()=>{if(!n.value)return[];const C=[],x=n.value.configs.rightBtns;if(x.forEach(S=>{C.push(S.name)}),!C.includes("downData")){const S={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"导出",index:0,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downData"};x.splice(0,0,S)}if(!C.includes("impData")){const S={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};x.splice(1,0,S)}if(!C.includes("expData")){const S={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};x.splice(2,0,S)}if(!C.includes("downTmpl")){const S={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};x.splice(3,0,S)}return x});function r(C,x){C=="left"?f.value.open(x,S=>{S.visible=!0,Object.keys(S).forEach(M=>{x[M]=S[M]}),n.value.configs.leftBtns.sort((M,T)=>{const E=M.index||1,I=T.index||1;return E-I}),n.value.configs.leftBtns=[...n.value.configs.leftBtns]}):f.value.open(x,S=>{S.visible=!0,Object.keys(S).forEach(M=>{x[M]=S[M]}),n.value.configs.rightBtns.sort((M,T)=>{const E=M.index||1,I=T.index||1;return E-I}),n.value.configs.rightBtns=[...n.value.configs.rightBtns]})}function d(C){const x=C=="left"?n.value.configs.leftBtns.length:n.value.configs.rightBtns.length;let S={title:"新增"+x,name:"new_"+x,index:x,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};C=="left"?n.value.configs.leftBtns.push(S):n.value.configs.rightBtns.push(S),e.editor.widget(e.wid,n.value),r(C,S)}function h(C,x){const S=()=>{if(["add","delBatch","expData","impData","downTmpl"].includes(x.name))x.visible=!1,C=="left"?n.value.configs.leftBtns=[...n.value.configs.leftBtns]:n.value.configs.rightBtns=[...n.value.configs.rightBtns];else if(C=="left"){const M=[];n.value.configs.leftBtns.forEach(T=>{T.name!=x.name&&M.push(T)}),n.value.configs.leftBtns=M}else{const M=[];n.value.configs.rightBtns.forEach(T=>{T.name!=x.name&&M.push(T)}),n.value.configs.rightBtns=M}};J.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{S()}})}const f=i.ref(null);function c(C){f.value.open(C,x=>{x.visible=!0,Object.keys(x).forEach(S=>{C[S]=x[S]}),n.value.configs.operation.btns.sort((S,M)=>{const T=S.index||1,E=M.index||1;return T-E}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function u(){const C=n.value.configs.operation.btns.length+1;let x={title:"新增"+C,name:"new_"+C,index:C,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.operation.btns.push(x),e.editor.widget(e.wid,n.value),f.value.open(x,S=>{Object.keys(S).forEach(M=>{x[M]=S[M]}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function m(C){const x=()=>{if(["delete","view","edit"].includes(C.name))C.visible=!1,n.value.configs.operation.btns=[...n.value.configs.operation.btns];else{const S=[];n.value.configs.operation.btns.forEach(M=>{M.name!=C.name&&S.push(M)}),n.value.configs.operation.btns=S}};J.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{x()}})}const b=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),y=i.computed(()=>b.value.fields?.length?(b.value.fields.forEach(C=>{C.show||(C.show={}),C.show.list||(C.show.list={})}),b.value.fields):[]),k={mounted:C=>C.focus()},v=i.ref({});function w(){const C=Object.keys(v.value);if(C.length)for(let x in C){const S=y.value.filter(M=>M.name==x);if(S&&S[0]){let M=v.value[x];Object.keys(M).forEach(T=>{S[0].show||(S[0].show={}),S[0].show.list||(S[0].show.list={}),T=="showIndex"?S[0].show.list.index=M[T]:T=="showWidth"?S[0].show.list.width=M[T]:T=="fixed"?S[0].show.list.fixed=M[T]:T=="align"?S[0].show.list.align=M[T]:S[0][T]=M[T]})}}v.value={}}function O(C,x){w();const S={};x=="showIndex"?S[x]=C.show?.list?.index:x=="showWidth"?S[x]=C.show?.list?.width:x=="fixed"?S[x]=C.show?.list?.fixed:x=="align"?S[x]=C.show?.list?.align:S[x]=C[x]||"",v.value[C.name]=S}function g(C,x){if(!C||!x){v.value={};return}const S=v.value[C.name][x];C.show||(C.show={}),C.show.list||(C.show.list={}),x=="showIndex"?C.show.list.index=S:x=="showWidth"?C.show.list.width=S:x=="fixed"?C.show.list.fixed=S:x=="align"?C.show.list.align=S:C[x]=S,v.value={}}function p(C,x){return x=="showIndex"?C.show?.list?.index:x=="showWidth"?C.show?.list?.width:x=="fixed"?C.show?.list?.fixed:x=="align"?C.show?.list?.align:C[x]}function N(C,x){y.value.filter(M=>M.name==C.name).forEach(M=>{M[x]=!M[x]})}const V=i.ref({options:[{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:C=>{const x=V.value.options.filter(S=>S.value==C);return x[0]?x[0].label:C}});return(C,x)=>{const S=i.resolveComponent("a-divider"),M=i.resolveComponent("CloseOutlined"),T=i.resolveComponent("a-button"),E=i.resolveComponent("PlusOutlined"),I=i.resolveComponent("a-input"),L=i.resolveComponent("a-form-item"),A=i.resolveComponent("a-col"),U=i.resolveComponent("a-input-number"),P=i.resolveComponent("a-checkbox"),G=i.resolveComponent("a-row"),j=i.resolveComponent("a-select"),B=i.resolveComponent("ToolOutlined"),F=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",ar,[i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[8]||(x[8]=[i.createTextVNode("工具设置")])),_:1}),i.createElementVNode("div",rr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,_=>(i.openBlock(),i.createBlock(T,i.mergeProps({key:_.name,class:["btn",_.name,!_.visible&&"deleted"],type:_.visible?_.type:"default",size:_.size,ref_for:!0},_.props||{},{onClick:D=>r("left",_)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(_.title)+" ",1),_.visible?(i.openBlock(),i.createBlock(M,{key:0,class:"bool-del",onClick:i.withModifiers(D=>h("left",_),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[_.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(_.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(T,{class:i.normalizeClass(["btn","tool-add"]),size:"small",onClick:x[0]||(x[0]=_=>d("left"))},{default:i.withCtx(()=>[i.createVNode(E)]),_:1}),i.createVNode(T,{class:i.normalizeClass(["btn","tool-add","right"]),onClick:x[1]||(x[1]=_=>d("right")),size:"small"},{default:i.withCtx(()=>[i.createVNode(E)]),_:1}),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,_=>(i.openBlock(),i.createBlock(T,i.mergeProps({key:_.name,class:["btn","right",_.name,!_.visible&&"deleted"],type:_.visible?_.type:"default",size:_.size,ref_for:!0},_.props||{},{onClick:D=>r("right",_)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(_.title)+" ",1),_.visible?(i.openBlock(),i.createBlock(M,{key:0,class:"bool-del",onClick:i.withModifiers(D=>h("right",_),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[_.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(_.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128))]),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[9]||(x[9]=[i.createTextVNode("操作设置")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createBlock(G,{key:0},{default:i.withCtx(()=>[i.createVNode(A,{span:7},{default:i.withCtx(()=>[i.createVNode(L,{label:"操作标题"},{default:i.withCtx(()=>[i.createVNode(I,{value:n.value.configs.operation.title},null,8,["value"])]),_:1})]),_:1}),i.createVNode(A,{span:5},{default:i.withCtx(()=>[i.createVNode(L,{label:"显示宽度",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode(U,{value:n.value.configs.operation.width,"onUpdate:value":x[2]||(x[2]=_=>n.value.configs.operation.width=_)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(A,{span:6},{default:i.withCtx(()=>[i.createVNode(L,{label:"显示按钮数量",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode(U,{value:n.value.configs.operation.count,"onUpdate:value":x[3]||(x[3]=_=>n.value.configs.operation.count=_)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(A,{span:5},{default:i.withCtx(()=>[i.createVNode(L,{label:"是否显示"},{default:i.withCtx(()=>[i.createVNode(P,{checked:n.value.configs.operation.visible,"onUpdate:checked":x[4]||(x[4]=_=>n.value.configs.operation.visible=_)},null,8,["checked"])]),_:1})]),_:1})]),_:1})):i.createCommentVNode("",!0),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[10]||(x[10]=[i.createTextVNode("操作按钮")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createElementBlock("div",dr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.configs.operation.btns,_=>(i.openBlock(),i.createBlock(T,i.mergeProps({key:_.name,class:["btn",_.name,!_.visible&&"deleted"],type:_.visible?_.type:"default",size:_.size||"small",ref_for:!0},_.props||{},{onClick:D=>c(_)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(_.title)+" ",1),_.visible?(i.openBlock(),i.createBlock(M,{key:0,class:"btn-del",onClick:i.withModifiers(D=>m(_),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[_.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(_.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(T,{class:i.normalizeClass(["btn","btn-add"]),onClick:x[5]||(x[5]=_=>u()),size:"small"},{default:i.withCtx(()=>[i.createVNode(E)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(S,{orientation:"left"},{default:i.withCtx(()=>x[11]||(x[11]=[i.createTextVNode("表头设置")])),_:1}),x[12]||(x[12]=i.createTextVNode(" 数据模型:")),i.createVNode(j,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":x[6]||(x[6]=_=>n.value.dataModel=_)},null,8,["options","value"]),i.createVNode(F,{columns:t.value,"data-source":y.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:_})=>[["showIndex","showWidth","align","fixed"].includes(_.key)?(i.openBlock(),i.createElementBlock("span",cr,[i.createVNode(B),i.createTextVNode(" "+i.toDisplayString(_.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:_,record:D})=>[["showIndex","showWidth"].includes(_.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!v.value[D.name]||!Object.keys(v.value[D.name]).includes(_.dataIndex))&&!p(D,_.dataIndex)&&"empty"]),onClick:$=>O(D,_.dataIndex)},[v.value[D.name]&&Object.keys(v.value[D.name]).includes(_.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(U,{key:0,value:v.value[D.name][_.dataIndex],"onUpdate:value":$=>v.value[D.name][_.dataIndex]=$,onBlur:$=>g(D,_.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[k]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(p(D,_.dataIndex)),1)],64))],10,hr)):["isList","isQuery","isSort"].includes(_.dataIndex)?(i.openBlock(),i.createElementBlock("div",fr,[i.createVNode(P,{checked:D[_.dataIndex],onClick:$=>N(D,_.dataIndex)},null,8,["checked","onClick"])])):["align","fixed"].includes(_.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!v.value[D.name]||!Object.keys(v.value[D.name]).includes(_.dataIndex))&&!p(D,_.dataIndex)&&"empty"]),onClick:$=>O(D,_.dataIndex)},[v.value[D.name]&&Object.keys(v.value[D.name]).includes(_.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(j,{key:0,value:D.show.list[_.dataIndex],"onUpdate:value":$=>D.show.list[_.dataIndex]=$,allowClear:!0,options:_.options,onBlur:x[7]||(x[7]=$=>g())},null,8,["value","onUpdate:value","options"])),[[k]]):(i.openBlock(),i.createElementBlock("span",pr,i.toDisplayString(_.showLabel(_.options,p(D,_.dataIndex))),1))],10,ur)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(ci,{ref_key:"btnSetting",ref:f,preset:["edit","view","add","delBatch","expData","impData","downTmpl"]},null,512)])}}}),[["__scopeId","data-v-c966c24c"]]);function nn(o){const e=o.toLowerCase().split("_"),t=[];t.push(e[0]);for(let n=1;n<e.length;n++){const l=e[n];l&&(t.push(l.charAt(0).toUpperCase()),l.length>1&&t.push(l.substring(1)))}return t.join("")}const gr={toHump:nn},kr={class:"unione-table-tools"},br={class:"unione-table-data"},yr={key:0,class:"unione-table-opts"},Cl=ne(i.defineComponent({__name:"tableList",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},loading:{type:Boolean,default:!1},pagination:{type:Object,required:!1},dataList:{type:Array,default(){return[]}},rowKey:{type:String,default:"id"}},emits:["edit","view","add","delete","delBatch","expData","impData","downTmpl","leftBtnClick","rightBtnClick","optBtnClick","btnClick","change"],setup(o,{expose:e,emit:t}){const n=Ie(),l=o,s=i.computed(()=>l.editor?.widget(l.wid)||l.widget||{}),a=i.computed(()=>s.value.props||{}),r=i.computed(()=>s.value.rowKey||l.rowKey||"id"),d=i.computed(()=>s.value.dsn?l.editor?.dataManager().use(s.value.dsn,"list"):null),h=i.computed(()=>{const E=l.dataList||[];return!E.length&&d.value?d.value.data().body||[]:E}),f=i.computed(()=>{if(s.value.operation==!1)return{visible:!1};const E=K.utils.obj.ext(s.value.operation||{},{title:"操作",width:200,count:2,btns:[],more:{title:"更多",visible:!0,trigger:"hover",size:"small",layout:"horizontal",items:[]}}),I=[];let L=(s.value.operation?.btns||[]).map(A=>(typeof A=="string"&&(A={name:A,visible:!1}),A));if(L.forEach(A=>{I.push(A.name)}),I.includes("edit")||L.splice(0,0,{title:"编辑",name:"edit",type:"default",visible:!0}),I.includes("view")||L.splice(1,0,{title:"查看",name:"view",type:"default",visible:!0}),I.includes("delete")||L.push({title:"删除",name:"delete",type:"default",props:{danger:!0},visible:!0}),l.editor&&l.editor.type.value!="code"){const A=L.filter(P=>P.name=="edit")[0];if(A.visible&&(A.action||(A.action={}),A.action.type||(A.action.type="route"),!A.action.href)){const P=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",G=l.editor.model.value;A.action.link=n.editPageUrl+"?psn="+P+"&model="+G+"&id={row."+l.rowKey+"}"}const U=L.filter(P=>P.name=="view")[0];if(U.visible&&(U.action||(U.action={}),U.action.type||(U.action.type="route"),!U.action.href)){const P=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form";U.action.link=n.viewPageUrl+"?psn="+P+"&model=view&id={row."+l.rowKey+"}"}}return L=L.filter(A=>A.visible!=!1).sort((A,U)=>{const P=A.index||1,G=U.index||1;return P-G}),E.count&&(L.length>E.count+1?(E.btns=L.slice(0,E.count),E.more.items=L.slice(E.count,L.length),E.more.visible=!0):(E.btns=L,E.more.visible=!1)),E}),c=i.computed(()=>{let E=[];s.value.columns?.length&&(E=[...s.value.columns]);const I=[];E.forEach((A,U)=>{A.dataIndex=A.name,A.convert&&(A.dataIndex=A.name+"Label",A.convertObj=new Ke(A.convert),A.customCell=(P,G,j)=>{const B=P[j.name];A.convertObj&&(P[j.dataIndex]==null||P[j.dataIndex]==null)&&B!=null&&B!=null&&(B+"").length>0&&(P[j.dataIndex]=B,A.convertObj.convert(B).then(F=>{F&&(P[j.dataIndex]=F)}))}),A.sort?.enable&&(A.sorter=!0,A.sort.multiple&&(A.sorter={},A.sorter.multiple=A.sort.multiple),A.sort.defoult&&(A.defaultSortOrder=A.sort.asc?"ascend":"descend")),A.customRender=({text:P})=>P||"--",A.fkey?.enable&&(A.fkey.labelName&&(A.dataIndex=nn(A.fkey.labelName)),A.fkey.labelTitle&&(A.title=A.fkey.labelTitle),A.customRender=({record:P,column:G})=>P&&P[G.name+"FEntry"]&&P[G.name+"FEntry"][G.dataIndex]||"--",A.fkey.fields?.forEach((P,G)=>{if(!P.name)return;const j=nn(P.name),B={fkName:A.name,title:P.title,name:j,dataIndex:P.name,width:P.width,index:P.index||U+G+1,customRender:({record:F,column:_})=>{if(F&&F[_.fkName+"FEntry"]){const D=F[_.fkName+"FEntry"][_.name];if(D)return P.convertObj&&P.convertObj.convert(D)||D}return"--"}};P.convert&&(P.convertObj=new Ke(P.convert)),I.push(B)}))}),I.forEach(A=>{E.splice(A.index,0,A)});const L=K.utils.obj.ext(s.value.rownum,{title:"序号",fixed:"left",align:"center",width:60,visible:!0});return L&&L.visible!=!1&&(L.customRender=A=>O.value?(O.value.current-1)*O.value.pageSize+A.index+1:A.index,E=[L,...E]),f.value&&f.value.visible!=!1&&E.push({fixed:"right",align:"center",...f.value,name:"operation"}),E}),u=i.computed(()=>{if(s.value.leftBtns===!1)return[];const E=[],I=[];if((s.value.leftBtns||[]).map(A=>(typeof A=="string"&&(A={name:A,visible:!1}),A)).forEach(A=>{A.visible!=!1&&E.push(A),I.push(A.name),A.name=="delBatch"&&!g.value&&(A.visible=!1)}),!I.includes("add")){const A={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};E.splice(0,0,A)}if(!I.includes("delBatch")&&g.value){const A={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};E.splice(1,0,A)}if(l.editor&&l.editor.type.value!="code"){const A=E.filter(U=>U.name=="add")[0];if(A.visible&&(A.action||(A.action={}),A.action.type||(A.action.type="route"),!A.action.href)){const U=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",P=l.editor.model.value;A.action.link=n.addPageUrl+"?psn="+U+"&model="+P}}return E});function m({btn:E,event:I}){if(n.isDebug&&console.log("unione table left btn click",E,I),E.name=="delBatch"){if(!p.value.selectedRowKeys.length){J.Modal.info({title:"提示信息",content:"请选择要删除的记录!"});return}if(d.value){d.value.deleteByIds(p.value.selectedRowKeys).then(()=>{M(),S(!0)});return}J.Modal.confirm({title:"确认信息",content:"请确认是否要删除选中的("+p.value.selectedRowKeys.length+")数据",onOk:()=>{V("delBatch",{btn:E,event:I,keys:p.value.selectedRowKeys}),V("leftBtnClick",{btn:E,event:I,keys:p.value.selectedRowKeys}),V("btnClick",{btn:E,event:I,keys:p.value.selectedRowKeys})}});return}V(E.name,{btn:E,event:I}),V("leftBtnClick",{btn:E,event:I}),V("btnClick",{btn:E,event:I})}const b=i.computed(()=>{if(s.value.rightBtns===!1)return[];const E=[],I=[];if((s.value.rightBtns||[]).map(A=>(typeof A=="string"&&(A={name:A,visible:!1}),A)).forEach(A=>{A.visible!=!1&&E.push(A),I.push(A.name)}),!I.includes("impData")){const A={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};E.splice(1,0,A)}if(!I.includes("expData")){const A={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};E.splice(2,0,A)}if(!I.includes("downTmpl")){const A={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};E.splice(3,0,A)}return E});function y({btn:E,event:I}){n.isDebug&&console.log("unione table right btn click",E,I),V(E.name,{btn:E,event:I}),V("rightBtnClick",{btn:E,event:I}),V("btnClick",{btn:E,event:I})}const k=i.computed(()=>({bordered:!0,size:"small",...s.value.attrs||{}})),v=i.ref({}),w=i.ref(null),O=i.computed(()=>K.utils.obj.ext(l.pagination||s.value.pagination,{showTotal:E=>"共"+E+"记录",pageSize:l.pagination?.pageSize||d.value?.data()?.pageSize||10,current:l.pagination?.current||d.value?.data()?.page||1,total:l.pagination?.total||d.value?.data()?.total||0,position:["bottomCenter"]})),g=i.computed(()=>typeof s.value.selection<"u"?s.value.selection:!0),p=i.ref({selectedRowKeys:[],selectedRowList:[],onChange:(E,I)=>{p.value.selectedRowKeys=E,p.value.selectedRowList=I},getCheckboxProps:E=>({disabled:E.checkable})}),N=["edit","view","add","delete","delBatch","impData","expData","downTmpl"],V=t;function C({btn:E,event:I},L){if(n.isDebug&&console.log("unione table opt btn click",E,I),E.name=="delete"){if(d.value){d.value.deleteByIds([L[r.value]]).then(()=>{M(),p.value.selectedRowKeys=p.value.selectedRowKeys.filter(A=>A!=L[r.value]),p.value.selectedRowList=p.value.selectedRowList.filter(A=>A[r.value]!=L[r.value])});return}J.Modal.confirm({title:"确认信息",content:"请确认是否要删除该记录?",onOk:()=>{V(E.name,{btn:E,event:I,row:L}),V("optBtnClick",{btn:E,event:I,row:L}),V("btnClick",{btn:E,event:I,row:L})}});return}V(E.name,{btn:E,event:I,row:L}),V("optBtnClick",{btn:E,event:I,row:L}),V("btnClick",{btn:E,event:I,row:L})}function x(E,I,L,A){console.log("tableChanged",E,I,L,A),w.value={page:E.current,pageSize:E.pageSize},L&&(Array.isArray(L)?(w.value.sorts=[],L.forEach(U=>{w.value.sorts.push({name:U.column.name,asc:U.order=="ascend"})})):L.column&&(w.value.sorts=[{name:L.column.name,asc:L.order=="ascend"}])),M(),V("change",{pagination:E,filters:I,sorter:L,event:A})}function S(E=!1){E?(p.value.selectedRowKeys=[],p.value.selectedRowList=[]):J.Modal.confirm({title:"确认信息",content:`确定要清除当前选中的(${p.value.selectedRowKeys.length})条数据?`,centered:!0,onOk:()=>{p.value.selectedRowKeys=[],p.value.selectedRowList=[]}})}function M(){if(d.value){const E={page:O.value.current,pageSize:O.value.pageSize,keywords:v.value.keywords,body:v.value.params||{}};w.value?.page&&(E.page=w.value.page),w.value?.pageSize&&(E.pageSize=w.value.pageSize),w.value?.sorts&&(E.sorts=w.value.sorts),console.log("dataStorage find params",E),d.value.find(E)}}i.onMounted(()=>{c.value?.forEach(E=>{E.sort?.enable&&E.sort.defoult&&(w.value||(w.value={},w.value.sorts||(w.value.sorts=[]),w.value.sorts.push({name:E.name,asc:E.sort.asc==!0})))}),l.editor?.ebus.$on("table-list-search",E=>{console.log("table-list-search",E),v.value=E||{},M()}),l.editor?.ebus.$on("table-list-reset",()=>{console.log("table-list-reset"),v.value={},M(),S(!0)}),l.editor?.ebus.$on("table-list-reload",()=>{console.log("table-list-reload"),M()})});function T(){return{keys:p.value.selectedRowKeys,rows:p.value.selectedRowList}}return e({getSelected:T,clearSelected:S}),(E,I)=>{const L=i.resolveComponent("unione-btn"),A=i.resolveComponent("DownOutlined"),U=i.resolveComponent("a-button"),P=i.resolveComponent("a-dropdown"),G=i.resolveComponent("a-table");return i.openBlock(),i.createBlock(ht,{class:"unione-table-list",model:l.editor?.model.value,"setting-title":"列表设置"},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",kr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,j=>(i.openBlock(),i.createBlock(L,{key:j.name,class:"btn",widget:j,editor:o.editor,onClick:m,preset:N,ctx:{sltKeys:p.value.selectedRowKeys,sltRows:p.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128)),p.value.selectedRowKeys.length?(i.openBlock(),i.createElementBlock("span",{key:0,class:"selected-info",onClick:I[0]||(I[0]=j=>S())},"当前选中记录("+i.toDisplayString(p.value.selectedRowKeys.length)+")",1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,j=>(i.openBlock(),i.createBlock(L,{key:j.name,class:"btn right",widget:j,editor:o.editor,onClick:y,preset:N,ctx:{sltKeys:p.value.selectedRowKeys,sltRows:p.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128))]),i.createElementVNode("div",br,[c.value&&c.value.length?(i.openBlock(),i.createBlock(G,i.mergeProps({key:0,columns:c.value,rowKey:r.value,"data-source":h.value,"row-selection":g.value?p.value:null,scroll:{x:a.value.scrollX||"max-content",y:a.value.scrollY},pagination:O.value,onChange:x},k.value),{bodyCell:i.withCtx(({column:j,record:B})=>[j.name==="operation"?(i.openBlock(),i.createElementBlock("div",yr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.btns,F=>(i.openBlock(),i.createBlock(L,{key:F.name,class:"opt",widget:F,editor:o.editor,onClick:_=>C(_,B),preset:N,ctx:{row:B}},null,8,["widget","editor","onClick","ctx"]))),128)),f.value.more?.visible!=!1&&f.value.more.items?.length?(i.openBlock(),i.createBlock(P,{key:0,trigger:[f.value.more.trigger||"hover"],class:i.normalizeClass(["opt-more",f.value.more.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["opt-more-overlay",f.value.more.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.more.items,F=>(i.openBlock(),i.createBlock(L,{key:F.name,class:"item",widget:F,editor:o.editor,onClick:_=>C(_,B),type:"text",preset:N,ctx:{row:B}},null,8,["widget","editor","onClick","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode(U,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.more.title)+" ",1),i.createVNode(A)]),_:1})]),_:2},1032,["trigger","class"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),_:1},16,["columns","rowKey","data-source","row-selection","scroll","pagination"])):i.createCommentVNode("",!0)])]),_:2},[l.editor&&l.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(mr,{editor:l.editor,wid:l.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-d11fa152"]]),wr={class:"page-setting-dialog"},jt=i.defineComponent({__name:"page",props:{settingTitle:{type:String,default:"页面设置"},editor:{type:Object,required:!1}},emits:["setting","saving"],setup(o,{emit:e}){const t=o,n=i.computed(()=>t.editor?.model?.value),l=K.useSession(),s=i.computed(()=>l.getPrincipal()),a=i.ref(!1);i.provide("closeSetting",()=>{t.editor?.save().then(u=>{a.value=!1})});function r(){a.value=!0}function d(){t.editor?.save().then(u=>{console.log("res",u)})}function h(){t.editor?.save().then(u=>{console.log("res",u)})}const f=i.ref("");function c(u){f.value||(f.value=n.value),u?t.editor?.setModel("edit"):t.editor?.setModel(f.value)}return(u,m)=>{const b=i.resolveComponent("SettingOutlined"),y=i.resolveComponent("a-tooltip"),k=i.resolveComponent("SaveOutlined"),v=i.resolveComponent("FormOutlined"),w=i.resolveComponent("StopOutlined"),O=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["unione-page",n.value])},[n.value=="edit"&&u.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(i.openBlock(),i.createBlock(y,{key:0,title:o.settingTitle},{default:i.withCtx(()=>[i.createVNode(b,{class:"page-setting",onClick:r})]),_:1},8,["title"])):i.createCommentVNode("",!0),n.value=="edit"&&u.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(i.openBlock(),i.createBlock(y,{key:1,title:"保存页面"},{default:i.withCtx(()=>[i.createVNode(k,{class:"btn-save",onClick:d})]),_:1})):i.createCommentVNode("",!0),n.value!="edit"&&s.value?.userRoles?.includes("FORM-ADMIN")?(i.openBlock(),i.createBlock(y,{key:2,title:"编辑页面"},{default:i.withCtx(()=>[i.createVNode(v,{class:"btn-edit",onClick:m[0]||(m[0]=g=>c(!0))})]),_:1})):i.createCommentVNode("",!0),n.value=="edit"&&u.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(i.openBlock(),i.createBlock(y,{key:3,title:"退出编辑"},{default:i.withCtx(()=>[i.createVNode(w,{class:"btn-edit",onClick:m[1]||(m[1]=g=>c(!1))})]),_:1})):i.createCommentVNode("",!0),i.renderSlot(u.$slots,"default"),n.value=="edit"?(i.openBlock(),i.createBlock(O,{key:4,title:t.settingTitle,open:a.value,"onUpdate:open":m[2]||(m[2]=g=>a.value=g),centered:"",width:"85%",onOk:h},{default:i.withCtx(()=>[i.createElementVNode("div",wr,[i.renderSlot(u.$slots,"page-setting")])]),_:3},8,["title","open"])):i.createCommentVNode("",!0)],2)}}}),xr={class:"unione-props-setting data-field-manage"},vr={key:0},Cr={key:1},Sr={key:2},Nr={key:3},Br={key:4},Or={key:5},Vr={key:6},_r=["onClick"],Mr=["onClick"],Tr=["onClick"],Ar={key:1},Er=ne(i.defineComponent({__name:"dataFieldMange",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:u})=>u+1},{title:"名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"标题",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"数据类型",dataIndex:"dataType",key:"dataType",width:"80px",align:"center"},{title:"长度",dataIndex:"dataLen",key:"dataLen",width:"60px",align:"center"},{title:"小数点",dataIndex:"dataPrec",key:"dataPrec",width:"60px",align:"center"},{title:"默认值",dataIndex:"defaultValue",key:"defaultValue",width:"60px",align:"center"},{title:"主键",dataIndex:"isPk",key:"isPk",width:"40px",align:"center"},{title:"外键",dataIndex:"isFk",key:"isFk",width:"30px",align:"center"},{title:"非空",dataIndex:"isNull",key:"isNull",width:"30px",align:"center"},{title:"同步",dataIndex:"syncDbEnable",key:"syncDbEnable",width:"30px",align:"center"},{title:"备注",dataIndex:"descs",key:"descs",width:"140px",align:"center"}]),t=i.useModel(o,"modelValue"),n=i.ref({selectedRowKeys:[],columnWidth:"25px",onChange:u=>{u.forEach(m=>{n.value.selectedRowKeys.includes(m)||n.value.selectedRowKeys.push(m);const b=[];t.value.forEach(y=>{!u.includes(y.name)&&n.value.selectedRowKeys.includes(y.name)&&b.push(y.name)}),b.length&&(n.value.selectedRowKeys=n.value.selectedRowKeys.filter(y=>!b.includes(y)))})}}),l={mounted:u=>u.focus()},s=i.ref({});function a(){const u=Object.keys(s.value);if(u.length)for(let m in u){const b=t.value.filter(y=>y.name==m);if(b&&b[0]){let y=s.value[m];Object.keys(y).forEach(k=>{b[0][k]=y[k]})}}s.value={}}function r(u,m){a();const b={};b[m]=u[m]||"",s.value[u.name]=b}function d(u,m){if(!u||!m){s.value={};return}const b=s.value[u.name][m];if(m=="name"&&t.value.filter(k=>k[m]==b&&k.name!=u.name).length>0){J.Modal.warn({title:"提示信息",content:"字段名称["+b+"]已存在"});return}u[m]=b,s.value={}}function h(u,m){t.value.filter(y=>y.name==u.name).forEach(y=>{y[m]=!y[m]})}function f(){if(a(),t.value.filter(b=>b.name=="new_").length>0){s.value.new_={name:"new_"};return}const m={title:"",name:"new_",isPk:!1};t.value.push(m),s.value[m.name]={name:"new_"}}function c(){if(!n.value.selectedRowKeys.length){J.Modal.info({title:"提示信息",content:"请选择要删除的字段!"});return}J.Modal.confirm({title:"确认信息",content:"确定要删除选中的["+n.value.selectedRowKeys.length+"]字段么?",onOk:()=>{t.value=t.value.filter(u=>!n.value.selectedRowKeys.includes(u.name)),n.value.selectedRowKeys=[]}})}return(u,m)=>{const b=i.resolveComponent("a-button"),y=i.resolveComponent("a-tooltip"),k=i.resolveComponent("a-input"),v=i.resolveComponent("a-input-number"),w=i.resolveComponent("a-select-option"),O=i.resolveComponent("a-select"),g=i.resolveComponent("a-checkbox"),p=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",xr,[i.createVNode(b,{class:"btn btn-add",type:"primary",onClick:f,size:"small"},{default:i.withCtx(()=>m[1]||(m[1]=[i.createTextVNode("新增")])),_:1}),i.createVNode(b,{class:"btn btn-delete",type:"primary",danger:"",onClick:c,size:"small"},{default:i.withCtx(()=>m[2]||(m[2]=[i.createTextVNode(" 删除 ")])),_:1}),i.createVNode(p,{columns:e.value,"data-source":t.value,pagination:!1,bordered:"","row-selection":n.value,scroll:{x:1150},"row-key":"name",size:"small",sticky:""},{headerCell:i.withCtx(({column:N})=>[N.key==="name"?(i.openBlock(),i.createElementBlock("span",vr,[m[3]||(m[3]=i.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="title"?(i.openBlock(),i.createElementBlock("span",Cr,[m[4]||(m[4]=i.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="descs"?(i.openBlock(),i.createElementBlock("span",Sr,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="dataLen"?(i.openBlock(),i.createElementBlock("span",Nr,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="dataPrec"?(i.openBlock(),i.createElementBlock("span",Br,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="defaultValue"?(i.openBlock(),i.createElementBlock("span",Or,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="dataType"?(i.openBlock(),i.createElementBlock("span",Vr,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(N.title),1)])):i.createCommentVNode("",!0),N.key==="isPk"?(i.openBlock(),i.createBlock(y,{key:7,title:"至少配置一个主键字段"},{default:i.withCtx(()=>[m[5]||(m[5]=i.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),i.createTextVNode(i.toDisplayString(N.title),1)]),_:2},1024)):i.createCommentVNode("",!0),N.key==="isFk"?(i.openBlock(),i.createBlock(y,{key:8,title:"是否是外键字段"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(N.title),1)]),_:2},1024)):i.createCommentVNode("",!0),N.key==="isNull"?(i.openBlock(),i.createBlock(y,{key:9,title:"是否允许为空"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(N.title),1)]),_:2},1024)):i.createCommentVNode("",!0),N.key==="syncDbEnable"?(i.openBlock(),i.createBlock(y,{key:10,title:"是否同步到数据库"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(N.title),1)]),_:2},1024)):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:N,text:V,record:C})=>[["name","title","descs","defaultValue"].includes(N.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!s.value[C.name]||!Object.keys(s.value[C.name]).includes(N.dataIndex))&&!V&&"empty"]),onClick:x=>r(C,N.dataIndex)},[s.value[C.name]&&Object.keys(s.value[C.name]).includes(N.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(k,{key:0,value:s.value[C.name][N.dataIndex],"onUpdate:value":x=>s.value[C.name][N.dataIndex]=x,onBlur:x=>d(C,N.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[l]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(V||" "),1)],64))],10,_r)):i.createCommentVNode("",!0),["dataLen","dataPrec"].includes(N.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!s.value[C.name]||!Object.keys(s.value[C.name]).includes(N.dataIndex))&&!V&&"empty"]),onClick:x=>r(C,N.dataIndex)},[s.value[C.name]&&Object.keys(s.value[C.name]).includes(N.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(v,{key:0,value:s.value[C.name][N.dataIndex],"onUpdate:value":x=>s.value[C.name][N.dataIndex]=x,onBlur:x=>d(C,N.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[l]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(V||" "),1)],64))],10,Mr)):["dataType"].includes(N.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!s.value[C.name]||!Object.keys(s.value[C.name]).includes(N.dataIndex))&&!V&&"empty"]),onClick:x=>r(C,N.dataIndex)},[s.value[C.name]&&Object.keys(s.value[C.name]).includes(N.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(O,{key:0,value:C[N.dataIndex],"onUpdate:value":x=>C[N.dataIndex]=x,onBlur:m[0]||(m[0]=x=>d())},{default:i.withCtx(()=>[i.createVNode(w,{key:"String",value:"String"}),i.createVNode(w,{key:"Long",value:"Long"}),i.createVNode(w,{key:"Short",value:"Short"}),i.createVNode(w,{key:"Integer",value:"Integer"}),i.createVNode(w,{key:"Float",value:"Float"}),i.createVNode(w,{key:"Double",value:"Double"}),i.createVNode(w,{key:"Date",value:"Date"}),i.createVNode(w,{key:"Timestamp",value:"Timestamp"})]),_:2},1032,["value","onUpdate:value"])),[[l]]):(i.openBlock(),i.createElementBlock("span",Ar,i.toDisplayString(V),1))],10,Tr)):["syncDbEnable","isFk","isPk"].includes(N.dataIndex)?(i.openBlock(),i.createBlock(g,{key:3,checked:C[N.dataIndex],onClick:x=>h(C,N.dataIndex)},null,8,["checked","onClick"])):["isNull"].includes(N.dataIndex)?(i.openBlock(),i.createBlock(g,{key:4,checked:!C[N.dataIndex],onClick:x=>h(C,N.dataIndex)},null,8,["checked","onClick"])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])])}}}),[["__scopeId","data-v-f6307a23"]]),Ir={class:"unione-props-setting data-field-setting"},Dr={key:0},Pr=["onClick"],Fr={class:"field-txt"},$r=["onClick"],Rr={key:1,class:"field-txt"},Lr=["onClick"],jr={key:1},zr=["onClick"],qr={key:0,class:"field-txt"},Ur={key:4,class:"edit-field"},Wr={key:0},Hr=["onClick"],Kr=ne(i.defineComponent({__name:"dataFieldSetting",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"列表",dataIndex:"isList",key:"isList",width:"40px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"40px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"40px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"60px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),t=i.useModel(o,"modelValue"),n={mounted:v=>v.focus()},l=i.ref({});function s(){const v=Object.keys(l.value);if(v.length)for(let w in v){const O=t.value.filter(g=>g.name==w);if(O&&O[0]){let g=l.value[w];Object.keys(g).forEach(p=>{p=="convertName"?(O[0].convert||(O[0].convert={}),O[0].convert.type=g[p]):O[0][p]=g[p]})}}l.value={}}function a(v,w){s();const O={};w=="convertName"?(v.convert||(v.convert={}),O[w]=v.convert?.type):O[w]=v[w]||"",l.value[v.name]=O}function r(v,w){{l.value={};return}}function d(v,w){t.value.filter(g=>g.name==v.name).forEach(g=>{g[w]=!g[w]})}const h=i.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{h.value.visible=!1}});function f(v,w){const O=t.value.filter(p=>p.name==v.name);O.forEach(p=>{w!="isSort"?p[w]=!0:p[w]=!p[w]});const g=O[0];if(!(!g||w=="isSort")){switch(h.value.prop=w,h.value.field=v,g.show||(g.show={}),w){case"isQuery":g.show.query||(g.show.query={}),h.value.show=g.show.query,h.value.title=`查询设置/${v.title}(${v.name})`;break;case"isForm":g.show.form||(g.show.form={}),h.value.show=g.show.form,h.value.title=`表单设置/${v.title}(${v.name})`;break;case"isView":g.show.view||(g.show.view={}),h.value.show=g.show.view,h.value.title=`详情设置/${v.title}(${v.name})`;break;case"isList":g.show.list||(g.show.list={}),h.value.show=g.show.list,h.value.title=`列头设置/${v.title}(${v.name})`;break}h.value.visible=!0}}const c=i.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:v=>{const w=c.value.options.filter(O=>O.value==v);return w[0]?w[0].label:v}}),u=i.ref({visible:!1,field:{},props:{},showInfo:v=>{let w="";return v.rules&&(w=v.rules.filter(O=>O.enable).length||""),w&&(w="("+w+")"),w},toSetting:()=>{const v=u.value.props,w={name:"range",trigger:v.trigger,whitespace:v.whitespace,message:v.rangeMessage};v.rangeMin!=null&&v.rangeMin!=null&&(w.min=v.rangeMin,w.enable=!0),v.rangeMax!=null&&v.rangeMax!=null&&(w.max=v.rangeMax,w.enable=!0);const O={name:"reg",trigger:v.trigger,whitespace:v.whitespace,message:v.regMessage};v.regExpress&&(O.pattern=v.regExpress,O.enable=!0),u.value.field.rules=[w,O],u.value.visible=!1,u.value.props={},console.log("rule",u.value.field.rules)}});function m(v){u.value.visible=!0,u.value.field=v;const w=v.rules||[],O={trigger:"change",whitespace:!0};w.forEach(g=>{g.name=="reg"&&(O.trigger=g.trigger,O.whitespace=g.whitespace,O.regExpress=g.pattern,O.regMessage=g.message),g.name=="range"&&(O.rangeMin=g.min,O.rangeMax=g.max,O.rangeMessage=g.message)}),u.value.props=O}const b=i.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:v=>{const w=b.value.widgets.filter(O=>O.value==v);return w[0]?w[0].label:v},toSetting:()=>{}}),y=i.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{y.value.convert.options||(y.value.convert.options=[]),y.value.convert.options.push({label:"",value:""})},toDelOption:(v,w)=>{y.value.convert.options.splice(v,1)},toSetting:()=>{y.value.visible=!1}});function k(v){y.value.visible=!0,y.value.field=v,y.value.convert=v.convert||{}}return(v,w)=>{const O=i.resolveComponent("ToolOutlined"),g=i.resolveComponent("a-button"),p=i.resolveComponent("a-select"),N=i.resolveComponent("a-checkbox"),V=i.resolveComponent("a-table"),C=i.resolveComponent("a-input-number"),x=i.resolveComponent("a-form-item"),S=i.resolveComponent("a-input"),M=i.resolveComponent("a-form"),T=i.resolveComponent("a-modal"),E=i.resolveComponent("a-col"),I=i.resolveComponent("a-row"),L=i.resolveComponent("a-select-option"),A=i.resolveComponent("a-divider"),U=i.resolveComponent("a-checkbox-group");return i.openBlock(),i.createElementBlock("div",Ir,[i.createVNode(V,{columns:e.value,"data-source":t.value,bordered:"",scroll:{x:1e3},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:P})=>[["widget","queryType","rules","convertName"].includes(P.key)?(i.openBlock(),i.createElementBlock("span",Dr,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(P.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:P,text:G,record:j})=>[["rules"].includes(P.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",!u.value.showInfo(j)&&"empty"]),onClick:B=>m(j)},[i.createElementVNode("span",Fr,i.toDisplayString(u.value.showInfo(j)),1),u.value.showInfo(j)?(i.openBlock(),i.createBlock(g,{key:0,type:"link"},{default:i.withCtx(()=>w[22]||(w[22]=[i.createTextVNode("设置")])),_:1})):i.createCommentVNode("",!0)],10,Pr)):["widget"].includes(P.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!l.value[j.name]||!Object.keys(l.value[j.name]).includes(P.dataIndex))&&!G&&"empty"]),onClick:B=>a(j,P.dataIndex)},[l.value[j.name]&&Object.keys(l.value[j.name]).includes(P.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(p,{key:0,value:j[P.dataIndex],"onUpdate:value":B=>j[P.dataIndex]=B,allowClear:!0,options:b.value.widgets,onBlur:w[0]||(w[0]=B=>r())},null,8,["value","onUpdate:value","options"])),[[n]]):(i.openBlock(),i.createElementBlock("span",Rr,i.toDisplayString(b.value.widgetName(G)),1))],10,$r)):["queryType"].includes(P.dataIndex)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[j.isQuery?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!l.value[j.name]||!Object.keys(l.value[j.name]).includes(P.dataIndex))&&!G&&"empty"]),onClick:B=>a(j,P.dataIndex)},[l.value[j.name]&&Object.keys(l.value[j.name]).includes(P.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(p,{key:0,value:j[P.dataIndex],"onUpdate:value":B=>j[P.dataIndex]=B,allowClear:!0,options:c.value.options,onBlur:w[1]||(w[1]=B=>r())},null,8,["value","onUpdate:value","options"])),[[n]]):(i.openBlock(),i.createElementBlock("span",jr,i.toDisplayString(c.value.showLabel(G)),1))],10,Lr)):i.createCommentVNode("",!0)],64)):["convertName"].includes(P.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:3,class:i.normalizeClass(["edit-field",(!l.value[j.name]||!Object.keys(l.value[j.name]).includes(P.dataIndex))&&!j.convert?.type&&"empty"]),onClick:B=>a(j,P.dataIndex)},[l.value[j.name]&&Object.keys(l.value[j.name]).includes(P.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(p,{key:0,value:j.convert.type,"onUpdate:value":B=>j.convert.type=B,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],allowClear:!0,onBlur:w[2]||(w[2]=B=>r())},null,8,["value","onUpdate:value"])),[[n]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j.convert?.type?(i.openBlock(),i.createElementBlock("span",qr,i.toDisplayString(j.convert.type=="dict"?"字典":"静态"),1)):i.createCommentVNode("",!0),j.convert?.type?(i.openBlock(),i.createBlock(g,{key:1,type:"link",onClick:i.withModifiers(B=>k(j),["stop"])},{default:i.withCtx(()=>w[23]||(w[23]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])):i.createCommentVNode("",!0)],64))],10,zr)):["isQuery","isForm","isView","isList","isSort"].includes(P.dataIndex)?(i.openBlock(),i.createElementBlock("div",Ur,[i.createVNode(N,{checked:j[P.dataIndex],onClick:B=>d(j,P.dataIndex)},null,8,["checked","onClick"]),i.createVNode(g,{type:"link",onClick:B=>f(j,P.dataIndex)},{default:i.withCtx(()=>w[24]||(w[24]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(T,{visible:h.value.visible,"onUpdate:visible":w[9]||(w[9]=P=>h.value.visible=P),title:h.value.title,onOk:h.value.toSetting},{default:i.withCtx(()=>[i.createVNode(M,{model:h.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(x,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(C,{value:h.value.show.index,"onUpdate:value":w[3]||(w[3]=P=>h.value.show.index=P)},null,8,["value"])]),_:1}),["isQuery"].includes(h.value.prop)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(x,{key:0,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(S,{value:h.value.show.width,"onUpdate:value":w[4]||(w[4]=P=>h.value.show.width=P)},null,8,["value"])]),_:1})),["isForm","isView"].includes(h.value.prop)?(i.openBlock(),i.createBlock(x,{key:1,label:"标题宽度"},{default:i.withCtx(()=>[i.createVNode(S,{value:h.value.show.labelWidth,"onUpdate:value":w[5]||(w[5]=P=>h.value.show.labelWidth=P)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isForm","isView"].includes(h.value.prop)?(i.openBlock(),i.createBlock(x,{key:2,label:"控件宽度"},{default:i.withCtx(()=>[i.createVNode(S,{value:h.value.show.valueWidth,"onUpdate:value":w[6]||(w[6]=P=>h.value.show.valueWidth=P)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(h.value.prop)?(i.openBlock(),i.createBlock(x,{key:3,label:"固定位置"},{default:i.withCtx(()=>[i.createVNode(p,{value:h.value.show.fixed,"onUpdate:value":w[7]||(w[7]=P=>h.value.show.fixed=P),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(h.value.prop)?(i.openBlock(),i.createBlock(x,{key:4,label:"对齐方式"},{default:i.withCtx(()=>[i.createVNode(p,{value:h.value.show.align,"onUpdate:value":w[8]||(w[8]=P=>h.value.show.align=P),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),i.createVNode(T,{visible:y.value.visible,"onUpdate:visible":w[11]||(w[11]=P=>y.value.visible=P),title:y.value.convert.type=="dict"?"字典设置":"选项设置",onOk:y.value.toSetting},{default:i.withCtx(()=>[y.value.convert.type!="dict"?(i.openBlock(),i.createElementBlock("div",Wr,[i.createVNode(g,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:y.value.toAddOption},{default:i.withCtx(()=>w[25]||(w[25]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode(V,{columns:y.value.optionColumn,"data-source":y.value.convert.options,size:"small"},{bodyCell:i.withCtx(({column:P,text:G,record:j,index:B})=>[P.dataIndex==="label"?(i.openBlock(),i.createBlock(S,{key:0,value:j.label,"onUpdate:value":F=>j.label=F,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),P.dataIndex==="value"?(i.openBlock(),i.createBlock(S,{key:1,value:j.value,"onUpdate:value":F=>j.value=F,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),P.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:2,onClick:F=>y.value.toDelOption(B,j)},"删除",8,Hr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):i.createCommentVNode("",!0),y.value.convert.type=="dict"?(i.openBlock(),i.createBlock(M,{key:1,model:y.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(I,{type:"flex",style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(E,{span:24,order:1},{default:i.withCtx(()=>[i.createVNode(x,{label:"字典名称:"},{default:i.withCtx(()=>[i.createVNode(S,{value:y.value.convert.dict,"onUpdate:value":w[10]||(w[10]=P=>y.value.convert.dict=P)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):i.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),i.createVNode(T,{visible:b.value.visible,"onUpdate:visible":w[13]||(w[13]=P=>b.value.visible=P),title:"控件设置",onOk:b.value.toSetting},{default:i.withCtx(()=>[i.createVNode(M,{model:b.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[b.value.field.widget=="a-select"?(i.openBlock(),i.createBlock(x,{key:0,label:"下拉框类型"},{default:i.withCtx(()=>[i.createVNode(p,{value:b.value.props.mode,"onUpdate:value":w[12]||(w[12]=P=>b.value.props.mode=P),allowClear:!0},{default:i.withCtx(()=>[i.createVNode(L,{value:"multiple"},{default:i.withCtx(()=>w[26]||(w[26]=[i.createTextVNode("多选")])),_:1}),i.createVNode(L,{value:"tags"},{default:i.withCtx(()=>w[27]||(w[27]=[i.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(T,{visible:u.value.visible,"onUpdate:visible":w[21]||(w[21]=P=>u.value.visible=P),title:"规则设置",onOk:u.value.toSetting},{default:i.withCtx(()=>[i.createVNode(M,{model:u.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(A,{orientation:"left"},{default:i.withCtx(()=>w[28]||(w[28]=[i.createTextVNode("基本设置")])),_:1}),i.createVNode(x,{label:"触发时机"},{default:i.withCtx(()=>[i.createVNode(U,{value:u.value.props.trigger,"onUpdate:value":w[14]||(w[14]=P=>u.value.props.trigger=P),options:["change","blur"]},null,8,["value"])]),_:1}),u.value.field.isNull?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(x,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:i.withCtx(()=>[i.createVNode(N,{value:u.value.props.whitespace,"onUpdate:value":w[15]||(w[15]=P=>u.value.props.whitespace=P),checked:u.value.props.whitespace},{default:i.withCtx(()=>w[29]||(w[29]=[i.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),i.createVNode(A,{orientation:"left"},{default:i.withCtx(()=>w[30]||(w[30]=[i.createTextVNode("数值区间")])),_:1}),i.createVNode(x,{label:"有效区间"},{default:i.withCtx(()=>[i.createVNode(C,{value:u.value.props.rangeMin,"onUpdate:value":w[16]||(w[16]=P=>u.value.props.rangeMin=P)},null,8,["value"]),w[31]||(w[31]=i.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),i.createVNode(C,{value:u.value.props.rangeMax,"onUpdate:value":w[17]||(w[17]=P=>u.value.props.rangeMax=P)},null,8,["value"])]),_:1}),i.createVNode(x,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(S,{value:u.value.props.rangeMessage,"onUpdate:value":w[18]||(w[18]=P=>u.value.props.rangeMessage=P)},null,8,["value"])]),_:1}),i.createVNode(A,{orientation:"left"},{default:i.withCtx(()=>w[32]||(w[32]=[i.createTextVNode("正则验证")])),_:1}),i.createVNode(x,{label:"表达式"},{default:i.withCtx(()=>[i.createVNode(S,{value:u.value.props.regExpress,"onUpdate:value":w[19]||(w[19]=P=>u.value.props.regExpress=P)},null,8,["value"])]),_:1}),i.createVNode(x,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(S,{value:u.value.props.regMessage,"onUpdate:value":w[20]||(w[20]=P=>u.value.props.regMessage=P)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-ef9b9849"]]),Qr={class:"unione-props-setting data-field"},Gr=ne(i.defineComponent({__name:"dataField",props:i.mergeModels({filter:{type:Array,default(){return[]}}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const e=i.useModel(o,"modelValue");return(t,n)=>{const l=i.resolveComponent("OrderedListOutlined"),s=i.resolveComponent("a-tab-pane"),a=i.resolveComponent("ToolOutlined"),r=i.resolveComponent("a-tabs");return i.openBlock(),i.createElementBlock("div",Qr,[i.createVNode(r,null,{default:i.withCtx(()=>[i.createVNode(s,{key:"field-mange"},{tab:i.withCtx(()=>[i.createVNode(l),n[2]||(n[2]=i.createTextVNode("字段管理 "))]),default:i.withCtx(()=>[i.createVNode(Er,{modelValue:e.value,"onUpdate:modelValue":n[0]||(n[0]=d=>e.value=d)},null,8,["modelValue"])]),_:1}),i.createVNode(s,{key:"field-setting"},{tab:i.withCtx(()=>[i.createVNode(a),n[3]||(n[3]=i.createTextVNode("字段设置 "))]),default:i.withCtx(()=>[i.createVNode(Kr,{modelValue:e.value,"onUpdate:modelValue":n[1]||(n[1]=d=>e.value=d)},null,8,["modelValue"])]),_:1})]),_:1})])}}}),[["__scopeId","data-v-008d1148"]]),Yr={key:0,class:"data-model-list"},Xr=["onClick"],Jr=ne(i.defineComponent({__name:"dataDefine",props:{limit:{type:Number,default:100},editor:{type:Object,required:!0}},setup(o,{expose:e}){const t=i.computed(()=>l.editor.dataModels()),n=i.ref({sn:"new_",title:"新建数据",fields:[]});i.onMounted(()=>{t.value&&t.value[0]&&(n.value=t.value[0])});const l=o;function s(c){n.value=c}function a(){if(t.value.length>=l.limit){J.Modal.warn({title:"提示信息",content:"数据模型数量超出限制!"});return}const c=sa.v4(),u={sn:c,title:"新建数据",name:"new_",fields:[]};n.value=u,console.log("data model added",u),l.editor.dataModel(c,u)}const r={title:[{required:!0,message:"数据标题不能为空",trigger:"change"}],name:[{required:!0,message:"数据名称不能为空",trigger:"change"}],url:[{required:!0,message:"数据URl不能为空",trigger:"change"}]},d=i.ref(),h=i.inject("closeSetting");function f(){d.value.validate().then(c=>{h&&h()})}return e({toSaving:f}),(c,u)=>{const m=i.resolveComponent("a-input"),b=i.resolveComponent("a-form-item"),y=i.resolveComponent("a-textarea"),k=i.resolveComponent("a-form");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["unione-props-setting","data-define",l.limit<=1&&"center"])},[l.limit>1?(i.openBlock(),i.createElementBlock("div",Yr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,v=>(i.openBlock(),i.createElementBlock("div",{key:v.sn,class:i.normalizeClass(["title",n.value&&n.value.sn==v.sn&&"slt"]),onClick:w=>s(v)},i.toDisplayString(v.title),11,Xr))),128)),i.createElementVNode("div",{class:"title btn-add",onClick:a},"+")])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["data-model-form",l.limit<=1&&"center"])},[i.createVNode(k,{ref_key:"formObj",ref:d,rules:r,model:n.value,"label-col":{span:4},"wrapper-col":{span:20}},{default:i.withCtx(()=>[i.createVNode(b,{label:"数据标题",name:"title",required:""},{default:i.withCtx(()=>[i.createVNode(m,{value:n.value.title,"onUpdate:value":u[0]||(u[0]=v=>n.value.title=v)},null,8,["value"])]),_:1}),i.createVNode(b,{label:"数据名称",name:"name",required:""},{default:i.withCtx(()=>[i.createVNode(m,{value:n.value.name,"onUpdate:value":u[1]||(u[1]=v=>n.value.name=v)},null,8,["value"])]),_:1}),i.createVNode(b,{label:"数据URL",name:"url",required:"",tooltip:"数据请求url,统一使用post请求,保存接口:url/save,修改接口:url/update,查询接口:url/find,删除接口:url/delete,详情接口:url/detail"},{default:i.withCtx(()=>[i.createVNode(m,{value:n.value.url,"onUpdate:value":u[2]||(u[2]=v=>n.value.url=v)},null,8,["value"])]),_:1}),i.createVNode(b,{label:"数据说明",name:"descs"},{default:i.withCtx(()=>[i.createVNode(y,{value:n.value.descs,"onUpdate:value":u[3]||(u[3]=v=>n.value.descs=v)},null,8,["value"])]),_:1})]),_:1},8,["model"]),i.createVNode(Gr,{modelValue:n.value.fields,"onUpdate:modelValue":u[4]||(u[4]=v=>n.value.fields=v)},null,8,["modelValue"])],2)],2)}}}),[["__scopeId","data-v-6be2cc50"]]),Zr={class:"unione-props-setting unione-page-setting"},zt=ne(i.defineComponent({__name:"pageSetting",props:{editor:{type:Object,required:!0}},setup(o){const e=o,t=i.ref({});return i.onMounted(()=>{t.value=e.editor.define.value}),(n,l)=>{const s=i.resolveComponent("a-form-item"),a=i.resolveComponent("a-input"),r=i.resolveComponent("a-switch"),d=i.resolveComponent("a-textarea"),h=i.resolveComponent("a-form"),f=i.resolveComponent("a-tab-pane"),c=i.resolveComponent("a-tabs");return i.openBlock(),i.createElementBlock("div",Zr,[i.createVNode(c,{type:"card"},{default:i.withCtx(()=>[i.createVNode(f,{key:"pageDefine",tab:"页面设置"},{default:i.withCtx(()=>[i.createVNode(h,{model:t.value,name:"basic","label-col":{span:5},"wrapper-col":{span:16},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[t.value.sn&&t.value.sn!="new_"?(i.openBlock(),i.createBlock(s,{key:0,label:"页面编码"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.sn)+"/V"+i.toDisplayString(t.value.vers),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(s,{label:"页面标题",required:""},{default:i.withCtx(()=>[i.createVNode(a,{value:t.value.title,"onUpdate:value":l[0]||(l[0]=u=>t.value.title=u)},null,8,["value"])]),_:1}),i.createVNode(s,{label:"页面组件",required:""},{default:i.withCtx(()=>[i.createVNode(a,{value:t.value.component,"onUpdate:value":l[1]||(l[1]=u=>t.value.component=u)},null,8,["value"])]),_:1}),i.createVNode(s,{label:"icon图标"},{default:i.withCtx(()=>[i.createVNode(a,{value:t.value.icon,"onUpdate:value":l[2]||(l[2]=u=>t.value.icon=u)},null,8,["value"])]),_:1}),i.createVNode(s,{label:"是否全局"},{default:i.withCtx(()=>[i.createVNode(r,{checked:t.value.isGlobal,"onUpdate:checked":l[3]||(l[3]=u=>t.value.isGlobal=u),checkedValue:1,checkedChildren:"是",unCheckedChildren:"否",unCheckedValue:0},null,8,["checked"])]),_:1}),i.createVNode(s,{label:"是否模版"},{default:i.withCtx(()=>[i.createVNode(r,{checked:t.value.isTmpl,"onUpdate:checked":l[4]||(l[4]=u=>t.value.isTmpl=u),checkedValue:1,checkedChildren:"是",unCheckedChildren:"否",unCheckedValue:0},null,8,["checked"])]),_:1}),i.createVNode(s,{label:"页面备注"},{default:i.withCtx(()=>[i.createVNode(d,{value:t.value.descs,"onUpdate:value":l[5]||(l[5]=u=>t.value.descs=u),placeholder:"请输入页面备注...",rows:4},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1}),i.createVNode(f,{key:"dataDefine",tab:"数据设置"},{default:i.withCtx(()=>[i.createVNode(Jr,{editor:o.editor},null,8,["editor"])]),_:1})]),_:1})])}}}),[["__scopeId","data-v-2420ce7a"]]),Sl=ne(i.defineComponent({__name:"editor",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},pageDefine:{type:Object,required:!1}},setup(o){console.log("unione page view setup .....");const e=o,t={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgetList:[],dataModels:[]},component:"unione-page-view"},n=new ct,l=i.computed(()=>n.$widgetList.value||[]);i.watch(()=>e.pageDefine,a=>{a&&n.load(s.value,a)});const s=i.ref("new_");return i.onMounted(()=>{const a=i.inject("route");console.log("unione page view route",a),s.value=e.psn||a?.query?.psn||a?.meta?.psn||"new_",console.log("unione page view,psn:"+s.value),n.setModel("run"),n.load(s.value,e.pageDefine||t)}),(a,r)=>(i.openBlock(),i.createBlock(jt,{class:"unione-page-view","setting-title":"页面设置",editor:i.unref(n)},i.createSlots({default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,d=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(d.render||d.widget),{key:d.wid,wid:d.wid,widget:d,editor:i.unref(n)},null,8,["wid","widget","editor"]))),128))]),_:2},[i.unref(n)?{name:"page-setting",fn:i.withCtx(()=>[i.createVNode(zt,{editor:i.unref(n)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"]))}}),[["__scopeId","data-v-f792d0b4"]]),ed={class:"form-btns"},Nl=i.defineComponent({__name:"form",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},pageDefine:{type:Object,required:!1}},setup(o){const e=i.inject("router"),t=o,n={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[],dsnList:[]},component:"unione-page-view"},l=new ct,s=i.computed(()=>l.$widgetList.value||[]),a=i.computed(()=>{const c=l.define.value?.configs?.btns||[],u=c.map(m=>m.name);if(!u.includes("save")){const m={title:"保存",type:"primary",index:0,visible:!0,size:"default",name:"save"};c.splice(m.index,0,m)}if(!u.includes("submit")){const m={title:"提交",type:"primary",index:1,visible:!0,size:"default",name:"submit"};let b=m.index||1;c.splice(b,0,m)}if(!u.includes("reset")){const m={title:"重置",type:"default",index:2,visible:!0,size:"default",props:{danger:!0},name:"reset"};c.splice(m.index,0,m)}if(!u.includes("back")){const m={title:"返回",type:"default",index:3,visible:!0,size:"default",name:"back"};c.splice(m.index,0,m)}return l.model.value=="view"&&c.filter(m=>["save","submit","reset"].includes(m.name)).forEach(m=>{m.visible=!1}),c});function r({btn:c,event:u}){c.name=="save"&&d(),c.name=="reset",c.name=="back"&&h()}async function d(){const c=l.dataManager().form();let u={};for(let m in c){const b=await c[m].validate();if(l.dataManager().psn()==m){for(let y in u)b[y]=u[y];u=b}else u[m]=b}console.log("=======form data=====",u),l.dataManager().primary().save({data:u,params:l.dataManager().params}).then(m=>{console.log("save result:",m)})}function h(){e.back()}i.watch(()=>t.pageDefine,c=>{c&&l.load(f.value,c)});const f=i.ref("new_");return i.onMounted(()=>{const c=i.inject("route");console.log("unione page view route",c),f.value=t.psn||c?.query?.psn||c?.meta?.psn||"new_",console.log("unione page view,psn:"+f.value),l.setModel(c?.query?.model||c?.meta?.model||"run"),c?.query&&l.dataManager().params(c.query),l.load(f.value,t.pageDefine||n)}),(c,u)=>{const m=i.resolveComponent("unione-btn");return i.openBlock(),i.createBlock(jt,{class:"unione-page-form","setting-title":"页面设置",editor:i.unref(l)},i.createSlots({default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,b=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(b.widget),{key:b.wid,wid:b.wid,widget:b,editor:i.unref(l)},null,8,["wid","widget","editor"]))),128)),i.createElementVNode("div",ed,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b.name},[b.visible!=!1?(i.openBlock(),i.createBlock(m,{key:0,widget:b,editor:i.unref(l),ctx:{},onClick:r},null,8,["widget","editor"])):i.createCommentVNode("",!0)],64))),128))])]),_:2},[i.unref(l)?{name:"page-setting",fn:i.withCtx(()=>[i.createVNode(zt,{editor:i.unref(l)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"])}}}),td=["onMouseover"],id={key:0,class:"node-opts"},nd={class:"form-warp"},ld={class:"form-btns"},Bl=i.defineComponent({__name:"tree",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},storage:{type:Object,required:!0},fields:{type:Array,required:!1},setting:{type:Object,required:!0},opts:{type:Object,required:!1},btns:{type:Object,required:!1},event:{type:Object,required:!1}},emits:["btnClick","treeClick"],setup(o,{emit:e}){const t=K.useDialog(),n=i.inject("router"),l=o,s={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[],dsnList:[]},component:"unione-page-tree"};function a(){if(l.fields?.length){const F={widget:"unione-form",dsn:"primary",primary:!0,widgets:l.fields};s.configs.widgets=[F]}s.configs.dsnList=["primary"],r.dataManager().use("primary","form").store(l.storage),s.configs.btns=l.btns||[],l.btns==!1&&(s.configs.btns=!1),s.configs.opts=l.opts||[],l.opts==!1&&(s.configs.opts=!1),s.configs.event=l.event||{},s.configs.setting=l.setting||{}}const r=new ct,d=i.ref(!1),h=i.ref([]),f=i.ref({}),c=i.ref(null),u=i.ref(null),m=i.ref([]),b=i.ref([]),y=i.ref(0),k=i.computed(()=>{const F={disabled:!1,draggable:!1,multiple:!1,selectable:!0,checkable:!1,showLine:!0,showIcon:!0,idField:"id",pidField:"pid",labelField:"title",leafField:"isLeaf",iconField:"iconName",...l.setting?.tree||{}};return r.define.value?.configs?.tree||F}),v=i.computed(()=>{const F=r.define.value?.configs?.opts;if(typeof F=="boolean"&&F==!1)return!1;const _=(F||[]).map($=>typeof $=="string"?{name:$,visible:!1}:$),D=[];return _.forEach($=>{D.push($.name)}),console.log("opts addBtn",_),_.filter($=>$.name=="add")[0]||{visible:!0,name:"add",icon:"PlusOutlined",title:"新建",props:{block:!0,type:"dashed"}}}),w=i.computed(()=>{const F=r.define.value?.configs?.opts;if(typeof F=="boolean"&&F==!1)return[];const _=(F||[]).map(Q=>typeof Q=="string"?{name:Q,visible:!1}:Q),D=[],$=[];return _.forEach(Q=>{$.push(Q.name),Q.name!="add"&&D.push(Q)}),$.includes("delete")||D.splice(1,0,{visible:!0,name:"delete",icon:"DeleteOutlined",tooltip:"删除",props:{type:"text"}}),$.includes("child")||D.splice(2,0,{visible:!0,name:"child",icon:"PlusOutlined",tooltip:"创建下级",props:{type:"text"}}),console.log("opts menuBtn",D),D});function O({btn:F,event:_},D){_.stopPropagation();const $=f.value[D[k.value.idField]];if(console.log("onTreeMenuClick,btn:",F),console.log("onTreeMenuClick,node:",D),console.log("onTreeMenuClick,curentNode:",$),F.name=="child"){const Q=f.value[$[k.value.idField]];Q.isLeaf=!1,c.value={},c.value[k.value.pidField]=Q[k.value.idField],c.value[k.value.labelField]="新建...",c.value[k.value.idField]="new_"+y.value,c.value.parentNode=Q,y.value=y.value+1,Q.children||(Q.children=[],b.value.push(Q[k.value.idField])),I.value.createNode&&I.value.createNode(c.value,Q,r.dataManager().params()),f.value[c.value[k.value.idField]]=c.value,Q.children.push(c.value),m.value=[c.value[k.value.idField]],r.dataManager().primary().setValue(c.value)}F.name=="delete"&&($[k.value.idField]&&($[k.value.idField]+"").startsWith("new_")?($.parentNode?$.parentNode.children=$.parentNode.children.filter(Q=>Q[k.value.idField]!=$[k.value.idField]):h.value=h.value.filter(Q=>Q[k.value.idField]!=$[k.value.idField]),delete f.value[$[k.value.idField]]):r.dataManager().primary().deleteByIds([$[k.value.idField]]).then(()=>{if($.parentNode){const Q=f.value[$[k.value.pidField]];Q.children=Q.children.filter(R=>R[k.value.idField]!=$[k.value.idField])}else h.value=h.value.filter(Q=>Q[k.value.idField]!=$[k.value.idField]);delete f.value[$[k.value.idField]]}))}function g(F,{expanded:_,node:D}){_&&(c.value=D.dataRef,r.dataManager().primary().setValue(c.value),T())}function p(F,_){_.selected?(c.value=_.node.dataRef,r.dataManager().primary().setValue(c.value)):c.value&&(m.value=[c.value[k.value.idField]]),U("treeClick",{keys:F,event:_})}const N=i.computed(()=>{if(l.storage?.orderBy){const F=l.storage.orderBy.split(" ");return[{name:F[0],asc:F[1].toLowerCase()=="asc"}]}return[]});i.watch(()=>l.params,()=>{d.value&&(h.value=[],f.value={},c.value=null,m.value=[],b.value=[],y.value=0,r.dataManager().params(l.params||{}),console.log("params changed props.params",l.params),T())}),i.watch(()=>c.value,()=>{console.log("active node changed",c.value),C(!c.value)});const V=i.ref(null);i.watch(V,()=>{V.value&&c.value&&r.dataManager().primary().setValue(c.value)});function C(F=!0){const _=r.dataManager().form();for(let D in _)_[D].setDisabled(F)}function x(){if(c.value={},c.value[k.value.pidField]=-1,c.value[k.value.labelField]="新建...",c.value[k.value.idField]="new_"+y.value,y.value=y.value+1,I.value.createNode&&I.value.createNode(c.value,null,r.dataManager().params()),c.value[k.value.pidField]==-1)h.value.push(c.value);else{const F=f.value[c.value[k.value.pidField]];F.children||(F.children=[]),F.children.push(c.value)}m.value=[c.value[k.value.idField]],f.value[c.value[k.value.idField]]=c.value,r.dataManager().primary().setValue(c.value)}const S=i.ref(""),M=tn(()=>{r.dataManager().primary().find({page:1,pageSize:9999,keywords:S.value,needCount:!1,body:k.value.async==!1?null:{},sorts:N.value}).then(F=>{if(f.value={},h.value=[],F.body?.length){const _={};F.body.forEach(D=>{_[D[k.value.idField]]=D}),F.body.forEach(D=>{const $=_[D[k.value.pidField]];$?($.children||($.children=[],$.isLeaf=!1),$.children.push(D)):h.value.push(D)})}})},400);function T(){const F={};if(F[k.value.pidField]=-1,c.value){if(c.value.children?.length||k.value.async==!1)return;F[k.value.pidField]=c.value[k.value.idField],r.dataManager().primary().find({page:1,pageSize:999,body:F,sorts:N.value}).then(_=>{c.value.children=_.body||[],c.value.children.forEach(D=>{D.isLeaf=!!D[k.value.leafField],f.value[D[k.value.idField]]=D,D.parentNode=f.value[D[k.value.pidField]]})})}else{const _=k.value.async==!1?null:{page:1,pageSize:999,body:F,sorts:N.value};r.dataManager().primary().find(_).then(D=>{if(k.value.async==!1){if(h.value=[],D.body?.length){const $={};D.body.forEach(Q=>{$[Q[k.value.idField]]=Q}),D.body.forEach(Q=>{const R=$[Q[k.value.pidField]];R?(R.children||(R.children=[],R.isLeaf=!1),R.children.push(Q)):h.value.push(Q)})}}else h.value=D.body||[],h.value.forEach($=>{$.isLeaf=!!$[k.value.leafField],f.value[$[k.value.idField]]=$})})}}const E=i.computed(()=>r.$widgetList.value||[]),I=i.computed(()=>{const F={...r.define.value?.configs?.event||{}};for(const _ in F)F[_]&&typeof F[_]!="function"&&F[_].enable&&F[_].scriptText&&(_=="createNode"?F[_]=new Function("node","parent","params",F[_].scriptText):F[_]=new Function("data","event",F[_].scriptText));return F}),L=i.computed(()=>r.define.value?.configs?.setting||l.setting||{});i.provide("pageSetting",L.value);const A=i.computed(()=>{const F=r.define.value?.configs?.btns;if(typeof F=="boolean"&&F==!1)return[];const _=(r.define.value?.configs?.btns||[]).map($=>typeof $=="string"?{name:$,visible:!1}:{size:"default",...$}),D=_.map($=>$.name);if(!D.includes("save")){const $={title:"保存",type:"primary",index:0,visible:!0,size:"default",name:"save"};_.splice($.index,0,$)}if(!D.includes("reset")){const $={title:"重置",type:"default",index:1,visible:!0,size:"default",props:{danger:!0},name:"reset"};_.splice($.index,0,$)}if(!D.includes("back")){const $={title:"返回",type:"default",index:_.length,visible:!0,size:"default",name:"back"};_.splice($.index,0,$)}return r.model.value=="view"&&_.filter($=>["save","submit","reset"].includes($.name)).forEach($=>{$.visible=!1}),_}),U=e;function P({btn:F,event:_}){F.name=="save"&&G({btn:F,event:_}),F.name=="reset",F.name=="back"&&j(),U("btnClick",{btn:F,event:_})}async function G(F){const _=r.dataManager().form();let D={...c.value};for(let $ in _){const Q=await _[$].validate();if(r.dataManager().psn()==$)for(let R in Q)D[R]=Q[R];else D[$]=Q}if(D[k.value.pidField]&&(D[k.value.pidField]+"").startsWith("new_")){t.error({content:"请先保存父节点!"});return}D[k.value.idField]&&(D[k.value.idField]+"").startsWith("new_")&&delete D[k.value.idField],delete D.parentNode,delete D.children,D[k.value.leafField]=D[k.value.leafField]?1:0,I.value.preSave&&I.value.preSave(D,F),console.log("=======form data=====",D),r.dataManager().primary().save({data:D}).then($=>{console.log("save result:",$),c.value[k.value.idField]=$.body,m.value=[$.body],f.value[$.body]=c.value,c.value.children?.forEach(Q=>{Q[k.value.pidField]=$.body}),I.value.postSaved&&I.value.postSaved(D,F)})}function j(){n.back()}const B=i.ref("new_");return i.onMounted(()=>{const F=i.inject("route");console.log("unione page tree route",F),B.value=l.psn||F?.query?.psn||F?.meta?.psn||"new_",console.log("unione page tree,psn:"+B.value),r.setModel(F?.query?.model||F?.meta?.model||"run");const _={...l.params||{},...F?.query||{},...F?.params||{}};r.dataManager().params(_),a(),r.load(B.value,s),i.nextTick(()=>{C(!0)}),T(),d.value=!0}),(F,_)=>{const D=i.resolveComponent("SearchOutlined"),$=i.resolveComponent("a-input"),Q=i.resolveComponent("unione-btn"),R=i.resolveComponent("a-tree");return i.openBlock(),i.createBlock(jt,{class:"unione-page-tree","setting-title":"页面设置",editor:i.unref(r)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",{class:"tree-warp",onContextmenu:_[4]||(_[4]=i.withModifiers(()=>{},["prevent"]))},[i.createVNode($,{size:"small",class:"input-search",placeholder:"输入关键字搜索...",value:S.value,"onUpdate:value":_[0]||(_[0]=X=>S.value=X),onChange:i.unref(M),onPressEnter:i.unref(M)},{suffix:i.withCtx(()=>[i.createVNode(D)]),_:1},8,["value","onChange","onPressEnter"]),v.value?(i.openBlock(),i.createBlock(Q,{key:0,widget:v.value,onClick:x},null,8,["widget"])):i.createCommentVNode("",!0),i.createVNode(R,{"show-line":k.value.showLine,"show-icon":k.value.showIcon,disabled:k.value.disabled,blockNode:!0,draggable:k.value.draggable,multiple:k.value.multiple,selectable:k.value.selectable,checkable:k.value.checkable,fieldNames:{title:k.value.labelField,key:k.value.idField},selectedKeys:m.value,"onUpdate:selectedKeys":_[2]||(_[2]=X=>m.value=X),expandedKeys:b.value,"onUpdate:expandedKeys":_[3]||(_[3]=X=>b.value=X),"tree-data":h.value,onExpand:g,onSelect:p},i.createSlots({icon:i.withCtx(({dataRef:X})=>[X[k.value.iconField]?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(X[k.value.iconField]),{key:0})):i.createCommentVNode("",!0)]),_:2},[w.value?.length?{name:"title",fn:i.withCtx(({dataRef:X})=>[i.createElementVNode("div",{class:"node-label",onMouseover:()=>u.value=X,onMouseleave:_[1]||(_[1]=()=>u.value=null)},[i.createElementVNode("span",null,i.toDisplayString(X[k.value.labelField]),1),c.value&&c.value[k.value.idField]==X[k.value.idField]||u.value&&u.value[k.value.idField]==X[k.value.idField]?(i.openBlock(),i.createElementBlock("div",id,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(w.value,Z=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[!I.value.btnVisible||I.value.btnVisible(Z,X)?(i.openBlock(),i.createBlock(Q,{key:Z.name,widget:Z,ctx:{node:X},onClick:ge=>O(ge,X)},null,8,["widget","ctx","onClick"])):i.createCommentVNode("",!0)],64))),256))])):i.createCommentVNode("",!0)],40,td)]),key:"0"}:void 0]),1032,["show-line","show-icon","disabled","draggable","multiple","selectable","checkable","fieldNames","selectedKeys","expandedKeys","tree-data"])],32),i.createElementVNode("div",nd,[i.renderSlot(F.$slots,"form-warp",{class:"form-warp"},()=>[i.createElementVNode("div",{ref_key:"formWarp",ref:V},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.value,X=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(X.widget),{key:X.wid,wid:X.wid,widget:X,editor:i.unref(r)},null,8,["wid","widget","editor"]))),128)),i.createElementVNode("div",ld,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.value,X=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:X.name},[X.visible!=!1?(i.openBlock(),i.createBlock(Q,{key:0,widget:X,editor:i.unref(r),disabled:!c.value,ctx:{},onClick:P},null,8,["widget","editor","disabled"])):i.createCommentVNode("",!0)],64))),128))])],512)])])]),_:2},[i.unref(r)?{name:"page-setting",fn:i.withCtx(()=>[i.createVNode(zt,{editor:i.unref(r)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"])}}}),Ol=i.defineComponent({__name:"list",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},storage:{type:Object,required:!0},fields:{type:Array,required:!0},queryBtns:{type:Array,required:!1},operation:{type:Object,required:!1},selection:{type:Object,required:!1},leftBtns:{type:Object,required:!1},rightBtns:{type:Object,required:!1}},emits:["btnClick"],setup(o,{expose:e,emit:t}){const n=o,l=i.ref(null),s={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[{widget:"unione-query",dsn:"",primary:!0,fields:[]},{widget:"unione-table",dsn:"",columns:[]}],dsnList:[]},component:"unione-page-list"};function a(){if(n.fields?.length){s.configs.widgets[0].dsn="primary",s.configs.widgets[0].fields=n.fields.filter(O=>O.isQuery),s.configs.widgets[0].btns=n.queryBtns||[],s.configs.widgets[0].params=n.params||{},s.configs.dsnList=["primary"],s.configs.widgets[1].dsn="primary";const w=n.fields.filter(O=>O.isPk)[0];w&&w.name&&(s.configs.widgets[1].dataKey=w.name),s.configs.widgets[1].columns=n.fields.filter(O=>O.hidden!=!0),s.configs.widgets[1].operation=K.utils.obj.ext(s.configs.widgets[1].operation,n.operation||{}),n.operation==!1&&(s.configs.widgets[1].operation=!1),n.selection==!1&&(s.configs.widgets[1].selection=!1),s.configs.widgets[1].leftBtns=n.leftBtns==!1?!1:n.leftBtns||[],s.configs.widgets[1].rightBtns=n.rightBtns==!1?!1:n.rightBtns||[],r.dataManager().use("primary","list").store(n.storage)}}const r=new ct,d=i.computed(()=>r.$widgetList.value||[]),h=t;function f(w){h("btnClick",w)}const c=i.ref("new_");i.onMounted(()=>{const w=i.inject("route");console.log("unione page view route",w),c.value=n.psn||w?.query?.psn||w?.meta?.psn||"new_",console.log("unione page view,psn:"+c.value),r.setModel(w?.query?.model||w?.meta?.model||"run");const O={...n.params||{},...w?.query||{},...w?.params||{}};r.dataManager().params(O),a(),r.load(c.value,s)});function u(){return r.dataManager().use("primary","list")}function m(w){w?r.ebus.$emit("table-list-search",w):r.ebus.$emit("table-list-reload")}function b(w){r.dataManager().params(w),r.ebus.$emit("query-form-params",w),r.ebus.$emit("table-list-search",{params:w})}function y(){return l.value?l.value[0]:null}function k(){return l.value?l.value[0].getSelected():null}function v(){l.value&&l.value[0].clearSelected()}return e({storage:u,editor:r,reload:m,setParams:b,getTable:y,getSelected:k,clearSelected:v}),(w,O)=>(i.openBlock(),i.createBlock(jt,{class:"unione-page-list","setting-title":"页面设置",editor:i.unref(r)},i.createSlots({default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,g=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:g.wid},[g.widget=="unione-table"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(g.widget),{key:0,wid:g.wid,widget:g,editor:i.unref(r),onBtnClick:f,ref_for:!0,ref_key:"table",ref:l},null,40,["wid","widget","editor"])):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(g.widget),{key:1,wid:g.wid,widget:g,editor:i.unref(r),onBtnClick:f},null,40,["wid","widget","editor"]))],64))),128))]),_:2},[i.unref(r)?{name:"page-setting",fn:i.withCtx(()=>[i.createVNode(zt,{editor:i.unref(r)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"]))}}),ft={release(o){return K.axios.admin({url:"/api/data/define/release",method:"post",data:o})},find(o){return K.axios.admin({url:"/api/data/define/find",method:"post",data:o})},save(o){return K.axios.admin({url:"/api/data/define/save",method:"post",data:o})},delete(o){return K.axios.admin({url:"/api/data/define/delete",method:"post",data:o})},detail(o){return K.axios.admin({url:"/api/data/define/detail",method:"post",headers:{"Content-Type":"application/json"},data:o})},loadFromDb(o){return K.axios.admin({url:"/api/data/define/load/from/db",method:"post",headers:{"Content-Type":"multipart/form-data"},data:o})},impFromDb(o){return K.axios.admin({url:"/api/data/define/imp/from/db",method:"post",headers:{"Content-Type":"multipart/form-data"},data:o})}},sd={class:"unione-page list-page"},od=ne(i.defineComponent({__name:"list",setup(o){const e=Ie(),t=K.useDialog(),n=i.inject("router"),l=i.ref({fields:[{title:"标题",name:"title"},{title:"名称",name:"name"},{title:"状态",name:"status"},{title:"类别",name:"category"}]}),s=i.ref({leftBtns:[{visible:!1,name:"delBatch"},{title:"从数据库导入",icon:"FunnelPlotOutlined",name:"impFromDb",props:{danger:!0,ghost:!0}},{title:"代码生成",icon:"CodeOutlined",name:"genCode"}],rightBtns:[{visible:!1,name:"downTmpl"}],columns:[{title:"类别",name:"category"},{title:"标题",name:"title"},{title:"名称",name:"name"},{title:"编码",name:"sn"},{title:"版本",name:"vers"},{title:"发布时间",name:"publishDate"},{title:"创建时间",name:"created"},{title:"状态",name:"status"}],operation:{title:"操作",width:190,btns:[{title:"预览",name:"view"},{title:"版本发布",name:"release",props:{danger:!0}},{title:"版本管理",name:"vers"},{title:"配置管理",name:"configs"},{title:"权限管理",name:"permis"},{title:"权限分配",name:"auth"},{title:"复制",name:"copy"}],count:2,more:{layout:"vertical"}}});i.onMounted(()=>{r()});const a=i.ref({pagination:{total:0,current:1,pageSize:20},loading:!1,params:{},data:[]});function r(){a.value.loading=!0,ft.find({page:a.value.pagination.current,pageSize:a.value.pagination.pageSize,body:a.value.params,keywords:a.value.keywords}).then(g=>{a.value.data=g.body,a.value.pagination.total=g.total*1}).finally(()=>{a.value.loading=!1})}function d(g){a.value.pagination.current=g.pagination.current,a.value.pagination.pageSize=g.pagination.pageSize,r()}function h({params:g,keywords:p}){a.value.pagination.current=1,a.value.params=g,a.value.keywords=p,r()}function f({btn:g,event:p,row:N}){console.log("table btn click",g,p,N),(g.name=="add"||g.name=="edit")&&n.push({path:"/system/data/define/edit",query:N?{id:N.id}:{}}),g.name=="impFromDb"&&(u.value=!0),g.name=="release"&&c(N),g.name=="view"&&n.push({path:e.listPageUrl,query:{psn:N.sn+":list",model:"preview"}})}function c(g){t.confirm({content:"确定要发布当前数据么?",onOk:()=>{ft.release([g.id]).then(p=>{p.success?(t.success({title:"发布成功",content:p.body}),r()):t.error({title:"发布失败",content:p.body})})}})}const u=i.ref(!1),m=i.ref({keywords:{visible:!1},fields:[{title:"数据源",name:"dsId",value:1,visible:!0,widget:"unione-select-box",convert:{types:"local",url:"/api/data/source/find",search:!0}},{title:"名称",name:"tableName",visible:!0}],btns:[{visible:!1,name:"reset"},{name:"advanced",visible:!1},{name:"imp",title:"提交",props:{danger:!0}}]}),b=i.ref({leftBtns:!1,rightBtns:!1,columns:[{title:"名称",name:"name"},{title:"标题",name:"title"}],operation:!1}),y=i.ref({pagination:{total:0,current:1,pageSize:10},loading:!1,params:{},data:[]});function k(g){!g||!Object.keys(g).length||!g.dsId||(J.message.loading("数据加载中..."),y.value.params=g,y.value.loading=!0,ft.loadFromDb(g).then(p=>{y.value.loading=!1,J.message.destroy(),p.success?(p.body.forEach(N=>{N.checkable=!!N.id}),y.value.data=p.body,y.value.pagination.total=p.body.length):J.message.error(p.message)}))}function v(g){y.value.pagination.current=g.pagination.current,y.value.pagination.pageSize=g.pagination.pageSize}const w=i.ref();function O({btn:g}){if(g.name!="imp")return;const p=w.value.getSelected();p?.keys?.length?t.confirm({content:"确定导入选中的"+p.keys.length+"条记录么?",onOk:()=>{J.message.loading("数据导入中..."),ft.impFromDb({dsId:y.value.params.dsId,tables:p.keys.join()}).then(N=>{J.message.destroy(),N.success?(t.success({content:N.message}),a.value.pagination.current=1,r()):t.error({context:N.message})})}}):t.error({content:"请选择目标记录!"})}return(g,p)=>{const N=i.resolveComponent("UnioneQuery"),V=i.resolveComponent("UnioneTable"),C=i.resolveComponent("a-drawer");return i.openBlock(),i.createElementBlock("div",sd,[i.createVNode(N,{widget:l.value,onQuery:h,onReset:h},null,8,["widget"]),i.createVNode(V,{widget:s.value,dataList:a.value.data,loading:a.value.loading,pagination:a.value.pagination,onChange:d,onBtnClick:f},null,8,["widget","dataList","loading","pagination"]),i.createVNode(C,{title:"从数据库中导入",width:550,visible:u.value,"onUpdate:visible":p[0]||(p[0]=x=>u.value=x),placement:"left"},{default:i.withCtx(()=>[i.createVNode(N,{widget:m.value,onQuery:k,onReset:k,onBtnClick:O,class:"load-table-form"},null,8,["widget"]),i.createVNode(V,{widget:b.value,dataList:y.value.data,loading:y.value.loading,pagination:y.value.pagination,onChange:v,rowKey:"name",ref_key:"loadTableObj",ref:w},null,8,["widget","dataList","loading","pagination"])]),_:1},8,["visible"])])}}}),[["__scopeId","data-v-483acb94"]]),ad={class:"unione-props-setting data-field-manage"},rd={key:0},dd={key:1},cd=["onClick"],hd=["onClick"],fd=["onClick"],ud={key:1},pd=ne(i.defineComponent({__name:"dataFieldMange",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:m})=>m+1},{title:"名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"标题",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"数据类型",dataIndex:"dataType",key:"dataType",width:"80px",align:"center"},{title:"长度",dataIndex:"dataLen",key:"dataLen",width:"60px",align:"center"},{title:"小数点",dataIndex:"dataPrec",key:"dataPrec",width:"60px",align:"center"},{title:"默认值",dataIndex:"dataValue",key:"dataValue",width:"60px",align:"center"},{title:"主键",dataIndex:"isPk",key:"isPk",width:"40px",align:"center"},{title:"外键",dataIndex:"isFk",key:"isFk",width:"30px",align:"center"},{title:"非空",dataIndex:"isNull",key:"isNull",width:"30px",align:"center"},{title:"同步",dataIndex:"syncEnable",key:"syncEnable",width:"30px",align:"center"},{title:"备注",dataIndex:"descs",key:"descs",width:"140px",align:"center"}]),t=i.useModel(o,"modelValue"),n=i.ref({selectedRowKeys:[],columnWidth:"25px",onChange:m=>{m.forEach(b=>{n.value.selectedRowKeys.includes(b)||n.value.selectedRowKeys.push(b);const y=[];t.value.forEach(k=>{!m.includes(k.name)&&n.value.selectedRowKeys.includes(k.name)&&y.push(k.name)}),y.length&&(n.value.selectedRowKeys=n.value.selectedRowKeys.filter(k=>!y.includes(k)))})}}),l={mounted:m=>m.focus()},s=i.ref({});function a(){const m=Object.keys(s.value);if(m.length)for(let b in m){const y=t.value.filter(k=>k.name==b);if(y&&y[0]){let k=s.value[b];Object.keys(k).forEach(v=>{y[0][v]=k[v]})}}s.value={}}function r(m,b){a();const y={};y[b]=m[b]||"",s.value[m.name]=y}function d(m,b){if(!m||!b){s.value={};return}const y=s.value[m.name][b];if(b=="name"&&t.value.filter(v=>v[b]==y&&v.name!=m.name).length>0){J.Modal.warn({title:"提示信息",content:"字段名称["+y+"]已存在"});return}m[b]=y,s.value={}}function h(m,b){const y=t.value.filter(k=>k.name==m.name)[0];return b=="isFk"?y.configs?.fkey?.enable:y[b]==1}function f(m,b){const y=t.value.filter(k=>k.name==m.name)[0];b=="isFk"?(y.configs||(y.configs={}),y.configs.fkey||(y.configs.fkey={}),y.configs.fkey.enable=!y.configs.fkey.enable):y[b]!=1?y[b]=1:y[b]=0}function c(){if(a(),t.value.filter(y=>y.name=="new_").length>0){s.value.new_={name:"new_"};return}const b={title:"",name:"new_",dataType:"String",isPk:0};t.value.push(b),s.value[b.name]={name:"new_"}}function u(){if(!n.value.selectedRowKeys.length){J.Modal.info({title:"提示信息",content:"请选择要删除的字段!"});return}J.Modal.confirm({title:"确认信息",content:"确定要删除选中的["+n.value.selectedRowKeys.length+"]字段么?",onOk:()=>{t.value=t.value.filter(m=>!n.value.selectedRowKeys.includes(m.name)),n.value.selectedRowKeys=[]}})}return(m,b)=>{const y=i.resolveComponent("a-button"),k=i.resolveComponent("a-tooltip"),v=i.resolveComponent("a-input"),w=i.resolveComponent("a-input-number"),O=i.resolveComponent("a-select-option"),g=i.resolveComponent("a-select"),p=i.resolveComponent("a-checkbox"),N=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",ad,[i.createVNode(y,{class:"btn btn-add",type:"primary",onClick:c,size:"small"},{default:i.withCtx(()=>b[1]||(b[1]=[i.createTextVNode("新增")])),_:1}),i.createVNode(y,{class:"btn btn-delete",type:"primary",danger:"",onClick:u,size:"small"},{default:i.withCtx(()=>b[2]||(b[2]=[i.createTextVNode(" 删除 ")])),_:1}),i.createVNode(N,{columns:e.value,"data-source":t.value,pagination:!0,bordered:"","row-selection":n.value,scroll:{x:1150},"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:V})=>[["name","title"].includes(V.key)?(i.openBlock(),i.createElementBlock("span",rd,[b[3]||(b[3]=i.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(V.title),1)])):i.createCommentVNode("",!0),["descs","dataLen","dataPrec","dataValue","dataType"].includes(V.key)?(i.openBlock(),i.createElementBlock("span",dd,[i.createVNode(i.unref(He.FormOutlined)),i.createTextVNode(" "+i.toDisplayString(V.title),1)])):i.createCommentVNode("",!0),V.key==="isPk"?(i.openBlock(),i.createBlock(k,{key:2,title:"至少配置一个主键字段"},{default:i.withCtx(()=>[b[4]||(b[4]=i.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),i.createTextVNode(i.toDisplayString(V.title),1)]),_:2},1024)):i.createCommentVNode("",!0),V.key==="isFk"?(i.openBlock(),i.createBlock(k,{key:3,title:"是否是外键字段"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(V.title),1)]),_:2},1024)):i.createCommentVNode("",!0),V.key==="isNull"?(i.openBlock(),i.createBlock(k,{key:4,title:"是否允许为空"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(V.title),1)]),_:2},1024)):i.createCommentVNode("",!0),V.key==="syncEnable"?(i.openBlock(),i.createBlock(k,{key:5,title:"是否同步到数据库"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(V.title),1)]),_:2},1024)):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:V,text:C,record:x})=>[["name","title","descs","dataValue"].includes(V.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(V.dataIndex))&&!C&&"empty"]),onClick:S=>r(x,V.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(V.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(v,{key:0,value:s.value[x.name][V.dataIndex],"onUpdate:value":S=>s.value[x.name][V.dataIndex]=S,onBlur:S=>d(x,V.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[l]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(C||" "),1)],64))],10,cd)):i.createCommentVNode("",!0),["dataLen","dataPrec"].includes(V.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(V.dataIndex))&&!C&&"empty"]),onClick:S=>r(x,V.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(V.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(w,{key:0,value:s.value[x.name][V.dataIndex],"onUpdate:value":S=>s.value[x.name][V.dataIndex]=S,onBlur:S=>d(x,V.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[l]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(C||" "),1)],64))],10,hd)):["dataType"].includes(V.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(V.dataIndex))&&!C&&"empty"]),onClick:S=>r(x,V.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(V.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(g,{key:0,value:x[V.dataIndex],"onUpdate:value":S=>x[V.dataIndex]=S,onBlur:b[0]||(b[0]=S=>d())},{default:i.withCtx(()=>[i.createVNode(O,{key:"String",value:"String"}),i.createVNode(O,{key:"Long",value:"Long"}),i.createVNode(O,{key:"Short",value:"Short"}),i.createVNode(O,{key:"Integer",value:"Integer"}),i.createVNode(O,{key:"Float",value:"Float"}),i.createVNode(O,{key:"Double",value:"Double"}),i.createVNode(O,{key:"Date",value:"Date"}),i.createVNode(O,{key:"Timestamp",value:"Timestamp"})]),_:2},1032,["value","onUpdate:value"])),[[l]]):(i.openBlock(),i.createElementBlock("span",ud,i.toDisplayString(C),1))],10,fd)):["syncEnable","isFk","isPk"].includes(V.dataIndex)?(i.openBlock(),i.createBlock(p,{key:3,checked:h(x,V.dataIndex),onClick:S=>f(x,V.dataIndex)},null,8,["checked","onClick"])):["isNull"].includes(V.dataIndex)?(i.openBlock(),i.createBlock(p,{key:4,checked:!h(x,V.dataIndex),onClick:S=>f(x,V.dataIndex)},null,8,["checked","onClick"])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])])}}}),[["__scopeId","data-v-4020e3f0"]]),Vl=1024;let md=0,ln=class{constructor(e,t){this.from=e,this.to=t}};class te{constructor(e={}){this.id=md++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ne.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}}te.closedBy=new te({deserialize:o=>o.split(" ")}),te.openedBy=new te({deserialize:o=>o.split(" ")}),te.group=new te({deserialize:o=>o.split(" ")}),te.isolate=new te({deserialize:o=>{if(o&&o!="rtl"&&o!="ltr"&&o!="auto")throw new RangeError("Invalid value for isolate: "+o);return o||"auto"}}),te.contextHash=new te({perNode:!0}),te.lookAhead=new te({perNode:!0}),te.mounted=new te({perNode:!0});class hi{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[te.mounted.id]}}const gd=Object.create(null);class Ne{constructor(e,t,n,l=0){this.name=e,this.props=t,this.id=n,this.flags=l}static define(e){let t=e.props&&e.props.length?Object.create(null):gd,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),l=new Ne(e.name||"",t,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(l)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return l}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(te.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let l of n.split(" "))t[l]=e[n];return n=>{for(let l=n.prop(te.group),s=-1;s<(l?l.length:0);s++){let a=t[s<0?n.name:l[s]];if(a)return a}}}}Ne.none=new Ne("",Object.create(null),0,8);class sn{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let l=null;for(let s of e){let a=s(n);a&&(l||(l=Object.assign({},n.props)),l[a[0].id]=a[1])}t.push(l?new Ne(n.name,l,n.id,n.flags):n)}return new sn(t)}}const fi=new WeakMap,_l=new WeakMap;var pe;(function(o){o[o.ExcludeBuffers=1]="ExcludeBuffers",o[o.IncludeAnonymous=2]="IncludeAnonymous",o[o.IgnoreMounts=4]="IgnoreMounts",o[o.IgnoreOverlays=8]="IgnoreOverlays"})(pe||(pe={}));class he{constructor(e,t,n,l,s){if(this.type=e,this.children=t,this.positions=n,this.length=l,this.props=null,s&&s.length){this.props=Object.create(null);for(let[a,r]of s)this.props[typeof a=="number"?a:a.id]=r}}toString(){let e=hi.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let n of this.children){let l=n.toString();l&&(t&&(t+=","),t+=l)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new rn(this.topNode,e)}cursorAt(e,t=0,n=0){let l=fi.get(this)||this.topNode,s=new rn(l);return s.moveTo(e,t),fi.set(this,s._tree),s}get topNode(){return new Me(this,0,0,null)}resolve(e,t=0){let n=qt(fi.get(this)||this.topNode,e,t,!1);return fi.set(this,n),n}resolveInner(e,t=0){let n=qt(_l.get(this)||this.topNode,e,t,!0);return _l.set(this,n),n}resolveStack(e,t=0){return yd(this,e,t)}iterate(e){let{enter:t,leave:n,from:l=0,to:s=this.length}=e,a=e.mode||0,r=(a&pe.IncludeAnonymous)>0;for(let d=this.cursor(a|pe.IncludeAnonymous);;){let h=!1;if(d.from<=s&&d.to>=l&&(!r&&d.type.isAnonymous||t(d)!==!1)){if(d.firstChild())continue;h=!0}for(;h&&n&&(r||!d.type.isAnonymous)&&n(d),!d.nextSibling();){if(!d.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:cn(Ne.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,l)=>new he(this.type,t,n,l,this.propValues),e.makeTree||((t,n,l)=>new he(Ne.none,t,n,l)))}static build(e){return wd(e)}}he.empty=new he(Ne.none,[],[],0);class on{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new on(this.buffer,this.index)}}class tt{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Ne.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],l=this.set.types[t],s=l.name;if(/\W/.test(s)&&!l.isError&&(s=JSON.stringify(s)),e+=4,n==e)return s;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return s+"("+a.join(",")+")"}findChild(e,t,n,l,s){let{buffer:a}=this,r=-1;for(let d=e;d!=t&&!(Ml(s,l,a[d+1],a[d+2])&&(r=d,n>0));d=a[d+3]);return r}slice(e,t,n){let l=this.buffer,s=new Uint16Array(t-e),a=0;for(let r=e,d=0;r<t;){s[d++]=l[r++],s[d++]=l[r++]-n;let h=s[d++]=l[r++]-n;s[d++]=l[r++]-e,a=Math.max(a,h)}return new tt(s,a,this.set)}}function Ml(o,e,t,n){switch(o){case-2:return t<e;case-1:return n>=e&&t<e;case 0:return t<e&&n>e;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function qt(o,e,t,n){for(var l;o.from==o.to||(t<1?o.from>=e:o.from>e)||(t>-1?o.to<=e:o.to<e);){let a=!n&&o instanceof Me&&o.index<0?null:o.parent;if(!a)return o;o=a}let s=n?0:pe.IgnoreOverlays;if(n)for(let a=o,r=a.parent;r;a=r,r=a.parent)a instanceof Me&&a.index<0&&((l=r.enter(e,t,s))===null||l===void 0?void 0:l.from)!=a.from&&(o=r);for(;;){let a=o.enter(e,t,s);if(!a)return o;o=a}}class Tl{cursor(e=0){return new rn(this,e)}getChild(e,t=null,n=null){let l=Al(this,e,t,n);return l.length?l[0]:null}getChildren(e,t=null,n=null){return Al(this,e,t,n)}resolve(e,t=0){return qt(this,e,t,!1)}resolveInner(e,t=0){return qt(this,e,t,!0)}matchContext(e){return an(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let l=t.lastChild;if(!l||l.to!=t.to)break;l.type.isError&&l.from==l.to?(n=t,t=l.prevSibling):t=l}return n}get node(){return this}get next(){return this.parent}}class Me extends Tl{constructor(e,t,n,l){super(),this._tree=e,this.from=t,this.index=n,this._parent=l}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,l,s=0){for(let a=this;;){for(let{children:r,positions:d}=a._tree,h=t>0?r.length:-1;e!=h;e+=t){let f=r[e],c=d[e]+a.from;if(Ml(l,n,c,c+f.length)){if(f instanceof tt){if(s&pe.ExcludeBuffers)continue;let u=f.findChild(0,f.buffer.length,t,n-c,l);if(u>-1)return new it(new kd(a,f,e,c),null,u)}else if(s&pe.IncludeAnonymous||!f.type.isAnonymous||dn(f)){let u;if(!(s&pe.IgnoreMounts)&&(u=hi.get(f))&&!u.overlay)return new Me(u.tree,c,e,a);let m=new Me(f,c,e,a);return s&pe.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?f.children.length-1:0,t,n,l)}}}if(s&pe.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+t:e=t<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let l;if(!(n&pe.IgnoreOverlays)&&(l=hi.get(this._tree))&&l.overlay){let s=e-this.from;for(let{from:a,to:r}of l.overlay)if((t>0?a<=s:a<s)&&(t<0?r>=s:r>s))return new Me(l.tree,l.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Al(o,e,t,n){let l=o.cursor(),s=[];if(!l.firstChild())return s;if(t!=null){for(let a=!1;!a;)if(a=l.type.is(t),!l.nextSibling())return s}for(;;){if(n!=null&&l.type.is(n))return s;if(l.type.is(e)&&s.push(l.node),!l.nextSibling())return n==null?s:[]}}function an(o,e,t=e.length-1){for(let n=o.parent;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}class kd{constructor(e,t,n,l){this.parent=e,this.buffer=t,this.index=n,this.start=l}}class it extends Tl{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:l}=this.context,s=l.findChild(this.index+4,l.buffer[this.index+3],e,t-this.context.start,n);return s<0?null:new it(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&pe.ExcludeBuffers)return null;let{buffer:l}=this.context,s=l.findChild(this.index+4,l.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new it(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new it(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new it(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,l=this.index+4,s=n.buffer[this.index+3];if(s>l){let a=n.buffer[this.index+1];e.push(n.slice(l,s,a)),t.push(0)}return new he(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function El(o){if(!o.length)return null;let e=0,t=o[0];for(let s=1;s<o.length;s++){let a=o[s];(a.from>t.from||a.to<t.to)&&(t=a,e=s)}let n=t instanceof Me&&t.index<0?null:t.parent,l=o.slice();return n?l[e]=n:l.splice(e,1),new bd(l,t)}class bd{constructor(e,t){this.heads=e,this.node=t}get next(){return El(this.heads)}}function yd(o,e,t){let n=o.resolveInner(e,t),l=null;for(let s=n instanceof Me?n:n.context.parent;s;s=s.parent)if(s.index<0){let a=s.parent;(l||(l=[n])).push(a.resolve(e,t)),s=a}else{let a=hi.get(s.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let r=new Me(a.tree,a.overlay[0].from+s.from,-1,s);(l||(l=[n])).push(qt(r,e,t,!1))}}return l?El(l):n}class rn{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Me)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:l}=this.buffer;return this.type=t||l.set.types[l.buffer[e]],this.from=n+l.buffer[e+1],this.to=n+l.buffer[e+2],!0}yield(e){return e?e instanceof Me?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:l}=this.buffer,s=l.findChild(this.index+4,l.buffer[this.index+3],e,t-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&pe.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&pe.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&pe.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let l=n<0?0:this.stack[n]+4;if(this.index!=l)return this.yieldBuf(t.findChild(l,this.index,-1,0,4))}else{let l=t.buffer[this.index+3];if(l<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(l)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:l}=this;if(l){if(e>0){if(this.index<l.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(l.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:n}=l)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let s=t+e,a=e<0?-1:n._tree.children.length;s!=a;s+=e){let r=n._tree.children[s];if(this.mode&pe.IncludeAnonymous||r instanceof tt||!r.type.isAnonymous||dn(r))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)e:for(let l=this.index,s=this.stack.length;s>=0;){for(let a=e;a;a=a._parent)if(a.index==l){if(l==this.index)return a;t=a,n=s+1;break e}l=this.stack[--s]}for(let l=n;l<this.stack.length;l++)t=new it(this.buffer,t,this.stack[l]);return this.bufferNode=new it(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let l=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(l=!0)}for(;l&&t&&t(this),l=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,l=!0}}}matchContext(e){if(!this.buffer)return an(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let l=e.length-1,s=this.stack.length-1;l>=0;s--){if(s<0)return an(this.node,e,l);let a=n[t.buffer[this.stack[s]]];if(!a.isAnonymous){if(e[l]&&e[l]!=a.name)return!1;l--}}return!0}}function dn(o){return o.children.some(e=>e instanceof tt||!e.type.isAnonymous||dn(e))}function wd(o){var e;let{buffer:t,nodeSet:n,maxBufferLength:l=Vl,reused:s=[],minRepeatType:a=n.types.length}=o,r=Array.isArray(t)?new on(t,t.length):t,d=n.types,h=0,f=0;function c(p,N,V,C,x,S){let{id:M,start:T,end:E,size:I}=r,L=f;for(;I<0;)if(r.next(),I==-1){let j=s[M];V.push(j),C.push(T-p);return}else if(I==-3){h=M;return}else if(I==-4){f=M;return}else throw new RangeError(`Unrecognized record size: ${I}`);let A=d[M],U,P,G=T-p;if(E-T<=l&&(P=k(r.pos-N,x))){let j=new Uint16Array(P.size-P.skip),B=r.pos-P.size,F=j.length;for(;r.pos>B;)F=v(P.start,j,F);U=new tt(j,E-P.start,n),G=P.start-p}else{let j=r.pos-I;r.next();let B=[],F=[],_=M>=a?M:-1,D=0,$=E;for(;r.pos>j;)_>=0&&r.id==_&&r.size>=0?(r.end<=$-l&&(b(B,F,T,D,r.end,$,_,L),D=B.length,$=r.end),r.next()):S>2500?u(T,j,B,F):c(T,j,B,F,_,S+1);if(_>=0&&D>0&&D<B.length&&b(B,F,T,D,T,$,_,L),B.reverse(),F.reverse(),_>-1&&D>0){let Q=m(A);U=cn(A,B,F,0,B.length,0,E-T,Q,Q)}else U=y(A,B,F,E-T,L-E)}V.push(U),C.push(G)}function u(p,N,V,C){let x=[],S=0,M=-1;for(;r.pos>N;){let{id:T,start:E,end:I,size:L}=r;if(L>4)r.next();else{if(M>-1&&E<M)break;M<0&&(M=I-l),x.push(T,E,I),S++,r.next()}}if(S){let T=new Uint16Array(S*4),E=x[x.length-2];for(let I=x.length-3,L=0;I>=0;I-=3)T[L++]=x[I],T[L++]=x[I+1]-E,T[L++]=x[I+2]-E,T[L++]=L;V.push(new tt(T,x[2]-E,n)),C.push(E-p)}}function m(p){return(N,V,C)=>{let x=0,S=N.length-1,M,T;if(S>=0&&(M=N[S])instanceof he){if(!S&&M.type==p&&M.length==C)return M;(T=M.prop(te.lookAhead))&&(x=V[S]+M.length+T)}return y(p,N,V,C,x)}}function b(p,N,V,C,x,S,M,T){let E=[],I=[];for(;p.length>C;)E.push(p.pop()),I.push(N.pop()+V-x);p.push(y(n.types[M],E,I,S-x,T-S)),N.push(x-V)}function y(p,N,V,C,x=0,S){if(h){let M=[te.contextHash,h];S=S?[M].concat(S):[M]}if(x>25){let M=[te.lookAhead,x];S=S?[M].concat(S):[M]}return new he(p,N,V,C,S)}function k(p,N){let V=r.fork(),C=0,x=0,S=0,M=V.end-l,T={size:0,start:0,skip:0};e:for(let E=V.pos-p;V.pos>E;){let I=V.size;if(V.id==N&&I>=0){T.size=C,T.start=x,T.skip=S,S+=4,C+=4,V.next();continue}let L=V.pos-I;if(I<0||L<E||V.start<M)break;let A=V.id>=a?4:0,U=V.start;for(V.next();V.pos>L;){if(V.size<0)if(V.size==-3)A+=4;else break e;else V.id>=a&&(A+=4);V.next()}x=U,C+=I,S+=A}return(N<0||C==p)&&(T.size=C,T.start=x,T.skip=S),T.size>4?T:void 0}function v(p,N,V){let{id:C,start:x,end:S,size:M}=r;if(r.next(),M>=0&&C<a){let T=V;if(M>4){let E=r.pos-(M-4);for(;r.pos>E;)V=v(p,N,V)}N[--V]=T,N[--V]=S-p,N[--V]=x-p,N[--V]=C}else M==-3?h=C:M==-4&&(f=C);return V}let w=[],O=[];for(;r.pos>0;)c(o.start||0,o.bufferStart||0,w,O,-1,0);let g=(e=o.length)!==null&&e!==void 0?e:w.length?O[0]+w[0].length:0;return new he(d[o.topID],w.reverse(),O.reverse(),g)}const Il=new WeakMap;function ui(o,e){if(!o.isAnonymous||e instanceof tt||e.type!=o)return 1;let t=Il.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=o||!(n instanceof he)){t=1;break}t+=ui(o,n)}Il.set(e,t)}return t}function cn(o,e,t,n,l,s,a,r,d){let h=0;for(let b=n;b<l;b++)h+=ui(o,e[b]);let f=Math.ceil(h*1.5/8),c=[],u=[];function m(b,y,k,v,w){for(let O=k;O<v;){let g=O,p=y[O],N=ui(o,b[O]);for(O++;O<v;O++){let V=ui(o,b[O]);if(N+V>=f)break;N+=V}if(O==g+1){if(N>f){let V=b[g];m(V.children,V.positions,0,V.children.length,y[g]+w);continue}c.push(b[g])}else{let V=y[O-1]+b[O-1].length-p;c.push(cn(o,b,y,g,O,p,V,null,d))}u.push(p+w-s)}}return m(e,t,n,l,0),(r||d)(c,u,a)}class ut{constructor(e,t,n,l,s=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=l,this.open=(s?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let l=[new ut(0,e.length,e,0,!1,n)];for(let s of t)s.to>e.length&&l.push(s);return l}static applyChanges(e,t,n=128){if(!t.length)return e;let l=[],s=1,a=e.length?e[0]:null;for(let r=0,d=0,h=0;;r++){let f=r<t.length?t[r]:null,c=f?f.fromA:1e9;if(c-d>=n)for(;a&&a.from<c;){let u=a;if(d>=u.from||c<=u.to||h){let m=Math.max(u.from,d)-h,b=Math.min(u.to,c)-h;u=m>=b?null:new ut(m,b,u.tree,u.offset+h,r>0,!!f)}if(u&&l.push(u),a.to>c)break;a=s<e.length?e[s++]:null}if(!f)break;d=f.toA,h=f.toA-f.toB}return l}}class Dl{startParse(e,t,n){return typeof e=="string"&&(e=new xd(e)),n=n?n.length?n.map(l=>new ln(l.from,l.to)):[new ln(0,0)]:[new ln(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let l=this.startParse(e,t,n);for(;;){let s=l.advance();if(s)return s}}}class xd{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new te({perNode:!0});class pi{constructor(e,t,n,l,s,a,r,d,h,f=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=l,this.pos=s,this.score=a,this.buffer=r,this.bufferBase=d,this.curContext=h,this.lookAhead=f,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let l=e.parser.context;return new pi(e,[],t,n,n,0,[],0,l?new Pl(l,l.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,l=e&65535,{parser:s}=this.p,a=this.reducePos<this.pos-25;a&&this.setLookAhead(this.pos);let r=s.dynamicPrecedence(l);if(r&&(this.score+=r),n==0){this.pushState(s.getGoto(this.state,l,!0),this.reducePos),l<s.minRepeatTerm&&this.storeNode(l,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(l,this.reducePos);return}let d=this.stack.length-(n-1)*3-(e&262144?6:0),h=d?this.stack[d-2]:this.p.ranges[0].from,f=this.reducePos-h;f>=2e3&&!(!((t=this.p.parser.nodeSet.types[l])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSize<f&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=f));let c=d?this.stack[d-1]:0,u=this.bufferBase+this.buffer.length-c;if(l<s.minRepeatTerm||e&131072){let m=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(l,h,m,u+4,!0)}if(e&262144)this.state=this.stack[d];else{let m=this.stack[d-3];this.state=s.getGoto(m,l,!0)}for(;this.stack.length>d;)this.stack.pop();this.reduceContext(l,h)}storeNode(e,t,n,l=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this,r=this.buffer.length;if(r==0&&a.parent&&(r=a.bufferBase-a.parent.bufferBase,a=a.parent),r>0&&a.buffer[r-4]==0&&a.buffer[r-1]>-1){if(t==n)return;if(a.buffer[r-2]>=t){a.buffer[r-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,t,n,l);else{let a=this.buffer.length;if(a>0&&this.buffer[a-4]!=0){let r=!1;for(let d=a;d>0&&this.buffer[d-2]>n;d-=4)if(this.buffer[d-1]>=0){r=!0;break}if(r)for(;a>0&&this.buffer[a-2]>n;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,l>4&&(l-=4)}this.buffer[a]=e,this.buffer[a+1]=t,this.buffer[a+2]=n,this.buffer[a+3]=l}}shift(e,t,n,l){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=l,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,l,4);else{let s=e,{parser:a}=this.p;(l>this.pos||t<=a.maxNode)&&(this.pos=l,a.stateFlag(s,1)||(this.reducePos=l)),this.pushState(s,n),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,l,4)}}apply(e,t,n,l){e&65536?this.reduce(e):this.shift(e,t,n,l)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let l=this.pos;this.reducePos=this.pos=l+e.length,this.pushState(t,l),this.buffer.push(n,l,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),l=e.bufferBase+t;for(;e&&l==e.bufferBase;)e=e.parent;return new pi(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,l,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new vd(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let l=[];for(let s=0,a;s<t.length;s+=2)(a=t[s+1])!=this.state&&this.p.parser.hasAction(a,e)&&l.push(t[s],a);if(this.stack.length<120)for(let s=0;l.length<8&&s<t.length;s+=2){let a=t[s+1];l.some((r,d)=>d&1&&r==a)||l.push(t[s],a)}t=l}let n=[];for(let l=0;l<t.length&&n.length<4;l+=2){let s=t[l+1];if(s==this.state)continue;let a=this.split();a.pushState(s,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(t[l],this.pos),a.reducePos=this.pos,a.score-=200,n.push(a)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,l=t&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],l,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;t=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(l,s)=>{if(!t.includes(l))return t.push(l),e.allActions(l,a=>{if(!(a&393216))if(a&65536){let r=(a>>19)-s;if(r>1){let d=a&65535,h=this.stack.length-r*3;if(h>=0&&e.getGoto(this.stack[h],d,!1)>=0)return r<<19|65536|d}}else{let r=n(a,s+1);if(r!=null)return r}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Pl(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Pl{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class vd{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let l=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=l}}class mi{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new mi(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new mi(this.stack,this.pos,this.index)}}function gi(o,e=Uint16Array){if(typeof o!="string")return o;let t=null;for(let n=0,l=0;n<o.length;){let s=0;for(;;){let a=o.charCodeAt(n++),r=!1;if(a==126){s=65535;break}a>=92&&a--,a>=34&&a--;let d=a-32;if(d>=46&&(d-=46,r=!0),s+=d,r)break;s*=46}t?t[l++]=s:t=new e(s)}return t}class ki{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Fl=new ki;class Cd{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Fl,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,l=this.rangeIndex,s=this.pos+e;for(;s<n.from;){if(!l)return null;let a=this.ranges[--l];s-=n.from-a.to,n=a}for(;t<0?s>n.to:s>=n.to;){if(l==this.ranges.length-1)return null;let a=this.ranges[++l];s+=a.from-n.to,n=a}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,l;if(t>=0&&t<this.chunk.length)n=this.pos+e,l=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(n=s,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)l=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let a=this.rangeIndex,r=this.range;for(;r.to<=n;)r=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>r.to&&(this.chunk2=this.chunk2.slice(0,r.to-n)),l=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),l}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Fl,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let l of this.ranges){if(l.from>=t)break;l.to>e&&(n+=this.input.read(Math.max(l.from,e),Math.min(l.to,t)))}return n}}class vt{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Sd(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}vt.prototype.contextual=vt.prototype.fallback=vt.prototype.extend=!1,vt.prototype.fallback=vt.prototype.extend=!1;function Sd(o,e,t,n,l,s){let a=0,r=1<<n,{dialect:d}=t.p.parser;e:for(;r&o[a];){let h=o[a+1];for(let m=a+3;m<h;m+=2)if((o[m+1]&r)>0){let b=o[m];if(d.allows(b)&&(e.token.value==-1||e.token.value==b||Nd(b,e.token.value,l,s))){e.acceptToken(b);break}}let f=e.next,c=0,u=o[a+2];if(e.next<0&&u>c&&o[h+u*3-3]==65535){a=o[h+u*3-1];continue e}for(;c<u;){let m=c+u>>1,b=h+m+(m<<1),y=o[b],k=o[b+1]||65536;if(f<y)u=m;else if(f>=k)c=m+1;else{a=o[b+2],e.advance();continue e}}break}}function $l(o,e,t){for(let n=e,l;(l=o[n])!=65535;n++)if(l==t)return n-e;return-1}function Nd(o,e,t,n){let l=$l(t,n,e);return l<0||$l(t,n,o)<l}const Oe=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let hn=null;function Rl(o,e,t){let n=o.cursor(pe.IncludeAnonymous);for(n.moveTo(e);;)if(!(t<0?n.childBefore(e):n.childAfter(e)))for(;;){if((t<0?n.to<e:n.from>e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(o.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:o.length}}class Bd{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Rl(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Rl(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],l=this.index[t];if(l==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[l],a=this.start[t]+n.positions[l];if(a>e)return this.nextStart=a,null;if(s instanceof he){if(a==e){if(a<this.safeFrom)return null;let r=a+s.length;if(r<=this.safeTo){let d=s.prop(te.lookAhead);if(!d||r+d<this.fragment.to)return s}}this.index[t]++,a+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+s.length}}}class Od{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new ki)}getActions(e){let t=0,n=null,{parser:l}=e.p,{tokenizers:s}=l,a=l.stateSlot(e.state,3),r=e.curContext?e.curContext.hash:0,d=0;for(let h=0;h<s.length;h++){if(!(1<<h&a))continue;let f=s[h],c=this.tokens[h];if(!(n&&!f.fallback)&&((f.contextual||c.start!=e.pos||c.mask!=a||c.context!=r)&&(this.updateCachedToken(c,f,e),c.mask=a,c.context=r),c.lookAhead>c.end+25&&(d=Math.max(c.lookAhead,d)),c.value!=0)){let u=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!f.extend&&(n=c,t>u))break}}for(;this.actions.length>t;)this.actions.pop();return d&&e.setLookAhead(d),!n&&e.pos==this.stream.end&&(n=new ki,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ki,{pos:n,p:l}=e;return t.start=n,t.end=Math.min(n+1,l.stream.end),t.value=n==l.stream.end?l.parser.eofTerm:0,t}updateCachedToken(e,t,n){let l=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(l,e),n),e.value>-1){let{parser:s}=n.p;for(let a=0;a<s.specialized.length;a++)if(s.specialized[a]==e.value){let r=s.specializers[a](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){r&1?e.extended=r>>1:e.value=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(l+1)}putAction(e,t,n,l){for(let s=0;s<l;s+=3)if(this.actions[s]==e)return l;return this.actions[l++]=e,this.actions[l++]=t,this.actions[l++]=n,l}addActions(e,t,n,l){let{state:s}=e,{parser:a}=e.p,{data:r}=a;for(let d=0;d<2;d++)for(let h=a.stateSlot(s,d?2:1);;h+=3){if(r[h]==65535)if(r[h+1]==1)h=Qe(r,h+2);else{l==0&&r[h+1]==2&&(l=this.putAction(Qe(r,h+2),t,n,l));break}r[h]==t&&(l=this.putAction(Qe(r,h+1),t,n,l))}return l}}class Vd{constructor(e,t,n,l){this.parser=e,this.input=t,this.ranges=l,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Cd(t,l),this.tokens=new Od(e,this.stream),this.topTerm=e.top[1];let{from:s}=l[0];this.stacks=[pi.start(this,e.top[0],s)],this.fragments=n.length&&this.stream.end-s>e.bufferLength*4?new Bd(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],l,s;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let r=e[a];for(;;){if(this.tokens.mainToken=null,r.pos>t)n.push(r);else{if(this.advanceStack(r,n,e))continue;{l||(l=[],s=[]),l.push(r);let d=this.tokens.getMainToken(r);s.push(d.value,d.end)}}break}}if(!n.length){let a=l&&Md(l);if(a)return Oe&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Oe&&l&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&l){let a=this.stoppedAt!=null&&l[0].pos>this.stoppedAt?l[0]:this.runRecovery(l,s,n);if(a)return Oe&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(n.length>a)for(n.sort((r,d)=>d.score-r.score);n.length>a;)n.pop();n.some(r=>r.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let a=0;a<n.length-1;a++){let r=n[a];for(let d=a+1;d<n.length;d++){let h=n[d];if(r.sameState(h)||r.buffer.length>500&&h.buffer.length>500)if((r.score-h.score||r.buffer.length-h.buffer.length)>0)n.splice(d--,1);else{n.splice(a--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let a=1;a<n.length;a++)n[a].pos<this.minStackPos&&(this.minStackPos=n[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let l=e.pos,{parser:s}=this,a=Oe?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&l>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,f=h?e.curContext.hash:0;for(let c=this.fragments.nodeAt(l);c;){let u=this.parser.nodeSet.types[c.type.id]==c.type?s.getGoto(e.state,c.type.id):-1;if(u>-1&&c.length&&(!h||(c.prop(te.contextHash)||0)==f))return e.useNode(c,u),Oe&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(c.type.id)})`),!0;if(!(c instanceof he)||c.children.length==0||c.positions[0]>0)break;let m=c.children[0];if(m instanceof he&&c.positions[0]==0)c=m;else break}}let r=s.stateSlot(e.state,4);if(r>0)return e.reduce(r),Oe&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(r&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let d=this.tokens.getActions(e);for(let h=0;h<d.length;){let f=d[h++],c=d[h++],u=d[h++],m=h==d.length||!n,b=m?e:e.split(),y=this.tokens.mainToken;if(b.apply(f,c,y?y.start:b.pos,u),Oe&&console.log(a+this.stackID(b)+` (via ${f&65536?`reduce of ${s.getName(f&65535)}`:"shift"} for ${s.getName(c)} @ ${l}${b==e?"":", split"})`),m)return!0;b.pos>l?t.push(b):n.push(b)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Ll(e,t),!0}}runRecovery(e,t,n){let l=null,s=!1;for(let a=0;a<e.length;a++){let r=e[a],d=t[a<<1],h=t[(a<<1)+1],f=Oe?this.stackID(r)+" -> ":"";if(r.deadEnd&&(s||(s=!0,r.restart(),Oe&&console.log(f+this.stackID(r)+" (restarted)"),this.advanceFully(r,n))))continue;let c=r.split(),u=f;for(let m=0;c.forceReduce()&&m<10&&(Oe&&console.log(u+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));m++)Oe&&(u=this.stackID(c)+" -> ");for(let m of r.recoverByInsert(d))Oe&&console.log(f+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,n);this.stream.end>r.pos?(h==r.pos&&(h++,d=0),r.recoverByDelete(d,h),Oe&&console.log(f+this.stackID(r)+` (via recover-delete ${this.parser.getName(d)})`),Ll(r,n)):(!l||l.score<r.score)&&(l=r)}return l}stackToTree(e){return e.close(),he.build({buffer:mi.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(hn||(hn=new WeakMap)).get(e);return t||hn.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function Ll(o,e){for(let t=0;t<e.length;t++){let n=e[t];if(n.pos==o.pos&&n.sameState(o)){e[t].score<o.score&&(e[t]=o);return}}e.push(o)}class _d{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}class bi extends Dl{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let r=0;r<e.repeatNodeCount;r++)t.push("");let n=Object.keys(e.topRules).map(r=>e.topRules[r][1]),l=[];for(let r=0;r<t.length;r++)l.push([]);function s(r,d,h){l[r].push([d,d.deserialize(String(h))])}if(e.nodeProps)for(let r of e.nodeProps){let d=r[0];typeof d=="string"&&(d=te[d]);for(let h=1;h<r.length;){let f=r[h++];if(f>=0)s(f,d,r[h++]);else{let c=r[h+-f];for(let u=-f;u>0;u--)s(r[h++],d,c);h++}}}this.nodeSet=new sn(t.map((r,d)=>Ne.define({name:d>=this.minRepeatTerm?void 0:r,id:d,props:l[d],top:n.indexOf(d)>-1,error:d==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(d)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Vl;let a=gi(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let r=0;r<this.specializerSpecs.length;r++)this.specialized[r]=this.specializerSpecs[r].term;this.specializers=this.specializerSpecs.map(jl),this.states=gi(e.states,Uint32Array),this.data=gi(e.stateData),this.goto=gi(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(r=>typeof r=="number"?new vt(a,r):r),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let l=new Vd(this,e,t,n);for(let s of this.wrappers)l=s(l,e,t,n);return l}getGoto(e,t,n=!1){let l=this.goto;if(t>=l[0])return-1;for(let s=l[t+1];;){let a=l[s++],r=a&1,d=l[s++];if(r&&n)return d;for(let h=s+(a>>1);s<h;s++)if(l[s]==e)return d;if(r)return-1}}hasAction(e,t){let n=this.data;for(let l=0;l<2;l++)for(let s=this.stateSlot(e,l?2:1),a;;s+=3){if((a=n[s])==65535)if(n[s+1]==1)a=n[s=Qe(n,s+2)];else{if(n[s+1]==2)return Qe(n,s+2);break}if(a==t||a==0)return Qe(n,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),l=n?t(n):void 0;for(let s=this.stateSlot(e,1);l==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Qe(this.data,s+2);else break;l=t(Qe(this.data,s+1))}return l}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Qe(this.data,n+2);else break;if(!(this.data[n+2]&1)){let l=this.data[n+1];t.some((s,a)=>a&1&&s==l)||t.push(this.data[n],l)}}return t}configure(e){let t=Object.assign(Object.create(bi.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let l=e.tokenizers.find(s=>s.from==n);return l?l.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,l)=>{let s=e.specializers.find(r=>r.from==n.external);if(!s)return n;let a=Object.assign(Object.assign({},n),{external:s.to});return t.specializers[l]=jl(a),a})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let s of e.split(" ")){let a=t.indexOf(s);a>=0&&(n[a]=!0)}let l=null;for(let s=0;s<t.length;s++)if(!n[s])for(let a=this.dialects[t[s]],r;(r=this.data[a++])!=65535;)(l||(l=new Uint8Array(this.maxTerm+1)))[r]=1;return new _d(e,n,l)}static deserialize(e){return new bi(e)}}function Qe(o,e){return o[e]|o[e+1]<<16}function Md(o){let e=null;for(let t of o){let n=t.p.stoppedAt;(t.pos==t.p.stream.end||n!=null&&t.pos>n)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function jl(o){if(o.external){let e=o.extend?1:0;return(t,n)=>o.external(t,n)<<1|e}return o.get}let Td=0;class Te{constructor(e,t,n,l){this.name=e,this.set=t,this.base=n,this.modified=l,this.id=Td++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof Te&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let l=new Te(n,[],null,[]);if(l.set.push(l),t)for(let s of t.set)l.set.push(s);return l}static defineModifier(e){let t=new yi(e);return n=>n.modified.indexOf(t)>-1?n:yi.get(n.base||n,n.modified.concat(t).sort((l,s)=>l.id-s.id))}}let Ad=0;class yi{constructor(e){this.name=e,this.instances=[],this.id=Ad++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(r=>r.base==e&&Ed(t,r.modified));if(n)return n;let l=[],s=new Te(e.name,l,e,t);for(let r of t)r.instances.push(s);let a=Id(t);for(let r of e.set)if(!r.modified.length)for(let d of a)l.push(yi.get(r,d));return s}}function Ed(o,e){return o.length==e.length&&o.every((t,n)=>t==e[n])}function Id(o){let e=[[]];for(let t=0;t<o.length;t++)for(let n=0,l=e.length;n<l;n++)e.push(e[n].concat(o[t]));return e.sort((t,n)=>n.length-t.length)}function zl(o){let e=Object.create(null);for(let t in o){let n=o[t];Array.isArray(n)||(n=[n]);for(let l of t.split(" "))if(l){let s=[],a=2,r=l;for(let c=0;;){if(r=="..."&&c>0&&c+3==l.length){a=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(r);if(!u)throw new RangeError("Invalid path: "+l);if(s.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),c+=u[0].length,c==l.length)break;let m=l[c++];if(c==l.length&&m=="!"){a=0;break}if(m!="/")throw new RangeError("Invalid path: "+l);r=l.slice(c)}let d=s.length-1,h=s[d];if(!h)throw new RangeError("Invalid path: "+l);let f=new fn(n,a,d>0?s.slice(0,d):null);e[h]=f.sort(e[h])}}return Dd.add(e)}const Dd=new te;class fn{constructor(e,t,n,l){this.tags=e,this.mode=t,this.context=n,this.next=l}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}fn.empty=new fn([],2,null);function ql(o,e){let t=Object.create(null);for(let s of o)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let a of s.tag)t[a.id]=s.class;let{scope:n,all:l=null}=e||{};return{style:s=>{let a=l;for(let r of s)for(let d of r.set){let h=t[d.id];if(h){a=a?a+" "+h:h;break}}return a},scope:n}}const q=Te.define,wi=q(),nt=q(),Ul=q(nt),Wl=q(nt),lt=q(),xi=q(lt),un=q(lt),$e=q(),pt=q($e),Re=q(),Le=q(),pn=q(),Ut=q(pn),vi=q(),z={comment:wi,lineComment:q(wi),blockComment:q(wi),docComment:q(wi),name:nt,variableName:q(nt),typeName:Ul,tagName:q(Ul),propertyName:Wl,attributeName:q(Wl),className:q(nt),labelName:q(nt),namespace:q(nt),macroName:q(nt),literal:lt,string:xi,docString:q(xi),character:q(xi),attributeValue:q(xi),number:un,integer:q(un),float:q(un),bool:q(lt),regexp:q(lt),escape:q(lt),color:q(lt),url:q(lt),keyword:Re,self:q(Re),null:q(Re),atom:q(Re),unit:q(Re),modifier:q(Re),operatorKeyword:q(Re),controlKeyword:q(Re),definitionKeyword:q(Re),moduleKeyword:q(Re),operator:Le,derefOperator:q(Le),arithmeticOperator:q(Le),logicOperator:q(Le),bitwiseOperator:q(Le),compareOperator:q(Le),updateOperator:q(Le),definitionOperator:q(Le),typeOperator:q(Le),controlOperator:q(Le),punctuation:pn,separator:q(pn),bracket:Ut,angleBracket:q(Ut),squareBracket:q(Ut),paren:q(Ut),brace:q(Ut),content:$e,heading:pt,heading1:q(pt),heading2:q(pt),heading3:q(pt),heading4:q(pt),heading5:q(pt),heading6:q(pt),contentSeparator:q($e),list:q($e),quote:q($e),emphasis:q($e),strong:q($e),link:q($e),monospace:q($e),strikethrough:q($e),inserted:q(),deleted:q(),changed:q(),invalid:q(),meta:vi,documentMeta:q(vi),annotation:q(vi),processingInstruction:q(vi),definition:Te.defineModifier("definition"),constant:Te.defineModifier("constant"),function:Te.defineModifier("function"),standard:Te.defineModifier("standard"),local:Te.defineModifier("local"),special:Te.defineModifier("special")};for(let o in z){let e=z[o];e instanceof Te&&(e.name=o)}ql([{tag:z.link,class:"tok-link"},{tag:z.heading,class:"tok-heading"},{tag:z.emphasis,class:"tok-emphasis"},{tag:z.strong,class:"tok-strong"},{tag:z.keyword,class:"tok-keyword"},{tag:z.atom,class:"tok-atom"},{tag:z.bool,class:"tok-bool"},{tag:z.url,class:"tok-url"},{tag:z.labelName,class:"tok-labelName"},{tag:z.inserted,class:"tok-inserted"},{tag:z.deleted,class:"tok-deleted"},{tag:z.literal,class:"tok-literal"},{tag:z.string,class:"tok-string"},{tag:z.number,class:"tok-number"},{tag:[z.regexp,z.escape,z.special(z.string)],class:"tok-string2"},{tag:z.variableName,class:"tok-variableName"},{tag:z.local(z.variableName),class:"tok-variableName tok-local"},{tag:z.definition(z.variableName),class:"tok-variableName tok-definition"},{tag:z.special(z.variableName),class:"tok-variableName2"},{tag:z.definition(z.propertyName),class:"tok-propertyName tok-definition"},{tag:z.typeName,class:"tok-typeName"},{tag:z.namespace,class:"tok-namespace"},{tag:z.className,class:"tok-className"},{tag:z.macroName,class:"tok-macroName"},{tag:z.propertyName,class:"tok-propertyName"},{tag:z.operator,class:"tok-operator"},{tag:z.comment,class:"tok-comment"},{tag:z.meta,class:"tok-meta"},{tag:z.invalid,class:"tok-invalid"},{tag:z.punctuation,class:"tok-punctuation"}]);const Pd=zl({String:z.string,Number:z.number,"True False":z.bool,PropertyName:z.propertyName,Null:z.null,",":z.separator,"[ ]":z.squareBracket,"{ }":z.brace}),Fd=bi.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[Pd],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});class ie{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=Ct(this,e,t);let l=[];return this.decompose(0,e,l,2),n.length&&n.decompose(0,n.length,l,3),this.decompose(t,this.length,l,1),je.from(l,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ct(this,e,t);let n=[];return this.decompose(e,t,n,0),je.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),l=new Wt(this),s=new Wt(e);for(let a=t,r=t;;){if(l.next(a),s.next(a),a=0,l.lineBreak!=s.lineBreak||l.done!=s.done||l.value!=s.value)return!1;if(r+=l.value.length,l.done||r>=n)return!0}}iter(e=1){return new Wt(this,e)}iterRange(e,t=this.length){return new Kl(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let l=this.line(e).from;n=this.iterRange(l,Math.max(l,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ql(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ie.empty:e.length<=32?new ce(e):je.from(ce.split(e,[]))}}class ce extends ie{constructor(e,t=$d(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,l){for(let s=0;;s++){let a=this.text[s],r=l+a.length;if((t?n:r)>=e)return new Rd(l,r,n,a);l=r+1,n++}}decompose(e,t,n,l){let s=e<=0&&t>=this.length?this:new ce(Hl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(l&1){let a=n.pop(),r=Ci(s.text,a.text.slice(),0,s.length);if(r.length<=32)n.push(new ce(r,a.length+s.length));else{let d=r.length>>1;n.push(new ce(r.slice(0,d)),new ce(r.slice(d)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof ce))return super.replace(e,t,n);[e,t]=Ct(this,e,t);let l=Ci(this.text,Ci(n.text,Hl(this.text,0,e)),t),s=this.length+n.length-(t-e);return l.length<=32?new ce(l,s):je.from(ce.split(l,[]),s)}sliceString(e,t=this.length,n=`
2
- `){[e,t]=Ct(this,e,t);let l="";for(let s=0,a=0;s<=t&&a<this.text.length;a++){let r=this.text[a],d=s+r.length;s>e&&a&&(l+=n),e<d&&t>s&&(l+=r.slice(Math.max(0,e-s),t-s)),s=d+1}return l}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],l=-1;for(let s of e)n.push(s),l+=s.length+1,n.length==32&&(t.push(new ce(n,l)),n=[],l=-1);return l>-1&&t.push(new ce(n,l)),t}}class je extends ie{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,l){for(let s=0;;s++){let a=this.children[s],r=l+a.length,d=n+a.lines-1;if((t?d:r)>=e)return a.lineInner(e,t,n,l);l=r+1,n=d+1}}decompose(e,t,n,l){for(let s=0,a=0;a<=t&&s<this.children.length;s++){let r=this.children[s],d=a+r.length;if(e<=d&&t>=a){let h=l&((a<=e?1:0)|(d>=t?2:0));a>=e&&d<=t&&!h?n.push(r):r.decompose(e-a,t-a,n,h)}a=d+1}}replace(e,t,n){if([e,t]=Ct(this,e,t),n.lines<this.lines)for(let l=0,s=0;l<this.children.length;l++){let a=this.children[l],r=s+a.length;if(e>=s&&t<=r){let d=a.replace(e-s,t-s,n),h=this.lines-a.lines+d.lines;if(d.lines<h>>4&&d.lines>h>>6){let f=this.children.slice();return f[l]=d,new je(f,this.length-(t-e)+n.length)}return super.replace(s,r,d)}s=r+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
3
- `){[e,t]=Ct(this,e,t);let l="";for(let s=0,a=0;s<this.children.length&&a<=t;s++){let r=this.children[s],d=a+r.length;a>e&&s&&(l+=n),e<d&&t>a&&(l+=r.sliceString(e-a,t-a,n)),a=d+1}return l}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof je))return 0;let n=0,[l,s,a,r]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;l+=t,s+=t){if(l==a||s==r)return n;let d=this.children[l],h=e.children[s];if(d!=h)return n+d.scanIdentical(h,t);n+=d.length+1}}static from(e,t=e.reduce((n,l)=>n+l.length+1,-1)){let n=0;for(let m of e)n+=m.lines;if(n<32){let m=[];for(let b of e)b.flatten(m);return new ce(m,t)}let l=Math.max(32,n>>5),s=l<<1,a=l>>1,r=[],d=0,h=-1,f=[];function c(m){let b;if(m.lines>s&&m instanceof je)for(let y of m.children)c(y);else m.lines>a&&(d>a||!d)?(u(),r.push(m)):m instanceof ce&&d&&(b=f[f.length-1])instanceof ce&&m.lines+b.lines<=32?(d+=m.lines,h+=m.length+1,f[f.length-1]=new ce(b.text.concat(m.text),b.length+1+m.length)):(d+m.lines>l&&u(),d+=m.lines,h+=m.length+1,f.push(m))}function u(){d!=0&&(r.push(f.length==1?f[0]:je.from(f,h)),h=-1,d=f.length=0)}for(let m of e)c(m);return u(),r.length==1?r[0]:new je(r,t)}}ie.empty=new ce([""],0);function $d(o){let e=-1;for(let t of o)e+=t.length+1;return e}function Ci(o,e,t=0,n=1e9){for(let l=0,s=0,a=!0;s<o.length&&l<=n;s++){let r=o[s],d=l+r.length;d>=t&&(d>n&&(r=r.slice(0,n-l)),l<t&&(r=r.slice(t-l)),a?(e[e.length-1]+=r,a=!1):e.push(r)),l=d+1}return e}function Hl(o,e,t){return Ci(o,[""],e,t)}class Wt{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof ce?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,l=this.nodes[n],s=this.offsets[n],a=s>>1,r=l instanceof ce?l.text.length:l.children.length;if(a==(t>0?r:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
4
- `,this;e--}else if(l instanceof ce){let d=l.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,d.length>Math.max(0,e))return this.value=e==0?d:t>0?d.slice(e):d.slice(0,d.length-e),this;e-=d.length}else{let d=l.children[a+(t<0?-1:0)];e>d.length?(e-=d.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(d),this.offsets.push(t>0?1:(d instanceof ce?d.text.length:d.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kl{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Wt(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:l}=this.cursor.next(e);return this.pos+=(l.length+e)*t,this.value=l.length<=n?l:t<0?l.slice(l.length-n):l.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ql{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:l}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=l,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ie.prototype[Symbol.iterator]=function(){return this.iter()},Wt.prototype[Symbol.iterator]=Kl.prototype[Symbol.iterator]=Ql.prototype[Symbol.iterator]=function(){return this});class Rd{constructor(e,t,n,l){this.from=e,this.to=t,this.number=n,this.text=l}get length(){return this.to-this.from}}function Ct(o,e,t){return e=Math.max(0,Math.min(o.length,e)),[e,Math.max(e,Math.min(o.length,t))]}let St="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(o=>o?parseInt(o,36):1);for(let o=1;o<St.length;o++)St[o]+=St[o-1];function Ld(o){for(let e=1;e<St.length;e+=2)if(St[e]>o)return St[e-1]<=o;return!1}function Gl(o){return o>=127462&&o<=127487}const Yl=8205;function Ge(o,e,t=!0,n=!0){return(t?Xl:jd)(o,e,n)}function Xl(o,e,t){if(e==o.length)return e;e&&Jl(o.charCodeAt(e))&&Zl(o.charCodeAt(e-1))&&e--;let n=mn(o,e);for(e+=es(n);e<o.length;){let l=mn(o,e);if(n==Yl||l==Yl||t&&Ld(l))e+=es(l),n=l;else if(Gl(l)){let s=0,a=e-2;for(;a>=0&&Gl(mn(o,a));)s++,a-=2;if(s%2==0)break;e+=2}else break}return e}function jd(o,e,t){for(;e>0;){let n=Xl(o,e-2,t);if(n<e)return n;e--}return 0}function Jl(o){return o>=56320&&o<57344}function Zl(o){return o>=55296&&o<56320}function mn(o,e){let t=o.charCodeAt(e);if(!Zl(t)||e+1==o.length)return t;let n=o.charCodeAt(e+1);return Jl(n)?(t-55296<<10)+(n-56320)+65536:t}function es(o){return o<65536?1:2}const gn=/\r\n?|\n/;var Ve=function(o){return o[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o}(Ve||(Ve={}));class Ye{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,l=0;t<this.sections.length;){let s=this.sections[t++],a=this.sections[t++];a<0?(e(n,l,s),l+=s):l+=a,n+=s}}iterChangedRanges(e,t=!1){kn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],l=this.sections[t++];l<0?e.push(n,l):e.push(l,n)}return new Ye(e)}composeDesc(e){return this.empty?e:e.empty?this:ts(this,e)}mapDesc(e,t=!1){return e.empty?this:bn(this,e,t)}mapPos(e,t=-1,n=Ve.Simple){let l=0,s=0;for(let a=0;a<this.sections.length;){let r=this.sections[a++],d=this.sections[a++],h=l+r;if(d<0){if(h>e)return s+(e-l);s+=r}else{if(n!=Ve.Simple&&h>=e&&(n==Ve.TrackDel&&l<e&&h>e||n==Ve.TrackBefore&&l<e||n==Ve.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!r)return e==l||t<0?s:s+d;s+=d}l=h}if(e>l)throw new RangeError(`Position ${e} is out of range for changeset of length ${l}`);return s}touchesRange(e,t=e){for(let n=0,l=0;n<this.sections.length&&l<=t;){let s=this.sections[n++],a=this.sections[n++],r=l+s;if(a>=0&&l<=t&&r>=e)return l<e&&r>t?"cover":!0;l=r}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],l=this.sections[t++];e+=(e?" ":"")+n+(l>=0?":"+l:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ye(e)}static create(e){return new Ye(e)}}class me extends Ye{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return kn(this,(t,n,l,s,a)=>e=e.replace(l,l+(n-t),a),!1),e}mapDesc(e,t=!1){return bn(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let l=0,s=0;l<t.length;l+=2){let a=t[l],r=t[l+1];if(r>=0){t[l]=r,t[l+1]=a;let d=l>>1;for(;n.length<d;)n.push(ie.empty);n.push(a?e.slice(s,s+a):ie.empty)}s+=a}return new me(t,n)}compose(e){return this.empty?e:e.empty?this:ts(this,e,!0)}map(e,t=!1){return e.empty?this:bn(this,e,t,!0)}iterChanges(e,t=!1){kn(this,e,t)}get desc(){return Ye.create(this.sections)}filter(e){let t=[],n=[],l=[],s=new Ht(this);e:for(let a=0,r=0;;){let d=a==e.length?1e9:e[a++];for(;r<d||r==d&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,d-r);we(l,f,-1);let c=s.ins==-1?-1:s.off==0?s.ins:0;we(t,f,c),c>0&&st(n,t,s.text),s.forward(f),r+=f}let h=e[a++];for(;r<h;){if(s.done)break e;let f=Math.min(s.len,h-r);we(t,f,-1),we(l,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),r+=f}}return{changes:new me(t,n),filtered:Ye.create(l)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],l=this.sections[t+1];l<0?e.push(n):l==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let l=[],s=[],a=0,r=null;function d(f=!1){if(!f&&!l.length)return;a<t&&we(l,t-a,-1);let c=new me(l,s);r=r?r.compose(c.map(r)):c,l=[],s=[],a=0}function h(f){if(Array.isArray(f))for(let c of f)h(c);else if(f instanceof me){if(f.length!=t)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${t})`);d(),r=r?r.compose(f.map(r)):f}else{let{from:c,to:u=c,insert:m}=f;if(c>u||c<0||u>t)throw new RangeError(`Invalid change range ${c} to ${u} (in doc of length ${t})`);let b=m?typeof m=="string"?ie.of(m.split(n||gn)):m:ie.empty,y=b.length;if(c==u&&y==0)return;c<a&&d(),c>a&&we(l,c-a,-1),we(l,u-c,y),st(s,l,b),a=u}}return h(e),d(!r),r}static empty(e){return new me(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let l=0;l<e.length;l++){let s=e[l];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((a,r)=>r&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<l;)n.push(ie.empty);n[l]=ie.of(s.slice(1)),t.push(s[0],n[l].length)}}}return new me(t,n)}static createSet(e,t){return new me(e,t)}}function we(o,e,t,n=!1){if(e==0&&t<=0)return;let l=o.length-2;l>=0&&t<=0&&t==o[l+1]?o[l]+=e:e==0&&o[l]==0?o[l+1]+=t:n?(o[l]+=e,o[l+1]+=t):o.push(e,t)}function st(o,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<o.length)o[o.length-1]=o[o.length-1].append(t);else{for(;o.length<n;)o.push(ie.empty);o.push(t)}}function kn(o,e,t){let n=o.inserted;for(let l=0,s=0,a=0;a<o.sections.length;){let r=o.sections[a++],d=o.sections[a++];if(d<0)l+=r,s+=r;else{let h=l,f=s,c=ie.empty;for(;h+=r,f+=d,d&&n&&(c=c.append(n[a-2>>1])),!(t||a==o.sections.length||o.sections[a+1]<0);)r=o.sections[a++],d=o.sections[a++];e(l,h,s,f,c),l=h,s=f}}}function bn(o,e,t,n=!1){let l=[],s=n?[]:null,a=new Ht(o),r=new Ht(e);for(let d=-1;;)if(a.ins==-1&&r.ins==-1){let h=Math.min(a.len,r.len);we(l,h,-1),a.forward(h),r.forward(h)}else if(r.ins>=0&&(a.ins<0||d==a.i||a.off==0&&(r.len<a.len||r.len==a.len&&!t))){let h=r.len;for(we(l,r.ins,-1);h;){let f=Math.min(a.len,h);a.ins>=0&&d<a.i&&a.len<=f&&(we(l,0,a.ins),s&&st(s,l,a.text),d=a.i),a.forward(f),h-=f}r.next()}else if(a.ins>=0){let h=0,f=a.len;for(;f;)if(r.ins==-1){let c=Math.min(f,r.len);h+=c,f-=c,r.forward(c)}else if(r.ins==0&&r.len<f)f-=r.len,r.next();else break;we(l,h,d<a.i?a.ins:0),s&&d<a.i&&st(s,l,a.text),d=a.i,a.forward(a.len-f)}else{if(a.done&&r.done)return s?me.createSet(l,s):Ye.create(l);throw new Error("Mismatched change set lengths")}}function ts(o,e,t=!1){let n=[],l=t?[]:null,s=new Ht(o),a=new Ht(e);for(let r=!1;;){if(s.done&&a.done)return l?me.createSet(n,l):Ye.create(n);if(s.ins==0)we(n,s.len,0,r),s.next();else if(a.len==0&&!a.done)we(n,0,a.ins,r),l&&st(l,n,a.text),a.next();else{if(s.done||a.done)throw new Error("Mismatched change set lengths");{let d=Math.min(s.len2,a.len),h=n.length;if(s.ins==-1){let f=a.ins==-1?-1:a.off?0:a.ins;we(n,d,f,r),l&&f&&st(l,n,a.text)}else a.ins==-1?(we(n,s.off?0:s.len,d,r),l&&st(l,n,s.textBit(d))):(we(n,s.off?0:s.len,a.off?0:a.ins,r),l&&!a.off&&st(l,n,a.text));r=(s.ins>d||a.ins>=0&&a.len>d)&&(r||n.length>h),s.forward2(d),a.forward(d)}}}}class Ht{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?ie.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?ie.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class mt{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,l;return this.empty?n=l=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),l=e.mapPos(this.to,-1)),n==this.from&&l==this.to?this:new mt(n,l,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return H.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return H.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return H.range(e.anchor,e.head)}static create(e,t,n){return new mt(e,t,n)}}class H{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:H.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new H([this.main],0)}addRange(e,t=!0){return H.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,H.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new H(e.ranges.map(t=>mt.fromJSON(t)),e.main)}static single(e,t=e){return new H([H.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,l=0;l<e.length;l++){let s=e[l];if(s.empty?s.from<=n:s.from<n)return H.normalized(e.slice(),t);n=s.to}return new H(e,t)}static cursor(e,t=0,n,l){return mt.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(l??16777215)<<6)}static range(e,t,n,l){let s=(n??16777215)<<6|(l==null?7:Math.min(6,l));return t<e?mt.create(t,e,48|s):mt.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((l,s)=>l.from-s.from),t=e.indexOf(n);for(let l=1;l<e.length;l++){let s=e[l],a=e[l-1];if(s.empty?s.from<=a.to:s.from<a.to){let r=a.from,d=Math.max(s.to,a.to);l<=t&&t--,e.splice(--l,2,s.anchor>s.head?H.range(d,r):H.range(r,d))}}return new H(e,t)}}function is(o,e){for(let t of o.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let yn=0;class Y{constructor(e,t,n,l,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=l,this.id=yn++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Y(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:wn),!!e.static,e.enables)}of(e){return new Si([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Si(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Si(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function wn(o,e){return o==e||o.length==e.length&&o.every((t,n)=>t===e[n])}class Si{constructor(e,t,n,l){this.dependencies=e,this.facet=t,this.type=n,this.value=l,this.id=yn++}dynamicSlot(e){var t;let n=this.value,l=this.facet.compareInput,s=this.id,a=e[s]>>1,r=this.type==2,d=!1,h=!1,f=[];for(let c of this.dependencies)c=="doc"?d=!0:c=="selection"?h=!0:((t=e[c.id])!==null&&t!==void 0?t:1)&1||f.push(e[c.id]);return{create(c){return c.values[a]=n(c),1},update(c,u){if(d&&u.docChanged||h&&(u.docChanged||u.selection)||xn(c,f)){let m=n(c);if(r?!ns(m,c.values[a],l):!l(m,c.values[a]))return c.values[a]=m,1}return 0},reconfigure:(c,u)=>{let m,b=u.config.address[s];if(b!=null){let y=Oi(u,b);if(this.dependencies.every(k=>k instanceof Y?u.facet(k)===c.facet(k):k instanceof gt?u.field(k,!1)==c.field(k,!1):!0)||(r?ns(m=n(c),y,l):l(m=n(c),y)))return c.values[a]=y,0}else m=n(c);return c.values[a]=m,1}}}}function ns(o,e,t){if(o.length!=e.length)return!1;for(let n=0;n<o.length;n++)if(!t(o[n],e[n]))return!1;return!0}function xn(o,e){let t=!1;for(let n of e)Qt(o,n)&1&&(t=!0);return t}function zd(o,e,t){let n=t.map(d=>o[d.id]),l=t.map(d=>d.type),s=n.filter(d=>!(d&1)),a=o[e.id]>>1;function r(d){let h=[];for(let f=0;f<n.length;f++){let c=Oi(d,n[f]);if(l[f]==2)for(let u of c)h.push(u);else h.push(c)}return e.combine(h)}return{create(d){for(let h of n)Qt(d,h);return d.values[a]=r(d),1},update(d,h){if(!xn(d,s))return 0;let f=r(d);return e.compare(f,d.values[a])?0:(d.values[a]=f,1)},reconfigure(d,h){let f=xn(d,n),c=h.config.facets[e.id],u=h.facet(e);if(c&&!f&&wn(t,c))return d.values[a]=u,0;let m=r(d);return e.compare(m,u)?(d.values[a]=u,0):(d.values[a]=m,1)}}}const ls=Y.define({static:!0});class gt{constructor(e,t,n,l,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=l,this.spec=s,this.provides=void 0}static define(e){let t=new gt(yn++,e.create,e.update,e.compare||((n,l)=>n===l),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ls).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,l)=>{let s=n.values[t],a=this.updateF(s,l);return this.compareF(s,a)?0:(n.values[t]=a,1)},reconfigure:(n,l)=>l.config.address[this.id]!=null?(n.values[t]=l.field(this),0):(n.values[t]=this.create(n),1)}}init(e){return[this,ls.of({field:this,create:e})]}get extension(){return this}}const kt={lowest:4,low:3,default:2,high:1,highest:0};function Kt(o){return e=>new ss(e,o)}const qd={highest:Kt(kt.highest),high:Kt(kt.high),default:Kt(kt.default),low:Kt(kt.low),lowest:Kt(kt.lowest)};class ss{constructor(e,t){this.inner=e,this.prec=t}}class Ni{of(e){return new vn(this,e)}reconfigure(e){return Ni.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class vn{constructor(e,t){this.compartment=e,this.inner=t}}class Bi{constructor(e,t,n,l,s,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=l,this.staticValues=s,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let l=[],s=Object.create(null),a=new Map;for(let u of Ud(e,t,a))u instanceof gt?l.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let r=Object.create(null),d=[],h=[];for(let u of l)r[u.id]=h.length<<1,h.push(m=>u.slot(m));let f=n?.config.facets;for(let u in s){let m=s[u],b=m[0].facet,y=f&&f[u]||[];if(m.every(k=>k.type==0))if(r[b.id]=d.length<<1|1,wn(y,m))d.push(n.facet(b));else{let k=b.combine(m.map(v=>v.value));d.push(n&&b.compare(k,n.facet(b))?n.facet(b):k)}else{for(let k of m)k.type==0?(r[k.id]=d.length<<1|1,d.push(k.value)):(r[k.id]=h.length<<1,h.push(v=>k.dynamicSlot(v)));r[b.id]=h.length<<1,h.push(k=>zd(k,b,m))}}let c=h.map(u=>u(r));return new Bi(e,a,c,r,d,s)}}function Ud(o,e,t){let n=[[],[],[],[],[]],l=new Map;function s(a,r){let d=l.get(a);if(d!=null){if(d<=r)return;let h=n[d].indexOf(a);h>-1&&n[d].splice(h,1),a instanceof vn&&t.delete(a.compartment)}if(l.set(a,r),Array.isArray(a))for(let h of a)s(h,r);else if(a instanceof vn){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(a.compartment)||a.inner;t.set(a.compartment,h),s(h,r)}else if(a instanceof ss)s(a.inner,a.prec);else if(a instanceof gt)n[r].push(a),a.provides&&s(a.provides,r);else if(a instanceof Si)n[r].push(a),a.facet.extensions&&s(a.facet.extensions,kt.default);else{let h=a.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,r)}}return s(o,kt.default),n.reduce((a,r)=>a.concat(r))}function Qt(o,e){if(e&1)return 2;let t=e>>1,n=o.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;o.status[t]=4;let l=o.computeSlot(o,o.config.dynamicSlots[t]);return o.status[t]=2|l}function Oi(o,e){return e&1?o.config.staticValues[e>>1]:o.values[e>>1]}const os=Y.define(),Cn=Y.define({combine:o=>o.some(e=>e),static:!0}),as=Y.define({combine:o=>o.length?o[0]:void 0,static:!0}),rs=Y.define(),ds=Y.define(),cs=Y.define(),hs=Y.define({combine:o=>o.length?o[0]:!1});class Nt{constructor(e,t){this.type=e,this.value=t}static define(){return new Wd}}class Wd{of(e){return new Nt(this,e)}}class Hd{constructor(e){this.map=e}of(e){return new ue(this,e)}}class ue{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new ue(this.type,t)}is(e){return this.type==e}static define(e={}){return new Hd(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let l of e){let s=l.map(t);s&&n.push(s)}return n}}ue.reconfigure=ue.define(),ue.appendConfig=ue.define();class xe{constructor(e,t,n,l,s,a){this.startState=e,this.changes=t,this.selection=n,this.effects=l,this.annotations=s,this.scrollIntoView=a,this._doc=null,this._state=null,n&&is(n,t.newLength),s.some(r=>r.type==xe.time)||(this.annotations=s.concat(xe.time.of(Date.now())))}static create(e,t,n,l,s,a){return new xe(e,t,n,l,s,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(xe.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}xe.time=Nt.define(),xe.userEvent=Nt.define(),xe.addToHistory=Nt.define(),xe.remote=Nt.define();function Kd(o,e){let t=[];for(let n=0,l=0;;){let s,a;if(n<o.length&&(l==e.length||e[l]>=o[n]))s=o[n++],a=o[n++];else if(l<e.length)s=e[l++],a=e[l++];else return t;!t.length||t[t.length-1]<s?t.push(s,a):t[t.length-1]<a&&(t[t.length-1]=a)}}function fs(o,e,t){var n;let l,s,a;return t?(l=e.changes,s=me.empty(e.changes.length),a=o.changes.compose(e.changes)):(l=e.changes.map(o.changes),s=o.changes.mapDesc(e.changes,!0),a=o.changes.compose(l)),{changes:a,selection:e.selection?e.selection.map(s):(n=o.selection)===null||n===void 0?void 0:n.map(l),effects:ue.mapEffects(o.effects,l).concat(ue.mapEffects(e.effects,s)),annotations:o.annotations.length?o.annotations.concat(e.annotations):e.annotations,scrollIntoView:o.scrollIntoView||e.scrollIntoView}}function Sn(o,e,t){let n=e.selection,l=Bt(e.annotations);return e.userEvent&&(l=l.concat(xe.userEvent.of(e.userEvent))),{changes:e.changes instanceof me?e.changes:me.of(e.changes||[],t,o.facet(as)),selection:n&&(n instanceof H?n:H.single(n.anchor,n.head)),effects:Bt(e.effects),annotations:l,scrollIntoView:!!e.scrollIntoView}}function us(o,e,t){let n=Sn(o,e.length?e[0]:{},o.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let a=!!e[s].sequential;n=fs(n,Sn(o,e[s],a?n.changes.newLength:o.doc.length),a)}let l=xe.create(o,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return Gd(t?Qd(l):l)}function Qd(o){let e=o.startState,t=!0;for(let l of e.facet(rs)){let s=l(o);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Kd(t,s))}if(t!==!0){let l,s;if(t===!1)s=o.changes.invertedDesc,l=me.empty(e.doc.length);else{let a=o.changes.filter(t);l=a.changes,s=a.filtered.mapDesc(a.changes).invertedDesc}o=xe.create(e,l,o.selection&&o.selection.map(s),ue.mapEffects(o.effects,s),o.annotations,o.scrollIntoView)}let n=e.facet(ds);for(let l=n.length-1;l>=0;l--){let s=n[l](o);s instanceof xe?o=s:Array.isArray(s)&&s.length==1&&s[0]instanceof xe?o=s[0]:o=us(e,Bt(s),!1)}return o}function Gd(o){let e=o.startState,t=e.facet(cs),n=o;for(let l=t.length-1;l>=0;l--){let s=t[l](o);s&&Object.keys(s).length&&(n=fs(n,Sn(e,s,o.changes.newLength),!0))}return n==o?o:xe.create(e,o.changes,o.selection,n.effects,n.annotations,n.scrollIntoView)}const Yd=[];function Bt(o){return o==null?Yd:Array.isArray(o)?o:[o]}var Xe=function(o){return o[o.Word=0]="Word",o[o.Space=1]="Space",o[o.Other=2]="Other",o}(Xe||(Xe={}));const Xd=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Nn;try{Nn=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Jd(o){if(Nn)return Nn.test(o);for(let e=0;e<o.length;e++){let t=o[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Xd.test(t)))return!0}return!1}function Zd(o){return e=>{if(!/\S/.test(e))return Xe.Space;if(Jd(e))return Xe.Word;for(let t=0;t<o.length;t++)if(e.indexOf(o[t])>-1)return Xe.Word;return Xe.Other}}class se{constructor(e,t,n,l,s,a){this.config=e,this.doc=t,this.selection=n,this.values=l,this.status=e.statusTemplate.slice(),this.computeSlot=s,a&&(a._state=this);for(let r=0;r<this.config.dynamicSlots.length;r++)Qt(this,r<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return Qt(this,n),Oi(this,n)}update(...e){return us(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:l}=t;for(let r of e.effects)r.is(Ni.reconfigure)?(t&&(l=new Map,t.compartments.forEach((d,h)=>l.set(h,d)),t=null),l.set(r.value.compartment,r.value.extension)):r.is(ue.reconfigure)?(t=null,n=r.value):r.is(ue.appendConfig)&&(t=null,n=Bt(n).concat(r.value));let s;t?s=e.startState.values.slice():(t=Bi.resolve(n,l,this),s=new se(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(d,h)=>h.reconfigure(d,this),null).values);let a=e.startState.facet(Cn)?e.newSelection:e.newSelection.asSingle();new se(t,e.newDoc,a,s,(r,d)=>d.update(r,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:H.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),l=this.changes(n.changes),s=[n.range],a=Bt(n.effects);for(let r=1;r<t.ranges.length;r++){let d=e(t.ranges[r]),h=this.changes(d.changes),f=h.map(l);for(let u=0;u<r;u++)s[u]=s[u].map(f);let c=l.mapDesc(h,!0);s.push(d.range.map(c)),l=l.compose(f),a=ue.mapEffects(a,f).concat(ue.mapEffects(Bt(d.effects),c))}return{changes:l,selection:H.create(s,t.mainIndex),effects:a}}changes(e=[]){return e instanceof me?e:me.of(e,this.doc.length,this.facet(se.lineSeparator))}toText(e){return ie.of(e.split(this.facet(se.lineSeparator)||gn))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Qt(this,t),Oi(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let l=e[n];l instanceof gt&&this.config.address[l.id]!=null&&(t[n]=l.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let l=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let a=n[s],r=e[s];l.push(a.init(d=>a.spec.fromJSON(r,d)))}}return se.create({doc:e.doc,selection:H.fromJSON(e.selection),extensions:t.extensions?l.concat([t.extensions]):l})}static create(e={}){let t=Bi.resolve(e.extensions||[],new Map),n=e.doc instanceof ie?e.doc:ie.of((e.doc||"").split(t.staticFacet(se.lineSeparator)||gn)),l=e.selection?e.selection instanceof H?e.selection:H.single(e.selection.anchor,e.selection.head):H.single(0);return is(l,n.length),t.staticFacet(Cn)||(l=l.asSingle()),new se(t,n,l,t.dynamicSlots.map(()=>null),(s,a)=>a.create(s),null)}get tabSize(){return this.facet(se.tabSize)}get lineBreak(){return this.facet(se.lineSeparator)||`
5
- `}get readOnly(){return this.facet(hs)}phrase(e,...t){for(let n of this.facet(se.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,l)=>{if(l=="$")return"$";let s=+(l||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let l=[];for(let s of this.facet(os))for(let a of s(this,t,n))Object.prototype.hasOwnProperty.call(a,e)&&l.push(a[e]);return l}charCategorizer(e){return Zd(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:l}=this.doc.lineAt(e),s=this.charCategorizer(e),a=e-n,r=e-n;for(;a>0;){let d=Ge(t,a,!1);if(s(t.slice(d,a))!=Xe.Word)break;a=d}for(;r<l;){let d=Ge(t,r);if(s(t.slice(r,d))!=Xe.Word)break;r=d}return a==r?null:H.range(a+n,r+n)}}se.allowMultipleSelections=Cn,se.tabSize=Y.define({combine:o=>o.length?o[0]:4}),se.lineSeparator=as,se.readOnly=hs,se.phrases=Y.define({compare(o,e){let t=Object.keys(o),n=Object.keys(e);return t.length==n.length&&t.every(l=>o[l]==e[l])}}),se.languageData=os,se.changeFilter=rs,se.transactionFilter=ds,se.transactionExtender=cs,Ni.reconfigure=ue.define();class Ot{eq(e){return this==e}range(e,t=e){return Gt.create(e,t,this)}}Ot.prototype.startSide=Ot.prototype.endSide=0,Ot.prototype.point=!1,Ot.prototype.mapMode=Ve.TrackDel;class Gt{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Gt(e,t,n)}}function Bn(o,e){return o.from-e.from||o.value.startSide-e.value.startSide}class On{constructor(e,t,n,l){this.from=e,this.to=t,this.value=n,this.maxPoint=l}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,l=0){let s=n?this.to:this.from;for(let a=l,r=s.length;;){if(a==r)return a;let d=a+r>>1,h=s[d]-e||(n?this.value[d].endSide:this.value[d].startSide)-t;if(d==a)return h>=0?a:r;h>=0?r=d:a=d+1}}between(e,t,n,l){for(let s=this.findIndex(t,-1e9,!0),a=this.findIndex(n,1e9,!1,s);s<a;s++)if(l(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],l=[],s=[],a=-1,r=-1;for(let d=0;d<this.value.length;d++){let h=this.value[d],f=this.from[d]+e,c=this.to[d]+e,u,m;if(f==c){let b=t.mapPos(f,h.startSide,h.mapMode);if(b==null||(u=m=b,h.startSide!=h.endSide&&(m=t.mapPos(f,h.endSide),m<u)))continue}else if(u=t.mapPos(f,h.startSide),m=t.mapPos(c,h.endSide),u>m||u==m&&h.startSide>0&&h.endSide<=0)continue;(m-u||h.endSide-h.startSide)<0||(a<0&&(a=u),h.point&&(r=Math.max(r,m-u)),n.push(h),l.push(u-a),s.push(m-a))}return{mapped:n.length?new On(l,s,n,r):null,pos:a}}}class re{constructor(e,t,n,l){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=l}static create(e,t,n,l){return new re(e,t,n,l)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:l=0,filterTo:s=this.length}=e,a=e.filter;if(t.length==0&&!a)return this;if(n&&(t=t.slice().sort(Bn)),this.isEmpty)return t.length?re.of(t):this;let r=new ms(this,null,-1).goto(0),d=0,h=[],f=new Vi;for(;r.value||d<t.length;)if(d<t.length&&(r.from-t[d].from||r.startSide-t[d].value.startSide)>=0){let c=t[d++];f.addInner(c.from,c.to,c.value)||h.push(c)}else r.rangeIndex==1&&r.chunkIndex<this.chunk.length&&(d==t.length||this.chunkEnd(r.chunkIndex)<t[d].from)&&(!a||l>this.chunkEnd(r.chunkIndex)||s<this.chunkPos[r.chunkIndex])&&f.addChunk(this.chunkPos[r.chunkIndex],this.chunk[r.chunkIndex])?r.nextChunk():((!a||l>r.to||s<r.from||a(r.from,r.to,r.value))&&(f.addInner(r.from,r.to,r.value)||h.push(Gt.create(r.from,r.to,r.value))),r.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?re.empty:this.nextLayer.update({add:h,filter:a,filterFrom:l,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],l=-1;for(let a=0;a<this.chunk.length;a++){let r=this.chunkPos[a],d=this.chunk[a],h=e.touchesRange(r,r+d.length);if(h===!1)l=Math.max(l,d.maxPoint),t.push(d),n.push(e.mapPos(r));else if(h===!0){let{mapped:f,pos:c}=d.map(r,e);f&&(l=Math.max(l,f.maxPoint),t.push(f),n.push(c))}}let s=this.nextLayer.map(e);return t.length==0?s:new re(n,t,s||re.empty,l)}between(e,t,n){if(!this.isEmpty){for(let l=0;l<this.chunk.length;l++){let s=this.chunkPos[l],a=this.chunk[l];if(t>=s&&e<=s+a.length&&a.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Yt.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Yt.from(e).goto(t)}static compare(e,t,n,l,s=-1){let a=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),r=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=s),d=ps(a,r,n),h=new Xt(a,d,s),f=new Xt(r,d,s);n.iterGaps((c,u,m)=>gs(h,c,f,u,m,l)),n.empty&&n.length==0&&gs(h,0,f,0,0,l)}static eq(e,t,n=0,l){l==null&&(l=999999999);let s=e.filter(f=>!f.isEmpty&&t.indexOf(f)<0),a=t.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(s.length!=a.length)return!1;if(!s.length)return!0;let r=ps(s,a),d=new Xt(s,r,0).goto(n),h=new Xt(a,r,0).goto(n);for(;;){if(d.to!=h.to||!_n(d.active,h.active)||d.point&&(!h.point||!d.point.eq(h.point)))return!1;if(d.to>l)return!0;d.next(),h.next()}}static spans(e,t,n,l,s=-1){let a=new Xt(e,null,s).goto(t),r=t,d=a.openStart;for(;;){let h=Math.min(a.to,n);if(a.point){let f=a.activeForPoint(a.to),c=a.pointFrom<t?f.length+1:a.point.startSide<0?f.length:Math.min(f.length,d);l.point(r,h,a.point,f,c,a.pointRank),d=Math.min(a.openEnd(h),f.length)}else h>r&&(l.span(r,h,a.active,d),d=a.openEnd(h));if(a.to>n)return d+(a.point&&a.to>n?1:0);r=a.to,a.next()}}static of(e,t=!1){let n=new Vi;for(let l of e instanceof Gt?[e]:t?ec(e):e)n.add(l.from,l.to,l.value);return n.finish()}static join(e){if(!e.length)return re.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let l=e[n];l!=re.empty;l=l.nextLayer)t=new re(l.chunkPos,l.chunk,t,Math.max(l.maxPoint,t.maxPoint));return t}}re.empty=new re([],[],null,-1);function ec(o){if(o.length>1)for(let e=o[0],t=1;t<o.length;t++){let n=o[t];if(Bn(e,n)>0)return o.slice().sort(Bn);e=n}return o}re.empty.nextLayer=re.empty;class Vi{finishChunk(e){this.chunks.push(new On(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new Vi)).add(e,t,n)}addInner(e,t,n){let l=e-this.lastTo||n.startSide-this.last.endSide;if(l<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return l<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(re.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=re.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function ps(o,e,t){let n=new Map;for(let s of o)for(let a=0;a<s.chunk.length;a++)s.chunk[a].maxPoint<=0&&n.set(s.chunk[a],s.chunkPos[a]);let l=new Set;for(let s of e)for(let a=0;a<s.chunk.length;a++){let r=n.get(s.chunk[a]);r!=null&&(t?t.mapPos(r):r)==s.chunkPos[a]&&!t?.touchesRange(r,r+s.chunk[a].length)&&l.add(s.chunk[a])}return l}class ms{constructor(e,t,n,l=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=l}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let l=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(l)||this.layer.chunkEnd(this.chunkIndex)<e||l.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let l=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<l)&&this.setRangeIndex(l)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Yt{constructor(e){this.heap=e}static from(e,t=null,n=-1){let l=[];for(let s=0;s<e.length;s++)for(let a=e[s];!a.isEmpty;a=a.nextLayer)a.maxPoint>=n&&l.push(new ms(a,t,n,s));return l.length==1?l[0]:new Yt(l)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)Vn(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)Vn(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Vn(this.heap,0)}}}function Vn(o,e){for(let t=o[e];;){let n=(e<<1)+1;if(n>=o.length)break;let l=o[n];if(n+1<o.length&&l.compare(o[n+1])>=0&&(l=o[n+1],n++),t.compare(l)<0)break;o[n]=t,o[e]=l,e=n}}class Xt{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Yt.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){_i(this.active,e),_i(this.activeTo,e),_i(this.activeRank,e),this.minActive=ks(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:l,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||l-this.activeTo[t])>0;)t++;Mi(this.active,t,n),Mi(this.activeTo,t,l),Mi(this.activeRank,t,s),e&&Mi(e,t,this.cursor.from),this.minActive=ks(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let l=this.minActive;if(l>-1&&(this.activeTo[l]-this.cursor.from||this.active[l].endSide-this.cursor.startSide)<0){if(this.activeTo[l]>e){this.to=this.activeTo[l],this.endSide=this.active[l].endSide;break}this.removeActive(l),n&&_i(n,l)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let l=n.length-1;l>=0&&n[l]<e;l--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function gs(o,e,t,n,l,s){o.goto(e),t.goto(n);let a=n+l,r=n,d=n-e;for(;;){let h=o.to+d-t.to||o.endSide-t.endSide,f=h<0?o.to+d:t.to,c=Math.min(f,a);if(o.point||t.point?o.point&&t.point&&(o.point==t.point||o.point.eq(t.point))&&_n(o.activeForPoint(o.to),t.activeForPoint(t.to))||s.comparePoint(r,c,o.point,t.point):c>r&&!_n(o.active,t.active)&&s.compareRange(r,c,o.active,t.active),f>a)break;r=f,h<=0&&o.next(),h>=0&&t.next()}}function _n(o,e){if(o.length!=e.length)return!1;for(let t=0;t<o.length;t++)if(o[t]!=e[t]&&!o[t].eq(e[t]))return!1;return!0}function _i(o,e){for(let t=e,n=o.length-1;t<n;t++)o[t]=o[t+1];o.pop()}function Mi(o,e,t){for(let n=o.length-1;n>=e;n--)o[n+1]=o[n];o[e]=t}function ks(o,e){let t=-1,n=1e9;for(let l=0;l<e.length;l++)(e[l]-n||o[l].endSide-o[t].endSide)<0&&(t=l,n=e[l]);return t}function tc(o,e,t,n){for(let l=0,s=0;;){if(s>=e)return l;if(l==o.length)break;s+=o.charCodeAt(l)==9?t-s%t:1,l=Ge(o,l)}return n===!0?-1:o.length}const Mn="ͼ",bs=typeof Symbol>"u"?"__"+Mn:Symbol.for(Mn),Tn=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ot{constructor(e,t){this.rules=[];let{finish:n}=t||{};function l(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function s(a,r,d,h){let f=[],c=/^@(\w+)\b/.exec(a[0]),u=c&&c[1]=="keyframes";if(c&&r==null)return d.push(a[0]+";");for(let m in r){let b=r[m];if(/&/.test(m))s(m.split(/,\s*/).map(y=>a.map(k=>y.replace(/&/,k))).reduce((y,k)=>y.concat(k)),b,d);else if(b&&typeof b=="object"){if(!c)throw new RangeError("The value of a property ("+m+") should be a primitive value.");s(l(m),b,f,u)}else b!=null&&f.push(m.replace(/_.*/,"").replace(/[A-Z]/g,y=>"-"+y.toLowerCase())+": "+b+";")}(f.length||u)&&d.push((n&&!c&&!h?a.map(n):a).join(", ")+" {"+f.join(" ")+"}")}for(let a in e)s(l(a),e[a],this.rules)}getRules(){return this.rules.join(`
6
- `)}static newName(){let e=ys[bs]||1;return ys[bs]=e+1,Mn+e.toString(36)}static mount(e,t,n){let l=e[Tn],s=n&&n.nonce;l?s&&l.setNonce(s):l=new ic(e,s),l.mount(Array.isArray(t)?t:[t],e)}}let ws=new Map;class ic{constructor(e,t){let n=e.ownerDocument||e,l=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&l.CSSStyleSheet){let s=ws.get(n);if(s)return e[Tn]=s;this.sheet=new l.CSSStyleSheet,ws.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Tn]=this}mount(e,t){let n=this.sheet,l=0,s=0;for(let a=0;a<e.length;a++){let r=e[a],d=this.modules.indexOf(r);if(d<s&&d>-1&&(this.modules.splice(d,1),s--,d=-1),d==-1){if(this.modules.splice(s++,0,r),n)for(let h=0;h<r.rules.length;h++)n.insertRule(r.rules[h],l++)}else{for(;s<d;)l+=this.modules[s++].rules.length;l+=r.rules.length,s++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let a="";for(let d=0;d<this.modules.length;d++)a+=this.modules[d].getRules()+`
7
- `;this.styleTag.textContent=a;let r=t.head||t;this.styleTag.parentNode!=r&&r.insertBefore(this.styleTag,r.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var Vt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},An={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ke=0;ke<10;ke++)Vt[48+ke]=Vt[96+ke]=String(ke);for(var ke=1;ke<=24;ke++)Vt[ke+111]="F"+ke;for(var ke=65;ke<=90;ke++)Vt[ke]=String.fromCharCode(ke+32),An[ke]=String.fromCharCode(ke);for(var En in Vt)An.hasOwnProperty(En)||(An[En]=Vt[En]);function Jt(o){let e;return o.nodeType==11?e=o.getSelection?o:o.ownerDocument:e=o,e.getSelection()}function In(o,e){return e?o==e||o.contains(e.nodeType!=1?e.parentNode:e):!1}function nc(o){let e=o.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ti(o,e){if(!e.anchorNode)return!1;try{return In(o,e.anchorNode)}catch{return!1}}function Zt(o){return o.nodeType==3?yt(o,0,o.nodeValue.length).getClientRects():o.nodeType==1?o.getClientRects():[]}function ei(o,e,t,n){return t?xs(o,e,t,n,-1)||xs(o,e,t,n,1):!1}function bt(o){for(var e=0;;e++)if(o=o.previousSibling,!o)return e}function Ai(o){return o.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(o.nodeName)}function xs(o,e,t,n,l){for(;;){if(o==t&&e==n)return!0;if(e==(l<0?0:Je(o))){if(o.nodeName=="DIV")return!1;let s=o.parentNode;if(!s||s.nodeType!=1)return!1;e=bt(o)+(l<0?0:1),o=s}else if(o.nodeType==1){if(o=o.childNodes[e+(l<0?-1:0)],o.nodeType==1&&o.contentEditable=="false")return!1;e=l<0?Je(o):0}else return!1}}function Je(o){return o.nodeType==3?o.nodeValue.length:o.childNodes.length}function Ei(o,e){let t=e?o.left:o.right;return{left:t,right:t,top:o.top,bottom:o.bottom}}function lc(o){let e=o.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:o.innerWidth,top:0,bottom:o.innerHeight}}function vs(o,e){let t=e.width/o.offsetWidth,n=e.height/o.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-o.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-o.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function sc(o,e,t,n,l,s,a,r){let d=o.ownerDocument,h=d.defaultView||window;for(let f=o,c=!1;f&&!c;)if(f.nodeType==1){let u,m=f==d.body,b=1,y=1;if(m)u=lc(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(c=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let w=f.getBoundingClientRect();({scaleX:b,scaleY:y}=vs(f,w)),u={left:w.left,right:w.left+f.clientWidth*b,top:w.top,bottom:w.top+f.clientHeight*y}}let k=0,v=0;if(l=="nearest")e.top<u.top?(v=-(u.top-e.top+a),t>0&&e.bottom>u.bottom+v&&(v=e.bottom-u.bottom+v+a)):e.bottom>u.bottom&&(v=e.bottom-u.bottom+a,t<0&&e.top-v<u.top&&(v=-(u.top+v-e.top+a)));else{let w=e.bottom-e.top,O=u.bottom-u.top;v=(l=="center"&&w<=O?e.top+w/2-O/2:l=="start"||l=="center"&&t<0?e.top-a:e.bottom-O+a)-u.top}if(n=="nearest"?e.left<u.left?(k=-(u.left-e.left+s),t>0&&e.right>u.right+k&&(k=e.right-u.right+k+s)):e.right>u.right&&(k=e.right-u.right+s,t<0&&e.left<u.left+k&&(k=-(u.left+k-e.left+s))):k=(n=="center"?e.left+(e.right-e.left)/2-(u.right-u.left)/2:n=="start"==r?e.left-s:e.right-(u.right-u.left)+s)-u.left,k||v)if(m)h.scrollBy(k,v);else{let w=0,O=0;if(v){let g=f.scrollTop;f.scrollTop+=v/y,O=(f.scrollTop-g)*y}if(k){let g=f.scrollLeft;f.scrollLeft+=k/b,w=(f.scrollLeft-g)*b}e={left:e.left-w,top:e.top-O,right:e.right-w,bottom:e.bottom-O},w&&Math.abs(w-k)<1&&(n="nearest"),O&&Math.abs(O-v)<1&&(l="nearest")}if(m)break;f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function oc(o){let e=o.ownerDocument,t,n;for(let l=o.parentNode;l&&!(l==e.body||t&&n);)if(l.nodeType==1)!n&&l.scrollHeight>l.clientHeight&&(n=l),!t&&l.scrollWidth>l.clientWidth&&(t=l),l=l.assignedSlot||l.parentNode;else if(l.nodeType==11)l=l.host;else break;return{x:t,y:n}}class ac{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?Je(t):0),n,Math.min(e.focusOffset,n?Je(n):0))}set(e,t,n,l){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=l}}let _t=null;function Cs(o){if(o.setActive)return o.setActive();if(_t)return o.focus(_t);let e=[];for(let t=o;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(o.focus(_t==null?{get preventScroll(){return _t={preventScroll:!0},!0}}:void 0),!_t){_t=!1;for(let t=0;t<e.length;){let n=e[t++],l=e[t++],s=e[t++];n.scrollTop!=l&&(n.scrollTop=l),n.scrollLeft!=s&&(n.scrollLeft=s)}}}let Ss;function yt(o,e,t=e){let n=Ss||(Ss=document.createRange());return n.setEnd(o,t),n.setStart(o,e),n}function Mt(o,e,t,n){let l={key:e,code:e,keyCode:t,which:t,cancelable:!0};n&&({altKey:l.altKey,ctrlKey:l.ctrlKey,shiftKey:l.shiftKey,metaKey:l.metaKey}=n);let s=new KeyboardEvent("keydown",l);s.synthetic=!0,o.dispatchEvent(s);let a=new KeyboardEvent("keyup",l);return a.synthetic=!0,o.dispatchEvent(a),s.defaultPrevented||a.defaultPrevented}function rc(o){for(;o;){if(o&&(o.nodeType==9||o.nodeType==11&&o.host))return o;o=o.assignedSlot||o.parentNode}return null}function Ns(o){for(;o.attributes.length;)o.removeAttributeNode(o.attributes[0])}function dc(o,e){let t=e.focusNode,n=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=n)return!1;for(n=Math.min(n,Je(t));;)if(n){if(t.nodeType!=1)return!1;let l=t.childNodes[n-1];l.contentEditable=="false"?n--:(t=l,n=Je(t))}else{if(t==o)return!0;n=bt(t),t=t.parentNode}}function Bs(o){return o.scrollTop>Math.max(1,o.scrollHeight-o.clientHeight-4)}function Os(o,e){for(let t=o,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=Je(t)}else if(t.parentNode&&!Ai(t))n=bt(t),t=t.parentNode;else return null}}function Vs(o,e){for(let t=o,n=e;;){if(t.nodeType==3&&n<t.nodeValue.length)return{node:t,offset:n};if(t.nodeType==1&&n<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[n],n=0}else if(t.parentNode&&!Ai(t))n=bt(t)+1,t=t.parentNode;else return null}}class ve{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new ve(e.parentNode,bt(e),t)}static after(e,t){return new ve(e.parentNode,bt(e)+1,t)}}const Dn=[];class oe{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let n=this.dom,l=null,s;for(let a of this.children){if(a.flags&7){if(!a.dom&&(s=l?l.nextSibling:n.firstChild)){let r=oe.get(s);(!r||!r.parent&&r.canReuseDOM(a))&&a.reuseDOM(s)}a.sync(e,t),a.flags&=-8}if(s=l?l.nextSibling:n.firstChild,t&&!t.written&&t.node==n&&s!=a.dom&&(t.written=!0),a.dom.parentNode==n)for(;s&&s!=a.dom;)s=_s(s);else n.insertBefore(a.dom,s);l=a.dom}for(s=l?l.nextSibling:n.firstChild,s&&t&&t.node==n&&(t.written=!0);s;)s=_s(s)}else if(this.flags&1)for(let n of this.children)n.flags&7&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let l=Je(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;l==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?l=-1:l=1),e=s}l<0?n=e:n=e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!oe.get(n);)n=n.nextSibling;if(!n)return this.length;for(let l=0,s=0;;l++){let a=this.children[l];if(a.dom==n)return s;s+=a.length+a.breakAfter}}domBoundsAround(e,t,n=0){let l=-1,s=-1,a=-1,r=-1;for(let d=0,h=n,f=n;d<this.children.length;d++){let c=this.children[d],u=h+c.length;if(h<e&&u>t)return c.domBoundsAround(e,t,h);if(u>=e&&l==-1&&(l=d,s=h),h>t&&c.dom.parentNode==this.dom){a=d,r=f;break}f=u,h=u+c.breakAfter}return{from:s,to:r<0?n+this.length:r,startDOM:(l?this.children[l-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a<this.children.length&&a>=0?this.children[a].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Dn){this.markDirty();for(let l=e;l<t;l++){let s=this.children[l];s.parent==this&&n.indexOf(s)<0&&s.destroy()}this.children.splice(e,t-e,...n);for(let l=0;l<n.length;l++)n[l].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Ms(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,n,l,s,a){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}oe.prototype.breakAfter=0;function _s(o){let e=o.nextSibling;return o.parentNode.removeChild(o),e}class Ms{constructor(e,t,n){this.children=e,this.pos=t,this.i=n,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function Ts(o,e,t,n,l,s,a,r,d){let{children:h}=o,f=h.length?h[e]:null,c=s.length?s[s.length-1]:null,u=c?c.breakAfter:a;if(!(e==n&&f&&!a&&!u&&s.length<2&&f.merge(t,l,s.length?c:null,t==0,r,d))){if(n<h.length){let m=h[n];m&&(l<m.length||m.breakAfter&&c?.breakAfter)?(e==n&&(m=m.split(l),l=0),!u&&c&&m.merge(0,l,c,!0,0,d)?s[s.length-1]=m:((l||m.children.length&&!m.children[0].length)&&m.merge(0,l,null,!1,0,d),s.push(m))):m?.breakAfter&&(c?c.breakAfter=1:a=1),n++}for(f&&(f.breakAfter=a,t>0&&(!a&&s.length&&f.merge(t,f.length,s[0],!1,r,0)?f.breakAfter=s.shift().breakAfter:(t<f.length||f.children.length&&f.children[f.children.length-1].length==0)&&f.merge(t,f.length,null,!1,r,0),e++));e<n&&s.length;)if(h[n-1].become(s[s.length-1]))n--,s.pop(),d=s.length?0:r;else if(h[e].become(s[0]))e++,s.shift(),r=s.length?0:d;else break;!s.length&&e&&n<h.length&&!h[e-1].breakAfter&&h[n].merge(0,0,h[e-1],!1,r,d)&&e--,(e<n||s.length)&&o.replaceChildren(e,n,s)}}function As(o,e,t,n,l,s){let a=o.childCursor(),{i:r,off:d}=a.findPos(t,1),{i:h,off:f}=a.findPos(e,-1),c=e-t;for(let u of n)c+=u.length;o.length+=c,Ts(o,h,f,r,d,n,0,l,s)}let Be=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Pn=typeof document<"u"?document:{documentElement:{style:{}}};const Fn=/Edge\/(\d+)/.exec(Be.userAgent),Es=/MSIE \d/.test(Be.userAgent),$n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Be.userAgent),Ii=!!(Es||$n||Fn),Is=!Ii&&/gecko\/(\d+)/i.test(Be.userAgent),Rn=!Ii&&/Chrome\/(\d+)/.exec(Be.userAgent),Ds="webkitFontSmoothing"in Pn.documentElement.style,Ps=!Ii&&/Apple Computer/.test(Be.vendor),Fs=Ps&&(/Mobile\/\w+/.test(Be.userAgent)||Be.maxTouchPoints>2);var W={mac:Fs||/Mac/.test(Be.platform),windows:/Win/.test(Be.platform),linux:/Linux|X11/.test(Be.platform),ie:Ii,ie_version:Es?Pn.documentMode||6:$n?+$n[1]:Fn?+Fn[1]:0,gecko:Is,gecko_version:Is?+(/Firefox\/(\d+)/.exec(Be.userAgent)||[0,0])[1]:0,chrome:!!Rn,chrome_version:Rn?+Rn[1]:0,ios:Fs,android:/Android\b/.test(Be.userAgent),webkit:Ds,safari:Ps,webkit_version:Ds?+(/\bAppleWebKit\/(\d+)/.exec(Be.userAgent)||[0,0])[1]:0,tabSize:Pn.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const cc=256;class De extends oe{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof De)||this.length-(t-e)+n.length>cc||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new De(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ve(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return hc(this.dom,e,t)}}class Ze extends oe{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let l of t)l.setParent(this)}setAttrs(e){if(Ns(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,l,s,a){return n&&(!(n instanceof Ze&&n.mark.eq(this.mark))||e&&s<=0||t<this.length&&a<=0)?!1:(As(this,e,t,n?n.children.slice():[],s-1,a-1),this.markDirty(),!0)}split(e){let t=[],n=0,l=-1,s=0;for(let r of this.children){let d=n+r.length;d>e&&t.push(n<e?r.split(e-n):r),l<0&&n>=e&&(l=s),n=d,s++}let a=this.length-e;return this.length=e,l>-1&&(this.children.length=l,this.markDirty()),new Ze(this.mark,t,a)}domAtPos(e){return $s(this,e)}coordsAt(e,t){return Ls(this,e,t)}}function hc(o,e,t){let n=o.nodeValue.length;e>n&&(e=n);let l=e,s=e,a=0;e==0&&t<0||e==n&&t>=0?W.chrome||W.gecko||(e?(l--,a=1):s<n&&(s++,a=-1)):t<0?l--:s<n&&s++;let r=yt(o,l,s).getClientRects();if(!r.length)return null;let d=r[(a?a<0:t>=0)?0:r.length-1];return W.safari&&!a&&d.width==0&&(d=Array.prototype.find.call(r,h=>h.width)||d),a?Ei(d,a<0):d||null}class wt extends oe{static create(e,t,n){return new wt(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=wt.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,l,s,a){return n&&(!(n instanceof wt)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&a<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}become(e){return e instanceof wt&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return ie.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,n=t&&t.state.doc,l=this.posAtStart;return n?n.slice(l,l+this.length):ie.empty}domAtPos(e){return(this.length?e==0:this.side>0)?ve.before(this.dom):ve.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let l=this.dom.getClientRects(),s=null;if(!l.length)return null;let a=this.side?this.side<0:e>0;for(let r=a?l.length-1:0;s=l[r],!(e>0?r==0:r==l.length-1||s.top<s.bottom);r+=a?-1:1);return Ei(s,!a)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Tt extends oe{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof Tt&&e.side==this.side}split(){return new Tt(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?ve.before(this.dom):ve.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return ie.empty}get isHidden(){return!0}}De.prototype.children=wt.prototype.children=Tt.prototype.children=Dn;function $s(o,e){let t=o.dom,{children:n}=o,l=0;for(let s=0;l<n.length;l++){let a=n[l],r=s+a.length;if(!(r==s&&a.getSide()<=0)){if(e>s&&e<r&&a.dom.parentNode==t)return a.domAtPos(e-s);if(e<=s)break;s=r}}for(let s=l;s>0;s--){let a=n[s-1];if(a.dom.parentNode==t)return a.domAtPos(a.length)}for(let s=l;s<n.length;s++){let a=n[s];if(a.dom.parentNode==t)return a.domAtPos(0)}return new ve(t,0)}function Rs(o,e,t){let n,{children:l}=o;t>0&&e instanceof Ze&&l.length&&(n=l[l.length-1])instanceof Ze&&n.mark.eq(e.mark)?Rs(n,e.children[0],t-1):(l.push(e),e.setParent(o)),o.length+=e.length}function Ls(o,e,t){let n=null,l=-1,s=null,a=-1;function r(h,f){for(let c=0,u=0;c<h.children.length&&u<=f;c++){let m=h.children[c],b=u+m.length;b>=f&&(m.children.length?r(m,f-u):(!s||s.isHidden&&t>0)&&(b>f||u==b&&m.getSide()>0)?(s=m,a=f-u):(u<f||u==b&&m.getSide()<0&&!m.isHidden)&&(n=m,l=f-u)),u=b}}r(o,e);let d=(t<0?n:s)||n||s;return d?d.coordsAt(Math.max(0,d==n?l:a),t):fc(o)}function fc(o){let e=o.dom.lastChild;if(!e)return o.dom.getBoundingClientRect();let t=Zt(e);return t[t.length-1]||null}function Ln(o,e){for(let t in o)t=="class"&&e.class?e.class+=" "+o.class:t=="style"&&e.style?e.style+=";"+o.style:e[t]=o[t];return e}const js=Object.create(null);function Di(o,e,t){if(o==e)return!0;o||(o=js),e||(e=js);let n=Object.keys(o),l=Object.keys(e);if(n.length-(t&&n.indexOf(t)>-1?1:0)!=l.length-(t&&l.indexOf(t)>-1?1:0))return!1;for(let s of n)if(s!=t&&(l.indexOf(s)==-1||o[s]!==e[s]))return!1;return!0}function jn(o,e,t){let n=!1;if(e)for(let l in e)t&&l in t||(n=!0,l=="style"?o.style.cssText="":o.removeAttribute(l));if(t)for(let l in t)e&&e[l]==t[l]||(n=!0,l=="style"?o.style.cssText=t[l]:o.setAttribute(l,t[l]));return n}function uc(o){let e=Object.create(null);for(let t=0;t<o.attributes.length;t++){let n=o.attributes[t];e[n.name]=n.value}return e}class zn{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ze=function(o){return o[o.Text=0]="Text",o[o.WidgetBefore=1]="WidgetBefore",o[o.WidgetAfter=2]="WidgetAfter",o[o.WidgetRange=3]="WidgetRange",o}(ze||(ze={}));class Ce extends Ot{constructor(e,t,n,l){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=l}get heightRelevant(){return!1}static mark(e){return new ti(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new at(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,l;if(e.isBlockGap)n=-5e8,l=4e8;else{let{start:s,end:a}=zs(e,t);n=(s?t?-3e8:-1:5e8)-1,l=(a?t?2e8:1:-6e8)+1}return new at(e,n,l,t,e.widget||null,!0)}static line(e){return new ii(e)}static set(e,t=!1){return re.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ce.none=re.empty;class ti extends Ce{constructor(e){let{start:t,end:n}=zs(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof ti&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&Di(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ti.prototype.point=!1;class ii extends Ce{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ii&&this.spec.class==e.spec.class&&Di(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}ii.prototype.mapMode=Ve.TrackBefore,ii.prototype.point=!0;class at extends Ce{constructor(e,t,n,l,s,a){super(t,n,s,e),this.block=l,this.isReplace=a,this.mapMode=l?t<=0?Ve.TrackBefore:Ve.TrackAfter:Ve.TrackDel}get type(){return this.startSide!=this.endSide?ze.WidgetRange:this.startSide<=0?ze.WidgetBefore:ze.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof at&&pc(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}at.prototype.point=!0;function zs(o,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=o;return t==null&&(t=o.inclusive),n==null&&(n=o.inclusive),{start:t??e,end:n??e}}function pc(o,e){return o==e||!!(o&&e&&o.compare(e))}function qn(o,e,t,n=0){let l=t.length-1;l>=0&&t[l]+n>=o?t[l]=Math.max(t[l],e):t.push(o,e)}class fe extends oe{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,l,s,a){if(n){if(!(n instanceof fe))return!1;this.dom||n.transferDOM(this)}return l&&this.setDeco(n?n.attrs:null),As(this,e,t,n?n.children.slice():[],s,a),!0}split(e){let t=new fe;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:l}=this.childPos(e);l&&(t.append(this.children[n].split(l),0),this.children[n].merge(l,this.children[n].length,null,!1,0,0),n++);for(let s=n;s<this.children.length;s++)t.append(this.children[s],0);for(;n>0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Di(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Rs(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=Ln(t,this.attrs||{})),n&&(this.attrs=Ln({class:n},this.attrs||{}))}domAtPos(e){return $s(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Ns(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(jn(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let l=this.dom.lastChild;for(;l&&oe.get(l)instanceof Ze;)l=l.lastChild;if(!l||!this.length||l.nodeName!="BR"&&((n=oe.get(l))===null||n===void 0?void 0:n.isEditable)==!1&&(!W.ios||!this.children.some(s=>s instanceof De))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof De)||/[^ -~]/.test(n.text))return null;let l=Zt(n.dom);if(l.length!=1)return null;e+=l[0].width,t=l[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Ls(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:l}=this.parent.view.viewState,s=n.bottom-n.top;if(Math.abs(s-l.lineHeight)<2&&l.textHeight<s){let a=(s-l.textHeight)/2;return{top:n.top+a,bottom:n.bottom-a,left:n.left,right:n.left}}}return n}become(e){return e instanceof fe&&this.children.length==0&&e.children.length==0&&Di(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let n=0,l=0;n<e.children.length;n++){let s=e.children[n],a=l+s.length;if(a>=t){if(s instanceof fe)return s;if(a>t)break}l=a+s.breakAfter}return null}}class et extends oe{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,l,s,a){return n&&(!(n instanceof et)||!this.widget.compare(n.widget)||e>0&&s<=0||t<this.length&&a<=0)?!1:(this.length=e+(n?n.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?ve.before(this.dom):ve.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let n=new et(this.widget,t,this.deco);return n.breakAfter=this.breakAfter,n}get children(){return Dn}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):ie.empty}domBoundsAround(){return null}become(e){return e instanceof et&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);return n||(this.widget instanceof Un?null:Ei(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:n}=this.deco;return t==n?!1:e<0?t<0:n>0}}class Un extends zn{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class ni{constructor(e,t,n,l){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=l,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof et&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new fe),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Pi(new Tt(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof et)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:a,done:r}=this.cursor.next(this.skip);if(this.skip=0,r)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let l=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(Pi(new De(this.text.slice(this.textOff,this.textOff+l)),t),n),this.atCursorPos=!0,this.textOff+=l,e-=l,n=0}}span(e,t,n,l){this.buildText(t-e,n,l),this.pos=t,this.openStart<0&&(this.openStart=l)}point(e,t,n,l,s,a){if(this.disallowBlockEffectsFor[a]&&n instanceof at){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=t-e;if(n instanceof at)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new et(n.widget||At.block,r,n));else{let d=wt.create(n.widget||At.inline,r,r?0:n.startSide),h=this.atCursorPos&&!d.isEditable&&s<=l.length&&(e<t||n.startSide>0),f=!d.isEditable&&(e<t||s>l.length||n.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!h&&!d.isEditable&&(this.pendingBuffer=0),this.flushBuffer(l),h&&(c.append(Pi(new Tt(1),l),s),s=l.length+Math.max(0,s-l.length)),c.append(Pi(d,l),s),this.atCursorPos=f,this.pendingBuffer=f?e<t||s>l.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=l.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);r&&(this.textOff+r<=this.text.length?this.textOff+=r:(this.skip+=r-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,n,l,s){let a=new ni(e,t,n,s);return a.openEnd=re.spans(l,t,n,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}function Pi(o,e){for(let t of e)o=new Ze(t,[o],o.length);return o}class At extends zn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}At.inline=new At("span"),At.block=new At("div");var be=function(o){return o[o.LTR=0]="LTR",o[o.RTL=1]="RTL",o}(be||(be={}));const xt=be.LTR,Wn=be.RTL;function qs(o){let e=[];for(let t=0;t<o.length;t++)e.push(1<<+o[t]);return e}const mc=qs("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),gc=qs("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Hn=Object.create(null),qe=[];for(let o of["()","[]","{}"]){let e=o.charCodeAt(0),t=o.charCodeAt(1);Hn[e]=t,Hn[t]=-e}function Us(o){return o<=247?mc[o]:1424<=o&&o<=1524?2:1536<=o&&o<=1785?gc[o-1536]:1774<=o&&o<=2220?4:8192<=o&&o<=8204?256:64336<=o&&o<=65023?4:1}const kc=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class rt{get dir(){return this.level%2?Wn:xt}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,l){let s=-1;for(let a=0;a<e.length;a++){let r=e[a];if(r.from<=t&&r.to>=t){if(r.level==n)return a;(s<0||(l!=0?l<0?r.from<t:r.to>t:e[s].level>r.level))&&(s=a)}}if(s<0)throw new RangeError("Index out of range");return s}}function Ws(o,e){if(o.length!=e.length)return!1;for(let t=0;t<o.length;t++){let n=o[t],l=e[t];if(n.from!=l.from||n.to!=l.to||n.direction!=l.direction||!Ws(n.inner,l.inner))return!1}return!0}const ae=[];function bc(o,e,t,n,l){for(let s=0;s<=n.length;s++){let a=s?n[s-1].to:e,r=s<n.length?n[s].from:t,d=s?256:l;for(let h=a,f=d,c=d;h<r;h++){let u=Us(o.charCodeAt(h));u==512?u=f:u==8&&c==4&&(u=16),ae[h]=u==4?2:u,u&7&&(c=u),f=u}for(let h=a,f=d,c=d;h<r;h++){let u=ae[h];if(u==128)h<r-1&&f==ae[h+1]&&f&24?u=ae[h]=f:ae[h]=256;else if(u==64){let m=h+1;for(;m<r&&ae[m]==64;)m++;let b=h&&f==8||m<t&&ae[m]==8?c==1?1:8:256;for(let y=h;y<m;y++)ae[y]=b;h=m-1}else u==8&&c==1&&(ae[h]=1);f=u,u&7&&(c=u)}}}function yc(o,e,t,n,l){let s=l==1?2:1;for(let a=0,r=0,d=0;a<=n.length;a++){let h=a?n[a-1].to:e,f=a<n.length?n[a].from:t;for(let c=h,u,m,b;c<f;c++)if(m=Hn[u=o.charCodeAt(c)])if(m<0){for(let y=r-3;y>=0;y-=3)if(qe[y+1]==-m){let k=qe[y+2],v=k&2?l:k&4?k&1?s:l:0;v&&(ae[c]=ae[qe[y]]=v),r=y;break}}else{if(qe.length==189)break;qe[r++]=c,qe[r++]=u,qe[r++]=d}else if((b=ae[c])==2||b==1){let y=b==l;d=y?0:1;for(let k=r-3;k>=0;k-=3){let v=qe[k+2];if(v&2)break;if(y)qe[k+2]|=2;else{if(v&4)break;qe[k+2]|=4}}}}}function wc(o,e,t,n){for(let l=0,s=n;l<=t.length;l++){let a=l?t[l-1].to:o,r=l<t.length?t[l].from:e;for(let d=a;d<r;){let h=ae[d];if(h==256){let f=d+1;for(;;)if(f==r){if(l==t.length)break;f=t[l++].to,r=l<t.length?t[l].from:e}else if(ae[f]==256)f++;else break;let c=s==1,u=(f<e?ae[f]:n)==1,m=c==u?c?1:2:n;for(let b=f,y=l,k=y?t[y-1].to:o;b>d;)b==k&&(b=t[--y].from,k=y?t[y-1].to:o),ae[--b]=m;d=f}else s=h,d++}}}function Kn(o,e,t,n,l,s,a){let r=n%2?2:1;if(n%2==l%2)for(let d=e,h=0;d<t;){let f=!0,c=!1;if(h==s.length||d<s[h].from){let y=ae[d];y!=r&&(f=!1,c=y==16)}let u=!f&&r==1?[]:null,m=f?n:n+1,b=d;e:for(;;)if(h<s.length&&b==s[h].from){if(c)break e;let y=s[h];if(!f)for(let k=y.to,v=h+1;;){if(k==t)break e;if(v<s.length&&s[v].from==k)k=s[v++].to;else{if(ae[k]==r)break e;break}}if(h++,u)u.push(y);else{y.from>d&&a.push(new rt(d,y.from,m));let k=y.direction==xt!=!(m%2);Qn(o,k?n+1:n,l,y.inner,y.from,y.to,a),d=y.to}b=y.to}else{if(b==t||(f?ae[b]!=r:ae[b]==r))break;b++}u?Kn(o,d,b,n+1,l,u,a):d<b&&a.push(new rt(d,b,m)),d=b}else for(let d=t,h=s.length;d>e;){let f=!0,c=!1;if(!h||d>s[h-1].to){let y=ae[d-1];y!=r&&(f=!1,c=y==16)}let u=!f&&r==1?[]:null,m=f?n:n+1,b=d;e:for(;;)if(h&&b==s[h-1].to){if(c)break e;let y=s[--h];if(!f)for(let k=y.from,v=h;;){if(k==e)break e;if(v&&s[v-1].to==k)k=s[--v].from;else{if(ae[k-1]==r)break e;break}}if(u)u.push(y);else{y.to<d&&a.push(new rt(y.to,d,m));let k=y.direction==xt!=!(m%2);Qn(o,k?n+1:n,l,y.inner,y.from,y.to,a),d=y.from}b=y.from}else{if(b==e||(f?ae[b-1]!=r:ae[b-1]==r))break;b--}u?Kn(o,b,d,n+1,l,u,a):b<d&&a.push(new rt(b,d,m)),d=b}}function Qn(o,e,t,n,l,s,a){let r=e%2?2:1;bc(o,l,s,n,r),yc(o,l,s,n,r),wc(l,s,n,r),Kn(o,l,s,e,t,n,a)}function xc(o,e,t){if(!o)return[new rt(0,0,e==Wn?1:0)];if(e==xt&&!t.length&&!kc.test(o))return Hs(o.length);if(t.length)for(;o.length>ae.length;)ae[ae.length]=256;let n=[],l=e==xt?0:1;return Qn(o,l,l,t,0,o.length,n),n}function Hs(o){return[new rt(0,o,0)]}let Ks="";function vc(o,e,t,n,l){var s;let a=n.head-o.from,r=rt.find(e,a,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),d=e[r],h=d.side(l,t);if(a==h){let u=r+=l?1:-1;if(u<0||u>=e.length)return null;d=e[r=u],a=d.side(!l,t),h=d.side(l,t)}let f=Ge(o.text,a,d.forward(l,t));(f<d.from||f>d.to)&&(f=h),Ks=o.text.slice(Math.min(a,f),Math.max(a,f));let c=r==(l?e.length-1:0)?null:e[r+(l?1:-1)];return c&&f==h&&c.level+(l?0:1)<d.level?H.cursor(c.side(!l,t)+o.from,c.forward(l,t)?1:-1,c.level):H.cursor(f+o.from,d.forward(l,t)?-1:1,d.level)}function Cc(o,e,t){for(let n=e;n<t;n++){let l=Us(o.charCodeAt(n));if(l==1)return xt;if(l==2||l==4)return Wn}return xt}const Qs=Y.define(),Gs=Y.define(),Ys=Y.define(),Xs=Y.define(),Gn=Y.define(),Js=Y.define(),Zs=Y.define(),Yn=Y.define(),Xn=Y.define(),eo=Y.define({combine:o=>o.some(e=>e)}),Sc=Y.define({combine:o=>o.some(e=>e)}),to=Y.define();class Et{constructor(e,t="nearest",n="nearest",l=5,s=5,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=l,this.xMargin=s,this.isSnapshot=a}map(e){return e.empty?this:new Et(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Et(H.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Fi=ue.define({map:(o,e)=>o.map(e)}),io=ue.define();function Ue(o,e,t){let n=o.facet(Xs);n.length?n[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const dt=Y.define({combine:o=>o.length?o[0]:!0});let Nc=0;const li=Y.define();class It{constructor(e,t,n,l,s){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=l,this.extension=s(this)}static define(e,t){const{eventHandlers:n,eventObservers:l,provide:s,decorations:a}=t||{};return new It(Nc++,e,n,l,r=>{let d=[li.of(r)];return a&&d.push(si.of(h=>{let f=h.plugin(r);return f?a(f):Ce.none})),s&&d.push(s(r)),d})}static fromClass(e,t){return It.define(n=>new e(n),t)}}class Jn{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(Ue(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){Ue(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){Ue(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const no=Y.define(),Zn=Y.define(),si=Y.define(),lo=Y.define(),el=Y.define(),so=Y.define();function oo(o,e){let t=o.state.facet(so);if(!t.length)return t;let n=t.map(s=>s instanceof Function?s(o):s),l=[];return re.spans(n,e.from,e.to,{point(){},span(s,a,r,d){let h=s-e.from,f=a-e.from,c=l;for(let u=r.length-1;u>=0;u--,d--){let m=r[u].spec.bidiIsolate,b;if(m==null&&(m=Cc(e.text,h,f)),d>0&&c.length&&(b=c[c.length-1]).to==h&&b.direction==m)b.to=f,c=b.inner;else{let y={from:h,to:f,direction:m,inner:[]};c.push(y),c=y.inner}}}}),l}const ao=Y.define();function ro(o){let e=0,t=0,n=0,l=0;for(let s of o.state.facet(ao)){let a=s(o);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(t=Math.max(t,a.right)),a.top!=null&&(n=Math.max(n,a.top)),a.bottom!=null&&(l=Math.max(l,a.bottom)))}return{left:e,right:t,top:n,bottom:l}}const oi=Y.define();class Ae{constructor(e,t,n,l){this.fromA=e,this.toA=t,this.fromB=n,this.toB=l}join(e){return new Ae(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let l=e[t-1];if(!(l.fromA>n.toA)){if(l.toA<n.fromA)break;n=n.join(l),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(e,t){if(t.length==0)return e;let n=[];for(let l=0,s=0,a=0,r=0;;l++){let d=l==e.length?null:e[l],h=a-r,f=d?d.fromB:1e9;for(;s<t.length&&t[s]<f;){let c=t[s],u=t[s+1],m=Math.max(r,c),b=Math.min(f,u);if(m<=b&&new Ae(m+h,b+h,m,b).addToSet(n),u>f)break;s+=2}if(!d)return n;new Ae(d.fromA,d.toA,d.fromB,d.toB).addToSet(n),a=d.toA,r=d.toB}}}class $i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=me.empty(this.startState.doc.length);for(let s of n)this.changes=this.changes.compose(s.changes);let l=[];this.changes.iterChangedRanges((s,a,r,d)=>l.push(new Ae(s,a,r,d))),this.changedRanges=l}static create(e,t,n){return new $i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class co extends oe{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Ce.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new fe],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ae(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:h,toA:f})=>f<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let l=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?l=this.domChanged.newSel.head:!Ac(e.changes,this.hasComposition)&&!e.selectionSet&&(l=e.state.selection.main.head));let s=l>-1?Oc(this.view,e.changes,l):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:f}=this.hasComposition;n=new Ae(h,f,e.changes.mapPos(h,-1),e.changes.mapPos(f,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(W.ie||W.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,r=this.updateDeco(),d=Mc(a,r,e.changes);return n=Ae.extendWithRanges(n,d),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:l}=this.view;l.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let a=W.chrome||W.ios?{node:l.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,a),this.flags&=-8,a&&(a.written||l.selectionRange.focusNode!=a.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(a=>a.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let a of this.children)a instanceof et&&a.widget instanceof Un&&s.push(a.dom);l.updateGaps(s)}updateChildren(e,t,n){let l=n?n.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let a=l.length-1;;a--){let r=a>=0?l[a]:null;if(!r)break;let{fromA:d,toA:h,fromB:f,toB:c}=r,u,m,b,y;if(n&&n.range.fromB<c&&n.range.toB>f){let g=ni.build(this.view.state.doc,f,n.range.fromB,this.decorations,this.dynamicDecorationMap),p=ni.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);m=g.breakAtStart,b=g.openStart,y=p.openEnd;let N=this.compositionView(n);p.breakAtStart?N.breakAfter=1:p.content.length&&N.merge(N.length,N.length,p.content[0],!1,p.openStart,0)&&(N.breakAfter=p.content[0].breakAfter,p.content.shift()),g.content.length&&N.merge(0,0,g.content[g.content.length-1],!0,0,g.openEnd)&&g.content.pop(),u=g.content.concat(N).concat(p.content)}else({content:u,breakAtStart:m,openStart:b,openEnd:y}=ni.build(this.view.state.doc,f,c,this.decorations,this.dynamicDecorationMap));let{i:k,off:v}=s.findPos(h,1),{i:w,off:O}=s.findPos(d,-1);Ts(this,w,O,k,v,u,m,b,y)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(io)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new De(e.text.nodeValue);t.flags|=8;for(let{deco:l}of e.marks)t=new Ze(l,[t],t.length);let n=new fe;return n.append(t,0),n}fixCompositionDOM(e){let t=(s,a)=>{a.flags|=8|(a.children.some(d=>d.flags&7)?1:0),this.markedForComposition.add(a);let r=oe.get(s);r&&r!=a&&(r.dom=null),a.setDOM(s)},n=this.childPos(e.range.fromB,1),l=this.children[n.i];t(e.line,l);for(let s=e.marks.length-1;s>=-1;s--)n=l.childPos(n.off,1),l=l.children[n.i],t(s>=0?e.marks[s].node:e.text,l)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,l=n==this.dom,s=!l&&Ti(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(l||t||s))return;let a=this.forceSelection;this.forceSelection=!1;let r=this.view.state.selection.main,d=this.moveToLine(this.domAtPos(r.anchor)),h=r.empty?d:this.moveToLine(this.domAtPos(r.head));if(W.gecko&&r.empty&&!this.hasComposition&&Bc(d)){let c=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(c,d.node.childNodes[d.offset]||null)),d=h=new ve(c,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!ei(d.node,d.offset,f.anchorNode,f.anchorOffset)||!ei(h.node,h.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,r))&&(this.view.observer.ignore(()=>{W.android&&W.chrome&&this.dom.contains(f.focusNode)&&Tc(f.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=Jt(this.view.root);if(c)if(r.empty){if(W.gecko){let u=Vc(d.node,d.offset);if(u&&u!=3){let m=(u==1?Os:Vs)(d.node,d.offset);m&&(d=new ve(m.node,m.offset))}}c.collapse(d.node,d.offset),r.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=r.bidiLevel)}else if(c.extend){c.collapse(d.node,d.offset);try{c.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();r.anchor>r.head&&([d,h]=[h,d]),u.setEnd(h.node,h.offset),u.setStart(d.node,d.offset),c.removeAllRanges(),c.addRange(u)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(d,h)),this.impreciseAnchor=d.precise?null:new ve(f.anchorNode,f.anchorOffset),this.impreciseHead=h.precise?null:new ve(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&ei(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Jt(e.root),{anchorNode:l,anchorOffset:s}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=fe.find(this,t.head);if(!a)return;let r=a.posAtStart;if(t.head==r||t.head==r+a.length)return;let d=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!d||!h||d.bottom>h.top)return;let f=this.domAtPos(t.head+t.assoc);n.collapse(f.node,f.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(l,s)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let l=e.offset;!n&&l<t.childNodes.length;l++){let s=oe.get(t.childNodes[l]);s instanceof fe&&(n=s.domAtPos(0))}for(let l=e.offset-1;!n&&l>=0;l--){let s=oe.get(t.childNodes[l]);s instanceof fe&&(n=s.domAtPos(s.length))}return n?new ve(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=oe.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let l=this.children[t];if(n<l.length||l instanceof fe)break;t++,n=0}return this.children[t].domAtPos(n)}coordsAt(e,t){let n=null,l=0;for(let s=this.length,a=this.children.length-1;a>=0;a--){let r=this.children[a],d=s-r.breakAfter,h=d-r.length;if(d<e)break;if(h<=e&&(h<e||r.covers(-1))&&(d>e||r.covers(1))&&(!n||r instanceof fe&&!(n instanceof fe&&t>=0)))n=r,l=h;else if(n&&h==e&&d==e&&r instanceof et&&Math.abs(t)<2){if(r.deco.startSide<0)break;a&&(n=null)}s=h}return n?n.coordsAt(e-l,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),l=this.children[t];if(!(l instanceof fe))return null;for(;l.children.length;){let{i:r,off:d}=l.childPos(n,1);for(;;r++){if(r==l.children.length)return null;if((l=l.children[r]).length)break}n=d}if(!(l instanceof De))return null;let s=Ge(l.text,n);if(s==n)return null;let a=yt(l.dom,n,s).getClientRects();for(let r=0;r<a.length;r++){let d=a[r];if(r==a.length-1||d.top<d.bottom&&d.left<d.right)return d}return null}measureVisibleLineHeights(e){let t=[],{from:n,to:l}=e,s=this.view.contentDOM.clientWidth,a=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,r=-1,d=this.view.textDirection==be.LTR;for(let h=0,f=0;f<this.children.length;f++){let c=this.children[f],u=h+c.length;if(u>l)break;if(h>=n){let m=c.dom.getBoundingClientRect();if(t.push(m.height),a){let b=c.dom.lastChild,y=b?Zt(b):[];if(y.length){let k=y[y.length-1],v=d?k.right-m.left:m.right-k.left;v>r&&(r=v,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?be.RTL:be.LTR}measureTextSize(){for(let s of this.children)if(s instanceof fe){let a=s.measureTextSize();if(a)return a}let e=document.createElement("div"),t,n,l;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Zt(e.firstChild)[0];t=e.getBoundingClientRect().height,n=s?s.width/27:7,l=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:l}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ms(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,l=0;;l++){let s=l==t.viewports.length?null:t.viewports[l],a=s?s.from-1:this.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(Ce.replace({widget:new Un(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!s)break;n=s.to+1}return Ce.set(e)}updateDeco(){let e=1,t=this.view.state.facet(si).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,l=this.view.state.facet(lo).map((s,a)=>{let r=typeof s=="function";return r&&(n=!0),r?s(this.view):s});for(l.length&&(this.dynamicDecorationMap[e++]=n,t.push(re.join(l))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let h=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=h.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let h of this.view.state.facet(to))try{if(h(this.view,e.range,e))return!0}catch(f){Ue(this.view.state,f,"scroll handler")}let{range:t}=e,n=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),l;if(!n)return;!t.empty&&(l=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,l.left),top:Math.min(n.top,l.top),right:Math.max(n.right,l.right),bottom:Math.max(n.bottom,l.bottom)});let s=ro(this.view),a={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:r,offsetHeight:d}=this.view.scrollDOM;sc(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,r),-r),Math.max(Math.min(e.yMargin,d),-d),this.view.textDirection==be.LTR)}}function Bc(o){return o.node.nodeType==1&&o.node.firstChild&&(o.offset==0||o.node.childNodes[o.offset-1].contentEditable=="false")&&(o.offset==o.node.childNodes.length||o.node.childNodes[o.offset].contentEditable=="false")}function ho(o,e){let t=o.observer.selectionRange;if(!t.focusNode)return null;let n=Os(t.focusNode,t.focusOffset),l=Vs(t.focusNode,t.focusOffset),s=n||l;if(l&&n&&l.node!=n.node){let r=oe.get(l.node);if(!r||r instanceof De&&r.text!=l.node.nodeValue)s=l;else if(o.docView.lastCompositionAfterCursor){let d=oe.get(n.node);!d||d instanceof De&&d.text!=n.node.nodeValue||(s=l)}}if(o.docView.lastCompositionAfterCursor=s!=n,!s)return null;let a=e-s.offset;return{from:a,to:a+s.node.nodeValue.length,node:s.node}}function Oc(o,e,t){let n=ho(o,t);if(!n)return null;let{node:l,from:s,to:a}=n,r=l.nodeValue;if(/[\n\r]/.test(r)||o.state.doc.sliceString(n.from,n.to)!=r)return null;let d=e.invertedDesc,h=new Ae(d.mapPos(s),d.mapPos(a),s,a),f=[];for(let c=l.parentNode;;c=c.parentNode){let u=oe.get(c);if(u instanceof Ze)f.push({node:c,deco:u.mark});else{if(u instanceof fe||c.nodeName=="DIV"&&c.parentNode==o.contentDOM)return{range:h,text:l,marks:f,line:c};if(c!=o.contentDOM)f.push({node:c,deco:new ti({inclusive:!0,attributes:uc(c),tagName:c.tagName.toLowerCase()})});else return null}}}function Vc(o,e){return o.nodeType!=1?0:(e&&o.childNodes[e-1].contentEditable=="false"?1:0)|(e<o.childNodes.length&&o.childNodes[e].contentEditable=="false"?2:0)}let _c=class{constructor(){this.changes=[]}compareRange(e,t){qn(e,t,this.changes)}comparePoint(e,t){qn(e,t,this.changes)}};function Mc(o,e,t){let n=new _c;return re.compare(o,e,t,n),n.changes}function Tc(o,e){for(let t=o;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Ac(o,e){let t=!1;return e&&o.iterChangedRanges((n,l)=>{n<e.to&&l>e.from&&(t=!0)}),t}function Ec(o,e,t=1){let n=o.charCategorizer(e),l=o.doc.lineAt(e),s=e-l.from;if(l.length==0)return H.cursor(e);s==0?t=1:s==l.length&&(t=-1);let a=s,r=s;t<0?a=Ge(l.text,s,!1):r=Ge(l.text,s);let d=n(l.text.slice(a,r));for(;a>0;){let h=Ge(l.text,a,!1);if(n(l.text.slice(h,a))!=d)break;a=h}for(;r<l.length;){let h=Ge(l.text,r);if(n(l.text.slice(r,h))!=d)break;r=h}return H.range(a+l.from,r+l.from)}function Ic(o,e){return e.left>o?e.left-o:Math.max(0,o-e.right)}function Dc(o,e){return e.top>o?e.top-o:Math.max(0,o-e.bottom)}function tl(o,e){return o.top<e.bottom-1&&o.bottom>e.top+1}function fo(o,e){return e<o.top?{top:e,left:o.left,right:o.right,bottom:o.bottom}:o}function uo(o,e){return e>o.bottom?{top:o.top,left:o.left,right:o.right,bottom:e}:o}function il(o,e,t){let n,l,s,a,r=!1,d,h,f,c;for(let b=o.firstChild;b;b=b.nextSibling){let y=Zt(b);for(let k=0;k<y.length;k++){let v=y[k];l&&tl(l,v)&&(v=fo(uo(v,l.bottom),l.top));let w=Ic(e,v),O=Dc(t,v);if(w==0&&O==0)return b.nodeType==3?po(b,e,t):il(b,e,t);if(!n||a>O||a==O&&s>w){n=b,l=v,s=w,a=O;let g=O?t<v.top?-1:1:w?e<v.left?-1:1:0;r=!g||(g>0?k<y.length-1:k>0)}w==0?t>v.bottom&&(!f||f.bottom<v.bottom)?(d=b,f=v):t<v.top&&(!c||c.top>v.top)&&(h=b,c=v):f&&tl(f,v)?f=uo(f,v.bottom):c&&tl(c,v)&&(c=fo(c,v.top))}}if(f&&f.bottom>=t?(n=d,l=f):c&&c.top<=t&&(n=h,l=c),!n)return{node:o,offset:0};let u=Math.max(l.left,Math.min(l.right,e));if(n.nodeType==3)return po(n,u,t);if(r&&n.contentEditable!="false")return il(n,u,t);let m=Array.prototype.indexOf.call(o.childNodes,n)+(e>=(l.left+l.right)/2?1:0);return{node:o,offset:m}}function po(o,e,t){let n=o.nodeValue.length,l=-1,s=1e9,a=0;for(let r=0;r<n;r++){let d=yt(o,r,r+1).getClientRects();for(let h=0;h<d.length;h++){let f=d[h];if(f.top==f.bottom)continue;a||(a=e-f.left);let c=(f.top>t?f.top-t:t-f.bottom)-1;if(f.left-1<=e&&f.right+1>=e&&c<s){let u=e>=(f.left+f.right)/2,m=u;if((W.chrome||W.gecko)&&yt(o,r).getBoundingClientRect().left==f.right&&(m=!u),c<=0)return{node:o,offset:r+(m?1:0)};l=r+(m?1:0),s=c}}}return{node:o,offset:l>-1?l:a>0?o.nodeValue.length:0}}function mo(o,e,t,n=-1){var l,s;let a=o.contentDOM.getBoundingClientRect(),r=a.top+o.viewState.paddingTop,d,{docHeight:h}=o.viewState,{x:f,y:c}=e,u=c-r;if(u<0)return 0;if(u>h)return o.state.doc.length;for(let g=o.viewState.heightOracle.textHeight/2,p=!1;d=o.elementAtHeight(u),d.type!=ze.Text;)for(;u=n>0?d.bottom+g:d.top-g,!(u>=0&&u<=h);){if(p)return t?null:0;p=!0,n=-n}c=r+u;let m=d.from;if(m<o.viewport.from)return o.viewport.from==0?0:t?null:go(o,a,d,f,c);if(m>o.viewport.to)return o.viewport.to==o.state.doc.length?o.state.doc.length:t?null:go(o,a,d,f,c);let b=o.dom.ownerDocument,y=o.root.elementFromPoint?o.root:b,k=y.elementFromPoint(f,c);k&&!o.contentDOM.contains(k)&&(k=null),k||(f=Math.max(a.left+1,Math.min(a.right-1,f)),k=y.elementFromPoint(f,c),k&&!o.contentDOM.contains(k)&&(k=null));let v,w=-1;if(k&&((l=o.docView.nearest(k))===null||l===void 0?void 0:l.isEditable)!=!1){if(b.caretPositionFromPoint){let g=b.caretPositionFromPoint(f,c);g&&({offsetNode:v,offset:w}=g)}else if(b.caretRangeFromPoint){let g=b.caretRangeFromPoint(f,c);g&&({startContainer:v,startOffset:w}=g,(!o.contentDOM.contains(v)||W.safari&&Pc(v,w,f)||W.chrome&&Fc(v,w,f))&&(v=void 0))}}if(!v||!o.docView.dom.contains(v)){let g=fe.find(o.docView,m);if(!g)return u>d.top+d.height/2?d.to:d.from;({node:v,offset:w}=il(g.dom,f,c))}let O=o.docView.nearest(v);if(!O)return null;if(O.isWidget&&((s=O.dom)===null||s===void 0?void 0:s.nodeType)==1){let g=O.dom.getBoundingClientRect();return e.y<g.top||e.y<=g.bottom&&e.x<=(g.left+g.right)/2?O.posAtStart:O.posAtEnd}else return O.localPosFromDOM(v,w)+O.posAtStart}function go(o,e,t,n,l){let s=Math.round((n-e.left)*o.defaultCharacterWidth);if(o.lineWrapping&&t.height>o.defaultLineHeight*1.5){let r=o.viewState.heightOracle.textHeight,d=Math.floor((l-t.top-(o.defaultLineHeight-r)*.5)/r);s+=d*o.viewState.heightOracle.lineLength}let a=o.state.sliceDoc(t.from,t.to);return t.from+tc(a,s,o.state.tabSize)}function Pc(o,e,t){let n;if(o.nodeType!=3||e!=(n=o.nodeValue.length))return!1;for(let l=o.nextSibling;l;l=l.nextSibling)if(l.nodeType!=1||l.nodeName!="BR")return!1;return yt(o,n-1,n).getBoundingClientRect().left>t}function Fc(o,e,t){if(e!=0)return!1;for(let l=o;;){let s=l.parentNode;if(!s||s.nodeType!=1||s.firstChild!=l)return!1;if(s.classList.contains("cm-line"))break;l=s}let n=o.nodeType==1?o.getBoundingClientRect():yt(o,0,Math.max(o.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function $c(o,e){let t=o.lineBlockAt(e);if(Array.isArray(t.type)){for(let n of t.type)if(n.to>e||n.to==e&&(n.to==t.to||n.type==ze.Text))return n}return t}function Rc(o,e,t,n){let l=$c(o,e.head),s=!n||l.type!=ze.Text||!(o.lineWrapping||l.widgetLineBreaks)?null:o.coordsAtPos(e.assoc<0&&e.head>l.from?e.head-1:e.head);if(s){let a=o.dom.getBoundingClientRect(),r=o.textDirectionAt(l.from),d=o.posAtCoords({x:t==(r==be.LTR)?a.right-1:a.left+1,y:(s.top+s.bottom)/2});if(d!=null)return H.cursor(d,t?-1:1)}return H.cursor(t?l.to:l.from,t?-1:1)}function ko(o,e,t,n){let l=o.state.doc.lineAt(e.head),s=o.bidiSpans(l),a=o.textDirectionAt(l.from);for(let r=e,d=null;;){let h=vc(l,s,a,r,t),f=Ks;if(!h){if(l.number==(t?o.state.doc.lines:1))return r;f=`
8
- `,l=o.state.doc.line(l.number+(t?1:-1)),s=o.bidiSpans(l),h=o.visualLineSide(l,!t)}if(d){if(!d(f))return r}else{if(!n)return h;d=n(f)}r=h}}function Lc(o,e,t){let n=o.state.charCategorizer(e),l=n(t);return s=>{let a=n(s);return l==Xe.Space&&(l=a),l==a}}function jc(o,e,t,n){let l=e.head,s=t?1:-1;if(l==(t?o.state.doc.length:0))return H.cursor(l,e.assoc);let a=e.goalColumn,r,d=o.contentDOM.getBoundingClientRect(),h=o.coordsAtPos(l,e.assoc||-1),f=o.documentTop;if(h)a==null&&(a=h.left-d.left),r=s<0?h.top:h.bottom;else{let m=o.viewState.lineBlockAt(l);a==null&&(a=Math.min(d.right-d.left,o.defaultCharacterWidth*(l-m.from))),r=(s<0?m.top:m.bottom)+f}let c=d.left+a,u=n??o.viewState.heightOracle.textHeight>>1;for(let m=0;;m+=10){let b=r+(u+m)*s,y=mo(o,{x:c,y:b},!1,s);if(b<d.top||b>d.bottom||(s<0?y<l:y>l)){let k=o.docView.coordsForChar(y),v=!k||b<k.top?-1:1;return H.cursor(y,v,void 0,a)}}}function Ri(o,e,t){for(;;){let n=0;for(let l of o)l.between(e-1,e+1,(s,a,r)=>{if(e>s&&e<a){let d=n||t||(e-s<a-e?-1:1);e=d<0?s:a,n=d}});if(!n)return e}}function nl(o,e,t){let n=Ri(o.state.facet(el).map(l=>l(o)),t.from,e.head>t.from?-1:1);return n==t.from?t:H.cursor(n,n<t.from?1:-1)}const ai="￿";class zc{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(se.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ai}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let l=e;;){this.findPointBefore(n,l);let s=this.text.length;this.readNode(l);let a=l.nextSibling;if(a==t)break;let r=oe.get(l),d=oe.get(a);(r&&d?r.breakAfter:(r?r.breakAfter:Ai(l))||Ai(a)&&(l.nodeName!="BR"||l.cmIgnore)&&this.text.length>s)&&this.lineBreak(),l=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,l=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,a=1,r;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(r=l.exec(t))&&(s=r.index,a=r[0].length),this.append(t.slice(n,s<0?t.length:s)),s<0)break;if(this.lineBreak(),a>1)for(let d of this.points)d.node==e&&d.pos>this.text.length&&(d.pos-=a-1);n=s+a}}readNode(e){if(e.cmIgnore)return;let t=oe.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let l=n.iter();!l.next().done;)l.lineBreak?this.lineBreak():this.append(l.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(qc(e,n.node,n.offset)?t:0))}}function qc(o,e,t){for(;;){if(!e||t<Je(e))return!1;if(e==o)return!0;t=bt(e)+1,e=e.parentNode}}class bo{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Uc{constructor(e,t,n,l){this.typeOver=l,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:a}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let r=s||a?[]:Kc(e),d=new zc(r,e.state);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=Qc(r,this.bounds.from)}else{let r=e.observer.selectionRange,d=s&&s.node==r.focusNode&&s.offset==r.focusOffset||!In(e.contentDOM,r.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(r.focusNode,r.focusOffset),h=a&&a.node==r.anchorNode&&a.offset==r.anchorOffset||!In(e.contentDOM,r.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(r.anchorNode,r.anchorOffset),f=e.viewport;if((W.ios||W.chrome)&&e.state.selection.main.empty&&d!=h&&(f.from>0||f.to<e.state.doc.length)){let c=Math.min(d,h),u=Math.max(d,h),m=f.from-c,b=f.to-u;(m==0||m==1||c==0)&&(b==0||b==-1||u==e.state.doc.length)&&(d=0,h=e.state.doc.length)}this.newSel=H.single(h,d)}}}function yo(o,e){let t,{newSel:n}=e,l=o.state.selection.main,s=o.inputState.lastKeyTime>Date.now()-100?o.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:r}=e.bounds,d=l.from,h=null;(s===8||W.android&&e.text.length<r-a)&&(d=l.to,h="end");let f=Hc(o.state.doc.sliceString(a,r,ai),e.text,d-a,h);f&&(W.chrome&&s==13&&f.toB==f.from+2&&e.text.slice(f.from,f.toB)==ai+ai&&f.toB--,t={from:a+f.from,to:a+f.toA,insert:ie.of(e.text.slice(f.from,f.toB).split(ai))})}else n&&(!o.hasFocus&&o.state.facet(dt)||n.main.eq(l))&&(n=null);if(!t&&!n)return!1;if(!t&&e.typeOver&&!l.empty&&n&&n.main.empty?t={from:l.from,to:l.to,insert:o.state.doc.slice(l.from,l.to)}:t&&t.from>=l.from&&t.to<=l.to&&(t.from!=l.from||t.to!=l.to)&&l.to-l.from-(t.to-t.from)<=4?t={from:l.from,to:l.to,insert:o.state.doc.slice(l.from,t.from).append(t.insert).append(o.state.doc.slice(t.to,l.to))}:(W.mac||W.android)&&t&&t.from==t.to&&t.from==l.head-1&&/^\. ?$/.test(t.insert.toString())&&o.contentDOM.getAttribute("autocorrect")=="off"?(n&&t.insert.length==2&&(n=H.single(n.main.anchor-1,n.main.head-1)),t={from:l.from,to:l.to,insert:ie.of([" "])}):W.chrome&&t&&t.from==t.to&&t.from==l.head&&t.insert.toString()==`
9
- `&&o.lineWrapping&&(n&&(n=H.single(n.main.anchor-1,n.main.head-1)),t={from:l.from,to:l.to,insert:ie.of([" "])}),t)return ll(o,t,n,s);if(n&&!n.main.eq(l)){let a=!1,r="select";return o.inputState.lastSelectionTime>Date.now()-50&&(o.inputState.lastSelectionOrigin=="select"&&(a=!0),r=o.inputState.lastSelectionOrigin),o.dispatch({selection:n,scrollIntoView:a,userEvent:r}),!0}else return!1}function ll(o,e,t,n=-1){if(W.ios&&o.inputState.flushIOSKey(e))return!0;let l=o.state.selection.main;if(W.android&&(e.to==l.to&&(e.from==l.from||e.from==l.from-1&&o.state.sliceDoc(e.from,l.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Mt(o.contentDOM,"Enter",13)||(e.from==l.from-1&&e.to==l.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>l.head)&&Mt(o.contentDOM,"Backspace",8)||e.from==l.from&&e.to==l.to+1&&e.insert.length==0&&Mt(o.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();o.inputState.composing>=0&&o.inputState.composing++;let a,r=()=>a||(a=Wc(o,e,t));return o.state.facet(Js).some(d=>d(o,e.from,e.to,s,r))||o.dispatch(r()),!0}function Wc(o,e,t){let n,l=o.state,s=l.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&o.inputState.composing<0){let r=s.from<e.from?l.sliceDoc(s.from,e.from):"",d=s.to>e.to?l.sliceDoc(e.to,s.to):"";n=l.replaceSelection(o.state.toText(r+e.insert.sliceString(0,void 0,o.state.lineBreak)+d))}else{let r=l.changes(e),d=t&&t.main.to<=r.newLength?t.main:void 0;if(l.selection.ranges.length>1&&o.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let h=o.state.sliceDoc(e.from,e.to),f,c=t&&ho(o,t.main.head);if(c){let b=e.insert.length-(e.to-e.from);f={from:c.from,to:c.to-b}}else f=o.state.doc.lineAt(s.head);let u=s.to-e.to,m=s.to-s.from;n=l.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:r,range:d||b.map(r)};let y=b.to-u,k=y-h.length;if(b.to-b.from!=m||o.state.sliceDoc(k,y)!=h||b.to>=f.from&&b.from<=f.to)return{range:b};let v=l.changes({from:k,to:y,insert:e.insert}),w=b.to-s.to;return{changes:v,range:d?H.range(Math.max(0,d.anchor+w),Math.max(0,d.head+w)):b.map(v)}})}else n={changes:r,selection:d&&l.selection.replaceRange(d)}}let a="input.type";return(o.composing||o.inputState.compositionPendingChange&&o.inputState.compositionEndedAt>Date.now()-50)&&(o.inputState.compositionPendingChange=!1,a+=".compose",o.inputState.compositionFirstChange&&(a+=".start",o.inputState.compositionFirstChange=!1)),l.update(n,{userEvent:a,scrollIntoView:!0})}function Hc(o,e,t,n){let l=Math.min(o.length,e.length),s=0;for(;s<l&&o.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==l&&o.length==e.length)return null;let a=o.length,r=e.length;for(;a>0&&r>0&&o.charCodeAt(a-1)==e.charCodeAt(r-1);)a--,r--;if(n=="end"){let d=Math.max(0,s-Math.min(a,r));t-=a+d-s}if(a<s&&o.length<e.length){let d=t<=s&&t>=a?s-t:0;s-=d,r=s+(r-a),a=s}else if(r<s){let d=t<=s&&t>=r?s-t:0;s-=d,a=s+(a-r),r=s}return{from:s,toA:a,toB:r}}function Kc(o){let e=[];if(o.root.activeElement!=o.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:l,focusOffset:s}=o.observer.selectionRange;return t&&(e.push(new bo(t,n)),(l!=t||s!=n)&&e.push(new bo(l,s))),e}function Qc(o,e){if(o.length==0)return null;let t=o[0].pos,n=o.length==2?o[1].pos:t;return t>-1&&n>-1?H.single(t+e,n+e):null}class Gc{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,W.safari&&e.contentDOM.addEventListener("input",()=>null),W.gecko&&fh(e.contentDOM.ownerDocument)}handleEvent(e){!lh(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let n=this.handlers[e];if(n){for(let l of n.observers)l(this.view,t);for(let l of n.handlers){if(t.defaultPrevented)break;if(l(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Yc(e),n=this.handlers,l=this.view.contentDOM;for(let s in t)if(s!="scroll"){let a=!t[s].handlers.length,r=n[s];r&&a!=!r.handlers.length&&(l.removeEventListener(s,this.handleEvent),r=null),r||l.addEventListener(s,this.handleEvent,{passive:a})}for(let s in n)s!="scroll"&&!t[s]&&l.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Jc.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),W.android&&W.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return W.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=xo.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||Xc.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Mt(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:W.safari&&!W.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wo(o,e){return(t,n)=>{try{return e.call(o,n,t)}catch(l){Ue(t.state,l)}}}function Yc(o){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of o){let l=n.spec;if(l&&l.domEventHandlers)for(let s in l.domEventHandlers){let a=l.domEventHandlers[s];a&&t(s).handlers.push(wo(n.value,a))}if(l&&l.domEventObservers)for(let s in l.domEventObservers){let a=l.domEventObservers[s];a&&t(s).observers.push(wo(n.value,a))}}for(let n in Pe)t(n).handlers.push(Pe[n]);for(let n in Ee)t(n).observers.push(Ee[n]);return e}const xo=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Xc="dthko",Jc=[16,17,18,20,91,92,224,225],Li=6;function ji(o){return Math.max(0,o)*.7+8}function Zc(o,e){return Math.max(Math.abs(o.clientX-e.clientX),Math.abs(o.clientY-e.clientY))}class eh{constructor(e,t,n,l){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=l,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=oc(e.contentDOM),this.atoms=e.state.facet(el).map(a=>a(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(se.allowMultipleSelections)&&th(e,t),this.dragging=nh(e,t)&&Mo(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Zc(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,l=0,s=0,a=this.view.win.innerWidth,r=this.view.win.innerHeight;this.scrollParents.x&&({left:l,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:r}=this.scrollParents.y.getBoundingClientRect());let d=ro(this.view);e.clientX-d.left<=l+Li?t=-ji(l-e.clientX):e.clientX+d.right>=a-Li&&(t=ji(e.clientX-a)),e.clientY-d.top<=s+Li?n=-ji(s-e.clientY):e.clientY+d.bottom>=r-Li&&(n=ji(e.clientY-r)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;n<e.ranges.length;n++){let l=e.ranges[n],s=null;if(l.empty){let a=Ri(this.atoms,l.from,0);a!=l.from&&(s=H.cursor(a,-1))}else{let a=Ri(this.atoms,l.from,-1),r=Ri(this.atoms,l.to,1);(a!=l.from||r!=l.to)&&(s=H.range(l.from==l.anchor?a:r,l.from==l.head?a:r))}s&&(t||(t=e.ranges.slice()),t[n]=s)}return t?H.create(t,e.mainIndex):e}select(e){let{view:t}=this,n=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function th(o,e){let t=o.state.facet(Qs);return t.length?t[0](e):W.mac?e.metaKey:e.ctrlKey}function ih(o,e){let t=o.state.facet(Gs);return t.length?t[0](e):W.mac?!e.altKey:!e.ctrlKey}function nh(o,e){let{main:t}=o.state.selection;if(t.empty)return!1;let n=Jt(o.root);if(!n||n.rangeCount==0)return!0;let l=n.getRangeAt(0).getClientRects();for(let s=0;s<l.length;s++){let a=l[s];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function lh(o,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=o.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=oe.get(t))&&n.ignoreEvent(e))return!1;return!0}const Pe=Object.create(null),Ee=Object.create(null),vo=W.ie&&W.ie_version<15||W.ios&&W.webkit_version<604;function sh(o){let e=o.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{o.focus(),t.remove(),Co(o,t.value)},50)}function zi(o,e,t){for(let n of o.facet(e))t=n(t,o);return t}function Co(o,e){e=zi(o.state,Yn,e);let{state:t}=o,n,l=1,s=t.toText(e),a=s.lines==t.selection.ranges.length;if(sl!=null&&t.selection.ranges.every(d=>d.empty)&&sl==s.toString()){let d=-1;n=t.changeByRange(h=>{let f=t.doc.lineAt(h.from);if(f.from==d)return{range:h};d=f.from;let c=t.toText((a?s.line(l++).text:e)+t.lineBreak);return{changes:{from:f.from,insert:c},range:H.cursor(h.from+c.length)}})}else a?n=t.changeByRange(d=>{let h=s.line(l++);return{changes:{from:d.from,to:d.to,insert:h.text},range:H.cursor(d.from+h.length)}}):n=t.replaceSelection(s);o.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=o=>{o.inputState.lastScrollTop=o.scrollDOM.scrollTop,o.inputState.lastScrollLeft=o.scrollDOM.scrollLeft},Pe.keydown=(o,e)=>(o.inputState.setSelectionOrigin("select"),e.keyCode==27&&o.inputState.tabFocusMode!=0&&(o.inputState.tabFocusMode=Date.now()+2e3),!1),Ee.touchstart=(o,e)=>{o.inputState.lastTouchTime=Date.now(),o.inputState.setSelectionOrigin("select.pointer")},Ee.touchmove=o=>{o.inputState.setSelectionOrigin("select.pointer")},Pe.mousedown=(o,e)=>{if(o.observer.flush(),o.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of o.state.facet(Ys))if(t=n(o,e),t)break;if(!t&&e.button==0&&(t=rh(o,e)),t){let n=!o.hasFocus;o.inputState.startMouseSelection(new eh(o,e,t,n)),n&&o.observer.ignore(()=>{Cs(o.contentDOM);let s=o.root.activeElement;s&&!s.contains(o.contentDOM)&&s.blur()});let l=o.inputState.mouseSelection;if(l)return l.start(e),l.dragging===!1}return!1};function So(o,e,t,n){if(n==1)return H.cursor(e,t);if(n==2)return Ec(o.state,e,t);{let l=fe.find(o.docView,e),s=o.state.doc.lineAt(l?l.posAtEnd:e),a=l?l.posAtStart:s.from,r=l?l.posAtEnd:s.to;return r<o.state.doc.length&&r==s.to&&r++,H.range(a,r)}}let No=(o,e,t)=>e>=t.top&&e<=t.bottom&&o>=t.left&&o<=t.right;function oh(o,e,t,n){let l=fe.find(o.docView,e);if(!l)return 1;let s=e-l.posAtStart;if(s==0)return 1;if(s==l.length)return-1;let a=l.coordsAt(s,-1);if(a&&No(t,n,a))return-1;let r=l.coordsAt(s,1);return r&&No(t,n,r)?1:a&&a.bottom>=n?-1:1}function Bo(o,e){let t=o.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:oh(o,t,e.clientX,e.clientY)}}const ah=W.ie&&W.ie_version<=11;let Oo=null,Vo=0,_o=0;function Mo(o){if(!ah)return o.detail;let e=Oo,t=_o;return Oo=o,_o=Date.now(),Vo=!e||t>Date.now()-400&&Math.abs(e.clientX-o.clientX)<2&&Math.abs(e.clientY-o.clientY)<2?(Vo+1)%3:1}function rh(o,e){let t=Bo(o,e),n=Mo(e),l=o.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),l=l.map(s.changes))},get(s,a,r){let d=Bo(o,s),h,f=So(o,d.pos,d.bias,n);if(t.pos!=d.pos&&!a){let c=So(o,t.pos,t.bias,n),u=Math.min(c.from,f.from),m=Math.max(c.to,f.to);f=u<f.from?H.range(u,m):H.range(m,u)}return a?l.replaceRange(l.main.extend(f.from,f.to)):r&&n==1&&l.ranges.length>1&&(h=dh(l,d.pos))?h:r?l.addRange(f):H.create([f])}}}function dh(o,e){for(let t=0;t<o.ranges.length;t++){let{from:n,to:l}=o.ranges[t];if(n<=e&&l>=e)return H.create(o.ranges.slice(0,t).concat(o.ranges.slice(t+1)),o.mainIndex==t?0:o.mainIndex-(o.mainIndex>t?1:0))}return null}Pe.dragstart=(o,e)=>{let{selection:{main:t}}=o.state;if(e.target.draggable){let l=o.docView.nearest(e.target);if(l&&l.isWidget){let s=l.posAtStart,a=s+l.length;(s>=t.to||a<=t.from)&&(t=H.range(s,a))}}let{inputState:n}=o;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",zi(o.state,Xn,o.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Pe.dragend=o=>(o.inputState.draggedContent=null,!1);function To(o,e,t,n){if(t=zi(o.state,Yn,t),!t)return;let l=o.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=o.inputState,a=n&&s&&ih(o,e)?{from:s.from,to:s.to}:null,r={from:l,insert:t},d=o.state.changes(a?[a,r]:r);o.focus(),o.dispatch({changes:d,selection:{anchor:d.mapPos(l,-1),head:d.mapPos(l,1)},userEvent:a?"move.drop":"input.drop"}),o.inputState.draggedContent=null}Pe.drop=(o,e)=>{if(!e.dataTransfer)return!1;if(o.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),l=0,s=()=>{++l==t.length&&To(o,e,n.filter(a=>a!=null).join(o.state.lineBreak),!1)};for(let a=0;a<t.length;a++){let r=new FileReader;r.onerror=s,r.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(r.result)||(n[a]=r.result),s()},r.readAsText(t[a])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return To(o,e,n,!0),!0}return!1},Pe.paste=(o,e)=>{if(o.state.readOnly)return!0;o.observer.flush();let t=vo?null:e.clipboardData;return t?(Co(o,t.getData("text/plain")||t.getData("text/uri-list")),!0):(sh(o),!1)};function ch(o,e){let t=o.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),o.focus()},50)}function hh(o){let e=[],t=[],n=!1;for(let l of o.selection.ranges)l.empty||(e.push(o.sliceDoc(l.from,l.to)),t.push(l));if(!e.length){let l=-1;for(let{from:s}of o.selection.ranges){let a=o.doc.lineAt(s);a.number>l&&(e.push(a.text),t.push({from:a.from,to:Math.min(o.doc.length,a.to+1)})),l=a.number}n=!0}return{text:zi(o,Xn,e.join(o.lineBreak)),ranges:t,linewise:n}}let sl=null;Pe.copy=Pe.cut=(o,e)=>{let{text:t,ranges:n,linewise:l}=hh(o.state);if(!t&&!l)return!1;sl=l?t:null,e.type=="cut"&&!o.state.readOnly&&o.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=vo?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(ch(o,t),!1)};const Ao=Nt.define();function Eo(o,e){let t=[];for(let n of o.facet(Zs)){let l=n(o,e);l&&t.push(l)}return t?o.update({effects:t,annotations:Ao.of(!0)}):null}function Io(o){setTimeout(()=>{let e=o.hasFocus;if(e!=o.inputState.notifiedFocused){let t=Eo(o.state,e);t?o.dispatch(t):o.update([])}},10)}Ee.focus=o=>{o.inputState.lastFocusTime=Date.now(),!o.scrollDOM.scrollTop&&(o.inputState.lastScrollTop||o.inputState.lastScrollLeft)&&(o.scrollDOM.scrollTop=o.inputState.lastScrollTop,o.scrollDOM.scrollLeft=o.inputState.lastScrollLeft),Io(o)},Ee.blur=o=>{o.observer.clearSelectionRange(),Io(o)},Ee.compositionstart=Ee.compositionupdate=o=>{o.observer.editContext||(o.inputState.compositionFirstChange==null&&(o.inputState.compositionFirstChange=!0),o.inputState.composing<0&&(o.inputState.composing=0))},Ee.compositionend=o=>{o.observer.editContext||(o.inputState.composing=-1,o.inputState.compositionEndedAt=Date.now(),o.inputState.compositionPendingKey=!0,o.inputState.compositionPendingChange=o.observer.pendingRecords().length>0,o.inputState.compositionFirstChange=null,W.chrome&&W.android?o.observer.flushSoon():o.inputState.compositionPendingChange?Promise.resolve().then(()=>o.observer.flush()):setTimeout(()=>{o.inputState.composing<0&&o.docView.hasComposition&&o.update([])},50))},Ee.contextmenu=o=>{o.inputState.lastContextMenu=Date.now()},Pe.beforeinput=(o,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&o.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),a=e.getTargetRanges();if(s&&a.length){let r=a[0],d=o.posAtDOM(r.startContainer,r.startOffset),h=o.posAtDOM(r.endContainer,r.endOffset);return ll(o,{from:d,to:h,insert:o.state.toText(s)},null),!0}}let l;if(W.chrome&&W.android&&(l=xo.find(s=>s.inputType==e.inputType))&&(o.observer.delayAndroidKey(l.key,l.keyCode),l.key=="Backspace"||l.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>s+10&&o.hasFocus&&(o.contentDOM.blur(),o.focus())},100)}return W.ios&&e.inputType=="deleteContentForward"&&o.observer.flushSoon(),W.safari&&e.inputType=="insertText"&&o.inputState.composing>=0&&setTimeout(()=>Ee.compositionend(o,e),20),!1};const Do=new Set;function fh(o){Do.has(o)||(Do.add(o),o.addEventListener("copy",()=>{}),o.addEventListener("cut",()=>{}))}const Po=["pre-wrap","normal","pre-line","break-spaces"];let Dt=!1;function Fo(){Dt=!1}class uh{constructor(e){this.lineWrapping=e,this.doc=ie.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Po.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n<e.length;n++){let l=e[n];l<0?n++:this.heightSamples[Math.floor(l*10)]||(t=!0,this.heightSamples[Math.floor(l*10)]=!0)}return t}refresh(e,t,n,l,s,a){let r=Po.indexOf(e)>-1,d=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=r;if(this.lineWrapping=r,this.lineHeight=t,this.charWidth=n,this.textHeight=l,this.lineLength=s,d){this.heightSamples={};for(let h=0;h<a.length;h++){let f=a[h];f<0?h++:this.heightSamples[Math.floor(f*10)]=!0}}return d}}class ph{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class We{constructor(e,t,n,l,s){this.from=e,this.length=t,this.top=n,this.height=l,this._content=s}get type(){return typeof this._content=="number"?ze.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof at?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new We(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var de=function(o){return o[o.ByPos=0]="ByPos",o[o.ByHeight=1]="ByHeight",o[o.ByPosNoHeight=2]="ByPosNoHeight",o}(de||(de={}));const qi=.001;class Se{constructor(e,t,n=2){this.length=e,this.height=t,this.flags=n}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>qi&&(Dt=!0),this.height=e)}replace(e,t,n){return Se.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,l){let s=this,a=n.doc;for(let r=l.length-1;r>=0;r--){let{fromA:d,toA:h,fromB:f,toB:c}=l[r],u=s.lineAt(d,de.ByPosNoHeight,n.setDoc(t),0,0),m=u.to>=h?u:s.lineAt(h,de.ByPosNoHeight,n,0,0);for(c+=m.to-h,h=m.to;r>0&&u.from<=l[r-1].toA;)d=l[r-1].fromA,f=l[r-1].fromB,r--,d<u.from&&(u=s.lineAt(d,de.ByPosNoHeight,n,0,0));f+=u.from-d,d=u.from;let b=ol.build(n.setDoc(a),e,f,c);s=Ui(s,s.replace(d,h,b))}return s.updateHeight(n,0)}static empty(){return new _e(0,0)}static of(e){if(e.length==1)return e[0];let t=0,n=e.length,l=0,s=0;for(;;)if(t==n)if(l>s*2){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,l-=r.size}else if(s>l*2){let r=e[n];r.break?e.splice(n,1,r.left,null,r.right):e.splice(n,1,r.left,r.right),n+=2+r.break,s-=r.size}else break;else if(l<s){let r=e[t++];r&&(l+=r.size)}else{let r=e[--n];r&&(s+=r.size)}let a=0;return e[t-1]==null?(a=1,t--):e[t]==null&&(a=1,n++),new mh(Se.of(e.slice(0,t)),a,Se.of(e.slice(n)))}}function Ui(o,e){return o==e?o:(o.constructor!=e.constructor&&(Dt=!0),e)}Se.prototype.size=1;class $o extends Se{constructor(e,t,n){super(e,t),this.deco=n}blockAt(e,t,n,l){return new We(l,this.length,n,this.height,this.deco||0)}lineAt(e,t,n,l,s){return this.blockAt(0,n,l,s)}forEachLine(e,t,n,l,s,a){e<=s+this.length&&t>=s&&a(this.blockAt(0,n,l,s))}updateHeight(e,t=0,n=!1,l){return l&&l.from<=t&&l.more&&this.setHeight(l.heights[l.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class _e extends $o{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,l){return new We(l,this.length,n,this.height,this.breaks)}replace(e,t,n){let l=n[0];return n.length==1&&(l instanceof _e||l instanceof ye&&l.flags&4)&&Math.abs(this.length-l.length)<10?(l instanceof ye?l=new _e(l.length,this.height):l.height=this.height,this.outdated||(l.outdated=!1),l):Se.of(n)}updateHeight(e,t=0,n=!1,l){return l&&l.from<=t&&l.more?this.setHeight(l.heights[l.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ye extends Se{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,l=e.doc.lineAt(t+this.length).number,s=l-n+1,a,r=0;if(e.lineWrapping){let d=Math.min(this.height,e.lineHeight*s);a=d/s,this.length>s+1&&(r=(this.height-d)/(this.length-s-1))}else a=this.height/s;return{firstLine:n,lastLine:l,perLine:a,perChar:r}}blockAt(e,t,n,l){let{firstLine:s,lastLine:a,perLine:r,perChar:d}=this.heightMetrics(t,l);if(t.lineWrapping){let h=l+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),f=t.doc.lineAt(h),c=r+f.length*d,u=Math.max(n,e-c/2);return new We(f.from,f.length,u,c,0)}else{let h=Math.max(0,Math.min(a-s,Math.floor((e-n)/r))),{from:f,length:c}=t.doc.line(s+h);return new We(f,c,n+r*h,r,0)}}lineAt(e,t,n,l,s){if(t==de.ByHeight)return this.blockAt(e,n,l,s);if(t==de.ByPosNoHeight){let{from:m,to:b}=n.doc.lineAt(e);return new We(m,b-m,0,0,0)}let{firstLine:a,perLine:r,perChar:d}=this.heightMetrics(n,s),h=n.doc.lineAt(e),f=r+h.length*d,c=h.number-a,u=l+r*c+d*(h.from-s-c);return new We(h.from,h.length,Math.max(l,Math.min(u,l+this.height-f)),f,0)}forEachLine(e,t,n,l,s,a){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:r,perLine:d,perChar:h}=this.heightMetrics(n,s);for(let f=e,c=l;f<=t;){let u=n.doc.lineAt(f);if(f==e){let b=u.number-r;c+=d*b+h*(e-s-b)}let m=d+h*u.length;a(new We(u.from,u.length,c,m,0)),c+=m,f=u.to+1}}replace(e,t,n){let l=this.length-t;if(l>0){let s=n[n.length-1];s instanceof ye?n[n.length-1]=new ye(s.length+l):n.push(null,new ye(l-1))}if(e>0){let s=n[0];s instanceof ye?n[0]=new ye(e+s.length):n.unshift(new ye(e-1),null)}return Se.of(n)}decomposeLeft(e,t){t.push(new ye(e-1),null)}decomposeRight(e,t){t.push(null,new ye(this.length-e-1))}updateHeight(e,t=0,n=!1,l){let s=t+this.length;if(l&&l.from<=t+this.length&&l.more){let a=[],r=Math.max(t,l.from),d=-1;for(l.from>t&&a.push(new ye(l.from-t-1).updateHeight(e,t));r<=s&&l.more;){let f=e.doc.lineAt(r).length;a.length&&a.push(null);let c=l.heights[l.index++];d==-1?d=c:Math.abs(c-d)>=qi&&(d=-2);let u=new _e(f,c);u.outdated=!1,a.push(u),r+=f+1}r<=s&&a.push(null,new ye(s-r).updateHeight(e,r));let h=Se.of(a);return(d<0||Math.abs(h.height-this.height)>=qi||Math.abs(d-this.heightMetrics(e,t).perLine)>=qi)&&(Dt=!0),Ui(this,h)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class mh extends Se{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,l){let s=n+this.left.height;return e<s?this.left.blockAt(e,t,n,l):this.right.blockAt(e,t,s,l+this.left.length+this.break)}lineAt(e,t,n,l,s){let a=l+this.left.height,r=s+this.left.length+this.break,d=t==de.ByHeight?e<a:e<r,h=d?this.left.lineAt(e,t,n,l,s):this.right.lineAt(e,t,n,a,r);if(this.break||(d?h.to<r:h.from>r))return h;let f=t==de.ByPosNoHeight?de.ByPosNoHeight:de.ByPos;return d?h.join(this.right.lineAt(r,f,n,a,r)):this.left.lineAt(r,f,n,l,s).join(h)}forEachLine(e,t,n,l,s,a){let r=l+this.left.height,d=s+this.left.length+this.break;if(this.break)e<d&&this.left.forEachLine(e,t,n,l,s,a),t>=d&&this.right.forEachLine(e,t,n,r,d,a);else{let h=this.lineAt(d,de.ByPos,n,l,s);e<h.from&&this.left.forEachLine(e,h.from-1,n,l,s,a),h.to>=e&&h.from<=t&&a(h),t>h.to&&this.right.forEachLine(h.to+1,t,n,r,d,a)}}replace(e,t,n){let l=this.left.length+this.break;if(t<l)return this.balanced(this.left.replace(e,t,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-l,t-l,n));let s=[];e>0&&this.decomposeLeft(e,s);let a=s.length;for(let r of n)s.push(r);if(e>0&&Ro(s,a-1),t<this.length){let r=s.length;this.decomposeRight(t,s),Ro(s,r)}return Se.of(s)}decomposeLeft(e,t){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(n++,e>=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,l=n+this.break;if(e>=l)return this.right.decomposeRight(e-l,t);e<n&&this.left.decomposeRight(e,t),this.break&&e<l&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Se.of(this.break?[e,null,t]:[e,t]):(this.left=Ui(this.left,e),this.right=Ui(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,l){let{left:s,right:a}=this,r=t+s.length+this.break,d=null;return l&&l.from<=t+s.length&&l.more?d=s=s.updateHeight(e,t,n,l):s.updateHeight(e,t,n),l&&l.from<=r+a.length&&l.more?d=a=a.updateHeight(e,r,n,l):a.updateHeight(e,r,n),d?this.balanced(s,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ro(o,e){let t,n;o[e]==null&&(t=o[e-1])instanceof ye&&(n=o[e+1])instanceof ye&&o.splice(e-1,3,new ye(t.length+1+n.length))}const gh=5;class ol{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),l=this.nodes[this.nodes.length-1];l instanceof _e?l.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new _e(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e<t||n.heightRelevant){let l=n.widget?n.widget.estimatedHeight:0,s=n.widget?n.widget.lineBreaks:0;l<0&&(l=this.oracle.lineHeight);let a=t-e;n.block?this.addBlock(new $o(a,l,n)):(a||s||l>=gh)&&this.addLineDeco(l,s,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new _e(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new ye(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof _e)return e;let t=new _e(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let l=this.ensureLine();l.length+=n,l.collapsed+=n,l.widgetHeight=Math.max(l.widgetHeight,e),l.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof _e)&&!this.isCovered?this.nodes.push(new _e(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let l of this.nodes)l instanceof _e&&l.updateHeight(this.oracle,n),n+=l?l.length:1;return this.nodes}static build(e,t,n,l){let s=new ol(n,e);return re.spans(t,n,l,s,0),s.finish(n)}}function kh(o,e,t){let n=new bh;return re.compare(o,e,t,n,0),n.changes}class bh{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,n,l){(e<t||n&&n.heightRelevant||l&&l.heightRelevant)&&qn(e,t,this.changes,5)}}function yh(o,e){let t=o.getBoundingClientRect(),n=o.ownerDocument,l=n.defaultView||window,s=Math.max(0,t.left),a=Math.min(l.innerWidth,t.right),r=Math.max(0,t.top),d=Math.min(l.innerHeight,t.bottom);for(let h=o.parentNode;h&&h!=n.body;)if(h.nodeType==1){let f=h,c=window.getComputedStyle(f);if((f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth)&&c.overflow!="visible"){let u=f.getBoundingClientRect();s=Math.max(s,u.left),a=Math.min(a,u.right),r=Math.max(r,u.top),d=Math.min(h==o.parentNode?l.innerHeight:d,u.bottom)}h=c.position=="absolute"||c.position=="fixed"?f.offsetParent:f.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,a)-t.left,top:r-(t.top+e),bottom:Math.max(r,d)-(t.top+e)}}function wh(o,e){let t=o.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class al{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let l=e[n],s=t[n];if(l.from!=s.from||l.to!=s.to||l.size!=s.size)return!1}return!0}draw(e,t){return Ce.replace({widget:new xh(this.size*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class xh extends zn{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Lo{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=jo,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=be.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Zn).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new uh(t),this.stateDeco=e.facet(si).filter(n=>typeof n!="function"),this.heightMap=Se.empty().applyChanges(this.stateDeco,ie.empty,this.heightOracle.setDoc(e.doc),[new Ae(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ce.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let l=n?t.head:t.anchor;if(!e.some(({from:s,to:a})=>l>=s&&l<=a)){let{from:s,to:a}=this.lineBlockAt(l);e.push(new Wi(s,a))}}return this.viewports=e.sort((n,l)=>n.from-l.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?jo:new rl(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ri(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(si).filter(f=>typeof f!="function");let l=e.changedRanges,s=Ae.extendWithRanges(l,kh(n,this.stateDeco,e?e.changes:me.empty(this.state.doc.length))),a=this.heightMap.height,r=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Fo(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=a||Dt)&&(e.flags|=2),r?(this.scrollAnchorPos=e.changes.mapPos(r.from,-1),this.scrollAnchorHeight=r.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let d=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<d.from||t.range.head>d.to)||!this.viewportIsAppropriate(d))&&(d=this.getViewport(0,t));let h=d.from!=this.viewport.from||d.to!=this.viewport.to;this.viewport=d,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Sc)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),l=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?be.RTL:be.LTR;let a=this.heightOracle.mustRefreshForWrapping(s),r=t.getBoundingClientRect(),d=a||this.mustMeasureContent||this.contentDOMHeight!=r.height;this.contentDOMHeight=r.height,this.mustMeasureContent=!1;let h=0,f=0;if(r.width&&r.height){let{scaleX:g,scaleY:p}=vs(t,r);(g>.005&&Math.abs(this.scaleX-g)>.005||p>.005&&Math.abs(this.scaleY-p)>.005)&&(this.scaleX=g,this.scaleY=p,h|=8,a=d=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,u=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=u)&&(this.paddingTop=c,this.paddingBottom=u,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(l.lineWrapping&&(d=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8);let m=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=m&&(this.scrollAnchorHeight=-1,this.scrollTop=m),this.scrolledToBottom=Bs(e.scrollDOM);let b=(this.printing?wh:yh)(t,this.paddingTop),y=b.top-this.pixelViewport.top,k=b.bottom-this.pixelViewport.bottom;this.pixelViewport=b;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(d=!0)),!this.inView&&!this.scrollTarget)return 0;let w=r.width;if((this.contentDOMWidth!=w||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=r.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),d){let g=e.docView.measureVisibleLineHeights(this.viewport);if(l.mustRefreshForHeights(g)&&(a=!0),a||l.lineWrapping&&Math.abs(w-this.contentDOMWidth)>l.charWidth){let{lineHeight:p,charWidth:N,textHeight:V}=e.docView.measureTextSize();a=p>0&&l.refresh(s,p,N,V,w/N,g),a&&(e.docView.minWidth=0,h|=8)}y>0&&k>0?f=Math.max(y,k):y<0&&k<0&&(f=Math.min(y,k)),Fo();for(let p of this.viewports){let N=p.from==this.viewport.from?g:e.docView.measureVisibleLineHeights(p);this.heightMap=(a?Se.empty().applyChanges(this.stateDeco,ie.empty,this.heightOracle,[new Ae(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(l,0,a,new ph(p.from,N))}Dt&&(h|=2)}let O=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return O&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),h|=this.updateForViewport()),(h&2||O)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),l=this.heightMap,s=this.heightOracle,{visibleTop:a,visibleBottom:r}=this,d=new Wi(l.lineAt(a-n*1e3,de.ByHeight,s,0,0).from,l.lineAt(r+(1-n)*1e3,de.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(h<d.from||h>d.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=l.lineAt(h,de.ByPos,s,0,0),u;t.y=="center"?u=(c.top+c.bottom)/2-f/2:t.y=="start"||t.y=="nearest"&&h<d.from?u=c.top:u=c.bottom-f,d=new Wi(l.lineAt(u-1e3/2,de.ByHeight,s,0,0).from,l.lineAt(u+f+1e3/2,de.ByHeight,s,0,0).to)}}return d}mapViewport(e,t){let n=t.mapPos(e.from,-1),l=t.mapPos(e.to,1);return new Wi(this.heightMap.lineAt(n,de.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(l,de.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},n=0){if(!this.inView)return!0;let{top:l}=this.heightMap.lineAt(e,de.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,de.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:r}=this;return(e==0||l<=a-Math.max(10,Math.min(-n,250)))&&(t==this.state.doc.length||s>=r+Math.max(10,Math.min(n,250)))&&l>a-2*1e3&&s<r+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let n=[];for(let l of e)t.touchesRange(l.from,l.to)||n.push(new al(t.mapPos(l.from),t.mapPos(l.to),l.size));return n}ensureLineGaps(e,t){let n=this.heightOracle.lineWrapping,l=n?1e4:2e3,s=l>>1,a=l<<1;if(this.defaultTextDirection!=be.LTR&&!n)return[];let r=[],d=(f,c,u,m)=>{if(c-f<s)return;let b=this.state.selection.main,y=[b.from];b.empty||y.push(b.to);for(let v of y)if(v>f&&v<c){d(f,v-10,u,m),d(v+10,c,u,m);return}let k=Ch(e,v=>v.from>=u.from&&v.to<=u.to&&Math.abs(v.from-f)<s&&Math.abs(v.to-c)<s&&!y.some(w=>v.from<w&&v.to>w));if(!k){if(c<u.to&&t&&n&&t.visibleRanges.some(v=>v.from<=c&&v.to>=c)){let v=t.moveToLineBoundary(H.cursor(c),!1,!0).head;v>f&&(c=v)}k=new al(f,c,this.gapSize(u,f,c,m))}r.push(k)},h=f=>{if(f.length<a||f.type!=ze.Text)return;let c=vh(f.from,f.to,this.stateDeco);if(c.total<a)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,m,b;if(n){let y=l/this.heightOracle.lineLength*this.heightOracle.lineHeight,k,v;if(u!=null){let w=Ki(c,u),O=((this.visibleBottom-this.visibleTop)/2+y)/f.height;k=w-O,v=w+O}else k=(this.visibleTop-f.top-y)/f.height,v=(this.visibleBottom-f.top+y)/f.height;m=Hi(c,k),b=Hi(c,v)}else{let y=c.total*this.heightOracle.charWidth,k=l*this.heightOracle.charWidth,v,w;if(u!=null){let O=Ki(c,u),g=((this.pixelViewport.right-this.pixelViewport.left)/2+k)/y;v=O-g,w=O+g}else v=(this.pixelViewport.left-k)/y,w=(this.pixelViewport.right+k)/y;m=Hi(c,v),b=Hi(c,w)}m>f.from&&d(f.from,m,f,c),b<f.to&&d(b,f.to,f,c)};for(let f of this.viewportLines)Array.isArray(f.type)?f.type.forEach(h):h(f);return r}gapSize(e,t,n,l){let s=Ki(l,n)-Ki(l,t);return this.heightOracle.lineWrapping?e.height*s:l.total*this.heightOracle.charWidth*s}updateLineGaps(e){al.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ce.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];re.spans(e,this.viewport.from,this.viewport.to,{span(l,s){t.push({from:l,to:s})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some((l,s)=>l.from!=t[s].from||l.to!=t[s].to);return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ri(this.heightMap.lineAt(e,de.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||ri(this.heightMap.lineAt(this.scaler.fromDOM(e),de.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ri(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Wi{constructor(e,t){this.from=e,this.to=t}}function vh(o,e,t){let n=[],l=o,s=0;return re.spans(t,o,e,{span(){},point(a,r){a>l&&(n.push({from:l,to:a}),s+=a-l),l=r}},20),l<e&&(n.push({from:l,to:e}),s+=e-l),{total:s,ranges:n}}function Hi({total:o,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let n=Math.floor(o*t);for(let l=0;;l++){let{from:s,to:a}=e[l],r=a-s;if(n<=r)return s+n;n-=r}}function Ki(o,e){let t=0;for(let{from:n,to:l}of o.ranges){if(e<=l){t+=e-n;break}t+=l-n}return t/o.total}function Ch(o,e){for(let t of o)if(e(t))return t}const jo={toDOM(o){return o},fromDOM(o){return o},scale:1,eq(o){return o==this}};class rl{constructor(e,t,n){let l=0,s=0,a=0;this.viewports=n.map(({from:r,to:d})=>{let h=t.lineAt(r,de.ByPos,e,0,0).top,f=t.lineAt(d,de.ByPos,e,0,0).bottom;return l+=f-h,{from:r,to:d,top:h,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-l)/(t.height-l);for(let r of this.viewports)r.domTop=a+(r.top-s)*this.scale,a=r.domBottom=r.domTop+(r.bottom-r.top),s=r.bottom}toDOM(e){for(let t=0,n=0,l=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return l+(e-n)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);n=s.bottom,l=s.domBottom}}fromDOM(e){for(let t=0,n=0,l=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return n+(e-l)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);n=s.bottom,l=s.domBottom}}eq(e){return e instanceof rl?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,n)=>t.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}}function ri(o,e){if(e.scale==1)return o;let t=e.toDOM(o.top),n=e.toDOM(o.bottom);return new We(o.from,o.length,t,n-t,Array.isArray(o._content)?o._content.map(l=>ri(l,e)):o._content)}const Qi=Y.define({combine:o=>o.join(" ")}),dl=Y.define({combine:o=>o.indexOf(!0)>-1}),cl=ot.newName(),zo=ot.newName(),qo=ot.newName(),Uo={"&light":"."+zo,"&dark":"."+qo};function hl(o,e,t){return new ot(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,l=>{if(l=="&")return o;if(!t||!t[l])throw new RangeError(`Unsupported selector: ${l}`);return t[l]}):o+" "+n}})}const Sh=hl("."+cl,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Uo),Nh={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},fl=W.ie&&W.ie_version<=11;class Bh{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new ac,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(W.ie&&W.ie_version<=11||W.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(W.chrome&&W.chrome_version<126)&&(this.editContext=new Vh(e),e.state.facet(dt)&&(e.contentDOM.editContext=this.editContext.editContext)),fl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,l=this.selectionRange;if(n.state.facet(dt)?n.root.activeElement!=this.dom:!Ti(n.dom,l))return;let s=l.anchorNode&&n.docView.nearest(l.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(W.ie&&W.ie_version<=11||W.android&&W.chrome)&&!n.state.selection.main.empty&&l.focusNode&&ei(l.focusNode,l.focusOffset,l.anchorNode,l.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Jt(e.root);if(!t)return!1;let n=W.safari&&e.root.nodeType==11&&nc(this.dom.ownerDocument)==this.dom&&Oh(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let l=Ti(this.dom,n);return l&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&dc(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),l&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let n=this.dom;n;)if(n.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=t)n.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Nh),fl&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),fl&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var n;if(!this.delayedAndroidKey){let l=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Mt(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(l)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,l=!1;for(let s of e){let a=this.readMutation(s);a&&(a.typeOver&&(l=!0),t==-1?{from:t,to:n}=a:(t=Math.min(a.from,t),n=Math.max(a.to,n)))}return{from:t,to:n,typeOver:l}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),l=this.selectionChanged&&Ti(this.dom,this.selectionRange);if(e<0&&!l)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Uc(this.view,e,t,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,l=yo(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),l}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=Wo(t,e.previousSibling||e.target.previousSibling,-1),l=Wo(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:l?t.posBefore(l):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(dt)!=e.state.facet(dt)&&(e.view.contentDOM.editContext=e.state.facet(dt)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let l of this.scrollTargets)l.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Wo(o,e,t){for(;e;){let n=oe.get(e);if(n&&n.parent==o)return n;let l=e.parentNode;e=l!=o.dom?l:t>0?e.nextSibling:e.previousSibling}return null}function Ho(o,e){let t=e.startContainer,n=e.startOffset,l=e.endContainer,s=e.endOffset,a=o.docView.domAtPos(o.state.selection.main.anchor);return ei(a.node,a.offset,l,s)&&([t,n,l,s]=[l,s,t,n]),{anchorNode:t,anchorOffset:n,focusNode:l,focusOffset:s}}function Oh(o,e){if(e.getComposedRanges){let l=e.getComposedRanges(o.root)[0];if(l)return Ho(o,l)}let t=null;function n(l){l.preventDefault(),l.stopImmediatePropagation(),t=l.getTargetRanges()[0]}return o.contentDOM.addEventListener("beforeinput",n,!0),o.dom.ownerDocument.execCommand("indent"),o.contentDOM.removeEventListener("beforeinput",n,!0),t?Ho(o,t):null}class Vh{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let{anchor:l}=e.state.selection.main,s={from:this.toEditorPos(n.updateRangeStart),to:this.toEditorPos(n.updateRangeEnd),insert:ie.of(n.text.split(`
10
- `))};s.from==this.from&&l<this.from?s.from=l:s.to==this.to&&l>this.to&&(s.to=l),!(s.from==s.to&&!s.insert.length)&&(this.pendingContextChange=s,e.state.readOnly||ll(e,s,H.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd))),this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)))},this.handlers.characterboundsupdate=n=>{let l=[],s=null;for(let a=this.toEditorPos(n.rangeStart),r=this.toEditorPos(n.rangeEnd);a<r;a++){let d=e.coordsForChar(a);s=d&&new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top)||s||new DOMRect,l.push(s)}t.updateCharacterBounds(n.rangeStart,l)},this.handlers.textformatupdate=n=>{let l=[];for(let s of n.getTextFormats()){let a=s.underlineStyle,r=s.underlineThickness;if(a!="None"&&r!="None"){let d=`text-decoration: underline ${a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${r=="Thin"?1:2}px`;l.push(Ce.mark({attributes:{style:d}}).range(this.toEditorPos(s.rangeStart),this.toEditorPos(s.rangeEnd)))}}e.dispatch({effects:io.of(Ce.set(l))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{e.inputState.composing=-1,e.inputState.compositionFirstChange=null};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let l=Jt(n.root);l&&l.rangeCount&&this.editContext.updateSelectionBounds(l.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,l=this.pendingContextChange;return e.changes.iterChanges((s,a,r,d,h)=>{if(n)return;let f=h.length-(a-s);if(l&&a>=l.to)if(l.from==s&&l.to==a&&l.insert.eq(h)){l=this.pendingContextChange=null,t+=f,this.to+=f;return}else l=null,this.revertPending(e.state);if(s+=t,a+=t,a<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||a>this.to||this.to-this.from+h.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(a),h.toString()),this.to+=f}t+=f}),l&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange;!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.resetRange(e.state),this.editContext.updateText(0,this.editContext.text.length,e.state.doc.sliceString(this.from,this.to)),this.setSelection(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),l=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=l)&&this.editContext.updateSelection(n,l)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e){return e+this.from}toContextPos(e){return e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class le{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(l=>l.forEach(s=>n(s,this)))||(l=>this.update(l)),this.dispatch=this.dispatch.bind(this),this._root=e.root||rc(e.parent)||document,this.viewState=new Lo(e.state||se.create(e)),e.scrollTo&&e.scrollTo.is(Fi)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(li).map(l=>new Jn(l));for(let l of this.plugins)l.update(this);this.observer=new Bh(this),this.inputState=new Gc(this),this.inputState.ensureHandlers(this.plugins),this.docView=new co(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof xe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,l,s=this.state;for(let u of e){if(u.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=u.state}if(this.destroyed){this.viewState.state=s;return}let a=this.hasFocus,r=0,d=null;e.some(u=>u.annotation(Ao))?(this.inputState.notifiedFocused=a,r=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,d=Eo(s,a),d||(r=1));let h=this.observer.delayedAndroidKey,f=null;if(h?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(f=null)):this.observer.clear(),s.facet(se.phrases)!=this.state.facet(se.phrases))return this.setState(s);l=$i.create(this,s,e),l.flags|=r;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(c&&(c=c.map(u.changes)),u.scrollIntoView){let{main:m}=u.state.selection;c=new Et(m.empty?m:H.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of u.effects)m.is(Fi)&&(c=m.value.clip(this.state))}this.viewState.update(l,c),this.bidiCache=Gi.update(this.bidiCache,l.changes),l.empty||(this.updatePlugins(l),this.inputState.update(l)),t=this.docView.update(l),this.state.facet(oi)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(l.startState.facet(Qi)!=l.state.facet(Qi)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!l.empty)for(let u of this.state.facet(Gn))try{u(l)}catch(m){Ue(this.state,m,"update listener")}(d||f)&&Promise.resolve().then(()=>{d&&this.state==d.startState&&this.dispatch(d),f&&!yo(this,f)&&h.force&&Mt(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new Lo(e),this.plugins=e.facet(li).map(n=>new Jn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new co(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(li),n=e.state.facet(li);if(t!=n){let l=[];for(let s of n){let a=t.indexOf(s);if(a<0)l.push(new Jn(s));else{let r=this.plugins[a];r.mustUpdate=e,l.push(r)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=l,this.pluginMap.clear()}else for(let l of this.plugins)l.mustUpdate=e;for(let l=0;l<this.plugins.length;l++)this.plugins[l].update(this);t!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(n){Ue(this.state,n,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,l=n.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:a}=this.viewState;Math.abs(l-this.viewState.scrollTop)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let r=0;;r++){if(a<0)if(Bs(n))s=-1,a=this.viewState.heightMap.height;else{let m=this.viewState.scrollAnchorAt(l);s=m.from,a=m.top}this.updateState=1;let d=this.viewState.measure(this);if(!d&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(r>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];d&4||([this.measureRequests,h]=[h,this.measureRequests]);let f=h.map(m=>{try{return m.read(this)}catch(b){return Ue(this.state,b),Ko}}),c=$i.create(this,this.state,[]),u=!1;c.flags|=d,t?t.flags|=d:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c),u&&this.docViewUpdate());for(let m=0;m<h.length;m++)if(f[m]!=Ko)try{let b=h[m];b.write&&b.write(f[m],this)}catch(b){Ue(this.state,b)}if(u&&this.docView.updateSelection(!0),!c.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let b=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-a;if(b>1||b<-1){l=l+b,n.scrollTop=l/this.scaleY,a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let r of this.state.facet(Gn))r(t)}get themeClasses(){return cl+" "+(this.state.facet(dl)?qo:zo)+" "+this.state.facet(Qi)}updateAttrs(){let e=Qo(this,no,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(dt)?"true":"false",class:"cm-content",style:`${W.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Qo(this,Zn,t);let n=this.observer.ignore(()=>{let l=jn(this.contentDOM,this.contentAttrs,t),s=jn(this.dom,this.editorAttrs,e);return l||s});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let l of n.effects)if(l.is(le.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=l.value}}mountStyles(){this.styleModules=this.state.facet(oi);let e=this.state.facet(le.cspNonce);ot.mount(this.root,this.styleModules.concat(Sh).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(n=>n.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return nl(this,e,ko(this,e,t,n))}moveByGroup(e,t){return nl(this,e,ko(this,e,t,n=>Lc(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),l=this.textDirectionAt(e.from),s=n[t?n.length-1:0];return H.cursor(s.side(t,l)+e.from,s.forward(!t,l)?1:-1)}moveToLineBoundary(e,t,n=!0){return Rc(this,e,t,n)}moveVertically(e,t,n){return nl(this,e,jc(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),mo(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let l=this.state.doc.lineAt(e),s=this.bidiSpans(l),a=s[rt.find(s,e-l.from,-1,t)];return Ei(n,a.dir==be.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eo)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>_h)return Hs(e.length);let t=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Ws(s.isolates,n=oo(this,e))))return s.order;n||(n=oo(this,e));let l=xc(e.text,t,n);return this.bidiCache.push(new Gi(e.from,e.to,t,n,!0,l)),l}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||W.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Cs(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Fi.of(new Et(typeof e=="number"?H.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Fi.of(new Et(H.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return It.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return It.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=ot.newName(),l=[Qi.of(n),oi.of(hl(`.${n}`,e))];return t&&t.dark&&l.push(dl.of(!0)),l}static baseTheme(e){return qd.lowest(oi.of(hl("."+cl,e,Uo)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),l=n&&oe.get(n)||oe.get(e);return((t=l?.rootView)===null||t===void 0?void 0:t.view)||null}}le.styleModule=oi,le.inputHandler=Js,le.clipboardInputFilter=Yn,le.clipboardOutputFilter=Xn,le.scrollHandler=to,le.focusChangeEffect=Zs,le.perLineTextDirection=eo,le.exceptionSink=Xs,le.updateListener=Gn,le.editable=dt,le.mouseSelectionStyle=Ys,le.dragMovesSelection=Gs,le.clickAddsSelectionRange=Qs,le.decorations=si,le.outerDecorations=lo,le.atomicRanges=el,le.bidiIsolatedRanges=so,le.scrollMargins=ao,le.darkTheme=dl,le.cspNonce=Y.define({combine:o=>o.length?o[0]:""}),le.contentAttributes=Zn,le.editorAttributes=no,le.lineWrapping=le.contentAttributes.of({class:"cm-lineWrapping"}),le.announce=ue.define();const _h=4096,Ko={};class Gi{constructor(e,t,n,l,s,a){this.from=e,this.to=t,this.dir=n,this.isolates=l,this.fresh=s,this.order=a}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let n=[],l=e.length?e[e.length-1].dir:be.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let a=e[s];a.dir==l&&!t.touchesRange(a.from,a.to)&&n.push(new Gi(t.mapPos(a.from,1),t.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return n}}function Qo(o,e,t){for(let n=o.state.facet(e),l=n.length-1;l>=0;l--){let s=n[l],a=typeof s=="function"?s(o):s;a&&Ln(a,t)}return t}const Mh=!W.ios,Go={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Mh&&(Go[".cm-line"].caretColor=Go[".cm-content"].caretColor="transparent !important");class Pt extends Ot{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Pt.prototype.elementClass="",Pt.prototype.toDOM=void 0,Pt.prototype.mapMode=Ve.TrackBefore,Pt.prototype.startSide=Pt.prototype.endSide=-1,Pt.prototype.point=!0;var ul;const Ft=new te;function Th(o){return Y.define({combine:o?e=>e.concat(o):void 0})}const Ah=new te;class Fe{constructor(e,t,n=[],l=""){this.data=e,this.name=l,se.prototype.hasOwnProperty("tree")||Object.defineProperty(se.prototype,"tree",{get(){return pl(this)}}),this.parser=t,this.extension=[Rt.of(this),se.languageData.of((s,a,r)=>{let d=Yo(s,a,r),h=d.type.prop(Ft);if(!h)return[];let f=s.facet(h),c=d.type.prop(Ah);if(c){let u=d.resolve(a-d.from,r);for(let m of c)if(m.test(u,s)){let b=s.facet(m.facet);return m.type=="replace"?b:b.concat(f)}}return f})].concat(n)}isActiveAt(e,t,n=-1){return Yo(e,t,n).type.prop(Ft)==this.data}findRegions(e){let t=e.facet(Rt);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],l=(s,a)=>{if(s.prop(Ft)==this.data){n.push({from:a,to:a+s.length});return}let r=s.prop(te.mounted);if(r){if(r.tree.prop(Ft)==this.data){if(r.overlay)for(let d of r.overlay)n.push({from:d.from+a,to:d.to+a});else n.push({from:a,to:a+s.length});return}else if(r.overlay){let d=n.length;if(l(r.tree,r.overlay[0].from+a),n.length>d)return}}for(let d=0;d<s.children.length;d++){let h=s.children[d];h instanceof he&&l(h,s.positions[d]+a)}};return l(pl(e),0),n}get allowsNesting(){return!0}}Fe.setState=ue.define();function Yo(o,e,t){let n=o.facet(Rt),l=pl(o).topNode;if(!n||n.allowsNesting)for(let s=l;s;s=s.enter(e,t,pe.ExcludeBuffers))s.type.isTop&&(l=s);return l}class Yi extends Fe{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=Th(e.languageData);return new Yi(t,e.parser.configure({props:[Ft.add(n=>n.isTop?t:void 0)]}),e.name)}configure(e,t){return new Yi(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function pl(o){let e=o.field(Fe.state,!1);return e?e.tree:he.empty}class Eh{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let di=null;class Xi{constructor(e,t,n=[],l,s,a,r,d){this.parser=e,this.state=t,this.fragments=n,this.tree=l,this.treeLen=s,this.viewport=a,this.skipped=r,this.scheduleOn=d,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new Xi(e,t,[],he.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Eh(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=he.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let l=Date.now()+e;e=()=>Date.now()>l}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let l=this.parse.advance();if(l)if(this.fragments=this.withoutTempSkipped(ut.addTree(l,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=l,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ut.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=di;di=this;try{return e()}finally{di=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Xo(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:l,treeLen:s,viewport:a,skipped:r}=this;if(this.takeTree(),!e.empty){let d=[];if(e.iterChangedRanges((h,f,c,u)=>d.push({fromA:h,toA:f,fromB:c,toB:u})),n=ut.applyChanges(n,d),l=he.empty,s=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){r=[];for(let h of this.skipped){let f=e.mapPos(h.from,1),c=e.mapPos(h.to,-1);f<c&&r.push({from:f,to:c})}}}return new Xi(this.parser,t,n,l,s,a,r,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:l,to:s}=this.skipped[n];l<e.to&&s>e.from&&(this.fragments=Xo(this.fragments,l,s),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Dl{createParse(t,n,l){let s=l[0].from,a=l[l.length-1].to;return{parsedPos:s,advance(){let d=di;if(d){for(let h of l)d.tempSkipped.push(h);e&&(d.scheduleOn=d.scheduleOn?Promise.all([d.scheduleOn,e]):e)}return this.parsedPos=a,new he(Ne.none,[],[],a-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return di}}function Xo(o,e,t){return ut.applyChanges(o,[{fromA:e,toA:t,fromB:e,toB:t}])}class $t{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new $t(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=Xi.create(e.facet(Rt).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new $t(n)}}Fe.state=gt.define({create:$t.init,update(o,e){for(let t of e.effects)if(t.is(Fe.setState))return t.value;return e.startState.facet(Rt)!=e.state.facet(Rt)?$t.init(e.state):o.apply(e)}});let Jo=o=>{let e=setTimeout(()=>o(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Jo=o=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(o,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const ml=typeof navigator<"u"&&(!((ul=navigator.scheduling)===null||ul===void 0)&&ul.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ih=It.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Fe.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Fe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Jo(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:l}}=this.view,s=n.field(Fe.state);if(s.tree==s.context.tree&&s.context.isDone(l+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!ml?Math.max(25,e.timeRemaining()-5):1e9),r=s.context.treeLen<l&&n.doc.length>l+1e3,d=s.context.work(()=>ml&&ml()||Date.now()>a,l+(r?0:1e5));this.chunkBudget-=Date.now()-t,(d||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Fe.setState.of(new $t(s.context))})),this.chunkBudget>0&&!(d&&!r)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Rt=Y.define({combine(o){return o.length?o[0]:null},enables:o=>[Fe.state,Ih,le.contentAttributes.compute([o],e=>{let t=e.facet(o);return t&&t.name?{"data-language":t.name}:{}})]});class Dh{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Ph=new te;function Zo({except:o,units:e=1}={}){return t=>{let n=o&&o.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}const Fh=new te;function $h(o){let e=o.firstChild,t=o.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?o.to:t.from}:null}class gl{constructor(e,t){this.specs=e;let n;function l(r){let d=ot.newName();return(n||(n=Object.create(null)))["."+d]=r,d}const s=typeof t.all=="string"?t.all:t.all?l(t.all):void 0,a=t.scope;this.scope=a instanceof Fe?r=>r.prop(Ft)==a.data:a?r=>r==a:void 0,this.style=ql(e.map(r=>({tag:r.tag,class:r.class||l(Object.assign({},r,{tag:null}))})),{all:s}).style,this.module=n?new ot(n):null,this.themeType=t.themeType}static define(e,t){return new gl(e,t||{})}}z.meta,z.link,z.heading,z.emphasis,z.strong,z.strikethrough,z.keyword,z.atom,z.bool,z.url,z.contentSeparator,z.labelName,z.literal,z.inserted,z.string,z.deleted,z.regexp,z.escape,z.string,z.variableName,z.variableName,z.typeName,z.namespace,z.className,z.variableName,z.macroName,z.propertyName,z.comment,z.invalid;const Rh=Object.create(null),ea=[Ne.none],ta=[],ia=Object.create(null),Lh=Object.create(null);for(let[o,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Lh[o]=jh(Rh,e);function kl(o,e){ta.indexOf(o)>-1||(ta.push(o),console.warn(e))}function jh(o,e){let t=[];for(let r of e.split(" ")){let d=[];for(let h of r.split(".")){let f=o[h]||z[h];f?typeof f=="function"?d.length?d=d.map(f):kl(h,`Modifier ${h} used at start of tag`):d.length?kl(h,`Tag ${h} used as modifier`):d=Array.isArray(f)?f:[f]:kl(h,`Unknown highlighting tag ${h}`)}for(let h of d)t.push(h)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),l=n+" "+t.map(r=>r.id),s=ia[l];if(s)return s.id;let a=ia[l]=Ne.define({id:ea.length,name:n,props:[zl({[n]:t})]});return ea.push(a),a.id}be.RTL,be.LTR;const zh=Yi.define({name:"json",parser:Fd.configure({props:[Ph.add({Object:Zo({except:/^\s*\}/}),Array:Zo({except:/^\s*\]/})}),Fh.add({"Object Array":$h})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function qh(){return new Dh(zh)}const bl=[{name:"tel",title:"手机号",express:"^1[3-9]\\d{9}$",error:"手机号不正确"},{name:"email",title:"邮箱",express:"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",error:"邮箱不正确"},{name:"idcard",title:"身份证号码",express:"(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)",error:"身份证号码不正确"}];function Uh(){const o=Ie();if(o.formRules?.length){const e={};bl.forEach(n=>{e[n.name]=n});const t=[...bl];return o.formRules.forEach(n=>{const l=e[n.name];l?Object.assign(l,n):t.push(l)}),t}return bl}const Wh={loadAdvances:Uh},Hh={class:"unione-props-setting data-field-setting"},Kh={key:0},Qh=["onClick"],Gh={class:"field-txt"},Yh=["onClick"],Xh={key:1,class:"field-txt"},Jh=["onClick"],Zh={key:0,class:"field-txt"},ef={key:3,class:"edit-field"},tf=["onClick"],nf=ne(i.defineComponent({__name:"dataFieldSetting",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=i.ref([qh()]),t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:g})=>g+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"form",key:"form",width:"40px",align:"center"},{title:"详情",dataIndex:"view",key:"view",width:"40px",align:"center"},{title:"列表",dataIndex:"list",key:"list",width:"40px",align:"center"},{title:"排序",dataIndex:"sort",key:"sort",width:"40px",align:"center"},{title:"查询",dataIndex:"query",key:"query",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),n=i.useModel(o,"modelValue"),l={mounted:g=>g.focus()},s=i.ref({});function a(){const g=Object.keys(s.value);if(g.length)for(let p in g){const N=n.value.filter(V=>V.name==p);if(N&&N[0]){let V=s.value[p];Object.keys(V).forEach(C=>{C=="convertName"?(N[0].convert||(N[0].convert={}),N[0].convert.type=V[C]):N[0][C]=V[C]})}}s.value={}}function r(g,p){a();const N={};p=="convertName"?(g.convert||(g.convert={}),N[p]=g.convert?.type):N[p]=g[p]||"",s.value[g.name]=N}function d(g,p){{s.value={};return}}function h(g,p){switch(p){case"query":return g.configs?.query?.enable;case"form":return g.configs?.show?.form?.enable;case"view":return g.configs?.show?.view?.enable;case"list":return g.configs?.show?.list?.enable;case"sort":return g.configs?.sort?.enable}}function f(g,p){switch(p){case"query":g.configs=K.utils.obj.ext(g.configs,{query:{enable:!1}}),g.configs.query.enable=!g.configs.query.enable;break;case"form":g.configs=K.utils.obj.ext(g.configs,{show:{form:{enable:!1}}}),g.configs.show.form.enable=!g.configs.show.form.enable;break;case"view":g.configs=K.utils.obj.ext(g.configs,{show:{view:{enable:!1}}}),g.configs.show.view.enable=!g.configs.show.view.enable;break;case"list":g.configs=K.utils.obj.ext(g.configs,{show:{list:{enable:!1}}}),g.configs.show.list.enable=!g.configs.show.list.enable;break;case"sort":g.configs=K.utils.obj.ext(g.configs,{sort:{enable:!1}}),g.configs.sort.enable=!g.configs.sort.enable;break}console.log("record.configs",g.configs)}const c=i.ref({title:"列头设置",prop:"list",visible:!1,field:{},show:{},toSetting:()=>{c.value.visible=!1}});function u(g,p){switch(c.value.prop=p,c.value.field=g,g.configs||(g.configs={}),g.configs.show||(g.configs.show={}),p){case"query":g.configs.query||(g.configs.query={}),g.configs.query.types||(g.configs.query.types="EQ"),c.value.show=g.configs.query,c.value.title=`查询设置/${g.title}(${g.name})`;break;case"form":g.configs.show.form||(g.configs.show.form={}),c.value.show=g.configs.show.form,c.value.title=`表单设置/${g.title}(${g.name})`;break;case"view":g.configs.show.view||(g.configs.show.view={}),c.value.show=g.configs.show.view,c.value.title=`详情设置/${g.title}(${g.name})`;break;case"list":g.configs.show.list||(g.configs.show.list={}),c.value.show=g.configs.show.list,c.value.title=`列头设置/${g.title}(${g.name})`;break;case"sort":g.configs.sort||(g.configs.sort={}),c.value.show=g.configs.sort,c.value.title=`排序设置/${g.title}(${g.name})`;break}c.value.visible=!0}const m=i.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:g=>{const p=m.value.options.filter(N=>N.value==g);return p[0]?p[0].label:g}}),b=i.ref({visible:!1,field:{},props:{},advances:Wh.loadAdvances(),showInfo:g=>{let p=0;if(g.configs?.rule){const N=g.configs.rule;N.advance&&p++,typeof N.rangeMin<"u"&&p++,typeof N.rangeMax<"u"&&p++,typeof N.regExpress<"u"&&p++}if(p>0)return"("+p+")"},toSetting:()=>{const g=b.value.props;b.value.field.configs=K.utils.obj.ext(b.value.field.configs,{rule:{...g}}),b.value.visible=!1,b.value.props={}}});function y(g){b.value.visible=!0,b.value.field=g,b.value.props=g.configs?.rule||{}}const k=i.ref({visible:!1,field:{},widget:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-input-number",label:"数值框"},{value:"unione-check-box",label:"多选框"},{value:"unione-radio-box",label:"单选框"},{value:"unione-switch-box",label:"开关"},{value:"unione-select-box",label:"下拉框"},{value:"unione-tree-box",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-slider",label:"滑块"},{value:"a-textarea",label:"文本域"}],widgetName:g=>{const p=g.configs?.widget?.name,N=k.value.widgets.filter(V=>V.value==p);return N[0]?N[0].label:p},toSetting:(g,p)=>{g.configs||(g.configs={}),g.configs.widget||(g.configs.widget={}),g.configs.widget.name=p},toclose:()=>{k.value.visible=!1}});function v(g){k.value.field=g,g.configs=K.utils.obj.ext(g.configs,{widget:{props:{}}}),k.value.widget=g.configs.widget,k.value.visible=!0}const w=i.ref({visible:!1,field:{},convert:{},types:[{value:"dict",label:"字典"},{value:"option",label:"静态"},{value:"dbtable",label:"数据集"},{value:"remote",label:"远程接口"},{value:"local",label:"本地接口"}],optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],getTypes:(g,p="--")=>w.value.types.filter(N=>N.value==g)[0]?.label||p,toAddOption:()=>{w.value.convert.options||(w.value.convert.options=[]),w.value.convert.options.push({label:"",value:""})},toDelOption:(g,p)=>{w.value.convert.options.splice(g,1)},toSetting:()=>{w.value.visible=!1}});function O(g){w.value.visible=!0,w.value.field=g,g.configs||(g.configs={}),g.configs.convert||(g.configs.convert={}),w.value.convert=g.configs.convert}return(g,p)=>{const N=i.resolveComponent("ToolOutlined"),V=i.resolveComponent("a-button"),C=i.resolveComponent("a-select"),x=i.resolveComponent("a-checkbox"),S=i.resolveComponent("a-table"),M=i.resolveComponent("a-switch"),T=i.resolveComponent("a-form-item"),E=i.resolveComponent("a-select-option"),I=i.resolveComponent("a-input-number"),L=i.resolveComponent("a-form"),A=i.resolveComponent("a-modal"),U=i.resolveComponent("a-input"),P=i.resolveComponent("unione-select-box"),G=i.resolveComponent("a-checkbox-group"),j=i.resolveComponent("unione-section");return i.openBlock(),i.createElementBlock("div",Hh,[i.createVNode(S,{columns:t.value,"data-source":n.value,bordered:"",scroll:{x:1e3},pagination:!0,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:B})=>[["widget","queryType","rules","convertName"].includes(B.key)?(i.openBlock(),i.createElementBlock("span",Kh,[i.createVNode(N),i.createTextVNode(" "+i.toDisplayString(B.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:B,text:F,record:_})=>[["rules"].includes(B.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",!b.value.showInfo(_)&&"empty"]),onClick:D=>y(_)},[i.createElementVNode("span",Gh,i.toDisplayString(b.value.showInfo(_)),1),b.value.showInfo(_)?(i.openBlock(),i.createBlock(V,{key:0,type:"link"},{default:i.withCtx(()=>p[50]||(p[50]=[i.createTextVNode("设置")])),_:1})):i.createCommentVNode("",!0)],10,Qh)):["widget"].includes(B.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!s.value[_.name]||!Object.keys(s.value[_.name]).includes(B.dataIndex))&&!F&&"empty"]),onClick:D=>r(_,B.dataIndex)},[s.value[_.name]&&Object.keys(s.value[_.name]).includes(B.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(C,{key:0,value:_.configs?.widget?.name,allowClear:!0,options:k.value.widgets,onChange:D=>k.value.toSetting(_,D),onBlur:p[0]||(p[0]=D=>d())},null,8,["value","options","onChange"])),[[l]]):(i.openBlock(),i.createElementBlock("span",Xh,i.toDisplayString(k.value.widgetName(_)),1)),i.createVNode(V,{type:"link",onClick:i.withModifiers(D=>v(_),["stop"])},{default:i.withCtx(()=>p[51]||(p[51]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])],10,Yh)):["convertName"].includes(B.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!s.value[_.name]||!Object.keys(s.value[_.name]).includes(B.dataIndex))&&!_.convert?.type&&"empty"]),onClick:D=>O(_)},[_.configs?.convert?.types?(i.openBlock(),i.createElementBlock("span",Zh,i.toDisplayString(w.value.getTypes(_.configs.convert.types)),1)):i.createCommentVNode("",!0)],10,Jh)):["query","form","view","list","sort"].includes(B.dataIndex)?(i.openBlock(),i.createElementBlock("div",ef,[i.createVNode(x,{checked:h(_,B.dataIndex),onClick:D=>f(_,B.dataIndex)},null,8,["checked","onClick"]),i.createVNode(V,{type:"link",onClick:D=>u(_,B.dataIndex)},{default:i.withCtx(()=>p[52]||(p[52]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(A,{visible:c.value.visible,"onUpdate:visible":p[14]||(p[14]=B=>c.value.visible=B),width:600,title:c.value.title,onOk:c.value.toSetting},{default:i.withCtx(()=>[i.createVNode(L,{model:c.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:i.normalizeClass(["field-setting-form","form-mix",c.value.prop])},{default:i.withCtx(()=>[i.createVNode(T,{label:"启用状态"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.show.enable,"onUpdate:checked":p[1]||(p[1]=B=>c.value.show.enable=B),checkedChildren:"启用",unCheckedChildren:"停用"},null,8,["checked"])]),_:1}),c.value.prop=="sort"?(i.openBlock(),i.createBlock(T,{key:0,label:"默认排序"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.show.defoult,"onUpdate:checked":p[2]||(p[2]=B=>c.value.show.defoult=B),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),c.value.prop=="sort"?(i.openBlock(),i.createBlock(T,{key:1,label:"排序方式"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.show.asc,"onUpdate:checked":p[3]||(p[3]=B=>c.value.show.asc=B),checkedChildren:"升序",unCheckedChildren:"降序"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),c.value.prop=="query"&&c.value.show.types=="ADVANCE"?(i.openBlock(),i.createBlock(T,{key:2,label:"高级查询"})):i.createCommentVNode("",!0),c.value.prop=="query"?(i.openBlock(),i.createBlock(T,{key:3,label:"默认查询",tooltip:"开启后该字段加入关键字查询"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.show.defoult,"onUpdate:checked":p[4]||(p[4]=B=>c.value.show.defoult=B),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),c.value.prop=="query"?(i.openBlock(),i.createBlock(T,{key:4,label:"默认显示",tooltip:"开启后,在查询表单中默认显示该查询字段"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.show.visible,"onUpdate:checked":p[5]||(p[5]=B=>c.value.show.visible=B),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),c.value.prop=="query"?(i.openBlock(),i.createBlock(T,{key:5,label:"查询方式"},{default:i.withCtx(()=>[i.createVNode(C,{value:c.value.show.types,"onUpdate:value":p[6]||(p[6]=B=>c.value.show.types=B)},{default:i.withCtx(()=>[i.createVNode(E,{key:"EQ",value:"EQ"},{default:i.withCtx(()=>p[53]||(p[53]=[i.createTextVNode("精确查询")])),_:1}),i.createVNode(E,{key:"LIKE",value:"LIKE"},{default:i.withCtx(()=>p[54]||(p[54]=[i.createTextVNode("模糊查询")])),_:1}),i.createVNode(E,{key:"LLIKE",value:"LLIKE"},{default:i.withCtx(()=>p[55]||(p[55]=[i.createTextVNode("左模糊")])),_:1}),i.createVNode(E,{key:"RLIKE",value:"RLIKE"},{default:i.withCtx(()=>p[56]||(p[56]=[i.createTextVNode("右模糊")])),_:1}),i.createVNode(E,{key:"RANGE",value:"RANGE"},{default:i.withCtx(()=>p[57]||(p[57]=[i.createTextVNode("范围查询")])),_:1}),i.createVNode(E,{key:"ADVANCE",value:"ADVANCE"},{default:i.withCtx(()=>p[58]||(p[58]=[i.createTextVNode("高级查询")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0),["query","sort"].includes(c.value.prop)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(T,{key:6,label:"显示顺序",tooltip:"默认根据字段顺序显示,若需调整字段显示顺序,可以通过这里设置!"},{default:i.withCtx(()=>[i.createVNode(I,{value:c.value.show.index,"onUpdate:value":p[7]||(p[7]=B=>c.value.show.index=B)},null,8,["value"])]),_:1})),["form","view"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:7,label:"显示宽度",tooltip:"字段显示宽度,0-24,设置成0,根据表单默认配置"},{default:i.withCtx(()=>[i.createVNode(I,{min:0,max:24,value:c.value.show.width,"onUpdate:value":p[8]||(p[8]=B=>c.value.show.width=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["list"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:8,label:"显示宽度",tooltip:"字段显示宽度"},{default:i.withCtx(()=>[i.createVNode(I,{min:0,value:c.value.show.width,"onUpdate:value":p[9]||(p[9]=B=>c.value.show.width=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["form","view"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:9,label:"标题宽度",tooltip:"表单title部分显示宽度,0-24"},{default:i.withCtx(()=>[i.createVNode(I,{min:0,max:24,value:c.value.show.labelWidth,"onUpdate:value":p[10]||(p[10]=B=>c.value.show.labelWidth=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["form","view"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:10,label:"控件宽度",tooltip:"表单组件部分显示宽度,0-24"},{default:i.withCtx(()=>[i.createVNode(I,{min:0,max:24,value:c.value.show.valueWidth,"onUpdate:value":p[11]||(p[11]=B=>c.value.show.valueWidth=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["list"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:11,label:"固定位置"},{default:i.withCtx(()=>[i.createVNode(C,{value:c.value.show.fixed,"onUpdate:value":p[12]||(p[12]=B=>c.value.show.fixed=B),allowClear:"",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["list"].includes(c.value.prop)?(i.openBlock(),i.createBlock(T,{key:12,label:"对齐方式"},{default:i.withCtx(()=>[i.createVNode(C,{value:c.value.show.align,"onUpdate:value":p[13]||(p[13]=B=>c.value.show.align=B),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model","class"])]),_:1},8,["visible","title","onOk"]),i.createVNode(A,{visible:w.value.visible,"onUpdate:visible":p[33]||(p[33]=B=>w.value.visible=B),width:600,title:w.value.getTypes(w.value.convert.types,"转换")+"设置",onOk:w.value.toSetting},{default:i.withCtx(()=>[i.createVNode(L,{model:w.value.convert,name:"basic","label-col":{span:5},"wrapper-col":{span:17},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(T,{label:"转换类型"},{default:i.withCtx(()=>[i.createVNode(C,{value:w.value.convert.types,"onUpdate:value":p[15]||(p[15]=B=>w.value.convert.types=B),allowClear:!0,options:w.value.types},null,8,["value","options"])]),_:1}),["unione-select-box","unione-tree-box"].includes(w.value.field.widget?.name)?(i.openBlock(),i.createBlock(T,{key:0,label:"是否搜索"},{default:i.withCtx(()=>[i.createVNode(M,{checked:c.value.convert.search,"onUpdate:checked":p[16]||(p[16]=B=>c.value.convert.search=B),checkedChildren:"启用",unCheckedChildren:"停用"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="option"?(i.openBlock(),i.createBlock(T,{key:1,label:"选项设置"},{default:i.withCtx(()=>[i.createVNode(V,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:w.value.toAddOption},{default:i.withCtx(()=>p[59]||(p[59]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode(S,{columns:w.value.optionColumn,"data-source":w.value.convert.options,size:"small"},{bodyCell:i.withCtx(({column:B,record:F,index:_})=>[B.dataIndex==="label"?(i.openBlock(),i.createBlock(U,{key:0,value:F.label,"onUpdate:value":D=>F.label=D,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),B.dataIndex==="value"?(i.openBlock(),i.createBlock(U,{key:1,value:F.value,"onUpdate:value":D=>F.value=D,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),B.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:2,onClick:D=>w.value.toDelOption(_,F)},"删除",8,tf)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1})):i.createCommentVNode("",!0),["dbtable","remote"].includes(w.value.convert.types)?(i.openBlock(),i.createBlock(T,{key:2,label:"数据源"},{default:i.withCtx(()=>[i.createVNode(P,{value:w.value.convert.dsId,"onUpdate:value":p[17]||(p[17]=B=>w.value.convert.dsId=B),convert:{types:"local",url:"/api/data/source/find",search:!0}},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:3,label:"table名称"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableName,"onUpdate:value":p[18]||(p[18]=B=>w.value.convert.tableName=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:4,label:"table名称"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableName,"onUpdate:value":p[19]||(p[19]=B=>w.value.convert.tableName=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"&&["unione-tree-box"].includes(w.value.field.widget?.name)?(i.openBlock(),i.createBlock(T,{key:5,label:"主键字段"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.idField,"onUpdate:value":p[20]||(p[20]=B=>w.value.convert.idField=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"&&["unione-tree-box"].includes(w.value.field.widget?.name)?(i.openBlock(),i.createBlock(T,{key:6,label:"父级字段"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.pidField,"onUpdate:value":p[21]||(p[21]=B=>w.value.convert.pidField=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:7,label:"value字段"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.valueField,"onUpdate:value":p[22]||(p[22]=B=>w.value.convert.valueField=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:8,label:"label字段"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.labelField,"onUpdate:value":p[23]||(p[23]=B=>w.value.convert.labelField=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:9,label:"扩展字段",tooltip:"默认只加载value,label字段,可以通过该属性加载其他更多字段,多个字段用逗号分隔"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableField,"onUpdate:value":p[24]||(p[24]=B=>w.value.convert.tableField=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:10,label:"数据过滤",tooltip:"支持数据条件过滤,eg:sex=1"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableWhere,"onUpdate:value":p[25]||(p[25]=B=>w.value.convert.tableWhere=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:11,label:"数据排序",tooltip:"设置数据进行排序方式,eg:age desc"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableOrder,"onUpdate:value":p[26]||(p[26]=B=>w.value.convert.tableOrder=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:12,label:"数据排序",tooltip:"设置数据进行排序方式,eg:age desc"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.tableOrder,"onUpdate:value":p[27]||(p[27]=B=>w.value.convert.tableOrder=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:13,label:"异步加载"},{default:i.withCtx(()=>[i.createVNode(M,{checked:w.value.convert.isAsync,"onUpdate:checked":p[28]||(p[28]=B=>w.value.convert.isAsync=B),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dbtable"?(i.openBlock(),i.createBlock(T,{key:14,label:"分页加载"},{default:i.withCtx(()=>[i.createVNode(M,{checked:w.value.convert.isPaging,"onUpdate:checked":p[29]||(p[29]=B=>w.value.convert.isPaging=B),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),w.value.convert.types=="dict"?(i.openBlock(),i.createBlock(T,{key:15,label:"字典名称"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.dictName,"onUpdate:value":p[30]||(p[30]=B=>w.value.convert.dictName=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["local","remote"].includes(w.value.convert.types)?(i.openBlock(),i.createBlock(T,{key:16,label:"接口地址",tooltip:"统一使用POST请求,json提交,标准结构:{body:{参数}}"},{default:i.withCtx(()=>[i.createVNode(U,{value:w.value.convert.url,"onUpdate:value":p[31]||(p[31]=B=>w.value.convert.url=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["local","remote"].includes(w.value.convert.types)?(i.openBlock(),i.createBlock(T,{key:17,label:"接口参数",tooltip:"标准json对象/数组,直接使用该参数进行接口请求,请求确保结构和接口匹配!"},{default:i.withCtx(()=>[i.createVNode(i.unref(Lt.Codemirror),{modelValue:w.value.convert.params,"onUpdate:modelValue":p[32]||(p[32]=B=>w.value.convert.params=B),placeholder:"接口请求参数,eg:{sex:1}",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:e.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),i.createVNode(A,{visible:k.value.visible,"onUpdate:visible":p[40]||(p[40]=B=>k.value.visible=B),width:600,title:"控件设置",onOk:k.value.toclose},{default:i.withCtx(()=>[i.createVNode(L,{model:k.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(T,{label:"组件类型"},{default:i.withCtx(()=>[i.withDirectives(i.createVNode(C,{value:k.value.widget.name,"onUpdate:value":p[34]||(p[34]=B=>k.value.widget.name=B),allowClear:!0,options:k.value.widgets},null,8,["value","options"]),[[l]])]),_:1}),i.createVNode(T,{label:"输入提示"},{default:i.withCtx(()=>[i.createVNode(U,{value:k.value.widget.placeholder,"onUpdate:value":p[35]||(p[35]=B=>k.value.widget.placeholder=B)},null,8,["value"])]),_:1}),i.createVNode(T,{label:"帮助说明"},{default:i.withCtx(()=>[i.createVNode(U,{value:k.value.widget.help,"onUpdate:value":p[36]||(p[36]=B=>k.value.widget.help=B)},null,8,["value"])]),_:1}),i.createVNode(T,{label:"提示文本"},{default:i.withCtx(()=>[i.createVNode(U,{value:k.value.widget.tooltip,"onUpdate:value":p[37]||(p[37]=B=>k.value.widget.tooltip=B)},null,8,["value"])]),_:1}),["a-date-picker"].includes(k.value.widget.name)?(i.openBlock(),i.createBlock(T,{key:0,label:"显示格式"},{default:i.withCtx(()=>[i.createVNode(U,{value:k.value.field.dataFormat,"onUpdate:value":p[38]||(p[38]=B=>k.value.field.dataFormat=B)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),k.value.widget.name=="unione-select-box"?(i.openBlock(),i.createBlock(T,{key:1,label:"下拉框类型"},{default:i.withCtx(()=>[i.createVNode(C,{value:k.value.widget.props.mode,"onUpdate:value":p[39]||(p[39]=B=>k.value.widget.props.mode=B),allowClear:!0},{default:i.withCtx(()=>[i.createVNode(E,{value:"multiple"},{default:i.withCtx(()=>p[60]||(p[60]=[i.createTextVNode("多选")])),_:1}),i.createVNode(E,{value:"tags"},{default:i.withCtx(()=>p[61]||(p[61]=[i.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(A,{visible:b.value.visible,"onUpdate:visible":p[49]||(p[49]=B=>b.value.visible=B),width:600,title:"规则设置",onOk:b.value.toSetting},{default:i.withCtx(()=>[i.createVNode(L,{model:b.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(j,{title:"基本设置",type:"line"},{default:i.withCtx(()=>[i.createVNode(T,{label:"触发时机"},{default:i.withCtx(()=>[i.createVNode(G,{value:b.value.props.trigger,"onUpdate:value":p[41]||(p[41]=B=>b.value.props.trigger=B),options:["change","blur"]},null,8,["value"])]),_:1}),b.value.field.isNull?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(T,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:i.withCtx(()=>[i.createVNode(x,{checked:b.value.props.whitespace,"onUpdate:checked":p[42]||(p[42]=B=>b.value.props.whitespace=B)},{default:i.withCtx(()=>p[62]||(p[62]=[i.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["checked"])]),_:1})),i.createVNode(T,{label:"预设类型"},{default:i.withCtx(()=>[i.createVNode(C,{options:b.value.advances,fieldNames:{label:"title",value:"name"},value:b.value.props.advance,"onUpdate:value":p[43]||(p[43]=B=>b.value.props.advance=B)},null,8,["options","value"])]),_:1})]),_:1}),["Long","Short","Integer","Float","Double"].includes(b.value.field.dataType)?(i.openBlock(),i.createBlock(j,{key:0,title:"数值验证",type:"line"},{default:i.withCtx(()=>[i.createVNode(T,{label:"有效区间"},{default:i.withCtx(()=>[i.createVNode(I,{value:b.value.props.rangeMin,"onUpdate:value":p[44]||(p[44]=B=>b.value.props.rangeMin=B)},null,8,["value"]),p[63]||(p[63]=i.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),i.createVNode(I,{value:b.value.props.rangeMax,"onUpdate:value":p[45]||(p[45]=B=>b.value.props.rangeMax=B)},null,8,["value"])]),_:1}),i.createVNode(T,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(U,{value:b.value.props.rangeMessage,"onUpdate:value":p[46]||(p[46]=B=>b.value.props.rangeMessage=B)},null,8,["value"])]),_:1})]),_:1})):i.createCommentVNode("",!0),i.createVNode(j,{title:"正则验证",type:"line"},{default:i.withCtx(()=>[i.createVNode(T,{label:"表达式"},{default:i.withCtx(()=>[i.createVNode(U,{value:b.value.props.regExpress,"onUpdate:value":p[47]||(p[47]=B=>b.value.props.regExpress=B)},null,8,["value"])]),_:1}),i.createVNode(T,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(U,{value:b.value.props.regMessage,"onUpdate:value":p[48]||(p[48]=B=>b.value.props.regMessage=B)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-d5938ab8"]]),lf={class:"unione-props-setting data-field-fkey"},sf={key:0},of=["onClick"],af=["onClick"],rf=["onClick"],df=["onClick"],cf=["onClick"],hf=["onClick"],ff=["onClick"],uf=["onClick"],pf=ne(i.defineComponent({__name:"dataFieldFKeys",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=K.useDialog(),t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:u})=>u+1},{title:"字段名称",dataIndex:"name",key:"name",width:"100px",fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"100px",fixed:"left",align:"center"},{title:"关联数据名称",dataIndex:"dsnName",key:"dsnName",width:"120px",align:"center"},{title:"关联数据标题",dataIndex:"dsnTitle",key:"dsnTitle",width:"150px",align:"center"},{title:"关联字段",dataIndex:"fieldName",key:"fieldName",width:"100px",align:"center"},{title:"显示字段",dataIndex:"labelName",key:"labelName",width:"120px",align:"center"}]),n=i.useModel(o,"modelValue"),l=i.computed(()=>n.value.filter(u=>u.configs?.fkey?.enable)||[]),s=i.ref({});function a(){s.value={}}function r(u,m){a();const b={};b[m]=u.configs.fkey[m]||"",s.value[u.name]=b}function d(u,m,b){u.configs.fkey.dsn=m,u.configs.fkey.dsnName=b.name,u.configs.fkey.dsnTitle=b.title,u.configs.fkey.dsnId=b.id}function h(u,m,b,y){u.configs.fkey[m]=b,m=="fieldName"&&(u.configs.fkey.fieldTitle=y.title),m=="labelName"&&(u.configs.fkey.labelTitle=y.title)}function f(u){c.value.record=u,c.value.visible=!0,c.value.fields=u.configs?.fkey?.fields||[]}const c=i.ref({visible:!1,record:null,editField:{},fields:[],columns:[{title:"字段名称",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"显示宽度",dataIndex:"width",key:"width",width:"60px",align:"center"},{title:"显示顺序",dataIndex:"index",key:"index",width:"60px",align:"center"},{title:"操作",dataIndex:"action",key:"action",width:"60px",align:"center"}],toEditField:(u,m)=>{c.value.editField[u]=m},onShowFieldChange:(u,m,b)=>{u.name=b.name,u.title=b.title},toAddField:()=>{c.value.fields.push({name:"",title:""}),c.value.editField[c.value.fields.length-1]="title"},toDelField:u=>{e.confirm({content:"确定要删除该字段么?",onOk:()=>{c.value.fields.splice(u,1)}})},toSetting:()=>{c.value.visible=!1,c.value.record.configs=K.utils.obj.ext(c.value.record.configs,{fkey:{fields:c.value.fields}})}});return(u,m)=>{const b=i.resolveComponent("FormOutlined"),y=i.resolveComponent("unione-select-box"),k=i.resolveComponent("a-button"),v=i.resolveComponent("a-table"),w=i.resolveComponent("a-input-number"),O=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",lf,[i.createVNode(v,{columns:t.value,"data-source":l.value,bordered:"","row-key":"name",size:"small",pagination:!1},{headerCell:i.withCtx(({column:g})=>[["dsnName","dsnTitle","fieldName","labelName"].includes(g.key)?(i.openBlock(),i.createElementBlock("span",sf,[i.createVNode(b),i.createTextVNode(" "+i.toDisplayString(g.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:g,record:p})=>[["dsnName"].includes(g.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!s.value[p.name]||!Object.keys(s.value[p.name]).includes(g.dataIndex))&&!p.configs?.fkey?.dsnName&&"empty"]),onClick:N=>r(p,g.dataIndex)},[s.value[p.name]&&Object.keys(s.value[p.name]).includes(g.dataIndex)?(i.openBlock(),i.createBlock(y,{key:0,value:s.value[p.name][g.dataIndex],"onUpdate:value":N=>s.value[p.name][g.dataIndex]=N,convert:{types:"local",url:"/api/data/define/find",valueField:"sn",labelField:"name",search:!0},onBlur:a,onSelect:(N,V)=>d(p,N,V)},null,8,["value","onUpdate:value","onSelect"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(p.configs?.fkey?.dsnName),1)],64))],10,of)):["dsnTitle"].includes(g.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!s.value[p.name]||!Object.keys(s.value[p.name]).includes(g.dataIndex))&&!p.configs?.fkey?.dsnTitle&&"empty"]),onClick:N=>r(p,g.dataIndex)},[s.value[p.name]&&Object.keys(s.value[p.name]).includes(g.dataIndex)?(i.openBlock(),i.createBlock(y,{key:0,value:s.value[p.name][g.dataIndex],"onUpdate:value":N=>s.value[p.name][g.dataIndex]=N,convert:{types:"local",url:"/api/data/define/find",valueField:"sn",labelField:"title",search:!0},onBlur:a,onSelect:(N,V)=>d(p,N,V)},null,8,["value","onUpdate:value","onSelect"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(p.configs?.fkey?.dsnTitle),1)],64))],10,af)):i.createCommentVNode("",!0),["fieldName"].includes(g.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!s.value[p.name]||!Object.keys(s.value[p.name]).includes(g.dataIndex))&&!p.configs?.fkey?.fieldName&&"empty"]),onClick:N=>r(p,g.dataIndex)},[s.value[p.name]&&p.configs?.fkey?.dsn&&Object.keys(s.value[p.name]).includes(g.dataIndex)?(i.openBlock(),i.createBlock(y,{key:0,value:s.value[p.name][g.dataIndex],"onUpdate:value":N=>s.value[p.name][g.dataIndex]=N,convert:{types:"local",url:"/api/data/field/find",params:{body:{defineId:p.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:a,onSelect:(N,V)=>h(p,"fieldName",N,V)},null,8,["value","onUpdate:value","convert","onSelect"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(p.configs?.fkey?.fieldTitle),1)],64))],10,rf)):["labelName"].includes(g.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:3,class:i.normalizeClass(["edit-field",(!s.value[p.name]||!Object.keys(s.value[p.name]).includes(g.dataIndex))&&!p.configs?.fkey?.labelName&&"empty"]),onClick:N=>r(p,g.dataIndex)},[s.value[p.name]&&p.configs?.fkey?.dsn&&Object.keys(s.value[p.name]).includes(g.dataIndex)?(i.openBlock(),i.createBlock(y,{key:0,value:s.value[p.name][g.dataIndex],"onUpdate:value":N=>s.value[p.name][g.dataIndex]=N,convert:{types:"local",url:"/api/data/field/find",params:{body:{defineId:p.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:a,onSelect:(N,V)=>h(p,"labelName",N,V)},null,8,["value","onUpdate:value","convert","onSelect"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(p.configs?.fkey?.labelTitle)+" ",1),p.configs?.fkey?.labelName?(i.openBlock(),i.createBlock(k,{key:0,type:"link",onClick:i.withModifiers(N=>f(p),["stop"])},{default:i.withCtx(()=>m[4]||(m[4]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])):i.createCommentVNode("",!0)],64))],10,df)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(O,{visible:c.value.visible,"onUpdate:visible":m[3]||(m[3]=g=>c.value.visible=g),width:600,title:"更多显示字段",class:"data-field-fkey",onOk:c.value.toSetting},{default:i.withCtx(()=>[i.createVNode(k,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:c.value.toAddField},{default:i.withCtx(()=>m[5]||(m[5]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode(v,{columns:c.value.columns,"data-source":c.value.fields,size:"small"},{bodyCell:i.withCtx(({column:g,record:p,index:N,text:V})=>[g.dataIndex==="title"?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",c.value.editField!="title"&&!V&&"empty"]),onClick:C=>c.value.toEditField(N,g.dataIndex)},[c.value.editField[N]=="title"?(i.openBlock(),i.createBlock(y,{key:0,value:p[p.dataIndex],"onUpdate:value":C=>p[p.dataIndex]=C,convert:{types:"local",url:"/api/data/field/find",search:!0,params:{body:{defineId:c.value.record.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:m[0]||(m[0]=C=>c.value.editField={}),onSelect:(C,x)=>c.value.onShowFieldChange(p,C,x)},null,8,["value","onUpdate:value","convert","onSelect"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(V),1)],64))],10,cf)):i.createCommentVNode("",!0),g.dataIndex==="width"?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",c.value.editField!="width"&&!V&&"empty"]),onClick:C=>c.value.toEditField(N,g.dataIndex)},[c.value.editField[N]=="width"?(i.openBlock(),i.createBlock(w,{key:0,onBlur:m[1]||(m[1]=C=>c.value.editField={}),value:p.width,"onUpdate:value":C=>p.width=C,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(V),1)],64))],10,hf)):i.createCommentVNode("",!0),g.dataIndex==="index"?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",c.value.editField!="wiindexdth"&&!V&&"empty"]),onClick:C=>c.value.toEditField(N,g.dataIndex)},[c.value.editField[N]=="index"?(i.openBlock(),i.createBlock(w,{key:0,onBlur:m[2]||(m[2]=C=>c.value.editField={}),value:p.index,"onUpdate:value":C=>p.index=C,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(V),1)],64))],10,ff)):i.createCommentVNode("",!0),g.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:3,onClick:C=>c.value.toDelField(N)},"删除",8,uf)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-84143692"]]),mf={class:"unione-props-setting data-filter"},gf={class:"title"},kf={class:"name"},bf={class:"action"},yf=ne(i.defineComponent({__name:"dataFilters",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(o){const e=K.useDialog(),t=i.useModel(o,"modelValue");function n(){r.value.visible=!0,r.value.filter={},r.value.name=null}function l(h){r.value.visible=!0,r.value.filter={...h},r.value.name=h.name}function s(h){e.confirm({content:"确定要删除该过滤对象么?",onOk:()=>{t.value.splice(h,1)}})}const a=i.ref(),r=i.ref({visible:!1,name:null,filter:{},rules:{title:[{required:!0,message:"过滤标题不能为空"}],name:[{required:!0,message:"过滤名称不能为空"}],filter:[{required:!0,message:"过滤脚本不能为空"}]},toSetting:()=>{a.value.validate().then(h=>{if(r.value.name){const f=t.value.filter(c=>c.name==r.value.name)[0];if(!f){e.error({content:"过滤记录未找到"});return}if(r.value.name!=r.value.filter.name&&t.value.filter(u=>u.name==r.value.filter.name).length){e.error({content:"过滤名称已存在!"});return}Object.keys(h).forEach(c=>{f[c]=h[c]})}else{if(t.value.filter(c=>c.name==r.value.filter.name).length){e.error({content:"过滤名称已存在!"});return}t.value.push(h)}r.value.visible=!1})}});function d(){const h=[];r.value.filter.filter||(r.value.filter.filter=""),h.push("-- @if(isNotEmpty(params."),h.push(r.value.filter.name||"xxx"),h.push(") && !isBlank(params."),h.push(r.value.filter.name||"xxx"),h.push(`)
11
- `),h.push(" AND XXX=#{params."),h.push(r.value.filter.name||"xxx"),h.push(`}
12
- `),h.push(`-- @}
13
- `),r.value.filter.filter=r.value.filter.filter+h.join("")}return(h,f)=>{const c=i.resolveComponent("a-button"),u=i.resolveComponent("a-card"),m=i.resolveComponent("PlusOutlined"),b=i.resolveComponent("a-empty"),y=i.resolveComponent("a-input"),k=i.resolveComponent("a-form-item"),v=i.resolveComponent("a-textarea"),w=i.resolveComponent("a-tag"),O=i.resolveComponent("a-form"),g=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",mf,[(t.value.length,i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.value,(p,N)=>(i.openBlock(),i.createBlock(u,{class:"filter-box",size:"small",key:N},{default:i.withCtx(()=>[i.createElementVNode("div",gf,"过滤标题:"+i.toDisplayString(p.title),1),i.createElementVNode("div",kf,"过滤名称:"+i.toDisplayString(p.name),1),i.createElementVNode("div",bf,[i.createVNode(c,{size:"small",onClick:V=>l(p)},{default:i.withCtx(()=>f[4]||(f[4]=[i.createTextVNode("编辑")])),_:2},1032,["onClick"]),i.createVNode(c,{danger:"",size:"small",onClick:V=>s(N)},{default:i.withCtx(()=>f[5]||(f[5]=[i.createTextVNode("删除")])),_:2},1032,["onClick"])])]),_:2},1024))),128)),i.createVNode(u,{class:"filter-box btn-add",size:"small",onClick:n},{default:i.withCtx(()=>[i.createVNode(m,{class:"btn"})]),_:1})],64)),i.createVNode(g,{visible:r.value.visible,"onUpdate:visible":f[3]||(f[3]=p=>r.value.visible=p),width:600,title:"设置数据过滤",class:"data-filter",onOk:r.value.toSetting},{default:i.withCtx(()=>[i.createVNode(O,{ref_key:"filterForm",ref:a,model:r.value.filter,rules:r.value.rules,name:"basic","label-col":{span:4},"wrapper-col":{span:18},class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(k,{label:"过滤标题",name:"title"},{default:i.withCtx(()=>[i.createVNode(y,{value:r.value.filter.title,"onUpdate:value":f[0]||(f[0]=p=>r.value.filter.title=p)},null,8,["value"])]),_:1}),i.createVNode(k,{label:"过滤名称",name:"name"},{default:i.withCtx(()=>[i.createVNode(y,{value:r.value.filter.name,"onUpdate:value":f[1]||(f[1]=p=>r.value.filter.name=p)},null,8,["value"])]),_:1}),i.createVNode(k,{label:"过滤脚本",name:"filter",tooltip:"使用beetsql语法,参数获取方式params.xxx,判断参数是否为空isNotEmpty(params.xxx) && !isBlank(params.xxx)"},{default:i.withCtx(()=>[i.createVNode(v,{value:r.value.filter.filter,"onUpdate:value":f[2]||(f[2]=p=>r.value.filter.filter=p),autosize:{minRows:10},style:{"padding-top":"20px"}},null,8,["value"]),i.createVNode(w,{class:"btn-tmpl",color:"blue",onClick:d},{default:i.withCtx(()=>f[6]||(f[6]=[i.createTextVNode("插入模版")])),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-a600b93f"]]),wf={class:"unione-page form-page data-define-edit"},xf={class:"actions"},vf=ne(i.defineComponent({__name:"edit",setup(o){const e=K.useDialog(),t=i.inject("route"),n=i.inject("router"),l=i.ref(),s=i.ref({isPrimary:!1,fields:[{title:"数据类型",name:"category",control:"unione-select-box",value:"sql",convert:{types:"dict",dictName:"DATACATEGORY"}},{title:"数据源",name:"dsId",control:"unione-select-box",convert:{types:"local",url:"/api/data/source/find",search:!0},props:{required:!0}},{title:"自定义",name:"isCustom",control:"unione-switch-box",value:0,convert:{types:"dict",dictName:"TUREORFALSE"}},{title:"数据标题",name:"title",dataLen:10,props:{required:!0}},{title:"数据名称",name:"name",props:{required:!0},rules:{whitespace:!0}},{title:"数据编码",name:"sn",dataLen:50},{title:"描述",name:"descs",control:"a-textarea",view:{width:3}}],setting:{showColumn:2,labelWidth:6}}),a=i.ref(),r=i.ref({isPrimary:!1,fields:[{title:"列表模版",name:"listTmpl",control:"unione-select-box",value:"normal",convert:{types:"option",options:[{value:"normal",label:"标准"}]},props:{required:!0}},{title:"表单风格",name:"showColumn",control:"unione-select-box",value:2,convert:{types:"option",options:[{value:1,label:"一列"},{value:2,label:"二列"},{value:3,label:"三列"}]},props:{required:!0}},{title:"标题宽度",name:"labelWidth",control:"a-input-number",value:9,rule:{rangeMin:1,rangeMax:24},props:{required:!0}}],setting:{showColumn:2,labelWidth:6}}),d=i.ref({configs:{fields:[],filters:[]}}),h=i.ref(!1);function f(){n.back()}function c(){e.confirm({content:"确定要发布当前数据么?",onOk:()=>{ft.release([d.value.id]).then(y=>{y.success?(e.success({title:"发布成功",content:y.body}),b(d.value.id)):e.error({title:"发布失败",content:y.body})})}})}async function u(){const y=await l.value.validate(),k={...d.value,...y};k.configs.show=await a.value.getValue(),console.log("formData",k),J.message.loading({content:"提交中..."}),h.value=!0,ft.save(k).then(v=>{J.message.destroy(),v.success?(d.value=v.body,l.value.setValue(v.body),a.value.setValue(v.body.configs?.show||{}),J.message.success("保存成功!")):J.message.error(v.message)}).finally(()=>{h.value=!1})}const m=i.ref(!1);i.onMounted(()=>{t.query.id&&b(t.query.id)});function b(y){J.message.loading({content:"加载中..."}),ft.detail(y).then(k=>{k.success?(d.value=k.body,l.value.setValue(k.body),a.value.setValue(k.body.configs?.show||{}),J.message.destroy()):J.message.error(k.message)})}return(y,k)=>{const v=i.resolveComponent("unione-form"),w=i.resolveComponent("unione-section"),O=i.resolveComponent("OrderedListOutlined"),g=i.resolveComponent("a-tab-pane"),p=i.resolveComponent("ToolOutlined"),N=i.resolveComponent("ApiOutlined"),V=i.resolveComponent("FunnelPlotOutlined"),C=i.resolveComponent("a-tabs"),x=i.resolveComponent("a-button");return i.openBlock(),i.createElementBlock("div",wf,[i.createVNode(w,{title:"基础信息",type:"line"},{default:i.withCtx(()=>[i.createVNode(v,{form:s.value,ref_key:"formBaseObj",ref:l},null,8,["form"])]),_:1}),i.createVNode(w,{class:"page-setting-section",title:"页面配置",type:m.value&&"line",location:m.value?"left":"right",reactive:"",modelValue:m.value,"onUpdate:modelValue":k[0]||(k[0]=S=>m.value=S)},{default:i.withCtx(()=>[i.createVNode(v,{form:r.value,ref_key:"pageSettingObj",ref:a},null,8,["form"])]),_:1},8,["type","location","modelValue"]),i.createVNode(C,null,{default:i.withCtx(()=>[i.createVNode(g,{key:"field-mange"},{tab:i.withCtx(()=>[i.createVNode(O),k[5]||(k[5]=i.createTextVNode("字段管理 "))]),default:i.withCtx(()=>[i.createVNode(pd,{modelValue:d.value.configs.fields,"onUpdate:modelValue":k[1]||(k[1]=S=>d.value.configs.fields=S)},null,8,["modelValue"])]),_:1}),i.createVNode(g,{key:"field-setting"},{tab:i.withCtx(()=>[i.createVNode(p),k[6]||(k[6]=i.createTextVNode("字段设置 "))]),default:i.withCtx(()=>[i.createVNode(nf,{modelValue:d.value.configs.fields,"onUpdate:modelValue":k[2]||(k[2]=S=>d.value.configs.fields=S)},null,8,["modelValue"])]),_:1}),i.createVNode(g,{key:"field-fkeys"},{tab:i.withCtx(()=>[i.createVNode(N),k[7]||(k[7]=i.createTextVNode("外键设置 "))]),default:i.withCtx(()=>[i.createVNode(pf,{modelValue:d.value.configs.fields,"onUpdate:modelValue":k[3]||(k[3]=S=>d.value.configs.fields=S)},null,8,["modelValue"])]),_:1}),i.createVNode(g,{key:"data-filter"},{tab:i.withCtx(()=>[i.createVNode(V),k[8]||(k[8]=i.createTextVNode("数据过滤 "))]),default:i.withCtx(()=>[i.createVNode(yf,{modelValue:d.value.configs.filters,"onUpdate:modelValue":k[4]||(k[4]=S=>d.value.configs.filters=S)},null,8,["modelValue"])]),_:1})]),_:1}),i.createElementVNode("div",xf,[i.createVNode(x,{type:"primary",onClick:u,loading:h.value},{default:i.withCtx(()=>k[9]||(k[9]=[i.createTextVNode("保存")])),_:1},8,["loading"]),d.value.id?(i.openBlock(),i.createBlock(x,{key:0,danger:"",onClick:c,loading:h.value},{default:i.withCtx(()=>k[10]||(k[10]=[i.createTextVNode("发布")])),_:1},8,["loading"])):i.createCommentVNode("",!0),i.createVNode(x,{onClick:f},{default:i.withCtx(()=>k[11]||(k[11]=[i.createTextVNode("返回")])),_:1})])])}}}),[["__scopeId","data-v-3eeab6e6"]]),Cf={UnioneEditor:ct,locales:Zi,loadConfig:Ie,DataStorage:en,Convertor:Ke,install(o,e){K.loadConfig(e);const t=Ie(e);t.axios&&K.axios.create(t.axios),o.component("UnioneBtn",ya),o.component("UnioneTabs",xa),o.component("UnioneSection",Oa),o.component("UnioneQuery",vl),o.component("UnioneTable",Cl),o.component("UnioneFormItem",Wa),o.component("UnioneForm",ja),o.component("UnioneSelectBox",Ha),o.component("UnioneSwitchBox",Ka),o.component("UnioneRadioBox",Qa),o.component("UnioneCheckBox",Ga),o.component("UnionePwdBox",Ya),o.component("UnionePageEditor",Sl),o.component("UnionePageForm",Nl),o.component("UnionePageTree",Bl),o.component("UnionePageList",Ol)}};ee.Convertor=Ke,ee.DataStorage=en,ee.UnioneDataDefineEdit=vf,ee.UnioneDataDefineList=od,ee.UnioneEditor=ct,ee.UnionePage=jt,ee.UnionePageEditor=Sl,ee.UnionePageForm=Nl,ee.UnionePageList=Ol,ee.UnionePageSetting=zt,ee.UnionePageTree=Bl,ee.UnioneQueryForm=vl,ee.UnioneTableList=Cl,ee.default=Cf,ee.loadConfig=Ie,ee.locales=Zi,ee.useDebounce=tn,ee.utils=gr,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(Me,te){typeof exports=="object"&&typeof module<"u"?te(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("dayjs"),require("prismjs"),require("@ant-design/icons-vue"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","dayjs","prismjs","@ant-design/icons-vue","uuid"],te):(Me=typeof globalThis<"u"?globalThis:Me||self,te(Me.index={},Me.UnioneBaseVue,Me.Vue,Me.antDesignVue,Me.lodashEs,Me.vueCodemirror,Me.langJavascript,Me.dayjs,Me.prism,Me.iconsVue,Me.uuid))})(this,function(Me,te,o,ge,nh,Tn,sh,oh,gr,li,lh){"use strict";const rh={isDebug:!0,axios:{form:"/portal"},listPageUrl:"/unione/page/list",addPageUrl:"/unione/page/add",editPageUrl:"/unione/page/edit",viewPageUrl:"/unione/page/view",formRules:[]},Ro=o.ref(rh);function Dt(r){return r&&(Ro.value=te.utils.obj.ext(Ro.value,r)),Ro.value}const ah={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},ch={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},dh=o.ref([ah,ch]);function hh(r,e){return te.locales.loadLanguage(r,()=>new Promise((t,i)=>{const n=dh.value.filter(s=>s.localeName==r);if(e)if(typeof e=="function")e().then(s=>{if(n.length==0){const l={...s,localeName:r};t(l)}else{const l={...n[0],...s};t(l)}});else if(n.length==0){const s={...e,localeName:r};t(s)}else{const s={...n[0],...e};t(s)}else n.length>0?t(n[0]):i("local language not defined ,lang:"+r)}))}const po={...te.locales};po.loadLanguage=hh;class uh{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(e,t){this.$psn=o.ref(e),this.$pid=o.ref(""),this.$store=o.ref({}),this.$forms=o.ref({}),this.$params=o.ref({}),this.$refObj=o.ref({}),this.$refData=o.ref({}),this.$model=t}params(e){if(e){this.$params.value=e,e.id&&(this.$pid.value=e.id,this.$psn.value&&this.use(this.$psn.value,"form").detail(this.$pid.value));for(const t in this.$store.value)this.$store.value[t].$params=e}return this.$params.value}psn(e){return e&&(this.$psn.value=e),this.$psn.value}regRef(e,t){}setRefData(e,t,i){}use(e,t,i){let n=this.$store.value[e];return n||(n=new mo(e,t,this.$model),this.$store.value[e]=n,n.$params=this.$params.value),i&&(n.$form=i,this.$forms.value[e]=i),n}useForm(e,t,i){const n=this.use(e,"form",t);return this.$psn.value==e&&this.$pid.value&&n.detail(this.$pid.value).then(s=>{i&&i(s)}),n}data(e){return this.$store.value[e]}form(e){return e?this.$forms.value[e]:this.$forms.value}primary(){return this.data(this.$psn.value)}dsnList(){return Object.keys(this.$store.value)}}class mo{$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(e,t,i){typeof e=="string"?(this.$dsn=e,this.$store={controller:"/api/data/storage/v1"}):(this.$store=e,this.$dsn=""),this.$type=t,this.$data=o.ref(t=="form"?{}:{body:[],total:0}),this.$dialog=te.useDialog(),this.$model=i||o.ref("run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(e){return e&&(this.$store=e),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(e){this.$data.value=e,this.$form?.setValue(e)}$processParams(e,t){if(t)t.forEach(i=>{e[i.name]==null&&e[i.name]==null&&(this.$params[i.name]!=null&&this.$params[i.name]!=null?e[i.alias||i.name]=this.$params[i.name]:i.value!=null&&i.value!=null&&(e[i.alias||i.name]=i.value))});else if(this.$params)for(const i in this.$params)e[i]==null&&e[i]==null&&this.$params[i]!=null&&this.$params[i]!=null&&(e[i]=this.$params[i]);return e}request(e){return new Promise((t,i)=>{const n=ge.message.loading("数据请求中..."),s=this.$store.controller+e.url;te.axios.form({method:"post",...e,url:s}).then(l=>{l.success?t(l):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),i({info:"数据请求失败,model sn:"+this.$dsn+",url:"+s,options:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),i({info:"数据请求失败,model sn:"+this.$dsn+",url:"+s,options:e,err:l})}).finally(()=>{n()})})}find(e){const t=this.$store.controller+(this.$store.findUrl||"/find");return!e&&this.$store.findParams&&(e={dsn:this.$dsn}),this.$isStorage()&&(e.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),e&&(e.body=this.$processParams(e.body,this.$store.findParams)),new Promise((i,n)=>{const s=ge.message.loading("数据加载中...");te.axios.form({url:t,method:"post",data:e}).then(l=>{l.success?(this.$data.value=l,i(l)):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,err:l})}).finally(()=>{s()})})}save(e){const t=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(e.dsn=this.$dsn+(this.$model!="run"?"@dev":""),e.params=this.$processParams(e.params,this.$store.saveParams)):e.data=this.$processParams(e.data,this.$store.saveParams),new Promise((i,n)=>{const s=ge.message.loading("数据提交中...");te.axios.form({url:t,method:"post",data:this.$isStorage()?e:e.data}).then(l=>{l.success?(this.$type=="form"&&(this.$data.value=l.body||{}),l.silence||ge.message.success(l.message),i(l)):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),n({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,err:l})}).finally(()=>{s()})})}loadByIds(e){return new Promise((t,i)=>{const n=ge.message.loading("数据加载中..."),s=this.$store.controller+"/loadByIds";te.axios.form({url:s,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(l=>{l.success?t(l):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),i({info:"数据加载失败,model sn:"+this.$dsn,ids:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),i({info:"数据加载失败,model sn:"+this.$dsn,ids:e,err:l})}).finally(()=>{n()})})}detail(e){return new Promise((t,i)=>{const n=ge.message.loading("数据加载中..."),s=this.$store.controller+"/detail";te.axios.form({url:s,method:"post",data:this.$isStorage()?{id:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(l=>{l.success?(this.$type=="form"&&(this.$data.value=l.body),t(l)):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),i({info:"加载数据详情失败,model sn:"+this.$dsn,url:s,id:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),i({info:"加载数据详情失败,model sn:"+this.$dsn,url:s,id:e,err:l})}).finally(()=>{n()})})}deleteByIds(e){return new Promise((t,i)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+e.length+"条。",onOk:()=>{const n=ge.message.loading("数据处理中..."),s=this.$store.controller+"/delete";te.axios.form({url:s,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(l=>{l.success?t(l):(l.silence||this.$dialog.error({content:l.message||"未知错误,请联系管理员"}),i({info:"数据删除失败,model sn:"+this.$dsn,url:s,ids:e,result:l}))}).catch(l=>{this.$dialog.error({content:"未知错误,请联系管理员"}),i({info:"数据删除失败,model sn:"+this.$dsn,url:s,ids:e,err:l})}).finally(()=>{n()})}})})}}let fh=class{$event;$onces;$delayEmit;constructor(){this.$event=o.ref({}),this.$onces=o.ref({}),this.$delayEmit=o.ref({})}$on(e,t){if(this.$event.value[e]=t,this.$delayEmit.value[e]){const i=this.$delayEmit.value[e];t(i)}}$emit(e,t){if(this.$onces.value[e]){const i=this.$onces.value[e];delete this.$onces.value[e],i(t)}this.$event.value[e]?this.$event.value[e](t):(this.$delayEmit.value[e]=t,setTimeout(()=>{delete this.$delayEmit.value[e]},1e3*10))}$once(e,t){this.$onces.value[e]=t}$off(e){delete this.$event.value[e]}};class Fi{define;ebus;model;type;$widgetList;$widgetMap;$dataManager;$axiosProccess;$dialog;constructor(e={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}}){const t=e.configs||{};this.model=o.ref("run"),this.type=o.ref(e.types||"setting"),this.define=o.ref(e),this.ebus=new fh,this.$widgetList=o.ref([]),this.$widgetMap=o.ref({}),this.$dataManager=new uh(t.dsnList?t.dsnList[0]:"",this.model),this.$axiosProccess=o.ref({}),this.$dialog=te.useDialog(),this.loadConfig(t)}sn(){return this.define.value.sn}load(e,t){if(!e)return;if(this.define.value.sn=e,e=="new_"){console.log("新建/本地页面sn:"+e+",define:",t),t&&t.configs&&(this.define.value=t,this.type.value=this.define.value.types||"setting",this.loadConfig(t.configs));return}const i=sessionStorage.getItem("PAGE_DEFINE:"+e);if(i&&this.model.value=="run"){this.define.value=JSON.parse(i),this.type.value=this.define.value.types||"setting",this.loadConfig(this.define.value.configs),console.log("从会话缓存中加载页面sn:"+e+",define:",this.define.value);return}te.axios.form({url:"/api/page/define/load/"+e,method:"post"}).then(n=>{n.success?(this.define.value=n.body,this.type.value=this.define.value.types||"setting",n.body.configs?this.define.value.configs=n.body.configs:this.define.value.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.value.configs),sessionStorage.setItem("PAGE_DEFINE:"+e,JSON.stringify(this.define.value)),console.log("从远程服务加载页面sn:"+e+",define:",this.define.value)):t&&t.configs&&(this.define.value=t,this.loadConfig(t.configs))})}save(){return new Promise((e,t)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.value.sn),t();return}this.$axiosProccess.value.save=!0;const i={...this.define.value.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},n={...this.define.value};n.configs=JSON.stringify(i),te.axios.form({url:"/api/page/define/save",method:"post",data:n}).then(s=>{this.$axiosProccess.value.save=!1,s.success?(ge.message.success(s.message),this.define.value=s.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.value.sn,JSON.stringify(this.define.value)),this.load(this.define.value.sn,this.define.value),e(s.body)):(this.$dialog.error({content:s.message}),t())}).catch(s=>{console.error("页面配置保存失败",s),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(e){e.dsnList?.length&&this.$dataManager.psn(e.dsnList[0]),this.$widgetList.value=e.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value)}setModel(e){this.model.value=e}widget(e,t){if(t){const i={...t,wid:e};this.$widgetMap.value[e]||(this.$widgetList.value.push(i),i.configs?.widgets&&this.$processWidget(i.configs.widgets)),this.$widgetMap.value[e]=i}else return this.$widgetMap.value[e]}widgets(e){if(e)this.$widgetList.value=e,this.$widgetMap.value={},this.$processWidget(e);else return this.$widgetList.value}$processWidget(e){e.forEach(t=>{t.wid||(t.wid="w:"+nh.uniqueId()),this.$widgetMap.value[t.wid]=t,t.configs?.widgets&&this.$processWidget(t.configs.widgets)})}dataManager(){return this.$dataManager}}const gh={class:"widget-setting-dialog"},Rh=o.defineComponent({__name:"widget",props:{model:{type:String,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1}},emits:["setting","saving"],setup(r,{expose:e,emit:t}){const i=t,n=o.ref(),s=o.ref(),l=o.ref(!1);function a(){s.value&&(l.value=!0),i("setting")}function c(){i("saving"),l.value=!1}function d(){return n.value?.clientHeight}function h(){return n.value?.clientWidth}return e({getHeight:d,getWidth:h}),(u,f)=>{const g=o.resolveComponent("SettingOutlined"),R=o.resolveComponent("a-tooltip"),p=o.resolveComponent("a-modal");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["unione-widget",r.model]),ref_key:"widgetDom",ref:n},[o.createVNode(R,{title:r.settingTitle},{default:o.withCtx(()=>[r.model=="edit"&&(u.$slots["widget-setting"]||r.custome)?(o.openBlock(),o.createBlock(g,{key:0,class:"widget-setting",onClick:a})):o.createCommentVNode("",!0)]),_:1},8,["title"]),o.renderSlot(u.$slots,"default",{},void 0,!0),r.model=="edit"&&u.$slots["widget-setting"]?(o.openBlock(),o.createBlock(p,{key:0,title:r.settingTitle,ref_key:"settingModal",ref:s,open:l.value,"onUpdate:open":f[0]||(f[0]=M=>l.value=M),centered:"",width:"80%",onOk:c},{default:o.withCtx(()=>[o.createElementVNode("div",gh,[o.renderSlot(u.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):o.createCommentVNode("",!0)],2)}}}),Le=(r,e)=>{const t=r.__vccOpts||r;for(const[i,n]of e)t[i]=n;return t},Mi=Le(Rh,[["__scopeId","data-v-17b517f5"]]),ph={key:0},mh=["onClick"],as=Le(o.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(r,{expose:e}){const t=r,i=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:N})=>N+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),n=o.ref({selectedRowKeys:[],columnWidth:"25px",onChange:N=>{n.value.selectedRowKeys=N}}),s={mounted:N=>N.focus()},l=o.ref({});function a(){const N=Object.keys(l.value);if(N.length)for(let m in N){const T=p.value.form.action.params[m];T&&l.value[m]&&Object.keys(l.value[m]).forEach(y=>{T[y]=l.value[m][y]})}l.value={}}function c(N,m,T){a();const y={};y[T]=m[T]||"",T=="showIndex"&&(y[T]=m.show?.query?.index),l.value[N]=y}function d(N,m,T){if(!m||!T){l.value={};return}const y=l.value[N][T];m[T]=y,l.value={}}function h(){p.value.form.action.params.push({title:"新建",name:"",value:""})}function u(){}const f=o.ref(""),g=o.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(N,m)=>f.value!=m&&t.preset.includes(m)?Promise.reject("预设按钮名称,请使用其他名称,["+t.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),R=o.ref([sh.javascript()]),p=o.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),M=o.ref();function S(N,m,T={}){N=JSON.parse(JSON.stringify(N)),N.event||(N.event={}),N.props||(N.props={}),N.action||(N.action={}),Object.keys(N.action).includes("maskClosable")||(N.action.maskClosable=!0),N.action.params||(N.action.params=[]),f.value=N.name,p.value.form=N,p.value.helps=T,p.value.visible=!0,M.value=m}const b=o.ref(null);function P(){b.value&&b.value.validate().then(()=>{p.value.visible=!1,M.value(p.value.form)})}return e({open:S,close}),(N,m)=>{const T=o.resolveComponent("a-input"),y=o.resolveComponent("a-form-item"),x=o.resolveComponent("a-select"),I=o.resolveComponent("a-input-number"),V=o.resolveComponent("a-checkbox"),F=o.resolveComponent("a-tab-pane"),L=o.resolveComponent("a-switch"),w=o.resolveComponent("a-button"),v=o.resolveComponent("a-divider"),X=o.resolveComponent("ToolOutlined"),C=o.resolveComponent("a-tooltip"),Z=o.resolveComponent("a-table"),k=o.resolveComponent("a-tabs"),Q=o.resolveComponent("a-form"),Y=o.resolveComponent("a-modal");return o.openBlock(),o.createBlock(Y,{visible:p.value.visible,"onUpdate:visible":m[23]||(m[23]=W=>p.value.visible=W),title:p.value.title,centered:"",width:"50%",onOk:P},{default:o.withCtx(()=>[o.createVNode(Q,{name:"basic",ref_key:"form",ref:b,rules:g.value,model:p.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:o.withCtx(()=>[o.createVNode(k,null,{default:o.withCtx(()=>[o.createVNode(F,{key:"base",tab:"基本设置"},{default:o.withCtx(()=>[o.createVNode(y,{label:"操作标题",required:"",name:"title"},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.title,"onUpdate:value":m[0]||(m[0]=W=>p.value.form.title=W)},null,8,["value"])]),_:1}),o.createVNode(y,{label:"操作名称",name:"name",required:""},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.name,"onUpdate:value":m[1]||(m[1]=W=>p.value.form.name=W),disabled:t.preset.includes(p.value.form.name)},null,8,["value","disabled"])]),_:1}),o.createVNode(y,{label:"操作图标"},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.icon,"onUpdate:value":m[2]||(m[2]=W=>p.value.form.icon=W)},null,8,["value"])]),_:1}),o.createVNode(y,{label:"按钮类型"},{default:o.withCtx(()=>[o.createVNode(x,{value:p.value.form.type,"onUpdate:value":m[3]||(m[3]=W=>p.value.form.type=W),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),o.createVNode(y,{label:"显示顺序"},{default:o.withCtx(()=>[o.createVNode(I,{value:p.value.form.index,"onUpdate:value":m[4]||(m[4]=W=>p.value.form.index=W)},null,8,["value"])]),_:1}),o.createVNode(y,{label:"按钮大小"},{default:o.withCtx(()=>[o.createVNode(x,{value:p.value.form.size,"onUpdate:value":m[5]||(m[5]=W=>p.value.form.size=W),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),o.createVNode(y,{label:"按钮特性"},{default:o.withCtx(()=>[o.createVNode(V,{checked:p.value.form.props.block,"onUpdate:checked":m[6]||(m[6]=W=>p.value.form.props.block=W)},{default:o.withCtx(()=>m[24]||(m[24]=[o.createTextVNode("自适应 ")])),_:1},8,["checked"]),o.createVNode(V,{checked:p.value.form.props.danger,"onUpdate:checked":m[7]||(m[7]=W=>p.value.form.props.danger=W)},{default:o.withCtx(()=>m[25]||(m[25]=[o.createTextVNode("危险 ")])),_:1},8,["checked"]),o.createVNode(V,{checked:p.value.form.props.ghost,"onUpdate:checked":m[8]||(m[8]=W=>p.value.form.props.ghost=W)},{default:o.withCtx(()=>m[26]||(m[26]=[o.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),o.createVNode(F,{key:"action",tab:"响应设置"},{default:o.withCtx(()=>[o.createVNode(y,{label:"响应方式",required:""},{default:o.withCtx(()=>[o.createVNode(x,{value:p.value.form.action.type,"onUpdate:value":m[9]||(m[9]=W=>p.value.form.action.type=W),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.action.psn,"onUpdate:value":m[10]||(m[10]=W=>p.value.form.action.psn=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["drawer","dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.action.component,"onUpdate:value":m[11]||(m[11]=W=>p.value.form.action.component=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),o.createVNode(y,{label:"连接地址"},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.action.href,"onUpdate:value":m[12]||(m[12]=W=>p.value.form.action.href=W)},null,8,["value"])]),_:1}),["link","route"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:2,label:"连接方式"},{default:o.withCtx(()=>[o.createVNode(x,{value:p.value.form.action.target,"onUpdate:value":m[13]||(m[13]=W=>p.value.form.action.target=W),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["drawer"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:3,label:"抽屉位置"},{default:o.withCtx(()=>[o.createVNode(x,{value:p.value.form.action.position,"onUpdate:value":m[14]||(m[14]=W=>p.value.form.action.position=W),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["drawer","dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:4,label:"显示标题",required:""},{default:o.withCtx(()=>[o.createVNode(T,{value:p.value.form.action.title,"onUpdate:value":m[15]||(m[15]=W=>p.value.form.action.title=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["drawer","dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:5,label:"蒙层关闭"},{default:o.withCtx(()=>[o.createVNode(L,{checked:p.value.form.action.maskClosable,"onUpdate:checked":m[16]||(m[16]=W=>p.value.form.action.maskClosable=W),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),["drawer","dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:6,label:"显示宽度"},{default:o.withCtx(()=>[o.createVNode(I,{value:p.value.form.action.width,"onUpdate:value":m[17]||(m[17]=W=>p.value.form.action.width=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["dialog"].includes(p.value.form.action.type)?(o.openBlock(),o.createBlock(y,{key:7,label:"显示高度"},{default:o.withCtx(()=>[o.createVNode(I,{value:p.value.form.action.height,"onUpdate:value":m[18]||(m[18]=W=>p.value.form.action.height=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),o.createVNode(v,{orientation:"left"},{default:o.withCtx(()=>[m[29]||(m[29]=o.createTextVNode("参数列表 ")),o.createVNode(w,{size:"small",class:"param-btn",onClick:h},{default:o.withCtx(()=>m[27]||(m[27]=[o.createTextVNode("添加")])),_:1}),o.createVNode(w,{size:"small",class:"param-btn",danger:"",onClick:u},{default:o.withCtx(()=>m[28]||(m[28]=[o.createTextVNode("删除")])),_:1})]),_:1}),o.createVNode(Z,{columns:i.value,"data-source":p.value.form.action.params,bordered:"",pagination:!1,"row-selection":n.value,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:W})=>[["name","title"].includes(W.key)?(o.openBlock(),o.createElementBlock("span",ph,[o.createVNode(X),o.createTextVNode(" "+o.toDisplayString(W.title),1)])):o.createCommentVNode("",!0),["value"].includes(W.key)?(o.openBlock(),o.createBlock(C,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:o.withCtx(()=>[o.createElementVNode("span",null,[o.createVNode(X),o.createTextVNode(" "+o.toDisplayString(W.title),1)])]),_:2},1024)):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:W,text:H,record:U,index:K})=>[["name","title","value"].includes(W.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!l.value[K]||!Object.keys(l.value[K]).includes(W.dataIndex))&&!H&&"empty"]),onClick:_=>c(K,U,W.dataIndex)},[l.value[K]&&Object.keys(l.value[K]).includes(W.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(T,{key:0,value:l.value[K][W.dataIndex],"onUpdate:value":_=>l.value[K][W.dataIndex]=_,onBlur:_=>d(K,U,W.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[s]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(H),1)],64))],10,mh)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),o.createVNode(F,{key:"event",tab:"事件设置"},{default:o.withCtx(()=>[o.createVNode(y,{label:"点击事件",help:p.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn.Codemirror),{modelValue:p.value.form.event.clickScript,"onUpdate:modelValue":m[19]||(m[19]=W=>p.value.form.event.clickScript=W),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:R.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),o.createVNode(y,{label:"禁用逻辑",help:p.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn.Codemirror),{modelValue:p.value.form.event.disableScript,"onUpdate:modelValue":m[20]||(m[20]=W=>p.value.form.event.disableScript=W),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:R.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),o.createVNode(y,{label:"显示逻辑",help:p.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn.Codemirror),{modelValue:p.value.form.event.visibleScript,"onUpdate:modelValue":m[21]||(m[21]=W=>p.value.form.event.visibleScript=W),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:R.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),o.createVNode(y,{label:"动态标题",help:p.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn.Codemirror),{modelValue:p.value.form.event.titleScript,"onUpdate:modelValue":m[22]||(m[22]=W=>p.value.form.event.titleScript=W),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:R.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),[["__scopeId","data-v-75055a2b"]]),Sh=["src"],Mh=["src"],Nh=Le(o.defineComponent({__name:"btn",props:{editor:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(r,{emit:e}){const t=Dt(),i=r,n=te.useSession();o.watch(()=>i.widget?.event,()=>{l()}),o.onMounted(()=>{l()});const s=o.ref({});function l(){i.widget?.event&&(i.widget.event.clickScript?s.value.click=new Function("ctx","btn","event",i.widget.event.clickScript):i.widget.event.click&&(s.value.click=i.widget.event.click),i.widget.event.disableScript?s.value.disable=new Function("ctx","btn",i.widget.event.disableScript):i.widget.event.disable&&(s.value.disable=i.widget.event.disable),i.widget.event.visibleScript?s.value.visible=new Function("ctx","btn",i.widget.event.visibleScript):i.widget.event.visible&&(s.value.visible=i.widget.event.visible),i.widget.event.titleScript?s.value.title=new Function("ctx","btn",i.widget.event.titleScript):i.widget.event.title&&(s.value.title=i.widget.event.title)),typeof i.widget.click=="function"&&(s.value.click=i.widget.click),typeof i.widget.title=="function"&&(s.value.title=i.widget.title),typeof i.widget.visible=="function"&&(s.value.visible=i.widget.visible),typeof i.widget.disabled=="function"&&(s.value.disable=i.widget.disabled)}const a=o.computed(()=>s.value.title?s.value.title(f.value,i.widget):i.widget.title),c=o.computed(()=>s.value.visible?s.value.visible(f.value,i.widget)!=!1:i.widget.visible!=!1),d=o.computed(()=>i.disabled==!0?!0:s.value.disable?s.value.disable(f.value,i.widget):i.widget.disable==!0),h=o.ref(null);function u(){h.value?.open(i.widget,N=>{console.log("btn props",N),Object.keys(N).forEach(m=>{i.widget[m]=N[m]}),console.log("props btn",i.widget)})}const f=o.computed(()=>({...i.ctx,user:n.getPrincipal(),token:n.getToken()})),g=o.ref({open:!1}),R=o.computed(()=>{if(i.widget.action?.href){let N=i.widget.action.href;const m=N.matchAll("{[a-zA-Z.]*}"),T=[];let y=null;for(;y=m.next();){if(y&&y.value&&y.value[0]){let x=y.value[0].substring(1,y.value[0].length-1);T.includes(x)||T.push(x)}if(y.done)break}if(T.length>0)for(let x=0;x<T.length;x++){let I=T[x],V=te.utils.obj.getValue(f.value,I);V?V instanceof Object?N=N.replaceAll("{"+I+"}",JSON.stringify(V)):Array.isArray(V)?N=N.replaceAll("{"+I+"}",V.join(",")):N=N.replaceAll("{"+I+"}",V):N=N.replaceAll("{"+I+"}","")}return N}return""}),p=o.computed(()=>{const N={};let m=i.widget.action?.href||i.widget.action?.link;if(m){const T=m.matchAll("{[a-zA-Z0-9.]*}"),y=[];let x=null;for(;x=T.next();){if(x&&x.value&&x.value[0]){let V=x.value[0].substring(1,x.value[0].length-1);y.includes(V)||y.push(V)}if(x.done)break}if(y.length>0)for(let V=0;V<y.length;V++){let F=y[V],L=te.utils.obj.getValue(f.value,F);L?L instanceof Object?m=m.replaceAll("{"+F+"}",JSON.stringify(L)):Array.isArray(L)?m=m.replaceAll("{"+F+"}",L.join(",")):m=m.replaceAll("{"+F+"}",L):m=m.replaceAll("{"+F+"}","")}const I=m.split("?")[1];I&&I.split("&").forEach(V=>{const F=V.split("=");F[0]&&F[1]&&(N[F[0]]=F[1])})}return i.widget.action?.params&&i.widget.action.params.filter(T=>T.value+"").forEach(T=>{if(new RegExp("{[a-zA-Z0-9.]*}").test(T.value)){let x=te.utils.obj.getValue(f.value,T.value);N[T.name]=x}else N[T.name]=T.value}),N}),M=e,S=o.inject("router");function b(N){if(t.isDebug&&console.log("unione btn click",i.widget,N),!(s.value.click&&s.value.click(f.value,i.widget,N)==!1)){if(i.widget.action?.type=="drawer"||i.widget.action?.type=="dialog")g.value.open=!0;else if(i.widget.action?.type=="route"&&(i.widget.action?.href||i.widget.action?.link)){if(i.widget.action.link&&i.editor?.type.value=="code")return;S.push({path:i.widget.action.href||i.widget.action?.link,query:p.value})}M("click",{btn:i.widget,event:N})}}function P(N){M("click",N)}return(N,m)=>{const T=o.resolveComponent("a-button"),y=o.resolveComponent("unione-btn"),x=o.resolveComponent("a-dropdown"),I=o.resolveComponent("a-drawer"),V=o.resolveComponent("a-modal");return c.value?(o.openBlock(),o.createBlock(Mi,{key:0,class:o.normalizeClass(["unione-btn",r.widget.props?.block&&"unione-btn-block"]),model:r.editor?.model.value,onSetting:u,custome:!0,"setting-title":"按钮设置"},{default:o.withCtx(()=>[!r.widget.widget||r.widget.widget=="button"?(o.openBlock(),o.createBlock(T,o.mergeProps({key:0,disabled:d.value,size:r.widget.size||"small",type:r.type||r.widget.type,shape:r.widget.shape,class:"unione-btn-"+r.widget.name,loading:r.widget.loading,target:r.widget.action?.target,title:r.widget.tooltip,onClick:b},r.widget.props),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(a.value)+" ",1)]),_:2},[r.widget.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.widget.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):o.createCommentVNode("",!0),r.widget.widget=="dropdown"?(o.openBlock(),o.createBlock(x,{key:1,trigger:[r.widget.trigger||"hover"],class:o.normalizeClass([r.widget.size||"small"])},{overlay:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["dropdown-overlay",r.widget.layout])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.widget.items,F=>(o.openBlock(),o.createBlock(y,{key:F.name,class:"item",widget:F,editor:r.editor,preset:r.preset,ctx:r.ctx,onClick:P},null,8,["widget","editor","preset","ctx"]))),128))],2)]),default:o.withCtx(()=>[o.createVNode(T,{size:r.widget.size||"small"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(a.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):o.createCommentVNode("",!0),r.widget.action?.type=="drawer"?(o.openBlock(),o.createBlock(I,{key:2,open:g.value.open,"onUpdate:open":m[0]||(m[0]=F=>g.value.open=F),title:r.widget.action?.title,placement:r.widget.action?.position,maskClosable:r.widget.action?.maskClosable,width:r.widget.action?.width,bodyStyle:{padding:0,overflow:!r.widget.action.component||r.widget.action.component=="iframe"?"hidden":"auto"}},{default:o.withCtx(()=>[!r.widget.action.component||r.widget.action.component=="iframe"?(o.openBlock(),o.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:R.value},null,8,Sh)):o.createCommentVNode("",!0)]),_:1},8,["open","title","placement","maskClosable","width","bodyStyle"])):o.createCommentVNode("",!0),r.widget.action?.type=="dialog"?(o.openBlock(),o.createBlock(V,{key:3,open:g.value.open,"onUpdate:open":m[1]||(m[1]=F=>g.value.open=F),title:r.widget.action?.title,width:r.widget.action?.width,maskClosable:r.widget.action?.maskClosable,centered:"",footer:null},{default:o.withCtx(()=>[!r.widget.action.component||r.widget.action.component=="iframe"?(o.openBlock(),o.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:R.value,style:o.normalizeStyle({height:r.widget.action?.height?r.widget.action?.height+"px":""})},null,12,Mh)):o.createCommentVNode("",!0)]),_:1},8,["open","title","width","maskClosable"])):o.createCommentVNode("",!0),o.createVNode(as,{ref_key:"btnSetting",ref:h,preset:i.preset},null,8,["preset"])]),_:1},8,["class","model"])):o.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b868da76"]]),bh={key:0,class:"unione-widget-empty-tip"},Lh=Le(o.defineComponent({__name:"tabs",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},setup(r){const e=r,t=o.ref(),i=o.computed(()=>e.editor?.widget(e.wid)||e.widget);return(n,s)=>{const l=o.resolveComponent("a-tab-pane"),a=o.resolveComponent("a-tabs");return o.openBlock(),o.createBlock(Mi,{class:o.normalizeClass(["unione-layout-tabs"]),model:e.editor?.model},{default:o.withCtx(()=>[i.value?(o.openBlock(),o.createBlock(a,{key:0,activeKey:t.value,"onUpdate:activeKey":s[0]||(s[0]=c=>t.value=c)},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value.chidlren,(c,d)=>(o.openBlock(),o.createBlock(l,{key:d,class:"unione-layout-tab-pane"},{tab:o.withCtx(()=>[o.createElementVNode("span",null,[c.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(c.icon),{key:0})):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(c.title),1)])]),default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.chidlren,(h,u)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h.widget),{key:u,wid:h.wid,editor:e.editor,widget:h},null,8,["wid","editor","widget"]))),128)),!c.chidlren||!c.chidlren.length?(o.openBlock(),o.createElementBlock("div",bh,o.toDisplayString(c.emptyTips),1)):o.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["activeKey"])):o.createCommentVNode("",!0)]),_:1},8,["model"])}}}),[["__scopeId","data-v-7b565c89"]]),Oh={class:"title"},Ph={class:"text"},Th={key:0,class:"reactive"},Ih={key:1,class:"opts"},xh={class:"warp"},wh=Le(o.defineComponent({__name:"section",props:o.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=r,t=o.computed(()=>e.editor?.widget(e.wid)||e.widget),i=o.computed(()=>t.value?.title||e.title),n=o.computed(()=>t.value?.icon||e.icon),s=o.computed(()=>t.value?.type||e.type),l=o.useModel(r,"modelValue");function a(){e.reactive&&(l.value=!l.value)}return(c,d)=>(o.openBlock(),o.createBlock(Mi,{class:o.normalizeClass(["unione-layout-section",l.value?"open":"close"]),model:e.editor?.model},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["head",r.location,r.reactive&&"reactive"]),onClick:a},[o.createElementVNode("div",Oh,[s.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["type",s.value])},null,2)):o.createCommentVNode("",!0),n.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{key:1,class:"icon"})):o.createCommentVNode("",!0),o.createElementVNode("span",Ph,o.toDisplayString(i.value),1)]),r.reactive?(o.openBlock(),o.createElementBlock("div",Th,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value?"UpOutlined":"DownOutlined")))])):o.createCommentVNode("",!0),r.location=="left"?(o.openBlock(),o.createElementBlock("div",Ih,[o.renderSlot(c.$slots,"opts",{},void 0,!0)])):o.createCommentVNode("",!0)],2),o.withDirectives(o.createElementVNode("div",xh,[o.renderSlot(c.$slots,"default",{},void 0,!0)],512),[[o.vShow,l.value]])]),_:3},8,["class","model"]))}}),[["__scopeId","data-v-e75e9a84"]]),yh={class:"unione-props-setting unione-form-setting"},Vh={class:"unione-form-btns"},Fh={key:0},Xh=["onClick"],Ch={class:"field-txt"},vh=["onClick"],Wh={key:1,class:"field-txt"},kh=["onClick"],Dh={key:0,class:"field-txt"},Eh={key:3,class:"edit-field"},Uh={key:0},Zh=["onClick"],Yh=Le(o.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(r){const e=r,t=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:x})=>x+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),i=o.computed(()=>{const x=e.editor.widget(e.wid)||{};return x.configs||(x.configs={}),x.configs.settings||(x.configs.settings={}),x.configs.settings.btns||(x.configs.settings.btns=[]),x}),n=o.computed(()=>(e.editor.dataModels()||[]).map(I=>({value:I.sn,label:I.title+"("+I.name+")"}))),s=o.computed(()=>{const x=i.value.configs.settings.btns,I=x.map(V=>V.name);if(!I.includes("save")){const V={title:"保存",type:"primary",index:0,visible:!0,name:"save"};x.splice(V.index,0,V)}if(!I.includes("submit")){const V={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let F=V.index||1;x.splice(F,0,V)}if(!I.includes("reset")){const V={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};x.splice(V.index,0,V)}if(!I.includes("back")){const V={title:"返回",type:"default",index:3,visible:!0,name:"back"};x.splice(V.index,0,V)}return x}),l=o.ref(null);function a(x){l.value&&l.value.open(x,I=>{I.visible=!0,Object.keys(I).forEach(V=>{x[V]=I[V]}),i.value.configs.settings.btns.sort((V,F)=>{const L=V.index||1,w=F.index||1;return L-w}),i.value.configs.settings.btns=[...i.value.configs.btns]})}function c(){const x=i.value.configs.settings.btns.length+1;let I={title:"新增",name:"new_"+x,index:x,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};I.name="new_"+i.value.configs.settings.btns.length;const V=i.value.configs.settings.btns.filter(F=>F.name==I.name).length;V>0&&(I.name=I.name+V),i.value.configs.settings.btns.push(I),e.editor.widget(e.wid,i.value),l.value.open(I,F=>{Object.keys(F).forEach(L=>{I[L]=F[L]}),i.value.configs.btns=[...i.value.configs.btns]})}function d(x){const I=()=>{if(["save","submit","reset","back"].includes(x.name))x.visible=!1,i.value.configs.settings.btns=[...i.value.configs.settings.btns];else{const V=[];i.value.configs.settings.btns.forEach(F=>{F.name!=x.name&&V.push(F)}),i.value.configs.settings.btns=V}};ge.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{I()}})}const h=o.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:x=>{const I=h.value.widgets.filter(V=>V.value==x);return I[0]?I[0].label:x},toSetting:()=>{}}),u=o.ref({visible:!1,field:{},props:{},showInfo:x=>{let I="";return x.rules&&(I=x.rules.filter(V=>V.enable).length||""),I&&(I="("+I+")"),I},toSetting:()=>{const x=u.value.props,I={name:"range",trigger:x.trigger,whitespace:x.whitespace,message:x.rangeMessage};x.rangeMin!=null&&x.rangeMin!=null&&(I.min=x.rangeMin,I.enable=!0),x.rangeMax!=null&&x.rangeMax!=null&&(I.max=x.rangeMax,I.enable=!0);const V={name:"reg",trigger:x.trigger,whitespace:x.whitespace,message:x.regMessage};x.regExpress&&(V.pattern=x.regExpress,V.enable=!0),u.value.field.rules=[I,V],u.value.visible=!1,u.value.props={},console.log("rule",u.value.field.rules)}});function f(x){u.value.visible=!0,u.value.field=x;const I=x.rules||[],V={trigger:"change",whitespace:!0};I.forEach(F=>{F.name=="reg"&&(V.trigger=F.trigger,V.whitespace=F.whitespace,V.regExpress=F.pattern,V.regMessage=F.message),F.name=="range"&&(V.rangeMin=F.min,V.rangeMax=F.max,V.rangeMessage=F.message)}),u.value.props=V}const g=o.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{g.value.visible=!1}});function R(x,I){const V=b.value.filter(L=>L.name==x.name);V.forEach(L=>{I!="isSort"?L[I]=!0:L[I]=!L[I]});const F=V[0];if(!(!F||I=="isSort")){switch(g.value.prop=I,g.value.field=x,F.show||(F.show={}),I){case"isQuery":F.show.query||(F.show.query={}),g.value.show=F.show.query,g.value.title=`查询设置/${x.title}(${x.name})`;break;case"isForm":F.show.form||(F.show.form={}),g.value.show=F.show.form,g.value.title=`表单设置/${x.title}(${x.name})`;break;case"isView":F.show.view||(F.show.view={}),g.value.show=F.show.view,g.value.title=`详情设置/${x.title}(${x.name})`;break;case"isList":F.show.list||(F.show.list={}),g.value.show=F.show.list,g.value.title=`列头设置/${x.title}(${x.name})`;break}g.value.visible=!0}}const p=o.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{p.value.convert.options||(p.value.convert.options=[]),p.value.convert.options.push({label:"",value:""})},toDelOption:(x,I)=>{p.value.convert.options.splice(x,1)},toSetting:()=>{p.value.visible=!1}});function M(x){p.value.visible=!0,p.value.field=x,p.value.convert=x.convert||{}}const S=o.computed(()=>e.editor?.dataModel(i.value.dataModel||"none")||{}),b=o.computed(()=>S.value.fields?.length?S.value.fields:[]),P={mounted:x=>x.focus()},N=o.ref({});function m(x,I){const V={};I=="convertName"?V[I]=x.convert?.type:V[I]=x[I]||"",N.value={},N.value[x.name]=V}function T(x,I){{N.value={};return}}function y(x,I){b.value.filter(F=>F.name==x.name).forEach(F=>{F[I]=!F[I]})}return(x,I)=>{const V=o.resolveComponent("a-divider"),F=o.resolveComponent("CloseOutlined"),L=o.resolveComponent("a-button"),w=o.resolveComponent("PlusOutlined"),v=o.resolveComponent("a-select"),X=o.resolveComponent("ToolOutlined"),C=o.resolveComponent("a-checkbox"),Z=o.resolveComponent("a-table"),k=o.resolveComponent("a-select-option"),Q=o.resolveComponent("a-form-item"),Y=o.resolveComponent("a-form"),W=o.resolveComponent("a-modal"),H=o.resolveComponent("a-checkbox-group"),U=o.resolveComponent("a-input-number"),K=o.resolveComponent("a-input"),_=o.resolveComponent("a-col"),J=o.resolveComponent("a-row");return o.openBlock(),o.createElementBlock("div",yh,[o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[23]||(I[23]=[o.createTextVNode("按钮设置")])),_:1}),o.createElementVNode("div",Vh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,G=>(o.openBlock(),o.createBlock(L,o.mergeProps({key:G.name,class:["btn",G.name,!G.visible&&"deleted"],type:G.visible?G.type:"default",size:G.size,ref_for:!0},G.props||{},{onClick:se=>a(G)}),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(G.title)+" ",1),G.visible?(o.openBlock(),o.createBlock(F,{key:0,class:"btn-del",onClick:o.withModifiers(se=>d(G),["stop"])},null,8,["onClick"])):o.createCommentVNode("",!0)]),_:2},[G.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(G.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),o.createVNode(L,{class:o.normalizeClass(["btn","btn-add"]),size:"small",onClick:I[0]||(I[0]=G=>c())},{default:o.withCtx(()=>[o.createVNode(w)]),_:1})]),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[24]||(I[24]=[o.createTextVNode("表单设置")])),_:1}),I[36]||(I[36]=o.createTextVNode(" 数据模型:")),o.createVNode(v,{class:"data-model-list",options:n.value,value:i.value.dataModel,"onUpdate:value":I[1]||(I[1]=G=>i.value.dataModel=G)},null,8,["options","value"]),o.createVNode(Z,{columns:t.value,"data-source":b.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:G})=>[["widget","rules","convertName"].includes(G.key)?(o.openBlock(),o.createElementBlock("span",Fh,[o.createVNode(X),o.createTextVNode(" "+o.toDisplayString(G.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:G,text:se,record:ae})=>[["rules"].includes(G.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",!u.value.showInfo(ae)&&"empty"]),onClick:we=>f(ae)},[o.createElementVNode("span",Ch,o.toDisplayString(u.value.showInfo(ae)),1),u.value.showInfo(ae)?(o.openBlock(),o.createBlock(L,{key:0,type:"link"},{default:o.withCtx(()=>I[25]||(I[25]=[o.createTextVNode("设置")])),_:1})):o.createCommentVNode("",!0)],10,Xh)):["widget"].includes(G.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!N.value[ae.name]||!Object.keys(N.value[ae.name]).includes(G.dataIndex))&&!se&&"empty"]),onClick:we=>m(ae,G.dataIndex)},[N.value[ae.name]&&Object.keys(N.value[ae.name]).includes(G.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(v,{key:0,value:ae[G.dataIndex],"onUpdate:value":we=>ae[G.dataIndex]=we,options:h.value.widgets,onBlur:I[2]||(I[2]=we=>T())},null,8,["value","onUpdate:value","options"])),[[P]]):(o.openBlock(),o.createElementBlock("span",Wh,o.toDisplayString(h.value.widgetName(se)),1))],10,vh)):["convertName"].includes(G.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!N.value[ae.name]||!Object.keys(N.value[ae.name]).includes(G.dataIndex))&&!ae.convert?.type&&"empty"]),onClick:we=>m(ae,G.dataIndex)},[N.value[ae.name]&&Object.keys(N.value[ae.name]).includes(G.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(v,{key:0,value:ae[G.dataIndex],"onUpdate:value":we=>ae[G.dataIndex]=we,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:I[3]||(I[3]=we=>T())},null,8,["value","onUpdate:value"])),[[P]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[ae.convert?.type?(o.openBlock(),o.createElementBlock("span",Dh,o.toDisplayString(ae.convert.type=="dict"?"字典":"静态"),1)):o.createCommentVNode("",!0),ae.convert?.type?(o.openBlock(),o.createBlock(L,{key:1,type:"link",onClick:o.withModifiers(we=>M(ae),["stop"])},{default:o.withCtx(()=>I[26]||(I[26]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],64))],10,kh)):["isForm","isView"].includes(G.dataIndex)?(o.openBlock(),o.createElementBlock("div",Eh,[o.createVNode(C,{checked:ae[G.dataIndex],onClick:we=>y(ae,G.dataIndex)},null,8,["checked","onClick"]),o.createVNode(L,{type:"link",onClick:we=>R(ae,G.dataIndex)},{default:o.withCtx(()=>I[27]||(I[27]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])])):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(W,{visible:h.value.visible,"onUpdate:visible":I[5]||(I[5]=G=>h.value.visible=G),title:"控件设置",onOk:h.value.toSetting},{default:o.withCtx(()=>[o.createVNode(Y,{model:h.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:o.withCtx(()=>[h.value.field.widget=="a-select"?(o.openBlock(),o.createBlock(Q,{key:0,label:"下拉框类型"},{default:o.withCtx(()=>[o.createVNode(v,{value:h.value.props.mode,"onUpdate:value":I[4]||(I[4]=G=>h.value.props.mode=G),allowClear:!0},{default:o.withCtx(()=>[o.createVNode(k,{value:"multiple"},{default:o.withCtx(()=>I[28]||(I[28]=[o.createTextVNode("多选")])),_:1}),o.createVNode(k,{value:"tags"},{default:o.withCtx(()=>I[29]||(I[29]=[o.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),o.createVNode(W,{visible:u.value.visible,"onUpdate:visible":I[13]||(I[13]=G=>u.value.visible=G),title:"规则设置",onOk:u.value.toSetting},{default:o.withCtx(()=>[o.createVNode(Y,{model:u.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[30]||(I[30]=[o.createTextVNode("基本设置")])),_:1}),o.createVNode(Q,{label:"触发时机"},{default:o.withCtx(()=>[o.createVNode(H,{value:u.value.props.trigger,"onUpdate:value":I[6]||(I[6]=G=>u.value.props.trigger=G),options:["change","blur"]},null,8,["value"])]),_:1}),u.value.field.isNull?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Q,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:o.withCtx(()=>[o.createVNode(C,{value:u.value.props.whitespace,"onUpdate:value":I[7]||(I[7]=G=>u.value.props.whitespace=G),checked:u.value.props.whitespace},{default:o.withCtx(()=>I[31]||(I[31]=[o.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[32]||(I[32]=[o.createTextVNode("数值区间")])),_:1}),o.createVNode(Q,{label:"有效区间"},{default:o.withCtx(()=>[o.createVNode(U,{value:u.value.props.rangeMin,"onUpdate:value":I[8]||(I[8]=G=>u.value.props.rangeMin=G)},null,8,["value"]),I[33]||(I[33]=o.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),o.createVNode(U,{value:u.value.props.rangeMax,"onUpdate:value":I[9]||(I[9]=G=>u.value.props.rangeMax=G)},null,8,["value"])]),_:1}),o.createVNode(Q,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(K,{value:u.value.props.rangeMessage,"onUpdate:value":I[10]||(I[10]=G=>u.value.props.rangeMessage=G)},null,8,["value"])]),_:1}),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[34]||(I[34]=[o.createTextVNode("正则验证")])),_:1}),o.createVNode(Q,{label:"表达式"},{default:o.withCtx(()=>[o.createVNode(K,{value:u.value.props.regExpress,"onUpdate:value":I[11]||(I[11]=G=>u.value.props.regExpress=G)},null,8,["value"])]),_:1}),o.createVNode(Q,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(K,{value:u.value.props.regMessage,"onUpdate:value":I[12]||(I[12]=G=>u.value.props.regMessage=G)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),o.createVNode(W,{visible:g.value.visible,"onUpdate:visible":I[20]||(I[20]=G=>g.value.visible=G),title:g.value.title,onOk:g.value.toSetting},{default:o.withCtx(()=>[o.createVNode(Y,{model:g.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:o.withCtx(()=>[o.createVNode(Q,{label:"显示顺序"},{default:o.withCtx(()=>[o.createVNode(U,{value:g.value.show.index,"onUpdate:value":I[14]||(I[14]=G=>g.value.show.index=G)},null,8,["value"])]),_:1}),["isQuery"].includes(g.value.prop)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Q,{key:0,label:"显示宽度"},{default:o.withCtx(()=>[o.createVNode(K,{value:g.value.show.width,"onUpdate:value":I[15]||(I[15]=G=>g.value.show.width=G)},null,8,["value"])]),_:1})),["isForm","isView"].includes(g.value.prop)?(o.openBlock(),o.createBlock(Q,{key:1,label:"标题宽度"},{default:o.withCtx(()=>[o.createVNode(K,{value:g.value.show.labelWidth,"onUpdate:value":I[16]||(I[16]=G=>g.value.show.labelWidth=G)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isForm","isView"].includes(g.value.prop)?(o.openBlock(),o.createBlock(Q,{key:2,label:"控件宽度"},{default:o.withCtx(()=>[o.createVNode(K,{value:g.value.show.valueWidth,"onUpdate:value":I[17]||(I[17]=G=>g.value.show.valueWidth=G)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isList"].includes(g.value.prop)?(o.openBlock(),o.createBlock(Q,{key:3,label:"固定位置"},{default:o.withCtx(()=>[o.createVNode(v,{value:g.value.show.fixed,"onUpdate:value":I[18]||(I[18]=G=>g.value.show.fixed=G),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isList"].includes(g.value.prop)?(o.openBlock(),o.createBlock(Q,{key:4,label:"对齐方式"},{default:o.withCtx(()=>[o.createVNode(v,{value:g.value.show.align,"onUpdate:value":I[19]||(I[19]=G=>g.value.show.align=G),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),o.createVNode(W,{visible:p.value.visible,"onUpdate:visible":I[22]||(I[22]=G=>p.value.visible=G),title:p.value.convert.type=="dict"?"字典设置":"选项设置",onOk:p.value.toSetting},{default:o.withCtx(()=>[p.value.convert.type!="dict"?(o.openBlock(),o.createElementBlock("div",Uh,[o.createVNode(L,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:p.value.toAddOption},{default:o.withCtx(()=>I[35]||(I[35]=[o.createTextVNode("新增")])),_:1},8,["onClick"]),o.createVNode(Z,{columns:p.value.optionColumn,"data-source":p.value.convert.options,size:"small"},{bodyCell:o.withCtx(({column:G,record:se,index:ae})=>[G.dataIndex==="label"?(o.openBlock(),o.createBlock(K,{key:0,value:se.label,"onUpdate:value":we=>se.label=we,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),G.dataIndex==="value"?(o.openBlock(),o.createBlock(K,{key:1,value:se.value,"onUpdate:value":we=>se.value=we,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),G.dataIndex==="action"?(o.openBlock(),o.createElementBlock("a",{key:2,onClick:we=>p.value.toDelOption(ae,se)},"删除",8,Zh)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):o.createCommentVNode("",!0),p.value.convert.type=="dict"?(o.openBlock(),o.createBlock(Y,{key:1,model:p.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:o.withCtx(()=>[o.createVNode(J,{type:"flex",style:{width:"100%"}},{default:o.withCtx(()=>[o.createVNode(_,{span:24,order:1},{default:o.withCtx(()=>[o.createVNode(Q,{label:"字典名称:"},{default:o.withCtx(()=>[o.createVNode(K,{value:p.value.convert.dict,"onUpdate:value":I[21]||(I[21]=G=>p.value.convert.dict=G)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):o.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),o.createVNode(as,{ref_key:"btnSetting",ref:l},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),Qh=Le(o.defineComponent({__name:"form",props:{editor:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1}},setup(r,{expose:e}){const t=r,i=o.ref(!1),n=o.ref(),s=o.ref({}),l=o.ref(null);o.onMounted(()=>{if(c.value.dsn){const b=a.value.dataManager();c.value.primary&&b.psn(c.value.dsn),l.value.setDisabled=S,l.value.getValue=f,l.value.setValue=g,l.value.reset=R,n.value=b.useForm(c.value.dsn,l.value,P=>{s.value=P.body||{}})}t.editor||a.value.loadConfig({widgets:d.value}),t.form?.model&&a.value.setModel(t.form.model),p()});const a=o.computed(()=>t.editor||new Fi),c=o.computed(()=>t.widget||t.form||{}),d=o.computed(()=>{let b=c.value.widgets||[];return!b.length&&t.form?.fields&&(b=t.form.fields),b.forEach(P=>{P.widget||(P.widget="unione-form-item"),P.control||(P.control="a-input")}),b}),h=o.inject("pageSetting",{}),u=o.computed(()=>c.value.setting||h?.form||{});o.provide("formSetting",u.value);function f(){return s.value}function g(b){s.value=b,p()}function R(){s.value={},p()}function p(){const b=P=>{P.widget=="unione-form-item"&&P.name&&(P.value!=null&&P.value!=null&&P.value!=""||P.value==0)&&(s.value[P.name]==null||s.value[P.name]==null||s.value[P.name]=="")&&(s.value[P.name]=P.value),P.widgets?.forEach(N=>{b(N)})};d.value.forEach(P=>{b(P)})}function M(){return l.value.validate()}function S(b=!0){i.value=b}return e({validate:M,getValue:f,setValue:g,reset:R,setDisabled:S}),(b,P)=>{const N=o.resolveComponent("a-form");return o.openBlock(),o.createBlock(Mi,{class:"unione-form-widget","setting-title":"表单设置",model:a.value.model.value},o.createSlots({default:o.withCtx(()=>[o.createVNode(N,{ref_key:"formObj",ref:l,model:s.value,class:o.normalizeClass(["unione-form",a.value.model.value,"form-layout-col-"+(u.value.showColumn||3)])},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,(m,T)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(m.widget),{key:T,widget:m,editor:a.value,value:s.value[m.name],"onUpdate:value":y=>s.value[m.name]=y,disabled:i.value,formValue:s.value},null,40,["widget","editor","value","onUpdate:value","disabled","formValue"]))),128))]),_:1},8,["model","class"])]),_:2},[r.editor&&c.value.wid?{name:"widget-setting",fn:o.withCtx(()=>[o.createVNode(Yh,{wid:c.value.wid,editor:r.editor},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-cecc4588"]]);function Rr(r,e=!1){const t=Dt();if(!r)return Promise.reject("字典名称不能为空");const i=localStorage.getItem("UNIONE-DICT-"+r);return i&&e==!1?Promise.resolve(JSON.parse(i)):(t.isDebug&&console.log("进入:加载字典数据方法,dict name:"+r+",force:"+e),new Promise((n,s)=>{te.axios.admin({url:"/api/system/dict/load/"+r}).then(l=>{if(l.success){const a=l.body.filter(c=>c.dictName!=c.dictKey);a.forEach(c=>{c.value=c.dictKey,c.label=c.dictValue}),a.length?(localStorage.setItem("UNIONE-DICT-"+r,JSON.stringify(a)),n(a)):s("字典加载失败,dict:"+r+",字典项列表为空")}else t.isDebug&&console.error("字典加载失败,dict:"+r,l),s("字典加载失败,dict:"+r+",error:"+l.message)})}))}async function pr(r,e){const t=Dt();if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("字典key为空");const i=await Rr(r),n=i.filter(s=>s.dictKey==e);return n.length>0?Promise.resolve(n[0]):(t.isDebug&&console.log("字典项匹配失败,name:"+r+",key:"+e+"options:",i),Promise.reject("字典项匹配失败,name:"+r+",key:"+e))}async function Kh(r,e){const t=await pr(r,e);return Promise.resolve(t.dictValue)}const mr={load:Rr,getLabel:Kh,getOption:pr};class ri{convertObj;config;options;constructor(e){(!e||!e.types)&&console.error("转换器定义不能为空,type不能为空",e),e.valueField||(e.valueField="id"),e.labelField||(e.labelField="title"),this.convertObj=e,this.options=e.options||[],this.config=Dt()}load(e,t=!1){return!(e==null||e==null||e=="undefined"||!(e+"").length)&&this.options?.length&&this.options.filter(i=>i.value==e).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((i,n)=>{if(!this.convertObj.dictName){n("字典名称不能为空,id:"+this.convertObj.id);return}mr.load(this.convertObj.dictName,t).then(s=>{this.options=s,typeof e=="number"&&this.options.forEach(l=>{l.value=parseInt(l.value)}),i(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject("静态转换器选项为空,id:"+this.convertObj.id))):!this.convertObj.id&&this.convertObj.types!="local"?Promise.reject("转换器id不能为空,type:"+this.convertObj.types):new Promise((i,n)=>{const s={body:this.convertObj.params||{}};this.convertObj.pidField&&(s.pid=-1);const l=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;te.axios.admin({url:l,data:s,method:"POST"}).then(a=>{a.success?(this.options=a.body,this.$processOptions(this.options),typeof e=="number"&&this.options.forEach(c=>{c.value=parseInt(c.value)}),e==null||e==null||e=="undefined"||!(e+"").length?this.options.length?i(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,a),n("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(d=>d.value==e).length?i(this.options):(s.body||(s.body={}),s.body[this.convertObj.valueField||"id"]=e,te.axios.admin({url:l,data:s,method:"POST"}).then(d=>{if(d.success){const h={};this.options.forEach(u=>{h[e]=!0}),d.body.forEach(u=>{h[u.value]||this.options.push(u)}),i(this.options)}else n("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,a),n("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+a.message))})})}convert(e){if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?mr.getLabel(this.convertObj.dictName,e):Promise.reject("字典名称不能为空");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const t=this.convertObj.options.filter(i=>i.value==e);return t.length?Promise.resolve(t[0].label):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e,this.convertObj),Promise.reject("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e))}return Promise.reject("静态转换器选项为空,id:"+this.convertObj.id)}if(this.options?.length){const t=this.options.filter(i=>i.value==e);if(t.length)return Promise.resolve(t[0].label)}return new Promise((t,i)=>{this.load(e).then(n=>{const s=n.filter(l=>l.value==e);if(s.length)return t(s[0].label);i()})})}children(e=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+e),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.reject("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id):new Promise((i,n)=>{const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;te.axios.admin({url:s,data:e,method:"POST"}).then(l=>{l.success?(this.$processOptions(l.body),this.options=[...this.options,...l.body],i(l.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e,l),n("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e+",error:"+l.message))})}):Promise.reject("转换器未设置parentField,id:"+this.convertObj.id)}search(e){return this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+e),this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.resolve(this.options.filter(t=>t.label.indexOf(e)>=0)):new Promise(t=>{const i=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;te.axios.admin({url:i,data:{body:{keywords:e}},method:"POST"}).then(n=>{n.success?(this.$processOptions(n.body),t(n.body)):t([])})})}$processOptions(e){return this.convertObj.types=="local"&&e.forEach(t=>{this.convertObj.idField&&(t.id=t[this.convertObj.idField]),this.convertObj.pidField&&(t.pid=t[this.convertObj.pidField]),t.value=t[this.convertObj.valueField||"id"],t.label=t[this.convertObj.labelField||"title"]}),e}}const Hh=["innerHTML"],Bh={key:2,class:"text-view"},Gh=Le(o.defineComponent({__name:"formItem",props:o.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(r){const e=r,t=o.useModel(r,"value"),i=o.computed(()=>s.value.showFormat?s.value.showFormat.call(this,t.value,{label:M.value,form:e.formValue}):M.value||t.value),n=o.inject("formSetting");o.onMounted(()=>{l.value.value!=null&&typeof l.value.value<"u"&&(e.formValue[l.value.name]==null||e.formValue[l.value.name]==null||typeof e.formValue[l.value.name]>"u")&&(t.value=l.value.value,l.value.widget=="unione-check-box"&&(Array.isArray(l.value.value)||(typeof l.value.value=="string"?t.value=l.value.value.split(","):t.value=[l.value.value])))});const s=o.ref({}),l=o.computed(()=>{const S=e.editor?.widget(e.wid)||e.widget||{};return S.event&&Object.keys(S.event).forEach(b=>{const P=S.event[b];P&&(s.value[b]=null,typeof P=="function"?s.value[b]=P:P.enable&&P.scriptText&&(s.value[b]=new Function("value","ctx",P.scriptText)))}),S}),a=o.computed(()=>!(s.value.visible&&s.value.visible(e.formValue[l.value.name],e.formValue)==!1)),c=o.computed(()=>s.value.title&&s.value.title(e.formValue[l.value.name],e.formValue)||l.value.title),d=o.computed(()=>s.value.change&&s.value.change(e.formValue[l.value.name],e.formValue)||l.value.change),h=o.ref({}),u=o.computed(()=>{const S=[],b=l.value.rule||{};let P=l.value.props?.required||l.value.required;if(s.value.required&&(P=s.value.required(e.formValue[l.value.name],e.formValue)),P&&S.push({required:!0,whitespace:b?.whitespace||!1,trigger:b?.trigger||n.ruleTrigger||"change",validator:(N,m)=>(b?.whitespace&&m&&typeof m=="string"&&(m=m.trim()),m!=null&&m!=null&&(m+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(c.value+"不能为空!"))}),b.advance&&h.value[b.advance]){const N=h.value[b.advance];S.push({pattern:N.pattern,message:N.message||"表单验证不通过!",trigger:b.trigger||n.ruleTrigger||"change"})}return b.regExpress&&S.push({pattern:b.regExpress,message:b.regMessage||"表单验证不通过!",trigger:b.trigger||n.ruleTrigger||"change"}),l.value.dataLen&&S.push({validator:(N,m)=>m&&(m+"").length>l.value.dataLen?Promise.reject("最大长度["+l.value.dataLen+"],当前:["+(m+"").length+"]"):Promise.resolve(),trigger:b?.trigger||n.ruleTrigger||"change"}),S}),f=o.computed(()=>{const S=l.value.props||{};if(l.value.control=="a-input-number"){const b=l.value.rule||{};b.rangeMin!=null&&b.rangeMin!=null&&(S.min=b.rangeMin),b.rangeMax!=null&&b.rangeMax!=null&&(S.max=b.rangeMax)}return l.value.control=="a-date-picker"&&l.value.view?.dataFormat&&(S.format=l.value.view.dataFormat,S.valueFormat=l.value.view.dataFormat),l.value.required&&(S.required=l.value.required),S}),g=o.computed(()=>{const S=l.value.css||{},b=["form-item-"+l.value.name];return S.cssName&&b.push(S.cssName),n.platform=="app"?S.cssName?typeof S.cssName=="string"&&S.cssName.indexOf("all-line")<0&&b.push("all-line"):b.push("all-line"):l.value.view?.width&&(l.value.view.width>=3?(!S.cssName||typeof S.cssName=="string"&&S.cssName.indexOf("all-line")<0)&&b.push("all-line"):l.value.view.width==2&&b.push("2in-line")),b}),R=o.computed(()=>{const S=n.showColumn||3;let b=l.value.view?.labelWidth||n.labelWidth||9;return l.value.css?.cssName&&S>1&&typeof l.value.css.cssName=="string"&&l.value.css.cssName.indexOf("all-line")>=0?{span:Math.round(b/S)}:l.value.view?.width>=3&&S>1?{span:Math.round(b/S)}:{span:b}}),p=o.computed(()=>{const S=n.showColumn||3;let b=l.value.view?.valueWidth||n.valueWidth||19;return l.value.css?.cssName&&S>1&&g.value.includes("all-line")?{}:{span:b}}),M=o.ref();return o.watch(t,()=>{t.value&&e.editor?.model.value=="view"&&l.value.convert&&new ri(l.value.convert).convert(t.value.toString()).then(S=>{M.value=S})}),(S,b)=>{const P=o.resolveComponent("a-form-item");return o.openBlock(),o.createBlock(Mi,{class:o.normalizeClass(["unione-form-item",g.value]),style:o.normalizeStyle(l.value.css?.cssText)},{default:o.withCtx(()=>[a.value?(o.openBlock(),o.createBlock(P,{key:0,label:c.value,name:l.value.name,labelCol:R.value,wrapperCol:p.value,required:l.value.props?.required,rules:u.value,help:(!e.editor||e.editor.model.value!="view")&&l.value.props?.help,tooltip:l.value.props?.tooltip},{default:o.withCtx(()=>[!e.editor||e.editor.model.value!="view"&&l.value.view!="html"?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value.control||"a-input"),o.mergeProps({key:0,wid:l.value.wid,widget:l.value,editor:e.editor,disabled:r.disabled,onChange:d.value,value:t.value,"onUpdate:value":b[0]||(b[0]=N=>t.value=N),formValue:r.formValue},f.value,{style:l.value.css?.props}),null,16,["wid","widget","editor","disabled","onChange","value","formValue","style"])):l.value.view=="html"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"text-view text-html",innerHTML:i.value},null,8,Hh)):(o.openBlock(),o.createElementBlock("div",Bh,o.toDisplayString(i.value),1))]),_:1},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip"])):o.createCommentVNode("",!0)]),_:1},8,["class","style"])}}}),[["__scopeId","data-v-b8c86fff"]]);function So(r,e=350){let t=null;return i=>{clearTimeout(t),t=setTimeout(()=>{r(i)},e)}}const _h=Le(o.defineComponent({__name:"selectBox",props:o.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(r){Dt();const e=r,t=o.useModel(r,"value"),i=o.ref([]),n=o.computed(()=>i.value?.length?i.value:e.options?.length?e.options:[]),s=o.computed(()=>{const g=u.value.convert||e.convert||{};if(g.refValue){const R={};return g.refValue.split(",").forEach(M=>{const S=M.split("=");S.length==1?R[S[0]]=te.utils.obj.getValue(e.formValue,S[0]):R[S[0]]=te.utils.obj.getValue(e.formValue,S[1])}),console.log(u.value.name+" ref field:"+g.refValue+",ref value",R),R}return{}}),l=o.computed(()=>(u.value.convert||e.convert||{}).search||!1),a=So(g=>{f.value.search(g).then(R=>{i.value=R})},500);function c(g,R){h.value.select&&h.value.select(g,{option:R,formValue:e.formValue})}const d=o.ref();o.onMounted(()=>{const g=u.value.convert||e.convert||{};d.value=g.params||{},g.params={...d.value,...s.value},f.value.load(t.value).then(R=>{i.value=R})});const h=o.ref({}),u=o.computed(()=>{const g=e.editor?.widget(e.wid)||e.widget||{};return g.event&&Object.keys(g.event).forEach(R=>{const p=g.event[R];p&&(h.value[R]=null,typeof p=="function"?h.value[R]=p:p.enable&&p.scriptText&&(h.value[R]=new Function("value","ctx",p.scriptText)))}),g}),f=o.computed(()=>{const g=u.value.convert||e.convert||{};return new ri(g)});return o.watch(t,()=>{t.value&&f.value.load(t.value).then(g=>{i.value=g})}),o.watch(()=>u.value.convert||e.convert||{},()=>{f.value.load().then(g=>{i.value=g})}),o.watch(()=>s.value,()=>{if(console.log(u.value.name+" ref value changed",s.value),s.value){t.value="";const g=u.value.convert||e.convert||{};g.params={...d.value,...s.value},f.value.load(void 0,!0).then(R=>{i.value=R})}},{deep:!0}),(g,R)=>{const p=o.resolveComponent("a-select");return o.openBlock(),o.createBlock(p,{class:"unione-form-select",options:n.value,showSearch:l.value,value:t.value,"onUpdate:value":R[0]||(R[0]=M=>t.value=M),onSearch:o.unref(a),onSelect:c},null,8,["options","showSearch","value","onSearch"])}}}),[["__scopeId","data-v-417884f2"]]),Ah=Le(o.defineComponent({__name:"switchBox",props:o.mergeModels({editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(r){const e=r,t=o.useModel(r,"value"),i=o.ref({});o.onMounted(()=>{l.value?.load(t.value).then(a=>{a.forEach(c=>{c.value&&(c.value=="1"||c.value=="true"||c.value=="TRUE")?(i.value.checkedChildren=c.label,c.value=="true"||c.value=="TRUE"?i.value.checkedValue=!0:i.value.checkedValue=1):(i.value.unCheckedChildren=c.label,c.value=="false"||c.value=="FALSE"?i.value.unCheckedValue=!1:i.value.unCheckedValue=0)})})});const n=o.ref({}),s=o.computed(()=>{const a=e.widget||{};return a.event&&Object.keys(a.event).forEach(c=>{const d=a.event[c];d&&(n.value[c]=null,typeof d=="function"?n.value[c]=d:d.enable&&d.scriptText&&(n.value[c]=new Function("value","ctx",d.scriptText)))}),a}),l=o.computed(()=>{const a=s.value.convert||e.convert;return a?new ri(a):null});return(a,c)=>{const d=o.resolveComponent("a-switch");return o.openBlock(),o.createBlock(d,o.mergeProps({class:"unione-form-switch"},i.value,{checked:t.value,"onUpdate:checked":c[0]||(c[0]=h=>t.value=h)}),null,16,["checked"])}}}),[["__scopeId","data-v-32bff921"]]),Jh=Le(o.defineComponent({__name:"radioBox",props:o.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(r){const e=r,t=o.useModel(r,"value"),i=o.ref([]),n=o.computed(()=>i.value?.length?i.value:e.options?.length?e.options:[]),s=o.computed(()=>{const h=c.value.convert||e.convert||{};if(h.refValue){const u={};return h.refValue.split(",").forEach(g=>{const R=g.split("=");R.length==1?u[R[0]]=te.utils.obj.getValue(e.formValue,R[0]):u[R[0]]=te.utils.obj.getValue(e.formValue,R[1])}),console.log(c.value.name+" ref field:"+h.refValue+",ref value",u),u}return{}}),l=o.ref();o.onMounted(()=>{const h=c.value.convert||e.convert||{};l.value=h.params||{},h.params={...l.value,...s.value},d.value.load(t.value||c.value.value).then(u=>{i.value=u})});const a=o.ref({}),c=o.computed(()=>{const h=e.editor?.widget(e.wid)||e.widget||{};return h.event&&Object.keys(h.event).forEach(u=>{const f=h.event[u];f&&(a.value[u]=null,typeof f=="function"?a.value[u]=f:f.enable&&f.scriptText&&(a.value[u]=new Function("value","ctx",f.scriptText)))}),h}),d=o.computed(()=>{const h=c.value.convert||e.convert||{};return new ri(h)});return o.watch(()=>s.value,()=>{if(console.log(c.value.name+" ref value changed",s.value),s.value){t.value="";const h=c.value.convert||e.convert||{};h.params={...l.value,...s.value},d.value.load(void 0,!0).then(u=>{i.value=u})}},{deep:!0}),(h,u)=>{const f=o.resolveComponent("a-radio-group");return o.openBlock(),o.createBlock(f,{class:"unione-form-radio",options:n.value,value:t.value,"onUpdate:value":u[0]||(u[0]=g=>t.value=g)},null,8,["options","value"])}}}),[["__scopeId","data-v-485b8303"]]),zh=Le(o.defineComponent({__name:"checkBox",props:o.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},returnType:{type:String,default:"string"},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:o.mergeModels(["change"],["update:value"]),setup(r,{emit:e}){const t=r,i=o.useModel(r,"value"),n=o.ref(),s=o.ref([]),l=o.computed(()=>s.value?.length?s.value:t.options?.length?t.options:[]),a=o.computed(()=>{const R=h.value.convert||t.convert||{};if(R.refValue){const p={};return R.refValue.split(",").forEach(S=>{const b=S.split("=");b.length==1?p[b[0]]=te.utils.obj.getValue(t.formValue,b[0]):p[b[0]]=te.utils.obj.getValue(t.formValue,b[1])}),console.log(h.value.name+" ref field:"+R.refValue+",ref value",p),p}return{}}),c=o.ref();o.onMounted(()=>{const R=i.value||h.value.value;t.returnType==="string"?n.value=R.split(","):n.value=R;const p=h.value.convert||t.convert||{};c.value=p.params||{},p.params={...c.value,...a.value},g.value.load().then(M=>{s.value=M})});const d=o.ref({}),h=o.computed(()=>{const R=t.editor?.widget(t.wid)||t.widget||{};return R.event&&Object.keys(R.event).forEach(p=>{const M=R.event[p];d.value[p]=null,M.enable&&M.scriptText&&(d.value[p]=new Function("value","ctx",M.scriptText))}),R}),u=e;function f(R){t.returnType==="string"?i.value=R.join(","):i.value=R,console.log("checkbox changed",i.value),u("change",i.value)}const g=o.computed(()=>{const R=h.value.convert||t.convert||{};return new ri(R)});return o.watch(()=>i.value,()=>{n.value=Array.isArray(i.value)?i.value:[],i.value&&!Array.isArray(i.value)&&(n.value=i.value.split(","))}),o.watch(()=>a.value,()=>{if(console.log(h.value.name+" ref value changed",a.value),a.value){n.value=[],t.returnType==="string"?i.value="":i.value=[];const R=h.value.convert||t.convert||{};R.params={...c.value,...a.value},g.value.load(void 0,!0).then(p=>{s.value=p})}},{deep:!0}),(R,p)=>{const M=o.resolveComponent("a-checkbox-group");return o.openBlock(),o.createBlock(M,{class:"unione-form-checkbox",options:l.value,value:n.value,"onUpdate:value":p[0]||(p[0]=S=>n.value=S),onChange:f},null,8,["options","value"])}}}),[["__scopeId","data-v-1aa92231"]]),$h=Le(o.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(r){const e=o.ref(),t=o.useModel(r,"value");return o.watch(()=>e.value,()=>{e.value?t.value=te.utils.sm2Encrypt(e.value):t.value=""}),(i,n)=>{const s=o.resolveComponent("a-input-password");return o.openBlock(),o.createBlock(s,{class:"unione-form-password",value:e.value,"onUpdate:value":n[0]||(n[0]=l=>e.value=l)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]),jh={class:"unione-props-setting unione-query-setting"},qh={class:"unione-query-opts"},eu={key:0},tu=["onClick"],iu={key:1},nu={key:1,class:"edit-field"},su=["onClick"],ou=Le(o.defineComponent({__name:"querySetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(r){const e=r,t=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:P})=>P+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"30px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"55px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"}]),i=o.computed(()=>{const P=e.editor.widget(e.wid)||{};return P.configs||(P.configs={}),P.configs.btns||(P.configs.btns=[]),P}),n=o.computed(()=>(e.editor.dataModels()||[]).map(N=>({value:N.sn,label:N.title+"("+N.name+")"}))),s=o.computed(()=>{const P=[],N=[];return i.value.configs.btns||(i.value.configs.btns=[]),i.value.configs.btns.forEach(m=>{P.push(m),N.push(m.name)}),N.includes("query")||P.splice(0,0,{visible:!0,name:"query",title:"搜索",type:"primary"}),N.includes("reset")||P.splice(1,0,{visible:!0,name:"reset",title:"重置",type:"default"}),N.includes("reset")||P.splice(1,0,{visible:!0,name:"advanced",title:"高级搜索",type:"default"}),P.sort((m,T)=>{const y=m.index||1,x=T.index||1;return y-x}),P}),l=o.ref(null);function a(P){l.value&&l.value.open(P,N=>{N.visible=!0,Object.keys(N).forEach(m=>{P[m]=N[m]}),i.value.configs.btns.sort((m,T)=>{const y=m.index||1,x=T.index||1;return y-x}),i.value.configs.btns=[...i.value.configs.btns]})}function c(){const P=i.value.configs.btns.length+1;let N={title:"新增",name:"new_"+P,size:"default",index:P,visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};i.value.configs.btns.push(N),e.editor.widget(e.wid,i.value),l.value.open(N,m=>{Object.keys(m).forEach(T=>{N[T]=m[T]}),i.value.configs.btns=[...i.value.configs.btns]})}function d(P){const N=()=>{if(["query","reset","advanced"].includes(P.name))P.visible=!1,i.value.configs.btns=[...i.value.configs.btns];else{const m=[];i.value.configs.btns.forEach(T=>{T.name!=P.name&&m.push(T)}),i.value.configs.btns=m}};ge.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{N()}})}const h=o.computed(()=>e.editor?.dataModel(i.value.dataModel||"none")||{}),u=o.computed(()=>h.value.fields?.length?h.value.fields:[]),f={mounted:P=>P.focus()},g=o.ref({});function R(){const P=Object.keys(g.value);if(P.length)for(let N in P){const m=u.value.filter(T=>T.name==N);if(m&&m[0]){let T=g.value[N];Object.keys(T).forEach(y=>{if(y=="showIndex"){const x=m[0].show?.query||{};m[0].show||(m[0].show={}),m[0].show.query={...x,index:T[y]}}else m[0][y]=T[y]})}}g.value={}}function p(P,N){R();const m={};m[N]=P[N]||"",N=="showIndex"&&(m[N]=P.show?.query?.index),g.value[P.name]=m}function M(P,N){if(!P||!N){g.value={};return}const m=g.value[P.name][N];if(N=="showIndex"){const T=P.show?.query||{};P.show||(P.show={}),P.show.query={...T,index:m}}else P[N]=m;g.value={}}function S(P,N){u.value.filter(T=>T.name==P.name).forEach(T=>{T[N]=!T[N]})}const b=o.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:P=>{const N=b.value.options.filter(m=>m.value==P);return N[0]?N[0].label:P}});return(P,N)=>{const m=o.resolveComponent("a-divider"),T=o.resolveComponent("CloseOutlined"),y=o.resolveComponent("a-button"),x=o.resolveComponent("PlusOutlined"),I=o.resolveComponent("a-select"),V=o.resolveComponent("ToolOutlined"),F=o.resolveComponent("a-checkbox"),L=o.resolveComponent("a-input-number"),w=o.resolveComponent("a-table");return o.openBlock(),o.createElementBlock("div",jh,[o.createVNode(m,{orientation:"left"},{default:o.withCtx(()=>N[3]||(N[3]=[o.createTextVNode("查询按钮")])),_:1}),o.createElementVNode("div",qh,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,v=>(o.openBlock(),o.createBlock(y,o.mergeProps({key:v.name,class:["btn",v.name,!v.visible&&"deleted"],type:v.visible?v.type:"default",size:v.size||"default",ref_for:!0},v.props||{},{onClick:X=>a(v)}),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(v.title)+" ",1),v.visible?(o.openBlock(),o.createBlock(T,{key:0,class:"btn-del",onClick:o.withModifiers(X=>d(v),["stop"])},null,8,["onClick"])):o.createCommentVNode("",!0)]),_:2},[v.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(v.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),o.createVNode(y,{class:o.normalizeClass(["btn","btn-add"]),onClick:N[0]||(N[0]=v=>c()),size:"small"},{default:o.withCtx(()=>[o.createVNode(x)]),_:1})]),o.createVNode(m,{orientation:"left"},{default:o.withCtx(()=>N[4]||(N[4]=[o.createTextVNode("查询字段")])),_:1}),N[5]||(N[5]=o.createTextVNode(" 数据模型:")),o.createVNode(I,{class:"data-model-list",options:n.value,value:i.value.dataModel,"onUpdate:value":N[1]||(N[1]=v=>i.value.dataModel=v)},null,8,["options","value"]),o.createVNode(w,{columns:t.value,"data-source":u.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:v})=>[["showIndex","queryType"].includes(v.key)?(o.openBlock(),o.createElementBlock("span",eu,[o.createVNode(V),o.createTextVNode(" "+o.toDisplayString(v.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:v,text:X,record:C})=>[["queryType"].includes(v.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!g.value[C.name]||!Object.keys(g.value[C.name]).includes(v.dataIndex))&&!X&&"empty"]),onClick:Z=>p(C,v.dataIndex)},[g.value[C.name]&&Object.keys(g.value[C.name]).includes(v.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(I,{key:0,value:C[v.dataIndex],"onUpdate:value":Z=>C[v.dataIndex]=Z,allowClear:!0,options:b.value.options,onBlur:N[2]||(N[2]=Z=>M())},null,8,["value","onUpdate:value","options"])),[[f]]):(o.openBlock(),o.createElementBlock("span",iu,o.toDisplayString(b.value.showLabel(X)),1))],10,tu)):["isQuery"].includes(v.dataIndex)?(o.openBlock(),o.createElementBlock("div",nu,[o.createVNode(F,{checked:C[v.dataIndex],onClick:Z=>S(C,v.dataIndex)},null,8,["checked","onClick"])])):v.dataIndex=="showIndex"?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!g.value[C.name]||!Object.keys(g.value[C.name]).includes(v.dataIndex))&&!X&&"empty"]),onClick:Z=>p(C,v.dataIndex)},[g.value[C.name]&&Object.keys(g.value[C.name]).includes(v.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(L,{key:0,value:g.value[C.name][v.dataIndex],"onUpdate:value":Z=>g.value[C.name][v.dataIndex]=Z,onBlur:Z=>M(C,v.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[f]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(C.show?.query?.index||" "),1)],64))],10,su)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(as,{ref_key:"btnSetting",ref:l},null,512)])}}}),[["__scopeId","data-v-ce575063"]]),lu={class:"query-btn"},ru={class:"btn-advanced-overlay"},Sr=Le(o.defineComponent({__name:"queryForm",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},fields:{type:Array},params:{type:Object,default(){return{}}}},emits:["query","reset","btnClick"],setup(r,{emit:e}){const t=r,i=o.computed(()=>{const M=t.editor?.widget(t.wid)||t.widget||{};return M.btns||(M.btns=[]),M}),n=o.computed(()=>({visible:!0,name:"keywords",title:"关键字",placeholder:"请输入搜索内容",...i.value.keywords||{}})),s=o.computed(()=>{let M=[];return i.value.fields?.length&&(M=i.value.fields),M.length==0&&t.fields?.length&&(M=t.fields),M.sort((S,b)=>{const P=S.show?.query?.index||1,N=b.show?.query?.index||1;return P-N}),M.forEach(S=>{!S.widget&&!S.control&&S.convert&&(S.widget="unione-select-box"),S.widget=S.widget||S.control||"a-input",S.defaultValue!=null&&S.defaultValue!="undefined"&&typeof S.defaultValue<"u"&&(h.value[S.name]=S.defaultValue,S.value=S.defaultValue)}),M}),l=o.computed(()=>i.value.labelWidth||7),a=o.computed(()=>{const M=i.value.btns.filter(S=>S.name=="advanced")[0]||{};return M.event?.clickScript&&(M.event.click=new Function("ctx","btn","event",M.event.clickScript)),M.event?.disableScript&&(M.event.disable=new Function("ctx","btn",M.event.disableScript)),M.event?.visibleScript&&(M.event.visible=new Function("ctx","btn",M.event.visibleScript)),{visible:!0,name:"advanced",title:"高级搜索",...M}}),c=["query","reset","advanced"],d=o.computed(()=>{const M=i.value.btns.filter(b=>b.name!="advanced"),S=[];return M.forEach(b=>{b.size||(b.size="default"),S.push(b.name)}),S.includes("query")||M.splice(0,0,{visible:!0,name:"query",title:"查询",size:"default",type:"primary"}),S.includes("reset")||M.splice(1,0,{visible:!0,name:"reset",title:"重置",size:"default",type:"default"}),M.sort((b,P)=>{const N=b.index||1,m=P.index||1;return N-m}),M}),h=o.ref({}),u=o.computed(()=>{const M={};return i.value.params?Object.keys(i.value.params).forEach(S=>{M[S]=i.value.params[S]}):t.params&&Object.keys(t.params).forEach(S=>{M[S]=t.params[S]}),M});o.onMounted(()=>{t.editor?.ebus.$on("query-form-params",M=>{i.value.params=M}),R()});const f=e;function g({btn:M,event:S}){console.log("unione query form btn click",M,S),M.name=="query"&&R(),M.name=="reset"&&p(),f("btnClick",{btn:M,event:S})}function R(){const M=[];s.value.forEach(b=>{b.visible&&M.push(b.name)});const S={params:{...u.value},keywords:""};Object.keys(h.value).forEach(b=>{M.includes(b)&&(S.params[b]=h.value[b])}),n.value.visible&&h.value[n.value.name]&&(S.keywords=h.value[n.value.name]),f("query",S),t.editor?.ebus.$emit("table-list-search",S)}function p(){h.value={},s.value.forEach(S=>{S.visible=!1});const M={params:{...u.value},keywords:""};f("reset",M),t.editor?.ebus.$emit("table-list-reset",M)}return(M,S)=>{const b=o.resolveComponent("a-input"),P=o.resolveComponent("a-form-item"),N=o.resolveComponent("unione-btn"),m=o.resolveComponent("a-checkbox"),T=o.resolveComponent("DownOutlined"),y=o.resolveComponent("a-button"),x=o.resolveComponent("a-dropdown"),I=o.resolveComponent("a-form");return o.openBlock(),o.createBlock(Mi,{class:"unione-query-form",model:t.editor?.model.value,"setting-title":"查询设置"},o.createSlots({default:o.withCtx(()=>[o.createVNode(I,{model:h.value,layout:"horizontal","label-col":{span:l.value}},{default:o.withCtx(()=>[n.value.visible?(o.openBlock(),o.createBlock(P,{key:0,label:n.value.title,class:"query-field keywords",name:n.value.name,style:o.normalizeStyle({width:l.value})},{default:o.withCtx(()=>[o.createVNode(b,{placeholder:n.value.placeholder,value:h.value[n.value.name],"onUpdate:value":S[0]||(S[0]=V=>h.value[n.value.name]=V),allowClear:"",onKeyup:o.withKeys(R,["enter"])},null,8,["placeholder","value"])]),_:1},8,["label","name","style"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,V=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:V.name},[V.visible?(o.openBlock(),o.createBlock(P,{key:0,label:V.title,class:o.normalizeClass(["query-field",V.name]),style:o.normalizeStyle({width:l.value}),name:V.name},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(V.widget),o.mergeProps({placeholder:V.placeholder,value:h.value[V.name],"onUpdate:value":F=>h.value[V.name]=F,ref_for:!0},V.props||{},{allowClear:"",widget:V}),null,16,["placeholder","value","onUpdate:value","widget"]))]),_:2},1032,["label","class","style","name"])):o.createCommentVNode("",!0)],64))),128)),o.createElementVNode("div",lu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,V=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:V.name},[V.visible!=!1?(o.openBlock(),o.createBlock(N,{key:0,widget:V,editor:r.editor,onClick:g,preset:c},null,8,["widget","editor"])):o.createCommentVNode("",!0)],64))),128)),a.value.visible&&s.value.length?(o.openBlock(),o.createBlock(x,{key:0,class:"btn btn-advanced",trigger:[a.value.trigger||"hover"]},{overlay:o.withCtx(()=>[o.createElementVNode("div",ru,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,V=>(o.openBlock(),o.createBlock(m,{key:V.name,class:"item",checked:V.visible,onClick:F=>V.visible=!V.visible},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(V.title),1)]),_:2},1032,["checked","onClick"]))),128))])]),default:o.withCtx(()=>[o.createVNode(y,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(a.value.title)+" ",1),o.createVNode(T)]),_:1})]),_:1},8,["trigger"])):o.createCommentVNode("",!0)])]),_:1},8,["model","label-col"])]),_:2},[t.editor&&t.wid?{name:"widget-setting",fn:o.withCtx(()=>[o.createVNode(ou,{editor:t.editor,wid:t.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-05f95e36"]]),au={class:"unione-props-setting unione-table-setting"},cu={class:"unione-table-tools"},du={key:1,class:"unione-table-opts"},hu={key:0},uu=["onClick"],fu={key:1,class:"edit-field"},gu=["onClick"],Ru={key:1},pu=Le(o.defineComponent({__name:"tableSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(r){const e=r,t=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:x})=>x+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"显示",dataIndex:"isList",key:"isList",width:"30px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"30px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"},{title:"对齐方式",dataIndex:"align",key:"align",width:"55px",align:"center",options:[{value:"left",label:"居左"},{value:"center",label:"居中"},{value:"right",label:"居右"}],showLabel(x,I){let V=x.filter(F=>F.value==I);return V&&V[0]&&V[0].label||I}},{title:"固定位置",dataIndex:"fixed",key:"fixed",width:"55px",align:"center",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}],showLabel(x,I){let V=x.filter(F=>F.value==I);return V&&V[0]&&V[0].label||I}},{title:"列宽",dataIndex:"showWidth",key:"showWidth",width:"50px",align:"center"}]),i=o.computed(()=>{const x=e.editor.widget(e.wid)||{};return x.configs||(x.configs={}),x.configs.leftBtns||(x.configs.leftBtns=[]),x.configs.rightBtns||(x.configs.rightBtns=[]),x.configs.operation||(x.configs.operation={}),x.configs.operation.btns||(x.configs.operation.btns=[]),x.configs.operation.more||(x.configs.operation.more={}),x}),n=o.computed(()=>(e.editor.dataModels()||[]).map(I=>({value:I.sn,label:I.title+"("+I.name+")"}))),s=o.computed(()=>{if(!i.value)return[];const x=[],I=i.value.configs.leftBtns;if(I.forEach(V=>{x.push(V.name)}),!x.includes("add")){const V={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};I.splice(0,0,V)}if(!x.includes("delBatch")){const V={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};I.splice(1,0,V)}return I}),l=o.computed(()=>{if(!i.value)return[];const x=[],I=i.value.configs.rightBtns;if(I.forEach(V=>{x.push(V.name)}),!x.includes("downData")){const V={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"导出",index:0,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downData"};I.splice(0,0,V)}if(!x.includes("impData")){const V={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};I.splice(1,0,V)}if(!x.includes("expData")){const V={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};I.splice(2,0,V)}if(!x.includes("downTmpl")){const V={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};I.splice(3,0,V)}return I});function a(x,I){x=="left"?h.value.open(I,V=>{V.visible=!0,Object.keys(V).forEach(F=>{I[F]=V[F]}),i.value.configs.leftBtns.sort((F,L)=>{const w=F.index||1,v=L.index||1;return w-v}),i.value.configs.leftBtns=[...i.value.configs.leftBtns]}):h.value.open(I,V=>{V.visible=!0,Object.keys(V).forEach(F=>{I[F]=V[F]}),i.value.configs.rightBtns.sort((F,L)=>{const w=F.index||1,v=L.index||1;return w-v}),i.value.configs.rightBtns=[...i.value.configs.rightBtns]})}function c(x){const I=x=="left"?i.value.configs.leftBtns.length:i.value.configs.rightBtns.length;let V={title:"新增"+I,name:"new_"+I,index:I,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};x=="left"?i.value.configs.leftBtns.push(V):i.value.configs.rightBtns.push(V),e.editor.widget(e.wid,i.value),a(x,V)}function d(x,I){const V=()=>{if(["add","delBatch","expData","impData","downTmpl"].includes(I.name))I.visible=!1,x=="left"?i.value.configs.leftBtns=[...i.value.configs.leftBtns]:i.value.configs.rightBtns=[...i.value.configs.rightBtns];else if(x=="left"){const F=[];i.value.configs.leftBtns.forEach(L=>{L.name!=I.name&&F.push(L)}),i.value.configs.leftBtns=F}else{const F=[];i.value.configs.rightBtns.forEach(L=>{L.name!=I.name&&F.push(L)}),i.value.configs.rightBtns=F}};ge.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{V()}})}const h=o.ref(null);function u(x){h.value.open(x,I=>{I.visible=!0,Object.keys(I).forEach(V=>{x[V]=I[V]}),i.value.configs.operation.btns.sort((V,F)=>{const L=V.index||1,w=F.index||1;return L-w}),i.value.configs.operation.btns=[...i.value.configs.operation.btns]})}function f(){const x=i.value.configs.operation.btns.length+1;let I={title:"新增"+x,name:"new_"+x,index:x,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};i.value.configs.operation.btns.push(I),e.editor.widget(e.wid,i.value),h.value.open(I,V=>{Object.keys(V).forEach(F=>{I[F]=V[F]}),i.value.configs.operation.btns=[...i.value.configs.operation.btns]})}function g(x){const I=()=>{if(["delete","view","edit"].includes(x.name))x.visible=!1,i.value.configs.operation.btns=[...i.value.configs.operation.btns];else{const V=[];i.value.configs.operation.btns.forEach(F=>{F.name!=x.name&&V.push(F)}),i.value.configs.operation.btns=V}};ge.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{I()}})}const R=o.computed(()=>e.editor?.dataModel(i.value.dataModel||"none")||{}),p=o.computed(()=>R.value.fields?.length?(R.value.fields.forEach(x=>{x.show||(x.show={}),x.show.list||(x.show.list={})}),R.value.fields):[]),M={mounted:x=>x.focus()},S=o.ref({});function b(){const x=Object.keys(S.value);if(x.length)for(let I in x){const V=p.value.filter(F=>F.name==I);if(V&&V[0]){let F=S.value[I];Object.keys(F).forEach(L=>{V[0].show||(V[0].show={}),V[0].show.list||(V[0].show.list={}),L=="showIndex"?V[0].show.list.index=F[L]:L=="showWidth"?V[0].show.list.width=F[L]:L=="fixed"?V[0].show.list.fixed=F[L]:L=="align"?V[0].show.list.align=F[L]:V[0][L]=F[L]})}}S.value={}}function P(x,I){b();const V={};I=="showIndex"?V[I]=x.show?.list?.index:I=="showWidth"?V[I]=x.show?.list?.width:I=="fixed"?V[I]=x.show?.list?.fixed:I=="align"?V[I]=x.show?.list?.align:V[I]=x[I]||"",S.value[x.name]=V}function N(x,I){if(!x||!I){S.value={};return}const V=S.value[x.name][I];x.show||(x.show={}),x.show.list||(x.show.list={}),I=="showIndex"?x.show.list.index=V:I=="showWidth"?x.show.list.width=V:I=="fixed"?x.show.list.fixed=V:I=="align"?x.show.list.align=V:x[I]=V,S.value={}}function m(x,I){return I=="showIndex"?x.show?.list?.index:I=="showWidth"?x.show?.list?.width:I=="fixed"?x.show?.list?.fixed:I=="align"?x.show?.list?.align:x[I]}function T(x,I){p.value.filter(F=>F.name==x.name).forEach(F=>{F[I]=!F[I]})}const y=o.ref({options:[{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:x=>{const I=y.value.options.filter(V=>V.value==x);return I[0]?I[0].label:x}});return(x,I)=>{const V=o.resolveComponent("a-divider"),F=o.resolveComponent("CloseOutlined"),L=o.resolveComponent("a-button"),w=o.resolveComponent("PlusOutlined"),v=o.resolveComponent("a-input"),X=o.resolveComponent("a-form-item"),C=o.resolveComponent("a-col"),Z=o.resolveComponent("a-input-number"),k=o.resolveComponent("a-checkbox"),Q=o.resolveComponent("a-row"),Y=o.resolveComponent("a-select"),W=o.resolveComponent("ToolOutlined"),H=o.resolveComponent("a-table");return o.openBlock(),o.createElementBlock("div",au,[o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[8]||(I[8]=[o.createTextVNode("工具设置")])),_:1}),o.createElementVNode("div",cu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,U=>(o.openBlock(),o.createBlock(L,o.mergeProps({key:U.name,class:["btn",U.name,!U.visible&&"deleted"],type:U.visible?U.type:"default",size:U.size,ref_for:!0},U.props||{},{onClick:K=>a("left",U)}),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(U.title)+" ",1),U.visible?(o.openBlock(),o.createBlock(F,{key:0,class:"bool-del",onClick:o.withModifiers(K=>d("left",U),["stop"])},null,8,["onClick"])):o.createCommentVNode("",!0)]),_:2},[U.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(U.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),o.createVNode(L,{class:o.normalizeClass(["btn","tool-add"]),size:"small",onClick:I[0]||(I[0]=U=>c("left"))},{default:o.withCtx(()=>[o.createVNode(w)]),_:1}),o.createVNode(L,{class:o.normalizeClass(["btn","tool-add","right"]),onClick:I[1]||(I[1]=U=>c("right")),size:"small"},{default:o.withCtx(()=>[o.createVNode(w)]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,U=>(o.openBlock(),o.createBlock(L,o.mergeProps({key:U.name,class:["btn","right",U.name,!U.visible&&"deleted"],type:U.visible?U.type:"default",size:U.size,ref_for:!0},U.props||{},{onClick:K=>a("right",U)}),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(U.title)+" ",1),U.visible?(o.openBlock(),o.createBlock(F,{key:0,class:"bool-del",onClick:o.withModifiers(K=>d("right",U),["stop"])},null,8,["onClick"])):o.createCommentVNode("",!0)]),_:2},[U.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(U.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128))]),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[9]||(I[9]=[o.createTextVNode("操作设置")])),_:1}),i.value?.configs?.operation?(o.openBlock(),o.createBlock(Q,{key:0},{default:o.withCtx(()=>[o.createVNode(C,{span:7},{default:o.withCtx(()=>[o.createVNode(X,{label:"操作标题"},{default:o.withCtx(()=>[o.createVNode(v,{value:i.value.configs.operation.title},null,8,["value"])]),_:1})]),_:1}),o.createVNode(C,{span:5},{default:o.withCtx(()=>[o.createVNode(X,{label:"显示宽度",labelCol:{span:9}},{default:o.withCtx(()=>[o.createVNode(Z,{value:i.value.configs.operation.width,"onUpdate:value":I[2]||(I[2]=U=>i.value.configs.operation.width=U)},null,8,["value"])]),_:1})]),_:1}),o.createVNode(C,{span:6},{default:o.withCtx(()=>[o.createVNode(X,{label:"显示按钮数量",labelCol:{span:9}},{default:o.withCtx(()=>[o.createVNode(Z,{value:i.value.configs.operation.count,"onUpdate:value":I[3]||(I[3]=U=>i.value.configs.operation.count=U)},null,8,["value"])]),_:1})]),_:1}),o.createVNode(C,{span:5},{default:o.withCtx(()=>[o.createVNode(X,{label:"是否显示"},{default:o.withCtx(()=>[o.createVNode(k,{checked:i.value.configs.operation.visible,"onUpdate:checked":I[4]||(I[4]=U=>i.value.configs.operation.visible=U)},null,8,["checked"])]),_:1})]),_:1})]),_:1})):o.createCommentVNode("",!0),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[10]||(I[10]=[o.createTextVNode("操作按钮")])),_:1}),i.value?.configs?.operation?(o.openBlock(),o.createElementBlock("div",du,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value.configs.operation.btns,U=>(o.openBlock(),o.createBlock(L,o.mergeProps({key:U.name,class:["btn",U.name,!U.visible&&"deleted"],type:U.visible?U.type:"default",size:U.size||"small",ref_for:!0},U.props||{},{onClick:K=>u(U)}),o.createSlots({default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(U.title)+" ",1),U.visible?(o.openBlock(),o.createBlock(F,{key:0,class:"btn-del",onClick:o.withModifiers(K=>g(U),["stop"])},null,8,["onClick"])):o.createCommentVNode("",!0)]),_:2},[U.icon?{name:"icon",fn:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(U.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),o.createVNode(L,{class:o.normalizeClass(["btn","btn-add"]),onClick:I[5]||(I[5]=U=>f()),size:"small"},{default:o.withCtx(()=>[o.createVNode(w)]),_:1})])):o.createCommentVNode("",!0),o.createVNode(V,{orientation:"left"},{default:o.withCtx(()=>I[11]||(I[11]=[o.createTextVNode("表头设置")])),_:1}),I[12]||(I[12]=o.createTextVNode(" 数据模型:")),o.createVNode(Y,{class:"data-model-list",options:n.value,value:i.value.dataModel,"onUpdate:value":I[6]||(I[6]=U=>i.value.dataModel=U)},null,8,["options","value"]),o.createVNode(H,{columns:t.value,"data-source":p.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:U})=>[["showIndex","showWidth","align","fixed"].includes(U.key)?(o.openBlock(),o.createElementBlock("span",hu,[o.createVNode(W),o.createTextVNode(" "+o.toDisplayString(U.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:U,record:K})=>[["showIndex","showWidth"].includes(U.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!S.value[K.name]||!Object.keys(S.value[K.name]).includes(U.dataIndex))&&!m(K,U.dataIndex)&&"empty"]),onClick:_=>P(K,U.dataIndex)},[S.value[K.name]&&Object.keys(S.value[K.name]).includes(U.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(Z,{key:0,value:S.value[K.name][U.dataIndex],"onUpdate:value":_=>S.value[K.name][U.dataIndex]=_,onBlur:_=>N(K,U.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[M]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(m(K,U.dataIndex)),1)],64))],10,uu)):["isList","isQuery","isSort"].includes(U.dataIndex)?(o.openBlock(),o.createElementBlock("div",fu,[o.createVNode(k,{checked:K[U.dataIndex],onClick:_=>T(K,U.dataIndex)},null,8,["checked","onClick"])])):["align","fixed"].includes(U.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!S.value[K.name]||!Object.keys(S.value[K.name]).includes(U.dataIndex))&&!m(K,U.dataIndex)&&"empty"]),onClick:_=>P(K,U.dataIndex)},[S.value[K.name]&&Object.keys(S.value[K.name]).includes(U.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(Y,{key:0,value:K.show.list[U.dataIndex],"onUpdate:value":_=>K.show.list[U.dataIndex]=_,allowClear:!0,options:U.options,onBlur:I[7]||(I[7]=_=>N())},null,8,["value","onUpdate:value","options"])),[[M]]):(o.openBlock(),o.createElementBlock("span",Ru,o.toDisplayString(U.showLabel(U.options,m(K,U.dataIndex))),1))],10,gu)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(as,{ref_key:"btnSetting",ref:h,preset:["edit","view","add","delBatch","expData","impData","downTmpl"]},null,512)])}}}),[["__scopeId","data-v-c966c24c"]]);function Mo(r){const e=r.toLowerCase().split("_"),t=[];t.push(e[0]);for(let i=1;i<e.length;i++){const n=e[i];n&&(t.push(n.charAt(0).toUpperCase()),n.length>1&&t.push(n.substring(1)))}return t.join("")}const mu={toHump:Mo},Su={class:"unione-table-tools"},Mu={class:"unione-table-data"},Nu={key:0,class:"unione-table-opts"},Mr=Le(o.defineComponent({__name:"tableList",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},loading:{type:Boolean,default:!1},pagination:{type:Object,required:!1},dataList:{type:Array,default(){return[]}},rowKey:{type:String,default:"id"}},emits:["edit","view","add","delete","delBatch","expData","impData","downTmpl","leftBtnClick","rightBtnClick","optBtnClick","btnClick","change"],setup(r,{expose:e,emit:t}){const i=Dt(),n=r,s=o.computed(()=>n.editor?.widget(n.wid)||n.widget||{}),l=o.computed(()=>s.value.props||{}),a=o.computed(()=>s.value.rowKey||n.rowKey||"id"),c=o.computed(()=>s.value.dsn?n.editor?.dataManager().use(s.value.dsn,"list"):null),d=o.computed(()=>{const w=n.dataList||[];return!w.length&&c.value?c.value.data().body||[]:w}),h=o.computed(()=>{if(s.value.operation==!1)return{visible:!1};const w=te.utils.obj.ext(s.value.operation||{},{title:"操作",width:200,count:2,btns:[],more:{title:"更多",visible:!0,trigger:"hover",size:"small",layout:"horizontal",items:[]}}),v=[];let X=(s.value.operation?.btns||[]).map(C=>(typeof C=="string"&&(C={name:C,visible:!1}),C));if(X.forEach(C=>{v.push(C.name)}),v.includes("edit")||X.splice(0,0,{title:"编辑",name:"edit",type:"default",visible:!0}),v.includes("view")||X.splice(1,0,{title:"查看",name:"view",type:"default",visible:!0}),v.includes("delete")||X.push({title:"删除",name:"delete",type:"default",props:{danger:!0},visible:!0}),n.editor&&n.editor.type.value!="code"){const C=X.filter(k=>k.name=="edit")[0];if(C.visible&&(C.action||(C.action={}),C.action.type||(C.action.type="route"),!C.action.href)){const k=(n.editor.sn().endsWith(":list")?n.editor.sn().substring(0,n.editor.sn().length-5):n.editor.sn())+":form",Q=n.editor.model.value;C.action.link=i.editPageUrl+"?psn="+k+"&model="+Q+"&id={row."+n.rowKey+"}"}const Z=X.filter(k=>k.name=="view")[0];if(Z.visible&&(Z.action||(Z.action={}),Z.action.type||(Z.action.type="route"),!Z.action.href)){const k=(n.editor.sn().endsWith(":list")?n.editor.sn().substring(0,n.editor.sn().length-5):n.editor.sn())+":form";Z.action.link=i.viewPageUrl+"?psn="+k+"&model=view&id={row."+n.rowKey+"}"}}return X=X.filter(C=>C.visible!=!1).sort((C,Z)=>{const k=C.index||1,Q=Z.index||1;return k-Q}),w.count&&(X.length>w.count+1?(w.btns=X.slice(0,w.count),w.more.items=X.slice(w.count,X.length),w.more.visible=!0):(w.btns=X,w.more.visible=!1)),w}),u=o.computed(()=>{let w=[];s.value.columns?.length&&(w=[...s.value.columns]);const v=[];w.forEach((C,Z)=>{C.dataIndex=C.name,C.convert&&(C.dataIndex=C.name+"Label",C.convertObj=new ri(C.convert),C.customCell=(k,Q,Y)=>{const W=k[Y.name];C.convertObj&&(k[Y.dataIndex]==null||k[Y.dataIndex]==null)&&W!=null&&W!=null&&(W+"").length>0&&(k[Y.dataIndex]=W,C.convertObj.convert(W).then(H=>{H&&(k[Y.dataIndex]=H)}))}),C.sort?.enable&&(C.sorter=!0,C.sort.multiple&&(C.sorter={},C.sorter.multiple=C.sort.multiple),C.sort.defoult&&(C.defaultSortOrder=C.sort.asc?"ascend":"descend")),C.customRender=({text:k})=>k||"--",C.fkey?.enable&&(C.fkey.labelName&&(C.dataIndex=Mo(C.fkey.labelName)),C.fkey.labelTitle&&(C.title=C.fkey.labelTitle),C.customRender=({record:k,column:Q})=>k&&k[Q.name+"FEntry"]&&k[Q.name+"FEntry"][Q.dataIndex]||"--",C.fkey.fields?.forEach((k,Q)=>{if(!k.name)return;const Y=Mo(k.name),W={fkName:C.name,title:k.title,name:Y,dataIndex:k.name,width:k.width,index:k.index||Z+Q+1,customRender:({record:H,column:U})=>{if(H&&H[U.fkName+"FEntry"]){const K=H[U.fkName+"FEntry"][U.name];if(K)return k.convertObj&&k.convertObj.convert(K)||K}return"--"}};k.convert&&(k.convertObj=new ri(k.convert)),v.push(W)}))}),v.forEach(C=>{w.splice(C.index,0,C)});const X=te.utils.obj.ext(s.value.rownum,{title:"序号",fixed:"left",align:"center",width:60,visible:!0});return X&&X.visible!=!1&&(X.customRender=C=>P.value?(P.value.current-1)*P.value.pageSize+C.index+1:C.index,w=[X,...w]),h.value&&h.value.visible!=!1&&w.push({fixed:"right",align:"center",...h.value,name:"operation"}),w}),f=o.computed(()=>{if(s.value.leftBtns===!1)return[];const w=[],v=[];if((s.value.leftBtns||[]).map(C=>(typeof C=="string"&&(C={name:C,visible:!1}),C)).forEach(C=>{C.visible!=!1&&w.push(C),v.push(C.name),C.name=="delBatch"&&!N.value&&(C.visible=!1)}),!v.includes("add")){const C={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};w.splice(0,0,C)}if(!v.includes("delBatch")&&N.value){const C={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};w.splice(1,0,C)}if(n.editor&&n.editor.type.value!="code"){const C=w.filter(Z=>Z.name=="add")[0];if(C.visible&&(C.action||(C.action={}),C.action.type||(C.action.type="route"),!C.action.href)){const Z=(n.editor.sn().endsWith(":list")?n.editor.sn().substring(0,n.editor.sn().length-5):n.editor.sn())+":form",k=n.editor.model.value;C.action.link=i.addPageUrl+"?psn="+Z+"&model="+k}}return w});function g({btn:w,event:v}){if(i.isDebug&&console.log("unione table left btn click",w,v),w.name=="delBatch"){if(!m.value.selectedRowKeys.length){ge.Modal.info({title:"提示信息",content:"请选择要删除的记录!"});return}if(c.value){c.value.deleteByIds(m.value.selectedRowKeys).then(()=>{F(),V(!0)});return}ge.Modal.confirm({title:"确认信息",content:"请确认是否要删除选中的("+m.value.selectedRowKeys.length+")数据",onOk:()=>{y("delBatch",{btn:w,event:v,keys:m.value.selectedRowKeys}),y("leftBtnClick",{btn:w,event:v,keys:m.value.selectedRowKeys}),y("btnClick",{btn:w,event:v,keys:m.value.selectedRowKeys})}});return}y(w.name,{btn:w,event:v}),y("leftBtnClick",{btn:w,event:v}),y("btnClick",{btn:w,event:v})}const R=o.computed(()=>{if(s.value.rightBtns===!1)return[];const w=[],v=[];if((s.value.rightBtns||[]).map(C=>(typeof C=="string"&&(C={name:C,visible:!1}),C)).forEach(C=>{C.visible!=!1&&w.push(C),v.push(C.name)}),!v.includes("impData")){const C={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};w.splice(1,0,C)}if(!v.includes("expData")){const C={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};w.splice(2,0,C)}if(!v.includes("downTmpl")){const C={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};w.splice(3,0,C)}return w});function p({btn:w,event:v}){i.isDebug&&console.log("unione table right btn click",w,v),y(w.name,{btn:w,event:v}),y("rightBtnClick",{btn:w,event:v}),y("btnClick",{btn:w,event:v})}const M=o.computed(()=>({bordered:!0,size:"small",...s.value.attrs||{}})),S=o.ref({}),b=o.ref(null),P=o.computed(()=>te.utils.obj.ext(n.pagination||s.value.pagination,{showTotal:w=>"共"+w+"记录",pageSize:n.pagination?.pageSize||c.value?.data()?.pageSize||10,current:n.pagination?.current||c.value?.data()?.page||1,total:n.pagination?.total||c.value?.data()?.total||0,position:["bottomCenter"]})),N=o.computed(()=>typeof s.value.selection<"u"?s.value.selection:!0),m=o.ref({selectedRowKeys:[],selectedRowList:[],onChange:(w,v)=>{m.value.selectedRowKeys=w,m.value.selectedRowList=v},getCheckboxProps:w=>({disabled:w.checkable})}),T=["edit","view","add","delete","delBatch","impData","expData","downTmpl"],y=t;function x({btn:w,event:v},X){if(i.isDebug&&console.log("unione table opt btn click",w,v),w.name=="delete"){if(c.value){c.value.deleteByIds([X[a.value]]).then(()=>{F(),m.value.selectedRowKeys=m.value.selectedRowKeys.filter(C=>C!=X[a.value]),m.value.selectedRowList=m.value.selectedRowList.filter(C=>C[a.value]!=X[a.value])});return}ge.Modal.confirm({title:"确认信息",content:"请确认是否要删除该记录?",onOk:()=>{y(w.name,{btn:w,event:v,row:X}),y("optBtnClick",{btn:w,event:v,row:X}),y("btnClick",{btn:w,event:v,row:X})}});return}y(w.name,{btn:w,event:v,row:X}),y("optBtnClick",{btn:w,event:v,row:X}),y("btnClick",{btn:w,event:v,row:X})}function I(w,v,X,C){console.log("tableChanged",w,v,X,C),b.value={page:w.current,pageSize:w.pageSize},X&&(Array.isArray(X)?(b.value.sorts=[],X.forEach(Z=>{b.value.sorts.push({name:Z.column.name,asc:Z.order=="ascend"})})):X.column&&(b.value.sorts=[{name:X.column.name,asc:X.order=="ascend"}])),F(),y("change",{pagination:w,filters:v,sorter:X,event:C})}function V(w=!1){w?(m.value.selectedRowKeys=[],m.value.selectedRowList=[]):ge.Modal.confirm({title:"确认信息",content:`确定要清除当前选中的(${m.value.selectedRowKeys.length})条数据?`,centered:!0,onOk:()=>{m.value.selectedRowKeys=[],m.value.selectedRowList=[]}})}function F(){if(c.value){const w={page:P.value.current,pageSize:P.value.pageSize,keywords:S.value.keywords,body:S.value.params||{}};b.value?.page&&(w.page=b.value.page),b.value?.pageSize&&(w.pageSize=b.value.pageSize),b.value?.sorts&&(w.sorts=b.value.sorts),console.log("dataStorage find params",w),c.value.find(w)}}o.onMounted(()=>{u.value?.forEach(w=>{w.sort?.enable&&w.sort.defoult&&(b.value||(b.value={},b.value.sorts||(b.value.sorts=[]),b.value.sorts.push({name:w.name,asc:w.sort.asc==!0})))}),n.editor?.ebus.$on("table-list-search",w=>{console.log("table-list-search",w),S.value=w||{},F()}),n.editor?.ebus.$on("table-list-reset",()=>{console.log("table-list-reset"),S.value={},F(),V(!0)}),n.editor?.ebus.$on("table-list-reload",()=>{console.log("table-list-reload"),F()})});function L(){return{keys:m.value.selectedRowKeys,rows:m.value.selectedRowList}}return e({getSelected:L,clearSelected:V}),(w,v)=>{const X=o.resolveComponent("unione-btn"),C=o.resolveComponent("DownOutlined"),Z=o.resolveComponent("a-button"),k=o.resolveComponent("a-dropdown"),Q=o.resolveComponent("a-table");return o.openBlock(),o.createBlock(Mi,{class:"unione-table-list",model:n.editor?.model.value,"setting-title":"列表设置"},o.createSlots({default:o.withCtx(()=>[o.createElementVNode("div",Su,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,Y=>(o.openBlock(),o.createBlock(X,{key:Y.name,class:"btn",widget:Y,editor:r.editor,onClick:g,preset:T,ctx:{sltKeys:m.value.selectedRowKeys,sltRows:m.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128)),m.value.selectedRowKeys.length?(o.openBlock(),o.createElementBlock("span",{key:0,class:"selected-info",onClick:v[0]||(v[0]=Y=>V())},"当前选中记录("+o.toDisplayString(m.value.selectedRowKeys.length)+")",1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(R.value,Y=>(o.openBlock(),o.createBlock(X,{key:Y.name,class:"btn right",widget:Y,editor:r.editor,onClick:p,preset:T,ctx:{sltKeys:m.value.selectedRowKeys,sltRows:m.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128))]),o.createElementVNode("div",Mu,[u.value&&u.value.length?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:0,columns:u.value,rowKey:a.value,"data-source":d.value,"row-selection":N.value?m.value:null,scroll:{x:l.value.scrollX||"max-content",y:l.value.scrollY},pagination:P.value,onChange:I},M.value),{bodyCell:o.withCtx(({column:Y,record:W})=>[Y.name==="operation"?(o.openBlock(),o.createElementBlock("div",Nu,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h.value.btns,H=>(o.openBlock(),o.createBlock(X,{key:H.name,class:"opt",widget:H,editor:r.editor,onClick:U=>x(U,W),preset:T,ctx:{row:W}},null,8,["widget","editor","onClick","ctx"]))),128)),h.value.more?.visible!=!1&&h.value.more.items?.length?(o.openBlock(),o.createBlock(k,{key:0,trigger:[h.value.more.trigger||"hover"],class:o.normalizeClass(["opt-more",h.value.more.size||"small"])},{overlay:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["opt-more-overlay",h.value.more.layout])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(h.value.more.items,H=>(o.openBlock(),o.createBlock(X,{key:H.name,class:"item",widget:H,editor:r.editor,onClick:U=>x(U,W),type:"text",preset:T,ctx:{row:W}},null,8,["widget","editor","onClick","ctx"]))),128))],2)]),default:o.withCtx(()=>[o.createVNode(Z,null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.value.more.title)+" ",1),o.createVNode(C)]),_:1})]),_:2},1032,["trigger","class"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),_:1},16,["columns","rowKey","data-source","row-selection","scroll","pagination"])):o.createCommentVNode("",!0)])]),_:2},[n.editor&&n.wid?{name:"widget-setting",fn:o.withCtx(()=>[o.createVNode(pu,{editor:n.editor,wid:n.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-d11fa152"]]);(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.id="canvas-editor-style",r.appendChild(document.createTextNode('.ce-select-control-popup{max-width:160px;min-width:69px;max-height:225px;position:absolute;z-index:1;border:1px solid #e4e7ed;border-radius:4px;background-color:#fff;box-shadow:0 2px 12px #0000001a;box-sizing:border-box;margin:5px 0;overflow-y:auto}.ce-select-control-popup ul{list-style:none;padding:3px 0;margin:0;box-sizing:border-box}.ce-select-control-popup ul li{font-size:13px;padding:0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#666;height:36px;line-height:36px;box-sizing:border-box;cursor:pointer}.ce-select-control-popup ul li:hover{background-color:#eef2fd}.ce-select-control-popup ul li.active{color:var(--COLOR-HOVER, #5175f4);font-weight:700}.ce-date-container{display:none;width:300px;overflow:hidden;left:0;right:0;position:absolute;z-index:1;color:#606266;background:#ffffff;border-radius:4px;padding:10px;user-select:none;border:1px solid #e4e7ed;box-shadow:0 2px 12px #0000001a}.ce-date-container.active{display:block}.ce-date-wrap{display:none}.ce-date-wrap.active{display:block}.ce-date-title{display:flex;justify-content:center;align-items:center;text-align:center;color:#606266;font-size:16px}.ce-date-title>span{display:inline-block}.ce-date-title>span:not(.ce-date-title__now){font-family:cursive;cursor:pointer}.ce-date-title>span:not(.ce-date-title__now):hover{color:#5175f4}.ce-date-title .ce-date-title__pre-year,.ce-date-title .ce-date-title__pre-month{width:15%}.ce-date-title .ce-date-title__now{width:40%}.ce-date-title .ce-date-title__next-year,.ce-date-title .ce-date-title__next-month{width:15%}.ce-date-week{width:100%;display:flex;justify-content:center;margin-top:15px;padding-bottom:5px;border-bottom:1px solid #e4e7ed}.ce-date-week>span{list-style:none;width:14.28571%;text-align:center;color:#606266;font-size:14px}.ce-date-day{width:100%;display:flex;flex-wrap:wrap;align-items:center;margin-top:5px}.ce-date-day>div{width:14.28571%;height:40px;text-align:center;color:#606266;font-size:14px;cursor:pointer;line-height:40px;border-radius:4px}.ce-date-day>div:hover{color:#5175f4;opacity:.8}.ce-date-day>div.active{color:#5175f4;font-weight:700}.ce-date-day>div.disable{color:#c0c4cc}.ce-date-day>div.select{color:#fff;background-color:#5175f4}.ce-time-wrap{display:none;padding:10px;height:286px}.ce-time-wrap ::-webkit-scrollbar{width:0}.ce-time-wrap.active{display:flex}.ce-time-wrap li{list-style:none}.ce-time-wrap>li{width:33.3%;height:100%;text-align:center}.ce-time-wrap>li>span{transform:translateY(-5px);display:inline-block}.ce-time-wrap>li>ol{height:calc(100% - 20px);overflow-y:auto;border:1px solid #e2e2e2;position:relative}.ce-time-wrap>li:first-child>ol{border-right:0}.ce-time-wrap>li:last-child>ol{border-left:0}.ce-time-wrap>li>ol>li{line-height:30px;cursor:pointer;transition:all .3s}.ce-time-wrap>li>ol>li:hover{background-color:#eaeaea}.ce-time-wrap>li>ol>li.active{color:#fff;background:#5175F4}.ce-date-menu{width:100%;height:28px;display:flex;justify-content:flex-end;align-items:center;padding-top:10px;position:relative;border-top:1px solid #e4e7ed}.ce-date-menu button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;appearance:none;text-align:center;box-sizing:border-box;outline:none;transition:.1s;font-weight:500;user-select:none;padding:7px 15px;font-size:12px;border-radius:3px;margin:0 0 0 10px}.ce-date-menu button:hover{color:#5175f4;border-color:#5175f4}.ce-date-menu button.ce-date-menu__time{border:1px solid transparent;position:absolute;left:0;margin-left:0}.ce-date-menu button.ce-date-menu__time:hover{color:#5175f4}.ce-block-item{position:absolute;z-index:0;overflow:hidden;border-radius:8px;background-color:#fff;border:1px solid rgb(235 236 240)}.ce-table-tool__row{position:absolute;width:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed}.ce-table-tool__row .ce-table-tool__row__item{width:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__row .ce-table-tool__row__item:after{content:"";position:absolute;bottom:0;left:2px;width:8px;height:1px;background-color:#c0c6cf}.ce-table-tool__row .ce-table-tool__row__item:hover{background-color:#dadce0}.ce-table-tool__row .ce-table-tool__row__item:last-child:after{display:none}.ce-table-tool__quick__add{width:16px;height:16px;position:absolute;border-radius:50%;background-color:#e2e6ed;cursor:pointer}.ce-table-tool__quick__add:after{content:"+";color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-55%)}.ce-table-tool__select{width:16px;height:18px;position:absolute;border-radius:3px;cursor:pointer}.ce-table-tool__select:hover{background-color:#e2e6ed}.ce-table-tool__select:after{content:":::";color:#aaaaab;position:absolute;top:50%;left:50%;transform:translate(-75%,-50%) rotate(-90deg)}.ce-table-tool__col{position:absolute;height:12px;border-radius:6.5px;overflow:hidden;background-color:#e2e6ed;display:flex}.ce-table-tool__col .ce-table-tool__col__item{height:100%;position:relative;cursor:pointer;transition:all .3s}.ce-table-tool__col .ce-table-tool__col__item:after{content:"";position:absolute;top:2px;left:-1px;width:1px;height:8px;z-index:1;background-color:#c0c6cf}.ce-table-tool__col .ce-table-tool__col__item:hover{background-color:#dadce0}.ce-table-tool__col .ce-table-tool__col__item:first-child:after{display:none}.ce-table-tool__row .ce-table-tool__row__item.active,.ce-table-tool__col .ce-table-tool__col__item.active{background-color:#c4d7fa}.ce-table-tool__col .ce-table-tool__anchor{right:-5px;width:10px;height:12px;z-index:9;position:absolute;cursor:col-resize}.ce-table-tool__row .ce-table-tool__anchor{bottom:-5px;left:0;width:12px;height:10px;z-index:9;position:absolute;cursor:row-resize}.ce-table-anchor__line{z-index:9;position:absolute;border:1px dotted #000000}.ce-table-tool__border{position:absolute;z-index:1;background:transparent;pointer-events:none}.ce-table-tool__border__row{position:absolute;cursor:row-resize;pointer-events:auto}.ce-table-tool__border__col{position:absolute;cursor:col-resize;pointer-events:auto}.ce-resizer-selection{position:absolute;border:1px solid;pointer-events:none}.ce-resizer-selection .resizer-handle{position:absolute;z-index:9;width:10px;height:10px;box-shadow:0 1px 4px #0000004d;border-radius:5px;border:2px solid #ffffff;box-sizing:border-box;pointer-events:initial}.ce-resizer-selection .handle-0{cursor:nw-resize}.ce-resizer-selection .handle-1{cursor:n-resize}.ce-resizer-selection .handle-2{cursor:ne-resize}.ce-resizer-selection .handle-3{cursor:e-resize}.ce-resizer-selection .handle-4{cursor:se-resize}.ce-resizer-selection .handle-5{cursor:s-resize}.ce-resizer-selection .handle-6{cursor:sw-resize}.ce-resizer-selection .handle-7{cursor:w-resize}.ce-resizer-size-view{display:flex;align-items:center;height:20px;white-space:nowrap;position:absolute;z-index:9;top:-30px;left:0;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px}.ce-resizer-size-view span{color:#fff;font-size:12px}.ce-resizer-image{position:absolute;opacity:.5}.ce-image-previewer{position:fixed;left:0;top:0;z-index:1000;width:100%;height:100%;overflow:hidden;background:#f2f4f7;display:flex;align-items:center;justify-content:center;animation:previewerAnimation .3s}@keyframes previewerAnimation{0%{opacity:.1}to{opacity:1}}.ce-image-previewer .image-close{width:24px;height:24px;display:inline-block;position:absolute;right:50px;top:30px;z-index:99;cursor:pointer;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIzLjk3IDdsMS40MTUgMS40MTQtNy43NzkgNy43NzggNy43NzkgNy43NzktMS40MTQgMS40MTQtNy43NzktNy43NzktNy43NzggNy43NzlMNyAyMy45N2w3Ljc3OC03Ljc3OUw3IDguNDE0IDguNDE0IDdsNy43NzggNy43NzhMMjMuOTcxIDd6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=) no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .image-close:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-container{position:relative}.ce-image-previewer .ce-image-container img{cursor:move;position:relative}.ce-image-previewer .ce-image-menu{height:50px;position:absolute;bottom:50px;z-index:99;display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i{width:32px;height:32px;margin:0 8px;cursor:pointer;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;transition:all .3s;border-radius:50%}.ce-image-previewer .ce-image-menu i:hover{background-color:#e2e6ed}.ce-image-previewer .ce-image-menu i.zoom-in{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0IDE0di00aDJ2NGg0djJoLTR2NGgtMnYtNGgtNHYtMmg0em04Ljc0OSAxMC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.zoom-out{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIyLjc0OSAyNC4xNjNBMTEuOTUyIDExLjk1MiAwIDAxMTUgMjdDOC4zNzMgMjcgMyAyMS42MjcgMyAxNVM4LjM3MyAzIDE1IDNzMTIgNS4zNzMgMTIgMTJjMCAyLjk1NC0xLjA2NyA1LjY1OC0yLjgzNyA3Ljc0OWw0LjkwOCA0LjkwOC0xLjQxNCAxLjQxNC00LjkwOC00LjkwOHpNMTUgMjVjNS41MjMgMCAxMC00LjQ3NyAxMC0xMFMyMC41MjMgNSAxNSA1IDUgOS40NzcgNSAxNXM0LjQ3NyAxMCAxMCAxMHptLTUtMTFoMTB2MkgxMHYtMnoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.rotate{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTYgNGM2LjYyNyAwIDEyIDUuMzczIDEyIDEyYTExLjk3IDExLjk3IDAgMDEtNCA4Ljk0NFYyM2gtLjg2QTkuOTY4IDkuOTY4IDAgMDAyNiAxNmMwLTUuNTIzLTQuNDc3LTEwLTEwLTEwUzYgMTAuNDc3IDYgMTZjMCA1LjE4NSAzLjk0NyA5LjQ0OSA5IDkuOTV2Mi4wMDlDOC44NCAyNy40NTEgNCAyMi4yOTEgNCAxNiA0IDkuMzczIDkuMzczIDQgMTYgNHoiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik0xOS44NzkgMjcuMzI4bDEuNzY3LTYuNzE3IDQuOTUgNC45NXoiLz48L2c+PC9zdmc+)}.ce-image-previewer .ce-image-menu i.original-size{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQgNGgyNHYyNEg0VjR6bTIgMnYyMGgyMFY2SDZ6bTQgNWgydjEwaC0yVjExem01IDJoMnYyaC0ydi0yem0wIDRoMnYyaC0ydi0yem01LTZoMnYxMGgtMlYxMXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu i.image-download{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQuNSAxNXYzLjVoMTVWMTVIMjF2NUgzdi01aDEuNXptOC4yMzItMTEuMjI2djkuMTk2bDQuMDUtNC4wNSAxLjA2IDEuMDYtNS44MzQgNS44MzQtNS44MzMtNS44MzMgMS4wNi0xLjA2IDMuOTk4IDMuOTk2VjMuNzc0aDEuNXoiIGZpbGw9IiMzRDQ3NTciLz48L3N2Zz4=)}.ce-image-previewer .ce-image-menu .image-navigate{display:flex;align-items:center;justify-content:center}.ce-image-previewer .ce-image-menu i.image-pre{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyLjUgNC4wNjNMNi44NzUgMTBsNS42MjUgNS45MzgiIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==)}.ce-image-previewer .ce-image-menu i.image-next{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuNSA0LjA2M0wxMy4xMjUgMTAgNy41IDE1LjkzOCIgc3Ryb2tlPSIjM0Q0NzU3IiBzdHJva2Utd2lkdGg9IjEuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PC9zdmc+)}.ce-image-previewer .ce-image-menu .image-count{color:#000;font-size:20px}.ce-image-previewer .ce-image-menu i.disabled{cursor:not-allowed;opacity:.5}.ce-contextmenu-container{z-index:9;position:fixed;display:none;padding:4px;overflow-x:hidden;overflow-y:auto;background:#fff;box-shadow:0 2px 12px #38383833;border:1px solid #e2e6ed;border-radius:2px}.ce-contextmenu-content{display:flex;flex-direction:column}.ce-contextmenu-content .ce-contextmenu-sub-item:after{position:absolute;content:"";width:16px;height:16px;right:12px;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMCAwaDE2djE2SDB6Ii8+PGcgZmlsbD0iIzc2N0M4NSI+PHBhdGggZD0iTTcgMTIuMjQzbC0uNzA3LS43MDcgNC4yNDMtNC4yNDMuNzA3LjcwN3oiLz48cGF0aCBkPSJNNi4yOTMgNC40NjRMNyAzLjc1NyAxMS4yNDMgOGwtLjcwNy43MDd6Ii8+PC9nPjwvZz48L3N2Zz4=)}.ce-contextmenu-content .ce-contextmenu-item{min-width:140px;padding:0 32px 0 16px;height:30px;display:flex;align-items:center;white-space:nowrap;box-sizing:border-box;cursor:pointer}.ce-contextmenu-content .ce-contextmenu-item.hover{background:rgba(25,55,88,.04)}.ce-contextmenu-content .ce-contextmenu-item span{max-width:300px;font-size:12px;color:#3d4757;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ce-contextmenu-content .ce-contextmenu-item span.ce-shortcut{color:#767c85;height:30px;flex:1;text-align:right;line-height:30px;margin-left:20px}.ce-contextmenu-content .ce-contextmenu-item i{width:16px;height:16px;vertical-align:middle;display:inline-block;background-repeat:no-repeat;background-size:100% 100%;flex-shrink:0;margin-right:8px}.ce-contextmenu-divider{background-color:#e2e6ed;margin:4px 16px;height:1px}.ce-contextmenu-print{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiA0aC0xVjJINXYySDRWMmExIDEgMCAwMTEtMWg2YTEgMSAwIDAxMSAxdjJ6bTAgNXY0YTEgMSAwIDAxLTEgMUg1YTEgMSAwIDAxLTEtMVY5aDF2NGg2VjloMXoiLz48cGF0aCBkPSJNMTIgMTJ2LTFoMlY1SDJ2NmgydjFIMmExIDEgMCAwMS0xLTFWNWExIDEgMCAwMTEtMWgxMmExIDEgMCAwMTEgMXY2YTEgMSAwIDAxLTEgMWgtMnoiLz48cGF0aCBkPSJNMyA4aDEwdjFIM3ptOC0yaDJ2MWgtMnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-image{background-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSLlm77lsYJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4PSIwIiB5PSIwIiB2aWV3Qm94PSIwIDAgMTYgMTYiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxzdHlsZT4uc3Qwe2ZpbGw6IzNkNDc1N308L3N0eWxlPjxnIGlkPSJfeDMwXzAt5YWs5YWxX3gyRl8wMuW3peWFt+agj194MkZf5o+S5YWl5Zu+54mHLTE2cHgtIj48ZyBpZD0iR3JvdXAtMTkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGlkPSJDb21iaW5lZC1TaGFwZSIgY2xhc3M9InN0MCIgZD0iTTEgMGgxMmMuNiAwIDEgLjQgMSAxdjExYzAgLjYtLjQgMS0xIDFIMWMtLjYgMC0xLS40LTEtMVYxYzAtLjYuNC0xIDEtMXptMCAxdjExaDEyVjFIMXoiLz48Y2lyY2xlIGlkPSLmpK3lnIblvaIiIGNsYXNzPSJzdDAiIGN4PSIxMCIgY3k9IjQiIHI9IjEiLz48cGF0aCBpZD0iUGF0aCIgY2xhc3M9InN0MCIgZD0iTTguNSAxMS4ybC00LTQuMUwxIDEwLjdWOS4yYzEuNy0xLjYgMi43LTIuNSAzLTIuOC40LS41LjctLjQgMSAwTDguNSAxMCAxMSA3LjNjLjQtLjUuNi0uNSAxLS4xbDIgMi44djEuNWwtMi41LTMuNC0zIDMuMXoiLz48L2c+PC9nPjwvc3ZnPg==)}.ce-contextmenu-image-change{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgyIDQpIiBmaWxsPSIjM0Q0NzU3Ij48Y2lyY2xlIGZpbGwtcnVsZT0ibm9uemVybyIgY3g9IjMiIGN5PSIxIiByPSIxIi8+PHBhdGggZD0iTTcuNDczIDguMjIzTDMuNDcgNC4xMDcgMCA3LjY2N3YtMS41QzEuNzE1IDQuNiAyLjcwNyAzLjY2NCAyLjk3NSAzLjM1OGMuNDAyLS40NTcuNjUxLS4zOSAxLjA0MiAwTDcuNDczIDcgOS45NiA0LjM0OWMuNDE0LS40NjIuNjItLjQ2MiAxLjAxMS0uMDcxTDEzIDcuMDZ2MS41bC0yLjUxLTMuNDEtMy4wMTcgMy4wNzJ6Ii8+PC9nPjxwYXRoIGQ9Ik02IDEuNUgxLjV2MTJoMTN2LTRWMTNhLjUuNSAwIDAxLS41LjVIMmEuNS41IDAgMDEtLjUtLjVWMmEuNS41IDAgMDEuNS0uNWg0em04LjUgOFY2bC0uNS41aDFsLS41LS41djMuNXpNNiAxLjVoNEw5LjUgMXYxbC41LS41SDZ6IiBzdHJva2U9IiMzRDQ3NTciLz48cGF0aCBkPSJNMTMuMDg1IDEuMzE2bC0zLjgxNCA0YTEgMSAwIDAwMS40NTggMS4zNjhsMy44MTUtNGExIDEgMCAxMC0xLjQ1OS0xLjM2OHoiIGZpbGw9IiMzRDQ3NTciIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-row-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNCA3djFoMlY3em0tMyAuNUw0IDV2NXpNMSAxaDEydjFIMXptMCAxMmgxMnYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-top-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNOCA1SDd2M2gxem0tLjUtM0wxMCA1SDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjEwLjUiIHdpZHRoPSIxMiIgaGVpZ2h0PSIzIiByeD0iMSIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-insert-bottom-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNyAxMWgxVjhIN3ptLjUgM0w1IDExaDV6Ii8+PHJlY3Qgc3Ryb2tlPSIjM0Q0NzU3IiB4PSIxLjUiIHk9IjIuNSIgd2lkdGg9IjEyIiBoZWlnaHQ9IjMiIHJ4PSIxIi8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-left-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMTEgN3YxaDNWN3ptLTMgLjVMMTEgNXY1eiIvPjxyZWN0IHN0cm9rZT0iIzNENDc1NyIgdHJhbnNmb3JtPSJyb3RhdGUoOTAgNCA3LjUpIiB4PSItMiIgeT0iNiIgd2lkdGg9IjEyIiBoZWlnaHQ9IjMiIHJ4PSIxIi8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-insert-right-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNNSA4VjdIMnYxem0zLS41TDUgMTBWNXoiLz48cmVjdCBzdHJva2U9IiMzRDQ3NTciIHRyYW5zZm9ybT0icm90YXRlKDkwIDEyIDcuNSkiIHg9IjYiIHk9IjYiIHdpZHRoPSIxMiIgaGVpZ2h0PSIzIiByeD0iMSIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-row-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik04LjUgNi41aDZ2MmgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMiAxMmgxMXYxSDJ6TTIgMmgxMXYxSDJ6bS42MyAzTDcgOS4zNWwtLjYzNS42NUwyIDUuNjN6Ii8+PHBhdGggZmlsbD0iIzNENDc1NyIgZD0iTTIgOS4zNjNMNi4zNTUgNSA3IDUuNzA3IDIuNjk1IDEweiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-row{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik04LjUgNS41aDZ2NGgtNnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMSAxM2gxMnYxSDF6TTEgMWgxMnYxSDF6bTAgNGgxdjFIMXptMSAxaDF2MUgyem0xIDFoMXYxSDN6bTEtMWgxdjFINHptMS0xaDF2MUg1ek00IDhoMXYxSDR6TTIgOGgxdjFIMnptMyAxaDF2MUg1ek0xIDloMXYxSDF6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-delete-col{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBzdHJva2U9IiM5MjlBQTgiIGQ9Ik01LjUgNy41di02aDR2NnoiLz48cGF0aCBmaWxsPSIjM0Q0NzU3IiBkPSJNMTMgMTVWM2gxdjEyek0xIDE1VjNoMXYxMnptNCAwdi0xaDF2MXptMS0xdi0xaDF2MXptMS0xdi0xaDF2MXptLTEtMXYtMWgxdjF6bS0xLTF2LTFoMXYxem0zIDF2LTFoMXYxem0wIDJ2LTFoMXYxem0xLTN2LTFoMXYxem0wIDR2LTFoMXYxeiIvPjwvZz48L3N2Zz4=)}.ce-contextmenu-delete-table{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTQgMTNoLTF2LTNIMnYzSDF2LTNhMSAxIDAgMDExLTFoMTFhMSAxIDAgMDExIDF2M3oiIGZpbGwtcnVsZT0ibm9uemVybyIvPjxwYXRoIGQ9Ik01LjYyNSAyTDEwIDYuMzc1IDkuMzc1IDcgNSAyLjYyNXoiLz48cGF0aCBkPSJNNSA2LjM3NUw5LjM3NSAybC42MjUuNjI1TDUuNjI1IDd6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik04IDcuNUwxMCA2djN6bS0xIDBMNSA2djN6Ii8+PHBhdGggZD0iTTkgN2gzdjFIOXpNMyA3aDN2MUgzeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTggMTBoMXY0SDh6bS0yIDBoMXY0SDZ6Ii8+PC9nPjwvc3ZnPg==)}.ce-contextmenu-merge-cancel-cell{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNNiAxdjFIMnYxMWg0djFIMmExIDEgMCAwMS0xLTFWMmExIDEgMCAwMTEtMWg0em0zIDBoNGExIDEgMCAwMTEgMXYxMWExIDEgMCAwMS0xIDFIOXYtMWg0VjJIOVYxeiIvPjxwYXRoIGZpbGwtcnVsZT0ibm9uemVybyIgZD0iTTYgMWgxdjRINnptMiAwaDF2NEg4eiIvPjxwYXRoIGQ9Ik0zIDcuNUw1IDZ2M3ptOSAwTDEwIDZ2M3oiLz48cGF0aCBkPSJNNCA3aDN2MUg0em00IDBoM3YxSDh6Ii8+PHBhdGggZmlsbC1ydWxlPSJub256ZXJvIiBkPSJNOCAxMGgxdjRIOHptLTIgMGgxdjRINnoiLz48L2c+PC9zdmc+)}.ce-contextmenu-vertical-align{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2IiB2aWV3Qm94PSIwIDAgMTYgMTYiIHdpZHRoPSIxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAxM2gxMnYxSDJ6bTAtM2g4djFIMnptMC0zaDEydjFIMnptMC02aDEydjFIMnptMCAzaDh2MUgyeiIgZmlsbD0iIzNkNDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggOEg3djZoMXptLS41LTNMMTAgOEg1ek0yIDNoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-middle{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOCAxMkg3djNoMXptLS41LTNsMi41IDNINXpNNyAzaDFWMEg3em0uNSAzTDUgM2g1ek0yIDdoMTF2MUgyeiIgZmlsbD0iIzNENDc1NyIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ce-contextmenu-vertical-align-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcgOWgxVjNIN3ptLjUgM0w1IDloNXpNMiAxM2gxMXYxSDJ6IiBmaWxsPSIjM0Q0NzU3IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ce-contextmenu-border-all{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik0zIDhoMTF2MUgzeiIvPjxwYXRoIGZpbGw9IiMzRDQ3NTciIGQ9Ik05IDN2MTFIOFYzeiIvPjwvc3ZnPg==)}.ce-contextmenu-border-empty{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMyAzaC0xVjJoMWExIDEgMCAwMTEgMXYxaC0xVjN6bS0zLTF2MUg4LjV2MmgtMVYzSDZWMmg0ek00IDJ2MUgzdjFIMlYzYTEgMSAwIDAxMS0xaDF6TTIgNmgxdjEuNWgydjFIM1YxMEgyVjZ6bTAgNmgxdjFoMXYxSDNhMSAxIDAgMDEtMS0xdi0xem00IDJ2LTFoMS41di0yaDF2MkgxMHYxSDZ6bTYgMHYtMWgxdi0xaDF2MWExIDEgMCAwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiNBQUFDQjAiLz48L3N2Zz4=)}.ce-contextmenu-border-dash{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMyAzaC0xVjJoMWExIDEgMCAwMTEgMXYxaC0xVjN6bS0zLTF2MUg4LjV2MmgtMVYzSDZWMmg0ek00IDJ2MUgzdjFIMlYzYTEgMSAwIDAxMS0xaDF6TTIgNmgxdjEuNWgydjFIM1YxMEgyVjZ6bTAgNmgxdjFoMXYxSDNhMSAxIDAgMDEtMS0xdi0xem00IDJ2LTFoMS41di0yaDF2MkgxMHYxSDZ6bTYgMHYtMWgxdi0xaDF2MWExIDEgMCAwMS0xIDFoLTF6bTItNGgtMVY4LjVoLTJ2LTFoMlY2aDF2NHpNOC41IDcuNXYtMWgtMXYxaC0xdjFoMXYxaDF2LTFoMXYtMWgtMXoiIGZpbGw9IiMwMDAwMDAiLz48L3N2Zz4=)}.ce-contextmenu-border-external{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iIzNENDc1NyIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iI0FBQUNCMCIvPjwvc3ZnPg==)}.ce-contextmenu-border-internal{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOSA1VjNIOHYyaDF6bTAgOXYtMkg4djJoMXpNNSA4SDN2MWgyVjh6bTkgMGgtMnYxaDJWOHpNOSA3djFoMXYxSDl2MUg4VjlIN1Y4aDFWN2gxeiIgZmlsbD0iIzNENDc1NyIvPjwvc3ZnPg==)}.ce-contextmenu-border-td{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgZD0iTTguNSAyLjUgdjYgaC02Ii8+PC9zdmc+)}.ce-contextmenu-border-td-top{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDMgaDEyIi8+PC9zdmc+)}.ce-contextmenu-border-td-left{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMyAzIHYxMSIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-bottom{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMi41IDE0IGgxMiIvPjwvc3ZnPg==)}.ce-contextmenu-border-td-right{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIvPjxwYXRoIHN0cm9rZT0iIzNENDc1NyIgc3Ryb2tlLXdpZHRoPSIyIiBkPSJNMTQgMyB2MTEiLz48L3N2Zz4=)}.ce-contextmenu-border-td-forward{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0xNCAzIGwtMTEgMTEiIC8+PC9zdmc+)}.ce-contextmenu-border-td-back{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTIuNSAzYS41LjUgMCAwMS41LS41aDExYS41LjUgMCAwMS41LjV2MTFhLjUuNSAwIDAxLS41LjVIM2EuNS41IDAgMDEtLjUtLjVWM3oiIHN0cm9rZT0iI0FBQUNCMCIgLz48cGF0aCBzdHJva2U9IiMzRDQ3NTciIGQ9Ik0zIDMgbDExIDExIiAvPjwvc3ZnPg==)}.ce-hyperlink-popup{background:#fff;box-shadow:0 2px 12px #626b8433;border-radius:2px;color:#3d4757;padding:12px 16px;position:absolute;z-index:1;text-align:center;display:none}.ce-hyperlink-popup a{min-width:100px;max-width:300px;font-size:12px;display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer;text-decoration:none;border-bottom-width:1px;border-bottom-style:solid;color:#00f}.ce-zone-indicator>div{padding:3px 6px;color:#000;font-size:12px;background:rgb(218 231 252);position:absolute;transform-origin:0 0}.ce-zone-indicator-border__top,.ce-zone-indicator-border__bottom,.ce-zone-indicator-border__left,.ce-zone-indicator-border__right{display:block;position:absolute;z-index:0}.ce-zone-indicator-border__top{border-top:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__bottom{border-top:2px dashed rgb(238,238,238);width:100%}.ce-zone-indicator-border__left{border-left:2px dashed rgb(238,238,238)}.ce-zone-indicator-border__right{border-right:2px dashed rgb(238,238,238)}.ce-zone-tip{display:none;align-items:center;height:30px;white-space:nowrap;position:fixed;opacity:.9;background-color:#000;padding:0 5px;border-radius:4px;z-index:9;transition:all .3s;outline:none;user-select:none;pointer-events:none;transform:translate(10px,10px)}.ce-zone-tip.show{display:flex}.ce-zone-tip span{color:#fff;font-size:12px}.ce-inputarea{width:100px;height:30px;min-width:0;min-height:0;margin:0;padding:0;left:0;top:0;letter-spacing:0;font-size:12px;position:absolute;z-index:-1;outline:none;resize:none;border:none;overflow:hidden;color:transparent;user-select:none;caret-color:transparent;background-color:transparent}.ce-cursor{width:1px;height:20px;left:0;right:0;position:absolute;outline:none;background-color:#000;pointer-events:none}.ce-cursor.ce-cursor--animation{animation-duration:1s;animation-iteration-count:infinite;animation-name:cursorAnimation}@keyframes cursorAnimation{0%{opacity:1}13%{opacity:0}50%{opacity:0}63%{opacity:1}to{opacity:1}}.ce-float-image{position:absolute;opacity:.5;pointer-events:none}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();var bu=Object.defineProperty,Lu=Object.defineProperties,Ou=Object.getOwnPropertyDescriptors,Nr=Object.getOwnPropertySymbols,Pu=Object.prototype.hasOwnProperty,Tu=Object.prototype.propertyIsEnumerable,No=(r,e,t)=>e in r?bu(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,B=(r,e)=>{for(var t in e||(e={}))Pu.call(e,t)&&No(r,t,e[t]);if(Nr)for(var t of Nr(e))Tu.call(e,t)&&No(r,t,e[t]);return r},oe=(r,e)=>Lu(r,Ou(e)),O=(r,e,t)=>(No(r,typeof e!="symbol"?e+"":e,t),t);const br="0.9.113";var Xi;(function(r){r.HALF="half",r.ONE_THIRD="one-third",r.QUARTER="quarter"})(Xi||(Xi={}));var In;(function(r){r.ARABIC="arabic",r.CHINESE="chinese"})(In||(In={}));var re;(function(r){r.INLINE="inline",r.BLOCK="block",r.SURROUND="surround",r.FLOAT_TOP="float-top",r.FLOAT_BOTTOM="float-bottom"})(re||(re={}));var pt;(function(r){r.BEFORE="before",r.AFTER="after",r.OUTER_BEFORE="outer-before",r.OUTER_AFTER="outer-after"})(pt||(pt={}));var bo;(function(r){r.ROW="row",r.COLUMN="column"})(bo||(bo={}));const j="​",Lr=`
2
+ `,Lo=" ",Or="&nbsp;",Iu=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],Pr={[Xi.HALF]:1/2,[Xi.ONE_THIRD]:1/3,[Xi.QUARTER]:1/4},xu={ENGLISH:"A-Za-z",SPANISH:"A-Za-zÁÉÍÓÚáéíóúÑñÜü",FRENCH:"A-Za-zÀÂÇàâçÉéÈèÊêËëÎîÏïÔôÙùÛûŸÿ",GERMAN:"A-Za-zÄäÖöÜüß",RUSSIAN:"А-Яа-яЁё",PORTUGUESE:"A-Za-zÁÉÍÓÚáéíóúÃÕãõÇç",ITALIAN:"A-Za-zÀàÈèÉéÌìÍíÎîÓóÒòÙù",DUTCH:"A-Za-zÀàÁáÂâÄäÈèÉéÊêËëÌìÍíÎîÏïÓóÒòÔôÖöÙùÛûÜü",SWEDISH:"A-Za-zÅåÄäÖö",GREEK:"ΑαΒβΓγΔδΕεΖζΗηΘθΙιΚκΛλΜμΝνΞξΟοΠπΡρΣσςΤτΥυΦφΧχΨψΩω"},wu="日";var Re;(function(r){r.LEFT="left",r.CENTER="center",r.RIGHT="right",r.ALIGNMENT="alignment",r.JUSTIFY="justify"})(Re||(Re={}));const Oo=/[0-9.]/,yu=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,Vu=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,Fu=new RegExp(`${Vu.source}|${yu.source}`,"g"),Xu=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Po=new RegExp(`^[${j}
3
+ ]`);function Tr(r,e){let t;return function(...i){t&&window.clearTimeout(t),t=window.setTimeout(()=>{r.apply(this,i)},e)}}function Cu(r,e){let t=0,i;return function(...n){const s=Date.now();s-t>=e?(window.clearTimeout(i),r.apply(this,n),t=s):(window.clearTimeout(i),i=window.setTimeout(()=>{r.apply(this,n),t=s},e))}}function To(r,e){if(!r||typeof r!="object")return r;let t={};return Array.isArray(r)?t=r.map(i=>To(i,e)):Object.keys(r).forEach(i=>{if(!e.includes(i))return t[i]=To(r[i],e)}),t}function Ne(r){if(typeof structuredClone=="function")return structuredClone(r);if(!r||typeof r!="object")return r;let e={};return Array.isArray(r)?e=r.map(t=>Ne(t)):Object.keys(r).forEach(t=>e[t]=Ne(r[t])),e}function Io(r){return r&&r.nodeType===1&&r.tagName.toLowerCase()==="body"}function cs(r,e,t){if(r&&!Io(r))for(r=r;r;){if(!e||e(r)||Io(r))return e&&!e(r)&&Io(r)?null:r;r=r.parentNode}return null}function pe(){function r(){return((1+Math.random())*65536|0).toString(16).substring(1)}return r()+r()+"-"+r()+"-"+r()+"-"+r()+"-"+r()+r()+r()}function mt(r){const e=[];if(Intl.Segmenter){const i=new Intl.Segmenter().segment(r);for(const{segment:n}of i)e.push(n)}else{const t=new Map;for(const n of r.matchAll(Fu))t.set(n.index,n[0]);let i=0;for(;i<r.length;){const n=t.get(i);n?(e.push(n),i+=n.length):(e.push(r[i]),i++)}}return e}function Ir(r,e){const t=document.createElement("a");t.href=r,t.download=e,t.click()}function vu(r,e){Wu(3,r,e)}function Wu(r,e,t){let i=0,n=0;const s=function(l){i=new Date().getTime()-n<300?i+1:0,n=new Date().getTime(),i>=r-1&&(t(l),i=0)};e.addEventListener("click",s)}function ds(r){return Object.prototype.toString.call(r)==="[object Object]"}function xo(r){return Array.isArray(r)}function wo(r){return Object.prototype.toString.call(r)==="[object Number]"}function ku(r){return Object.prototype.toString.call(r)==="[object String]"}function xr(r,e){if(ds(r)&&ds(e)){const t=e;for(const[i,n]of Object.entries(r))t[i]?t[i]=xr(n,t[i]):t[i]=n}else xo(r)&&xo(e)&&e.push(...r);return e}function wr(r){setTimeout(()=>{r()},0)}function Du(r){const e=["零","一","二","三","四","五","六","七","八","九"],t=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!r||isNaN(r))return"零";const i=r.toString().split("");let n="";for(let s=0;s<i.length;s++){const l=i.length-1-s;n=`${t[s]}${n}`,n=`${e[Number(i[l])]}${n}`}return n=n.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),n=n.replace(/零+/g,"零"),n=n.replace(/零亿/g,"亿").replace(/零万/g,"万"),n=n.replace(/亿万/g,"亿"),n=n.replace(/零+$/,""),n=n.replace(/^一十/g,"十"),n}function Ci(r,e,t){for(let i=0;i<r.length;i++){const n=r[i],s=e[n];s!==void 0?t[n]=s:delete t[n]}}function Lt(r,e){const t={};for(const i in r)e.includes(i)&&(t[i]=r[i]);return t}function Qt(r,e){const t={};for(const i in r)e.includes(i)||(t[i]=r[i]);return t}function Eu(r){const t=new TextEncoder().encode(r),i=Array.from(t,s=>String.fromCharCode(s));return window.btoa(i.join(""))}function Uu(r){let e=r.parentElement;for(;e;){const i=window.getComputedStyle(e).getPropertyValue("overflow-y");if(e.scrollHeight>e.clientHeight&&(i==="auto"||i==="scroll"))return e;e=e.parentElement}return document.documentElement}function yr(r,e){return r.length!==e.length?!1:!r.some(t=>!e.includes(t))}function Zu(r,e){if(!ds(r)||!ds(e))return!1;const t=Object.keys(r),i=Object.keys(e);return t.length!==i.length?!1:!t.some(n=>e[n]!==r[n])}function Yu(r,e){const t=r.x,i=r.x+r.width,n=r.y,s=r.y+r.height,l=e.x,a=e.x+e.width,c=e.y,d=e.y+e.height;return!(t>a||i<l||n>d||s<c)}function Vr(r){return r==null}function Fr(r){return r.replace(/\r\n|\r/g,`
4
+ `)}const Qu=12,Ku={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},Ni="editor-component",ie="ce",yo=`${ie}-clipboard`,Vo={print:{imagePreviewerDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1}};var He;(function(r){r.UP="top",r.DOWN="down",r.LEFT="left",r.RIGHT="right"})(He||(He={}));const vi=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Hu=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),Bu=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var D;(function(r){r.TEXT="text",r.IMAGE="image",r.TABLE="table",r.HYPERLINK="hyperlink",r.SUPERSCRIPT="superscript",r.SUBSCRIPT="subscript",r.SEPARATOR="separator",r.PAGE_BREAK="pageBreak",r.CONTROL="control",r.AREA="area",r.CHECKBOX="checkbox",r.RADIO="radio",r.LATEX="latex",r.TAB="tab",r.DATE="date",r.BLOCK="block",r.TITLE="title",r.LIST="list"})(D||(D={}));const Kt=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration"],Wi=["rowFlex","rowMargin"],Gu=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","rowMargin","textDecoration"],_u=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tableToolDisabled","borderType","borderColor","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","textDecoration","extension","externalId","areaId","area"],Au=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],xn=["tdId","trId","tableId"],Fo=["level","titleId","title"],hs=["listId","listType","listStyle"],Xo=["control","controlId","controlComponent"],ai=["font","size","bold","highlight","italic","strikeout"],Ai=["areaId","area"],Xr=[...xn,...Fo,...hs,...Ai],yt=[D.TEXT,D.HYPERLINK,D.SUBSCRIPT,D.SUPERSCRIPT,D.CONTROL,D.DATE],Ju=[D.IMAGE,D.LATEX],zu=[D.BLOCK,D.PAGE_BREAK,D.SEPARATOR,D.TABLE],$u=["HR","TABLE","UL","OL"],ju=[D.TITLE,D.LIST],Cr=class{constructor(r){O(this,"element"),this.element=r}_defineIframeProperties(r){Object.defineProperties(r,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(r){var e,t;const i=this.element.block,n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...Cr.sandbox),n.style.border="none",n.style.width="100%",n.style.height="100%",(e=i.iframeBlock)!=null&&e.src?n.src=i.iframeBlock.src:(t=i.iframeBlock)!=null&&t.srcdoc&&(n.srcdoc=i.iframeBlock.srcdoc),r.append(n),this._defineIframeProperties(n.contentWindow)}};let Co=Cr;O(Co,"sandbox",["allow-scripts","allow-same-origin"]);class vr{constructor(e){O(this,"draw"),O(this,"options"),O(this,"imageCache"),O(this,"container"),O(this,"floatImageContainer"),O(this,"floatImage"),this.draw=e,this.options=e.getOptions(),this.container=e.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const e=[],t=i=>{for(const n of i)if(n.type===D.TABLE){const s=n.trList;for(let l=0;l<s.length;l++){const a=s[l];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];t(d.value)}}}else n.type===D.IMAGE&&e.push(n)};return t(this.draw.getOriginalMainElementList()),e}createFloatImage(e){const{scale:t}=this.options;let i=this.floatImageContainer,n=this.floatImage;i||(i=document.createElement("div"),i.classList.add(`${ie}-float-image`),this.container.append(i),this.floatImageContainer=i),n||(n=document.createElement("img"),i.append(n),this.floatImage=n),i.style.display="none",n.style.width=`${e.width*t}px`,n.style.height=`${e.height*t}px`;const s=this.draw.getHeight(),l=this.draw.getPageGap(),a=this.draw.getPageNo()*(s+l),c=e.imgFloatPosition;i.style.left=`${c.x*t}px`,i.style.top=`${a+c.y*t}px`,n.src=e.value}dragFloatImage(e,t){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const i=parseFloat(this.floatImageContainer.style.left)+e,n=parseFloat(this.floatImageContainer.style.top)+t;this.floatImageContainer.style.left=`${i}px`,this.floatImageContainer.style.top=`${n}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(e){this.draw.getImageObserver().add(e)}getFallbackImage(e,t){const n=(e-Math.ceil(e/8)*8)/2,s=(t-Math.ceil(t/8)*8)/2,l=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">
5
+ <rect width="${e}" height="${t}" fill="url(#mosaic)" />
6
+ <defs>
7
+ <pattern id="mosaic" x="${n}" y="${s}" width="${8*2}" height="${8*2}" patternUnits="userSpaceOnUse">
8
+ <rect width="8" height="8" fill="#cccccc" />
9
+ <rect width="8" height="8" fill="#cccccc" transform="translate(8, 8)" />
10
+ </pattern>
11
+ </defs>
12
+ </svg>`,a=new Image;return a.src=`data:image/svg+xml;base64,${Eu(l)}`,a}render(e,t,i,n){const{scale:s}=this.options,l=t.width*s,a=t.height*s;if(this.imageCache.has(t.value)){const c=this.imageCache.get(t.value);e.drawImage(c,i,n,l,a)}else{const c=this.draw.getRenderCount(),d=new Promise((h,u)=>{const f=new Image;f.setAttribute("crossOrigin","Anonymous"),f.src=t.value,f.onload=()=>{this.imageCache.set(t.value,f),h(t),c===this.draw.getRenderCount()&&(t.imgDisplay===re.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):e.drawImage(f,i,n,l,a))},f.onerror=g=>{const R=this.getFallbackImage(l,a);R.onload=()=>{e.drawImage(R,i,n,l,a),this.imageCache.set(t.value,R)},u(g)}});this.addImageObserver(d)}}}const us=82;function Ji(r){return vo[r]==null&&qu(r),vo[r]}function qu(r){const e=ef[r];if(e==null)return;const t=e.substring(3,5),i=1*t.charCodeAt(0)-us,n=1*t.charCodeAt(1)-us,s=e.substring(5),l=[[]];let a=1/0,c=-1/0,d=1/0,h=-1/0,u=0;for(;u<s.length;){const f=s.substring(u,u+2);if(f==" R")l.push([]);else{const g=f.charCodeAt(0)-us-i,R=f.charCodeAt(1)-us;a=Math.min(R,a),c=Math.max(R,c),d=Math.min(g,d),h=Math.max(g,h),l[l.length-1].push([g,R])}u+=2}vo[r]={w:n-i,xmin:d,xmax:h,ymin:a,ymax:c,polylines:l}}const vo={},ef={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP",526:" 9H\\YFK[ RKFYF RK[Y[",527:" 9I[RFJ[ RRFZ[ RMTWT",528:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",529:" 6HYLFL[ RLFXF",530:" 9I[RFJ[ RRFZ[ RJ[Z[",531:" 12H[LFL[ RLFYF RLPTP RL[Y[",532:" 9H\\YFK[ RKFYF RK[Y[",533:" 9G]KFK[ RYFY[ RKPYP",534:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF ROPUP",535:" 3NVRFR[",536:" 9G\\KFK[ RYFKT RPOY[",537:" 6I[RFJ[ RRFZ[",538:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",539:" 9G]KFK[ RKFY[ RYFY[",540:" 9I[KFYF ROPUP RK[Y[",541:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",542:" 9G]KFK[ RYFY[ RKFYF",543:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",544:" 10I[KFRPK[ RKFYF RK[Y[",545:" 6JZRFR[ RKFYF",546:" 19I[KKKILGMFOFPGQIRMR[ RYKYIXGWFUFTGSIRM",547:" 21H\\RFR[ RPKMLLMKOKRLTMUPVTVWUXTYRYOXMWLTKPK",548:" 6H\\KFY[ RK[YF",549:" 18G]RFR[ RILJLKMLQMSNTQUSUVTWSXQYMZL[L",550:" 17H\\K[O[LTKPKLLINGQFSFVGXIYLYPXTU[Y[",551:" 20G[G[IZLWOSSLVFV[UXSUQSNQLQKRKTLVNXQZT[Y[",552:" 41F]SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFXFZG[I[KZMYNWOTP RSPTPWQXRYTYWXYWZU[R[PZOX",553:" 24H\\TLTMUNWNYMZKZIYGWFTFQGOIMLLNKRKVLYMZO[Q[TZVXWV",554:" 35G^TFRGQIPMOSNVMXKZI[G[FZFXGWIWKXMZP[S[VZXXZT[O[KZHYGWFTFRHRJSMUPWRZT\\U",555:" 28H\\VJVKWLYLZKZIYGVFRFOGNINLONPOSPPPMQLRKTKWLYMZP[S[VZXXYV",556:" 28H\\RLPLNKMINGQFTFXG[G]F RXGVNTTRXPZN[L[JZIXIVJULUNV RQPZP",557:" 29G^G[IZMVPQQNRJRGQFPFOGNINLONQOUOXNYMZKZQYVXXVZS[O[LZJXIVIT",558:" 38F^MMKLJJJIKGMFNFPGQIQKPONULYJ[H[GZGX RMRVOXN[L]J^H^G]F\\FZHXLVRUWUZV[W[YZZY\\V",559:" 25IZWVUTSQROQLQIRGSFUFVGWIWLVQTVSXQZO[M[KZJXJVKUMUOV",560:" 25JYT^R[PVOPOJPGRFTFUGVJVMURR[PaOdNfLgKfKdLaN^P\\SZWX",561:" 39F^MMKLJJJIKGMFNFPGQIQKPONULYJ[H[GZGX R^I^G]F\\FZGXIVLTNROPO RROSQSXTZU[V[XZYY[V",562:" 29I\\MRORSQVOXMYKYHXFVFUGTISNRSQVPXNZL[J[IZIXJWLWNXQZT[V[YZ[X",563:" 45@aEMCLBJBICGEFFFHGIIIKHPGTE[ RGTJLLHMGOFPFRGSISKRPQTO[ RQTTLVHWGYFZF\\G]I]K\\PZWZZ[[\\[^Z_YaV",564:" 32E]JMHLGJGIHGJFKFMGNINKMPLTJ[ RLTOLQHRGTFVFXGYIYKXPVWVZW[X[ZZ[Y]V",565:" 29H]TFQGOIMLLNKRKVLYMZO[Q[TZVXXUYSZOZKYHXGVFTFRHRKSNUQWSZU\\V",566:" 31F_SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFZF\\G]H^J^M]O\\PZQWQUPTO",567:" 32H^ULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWSSWPYNZK[I[HZHXIWKWMXPZS[V[YZ[X",568:" 38F_SHTITLSPRSQUOXMZK[J[IZIWJRKOLMNJPHRGUFYF[G\\H]J]M\\O[PYQVQSPTQUSUXVZX[ZZ[Y]V",569:" 28H\\H[JZLXOTQQSMTJTGSFRFQGPIPKQMSOVQXSYUYWXYWZT[P[MZKXJVJT",570:" 25H[RLPLNKMINGQFTFXG[G]F RXGVNTTRXPZN[L[JZIXIVJULUNV",571:" 33E]JMHLGJGIHGJFKFMGNINKMOLRKVKXLZN[P[RZSYUUXMZF RXMWQVWVZW[X[ZZ[Y]V",572:" 32F]KMILHJHIIGKFLFNGOIOKNOMRLVLYM[O[QZTWVTXPYMZIZGYFXFWGVIVKWNYP[Q",573:" 25C_HMFLEJEIFGHFIFKGLILLK[ RUFK[ RUFS[ RaF_G\\JYNVTS[",574:" 36F^NLLLKKKILGNFPFRGSISLQUQXRZT[V[XZYXYVXUVU R]I]G\\FZFXGVITLPUNXLZJ[H[GZGX",575:" 38F]KMILHJHIIGKFLFNGOIOKNOMRLVLXMZN[P[RZTXVUWSYM R[FYMVWT]RbPfNgMfMdNaP^S[VY[V",576:" 40H]ULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWTTWPZN[K[JZJXKWNWPXQYR[R^QaPcNfLgKfKdLaN^Q[TYZV",583:" 9I[JFR[ RZFR[ RJFZF",601:" 18I\\XMX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",602:" 18H[LFL[ RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",603:" 15I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX",604:" 18I\\XFX[ RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",605:" 18I[LSXSXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX",606:" 9MYWFUFSGRJR[ ROMVM",607:" 23I\\XMX]W`VaTbQbOa RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",608:" 11I\\MFM[ RMQPNRMUMWNXQX[",609:" 9NVQFRGSFREQF RRMR[",610:" 12MWRFSGTFSERF RSMS^RaPbNb",611:" 9IZMFM[ RWMMW RQSX[",612:" 3NVRFR[",613:" 19CaGMG[ RGQJNLMOMQNRQR[ RRQUNWMZM\\N]Q][",614:" 11I\\MMM[ RMQPNRMUMWNXQX[",615:" 18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM",616:" 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",617:" 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",618:" 9KXOMO[ ROSPPRNTMWM",619:" 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",634:" 27G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT",635:" 9LWRMPTOXOZP[R[TYUW",636:" 19I[OMK[ RYNXMWMUNQROSNS RNSPTQUSZT[U[VZ",637:" 9JZKFMFOGPHX[ RRML[",638:" 21H]OMIb RNQMVMYO[Q[SZUXWT RYMWTVXVZW[Y[[Y\\W",639:" 14I[LMOMNSMXL[ RYMXPWRUURXOZL[",640:" 29JZTFRGQHQIRJUKXK RUKRLPMOOOQQSTTVT RTTPUNVMXMZO\\S^T_TaRbPb",641:" 18J[RMPNNPMSMVNYOZQ[S[UZWXXUXRWOVNTMRM",642:" 13G]PML[ RUMVSWXX[ RIPKNNM[M",643:" 19I[MSMVNYOZQ[S[UZWXXUXRWOVNTMRMPNNPMSIb",644:" 18I][MQMONMPLSLVMYNZP[R[TZVXWUWRVOUNSM",645:" 8H\\SMP[ RJPLNOMZM",646:" 16H\\IQJOLMNMONOPMVMYO[Q[TZVXXTYPYM",647:" 21G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb",648:" 14I[KMMMOOU`WbYb RZMYOWRM]K`Jb",649:" 20F]VFNb RGQHOJMLMMNMPLULXMZO[Q[TZVXXUZP[M",650:" 23F]NMLNJQITIWJZK[M[OZQW RRSQWRZS[U[WZYWZTZQYNXM",651:" 22L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXVRUWUZV[W[YZZY\\V",652:" 23M[MVOSRNSLTITGSFQGPIOMNTNZO[P[RZTXUUURVVWWYW[V",653:" 14MXTTTSSRQROSNTMVMXNZP[S[VYXV",654:" 24L\\UUTSRRPRNSMTLVLXMZO[Q[SZTXZF RVRUWUZV[W[YZZY\\V",655:" 17NXOYQXRWSUSSRRQROSNUNXOZQ[S[UZVYXV",656:" 24OWOVSQUNVLWIWGVFTGSIQQNZKaJdJfKgMfNcOZP[R[TZUYWV",657:" 28L[UUTSRRPRNSMTLVLXMZO[Q[SZTY RVRTYPdOfMgLfLdMaP^S\\U[XY[V",658:" 29M\\MVOSRNSLTITGSFQGPIOMNSM[ RM[NXOVQSSRURVSVUUXUZV[W[YZZY\\V",659:" 16PWSMSNTNTMSM RPVRRPXPZQ[R[TZUYWV",660:" 20PWSMSNTNTMSM RPVRRLdKfIgHfHdIaL^O\\Q[TYWV",661:" 33M[MVOSRNSLTITGSFQGPIOMNSM[ RM[NXOVQSSRURVSVUTVQV RQVSWTZU[V[XZYY[V",662:" 18OWOVQSTNULVIVGUFSGRIQMPTPZQ[R[TZUYWV",663:" 33E^EVGSIRJSJTIXH[ RIXJVLSNRPRQSQTPXO[ RPXQVSSURWRXSXUWXWZX[Y[[Z\\Y^V",664:" 23J\\JVLSNROSOTNXM[ RNXOVQSSRURVSVUUXUZV[W[YZZY\\V",665:" 23LZRRPRNSMTLVLXMZO[Q[SZTYUWUUTSRRQSQURWTXWXYWZV",666:" 24KZKVMSNQMUGg RMUNSPRRRTSUUUWTYSZQ[ RMZO[R[UZWYZV",667:" 27L[UUTSRRPRNSMTLVLXMZO[Q[SZ RVRUUSZPaOdOfPgRfScS\\U[XY[V",668:" 15MZMVOSPQPSSSTTTVSYSZT[U[WZXYZV",669:" 16NYNVPSQQQSSVTXTZR[ RNZP[T[VZWYYV",670:" 16OXOVQSSO RVFPXPZQ[S[UZVYXV RPNWN",671:" 19L[LVNRLXLZM[O[QZSXUU RVRTXTZU[V[XZYY[V",672:" 17L[LVNRMWMZN[O[RZTXUUUR RURVVWWYW[V",673:" 25I^LRJTIWIYJ[L[NZPX RRRPXPZQ[S[UZWXXUXR RXRYVZW\\W^V",674:" 20JZJVLSNRPRQSQZR[U[XYZV RWSVRTRSSOZN[L[KZ",675:" 23L[LVNRLXLZM[O[QZSXUU RVRPdOfMgLfLdMaP^S\\U[XY[V",676:" 23LZLVNSPRRRTTTVSXQZN[P\\Q^QaPdOfMgLfLdMaP^S\\WYZV",677:" 22J\\K[NZQXSVUSWOXKXIWGUFSGRHQJPOPTQXRZT[V[XZYY",683:" 26I[WUWRVOUNSMQMONMPLSLVMYNZP[R[TZVXWUXPXKWHVGTFRFPGNI",684:" 16JZWNUMRMPNNPMSMVNYOZQ[T[VZ RMTUT",685:" 23J[TFRGPJOLNOMTMXNZO[Q[SZUWVUWRXMXIWGVFTF RNPWP",686:" 21H\\VFNb RQMNNLPKSKVLXNZQ[S[VZXXYUYRXPVNSMQM",687:" 16I[XOWNTMQMNNMOLQLSMUOWSZT\\T^S_Q_",700:" 18H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF",701:" 5H\\NJPISFS[",702:" 15H\\LKLJMHNGPFTFVGWHXJXLWNUQK[Y[",703:" 16H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW",704:" 7H\\UFKTZT RUFU[",705:" 18H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW",706:" 24H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT",707:" 6H\\YFO[ RKFYF",708:" 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF",709:" 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX",710:" 6MWRYQZR[SZRY",711:" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX RWNMX ROLLOKQ RULXOYQ",863:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKVYVRJ RRZYNKNRZ",869:" 34G]PIPGQFSFTGTI RGZHXJVKTLPLKMJOIUIWJXKXPYTZV\\X]Z RGZ]Z RQZP[Q\\S\\T[SZ",870:" 64JZRMRS RRSQ\\ RRSS\\ RQ\\S\\ RRMQJPHNG RQJNG RRMSJTHVG RSJVG RRMNKLKJM RPLLLJM RRMVKXKZM RTLXLZM RRMPNOOOR RRMPOOR RRMTNUOUR RRMTOUR",871:" 94JZRIRK RRNRP RRSRU RRYQ\\ RRYS\\ RQ\\S\\ RRGQIPJ RRGSITJ RPJRITJ RRKPNNOMN RRKTNVOWN RNOPORNTOVO RRPPSNTLTKRKSLT RRPTSVTXTYRYSXT RNTPTRSTTVT RRUPXOYMZLZKYJWJYLZ RRUTXUYWZXZYYZWZYXZ RMZOZRYUZWZ",872:" 40JZRYQ\\ RRYS\\ RQ\\S\\ RRYUZXZZXZUYTWTYRZOYMWLUMVJUHSGQGOHNJOMMLKMJOKRMTKTJUJXLZOZRY",873:" 32JZRYQ\\ RRYS\\ RQ\\S\\ RRYVXVVXUXRZQZLYIXHVHTGPGNHLHKIJLJQLRLUNVNXRY",874:" 15I[IPKR RLKNP RRGRO RXKVP R[PYR",899:" 6QSRQQRRSSRRQ",900:" 10PTQPPQPSQTSTTSTQSPQP",901:" 14NVQNOONQNSOUQVSVUUVSVQUOSNQN",902:" 18MWQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM",903:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",904:" 22G]PGMHJJHMGPGTHWJZM\\P]T]W\\ZZ\\W]T]P\\MZJWHTGPG",905:" 34AcPALBJCGEEGCJBLAPATBXCZE]G_JaLbPcTcXbZa]__]aZbXcTcPbLaJ_G]EZCXBTAPA",906:" 34<hP<K=G?DAAD?G=K<P<T=Y?]A`DcGeKgPhThYg]e`cc`e]gYhThPgKeGcD`A]?Y=T<P<",907:" 50){O)I*E+@-;073370;-@+E*I)O)U*[+_-d0i3m7q;t@wEyIzO{U{[z_ydwitmqqmtiwdy_z[{U{OzIyEw@t;q7m3i0d-_+[*U)O)",908:" 34>fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc",909:" 33AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH",997:" 3MWMXWX",998:" 3JZJZZZ",999:" 3JZJ]Z]",1001:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1002:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS",1185:" 35LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ",1186:" 34KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO",1187:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RZK[L[KYKWLVNSYR[Q\\ RYKXLWNTYS[Q\\O\\O[P\\ RLOYO",1192:" 38IZVKWLXLXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RVOTVTWUXWXXWYU RWOUVUWVX RLOWO",1193:" 38IZVKWL RXKSKQLPMOOLYK[J\\ RSKQMPOMYL[J\\H\\H[I\\ RWKTVTWUXWXXWYU RXKUVUWVX RLOVO",1194:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L\\L\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ RZOXVXWYX[X\\W]U R[OYVYWZX RIO[O",1195:" 63F^SKTLTM RULSKPKNLMMLOIYH[G\\ RPKNMMOJYI[G\\E\\E[F\\ RZK[L R\\KWKUL RTMSOPYO[N\\ RWKUMTOQYP[N\\L\\L[M\\ R[KXVXWYX[X\\W]U R\\KYVYWZX RIOZO",1196:" 20MWNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1200:" 28LYQKOLNONTOWQXTXVWWTWOVLTKQK RQKPLOOOTPWQX RTXUWVTVOULTK",1201:" 10LYPNSKSX RRLRX ROXVX",1202:" 35LYOMONNNNMOLQKTKVLWNVPTQQROSNUNX RTKULVNUPTQ RNWOVPVSWVWWV RPVSXVXWVWU",1203:" 39LYOMONNNNMOLQKTKVLWNVPTQ RTKULVNUPTQ RRQTQVRWTWUVWTXQXOWNVNUOUOV RTQURVTVUUWTX",1204:" 13LYSMSX RTKTX RTKMTXT RQXVX",1205:" 33LYOKNQ ROKVK ROLSLVK RNQOPQOTOVPWRWUVWTXQXOWNVNUOUOV RTOUPVRVUUWTX",1206:" 36LYVMVNWNWMVLTKRKPLOMNPNUOWQXTXVWWUWSVQTPQPNR RRKPMOPOUPWQX RTXUWVUVSUQTP",1207:" 22LYNKNO RVMRTPX RWKTQQX RNMPKRKUM RNMPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW",1401:" 21F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\",1402:" 20H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\",1403:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",1404:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",1405:" 12KYOBOb RPBPb ROBVB RObVb",1406:" 12KYTBTb RUBUb RNBUB RNbUb",1407:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",1408:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",1409:" 24KYU@RCPFOIOLPOSVTYT\\S_Ra RRCQEPHPKQNTUUXU[T^RaOd",1410:" 24KYO@RCTFUIULTOQVPYP\\Q_Ra RRCSETHTKSNPUOXO[P^RaUd",1411:" 13AXCRGRR` RGSRa RFSRb RX:Rb",1412:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2001:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2002:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2003:" 32G\\XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXXYV RQFOGMILKKNKSLVMXOZQ[",2004:" 30G]LFL[ RMFM[ RIFSFVGXIYKZNZSYVXXVZS[I[ RSFUGWIXKYNYSXVWXUZS[",2005:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2006:" 20G[LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[P[",2007:" 40G^XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXX RQFOGMILKKNKSLVMXOZQ[ RXSX[ RYSY[ RUS\\S",2008:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2009:" 12MXRFR[ RSFS[ ROFVF RO[V[",2010:" 20KZUFUWTZR[P[NZMXMVNUOVNW RTFTWSZR[ RQFXF",2011:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2012:" 14I[NFN[ ROFO[ RKFRF RK[Z[ZUY[",2013:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2014:" 21G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[",2015:" 44G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF",2016:" 29G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[",2017:" 64G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF RNYNXOVQURUTVUXV_W`Y`Z^Z] RUXV\\W^X_Y_Z^",2018:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUPMP RUFWGXHYJYLXNWOUP RI[P[ RRPTQURXYYZZZ[Y RTQUSWZX[Z[[Y[X",2019:" 34H\\XIYFYLXIVGSFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[Q[NZLXKUK[LX",2020:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2021:" 23F^KFKULXNZQ[S[VZXXYUYF RLFLUMXOZQ[ RHFOF RVF\\F",2022:" 15H\\KFR[ RLFRX RYFR[ RIFOF RUF[F",2023:" 24F^JFN[ RKFNV RRFN[ RRFV[ RSFVV RZFV[ RGFNF RWF]F",2024:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2025:" 20H]KFRQR[ RLFSQS[ RZFSQ RIFOF RVF\\F RO[V[",2026:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2027:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2028:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2029:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2030:" 15H\\RFJ[ RRFZ[ RRIY[ RKZYZ RJ[Z[",2031:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2032:" 16H\\XFK[ RYFL[ RLFKLKFYF RK[Y[YUX[",2033:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2034:" 56G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF ROMOT RUMUT ROPUP ROQUQ",2035:" 12MXRFR[ RSFS[ ROFVF RO[V[",2036:" 27F\\KFK[ RLFL[ RYFLS RQOY[ RPOX[ RHFOF RUF[F RH[O[ RU[[[",2037:" 15H\\RFK[ RRFY[ RRIX[ RI[O[ RU[[[",2038:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2039:" 21G^LFL[ RMFYY RMHY[ RYFY[ RIFMF RVF\\F RI[O[",2040:" 36G]KEJJ RZEYJ RONNS RVNUS RKWJ\\ RZWY\\ RKGYG RKHYH ROPUP ROQUQ RKYYY RKZYZ",2041:" 44G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF",2042:" 21F^KFK[ RLFL[ RXFX[ RYFY[ RHF\\F RH[O[ RU[\\[",2043:" 29G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[",2044:" 20H]KFRPJ[ RJFQP RJFYFZLXF RKZXZ RJ[Y[ZUX[",2045:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2046:" 33I\\KKKILGMFOFPGQIRMR[ RKIMGOGQI RZKZIYGXFVFUGTISMS[ RZIXGVGTI RO[V[",2047:" 48H]RFR[ RSFS[ RPKMLLMKOKRLTMUPVUVXUYTZRZOYMXLUKPK RPKNLMMLOLRMTNUPV RUVWUXTYRYOXMWLUK ROFVF RO[V[",2048:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2049:" 41G^RFR[ RSFS[ RIMJLLMMQNSOTQU RJLKMLQMSNTQUTUWTXSYQZM[L RTUVTWSXQYM[L\\M ROFVF RO[V[",2050:" 43G]JXK[O[MWKSJPJLKIMGPFTFWGYIZLZPYSWWU[Y[ZX RMWLTKPKLLINGPF RTFVGXIYLYPXTWW RKZNZ RVZYZ",2051:" 18H\\UFH[ RUFV[ RTHU[ RLUUU RF[L[ RR[X[",2052:" 41F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVP RWFYGZIZKYNXOVP RMPVPXQYSYUXXVZR[F[ RVPWQXSXUWXUZR[",2053:" 34H]ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[S[UZWXXV RTFRGPINLMOLSLVMYNZP[",2054:" 30F]OFI[ RPFJ[ RLFUFXGYHZKZOYSWWUYSZO[F[ RUFWGXHYKYOXSVWTYRZO[",2055:" 22F]OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[U[WVT[",2056:" 20F\\OFI[ RPFJ[ RTLRT RLF[FZLZF RMPSP RF[M[",2057:" 42H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RTFRGPINLMOLSLVMYNZP[ RR[TZVXXT RUT\\T",2058:" 27E_NFH[ ROFI[ R[FU[ R\\FV[ RKFRF RXF_F RLPXP RE[L[ RR[Y[",2059:" 12LYUFO[ RVFP[ RRFYF RL[S[",2060:" 21I[XFSWRYQZO[M[KZJXJVKULVKW RWFRWQYO[ RTF[F",2061:" 27F]OFI[ RPFJ[ R]FLS RSOW[ RROV[ RLFSF RYF_F RF[M[ RS[Y[",2062:" 14H\\QFK[ RRFL[ RNFUF RH[W[YUV[",2063:" 30E`NFH[ RNFO[ ROFPY R\\FO[ R\\FV[ R]FW[ RKFOF R\\F`F RE[K[ RS[Z[",2064:" 21F_OFI[ ROFVX ROIV[ R\\FV[ RLFOF RYF_F RF[L[",2065:" 42G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF",2066:" 27F]OFI[ RPFJ[ RLFXF[G\\I\\K[NYPUQMQ RXFZG[I[KZNXPUQ RF[M[",2067:" 61G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF RSFQGOIMLLOKSKVLYN[ RQ[SZUXWUXRYNYKXHVF RLYLXMVOUPURVSXS_T`V`W^W] RSXT^U_V_W^",2068:" 42F^OFI[ RPFJ[ RLFWFZG[I[KZNYOVPMP RWFYGZIZKYNXOVP RRPTQURVZW[Y[ZYZX RURWYXZYZZY RF[M[",2069:" 35G^ZH[H\\F[L[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJUI[JYKY",2070:" 16H]UFO[ RVFP[ ROFLLNF]F\\L\\F RL[S[",2071:" 25F_NFKQJUJXKZN[R[UZWXXU\\F ROFLQKUKXLZN[ RKFRF RYF_F",2072:" 15H\\NFO[ ROFPY R\\FO[ RLFRF RXF^F",2073:" 24E_MFK[ RNFLY RUFK[ RUFS[ RVFTY R]FS[ RJFQF RZF`F",2074:" 21G]NFU[ ROFV[ R\\FH[ RLFRF RXF^F RF[L[ RR[X[",2075:" 20H]NFRPO[ ROFSPP[ R]FSP RLFRF RYF_F RL[S[",2076:" 16G][FH[ R\\FI[ ROFLLNF\\F RH[V[XUU[",2077:" 46H\\KILKXWYYY[ RLLXX RKIKKLMXYY[ RPPLTKVKXLZK[ RKVMZ RLTLVMXMZK[ RSSXN RVIVLWNYNYLWKVI RVIWLYN",2101:" 39I]NONPMPMONNPMTMVNWOXQXXYZZ[ RWOWXXZZ[[[ RWQVRPSMTLVLXMZP[S[UZWX RPSNTMVMXNZP[",2102:" 33G\\LFL[ RMFM[ RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIFMF",2103:" 28H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[",2104:" 36H]WFW[ RXFX[ RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTFXF RW[[[",2105:" 31H[LSXSXQWOVNTMQMNNLPKSKULXNZQ[S[VZXX RWSWPVN RQMONMPLSLUMXOZQ[",2106:" 22KXUGTHUIVHVGUFSFQGPIP[ RSFRGQIQ[ RMMUM RM[T[",2107:" 60I\\QMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM RONNPNTOV RUVVTVPUN RVOWNYMYNWN RNUMVLXLYM[P\\U\\X]Y^ RLYMZP[U[X\\Y^Y_XaUbObLaK_K^L\\O[",2108:" 28G]LFL[ RMFM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIFMF RI[P[ RT[[[",2109:" 18MXRFQGRHSGRF RRMR[ RSMS[ ROMSM RO[V[",2110:" 25MXSFRGSHTGSF RTMT_SaQbObNaN`O_P`Oa RSMS_RaQb RPMTM",2111:" 27G\\LFL[ RMFM[ RWMMW RRSX[ RQSW[ RIFMF RTMZM RI[P[ RT[Z[",2112:" 12MXRFR[ RSFS[ ROFSF RO[V[",2113:" 44BcGMG[ RHMH[ RHPJNMMOMRNSPS[ ROMQNRPR[ RSPUNXMZM]N^P^[ RZM\\N]P][ RDMHM RD[K[ RO[V[ RZ[a[",2114:" 28G]LML[ RMMM[ RMPONRMTMWNXPX[ RTMVNWPW[ RIMMM RI[P[ RT[[[",2115:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2116:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2117:" 33H\\WMWb RXMXb RWPUNSMQMNNLPKSKULXNZQ[S[UZWX RQMONMPLSLUMXOZQ[ RTb[b",2118:" 23IZNMN[ ROMO[ ROSPPRNTMWMXNXOWPVOWN RKMOM RK[R[",2119:" 32J[WOXMXQWOVNTMPMNNMOMQNRPSUUWVXW RMPNQPRUTWUXVXYWZU[Q[OZNYMWM[NY",2120:" 16KZPFPWQZS[U[WZXX RQFQWRZS[ RMMUM",2121:" 28G]LMLXMZP[R[UZWX RMMMXNZP[ RWMW[ RXMX[ RIMMM RTMXM RW[[[",2122:" 15I[LMR[ RMMRY RXMR[ RJMPM RTMZM",2123:" 24F^JMN[ RKMNX RRMN[ RRMV[ RSMVX RZMV[ RGMNM RWM]M",2124:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2125:" 22H[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2126:" 16I[WML[ RXMM[ RMMLQLMXM RL[X[XWW[",2127:" 40G^QMNNLPKRJUJXKZN[P[RZUWWTYPZM RQMONMPLRKUKXLZN[ RQMSMUNVPXXYZZ[ RSMTNUPWXXZZ[[[",2128:" 57G\\TFQGOIMMLPKTJZIb RTFRGPINMMPLTKZJb RTFVFXGYHYKXMWNTOPO RVFXHXKWMVNTO RPOTPVRWTWWVYUZR[P[NZMYLV RPOSPURVTVWUYTZR[",2129:" 28H\\IPKNMMOMQNROSRSVRZOb RJOLNPNRO RZMYPXRSYP^Nb RYMXPWRSY",2130:" 44I\\VNTMRMONMQLTLWMYNZP[R[UZWWXTXQWOSJRHRFSEUEWFYH RRMPNNQMTMXNZ RR[TZVWWTWPVNTKSISGTFVFYH",2131:" 32I[XPVNTMPMNNNPPRSS RPMONOPQRSS RSSNTLVLXMZP[S[UZWX RSSOTMVMXNZP[",2132:" 31I[TFRGQHQIRJUKZKZJWKSMPOMRLULWMYP[S]T_TaSbQbPa RULQONRMUMWNYP[",2133:" 32G]HQIOKMNMONOPNTL[ RMMNNNPMTK[ RNTPPRNTMVMXNYOYRXWUb RVMXOXRWWTb",2134:" 44F]GQHOJMMMNNNPMUMXNZO[ RLMMNMPLULXMZO[Q[SZUXWUXRYMYIXGVFTFRHRJSMUPWRZT RSZUWVUWRXMXIWGVF",2135:" 15LXRMPTOXOZP[S[UYVW RSMQTPXPZQ[",2136:" 29H\\NMJ[ ROMK[ RXMYNZNYMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW",2137:" 23H\\KFMFOGPHQJWXXZY[ RMFOHPJVXWZY[Z[ RRMJ[ RRMK[",2138:" 28F]MMGb RNMHb RMPLVLYN[P[RZTXVU RXMUXUZV[Y[[Y\\W RYMVXVZW[",2139:" 24H\\NML[ ROMNSMXL[ RYMXQVU RZMYPXRVUTWQYOZL[ RKMOM",2140:" 45IZTFRGQHQIRJUKXK RUKQLOMNONQPSSTVT RUKRLPMOOOQQSST RSTOUMVLXLZN\\S^T_TaRbPb RSTPUNVMXMZO\\S^",2141:" 32I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN",2142:" 22G]PNL[ RPNM[ RVNV[ RVNW[ RIPKNNM[M RIPKONN[N",2143:" 31H[LVMYNZP[R[UZWWXTXQWOVNTMRMONMQLTHb RR[TZVWWTWPVN RRMPNNQMTIb",2144:" 35H][MQMNNLQKTKWLYMZO[Q[TZVWWTWQVOUNSM RQMONMQLTLXMZ RQ[SZUWVTVPUN RUN[N",2145:" 16H\\SNP[ RSNQ[ RJPLNOMZM RJPLOONZN",2146:" 31H\\IQJOLMOMPNPPNVNYP[ RNMONOPMVMYNZP[Q[TZVXXUYRYOXMWNXOYR RXUYO",2147:" 37G]ONMOKQJTJWKYLZN[Q[TZWXYUZRZOXMVMTORSPXMb RJWLYNZQZTYWWYU RZOXNVNTPRSPYNb",2148:" 23I[KMMMONPPU_VaWb RMMNNOPT_UaWbYb RZMYOWRM]K`Jb",2149:" 34F]UFOb RVFNb RGQHOJMMMNNNPMUMXOZRZTYWVYS RLMMNMPLULXMZO[R[TZVXXUYS[M",2150:" 44F]JQLOONNMLNJQITIWJZK[M[OZQWRT RIWJYKZMZOYQW RQTQWRZS[U[WZYWZTZQYNXMWNYOZQ RQWRYSZUZWYYW",2151:" 39H]XMVTUXUZV[Y[[Y\\W RYMWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ",2152:" 36H[PFLSLVMYNZ RQFMS RMSNPPNRMTMVNWOXQXTWWUZR[P[NZMWMS RVNWPWTVWTZR[ RMFQF",2153:" 25I[WPWQXQXPWNUMRMONMQLTLWMYNZP[R[UZWW RRMPNNQMTMXNZ",2154:" 42H]ZFVTUXUZV[Y[[Y\\W R[FWTVXVZW[ RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RWF[F",2155:" 26I[MVQUTTWRXPWNUMRMONMQLTLWMYNZP[R[UZWX RRMPNNQMTMXNZ",2156:" 35KZZGYHZI[H[GZFXFVGUHTJSMP[O_Na RXFVHUJTNRWQ[P^O`NaLbJbIaI`J_K`Ja ROMYM",2157:" 43H\\YMU[T^RaObLbJaI`I_J^K_J` RXMT[S^QaOb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ",2158:" 31H]PFJ[ RQFK[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W RMFQF",2159:" 26LYUFTGUHVGUF RMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW",2160:" 32LYVFUGVHWGVF RNQOOQMTMUNUQR[Q^P`OaMbKbJaJ`K_L`Ka RSMTNTQQ[P^O`Mb",2161:" 34H\\PFJ[ RQFK[ RXNWOXPYOYNXMWMUNQROSMS ROSQTSZT[ ROSPTRZS[U[WZYW RMFQF",2162:" 18MYUFQTPXPZQ[T[VYWW RVFRTQXQZR[ RRFVF",2163:" 52AbBQCOEMHMINIPHTF[ RGMHNHPGTE[ RHTJPLNNMPMRNSOSQP[ RPMRORQO[ RRTTPVNXMZM\\N]O]Q[W[Z\\[ RZM\\O\\QZWZZ[[^[`YaW",2164:" 37F]GQHOJMMMNNNPMTK[ RLMMNMPLTJ[ RMTOPQNSMUMWNXOXQVWVZW[ RUMWOWQUWUZV[Y[[Y\\W",2165:" 32I[RMONMQLTLWMYNZP[R[UZWWXTXQWOVNTMRM RRMPNNQMTMXNZ RR[TZVWWTWPVN",2166:" 42G\\HQIOKMNMONOPNTJb RMMNNNPMTIb RNTOQQNSMUMWNXOYQYTXWVZS[Q[OZNWNT RWNXPXTWWUZS[ RFbMb",2167:" 33H\\XMRb RYMSb RVTVQUNSMQMNNLQKTKWLYMZO[Q[SZUWVT RQMONMQLTLXMZ RObVb",2168:" 26IZJQKOMMPMQNQPPTN[ ROMPNPPOTM[ RPTRPTNVMXMYNYOXPWOXN",2169:" 28J[XOXPYPYOXNUMRMONNONQORVVWW RNPOQVUWVWYVZS[P[MZLYLXMXMY",2170:" 18KYTFPTOXOZP[S[UYVW RUFQTPXPZQ[ RNMWM",2171:" 37F]GQHOJMMMNNNQLWLYN[ RLMMNMQKWKYLZN[P[RZTXVT RXMVTUXUZV[Y[[Y\\W RYMWTVXVZW[",2172:" 26H\\IQJOLMOMPNPQNWNYP[ RNMONOQMWMYNZP[Q[TZVXXUYQYMXMYO",2173:" 41C`DQEOGMJMKNKQIWIYK[ RIMJNJQHWHYIZK[M[OZQXRV RTMRVRYSZU[W[YZ[X\\V]R]M\\M]O RUMSVSYU[",2174:" 42H\\KQMNOMRMSOSR RQMRORRQVPXNZL[K[JZJYKXLYKZ RQVQYR[U[WZYW RYNXOYPZOZNYMXMVNTPSRRVRYS[",2175:" 41G\\HQIOKMNMONOQMWMYO[ RMMNNNQLWLYMZO[Q[SZUXWT RZMV[U^SaPbMbKaJ`J_K^L_K` RYMU[T^RaPb",2176:" 31H\\YMXOVQNWLYK[ RLQMOOMRMVO RMOONRNVOXO RLYNYRZUZWY RNYR[U[WYXW",2177:" 43G^VGUHVIWHWGUFRFOGMILLL[ RRFPGNIMLM[ R\\G[H\\I]H]G\\FZFXGWIW[ RZFYGXIX[ RIM[M RI[P[ RT[[[",2178:" 33G]WGVHWIXHWGUFRFOGMILLL[ RRFPGNIMLM[ RWMW[ RXMX[ RIMXM RI[P[ RT[[[",2179:" 35G]VGUHVIWHWGUF RXFRFOGMILLL[ RRFPGNIMLM[ RWHW[ RXFX[ RIMWM RI[P[ RT[[[",2180:" 54BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R]G\\H]I^H]G[FXFUGSIRLR[ RXFVGTISLS[ R]M][ R^M^[ RDM^M RD[K[ RO[V[ RZ[a[",2181:" 56BcRGQHRISHRGPFMFJGHIGLG[ RMFKGIIHLH[ R\\G[H\\I]H]G[F R^FXFUGSIRLR[ RXFVGTISLS[ R]H][ R^F^[ RDM]M RD[K[ RO[V[ RZ[a[",2182:" 12MXRMR[ RSMS[ ROMSM RO[V[",2184:" 25IZWNUMRMONMPLSLVMYNZQ[T[VZ RRMPNNPMSMVNYOZQ[ RMTUT",2185:" 43I\\TFQGOJNLMOLTLXMZO[Q[TZVWWUXRYMYIXGVFTF RTFRGPJOLNOMTMXNZO[ RQ[SZUWVUWRXMXIWGVF RNPWP",2186:" 42G]UFOb RVFNb RQMMNKPJSJVKXMZP[S[WZYXZUZRYPWNTMQM RQMNNLPKSKVLXNZP[ RS[VZXXYUYRXPVNTM",2187:" 27I[TMVNXPXOWNTMQMNNMOLQLSMUOWSZ RQMONNOMQMSNUSZT\\T^S_Q_",2190:" 45G]LMKNJPJRKUOYP[ RJRKTOXP[P]O`MbLbKaJ_J\\KXMTOQRNTMVMYNZPZTYXWZU[T[SZSXTWUXTY RVMXNYPYTXXWZ",2191:" 69E_YGXHYIZHYGWFTFQGOINKMNLRJ[I_Ha RTFRGPIOKNNLWK[J^I`HaFbDbCaC`D_E`Da R_G^H_I`H`G_F]F[GZHYJXMU[T_Sa R]F[HZJYNWWV[U^T`SaQbObNaN`O_P`Oa RIM^M",2192:" 52F^[GZH[I\\H[GXFUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea RYMWTVXVZW[Z[\\Y]W RZMXTWXWZX[ RJMZM",2193:" 54F^YGXHYIZHZGXF R\\FUFRGPIOKNNMRK[J_Ia RUFSGQIPKONMWL[K^J`IaGbEbDaD`E_F`Ea R[FWTVXVZW[Z[\\Y]W R\\FXTWXWZX[ RJMYM",2194:" 86@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R`G_H`IaH`G]FZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R^M\\T[X[Z\\[_[aYbW R_M]T\\X\\Z][ RDM_M",2195:" 88@cTGSHTIUHTGRFOFLGJIIKHNGRE[D_Ca ROFMGKIJKINGWF[E^D`CaAb?b>a>`?_@`?a R^G]H^I_H_G]F RaFZFWGUITKSNRRP[O_Na RZFXGVIUKTNRWQ[P^O`NaLbJbIaI`J_K`Ja R`F\\T[X[Z\\[_[aYbW RaF]T\\X\\Z][ RDM^M",2196:" 20LYMQNOPMSMTNTQRWRZS[ RRMSNSQQWQZR[U[WYXW",2200:" 40H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RQFOGNHMJLOLRMWNYOZQ[ RS[UZVYWWXRXOWJVHUGSF",2201:" 11H\\NJPISFS[ RRGR[ RN[W[",2202:" 45H\\LJMKLLKKKJLHMGPFTFWGXHYJYLXNUPPRNSLUKXK[ RTFVGWHXJXLWNTPPR RKYLXNXSZVZXYYX RNXS[W[XZYXYV",2203:" 47H\\LJMKLLKKKJLHMGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[P[MZLYKWKVLUMVLW RWQXTXWWYVZT[",2204:" 13H\\THT[ RUFU[ RUFJUZU RQ[X[",2205:" 39H\\MFKP RKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMVLW RSMUNWPXSXUWXUZS[ RMFWF RMGRGWF",2206:" 48H\\WIVJWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNRNOOMQLT RRFPGNIMKLOLUMXOZQ[ RS[UZWXXUXTWQUOSN",2207:" 31H\\KFKL RKJLHNFPFUIWIXHYF RLHNGPGUI RYFYIXLTQSSRVR[ RXLSQRSQVQ[",2208:" 63H\\PFMGLILLMNPOTOWNXLXIWGTFPF RPFNGMIMLNNPO RTOVNWLWIVGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO",2209:" 48H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[",2210:" 6MWRYQZR[SZRY",2211:" 8MWR[QZRYSZS\\R^Q_",2212:" 12MWRMQNROSNRM RRYQZR[SZRY",2213:" 14MWRMQNROSNRM RR[QZRYSZS\\R^Q_",2214:" 15MWRFQHRTSHRF RRHRN RRYQZR[SZRY",2215:" 32I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF",2251:" 8MWRHQGRFSGSIRKQL",2252:" 8MWSFRGQIQKRLSKRJ",2253:" 8MWRHSGRFQGQIRKSL",2254:" 8MWQFRGSISKRLQKRJ",2255:" 10E[HMLMRY RKMR[ R[BR[",2256:" 13F^ZJSJOKMLKNJQJSKVMXOYSZZZ",2257:" 13F^JJJQKULWNYQZSZVYXWYUZQZJ",2258:" 13F^JJQJUKWLYNZQZSYVWXUYQZJZ",2259:" 13F^JZJSKOLMNKQJSJVKXMYOZSZZ",2260:" 16F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR",2261:" 11E_XP[RXT RUMZRUW RIRZR",2262:" 11JZPLRITL RMORJWO RRJR[",2263:" 11E_LPIRLT ROMJROW RJR[R",2264:" 11JZPXR[TX RMURZWU RRIRZ",2265:" 44I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF",2266:" 15H\\JFR[ RKFRY RZFR[ RJFZF RKGYG",2267:" 10AbDMIMRY RHNR[ Rb:R[",2268:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2269:" 50F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia RQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",2270:" 26F_\\S[UYVWVUUTTQPPONNLNJOIQISJULVNVPUQTTPUOWNYN[O\\Q\\S",2271:" 32F^[FI[ RNFPHPJOLMMKMIKIIJGLFNFPGSHVHYG[F RWTUUTWTYV[X[ZZ[X[VYTWT",2272:" 49F_[NZO[P\\O\\N[MZMYNXPVUTXRZP[M[JZIXIUJSPORMSKSIRGPFNGMIMKNNPQUXWZZ[[[\\Z\\Y RM[KZJXJUKSMQ RMKNMVXXZZ[",2273:" 56E`WNVLTKQKOLNMMPMSNUPVSVUUVS RQKOMNPNSOUPV RWKVSVUXVZV\\T]Q]O\\L[JYHWGTFQFNGLHJJILHOHRIUJWLYNZQ[T[WZYYZX RXKWSWUXV",2274:" 42H\\PBP_ RTBT_ RXIWJXKYJYIWGTFPFMGKIKKLMMNOOUQWRYT RKKMMONUPWQXRYTYXWZT[P[MZKXKWLVMWLX",2275:" 12H]SFLb RYFRb RLQZQ RKWYW",2276:" 46JZUITJUKVJVIUGSFQFOGNINKOMQOVR ROMTPVRWTWVVXTZ RPNNPMRMTNVPXU[ RNVSYU[V]V_UaSbQbOaN_N^O]P^O_",2277:" 30JZRFQHRJSHRF RRFRb RRQQTRbSTRQ RLMNNPMNLLM RLMXM RTMVNXMVLTM",2278:" 56JZRFQHRJSHRF RRFRT RRPQRSVRXQVSRRP RRTRb RR^Q`RbS`R^ RLMNNPMNLLM RLMXM RTMVNXMVLTM RL[N\\P[NZL[ RL[X[ RT[V\\X[VZT[",2279:" 12I\\XFX[ RKFXF RPPXP RK[X[",2281:" 38E`QFNGKIILHOHRIUKXNZQ[T[WZZX\\U]R]O\\LZIWGTFQF RROQPQQRRSRTQTPSORO RRPRQSQSPRP",2282:" 45J[PFNGOIQJ RPFOGOI RUFWGVITJ RUFVGVI RQJOKNLMNMQNSOTQUTUVTWSXQXNWLVKTJQJ RRUR[ RSUS[ RNXWX",2283:" 27I\\RFOGMILLLMMPORRSSSVRXPYMYLXIVGSFRF RRSR[ RSSS[ RNWWW",2284:" 28D`PFMGJIHLGOGSHVJYM[P\\T\\W[ZY\\V]S]O\\LZIWGTFPF RRFR\\ RGQ]Q",2285:" 31G`PMMNKPJSJTKWMYPZQZTYVWWTWSVPTNQMPM R]GWG[HUN R]G]M\\IVO R\\HVN",2286:" 28F\\IIJGLFOFQGRIRLQOPQNSKU ROFPGQIQMPPNS RVFT[ RWFS[ RKUYU",2287:" 30I\\MFMU RNFMQ RMQNOONQMTMWNXPXRWTUV RTMVNWPWRTXTZU[W[YY RKFNF",2288:" 44I\\RNOOMQLTLUMXOZR[S[VZXXYUYTXQVOSNRN RRHNJRFRN RSHWJSFSN RRSQTQURVSVTUTTSSRS RRTRUSUSTRT",2289:" 37G^QHRFR[ RTHSFS[ RJHKFKMLPNRQSRS RMHLFLNMQ R[HZFZMYPWRTSSS RXHYFYNXQ RNWWW",2290:" 31G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[Y[YVX[",2291:" 24H[YGUGQHNJLMKPKSLVNYQ[U\\Y\\ RYGVHSJQMPPPSQVSYV[Y\\",2292:" 27F_OQMQKRJSIUIWJYKZM[O[QZRYSWSURSQROQ RSHPQ RZJRR R\\QST",2293:" 12H\\OKUY RUKOY RKOYU RYOKU",2294:" 48F^NVLUKUIVHXHYI[K\\L\\N[OYOXNVKRJOJMKJMHPGTGWHYJZMZOYRVVUXUYV[X\\Y\\[[\\Y\\X[VYUXUVV RJMKKMIPHTHWIYKZM",2295:" 48F^NMLNKNIMHKHJIHKGLGNHOJOKNMKQJTJVKYM[P\\T\\W[YYZVZTYQVMUKUJVHXGYG[H\\J\\K[MYNXNVM RJVKXMZP[T[WZYXZV",2301:" 40F_JMILIJJHLGNGPHQIRKSP RIJKHMHOIPJQLRPR[ R[M\\L\\J[HYGWGUHTISKRP R\\JZHXHVIUJTLSPS[",2302:" 51F^IGJKKMMOPPTPWOYMZK[G RIGJJKLMNPOTOWNYLZJ[G RPONPMQLSLVMXOZQ[S[UZWXXVXSWQVPTO RPPNQMSMVNY RVYWVWSVQTP",2303:" 30F^MJMV RNKNU RVKVU RWJWV RIGKIMJPKTKWJYI[G RIYKWMVPUTUWVYW[Y",2304:" 48F^[ILIJJILINJPLQNQPPQNQLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX",2305:" 48F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU",2306:" 48G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[",2307:" 41F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY",2308:" 30F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W",2309:" 33G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY",2310:" 33F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ",2311:" 36F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2381:" 89IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVeXgXgVeV RfVfX ReWgW",2382:" 85D`H>Hf RI>If RM>Mf RQBSBSDQDQAR?T>W>Y?[A\\D\\I[LYNWOUOSNRLQNOQNROSQVRXSVUUWUYV[X\\[\\`[cYeWfTfReQcQ`S`SbQb RRBRD RQCSC RY?ZA[D[IZLYN RRLRNPQNRPSRVRX RYVZX[[[`ZcYe RR`Rb RQaSa",2401:" 21AcHBHb RIBIb R[B[b R\\B\\b RDB`B RDbMb RWb`b",2402:" 23BaGBQPFb RFBPP REBPQ REB\\B^I[B RGa\\a RFb\\b^[[b",2403:" 28I[X+U1R8P=OANFMNMVN^OcPgRlUsXy RU1S6Q<P@OFNNNVO^PdQhSnUs",2404:" 28I[L+O1R8T=UAVFWNWVV^UcTgRlOsLy RO1Q6S<T@UFVNVVU^TdShQnOs",2405:" 14I[M+MRMy RN+NRNy RM+X+ RMyXy",2406:" 14I[V+VRVy RW+WRWy RL+W+ RLyWy",2407:" 48I[V+S-Q/P1O4O8P<TDUGUJTMRP RS-Q0P4P8Q;UCVGVJUMRPNRRTUWVZV]UaQiPlPpQtSw RRTTWUZU]T`PhOlOpPsQuSwVy",2408:" 48I[N+Q-S/T1U4U8T<PDOGOJPMRP RQ-S0T4T8S;OCNGNJOMRPVRRTOWNZN]OaSiTlTpStQw RRTPWOZO]P`ThUlUpTsSuQwNy",2409:" 32I[V.S1Q4O8N=NCOIPMSXT\\UbUgTlSoQs RS1Q5P8O=OBPHQLTWU[VaVgUlSpQsNv",2410:" 32I[N.Q1S4U8V=VCUITMQXP\\ObOgPlQoSs RQ1S5T8U=UBTHSLPWO[NaNgOlQpSsVv",2411:' 147Z:RARRo R@RQo R?RRr RZ"VJRr',2412:" 57Ca].\\.[/[0\\1]1^0^.],[+Y+W,U.T0S3R:QJQjPsOv R\\/\\0]0]/\\/ RR:Rj RU.T1S:SZRjQqPtOvMxKyIyGxFvFtGsHsItIuHvGv RGtGuHuHtGt",2501:" 20H\\RFJ[ RRIK[J[ RRIY[Z[ RRFZ[ RMUWU RLVXV",2502:" 44H\\LFL[ RMGMZ RLFTFWGXHYJYMXOWPTQ RMGTGWHXJXMWOTP RMPTPWQXRYTYWXYWZT[L[ RMQTQWRXTXWWYTZMZ",2503:" 38H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV RZKYKXIWHUGQGOHMKLNLSMVOYQZUZWYXXYVZV",2504:" 32H]LFL[ RMGMZ RLFSFVGXIYKZNZSYVXXVZS[L[ RMGSGVHWIXKYNYSXVWXVYSZMZ",2505:" 27I\\MFM[ RNGNZ RMFYF RNGYGYF RNPTPTQ RNQTQ RNZYZY[ RM[Y[",2506:" 21I[MFM[ RNGN[M[ RMFYF RNGYGYF RNPTPTQ RNQTQ",2507:" 44H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZRUR RZKYKXIWHUGQGOHNIMKLNLSMVNXOYQZUZWYXXYVYSUSUR",2508:" 22G]KFK[ RKFLFL[K[ RYFXFX[Y[ RYFY[ RLPXP RLQXQ",2509:" 8NWRFR[S[ RRFSFS[",2510:" 20J[VFVVUYSZQZOYNVMV RVFWFWVVYUZS[Q[OZNYMV",2511:" 22H]LFL[M[ RLFMFM[ RZFYFMR RZFMS RPOY[Z[ RQOZ[",2512:" 14IZMFM[ RMFNFNZ RNZYZY[ RM[Y[",2513:" 26F^JFJ[ RKKK[J[ RKKR[ RJFRX RZFRX RYKR[ RYKY[Z[ RZFZ[",2514:" 20G]KFK[ RLIL[K[ RLIY[ RKFXX RXFXX RXFYFY[",2515:" 40G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RQGNHLKKNKSLVNYQZSZVYXVYSYNXKVHSGQG",2516:" 27H\\LFL[ RMGM[L[ RLFUFWGXHYJYMXOWPUQMQ RMGUGWHXJXMWOUPMP",2517:" 48G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RQGNHLKKNKSLVNYQZSZVYXVYSYNXKVHSGQG RSXX]Y] RSXTXY]",2518:" 34H\\LFL[ RMGM[L[ RLFTFWGXHYJYMXOWPTQMQ RMGTGWHXJXMWOTPMP RRQX[Y[ RSQY[",2519:" 43H\\YIWGTFPFMGKIKKLMMNOOTQVRWSXUXXWYTZPZNYMXKX RYIWIVHTGPGMHLILKMMONTPVQXSYUYXWZT[P[MZKX",2520:" 15J[RGR[ RSGS[R[ RLFYFYG RLFLGYG",2521:" 24G]KFKULXNZQ[S[VZXXYUYF RKFLFLUMXNYQZSZVYWXXUXFYF",2522:" 14H\\JFR[ RJFKFRX RZFYFRX RZFR[",2523:" 26E_GFM[ RGFHFMX RRFMX RRIM[ RRIW[ RRFWX R]F\\FWX R]FW[",2524:" 16H\\KFX[Y[ RKFLFY[ RYFXFK[ RYFL[K[",2525:" 17I\\KFRPR[S[ RKFLFSP RZFYFRP RZFSPS[",2526:" 20H\\XFK[ RYFL[ RKFYF RKFKGXG RLZYZY[ RK[Y[",2551:" 38E\\XFVHTKQPOSLWIZG[E[DZDXEWFXEY RXFWJUTT[ RXFU[ RT[TYSVRTPRNQLQKRKTLWOZR[V[XZ",2552:" 70F^UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFXFZG[I[KZMXNTORO RXFYGZIZKYMXN RTOWPXQYSYVXYWZU[S[RZRXSU RTOVPWQXSXVWYU[",2553:" 41H]KHJJJLKNNOQOUNWMYKZIZGYFWFTGQJOMMQLULXMZP[R[UZWXXVXTWRURSSRU RWFUGRJPMNQMUMXNZP[",2554:" 43F]UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWJWLXNZP[S[UZWXYTZOZLYIWGUFPFMGKIJKJMKNMNNMOK",2555:" 49I\\WIVJVLWMYMZKZIYGWFTFRGQHPJPLQNSO RTFRHQJQMSO RSOQONPLRKTKWLYMZO[R[UZWXXVXTWRURSSRU RQOOPMRLTLXMZ",2556:" 46G\\WHVJTORUQWOZM[ RQLPNNOLOKMKKLINGQF[FXGWHVKTSSVRXPZM[K[IZHYHXIWJXIY RSFWGXG ROSPRRQVQXPZMXT",2557:" 53G]JIIKIMJOLPOPROTNWKXHXGWFVFTGRIQKPNPQQSSTUTWSYQZO RWFUGSIRKQNQRST RZOYSWWUYSZO[L[JZIXIWJVKWJX RYSWVUXRZO[",2558:" 55F^LLKKKILGOFRFOQMWLYKZI[G[FZFXGWHXGY RRFOONRLWKYI[ RJTKSMRVOXN[L]J^H^G]F\\FZGXJWLURTVTYV[W[YZ[X R\\FZHXLVRUVUYV[",2559:" 33IYWHUKSPQUPWNZL[ RYLWNTOQOONNLNJOHQGUFYFWHVJTPRVQXOZL[J[IZIXJWKXJY",2560:" 34IZYFWHUKSPPYN] RYMWOTPQPOONMNKOIQGUFYFWIVKSTQXPZN]M^K_J^J\\KZMXOWRVVU",2561:" 59F^LLKKKIMGPFRFOQMWLYKZI[G[FZFXGWHXGY RRFOONRLWKYI[ RZGWKUMSNPO R]G\\H]I^H^G]F\\FZGWLVMTNPO RPOSPTRUYV[ RPORPSRTYV[W[YZ[X",2562:" 40I[MILKLMMOOPRPUOWNZK[H[GZFYFWGVHTKPUOWMZK[ RVHTLRSQVPXNZK[I[HZHXIWKWMXPZR[U[WZYX",2563:" 49D`RFNOKUIXGZE[C[BZBXCWDXCY RRFPMOQNVNZP[ RRFQJPOOVOZP[ R[FWORXP[ R[FYMXQWVWZY[Z[\\Z^X R[FZJYOXVXZY[",2564:" 38G^RFQJOPMULWJZH[F[EZEXFWGXFY RRFRKSVT[ RRFSKTVT[ R`G_H`IaHaG`F^F\\GZJYLWQUWT[",2565:" 34H]SFQGOIMLLNKRKVLYMZO[Q[TZVXXUYSZOZKYHXGWGUHSJQNPSPV RQGOJMNLRLVMYO[",2566:" 53F]UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFVFYGZH[J[MZOYPVQTQRP RVFXGYHZJZMYOXPVQ",2567:" 43H]UJULTNSOQPOPNNNLOIQGTFWFYGZIZMYPWSSWPYNZK[I[HZHXIWKWMXPZS[V[XZZX RWFXGYIYMXPVSSVOYK[",2568:" 65F^UGTHSJQOOUNWLZJ[ RTHSKQSPVOXMZJ[H[GZGXHWIXHY ROLNNMOKOJNJLKJMHOGRFWFZG[I[KZMYNVORO RWFYGZIZKYMXNVO RROUPVRWYX[ RROTPURVYX[Y[[Z]X",2569:" 36H\\NIMKMMNOPPSPVOXN[K\\H\\G[FZFXGWHVJUMSTRWPZN[ RVJUNTUSXQZN[K[IZHXHWIVJWIX",2570:" 38I[YHXJVOTUSWQZO[ RSLRNPONOMMMKNIPGSF\\FZGYHXKVSUVTXRZO[M[KZJYJXKWLXKY RUFYGZG",2571:" 39G]HJJGLFMFOHOKNNKVKYL[ RMFNHNKKSJVJYL[N[PZSWUTVR RZFVRUVUYW[X[ZZ\\X R[FWRVVVYW[",2572:" 36G\\HJJGLFMFOHOKNOLVLYM[ RMFNHNKLRKVKYM[N[QZTWVTXPYMZIZGYFXFWGVIVLWNYP[Q]Q",2573:" 41F]ILHLGKGIHGJFNFMHLLKUJ[ RLLLUK[ RVFTHRLOUMYK[ RVFUHTLSUR[ RTLTUS[ R`F^G\\IZLWUUYS[",2574:" 52H\\PKOLMLLKLIMGOFQFSGTITLSPQUOXMZJ[H[GZGXHWIXHY RQFRGSISLRPPUNXLZJ[ R]G\\H]I^H^G]F[FYGWIULSPRURXSZT[U[WZYX",2575:" 42G]JJLGNFOFQGQIOOORPT ROFPGPINONRPTRTUSWQYNZL R\\FZLWTUX R]F[LYQWUUXSZP[L[JZIXIWJVKWJX",2576:" 44G\\ZHYJWOVRUTSWQYOZL[ RSLRNPONOMMMKNIPGSF]F[GZHYKXOVUTXQZL[H[GZGXHWJWLXOZQ[T[WZYX RVFZG[G",2601:" 36H\\WMW[X[ RWMXMX[ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2602:" 36H\\LFL[M[ RLFMFM[ RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",2603:" 32I[XPVNTMQMONMPLSLUMXOZQ[T[VZXX RXPWQVOTNQNOONPMSMUNXOYQZTZVYWWXX",2604:" 36H\\WFW[X[ RWFXFX[ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2605:" 36I[MTXTXQWOVNTMQMONMPLSLUMXOZQ[T[VZXX RMSWSWQVOTNQNOONPMSMUNXOYQZTZVYWWXX",2606:" 24LZWFUFSGRJR[S[ RWFWGUGSH RTGSJS[ ROMVMVN ROMONVN",2607:" 48H\\XMWMW\\V_U`SaQaO`N_L_ RXMX\\W_UaSbPbNaL_ RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2608:" 25H\\LFL[M[ RLFMFM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2609:" 24NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMR[S[ RRMSMS[",2610:" 24NWRFQGQHRISITHTGSFRF RRGRHSHSGRG RRMRbSb RRMSMSb",2611:" 22H[LFL[M[ RLFMFM[ RXMWMMW RXMMX RPTV[X[ RQSX[",2612:" 8NWRFR[S[ RRFSFS[",2613:" 42CbGMG[H[ RGMHMH[ RHQKNMMPMRNSQS[ RHQKOMNONQORQR[S[ RSQVNXM[M]N^Q^[ RSQVOXNZN\\O]Q][^[",2614:" 25H\\LML[M[ RLMMMM[ RMQPNRMUMWNXQX[ RMQPORNTNVOWQW[X[",2615:" 36I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM RQNOONPMSMUNXOYQZTZVYWXXUXSWPVOTNQN",2616:" 36H\\LMLbMb RLMMMMb RMPONQMTMVNXPYSYUXXVZT[Q[OZMX RMPQNTNVOWPXSXUWXVYTZQZMX",2617:" 36H\\WMWbXb RWMXMXb RWPUNSMPMNNLPKSKULXNZP[S[UZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2618:" 21KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",2619:" 50J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",2624:" 16I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",2625:" 17JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",2626:" 20I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",2651:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[",2652:" 23LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[",2653:" 22LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2654:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZV[XZYY[V R[FUXUZV[",2655:" 23LXOYQXRWSUSSRRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2656:" 27OXRRUOWLXIXGWFUGTIKdKfLgNfOcPZQ[S[UZVYXV RTISNRRO[M`Kd",2657:" 38K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V",2658:" 30L[LVNSPO RSFL[ RTFM[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2659:" 19NVSLRMSNTMSL RQROXOZQ[SZTYVV RRRPXPZQ[",2660:" 24NVSLRMSNTMSL RQRKd RRRO[M`KdJfHgGfGdHaJ_M]Q[TYVV",2661:" 31LZLVNSPO RSFL[ RTFM[ RURUSVSURTRRTOU ROURVSZT[ ROUQVRZT[U[XYZV",2662:" 17NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[",2663:" 45E^EVGSIRKSKUI[ RIRJSJUH[ RKUMSORPRRSRUP[ RPRQSQUO[ RRUTSVRWRYSYUXXXZY[ RWRXSXUWXWZY[[Z\\Y^V",2664:" 32I[IVKSMROSOUM[ RMRNSNUL[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2665:" 29KYRRPRNSMTLVLXMZO[Q[SZTYUWUUTSRRQSQURWTXVXXWYV RPRNTMVMYO[",2666:" 30L[LVNSPO RQLHg RRLIg ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2667:" 35K[UUTSRRPRNSMTLVLXMZO[Q[SZ RPRNTMVMYO[ RVRPdPfQgSfTcT[V[YY[V RWRT[R`Pd",2668:" 24LZLVNSPRRSRUP[ RPRQSQUO[ RRUTSVRWRVU RVRVUWWXWZV",2669:" 22NZNVPSQQQSTUUWUYTZR[ RQSSUTWTYR[ RNZP[U[XYZV",2670:" 20NVNVPSRO RUFOXOZQ[SZTYVV RVFPXPZQ[ RPNVN",2671:" 27K[NRLXLZN[O[QZSXUU RORMXMZN[ RVRTXTZV[XZYY[V RWRUXUZV[",2672:" 23KZNRMTLWLZN[O[RZTXUUUR RORNTMWMZN[ RURVVWWXWZV",2673:" 36H]LRJTIWIZK[L[NZPX RMRKTJWJZK[ RRRPXPZR[S[UZWXXUXR RSRQXQZR[ RXRYVZW[W]V",2674:" 42JZJVLSNRPRQSQUPXOZM[L[KZKYLYKZ RWSVTWTWSVRURSSRUQXQZR[U[XYZV RQSRU RSSQU RPXQZ RQXOZ",2675:" 32K[NRLXLZN[O[QZSXUU RORMXMZN[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V",2676:" 38LYLVNSPRRRTSTVSXPZN[ RRRSSSVRXPZ RN[P\\Q^QaPdNfLgKfKdLaO^R\\VYYV RN[O\\P^PaOdNf",2700:" 42H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF ROGMJLOLRMWOZ RNYQZSZVY RUZWWXRXOWJUG RVHSGQGNH",2701:" 12H\\NJPISFS[ RNJNKPJRHR[S[",2702:" 34H\\LKLJMHNGPFTFVGWHXJXLWNUQL[ RLKMKMJNHPGTGVHWJWLVNTQK[ RLZYZY[ RK[Y[",2703:" 48H\\MFXFQO RMFMGWG RWFPO RQNSNVOXQYTYUXXVZS[P[MZLYKWLW RPOSOVPXS RTOWQXTXUWXTZ RXVVYSZPZMYLW ROZLX",2704:" 18H\\UIU[V[ RVFV[ RVFKVZV RUILV RLUZUZV",2705:" 53H\\MFLO RNGMN RMFWFWG RNGWG RMNPMSMVNXPYSYUXXVZS[P[MZLYKWLW RLOMOONSNVOXR RTNWPXSXUWXTZ RXVVYSZPZMYLW ROZLX",2706:" 62H\\VGWIXIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQ RWHTGRGOH RPGNJMOMTNXQZ RMVOYRZSZVYXV RTZWXXUXTWQTO RXSVPSOROOPMS RQONQMT",2707:" 12H\\KFYFO[ RKFKGXG RXFN[O[",2708:" 68H\\PFMGLILKMMNNPOTPVQWRXTXWWYTZPZMYLWLTMRNQPPTOVNWMXKXIWGTFPF RNGMIMKNMPNTOVPXRYTYWXYWZT[P[MZLYKWKTLRNPPOTNVMWKWIVG RWHTGPGMH RLXOZ RUZXX",2709:" 62H\\WPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLXMXNZ RWMVPSR RWNUQRRQRNQLN RPRMPLMLLMIPG RLKNHQGRGUHWK RSGVIWMWRVWTZ RUYRZPZMY",2710:" 16MXRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2711:" 24MXTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^",2712:" 32MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2713:" 40MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^",2714:" 24MXRFRTST RRFSFST RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2715:" 58I\\LKLJMHNGQFTFWGXHYJYLXNWOUPRQ RLKMKMJNHQGTGWHXJXLWNUORP RMIPG RUGXI RXMTP RRPRTSTSP RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",2716:" 24MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ",2717:" 24MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL",2718:" 71F_\\MZMXNWPUVTXSYQZMZKYJWJUKSLRQOSMTKTISGQFPFNGMIMKNNPQUWXZZ[\\[ R\\M\\NZNXO RYNXPVVUXSZQ[M[KZJYIWIUJSLQQNRMSKSIRG RSHQGPGNH ROGNINKONQQVWXYZZ\\Z\\[",2719:" 51I\\RBR_S_ RRBSBS_ RWIYIWGTFQFNGLILKMMNNVRWSXUXWWYTZQZOYNX RWIVHTGQGNHMIMKNMVQXSYUYWXYWZT[Q[NZLXNX RXXUZ",2720:" 8G^[BIbJb R[B\\BJb",2721:" 24KYUBSDQGOKNPNTOYQ]S`UbVb RUBVBTDRGPKOPOTPYR]T`Vb",2722:" 24KYNBPDRGTKUPUTTYR]P`NbOb RNBOBQDSGUKVPVTUYS]Q`Ob",2723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",2724:" 8F_JQ[Q[R RJQJR[R",2725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",2726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",2727:" 11NWSFRGRM RSGRM RSFTGRM",2728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",2729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",2750:" 42H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RTFRGPINLMOLSLVMYO[ RQ[SZUXWUXRYNYKXHVF",2751:" 15H]TJO[ RVFP[ RVFSIPKNL RUIQKNL",2752:" 42H]OJPKOLNKNJOHPGSFVFYGZIZKYMWOTQPSMUKWI[ RVFXGYIYKXMVOPS RJYKXMXRZUZWYXW RMXR[U[WZXW",2753:" 50H]OJPKOLNKNJOHPGSFVFYGZIZKYMVOSP RVFXGYIYKXMVO RQPSPVQWRXTXWWYVZS[O[LZKYJWJVKULVKW RSPUQVRWTWWVYUZS[",2754:" 10H]XGR[ RYFS[ RYFJUZU",2755:" 39H]QFLP RQF[F RQGVG[F RLPMOPNSNVOWPXRXUWXUZR[O[LZKYJWJVKULVKW RSNUOVPWRWUVXTZR[",2756:" 46H]YIXJYKZJZIYGWFTFQGOIMLLOKSKWLYMZO[R[UZWXXVXSWQVPTOQOOPMRLT RTFRGPINLMOLSLXMZ RR[TZVXWVWRVP",2757:" 30H]NFLL R[FZIXLSRQUPWO[ RXLRRPUOWN[ RMIPFRFWI RNHPGRGWIYIZH[F",2758:" 63H]SFPGOHNJNMOOQPTPXOYNZLZIYGVFSF RSFQGPHOJOMPOQP RTPWOXNYLYIXGVF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RQPNQLSKUKXLZN[ RR[UZVYWWWSVQ",2759:" 46H]YMXOVQTRQROQNPMNMKNIPGSFVFXGYHZJZNYRXUVXTZQ[N[LZKXKWLVMWLX ROQNONKOIQGSF RXGYIYNXRWUUXSZQ[",2760:" 6MXPYOZP[QZPY",2761:" 8MXP[OZPYQZQ[P]N_",2762:" 11MXSMRNSOTNSM RPYOZP[QZ",2763:" 14MXSMRNSOTNSM RP[OZPYQZQ[P]N_",2764:" 17MXUFTGRS RUGRS RUFVGRS RPYOZP[QZPY",2765:" 34H]OJPKOLNKNJOHPGSFWFZG[I[KZMYNSPQQQSRTTT RWFYGZIZKYMXNVO RPYOZP[QZPY",2766:" 8MXVFTHSJSKTLUKTJ",2767:" 8MXUHTGUFVGVHUJSL",2768:" 55E_\\N[O\\P]O]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQUSXUZW[Y[ZYZX RK[IZHXHVITJSPP ROLPQQTSWUYWZYZZY",2769:" 41H]TBL_ RYBQ_ RZJYKZL[K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW",2770:" 3G]_BEb",2771:" 20KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb",2772:" 20JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_",2773:" 9J[TFTR ROIYO RYIOO",2774:" 3E_IR[R",2775:" 6E_RIR[ RIR[R",2776:" 6E_IO[O RIU[U",2777:" 6NWUFSM RVFSM",2778:" 12I[PFNM RQFNM RYFWM RZFWM",2779:" 14KZSFQGPIPKQMSNUNWMXKXIWGUFSF",2801:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2802:" 31G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2803:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2804:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2805:" 31F^NFNLMTLXKZJ[ RXFX[ RYFY[ RKF\\F RG[\\[ RG[Gb RH[Gb R[[\\b R\\[\\b",2806:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2807:" 71CbRFR[ RSFS[ ROFVF RGGHHGIFHFGGFHFIGJIKMLONPWPYOZM[I\\G]F^F_G_H^I]H^G RNPLQKSJXIZH[ RNPMQLSKXJZI[G[FZEX RWPYQZS[X\\Z][ RWPXQYSZX[Z\\[^[_Z`X RO[V[",2808:" 45H\\LIKFKLLINGPFTFWGXIXLWNTOQO RTFVGWIWLVNTO RTOVPXRYTYWXYWZT[O[MZLYKWKVLUMVLW RWQXTXWWYVZT[",2809:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RXHLY RH[O[ RU[\\[",2810:" 37F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RXHLY RH[O[ RU[\\[ RN@N?M?M@NBPCTCVBW@",2811:" 43F^KFK[ RLFL[ RHFOF RLPSPUOVMWIXGYFZF[G[HZIYHZG RSPUQVSWXXZY[ RSPTQUSVXWZX[Z[[Z\\X RH[O[",2812:" 25E^MFMLLTKXJZI[H[GZGYHXIYHZ RXFX[ RYFY[ RJF\\F RU[\\[",2813:" 30F_KFK[ RLFRX RKFR[ RYFR[ RYFY[ RZFZ[ RHFLF RYF]F RH[N[ RV[][",2814:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RLPXP RH[O[ RU[\\[",2815:" 44G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RQFOGMILKKOKRLVMXOZQ[ RS[UZWXXVYRYOXKWIUGSF",2816:" 21F^KFK[ RLFL[ RXFX[ RYFY[ RHF\\F RH[O[ RU[\\[",2817:" 29G]LFL[ RMFM[ RIFUFXGYHZJZMYOXPUQMQ RUFWGXHYJYMXOWPUQ RI[P[",2818:" 32G\\XIYLYFXIVGSFQFNGLIKKJNJSKVLXNZQ[S[VZXXYV RQFOGMILKKNKSLVMXOZQ[",2819:" 16I\\RFR[ RSFS[ RLFKLKFZFZLYF RO[V[",2820:" 24H]KFRV RLFSV RZFSVQYPZN[M[LZLYMXNYMZ RIFOF RVF\\F",2821:" 48F_RFR[ RSFS[ ROFVF RPILJJLIOIRJULWPXUXYW[U\\R\\O[LYJUIPI RPIMJKLJOJRKUMWPX RUXXWZU[R[OZLXJUI RO[V[",2822:" 21H\\KFX[ RLFY[ RYFK[ RIFOF RUF[F RI[O[ RU[[[",2823:" 27F^KFK[ RLFL[ RXFX[ RYFY[ RHFOF RUF\\F RH[\\[ R[[\\b R\\[\\b",2824:" 28F]KFKQLSOTRTUSWQ RLFLQMSOT RWFW[ RXFX[ RHFOF RTF[F RT[[[",2825:" 30BcGFG[ RHFH[ RRFR[ RSFS[ R]F][ R^F^[ RDFKF ROFVF RZFaF RD[a[",2826:" 36BcGFG[ RHFH[ RRFR[ RSFS[ R]F][ R^F^[ RDFKF ROFVF RZFaF RD[a[ R`[ab Ra[ab",2827:" 31F`PFP[ RQFQ[ RIFHLHFTF RQPXP[Q\\R]T]W\\Y[ZX[M[ RXPZQ[R\\T\\W[YZZX[",2828:" 41CaHFH[ RIFI[ REFLF RIPPPSQTRUTUWTYSZP[E[ RPPRQSRTTTWSYRZP[ R[F[[ R\\F\\[ RXF_F RX[_[",2829:" 29H]MFM[ RNFN[ RJFQF RNPUPXQYRZTZWYYXZU[J[ RUPWQXRYTYWXYWZU[",2830:" 39H]LIKFKLLINGQFSFVGXIYKZNZSYVXXVZS[P[MZLYKWKVLUMVLW RSFUGWIXKYNYSXVWXUZS[ RPPYP",2831:" 59CbHFH[ RIFI[ REFLF RE[L[ RVFSGQIPKOOORPVQXSZV[X[[Z]X^V_R_O^K]I[GXFVF RVFTGRIQKPOPRQVRXTZV[ RX[ZZ\\X]V^R^O]K\\IZGXF RIPOP",2832:" 45G]WFW[ RXFX[ R[FOFLGKHJJJLKNLOOPWP ROFMGLHKJKLLNMOOP RRPPQORLYKZJZIY RPQOSMZL[J[IYIX RT[[[",2901:" 39I]NONPMPMONNPMTMVNWOXQXXYZZ[ RWOWXXZZ[[[ RWQVRPSMTLVLXMZP[S[UZWX RPSNTMVMXNZP[",2902:" 48H\\XFWGQINKLNKQKULXNZQ[S[VZXXYUYSXPVNSMQMNNLPKS RXFWHUIQJNLLN RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2903:" 37H\\MMM[ RNMN[ RJMUMXNYPYQXSUT RUMWNXPXQWSUT RNTUTXUYWYXXZU[J[ RUTWUXWXXWZU[",2904:" 14HZMMM[ RNMN[ RJMXMXRWM RJ[Q[",2905:" 22F]NMNQMWLZK[ RWMW[ RXMX[ RKM[M RI[H`H[[[[`Z[",2906:" 31H[LSXSXQWOVNTMQMNNLPKSKULXNZQ[S[VZXX RWSWPVN RQMONMPLSLUMXOZQ[",2907:" 59E`RMR[ RSMS[ ROMVM RJNIOHNIMJMKNMRNSPTUTWSXRZN[M\\M]N\\O[N RPTNUMVKZJ[ RPTNVLZK[I[HZGX RUTWUXVZZ[[ RUTWVYZZ[\\[]Z^X RO[V[",2908:" 42I[MOLMLQMONNPMTMWNXPXQWSTT RTMVNWPWQVSTT RQTTTWUXWXXWZT[P[MZLXLWMVNWMX RTTVUWWWXVZT[",2909:" 27G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[P[ RT[[[ RWNMZ",2910:" 37G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[P[ RT[[[ RWNMZ ROGOFNFNGOIQJSJUIVG",2911:" 38H\\MMM[ RNMN[ RJMQM RNTPTSSTRVNWMXMYNXOWN RPTSUTVVZW[ RPTRUSVUZV[X[YZZX RJ[Q[",2912:" 22G]NMNQMWLZK[J[IZJYKZ RWMW[ RXMX[ RKM[M RT[[[",2913:" 30G^LML[ RLMR[ RMMRY RXMR[ RXMX[ RYMY[ RIMMM RXM\\M RI[O[ RU[\\[",2914:" 27G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RMTWT RI[P[ RT[[[",2915:" 36H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RQMONMPLSLUMXOZQ[ RS[UZWXXUXSWPUNSM",2916:" 21G]LML[ RMMM[ RWMW[ RXMX[ RIM[M RI[P[ RT[[[",2917:" 36G\\LMLb RMMMb RMPONQMSMVNXPYSYUXXVZS[Q[OZMX RSMUNWPXSXUWXUZS[ RIMMM RIbPb",2918:" 28H[WPVQWRXQXPVNTMQMNNLPKSKULXNZQ[S[VZXX RQMONMPLSLUMXOZQ[",2919:" 16I\\RMR[ RSMS[ RMMLRLMYMYRXM RO[V[",2920:" 22I[LMR[ RMMRY RXMR[P_NaLbKbJaK`La RJMPM RTMZM",2921:" 52H]RFRb RSFSb ROFSF RRPQNPMNMLNKQKWLZN[P[QZRX RNMMNLQLWMZN[ RWMXNYQYWXZW[ RSPTNUMWMYNZQZWYZW[U[TZSX RObVb",2922:" 21H\\LMW[ RMMX[ RXML[ RJMPM RTMZM RJ[P[ RT[Z[",2923:" 23G]LML[ RMMM[ RWMW[ RXMX[ RIMPM RTM[M RI[[[[`Z[",2924:" 28G]LMLTMVPWRWUVWT RMMMTNVPW RWMW[ RXMX[ RIMPM RTM[M RT[[[",2925:" 30CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[",2926:" 32CbHMH[ RIMI[ RRMR[ RSMS[ R\\M\\[ R]M][ REMLM ROMVM RYM`M RE[`[``_[",2927:" 27H]QMQ[ RRMR[ RLMKRKMUM RRTVTYUZWZXYZV[N[ RVTXUYWYXXZV[",2928:" 37E_JMJ[ RKMK[ RGMNM RKTOTRUSWSXRZO[G[ ROTQURWRXQZO[ RYMY[ RZMZ[ RVM]M RV[][",2929:" 25J[OMO[ RPMP[ RLMSM RPTTTWUXWXXWZT[L[ RTTVUWWWXVZT[",2930:" 34I\\MOLMLQMONNPMSMVNXPYSYUXXVZS[P[NZLXLWMVNWMX RSMUNWPXSXUWXUZS[ RRTXT",2931:" 51DaIMI[ RJMJ[ RFMMM RF[M[ RVMSNQPPSPUQXSZV[X[[Z]X^U^S]P[NXMVM RVMTNRPQSQURXTZV[ RX[ZZ\\X]U]S\\PZNXM RJTPT",2932:" 40G\\VMV[ RWMW[ RZMOMLNKPKQLSOTVT ROMMNLPLQMSOT RTTQUPVNZM[ RTTRUQVOZN[L[KZJX RS[Z[",3001:" 36H\\RFKZ RQIW[ RRIX[ RRFY[ RMUVU RI[O[ RT[[[ RKZJ[ RKZM[ RWZU[ RWYV[ RXYZ[",3002:" 78G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZLYNXOUP RXHYJYLXN RUFWGXIXMWOUP RNPUPXQYRZTZWYYXZU[I[ RXRYTYWXY RUPWQXSXXWZU[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[",3003:" 37G\\XIYFYLXIVGTFQFNGLIKKJNJSKVLXNZQ[T[VZXXYV RMILKKNKSLVMX RQFOGMJLNLSMWOZQ[",3004:" 62G]LFL[ RMGMZ RNFN[ RIFSFVGXIYKZNZSYVXXVZS[I[ RWIXKYNYSXVWX RSFUGWJXNXSWWUZS[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[",3005:" 83G\\LFL[ RMGMZ RNFN[ RIFYFYL RNPTP RTLTT RI[Y[YU RJFLG RKFLH ROFNH RPFNG RTFYG RVFYH RWFYI RXFYL RTLSPTT RTNRPTR RTOPPTQ RLZJ[ RLYK[ RNYO[ RNZP[ RT[YZ RV[YY RW[YX RX[YU",3006:" 70G[LFL[ RMGMZ RNFN[ RIFYFYL RNPTP RTLTT RI[Q[ RJFLG RKFLH ROFNH RPFNG RTFYG RVFYH RWFYI RXFYL RTLSPTT RTNRPTR RTOPPTQ RLZJ[ RLYK[ RNYO[ RNZP[",3007:" 60G^XIYFYLXIVGTFQFNGLIKKJNJSKVLXNZQ[T[VZXZY[YS RMILKKNKSLVMX RQFOGMJLNLSMWOZQ[ RXTXY RWSWYVZ RTS\\S RUSWT RVSWU RZSYU R[SYT",3008:" 81F^KFK[ RLGLZ RMFM[ RWFW[ RXGXZ RYFY[ RHFPF RTF\\F RMPWP RH[P[ RT[\\[ RIFKG RJFKH RNFMH ROFMG RUFWG RVFWH RZFYH R[FYG RKZI[ RKYJ[ RMYN[ RMZO[ RWZU[ RWYV[ RYYZ[ RYZ[[",3009:" 39LXQFQ[ RRGRZ RSFS[ RNFVF RN[V[ ROFQG RPFQH RTFSH RUFSG RQZO[ RQYP[ RSYT[ RSZU[",3010:" 45JYSFSWRZQ[ RTGTWSZ RUFUWTZQ[O[MZLXLVMUNUOVOWNXMX RMVMWNWNVMV RPFXF RQFSG RRFSH RVFUH RWFUG",3011:" 69F\\KFK[ RLGLZ RMFM[ RXGMR RPPW[ RQPX[ RQNY[ RHFPF RUF[F RH[P[ RT[[[ RIFKG RJFKH RNFMH ROFMG RWFXG RZFXG RKZI[ RKYJ[ RMYN[ RMZO[ RWYU[ RWYZ[",3012:" 52I[NFN[ ROGOZ RPFP[ RKFSF RK[Z[ZU RLFNG RMFNH RQFPH RRFPG RNZL[ RNYM[ RPYQ[ RPZR[ RU[ZZ RW[ZY RX[ZX RY[ZU",3013:" 63E_JFJZ RJFQ[ RKFQX RLFRX RXFQ[ RXFX[ RYGYZ RZFZ[ RGFLF RXF]F RG[M[ RU[][ RHFJG R[FZH R\\FZG RJZH[ RJZL[ RXZV[ RXYW[ RZY[[ RZZ\\[",3014:" 39F^KFKZ RKFY[ RLFXX RMFYX RYGY[ RHFMF RVF\\F RH[N[ RIFKG RWFYG R[FYG RKZI[ RKZM[",3015:" 54G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF",3016:" 59G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZMYOXPUQNQ RXHYJYMXO RUFWGXIXNWPUQ RI[Q[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[",3017:" 77G]QFNGLIKKJOJRKVLXNZQ[S[VZXXYVZRZOYKXIVGSFQF RMILKKNKSLVMX RWXXVYSYNXKWI RQFOGMJLNLSMWOZQ[ RS[UZWWXSXNWJUGSF RNXOVQURUTVUXV^W`Y`Z^Z\\ RV\\W^X_Y_ RUXW]X^Y^Z]",3018:" 80G]LFL[ RMGMZ RNFN[ RIFUFXGYHZJZLYNXOUPNP RXHYJYLXN RUFWGXIXMWOUP RRPTQUSWYX[Z[[Y[W RWWXYYZZZ RTQURXXYYZY[X RI[Q[ RJFLG RKFLH ROFNH RPFNG RLZJ[ RLYK[ RNYO[ RNZP[",3019:" 44H\\XIYFYLXIVGSFPFMGKIKLLNOPURWSXUXXWZ RLLMNOOUQWRXT RMGLILKMMONUPXRYTYWXYWZT[Q[NZLXKUK[LX",3020:" 57H\\JFJL RQFQ[ RRGRZ RSFS[ RZFZL RJFZF RN[V[ RKFJL RLFJI RMFJH ROFJG RUFZG RWFZH RXFZI RYFZL RQZO[ RQYP[ RSYT[ RSZU[",3021:" 45F^KFKULXNZQ[S[VZXXYUYG RLGLVMX RMFMVNYOZQ[ RHFPF RVF\\F RIFKG RJFKH RNFMH ROFMG RWFYG R[FYG",3022:" 34H\\KFR[ RLFRXR[ RMFSX RYGR[ RIFPF RUF[F RJFLH RNFMH ROFMG RWFYG RZFYG",3023:" 55F^JFN[ RKFNVN[ RLFOV RRFOVN[ RRFV[ RSFVVV[ RTFWV RZGWVV[ RGFOF RRFTF RWF]F RHFKG RIFKH RMFLH RNFLG RXFZG R\\FZG",3024:" 54H\\KFW[ RLFX[ RMFY[ RXGLZ RIFPF RUF[F RI[O[ RT[[[ RJFMH RNFMH ROFMG RVFXG RZFXG RLZJ[ RLZN[ RWZU[ RWYV[ RWYZ[",3025:" 48G]JFQQQ[ RKFRQRZ RLFSQS[ RYGSQ RHFOF RVF\\F RN[V[ RIFKG RNFLG RWFYG R[FYG RQZO[ RQYP[ RSYT[ RSZU[",3026:" 41H\\YFKFKL RWFK[ RXFL[ RYFM[ RK[Y[YU RLFKL RMFKI RNFKH RPFKG RT[YZ RV[YY RW[YX RX[YU",3051:" 38H\\UFIZ RSJT[ RTHUZ RUFUHVYV[ RLUTU RF[L[ RQ[X[ RIZG[ RIZK[ RTZR[ RTYS[ RVYW[",3052:" 78F^OFI[ RPFJ[ RQFK[ RLFWFZG[I[KZNYOVP RYGZIZKYNXO RWFXGYIYKXNVP RNPVPXQYSYUXXVZR[F[ RWQXSXUWXUZ RVPWRWUVXTZR[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3053:" 41H]ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[S[UZWXXV RQHOJNLMOLSLWMY RTFRGPJOLNOMSMXNZP[",3054:" 63F]OFI[ RPFJ[ RQFK[ RLFUFXGYHZKZOYSWWUYSZO[F[ RWGXHYKYOXSVWTY RUFWHXKXOWSUWRZO[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3055:" 80F]OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[U[WV RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[ RP[UZ RR[UY RUYWV",3056:" 70F\\OFI[ RPFJ[ RQFK[ RULST RLF[FZL RNPTP RF[N[ RMFPG RNFOH RRFPH RSFPG RWFZG RXFZH RYFZI RZFZL RULSPST RTNRPSR RTOQPSQ RJZG[ RJYH[ RKYL[ RJZM[",3057:" 65H^ZH[H\\F[L[JZHYGWFTFQGOIMLLOKSKVLYMZP[R[UZWXYT RQHOJNLMOLSLWMY RVXWWXT RTFRGPJOLNOMSMXNZP[ RR[TZVWWT RTT\\T RUTWU RVTWW RZTXV R[TXU",3058:" 81E_NFH[ ROFI[ RPFJ[ RZFT[ R[FU[ R\\FV[ RKFSF RWF_F RLPXP RE[M[ RQ[Y[ RLFOG RMFNH RQFOH RRFOG RXF[G RYFZH R]F[H R^F[G RIZF[ RIYG[ RJYK[ RIZL[ RUZR[ RUYS[ RVYW[ RUZX[",3059:" 39KYTFN[ RUFO[ RVFP[ RQFYF RK[S[ RRFUG RSFTH RWFUH RXFUG ROZL[ ROYM[ RPYQ[ ROZR[",3060:" 47I\\WFRWQYO[ RXFTSSVRX RYFUSSXQZO[M[KZJXJVKULUMVMWLXKX RKVKWLWLVKV RTF\\F RUFXG RVFWH RZFXH R[FXG",3061:" 72F]OFI[ RPFJ[ RQFK[ R\\GMR RQOU[ RROV[ RSNWZ RLFTF RYF_F RF[N[ RR[Y[ RMFPG RNFOH RRFPH RSFPG RZF\\G R^F\\G RJZG[ RJYH[ RKYL[ RJZM[ RUZS[ RUYT[ RVYX[",3062:" 49H\\QFK[ RRFL[ RSFM[ RNFVF RH[W[YU ROFRG RPFQH RTFRH RUFRG RLZI[ RLYJ[ RMYN[ RLZO[ RR[WZ RT[XX RV[YU",3063:" 68D`MFGZ RMGNYN[ RNFOY ROFPX R[FPXN[ R[FU[ R\\FV[ R]FW[ RJFOF R[F`F RD[J[ RR[Z[ RKFMG RLFMH R^F\\H R_F\\G RGZE[ RGZI[ RVZS[ RVYT[ RWYX[ RVZY[",3064:" 43F_OFIZ ROFV[ RPFVX RQFWX R\\GWXV[ RLFQF RYF_F RF[L[ RMFPG RNFPH RZF\\G R^F\\G RIZG[ RIZK[",3065:" 56G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF ROIMLLOKSKWLY RUXWUXRYNYJXH RSFQGOJNLMOLSLXMZN[ RQ[SZUWVUWRXNXIWGVF",3066:" 60F]OFI[ RPFJ[ RQFK[ RLFXF[G\\I\\K[NYPUQMQ RZG[I[KZNXP RXFYGZIZKYNWPUQ RF[N[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3067:" 78G]SFPGNILLKOJSJVKYLZN[Q[TZVXXUYRZNZKYHXGVFSF ROIMLLOKSKWLY RUXWUXRYNYJXH RSFQGOJNLMOLSLXMZN[ RQ[SZUWVUWRXNXIWGVF RLXMVOUPURVSXT]U^V^W] RT^U_V_ RSXS_T`V`W]W\\",3068:" 78F^OFI[ RPFJ[ RQFK[ RLFWFZG[I[KZNYOVPNP RYGZIZKYNXO RWFXGYIYKXNVP RRPTQURWXXYYYZX RWYXZYZ RURVZW[Y[ZXZW RF[N[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3069:" 44G^ZH[H\\F[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJUI[JYKY",3070:" 54G]TFN[ RUFO[ RVFP[ RMFKL R]F\\L RMF]F RK[S[ RNFKL RPFLI RRFMG RYF\\G RZF\\H R[F\\I R\\F\\L ROZL[ ROYM[ RPYQ[ ROZR[",3071:" 48F_NFKQJUJXKZN[R[UZWXXU\\G ROFLQKUKYLZ RPFMQLULYN[ RKFSF RYF_F RLFOG RMFNH RQFOH RRFOG RZF\\G R^F\\G",3072:" 35H\\NFNHOYO[ ROGPX RPFQW R[GO[ RLFSF RXF^F RMFNH RQFPH RRFOG RYF[G R]F[G",3073:" 57E_MFMHKYK[ RNGLX ROFMW RUFMWK[ RUFUHSYS[ RVGTX RWFUW R]GUWS[ RJFRF RUFWF RZF`F RKFNG RLFMH RPFNI RQFNG R[F]G R_F]G",3074:" 54G]NFT[ ROFU[ RPFV[ R[GIZ RLFSF RXF^F RF[L[ RQ[X[ RMFOH RQFPH RRFPG RYF[G R]F[G RIZG[ RIZK[ RTZR[ RTYS[ RUYW[",3075:" 51G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[",3076:" 35G]ZFH[ R[FI[ R\\FJ[ R\\FNFLL RH[V[XU ROFLL RPFMI RRFNG RR[VZ RT[WX RU[XU",3101:" 54I]NPNOOOOQMQMONNPMTMVNWOXQXXYZZ[ RVOWQWXXZ RTMUNVPVXWZZ[[[ RVRUSPTMULWLXMZP[S[UZVX RNUMWMXNZ RUSQTOUNWNXOZP[",3102:" 47G\\LFL[MZOZ RMGMY RIFNFNZ RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RJFLG RKFLH",3103:" 34H[WQWPVPVRXRXPVNTMQMNNLPKSKULXNZQ[S[VZXX RMPLRLVMX RQMONNOMRMVNYOZQ[",3104:" 52H]VFV[[[ RWGWZ RSFXFX[ RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RTFVG RUFVH RXYY[ RXZZ[",3105:" 41H[MSXSXQWOVNSMQMNNLPKSKULXNZQ[S[VZXX RWRWQVO RMPLRLVMX RVSVPUNSM RQMONNOMRMVNYOZQ[",3106:" 40KYWHWGVGVIXIXGWFTFRGQHPKP[ RRHQKQZ RTFSGRIR[ RMMVM RM[U[ RPZN[ RPYO[ RRYS[ RRZT[",3107:" 89I\\XNYOZNYMXMVNUO RQMONNOMQMSNUOVQWSWUVVUWSWQVOUNSMQM ROONQNSOU RUUVSVQUO RQMPNOPOTPVQW RSWTVUTUPTNSM RNUMVLXLYM[N\\Q]U]X^Y_ RN[Q\\U\\X] RLYMZP[U[X\\Y^Y_XaUbObLaK_K^L\\O[ RObMaL_L^M\\O[",3108:" 65G^LFL[ RMGMZ RIFNFN[ RNQOOPNRMUMWNXOYRY[ RWOXRXZ RUMVNWQW[ RI[Q[ RT[\\[ RJFLG RKFLH RLZJ[ RLYK[ RNYO[ RNZP[ RWZU[ RWYV[ RYYZ[ RYZ[[",3109:" 43LXQFQHSHSFQF RRFRH RQGSG RQMQ[ RRNRZ RNMSMS[ RN[V[ ROMQN RPMQO RQZO[ RQYP[ RSYT[ RSZU[",3110:" 41KXRFRHTHTFRF RSFSH RRGTG RRMR^QaPb RSNS]R` ROMTMT]S`RaPbMbLaL_N_NaMaM` RPMRN RQMRO",3111:" 61G]LFL[ RMGMZ RIFNFN[ RWNNW RRSY[ RRTX[ RQTW[ RTM[M RI[Q[ RT[[[ RJFLG RKFLH RUMWN RZMWN RLZJ[ RLYK[ RNYO[ RNZP[ RWYU[ RVYZ[",3112:" 31LXQFQ[ RRGRZ RNFSFS[ RN[V[ ROFQG RPFQH RQZO[ RQYP[ RSYT[ RSZU[",3113:" 99AcFMF[ RGNGZ RCMHMH[ RHQIOJNLMOMQNROSRS[ RQORRRZ ROMPNQQQ[ RSQTOUNWMZM\\N]O^R^[ R\\O]R]Z RZM[N\\Q\\[ RC[K[ RN[V[ RY[a[ RDMFN REMFO RFZD[ RFYE[ RHYI[ RHZJ[ RQZO[ RQYP[ RSYT[ RSZU[ R\\ZZ[ R\\Y[[ R^Y_[ R^Z`[",3114:" 65G^LML[ RMNMZ RIMNMN[ RNQOOPNRMUMWNXOYRY[ RWOXRXZ RUMVNWQW[ RI[Q[ RT[\\[ RJMLN RKMLO RLZJ[ RLYK[ RNYO[ RNZP[ RWZU[ RWYV[ RYYZ[ RYZ[[",3115:" 46H\\QMNNLPKSKULXNZQ[S[VZXXYUYSXPVNSMQM RMPLRLVMX RWXXVXRWP RQMONNOMRMVNYOZQ[ RS[UZVYWVWRVOUNSM",3116:" 60G\\LMLb RMNMa RIMNMNb RNPONQMSMVNXPYSYUXXVZS[Q[OZNX RWPXRXVWX RSMUNVOWRWVVYUZS[ RIbQb RJMLN RKMLO RLaJb RL`Kb RN`Ob RNaPb",3117:" 55H\\VNVb RWOWa RUNWNXMXb RVPUNSMQMNNLPKSKULXNZQ[S[UZVX RMPLRLVMX RQMONNOMRMVNYOZQ[ RSb[b RVaTb RV`Ub RX`Yb RXaZb",3118:" 43IZNMN[ RONOZ RKMPMP[ RWOWNVNVPXPXNWMUMSNQPPS RK[S[ RLMNN RMMNO RNZL[ RNYM[ RPYQ[ RPZR[",3119:" 43J[WOXMXQWOVNTMPMNNMOMQNSPTUUWVXY RNNMQ RNRPSUTWU RXVWZ RMONQPRUSWTXVXYWZU[Q[OZNYMWM[NY",3120:" 22KZPHPVQYRZT[V[XZYX RQHQWRY RPHRFRWSZT[ RMMVM",3121:" 43G^LMLVMYNZP[S[UZVYWW RMNMWNY RIMNMNWOZP[ RWMW[\\[ RXNXZ RTMYMY[ RJMLN RKMLO RYYZ[ RYZ[[",3122:" 31I[LMR[ RMMRY RNMSY RXNSYR[ RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3123:" 45F^JMN[ RKMNX RLMOX RRMOXN[ RRMV[ RSMVX RRMTMWX RZNWXV[ RGMOM RWM]M RHMKN RNMLN RXMZN R\\MZN",3124:" 48H\\LMV[ RMMW[ RNMX[ RWNMZ RJMQM RTMZM RJ[P[ RS[Z[ RKMMN RPMNN RUMWN RYMWN RMZK[ RMZO[ RVZT[ RWZY[",3125:" 40H[LMR[ RMMRY RNMSY RXNSYP_NaLbJbIaI_K_KaJaJ` RJMQM RTMZM RKMNO RPMNN RVMXN RYMXN",3126:" 41I[VML[ RWMM[ RXMN[ RXMLMLQ RL[X[XW RMMLQ RNMLP ROMLO RQMLN RS[XZ RU[XY RV[XX RW[XW",3151:" 50G]WMUTUXVZW[Y[[Y\\W RXMVTVZ RWMYMWTVX RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RNNLQKTKWLY RPMNOMQLTLWMZN[",3152:" 52I\\PFNMMSMWNYOZQ[S[VZXWYTYRXOWNUMSMQNPOOQNT RQFOMNQNWOZ RVYWWXTXQWO RMFRFPMNT RS[UYVWWTWQVNUM RNFQG ROFPH",3153:" 34I[WQWPVPVRXRXPWNUMRMONMQLTLVMYNZP[R[UZWW ROONQMTMWNY RRMPOOQNTNWOZP[",3154:" 58G]YFVQUUUXVZW[Y[[Y\\W RZFWQVUVZ RVF[FWTVX RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RMOLQKTKWLY RPMNOMQLTLWMZN[ RWFZG RXFYH",3155:" 33I[MVQUTTWRXPWNUMRMONMQLTLVMYNZP[R[UZWX ROONQMTMWNY RRMPOOQNTNWOZP[",3156:" 45JZZHZGYGYI[I[GZFXFVGTISKRNQRO[N^M`Kb RTJSMRRP[O^ RXFVHUJTMSRQZP]O_MaKbIbHaH_J_JaIaI` RNMYM",3157:" 57H]XMT[S^QaOb RYMU[S_ RXMZMV[T_RaObLbJaI`I^K^K`J`J_ RVTVQUNSMQMNNLQKTKVLYMZO[Q[SZTYUWVT RNOMQLTLWMY RQMOONQMTMWNZO[",3158:" 41G]OFI[K[ RPFJ[ RLFQFK[ RMTOPQNSMUMWNXPXSVX RWNWRVVVZ RWPUUUXVZW[Y[[Y\\W RMFPG RNFOH",3159:" 35KXSFSHUHUFSF RTFTH RSGUG RLQMOOMQMRNSPSSQX RRNRRQVQZ RRPPUPXQZR[T[VYWW",3160:" 45KXUFUHWHWFUF RVFVH RUGWG RMQNOPMRMSNTPTSRZQ]P_NaLbJbIaI_K_KaJaJ` RSNSSQZP]O_ RSPRTP[O^N`Lb",3161:" 49G]OFI[K[ RPFJ[ RLFQFK[ RYOYNXNXPZPZNYMWMUNQROS RMSOSQTRUTYUZWZ RQUSYTZ ROSPTRZS[U[WZYW RMFPG RNFOH",3162:" 26LXTFQQPUPXQZR[T[VYWW RUFRQQUQZ RQFVFRTQX RRFUG RSFTH",3163:" 61@cAQBODMFMGNHPHSF[ RGNGSE[ RGPFTD[F[ RHSJPLNNMPMRNSPSSQ[ RRNRSP[ RRPQTO[Q[ RSSUPWNYM[M]N^P^S\\X R]N]R\\V\\Z R]P[U[X\\Z][_[aYbW",3164:" 42F^GQHOJMLMMNNPNSL[ RMNMSK[ RMPLTJ[L[ RNSPPRNTMVMXNYPYSWX RXNXRWVWZ RXPVUVXWZX[Z[\\Y]W",3165:" 46H\\QMNNLQKTKVLYMZP[S[VZXWYTYRXOWNTMQM RNOMQLTLWMY RVYWWXTXQWO RQMOONQMTMWNZP[ RS[UYVWWTWQVNTM",3166:" 66G]HQIOKMMMNNOPOSNWKb RNNNSMWJb RNPMTIb ROTPQQORNTMVMXNYOZRZTYWWZT[R[PZOWOT RXOYQYTXWWY RVMWNXQXTWWVYT[ RFbNb RJaGb RJ`Hb RK`Lb RJaMb",3167:" 57G\\WMQb RXMRb RWMYMSb RUTUQTNRMPMMNKQJTJVKYLZN[P[RZSYTWUT RMOLQKTKWLY RPMNOMQLTLWMZN[ RNbVb RRaOb RR`Pb RS`Tb RRaUb",3168:" 30I[JQKOMMOMPNQPQTO[ RPNPTN[ RPPOTM[O[ RYOYNXNXPZPZNYMWMUNSPQT",3169:" 47J[XPXOWOWQYQYOXNUMRMONNONQOSQTTUVVWX RONNQ RORQSTTVU RWVVZ RNOOQQRTSVTWVWXVZS[P[MZLYLWNWNYMYMX",3170:" 23KYTFQQPUPXQZR[T[VYWW RUFRQQUQZ RTFVFRTQX RNMXM",3171:" 42F^GQHOJMLMMNNPNSLX RMNMRLVLZ RMPKUKXLZN[P[RZTXVU RXMVUVXWZX[Z[\\Y]W RYMWUWZ RXMZMXTWX",3172:" 29H\\IQJOLMNMONPPPSNX RONORNVNZ ROPMUMXNZP[R[TZVXXUYQYMXMXNYP",3173:" 48CaDQEOGMIMJNKPKSIX RJNJRIVIZ RJPHUHXIZK[M[OZQXRU RTMRURXSZU[W[YZ[X]U^Q^M]M]N^P RUMSUSZ RTMVMTTSX",3174:" 51G]JQLNNMPMRNSPSR RPMQNQRPVOXMZK[I[HZHXJXJZIZIY RRORRQVQY RZOZNYNYP[P[NZMXMVNTPSRRVRZS[ RPVPXQZS[U[WZYW",3175:" 49G]HQIOKMMMNNOPOSMX RNNNRMVMZ RNPLULXMZO[Q[SZUXWT RYMU[T^RaPb RZMV[T_ RYM[MW[U_SaPbMbKaJ`J^L^L`K`K_",3176:" 39H\\YMXOVQNWLYK[ RXOOOMPLR RVORNONNO RVORMOMMOLR RLYUYWXXV RNYRZUZVY RNYR[U[WYXV",3200:" 50H\\QFNGLJKOKRLWNZQ[S[VZXWYRYOXJVGSFQF RNHMJLNLSMWNY RVYWWXSXNWJVH RQFOGNIMNMSNXOZQ[ RS[UZVXWSWNVIUGSF",3201:" 28H\\QHQ[ RRHRZ RSFS[ RSFPINJ RM[W[ RQZO[ RQYP[ RSYT[ RSZU[",3202:" 62H\\LJLKMKMJLJ RLIMINJNKMLLLKKKJLHMGPFTFWGXHYJYLXNUPPRNSLUKXK[ RWHXJXLWN RTFVGWJWLVNTPPR RKYLXNXSYWYYX RNXSZWZXY RNXS[W[XZYXYV",3203:" 76H\\LJLKMKMJLJ RLIMINJNKMLLLKKKJLHMGPFTFWGXIXLWNTO RVGWIWLVN RSFUGVIVLUNSO RQOTOVPXRYTYWXYWZT[P[MZLYKWKVLUMUNVNWMXLX RWRXTXWWY RSOUPVQWTWWVZT[ RLVLWMWMVLV",3204:" 28H\\SIS[ RTHTZ RUFU[ RUFJUZU RP[X[ RSZQ[ RSYR[ RUYV[ RUZW[",3205:" 55H\\MFKPMNPMSMVNXPYSYUXXVZS[P[MZLYKWKVLUMUNVNWMXLX RWPXRXVWX RSMUNVOWRWVVYUZS[ RLVLWMWMVLV RMFWF RMGUG RMHQHUGWF",3206:" 69H\\VIVJWJWIVI RWHVHUIUJVKWKXJXIWGUFRFOGMILKKOKULXNZQ[S[VZXXYUYTXQVOSNQNOONPMR RNIMKLOLUMXNY RWXXVXSWQ RRFPGOHNJMNMUNXOZQ[ RS[UZVYWVWSVPUOSN",3207:" 43H\\KFKL RYFYIXLTQSSRWR[ RSRRTQWQ[ RXLSQQTPWP[R[ RKJLHNFPFUIWIXHYF RMHNGPGRH RKJLINHPHUI",3208:" 79H\\PFMGLILLMNPOTOWNXLXIWGTFPF RNGMIMLNN RVNWLWIVG RPFOGNINLONPO RTOUNVLVIUGTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RMQLSLWMY RWYXWXSWQ RPONPMSMWNZP[ RT[VZWWWSVPTO",3209:" 69H\\MWMXNXNWMW RWOVQURSSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNVOWOXNYMY RMPLNLKMI RVHWIXLXRWVVX RQSORNQMNMKNHOGQF RSFUGVIWLWSVWUYTZR[",3210:" 16MXRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3211:" 24MXTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^",3212:" 32MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3213:" 40MXRMQNQORPSPTOTNSMRM RRNROSOSNRN RTZS[R[QZQYRXSXTYT\\S^Q_ RRYRZSZSYRY RS[T\\ RTZS^",3214:" 34MXRFQGQIRQ RRFRTST RRFSFST RSFTGTISQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3215:" 52I\\MKMJNJNLLLLJMHNGPFTFWGXHYJYLXNWOSQ RWHXIXMWN RTFVGWIWMVOUP RRQRTSTSQRQ RRXQYQZR[S[TZTYSXRX RRYRZSZSYRY",3216:" 24MXTFRGQIQLRMSMTLTKSJRJQK RRKRLSLSKRK RRGQK RQIRJ",3217:" 24MXTHSIRIQHQGRFSFTGTJSLQM RRGRHSHSGRG RSITJ RTHSL",3218:" 74E_[O[NZNZP\\P\\N[MZMYNXPVUTXRZP[L[JZIXIUJSPORMSKSIRGPFNGMIMLNOPRTWWZY[[[\\Y\\X RKZJXJUKSLR RRMSI RSKRG RNGMK RNNPQTVWYYZ RN[LZKXKULSPO RMINMQQUVXYZZ[Z\\Y",3219:" 56H\\PBP_ RTBT_ RXKXJWJWLYLYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RLLMNOOUQWRXT RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWKUMUMWLWLV",3220:" 8G^[BIbJb R[B\\BJb",3221:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3222:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3223:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3224:" 8F_JQ[Q[R RJQJR[R",3225:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3226:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3227:" 11NWSFRGRM RSGRM RSFTGRM",3228:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",3229:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",3250:" 58H]TFQGOIMLLOKSKVLYMZO[Q[TZVXXUYRZNZKYHXGVFTF RQHOJNLMOLSLWMY RTYVWWUXRYNYJXH RTFRGPJOLNOMSMXNZO[ RQ[SZUWVUWRXNXIWGVF",3251:" 20H]TJO[Q[ RWFUJP[ RWFQ[ RWFTIQKOL RTJRKOL",3252:" 52H]OKOJPJPLNLNJOHPGSFVFYGZIZKYMWOMUKWI[ RXGYIYKXMVOSQ RVFWGXIXKWMUOMU RJYKXMXRYWYXX RMXRZWZ RMXR[U[WZXXXW",3253:" 64H]OKOJPJPLNLNJOHPGSFVFYGZIZKYMXNVOSP RXGYIYKXMWN RVFWGXIXKWMUOSP RQPSPVQWRXTXWWYUZR[O[LZKYJWJULULWKWKV RVRWTWWVY RSPUQVSVWUYTZR[",3254:" 15H]WJR[T[ RZFXJS[ RZFT[ RZFJUZU",3255:" 49H]QFLP RQF[F RQGYG RPHUHYG[F RLPMOPNSNVOWPXRXUWXUZQ[N[LZKYJWJULULWKWKV RVPWRWUVXTZ RSNUOVQVUUXSZQ[",3256:" 61H]YJYIXIXKZKZIYGWFTFQGOIMLLOKSKVLYMZO[R[UZWXXVXSWQVPTOQOOPNQMS RPINLMOLSLWMY RVXWVWSVQ RTFRGPJOLNOMSMXNZO[ RR[TZUYVVVRUPTO",3257:" 39H]NFLL R[FZIXLTQRTQWP[ RRSPWO[ RXLRRPUOWN[P[ RMIPFRFWI ROGRGWI RMIOHRHWIYIZH[F",3258:"104H]SFPGOHNJNMOOQPTPWOYNZLZIYGWFSF RUFPG RPHOJONPO ROORP RSPWO RXNYLYIXG RYGUF RSFQHPJPNQP RTPVOWNXLXHWF RQPMQKSJUJXKZN[R[VZWYXWXTWRVQTP RRPMQ RNQLSKUKXLZ RKZP[VZ RVYWWWTVR RVQSP RQPOQMSLULXMZN[ RR[TZUYVWVSUQTP",3259:" 61H]XNWPVQTRQROQNPMNMKNIPGSFVFXGYHZKZNYRXUVXTZQ[N[LZKXKVMVMXLXLW ROPNNNKOI RXHYJYNXRWUUX RQRPQOOOKPHQGSF RVFWGXIXNWRVUUWSZQ[",3260:" 16MXPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3261:" 22MXQ[P[OZOYPXQXRYR[Q]P^N_ RPYPZQZQYPY RQ[Q\\P^",3262:" 32MXSMRNROSPTPUOUNTMSM RSNSOTOTNSN RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3263:" 38MXSMRNROSPTPUOUNTMSM RSNSOTOTNSN RQ[P[OZOYPXQXRYR[Q]P^N_ RPYPZQZQYPY RQ[Q\\P^",3264:" 34MXVFUFTGRT RVGUGRT RVGVHRT RVFWGWHRT RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3265:" 59H]OKOJPJPLNLNJOHPGSFWFZG[I[KZMYNWOSPQQQSSTTT RUFZG RYGZIZKYMXNVO RWFXGYIYKXMWNSPRQRSST RPXOYOZP[Q[RZRYQXPX RPYPZQZQYPY",3266:" 22MXWFUGTHSJSLTMUMVLVKUJTJ RUGTITJ RTKTLULUKTK",3267:" 22MXVIUITHTGUFVFWGWIVKULSM RUGUHVHVGUG RVIVJUL",3268:" 72E_\\O\\N[N[P]P]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQURWTZV[X[YYYX RL[HZ RIZHXHVITJSLR RPPQSTYVZ RK[JZIXIVJTKSMRRO ROLPOQRSVUYWZXZYY",3269:" 52H]TBL_ RYBQ_ RZKZJYJYL[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJULULWKWKV",3270:" 8G^_BEbFb R_B`BFb",3271:" 32JZZBXCUERHPKNOMSMXN\\O_Qb RSHQKOONTN\\ RZBWDTGRJQLPOOSN\\ RNTO]P`Qb",3272:" 32JZSBUEVHWLWQVUTYR\\O_LaJb RVHVPUUSYQ\\ RSBTDUGVP RVHUQTUSXRZP]M`Jb",3273:" 39J[TFSGUQTR RTFTR RTFUGSQTR ROIPIXOYO ROIYO ROIOJYNYO RYIXIPOOO RYIOO RYIYJONOO",3274:" 8F_JQ[Q[R RJQJR[R",3275:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3276:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3277:" 11MWUFTGRM RUGRM RUFVGRM",3278:" 22H\\PFOGMM RPGMM RPFQGMM RZFYGWM RZGWM RZF[GWM",3279:" 30KZSFQGPIPKQMSNUNWMXKXIWGUFSF RSFPIQMUNXKWGSF RUFQGPKSNWMXIUF",3301:" 62F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHVJVXXZ RYFXGWJWWYY",3302:"101E_GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRRQUOW RPHQJQT RNFOGPJPUOW RRISGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KRP RYM[O\\R\\U[XYZV[S[PZJWIWHX RXNYN[P RVNYO[Q\\S RTZRZLWKW RZYXZUZRYNWKVIVHXHZI[JZIY",3303:" 79F^RHPFNFLGJJINIRJVLYNZQ[T[WZYY[W RLHKJJMJRKVMYPZ RNFMGLIKMKQLUMWOYRZUZXY[W RUFRHQIPKPLQNTPURUT RQKQLUPUQ RQIQJRLUNVPVRUTSURUPTOR RUFVGXHZH RUGVHWH RTGVIXIZH[G",3304:" 79E_HLHKIIKGNFRFUGWHYJ[M\\Q\\U[XYZV[S[PZJWIWHX RKHMGRGUHWIYK[N RTZRZLWKW RHKJIMHRHUIWJYL[O\\R RZYXZUZRYNWKVIVHXHZI[JZIY RPHMKLMLONSNU RMNMONQNR RMKMMOQOSNUMVKVJUJT",3305:" 95F^RHPFNFLGJJINIRJVLYNZQ[T[WZYY[W RLHKJJMJRKVMYPZ RNFMGLIKMKQLUMWOYRZUZXY[W RUFRHQIPKPLQNTPURUT RQKQLUPUQ RQIQJRLUNVPVRUTSURUPTOR RUFVGXHZH RUGVHWH RTGVIXIZH[G RUNYK RYKZL\\L RXLYMZM RWMXNZN\\L",3306:" 94F^MNKMJKJIKGNFQFTGXI RKHMGRGUH RJKKIMHRHXIZI[H[GZFYF RSHRIQKQMROVSWVWYV\\U]S^ RTPWSXVXYW[ RQMSOVQXSYVYYX[V]S^O^L]K\\JZJWLTLRKQ RL\\K[KWLU RO^M]L[LWMTMRLQJQIRIS RUPYL RYLZM\\M RXMYNZN RWNXOZO\\M",3307:" 99E_UJTHSGQFNFKGIJHNHRIUJWLYNZQ[T[WZYY[W\\T\\Q[NYL RKHJJIMIRJUKW RZW[U[QZNYM RNFLGKIJMJRKVLXNZ RWZYXZUZQYOWM RUFRHPJOLOMPOSQTSTU RPLPMTQTR RPJPKQMTOUQUSTURVQVOUNS RTOYLZJ R\\FZJ RYG]I R\\F[GYGZHZJ[I]I\\H\\F",3308:" 92F_RFPGNIMKMMNOPQQSQU RNLNMQQQR RNINKOMQORQRSQUPVNWLWJVIUHSHQIPJQIR RRFTHVHXG RQGSH RPGQHSIUIXG RRPYK RYK[N\\Q\\T[WYYVZR[ RXLZN[Q[UZW RVMWMYOZRZVYXXYVZ RVZTZRYPYNZM\\N^P_R_T^ RSZQZ RR[PZNZ",3309:" 83F_PPNPLOKNJLJJKHLGOFQFTGWJYK RLHNGRGTHUI RJJKIMHQHTIVJYK[K\\J\\H[GYG RJXKYJZIYIWJVLVNWPYR\\T^ RNXOYQ\\R] RLVMWNYP\\Q]S^V^X]Y\\ZZZWYUWRVPVO RYXYWVRVQ RX]Y[YYXWVTURUPWNYNZOZP",3310:" 83F_PPNPLOKNJLJJKHLGOFQFTGWJYK RLHNGRGTHUI RJJKIMHQHTIVJYK[K\\J\\H[GYG RJXKYJZIYIWJVLVNWPYR\\T^ RNXOYQ\\R] RLVMWNYP\\Q]S^V^X]Y\\ZZZWYUWRVPVO RYXYWVRVQ RX]Y[YYXWVTURUPWNYNZOZP",3311:" 81E_[KZIXGUFRFOGMILKLNMQPWPYN[ RMNMOPUPV RNHMJMMNOPSQVQXPZN[L[JZ RHVJZ RGYKW RHVHXGYIYJZJXKWIWHV RNONMOKQJTJVKXMYM RUKWM RRJTKULVN RYMPQ RUOYXZY[Y RTPXXZZ RSPWYY[\\X",3312:" 73G^ZSYTVTUSUQVOXLYJYH RVQVPYLYK RWTVSVRWPYNZLZJYHXGUFPFMGLHKJKLLNNQOSOTNV RLKLLOQOR RLHLJMLOOPQPSOUMWJY RMWOWRYUZXZZY RNXOXSZTZ RJYLXMXQZT[V[YZZY[W",3313:"128BbEQERFSHSJRJOIMGJGHIF RIOGK RHSIRIPGMFKFIGGIFKFMGOIPLPROUNWLYI[HZGZ RNIOLORNUMW RJZIYHY RKFMHNKNRMVLXKYJXIXF[ RNGPFRFTGVIWLWRVUUWSYQ[PZOZ RUIVLVRUV RRZQYPY RRFTHUKUSTWSYRXQXN[ RUHVGXFZF\\G]H^J_K R\\H]J RZF[G\\J]K_K R_K\\M[NZQZT[X][`X R\\N[P[T\\W^Z R_K]M\\O\\S]W_Y",3314:" 96D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGRISLSRRUQWOYL[KZIZG[ RQIRKRRQUPWOX RMZKYIY RNFPHQKQRPVNYLXJXG[ RRHSGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KYMXNWQWTXXZ[]X RYNXPXTYW[Z R\\KZMYOYSZW\\Y",3315:" 72D`PFNGLIKKKMMQMS RLLLMMOMP RLILKNONQMSLTJTISIR RPFQGWIZK[M\\P\\S[VZXXZU[R[OZIWHWGX RPGQHWJYKZL RPFPHQIWKYL[N\\P RSZQZKWJW RYYWZTZQYMWJVHVGXGZH[IZHY",3316:"100E`HQHRISKSMRMOLMJJJHLF RLOJK RKSLRLPJMIKIIJGLFOFQGRHSJSU RSWS\\R^P_M_L^L\\M[N\\M] RQHRJR\\Q^ ROFPGQJQU RQWQ\\P^O_ RSJXF RXFZI[K\\O\\R[UYXV[ RWGZK[N[O RVHXJZM[P[SZVYX RWYUVSU RQUOVMX RWZUWSVPV RV[TXSW RQWOWMX",3317:" 88D`PFNGLIKKKMMQMS RLLLMMOMP RLILKNONQMSLTJTISIR RPFQGWIZK[M\\P\\S[VZX RXZU[R[OZIWHWGX RPGQHWJYKZL RPFPHQIWKYL[N\\P RSZQZKWJW RXZTZQYMWJVHVGXGZH[IZHY RTXVVXV\\Z]Z RWWXW[Z RUWVWZ[\\[^Y",3318:" 96D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRVQXOZM[K[IZ RPHQJQVPX RNFOGPJPVOYM[ RGVIZ RFYJW RGVGXFYHYIZIXJWHWGV RRISGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KRP RTOXYZ[]X RUOYX[Z RVNZX[Y\\Y",3319:" 83E`\\H[G\\F]G]I\\KZKVISHOHKIIK RYJVHSGOGLH R]I\\JZJVGSFOFLGJIIKHNHRIUJWLYNZQ[U[XZZY\\W]T]Q\\OZNWNUOSRQSOS RLXNYQZUZYY RIUKWMXPYUYYX[W\\V]T RXOWOSSRS R]Q[OYOWPUSSTQTOSNQNOOMQL",3320:" 81F_LNJMIKIIJGMFRFUGYJ[J\\I RJHLGRGUHXJ RIKJILHRHUIYK[K\\I\\G[FZG[H RUIRLQNQPSTSV RRORPSRSS RRLRNTRTTSVRWPWOVOT RJYKZJ[IZIXJVLVOWSYVZYZ[Y RLWMWSZUZ RIXJWKWMXQZT[W[ZZ\\X",3321:" 45G]JHKHLILWJX RKGMHMXPZ RIILFNHNWPYRY RJXKXMYO[RYVV RTHUHVIVYX[[X RUGWHWYYZ RSIVFYHXIXXYYZY",3322:"100D`GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRRQUOW RPHQJQT RNFOGPJPUOW RRISGUFWFYG[J\\K RYHZJ RWFXGYJZK\\K RZKXKWLWNXP[R\\T RXO[Q RWMXN[P\\R\\V[XYZW[S[PZJWIWHX RTZRZLWKW RZYXZUZRYNWKVIVHXHZI[JZIY",3323:"143BcEQERFSHSJRJOIMGJGHIF RIOGK RHSIRIPGMFKFIGGIFLFNGOHPJPNOQMTKV RNHOJOONR RLFMGNJNOMSKV RNGPFSFUG RWFTGSISMTPVSWUWWVY RTMTNWSWT RWFUGTITLUNWQXTXVWXUZS[O[MZKXIWGWFX RNZKWJW RQ[OZLWJVGVFXFZG[HZGY RWFZF\\G^J_K R\\H]J RZF[G\\J]K_K R]K[KZLZN[P^R_T R[O^Q RZM[N^P_R_W^Y]Z[[X[UZ RYZXZVY R^Y\\ZZZXYWX",3324:" 86F^KHMHOIPJQMQO RQQQUPXM[KZI[ RNZLYKY ROYNYLXI[ RMGPHQIRLRUSWUYWZ RIINFPGRISLSO RSQSTTWUXWYYY RQURXTZV[[X RSLTIWFYG[F RVGXHYH RUHVHXI[F RKSMOQO RSOWOYM RMPWP RKSMQQQ RSQWQYM",3325:" 74E_HQHRISKSMRMOLMJJJHLF RLOJK RKSLRLPJMIKIIJGLFOFQGRHSJSORRQTQUSWTW RQHRJRPQSPUSX ROFPGQJQPPTOVRYUV RSJ[F RYGYZX] RZGZXY[ R[F[VZZY\\W^T_P_M^K\\JZKYLZK[",3326:" 74F^NIOGQFTFVGWHXJXMWOVPTQ RQQOPNN RVHWIWNVO RTFUGVIVNUPTQ RMUNSORQQTQWRYTZVZZY\\W^T_P_N^KZJY RXTYVYZX\\ RTQWSXUX[W]V^T_ RO^N]LZKY RR_P^O]MZLYIYHZH\\I]J]",3401:" 46J[TMQNOONPMSMVNYO[UX RNVOYPZ RQNOPNSNUOXQZ RRNSOUPUYW[ZX RSNVPVXXZ RTMUNWOXO RWPXO RWPWXXYYY",3402:" 50J[LHMINK RTFQGOINKNXMY RPIOKOXRZ RTFRGQHPKPXRYSZ RMYNYPZQ[TZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ",3403:" 27KXRNTPVOTMRNOPNRNWOYQ[UY RSNUO RPPOROWPYQZ RQOPQPVQXSZ",3404:" 47J[QFNINKOLSNVPWRWUVXTZ ROJOKSMVOWP ROHOIPJUMWOXRXUWXTZQ[ RRNNPNXMY ROPOXRZ RPOPXRYSZ RMYNYPZQ[",3405:" 27KXPUVQSMOPNRNWOYQ[UY RUQRN RPPOROWPYQZ RTRROQOPQPVQXSZ",3406:" 49LYXFWGUGSFQFPHPMOONP RVHTHRGQG RXFWHVITIRHQHPI RPKQMRNTOVOVP RNPPP RRPVP RPPPTQ` RSOPOQNQ[ RRPRTQ`",3407:" 53J[TMQNOONPMSMVNYO[UX RNWOYPZ RQNOPNSNUOXQZ RRNSOUPUXV[V]U_ RSNVPVZ RTMUNWOXO RWPXO RWPW\\V^U_S`P`N_M^M]N]N^",3408:" 50J[LHMINK RTFQGOINKNXMY RPIOKOYPZ RTFRGQHPKPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^",3409:" 39MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQYS[VX RPNRORXTZ RNPQMRNTO RSPTO RSPSXTYUY",3410:" 45MWRFQGQHRISHSGRF RQGSH RQHSG ROOPOQPQ[P^O_M` RPNROR[Q] RNPQMRNTO RSPTO RSPS[R]P_M` RS[T]U^",3411:" 63KYNHOIPK RUFSGQIPKPMOONP RPPPXOY RRIQKQM RQOPOQMQXSZ RUFSHRKRO RRPRXSYTY ROYQZR[UX RRLVIWJWLUNSO RUJVKVLUN RROWOWP RNPPP RRPWP",3412:" 29MWOHPIQK RWFTGRIQKQXPY RSIRKRYTZ RWFUGTHSKSXTYUY RPYRZS[VX",3413:" 74E_GOHOIPIXHYJ[ RHNJPJXIYJZKYJX RFPIMKOKXLYJ[ RNNPOQQQXPYR[ RPNQORQRXQYRZSYRX RKPNNPMRNSPSXTYR[ RVNWOYPYY[[^X RWNZPZX\\Z RSPVNXMYN[O\\O R[P\\O R[P[X\\Y]Y",3414:" 49I[KOLOMPMXLYN[ RLNNPNXMYNZOYNX RJPMMOOOXPYN[ RRNSOUPUYW[ZX RSNVPVXXZ ROPRNTMUNWOXO RWPXO RWPWXXYYY",3415:" 41J[NPNXMY ROPOXRZ RQOPPPXRYSZ RMYNYPZQ[TZ RNPQOVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ",3416:" 57J[OJMLMNNQNXLZ RNYO` RNMNNOQO[ RNKNLONPQPXQXSYTZ RPYO` RSZQY RTZR[PY RNYLZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ",3417:" 43J[TMQNOONPMSMVNYO[UX RNWOYPZ RQNOPNSNUOXQZ RRNSOUPUXV` RSNVPV[ RTMUNWOXO RWPXO RWPWXV`",3418:" 32KYNOOOPPPXOY RONQPQYSZ RMPPMRORXSYTY ROYQZR[UX RTNUPWOVMRO RUNVO",3419:" 42LWXFWGUGSFQFPHPMOONP RVHTHRGQG RXFWHVITIRHQHPI RPKRP RPPPTQ` RQOPOQNQ[ RRPRTQ` RNPPP",3420:" 37LXSIRLQNPONP RSISOVOVP RNPQP RSPVP RQPQXPY RROQORMRXTZ RSPSXTYUY RPYRZS[VX",3421:" 47I[KOLOMPMXLY RLNNPNXPZ RJPMMOOOXQYRZ RLYMYOZP[RZUX RVMTOUPUYW[ZX RVPWOVNUOVPVXXZ RVMXOWPWXXYYY",3422:" 47J[OKMMMONRNXMY RNNNOOROXRZ RNLNMOOPRPXRYSZ RMYNYPZQ[TZ RPPVMWOXRXUWXVYTZ RUNVOWQ RTNVPWSWUVXTZ",3423:" 72F_KKIMIOJRJXIYK[ RJNJOKRKXJYKZLYKX RJLJMKOLRLXMYK[ RONQORQRXQY RQNROSQSXVZ RLPONQMSNTPTXVYWZ RQYRYTZU[XZ RTPZM[O\\R\\T[XZYXZ RYNZO[Q RXNZP[S[UZXXZ",3424:" 44KZOOPOQPQXPXNYM[M]N_P`S`V_V^U^U_ RPNRPRXUZ RNPQMSOSXUYVZ RXYT[SZQYOYM[ RUNVPXOWMSO RVNWO",3425:" 47J[OKMMMONRNXMY RNNNOOROYQZ RNLNMOOPRPXQYRY RMYOZP[SX RPPVMWOXSXWWZV\\T^Q` RUNVOWR RTNVQWTWWV[T^",3426:" 43KYNPSMUNVPVRUTQV RSNUO RRNTOUQURTTSU RSUUWVYV]U_S`Q`O_N]N[OYQXWV RRVTWUY RQVTXUZU]T_S`",3427:" 61JZRMPNMPMRNU RNPNROT RPNOOORPT RPNROTOVNWMWKVJTJ RQNSN RRMTNVN RNUVRWUWWVYR[ RUSVUVXUY RTSUUUXTZ RTZRYOYL[ RSZQZ RR[PZNZL[",3428:" 78J[VFUGSGQFOFNHNMMOLP RTHRHPGOG RVFUHTIRIPHOHNI RNKPP RNPNTO` ROONOONO[ RPPPTO` RLPNP RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3429:" 62J[PIOLNNMOKP RPIPXQYO[ ROONOONOXNYOZPYOX RKPNPNXMYO[ RPPUMWNXPXRWTSV RUNWO RTNVOWQWRVTUU RUUWVXXX[W]U_R` RUVWW RSVTVVWWYW\\V^",3501:" 60G]LINGPFRFSGZW[X]X RQGRHYXZZ[YYX RNGPGQHXXYZZ[[[]X RLMMLOKPKQL RPLPM RMLOLPN RG[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS",3502:"110F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU",3509:" 67I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKWW RRZQZOYLY RYHXJXVWXUZS[P[NZKZI[",3510:" 65H\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZ RWKWW RYHXJXVWXUZR[O[LZJXJVKULUMVLWKW RJVMV",3511:"115F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOXLYM[N RWMYN[N R[NYQWSUU RWSYTZX[Z\\Z RYVZZ RWSXTYZZ[[[\\Z RUOUY",3512:" 85G]IHKFNFPGRF RLGOG RIHKGMHPHRF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RSIRJQLQU RRKRS RSISRRTQU RSIUGWFYF[G RXGYGZH RUGWGYI[G RWGWX",3513:"107D`LJKKJMJOHOGPGRHQJQJU RKLKS RHPKP RLJLRKTJU RE[GYIXKXMYNYOX RHYKYMZ RE[GZJZL[M[NZOX RLJPFTJTWUYVY RPGSJSXRYSZTYSX RPPSP RNHOHRKROOO ROQRQRXQYS[VYWX RTJXF\\J\\W]Y^Y RXG[J[X]Z RXP[P RVHWHZKZOWO RWQZQZY\\[^Y ROHOX RWHWX",3514:" 84E^GIIGKFMFOGQJVUXXYY RMGOIPKVWYZ RIGKGMHOKTVVYWZY[ RVHXIZI\\H]F RWGYH[H RVHXFZG\\G]F RKOIOHPHRIQKQ RIPKP RG[IYKXNXPY RJYMYOZ RG[JZMZN[PY RKGKX RYIY[ RRLSMUNWNYM RKTMSQSST",3515:" 79E_NFLGJIIKHNHRIUJWLYNZQ[S[VZXYZW[U\\R\\N[KZIXGVFUGRIOJ RJJIMISJV RNFLHKJJMJSKVLXNZ RZV[S[MYIXH RVZXXYVZSZMYKWHUG ROJOW RPJPU RQJQTPVOW RUGUZ RUMWNXNZM RUSWRXRZS",3516:" 70H^KFLGMIMOKOJPJRKQMQMYJ[MZMbO` RMHNJN` RKPNP RKFMGNHOJO` ROKRIVFZJZX RVGYJYX RTHUHXKXY RRXUXXY RSYUYWZ RRZTZV[XYZX RRIR_ RRMTNVNXM RRSTRVRXS",3517:" 99E_NFLGJIIKHNHRIUJWLYNZP[T[VZXYZW[U\\R\\N[KZIXGVFUGRIOJ RJJIMISJV RNFLHKJJMJSKVLXNZ RZV[S[MYIXH RVZXXYVZSZMYKWHUG ROJOW RPJPU RQJQTPVOW RUGUZ RUMWNXNZM RUSWRXRZS RP[QZRZT[X`Za[a RT\\V_XaYa RRZS[VaXbZb[a",3518:"108F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXRXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRIUGWFYGZIZLYNXOTQRR RWGXGYIYMXN RUGWHXJXMWOTQ RTQVRWSZX[Y\\Y RWTYX[Z RTQVSXYZ[\\Y",3519:" 94G^UITHRGOF RVHTG RWGSFOFLGKHJJKLLMONWNYOZPZRYU RKKLLOMXMZN[O[QZS RKHKJLKOLYL[M\\O\\QYUU[ RIOJPLQUQVRVSUU RJQLRTRUS RIOIPJRLSSSUTUU RI[LYPXSXVY RKZNYRYUZ RI[MZRZU[ RWGUISL RRNPQ ROSMUKVJVJUKV",3520:" 71E]JJILHOHSIVKYMZP[S[VZXYZW[U RISJVLXNYQZTZWY RJJIMIQJTLWNXQYTYWXYW[U RHIIGKFOFUGYG[F RPGTHXH RHIIHKGNGTIWIYH[F RSIRJPKPV RQKQT RRJRSQUPV RWIWX",3521:" 89F^HHJFLFOGQF RKGNG RHHJGMHOHQF RKJJLIOISJVKXMZP[S[VZXYZ[\\Y RJSKVNYQZTZ RKJJNJQKTLVNXQYUYXX RUIQJPLPV RQKQT RRJRSQUPV RUIWHYFZG\\HZIZW[Y\\Y RYIZHYGXHYIYX[Z RWHXIXX RUIUY RUNXN RURXR",3522:" 72G^JFKGLILOJOIPIRJQLQLXJY RLHMJMX RJPMP RNYQYSZ RJFLGMHNJNXRXUY RJYMYPZR[UYXXZX RRJUIWHYFZG\\HZIZX RYIZHYGXHYIYW RWHXIXX RRJRX RRMTNVNXM RRSTRVRXS",3523:" 95E`HFIGJIJOHOGPGRHQJQJXHY RJHKJKX RHPKP RLYNYPZ RHFJGKHLJLXOXQY RHYKYNZO[QYTXVYW[YY\\X ROHRFTHTXWXYY RRGSHSX ROHQHRIRXQY RWYXZ RWHZF\\H\\X RZG[H[X RWHYHZIZXYY ROHOX RWHWX RONRN RORRR RWNZN RWRZR",3524:" 65G]HIJGLFNFOGWYXZZZ RMGNHVYWZ RJGLGMHUZV[X[ZZ\\X RWFYG[G\\F RWGXHZH RVHWIYI[H\\F RH[IYKXMXNY RJYLYMZ RH[IZKZM[ RWFSO RQRM[ RLPPP RSPXP",3525:" 86G^JFKGLILOJOIPIRJQLQLXJY RLHMJMX RJPMP RNYQYSZ RJFLGMHNJNXRXUY RJYMYPZR[UYXX RRJUIWHYFZG\\HZIZ^Y`WbUaQ`L` RYIZHYGXHYIYY RWHXIXXZ[ RXaV`S` RY`V_P_L` RRJRX RRMTNVNXM RRSTRVRXS",3526:" 57H\\XGWIROOSMWJ[ RVKNV RZFWJUNRRMXLZ RJHLFOGUGZF RKGOHSHWG RJHNIRIVHXG RLZNYRXVXZY RMZQYUYYZ RJ[OZUZX[ZY RMPQP RTPXP",3601:" 53J[PRNTMVMXNZP[RYUX RMVNXOYQZ RNTNVOXQYRY RNPPPSOUNVMXOWPWXXYYY RONNOQO RTOWOVNVYWZ RMOOMPNROUPUYW[YY RMORT",3602:" 44I[LHMJMXKY RNJMHNGNXQZ RLHOFOXQYRZ RKYMYOZP[RZUYWY ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3603:" 35JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMUNWOXO RSNTOVO RPORNTPVPXO",3604:" 41IZRMPNMOMXKY RNONXQZ RRMOOOXQYRZ RKYMYOZP[RZUYWY RMHPFQIWOWY RPINHOGPIVOVX RMHUPUY",3605:" 32JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMWQURPU RSNVQ RPORNUR",3606:" 41JWNHNXLYMYOZP[ ROHOYQZ RPHPXRYSYQZP[ RNHQGSFTGVHWH RRGSHUH RPHQGSIUIWH RKMNM RPMTM",3607:" 56I[MOMXKYLYNZO[PZRYUX RNPNYPZ ROOOXQYRY RMOOORNTMUNWOYOWPW\\V_TaRbQaO`M` RSNVPV\\ RSaQ`P` RRNSOUPUZV]V_ RTaS`Q_O_M`",3608:" 47I[LHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPROTNUMVNXOYOWPWYU[T] RTNVOVYU[ RROSOUPUYT]T`UbVbT`",3609:" 35MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[UY RRPSORNQORPRYSZ RRMSNUOSPSXTYUY",3610:" 39MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[T] RRPSORNQORPRYS[ RRMSNUOSPSYT]T`RbPbPaRb",3611:" 50IZLHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPRNTMVPSROU RSNUP RRNTQ RSRTSVXWYXY RSSTTUYVZ RRSSTTYV[XY",3612:" 22MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[",3613:" 67E_GOHOIPIXGYHYJZK[ RINJOJYLZ RGOIMKOKXMYK[ RKPNOPNQMSOSXUYS[ RPNRORYTZ RNOOOQPQXPYRZS[ RSPVOXNYMZN\\O]O[P[X\\Y]Y RXNZOZY[Z RVOWOYPYY[[]Y",3614:" 45I[KOLOMPMXKYLYNZO[ RMNNONYPZ RKOMMOOOXQYO[ ROPROTNUMVNXOYOWPWXXYYY RTNVOVYWZ RROSOUPUYW[YY",3615:" 40I[MOMXKY RNPNXQZ ROOOXQYRZ RKYMYOZP[RZUYWY RMOOORNTMUNWOYOWPWY RSNVPVX RRNSOUPUY",3616:" 54I[LMMOMXKYMYMb RMNNONaO`N^ RNYOYQZ RLMNNOOOXQYRZ ROZP[RZUYWY ROZO^P`Mb ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3617:" 44I[MOMXKY RNPNYPZ ROOOXQYRY RKYLYNZO[PZRYUX RMOOORNTMUNWOYOWPWb RSNVPVaU`V^ RRNSOUPU^T`Wb",3618:" 38JXLOMONPNXLYMYOZP[ RMNOOOYQZ RLONMPOPXRYSYQZP[ RPOTMUNWOXO RSNTOVO RRNTPVPXO",3619:" 59JZMOMSOTUTWUWY RNONS RVUVY RPNOOOSQT RSTUUUYTZ RMOPNRMTNVNWM RQNSN RPNROTOVN RWYTZR[PZNZL[ RSZQZ RTZRYOYL[ RWMVOTROWL[",3620:" 28MWPHQJQXOYPYRZS[ RRJQHRGRYTZ RPHSFSXUYVYTZS[ RNMQM RSMVM",3621:" 47I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPWXXYYY RTNVOVYWZ RUMSOUPUYW[YY",3622:" 36I[LMMOMXP[RYUXWX RMNNONXQZ RLMNNOOOWPXRY RUMVNXOYOWPWX RTNVOVW RUMSOUPUX",3623:" 57E_HMIOIXL[NYQX RINJOJXMZ RHMJNKOKWLXNY RQMOOQPQXT[VYYX[X RPNRORXUZ RQMRNTOSPSWTXVY RYMZN\\O]O[P[X RXNZOZW RYMWOYPYX",3624:" 59H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT",3625:" 60I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`",3626:" 38I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT",3700:" 42H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY",3701:" 27H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY",3702:" 48H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXPQPNQLSKVK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY",3703:" 57H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJXHWGTFPFMGKIKLLNOPURWSXUXXWZ RXJWH RLLMNOOUQWRXT RMYLW RMGLILKMMONUPXRYTYWXYWZT[P[MZLYKWMVMXNZP[",3720:" 8G^[BIbJb R[B\\BJb",3721:" 27KYUBSDQGOKNPNTOYQ]S`Ub RQHPKOOOUPYQ\\ RSDRFQIPOPUQ[R^S`",3722:" 27KYOBQDSGUKVPVTUYS]Q`Ob RSHTKUOUUTYS\\ RQDRFSITOTUS[R^Q`",3723:" 39JZRFQGSQRR RRFRR RRFSGQQRR RMINIVOWO RMIWO RMIMJWNWO RWIVINOMO RWIMO RWIWJMNMO",3724:" 8F_JQ[Q[R RJQJR[R",3725:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3726:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3727:" 11NWSFRGRM RSGRM RSFTGRM",3728:" 22I[NFMGMM RNGMM RNFOGMM RWFVGVM RWGVM RWFXGVM",3729:" 30KYQFOGNINKOMQNSNUMVKVIUGSFQF RQFNIOMSNVKUGQF RSFOGNKQNUMVISF",3801:" 52E_NHLIJKIMHPHSIUKV RJLIOISJU RNHLJKLJOJRKVKXJZH[ RVHXHXYVY RYHYY RZGZZ RHFKGQHVHZG\\F RJPXP RH[KZQYVYZZ\\[",3802:" 65E_LGLZ RMGMZ RPFNGNZP[ RHJJHLGPFUFXGZIZKYM RXHYIYKXM RUFWGXIXKWL RQUOTNRNPONPMSLVLYM[O\\Q\\T[WYYWZT[P[LZJYHW RZO[Q[UZW RVLYNZQZUYXWZ",3803:" 60E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[Y\\[ R[HZMZT[Y RZKYJ RZNYKXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RYWZV RVZXXYVZS",3804:" 46E_KGKZ RLGLZ RNFMGMZN[ RHKIIKGNFSFVGXHZJ[L\\O\\R[UZWXYVZS[N[KZIXHV RZK[N[SZV RVGXIYKZNZSYVXXVZ",3805:" 86E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[Y\\[ R[HZMZT[Y RZKYJ RZMXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RYWZV RVZXXYVZS RJPKONOUQXQZP RPPRQURWRYQ RMORRUSWSYRZP RZMYLXLWMXNYM",3806:" 69E_JHJZ RMGKHKY ROFMGLILYNY RHJJHLGOFSFVGXHYI\\F R\\F[HZLZO[S\\U RZIYK RVGXIYLZO RLPMOOOTPWPYO RQPTQVQXP RNOTRVRXQYOYLXKWKVLWMXL RH[JZNYSYYZ\\[",3807:" 90E_\\F[HZJXHVGSFQFNGLHJJILHOHRIUJWLYNZQ[T[VZXYYXZV[Y\\[ R[HZMZT[Y RZKYJ RZNYKXIVG RJKINISJV RNGLIKKJNJSKVLXNZ RXXYVYR RVZWYXVXQ RKSLRMSLTKTJS RJPKNMMOMRNUPWQ RKOMNONROTP RJPLOOOUQYQZP",3808:" 50E_JGJZH[ RKHKZ RNHLHLZ RHFJGNHSHYG\\F RLPMNOLRKVKYL[N\\Q\\T[UYV RZN[P[SZU RVKXLYMZOZSYVYXZZ\\[ RH[LZPZU[",3809:" 23E_QIQY RRJRX RSISY RHFLHPITIXH\\F RH[KZOYUYYZ\\[",3810:" 42E_TIVIVXUZS[ RWIWXVY RXHXY RHFLHPITIXH\\F RIOHQHUIXKZN[S[VZXYZW\\T RIUJXKY RHSJUKXLZN[",3811:" 70E_JGJZH[ RKHKZ RNHLHLZ RHFJGNHSHYG\\F RLPMNOLRKUKXLYMYOXPSRQSPTPUQVRUQT RWLXMXOWP RUKWMWOVPSR RSRVRYSZUZWYX RWSYUYW RSRVSXUYXZZ[[\\[ RH[LZPZU[",3812:" 45E_JGJZ RKHKY RNHLHLYNY R\\KZNYPXSXUYW[X RZOYRYUZW R\\K[MZQZT[X\\[ RHFJGNHSHYG\\F RH[JZNYSYYZ\\[",3813:" 68E_QIQY RRJRX RSISY RNYLWJVIUHRHMIJKHMGPFTFWGYH[J\\M\\R[UZVXWVY RJUIRIMJJ RLWKUJRJLKIMG RZJ[M[RZU RWGYIZLZRYUXW RHFLHPITIXH\\F RH[KZOYUYYZ\\[",3814:" 48E_JHJZH[ RLHKIKZ ROFMGLILZ RHJJHLGOFSFVGXHZJ[L\\O\\S[UYV RZK[N[RZU RVGXIYKZNZRYVYXZZ[[\\[ RH[LZPZU[",3815:" 54E_QFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXHVGSFQF RJKINISJV RNGLIKKJNJSKVLXNZ RZV[S[NZK RVZXXYVZSZNYKXIVG",3816:" 51E_JIJZ RMHKJKY RQFOGMILKLYNY RHKJINGQFTFWGYH[J\\M\\O[RYTVURUOTMRLO RZJ[L[PZR RWGYIZLZPYSVU RH[JZNYSYYZ\\[",3817:" 74E_QFNGLHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXHVGSFQF RJKINISJV RNGLIKKJNJSKVLXNZ RZV[S[NZK RVZXXYVZSZNYKXIVG RJSKUNVTW[W\\X\\Z[[[Z\\Y RPWRW RKUNWQXSXTW",3818:" 69E_JIJZH[ RKIKZ RLHLZ RHKJILHNGQFUFYG[I\\K\\N[PZQ RYHZI[K[NZP RUFWGYIZKZOYQ RXRUSRSPRPPROUOXPZR\\U\\W[XZX RXQYR[V[WZT RTOVPXRYTZX[Z\\[ RH[LZPZU[",3819:" 94E_TFZG\\F[H[JYHWGTFPFMGJJIMIOJRLTOURUTTUSVQVP R[GZH[J RJPKRLSOTRTTS RKIJKJNKPMRPSRSTRVPWOXO RLQMQNPPNRMUMWNYPZRZUYXWZ RPMRLULXMZO[R[UZW RIWJYIZ RNPNOOMPLRKUKXL[O\\R\\T[WYYWZT[P[MZKYIWIYH[JZP[",3820:" 66E_QHMHKIJJILHOHSIVJXKYMZP[S[VZXYZW[U\\R\\N[KYIWH RUHTITKULVKUJ RISJVLXNYQZTZWY RJJINIQJTLWNXQYTYWXYW[T\\R RHFKI RKHLG RIGJGKFMGQHWHZG\\F",3821:" 51E_LHJJILHOHRIUJWLYNZQ[U[XZZY RKJJLIOISJV RKILJLKKMJPJSKVLXNZ RVHXHXXWZU[ RYHYXXY RZGZY\\[ RHFKGQHVHZG\\F",3822:" 31E_HFR[ RIGJHQWRY RJGKHRWSX R\\FR[ RWNUS RYLUQTTTV RHFJGOHUHZG\\F",3823:" 67E_LHJJILHOHRIUJWLYNZQ[S[VZXYZW[U\\R\\O[LZJXH RJLIOIRJUKW RJJKKKLJOJRKVLXNZ RYWZU[R[OZL RVZXXYVZRZOYLYKZJ RQIQ[ RRJRZ RSIS[ RHFLHPITIXH\\F",3824:" 41E_HFXYYZ RIGKHZZ RLH\\[ R\\FSP RQRJZ RPSMULW RQRMTLUKWKY RHFLHPITIXH\\F RH[JZNYSYYZ\\[",3825:" 47E_XHXZ RYHYY RZGZY RKHIJHMHPISKUMVPWSWVVXU RLUOVUV RHPIRKTNUTUVV RHFLHPITIXH\\F RHWJYLZP[T[XZ\\X",3826:" 73E_HFIGKHNHSFVFYGZIZKYM RXGYIYKXM RVFWGXIXL RXNTOROPNPLRKTKXL RTKVLWMVNTO RYM[O\\R\\T[WYYWZT[P[MZKYIWHTHRIOJNLMNMPNPPOQNPOO RXMZO[Q[UZW RXNYOZQZUYXWZ",3901:" 42J[PQMTMXP[TY RNTNXPZ ROROWRZ RRSMNNMONNO RONSNUMWOWXXY RUNVOVXUYVZWYVX RSNUPUXTYV[XY",3902:" 31IZNHLFMJMXP[UYWX RNHNXPZ RNHPFOJOWRZ ROOTMWPWX RTNVPVX RRNUQUY",3903:" 23KWNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMVOTPRN RSNUO",3904:" 32JZRMMPMXP[RZUYWY RNPNXPZ ROOOWRZ RPIPFQIWPWY RPIVPVX RPIMIPJUPUY",3905:" 25KXNPNYP[RY ROPOYPZ RPOPXQYRY RNPTMWQPU RSNVQ RRNUR",3906:" 32KWOIOXNYP[ RPIPXOYPZQYPX RQHQXRYP[ ROIUFWHUISG RTGVH RLMOM RQMUM",3907:" 41J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW]V_U`SaQaO`MaObQa RTNVPV]U_ RPaNa RRNUQU^T`Sa",3908:" 42I[NHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROORNTMWPWYT]T`UbVbT` RTNVPVYU[ RRNUQUZT]",3909:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[",3910:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTOSPSZT]T`RbPaPbRb",3911:" 51IZNHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROPRNTMVPSROU RSNUP RRNTQ RRSSTTYV[XY RSSTUUYVZ RSRTSVXWYXY",3912:" 21MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[",3913:" 66E_GOHOIPIXHYJ[ RINJOJXIYJZKYJX RGOIMKOKXLYJ[ RKONNPMSOSXTYR[ RPNRORXQYRZSYRX RNNQPQXPYR[ RSOVNXM[O[X\\YZ[ RXNZOZXYYZZ[YZX RVNYPYXXYZ[",3914:" 44I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX RTNVPVX RRNUQUY",3916:" 47IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY",3917:" 31J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`",3918:" 31KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO",3919:" 41JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ",3920:" 27MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM",3921:" 40I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY",3922:" 36I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX",3923:" 59E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},fe={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function fs(r,e="math"){const t=r.charCodeAt(0);if(65<=t&&t<=90){const i=t-65;return e=="text"||e=="rm"?i+2001:e=="tt"?i+501:e=="bf"||e=="bb"?i+3001:e=="sf"?i+2501:e=="frak"?i+3301:e=="scr"||e=="cal"?i+2551:i+2051}if(97<=t&&t<=122){const i=t-97;return e=="text"||e=="rm"?i+2101:e=="tt"?i+601:e=="bf"||e=="bb"?i+3101:e=="sf"?i+2601:e=="frak"?i+3401:e=="scr"||e=="cal"?i+2651:i+2151}if(48<=t&&t<=57){const i=t-48;return e=="it"?i+2750:e=="bf"?i+3200:e=="tt"?i+700:i+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[r]}const Vt={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function tf(r){r=r.replace(/\n/g," ");let e=0;const t=[];let i="";for(;e<r.length;)r[e]==" "?i.length&&(t.push(i),i=""):r[e]=="\\"?i.length==1&&i[0]=="\\"?(i+=r[e],t.push(i),i=""):(i.length&&t.push(i),i=r[e]):/[A-Za-z0-9\.]/.test(r[e])?i+=r[e]:(i.length&&i!="\\"&&(t.push(i),i=""),i+=r[e],t.push(i),i=""),e++;return i.length&&t.push(i),t}function nf(r){return{type:fe[r]?"symb":"char",mode:"math",text:r,chld:[],bbox:null}}function Wo(r){let e=0,t={type:"node",text:"",mode:"math",chld:[],bbox:null};function i(){if(r[e]!="[")return null;let s=0,l=e;for(;l<r.length;){if(r[l]=="[")s++;else if(r[l]=="]"&&(s--,!s))break;l++}const a=Wo(r.slice(e+1,l));return e=l,a}function n(s){let l=e,a=l,c=0,d=0;const h=[];for(;l<r.length;){if(r[l]=="{")c||(a=l),c++;else if(r[l]=="}"){if(c--,!c&&(h.push(Wo(r.slice(a+1,l))),d++,d==s))break}else if(c==0&&(h.push(nf(r[l])),d++,d==s))break;l++}return e=l,h}for(e=0;e<r.length;e++){const s=fe[r[e]],l={type:"",text:r[e],mode:"math",chld:[],bbox:null};if(s)if(s.arity){e++,l.type="func";let a=null;s.flags.opt&&(a=i(),a&&e++);const c=n(s.arity);l.chld=c,a&&l.chld.push(a)}else l.type="symb";else r[e]=="{"?(l.type="node",l.text="",l.chld=n(1)):l.type="char";t.chld.push(l)}return t.chld.length==1&&(t=t.chld[0]),t}function Wr(r){let e=0;for(;e<r.length;){if(r[e].text=="\\begin"){let t;for(t=e;t<r.length&&r[t].text!="\\end";t++);const i=r.splice(e+1,t-(e+1));Wr(i),r[e].text=r[e].chld[0].text,r[e].chld=i,r.splice(e+1,1)}e++}}function St(r,e,t,i,n,s){if(t==null&&(t=e),!!r.bbox){s&&(r.bbox.x*=e,r.bbox.y*=t),r.bbox.w*=e,r.bbox.h*=t;for(let l=0;l<r.chld.length;l++)St(r.chld[l],e,t,0,0,!0);r.bbox.x+=i,r.bbox.y+=n}}function kr(r){let e=1/0,t=-1/0,i=1/0,n=-1/0;for(let s=0;s<r.length;s++)r[s].bbox&&(e=Math.min(e,r[s].bbox.x),i=Math.min(i,r[s].bbox.y),t=Math.max(t,r[s].bbox.x+r[s].bbox.w),n=Math.max(n,r[s].bbox.y+r[s].bbox.h));return{x:e,y:i,w:t-e,h:n-i}}function sf(r){if(!r.length)return null;const e=kr(r);for(let i=0;i<r.length;i++)r[i].bbox&&(r[i].bbox.x-=e.x,r[i].bbox.y-=e.y);return{type:"node",text:"",mode:"math",chld:r,bbox:e}}function of(r,e="center"){for(let d=0;d<r.length;d++)if(r[d].text=="^"||r[d].text=="'"){let h=0,u=d;for(;u>0&&(r[u].text=="^"||r[u].text=="_"||r[u].text=="'");)u--;h=r[u].bbox.y,r[d].text=="'"?r[d].bbox.y=h:(St(r[d],Vt.SUB_SUP_SCALE,null,0,0),fe[r[u].text]&&fe[r[u].text].flags.big?r[d].bbox.y=h-r[d].bbox.h:r[u].text=="\\int"?r[d].bbox.y=h:r[d].bbox.y=h-r[d].bbox.h/2)}else if(r[d].text=="_"){let h=1,u=d;for(;u>0&&(r[u].text=="^"||r[u].text=="_"||r[u].text=="'");)u--;h=r[u].bbox.y+r[u].bbox.h,St(r[d],Vt.SUB_SUP_SCALE,null,0,0),fe[r[u].text]&&fe[r[u].text].flags.big?r[d].bbox.y=h:r[u].text=="\\int"?r[d].bbox.y=h-r[d].bbox.h:r[d].bbox.y=h-r[d].bbox.h/2}function t(d,h,u,f,g){let R=d,p=g,M=1/0,S=-1/0;for(;f>0?R<r.length:R>=0;){if(r[R].text==h)p++;else if(r[R].text==u){if(p--,p==0)break}else r[R].text=="^"||r[R].text=="_"||r[R].bbox&&(M=Math.min(M,r[R].bbox.y),S=Math.max(S,r[R].bbox.y+r[R].bbox.h));R+=f}return[M,S]}for(let d=0;d<r.length;d++)if(r[d].text=="\\left"){const[h,u]=t(d,"\\left","\\right",1,0);h!=1/0&&u!=-1/0&&(r[d].bbox.y=h,St(r[d],1,(u-h)/r[d].bbox.h,0,0))}else if(r[d].text=="\\right"){const[h,u]=t(d,"\\right","\\left",-1,0);h!=1/0&&u!=-1/0&&(r[d].bbox.y=h,St(r[d],1,(u-h)/r[d].bbox.h,0,0))}else if(r[d].text=="\\middle"){const[h,u]=t(d,"\\right","\\left",-1,1),[f,g]=t(d,"\\left","\\right",1,1),R=Math.min(h,f),p=Math.max(u,g);R!=1/0&&p!=-1/0&&(r[d].bbox.y=R,St(r[d],1,(p-R)/r[d].bbox.h,0,0))}if(!r.some(d=>d.text=="&"||d.text=="\\\\"))return;const i=[];let n=[],s=[];for(let d=0;d<r.length;d++)r[d].text=="&"?(n.push(s),s=[]):r[d].text=="\\\\"?(s.length&&(n.push(s),s=[]),i.push(n),n=[]):s.push(r[d]);s.length&&n.push(s),n.length&&i.push(n);const l=[],a=[];for(let d=0;d<i.length;d++){const h=[];for(let u=0;u<i[d].length;u++){const f=sf(i[d][u]);f&&(l[u]=l[u]||0,l[u]=Math.max(f.bbox.w+1,l[u])),h[u]=f}a.push(h)}const c=[];for(let d=0;d<a.length;d++){let h=1/0,u=-1/0;for(let f=0;f<a[d].length;f++)a[d][f]&&(h=Math.min(h,a[d][f].bbox.y),u=Math.max(u,a[d][f].bbox.y+a[d][f].bbox.h));c.push([h,u])}for(let d=0;d<c.length;d++)(c[d][0]==1/0||c[d][1]==1/0)&&(c[d][0]=d==0?0:c[d-1][1],c[d][1]=c[d][0]+2);for(let d=1;d<a.length;d++){const h=c[d-1][1]-c[d][0]+Vt.LINE_SPACING;for(let u=0;u<a[d].length;u++)a[d][u]&&(a[d][u].bbox.y+=h);c[d][0]+=h,c[d][1]+=h}r.splice(0,r.length);for(let d=0;d<a.length;d++){let h=0;for(let u=0;u<a[d].length;u++){const f=a[d][u];if(!f){h+=l[u];continue}f.bbox.x+=h,h+=l[u]-f.bbox.w,e=="center"?f.bbox.x+=(l[u]-f.bbox.w)/2:e=="left"||(e=="right"||e=="equation"&&u!=a[d].length-1)&&(f.bbox.x+=l[u]-f.bbox.w),r.push(f)}}}function Ht(r,e="math"){var t,i,n;const s=(t={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[r.text])!=null?t:e;if(!r.chld.length){if(fe[r.text])if(fe[r.text].flags.big)r.text=="\\lim"?r.bbox={x:0,y:0,w:3.5,h:2}:r.bbox={x:0,y:-.5,w:3,h:3};else if(fe[r.text].flags.txt){let l=0;for(let a=1;a<r.text.length;a++)l+=Ji(fs(r.text[a],"text")).w;l/=16,r.bbox={x:0,y:0,w:l,h:2}}else if(fe[r.text].glyph){let l=Ji(fe[r.text].glyph).w;l/=16,r.text=="\\int"||r.text=="\\oint"?r.bbox={x:0,y:-1.5,w:l,h:5}:r.bbox={x:0,y:0,w:l,h:2}}else r.bbox={x:0,y:0,w:1,h:2};else{let l=0;for(let a=0;a<r.text.length;a++)Ji(fs(r.text[a],s))&&(s=="tt"?l+=16:l+=Ji(fs(r.text[a],s)).w);l/=16,r.bbox={x:0,y:0,w:l,h:2}}r.mode=s;return}if(r.text=="\\frac"){const l=r.chld[0],a=r.chld[1],c=Vt.FRAC_SCALE;Ht(l),Ht(a),l.bbox.x=0,l.bbox.y=0,a.bbox.x=0,a.bbox.y=0;const d=Math.max(l.bbox.w,a.bbox.w)*c;St(l,c,null,(d-l.bbox.w*c)/2,0),St(a,c,null,(d-a.bbox.w*c)/2,l.bbox.h+Vt.FRAC_SPACING),r.bbox={x:0,y:-l.bbox.h+1-Vt.FRAC_SPACING/2,w:d,h:l.bbox.h+a.bbox.h+Vt.FRAC_SPACING}}else if(r.text=="\\binom"){const l=r.chld[0],a=r.chld[1];Ht(l),Ht(a),l.bbox.x=0,l.bbox.y=0,a.bbox.x=0,a.bbox.y=0;const c=Math.max(l.bbox.w,a.bbox.w);St(l,1,null,(c-l.bbox.w)/2+1,0),St(a,1,null,(c-a.bbox.w)/2+1,l.bbox.h),r.bbox={x:0,y:-l.bbox.h+1,w:c+2,h:l.bbox.h+a.bbox.h}}else if(r.text=="\\sqrt"){const l=r.chld[0];Ht(l);const a=r.chld[1];let c=0;a&&(Ht(a),c=Math.max(a.bbox.w*Vt.SQRT_MAG_SCALE-.5,0),St(a,Vt.SQRT_MAG_SCALE,null,0,.5)),St(l,1,null,1+c,.5),r.bbox={x:0,y:2-l.bbox.h-.5,w:l.bbox.w+1+c,h:l.bbox.h+.5}}else if(fe[r.text]&&fe[r.text].flags.hat){const l=r.chld[0];Ht(l);const a=l.bbox.y-.5;l.bbox.y=.5,r.bbox={x:0,y:a,w:l.bbox.w,h:l.bbox.h+.5}}else if(fe[r.text]&&fe[r.text].flags.mat){const l=r.chld[0];Ht(l),r.bbox={x:0,y:0,w:l.bbox.w,h:l.bbox.h+.5}}else{let l=0,a=0,c=1;for(let R=0;R<r.chld.length;R++){const p=r.chld[R],M=(i={"\\quad":2,"\\,":2*3/18,"\\:":2*4/18,"\\;":2*5/18,"\\!":2*-3/18}[p.text])!=null?i:null;if(p.text=="\\\\"){a+=c,l=0,c=1;continue}else{if(p.text=="&")continue;if(M!=null){l+=M;continue}else{if(Ht(p,s),St(p,1,null,l,a),p.text=="^"||p.text=="_"||p.text=="'"){let S=R;for(;S>0&&(r.chld[S].text=="^"||r.chld[S].text=="_"||r.chld[S].text=="'");)S--;const b=fe[r.chld[S].text]&&fe[r.chld[S].text].flags.big;if(p.text=="'"){let P=S+1,N=0;for(;P<R;)r.chld[P].text=="'"&&N++,P++;p.bbox.x=r.chld[S].bbox.x+r.chld[S].bbox.w+p.bbox.w*N,l=Math.max(l,p.bbox.x+p.bbox.w)}else if(b){const P=r.chld[S].bbox.x+(r.chld[S].bbox.w-p.bbox.w*Vt.SUB_SUP_SCALE)/2;p.bbox.x=P,l=Math.max(l,r.chld[S].bbox.x+r.chld[S].bbox.w+(p.bbox.w*Vt.SUB_SUP_SCALE-r.chld[S].bbox.w)/2)}else p.bbox.x=r.chld[S].bbox.x+r.chld[S].bbox.w,l=Math.max(l,p.bbox.x+p.bbox.w*Vt.SUB_SUP_SCALE)}else l+=p.bbox.w;e=="text"&&(l+=1),c=Math.max(p.bbox.y+p.bbox.h-a,c)}}}a+=c;const d={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},h=(n={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[r.text])!=null?n:"left",u=!!d[r.text],f=!!d[r.text]&&d[r.text].length>1;of(r.chld,h);const g=kr(r.chld);r.text=="\\text"&&(g.x-=1,g.w+=2);for(let R=0;R<r.chld.length;R++)St(r.chld[R],1,null,-g.x+(u?1.5:0),-g.y);r.bbox={x:0,y:0,w:g.w+1.5*Number(u)+1.5*Number(f),h:g.h},u&&r.chld.unshift({type:"symb",text:d[r.text][0],mode:r.mode,chld:[],bbox:{x:0,y:0,w:1,h:g.h}}),f&&r.chld.push({type:"symb",text:d[r.text][1],mode:r.mode,chld:[],bbox:{x:g.w+2,y:0,w:1,h:g.h}}),(u||f||r.text=="matrix")&&(r.type="node",r.text="",r.bbox.y-=(r.bbox.h-2)/2)}}function lf(r){function e(i,n,s){const l=[];if(i.bbox){if(n+=i.bbox.x,s+=i.bbox.y,i.text=="\\frac"){const a=i.chld[1].bbox.y-(i.chld[0].bbox.y+i.chld[0].bbox.h),c={type:"symb",mode:i.mode,text:"\\bar",bbox:{x:n,y:s+(i.chld[1].bbox.y-a/2)-a/2,w:i.bbox.w,h:a},chld:[]};l.push(c)}else if(i.text=="\\sqrt"){const a=i.chld[0].bbox.y,c=Math.max(0,i.chld[0].bbox.x-i.chld[0].bbox.h/2),d={type:"symb",mode:i.mode,text:"\\sqrt",bbox:{x:n+c,y:s+a/2,w:i.chld[0].bbox.x-c,h:i.bbox.h-a/2},chld:[]};l.push(d),l.push({type:"symb",text:"\\bar",mode:i.mode,bbox:{x:n+i.chld[0].bbox.x,y:s,w:i.bbox.w-i.chld[0].bbox.x,h:a},chld:[]})}else if(i.text=="\\binom"){const a=Math.min(i.chld[0].bbox.x,i.chld[1].bbox.x),c={type:"symb",mode:i.mode,text:"(",bbox:{x:n,y:s,w:a,h:i.bbox.h},chld:[]};l.push(c),l.push({type:"symb",text:")",mode:i.mode,bbox:{x:n+i.bbox.w-a,y:s,w:a,h:i.bbox.h},chld:[]})}else if(fe[i.text]&&fe[i.text].flags.hat){const a=i.chld[0].bbox.y,c={type:"symb",mode:i.mode,text:i.text,bbox:{x:n,y:s,w:i.bbox.w,h:a},chld:[]};l.push(c)}else if(fe[i.text]&&fe[i.text].flags.mat){const a=i.chld[0].bbox.h,c={type:"symb",text:i.text,mode:i.mode,bbox:{x:n,y:s+a,w:i.bbox.w,h:i.bbox.h-a},chld:[]};l.push(c)}else if(i.type!="node"&&i.text!="^"&&i.text!="_"){const a={type:i.type=="func"?"symb":i.type,text:i.text,mode:i.mode,bbox:{x:n,y:s,w:i.bbox.w,h:i.bbox.h},chld:[]};l.push(a)}}for(let a=0;a<i.chld.length;a++){const c=e(i.chld[a],n,s);l.push(...c)}return l}const t=e(r,-r.bbox.x,-r.bbox.y);r.type="node",r.text="",r.chld=t}function rf(r){const e=[];for(let t=0;t<r.chld.length;t++){const i=r.chld[t];let n=i.bbox.h/2,s=!1;if(fe[i.text]&&fe[i.text].flags.hat&&!fe[i.text].flags.xfl&&!fe[i.text].flags.yfl&&(n*=4,s=!0),fe[i.text]&&fe[i.text].glyph){const l=Ji(fe[i.text].glyph);for(let a=0;a<l.polylines.length;a++){const c=[];for(let d=0;d<l.polylines[a].length;d++){let h=l.polylines[a][d][0],u=l.polylines[a][d][1];if(fe[i.text].flags.xfl)h=(h-l.xmin)/Math.max(l.xmax-l.xmin,1)*i.bbox.w,h+=i.bbox.x;else if(l.w/16*n>i.bbox.w)h=h/Math.max(l.w,1)*i.bbox.w,h+=i.bbox.x;else{h=h/16*n;const f=(i.bbox.w-l.w/16*n)/2;h+=i.bbox.x+f}if(fe[i.text].flags.yfl)u=(u-l.ymin)/Math.max(l.ymax-l.ymin,1)*i.bbox.h,u+=i.bbox.y;else{if(u=u/16*n,s){const f=(l.ymax+l.ymin)/2;u-=f/16*n}u+=i.bbox.y+i.bbox.h/2}c.push([h,u])}e.push(c)}}else if(fe[i.text]&&fe[i.text].flags.txt||i.type=="char"){let l=i.bbox.x;const a=!!(fe[i.text]&&fe[i.text].flags.txt);for(let c=Number(a);c<i.text.length;c++){const d=Ji(fs(i.text[c],a?"text":i.mode));if(!d){console.warn("unmapped character: "+i.text[c]);continue}for(let h=0;h<d.polylines.length;h++){const u=[];for(let f=0;f<d.polylines[h].length;f++){let g=d.polylines[h][f][0],R=d.polylines[h][f][1];g/=16,R/=16,g*=n,R*=n,i.mode=="tt"&&(d.w>16?g*=16/d.w:g+=(16-d.w)/2/16),g+=l,R+=i.bbox.y+i.bbox.h/2,u.push([g,R])}e.push(u)}i.mode=="tt"?l+=n:l+=d.w/16*n}}}return e}function Bt(r){return Math.round(r*100)/100}class af{constructor(e){O(this,"_latex"),O(this,"_tree"),O(this,"_tokens"),O(this,"_polylines"),this._latex=e,this._tokens=tf(e),this._tree=Wo(this._tokens),Wr(this._tree.chld),Ht(this._tree),lf(this._tree),this._polylines=rf(this._tree)}resolveScale(e){var t,i,n,s;if(e==null)return[16,16,16,16];let l=(t=e.SCALE_X)!=null?t:16,a=(i=e.SCALE_Y)!=null?i:16;if(e.MIN_CHAR_H!=null){let h=0;for(let f=0;f<this._tree.chld.length;f++){const g=this._tree.chld[f];(g.type=="char"||fe[g.text]&&(fe[g.text].flags.txt||!Object.keys(fe[g.text].flags).length))&&(h=Math.min(g.bbox.h,h))}const u=Math.max(1,e.MIN_CHAR_H/h);l*=u,a*=u}if(e.MAX_W!=null){const h=l;l=Math.min(l,e.MAX_W/this._tree.bbox.w),a*=l/h}if(e.MAX_H!=null){const h=a;a=Math.min(a,e.MAX_H/this._tree.bbox.h),l*=a/h}const c=(n=e.MARGIN_X)!=null?n:l,d=(s=e.MARGIN_Y)!=null?s:a;return[c,d,l,a]}polylines(e){e||(e={});const t=[],[i,n,s,l]=this.resolveScale(e);for(let a=0;a<this._polylines.length;a++){t.push([]);for(let c=0;c<this._polylines[a].length;c++){const[d,h]=this._polylines[a][c];t[t.length-1].push([i+d*s,n+h*l])}}return t}pathd(e){e||(e={});let t="";const[i,n,s,l]=this.resolveScale(e);for(let a=0;a<this._polylines.length;a++)for(let c=0;c<this._polylines[a].length;c++){const[d,h]=this._polylines[a][c];t+=c?"L":"M",t+=`${Bt(i+d*s)} ${Bt(n+h*l)}`}return t}svg(e){var t,i;e||(e={});const[n,s,l,a]=this.resolveScale(e),c=Bt(this._tree.bbox.w*l+n*2),d=Bt(this._tree.bbox.h*a+s*2);let h=`<svg
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ width="${c}" height="${d}"
15
+ fill="none" stroke="${(t=e.FG_COLOR)!=null?t:"black"}" stroke-width="${(i=e.STROKE_W)!=null?i:1}"
16
+ stroke-linecap="round" stroke-linejoin="round"
17
+ >`;e.BG_COLOR&&(h+=`<rect x="0" y="0" width="${c}" height="${d}" fill="${e.BG_COLOR}" stroke="none"></rect>`),h+='<path d="';for(let u=0;u<this._polylines.length;u++){h+="M";for(let f=0;f<this._polylines[u].length;f++){const[g,R]=this._polylines[u][f];h+=Bt(n+g*l)+" "+Bt(s+R*a)+" "}}return h+='"/>',h+="</svg>",{svg:`data:image/svg+xml;base64,${window.btoa(h)}`,width:Math.ceil(c),height:Math.ceil(d)}}pdf(e){var t;e||(e={});const[i,n,s,l]=this.resolveScale(e),a=Bt(this._tree.bbox.w*s+i*2),c=Bt(this._tree.bbox.h*l+n*2);let d=`%PDF-1.1
18
+ %%¥±ë
19
+ 1 0 obj
20
+ << /Type /Catalog
21
+ /Pages 2 0 R
22
+ >>endobj
23
+ 2 0 obj
24
+ << /Type /Pages
25
+ /Kids [3 0 R]
26
+ /Count 1
27
+ /MediaBox [0 0 ${a} ${c}]
28
+ >>
29
+ endobj
30
+ 3 0 obj
31
+ << /Type /Page
32
+ /Parent 2 0 R
33
+ /Resources
34
+ << /Font
35
+ << /F1
36
+ << /Type /Font
37
+ /Subtype /Type1
38
+ /BaseFont /Times-Roman
39
+ >>
40
+ >>
41
+ >>
42
+ /Contents [`,h="",u=4;for(let f=0;f<this._polylines.length;f++){h+=`${u} 0 obj
43
+ << /Length 0 >>
44
+ stream
45
+ 1 j 1 J ${(t=e.STROKE_W)!=null?t:1} w
46
+ `;for(let g=0;g<this._polylines[f].length;g++){const[R,p]=this._polylines[f][g];h+=`${Bt(i+R*s)} ${Bt(c-(n+p*l))} ${g?"l":"m"} `}h+=`
47
+ S
48
+ endstream
49
+ endobj
50
+ `,d+=`${u} 0 R `,u++}return d+=`]
51
+ >>
52
+ endobj
53
+ `,h+=`
54
+ trailer
55
+ << /Root 1 0 R
56
+ /Size 0
57
+ >>startxref
58
+
59
+ %%EOF
60
+ `,d+h}boxes(e){e||(e={});const[t,i,n,s]=this.resolveScale(e),l=[];for(let a=0;a<this._tree.chld.length;a++){const{x:c,y:d,w:h,h:u}=this._tree.chld[a].bbox;l.push({x:t+c*n,y:i+d*s,w:h*n,h:u*s})}return l}box(e){e||(e={});const[t,i,n,s]=this.resolveScale(e);return{x:t+this._tree.bbox.x*n,y:i+this._tree.bbox.y*s,w:this._tree.bbox.w*n,h:this._tree.bbox.h*s}}}class Dr extends vr{static convertLaTextToSVG(e){return new af(e).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(e,t,i,n){const{scale:s}=this.options,l=t.width*s,a=t.height*s;if(this.imageCache.has(t.value)){const c=this.imageCache.get(t.value);e.drawImage(c,i,n,l,a)}else{const c=new Promise((d,h)=>{const u=new Image;u.src=t.laTexSVG,u.onload=()=>{e.drawImage(u,i,n,l,a),this.imageCache.set(t.value,u),d(t)},u.onerror=f=>{h(f)}});this.addImageObserver(c)}}}var Gt;(function(r){r.UL="ul",r.OL="ol"})(Gt||(Gt={}));var ki;(function(r){r.DISC="disc",r.CIRCLE="circle",r.SQUARE="square",r.CHECKBOX="checkbox"})(ki||(ki={}));var Er;(function(r){r.DECIMAL="decimal"})(Er||(Er={}));var ht;(function(r){r.DISC="disc",r.CIRCLE="circle",r.SQUARE="square",r.DECIMAL="decimal",r.CHECKBOX="checkbox"})(ht||(ht={}));const ko={[ki.DISC]:"•",[ki.CIRCLE]:"◦",[ki.SQUARE]:"▫︎",[ki.CHECKBOX]:"☑️"},cf={[Gt.OL]:"ol",[Gt.UL]:"ul"},df={[ht.DISC]:"disc",[ht.CIRCLE]:"circle",[ht.SQUARE]:"square",[ht.DECIMAL]:"decimal",[ht.CHECKBOX]:"checkbox"};var Ce;(function(r){r.FIRST="first",r.SECOND="second",r.THIRD="third",r.FOURTH="fourth",r.FIFTH="fifth",r.SIXTH="sixth"})(Ce||(Ce={}));const hf={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},Ur={[Ce.FIRST]:"defaultFirstSize",[Ce.SECOND]:"defaultSecondSize",[Ce.THIRD]:"defaultThirdSize",[Ce.FOURTH]:"defaultFourthSize",[Ce.FIFTH]:"defaultFifthSize",[Ce.SIXTH]:"defaultSixthSize"},Do={[Ce.FIRST]:1,[Ce.SECOND]:2,[Ce.THIRD]:3,[Ce.FOURTH]:4,[Ce.FIFTH]:5,[Ce.SIXTH]:6},uf={H1:Ce.FIRST,H2:Ce.SECOND,H3:Ce.THIRD,H4:Ce.FOURTH,H5:Ce.FIFTH,H6:Ce.SIXTH};var _t;(function(r){r.IFRAME="iframe",r.VIDEO="video"})(_t||(_t={}));var he;(function(r){r.TEXT="text",r.SELECT="select",r.CHECKBOX="checkbox",r.RADIO="radio",r.DATE="date",r.NUMBER="number"})(he||(he={}));var E;(function(r){r.PREFIX="prefix",r.POSTFIX="postfix",r.PRE_TEXT="preText",r.POST_TEXT="postText",r.PLACEHOLDER="placeholder",r.VALUE="value",r.CHECKBOX="checkbox",r.RADIO="radio"})(E||(E={}));var Eo;(function(r){r.ROW_START="rowStart",r.VALUE_START="valueStart"})(Eo||(Eo={}));var zi;(function(r){r.ACTIVE="active",r.INACTIVE="inactive"})(zi||(zi={}));var ci;(function(r){r.COMPONENT="component",r.MENU="menu",r.MAIN="main",r.FOOTER="footer",r.CONTEXTMENU="contextmenu",r.POPUP="popup",r.CATALOG="catalog",r.COMMENT="comment"})(ci||(ci={}));var di;(function(r){r.PAGE="page",r.TABLE="table"})(di||(di={}));var ce;(function(r){r.EDIT="edit",r.CLEAN="clean",r.READONLY="readonly",r.FORM="form",r.PRINT="print",r.DESIGN="design"})(ce||(ce={}));var de;(function(r){r.HEADER="header",r.MAIN="main",r.FOOTER="footer"})(de||(de={}));var bi;(function(r){r.PAGING="paging",r.CONTINUITY="continuity"})(bi||(bi={}));var At;(function(r){r.VERTICAL="vertical",r.HORIZONTAL="horizontal"})(At||(At={}));var gs;(function(r){r.BREAK_ALL="break-all",r.BREAK_WORD="break-word"})(gs||(gs={}));var Rs;(function(r){r.SPEED="speed",r.COMPATIBILITY="compatibility"})(Rs||(Rs={}));var ut;(function(r){r.ALL="all",r.EMPTY="empty",r.EXTERNAL="external",r.INTERNAL="internal",r.DASH="dash"})(ut||(ut={}));var Mt;(function(r){r.TOP="top",r.RIGHT="right",r.BOTTOM="bottom",r.LEFT="left"})(Mt||(Mt={}));var $i;(function(r){r.FORWARD="forward",r.BACK="back"})($i||($i={}));var ps;(function(r){r.CONTAIN="contain",r.COVER="cover"})(ps||(ps={}));var Li;(function(r){r.REPEAT="repeat",r.NO_REPEAT="no-repeat",r.REPEAT_X="repeat-x",r.REPEAT_Y="repeat-y"})(Li||(Li={}));const ff={color:"#FFFFFF",image:"",size:ps.COVER,repeat:Li.NO_REPEAT,applyPageNumbers:[]};var Ae;(function(r){r.TOP="top",r.MIDDLE="middle",r.BOTTOM="bottom"})(Ae||(Ae={}));const gf={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:Ae.BOTTOM},Rf={placeholderColor:"#9c9b9b",bracketColor:"#000000",prefix:"{",postfix:"}",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},pf={bottom:30,inactiveAlpha:1,maxHeightRadio:Xi.HALF,disabled:!1,editable:!0},mf={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},Sf={top:30,inactiveAlpha:1,maxHeightRadio:Xi.HALF,disabled:!1,editable:!0},Mf={disabled:!0,color:"#CCCCCC",lineWidth:1.5},Nf={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},wn={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},bf={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:Re.CENTER,format:wn.PAGE_NO,numberType:In.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},Zr={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},Lf={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:Ae.BOTTOM},Of={lineWidth:1,strokeStyle:"#000000"},Pf={tdPadding:[0,5,5,5],defaultTrMinHeight:42,defaultColMinWidth:40,defaultBorderColor:"#000000"};var ms;(function(r){r.TEXT="text",r.IMAGE="image"})(ms||(ms={}));const Uo={data:"",type:ms.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:In.ARABIC},Tf={tipDisabled:!0};var Ss;(function(r){r.PAGE="page",r.CONTINUITY="continuity"})(Ss||(Ss={}));const If={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:Ss.CONTINUITY},xf={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},wf={top:0,left:5};function Zo(r={}){var e,t,i;const n=B(B({},Pf),r.table),s=B(B({},Sf),r.header),l=B(B({},pf),r.footer),a=B(B({},bf),r.pageNumber),c=B(B({},Uo),r.watermark),d=B(B({},Rf),r.control),h=B(B({},gf),r.checkbox),u=B(B({},Lf),r.radio),f=B(B({},Ku),r.cursor),g=B(B({},hf),r.title),R=B(B({},Zr),r.placeholder),p=B(B({},mf),r.group),M=B(B({},Nf),r.pageBreak),S=B(B({},Tf),r.zone),b=B(B({},ff),r.background),P=B(B({},Mf),r.lineBreak),N=B(B({},Of),r.separator),m=B(B({},If),r.lineNumber),T=B(B({},xf),r.pageBorder),y=B(B({},wf),r.badge),x={print:B(B({},Vo.print),(e=r.modeRule)==null?void 0:e.print),readonly:B(B({},Vo.readonly),(t=r.modeRule)==null?void 0:t.readonly),form:B(B({},Vo.form),(i=r.modeRule)==null?void 0:i.form)};return oe(B({mode:ce.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"Microsoft YaHei",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[100,120,100,120],pageMode:bi.PAGING,renderMode:Rs.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:At.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:gs.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[xu.ENGLISH],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1},r),{table:n,header:s,footer:l,pageNumber:a,watermark:c,control:d,checkbox:h,radio:u,cursor:f,title:g,placeholder:R,group:p,pageBreak:M,zone:S,background:b,lineBreak:P,separator:N,lineNumber:m,pageBorder:T,badge:y,modeRule:x})}function Yr(r){const e=[];for(let t=0;t<r.length;t++){const i=r[t],n=mt(i.value);for(let s=0;s<n.length;s++)e.push(oe(B({},i),{value:n[s]}))}return e}function tt(r,e){var t;const{isHandleFirstElement:i=!0,isForceCompensation:n=!1,editorOptions:s}=e,l=r[0];(n||i&&l?.type!==D.LIST&&(l?.type&&l.type!==D.TEXT||!Po.test(l?.value)))&&r.unshift({value:j});let a=0;for(;a<r.length;){let c=r[a];if(c.type===D.TITLE){r.splice(a,1);const d=c.valueList||[];if(tt(d,oe(B({},e),{isHandleFirstElement:!1,isForceCompensation:!1})),d.length){const h=c.titleId||pe(),u=s.title;for(let f=0;f<d.length;f++){const g=d[f];g.title=c.title,c.level&&(g.titleId=h,g.level=c.level),Kr(g)&&(g.size||(g.size=u[Ur[g.level]]),g.bold===void 0&&(g.bold=!0)),r.splice(a,0,g),a++}}a--}else if(c.type===D.LIST){r.splice(a,1);const d=c.valueList||[];if(tt(d,oe(B({},e),{isHandleFirstElement:!0,isForceCompensation:!1})),d.length){const h=pe();for(let u=0;u<d.length;u++){const f=d[u];f.listId=h,f.listType=c.listType,f.listStyle=c.listStyle,r.splice(a,0,f),a++}}a--}else if(c.type===D.AREA){r.splice(a,1);const d=c?.valueList||[];if(tt(d,oe(B({},e),{isHandleFirstElement:!0,isForceCompensation:!0})),d.length){const h=pe();for(let u=0;u<d.length;u++){const f=d[u];if(f.areaId=c.areaId||h,f.area=c.area,f.areaIndex=u,f.type===D.TABLE){const g=f.trList;for(let R=0;R<g.length;R++){const p=g[R];for(let M=0;M<p.tdList.length;M++){const b=p.tdList[M].value;for(let P=0;P<b.length;P++){const N=b[P];N.areaId=c.areaId||h,N.area=c.area}}}}r.splice(a,0,f),a++}}a--}else if(c.type===D.TABLE){const d=c.id||pe();if(c.id=d,c.trList){const{defaultTrMinHeight:h}=s.table;for(let u=0;u<c.trList.length;u++){const f=c.trList[u],g=f.id||pe();f.id=g,(!f.minHeight||f.minHeight<h)&&(f.minHeight=h),f.height<f.minHeight&&(f.height=f.minHeight);for(let R=0;R<f.tdList.length;R++){const p=f.tdList[R],M=p.id||pe();p.id=M,tt(p.value,oe(B({},e),{isHandleFirstElement:!0,isForceCompensation:!0}));for(let S=0;S<p.value.length;S++){const b=p.value[S];b.tdId=M,b.trId=g,b.tableId=d}}}}}else if(c.type===D.HYPERLINK){r.splice(a,1);const d=Yr(c.valueList||[]);if(d.length){const h=pe();for(let u=0;u<d.length;u++){const f=d[u];f.type=c.type,f.url=c.url,f.hyperlinkId=h,r.splice(a,0,f),a++}}a--}else if(c.type===D.DATE){r.splice(a,1);const d=Yr(c.valueList||[]);if(d.length){const h=pe();for(let u=0;u<d.length;u++){const f=d[u];f.type=c.type,f.dateFormat=c.dateFormat,f.dateId=h,r.splice(a,0,f),a++}}a--}else if(c.type===D.CONTROL){if(!c.control){a++;continue}const{prefix:d,postfix:h,preText:u,postText:f,value:g,placeholder:R,code:p,type:M,valueSets:S}=c.control,{editorOptions:{control:b,checkbox:P,radio:N}}=e,m=c.controlId||pe();r.splice(a,1);const T=Lt(c,[...Xr,...Wi]),y=Lt(c.control,ai),x=oe(B({},y),{color:s.control.bracketColor}),I=mt(d||b.prefix);for(let F=0;F<I.length;F++){const L=I[F];r.splice(a,0,oe(B(B({},T),x),{controlId:m,value:L,type:c.type,control:c.control,controlComponent:E.PREFIX})),a++}if(u){const F=mt(u);for(let L=0;L<F.length;L++){const w=F[L];r.splice(a,0,oe(B(B({},T),y),{controlId:m,value:w,type:c.type,control:c.control,controlComponent:E.PRE_TEXT})),a++}}if(g&&g.length||M===he.CHECKBOX||M===he.RADIO||M===he.SELECT&&p&&(!g||!g.length)){let F=g?Ne(g):[];if(M===he.CHECKBOX){const L=p?p.split(","):[];if(Array.isArray(S)&&S.length){const w=F.reduce((X,C)=>X.concat(C.value.split("").map(Z=>oe(B({},C),{value:Z}))),[]);let v=0;for(let X=0;X<S.length;X++){const C=S[X];r.splice(a,0,oe(B(B({},T),y),{controlId:m,value:"",type:c.type,control:c.control,controlComponent:E.CHECKBOX,checkbox:{code:C.code,value:L.includes(C.code)}})),a++;const Z=mt(C.value);for(let k=0;k<Z.length;k++){const Q=Z[k],Y=k===Z.length-1;r.splice(a,0,oe(B(B(B({},T),y),w[v]),{controlId:m,value:Q===`
61
+ `?j:Q,letterSpacing:Y?P.gap:0,control:c.control,controlComponent:E.VALUE})),v++,a++}}}}else if(M===he.RADIO){if(Array.isArray(S)&&S.length){const L=F.reduce((v,X)=>v.concat(X.value.split("").map(C=>oe(B({},X),{value:C}))),[]);let w=0;for(let v=0;v<S.length;v++){const X=S[v];r.splice(a,0,oe(B(B({},T),y),{controlId:m,value:"",type:c.type,control:c.control,controlComponent:E.RADIO,radio:{code:X.code,value:p===X.code}})),a++;const C=mt(X.value);for(let Z=0;Z<C.length;Z++){const k=C[Z],Q=Z===C.length-1;r.splice(a,0,oe(B(B(B({},T),y),L[w]),{controlId:m,value:k===`
62
+ `?j:k,letterSpacing:Q?N.gap:0,control:c.control,controlComponent:E.VALUE})),w++,a++}}}}else{if((!g||!g.length)&&Array.isArray(S)&&S.length){const L=S.find(w=>w.code===p);L&&(F=[{value:L.value}])}tt(F,oe(B({},e),{isHandleFirstElement:!1,isForceCompensation:!1}));for(let L=0;L<F.length;L++){const w=F[L],v=w.value;r.splice(a,0,oe(B(B(B({},T),y),w),{controlId:m,value:v===`
63
+ `?j:v,type:w.type||D.TEXT,control:c.control,controlComponent:E.VALUE})),a++}}}else if(R){const F=oe(B({},y),{color:s.control.placeholderColor}),L=mt(R);for(let w=0;w<L.length;w++){const v=L[w];r.splice(a,0,oe(B(B({},T),F),{controlId:m,value:v===`
64
+ `?j:v,type:c.type,control:c.control,controlComponent:E.PLACEHOLDER})),a++}}if(f){const F=mt(f);for(let L=0;L<F.length;L++){const w=F[L];r.splice(a,0,oe(B(B({},T),y),{controlId:m,value:w,type:c.type,control:c.control,controlComponent:E.POST_TEXT})),a++}}const V=mt(h||b.postfix);for(let F=0;F<V.length;F++){const L=V[F];r.splice(a,0,oe(B(B({},T),x),{controlId:m,value:L,type:c.type,control:c.control,controlComponent:E.POSTFIX})),a++}a--}else if((!c.type||yt.includes(c.type))&&((t=c.value)==null?void 0:t.length)>1){r.splice(a,1);const d=mt(c.value);for(let h=0;h<d.length;h++)r.splice(a+h,0,oe(B({},c),{value:d[h]}));c=r[a]}if((c.value===`
65
+ `||c.value==`\r
66
+ `)&&(c.value=j),(c.type===D.IMAGE||c.type===D.BLOCK)&&(c.id=c.id||pe()),c.type===D.LATEX){const{svg:d,width:h,height:u}=Dr.convertLaTextToSVG(c.value);c.width=c.width||h,c.height=c.height||u,c.laTexSVG=d,c.id=c.id||pe()}a++}}function yf(r,e){const t=Object.keys(r),i=Object.keys(e);if(t.length!==i.length)return!1;for(let n=0;n<t.length;n++){const s=t[n];if(s!=="value"&&!(s==="groupIds"&&Array.isArray(r[s])&&Array.isArray(e[s])&&yr(r[s],e[s]))&&r[s]!==e[s])return!1}return!0}function ji(r,e={}){const{extraPickAttrs:t}=e,i=[..._u];t&&i.push(...t);const n={value:r.value===j?`
67
+ `:r.value};return i.forEach(s=>{const l=r[s];l!==void 0&&(n[s]=l)}),n}function be(r,e={}){const{extraPickAttrs:t,isClassifyArea:i=!1,isClone:n=!0}=e,s=n?Ne(r):r,l=[];let a=0;for(;a<s.length;){let c=s[a];if(a===0&&c.value===j&&!c.listId&&(!c.type||c.type===D.TEXT)){a++;continue}if(c.areaId){const h=c.areaId,u=c.area,f=[];for(;a<s.length;){const R=s[a];if(h!==R.areaId){a--;break}delete R.area,delete R.areaId,f.push(R),a++}const g=be(f,e);if(i){const R={type:D.AREA,value:"",areaId:h,area:u};R.valueList=g,c=R}else{l.splice(a,0,...g);continue}}else if(c.titleId&&c.level){const h=c.titleId;if(h){const u=c.level,f={type:D.TITLE,title:c.title,titleId:h,value:"",level:u},g=[];for(;a<s.length;){const R=s[a];if(h!==R.titleId){a--;break}delete R.level,delete R.title,g.push(R),a++}f.valueList=be(g,e),c=f}}else if(c.listId&&c.listType){const h=c.listId;if(h){const u=c.listType,f=c.listStyle,g={type:D.LIST,value:"",listId:h,listType:u,listStyle:f},R=[];for(;a<s.length;){const p=s[a];if(h!==p.listId){a--;break}delete p.listType,delete p.listStyle,R.push(p),a++}g.valueList=be(R,e),c=g}}else if(c.type===D.TABLE){if(c.pagingId){let h=a+1,u=0;for(;h<s.length;){const f=s[h];if(f.pagingId===c.pagingId)c.height+=f.height,c.trList.push(...f.trList),h++,u++;else break}a+=u}if(c.trList)for(let h=0;h<c.trList.length;h++){const u=c.trList[h];delete u.id;for(let f=0;f<u.tdList.length;f++){const g=u.tdList[f],R={colspan:g.colspan,rowspan:g.rowspan,value:be(g.value,oe(B({},e),{isClassifyArea:!1}))};Au.forEach(p=>{const M=g[p];M!==void 0&&(R[p]=M)}),u.tdList[f]=R}}}else if(c.type===D.HYPERLINK){const h=c.hyperlinkId;if(h){const u={type:D.HYPERLINK,value:"",url:c.url},f=[];for(;a<s.length;){const g=s[a];if(h!==g.hyperlinkId){a--;break}delete g.type,delete g.url,f.push(g),a++}u.valueList=be(f,e),c=u}}else if(c.type===D.DATE){const h=c.dateId;if(h){const u={type:D.DATE,value:"",dateFormat:c.dateFormat},f=[];for(;a<s.length;){const g=s[a];if(h!==g.dateId){a--;break}delete g.type,delete g.dateFormat,f.push(g),a++}u.valueList=be(f,e),c=u}}else if(c.controlId){const h=c.controlId;if(c.controlComponent===E.PREFIX){const u=[];let f=!1,g=a;for(;g<s.length;){const R=s[g];if(h!==R.controlId)break;R.controlComponent===E.VALUE&&(delete R.control,delete R.controlId,u.push(R)),R.controlComponent===E.POSTFIX&&(f=!0),g++}if(f){const R=Lt(c,ai),p=B(B({},c.control),R),M=oe(B({},Lt(c,Wi)),{type:D.CONTROL,value:"",control:p,controlId:h});M.control.value=be(u,e),c=ji(M,{extraPickAttrs:t}),a+=g-a-1}}if(c.controlComponent&&(delete c.control,delete c.controlId,c.controlComponent!==E.VALUE&&c.controlComponent!==E.PRE_TEXT&&c.controlComponent!==E.POST_TEXT)){a++;continue}}const d=ji(c,{extraPickAttrs:t});if(!c.type||c.type===D.TEXT||c.type===D.SUBSCRIPT||c.type===D.SUPERSCRIPT)for(;a<s.length;){const h=s[a+1];if(a++,h&&yf(d,ji(h,{extraPickAttrs:t}))){const u=h.value===j?`
68
+ `:h.value;d.value+=u}else break}else a++;l.push(d)}return l}function Vf(r){switch(window.getComputedStyle(r).textAlign){case"left":case"start":return Re.LEFT;case"center":return Re.CENTER;case"right":case"end":return Re.RIGHT;case"justify":return Re.ALIGNMENT;case"justify-all":return Re.JUSTIFY;default:return Re.LEFT}}function Qr(r){return r===Re.ALIGNMENT?"justify":r}function Ff(r){switch(r){case Re.LEFT:return"flex-start";case Re.CENTER:return"center";case Re.RIGHT:return"flex-end";case Re.ALIGNMENT:case Re.JUSTIFY:return"space-between";default:return"flex-start"}}function Kr(r){return!r.type||yt.includes(r.type)}function Ms(r,e){const t=r[e];if(!t)return null;const i=r[e+1];return!t.listId&&t.value===j&&i&&i.value!==j&&t.areaId===i.areaId?i:t}function $e(r,e,t,i){var n,s,l;let a=Ms(r,t);if(!a)return;const{isBreakWhenWrap:c=!1,editorOptions:d}=i||{},{mode:h}=d||{};h!==ce.DESIGN&&((n=a.title)!=null&&n.disabled)&&(a=Qt(a,Fo));let u=!1;for(let f=0;f<e.length;f++){const g=e[f];if(c&&!a.listId&&Po.test(g.value)&&(u=!0),u||!a.listId&&g.type===D.LIST){const p=[...xn,...Wi,...Ai];Ci(p,a,g),(s=g.valueList)==null||s.forEach(M=>{Ci(p,a,M)});continue}(l=g.valueList)!=null&&l.length&&$e(r,g.valueList,t,i);const R=[...Xr];qi(g)||R.push(...Wi),Ci(R,a,g)}}function Xf(r,e){let t="span";r.type===D.SUPERSCRIPT?t="sup":r.type===D.SUBSCRIPT&&(t="sub");const i=document.createElement(t);return i.style.fontFamily=r.font||e.defaultFont,r.rowFlex&&(i.style.textAlign=Qr(r.rowFlex)),r.color&&(i.style.color=r.color),r.bold&&(i.style.fontWeight="600"),r.italic&&(i.style.fontStyle="italic"),i.style.fontSize=`${r.size||e.defaultSize}px`,r.highlight&&(i.style.backgroundColor=r.highlight),r.underline&&(i.style.textDecoration="underline"),r.strikeout&&(i.style.textDecoration+=" line-through"),i.innerText=r.value.replace(new RegExp(`${j}`,"g"),`
69
+ `),i}function Hr(r){let e=0;const t=new Map;for(let i=0;i<r.length;i++){const n=r[i];if(i===0){if(n.checkbox)continue;n.value=n.value.replace(Po,"")}if(n.listWrap){const s=t.get(e)||[];s.push(n),t.set(e,s)}else{const s=n.value.split(`
70
+ `);for(let l=0;l<s.length;l++){l>0&&(e+=1);const a=s[l],c=t.get(e)||[];c.push(oe(B({},n),{value:a})),t.set(e,c)}}}return t}function Cf(r){var e;const t=[];if(!r.length)return t;let i=((e=r[0])==null?void 0:e.rowFlex)||null;t.push({rowFlex:i,data:[r[0]]});for(let n=1;n<r.length;n++){const s=r[n],l=s.rowFlex||null;i===l&&!qi(s)&&!qi(r[n-1])?t[t.length-1].data.push(s):(t.push({rowFlex:l,data:[s]}),i=l)}for(let n=0;n<t.length;n++){const s=t[n];s.data=be(s.data)}return t}function yn(r,e){const t=Zo(e);function i(l){var a,c,d,h,u,f,g,R,p,M,S,b;const P=document.createElement("div");for(let N=0;N<l.length;N++){const m=l[N];if(m.type===D.TABLE){const T=document.createElement("table");T.setAttribute("cellSpacing","0"),T.setAttribute("cellpadding","0"),T.setAttribute("border","0");const y="1px solid #000000";!m.borderType||m.borderType===ut.ALL?(T.style.borderTop=y,T.style.borderLeft=y):m.borderType===ut.EXTERNAL&&(T.style.border=y),T.style.width=`${m.width}px`;const x=document.createElement("colgroup");for(let V=0;V<m.colgroup.length;V++){const F=m.colgroup[V],L=document.createElement("col");L.setAttribute("width",`${F.width}`),x.append(L)}T.append(x);const I=m.trList;for(let V=0;V<I.length;V++){const F=document.createElement("tr"),L=I[V];F.style.height=`${L.height}px`;for(let w=0;w<L.tdList.length;w++){const v=document.createElement("td");(!m.borderType||m.borderType===ut.ALL)&&(v.style.borderBottom=v.style.borderRight="1px solid");const X=L.tdList[w];v.colSpan=X.colspan,v.rowSpan=X.rowspan,v.style.verticalAlign=X.verticalAlign||"top",(a=X.borderTypes)!=null&&a.includes(Mt.TOP)&&(v.style.borderTop=y),(c=X.borderTypes)!=null&&c.includes(Mt.RIGHT)&&(v.style.borderRight=y),(d=X.borderTypes)!=null&&d.includes(Mt.BOTTOM)&&(v.style.borderBottom=y),(h=X.borderTypes)!=null&&h.includes(Mt.LEFT)&&(v.style.borderLeft=y);const C=yn(X.value,e);v.innerHTML=C.innerHTML,X.backgroundColor&&(v.style.backgroundColor=X.backgroundColor),F.append(v)}T.append(F)}P.append(T)}else if(m.type===D.HYPERLINK){const T=document.createElement("a");T.innerText=m.valueList.map(y=>y.value).join(""),m.url&&(T.href=m.url),P.append(T)}else if(m.type===D.TITLE){const T=document.createElement(`h${Do[m.level]}`),y=i(m.valueList);T.innerHTML=y.innerHTML,P.append(T)}else if(m.type===D.LIST){const T=document.createElement(cf[m.listType]);m.listStyle&&(T.style.listStyleType=df[m.listStyle]);const y=be(m.valueList);Hr(y).forEach(I=>{const V=document.createElement("li"),F=i(I);V.innerHTML=F.innerHTML,T.append(V)}),P.append(T)}else if(m.type===D.IMAGE){const T=document.createElement("img");m.value&&(T.src=m.value,T.width=m.width,T.height=m.height),P.append(T)}else if(m.type===D.BLOCK){if(((u=m.block)==null?void 0:u.type)===_t.VIDEO){const T=(f=m.block.videoBlock)==null?void 0:f.src;if(T){const y=document.createElement("video");y.style.display="block",y.controls=!0,y.src=T,y.width=m.width||e?.width||window.innerWidth,y.height=m.height,P.append(y)}}else if(((g=m.block)==null?void 0:g.type)===_t.IFRAME){const{src:T,srcdoc:y}=m.block.iframeBlock||{};if(T||y){const x=document.createElement("iframe");x.sandbox.add(...Co.sandbox),x.style.display="block",x.style.border="none",T?x.src=T:y&&(x.srcdoc=y),x.width=`${m.width||e?.width||window.innerWidth}`,x.height=`${m.height}`,P.append(x)}}}else if(m.type===D.SEPARATOR){const T=document.createElement("hr");P.append(T)}else if(m.type===D.CHECKBOX){const T=document.createElement("input");T.type="checkbox",(R=m.checkbox)!=null&&R.value&&T.setAttribute("checked","true"),P.append(T)}else if(m.type===D.RADIO){const T=document.createElement("input");T.type="radio",(p=m.radio)!=null&&p.value&&T.setAttribute("checked","true"),P.append(T)}else if(m.type===D.TAB){const T=document.createElement("span");T.innerHTML=`${Or}${Or}`,P.append(T)}else if(m.type===D.CONTROL){const T=document.createElement("span"),y=i(((M=m.control)==null?void 0:M.value)||[]);T.innerHTML=y.innerHTML,P.append(T)}else if(!m.type||m.type===D.LATEX||yt.includes(m.type)){let T="";if(m.type===D.DATE?T=((S=m.valueList)==null?void 0:S.map(x=>x.value).join(""))||"":T=m.value,!T)continue;const y=Xf(m,t);((b=l[N-1])==null?void 0:b.type)===D.TITLE&&(T=T.replace(/^\n/,"")),y.innerText=T.replace(new RegExp(`${j}`,"g"),`
71
+ `),P.append(y)}}return P}const n=document.createElement("div"),s=Cf(r);for(let l=0;l<s.length;l++){const a=s[l],c=!a.rowFlex||a.rowFlex===Re.LEFT,d=document.createElement("div");if(!c){const h=a.data[0];qi(h)?(d.style.display="flex",d.style.justifyContent=Ff(h.rowFlex)):d.style.textAlign=Qr(a.rowFlex)}d.innerHTML=i(a.data).innerHTML,c?d.childNodes.forEach(h=>{n.append(h.cloneNode(!0))}):n.append(d)}return n}function vf(r){if(!r||r.nodeType!==3)return null;const e=r.parentNode,t=e.nodeName==="FONT"?e.parentNode:e,i=Vf(t),n=r.textContent,s=window.getComputedStyle(t);if(!n||t.nodeName==="STYLE")return null;const l={value:n,color:s.color,bold:Number(s.fontWeight)>500,italic:s.fontStyle.includes("italic"),size:Math.floor(parseFloat(s.fontSize))};return t.nodeName==="SUB"||s.verticalAlign==="sub"?l.type=D.SUBSCRIPT:(t.nodeName==="SUP"||s.verticalAlign==="super")&&(l.type=D.SUPERSCRIPT),i!==Re.LEFT&&(l.rowFlex=i),s.backgroundColor!=="rgba(0, 0, 0, 0)"&&(l.highlight=s.backgroundColor),s.textDecorationLine.includes("underline")&&(l.underline=!0),s.textDecorationLine.includes("line-through")&&(l.strikeout=!0),l}function Vn(r,e){const t=[];function i(l){if(l.nodeType===3){const a=vf(l);a&&t.push(a)}else if(l.nodeType===1){const a=l.childNodes;for(let c=0;c<a.length;c++){const d=a[c];if(d.nodeName==="BR")t.push({value:`
72
+ `});else if(d.nodeName==="A"){const h=d,u=h.innerText;u&&t.push({type:D.HYPERLINK,value:"",valueList:[{value:u}],url:h.href})}else if(/H[1-6]/.test(d.nodeName)){const u=Vn(Wf(d,"div").outerHTML,e);t.push({value:"",type:D.TITLE,level:uf[d.nodeName],valueList:u}),d.nextSibling&&!$u.includes(d.nextSibling.nodeName)&&t.push({value:`
73
+ `})}else if(d.nodeName==="UL"||d.nodeName==="OL"){const h=d,u={value:"",type:D.LIST,valueList:[]};d.nodeName==="OL"?u.listType=Gt.OL:(u.listType=Gt.UL,u.listStyle=h.style.listStyleType),h.querySelectorAll("li").forEach(f=>{const g=Vn(f.innerHTML,e);g.forEach(R=>{R.value===`
74
+ `&&(R.listWrap=!0)}),g.unshift({value:`
75
+ `}),u.valueList.push(...g)}),t.push(u)}else if(d.nodeName==="HR")t.push({value:`
76
+ `,type:D.SEPARATOR});else if(d.nodeName==="IMG"){const{src:h,width:u,height:f}=d;h&&u&&f&&t.push({width:u,height:f,value:h,type:D.IMAGE})}else if(d.nodeName==="VIDEO"){const{src:h,width:u,height:f}=d;h&&u&&f&&t.push({value:"",type:D.BLOCK,block:{type:_t.VIDEO,videoBlock:{src:h}},width:u,height:f})}else if(d.nodeName==="IFRAME"){const{src:h,srcdoc:u,width:f,height:g}=d;(h||u)&&f&&g&&t.push({value:"",type:D.BLOCK,block:{type:_t.IFRAME,iframeBlock:{src:h,srcdoc:u}},width:parseInt(f),height:parseInt(g)})}else if(d.nodeName==="TABLE"){const h=d,u={type:D.TABLE,value:`
77
+ `,colgroup:[],trList:[]};if(h.querySelectorAll("tr").forEach(f=>{const g=window.getComputedStyle(f).height.replace("px",""),R={height:Number(g),tdList:[]};f.querySelectorAll("th,td").forEach(p=>{const M=p,S=Vn(M.innerHTML,e),b={colspan:M.colSpan,rowspan:M.rowSpan,value:S};M.style.backgroundColor&&(b.backgroundColor=M.style.backgroundColor),R.tdList.push(b)}),u.trList.push(R)}),u.trList.length){const f=u.trList[0].tdList.reduce((R,p)=>R+p.colspan,0),g=Math.ceil(e.innerWidth/f);for(let R=0;R<f;R++)u.colgroup.push({width:g});t.push(u)}}else d.nodeName==="INPUT"&&d.type===E.CHECKBOX?t.push({type:D.CHECKBOX,value:"",checkbox:{value:d.checked}}):d.nodeName==="INPUT"&&d.type===E.RADIO?t.push({type:D.RADIO,value:"",radio:{value:d.checked}}):(i(d),d.nodeType===1&&c!==a.length-1&&window.getComputedStyle(d).display==="block"&&t.push({value:`
78
+ `}))}}}const n=document.createElement("div");n.innerHTML=r,document.body.appendChild(n);const s=[];return n.childNodes.forEach(l=>{var a;l.nodeType!==1&&!((a=l.textContent)!=null&&a.trim())&&s.push(l)}),s.forEach(l=>l.remove()),i(n),n.remove(),t}function Fn(r){function e(t){var i,n,s,l,a,c,d;let h="";for(let u=0;u<t.length;u++){const f=t[u];if(f.type===D.TABLE){h+=`
79
+ `;const g=f.trList;for(let R=0;R<g.length;R++){const p=g[R];for(let M=0;M<p.tdList.length;M++){const S=p.tdList[M],b=e(be(S.value)),P=M===0,N=p.tdList.length-1===M;h+=`${P?"":" "}${b}${N?`
80
+ `:""}`}}}else if(f.type===D.TAB)h+=" ";else if(f.type===D.HYPERLINK)h+=f.valueList.map(g=>g.value).join("");else if(f.type===D.TITLE)h+=`${e(be(f.valueList))}`;else if(f.type===D.LIST){const g=be(f.valueList),R=Hr(g);let p="";f.listType===Gt.UL&&(p=ko[f.listStyle]),R.forEach((M,S)=>{const b=R.size-1===S;h+=`
81
+ ${p||`${S+1}.`}${e(M)}${b?`
82
+ `:""}`})}else if(f.type===D.CHECKBOX)h+=(i=f.checkbox)!=null&&i.value?"☑":"□";else if(f.type===D.RADIO)h+=(n=f.radio)!=null&&n.value?"☉":"○";else if(!f.type||f.type===D.LATEX||yt.includes(f.type)){let g="";if(f.type===D.CONTROL){const R=((l=(s=f.control.value)==null?void 0:s[0])==null?void 0:l.value)||"";g=R?`${((a=f.control)==null?void 0:a.preText)||""}${R}${((c=f.control)==null?void 0:c.postText)||""}`:""}else f.type===D.DATE?g=((d=f.valueList)==null?void 0:d.map(R=>R.value).join(""))||"":g=f.value;h+=g.replace(new RegExp(`${j}`,"g"),`
83
+ `)}}return h}return e(be(r))}function Yo(r){return To(r,["metrics","style"])}function qi(r){return!!r?.type&&(zu.includes(r.type)||r.imgDisplay===re.INLINE)}function Wf(r,e){const t=document.createElement(e);for(let i=0;i<r.attributes.length;i++){const n=r.attributes[i];t.setAttribute(n.name,n.value)}return t.innerHTML=r.innerHTML,t}function Br(r){const e=[];for(let t=0;t<r.length;t++){const i=r[t];i.imgDisplay===re.SURROUND&&e.push(i)}return e}function kf(r,e){var t;for(let i=r.length-1;i>=0;i--)((t=r[i].imgFloatPosition)==null?void 0:t.pageNo)===e&&r.splice(i,1)}function Xn(r,e,t=pt.BEFORE){var i,n,s,l,a,c,d,h,u,f,g,R;if(!((n=(i=r[e])==null?void 0:i.control)!=null&&n.hide)&&!((l=(s=r[e])==null?void 0:s.area)!=null&&l.hide))return e;let p=e;if(t===pt.BEFORE)for(p=e-1;p>0;){if(!((c=(a=r[p])==null?void 0:a.control)!=null&&c.hide)&&!((h=(d=r[p])==null?void 0:d.area)!=null&&h.hide))return p;p--}else for(p=e+1;p<r.length;){if(!((f=(u=r[p])==null?void 0:u.control)!=null&&f.hide)&&!((R=(g=r[p])==null?void 0:g.area)!=null&&R.hide))return p;p++}return p}function Df(r){localStorage.setItem(yo,JSON.stringify({text:r.text,elementList:r.elementList}))}function Gr(){const r=localStorage.getItem(yo);return r?JSON.parse(r):null}function _r(){localStorage.removeItem(yo)}function Ef(r,e,t){if(!r&&!e&&!t.length)return;const i=new Blob([r],{type:"text/plain"}),n=new Blob([e],{type:"text/html"});if(window.ClipboardItem){const s=new ClipboardItem({[i.type]:i,[n.type]:n});window.navigator.clipboard.write([s])}else{const s=document.createElement("div");s.setAttribute("contenteditable","true"),s.innerHTML=e,document.body.append(s);const l=window.getSelection(),a=document.createRange(),c=document.createElement("span");c.innerText=`
84
+ `,s.append(c),a.selectNodeContents(s),l?.removeAllRanges(),l?.addRange(a),document.execCommand("copy"),s.remove()}Df({text:r,elementList:t})}function Ar(r,e){const t=yn(r,e);document.body.append(t);const i=t.innerText;t.remove();const n=t.innerHTML;!i&&!n&&!r.length||Ef(i,n,be(r))}function Uf(r){let e=!1;for(let t=0;t<r.items.length;t++)if(r.items[t].kind==="file"){e=!0;break}return e}function Qo(r,e){const t=r.getDraw();if(t.isReadonly()||t.isDisabled()||t.getControl().getIsDisabledPasteControl())return;const i=t.getRange(),{startIndex:n}=i.getRange(),s=t.getElementList();if(~n&&!i.getIsSelectAll()){const l=s[n];if(l?.titleId||l?.listId){let a=0;for(;a<e.length;){const c=e[a];if(l.titleId&&/^\n/.test(c.value))break;if(ju.includes(c.type)){if(e.splice(a,1),c.valueList)for(let d=0;d<c.valueList.length;d++){const h=c.valueList[d];h.value===j||h.value===`
85
+ `||(e.splice(a,0,h),a++)}a--}a++}}$e(s,e,n,{isBreakWhenWrap:!0,editorOptions:t.getOptions()})}t.insertElementList(e)}function Jr(r,e){const t=r.getDraw();if(t.isReadonly()||t.isDisabled())return;const i=Vn(e,{innerWidth:t.getOriginalInnerWidth()});Qo(r,i)}function Ko(r,e){const t=r.getDraw();if(t.isReadonly()||t.isDisabled())return;const i=t.getRange(),{startIndex:n}=i.getRange(),s=t.getElementList(),l=new FileReader;l.readAsDataURL(e),l.onload=()=>{const a=new Image,c=l.result;a.src=c,a.onload=()=>{const d={value:c,type:D.IMAGE,width:a.width,height:a.height};~n&&$e(s,[d],n,{editorOptions:t.getOptions()}),t.insertElementList([d])}}}function Zf(r,e){const t=r.getDraw();if(t.isReadonly()||t.isDisabled())return;const i=e.clipboardData;if(!i)return;const{paste:n}=t.getOverride();if(n){const l=n(e);if(l?.preventDefault!==!1)return}if(!Uf(i)){const l=i.getData("text"),a=Gr();if(a&&Fr(l)===Fr(a.text)){Qo(r,a.elementList);return}}_r();let s=!1;for(let l=0;l<i.items.length;l++)if(i.items[l].type==="text/html"){s=!0;break}for(let l=0;l<i.items.length;l++){const a=i.items[l];if(a.kind==="string"){if(a.type==="text/plain"&&!s){a.getAsString(c=>{r.input(c)});break}if(a.type==="text/html"&&s){a.getAsString(c=>{Jr(r,c)});break}}else if(a.kind==="file"&&a.type.includes("image")){const c=a.getAsFile();c&&Ko(r,c)}}}async function Yf(r,e){const t=r.getDraw();if(t.isReadonly()||t.isDisabled())return;const{paste:i}=t.getOverride();if(i){const l=i();if(l?.preventDefault!==!1)return}const n=await navigator.clipboard.readText(),s=Gr();if(n===s?.text){Qo(r,s.elementList);return}if(_r(),e?.isPlainText)n&&r.input(n);else{const l=await navigator.clipboard.read();let a=!1;for(const c of l)if(c.types.includes("text/html")){a=!0;break}for(const c of l)if(c.types.includes("text/plain")&&!a){const h=await(await c.getType("text/plain")).text();h&&r.input(h)}else if(c.types.includes("text/html")&&a){const h=await(await c.getType("text/html")).text();h&&Jr(r,h)}else if(c.types.some(d=>d.startsWith("image/"))){const d=c.types.find(u=>u.startsWith("image/")),h=await c.getType(d);Ko(r,h)}}}class Qf{constructor(e,t){O(this,"draw"),O(this,"container"),O(this,"agentCursorDom"),O(this,"canvasEvent"),O(this,"eventBus"),this.draw=e,this.container=e.getContainer(),this.canvasEvent=t,this.eventBus=e.getEventBus();const i=document.createElement("textarea");i.autocomplete="off",i.classList.add(`${ie}-inputarea`),i.innerText="",this.container.append(i),this.agentCursorDom=i,i.onkeydown=n=>this._keyDown(n),i.oninput=Tr(this._input.bind(this),0),i.onpaste=n=>this._paste(n),i.addEventListener("compositionstart",this._compositionstart.bind(this)),i.addEventListener("compositionend",this._compositionend.bind(this))}getAgentCursorDom(){return this.agentCursorDom}_keyDown(e){this.canvasEvent.keydown(e)}_input(e){const t=e.data;t&&this.canvasEvent.input(t),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",e)}_paste(e){this.draw.isReadonly()||!e.clipboardData||(Zf(this.canvasEvent,e),e.preventDefault())}_compositionstart(){this.canvasEvent.compositionstart()}_compositionend(e){this.canvasEvent.compositionend(e)}}class Kf{constructor(e,t){O(this,"ANIMATION_CLASS",`${ie}-cursor--animation`),O(this,"draw"),O(this,"container"),O(this,"options"),O(this,"position"),O(this,"cursorDom"),O(this,"cursorAgent"),O(this,"blinkTimeout"),O(this,"hitLineStartIndex"),this.draw=e,this.container=e.getContainer(),this.position=e.getPosition(),this.options=e.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${ie}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new Qf(e,t),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}getHitLineStartIndex(){return this.hitLineStartIndex}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}focus(){if(Bu&&this.draw.isReadonly())return;const e=this.cursorAgent.getAgentCursorDom();document.activeElement!==e&&(e.focus(),e.setSelectionRange(0,0))}drawCursor(e){let t=this.position.getCursorPosition();if(!t)return;const{scale:i,cursor:n}=this.options,{color:s,width:l,isShow:a=!0,isBlink:c=!0,isFocus:d=!0,hitLineStartIndex:h}=B(B({},n),e),u=this.draw.getHeight(),f=this.draw.getPageGap();this.hitLineStartIndex=h,h&&(t=this.position.getPositionList()[h]);const{metrics:g,coordinate:{leftTop:R,rightTop:p},ascent:M,pageNo:S}=t,N=(this.draw.getZone().isMainActive()?S:this.draw.getPageNo())*(u+f),m=Qu*i,T=Math.min(g.height/4,m),y=g.height+T*2,x=this.cursorAgent.getAgentCursorDom();d&&setTimeout(()=>{this.focus()});const I=g.boundingBoxDescent<0?0:g.boundingBoxDescent,V=R[1]+M+I-(y-T)+N,F=h?R[0]:p[0];if(x.style.left=`${F}px`,x.style.top=`${V+y-m}px`,!a){this.recoveryCursor();return}const L=this.draw.isReadonly();this.cursorDom.style.width=`${l*i}px`,this.cursorDom.style.backgroundColor=s,this.cursorDom.style.left=`${F}px`,this.cursorDom.style.top=`${V}px`,this.cursorDom.style.display=L?"none":"block",this.cursorDom.style.height=`${y}px`,c?this._setBlinkTimeout():this._clearBlinkTimeout()}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(e){const{cursorPosition:t,direction:i}=e;if(!t||!i)return;const{pageNo:n,coordinate:{leftTop:s,leftBottom:l}}=t,a=n*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,c=i===He.UP,d=l[0],h=c?s[1]+a:l[1]+a,u=Uu(this.container),f={left:0,right:0,top:0,bottom:0};if(u===document.documentElement)f.right=window.innerWidth,f.bottom=window.innerHeight;else{const{left:R,right:p,top:M,bottom:S}=u.getBoundingClientRect();f.left=R,f.right=p,f.top=M,f.bottom=S}const{maskMargin:g}=this.options;if(f.top+=g[0],f.bottom-=g[2],!(d>=f.left&&d<=f.right&&h>=f.top&&h<=f.bottom)){const{scrollLeft:R,scrollTop:p}=u;c?u.scroll(R,p-(f.top-h)):u.scroll(R,p+h-f.bottom)}}}var Ho;(function(r){r[r.LEFT=0]="LEFT",r[r.CENTER=1]="CENTER",r[r.RIGHT=2]="RIGHT"})(Ho||(Ho={}));function Jt(r){return vi?r.metaKey:r.ctrlKey}var le;(function(r){r.Delete="Delete",r.Backspace="Backspace",r.Enter="Enter",r.Left="ArrowLeft",r.Right="ArrowRight",r.Up="ArrowUp",r.Down="ArrowDown",r.ESC="Escape",r.TAB="Tab",r.META="Meta",r.LEFT_BRACKET="[",r.RIGHT_BRACKET="]",r.COMMA=",",r.PERIOD=".",r.LEFT_ANGLE_BRACKET="<",r.RIGHT_ANGLE_BRACKET=">",r.EQUAL="=",r.MINUS="-",r.PLUS="+",r.A="a",r.B="b",r.C="c",r.D="d",r.E="e",r.F="f",r.G="g",r.H="h",r.I="i",r.J="j",r.K="k",r.L="l",r.M="m",r.N="n",r.O="o",r.P="p",r.Q="q",r.R="r",r.S="s",r.T="t",r.U="u",r.V="v",r.W="w",r.X="x",r.Y="y",r.Z="z",r.A_UPPERCASE="A",r.B_UPPERCASE="B",r.C_UPPERCASE="C",r.D_UPPERCASE="D",r.E_UPPERCASE="E",r.F_UPPERCASE="F",r.G_UPPERCASE="G",r.H_UPPERCASE="H",r.I_UPPERCASE="I",r.J_UPPERCASE="J",r.K_UPPERCASE="K",r.L_UPPERCASE="L",r.M_UPPERCASE="M",r.N_UPPERCASE="N",r.O_UPPERCASE="O",r.P_UPPERCASE="P",r.Q_UPPERCASE="Q",r.R_UPPERCASE="R",r.S_UPPERCASE="S",r.T_UPPERCASE="T",r.U_UPPERCASE="U",r.V_UPPERCASE="V",r.W_UPPERCASE="W",r.X_UPPERCASE="X",r.Y_UPPERCASE="Y",r.Z_UPPERCASE="Z",r.ZERO="0",r.ONE="1",r.TWO="2",r.THREE="3",r.FOUR="4",r.FIVE="5",r.SIX="6",r.SEVEN="7",r.EIGHT="8",r.NINE="9"})(le||(le={}));class Ns{constructor(e,t){O(this,"element"),O(this,"control"),this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getCode(){var e;return((e=this.element.control)==null?void 0:e.code)||null}getValue(){const e=this.control.getElementList(),{startIndex:t}=this.control.getRange(),i=e[t],n=[];let s=t;for(;s>0;){const a=e[s];if(a.controlId!==i.controlId||a.controlComponent===E.PREFIX||a.controlComponent===E.PRE_TEXT)break;a.controlComponent===E.VALUE&&n.unshift(a),s--}let l=t+1;for(;l<e.length;){const a=e[l];if(a.controlId!==i.controlId||a.controlComponent===E.POSTFIX||a.controlComponent===E.POST_TEXT)break;a.controlComponent===E.VALUE&&n.push(a),l++}return n}setValue(){return-1}setSelect(e,t={},i={}){if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const{control:n}=this.element,s=t.elementList||this.control.getElementList(),{startIndex:l}=t.range||this.control.getRange(),a=s[l];let c=l;for(;c>0;){const h=s[c];if(h.controlId!==a.controlId||h.controlComponent===E.PREFIX||h.controlComponent===E.PRE_TEXT)break;if(h.controlComponent===E.CHECKBOX){const u=h.checkbox;u.value=e.includes(u.code)}c--}let d=l+1;for(;d<s.length;){const h=s[d];if(h.controlId!==a.controlId||h.controlComponent===E.POSTFIX||h.controlComponent===E.POST_TEXT)break;if(h.controlComponent===E.CHECKBOX){const u=h.checkbox;u.value=e.includes(u.code)}d++}n.code=e.join(","),this.control.repaintControl({curIndex:l,isSetCursor:!1}),this.control.emitControlContentChange({context:t})}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:n}=t;return e.key===le.Backspace||e.key===le.Delete?this.control.removeControl(i):n}cut(){return-1}}class Bo extends Ns{setSelect(e,t={},i={}){if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const{control:n}=this.element,s=t.elementList||this.control.getElementList(),{startIndex:l}=t.range||this.control.getRange(),a=s[l];let c=l;for(;c>0;){const h=s[c];if(h.controlId!==a.controlId||h.controlComponent===E.PREFIX||h.controlComponent===E.PRE_TEXT)break;if(h.controlComponent===E.RADIO){const u=h.radio;u.value=e.includes(u.code)}c--}let d=l+1;for(;d<s.length;){const h=s[d];if(h.controlId!==a.controlId||h.controlComponent===E.POSTFIX||h.controlComponent===E.POST_TEXT)break;if(h.controlComponent===E.RADIO){const u=h.radio;u.value=e.includes(u.code)}d++}n.code=e.join(","),this.control.repaintControl({curIndex:l,isSetCursor:!1}),this.control.emitControlContentChange({context:t})}}function zr(r){const e=r.getDraw(),t=e.getPosition(),i=e.getRange();r.isAllowDrag=!0,r.cacheRange=Ne(i.getRange()),r.cacheElementList=e.getElementList(),r.cachePositionList=t.getPositionList(),r.cachePositionContext=t.getPositionContext()}function $r(r,e){const{checkbox:t,control:i}=r;if(!i)e.getCheckboxParticle().setSelect(r);else{const n=i?.code?i.code.split(","):[];if(t?.value){const l=n.findIndex(a=>a===t.code);n.splice(l,1)}else t?.code&&n.push(t.code);const s=e.getControl().getActiveControl();s instanceof Ns&&s.setSelect(n)}}function jr(r,e){const{radio:t,control:i}=r;if(!i)e.getRadioParticle().setSelect(r);else{const n=t?.code?[t.code]:[],s=e.getControl().getActiveControl();s instanceof Bo&&s.setSelect(n)}}function Hf(r,e){var t,i;const n=e.getDraw(),s=n.isReadonly(),l=n.getRange(),a=n.getPosition(),c=l.getRange();if(r.button===Ho.RIGHT&&(c.isCrossRowCol||!l.getIsCollapsed()))return;if(!e.isAllowDrag&&!s&&c.startIndex!==c.endIndex&&l.getIsPointInRange(r.offsetX,r.offsetY)){zr(e);return}const h=r.target.dataset.index;h&&n.setPageNo(Number(h)),e.isAllowSelection=!0;const u=Ne(a.getPositionContext()),f=a.adjustPositionContext({x:r.offsetX,y:r.offsetY});if(!f)return;const{index:g,isDirectHit:R,isCheckbox:p,isRadio:M,isImage:S,isTable:b,tdValueIndex:P,hitLineStartIndex:N}=f;e.mouseDownStartPosition=oe(B({},f),{index:b?P:g,x:r.offsetX,y:r.offsetY});const m=n.getElementList(),T=a.getPositionList(),y=b?P:g,x=m[y],I=!!(R&&S),V=!!(R&&p),F=!!(R&&M);if(~g){let C=y,Z=y;if(r.shiftKey){const{startIndex:k}=l.getRange();~k&&a.getPositionContext().tdId===u.tdId&&(y>k?C=k:Z=k)}if(l.setRange(C,Z),a.setCursorPosition(T[y]),V&&!s)$r(x,n);else if(F&&!s)jr(x,n);else if(x.controlComponent===E.VALUE&&(((t=x.control)==null?void 0:t.type)===he.CHECKBOX||((i=x.control)==null?void 0:i.type)===he.RADIO)){let k=y;for(;k>0;){const Q=m[k];if(Q.controlComponent===E.CHECKBOX){$r(Q,n);break}else if(Q.controlComponent===E.RADIO){jr(Q,n);break}k--}}else n.render({curIndex:y,isCompute:!1,isSubmitHistory:!1,isSetCursor:!I&&!V&&!F});N&&e.getDraw().getCursor().drawCursor({hitLineStartIndex:N})}const L=n.getPreviewer();if(L.clearResizer(),I){const C={dragDisable:s||!x.controlId&&n.getMode()===ce.FORM};x.type===D.LATEX&&(C.mime="svg",C.srcKey="laTexSVG"),L.drawResizer(x,T[y],C),n.getCursor().drawCursor({isShow:!1}),zr(e),(x.imgDisplay===re.SURROUND||x.imgDisplay===re.FLOAT_TOP||x.imgDisplay===re.FLOAT_BOTTOM)&&n.getImageParticle().createFloatImage(x);const Z=n.getEventBus();Z.isSubscribe("imageMousedown")&&Z.emit("imageMousedown",{evt:r,element:x})}const w=n.getTableTool();w.dispose(),b&&!s&&n.getMode()!==ce.FORM&&w.render();const v=n.getHyperlinkParticle();v.clearHyperlinkPopup(),x.type===D.HYPERLINK&&(Jt(r)?v.openHyperlink(x):v.drawHyperlinkPopup(x,T[y]));const X=n.getDateParticle();X.clearDatePicker(),x.type===D.DATE&&!s&&X.renderDatePicker(x,T[y])}function bs(r){const e=pe();return Reflect.set(r,"dragId",e),e}function Ls(r,e){return e.findIndex(t=>t.dragId===r)}function qr(r,e,t){const i=t.getDraw();if(r.imgDisplay===re.SURROUND||r.imgDisplay===re.FLOAT_TOP||r.imgDisplay===re.FLOAT_BOTTOM){const n=e.offsetX-t.mouseDownStartPosition.x,s=e.offsetY-t.mouseDownStartPosition.y,l=r.imgFloatPosition;r.imgFloatPosition={x:l.x+n,y:l.y+s,pageNo:i.getPageNo()}}i.getImageParticle().destroyFloatImage()}function Bf(r,e){var t,i,n,s,l,a;if(e.isAllowDrop){const c=e.getDraw();if(c.isReadonly()||c.isDisabled()){e.mousedown(r);return}const d=c.getPosition(),h=d.getPositionList(),u=d.getPositionContext(),f=c.getRange(),g=e.cacheRange,R=e.cacheElementList,p=e.cachePositionList,M=e.cachePositionContext,S=f.getRange(),b=g.startIndex===g.endIndex,P=b?g.startIndex-1:g.startIndex,N=g.endIndex;if(S.startIndex>=P&&S.endIndex<=N&&((t=e.cachePositionContext)==null?void 0:t.tdId)===u.tdId){c.clearSideEffect();let ve=!1,Ie=!1;if(b){const me=R[N];if(me.type===D.IMAGE||me.type===D.LATEX){if(qr(me,r,e),me.imgDisplay===re.SURROUND||me.imgDisplay===re.FLOAT_TOP||me.imgDisplay===re.FLOAT_BOTTOM)c.getPreviewer().drawResizer(me),ve=!0;else{const Se=p[N];c.getPreviewer().drawResizer(me,Se)}Ie=me.imgDisplay===re.SURROUND}}f.replaceRange(B({},g)),c.render({isCompute:Ie,isSubmitHistory:ve,isSetCursor:!1});return}const m=R.slice(P+1,N+1),T=m.find(ve=>ve.controlId);if(T){const ve=R[P+1],Ie=R[N];if(!((!ve.controlId||ve.controlComponent===E.PREFIX)&&(!Ie.controlId||Ie.controlComponent===E.POSTFIX)||ve.controlId===Ie.controlId&&ve.controlComponent===E.PREFIX&&Ie.controlComponent===E.POSTFIX||((i=ve.control)==null?void 0:i.type)===he.TEXT&&ve.controlComponent===E.VALUE&&((n=Ie.control)==null?void 0:n.type)===he.TEXT&&Ie.controlComponent===E.VALUE)){c.render({curIndex:S.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const y=c.getControl(),x=c.getElementList(),I=!T||!!x[S.startIndex].controlId||!y.getIsElementListContainFullControl(m),V=c.getOptions(),F=m.map(ve=>{if(!ve.type||ve.type===D.TEXT){const Ie={value:ve.value},me=Kt;return I||me.push(...Xo),me.forEach(Se=>{const A=ve[Se];A!==void 0&&(Ie[Se]=A)}),Ie}else{let Ie=Ne(ve);return I&&(Ie=Qt(Ie,Xo)),tt([Ie],{isHandleFirstElement:!1,editorOptions:V}),Ie}});$e(x,F,S.startIndex,{editorOptions:c.getOptions()});const L=R[P],w=p[P],v=bs(R[P]),X=bs(R[N]),C=F.length;let Z=S.startIndex,k=Z+C;const Q=y.getActiveControl();if(Q&&R[Z].controlComponent!==E.POSTFIX?(k=Q.setValue(F),Z=k-C):c.spliceElementList(x,Z+1,0,F),!~k){c.render({isSetCursor:!1});return}const Y=bs(x[Z]),W=bs(x[k]),H=Ls(v,R),U=Ls(X,R),K=R[U];if(K.controlId&&K.controlComponent!==E.POSTFIX)f.replaceRange(oe(B({},g),{startIndex:H,endIndex:U})),(s=y.getActiveControl())==null||s.cut();else{let ve=!0;if(M?.isTable){const{tableId:Ie,trIndex:me,tdIndex:Se}=M;ve=!c.getOriginalElementList().some(It=>{var q,os,_e,ls;return It.id===Ie&&((ls=(_e=(os=(q=It?.trList)==null?void 0:q[me])==null?void 0:os.tdList)==null?void 0:_e[Se])==null?void 0:ls.deletable)===!1})}ve&&c.spliceElementList(R,H+1,U-H)}const _=x[S.startIndex],J=h[S.startIndex];let G=u.index;G&&(_.tableId&&!L.tableId?w.index<G&&(G-=C):!_.tableId&&L.tableId&&J.index<G&&(G+=C),d.setPositionContext(oe(B({},u),{index:G})));const se=Ls(Y,x),ae=Ls(W,x);f.setRange(b?ae:se,ae,S.tableId,S.startTdIndex,S.endTdIndex,S.startTrIndex,S.endTrIndex),c.clearSideEffect();let we=null;if(b){const Ie=c.getElementList()[ae];(Ie.type===D.IMAGE||Ie.type===D.LATEX)&&(qr(Ie,r,e),we=Ie)}if(c.render({isSetCursor:!1}),Q?y.emitControlContentChange():L.controlId&&y.emitControlContentChange({context:{range:g,elementList:R},controlElement:L}),we)if(we.imgDisplay===re.SURROUND||we.imgDisplay===re.FLOAT_TOP||we.imgDisplay===re.FLOAT_BOTTOM)c.getPreviewer().drawResizer(we);else{const Ie=d.getPositionList()[ae];c.getPreviewer().drawResizer(we,Ie)}}else e.isAllowDrag&&((l=e.cacheRange)==null?void 0:l.startIndex)!==((a=e.cacheRange)==null?void 0:a.endIndex)&&e.mousedown(r)}function Gf(r,e){const t=e.getDraw();if(!t.getOptions().pageOuterSelectionDisable)return;const i=t.getPageContainer(),{x:n,y:s,width:l,height:a}=i.getBoundingClientRect();r.x>=n&&r.x<=n+l&&r.y>=s&&r.y<=s+a||e.setIsAllowSelection(!1)}function _f(r,e){var t;const i=e.getDraw();if(e.isAllowDrag){const m=r.offsetX,T=r.offsetY,{startIndex:y,endIndex:x}=e.cacheRange,I=e.cachePositionList;for(let F=y+1;F<=x;F++){const{coordinate:{leftTop:L,rightBottom:w}}=I[F];if(m>=L[0]&&m<=w[0]&&T>=L[1]&&T<=w[1])return}const V=(t=e.cacheRange)==null?void 0:t.startIndex;if(V){const F=e.cacheElementList[V];F?.type===D.IMAGE&&(F.imgDisplay===re.SURROUND||F.imgDisplay===re.FLOAT_TOP||F.imgDisplay===re.FLOAT_BOTTOM)&&(i.getPreviewer().clearResizer(),i.getImageParticle().dragFloatImage(r.movementX,r.movementY))}e.dragover(r),e.isAllowDrop=!0;return}if(!e.isAllowSelection||!e.mouseDownStartPosition)return;const s=r.target.dataset.index;s&&i.setPageNo(Number(s));const a=i.getPosition().getPositionByXY({x:r.offsetX,y:r.offsetY});if(!~a.index)return;const{index:c,isTable:d,tdValueIndex:h,tdIndex:u,trIndex:f,tableId:g}=a,{index:R,isTable:p,tdIndex:M,trIndex:S,tableId:b}=e.mouseDownStartPosition,P=d?h:c,N=i.getRange();if(d&&p&&(u!==M||f!==S))N.setRange(P,P,g,M,u,S,f);else{let m=~P?P:0;if((p||d)&&b!==g)return;let T=R;if(T>m&&([T,m]=[m,T]),T===m)return;const y=i.getElementList(),x=y[T+1],I=y[m];if(x?.controlComponent===E.PLACEHOLDER&&I?.controlComponent===E.PLACEHOLDER&&x.controlId===I.controlId)return;N.setRange(T,m)}i.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function Af(r,e){var t,i;const n=e.getDraw();if(n.isReadonly())return;const s=n.getRange();if(!s.getIsCanInput())return;const l=n.getControl(),a=n.getPosition();if(s.getIsCollapsed()){const f=s.getRange(),R=n.getElementList()[f.startIndex];if((t=R.control)!=null&&t.hide||(i=R.area)!=null&&i.hide){const p=l.removeControl(f.startIndex);if(p){f.startIndex=p,f.endIndex=p,s.replaceRange(f);const M=a.getPositionList();a.setCursorPosition(M[p])}}}const{startIndex:c,endIndex:d,isCrossRowCol:h}=s.getRange();let u;if(h){const f=n.getTableParticle().getRangeRowCol();if(!f)return;let g=!1;for(let R=0;R<f.length;R++){const p=f[R];for(let M=0;M<p.length;M++){const S=p[M];S.value.length>1&&(n.spliceElementList(S.value,1,S.value.length-1),g=!0)}}u=g?0:null}else if(l.getActiveControl()&&l.getIsRangeCanCaptureEvent())u=l.keydown(r),u&&l.emitControlContentChange();else{const f=a.getCursorPosition();if(!f)return;const{index:g}=f,R=s.getIsCollapsed(),p=n.getElementList();if(R&&g===0){const S=p[g];if(S.value===j){S.listId&&n.getListParticle().unsetList(),r.preventDefault();return}}const M=p[c];if(R&&M.rowFlex&&M.value===j){const S=s.getRangeRowElementList();if(S){const b=p[c-1];S.forEach(P=>{P.rowFlex=b?.rowFlex})}}R?n.spliceElementList(p,g,1):n.spliceElementList(p,c+1,d-c),u=R?g-1:c}n.getGlobalEvent().setCanvasEventAbility(),u===null?(s.setRange(c,c),n.render({curIndex:c,isSubmitHistory:!1})):(s.setRange(u,u),n.render({curIndex:u}))}function Jf(r,e){var t,i,n;const s=e.getDraw();if(s.isReadonly())return;const l=s.getRange();if(!l.getIsCanInput())return;const{startIndex:a,endIndex:c,isCrossRowCol:d}=l.getRange(),h=s.getElementList(),u=s.getControl();if(l.getIsCollapsed()){const g=h[a+1];if((t=g?.control)!=null&&t.hide||(i=g?.area)!=null&&i.hide){const R=u.removeControl(a+1);if(R){const p=s.getPosition(),M=p.getPositionList();p.setCursorPosition(M[R])}}}let f;if(d){const g=s.getTableParticle().getRangeRowCol();if(!g)return;let R=!1;for(let p=0;p<g.length;p++){const M=g[p];for(let S=0;S<M.length;S++){const b=M[S];b.value.length>1&&(s.spliceElementList(b.value,1,b.value.length-1),R=!0)}}f=R?0:null}else if(u.getActiveControl()&&u.getIsRangeWithinControl())f=u.keydown(r),f&&u.emitControlContentChange();else if((n=h[c+1])!=null&&n.controlId)f=u.removeControl(c+1);else{const g=s.getPosition(),R=g.getCursorPosition();if(!R)return;const{index:p}=R,M=g.getPositionContext();if(M.isDirectHit&&M.isImage)s.spliceElementList(h,p,1),f=p-1;else{const S=l.getIsCollapsed();if(!S)s.spliceElementList(h,a+1,c-a);else{if(!h[p+1])return;s.spliceElementList(h,p+1,1)}f=S?p:a}}s.getGlobalEvent().setCanvasEventAbility(),f===null?(l.setRange(a,a),s.render({curIndex:a,isSubmitHistory:!1})):(l.setRange(f,f),s.render({curIndex:f}))}function zf(r,e){var t,i,n;const s=e.getDraw();if(s.isReadonly())return;const l=s.getRange();if(!l.getIsCanInput())return;const{startIndex:a,endIndex:c}=l.getRange(),d=l.getIsCollapsed(),h=s.getElementList(),u=h[a],f=h[c];if(d&&f.listId&&f.value===j&&((t=h[c+1])==null?void 0:t.listId)!==f.listId){s.getListParticle().unsetList();return}let g={value:j};if(r.shiftKey&&u.listId&&(g.listWrap=!0),$e(h,[g],a,{isBreakWhenWrap:!0,editorOptions:s.getOptions()}),r.shiftKey&&f.areaId&&f.areaId!==((i=h[c+1])==null?void 0:i.areaId)&&(g=Qt(g,Ai)),!(f.titleId&&f.titleId!==((n=h[c+1])==null?void 0:n.titleId))){const S=l.getRangeAnchorStyle(h,c);if(S){const b=[...Wi];S.controlComponent!==E.POSTFIX&&b.push(...Kt),b.forEach(P=>{const N=S[P];N!==void 0&&(g[P]=N)})}}const R=s.getControl(),p=R.getActiveControl();let M;if(p&&R.getIsRangeWithinControl())M=R.setValue([g]),R.emitControlContentChange();else{const b=s.getPosition().getCursorPosition();if(!b)return;const{index:P}=b;d?s.spliceElementList(h,P+1,0,[g]):s.spliceElementList(h,a+1,c-a,[g]),M=P+1}~M&&(l.setRange(M,M),s.render({curIndex:M})),r.preventDefault()}function $f(r,e){var t,i,n;const s=e.getDraw();if(s.isReadonly())return;const a=s.getPosition(),c=a.getCursorPosition();if(!c)return;const d=a.getPositionContext(),{index:h}=c;if(h<=0&&!d.isTable)return;const u=s.getRange(),{startIndex:f,endIndex:g}=u.getRange(),R=u.getIsCollapsed(),p=s.getElementList(),M=s.getControl();if(s.getMode()===ce.FORM&&M.getActiveControl()&&(((t=p[h])==null?void 0:t.controlComponent)===E.PREFIX||((i=p[h])==null?void 0:i.controlComponent)===E.PRE_TEXT)){M.initNextControl({direction:He.UP});return}let S=1;if(Jt(r)){const y=s.getLetterReg(),x=r.shiftKey&&!R&&f===c?.index?g:f;if(y.test((n=p[x])==null?void 0:n.value)){let I=x-1;for(;I>0;){const V=p[I];if(!y.test(V.value))break;S++,I--}}}const b=f-S;let P=b,N=b;if(r.shiftKey&&c&&(f!==g?f===c.index?(P=f,N=g-S):(P=b,N=g):N=g),!r.shiftKey){const y=p[f];if(y.type===D.TABLE){const x=y.trList,I=x.length-1,V=x[I],F=V.tdList.length-1,L=V.tdList[F];a.setPositionContext({isTable:!0,index:f,trIndex:I,tdIndex:F,tdId:L.id,trId:V.id,tableId:y.id}),P=L.value.length-1,N=P,s.getTableTool().render()}else if(y.tableId&&f===0){const I=s.getOriginalElementList()[d.index].trList;e:for(let V=0;V<I.length;V++){const F=I[V];if(F.id!==y.trId)continue;const L=F.tdList;for(let w=0;w<L.length;w++)if(L[w].id===y.tdId){if(V===0&&w===0)a.setPositionContext({isTable:!1}),P=d.index-1,N=P,s.getTableTool().dispose();else{let X=V,C=w-1;C<0&&(X=V-1,C=I[X].tdList.length-1);const Z=I[X],k=Z.tdList[C];a.setPositionContext({isTable:!0,index:d.index,trIndex:X,tdIndex:C,tdId:k.id,trId:Z.id,tableId:y.tableId}),P=k.value.length-1,N=P,s.getTableTool().render()}break e}}}}if(!~P||!~N)return;const m=s.getElementList();P=Xn(m,P),N=Xn(m,N),u.setRange(P,N);const T=P===N;s.render({curIndex:T?P:void 0,isSetCursor:T,isSubmitHistory:!1,isCompute:!1}),r.preventDefault()}function jf(r,e){var t,i,n;const s=e.getDraw();if(s.isReadonly())return;const a=s.getPosition(),c=a.getCursorPosition();if(!c)return;const{index:d}=c,h=a.getPositionList(),u=a.getPositionContext();if(d>h.length-1&&!u.isTable)return;const f=s.getRange(),{startIndex:g,endIndex:R}=f.getRange(),p=f.getIsCollapsed();let M=s.getElementList();const S=s.getControl();if(s.getMode()===ce.FORM&&S.getActiveControl()&&(((t=M[d+1])==null?void 0:t.controlComponent)===E.POSTFIX||((i=M[d+1])==null?void 0:i.controlComponent)===E.POST_TEXT)){S.initNextControl({direction:He.DOWN});return}let b=1;if(Jt(r)){const I=s.getLetterReg(),V=r.shiftKey&&!p&&g===c?.index?R:g;if(I.test((n=M[V+1])==null?void 0:n.value)){let F=V+2;for(;F<M.length;){const L=M[F];if(!I.test(L.value))break;b++,F++}}}const P=R+b;let N=P,m=P;if(r.shiftKey&&c&&(g!==R?g===c.index?(N=g,m=P):(N=g+b,m=R):N=g),!r.shiftKey){const I=M[R],V=M[R+1];if(V?.type===D.TABLE){const L=V.trList[0],w=L.tdList[0];a.setPositionContext({isTable:!0,index:R+1,trIndex:0,tdIndex:0,tdId:w.id,trId:L.id,tableId:V.id}),N=0,m=0,s.getTableTool().render()}else if(I.tableId&&!V){const L=s.getOriginalElementList()[u.index].trList;e:for(let w=0;w<L.length;w++){const v=L[w];if(v.id!==I.trId)continue;const X=v.tdList;for(let C=0;C<X.length;C++)if(X[C].id===I.tdId){if(w===L.length-1&&C===X.length-1)a.setPositionContext({isTable:!1}),N=u.index,m=N,M=s.getElementList(),s.getTableTool().dispose();else{let k=w,Q=C+1;Q>X.length-1&&(k=w+1,Q=0);const Y=L[k],W=Y.tdList[Q];a.setPositionContext({isTable:!0,index:u.index,trIndex:k,tdIndex:Q,tdId:W.id,trId:Y.id,tableId:I.tableId}),N=0,m=N,s.getTableTool().render()}break e}}}}const T=M.length-1;if(N>T||m>T)return;const y=s.getElementList();N=Xn(y,N,pt.AFTER),m=Xn(y,m,pt.AFTER),f.setRange(N,m);const x=N===m;s.render({curIndex:x?N:void 0,isSetCursor:x,isSubmitHistory:!1,isCompute:!1}),r.preventDefault()}function qf(r,e){const t=e.getDraw();if(t.isReadonly())return;r.preventDefault();const n=t.getControl();if(n.getActiveControl()&&n.getIsRangeWithinControl())n.initNextControl({direction:r.shiftKey?He.UP:He.DOWN});else{const l=t.getRange(),a=t.getElementList(),{startIndex:c,endIndex:d}=l.getRange(),h=l.getRangeAnchorStyle(a,d),u=h?Lt(h,Kt):null,f=oe(B({},u),{type:D.TAB,value:""});$e(a,[f],c,{editorOptions:t.getOptions()}),t.insertElementList([f])}}function Go(r){const{positionList:e,index:t,isUp:i,rowNo:n,cursorX:s}=r;let l=-1;const a=[];if(i){let c=t-1;for(;c>=0;){const d=e[c];if(c--,d.rowNo!==n){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.unshift(d)}}}else{let c=t+1;for(;c<e.length;){const d=e[c];if(c++,d.rowNo!==n){if(a[0]&&a[0].rowNo!==d.rowNo)break;a.push(d)}}}for(let c=0;c<a.length;c++){const d=a[c],{coordinate:{leftTop:[h],rightTop:[u]}}=d;if(c===a.length-1&&(l=d.index),!(s<h||s>u)){l=d.index;break}}return l}function eg(r,e){const t=e.getDraw();if(t.isReadonly())return;const n=t.getPosition(),s=n.getCursorPosition();if(!s)return;const l=t.getRange(),{startIndex:a,endIndex:c}=l.getRange();let d=n.getPositionList();const h=r.key===le.Up;let u=-1,f=-1;const g=n.getPositionContext();if(!r.shiftKey&&g.isTable&&(h&&s.rowIndex===0||!h&&s.rowIndex===t.getRowCount()-1)){const{index:p,trIndex:M,tdIndex:S,tableId:b}=g;if(h)if(M===0)n.setPositionContext({isTable:!1}),u=p-1,f=u,t.getTableTool().dispose();else{let P=-1,N=-1;const T=t.getOriginalElementList()[p].trList,y=T[M].tdList[S].colIndex;e:for(let V=M-1;V>=0;V--){const L=T[V].tdList;for(let w=0;w<L.length;w++){const v=L[w];if(v.colIndex===y||v.colIndex+v.colspan-1>=y&&v.colIndex<=y){P=V,N=w;break e}}}if(!~P||!~N)return;const x=T[P],I=x.tdList[N];n.setPositionContext({isTable:!0,index:p,trIndex:P,tdIndex:N,tdId:I.id,trId:x.id,tableId:b}),u=I.value.length-1,f=u,t.getTableTool().render()}else{const N=t.getOriginalElementList()[p].trList;if(M===N.length-1)n.setPositionContext({isTable:!1}),u=p,f=u,t.getTableTool().dispose();else{let m=-1,T=-1;const y=N[M].tdList[S].colIndex;e:for(let V=M+1;V<N.length;V++){const L=N[V].tdList;for(let w=0;w<L.length;w++){const v=L[w];if(v.colIndex===y||v.colIndex+v.colspan-1>=y&&v.colIndex<=y){m=V,T=w;break e}}}if(!~m||!~T)return;const x=N[m],I=x.tdList[T];n.setPositionContext({isTable:!0,index:p,trIndex:m,tdIndex:T,tdId:I.id,trId:x.id,tableId:b}),u=I.value.length-1,f=u,t.getTableTool().render()}}}else{let p=s;r.shiftKey&&(a===s.index?p=d[c]:p=d[a]);const{index:M,rowNo:S,rowIndex:b,coordinate:{rightTop:[P]}}=p;if(h&&b===0||!h&&b===t.getRowCount()-1)return;const N=Go({positionList:d,index:M,rowNo:S,isUp:h,cursorX:P});if(N<0)return;u=N,f=N,r.shiftKey&&(a!==c?a===s.index?u=a:f=c:h?f=c:u=a);const T=t.getElementList()[N];if(T.type===D.TABLE){const{scale:y}=t.getOptions(),x=t.getMargins(),I=T.trList;let V=-1,F=-1,L=-1;if(h)e:for(let w=I.length-1;w>=0;w--){const X=I[w].tdList;for(let C=0;C<X.length;C++){const Z=X[C],k=Z.x*y+x[3],Q=Z.width*y;if(P>=k&&P<=k+Q){const Y=Z.positionList,W=Y[Y.length-1],H=Go({positionList:Y,index:W.index+1,rowNo:W.rowNo-1,isUp:h,cursorX:P})||W.index;V=w,F=C,L=H;break e}}}else e:for(let w=0;w<I.length;w++){const X=I[w].tdList;for(let C=0;C<X.length;C++){const Z=X[C],k=Z.x*y+x[3],Q=Z.width*y;if(P>=k&&P<=k+Q){const Y=Z.positionList,W=Go({positionList:Y,index:-1,rowNo:-1,isUp:h,cursorX:P})||0;V=w,F=C,L=W;break e}}}if(~V&&~F&&~L){const w=I[V],v=w.tdList[F];n.setPositionContext({isTable:!0,index:N,trIndex:V,tdIndex:F,tdId:v.id,trId:w.id,tableId:T.id}),u=L,f=u,d=n.getPositionList(),t.getTableTool().render()}}}if(!~u||!~f)return;u>f&&([u,f]=[f,u]),l.setRange(u,f);const R=u===f;t.render({curIndex:R?u:void 0,isSetCursor:R,isSubmitHistory:!1,isCompute:!1}),t.getCursor().moveCursorToVisible({cursorPosition:d[h?u:f],direction:h?He.UP:He.DOWN})}function tg(r,e){if(e.isComposing)return;const t=e.getDraw();if(r.key===le.Backspace)Af(r,e);else if(r.key===le.Delete)Jf(r,e);else if(r.key===le.Enter)zf(r,e);else if(r.key===le.Left)$f(r,e);else if(r.key===le.Right)jf(r,e);else if(r.key===le.Up||r.key===le.Down)eg(r,e);else if(Jt(r)&&r.key.toLocaleLowerCase()===le.Z){if(t.isReadonly()&&t.getMode()!==ce.FORM)return;t.getHistoryManager().undo(),r.preventDefault()}else if(Jt(r)&&r.key.toLocaleLowerCase()===le.Y){if(t.isReadonly()&&t.getMode()!==ce.FORM)return;t.getHistoryManager().redo(),r.preventDefault()}else if(Jt(r)&&r.key.toLocaleLowerCase()===le.C)e.copy(),r.preventDefault();else if(Jt(r)&&r.key.toLocaleLowerCase()===le.X)e.cut(),r.preventDefault();else if(Jt(r)&&r.key.toLocaleLowerCase()===le.A)e.selectAll(),r.preventDefault();else if(Jt(r)&&r.key.toLocaleLowerCase()===le.S){if(t.isReadonly())return;const i=t.getListener();i.saved&&i.saved(t.getValue());const n=t.getEventBus();n.isSubscribe("saved")&&n.emit("saved",t.getValue()),r.preventDefault()}else if(r.key===le.ESC){e.clearPainterStyle();const i=t.getZone();i.isMainActive()||i.setZone(de.MAIN),r.preventDefault()}else r.key===le.TAB&&qf(r,e)}function ea(r,e){var t,i;const n=e.getDraw();if(n.isReadonly()||n.isDisabled())return;const l=n.getPosition().getCursorPosition();if(!r||!l)return;const a=e.isComposing;if(a&&((t=e.compositionInfo)==null?void 0:t.value)===r)return;const c=n.getRange();if(!c.getIsCanInput())return;const d=c.getDefaultStyle()||((i=e.compositionInfo)==null?void 0:i.defaultStyle)||null;ta(e),a||n.getCursor().clearAgentDomValue();const{TEXT:h,HYPERLINK:u,SUBSCRIPT:f,SUPERSCRIPT:g,DATE:R,TAB:p}=D,M=r.replaceAll(`
86
+ `,j),{startIndex:S,endIndex:b}=c.getRange(),P=n.getElementList(),N=c.getRangeAnchorStyle(P,b);if(!N)return;const m=n.isDesignMode(),T=mt(M).map(I=>{var V,F;const L={value:I};if(m||!((V=N.title)!=null&&V.disabled)&&!((F=N.control)!=null&&F.disabled)){const w=P[b+1];(!N.type||N.type===h||N.type===u&&w?.type===u||N.type===R&&w?.type===R||N.type===f&&w?.type===f||N.type===g&&w?.type===g)&&Gu.forEach(v=>{if(v==="groupIds"&&!w?.groupIds)return;const X=N[v];X!==void 0&&(L[v]=X)}),(d||N.type===p)&&Kt.forEach(v=>{const X=d?.[v]||N[v];X!==void 0&&(L[v]=X)}),a&&(L.underline=!0)}return L}),y=n.getControl();let x;if(y.getActiveControl()&&y.getIsRangeWithinControl())x=y.setValue(T),a||y.emitControlContentChange();else{const I=S+1;S!==b&&n.spliceElementList(P,I,b-S),$e(P,T,S,{editorOptions:n.getOptions()}),n.spliceElementList(P,I,0,T),x=S+T.length}~x&&(c.setRange(x,x),n.render({curIndex:x,isSubmitHistory:!a})),a&&(e.compositionInfo={elementList:P,value:M,startIndex:x-T.length,endIndex:x,defaultStyle:d})}function ta(r){if(!r.compositionInfo)return;const{elementList:e,startIndex:t,endIndex:i}=r.compositionInfo;e.splice(t+1,i-t),r.getDraw().getRange().setRange(t,t),r.compositionInfo=null}function ig(r){const e=r.getDraw(),t=e.getRange(),{startIndex:i,endIndex:n}=t.getRange();if(!~i&&!~i||e.isReadonly()||!t.getIsCanInput())return;const s=e.getElementList();let l=i,a=n;if(i===n){const f=e.getPosition().getPositionList(),g=f[i],R=g.rowNo,p=g.pageNo,M=[];for(let b=0;b<f.length;b++){const P=f[b];if(P.pageNo>p)break;P.pageNo===p&&P.rowNo===R&&M.push(b)}const S=M[0]-1;l=S<0?0:S,a=M[M.length-1]}const c=e.getOptions();Ar(s.slice(l+1,a+1),c);const d=e.getControl();let h;d.getActiveControl()&&d.getIsRangeWithinControl()?(h=d.cut(),d.emitControlContentChange()):(e.spliceElementList(s,l+1,a-l),h=l),t.setRange(h,h),e.render({curIndex:h})}function ng(r,e){const t=r.getDraw(),{copy:i}=t.getOverride();if(i){const a=i();if(a?.preventDefault!==!1)return}const n=t.getRange();let s=null;if(n.getRange().isCrossRowCol){const a=n.getRangeTableElement();if(!a)return;const c=t.getTableParticle().getRangeRowCol();if(!c)return;const d={type:D.TABLE,value:"",colgroup:[],trList:[]},h=c[0],u=h[0].colIndex,f=h[h.length-1],g=f.colIndex+f.colspan-1;for(let R=u;R<=g;R++)d.colgroup.push(a.colgroup[R]);for(let R=0;R<c.length;R++){const p=c[R],M=a.trList[p[0].rowIndex],S={tdList:[],height:M.height,minHeight:M.minHeight};for(let b=0;b<p.length;b++)S.tdList.push(p[b]);d.trList.push(S)}s=be([d])}else s=n.getIsCollapsed()?n.getRangeRowElementList():n.getSelectionElementList();e?.isPlainText&&s?.length&&(s=[{value:Fn(s)}]),s?.length&&Ar(s,t.getOptions())}function sg(r,e){var t,i;const n=e.getDraw(),{drop:s}=n.getOverride();if(s){const a=s(r);if(a?.preventDefault!==!1)return}r.preventDefault();const l=(t=r.dataTransfer)==null?void 0:t.getData("text");if(l)e.input(l);else{const a=(i=r.dataTransfer)==null?void 0:i.files;if(!a)return;for(let c=0;c<a.length;c++){const d=a[c];d.type.startsWith("image")&&Ko(e,d)}}}function og(r){var e;if(!Intl.Segmenter)return null;const t=r.getDraw(),i=t.getPosition().getCursorPosition();if(!i)return null;const s=t.getRange().getRangeParagraphInfo();if(!s)return null;const l=((e=s?.elementList)==null?void 0:e.map(g=>!g.type||g.type!==D.CONTROL&&yt.includes(g.type)?g.value:j).join(""))||"";if(!l)return null;const a=i.index,c=s.startIndex,h=new Intl.Segmenter(void 0,{granularity:"word"}).segment(l);let u=-1,f=-1;for(const{segment:g,index:R,isWordLike:p}of h){const M=R+c;if(p&&a>=M&&a<M+g.length){u=M-1,f=u+g.length;break}}return~u&&~f?{startIndex:u,endIndex:f}:null}function lg(r){const e=r.getDraw(),t=e.getPosition().getCursorPosition();if(!t)return null;const{value:i,index:n}=t,s=e.getLetterReg();let l=0,a=0;const c=Oo.test(i);if(c||s.test(i)){const h=e.getElementList();let u=n-1;for(;u>0;){const g=h[u].value;if(c&&Oo.test(g)||!c&&s.test(g))l++,u--;else break}let f=n+1;for(;f<h.length;){const g=h[f].value;if(c&&Oo.test(g)||!c&&s.test(g))a++,f++;else break}}const d=n-l-1;return d<0?null:{startIndex:d,endIndex:n+a}}function rg(r,e){const t=r.getDraw(),i=t.getPosition(),n=i.getPositionByXY({x:e.offsetX,y:e.offsetY});if(n.isImage&&n.isDirectHit){t.getPreviewer().render();return}if(t.getIsPagingMode()&&!~n.index&&n.zone){t.getZone().setZone(n.zone),t.clearSideEffect(),i.setPositionContext({isTable:!1});return}if((n.isCheckbox||n.isRadio)&&n.isDirectHit)return;const s=t.getRange(),l=og(r)||lg(r);l&&(s.setRange(l.startIndex,l.endIndex),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),s.setRangeStyle())}function ag(r){var e,t;const i=r.getDraw(),s=i.getPosition().getCursorPosition();if(!s)return;const{index:l}=s,a=i.getElementList();let c=0,d=0,h=l-1;for(;h>0;){const p=a[h],M=a[h-1];if(p.value===j&&!p.listWrap||p.listId!==M?.listId||p.titleId!==M?.titleId)break;c++,h--}let u=l+1;for(;u<a.length;){const p=a[u],M=a[u+1];if(p.value===j&&!p.listWrap||p.listId!==M?.listId||p.titleId!==M?.titleId)break;d++,u++}const f=i.getRange();let g=l-c-1;if(((e=a[g])==null?void 0:e.value)!==j&&(g-=1),g<0)return;let R=l+d+1;(((t=a[R])==null?void 0:t.value)===j||R>a.length-1)&&(R-=1),f.setRange(g,R),i.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}var ia={dblclick:rg,threeClick:ag};function cg(r){r.isComposing=!0}function dg(r,e){r.isComposing=!1;const t=r.getDraw();if(e.data)setTimeout(()=>{r.compositionInfo&&ea(e.data,r)},1);else{ta(r);const n=t.getRange(),{endIndex:s}=n.getRange();t.render({curIndex:s,isSubmitHistory:!1})}t.getCursor().clearAgentDomValue()}var na={compositionstart:cg,compositionend:dg};function hg(r,e){var t;const i=e.getDraw();if(i.isReadonly())return;r.preventDefault();const s=i.getPageContainer();if(!cs(r.target,N=>N===s))return;const c=r.target.dataset.index;c&&i.setPageNo(Number(c));const d=i.getPosition(),h=d.adjustPositionContext({x:r.offsetX,y:r.offsetY});if(!h)return;const{isTable:u,tdValueIndex:f,index:g}=h,R=d.getPositionList(),p=u?f:g;~g&&(i.getRange().setRange(p,p),d.setCursorPosition(R[p]));const M=i.getCursor(),{cursor:{dragColor:S,dragWidth:b,dragFloatImageDisabled:P}}=i.getOptions();if(P){const N=(t=e.cacheElementList)==null?void 0:t[e.cacheRange.startIndex];if(N?.type===D.IMAGE&&(N.imgDisplay===re.FLOAT_TOP||N.imgDisplay===re.FLOAT_BOTTOM||N.imgDisplay===re.SURROUND))return}M.drawCursor({width:b,color:S,isBlink:!1,isFocus:!1})}var ug={dragover:hg};class fg{constructor(e){O(this,"isAllowSelection"),O(this,"isComposing"),O(this,"compositionInfo"),O(this,"isAllowDrag"),O(this,"isAllowDrop"),O(this,"cacheRange"),O(this,"cacheElementList"),O(this,"cachePositionList"),O(this,"cachePositionContext"),O(this,"mouseDownStartPosition"),O(this,"draw"),O(this,"pageContainer"),O(this,"pageList"),O(this,"range"),O(this,"position"),this.draw=e,this.pageContainer=e.getPageContainer(),this.pageList=e.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),vu(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(e){this.isAllowSelection=e,e||this.applyPainterStyle()}setIsAllowDrag(e){this.isAllowDrag=e,this.isAllowDrop=e}clearPainterStyle(){this.pageList.forEach(e=>{e.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const e=this.draw.getPainterStyle();if(!e||this.draw.isReadonly()||this.draw.isDisabled())return;const i=this.range.getSelection();if(!i)return;const n=Object.keys(e);i.forEach(l=>{n.forEach(a=>{const c=a;l[c]=e[c]})}),this.draw.render({isSetCursor:!1});const s=this.draw.getPainterOptions();(!s||!s.isDblclick)&&this.clearPainterStyle()}selectAll(){const e=this.position.getPositionList();this.range.setRange(0,e.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}mousemove(e){_f(e,this)}mousedown(e){Hf(e,this)}click(){Hu&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(e){Bf(e,this)}mouseleave(e){Gf(e,this)}keydown(e){tg(e,this)}dblclick(e){ia.dblclick(this,e)}threeClick(){ia.threeClick(this)}input(e){ea(e,this)}cut(){ig(this)}copy(e){ng(this,e)}compositionstart(){na.compositionstart(this)}compositionend(e){na.compositionend(this,e)}drop(e){sg(e,this)}dragover(e){ug.dragover(e,this)}}const gg={PAGE_SCALE:"pageScale"};class Rg{constructor(e,t){O(this,"draw"),O(this,"options"),O(this,"cursor"),O(this,"canvasEvent"),O(this,"range"),O(this,"previewer"),O(this,"tableTool"),O(this,"hyperlinkParticle"),O(this,"control"),O(this,"dateParticle"),O(this,"imageParticle"),O(this,"dprMediaQueryList"),O(this,"clearSideEffect",i=>{if(!this.cursor)return;const n=i?.composedPath()[0]||i.target,s=this.draw.getPageList();if(cs(n,c=>s.includes(c)))return;if(cs(n,c=>!!c&&c.nodeType===1&&!!c.getAttribute(Ni))){this.watchCursorActive();return}this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage()}),O(this,"setCanvasEventAbility",()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)}),O(this,"setPageScale",i=>{if(this.options.shortcutDisableKeys.includes(gg.PAGE_SCALE)||!i.ctrlKey)return;i.preventDefault();const{scale:n}=this.options;if(i.deltaY<0){const s=n*10+1;s<=30&&this.draw.setPageScale(s/10)}else{const s=n*10-1;s>=5&&this.draw.setPageScale(s/10)}}),O(this,"_handleVisibilityChange",()=>{if(document.visibilityState==="visible"){const i=this.range.getRange(),n=!!~i.startIndex&&!!~i.endIndex&&i.startIndex===i.endIndex;this.range.replaceRange(i),this.draw.render({isSetCursor:n,isCompute:!1,isSubmitHistory:!1,curIndex:i.startIndex})}}),O(this,"_handleDprChange",()=>{this.draw.setPageDevicePixel()}),this.draw=e,this.options=e.getOptions(),this.canvasEvent=t,this.cursor=null,this.range=e.getRange(),this.previewer=e.getPreviewer(),this.tableTool=e.getTableTool(),this.hyperlinkParticle=e.getHyperlinkParticle(),this.dateParticle=e.getDateParticle(),this.imageParticle=e.getImageParticle(),this.control=e.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("mousedown",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{var e,t;(e=this.cursor)!=null&&e.getAgentIsActive()||(t=this.cursor)==null||t.drawCursor({isFocus:!1,isBlink:!1})})}}class pg{constructor(e){O(this,"undoStack",[]),O(this,"redoStack",[]),O(this,"maxRecordCount"),this.maxRecordCount=e.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const e=this.undoStack.pop();this.redoStack.push(e),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const e=this.redoStack.pop();this.undoStack.push(e),e()}}execute(e){for(this.undoStack.push(e),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class mg{constructor(e){O(this,"cursorPosition"),O(this,"positionContext"),O(this,"positionList"),O(this,"floatPositionList"),O(this,"draw"),O(this,"eventBus"),O(this,"options"),this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=e,this.eventBus=e.getEventBus(),this.options=e.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(e){const{index:t,trIndex:i,tdIndex:n}=this.positionContext;return e[t].trList[i].tdList[n].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const e=this.draw.getZone();return e.isHeaderActive()?this.draw.getHeader().getPositionList():e.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:e,endIndex:t}=this.draw.getRange().getRange();return e===t?null:this.getPositionList().slice(e+1,t+1)}setPositionList(e){this.positionList=e}setFloatPositionList(e){this.floatPositionList=e}computePageRowPosition(e){const{positionList:t,rowList:i,pageNo:n,startX:s,startY:l,startRowIndex:a,startIndex:c,innerWidth:d,zone:h}=e,{scale:u,table:{tdPadding:f}}=this.options;let g=s,R=l,p=c;for(let M=0;M<i.length;M++){const S=i[M];if(!S.isSurround){const N=S.width+(S.offsetX||0);S.rowFlex===Re.CENTER?g+=(d-N)/2:S.rowFlex===Re.RIGHT&&(g+=d-N)}g+=S.offsetX||0,R+=S.offsetY||0;const b=g,P=R;for(let N=0;N<S.elementList.length;N++){const m=S.elementList[N],T=m.metrics,y=m.imgDisplay!==re.INLINE&&m.type===D.IMAGE||m.type===D.LATEX?S.ascent-T.height:S.ascent;m.left&&(g+=m.left);const x={pageNo:n,index:p,value:m.value,rowIndex:a+M,rowNo:M,metrics:T,left:m.left||0,ascent:y,lineHeight:S.height,isFirstLetter:N===0,isLastLetter:N===S.elementList.length-1,coordinate:{leftTop:[g,R],leftBottom:[g,R+S.height],rightTop:[g+T.width,R],rightBottom:[g+T.width,R+S.height]}};if(m.imgDisplay===re.SURROUND||m.imgDisplay===re.FLOAT_TOP||m.imgDisplay===re.FLOAT_BOTTOM){const I=t[t.length-1];I&&(x.metrics=I.metrics,x.coordinate=I.coordinate),m.imgFloatPosition||(m.imgFloatPosition={x:g,y:R,pageNo:n}),this.floatPositionList.push({pageNo:n,element:m,position:x,isTable:e.isTable,index:e.index,tdIndex:e.tdIndex,trIndex:e.trIndex,tdValueIndex:p,zone:h})}if(t.push(x),p++,g+=T.width,m.type===D.TABLE){const I=f[1]+f[3],V=f[0]+f[2];for(let F=0;F<m.trList.length;F++){const L=m.trList[F];for(let w=0;w<L.tdList.length;w++){const v=L.tdList[w];v.positionList=[];const X=v.rowList,C=this.computePageRowPosition({positionList:v.positionList,rowList:X,pageNo:n,startRowIndex:0,startIndex:0,startX:(v.x+f[3])*u+b,startY:(v.y+f[0])*u+P,innerWidth:(v.width-I)*u,isTable:!0,index:p-1,tdIndex:w,trIndex:F,zone:h});if(v.verticalAlign===Ae.MIDDLE||v.verticalAlign===Ae.BOTTOM){const Z=X.reduce((Y,W)=>Y+W.height,0),k=(v.height-V)*u-Z,Q=v.verticalAlign===Ae.MIDDLE?k/2:k;Math.floor(Q)>0&&v.positionList.forEach(Y=>{const{coordinate:{leftTop:W,leftBottom:H,rightBottom:U,rightTop:K}}=Y;W[1]+=Q,H[1]+=Q,U[1]+=Q,K[1]+=Q})}g=C.x,R=C.y}}g=b,R=P}}g=s,R+=S.height}return{x:g,y:R,index:p}}computePositionList(){var e;this.positionList=[];const t=this.draw.getInnerWidth(),i=this.draw.getPageRowList(),n=this.draw.getMargins(),s=n[3],a=this.draw.getHeader().getExtraHeight(),c=n[0]+a;let d=0;for(let h=0;h<i.length;h++){const u=i[h],f=(e=u[0])==null?void 0:e.startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:u,pageNo:h,startRowIndex:d,startIndex:f,startX:s,startY:c,innerWidth:t}),d+=u.length}}computeRowPosition(e){const{row:t,innerWidth:i}=e,n=[];return this.computePageRowPosition({positionList:n,innerWidth:i,rowList:[Ne(t)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),n}setCursorPosition(e){this.cursorPosition=e}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(e){this.eventBus.emit("positionContextChange",{value:e,oldValue:this.positionContext}),this.positionContext=e}getPositionByXY(e){var t,i,n,s,l;const{x:a,y:c,isTable:d}=e;let{elementList:h,positionList:u}=e;h||(h=this.draw.getOriginalElementList()),u||(u=this.getOriginalPositionList());const f=this.draw.getZone(),g=(t=e.pageNo)!=null?t:this.draw.getPageNo(),R=f.isMainActive(),p=R?g:0;if(!d){const N=this.getFloatPositionByXY(oe(B({},e),{imgDisplays:[re.FLOAT_TOP,re.SURROUND]}));if(N)return N}for(let N=0;N<u.length;N++){const{index:m,pageNo:T,left:y,isFirstLetter:x,coordinate:{leftTop:I,rightTop:V,leftBottom:F}}=u[N];if(p===T){if(T>p)break;if(I[0]-y<=a&&V[0]>=a&&I[1]<=c&&F[1]>=c){let L=N;const w=h[N];if(w.type===D.TABLE)for(let X=0;X<w.trList.length;X++){const C=w.trList[X];for(let Z=0;Z<C.tdList.length;Z++){const k=C.tdList[Z],Q=this.getPositionByXY({x:a,y:c,td:k,pageNo:g,tablePosition:u[N],isTable:!0,elementList:k.value,positionList:k.positionList});if(~Q.index){const{index:Y,hitLineStartIndex:W}=Q,H=k.value[Y];return{index:m,isCheckbox:Q.isCheckbox||H.type===D.CHECKBOX||H.controlComponent===E.CHECKBOX,isRadio:H.type===D.RADIO||H.controlComponent===E.RADIO,isControl:!!H.controlId,isImage:Q.isImage,isDirectHit:Q.isDirectHit,isTable:!0,tdIndex:Z,trIndex:X,tdValueIndex:Y,tdId:k.id,trId:C.id,tableId:w.id,hitLineStartIndex:W}}}}if(w.type===D.IMAGE||w.type===D.LATEX)return{index:L,isDirectHit:!0,isImage:!0};if(w.type===D.CHECKBOX||w.controlComponent===E.CHECKBOX)return{index:L,isDirectHit:!0,isCheckbox:!0};if(w.type===D.TAB&&w.listStyle===ht.CHECKBOX){let X=L-1;for(;X>0;){const C=h[X];if(C.value===j&&C.listStyle===ht.CHECKBOX)break;X--}return{index:X,isDirectHit:!0,isCheckbox:!0}}if(w.type===D.RADIO||w.controlComponent===E.RADIO)return{index:L,isDirectHit:!0,isRadio:!0};let v;if(h[m].value!==j){const X=V[0]-I[0];a<I[0]+X/2&&(L=N-1,x&&(v=N))}return{isDirectHit:!0,hitLineStartIndex:v,index:L,isControl:!!w.controlId}}}}if(!d){const N=this.getFloatPositionByXY(oe(B({},e),{imgDisplays:[re.FLOAT_BOTTOM]}));if(N)return N}let M=!1,S=-1,b;if(d){const{scale:N}=this.options,{td:m,tablePosition:T}=e;if(m&&T){const{leftTop:y}=T.coordinate,x=m.x*N+y[0],I=m.y*N+y[1],V=m.width*N,F=m.height*N;if(!(x<a&&a<x+V&&I<c&&c<I+F))return{index:S}}}const P=u.filter(N=>N.isLastLetter&&N.pageNo===p);for(let N=0;N<P.length;N++){const{index:m,rowNo:T,coordinate:{leftTop:y,leftBottom:x}}=P[N];if(c>y[1]&&c<=x[1]){const I=u.findIndex(w=>w.pageNo===p&&w.rowNo===T),V=h[I],F=u[I],L=V.listStyle===ht.CHECKBOX?this.draw.getMargins()[3]:F.coordinate.leftTop[0];if(a<L)~I?F.value===j?S=I:(S=I-1,b=I):S=m;else{if(V.listStyle===ht.CHECKBOX&&a<y[0])return{index:I,isDirectHit:!0,isCheckbox:!0};S=m}M=!0;break}}if(!M){const N=this.draw.getHeader(),m=N.getHeight(),T=N.getHeaderTop()+m,y=this.draw.getFooter(),I=this.draw.getHeight()-(y.getFooterBottom()+y.getHeight());if(R){if(c<T)return{index:-1,zone:de.HEADER};if(c>I)return{index:-1,zone:de.FOOTER}}else if(c<=I&&c>=T)return{index:-1,zone:de.MAIN};const V=this.draw.getMargins();if(c<=V[0])for(let F=0;F<u.length;F++){const L=u[F];if(L.pageNo!==p||L.rowNo!==0)continue;const{leftTop:w,rightTop:v}=L.coordinate;if(a<=V[3]||a>=w[0]&&a<=v[0]||((i=u[F+1])==null?void 0:i.rowNo)!==0)return{index:L.index}}else{const F=P[P.length-1];if(F){const L=F.rowNo;for(let w=0;w<u.length;w++){const v=u[w];if(v.pageNo!==p||v.rowNo!==L)continue;const{leftTop:X,rightTop:C}=v.coordinate;if(a<=V[3]||a>=X[0]&&a<=C[0]||((n=u[w+1])==null?void 0:n.rowNo)!==L)return{index:v.index}}}}return{index:((s=P[P.length-1])==null?void 0:s.index)||u.length-1}}return{hitLineStartIndex:b,index:S,isControl:!!((l=h[S])!=null&&l.controlId)}}getFloatPositionByXY(e){var t;const{x:i,y:n}=e,s=(t=e.pageNo)!=null?t:this.draw.getPageNo(),l=this.draw.getZone().getZone(),{scale:a}=this.options;for(let c=0;c<this.floatPositionList.length;c++){const{position:d,element:h,isTable:u,index:f,trIndex:g,tdIndex:R,tdValueIndex:p,zone:M,pageNo:S}=this.floatPositionList[c];if(s===S&&h.type===D.IMAGE&&h.imgDisplay&&e.imgDisplays.includes(h.imgDisplay)&&(!M||M===l)){const b=h.imgFloatPosition,P=b.x*a,N=b.y*a,m=h.width*a,T=h.height*a;if(i>=P&&i<=P+m&&n>=N&&n<=N+T)return u?{index:f,isDirectHit:!0,isImage:!0,isTable:u,trIndex:g,tdIndex:R,tdValueIndex:p,tdId:h.tdId,trId:h.trId,tableId:h.tableId}:{index:d.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(e){const t=this.getPositionByXY(e);if(!~t.index)return null;if(t.isControl&&this.draw.getMode()!==ce.READONLY){const{index:p,isTable:M,trIndex:S,tdIndex:b,tdValueIndex:P}=t,N=this.draw.getControl(),{newIndex:m}=N.moveCursor({index:p,isTable:M,trIndex:S,tdIndex:b,tdValueIndex:P});M?t.tdValueIndex=m:t.index=m}const{index:i,isCheckbox:n,isRadio:s,isControl:l,isImage:a,isDirectHit:c,isTable:d,trIndex:h,tdIndex:u,tdId:f,trId:g,tableId:R}=t;return this.setPositionContext({isTable:d||!1,isCheckbox:n||!1,isRadio:s||!1,isControl:l||!1,isImage:a||!1,isDirectHit:c||!1,index:i,trIndex:h,tdIndex:u,tdId:f,trId:g,tableId:R}),t}setSurroundPosition(e){var t;const{pageNo:i,row:n,rowElement:s,rowElementRect:l,surroundElementList:a,availableWidth:c}=e;let d=l.x,h=0;if(a.length&&!qi(s)&&!((t=s.control)!=null&&t.minWidth))for(let u=0;u<a.length;u++){const f=a[u],g=f.imgFloatPosition;if(g.pageNo!==i)continue;const R=oe(B({},g),{width:f.width,height:f.height});if(Yu(l,R)){n.isSurround=!0;const p=R.width+R.x-l.x;if(s.left=p,n.width+=p,h+=p,d=R.x+R.width,n.width+s.metrics.width>c){s.left=0,n.width-=h;break}}}return{x:d,rowIncreaseWidth:h}}}class Sg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"range"),O(this,"listener"),O(this,"eventBus"),O(this,"position"),O(this,"historyManager"),O(this,"defaultStyle"),this.draw=e,this.options=e.getOptions(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.range={startIndex:-1,endIndex:-1},this.defaultStyle=null}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(e){e?this.defaultStyle=B(B({},this.defaultStyle),e):this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(e,t){const i=Ms(e,t);return i?B(B({},i),this.defaultStyle):null}getIsRangeChange(e,t,i,n,s,l,a){return this.range.startIndex!==e||this.range.endIndex!==t||this.range.tableId!==i||this.range.startTdIndex!==n||this.range.endTdIndex!==s||this.range.startTrIndex!==l||this.range.endTrIndex!==a}getIsCollapsed(){const{startIndex:e,endIndex:t}=this.range;return e===t}getIsSelection(){const{startIndex:e,endIndex:t}=this.range;return!~e&&!~t?!1:e!==t}getSelection(){const{startIndex:e,endIndex:t}=this.range;return e===t?null:this.draw.getElementList().slice(e+1,t+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const e=this.draw.getTableParticle().getRangeRowCol();if(!e)return null;const t=[];for(let i=0;i<e.length;i++){const n=e[i];for(let s=0;s<n.length;s++){const l=n[s];t.push(...l.value)}}return t}return this.getSelection()}getTextLikeSelection(){const e=this.getSelection();return e?e.filter(t=>!t.type||yt.includes(t.type)):null}getTextLikeSelectionElementList(){const e=this.getSelectionElementList();return e?e.filter(t=>!t.type||yt.includes(t.type)):null}getRangeRow(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;const i=this.position.getPositionList(),n=new Map;for(let s=e;s<t+1;s++){const{pageNo:l,rowNo:a}=i[s],c=n.get(l);c?c.has(a)||c.add(a):n.set(l,new Set([a]))}return n}getRangeRowElementList(){const{startIndex:e,endIndex:t,isCrossRowCol:i}=this.range;if(!~e&&!~t)return null;if(i)return this.getSelectionElementList();const n=this.getRangeRow();if(!n)return null;const s=this.position.getPositionList(),l=this.draw.getElementList(),a=[];for(let c=0;c<s.length;c++){const d=s[c],h=n.get(d.pageNo);h&&h.has(d.rowNo)&&a.push(l[c])}return a}getRangeParagraph(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;const i=this.position.getPositionList(),n=this.draw.getElementList(),s=new Map;let l=e;for(;l>=0;){const{pageNo:d,rowNo:h}=i[l];let u=s.get(d);u||(u=[],s.set(d,u)),u.includes(h)||u.unshift(h);const f=n[l],g=n[l-1];if(f.value===j&&!f.listWrap||f.listId!==g?.listId||f.titleId!==g?.titleId)break;l--}const a=e===t;if(!a){let d=e+1;for(;d<t;){const{pageNo:h,rowNo:u}=i[d];let f=s.get(h);f||(f=[],s.set(h,f)),f.includes(u)||f.push(u),d++}}let c=t;for(a&&n[e].value===j&&(c+=1);c<i.length;){const d=n[c],h=n[c+1];if(d.value===j&&!d.listWrap||d.listId!==h?.listId||d.titleId!==h?.titleId)break;const{pageNo:u,rowNo:f}=i[c];let g=s.get(u);g||(g=[],s.set(u,g)),g.includes(f)||g.push(f),c++}return s}getRangeParagraphInfo(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;let i=-1;const n=[],s=this.getRangeParagraph();if(!s)return null;const l=this.draw.getElementList(),a=this.position.getPositionList();for(let c=0;c<a.length;c++){const d=a[c],h=s.get(d.pageNo);h&&h.includes(d.rowNo)&&(~i||(i=d.index),n.push(l[c]))}return n.length?{elementList:n,startIndex:i}:null}getRangeParagraphElementList(){var e;return((e=this.getRangeParagraphInfo())==null?void 0:e.elementList)||null}getRangeTableElement(){const e=this.position.getPositionContext();return e.isTable?this.draw.getOriginalElementList()[e.index]:null}getIsSelectAll(){const e=this.draw.getElementList(),{startIndex:t,endIndex:i}=this.range;return t===0&&e.length-1===i&&!this.position.getPositionContext().isTable}getIsPointInRange(e,t){const{startIndex:i,endIndex:n}=this.range,s=this.position.getPositionList();for(let l=i+1;l<=n&&s[l];l++){const{coordinate:{leftTop:c,rightBottom:d}}=s[l];if(e>=c[0]&&e<=d[0]&&t>=c[1]&&t<=d[1])return!0}return!1}getKeywordRangeList(e){const t=this.draw.getSearch().getMatchList(e,this.draw.getOriginalElementList()),i=new Map;for(const s of t){const l=i.get(s.groupId);if(l)l.endIndex+=1;else{const{type:a,groupId:c,tableId:d,index:h,tdIndex:u,trIndex:f}=s,g={startIndex:h,endIndex:h};a===di.TABLE&&(g.tableId=d,g.startTdIndex=u,g.endTdIndex=u,g.startTrIndex=f,g.endTrIndex=f),i.set(c,g)}}const n=[];return i.forEach(s=>{n.push(s)}),n}getIsCanInput(){var e;const{startIndex:t,endIndex:i}=this.getRange();if(!~t&&!~i)return!1;const n=this.draw.getElementList(),s=n[t];if(t===i)return(s.controlComponent!==E.PRE_TEXT||((e=n[t+1])==null?void 0:e.controlComponent)!==E.PRE_TEXT)&&s.controlComponent!==E.POST_TEXT;const l=n[i];return!s.controlId&&!l.controlId||(!s.controlId||s.controlComponent===E.POSTFIX)&&(!l.controlId||l.controlComponent===E.POSTFIX)||!!s.controlId&&l.controlId===s.controlId&&l.controlComponent!==E.PRE_TEXT&&l.controlComponent!==E.POST_TEXT&&l.controlComponent!==E.POSTFIX}setRange(e,t,i,n,s,l,a){this.getIsRangeChange(e,t,i,n,s,l,a)&&(this.range.startIndex=e,this.range.endIndex=t,this.range.tableId=i,this.range.startTdIndex=n,this.range.endTdIndex=s,this.range.startTrIndex=l,this.range.endTrIndex=a,this.range.isCrossRowCol=!!(n||s||l||a),this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const d=this.draw.getControl();if(~e&&~t){const u=this.draw.getElementList()[e];if(u?.controlId){d.initControl();return}}d.destroyControl()}replaceRange(e){this.setRange(e.startIndex,e.endIndex,e.tableId,e.startTdIndex,e.endTdIndex,e.startTrIndex,e.endTrIndex)}shrinkRange(){const{startIndex:e,endIndex:t}=this.range;e===t||!~e&&!~t||this.replaceRange(oe(B({},this.range),{startIndex:t}))}setRangeStyle(){var e,t;const i=this.listener.rangeStyleChange,n=this.eventBus.isSubscribe("rangeStyleChange");if(!i&&!n)return;const{startIndex:s,endIndex:l,isCrossRowCol:a}=this.range;if(!~s&&!~l)return;let c;if(a){const C=this.draw.getOriginalElementList(),Z=this.position.getPositionContext();c=C[Z.index]}else{const C=~l?l:0,Z=this.draw.getElementList();c=this.getRangeAnchorStyle(Z,C)}if(!c)return;const d=this.getSelection()||[c],h=c.type||D.TEXT,u=c.font||this.options.defaultFont,f=c.size||this.options.defaultSize,g=!~d.findIndex(C=>!C.bold),R=!~d.findIndex(C=>!C.italic),p=!~d.findIndex(C=>{var Z;return!C.underline&&!((Z=C.control)!=null&&Z.underline)}),M=!~d.findIndex(C=>!C.strikeout),S=c.color||null,b=c.highlight||null,P=c.rowFlex||null,N=(e=c.rowMargin)!=null?e:this.options.defaultRowMargin,m=c.dashArray||[],T=c.level||null,y=c.listType||null,x=c.listStyle||null,I=p&&c.textDecoration||null,V=!!this.draw.getPainterStyle(),F=this.historyManager.isCanUndo(),L=this.historyManager.isCanRedo(),w=c.groupIds||null,v=(t=c.extension)!=null?t:null,X={type:h,undo:F,redo:L,painter:V,font:u,size:f,bold:g,italic:R,underline:p,strikeout:M,color:S,highlight:b,rowFlex:P,rowMargin:N,dashArray:m,level:T,listType:y,listStyle:x,groupIds:w,textDecoration:I,extension:v};i&&i(X),n&&this.eventBus.emit("rangeStyleChange",X)}recoveryRangeStyle(){const e=this.listener.rangeStyleChange,t=this.eventBus.isSubscribe("rangeStyleChange");if(!e&&!t)return;const i=this.options.defaultFont,n=this.options.defaultSize,s=this.options.defaultRowMargin,l=!!this.draw.getPainterStyle(),a=this.historyManager.isCanUndo(),c=this.historyManager.isCanRedo(),d={type:null,undo:a,redo:c,painter:l,font:i,size:n,bold:!1,italic:!1,underline:!1,strikeout:!1,color:null,highlight:null,rowFlex:null,rowMargin:s,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null};e&&e(d),t&&this.eventBus.emit("rangeStyleChange",d)}shrinkBoundary(e={}){const t=e.elementList||this.draw.getElementList(),i=e.range||this.getRange(),{startIndex:n,endIndex:s}=i;if(!~n&&!~s)return;const l=t[n],a=t[s];if(n===s){if(l.controlComponent===E.PLACEHOLDER){let c=n-1;for(;c>0;){const d=t[c];if(d.controlId!==l.controlId||d.controlComponent===E.PREFIX||d.controlComponent===E.PRE_TEXT){i.startIndex=c,i.endIndex=c;break}c--}}}else{if(l.controlComponent===E.PLACEHOLDER||a.controlComponent===E.PLACEHOLDER){let c=s-1;for(;c>0;){const d=t[c];if(d.controlId!==a.controlId||d.controlComponent===E.PREFIX||d.controlComponent===E.PRE_TEXT){i.startIndex=c,i.endIndex=c;return}c--}}if(l.controlComponent===E.PREFIX){let c=n+1;for(;c<t.length;){const d=t[c];if(d.controlId!==l.controlId||d.controlComponent===E.VALUE){i.startIndex=c-1;break}else if(d.controlComponent===E.PLACEHOLDER){i.startIndex=c-1,i.endIndex=c-1;return}c++}}if(a.controlComponent!==E.VALUE){let c=n-1;for(;c>0;){const d=t[c];if(d.controlId!==l.controlId||d.controlComponent===E.VALUE){i.startIndex=c;break}else if(d.controlComponent===E.PLACEHOLDER){i.startIndex=c,i.endIndex=c;return}c--}}}}render(e,t,i,n,s){e.save(),e.globalAlpha=this.options.rangeAlpha,e.fillStyle=this.options.rangeColor,e.fillRect(t,i,n,s),e.restore()}toString(){const e=this.getTextLikeSelection();return e?e.map(t=>t.value).join("").replace(new RegExp(j,"g"),""):""}}class Mg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"imageCache"),this.draw=e,this.options=e.getOptions(),this.imageCache=new Map}_renderBackgroundColor(e,t,i,n){e.save(),e.fillStyle=t,e.fillRect(0,0,i,n),e.restore()}_drawImage(e,t,i,n){const{background:s,scale:l}=this.options;if(s.size===ps.CONTAIN){const a=t.width*l,c=t.height*l;if(!s.repeat||s.repeat===Li.NO_REPEAT)e.drawImage(t,0,0,a,c);else{let d=0,h=0;const u=s.repeat===Li.REPEAT||s.repeat===Li.REPEAT_X?Math.ceil(i*l/a):1,f=s.repeat===Li.REPEAT||s.repeat===Li.REPEAT_Y?Math.ceil(n*l/c):1;for(let g=0;g<u;g++){for(let R=0;R<f;R++)e.drawImage(t,d,h,a,c),h+=c;h=0,d+=a}}}else e.drawImage(t,0,0,i*l,n*l)}_renderBackgroundImage(e,t,i){const{background:n}=this.options,s=this.imageCache.get(n.image);if(s)this._drawImage(e,s,t,i);else{const l=new Image;l.setAttribute("crossOrigin","Anonymous"),l.src=n.image,l.onload=()=>{this.imageCache.set(n.image,l),this._drawImage(e,l,t,i),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(e,t){const{background:{image:i,color:n,applyPageNumbers:s}}=this.options;if(i&&(!s?.length||s.includes(t))){const{width:l,height:a}=this.options;this._renderBackgroundImage(e,l,a)}else{const l=this.draw.getCanvasWidth(t),a=this.draw.getCanvasHeight(t);this._renderBackgroundColor(e,n,l,a)}}}class _o{constructor(){O(this,"fillRect"),O(this,"fillColor"),O(this,"fillDecorationStyle"),this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(e,t,i,n,s,l,a){const c=!this.fillRect.width;if(!c&&(this.fillColor!==l||this.fillDecorationStyle!==a)){this.render(e),this.clearFillInfo(),this.recordFillInfo(e,t,i,n,s,l,a);return}c&&(this.fillRect.x=t,this.fillRect.y=i),s&&this.fillRect.height<s&&(this.fillRect.height=s),this.fillRect.width+=n,this.fillColor=l,this.fillDecorationStyle=a}}class Ng extends _o{constructor(e){super(),O(this,"options"),this.options=e.getOptions()}render(e){if(!this.fillRect.width)return;const{highlightAlpha:t}=this.options,{x:i,y:n,width:s,height:l}=this.fillRect;e.save(),e.globalAlpha=t,e.fillStyle=this.fillColor,e.fillRect(i,n,s,l),e.restore(),this.clearFillInfo()}}class bg{constructor(e){O(this,"draw"),O(this,"options"),this.draw=e,this.options=e.getOptions()}render(e,t){const{marginIndicatorColor:i,pageMode:n}=this.options,s=this.draw.getWidth(),l=n===bi.CONTINUITY?this.draw.getCanvasHeight(t)/this.draw.getPagePixelRatio():this.draw.getHeight(),a=this.draw.getMargins(),c=this.draw.getMarginIndicatorSize();e.save(),e.translate(.5,.5),e.strokeStyle=i,e.beginPath();const d=[a[3],a[0]],h=[s-a[1],a[0]],u=[a[3],l-a[2]],f=[s-a[1],l-a[2]];e.moveTo(d[0]-c,d[1]),e.lineTo(...d),e.lineTo(d[0],d[1]-c),e.moveTo(h[0]+c,h[1]),e.lineTo(...h),e.lineTo(h[0],h[1]-c),e.moveTo(u[0]-c,u[1]),e.lineTo(...u),e.lineTo(u[0],u[1]+c),e.moveTo(f[0]+c,f[1]),e.lineTo(...f),e.lineTo(f[0],f[1]+c),e.stroke(),e.restore()}}class Lg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"position"),O(this,"searchKeyword"),O(this,"searchNavigateIndex"),O(this,"searchMatchList"),this.draw=e,this.options=e.getOptions(),this.position=e.getPosition(),this.searchNavigateIndex=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(e){this.searchKeyword=e,this.searchNavigateIndex=null}searchNavigatePre(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let e=this.searchNavigateIndex-1,t=!1;const i=this.searchMatchList[this.searchNavigateIndex].groupId;for(;e>=0;){const n=this.searchMatchList[e];if(i!==n.groupId){t=!0,this.searchNavigateIndex=e-(this.searchKeyword.length-1);break}e--}if(!t){if(this.searchMatchList[this.searchMatchList.length-1].groupId===i)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let e=this.searchNavigateIndex+1,t=!1;const i=this.searchMatchList[this.searchNavigateIndex].groupId;for(;e<this.searchMatchList.length;){const n=this.searchMatchList[e];if(i!==n.groupId){t=!0,this.searchNavigateIndex=e;break}e++}if(!t){if(this.searchMatchList[0].groupId===i)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(e){const{coordinate:{leftTop:t,leftBottom:i,rightTop:n},pageNo:s}=e,l=this.draw.getHeight(),a=this.draw.getPageGap(),c=s*(l+a),d=document.createElement("div");d.style.position="absolute";const h=50;d.style.width=`${n[0]-t[0]+h}px`,d.style.height=`${i[1]-t[1]+h}px`,d.style.left=`${t[0]}px`,d.style.top=`${t[1]+c}px`,this.draw.getContainer().append(d),d.scrollIntoView(!1),d.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((e,t)=>e+t)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const e=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let t=0,i=null;for(let n=0;n<this.searchMatchList.length;n++){const s=this.searchMatchList[n];i!==s.groupId&&(i=s.groupId,t+=1)}return{index:e,count:t}}getMatchList(e,t){const i=e.toLocaleLowerCase(),n=[],s=[],l=t.length,a=[];for(let u=0;u<l;u++)t[u].type===D.TABLE&&a.push(u);let c=0,d=0;for(;d<l-1;){const u=a.length?a[c]:l,f=t.slice(d,u);f.length&&s.push({index:d,type:di.PAGE,elementList:f});const g=t[u];g&&s.push({index:u,type:di.TABLE,elementList:[g]}),d=u+1,c++}function h(u,f,g,R){if(!u)return;const p=g.map(b=>{var P,N;return!b.type||yt.includes(b.type)&&b.controlComponent!==E.CHECKBOX&&!((P=b.control)!=null&&P.hide)&&!((N=b.area)!=null&&N.hide)?b.value:j}).filter(Boolean).join("").toLocaleLowerCase(),M=[];let S=p.indexOf(u);for(;S!==-1;)M.push(S),S=p.indexOf(u,S+u.length);for(let b=0;b<M.length;b++){const P=M[b],N=pe();for(let m=0;m<u.length;m++){const T=P+m+(R?.startIndex||0);n.push(B({type:f,index:T,groupId:N},R))}}}for(let u=0;u<s.length;u++){const f=s[u];if(f.type===di.TABLE){const g=f.elementList[0];for(let R=0;R<g.trList.length;R++){const p=g.trList[R];for(let M=0;M<p.tdList.length;M++){const S=p.tdList[M],b={tableId:g.id,tableIndex:f.index,trIndex:R,tdIndex:M,tdId:S.id};h(i,f.type,S.value,b)}}}else h(i,f.type,f.elementList,{startIndex:f.index})}return n}compute(e){this.searchMatchList=this.getMatchList(e,this.draw.getOriginalElementList())}render(e,t){var i,n;if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:s,searchMatchColor:l,searchNavigateMatchColor:a}=this.options,c=this.position.getOriginalPositionList(),d=this.draw.getOriginalElementList();e.save(),e.globalAlpha=s;for(let h=0;h<this.searchMatchList.length;h++){const u=this.searchMatchList[h];let f=null;if(u.type===di.TABLE){const{tableIndex:T,trIndex:y,tdIndex:x,index:I}=u;f=(n=(i=d[T])==null?void 0:i.trList[y].tdList[x])==null?void 0:n.positionList[I]}else f=c[u.index];if(!f)continue;const{coordinate:{leftTop:g,leftBottom:R,rightTop:p},pageNo:M}=f;if(M!==t)continue;if(this.getSearchNavigateIndexList().includes(h)){e.fillStyle=a;const T=this.searchMatchList[h-1];(!T||T.groupId!==u.groupId)&&this.searchNavigateScrollIntoView(f)}else e.fillStyle=l;const b=g[0],P=g[1],N=p[0]-g[0],m=R[1]-g[1];e.fillRect(b,P,N,m)}e.restore()}replace(e,t){var i,n,s,l;if(this.draw.isReadonly()||!e||new RegExp(`${j}`,"g").test(e))return;let c=this.getSearchMatchList();const d=t?.index;if(wo(d)){const P=[];c.forEach(N=>{const m=P[P.length-1];!m||m[0].groupId!==N.groupId?P.push([N]):m.push(N)}),c=P[d]}if(!c?.length)return;const h=this.draw.isDesignMode();let u=0,f=0,g="",R="",p=-1;const M=this.draw.getOriginalElementList();for(let P=0;P<c.length;P++){const N=c[P];if(N.type===di.TABLE){const{tableIndex:m,trIndex:T,tdIndex:y,index:x,tdId:I}=N;R&&I!==R&&(f=0),R=I;const V=m+u,F=M[V].trList[T].tdList[y].value,L=x+f,w=F[L];if(!h&&(((i=w?.control)==null?void 0:i.deletable)===!1||((n=w?.title)==null?void 0:n.deletable)===!1))continue;if(g===N.groupId){this.draw.spliceElementList(F,L,1),f--;continue}~p||(p=P);for(let v=0;v<e.length;v++){const X=e[v];v===0?w.value=X:(this.draw.spliceElementList(F,L+v,0,[oe(B({},w),{value:X})]),f++)}}else{const m=N.index+u,T=M[m];if(!h&&(((s=T?.control)==null?void 0:s.deletable)===!1||((l=T?.title)==null?void 0:l.deletable)===!1)||T.type===D.CONTROL&&T.controlComponent!==E.VALUE)continue;if(~p||(p=P),g===N.groupId){this.draw.spliceElementList(M,m,1),u--;continue}for(let y=0;y<e.length;y++){const x=e[y];y===0?T.value=x:(this.draw.spliceElementList(M,m+y,0,[oe(B({},T),{value:x})]),u++)}}g=N.groupId}if(!~p)return;const S=c[p],b=S.index+(e.length-1);if(S.type===di.TABLE){const{tableIndex:P,trIndex:N,tdIndex:m,index:T}=S,y=M[P].trList[N].tdList[m].value[T];this.position.setPositionContext({isTable:!0,index:P,trIndex:N,tdIndex:m,tdId:y.tdId,trId:y.trId,tableId:y.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(b,b),this.draw.render({curIndex:b})}}class Og extends _o{constructor(e){super(),O(this,"options"),this.options=e.getOptions()}render(e){if(!this.fillRect.width)return;const{scale:t,strikeoutColor:i}=this.options,{x:n,y:s,width:l}=this.fillRect;e.save(),e.lineWidth=t,e.strokeStyle=i;const a=s+.5;e.beginPath(),e.moveTo(n,a),e.lineTo(n+l,a),e.stroke(),e.restore(),this.clearFillInfo()}}var en;(function(r){r.SOLID="solid",r.DOUBLE="double",r.DASHED="dashed",r.DOTTED="dotted",r.WAVY="wavy"})(en||(en={}));var tn;(function(r){r.SOLID="solid",r.DASHED="dashed",r.DOTTED="dotted"})(tn||(tn={}));class Pg extends _o{constructor(e){super(),O(this,"options"),this.options=e.getOptions()}_drawLine(e,t,i,n,s){const l=t+n;switch(e.beginPath(),s){case tn.DASHED:e.setLineDash([3,1]);break;case tn.DOTTED:e.setLineDash([1,1]);break}e.moveTo(t,i),e.lineTo(l,i),e.stroke()}_drawDouble(e,t,i,n){const l=t+n,a=i+3*this.options.scale;e.beginPath(),e.moveTo(t,i),e.lineTo(l,i),e.stroke(),e.beginPath(),e.moveTo(t,a),e.lineTo(l,a),e.stroke()}_drawWave(e,t,i,n){const{scale:s}=this.options,l=1.2*s,a=1/s,c=i+2*l;e.beginPath();for(let d=0;d<n;d++){const h=l*Math.sin(a*d);e.lineTo(t+d,c+h)}e.stroke()}render(e){if(!this.fillRect.width)return;const{underlineColor:t,scale:i}=this.options,{x:n,y:s,width:l}=this.fillRect;e.save(),e.strokeStyle=this.fillColor||t,e.lineWidth=i;const a=Math.floor(s+2*e.lineWidth)+.5;switch(this.fillDecorationStyle){case en.WAVY:this._drawWave(e,n,a,l);break;case en.DOUBLE:this._drawDouble(e,n,a,l);break;case en.DASHED:this._drawLine(e,n,a,l,tn.DASHED);break;case en.DOTTED:this._drawLine(e,n,a,l,tn.DOTTED);break;default:this._drawLine(e,n,a,l);break}e.restore(),this.clearFillInfo()}}class Tg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"ctx"),O(this,"curX"),O(this,"curY"),O(this,"text"),O(this,"curStyle"),O(this,"curColor"),O(this,"cacheMeasureText"),this.draw=e,this.options=e.getOptions(),this.ctx=e.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(e,t){e.save(),e.font=t;const i=this.measureText(e,{value:wu});return e.restore(),i}measureWord(e,t,i){const n=this.draw.getLetterReg();let s=0,l=t[i],a=i;for(;a<t.length;){const c=t[a];if(c.type&&c.type!==D.TEXT||!n.test(c.value)){l=c;break}s+=this.measureText(e,c).width,a++}return{width:s,endElement:l}}measurePunctuationWidth(e,t){return!t||!Iu.includes(t.value)?0:this.measureText(e,t).width}measureText(e,t){if(t.width){const l=e.measureText(t.value);return{width:t.width,actualBoundingBoxAscent:l.actualBoundingBoxAscent,actualBoundingBoxDescent:l.actualBoundingBoxDescent,actualBoundingBoxLeft:l.actualBoundingBoxLeft,actualBoundingBoxRight:l.actualBoundingBoxRight,fontBoundingBoxAscent:l.fontBoundingBoxAscent,fontBoundingBoxDescent:l.fontBoundingBoxDescent}}const i=`${t.value}${e.font}`,n=this.cacheMeasureText.get(i);if(n)return n;const s=e.measureText(t.value);return this.cacheMeasureText.set(i,s),s}complete(){this._render(),this.text=""}record(e,t,i,n){if(this.ctx=e,this.options.renderMode===Rs.COMPATIBILITY){this._setCurXY(i,n),this.text=t.value,this.curStyle=t.style,this.curColor=t.color,this.complete();return}this.text||this._setCurXY(i,n),(this.curStyle&&t.style!==this.curStyle||t.color!==this.curColor)&&(this.complete(),this._setCurXY(i,n)),this.text+=t.value,this.curStyle=t.style,this.curColor=t.color}_setCurXY(e,t){this.curX=e,this.curY=t}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class nn{constructor(e){O(this,"draw"),O(this,"options"),this.draw=e,this.options=e.getOptions()}static formatNumberPlaceholder(e,t,i,n){const s=n===In.CHINESE?Du(t):`${t}`;return e.replace(i,s)}render(e,t){const{scale:i,pageNumber:{size:n,font:s,color:l,rowFlex:a,numberType:c,format:d,startPageNo:h,fromPageNo:u}}=this.options;if(t<u)return;let f=d;const g=new RegExp(wn.PAGE_NO);g.test(f)&&(f=nn.formatNumberPlaceholder(f,t+h-u,g,c));const R=new RegExp(wn.PAGE_COUNT);R.test(f)&&(f=nn.formatNumberPlaceholder(f,this.draw.getPageCount()-u,R,c));const p=this.draw.getWidth(),M=this.draw.getHeight(),S=this.draw.getPageNumberBottom(),b=M-S;e.save(),e.fillStyle=l,e.font=`${n*i}px ${s}`;let P=0;const N=this.draw.getMargins(),{width:m}=e.measureText(f);a===Re.CENTER?P=(p-m)/2:a===Re.RIGHT?P=p-m-N[1]:P=N[3],e.fillText(f,P,b),e.restore()}}class Ig{constructor(e){O(this,"draw"),O(this,"options"),O(this,"scrollContainer"),O(this,"_observer",Tr(()=>{const{intersectionPageNo:t,visiblePageNoList:i}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(t),this.draw.setVisiblePageNoList(i)},150)),this.draw=e,this.options=e.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(e){const t=e.getBoundingClientRect(),i=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,n=Math.min(t.bottom,i)-Math.max(t.top,0);return{intersectionHeight:n>0?n:0}}getPageVisibleInfo(){const e=this.draw.getPageList(),t=[];let i=0,n=0;for(let s=0;s<e.length;s++){const l=e[s],{intersectionHeight:a}=this.getElementVisibleInfo(l);if(n&&!a)break;a&&t.push(s),a>n&&(n=a,i=s)}return{intersectionPageNo:i,visiblePageNoList:t}}}class xg{constructor(e){O(this,"step",5),O(this,"thresholdPoints",[70,40,10,20]),O(this,"selectionContainer"),O(this,"rangeManager"),O(this,"requestAnimationFrameId"),O(this,"isMousedown"),O(this,"isMoving"),O(this,"clientWidth"),O(this,"clientHeight"),O(this,"containerRect"),O(this,"_mousedown",()=>{if(this.isMousedown=!0,this.clientWidth=this.selectionContainer instanceof Document?document.documentElement.clientWidth:this.selectionContainer.clientWidth,this.clientHeight=this.selectionContainer instanceof Document?document.documentElement.clientHeight:this.selectionContainer.clientHeight,!(this.selectionContainer instanceof Document)){const i=this.selectionContainer.getBoundingClientRect();this.containerRect=i}}),O(this,"_mouseup",()=>{this.isMousedown=!1,this._stopMove()}),O(this,"_mousemove",i=>{if(!this.isMousedown||this.rangeManager.getIsCollapsed())return;let{x:n,y:s}=i;this.containerRect&&(n=n-this.containerRect.x,s=s-this.containerRect.y),s<this.thresholdPoints[0]?this._startMove(He.UP):this.clientHeight-s<=this.thresholdPoints[1]?this._startMove(He.DOWN):n<this.thresholdPoints[2]?this._startMove(He.LEFT):this.clientWidth-n<this.thresholdPoints[3]?this._startMove(He.RIGHT):this._stopMove()}),this.rangeManager=e.getRange();const{scrollContainerSelector:t}=e.getOptions();this.selectionContainer=t&&document.querySelector(t)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const e=this.selectionContainer;e.addEventListener("mousedown",this._mousedown),e.addEventListener("mousemove",this._mousemove),e.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const e=this.selectionContainer;e.removeEventListener("mousedown",this._mousedown),e.removeEventListener("mousemove",this._mousemove),e.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_move(e){const t=this.selectionContainer instanceof Document?window:this.selectionContainer,i=this.selectionContainer instanceof Document?window.scrollX:t.scrollLeft,n=this.selectionContainer instanceof Document?window.scrollY:t.scrollTop;e===He.DOWN?t.scrollTo(i,n+this.step):e===He.UP?t.scrollTo(i,n-this.step):e===He.LEFT?t.scrollTo(i-this.step,n):t.scrollTo(i+this.step,n),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,e))}_startMove(e){this.isMoving||(this.isMoving=!0,this._move(e))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class wg{constructor(e){O(this,"draw"),O(this,"range"),O(this,"options"),this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}getTrListGroupByCol(e){var t;const i=Ne(e);for(let n=0;n<e.length;n++){const s=i[n];for(let l=s.tdList.length-1;l>=0;l--){const a=s.tdList[l],{rowspan:c,rowIndex:d,colIndex:h}=a,u=d+c-1;if(u!==l){const f=s.tdList.splice(l,1)[0];(t=i[u])==null||t.tdList.splice(h,0,f)}}}return i}getRangeRowCol(){const{isTable:e,index:t,trIndex:i,tdIndex:n}=this.draw.getPosition().getPositionContext();if(!e)return null;const{isCrossRowCol:s,startTdIndex:l,endTdIndex:a,startTrIndex:c,endTrIndex:d}=this.range.getRange(),f=this.draw.getOriginalElementList()[t].trList;if(!s)return[[f[i].tdList[n]]];let g=f[c].tdList[l],R=f[d].tdList[a];(g.x>R.x||g.y>R.y)&&([g,R]=[R,g]);const p=g.colIndex,M=R.colIndex+(R.colspan-1),S=g.rowIndex,b=R.rowIndex+(R.rowspan-1),P=[];for(let N=0;N<f.length;N++){const m=f[N],T=[];for(let y=0;y<m.tdList.length;y++){const x=m.tdList[y],I=x.colIndex,V=x.rowIndex;I>=p&&I<=M&&V>=S&&V<=b&&T.push(x)}T.length&&P.push(T)}return P.length?P:null}_drawOuterBorder(e){const{ctx:t,startX:i,startY:n,width:s,height:l,isDrawFullBorder:a,borderExternalWidth:c}=e,{scale:d}=this.options,h=t.lineWidth;c&&(t.lineWidth=c*d),t.beginPath();const u=Math.round(i),f=Math.round(n);t.translate(.5,.5),a?t.rect(u,f,s,l):(t.moveTo(u,f+l),t.lineTo(u,f),t.lineTo(u+s,f)),t.stroke(),c&&(t.lineWidth=h),t.translate(-.5,-.5)}_drawSlash(e,t,i,n){var s,l;const{scale:a}=this.options;e.save();const c=t.width*a,d=t.height*a,h=Math.round(t.x*a+i),u=Math.round(t.y*a+n);(s=t.slashTypes)!=null&&s.includes($i.FORWARD)&&(e.moveTo(h+c,u),e.lineTo(h,u+d)),(l=t.slashTypes)!=null&&l.includes($i.BACK)&&(e.moveTo(h,u),e.lineTo(h+c,u+d)),e.stroke(),e.restore()}_drawBorder(e,t,i,n){var s,l,a,c,d,h;const{colgroup:u,trList:f,borderType:g,borderColor:R,borderWidth:p=1,borderExternalWidth:M}=t;if(!u||!f)return;const{scale:S,table:{defaultBorderColor:b}}=this.options,P=t.width*S,N=t.height*S,m=g===ut.EMPTY,T=g===ut.EXTERNAL,y=g===ut.INTERNAL;e.save(),g===ut.DASH&&e.setLineDash([3,3]),e.lineWidth=p*S,e.strokeStyle=R||b,!m&&!y&&this._drawOuterBorder({ctx:e,startX:i,startY:n,width:P,height:N,borderExternalWidth:M,isDrawFullBorder:T});for(let x=0;x<f.length;x++){const I=f[x];for(let V=0;V<I.tdList.length;V++){const F=I.tdList[V];if((s=F.slashTypes)!=null&&s.length&&this._drawSlash(e,F,i,n),!((l=F.borderTypes)!=null&&l.length)&&(m||T))continue;const L=F.width*S,w=F.height*S,v=Math.round(F.x*S+i+L),X=Math.round(F.y*S+n);if(e.translate(.5,.5),e.beginPath(),(a=F.borderTypes)!=null&&a.includes(Mt.TOP)&&(e.moveTo(v-L,X),e.lineTo(v,X),e.stroke()),(c=F.borderTypes)!=null&&c.includes(Mt.RIGHT)&&(e.moveTo(v,X),e.lineTo(v,X+w),e.stroke()),(d=F.borderTypes)!=null&&d.includes(Mt.BOTTOM)&&(e.moveTo(v,X+w),e.lineTo(v-L,X+w),e.stroke()),(h=F.borderTypes)!=null&&h.includes(Mt.LEFT)&&(e.moveTo(v-L,X),e.lineTo(v-L,X+w),e.stroke()),!m&&!T){if((!y||F.colIndex+F.colspan<u.length)&&(e.moveTo(v,X),e.lineTo(v,X+w),M&&M!==p&&F.colIndex+F.colspan===u.length)){const C=e.lineWidth;e.lineWidth=M*S,e.stroke(),e.beginPath(),e.lineWidth=C}if(!y||F.rowIndex+F.rowspan<f.length){const C=M&&M!==p&&F.rowIndex+F.rowspan===f.length;if(C&&(e.stroke(),e.beginPath()),e.moveTo(v,X+w),e.lineTo(v-L,X+w),C){const Z=e.lineWidth;e.lineWidth=M*S,e.stroke(),e.beginPath(),e.lineWidth=Z}}e.stroke()}e.translate(-.5,-.5)}}e.restore()}_drawBackgroundColor(e,t,i,n){const{trList:s}=t;if(!s)return;const{scale:l}=this.options;for(let a=0;a<s.length;a++){const c=s[a];for(let d=0;d<c.tdList.length;d++){const h=c.tdList[d];if(!h.backgroundColor)continue;e.save();const u=h.width*l,f=h.height*l,g=Math.round(h.x*l+i),R=Math.round(h.y*l+n);e.fillStyle=h.backgroundColor,e.fillRect(g,R,u,f),e.restore()}}}getTableWidth(e){return e.colgroup.reduce((t,i)=>t+i.width,0)}getTableHeight(e){const t=e.trList;return t?.length?this.getTdListByColIndex(t,0).reduce((i,n)=>i+n.height,0):0}getRowCountByColIndex(e,t){return this.getTdListByColIndex(e,t).reduce((i,n)=>i+n.rowspan,0)}getTdListByColIndex(e,t){const i=[];for(let n=0;n<e.length;n++){const s=e[n].tdList;for(let l=0;l<s.length;l++){const a=s[l],c=a.colIndex,d=c+a.colspan-1;t>=c&&t<=d&&i.push(a)}}return i}getTdListByRowIndex(e,t){const i=[];for(let n=0;n<e.length;n++){const s=e[n].tdList;for(let l=0;l<s.length;l++){const a=s[l],c=a.rowIndex,d=c+a.rowspan-1;t>=c&&t<=d&&i.push(a)}}return i}computeRowColInfo(e){const{colgroup:t,trList:i}=e;if(!t||!i)return;let n=0;for(let s=0;s<i.length;s++){const l=i[s],a=i.length-1===s;for(let c=0;c<l.tdList.length;c++){const d=l.tdList[c];let h=0;if(i.length>1&&s!==0){const S=l.tdList[c-1],b=S?S.colIndex+S.colspan:c;for(let P=b;P<t.length;P++)if(this.getRowCountByColIndex(i.slice(0,s),P)===s){h=P;let m=0;for(let T=0;T<P;T++)m+=t[T].width;n=m;break}}else{const S=l.tdList[c-1];S&&(h=S.colIndex+S.colspan)}let u=0;for(let S=0;S<d.colspan;S++)u+=t[S+h].width;let f=0;for(let S=0;S<d.rowspan;S++){const b=i[S+s]||i[s];f+=b.height}const g=l.tdList.length-1===c;let R=a;if(!R&&d.rowspan>1){const S=i.length-1-s;R=d.rowspan-1===S}const p=a&&g;d.isLastRowTd=g,d.isLastColTd=R,d.isLastTd=p,d.x=n;let M=0;for(let S=0;S<s;S++){const b=i[S].tdList;for(let P=0;P<b.length;P++){const N=b[P];if(h>=N.colIndex&&h<N.colIndex+N.colspan){M+=N.height;break}}}d.y=M,d.width=u,d.height=f,d.rowIndex=s,d.colIndex=h,d.trIndex=s,d.tdIndex=c,n+=u,g&&!p&&(n=0)}}}drawRange(e,t,i,n){const{scale:s,rangeAlpha:l,rangeColor:a}=this.options,{type:c,trList:d}=t;if(!d||c!==D.TABLE)return;const{isCrossRowCol:h,startTdIndex:u,endTdIndex:f,startTrIndex:g,endTrIndex:R}=this.range.getRange();if(!h)return;let p=d[g].tdList[u],M=d[R].tdList[f];(p.x>M.x||p.y>M.y)&&([p,M]=[M,p]);const S=p.colIndex,b=M.colIndex+(M.colspan-1),P=p.rowIndex,N=M.rowIndex+(M.rowspan-1);e.save();for(let m=0;m<d.length;m++){const T=d[m];for(let y=0;y<T.tdList.length;y++){const x=T.tdList[y],I=x.colIndex,V=x.rowIndex;if(I>=S&&I<=b&&V>=P&&V<=N){const F=x.x*s,L=x.y*s,w=x.width*s,v=x.height*s;e.globalAlpha=l,e.fillStyle=a,e.fillRect(F+i,L+n,w,v)}}}e.restore()}render(e,t,i,n){this._drawBackgroundColor(e,t,i,n),this._drawBorder(e,t,i,n)}}var hi;(function(r){r.ROW="row",r.COL="col"})(hi||(hi={}));class yg{constructor(e){O(this,"MIN_TD_WIDTH",20),O(this,"ROW_COL_OFFSET",18),O(this,"ROW_COL_QUICK_WIDTH",16),O(this,"ROW_COL_QUICK_OFFSET",5),O(this,"ROW_COL_QUICK_POSITION",this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2),O(this,"BORDER_VALUE",4),O(this,"TABLE_SELECT_OFFSET",20),O(this,"draw"),O(this,"canvas"),O(this,"options"),O(this,"position"),O(this,"range"),O(this,"container"),O(this,"toolRowContainer"),O(this,"toolRowAddBtn"),O(this,"toolColAddBtn"),O(this,"toolTableSelectBtn"),O(this,"toolColContainer"),O(this,"toolBorderContainer"),O(this,"anchorLine"),O(this,"mousedownX"),O(this,"mousedownY"),this.draw=e,this.canvas=e.getPage(),this.options=e.getOptions(),this.position=e.getPosition(),this.range=e.getRange(),this.container=e.getContainer(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){var e,t,i,n,s,l;(e=this.toolRowContainer)==null||e.remove(),(t=this.toolRowAddBtn)==null||t.remove(),(i=this.toolColAddBtn)==null||i.remove(),(n=this.toolTableSelectBtn)==null||n.remove(),(s=this.toolColContainer)==null||s.remove(),(l=this.toolBorderContainer)==null||l.remove(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){const{isTable:e,index:t,trIndex:i,tdIndex:n}=this.position.getPositionContext();if(!e)return;this.dispose();const s=this.draw.getOriginalElementList(),l=this.position.getOriginalPositionList(),a=s[t];if(a.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:c}=this.options,d=l[t],{colgroup:h,trList:u}=a,{coordinate:{leftTop:f}}=d,g=this.draw.getHeight(),R=this.draw.getPageGap(),p=this.draw.getPageNo()*(g+R),M=f[0],S=f[1]+p,b=a.trList[i].tdList[n],P=b.rowIndex,N=b.colIndex,m=a.height*c,T=a.width*c,y=document.createElement("div");y.classList.add(`${ie}-table-tool__select`),y.style.height=`${m*c}`,y.style.left=`${M}px`,y.style.top=`${S}px`,y.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*c}px, ${-this.TABLE_SELECT_OFFSET*c}px)`,y.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(y),this.toolTableSelectBtn=y;const x=u.map(X=>X.height),I=document.createElement("div");I.classList.add(`${ie}-table-tool__row`),I.style.transform=`translateX(-${this.ROW_COL_OFFSET*c}px)`;for(let X=0;X<x.length;X++){const C=x[X]*c,Z=document.createElement("div");Z.classList.add(`${ie}-table-tool__row__item`),X===P&&Z.classList.add("active"),Z.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByRowIndex(u,X),Y=Q[0],W=Q[Q.length-1];this.position.setPositionContext({index:t,isTable:!0,trIndex:Y.trIndex,tdIndex:Y.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,Y.tdIndex,W.tdIndex,Y.trIndex,W.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(I,X)};const k=document.createElement("div");k.classList.add(`${ie}-table-tool__anchor`),k.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:X,order:hi.ROW})},Z.append(k),Z.style.height=`${C}px`,I.append(Z)}I.style.left=`${M}px`,I.style.top=`${S}px`,this.container.append(I),this.toolRowContainer=I;const V=document.createElement("div");V.classList.add(`${ie}-table-tool__quick__add`),V.style.height=`${m*c}`,V.style.left=`${M}px`,V.style.top=`${S+m}px`,V.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*c}px, ${this.ROW_COL_QUICK_OFFSET*c}px)`,V.onclick=()=>{this.position.setPositionContext({index:t,isTable:!0,trIndex:u.length-1,tdIndex:0,tableId:a.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(V),this.toolRowAddBtn=V;const F=h.map(X=>X.width),L=document.createElement("div");L.classList.add(`${ie}-table-tool__col`),L.style.transform=`translateY(-${this.ROW_COL_OFFSET*c}px)`;for(let X=0;X<F.length;X++){const C=F[X]*c,Z=document.createElement("div");Z.classList.add(`${ie}-table-tool__col__item`),X===N&&Z.classList.add("active"),Z.onclick=()=>{const Q=this.draw.getTableParticle().getTdListByColIndex(u,X),Y=Q[0],W=Q[Q.length-1];this.position.setPositionContext({index:t,isTable:!0,trIndex:Y.trIndex,tdIndex:Y.tdIndex,tableId:a.id}),this.range.setRange(0,0,a.id,Y.tdIndex,W.tdIndex,Y.trIndex,W.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(L,X)};const k=document.createElement("div");k.classList.add(`${ie}-table-tool__anchor`),k.onmousedown=Q=>{this._mousedown({evt:Q,element:a,index:X,order:hi.COL})},Z.append(k),Z.style.width=`${C}px`,L.append(Z)}L.style.left=`${M}px`,L.style.top=`${S}px`,this.container.append(L),this.toolColContainer=L;const w=document.createElement("div");w.classList.add(`${ie}-table-tool__quick__add`),w.style.height=`${m*c}`,w.style.left=`${M+T}px`,w.style.top=`${S}px`,w.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*c}px, -${this.ROW_COL_QUICK_POSITION*c}px)`,w.onclick=()=>{this.position.setPositionContext({index:t,isTable:!0,trIndex:0,tdIndex:u[0].tdList.length-1||0,tableId:a.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(w),this.toolColAddBtn=w;const v=document.createElement("div");v.classList.add(`${ie}-table-tool__border`),v.style.height=`${m}px`,v.style.width=`${T}px`,v.style.left=`${M}px`,v.style.top=`${S}px`;for(let X=0;X<u.length;X++){const C=u[X];for(let Z=0;Z<C.tdList.length;Z++){const k=C.tdList[Z],Q=document.createElement("div");Q.classList.add(`${ie}-table-tool__border__row`),Q.style.width=`${k.width*c}px`,Q.style.height=`${this.BORDER_VALUE}px`,Q.style.top=`${(k.y+k.height)*c-this.BORDER_VALUE/2}px`,Q.style.left=`${k.x*c}px`,Q.onmousedown=W=>{this._mousedown({evt:W,element:a,index:k.rowIndex+k.rowspan-1,order:hi.ROW})},v.appendChild(Q);const Y=document.createElement("div");Y.classList.add(`${ie}-table-tool__border__col`),Y.style.width=`${this.BORDER_VALUE}px`,Y.style.height=`${k.height*c}px`,Y.style.top=`${k.y*c}px`,Y.style.left=`${(k.x+k.width)*c-this.BORDER_VALUE/2}px`,Y.onmousedown=W=>{this._mousedown({evt:W,element:a,index:k.colIndex+k.colspan-1,order:hi.COL})},v.appendChild(Y)}}this.container.append(v),this.toolBorderContainer=v}_setAnchorActive(e,t){const i=e.children;for(let n=0;n<i.length;n++){const s=i[n];n===t?s.classList.add("active"):s.classList.remove("active")}}_mousedown(e){const{evt:t,index:i,order:n,element:s}=e;this.canvas=this.draw.getPage();const{scale:l}=this.options,a=this.draw.getWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),h=this.draw.getPageNo()*(c+d);this.mousedownX=t.x,this.mousedownY=t.y;const u=t.target,f=this.canvas.getBoundingClientRect(),g=window.getComputedStyle(u).cursor;document.body.style.cursor=g,this.canvas.style.cursor=g;let R=0,p=0;const M=document.createElement("div");M.classList.add(`${ie}-table-anchor__line`),n===hi.ROW?(M.classList.add(`${ie}-table-anchor__line__row`),M.style.width=`${a}px`,R=0,p=h+this.mousedownY-f.top):(M.classList.add(`${ie}-table-anchor__line__col`),M.style.height=`${c}px`,R=this.mousedownX-f.left,p=h),M.style.left=`${R}px`,M.style.top=`${p}px`,this.container.append(M),this.anchorLine=M;let S=0,b=0;const P=N=>{const m=this._mousemove(N,n,R,p);m&&(S=m.dx,b=m.dy)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",()=>{var N;let m=!1;if(n===hi.ROW){const T=s.trList,y=T[i]||T[i-1],{defaultTrMinHeight:x}=this.options.table;b<0&&y.height+b<x&&(b=x-y.height),b&&(y.height+=b,y.minHeight=y.height,m=!0)}else{const{colgroup:T}=s;if(T&&S){const y=this.draw.getInnerWidth(),x=T[i].width;S<0&&x+S<this.MIN_TD_WIDTH&&(S=this.MIN_TD_WIDTH-x);const I=(N=T[i+1])==null?void 0:N.width;S>0&&I&&I-S<this.MIN_TD_WIDTH&&(S=I-this.MIN_TD_WIDTH);const V=x+S;if(i===T.length-1){let F=0;for(let L=0;L<T.length;L++){const w=T[L];L===i+1&&(F-=S),L===i&&(F+=V),L!==i&&(F+=w.width)}if(F>y){const L=s.width;S=y-L}}S&&(T.length-1!==i&&(T[i+1].width-=S/l),T[i].width+=S/l,m=!0)}}m&&this.draw.render({isSetCursor:!1}),M.remove(),document.removeEventListener("mousemove",P),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(e,t,i,n){if(!this.anchorLine)return null;const s=e.x-this.mousedownX,l=e.y-this.mousedownY;return t===hi.ROW?this.anchorLine.style.top=`${n+l}px`:this.anchorLine.style.left=`${i+s}px`,e.preventDefault(),{dx:s,dy:l}}}class Vg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"container"),O(this,"hyperlinkPopupContainer"),O(this,"hyperlinkDom"),this.draw=e,this.options=e.getOptions(),this.container=e.getContainer();const{hyperlinkPopupContainer:t,hyperlinkDom:i}=this._createHyperlinkPopupDom();this.hyperlinkDom=i,this.hyperlinkPopupContainer=t}_createHyperlinkPopupDom(){const e=document.createElement("div");e.classList.add(`${ie}-hyperlink-popup`);const t=document.createElement("a");return t.target="_blank",t.rel="noopener",e.append(t),this.container.append(e),{hyperlinkPopupContainer:e,hyperlinkDom:t}}drawHyperlinkPopup(e,t){const{coordinate:{leftTop:[i,n]},lineHeight:s}=t,l=this.draw.getHeight(),a=this.draw.getPageGap(),c=this.draw.getPageNo()*(l+a);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${i}px`,this.hyperlinkPopupContainer.style.top=`${n+c+s}px`;const d=e.url||"#";this.hyperlinkDom.href=d,this.hyperlinkDom.title=d,this.hyperlinkDom.innerText=d}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(e){const t=window.open(e.url,"_blank");t&&(t.opener=null)}render(e,t,i,n){e.save(),e.font=t.style,t.color||(t.color=this.options.defaultHyperlinkColor),e.fillStyle=t.color,t.underline===void 0&&(t.underline=!0),e.fillText(t.value,i,n),e.restore()}}class Fg{constructor(e,t){O(this,"draw"),O(this,"position"),O(this,"zone"),O(this,"options"),O(this,"elementList"),O(this,"rowList"),O(this,"positionList"),this.draw=e,this.position=e.getPosition(),this.zone=e.getZone(),this.options=e.getOptions(),this.elementList=t||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(e){this.elementList=e}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const e=this.draw.getInnerWidth(),t=this.draw.getMargins(),i=Br(this.elementList);this.rowList=this.draw.computeRowList({startX:t[3],startY:this.getHeaderTop(),innerWidth:e,elementList:this.elementList,surroundElementList:i})}_computePositionList(){const e=this.getHeaderTop(),t=this.draw.getInnerWidth(),n=this.draw.getMargins()[3],s=e;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:n,startY:s,innerWidth:t,zone:de.HEADER})}getHeaderTop(){const{header:{top:e,disabled:t},scale:i}=this.options;return t?0:Math.floor(e*i)}getMaxHeight(){const{header:{maxHeightRadio:e}}=this.options,t=this.draw.getHeight();return Math.floor(t*Pr[e])}getHeight(){const e=this.getMaxHeight(),t=this.getRowHeight();return t>e?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),n=this.getHeaderTop()+t-e[0];return n<=0?0:n}render(e,t){e.save(),e.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const i=this.draw.getInnerWidth(),n=this.getMaxHeight(),s=[];let l=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(l+c.height>n)break;s.push(c),l+=c.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:s,pageNo:t,startIndex:0,innerWidth:i,zone:de.HEADER}),e.restore()}}class Xg{getOffsetY(e){return-e.metrics.height/2}render(e,t,i,n){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,i,n+this.getOffsetY(t)),e.restore()}}class Cg{getOffsetY(e){return e.metrics.height/2}render(e,t,i,n){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,i,n+this.getOffsetY(t)),e.restore()}}class vg{constructor(e){O(this,"options"),this.options=e.getOptions()}render(e,t,i,n){var s;e.save();const{scale:l,separator:{lineWidth:a,strokeStyle:c}}=this.options;e.lineWidth=a*l,e.strokeStyle=t.color||c,(s=t.dashArray)!=null&&s.length&&e.setLineDash(t.dashArray);const d=Math.round(n);e.translate(0,e.lineWidth/2),e.beginPath(),e.moveTo(i,d),e.lineTo(i+t.width*l,d),e.stroke(),e.restore()}}class Wg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"i18n"),this.draw=e,this.options=e.getOptions(),this.i18n=e.getI18n()}render(e,t,i,n){const{pageBreak:{font:s,fontSize:l,lineDash:a}}=this.options,c=this.i18n.t("pageBreak.displayName"),{scale:d,defaultRowMargin:h}=this.options,u=l*d,f=t.width*d,g=this.draw.getDefaultBasicRowMarginHeight()*h;e.save(),e.font=`${u}px ${s}`;const R=e.measureText(c),p=(f-R.width)/2;e.setLineDash(a),e.translate(0,.5+g),e.beginPath(),e.moveTo(i,n),e.lineTo(i+p,n),e.moveTo(i+p+R.width,n),e.lineTo(i+f,n),e.stroke(),e.fillText(c,i+p,n+R.actualBoundingBoxAscent-u/2),e.restore()}}class kg{constructor(e){O(this,"draw"),O(this,"options"),O(this,"imageCache"),this.draw=e,this.options=e.getOptions(),this.imageCache=new Map}renderText(e,t){const{watermark:{data:i,opacity:n,font:s,size:l,color:a,repeat:c,gap:d,numberType:h},scale:u}=this.options,f=this.draw.getWidth(),g=this.draw.getHeight();e.save(),e.globalAlpha=n,e.font=`${l*u}px ${s}`;let R=i;const p=new RegExp(wn.PAGE_NO);p.test(R)&&(R=nn.formatNumberPlaceholder(R,t+1,p,h));const M=new RegExp(wn.PAGE_COUNT);M.test(R)&&(R=nn.formatNumberPlaceholder(R,this.draw.getPageCount(),M,h));const S=e.measureText(R);if(c){const b=this.draw.getPagePixelRatio(),P=document.createElement("canvas"),N=P.getContext("2d"),m=S.width,T=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent,y=Math.sqrt(Math.pow(m,2)+Math.pow(T,2)),x=y+2*d[0]*u,I=y+2*d[1]*u;P.width=x,P.height=I,P.style.width=`${x*b}px`,P.style.height=`${I*b}px`,N.translate(x/2,I/2),N.rotate(-45*Math.PI/180),N.translate(-x/2,-I/2),N.font=`${l*u}px ${s}`,N.fillStyle=a,N.fillText(R,(x-m)/2,(I-T)/2+S.actualBoundingBoxAscent);const V=e.createPattern(P,"repeat");V&&(e.fillStyle=V,e.fillRect(0,0,f,g))}else{const b=f/2,P=g/2;e.fillStyle=a,e.translate(b,P),e.rotate(-45*Math.PI/180),e.fillText(R,-S.width/2,S.actualBoundingBoxAscent-l*u/2)}e.restore()}renderImage(e){const{watermark:{width:t,height:i,data:n,opacity:s,repeat:l,gap:a},scale:c}=this.options;if(!this.imageCache.has(n)){const g=new Image;g.setAttribute("crossOrigin","Anonymous"),g.src=n,g.onload=()=>{this.imageCache.set(n,g),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const d=this.draw.getWidth(),h=this.draw.getHeight(),u=t*c,f=i*c;if(e.save(),e.globalAlpha=s,l){const g=this.draw.getPagePixelRatio(),R=document.createElement("canvas"),p=R.getContext("2d"),M=Math.sqrt(Math.pow(u,2)+Math.pow(f,2)),S=M+2*a[0]*c,b=M+2*a[1]*c;R.width=S,R.height=b,R.style.width=`${S*g}px`,R.style.height=`${b*g}px`,p.translate(S/2,b/2),p.rotate(-45*Math.PI/180),p.translate(-S/2,-b/2),p.drawImage(this.imageCache.get(n),(S-u)/2,(b-f)/2,u,f);const P=e.createPattern(R,"repeat");P&&(e.fillStyle=P,e.fillRect(0,0,d,h))}else{const g=d/2,R=h/2;e.translate(g,R),e.rotate(-45*Math.PI/180),e.drawImage(this.imageCache.get(n),-u/2,-f/2,u,f)}e.restore()}render(e,t){this.options.watermark.type===ms.IMAGE?this.renderImage(e):this.renderText(e,t)}}class Dg{constructor(e){O(this,"draw"),O(this,"control"),O(this,"options"),O(this,"highlightList"),O(this,"highlightMatchResult"),this.draw=e.getDraw(),this.control=e,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(e,t){var i,n;const{control:{activeBackgroundColor:s,disabledBackgroundColor:l,existValueBackgroundColor:a,noValueBackgroundColor:c}}=this.options,d=e[t],h=this.draw.isPrintMode(),u=(i=this.control.getActiveControl())==null?void 0:i.getElement();let f=!1,g=!1,R=!1,p=!1;return d.highlight||(f=!h&&!!s&&!!u&&d.controlId===u.controlId&&!this.control.getIsRangeInPostfix()),f||(g=!h&&!!l&&!!((n=d.control)!=null&&n.disabled)),g||(R=!h&&!!a&&!!d.controlId&&this.control.getIsExistValueByElementListIndex(e,t)),R||(p=!h&&!!c&&!!d.controlId&&!this.control.getIsExistValueByElementListIndex(e,t)),(f?s:"")||(g?l:"")||(R?a:"")||(p?c:"")}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(e){this.highlightList=e}computeHighlightList(){const e=this.draw.getSearch(),t=(i,n)=>{let s=0;for(;s<i.length;){const l=i[s];if(s++,l.type===D.TABLE){const R=l.trList;for(let p=0;p<R.length;p++){const M=R[p];for(let S=0;S<M.tdList.length;S++){const b=M.tdList[S],P={tableId:l.id,tableIndex:s-1,trIndex:p,tdIndex:S,tdId:b.id};t(b.value,P)}}}const a=l?.control;if(!a)continue;const c=this.highlightList.findIndex(R=>R.id===l.controlId||a.conceptId&&a.conceptId===R.conceptId);if(!~c)continue;const d=s;let h=s;for(;h<i.length&&i[h].controlId===l.controlId;)h++;s=h;const u=i.slice(d,h).map(R=>R.controlComponent===E.VALUE?R:{value:j}),f=this.highlightList[c],{ruleList:g}=f;for(let R=0;R<g.length;R++){const p=g[R],M=e.getMatchList(p.keyword,u);this.highlightMatchResult.push(...M.map(S=>oe(B(B(B({},S),p),n),{index:S.index+d})))}}};this.highlightMatchResult=[],t(this.draw.getOriginalMainElementList())}renderHighlightList(e,t){var i,n,s;if(!((i=this.highlightMatchResult)!=null&&i.length))return;const{searchMatchAlpha:l,searchMatchColor:a}=this.options,c=this.draw.getPosition().getOriginalPositionList(),d=this.draw.getOriginalElementList();e.save();for(let h=0;h<this.highlightMatchResult.length;h++){const u=this.highlightMatchResult[h];let f=null;if(u.tableId){const{tableIndex:m,trIndex:T,tdIndex:y,index:x}=u;f=(s=(n=d[m])==null?void 0:n.trList[T].tdList[y])==null?void 0:s.positionList[x]}else f=c[u.index];if(!f)continue;const{coordinate:{leftTop:g,leftBottom:R,rightTop:p},pageNo:M}=f;if(M!==t)continue;e.fillStyle=u.backgroundColor||a,e.globalAlpha=u.alpha||l;const S=g[0],b=g[1],P=p[0]-g[0],N=R[1]-g[1];e.fillRect(S,b,P,N)}e.restore()}}class Eg{constructor(e){O(this,"borderRect"),O(this,"options"),this.borderRect=this.clearBorderInfo(),this.options=e.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(e,t,i,n){!this.borderRect.width&&(this.borderRect.x=e,this.borderRect.y=t,this.borderRect.height=n),this.borderRect.width+=i}render(e){if(!this.borderRect.width)return;const{scale:t,control:{borderWidth:i,borderColor:n}}=this.options,{x:s,y:l,width:a,height:c}=this.borderRect;e.save(),e.translate(0,1*t),e.lineWidth=i*t,e.strokeStyle=n,e.beginPath(),e.rect(s,l,a,c),e.stroke(),e.restore(),this.clearBorderInfo()}}class Cn{constructor(e,t){O(this,"element"),O(this,"control"),O(this,"isPopup"),O(this,"selectDom"),O(this,"options"),O(this,"VALUE_DELIMITER",","),O(this,"DEFAULT_MULTI_SELECT_DELIMITER",",");const i=t.getDraw();this.options=i.getOptions(),this.element=e,this.control=t,this.isPopup=!1,this.selectDom=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){var e,t;return(t=(e=this.element)==null?void 0:e.control)!=null&&t.code?this.element.control.code.split(","):[]}getText(e){var t,i;if(!((t=this.element)!=null&&t.control))return null;const n=this.element.control;if(!((i=n.valueSets)!=null&&i.length))return null;const s=n?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,l=n.valueSets,a=[];return e.forEach(c=>{const d=l.find(h=>h.code===c);d&&!Vr(d.value)&&a.push(d.value)}),a.join(s)||null}getValue(e={}){const t=e.elementList||this.control.getElementList(),{startIndex:i}=e.range||this.control.getRange(),n=t[i],s=[];let l=i;for(;l>0;){const c=t[l];if(c.controlId!==n.controlId||c.controlComponent===E.PREFIX||c.controlComponent===E.PRE_TEXT)break;c.controlComponent===E.VALUE&&s.unshift(c),l--}let a=i+1;for(;a<t.length;){const c=t[a];if(c.controlId!==n.controlId||c.controlComponent===E.POSTFIX||c.controlComponent===E.POST_TEXT)break;c.controlComponent===E.VALUE&&s.push(c),a++}return s}setValue(e,t={},i={}){var n,s;if(!((s=(n=this.element.control)==null?void 0:n.selectExclusiveOptions)!=null&&s.inputAble)||!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const l=t.elementList||this.control.getElementList(),a=t.range||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:c,endIndex:d}=a,h=this.control.getDraw();c!==d?h.spliceElementList(l,c+1,d-c):this.control.removePlaceholder(c,t);const u=l[c],f=u.type&&!yt.includes(u.type)||u.controlComponent===E.PREFIX||u.controlComponent===E.PRE_TEXT?Lt(u,["control","controlId",...ai]):Qt(u,["type"]),g=a.startIndex+1;for(let R=0;R<e.length;R++){const p=oe(B(B({},f),e[R]),{controlComponent:E.VALUE});$e(l,[p],c,{editorOptions:this.options}),h.spliceElementList(l,g+R,0,[p])}return g+e.length-1}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),i=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:s}=i,l=t[n],a=t[s];if(e.key===le.Backspace)return n!==s?this.clearSelect():l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT||a.controlComponent===E.POSTFIX||a.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):this.clearSelect();if(e.key===le.Delete){if(n!==s)return this.clearSelect();{const c=t[s+1];return(l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT)&&c.controlComponent===E.PLACEHOLDER||c.controlComponent===E.POSTFIX||c.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):this.clearSelect()}}return s}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();return e===t?e:this.clearSelect()}clearSelect(e={},t={}){const{isIgnoreDisabledRule:i=!1,isAddPlaceholder:n=!0}=t;if(!i&&this.control.getIsDisabledControl(e))return-1;const s=e.elementList||this.control.getElementList(),{startIndex:l}=e.range||this.control.getRange(),a=s[l];let c=-1,d=-1,h=l;for(;h>0;){const g=s[h];if(g.controlId!==a.controlId||g.controlComponent===E.PREFIX||g.controlComponent===E.PRE_TEXT){c=h;break}h--}let u=l+1;for(;u<s.length;){const g=s[u];if(g.controlId!==a.controlId||g.controlComponent===E.POSTFIX||g.controlComponent===E.POST_TEXT){d=u-1;break}u++}return!~c||!~d?-1:(this.control.getDraw().spliceElementList(s,c+1,d-c,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),n&&this.control.addPlaceholder(h,e),this.control.setControlProperties({code:null},{elementList:s,range:{startIndex:h,endIndex:h}}),h)}setSelect(e,t={},i={}){var n;if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const s=t.elementList||this.control.getElementList(),l=t.range||this.control.getRange(),a=this.element.control,c=e?.split(this.VALUE_DELIMITER)||[],d=a.code,h=((n=a.code)==null?void 0:n.split(this.VALUE_DELIMITER))||[],u=a.isMultiSelect;if(!u&&e===d||u&&yr(h,c)){this.control.repaintControl({curIndex:l.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const f=a.valueSets;if(!Array.isArray(f)||!f.length)return;const g=this.getText(c);if(!g){if(d){const m=this.clearSelect(t,{isIgnoreDeletedRule:i.isIgnoreDeletedRule});~m&&(this.control.repaintControl({curIndex:m}),this.control.emitControlContentChange({controlValue:[]}))}return}const R=this.getValue(t)[0],p=R?Lt(R,Kt):Lt(s[l.startIndex],ai),M=this.clearSelect(t,{isAddPlaceholder:!1,isIgnoreDeletedRule:i.isIgnoreDeletedRule});if(!~M)return;d||this.control.removePlaceholder(M,t);const S=Qt(s[M],Kt),b=M+1,P=mt(g),N=this.control.getDraw();for(let m=0;m<P.length;m++){const T=oe(B(B({},p),S),{type:D.TEXT,value:P[m],controlComponent:E.VALUE});$e(s,[T],M,{editorOptions:this.options}),N.spliceElementList(s,b+m,0,[T])}if(this.control.setControlProperties({code:e},{elementList:s,range:{startIndex:M,endIndex:M}}),!t.range){const m=b+P.length-1;this.control.repaintControl({curIndex:m}),this.control.emitControlContentChange({context:t}),u||this.destroy()}}_createSelectPopupDom(){const e=this.element.control,t=e.valueSets;if(!Array.isArray(t)||!t.length)return;const i=this.control.getPosition();if(!i)return;const n=document.createElement("div");n.classList.add(`${ie}-select-control-popup`),n.setAttribute(Ni,ci.POPUP);const s=document.createElement("ul");for(let u=0;u<t.length;u++){const f=t[u],g=document.createElement("li");let R=this.getCodes();R.includes(f.code)&&g.classList.add("active"),g.onclick=()=>{const p=R.findIndex(M=>M===f.code);e.isMultiSelect?~p?R.splice(p,1):R.push(f.code):~p?R=[]:R=[f.code],this.setSelect(R.join(this.VALUE_DELIMITER))},g.append(document.createTextNode(f.value)),s.append(g)}n.append(s);const{coordinate:{leftTop:[l,a]},lineHeight:c}=i,d=this.control.getPreY();n.style.left=`${l}px`,n.style.top=`${a+d+c}px`,this.control.getContainer().append(n),this.selectDom=n}awake(){var e;if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const{startIndex:t}=this.control.getRange();((e=this.control.getElementList()[t+1])==null?void 0:e.controlId)===this.element.controlId&&(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){var e;this.isPopup&&((e=this.selectDom)==null||e.remove(),this.isPopup=!1)}}class Ao{constructor(e,t){O(this,"element"),O(this,"control"),O(this,"options");const i=t.getDraw();this.options=i.getOptions(),this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getValue(e={}){const t=e.elementList||this.control.getElementList(),{startIndex:i}=e.range||this.control.getRange(),n=t[i],s=[];let l=i;for(;l>0;){const c=t[l];if(c.controlId!==n.controlId||c.controlComponent===E.PREFIX||c.controlComponent===E.PRE_TEXT)break;c.controlComponent===E.VALUE&&s.unshift(c),l--}let a=i+1;for(;a<t.length;){const c=t[a];if(c.controlId!==n.controlId||c.controlComponent===E.POSTFIX||c.controlComponent===E.POST_TEXT)break;c.controlComponent===E.VALUE&&s.push(c),a++}return s}setValue(e,t={},i={}){if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),s=t.range||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:a}=s,c=this.control.getDraw();l!==a?c.spliceElementList(n,l+1,a-l,[],{isIgnoreDeletedRule:i.isIgnoreDeletedRule}):this.control.removePlaceholder(l,t);const d=n[l],h=d.type&&!yt.includes(d.type)||d.controlComponent===E.PREFIX||d.controlComponent===E.PRE_TEXT?Lt(d,["control","controlId",...ai]):Qt(d,["type"]),u=s.startIndex+1;for(let f=0;f<e.length;f++){const g=oe(B(B({},h),e[f]),{controlComponent:E.VALUE});$e(n,[g],l,{editorOptions:this.options}),c.spliceElementList(n,u+f,0,[g])}return u+e.length-1}clearValue(e={},t={}){if(!t.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const i=e.elementList||this.control.getElementList(),n=e.range||this.control.getRange(),{startIndex:s,endIndex:l}=n;return this.control.getDraw().spliceElementList(i,s+1,l-s,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),this.getValue(e).length||this.control.addPlaceholder(s,e),s}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),i=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:s}=i,l=t[n],a=t[s],c=this.control.getDraw();if(e.key===le.Backspace)return n!==s?(c.spliceElementList(t,n+1,s-n),this.getValue().length||this.control.addPlaceholder(n),n):l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT||a.controlComponent===E.POSTFIX||a.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):(c.spliceElementList(t,n,1),this.getValue().length||this.control.addPlaceholder(n-1),n-1);if(e.key===le.Delete){if(n!==s)return c.spliceElementList(t,n+1,s-n),this.getValue().length||this.control.addPlaceholder(n),n;{const d=t[s+1];return(l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT)&&d.controlComponent===E.PLACEHOLDER||d.controlComponent===E.POSTFIX||d.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):(c.spliceElementList(t,n+1,1),this.getValue().length||this.control.addPlaceholder(n),n)}}return s}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const i=this.control.getDraw(),n=this.control.getElementList();return i.spliceElementList(n,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}}class sa{constructor(e,t={}){O(this,"draw"),O(this,"options"),O(this,"now"),O(this,"dom"),O(this,"renderOptions"),O(this,"isDatePicker"),O(this,"pickDate"),O(this,"lang"),this.draw=e,this.options=t,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const e=document.createElement("div");e.classList.add(`${ie}-date-container`),e.setAttribute(Ni,ci.POPUP);const t=document.createElement("div");t.classList.add(`${ie}-date-wrap`);const i=document.createElement("div");i.classList.add(`${ie}-date-title`);const n=document.createElement("span");n.classList.add(`${ie}-date-title__pre-year`),n.innerText="<<";const s=document.createElement("span");s.classList.add(`${ie}-date-title__pre-month`),s.innerText="<";const l=document.createElement("span");l.classList.add(`${ie}-date-title__now`);const a=document.createElement("span");a.classList.add(`${ie}-date-title__next-month`),a.innerText=">";const c=document.createElement("span");c.classList.add(`${ie}-date-title__next-year`),c.innerText=">>",i.append(n),i.append(s),i.append(l),i.append(a),i.append(c);const d=document.createElement("div");d.classList.add(`${ie}-date-week`);const{weeks:{sun:h,mon:u,tue:f,wed:g,thu:R,fri:p,sat:M}}=this.lang;[h,u,f,g,R,p,M].forEach(L=>{const w=document.createElement("span");w.innerText=`${L}`,d.append(w)});const b=document.createElement("div");b.classList.add(`${ie}-date-day`),t.append(i),t.append(d),t.append(b);const P=document.createElement("ul");P.classList.add(`${ie}-time-wrap`);let N,m,T;[this.lang.hour,this.lang.minute,this.lang.second].forEach((L,w)=>{const v=document.createElement("li"),X=document.createElement("span");X.innerText=L,v.append(X);const C=document.createElement("ol"),Z=w===0,k=w===1,Q=Z?24:60;for(let Y=0;Y<Q;Y++){const W=document.createElement("li");W.innerText=`${String(Y).padStart(2,"0")}`,W.setAttribute("data-id",`${Y}`),C.append(W)}Z?N=C:k?m=C:T=C,v.append(C),P.append(v)});const x=document.createElement("div");x.classList.add(`${ie}-date-menu`);const I=document.createElement("button");I.classList.add(`${ie}-date-menu__time`),I.innerText=this.lang.timeSelect;const V=document.createElement("button");V.classList.add(`${ie}-date-menu__now`),V.innerText=this.lang.now;const F=document.createElement("button");return F.classList.add(`${ie}-date-menu__submit`),F.innerText=this.lang.confirm,x.append(I),x.append(V),x.append(F),e.append(t),e.append(P),e.append(x),this.draw.getContainer().append(e),{container:e,dateWrap:t,datePickerWeek:d,timeWrap:P,title:{preYear:n,preMonth:s,now:l,nextMonth:a,nextYear:c},day:b,time:{hour:N,minute:m,second:T},menu:{time:I,now:V,submit:F}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=e=>{if(!this.pickDate)return;const i=e.target.dataset.id;i&&(this.pickDate.setHours(Number(i)),this._setTimePick(!1))},this.dom.time.minute.onclick=e=>{if(!this.pickDate)return;const i=e.target.dataset.id;i&&(this.pickDate.setMinutes(Number(i)),this._setTimePick(!1))},this.dom.time.second.onclick=e=>{if(!this.pickDate)return;const i=e.target.dataset.id;i&&(this.pickDate.setSeconds(Number(i)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[e,t]},lineHeight:i,pageNo:n}}=this.renderOptions,s=this.draw.getHeight(),l=this.draw.getPageGap(),c=(n??this.draw.getPageNo())*(s+l);this.dom.container.style.left=`${e}px`,this.dom.container.style.top=`${t+c+i}px`}isInvalidDate(e){return e.toDateString()==="Invalid Date"}_setValue(){var e;const t=(e=this.renderOptions)==null?void 0:e.value;if(t){const i=new Date(t);this.now=this.isInvalidDate(i)?new Date:i}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const e=this.draw.getI18n(),t=e.t.bind(e);return{now:t("datePicker.now"),confirm:t("datePicker.confirm"),return:t("datePicker.return"),timeSelect:t("datePicker.timeSelect"),weeks:{sun:t("datePicker.weeks.sun"),mon:t("datePicker.weeks.mon"),tue:t("datePicker.weeks.tue"),wed:t("datePicker.weeks.wed"),thu:t("datePicker.weeks.thu"),fri:t("datePicker.weeks.fri"),sat:t("datePicker.weeks.sat")},year:t("datePicker.year"),month:t("datePicker.month"),hour:t("datePicker.hour"),minute:t("datePicker.minute"),second:t("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:e,mon:t,tue:i,wed:n,thu:s,fri:l,sat:a}}=this.lang,c=[e,t,i,n,s,l,a];this.dom.datePickerWeek.childNodes.forEach((f,g)=>{const R=f;R.innerText=c[g]});const d=this.dom.time.hour.previousElementSibling;d.innerText=this.lang.hour;const h=this.dom.time.minute.previousElementSibling;h.innerText=this.lang.minute;const u=this.dom.time.second.previousElementSibling;u.innerText=this.lang.second}_update(){const e=new Date,t=e.getFullYear(),i=e.getMonth()+1,n=e.getDate();let s=null,l=null,a=null;this.pickDate&&(s=this.pickDate.getFullYear(),l=this.pickDate.getMonth()+1,a=this.pickDate.getDate());const c=this.now.getFullYear(),d=this.now.getMonth()+1;this.dom.title.now.innerText=`${c}${this.lang.year} ${String(d).padStart(2,"0")}${this.lang.month}`;const u=new Date(c,d,0).getDate();let f=new Date(c,d-1,1).getDay();f===0&&(f=7);const g=new Date(c,d-1,0).getDate();this.dom.day.innerHTML="";const R=g-f+1;for(let M=R;M<=g;M++){const S=document.createElement("div");S.classList.add("disable"),S.innerText=`${M}`,S.onclick=()=>{const b=d-2;this.now=new Date(c,b,M),this._setDatePick(c,b,M)},this.dom.day.append(S)}for(let M=1;M<=u;M++){const S=document.createElement("div");t===c&&i===d&&n===M&&S.classList.add("active"),this.pickDate&&s===c&&l===d&&a===M&&S.classList.add("select"),S.innerText=`${M}`,S.onclick=b=>{const P=d-1;this.now=new Date(c,P,M),this._setDatePick(c,P,M),b.stopPropagation()},this.dom.day.append(S)}const p=6*7-f-u;for(let M=1;M<=p;M++){const S=document.createElement("div");S.classList.add("disable"),S.innerText=`${M}`,S.onclick=()=>{this.now=new Date(c,d,M),this._setDatePick(c,d,M)},this.dom.day.append(S)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(e,t,i){var n,s,l;this.now=new Date(e,t,i),(n=this.pickDate)==null||n.setFullYear(e),(s=this.pickDate)==null||s.setMonth(t),(l=this.pickDate)==null||l.setDate(i),this._update()}_setTimePick(e=!0){var t,i,n;const s=((t=this.pickDate)==null?void 0:t.getHours())||0,l=((i=this.pickDate)==null?void 0:i.getMinutes())||0,a=((n=this.pickDate)==null?void 0:n.getSeconds())||0,{hour:c,minute:d,second:h}=this.dom.time;[c,d,h].forEach(g=>{g.querySelectorAll("li").forEach(R=>R.classList.remove("active"))}),[[c,s],[d,l],[h,a]].forEach(([g,R])=>{const p=g.querySelector(`[data-id='${R}']`);p.classList.add("active"),e&&this._scrollIntoView(g,p)})}_scrollIntoView(e,t){if(!t){e.scrollTop=0;return}const i=[];let n=t.offsetParent;for(;n&&e!==n&&e.contains(n);)i.push(n),n=n.offsetParent;const s=t.offsetTop+i.reduce((d,h)=>d+h.offsetTop,0),l=s+t.offsetHeight,a=e.scrollTop,c=a+e.clientHeight;s<a?e.scrollTop=s:l>c&&(e.scrollTop=l-e.clientHeight)}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(e){e?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){var e;if(this.options.onSubmit&&this.pickDate){const t=(e=this.renderOptions)==null?void 0:e.dateFormat,i=this.formatDate(this.pickDate,t);this.options.onSubmit(i)}}formatDate(e,t="yyyy-MM-dd hh:mm:ss"){let i=t;const n={"y+":e.getFullYear().toString(),"M+":(e.getMonth()+1).toString(),"d+":e.getDate().toString(),"h+":e.getHours().toString(),"m+":e.getMinutes().toString(),"s+":e.getSeconds().toString()};for(const s in n){const l=new RegExp("("+s+")").exec(t),a=s;l&&(i=i.replace(l[1],l[1].length===1?n[a]:n[a].padStart(l[1].length,"0")))}return i}render(e){this.renderOptions=e,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class vn{constructor(e,t){O(this,"draw"),O(this,"element"),O(this,"control"),O(this,"isPopup"),O(this,"datePicker"),O(this,"options");const i=t.getDraw();this.draw=i,this.options=i.getOptions(),this.element=e,this.control=t,this.isPopup=!1,this.datePicker=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getValueRange(e={}){const t=e.elementList||this.control.getElementList(),{startIndex:i}=e.range||this.control.getRange(),n=t[i];let s=i;for(;s>0;){const a=t[s];if(a.controlId!==n.controlId||a.controlComponent===E.PREFIX||a.controlComponent===E.PRE_TEXT)break;s--}let l=i+1;for(;l<t.length;){const a=t[l];if(a.controlId!==n.controlId||a.controlComponent===E.POSTFIX||a.controlComponent===E.POST_TEXT)break;l++}return s===l?null:[s,l-1]}getValue(e={}){const t=e.elementList||this.control.getElementList(),i=this.getValueRange(e);if(!i)return[];const n=[],[s,l]=i;for(let a=s;a<=l;a++){const c=t[a];c.controlComponent===E.VALUE&&n.push(c)}return n}setValue(e,t={},i={}){if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const n=t.elementList||this.control.getElementList(),s=t.range||this.control.getRange();this.control.shrinkBoundary(t);const{startIndex:l,endIndex:a}=s,c=this.control.getDraw();l!==a?c.spliceElementList(n,l+1,a-l):this.control.removePlaceholder(l,t);const d=n[l],h=d.type&&!yt.includes(d.type)||d.controlComponent===E.PREFIX||d.controlComponent===E.PRE_TEXT?Lt(d,["control","controlId",...ai]):Qt(d,["type"]),u=s.startIndex+1;for(let f=0;f<e.length;f++){const g=oe(B(B({},h),e[f]),{controlComponent:E.VALUE});$e(n,[g],l,{editorOptions:this.options}),c.spliceElementList(n,u+f,0,[g])}return u+e.length-1}clearSelect(e={},t={}){const{isIgnoreDisabledRule:i=!1,isAddPlaceholder:n=!0}=t;if(!i&&this.control.getIsDisabledControl(e))return-1;const s=this.getValueRange(e);if(!s)return-1;const[l,a]=s;if(!~l||!~a)return-1;const c=e.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(c,l+1,a-l,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),n&&this.control.addPlaceholder(l,e),l}setSelect(e,t={},i={}){if(!i.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const n=t.elementList||this.control.getElementList(),s=t.range||this.control.getRange(),l=this.getValue(t)[0],a=l?Lt(l,Kt):Lt(n[s.startIndex],ai),c=this.clearSelect(t,{isAddPlaceholder:!1,isIgnoreDeletedRule:i.isIgnoreDeletedRule});if(!~c)return;const d=Qt(n[c],Kt),h=c+1,u=this.control.getDraw();for(let f=0;f<e.length;f++){const g=oe(B(B({},a),d),{type:D.TEXT,value:e[f],controlComponent:E.VALUE});$e(n,[g],c,{editorOptions:this.options}),u.spliceElementList(n,h+f,0,[g])}if(!t.range){const f=h+e.length-1;this.control.repaintControl({curIndex:f}),this.control.emitControlContentChange({context:t}),this.destroy()}}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),i=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:s}=i,l=t[n],a=t[s],c=this.control.getDraw();if(e.key===le.Backspace)return n!==s?(c.spliceElementList(t,n+1,s-n),this.getValue().length||this.control.addPlaceholder(n),n):l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT||a.controlComponent===E.POSTFIX||a.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):(c.spliceElementList(t,n,1),this.getValue().length||this.control.addPlaceholder(n-1),n-1);if(e.key===le.Delete){if(n!==s)return c.spliceElementList(t,n+1,s-n),this.getValue().length||this.control.addPlaceholder(n),n;{const d=t[s+1];return(l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT)&&d.controlComponent===E.PLACEHOLDER||d.controlComponent===E.POSTFIX||d.controlComponent===E.POST_TEXT||l.controlComponent===E.PLACEHOLDER?this.control.removeControl(n):(c.spliceElementList(t,n+1,1),this.getValue().length||this.control.addPlaceholder(n),n)}}return s}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const i=this.control.getDraw(),n=this.control.getElementList();return i.spliceElementList(n,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}awake(){var e,t;if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const i=this.control.getPosition();if(!i)return;const n=this.draw.getElementList(),{startIndex:s}=this.control.getRange();if(((e=n[s+1])==null?void 0:e.controlId)!==this.element.controlId)return;this.datePicker=new sa(this.draw,{onSubmit:this._setDate.bind(this)});const l=this.getValue().map(c=>c.value).join("")||"",a=(t=this.element.control)==null?void 0:t.dateFormat;this.datePicker.render({value:l,position:i,dateFormat:a}),this.isPopup=!0}destroy(){var e;this.isPopup&&((e=this.datePicker)==null||e.destroy(),this.isPopup=!1)}_setDate(e){e?this.setSelect(e):this.clearSelect(),this.destroy()}}class oa extends Ao{}class Ug{constructor(e){O(this,"controlBorder"),O(this,"draw"),O(this,"range"),O(this,"listener"),O(this,"eventBus"),O(this,"controlSearch"),O(this,"options"),O(this,"controlOptions"),O(this,"activeControl"),O(this,"activeControlValue"),O(this,"preElement"),this.controlBorder=new Eg(e),this.draw=e,this.range=e.getRange(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.controlSearch=new Dg(this),this.options=e.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null}setHighlightList(e){this.controlSearch.setHighlightList(e)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(e,t){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(e,t)}getDraw(){return this.draw}filterAssistElement(e){return e.filter((t,i)=>{var n,s,l;if(t.type===D.TABLE){const a=t.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let h=0;h<d.tdList.length;h++){const u=d.tdList[h];u.value=this.filterAssistElement(u.value)}}}if(!t.controlId)return!0;if((n=t.control)!=null&&n.minWidth){if(t.controlComponent===E.PREFIX||t.controlComponent===E.POSTFIX)return t.value="",!0}else{if((s=t.control)!=null&&s.preText&&t.controlComponent===E.PRE_TEXT){let a=!1,c=i+1;for(;c<e.length;){const d=e[c];if(t.controlId!==d.controlId)break;if(d.controlComponent===E.VALUE){a=!0;break}c++}return a}if((l=t.control)!=null&&l.postText&&t.controlComponent===E.POST_TEXT){let a=!1,c=i-1;for(;c<e.length;){const d=e[c];if(t.controlId!==d.controlId)break;if(d.controlComponent===E.VALUE){a=!0;break}c--}return a}}return t.controlComponent!==E.PREFIX&&t.controlComponent!==E.POSTFIX&&t.controlComponent!==E.PLACEHOLDER})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:e,endIndex:t}=this.getRange();if(!~e&&!~t)return!1;const i=this.getElementList(),n=i[e];if(e===t&&n.controlComponent===E.POSTFIX)return!0;const s=i[t];return!!(n.controlId&&n.controlId===s.controlId&&s.controlComponent!==E.POSTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:e,endIndex:t}=this.getRange();return e!==t?!1:this.getElementList()[e].controlComponent===E.POSTFIX}getIsRangeWithinControl(){const{startIndex:e,endIndex:t}=this.getRange();if(!~e&&!~t)return!1;const i=this.getElementList(),n=i[e],s=i[t];return!!(n?.controlId&&n.controlId===s.controlId&&s.controlComponent!==E.POSTFIX)}getIsElementListContainFullControl(e){if(!e.some(n=>n.controlId))return!1;let t=0,i=0;for(let n=0;n<e.length;n++){const s=e[n];s.controlComponent===E.PREFIX?t++:s.controlComponent===E.POSTFIX&&i++}return!t||!i?!1:t===i}getIsDisabledControl(e={}){var t,i;if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:n,endIndex:s}=e.range||this.range.getRange();return n===s&&~n&&~s&&(e.elementList||this.getElementList())[n].controlComponent===E.POSTFIX?!1:!!((i=(t=this.activeControl.getElement())==null?void 0:t.control)!=null&&i.disabled)}getIsDisabledPasteControl(e={}){var t,i;if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:n,endIndex:s}=e.range||this.range.getRange();return n===s&&~n&&~s&&(e.elementList||this.getElementList())[n].controlComponent===E.POSTFIX?!1:!!((i=(t=this.activeControl.getElement())==null?void 0:t.control)!=null&&i.pasteDisabled)}getIsExistValueByElementListIndex(e,t){var i,n,s;const l=e[t];if(!l.controlId)return!1;if(((i=l.control)==null?void 0:i.type)===he.CHECKBOX||((n=l.control)==null?void 0:n.type)===he.RADIO)return!!((s=l.control)!=null&&s.code);if(l.controlComponent===E.VALUE)return!0;if(l.controlComponent===E.PLACEHOLDER)return!1;if(l.controlComponent===E.PREFIX||l.controlComponent===E.PRE_TEXT){let a=t+1;for(;a<e.length;){const c=e[a];if(c.controlId!==l.controlId)return!1;if(c.controlComponent===E.VALUE)return!0;if(c.controlComponent===E.PLACEHOLDER)return!1;a++}}if(l.controlComponent===E.POSTFIX||l.controlComponent===E.POST_TEXT){let a=t-1;for(;a>=0;){const c=e[a];if(c.controlId!==l.controlId)return!1;if(c.controlComponent===E.VALUE)return!0;if(c.controlComponent===E.PLACEHOLDER)return!1;a--}}return!1}getControlHighlight(e,t){return this.controlSearch.getControlHighlight(e,t)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const e=this.draw.getPosition().getPositionList(),{endIndex:t}=this.range.getRange();return e[t]||null}getPreY(){var e,t;const i=this.draw.getHeight(),n=this.draw.getPageGap();return((t=(e=this.getPosition())==null?void 0:e.pageNo)!=null?t:this.draw.getPageNo())*(i+n)}getRange(){return this.range.getRange()}shrinkBoundary(e={}){this.range.shrinkBoundary(e)}getActiveControl(){return this.activeControl}getControlElementList(e={}){const t=e.elementList||this.getElementList(),{startIndex:i}=e.range||this.getRange(),n=t[i];if(!n?.controlId)return[];const s=[];let l=i;for(;l>0;){const c=t[l];if(c.controlId!==n.controlId)break;s.unshift(c),l--}let a=i+1;for(;a<t.length;){const c=t[a];if(c.controlId!==n.controlId)break;s.push(c),a++}return s}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(e){var t,i;if(!this.activeControl)return;const n=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!n)return;let s;const l=this.activeControlValue,a=this.activeControl.getElement();l?.length?s=be(l)[0].control:(s=ji(Ne(a)).control,s.value=[]);const c={state:e,control:s,controlId:a.controlId};(i=(t=this.listener).controlChange)==null||i.call(t,c),n&&this.eventBus.emit("controlChange",c)}initControl(){var e,t;const i=this.getElementList(),n=this.getRange(),s=i[n.startIndex];if(this.activeControl){(this.activeControl instanceof Cn||this.activeControl instanceof vn)&&(s.controlComponent===E.POSTFIX?this.activeControl.destroy():this.activeControl.awake()),((e=this.preElement)==null?void 0:e.controlId)===s.controlId&&(s.controlComponent===E.POSTFIX?this.emitControlChange(zi.INACTIVE):((t=this.preElement)==null?void 0:t.controlComponent)===E.POSTFIX&&this.emitControlChange(zi.ACTIVE));const c=this.activeControl.getElement();if(s.controlId===c.controlId){this.updateActiveControlValue(),this.preElement=s;return}}if(this.destroyControl(),this.draw.isReadonly())return;const a=s.control;if(a.type===he.TEXT)this.activeControl=new Ao(s,this);else if(a.type===he.SELECT){const c=new Cn(s,this);this.activeControl=c,c.awake()}else if(a.type===he.CHECKBOX)this.activeControl=new Ns(s,this);else if(a.type===he.RADIO)this.activeControl=new Bo(s,this);else if(a.type===he.DATE){const c=new vn(s,this);this.activeControl=c,c.awake()}else a.type===he.NUMBER&&(this.activeControl=new oa(s,this));this.updateActiveControlValue(),this.preElement=s,s.controlComponent!==E.POSTFIX&&this.emitControlChange(zi.ACTIVE)}destroyControl(e={}){var t;if(!this.activeControl)return;const{isEmitEvent:i=!0}=e;(this.activeControl instanceof Cn||this.activeControl instanceof vn)&&this.activeControl.destroy(),i&&((t=this.preElement)==null?void 0:t.controlComponent)!==E.POSTFIX&&this.emitControlChange(zi.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(e={}){const{curIndex:t,isCompute:i=!0,isSubmitHistory:n=!0,isSetCursor:s=!0}=e;t===void 0?(this.range.clearRange(),this.draw.render({isCompute:i,isSubmitHistory:n,isSetCursor:!1})):(this.range.setRange(t,t),this.draw.render({curIndex:t,isCompute:i,isSetCursor:s,isSubmitHistory:n}))}emitControlContentChange(e){var t,i,n,s,l,a;const c=this.eventBus.isSubscribe("controlContentChange");if(!c&&!this.listener.controlContentChange)return;const d=e?.controlElement||((t=this.activeControl)==null?void 0:t.getElement());if(!d)return;const h=((i=e?.context)==null?void 0:i.elementList)||this.getElementList(),{startIndex:u}=((n=e?.context)==null?void 0:n.range)||this.getRange();if(!((s=h[u])!=null&&s.controlId))return;const f=e?.controlValue||this.getControlElementList(e?.context);let g;if(f?.length?g=be(f)[0].control:(g=d.control,g.value=[]),!g)return;const R={control:g,controlId:d.controlId};(a=(l=this.listener).controlContentChange)==null||a.call(l,R),c&&this.eventBus.emit("controlContentChange",R)}reAwakeControl(){if(!this.activeControl)return;const e=this.getElementList(),t=this.getRange(),i=e[t.startIndex];this.activeControl.setElement(i),(this.activeControl instanceof vn||this.activeControl instanceof Cn)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}moveCursor(e){var t,i;const{index:n,trIndex:s,tdIndex:l,tdValueIndex:a}=e;let c=this.draw.getOriginalElementList(),d;const h=e.isTable?a:n;if(e.isTable?(c=c[n].trList[s].tdList[l].value,d=c[a]):d=c[n],(t=d.control)!=null&&t.hide||(i=d.area)!=null&&i.hide){const u=Xn(c,h);return{newIndex:u,newElement:c[u]}}if(d.controlComponent===E.VALUE)return{newIndex:h,newElement:d};if(d.controlComponent===E.POSTFIX){let u=h+1;for(;u<c.length;){if(c[u].controlId!==d.controlId)return{newIndex:u-1,newElement:c[u-1]};u++}}else if(d.controlComponent===E.PREFIX||d.controlComponent===E.PRE_TEXT){let u=h+1;for(;u<c.length;){const f=c[u];if(f.controlId!==d.controlId||f.controlComponent!==E.PREFIX&&f.controlComponent!==E.PRE_TEXT)return{newIndex:u-1,newElement:c[u-1]};u++}}else if(d.controlComponent===E.PLACEHOLDER||d.controlComponent===E.POST_TEXT){let u=h-1;for(;u>0;){const f=c[u];if(f.controlId!==d.controlId||f.controlComponent===E.VALUE||f.controlComponent===E.PREFIX||f.controlComponent===E.PRE_TEXT)return{newIndex:u,newElement:c[u]};u--}}return{newIndex:h,newElement:d}}removeControl(e,t={}){var i,n;const s=t.elementList||this.getElementList(),l=s[e];if(!this.draw.isDesignMode()&&!((i=l?.control)!=null&&i.hide)&&!((n=l?.area)!=null&&n.hide)){const{deletable:u=!0}=l.control;if(!u)return null;const f=this.draw.getMode();if(f===ce.FORM&&this.options.modeRule[f].controlDeletableDisabled)return null}let a=-1,c=-1,d=e;for(;d>0;){if(s[d].controlId!==l.controlId){a=d;break}d--}let h=e+1;for(;h<s.length;){if(s[h].controlId!==l.controlId){c=h-1;break}h++}return h===s.length&&(c=h-1),!~a&&!~c?e:(a=~a?a:0,this.draw.spliceElementList(s,a+1,c-a),a)}removePlaceholder(e,t={}){const i=t.elementList||this.getElementList(),n=i[e],s=i[e+1];if(n.controlComponent===E.PLACEHOLDER||s.controlComponent===E.PLACEHOLDER){let l=!1,a=e;for(;a<i.length;){const c=i[a];if(c.controlId!==n.controlId)break;c.controlComponent===E.PLACEHOLDER?(l||(l=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(e)),i.splice(a,1)):a++}}}addPlaceholder(e,t={}){const i=t.elementList||this.getElementList(),n=i[e],s=n.control;if(!s.placeholder)return;const l=mt(s.placeholder),a=Lt(n,ai);for(let c=0;c<l.length;c++){const d=l[c],h=oe(B({},a),{value:d===`
87
+ `?j:d,controlId:n.controlId,type:D.CONTROL,control:n.control,controlComponent:E.PLACEHOLDER,color:this.controlOptions.placeholderColor});$e(i,[h],e,{editorOptions:this.options}),this.draw.spliceElementList(i,e+c+1,0,[h])}}setValue(e){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(e)}setControlProperties(e,t={}){const i=t.elementList||this.getElementList(),{startIndex:n}=t.range||this.getRange(),s=i[n];let l=n;for(;l>0;){const c=i[l];if(c.controlId!==s.controlId)break;c.control=B(B({},c.control),e),l--}let a=n+1;for(;a<i.length;){const c=i[a];if(c.controlId!==s.controlId)break;c.control=B(B({},c.control),e),a++}}keydown(e){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(e)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(e){const{id:t,conceptId:i,areaId:n}=e,s=[];if(!t&&!i)return s;const l=(c,d)=>{let h=0;for(;h<c.length;){const u=c[h];if(h++,u.type===D.TABLE){const b=u.trList;for(let P=0;P<b.length;P++){const N=b[P];for(let m=0;m<N.tdList.length;m++){const T=N.tdList[m];l(T.value,d)}}}if(!u.control||t&&u.controlId!==t||i&&u.control.conceptId!==i||n&&u.areaId!==n)continue;const{type:f,code:g,valueSets:R}=u.control;let p=h,M="";const S=[];for(;p<c.length;){const b=c[p];if(b.controlId!==u.controlId)break;(f===he.TEXT||f===he.DATE||f===he.NUMBER)&&b.controlComponent===E.VALUE&&(M+=b.value,S.push(Qt(b,Xo))),p++}if(f===he.TEXT||f===he.DATE||f===he.NUMBER)s.push(oe(B({},u.control),{zone:d,value:M||null,innerText:M||null,elementList:be(S)}));else if(f===he.SELECT||f===he.CHECKBOX||f===he.RADIO){const b=g?.split(",").map(P=>{var N;return(N=R?.find(m=>m.code===P))==null?void 0:N.value}).filter(Boolean).join("");s.push(oe(B({},u.control),{zone:d,value:g||null,innerText:b||null}))}h=p}},a=[{zone:de.HEADER,elementList:this.draw.getHeaderElementList()},{zone:de.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:de.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:c,elementList:d}of a)l(d,c);return s}setValueListById(e){if(!e.length)return;let t=!1,i=!1;const n=l=>{let a=0;for(;a<l.length;){const c=l[a];if(a++,c.type===D.TABLE){const b=c.trList;for(let P=0;P<b.length;P++){const N=b[P];for(let m=0;m<N.tdList.length;m++){const T=N.tdList[m];n(T.value)}}}if(!c.control)continue;const d=e.find(b=>b.id&&c.controlId===b.id||b.conceptId&&c.control.conceptId===b.conceptId||b.areaId&&c.areaId===b.areaId);if(!d)continue;const{value:h,isSubmitHistory:u=!0}=d;t=!0,u&&(i=!0);const{type:f}=c.control;let g=a;for(;g<l.length&&l[g].controlId===c.controlId;)g++;const p={range:{startIndex:a-1,endIndex:g-2},elementList:l},M={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(f===he.TEXT){const b=Array.isArray(h)?h:h?[{value:h}]:[];b.length&&tt(b,{isHandleFirstElement:!1,editorOptions:this.options});const P=new Ao(c,this);this.activeControl=P,b.length?P.setValue(b,p,M):P.clearValue(p,M)}else if(f===he.SELECT){if(Array.isArray(h))continue;const b=new Cn(c,this);this.activeControl=b,h?b.setSelect(h,p,M):b.clearSelect(p,M)}else if(f===he.CHECKBOX){if(Array.isArray(h))continue;const b=new Ns(c,this);this.activeControl=b;const P=h?h.split(","):[];b.setSelect(P,p,M)}else if(f===he.RADIO){if(Array.isArray(h))continue;const b=new Bo(c,this);this.activeControl=b;const P=h?[h]:[];b.setSelect(P,p,M)}else if(f===he.DATE){const b=new vn(c,this);this.activeControl=b,xo(h)?(h.length&&tt(h,{isHandleFirstElement:!1,editorOptions:this.options}),b.setValue(h,p,M)):ku(h)?b.setSelect(h,p,M):b.clearSelect(p,M)}else if(f===he.NUMBER){const b=Array.isArray(h)?h:h?[{value:h}]:[];b.length&&tt(b,{isHandleFirstElement:!1,editorOptions:this.options});const P=new oa(c,this);this.activeControl=P,b.length?P.setValue(b,p,M):P.clearValue(p,M)}this.emitControlContentChange({context:p}),this.activeControl=null;let S=a;for(;S<l.length&&l[S].controlId===c.controlId;)S++;a=S}};this.destroyControl({isEmitEvent:!1});const s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const l of s)n(l);t&&(i||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:i,isSetCursor:!1}))}setExtensionListById(e){if(!e.length)return;const t=n=>{let s=0;for(;s<n.length;){const l=n[s];if(s++,l.type===D.TABLE){const h=l.trList;for(let u=0;u<h.length;u++){const f=h[u];for(let g=0;g<f.tdList.length;g++){const R=f.tdList[g];t(R.value)}}}if(!l.control)continue;const a=e.find(h=>h.id&&l.controlId===h.id||h.conceptId&&l.control.conceptId===h.conceptId||h.areaId&&l.areaId===h.areaId);if(!a)continue;const{extension:c}=a;this.setControlProperties({extension:c},{elementList:n,range:{startIndex:s,endIndex:s}});let d=s;for(;d<n.length&&n[d].controlId===l.controlId;)d++;s=d}},i=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const n of i)t(n)}setPropertiesListById(e){if(!e.length)return;let t=!1,i=!1;const n=l=>{let a=0;for(;a<l.length;){const c=l[a];if(a++,c.type===D.TABLE){const g=c.trList;for(let R=0;R<g.length;R++){const p=g[R];for(let M=0;M<p.tdList.length;M++){const S=p.tdList[M];n(S.value)}}}if(!c.control)continue;const d=e.find(g=>g.id&&c.controlId===g.id||g.conceptId&&c.control.conceptId===g.conceptId||g.areaId&&c.areaId===g.areaId);if(!d)continue;const{properties:h,isSubmitHistory:u=!0}=d;t=!0,u&&(i=!0),this.setControlProperties(oe(B(B({},c.control),h),{value:c.control.value}),{elementList:l,range:{startIndex:a,endIndex:a}}),ai.forEach(g=>{const R=h[g];R&&Reflect.set(c,g,R)});let f=a;for(;f<l.length&&l[f].controlId===c.controlId;)f++;a=f}},s={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const l in s){const a=s[l];n(a)}if(t){for(const l in s){const a=l,c=be(s[a],{isClassifyArea:!0,extraPickAttrs:["id"]});s[a]=c,tt(c,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(s),i||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:i,isSetCursor:!1})}}getList(){const e=[];function t(n){for(let s=0;s<n.length;s++){const l=n[s];if(l.type===D.TABLE){const a=l.trList;for(let c=0;c<a.length;c++){const d=a[c];for(let h=0;h<d.tdList.length;h++){const f=d.tdList[h].value;t(f)}}}if(l.controlId){const a=Qt(l,[...Fo,...hs]);e.push(a)}}}const i=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const n of i)t(n);return be(e,{extraPickAttrs:["controlId"]})}recordBorderInfo(e,t,i,n){this.controlBorder.recordBorderInfo(e,t,i,n)}drawBorder(e){this.controlBorder.render(e)}getPreControlContext(){if(!this.activeControl)return null;const t=this.draw.getPosition().getPositionContext();if(!t)return null;const i=this.activeControl.getElement();function n(c,d){for(let h=d;h>0;h--){const u=c[h];if(u.type===D.TABLE){const g=u.trList||[];for(let R=g.length-1;R>=0;R--){const p=g[R],M=p.tdList;for(let S=M.length-1;S>=0;S--){const b=M[S],P=n(b.value,b.value.length-1);if(P)return{positionContext:{isTable:!0,index:h,trIndex:R,tdIndex:S,tdId:b.id,trId:p.id,tableId:u.id},nextIndex:P.nextIndex}}}}if(!u.controlId||u.controlId===i.controlId)continue;let f=h;for(;f>0;){const g=c[f];if(g.controlComponent===E.VALUE||g.controlComponent===E.PREFIX||g.controlComponent===E.PRE_TEXT)break;f--}return{positionContext:{isTable:!1},nextIndex:f}}return null}const{startIndex:s}=this.range.getRange(),l=this.getElementList(),a=n(l,s);if(a)return{positionContext:t.isTable?t:a.positionContext,nextIndex:a.nextIndex};if(i.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:h,tdIndex:u}=t,f=c[d].trList;for(let R=h;R>=0;R--){const p=f[R],M=p.tdList;for(let S=M.length-1;S>=0;S--){if(h===R&&S>=u)continue;const b=M[S],P=n(b.value,b.value.length-1);if(P)return{positionContext:{isTable:!0,index:t.index,trIndex:R,tdIndex:S,tdId:b.id,trId:p.id,tableId:i.tableId},nextIndex:P.nextIndex}}}const g=n(c,d-1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const t=this.draw.getPosition().getPositionContext();if(!t)return null;const i=this.activeControl.getElement();function n(c,d){var h,u;for(let f=d;f<c.length;f++){const g=c[f];if(g.type===D.TABLE){const R=g.trList||[];for(let p=0;p<R.length;p++){const M=R[p],S=M.tdList;for(let b=0;b<S.length;b++){const P=S[b],N=n(P.value,0);if(N)return{positionContext:{isTable:!0,index:f,trIndex:p,tdIndex:b,tdId:P.id,trId:M.id,tableId:g.id},nextIndex:N.nextIndex}}}}if(!(!g.controlId||g.controlId===i.controlId||((h=c[f+1])==null?void 0:h.controlComponent)===E.PREFIX||((u=c[f+1])==null?void 0:u.controlComponent)===E.PRE_TEXT))return{positionContext:{isTable:!1},nextIndex:f}}return null}const{endIndex:s}=this.range.getRange(),l=this.getElementList(),a=n(l,s);if(a)return{positionContext:t.isTable?t:a.positionContext,nextIndex:a.nextIndex};if(i.tableId){const c=this.draw.getOriginalElementList(),{index:d,trIndex:h,tdIndex:u}=t,f=c[d].trList;for(let R=h;R<f.length;R++){const p=f[R],M=p.tdList;for(let S=0;S<M.length;S++){if(h===R&&S<=u)continue;const b=M[S],P=n(b.value,0);if(P)return{positionContext:{isTable:!0,index:t.index,trIndex:R,tdIndex:S,tdId:b.id,trId:p.id,tableId:i.tableId},nextIndex:P.nextIndex}}}const g=n(c,d+1);if(g)return{positionContext:{isTable:!1},nextIndex:g.nextIndex}}return null}initNextControl(e={}){const{direction:t=He.DOWN}=e;let i=null;if(t===He.UP?i=this.getPreControlContext():i=this.getNextControlContext(),!i)return;const{nextIndex:n,positionContext:s}=i,l=this.draw.getPosition();l.setPositionContext(s),this.draw.getRange().replaceRange({startIndex:n,endIndex:n}),this.draw.render({curIndex:n,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const a=l.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:a[n],direction:t})}setMinWidthControlInfo(e){var t,i,n,s,l;const{row:a,rowElement:c,controlRealWidth:d,availableWidth:h}=e;if(!((t=c.control)!=null&&t.minWidth))return;const{scale:u}=this.options,f=c.control.minWidth*u;let g=null;if((i=c.control)!=null&&i.minWidth&&(((n=c.control)==null?void 0:n.rowFlex)===Re.CENTER||((s=c.control)==null?void 0:s.rowFlex)===Re.RIGHT)){let p=c.metrics.width,M=a.elementList.length-1;for(;M>=0;){const S=a.elementList[M];if(p+=S.metrics.width,((l=a.elementList[M-1])==null?void 0:l.controlComponent)===E.PREFIX){g=S;break}M--}g&&p<f&&(c.control.rowFlex===Re.CENTER?g.left=(f-p)/2:c.control.rowFlex===Re.RIGHT&&(g.left=f-p-c.metrics.width))}const R=f-d;if(R>0){const p=g?.left||0,M=h-a.width-c.metrics.width,S=Math.min(M,R);c.left=S-p,a.width+=S-p}}}class Zg{constructor(e){O(this,"draw"),O(this,"options"),this.draw=e,this.options=e.getOptions()}setSelect(e){const{checkbox:t}=e;t?t.value=!t.value:e.checkbox={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(e){const{ctx:t,x:i,index:n,row:s}=e;let{y:l}=e;const{checkbox:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:h,verticalAlign:u},scale:f}=this.options,{metrics:g,checkbox:R}=s.elementList[n];if(u===Ae.TOP||u===Ae.MIDDLE){let P=n+1,N=null;for(;P<s.elementList.length&&(N=s.elementList[P],!(N.value!==j&&N.value!==Lo));)P++;if(N){const{metrics:{boundingBoxAscent:m,boundingBoxDescent:T}}=N,y=m+T;y>g.height&&(u===Ae.TOP?l-=m-g.height:u===Ae.MIDDLE&&(l-=(y-g.height)/2))}}const p=Math.round(i+a*f),M=Math.round(l-g.height+c),S=g.width-a*2*f,b=g.height;t.save(),t.beginPath(),t.translate(.5,.5),R?.value?(t.lineWidth=c,t.strokeStyle=d,t.rect(p,M,S,b),t.stroke(),t.beginPath(),t.fillStyle=d,t.fillRect(p,M,S,b),t.beginPath(),t.strokeStyle=h,t.lineWidth=c*2*f,t.moveTo(p+2*f,M+b/2),t.lineTo(p+S/2,M+b-3*f),t.lineTo(p+S-2*f,M+3*f),t.stroke()):(t.lineWidth=c,t.rect(p,M,S,b),t.stroke()),t.closePath(),t.restore()}}class Yg{constructor(e){O(this,"draw"),O(this,"options"),this.draw=e,this.options=e.getOptions()}setSelect(e){const{radio:t}=e;t?t.value=!t.value:e.radio={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(e){const{ctx:t,x:i,index:n,row:s}=e;let{y:l}=e;const{radio:{gap:a,lineWidth:c,fillStyle:d,strokeStyle:h,verticalAlign:u},scale:f}=this.options,{metrics:g,radio:R}=s.elementList[n];if(u===Ae.TOP||u===Ae.MIDDLE){let P=n+1,N=null;for(;P<s.elementList.length&&(N=s.elementList[P],!(N.value!==j&&N.value!==Lo));)P++;if(N){const{metrics:{boundingBoxAscent:m,boundingBoxDescent:T}}=N,y=m+T;y>g.height&&(u===Ae.TOP?l-=m-g.height:u===Ae.MIDDLE&&(l-=(y-g.height)/2))}}const p=Math.round(i+a*f),M=Math.round(l-g.height+c),S=g.width-a*2*f,b=g.height;t.save(),t.beginPath(),t.translate(.5,.5),t.strokeStyle=R?.value?d:h,t.lineWidth=c,t.arc(p+S/2,M+b/2,S/2,0,Math.PI*2),t.stroke(),R?.value&&(t.beginPath(),t.fillStyle=d,t.arc(p+S/2,M+b/2,S/3,0,Math.PI*2),t.fill()),t.closePath(),t.restore()}}const la="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBhOyhmdW5jdGlvbihlKXtlLlRFWFQ9InRleHQiLGUuVEFCTEU9InRhYmxlIixlLkhZUEVSTElOSz0iaHlwZXJsaW5rIixlLkNPTlRST0w9ImNvbnRyb2wifSkoYXx8KGE9e30pKTt2YXIgcDsoZnVuY3Rpb24oZSl7ZS5WQUxVRT0idmFsdWUifSkocHx8KHA9e30pKTtjb25zdCBoPSJcdTIwMEIiLGQ9YApgO2Z1bmN0aW9uIHUoZSl7dmFyIGMsZjtsZXQgcj0iIixuPTA7Zm9yKDtuPGUubGVuZ3RoOyl7Y29uc3QgdD1lW25dO2lmKHQudHlwZT09PWEuVEFCTEUpe2lmKHQudHJMaXN0KWZvcihsZXQgbD0wO2w8dC50ckxpc3QubGVuZ3RoO2wrKyl7Y29uc3Qgcz10LnRyTGlzdFtsXTtmb3IobGV0IG89MDtvPHMudGRMaXN0Lmxlbmd0aDtvKyspe2NvbnN0IGk9cy50ZExpc3Rbb107cis9dShpLnZhbHVlKX19fWVsc2UgaWYodC50eXBlPT09YS5IWVBFUkxJTkspe2NvbnN0IGw9dC5oeXBlcmxpbmtJZCxzPVtdO2Zvcig7bjxlLmxlbmd0aDspe2NvbnN0IG89ZVtuXTtpZihsIT09by5oeXBlcmxpbmtJZCl7bi0tO2JyZWFrfWRlbGV0ZSBvLnR5cGUscy5wdXNoKG8pLG4rK31yKz11KHMpfWVsc2UgaWYodC5jb250cm9sSWQpe2lmKCEoKGM9dC5jb250cm9sKT09bnVsbD92b2lkIDA6Yy5oaWRlKSl7Y29uc3QgbD10LmNvbnRyb2xJZCxzPVtdO2Zvcig7bjxlLmxlbmd0aDspe2NvbnN0IG89ZVtuXTtpZihsIT09by5jb250cm9sSWQpe24tLTticmVha31vLmNvbnRyb2xDb21wb25lbnQ9PT1wLlZBTFVFJiYoZGVsZXRlIG8uY29udHJvbElkLHMucHVzaChvKSksbisrfXIrPXUocyl9fWVsc2UoIXQudHlwZXx8dC50eXBlPT09YS5URVhUKSYmISgoZj10LmFyZWEpPT1udWxsP3ZvaWQgMDpmLmhpZGUpJiYocis9dC52YWx1ZSk7bisrfXJldHVybiByfWZ1bmN0aW9uIGcoZSl7Y29uc3Qgcj1bXSxuPS9bMC05XS8sYz0vW0EtWmEtel0vLGY9L1xzLztsZXQgdD0hMSxsPSExLHM9IiI7ZnVuY3Rpb24gbygpe3MmJihyLnB1c2gocykscz0iIil9Zm9yKGNvbnN0IGkgb2YgZSljLnRlc3QoaSk/KHR8fG8oKSxzKz1pLHQ9ITAsbD0hMSk6bi50ZXN0KGkpPyhsfHxvKCkscys9aSx0PSExLGw9ITApOihvKCksdD0hMSxsPSExLGYudGVzdChpKXx8ci5wdXNoKGkpKTtyZXR1cm4gbygpLHJ9b25tZXNzYWdlPWU9Pntjb25zdCByPWUuZGF0YSxjPXUocikucmVwbGFjZShuZXcgUmVnRXhwKGBeJHtofWApLCIiKS5yZXBsYWNlKG5ldyBSZWdFeHAoaCwiZyIpLGQpLGY9ZyhjKTtwb3N0TWVzc2FnZShmLmxlbmd0aCl9fSkoKTt9KSgpOwo=",ra=typeof window<"u"&&window.Blob&&new Blob([atob(la)],{type:"text/javascript;charset=utf-8"});function Qg(){const r=ra&&(window.URL||window.webkitURL).createObjectURL(ra);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+la,{type:"module"})}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const aa="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBhOyhmdW5jdGlvbih0KXt0LlRFWFQ9InRleHQiLHQuSU1BR0U9ImltYWdlIix0LlRBQkxFPSJ0YWJsZSIsdC5IWVBFUkxJTks9Imh5cGVybGluayIsdC5TVVBFUlNDUklQVD0ic3VwZXJzY3JpcHQiLHQuU1VCU0NSSVBUPSJzdWJzY3JpcHQiLHQuU0VQQVJBVE9SPSJzZXBhcmF0b3IiLHQuUEFHRV9CUkVBSz0icGFnZUJyZWFrIix0LkNPTlRST0w9ImNvbnRyb2wiLHQuQ0hFQ0tCT1g9ImNoZWNrYm94Iix0LlJBRElPPSJyYWRpbyIsdC5MQVRFWD0ibGF0ZXgiLHQuVEFCPSJ0YWIiLHQuREFURT0iZGF0ZSIsdC5CTE9DSz0iYmxvY2siLHQuVElUTEU9InRpdGxlIix0LkFSRUE9ImFyZWEiLHQuTElTVD0ibGlzdCJ9KShhfHwoYT17fSkpO3ZhciBsOyhmdW5jdGlvbih0KXt0LkZJUlNUPSJmaXJzdCIsdC5TRUNPTkQ9InNlY29uZCIsdC5USElSRD0idGhpcmQiLHQuRk9VUlRIPSJmb3VydGgiLHQuRklGVEg9ImZpZnRoIix0LlNJWFRIPSJzaXh0aCJ9KShsfHwobD17fSkpO2NvbnN0IGc9e1tsLkZJUlNUXToxLFtsLlNFQ09ORF06MixbbC5USElSRF06MyxbbC5GT1VSVEhdOjQsW2wuRklGVEhdOjUsW2wuU0lYVEhdOjZ9LEw9W2EuVEVYVCxhLkhZUEVSTElOSyxhLlNVQlNDUklQVCxhLlNVUEVSU0NSSVBULGEuQ09OVFJPTCxhLkRBVEVdLGQ9Ilx1MjAwQiI7ZnVuY3Rpb24gZih0KXtyZXR1cm4hdC50eXBlfHxMLmluY2x1ZGVzKHQudHlwZSl9ZnVuY3Rpb24gQyh0KXtjb25zdHtlbGVtZW50TGlzdDpuLHBvc2l0aW9uTGlzdDp2fT10LEk9W107bGV0IGk9MDtmb3IoO2k8bi5sZW5ndGg7KXtjb25zdCBzPW5baV07aWYocy50aXRsZUlkKXtjb25zdCBvPXMudGl0bGVJZCxlPXMubGV2ZWwsYz17dHlwZTphLlRJVExFLHZhbHVlOiIiLGxldmVsOmUsdGl0bGVJZDpvLHBhZ2VObzp2W2ldLnBhZ2VOb30scj1bXTtmb3IoO2k8bi5sZW5ndGg7KXtjb25zdCB1PW5baV07aWYobyE9PXUudGl0bGVJZCl7aS0tO2JyZWFrfXIucHVzaCh1KSxpKyt9Yy52YWx1ZT1yLmZpbHRlcih1PT5mKHUpKS5tYXAodT0+dS52YWx1ZSkuam9pbigiIikucmVwbGFjZShuZXcgUmVnRXhwKGQsImciKSwiIiksSS5wdXNoKGMpfWkrK31pZighSS5sZW5ndGgpcmV0dXJuIG51bGw7Y29uc3QgaD0ocyxvKT0+e2NvbnN0IGU9by5zdWJDYXRhbG9nW28uc3ViQ2F0YWxvZy5sZW5ndGgtMV0sYz1nW2U9PW51bGw/dm9pZCAwOmUubGV2ZWxdLHI9Z1tzLmxldmVsXTtlJiZyPmM/aChzLGUpOm8uc3ViQ2F0YWxvZy5wdXNoKHtpZDpzLnRpdGxlSWQsbmFtZTpzLnZhbHVlLGxldmVsOnMubGV2ZWwscGFnZU5vOnMucGFnZU5vLHN1YkNhdGFsb2c6W119KX0sUj1bXTtmb3IobGV0IHM9MDtzPEkubGVuZ3RoO3MrKyl7Y29uc3Qgbz1JW3NdLGU9UltSLmxlbmd0aC0xXSxjPWdbZT09bnVsbD92b2lkIDA6ZS5sZXZlbF0scj1nW28ubGV2ZWxdO2UmJnI+Yz9oKG8sZSk6Ui5wdXNoKHtpZDpvLnRpdGxlSWQsbmFtZTpvLnZhbHVlLGxldmVsOm8ubGV2ZWwscGFnZU5vOm8ucGFnZU5vLHN1YkNhdGFsb2c6W119KX1yZXR1cm4gUn1vbm1lc3NhZ2U9dD0+e2NvbnN0IG49dC5kYXRhLHY9QyhuKTtwb3N0TWVzc2FnZSh2KX19KSgpO30pKCk7Cg==",ca=typeof window<"u"&&window.Blob&&new Blob([atob(aa)],{type:"text/javascript;charset=utf-8"});function Kg(){const r=ca&&(window.URL||window.webkitURL).createObjectURL(ca);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+aa,{type:"module"})}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const da="KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBuOyhmdW5jdGlvbihvKXtvLlRBQkxFPSJ0YWJsZSJ9KShufHwobj17fSkpO2Z1bmN0aW9uIGMobyl7Y29uc3QgdD1bXTtmb3IoY29uc3QgcyBvZiBvKXtpZihzLnR5cGU9PT1uLlRBQkxFKXtjb25zdCBlPXMudHJMaXN0O2ZvcihsZXQgcj0wO3I8ZS5sZW5ndGg7cisrKXtjb25zdCBpPWVbcl07Zm9yKGxldCB1PTA7dTxpLnRkTGlzdC5sZW5ndGg7dSsrKXtjb25zdCBkPWkudGRMaXN0W3VdO3QucHVzaCguLi5jKGQudmFsdWUpKX19fWlmKCEhcy5ncm91cElkcylmb3IoY29uc3QgZSBvZiBzLmdyb3VwSWRzKXQuaW5jbHVkZXMoZSl8fHQucHVzaChlKX1yZXR1cm4gdH1vbm1lc3NhZ2U9bz0+e2NvbnN0IHQ9by5kYXRhLHM9Yyh0KTtwb3N0TWVzc2FnZShzKX19KSgpO30pKCk7Cg==",ha=typeof window<"u"&&window.Blob&&new Blob([atob(da)],{type:"text/javascript;charset=utf-8"});function Hg(){const r=ha&&(window.URL||window.webkitURL).createObjectURL(ha);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+da,{type:"module"})}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}const ua="KCgpPT57dmFyIGZlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxUZT1PYmplY3QuZGVmaW5lUHJvcGVydGllczt2YXIgSWU9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcnM7dmFyIGFlPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7dmFyIEFlPU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHksZGU9T2JqZWN0LnByb3RvdHlwZS5wcm9wZXJ0eUlzRW51bWVyYWJsZTt2YXIgbmU9KFQsSSxkKT0+SSBpbiBUP2ZlKFQsSSx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsd3JpdGFibGU6ITAsdmFsdWU6ZH0pOlRbSV09ZCxnPShULEkpPT57Zm9yKHZhciBkIGluIEl8fChJPXt9KSlBZS5jYWxsKEksZCkmJm5lKFQsZCxJW2RdKTtpZihhZSlmb3IodmFyIGQgb2YgYWUoSSkpZGUuY2FsbChJLGQpJiZuZShULGQsSVtkXSk7cmV0dXJuIFR9LF89KFQsSSk9PlRlKFQsSWUoSSkpOyhmdW5jdGlvbigpeyJ1c2Ugc3RyaWN0Ijt2YXIgVDsoZnVuY3Rpb24oZSl7ZS5IQUxGPSJoYWxmIixlLk9ORV9USElSRD0ib25lLXRoaXJkIixlLlFVQVJURVI9InF1YXJ0ZXIifSkoVHx8KFQ9e30pKTt2YXIgSTsoZnVuY3Rpb24oZSl7ZS5BUkFCSUM9ImFyYWJpYyIsZS5DSElORVNFPSJjaGluZXNlIn0pKEl8fChJPXt9KSk7dmFyIGQ7KGZ1bmN0aW9uKGUpe2UuSU5MSU5FPSJpbmxpbmUiLGUuQkxPQ0s9ImJsb2NrIixlLlNVUlJPVU5EPSJzdXJyb3VuZCIsZS5GTE9BVF9UT1A9ImZsb2F0LXRvcCIsZS5GTE9BVF9CT1RUT009ImZsb2F0LWJvdHRvbSJ9KShkfHwoZD17fSkpO3ZhciBYOyhmdW5jdGlvbihlKXtlLkJFRk9SRT0iYmVmb3JlIixlLkFGVEVSPSJhZnRlciIsZS5PVVRFUl9CRUZPUkU9Im91dGVyLWJlZm9yZSIsZS5PVVRFUl9BRlRFUj0ib3V0ZXItYWZ0ZXIifSkoWHx8KFg9e30pKTt2YXIgTTsoZnVuY3Rpb24oZSl7ZS5ST1c9InJvdyIsZS5DT0xVTU49ImNvbHVtbiJ9KShNfHwoTT17fSkpO2NvbnN0IFA9Ilx1MjAwQiI7VC5IQUxGKyIiLDEvMixULk9ORV9USElSRCsiIiwxLzMsVC5RVUFSVEVSKyIiLDEvNDtmdW5jdGlvbiBIKGUpe2lmKHR5cGVvZiBzdHJ1Y3R1cmVkQ2xvbmU9PSJmdW5jdGlvbiIpcmV0dXJuIHN0cnVjdHVyZWRDbG9uZShlKTtpZighZXx8dHlwZW9mIGUhPSJvYmplY3QiKXJldHVybiBlO2xldCBzPXt9O3JldHVybiBBcnJheS5pc0FycmF5KGUpP3M9ZS5tYXAoRT0+SChFKSk6T2JqZWN0LmtleXMoZSkuZm9yRWFjaChFPT5zW0VdPUgoZVtFXSkpLHN9ZnVuY3Rpb24gdyhlLHMpe2NvbnN0IEU9e307Zm9yKGNvbnN0IEEgaW4gZSlzLmluY2x1ZGVzKEEpJiYoRVtBXT1lW0FdKTtyZXR1cm4gRX1mdW5jdGlvbiBsZShlLHMpe3JldHVybiBlLmxlbmd0aCE9PXMubGVuZ3RoPyExOiFlLnNvbWUoRT0+IXMuaW5jbHVkZXMoRSkpfXZhciBsOyhmdW5jdGlvbihlKXtlLlRFWFQ9InRleHQiLGUuSU1BR0U9ImltYWdlIixlLlRBQkxFPSJ0YWJsZSIsZS5IWVBFUkxJTks9Imh5cGVybGluayIsZS5TVVBFUlNDUklQVD0ic3VwZXJzY3JpcHQiLGUuU1VCU0NSSVBUPSJzdWJzY3JpcHQiLGUuU0VQQVJBVE9SPSJzZXBhcmF0b3IiLGUuUEFHRV9CUkVBSz0icGFnZUJyZWFrIixlLkNPTlRST0w9ImNvbnRyb2wiLGUuQVJFQT0iYXJlYSIsZS5DSEVDS0JPWD0iY2hlY2tib3giLGUuUkFESU89InJhZGlvIixlLkxBVEVYPSJsYXRleCIsZS5UQUI9InRhYiIsZS5EQVRFPSJkYXRlIixlLkJMT0NLPSJibG9jayIsZS5USVRMRT0idGl0bGUiLGUuTElTVD0ibGlzdCJ9KShsfHwobD17fSkpO2NvbnN0IHJlPVsicm93RmxleCIsInJvd01hcmdpbiJdLG9lPVsidHlwZSIsImZvbnQiLCJzaXplIiwiYm9sZCIsImNvbG9yIiwiaXRhbGljIiwiaGlnaGxpZ2h0IiwidW5kZXJsaW5lIiwic3RyaWtlb3V0Iiwicm93RmxleCIsInJvd01hcmdpbiIsImRhc2hBcnJheSIsInRyTGlzdCIsInRhYmxlVG9vbERpc2FibGVkIiwiYm9yZGVyVHlwZSIsImJvcmRlckNvbG9yIiwid2lkdGgiLCJoZWlnaHQiLCJ1cmwiLCJjb2xncm91cCIsInZhbHVlTGlzdCIsImNvbnRyb2wiLCJjaGVja2JveCIsInJhZGlvIiwiZGF0ZUZvcm1hdCIsImJsb2NrIiwibGV2ZWwiLCJ0aXRsZSIsImxpc3RUeXBlIiwibGlzdFN0eWxlIiwibGlzdFdyYXAiLCJncm91cElkcyIsImNvbmNlcHRJZCIsImltZ0Rpc3BsYXkiLCJpbWdGbG9hdFBvc2l0aW9uIiwiaW1nVG9vbERpc2FibGVkIiwidGV4dERlY29yYXRpb24iLCJleHRlbnNpb24iLCJleHRlcm5hbElkIiwiYXJlYUlkIiwiYXJlYSJdLHNlPVsiY29uY2VwdElkIiwiZXh0ZW5zaW9uIiwiZXh0ZXJuYWxJZCIsInZlcnRpY2FsQWxpZ24iLCJiYWNrZ3JvdW5kQ29sb3IiLCJib3JkZXJUeXBlcyIsInNsYXNoVHlwZXMiLCJkaXNhYmxlZCIsImRlbGV0YWJsZSJdLGNlPVsiZm9udCIsInNpemUiLCJib2xkIiwiaGlnaGxpZ2h0IiwiaXRhbGljIiwic3RyaWtlb3V0Il07bC5URVhULGwuSFlQRVJMSU5LLGwuU1VCU0NSSVBULGwuU1VQRVJTQ1JJUFQsbC5DT05UUk9MLGwuREFURSxsLklNQUdFLGwuTEFURVgsbC5CTE9DSyxsLlBBR0VfQlJFQUssbC5TRVBBUkFUT1IsbC5UQUJMRSxsLlRJVExFLGwuTElTVDt2YXIgTjsoZnVuY3Rpb24oZSl7ZS5VTD0idWwiLGUuT0w9Im9sIn0pKE58fChOPXt9KSk7dmFyIE87KGZ1bmN0aW9uKGUpe2UuRElTQz0iZGlzYyIsZS5DSVJDTEU9ImNpcmNsZSIsZS5TUVVBUkU9InNxdWFyZSIsZS5DSEVDS0JPWD0iY2hlY2tib3gifSkoT3x8KE89e30pKTt2YXIgYjsoZnVuY3Rpb24oZSl7ZS5ERUNJTUFMPSJkZWNpbWFsIn0pKGJ8fChiPXt9KSk7dmFyIHY7KGZ1bmN0aW9uKGUpe2VbZS5ESVNDPU8uRElTQ109IkRJU0MiLGVbZS5DSVJDTEU9Ty5DSVJDTEVdPSJDSVJDTEUiLGVbZS5TUVVBUkU9Ty5TUVVBUkVdPSJTUVVBUkUiLGVbZS5ERUNJTUFMPWIuREVDSU1BTF09IkRFQ0lNQUwiLGVbZS5DSEVDS0JPWD1PLkNIRUNLQk9YXT0iQ0hFQ0tCT1gifSkodnx8KHY9e30pKSxPLkRJU0MrIiIsTy5DSVJDTEUrIiIsTy5TUVVBUkUrIiIsTy5DSEVDS0JPWCsiIixOLk9MKyIiLE4uVUwrIiIsdi5ESVNDKyIiLHYuQ0lSQ0xFKyIiLHYuU1FVQVJFKyIiLHYuREVDSU1BTCsiIix2LkNIRUNLQk9YKyIiO3ZhciBmOyhmdW5jdGlvbihlKXtlLkZJUlNUPSJmaXJzdCIsZS5TRUNPTkQ9InNlY29uZCIsZS5USElSRD0idGhpcmQiLGUuRk9VUlRIPSJmb3VydGgiLGUuRklGVEg9ImZpZnRoIixlLlNJWFRIPSJzaXh0aCJ9KShmfHwoZj17fSkpLGYuRklSU1QrIiIsZi5TRUNPTkQrIiIsZi5USElSRCsiIixmLkZPVVJUSCsiIixmLkZJRlRIKyIiLGYuU0lYVEgrIiIsZi5GSVJTVCsiIixmLlNFQ09ORCsiIixmLlRISVJEKyIiLGYuRk9VUlRIKyIiLGYuRklGVEgrIiIsZi5TSVhUSCsiIixmLkZJUlNULGYuU0VDT05ELGYuVEhJUkQsZi5GT1VSVEgsZi5GSUZUSCxmLlNJWFRIO3ZhciBLOyhmdW5jdGlvbihlKXtlLklGUkFNRT0iaWZyYW1lIixlLlZJREVPPSJ2aWRlbyJ9KShLfHwoSz17fSkpO3ZhciB6OyhmdW5jdGlvbihlKXtlLlRFWFQ9InRleHQiLGUuU0VMRUNUPSJzZWxlY3QiLGUuQ0hFQ0tCT1g9ImNoZWNrYm94IixlLlJBRElPPSJyYWRpbyIsZS5EQVRFPSJkYXRlIixlLk5VTUJFUj0ibnVtYmVyIn0pKHp8fCh6PXt9KSk7dmFyIEw7KGZ1bmN0aW9uKGUpe2UuUFJFRklYPSJwcmVmaXgiLGUuUE9TVEZJWD0icG9zdGZpeCIsZS5QUkVfVEVYVD0icHJlVGV4dCIsZS5QT1NUX1RFWFQ9InBvc3RUZXh0IixlLlBMQUNFSE9MREVSPSJwbGFjZWhvbGRlciIsZS5WQUxVRT0idmFsdWUiLGUuQ0hFQ0tCT1g9ImNoZWNrYm94IixlLlJBRElPPSJyYWRpbyJ9KShMfHwoTD17fSkpO3ZhciBHOyhmdW5jdGlvbihlKXtlLlJPV19TVEFSVD0icm93U3RhcnQiLGUuVkFMVUVfU1RBUlQ9InZhbHVlU3RhcnQifSkoR3x8KEc9e30pKTt2YXIgWTsoZnVuY3Rpb24oZSl7ZS5BQ1RJVkU9ImFjdGl2ZSIsZS5JTkFDVElWRT0iaW5hY3RpdmUifSkoWXx8KFk9e30pKTt2YXIgVjsoZnVuY3Rpb24oZSl7ZS5DT01QT05FTlQ9ImNvbXBvbmVudCIsZS5NRU5VPSJtZW51IixlLk1BSU49Im1haW4iLGUuRk9PVEVSPSJmb290ZXIiLGUuQ09OVEVYVE1FTlU9ImNvbnRleHRtZW51IixlLlBPUFVQPSJwb3B1cCIsZS5DQVRBTE9HPSJjYXRhbG9nIixlLkNPTU1FTlQ9ImNvbW1lbnQifSkoVnx8KFY9e30pKTt2YXIgUTsoZnVuY3Rpb24oZSl7ZS5QQUdFPSJwYWdlIixlLlRBQkxFPSJ0YWJsZSJ9KShRfHwoUT17fSkpO3ZhciBXOyhmdW5jdGlvbihlKXtlLkVESVQ9ImVkaXQiLGUuQ0xFQU49ImNsZWFuIixlLlJFQURPTkxZPSJyZWFkb25seSIsZS5GT1JNPSJmb3JtIixlLlBSSU5UPSJwcmludCIsZS5ERVNJR049ImRlc2lnbiJ9KShXfHwoVz17fSkpO3ZhciBxOyhmdW5jdGlvbihlKXtlLkhFQURFUj0iaGVhZGVyIixlLk1BSU49Im1haW4iLGUuRk9PVEVSPSJmb290ZXIifSkocXx8KHE9e30pKTt2YXIgWjsoZnVuY3Rpb24oZSl7ZS5QQUdJTkc9InBhZ2luZyIsZS5DT05USU5VSVRZPSJjb250aW51aXR5In0pKFp8fChaPXt9KSk7dmFyIEo7KGZ1bmN0aW9uKGUpe2UuVkVSVElDQUw9InZlcnRpY2FsIixlLkhPUklaT05UQUw9Imhvcml6b250YWwifSkoSnx8KEo9e30pKTt2YXIgajsoZnVuY3Rpb24oZSl7ZS5CUkVBS19BTEw9ImJyZWFrLWFsbCIsZS5CUkVBS19XT1JEPSJicmVhay13b3JkIn0pKGp8fChqPXt9KSk7dmFyICQ7KGZ1bmN0aW9uKGUpe2UuU1BFRUQ9InNwZWVkIixlLkNPTVBBVElCSUxJVFk9ImNvbXBhdGliaWxpdHkifSkoJHx8KCQ9e30pKTt2YXIgRDsoZnVuY3Rpb24oZSl7ZS5MRUZUPSJsZWZ0IixlLkNFTlRFUj0iY2VudGVyIixlLlJJR0hUPSJyaWdodCIsZS5BTElHTk1FTlQ9ImFsaWdubWVudCIsZS5KVVNUSUZZPSJqdXN0aWZ5In0pKER8fChEPXt9KSk7dmFyIGVlOyhmdW5jdGlvbihlKXtlLkFMTD0iYWxsIixlLkVNUFRZPSJlbXB0eSIsZS5FWFRFUk5BTD0iZXh0ZXJuYWwiLGUuSU5URVJOQUw9ImludGVybmFsIixlLkRBU0g9ImRhc2gifSkoZWV8fChlZT17fSkpO3ZhciB0ZTsoZnVuY3Rpb24oZSl7ZS5UT1A9InRvcCIsZS5SSUdIVD0icmlnaHQiLGUuQk9UVE9NPSJib3R0b20iLGUuTEVGVD0ibGVmdCJ9KSh0ZXx8KHRlPXt9KSk7dmFyIGllOyhmdW5jdGlvbihlKXtlLkZPUldBUkQ9ImZvcndhcmQiLGUuQkFDSz0iYmFjayJ9KShpZXx8KGllPXt9KSk7dmFyIGs7KGZ1bmN0aW9uKGUpe2UuQ09OVEFJTj0iY29udGFpbiIsZS5DT1ZFUj0iY292ZXIifSkoa3x8KGs9e30pKTt2YXIgbTsoZnVuY3Rpb24oZSl7ZS5SRVBFQVQ9InJlcGVhdCIsZS5OT19SRVBFQVQ9Im5vLXJlcGVhdCIsZS5SRVBFQVRfWD0icmVwZWF0LXgiLGUuUkVQRUFUX1k9InJlcGVhdC15In0pKG18fChtPXt9KSksay5DT1ZFUixtLk5PX1JFUEVBVDt2YXIgRjsoZnVuY3Rpb24oZSl7ZS5UT1A9InRvcCIsZS5NSURETEU9Im1pZGRsZSIsZS5CT1RUT009ImJvdHRvbSJ9KShGfHwoRj17fSkpLEYuQk9UVE9NLFQuSEFMRixULkhBTEY7Y29uc3QgdWU9e1BBR0VfTk86IntwYWdlTm99IixQQUdFX0NPVU5UOiJ7cGFnZUNvdW50fSJ9O0QuQ0VOVEVSLHVlLlBBR0VfTk8sSS5BUkFCSUMsRi5CT1RUT007dmFyIHk7KGZ1bmN0aW9uKGUpe2UuVEVYVD0idGV4dCIsZS5JTUFHRT0iaW1hZ2UifSkoeXx8KHk9e30pKSx5LlRFWFQsSS5BUkFCSUM7dmFyIFU7KGZ1bmN0aW9uKGUpe2UuUEFHRT0icGFnZSIsZS5DT05USU5VSVRZPSJjb250aW51aXR5In0pKFV8fChVPXt9KSksVS5DT05USU5VSVRZO2Z1bmN0aW9uIEVlKGUscyl7Y29uc3QgRT1PYmplY3Qua2V5cyhlKSxBPU9iamVjdC5rZXlzKHMpO2lmKEUubGVuZ3RoIT09QS5sZW5ndGgpcmV0dXJuITE7Zm9yKGxldCBSPTA7UjxFLmxlbmd0aDtSKyspe2NvbnN0IGE9RVtSXTtpZihhIT09InZhbHVlIiYmIShhPT09Imdyb3VwSWRzIiYmQXJyYXkuaXNBcnJheShlW2FdKSYmQXJyYXkuaXNBcnJheShzW2FdKSYmbGUoZVthXSxzW2FdKSkmJmVbYV0hPT1zW2FdKXJldHVybiExfXJldHVybiEwfWZ1bmN0aW9uIEIoZSxzPXt9KXtjb25zdHtleHRyYVBpY2tBdHRyczpFfT1zLEE9Wy4uLm9lXTtFJiZBLnB1c2goLi4uRSk7Y29uc3QgUj17dmFsdWU6ZS52YWx1ZT09PVA/YApgOmUudmFsdWV9O3JldHVybiBBLmZvckVhY2goYT0+e2NvbnN0IHA9ZVthXTtwIT09dm9pZCAwJiYoUlthXT1wKX0pLFJ9ZnVuY3Rpb24gaChlLHM9e30pe2NvbnN0e2V4dHJhUGlja0F0dHJzOkUsaXNDbGFzc2lmeUFyZWE6QT0hMSxpc0Nsb25lOlI9ITB9PXMsYT1SP0goZSk6ZSxwPVtdO2xldCBpPTA7Zm9yKDtpPGEubGVuZ3RoOyl7bGV0IHQ9YVtpXTtpZihpPT09MCYmdC52YWx1ZT09PVAmJiF0Lmxpc3RJZCYmKCF0LnR5cGV8fHQudHlwZT09PWwuVEVYVCkpe2krKztjb250aW51ZX1pZih0LmFyZWFJZCl7Y29uc3Qgbj10LmFyZWFJZCx1PXQuYXJlYSxjPVtdO2Zvcig7aTxhLmxlbmd0aDspe2NvbnN0IG89YVtpXTtpZihuIT09by5hcmVhSWQpe2ktLTticmVha31kZWxldGUgby5hcmVhLGRlbGV0ZSBvLmFyZWFJZCxjLnB1c2gobyksaSsrfWNvbnN0IHI9aChjLHMpO2lmKEEpe2NvbnN0IG89e3R5cGU6bC5BUkVBLHZhbHVlOiIiLGFyZWFJZDpuLGFyZWE6dX07by52YWx1ZUxpc3Q9cix0PW99ZWxzZXtwLnNwbGljZShpLDAsLi4ucik7Y29udGludWV9fWVsc2UgaWYodC50aXRsZUlkJiZ0LmxldmVsKXtjb25zdCBuPXQudGl0bGVJZDtpZihuKXtjb25zdCB1PXQubGV2ZWwsYz17dHlwZTpsLlRJVExFLHRpdGxlOnQudGl0bGUsdGl0bGVJZDpuLHZhbHVlOiIiLGxldmVsOnV9LHI9W107Zm9yKDtpPGEubGVuZ3RoOyl7Y29uc3Qgbz1hW2ldO2lmKG4hPT1vLnRpdGxlSWQpe2ktLTticmVha31kZWxldGUgby5sZXZlbCxkZWxldGUgby50aXRsZSxyLnB1c2gobyksaSsrfWMudmFsdWVMaXN0PWgocixzKSx0PWN9fWVsc2UgaWYodC5saXN0SWQmJnQubGlzdFR5cGUpe2NvbnN0IG49dC5saXN0SWQ7aWYobil7Y29uc3QgdT10Lmxpc3RUeXBlLGM9dC5saXN0U3R5bGUscj17dHlwZTpsLkxJU1QsdmFsdWU6IiIsbGlzdElkOm4sbGlzdFR5cGU6dSxsaXN0U3R5bGU6Y30sbz1bXTtmb3IoO2k8YS5sZW5ndGg7KXtjb25zdCBDPWFbaV07aWYobiE9PUMubGlzdElkKXtpLS07YnJlYWt9ZGVsZXRlIEMubGlzdFR5cGUsZGVsZXRlIEMubGlzdFN0eWxlLG8ucHVzaChDKSxpKyt9ci52YWx1ZUxpc3Q9aChvLHMpLHQ9cn19ZWxzZSBpZih0LnR5cGU9PT1sLlRBQkxFKXtpZih0LnBhZ2luZ0lkKXtsZXQgbj1pKzEsdT0wO2Zvcig7bjxhLmxlbmd0aDspe2NvbnN0IGM9YVtuXTtpZihjLnBhZ2luZ0lkPT09dC5wYWdpbmdJZCl0LmhlaWdodCs9Yy5oZWlnaHQsdC50ckxpc3QucHVzaCguLi5jLnRyTGlzdCksbisrLHUrKztlbHNlIGJyZWFrfWkrPXV9aWYodC50ckxpc3QpZm9yKGxldCBuPTA7bjx0LnRyTGlzdC5sZW5ndGg7bisrKXtjb25zdCB1PXQudHJMaXN0W25dO2RlbGV0ZSB1LmlkO2ZvcihsZXQgYz0wO2M8dS50ZExpc3QubGVuZ3RoO2MrKyl7Y29uc3Qgcj11LnRkTGlzdFtjXSxvPXtjb2xzcGFuOnIuY29sc3Bhbixyb3dzcGFuOnIucm93c3Bhbix2YWx1ZTpoKHIudmFsdWUsXyhnKHt9LHMpLHtpc0NsYXNzaWZ5QXJlYTohMX0pKX07c2UuZm9yRWFjaChDPT57Y29uc3QgUz1yW0NdO1MhPT12b2lkIDAmJihvW0NdPVMpfSksdS50ZExpc3RbY109b319fWVsc2UgaWYodC50eXBlPT09bC5IWVBFUkxJTkspe2NvbnN0IG49dC5oeXBlcmxpbmtJZDtpZihuKXtjb25zdCB1PXt0eXBlOmwuSFlQRVJMSU5LLHZhbHVlOiIiLHVybDp0LnVybH0sYz1bXTtmb3IoO2k8YS5sZW5ndGg7KXtjb25zdCByPWFbaV07aWYobiE9PXIuaHlwZXJsaW5rSWQpe2ktLTticmVha31kZWxldGUgci50eXBlLGRlbGV0ZSByLnVybCxjLnB1c2gociksaSsrfXUudmFsdWVMaXN0PWgoYyxzKSx0PXV9fWVsc2UgaWYodC50eXBlPT09bC5EQVRFKXtjb25zdCBuPXQuZGF0ZUlkO2lmKG4pe2NvbnN0IHU9e3R5cGU6bC5EQVRFLHZhbHVlOiIiLGRhdGVGb3JtYXQ6dC5kYXRlRm9ybWF0fSxjPVtdO2Zvcig7aTxhLmxlbmd0aDspe2NvbnN0IHI9YVtpXTtpZihuIT09ci5kYXRlSWQpe2ktLTticmVha31kZWxldGUgci50eXBlLGRlbGV0ZSByLmRhdGVGb3JtYXQsYy5wdXNoKHIpLGkrK311LnZhbHVlTGlzdD1oKGMscyksdD11fX1lbHNlIGlmKHQuY29udHJvbElkKXtjb25zdCBuPXQuY29udHJvbElkO2lmKHQuY29udHJvbENvbXBvbmVudD09PUwuUFJFRklYKXtjb25zdCB1PVtdO2xldCBjPSExLHI9aTtmb3IoO3I8YS5sZW5ndGg7KXtjb25zdCBvPWFbcl07aWYobiE9PW8uY29udHJvbElkKWJyZWFrO28uY29udHJvbENvbXBvbmVudD09PUwuVkFMVUUmJihkZWxldGUgby5jb250cm9sLGRlbGV0ZSBvLmNvbnRyb2xJZCx1LnB1c2gobykpLG8uY29udHJvbENvbXBvbmVudD09PUwuUE9TVEZJWCYmKGM9ITApLHIrK31pZihjKXtjb25zdCBvPXcodCxjZSksQz1nKGcoe30sdC5jb250cm9sKSxvKSxTPV8oZyh7fSx3KHQscmUpKSx7dHlwZTpsLkNPTlRST0wsdmFsdWU6IiIsY29udHJvbDpDLGNvbnRyb2xJZDpufSk7Uy5jb250cm9sLnZhbHVlPWgodSxzKSx0PUIoUyx7ZXh0cmFQaWNrQXR0cnM6RX0pLGkrPXItaS0xfX1pZih0LmNvbnRyb2xDb21wb25lbnQmJihkZWxldGUgdC5jb250cm9sLGRlbGV0ZSB0LmNvbnRyb2xJZCx0LmNvbnRyb2xDb21wb25lbnQhPT1MLlZBTFVFJiZ0LmNvbnRyb2xDb21wb25lbnQhPT1MLlBSRV9URVhUJiZ0LmNvbnRyb2xDb21wb25lbnQhPT1MLlBPU1RfVEVYVCkpe2krKztjb250aW51ZX19Y29uc3QgeD1CKHQse2V4dHJhUGlja0F0dHJzOkV9KTtpZighdC50eXBlfHx0LnR5cGU9PT1sLlRFWFR8fHQudHlwZT09PWwuU1VCU0NSSVBUfHx0LnR5cGU9PT1sLlNVUEVSU0NSSVBUKWZvcig7aTxhLmxlbmd0aDspe2NvbnN0IG49YVtpKzFdO2lmKGkrKyxuJiZFZSh4LEIobix7ZXh0cmFQaWNrQXR0cnM6RX0pKSl7Y29uc3QgdT1uLnZhbHVlPT09UD9gCmA6bi52YWx1ZTt4LnZhbHVlKz11fWVsc2UgYnJlYWt9ZWxzZSBpKys7cC5wdXNoKHgpfXJldHVybiBwfW9ubWVzc2FnZT1lPT57Y29uc3Qgcz1lLmRhdGEse29wdGlvbnM6RSxkYXRhOkF9PXMse2V4dHJhUGlja0F0dHJzOlI9W119PUV8fHt9LGE9e2hlYWRlcjpoKEEuaGVhZGVyLHtleHRyYVBpY2tBdHRyczpSLGlzQ2xvbmU6ITF9KSxtYWluOmgoQS5tYWluLHtleHRyYVBpY2tBdHRyczpSLGlzQ2xhc3NpZnlBcmVhOiEwLGlzQ2xvbmU6ITF9KSxmb290ZXI6aChBLmZvb3Rlcix7ZXh0cmFQaWNrQXR0cnM6Uixpc0Nsb25lOiExfSl9O3Bvc3RNZXNzYWdlKGEpfX0pKCk7fSkoKTsK",fa=typeof window<"u"&&window.Blob&&new Blob([atob(ua)],{type:"text/javascript;charset=utf-8"});function Bg(){const r=fa&&(window.URL||window.webkitURL).createObjectURL(fa);try{return r?new Worker(r):new Worker("data:application/javascript;base64,"+ua,{type:"module"})}finally{r&&(window.URL||window.webkitURL).revokeObjectURL(r)}}class Gg{constructor(e){O(this,"draw"),O(this,"wordCountWorker"),O(this,"catalogWorker"),O(this,"groupWorker"),O(this,"valueWorker"),this.draw=e,this.wordCountWorker=new Qg,this.catalogWorker=new Kg,this.groupWorker=new Hg,this.valueWorker=new Bg}getWordCount(){return new Promise((e,t)=>{this.wordCountWorker.onmessage=n=>{e(n.data)},this.wordCountWorker.onerror=n=>{t(n)};const i=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(i)})}getCatalog(){return new Promise((e,t)=>{this.catalogWorker.onmessage=s=>{e(s.data)},this.catalogWorker.onerror=s=>{t(s)};const i=this.draw.getOriginalMainElementList(),n=this.draw.getPosition().getOriginalMainPositionList();this.catalogWorker.postMessage({elementList:i,positionList:n})})}getGroupIds(){return new Promise((e,t)=>{this.groupWorker.onmessage=n=>{e(n.data)},this.groupWorker.onerror=n=>{t(n)};const i=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(i)})}getValue(e){return new Promise((t,i)=>{this.valueWorker.onmessage=n=>{t({version:br,data:n.data,options:Ne(this.draw.getOptions())})},this.valueWorker.onerror=n=>{i(n)},this.valueWorker.postMessage({data:this.draw.getOriginValue(e),options:e})})}}class _g{constructor(e){O(this,"container"),O(this,"canvas"),O(this,"draw"),O(this,"options"),O(this,"curElement"),O(this,"curElementSrc"),O(this,"previewerDrawOption"),O(this,"curPosition"),O(this,"eventBus"),O(this,"imageList"),O(this,"curShowElement"),O(this,"imageCount"),O(this,"imagePre"),O(this,"imageNext"),O(this,"resizerSelection"),O(this,"resizerHandleList"),O(this,"resizerImageContainer"),O(this,"resizerImage"),O(this,"resizerSize"),O(this,"width"),O(this,"height"),O(this,"mousedownX"),O(this,"mousedownY"),O(this,"curHandleIndex"),O(this,"previewerContainer"),O(this,"previewerImage"),O(this,"_keydown",()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))}),this.container=e.getContainer(),this.canvas=e.getPage(),this.draw=e,this.options=e.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null,this.eventBus=e.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:t,resizerHandleList:i,resizerImageContainer:n,resizerImage:s,resizerSize:l}=this._createResizerDom();this.resizerSelection=t,this.resizerHandleList=i,this.resizerImageContainer=n,this.resizerImage=s,this.resizerSize=l,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(e,t=null){var i;const{scale:n}=this.options;let s=0,l=0;const a=this.draw.getHeight(),c=this.draw.getPageGap(),h=((i=t?.pageNo)!=null?i:this.draw.getPageNo())*(a+c);if(e.imgFloatPosition)s=e.imgFloatPosition.x*n,l=e.imgFloatPosition.y*n+h;else if(t){const{coordinate:{leftTop:[u,f]},ascent:g}=t;s=u,l=f+h+g}return{x:s,y:l}}_createResizerDom(){const{scale:e}=this.options,t=document.createElement("div");t.classList.add(`${ie}-resizer-selection`),t.style.display="none",t.style.borderColor=this.options.resizerColor,t.style.borderWidth=`${e}px`;const i=[];for(let c=0;c<8;c++){const d=document.createElement("div");d.style.background=this.options.resizerColor,d.classList.add("resizer-handle"),d.classList.add(`handle-${c}`),d.setAttribute("data-index",String(c)),d.onmousedown=this._mousedown.bind(this),t.append(d),i.push(d)}this.container.append(t);const n=document.createElement("div");n.classList.add(`${ie}-resizer-size-view`);const s=document.createElement("span");n.append(s),t.append(n);const l=document.createElement("div");l.classList.add(`${ie}-resizer-image`),l.style.display="none";const a=document.createElement("img");return l.append(a),this.container.append(l),{resizerSelection:t,resizerHandleList:i,resizerImageContainer:l,resizerImage:a,resizerSize:s}}_mousedown(e){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:t}=this.options;this.mousedownX=e.x,this.mousedownY=e.y;const i=e.target;this.curHandleIndex=Number(i.dataset.index);const n=window.getComputedStyle(i).cursor;document.body.style.cursor=n,this.canvas.style.cursor=n,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:s,y:l}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${s}px`,this.resizerImageContainer.style.top=`${l}px`,this.resizerImage.style.width=`${this.curElement.width*t}px`,this.resizerImage.style.height=`${this.curElement.height*t}px`;const a=this._mousemove.bind(this);document.addEventListener("mousemove",a),document.addEventListener("mouseup",()=>{var c;this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:(c=this.curPosition)==null?void 0:c.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",a),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(e){if(!this.curElement||this.previewerDrawOption.dragDisable)return;const{scale:t}=this.options;let i=0,n=0;switch(this.curHandleIndex){case 0:{const d=this.mousedownX-e.x,h=this.mousedownY-e.y;i=Math.cbrt(d**3+h**3),n=this.curElement.height*i/this.curElement.width}break;case 1:n=this.mousedownY-e.y;break;case 2:{const d=e.x-this.mousedownX,h=this.mousedownY-e.y;i=Math.cbrt(d**3+h**3),n=this.curElement.height*i/this.curElement.width}break;case 4:{const d=e.x-this.mousedownX,h=e.y-this.mousedownY;i=Math.cbrt(d**3+h**3),n=this.curElement.height*i/this.curElement.width}break;case 3:i=e.x-this.mousedownX;break;case 5:n=e.y-this.mousedownY;break;case 6:{const d=this.mousedownX-e.x,h=e.y-this.mousedownY;i=Math.cbrt(d**3+h**3),n=this.curElement.height*i/this.curElement.width}break;case 7:i=this.mousedownX-e.x;break}const s=this.curElement.width+i/t,l=this.curElement.height+n/t;if(s<=0||l<=0)return;this.width=s,this.height=l;const a=s*t,c=l*t;this.resizerImage.style.width=`${a}px`,this.resizerImage.style.height=`${c}px`,this._updateResizerRect(a,c),this._updateResizerSizeView(a,c),e.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const e=document.createElement("div");e.classList.add(`${ie}-image-previewer`);const t=document.createElement("i");t.classList.add("image-close"),t.onclick=()=>{this._clearPreviewer()},e.append(t);const i=document.createElement("div");i.classList.add(`${ie}-image-container`);const n=document.createElement("img");n.src=this.curElementSrc,n.draggable=!1,i.append(n),this.previewerImage=n,e.append(i);let s=0,l=0,a=1,c=0;const d=document.createElement("div");d.classList.add(`${ie}-image-menu`);const h=document.createElement("div");h.classList.add("image-navigate");const u=document.createElement("i");u.classList.add("image-pre"),u.onclick=()=>{const T=this.imageList.findIndex(y=>{var x;return y.id===((x=this.curShowElement)==null?void 0:x.id)});T<=0||(this.curShowElement=this.imageList[T-1],n.src=this.curShowElement.value,this._updateImageNavigate())},h.append(u),this.imagePre=u;const f=document.createElement("span");f.classList.add("image-count"),this.imageCount=f,h.append(f);const g=document.createElement("i");g.classList.add("image-next"),g.onclick=()=>{const T=this.imageList.findIndex(y=>{var x;return y.id===((x=this.curShowElement)==null?void 0:x.id)});T>=this.imageList.length-1||(this.curShowElement=this.imageList[T+1],n.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=g,h.append(g),d.append(h);const R=document.createElement("i");R.classList.add("zoom-in"),R.onclick=()=>{a+=.1,this._setPreviewerTransform(a,c,s,l)},d.append(R);const p=document.createElement("i");p.onclick=()=>{a-.1<=.1||(a-=.1,this._setPreviewerTransform(a,c,s,l))},p.classList.add("zoom-out"),d.append(p);const M=document.createElement("i");M.classList.add("rotate"),M.onclick=()=>{c+=1,this._setPreviewerTransform(a,c,s,l)},d.append(M);const S=document.createElement("i");S.classList.add("original-size"),S.onclick=()=>{s=0,l=0,a=1,c=0,this._setPreviewerTransform(a,c,s,l)},d.append(S);const b=document.createElement("i");b.classList.add("image-download"),b.onclick=()=>{var T;const{mime:y}=this.previewerDrawOption;Ir(n.src,`${(T=this.curElement)==null?void 0:T.id}.${y||"png"}`)},d.append(b),e.append(d),this.previewerContainer=e,document.body.append(e);let P=0,N=0,m=!1;n.onmousedown=T=>{m=!0,P=T.x,N=T.y,e.style.cursor="move"},e.onmousemove=T=>{m&&(s+=T.x-P,l+=T.y-N,P=T.x,N=T.y,this._setPreviewerTransform(a,c,s,l))},e.onmouseup=()=>{m=!1,e.style.cursor="auto"},e.onwheel=T=>{if(T.preventDefault(),T.stopPropagation(),T.deltaY<0)a+=.1;else{if(a-.1<=.1)return;a-=.1}this._setPreviewerTransform(a,c,s,l)},this._updateImageNavigate()}_updateImageNavigate(){const e=this.imageList.findIndex(t=>{var i;return t.id===((i=this.curShowElement)==null?void 0:i.id)});this.imageCount.innerText=`${e+1} / ${this.imageList.length}`,e<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),e>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_setPreviewerTransform(e,t,i,n){this.previewerImage&&(this.previewerImage.style.left=`${i}px`,this.previewerImage.style.top=`${n}px`,this.previewerImage.style.transform=`scale(${e}) rotate(${t*90}deg)`)}_clearPreviewer(){var e;(e=this.previewerContainer)==null||e.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(e,t){const{resizerSize:i,scale:n}=this.options,s=this.draw.isReadonly();this.resizerSelection.style.width=`${e}px`,this.resizerSelection.style.height=`${t}px`;for(let l=0;l<8;l++){const a=l===0||l===6||l===7?-i:l===1||l===5?e/2:e-i,c=l===0||l===1||l===2?-i:l===3||l===7?t/2-i:t-i;this.resizerHandleList[l].style.transform=`scale(${n})`,this.resizerHandleList[l].style.left=`${a}px`,this.resizerHandleList[l].style.top=`${c}px`,this.resizerHandleList[l].style.display=s?"none":"block"}}_updateResizerSizeView(e,t){this.resizerSize.innerText=`${Math.round(e)} × ${Math.round(t)}`}render(){var e,t;const i=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||i===ce.PRINT&&((e=this.options.modeRule[ce.PRINT])!=null&&e.imagePreviewerDisabled)||i===ce.READONLY&&((t=this.options.modeRule[ce.READONLY])!=null&&t.imagePreviewerDisabled)||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(e,t=null,i={}){var n,s;const l=this.draw.getMode();e.imgToolDisabled&&!this.draw.isDesignMode()||l===ce.PRINT&&((n=this.options.modeRule[ce.PRINT])!=null&&n.imagePreviewerDisabled)||l===ce.READONLY&&((s=this.options.modeRule[ce.READONLY])!=null&&s.imagePreviewerDisabled)||(this.previewerDrawOption=i,this.curElementSrc=e[i.srcKey||"value"]||"",this.updateResizer(e,t),document.addEventListener("keydown",this._keydown))}updateResizer(e,t=null){const{scale:i}=this.options,n=e.width*i,s=e.height*i;this._updateResizerSizeView(n,s);const{x:l,y:a}=this._getElementPosition(e,t);this.resizerSelection.style.left=`${l}px`,this.resizerSelection.style.top=`${a}px`,this.resizerSelection.style.borderWidth=`${i}px`,this._updateResizerRect(n,s),this.resizerSelection.style.display="block",this.curElement=e,this.curPosition=t,this.width=n,this.height=s}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class Ag{constructor(e){O(this,"draw"),O(this,"range"),O(this,"datePicker"),O(this,"options"),this.draw=e,this.options=e.getOptions(),this.range=e.getRange(),this.datePicker=new sa(e,{onSubmit:this._setValue.bind(this)})}_setValue(e){if(!e)return;const t=this.getDateElementRange();if(!t)return;const[i,n]=t,s=this.draw.getElementList(),l=s[i+1];this.draw.spliceElementList(s,i+1,n-i),this.range.setRange(i,i);const a={type:D.DATE,value:"",dateFormat:l.dateFormat,valueList:[{value:e}]};$e(s,[a],i,{editorOptions:this.options}),this.draw.insertElementList([a])}getDateElementRange(){let e=-1,t=-1;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return null;const s=this.draw.getElementList(),l=s[i];if(l.type!==D.DATE)return null;let a=i;for(;a>=0;){if(s[a].dateId!==l.dateId){e=a;break}a--}let c=i+1;for(;c<s.length;){if(s[c].dateId!==l.dateId){t=c-1;break}c++}return c===s.length&&(t=c-1),!~e||!~t?null:[e,t]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(e,t){const i=this.draw.getElementList(),n=this.getDateElementRange(),s=n?i.slice(n[0]+1,n[1]+1).map(l=>l.value).join(""):"";this.datePicker.render({value:s,position:t,dateFormat:e.dateFormat})}}class Jg{constructor(e){O(this,"element"),this.element=e}render(e){var t;const i=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=((t=i.videoBlock)==null?void 0:t.src)||"",n.controls=!0,e.append(n)}}class zg{constructor(e,t){O(this,"draw"),O(this,"element"),O(this,"block"),O(this,"blockContainer"),O(this,"blockItem"),this.draw=e.getDraw(),this.blockContainer=e.getBlockContainer(),this.element=t,this.block=null,this.blockItem=this._createBlockItem(),this.blockContainer.append(this.blockItem)}getBlockElement(){return this.element}_createBlockItem(){const e=document.createElement("div");return e.classList.add(`${ie}-block-item`),e}render(){const e=this.element.block;e.type===_t.IFRAME?(this.block=new Co(this.element),this.block.render(this.blockItem)):e.type===_t.VIDEO&&(this.block=new Jg(this.element),this.block.render(this.blockItem))}setClientRects(e,t,i){const n=this.draw.getHeight(),s=this.draw.getPageGap(),l=e*(n+s),{metrics:a}=this.element;this.blockItem.style.width=`${a.width}px`,this.blockItem.style.height=`${a.height}px`,this.blockItem.style.left=`${t}px`,this.blockItem.style.top=`${l+i}px`}remove(){this.blockItem.remove()}}class $g{constructor(e){O(this,"draw"),O(this,"container"),O(this,"blockContainer"),O(this,"blockMap"),this.draw=e,this.container=e.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const e=document.createElement("div");return e.classList.add(`${ie}-block-container`),e}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(e,t,i,n){const s=t.id,l=this.blockMap.get(s);if(l)l.setClientRects(e,i,n);else{const a=new zg(this,t);a.render(),a.setClientRects(e,i,n),this.blockMap.set(s,a)}}clear(){if(!this.blockMap.size)return;const e=this.draw.getElementList(),t=[];for(let i=0;i<e.length;i++){const n=e[i];n.type===D.BLOCK&&t.push(n.id)}this.blockMap.forEach(i=>{const n=i.getBlockElement().id;t.includes(n)||(i.remove(),this.blockMap.delete(n))})}}var Jo={contextmenu:{global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印"},control:{delete:"删除控件"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线"}},datePicker:{now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},frame:{header:"页眉",footer:"页脚"},pageBreak:{displayName:"分页符"},zone:{headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"}},jg={contextmenu:{global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print"},control:{delete:"Delete control"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",surround:"Surround",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderDash:"Dash",borderExternal:"External",borderInternal:"Internal",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back"}},datePicker:{now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},frame:{header:"Header",footer:"Footer"},pageBreak:{displayName:"Page Break"},zone:{headerTip:"Double click to edit header",footerTip:"Double click to edit footer"}};class qg{constructor(e){O(this,"currentLocale"),O(this,"langMap",new Map([["zhCN",Jo],["en",jg]])),this.currentLocale=e}registerLangMap(e,t){const i=this.langMap.get(e);this.langMap.set(e,xr(i||Jo,t))}getLocale(){return this.currentLocale}setLocale(e){this.currentLocale=e}getLang(){return this.langMap.get(this.currentLocale)||Jo}t(e){const t=e.split(".");let i="",n=this.getLang();for(let s=0;s<t.length;s++){const l=t[s],a=Reflect.get(n,l);if(a)i=n=a;else return""}return i}}class eR{constructor(){O(this,"promiseList"),this.promiseList=[]}add(e){this.promiseList.push(e)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class tR{constructor(e,t){O(this,"draw"),O(this,"zone"),O(this,"i18n"),O(this,"container"),O(this,"pageContainer"),O(this,"isDisableMouseMove"),O(this,"tipContainer"),O(this,"tipContent"),O(this,"currentMoveZone"),this.draw=e,this.zone=t,this.i18n=e.getI18n(),this.container=e.getContainer(),this.pageContainer=e.getPageContainer();const{tipContainer:i,tipContent:n}=this._drawZoneTip();this.tipContainer=i,this.tipContent=n,this.isDisableMouseMove=!0,this.currentMoveZone=de.MAIN;const s=[],{header:l,footer:a}=e.getOptions();l.disabled||s.push(de.HEADER),a.disabled||s.push(de.FOOTER),s.length&&this._watchMouseMoveZoneChange(s)}_watchMouseMoveZoneChange(e){this.pageContainer.addEventListener("mousemove",Cu(t=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())&&t.offsetY)if(t.target instanceof HTMLCanvasElement){const i=this.zone.getZoneByY(t.offsetY);if(!e.includes(i)){this._updateZoneTip(!1);return}this.currentMoveZone=i,this._updateZoneTip(this.zone.getZone()===de.MAIN&&(i===de.HEADER||i===de.FOOTER),t.x,t.y)}else this._updateZoneTip(!1)},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const e=document.createElement("div");e.classList.add(`${ie}-zone-tip`);const t=document.createElement("span");return e.append(t),this.container.append(e),{tipContainer:e,tipContent:t}}_updateZoneTip(e,t,i){e?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${t}px`,this.tipContainer.style.top=`${i}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===de.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class iR{constructor(e){O(this,"INDICATOR_PADDING",2),O(this,"INDICATOR_TITLE_TRANSLATE",[20,5]),O(this,"draw"),O(this,"options"),O(this,"i18n"),O(this,"container"),O(this,"currentZone"),O(this,"indicatorContainer"),this.draw=e,this.i18n=e.getI18n(),this.options=e.getOptions(),this.container=e.getContainer(),this.currentZone=de.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new tR(e,this)}isHeaderActive(){return this.getZone()===de.HEADER}isMainActive(){return this.getZone()===de.MAIN}isFooterActive(){return this.getZone()===de.FOOTER}getZone(){return this.currentZone}setZone(e){const{header:t,footer:i}=this.options;!t.editable&&e===de.HEADER||!i.editable&&e===de.FOOTER||this.currentZone!==e&&(this.currentZone=e,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),wr(()=>{const n=this.draw.getListener();n.zoneChange&&n.zoneChange(e);const s=this.draw.getEventBus();s.isSubscribe("zoneChange")&&s.emit("zoneChange",e)}))}getZoneByY(e){const t=this.draw.getHeader(),i=t.getHeaderTop()+t.getHeight(),n=this.draw.getFooter(),l=this.draw.getHeight()-(n.getFooterBottom()+n.getHeight());return e<i?de.HEADER:e>l?de.FOOTER:de.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:e}=this.options,t=this.isHeaderActive(),[i,n]=this.INDICATOR_TITLE_TRANSLATE,s=this.draw.getPageList(),l=this.draw.getMargins(),a=this.draw.getInnerWidth(),c=this.draw.getHeight(),d=this.draw.getPageGap(),h=c+d;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${ie}-zone-indicator`);const u=this.draw.getHeader(),f=this.draw.getFooter(),g=t?u.getHeight():f.getHeight(),R=t?u.getHeaderTop():c-f.getFooterBottom()-g;for(let p=0;p<s.length;p++){const M=h*p+R,S=l[3]-this.INDICATOR_PADDING,b=l[3]+a+this.INDICATOR_PADDING,P=t?M-this.INDICATOR_PADDING:M+g+this.INDICATOR_PADDING,N=t?M+g+this.INDICATOR_PADDING:M-this.INDICATOR_PADDING,m=document.createElement("div");m.innerText=this.i18n.t(`frame.${t?"header":"footer"}`),m.style.top=`${N}px`,m.style.transform=`translate(${i*e}px, ${n*e}px) scale(${e})`,this.indicatorContainer.append(m);const T=document.createElement("span");T.classList.add(`${ie}-zone-indicator-border__top`),T.style.top=`${P}px`,T.style.width=`${a}px`,T.style.marginLeft=`${l[3]}px`,this.indicatorContainer.append(T);const y=document.createElement("span");y.classList.add(`${ie}-zone-indicator-border__left`),y.style.top=`${M}px`,y.style.height=`${g}px`,y.style.left=`${S}px`,this.indicatorContainer.append(y);const x=document.createElement("span");x.classList.add(`${ie}-zone-indicator-border__bottom`),x.style.top=`${N}px`,this.indicatorContainer.append(x);const I=document.createElement("span");I.classList.add(`${ie}-zone-indicator-border__right`),I.style.top=`${M}px`,I.style.height=`${g}px`,I.style.left=`${b}px`,this.indicatorContainer.append(I)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){var e;(e=this.indicatorContainer)==null||e.remove(),this.indicatorContainer=null}}class nR{constructor(e,t){O(this,"draw"),O(this,"position"),O(this,"zone"),O(this,"options"),O(this,"elementList"),O(this,"rowList"),O(this,"positionList"),this.draw=e,this.position=e.getPosition(),this.zone=e.getZone(),this.options=e.getOptions(),this.elementList=t||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(e){this.elementList=e}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const e=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:e,elementList:this.elementList})}_computePositionList(){const e=this.getFooterBottom(),t=this.draw.getInnerWidth(),n=this.draw.getMargins()[3],s=this.draw.getHeight(),l=this.getHeight(),a=s-e-l;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:n,startY:a,innerWidth:t,zone:de.FOOTER})}getFooterBottom(){const{footer:{bottom:e,disabled:t},scale:i}=this.options;return t?0:Math.floor(e*i)}getMaxHeight(){const{footer:{maxHeightRadio:e}}=this.options,t=this.draw.getHeight();return Math.floor(t*Pr[e])}getHeight(){const e=this.getMaxHeight(),t=this.getRowHeight();return t>e?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),n=this.getFooterBottom()+t-e[2];return n<=0?0:n}render(e,t){e.save(),e.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const i=this.draw.getInnerWidth(),n=this.getMaxHeight(),s=[];let l=0;for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a];if(l+c.height>n)break;s.push(c),l+=c.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:s,pageNo:t,startIndex:0,innerWidth:i,zone:de.FOOTER}),e.restore()}}class sR{constructor(e){O(this,"draw"),O(this,"range"),O(this,"options"),O(this,"UN_COUNT_STYLE_WIDTH",20),O(this,"MEASURE_BASE_TEXT","0"),O(this,"LIST_GAP",10),this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}setList(e,t){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:s}=this.range.getRange();if(!~n&&!~s)return;const l=this.range.getRangeParagraphElementList();if(!l||!l.length)return;if(l.find(u=>u.listType===e&&u.listStyle===t)||!e){this.unsetList();return}const c=pe();l.forEach(u=>{u.listId=c,u.listType=e,u.listStyle=t});const d=n===s,h=d?s:n;this.draw.render({curIndex:h,isSetCursor:d})}unsetList(){var e;if(this.draw.isReadonly())return;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return;const s=(e=this.range.getRangeParagraphElementList())==null?void 0:e.filter(h=>h.listId);if(!s||!s.length)return;const l=this.draw.getElementList(),a=l[n];if(a.listId){let h=n+1;for(;h<l.length;){const u=l[h];if(u.value===j&&!u.listWrap)break;if(u.listId!==a.listId){this.draw.spliceElementList(l,h,0,[{value:j}]);break}h++}}s.forEach(h=>{delete h.listId,delete h.listType,delete h.listStyle,delete h.listWrap});const c=i===n,d=c?n:i;this.draw.render({curIndex:d,isSetCursor:c})}computeListStyle(e,t){const i=new Map;let n=0,s=t[n].listId,l=[];const a=t.length;for(;n<a;){const c=t[n];if(s&&s===c.listId)l.push(c);else if(c.listId&&c.listId!==s){if(l.length){const d=this.getListStyleWidth(e,l);i.set(s,d)}s=c.listId,l=s?[c]:[]}n++}if(l.length){const c=this.getListStyleWidth(e,l);i.set(s,c)}return i}getListStyleWidth(e,t){const{scale:i,checkbox:n}=this.options,s=t[0];if(s.listStyle&&s.listStyle!==ht.DECIMAL)return s.listStyle===ht.CHECKBOX?(n.width+this.LIST_GAP)*i:this.UN_COUNT_STYLE_WIDTH*i;const l=t.reduce((d,h)=>(h.value===j&&(d+=1),d),0);if(!l)return 0;const a=`${this.MEASURE_BASE_TEXT.repeat(String(l).length)}${le.PERIOD}`,c=e.measureText(a);return Math.ceil((c.width+this.LIST_GAP)*i)}drawListStyle(e,t,i){var n;const{elementList:s,offsetX:l,listIndex:a,ascent:c}=t,d=s[0];if(d.value!==j||d.listWrap)return;let h=0;const{defaultTabWidth:u,scale:f,defaultFont:g,defaultSize:R}=this.options;for(let P=1;P<s.length;P++){const N=s[P];if(N?.type!==D.TAB)break;h+=u*f}const{coordinate:{leftTop:[p,M]}}=i,S=p-l+h,b=M+c;if(d.listStyle===ht.CHECKBOX){const{width:P,height:N,gap:m}=this.options.checkbox,T=oe(B({},d),{checkbox:{value:!!((n=d.checkbox)!=null&&n.value)},metrics:oe(B({},d.metrics),{width:(P+m*2)*f,height:N*f})});this.draw.getCheckboxParticle().render({ctx:e,x:S-m*f,y:b,index:0,row:oe(B({},t),{elementList:[T,...t.elementList]})})}else{let P="";if(d.listType===Gt.UL?P=ko[d.listStyle]||ko[ki.DISC]:P=`${a+1}${le.PERIOD}`,!P)return;e.save(),e.font=`${R*f}px ${g}`,e.fillText(P,S,b),e.restore()}}}const ga=class{constructor(r){O(this,"options"),this.options=r.getOptions()}render(r,e,t,i){const{scale:n,lineBreak:{color:s,lineWidth:l}}=this.options;r.save(),r.beginPath();const a=i-ga.HEIGHT*n/2,c=t+e.metrics.width;r.translate(c,a),r.scale(n,n),r.strokeStyle=s,r.lineWidth=l,r.lineCap="round",r.lineJoin="round",r.beginPath(),r.moveTo(8,0),r.lineTo(12,0),r.lineTo(12,6),r.lineTo(3,6),r.moveTo(3,6),r.lineTo(6,3),r.moveTo(3,6),r.lineTo(6,9),r.stroke(),r.closePath(),r.restore()}};let sn=ga;O(sn,"WIDTH",12),O(sn,"HEIGHT",9),O(sn,"GAP",3);class Ra{constructor(e){O(this,"draw"),O(this,"position"),O(this,"options"),O(this,"elementList"),O(this,"rowList"),O(this,"positionList"),this.draw=e,this.position=e.getPosition(),this.options=e.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(e){this._computeRowList(),this._computePositionList(e)}_computeRowList(){const e=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:e,elementList:this.elementList})}_computePositionList(e){const{lineBreak:t,scale:i}=this.options,n=this.draw.getHeader().getExtraHeight(),s=this.draw.getInnerWidth(),l=this.draw.getMargins();let a=l[3];t.disabled||(a+=(sn.WIDTH+sn.GAP)*i);const c=e?.startY||l[0]+n;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:a,startY:c,innerWidth:s})}render(e,t){const{placeholder:i=this.options.placeholder}=t||{},{data:n,font:s,size:l,color:a,opacity:c}=i;this._recovery(),this.elementList=[{value:n,font:s,size:l,color:a}],tt(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(t);const d=this.draw.getInnerWidth();e.save(),e.globalAlpha=c,this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:d,isDrawLineBreak:!1}),e.restore()}}class oR{constructor(e){O(this,"draw"),O(this,"options"),O(this,"range"),O(this,"fillRectMap"),this.draw=e,this.options=e.getOptions(),this.range=e.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==de.MAIN)return null;const e=this.range.getSelection();if(!e)return null;const t=pe();return e.forEach(i=>{Array.isArray(i.groupIds)||(i.groupIds=[]),i.groupIds.push(t)}),this.draw.render({isSetCursor:!1,isCompute:!1}),t}getElementListByGroupId(e,t){var i,n;const s=[];for(let l=0;l<e.length;l++){const a=e[l];if(a.type===D.TABLE){const c=a.trList;for(let d=0;d<c.length;d++){const h=c[d];for(let u=0;u<h.tdList.length;u++){const f=h.tdList[u],g=this.getElementListByGroupId(f.value,t);if(g.length)return s.push(...g),s}}}if((i=a?.groupIds)!=null&&i.includes(t)){s.push(a);const c=e[l+1];if(!((n=c?.groupIds)!=null&&n.includes(t)))break}}return s}deleteGroup(e){if(this.draw.isReadonly())return;const t=this.draw.getOriginalMainElementList(),i=this.getElementListByGroupId(t,e);if(i.length){for(let n=0;n<i.length;n++){const s=i[n],l=s.groupIds,a=l.findIndex(c=>c===e);l.splice(a,1),l.length||delete s.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(e,t){var i,n;for(let s=0;s<e.length;s++){const l=e[s];if(l.type===D.TABLE){const c=l.trList;for(let d=0;d<c.length;d++){const h=c[d];for(let u=0;u<h.tdList.length;u++){const f=h.tdList[u],g=this.getContextByGroupId(f.value,t);if(g)return oe(B({},g),{isTable:!0,index:s,trIndex:d,tdIndex:u,tdId:f.id,trId:h.id,tableId:l.tableId})}}}const a=e[s+1];if((i=l.groupIds)!=null&&i.includes(t)&&!((n=a?.groupIds)!=null&&n.includes(t)))return{isTable:!1,startIndex:s,endIndex:s}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(e,t,i,n,s){const l=e.groupIds;if(l)for(const a of l){const c=this.fillRectMap.get(a);c?c.width+=n:this.fillRectMap.set(a,{x:t,y:i,width:n,height:s})}}render(e){var t;if(!this.fillRectMap.size)return;const i=this.range.getRange(),s=(t=this.draw.getElementList()[i.endIndex])==null?void 0:t.groupIds,{group:{backgroundColor:l,opacity:a,activeOpacity:c,activeBackgroundColor:d}}=this.options;e.save(),this.fillRectMap.forEach((h,u)=>{const{x:f,y:g,width:R,height:p}=h;s?.includes(u)?(e.globalAlpha=c,e.fillStyle=d):(e.globalAlpha=a,e.fillStyle=l),e.fillRect(f,g,R,p)}),e.restore(),this.clearFillInfo()}}class lR{constructor(e){O(this,"draw"),O(this,"eventBus"),O(this,"pageContainer"),this.draw=e,this.eventBus=this.draw.getEventBus(),this.pageContainer=this.draw.getPageContainer(),this.pageContainer.addEventListener("mousemove",this._mousemove.bind(this)),this.pageContainer.addEventListener("mouseenter",this._mouseenter.bind(this)),this.pageContainer.addEventListener("mouseleave",this._mouseleave.bind(this)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.bind(this))}_mousemove(e){this.eventBus.isSubscribe("mousemove")&&this.eventBus.emit("mousemove",e)}_mouseenter(e){this.eventBus.isSubscribe("mouseenter")&&this.eventBus.emit("mouseenter",e)}_mouseleave(e){this.eventBus.isSubscribe("mouseleave")&&this.eventBus.emit("mouseleave",e)}_mousedown(e){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",e)}_mouseup(e){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",e)}_click(e){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",e)}}class rR{constructor(e){O(this,"draw"),O(this,"options"),this.draw=e,this.options=e.getOptions()}render(e,t){const{scale:i,lineNumber:{color:n,size:s,font:l,right:a,type:c}}=this.options,d=this.draw.getTextParticle(),h=this.draw.getMargins(),u=this.draw.getPosition().getOriginalMainPositionList(),g=this.draw.getPageRowList()[t];e.save(),e.fillStyle=n,e.font=`${s*i}px ${l}`;for(let R=0;R<g.length;R++){const p=g[R],{coordinate:{leftBottom:M}}=u[p.startIndex],S=c===Ss.PAGE?R+1:p.rowIndex+1,b=d.measureText(e,{value:`${S}`}),P=h[3]-(b.width+a)*i,N=M[1]-b.actualBoundingBoxAscent*i;e.fillText(`${S}`,P,N)}e.restore()}}class aR{constructor(e){O(this,"draw"),O(this,"header"),O(this,"footer"),O(this,"options"),this.draw=e,this.header=e.getHeader(),this.footer=e.getFooter(),this.options=e.getOptions()}render(e){const{scale:t,pageBorder:{color:i,lineWidth:n,padding:s}}=this.options;e.save(),e.translate(.5,.5),e.strokeStyle=i,e.lineWidth=n*t;const l=this.draw.getMargins(),a=l[3]-s[3]*t,c=l[0]+this.header.getExtraHeight()-s[0]*t,d=this.draw.getInnerWidth()+(s[1]+s[3])*t,h=this.draw.getHeight()-c-this.footer.getExtraHeight()-l[2]+s[2]*t;e.rect(a,c,d,h),e.stroke(),e.restore()}}function cR(r,e){const{value:t,oldValue:i}=e;i.isTable&&!t.isTable&&r.getTableTool().dispose()}class dR{constructor(e){O(this,"draw"),O(this,"eventBus"),this.draw=e,this.eventBus=e.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",e=>{cR(this.draw,e)})}}class hR{constructor(e){O(this,"draw"),O(this,"range"),O(this,"position"),O(this,"tableTool"),O(this,"tableParticle"),O(this,"options"),this.draw=e,this.range=e.getRange(),this.position=e.getPosition(),this.tableTool=e.getTableTool(),this.tableParticle=e.getTableParticle(),this.options=e.getOptions()}insertTable(e,t){var i;const{startIndex:n,endIndex:s}=this.range.getRange();if(!~n&&!~s)return;const{defaultTrMinHeight:l}=this.options.table,a=this.draw.getElementList();let c=0;if((i=a[n])!=null&&i.listId){const p=this.position.getPositionList(),{rowIndex:M}=p[n],b=this.draw.getRowList()[M];c=b?.offsetX||0}const d=this.draw.getContextInnerWidth()-c,h=[],u=d/t;for(let p=0;p<t;p++)h.push({width:u});const f=[];for(let p=0;p<e;p++){const M=[],S={height:l,tdList:M};for(let b=0;b<t;b++)M.push({colspan:1,rowspan:1,value:[]});f.push(S)}const g={type:D.TABLE,value:"",colgroup:h,trList:f};tt([g],{editorOptions:this.options}),$e(a,[g],n,{editorOptions:this.options});const R=n+1;this.draw.spliceElementList(a,R,n===s?0:s-n,[g]),this.range.setRange(R,R),this.draw.render({curIndex:R,isSetCursor:!1})}insertTableTopRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:i,tableId:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=a[i];if(c.tdList.length<l.colgroup.length){const u=c.tdList[0].rowIndex;for(let f=0;f<i;f++){const g=a[f];for(let R=0;R<g.tdList.length;R++){const p=g.tdList[R];p.rowspan>1&&p.rowIndex+p.rowspan>=u+1&&(p.rowspan+=1)}}}const d=pe(),h={height:c.height,id:d,tdList:[]};for(let u=0;u<c.tdList.length;u++){const f=c.tdList[u],g=pe();h.tdList.push({id:g,rowspan:1,colspan:f.colspan,value:[{value:j,size:16,tableId:n,trId:d,tdId:g}]})}a.splice(i,0,h),this.position.setPositionContext({isTable:!0,index:t,trIndex:i,tdIndex:0,tdId:h.tdList[0].id,trId:h.id,tableId:n}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:i,tableId:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=a[i],d=a.length-1===i?c:a[i+1];if(d.tdList.length<l.colgroup.length){const f=d.tdList[0].rowIndex;for(let g=0;g<i+1;g++){const R=a[g];for(let p=0;p<R.tdList.length;p++){const M=R.tdList[p];M.rowspan>1&&M.rowIndex+M.rowspan>=f+1&&(M.rowspan+=1)}}}const h=pe(),u={height:d.height,id:h,tdList:[]};for(let f=0;f<d.tdList.length;f++){const g=d.tdList[f],R=pe();u.tdList.push({id:R,rowspan:1,colspan:g.colspan,value:[{value:j,size:16,tableId:n,trId:h,tdId:R}]})}a.splice(i+1,0,u),this.position.setPositionContext({isTable:!0,index:t,trIndex:i+1,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:l.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(e){if(e.type!==D.TABLE)return;const{defaultColMinWidth:t}=this.options.table,i=e.colgroup,n=i.reduce((l,a)=>l+a.width,0),s=this.draw.getOriginalInnerWidth();if(n>s){const l=i.filter(c=>c.width>t),a=(n-s)/l.length;for(let c=0;c<i.length;c++){const d=i[c];d.width-a>=t&&(d.width-=a)}}}insertTableLeftCol(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:i,tableId:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=i;for(let u=0;u<a.length;u++){const f=a[u],g=pe();f.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:j,size:16,tableId:n,trId:f.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;l.colgroup.splice(c,0,{width:d}),this.adjustColWidth(l),this.position.setPositionContext({isTable:!0,index:t,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:n}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:i,tableId:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=i+1;for(let u=0;u<a.length;u++){const f=a[u],g=pe();f.tdList.splice(c,0,{id:g,rowspan:1,colspan:1,value:[{value:j,size:16,tableId:n,trId:f.id,tdId:g}]})}const{defaultColMinWidth:d}=this.options.table;l.colgroup.splice(c,0,{width:d}),this.adjustColWidth(l),this.position.setPositionContext({isTable:!0,index:t,trIndex:0,tdIndex:c,tdId:a[0].tdList[c].id,trId:a[0].id,tableId:l.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:i,tdIndex:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=a[i],d=c.tdList[n].rowIndex;if(a.length<=1&&l.pagingIndex===0){this.deleteTable();return}for(let h=0;h<d;h++){const f=a[h].tdList;for(let g=0;g<f.length;g++){const R=f[g];R.rowIndex+R.rowspan>d&&R.rowspan--}}for(let h=0;h<c.tdList.length;h++){const u=c.tdList[h];if(u.rowspan>1){const f=pe(),g=a[i+1];g.tdList.splice(h,0,{id:f,rowspan:u.rowspan-1,colspan:u.colspan,value:[{value:j,size:16,tableId:l.id,trId:g.id,tdId:f}]})}}a.splice(i,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:e.index}),this.tableTool.dispose()}deleteTableCol(){var e;const t=this.position.getPositionContext();if(!t.isTable)return;const{index:i,tdIndex:n,trIndex:s}=t,a=this.draw.getOriginalElementList()[i],c=a.trList,h=c[s].tdList[n].colIndex;if(!c.find(f=>f.tdList.length>1)){this.deleteTable();return}for(let f=0;f<c.length;f++){const g=c[f];for(let R=0;R<g.tdList.length;R++){const p=g.tdList[R];p.colIndex<=h&&p.colIndex+p.colspan>h&&(p.colspan>1?p.colspan--:g.tdList.splice(R,1))}}(e=a.colgroup)==null||e.splice(h,1),this.position.setPositionContext({isTable:!1}),this.range.setRange(0,0),this.draw.render({curIndex:t.index}),this.tableTool.dispose()}deleteTable(){const e=this.position.getPositionContext();if(!e.isTable)return;const t=this.draw.getOriginalElementList(),i=t[e.index];let n=1,s=e.index;if(i.pagingId){s=e.index-i.pagingIndex;for(let a=s+1;a<t.length&&t[a].pagingId===i.pagingId;a++)n++}t.splice(s,n);const l=s-1;this.position.setPositionContext({isTable:!1,index:l}),this.range.setRange(l,l),this.draw.render({curIndex:l}),this.tableTool.dispose()}mergeTableCell(){const e=this.position.getPositionContext();if(!e.isTable)return;const{isCrossRowCol:t,startTdIndex:i,endTdIndex:n,startTrIndex:s,endTrIndex:l}=this.range.getRange();if(!t)return;const{index:a}=e,h=this.draw.getOriginalElementList()[a].trList;let u=h[s].tdList[i],f=h[l].tdList[n];(u.x>f.x||u.y>f.y)&&([u,f]=[f,u]);const g=u.colIndex,R=f.colIndex+(f.colspan-1),p=u.rowIndex,M=f.rowIndex+(f.rowspan-1),S=[];for(let w=0;w<h.length;w++){const v=h[w],X=[];for(let C=0;C<v.tdList.length;C++){const Z=v.tdList[C],k=Z.colIndex,Q=Z.rowIndex;k>=g&&k<=R&&Q>=p&&Q<=M&&X.push(Z)}X.length&&S.push(X)}if(!S.length)return;const b=S[S.length-1],P=S[0][0],N=b[b.length-1],m=P.x,T=P.y,y=N.x+N.width,x=N.y+N.height;for(let w=0;w<S.length;w++){const v=S[w];for(let X=0;X<v.length;X++){const C=v[X],Z=C.x,k=C.y,Q=Z+C.width,Y=k+C.height;if(m>Z||T>k||y<Q||x<Y)return}}const I=[],V=S[0][0],F=V.value[0];for(let w=0;w<S.length;w++){const v=S[w];for(let X=0;X<v.length;X++){const C=v[X];if(!(w===0&&X===0)){I.push(C.id);const k=C.value.length>1?0:1;for(let Q=k;Q<C.value.length;Q++){const Y=C.value[Q];Ci(xn,F,Y),V.value.push(Y)}}w===0&&X!==0&&(V.colspan+=C.colspan),w!==0&&V.colIndex===C.colIndex&&(V.rowspan+=C.rowspan)}}for(let w=0;w<h.length;w++){const v=h[w];let X=0;for(;X<v.tdList.length;){const C=v.tdList[X];I.includes(C.id)&&(v.tdList.splice(X,1),X--),X++}}this.position.setPositionContext(oe(B({},e),{trIndex:V.trIndex,tdIndex:V.tdIndex}));const L=V.value.length-1;this.range.setRange(L,L),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:i,trIndex:n}=e,l=this.draw.getOriginalElementList()[t],a=l.trList,c=a[n],d=c.tdList[i];if(d.rowspan===1&&d.colspan===1)return;const h=d.colspan;if(d.colspan>1){for(let f=1;f<d.colspan;f++){const g=pe();c.tdList.splice(i+f,0,{id:g,rowspan:1,colspan:1,value:[{value:j,size:16,tableId:l.id,trId:c.id,tdId:g}]})}d.colspan=1}if(d.rowspan>1){for(let f=1;f<d.rowspan;f++){const g=a[n+f];for(let R=0;R<h;R++){const p=pe();g.tdList.splice(d.colIndex,0,{id:p,rowspan:1,colspan:1,value:[{value:j,size:16,tableId:l.id,trId:g.id,tdId:p}]})}}d.rowspan=1}const u=d.value.length-1;this.range.setRange(u,u),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const e=this.position.getPositionContext();if(!e.isTable||this.range.getRange().isCrossRowCol)return;const{index:i,tdIndex:n,trIndex:s}=e,a=this.draw.getOriginalElementList()[i],c=a.trList,d=c[s],h=d.tdList[n];a.colgroup.splice(n+1,0,{width:this.options.table.defaultColMinWidth});for(let u=0;u<c.length;u++){const f=c[u];let g=0;for(;g<f.tdList.length;){const R=f.tdList[g];if(R.rowIndex!==h.rowIndex)R.colIndex<=h.colIndex&&R.colIndex+R.colspan>h.colIndex&&R.colspan++;else if(R.id===h.id){const p=pe();d.tdList.splice(g+h.colspan,0,{id:p,rowspan:h.rowspan,colspan:1,value:[{value:j,size:16,tableId:a.id,trId:f.id,tdId:p}]}),g++}g++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const e=this.position.getPositionContext();if(!e.isTable||this.range.getRange().isCrossRowCol)return;const{index:i,tdIndex:n,trIndex:s}=e,a=this.draw.getOriginalElementList()[i],c=a.trList,h=c[s].tdList[n];let u=-1,f=0;for(;f<c.length;){if(f===u){f++;continue}const g=c[f];let R=0;for(;R<g.tdList.length;){const p=g.tdList[R];if(p.id===h.id){const M=pe(),S=pe();c.splice(f+h.rowspan,0,{id:M,height:this.options.table.defaultTrMinHeight,tdList:[{id:S,rowspan:1,colspan:h.colspan,value:[{value:j,size:16,tableId:a.id,trId:M,tdId:S}]}]}),u=f+h.rowspan}else p.rowIndex>=h.rowIndex&&p.rowIndex<h.rowIndex+h.rowspan&&p.rowIndex+p.rowspan>=h.rowIndex+h.rowspan&&p.rowspan++;R++}f++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;for(let n=0;n<t.length;n++){const s=t[n];for(let l=0;l<s.length;l++){const a=s[l];!a||a.verticalAlign===e||!a.verticalAlign&&e===Ae.TOP||(a.verticalAlign=e)}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i})}tableBorderType(e){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:i}=t,s=this.draw.getOriginalElementList()[i];if(!s.borderType&&e===ut.ALL||s.borderType===e)return;s.borderType=e;const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l})}tableBorderColor(e){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:i}=t,s=this.draw.getOriginalElementList()[i];if(!s.borderColor&&e===this.options.table.defaultBorderColor||s.borderColor===e)return;s.borderColor=e;const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l,isCompute:!1})}tableTdBorderType(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;const i=t.flat(),n=i.some(l=>{var a;return!((a=l.borderTypes)!=null&&a.includes(e))});i.forEach(l=>{l.borderTypes||(l.borderTypes=[]);const a=l.borderTypes.findIndex(c=>c===e);n?~a||l.borderTypes.push(e):~a&&l.borderTypes.splice(a,1),l.borderTypes.length||delete l.borderTypes});const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s})}tableTdSlashType(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;const i=t.flat(),n=i.some(l=>{var a;return!((a=l.slashTypes)!=null&&a.includes(e))});i.forEach(l=>{l.slashTypes||(l.slashTypes=[]);const a=l.slashTypes.findIndex(c=>c===e);n?~a||l.slashTypes.push(e):~a&&l.slashTypes.splice(a,1),l.slashTypes.length||delete l.slashTypes});const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s})}tableTdBackgroundColor(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;for(let n=0;n<t.length;n++){const s=t[n];for(let l=0;l<s.length;l++){const a=s[l];a.backgroundColor=e}}const{endIndex:i}=this.range.getRange();this.range.setRange(i,i),this.draw.render({isCompute:!1})}tableSelectAll(){const e=this.position.getPositionContext(),{index:t,tableId:i,isTable:n}=e;if(!n||!i)return;const{startIndex:s,endIndex:l}=this.range.getRange(),c=this.draw.getOriginalElementList()[t].trList,d=c.length-1,h=c[d].tdList.length-1;this.range.replaceRange({startIndex:s,endIndex:l,tableId:i,startTdIndex:0,endTdIndex:h,startTrIndex:0,endTrIndex:d}),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}var Wn;(function(r){r.EDIT="edit",r.READONLY="readonly",r.FORM="form"})(Wn||(Wn={}));class uR{constructor(e){O(this,"draw"),O(this,"zone"),O(this,"range"),O(this,"position"),O(this,"areaInfoMap",new Map),this.draw=e,this.zone=e.getZone(),this.range=e.getRange(),this.position=e.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];return i?.areaId||null}getActiveAreaInfo(){const e=this.getActiveAreaId();return e&&this.areaInfoMap.get(e)||null}isReadonly(){const e=this.getActiveAreaInfo();if(!e?.area)return!1;switch(e.area.mode){case Wn.EDIT:return!1;case Wn.READONLY:return!0;case Wn.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(e){this.zone.getZone()!==de.MAIN&&this.zone.setZone(de.MAIN),this.draw.getPosition().setPositionContext({isTable:!1});const{id:t,value:i,area:n,position:s}=e;if(s===pt.BEFORE)this.range.setRange(0,0);else{const c=this.draw.getOriginalMainElementList().length-1;this.range.setRange(c,c)}const l=t||pe();return this.draw.insertElementList([{type:D.AREA,value:"",areaId:l,valueList:i,area:Ne(n)}]),l}render(e,t){if(!this.areaInfoMap.size)return;e.save();const i=this.draw.getMargins(),n=this.draw.getInnerWidth();for(const s of this.areaInfoMap){const{area:l,positionList:a}=s[1];if(l?.hide||!l?.backgroundColor&&!l?.borderColor&&!l?.placeholder)continue;const c=a.filter(R=>R.pageNo===t);if(!c.length)continue;e.translate(.5,.5);const d=c[0],h=c[c.length-1],u=i[3],f=Math.ceil(d.coordinate.leftTop[1]),g=Math.ceil(h.coordinate.rightBottom[1]-f);l.backgroundColor&&(e.fillStyle=l.backgroundColor,e.fillRect(u,f,n,g)),l.borderColor&&(e.strokeStyle=l.borderColor,e.strokeRect(u,f,n,g)),l.placeholder&&a.length<=1&&new Ra(this.draw).render(e,{placeholder:B(B({},Zr),l.placeholder),startY:d.coordinate.leftTop[1]}),e.translate(-.5,-.5)}e.restore()}compute(){this.areaInfoMap.clear();const e=this.draw.getOriginalMainElementList(),t=this.position.getOriginalMainPositionList();for(let i=0;i<e.length;i++){const n=e[i],s=n.areaId;if(s){const l=this.areaInfoMap.get(s);l?(l.elementList.push(n),l.positionList.push(t[i])):this.areaInfoMap.set(s,{id:s,area:n.area,elementList:[n],positionList:[t[i]]})}}}getAreaValue(e={}){const t=e.id||this.getActiveAreaId();if(!t)return null;const i=this.areaInfoMap.get(t);return i?{area:i.area,id:i.id,startPageNo:i.positionList[0].pageNo,endPageNo:i.positionList[i.positionList.length-1].pageNo,value:be(i.elementList)}:null}getContextByAreaId(e){const t=this.draw.getOriginalMainElementList();for(let i=0;i<t.length;i++)if(t[i].areaId===e){const s=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:s[i]}}return null}setAreaProperties(e){const t=e.id||this.getActiveAreaId();if(!t)return;const i=this.areaInfoMap.get(t);if(!i)return;i.area||(i.area={});let n=!1;const s=["top","hide"];Object.entries(e.properties).forEach(([l,a])=>{if(Vr(a))return;const c=l;i.area[c]=a,s.includes(c)&&(n=!0)}),this.draw.render({isCompute:n,isSetCursor:!1})}}class fR{constructor(e){O(this,"draw"),O(this,"options"),O(this,"imageCache"),O(this,"mainBadge"),O(this,"areaBadgeMap"),this.draw=e,this.options=e.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(e){this.mainBadge=e}setAreaBadgeMap(e){this.areaBadgeMap.clear(),e.forEach(t=>{this.areaBadgeMap.set(t.areaId,t.badge)})}_drawImage(e,t,i,n,s,l){if(this.imageCache.has(l)){const a=this.imageCache.get(l);e.drawImage(a,t,i,n,s)}else{const a=new Image;a.setAttribute("crossOrigin","Anonymous"),a.src=l,a.onload=()=>{this.imageCache.set(l,a),e.drawImage(a,t,i,n,s)}}}render(e,t){if(t===0&&this.mainBadge){const{scale:i,badge:n}=this.options,{left:s,top:l,width:a,height:c,value:d}=this.mainBadge,h=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),u=(s||n.left)*i,f=(l||n.top)*i+h;this._drawImage(e,u,f,a*i,c*i,d)}if(this.areaBadgeMap.size){const i=this.draw.getArea().getAreaInfo();if(i.size){const{scale:n,badge:s}=this.options;for(const l of i){const{positionList:a}=l[1],c=a[0];if(c.pageNo!==t)continue;const d=this.areaBadgeMap.get(l[0]);if(!d)continue;const{left:h,top:u,width:f,height:g,value:R}=d,p=(h||s.left)*n,M=(u||s.top)*n+c.coordinate.leftTop[1];this._drawImage(e,p,M,f*n,g*n,R)}}}}}class gR{constructor(e,t,i,n,s,l){O(this,"container"),O(this,"pageContainer"),O(this,"pageList"),O(this,"ctxList"),O(this,"pageNo"),O(this,"renderCount"),O(this,"pagePixelRatio"),O(this,"mode"),O(this,"options"),O(this,"position"),O(this,"zone"),O(this,"elementList"),O(this,"listener"),O(this,"eventBus"),O(this,"override"),O(this,"i18n"),O(this,"canvasEvent"),O(this,"globalEvent"),O(this,"cursor"),O(this,"range"),O(this,"margin"),O(this,"background"),O(this,"badge"),O(this,"search"),O(this,"group"),O(this,"area"),O(this,"underline"),O(this,"strikeout"),O(this,"highlight"),O(this,"historyManager"),O(this,"previewer"),O(this,"imageParticle"),O(this,"laTexParticle"),O(this,"textParticle"),O(this,"tableParticle"),O(this,"tableTool"),O(this,"tableOperate"),O(this,"pageNumber"),O(this,"lineNumber"),O(this,"waterMark"),O(this,"placeholder"),O(this,"header"),O(this,"footer"),O(this,"hyperlinkParticle"),O(this,"dateParticle"),O(this,"separatorParticle"),O(this,"pageBreakParticle"),O(this,"superscriptParticle"),O(this,"subscriptParticle"),O(this,"checkboxParticle"),O(this,"radioParticle"),O(this,"blockParticle"),O(this,"listParticle"),O(this,"lineBreakParticle"),O(this,"control"),O(this,"pageBorder"),O(this,"workerManager"),O(this,"scrollObserver"),O(this,"selectionObserver"),O(this,"imageObserver"),O(this,"LETTER_REG"),O(this,"WORD_LIKE_REG"),O(this,"rowList"),O(this,"pageRowList"),O(this,"painterStyle"),O(this,"painterOptions"),O(this,"visiblePageNoList"),O(this,"intersectionPageNo"),O(this,"lazyRenderIntersectionObserver"),O(this,"printModeData"),this.container=this._wrapContainer(e),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pagePixelRatio=null,this.mode=t.mode,this.options=t,this.elementList=i.main,this.listener=n,this.eventBus=s,this.override=l,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new qg(t.locale),this.historyManager=new pg(this),this.position=new mg(this),this.zone=new iR(this),this.range=new Sg(this),this.margin=new bg(this),this.background=new Mg(this),this.badge=new fR(this),this.search=new Lg(this),this.group=new oR(this),this.area=new uR(this),this.underline=new Pg(this),this.strikeout=new Og(this),this.highlight=new Ng(this),this.previewer=new _g(this),this.imageParticle=new vr(this),this.laTexParticle=new Dr(this),this.textParticle=new Tg(this),this.tableParticle=new wg(this),this.tableTool=new yg(this),this.tableOperate=new hR(this),this.pageNumber=new nn(this),this.lineNumber=new rR(this),this.waterMark=new kg(this),this.placeholder=new Ra(this),this.header=new Fg(this,i.header),this.footer=new nR(this,i.footer),this.hyperlinkParticle=new Vg(this),this.dateParticle=new Ag(this),this.separatorParticle=new vg(this),this.pageBreakParticle=new Wg(this),this.superscriptParticle=new Xg,this.subscriptParticle=new Cg,this.checkboxParticle=new Zg(this),this.radioParticle=new Yg(this),this.blockParticle=new $g(this),this.listParticle=new sR(this),this.lineBreakParticle=new sn(this),this.control=new Ug(this),this.pageBorder=new aR(this),this.scrollObserver=new Ig(this),this.selectionObserver=new xg(this),this.imageObserver=new eR,new lR(this),this.canvasEvent=new fg(this),this.cursor=new Kf(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new Rg(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new Gg(this),new dR(this);const{letterClass:a}=t;this.LETTER_REG=new RegExp(`[${a.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${a.map(c=>`[^${c}][${c}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.mode===ce.PRINT&&this.setPrintData(),this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const e=Ne(this.printModeData);["header","main","footer"].forEach(i=>{e[i]=this.control.filterAssistElement(e[i])}),this.setEditorData(e)}clearPrintData(){this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null)}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(e){this.mode!==e&&(e===ce.PRINT&&this.setPrintData(),this.mode===ce.PRINT&&this.clearPrintData(),this.clearSideEffect(),this.range.clearRange(),this.mode=e,this.options.mode=e,this.render({isSetCursor:!1,isSubmitHistory:!1}))}isReadonly(){var e,t;if((t=(e=this.area.getActiveAreaInfo())==null?void 0:e.area)!=null&&t.mode)return this.area.isReadonly();switch(this.mode){case ce.DESIGN:return!1;case ce.READONLY:case ce.PRINT:return!0;case ce.FORM:return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){var e,t,i,n,s;if(this.mode===ce.DESIGN)return!1;const{startIndex:l,endIndex:a}=this.range.getRange(),c=this.getElementList();if((e=this.getTd())!=null&&e.disabled)return!0;if(l===a){const h=c[l],u=c[l+1];return!!((t=h?.title)!=null&&t.disabled&&((i=u?.title)!=null&&i.disabled)&&h.titleId===u.titleId||(n=h?.control)!=null&&n.disabled&&((s=u?.control)!=null&&s.disabled)&&h.controlId===u.controlId)}return c.slice(l+1,a+1).some(h=>{var u,f;return((u=h.title)==null?void 0:u.disabled)||((f=h.control)==null?void 0:f.disabled)})}isDesignMode(){return this.mode===ce.DESIGN}isPrintMode(){return this.mode===ce.PRINT}getOriginalWidth(){const{paperDirection:e,width:t,height:i}=this.options;return e===At.VERTICAL?t:i}getOriginalHeight(){const{paperDirection:e,width:t,height:i}=this.options;return e===At.VERTICAL?i:t}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const e=this.getMargins(),t=this.header.getExtraHeight(),i=this.footer.getExtraHeight();return e[0]+e[2]+t+i}getCanvasWidth(e=-1){return this.getPage(e).width}getCanvasHeight(e=-1){return this.getPage(e).height}getInnerWidth(){const e=this.getWidth(),t=this.getMargins();return e-t[1]-t[3]}getOriginalInnerWidth(){const e=this.getOriginalWidth(),t=this.getOriginalMargins();return e-t[1]-t[3]}getContextInnerWidth(){const e=this.position.getPositionContext();if(e.isTable){const{index:t,trIndex:i,tdIndex:n}=e,l=this.getOriginalElementList()[t].trList[i].tdList[n],a=this.getTdPadding();return l.width-a[1]-a[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(e=>e*this.options.scale)}getOriginalMargins(){const{margins:e,paperDirection:t}=this.options;return t===At.VERTICAL?e:[e[1],e[2],e[3],e[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:e},scale:t}=this.options;return e*t}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(){const{table:{tdPadding:e},scale:t}=this.options;return e.map(i=>i*t)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(e){this.visiblePageNoList=e,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(e){this.intersectionPageNo=e,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(e){this.pageNo=e}getRenderCount(){return this.renderCount}getPage(e=-1){return this.pageList[~e?e:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(e){const t=this.position.getPositionContext(),{index:i,trIndex:n,tdIndex:s}=t;return e[i].trList[n].tdList[s].rowList}getOriginalRowList(){const e=this.getZone();return e.isHeaderActive()?this.header.getRowList():e.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getArea(){return this.area}getBadge(){return this.badge}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getTextParticle(){return this.textParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(e){var t;const i=this.position.getPositionContext(),{index:n,trIndex:s,tdIndex:l}=i;return((t=e[n].trList)==null?void 0:t[s].tdList[l].value)||[]}getElementList(){const e=this.position.getPositionContext(),t=this.getOriginalElementList();return e.isTable?this.getTableElementList(t):t}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const e=this.getZone();return e.isHeaderActive()?this.getHeaderElementList():e.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}getTd(){const e=this.position.getPositionContext(),{index:t,trIndex:i,tdIndex:n,isTable:s}=e;return s?this.getOriginalElementList()[t].trList[i].tdList[n]:null}insertElementList(e,t={}){if(!e.length||!this.range.getIsCanInput())return;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return;const{isSubmitHistory:s=!0}=t;tt(e,{isHandleFirstElement:!1,editorOptions:this.options});let l=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl())l=a.setValue(e,void 0,{isIgnoreDisabledRule:!0}),this.control.emitControlContentChange();else{const c=this.getElementList(),d=i===n,h=i+1;d||this.spliceElementList(c,h,n-i),this.spliceElementList(c,h,0,e),l=i+e.length;const u=c[h-1];e[0].listId&&u&&!u.listId&&u?.value===j&&(!u.type||u.type===D.TEXT)&&(c.splice(i,1),l-=1)}~l&&(this.range.setRange(l,l),this.render({curIndex:l,isSubmitHistory:s}))}appendElementList(e,t={}){if(!e.length)return;tt(e,{isHandleFirstElement:!1,editorOptions:this.options});let i;const{isPrepend:n,isSubmitHistory:s=!0}=t;n?(this.elementList.splice(1,0,...e),i=e.length):(this.elementList.push(...e),i=this.elementList.length-1),this.range.setRange(i,i),this.render({curIndex:i,isSubmitHistory:s})}spliceElementList(e,t,i,n,s){var l,a,c,d,h,u,f,g;const{isIgnoreDeletedRule:R=!1}=s||{},{group:p,modeRule:M}=this.options;if(i>0){const S=t+i,b=e[S],P=b?.listId;if(P&&((l=e[t-1])==null?void 0:l.listId)!==P){let N=S;for(;N<e.length;){const m=e[N];if(m.listId!==P||m.value===j)break;delete m.listId,delete m.listType,delete m.listStyle,N++}}if(!R&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const N=(a=this.getTd())==null?void 0:a.deletable;let m=S-1;for(;m>=t;){const T=e[m];((c=T?.control)!=null&&c.hide||(d=T?.area)!=null&&d.hide||N!==!1&&((h=T?.control)==null?void 0:h.deletable)!==!1&&(!T.controlId||this.mode!==ce.FORM||!M[this.mode].controlDeletableDisabled)&&((u=T?.title)==null?void 0:u.deletable)!==!1&&(p.deletable!==!1||!((f=T.groupIds)!=null&&f.length))&&(((g=T?.area)==null?void 0:g.deletable)!==!1||T?.areaIndex!==0))&&e.splice(m,1),m--}}else e.splice(t,i)}if(n?.length)for(let S=0;S<n.length;S++)e.splice(t+S,0,n[S])}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getRowCount(){return this.getRowList().length}async getDataURL(e={}){const{pixelRatio:t,mode:i}=e;t&&this.setPagePixelRatio(t);const n=this.mode,s=!!i&&n!==i;s&&this.setMode(i),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const l=this.pageList.map(a=>a.toDataURL());return t&&this.setPagePixelRatio(null),s&&this.setMode(n),l}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(e,t){this.painterStyle=e,this.painterOptions=t||null,this.getPainterStyle()&&this.pageList.forEach(i=>i.style.cursor="copy")}setDefaultRange(){this.elementList.length&&setTimeout(()=>{const e=this.elementList.length-1;this.range.setRange(e,e),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===bi.PAGING}setPageMode(e){if(!e||this.options.pageMode===e)return;if(this.options.pageMode=e,e===bi.PAGING){const{height:n}=this.options,s=this.getPagePixelRatio(),l=this.pageList[0];l.style.height=`${n}px`,l.height=n*s,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(de.MAIN);const{startIndex:t}=this.range.getRange(),i=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:t,isSubmitHistory:!1}),i||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(e),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",e)})}setPageScale(e){const t=this.getPagePixelRatio();this.options.scale=e;const i=this.getWidth(),n=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((l,a)=>{l.width=i*t,l.height=n*t,l.style.width=`${i}px`,l.style.height=`${n}px`,l.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[a])});const s=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!s,curIndex:s?.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(e),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",e)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(e){!this.pagePixelRatio&&e===window.devicePixelRatio||e===this.pagePixelRatio||(this.pagePixelRatio=e,this.setPageDevicePixel())}setPageDevicePixel(){const e=this.getPagePixelRatio(),t=this.getWidth(),i=this.getHeight();this.pageList.forEach((n,s)=>{n.width=t*e,n.height=i*e,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(e,t){this.options.width=e,this.options.height=t;const i=this.getPagePixelRatio(),n=this.getWidth(),s=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((l,a)=>{l.width=n*i,l.height=s*i,l.style.width=`${n}px`,l.style.height=`${s}px`,this._initPageContext(this.ctxList[a])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(e){const t=this.getPagePixelRatio();this.options.paperDirection=e;const i=this.getWidth(),n=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,l)=>{s.width=i*t,s.height=n*t,s.style.width=`${i}px`,s.style.height=`${n}px`,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(e){this.options.margins=e,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(e={}){const{pageNo:t}=e;let i=this.elementList;return Number.isInteger(t)&&t>=0&&t<this.pageRowList.length&&(i=this.pageRowList[t].flatMap(s=>s.elementList)),{header:this.getHeaderElementList(),main:i,footer:this.getFooterElementList()}}getValue(e={}){const t=this.getOriginValue(e),{extraPickAttrs:i}=e,n={header:be(t.header,{extraPickAttrs:i}),main:be(t.main,{extraPickAttrs:i,isClassifyArea:!0}),footer:be(t.footer,{extraPickAttrs:i})};return{version:br,data:n,options:Ne(this.options)}}setValue(e,t){const{header:i,main:n,footer:s}=Ne(e);if(!i&&!n&&!s)return;const{isSetCursor:l=!1}=t||{};[i,n,s].forEach(d=>{d&&tt(d,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:i,main:n,footer:s}),this.historyManager.recovery();const c=l?n?.length?n.length-1:0:void 0;c!==void 0&&this.range.setRange(c,c),this.render({curIndex:c,isSetCursor:l,isFirstRender:!0})}setEditorData(e){const{header:t,main:i,footer:n}=e;t&&this.header.setElementList(t),i&&(this.elementList=i),n&&this.footer.setElementList(n)}_wrapContainer(e){const t=document.createElement("div");return e.append(t),t}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(Ni,ci.MAIN)}_createPageContainer(){const e=document.createElement("div");return e.classList.add(`${ie}-page-container`),this.container.append(e),e}_createPage(e){const t=this.getWidth(),i=this.getHeight(),n=document.createElement("canvas");n.style.width=`${t}px`,n.style.height=`${i}px`,n.style.display="block",n.style.backgroundColor="#ffffff",n.style.marginBottom=`${this.getPageGap()}px`,n.setAttribute("data-index",String(e)),this.pageContainer.append(n);const s=this.getPagePixelRatio();n.width=t*s,n.height=i*s,n.style.cursor="text";const l=n.getContext("2d");this._initPageContext(l),this.pageList.push(n),this.ctxList.push(l)}_initPageContext(e){const t=this.getPagePixelRatio();e.scale(t,t),e.letterSpacing="0px",e.wordSpacing="0px",e.direction="ltr"}getElementFont(e,t=1){const{defaultSize:i,defaultFont:n}=this.options,s=e.font||n,l=e.actualSize||e.size||i;return`${e.italic?"italic ":""}${e.bold?"bold ":""}${l*t}px ${s}`}getElementSize(e){return e.actualSize||e.size||this.options.defaultSize}getElementRowMargin(e){var t;const{defaultBasicRowMarginHeight:i,defaultRowMargin:n,scale:s}=this.options;return i*((t=e.rowMargin)!=null?t:n)*s}computeRowList(e){var t,i,n,s,l,a,c,d,h,u,f,g,R,p,M,S,b,P,N,m,T;const{innerWidth:y,elementList:x,isPagingMode:I=!1,isFromTable:V=!1,startX:F=0,startY:L=0,pageHeight:w=0,mainOuterHeight:v=0,surroundElementList:X=[]}=e,{defaultSize:C,defaultRowMargin:Z,scale:k,table:{tdPadding:Q,defaultTrMinHeight:Y},defaultTabWidth:W}=this.options,H=this.getDefaultBasicRowMarginHeight(),K=document.createElement("canvas").getContext("2d"),_=this.listParticle.computeListStyle(K,x),J=[];x.length&&J.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:((t=x?.[0])==null?void 0:t.rowFlex)||((i=x?.[1])==null?void 0:i.rowFlex)});let G=F,se=L,ae=0,we,ve=0,Ie=0;for(let me=0;me<x.length;me++){const Se=J[J.length-1],A=x[me],It=H*((n=A.rowMargin)!=null?n:Z),q={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},os=Se.offsetX||A.listId&&_.get(A.listId)||0,_e=y-os,ls=Se.elementList.length===1;if(G+=ls?os:0,se+=ls&&Se.offsetY||0,((s=A.control)!=null&&s.hide||(l=A.area)!=null&&l.hide)&&!this.isDesignMode())q.height=((a=Se.elementList[Se.elementList.length-1])==null?void 0:a.metrics.height)||this.options.defaultSize*k;else if(A.type===D.IMAGE||A.type===D.LATEX){if(A.imgDisplay===re.SURROUND||A.imgDisplay===re.FLOAT_TOP||A.imgDisplay===re.FLOAT_BOTTOM)q.width=0,q.height=0,q.boundingBoxDescent=0;else{const Pe=A.width*k,Ke=A.height*k;if(Pe>_e){const Xe=Ke*_e/Pe;A.width=_e/k,A.height=Xe/k,q.width=_e,q.height=Xe,q.boundingBoxDescent=Xe}else q.width=Pe,q.height=Ke,q.boundingBoxDescent=Ke}q.boundingBoxAscent=0}else if(A.type===D.TABLE){const Pe=Q[1]+Q[3],Ke=Q[0]+Q[2];if(A.pagingId){let De=me+1,et=0;for(;De<x.length;){const Ee=x[De];if(Ee.pagingId===A.pagingId){const Ue=Ee.trList.filter(xt=>!xt.pagingRepeat);A.trList.push(...Ue),A.height+=Ee.height,De++,et++}else break}et&&x.splice(me+1,et)}A.pagingIndex=(c=A.pagingIndex)!=null?c:0;const Xe=A.trList;for(let De=0;De<Xe.length;De++){const et=Xe[De];et.height=et.minHeight||Y,et.minHeight=et.height}this.tableParticle.computeRowColInfo(A);for(let De=0;De<Xe.length;De++){const et=Xe[De];for(let Ee=0;Ee<et.tdList.length;Ee++){const Ue=et.tdList[Ee],xt=this.computeRowList({innerWidth:(Ue.width-Pe)*k,elementList:Ue.value,isFromTable:!0,isPagingMode:I}),Ye=xt.reduce((lt,kt)=>lt+kt.height,0);Ue.rowList=xt;const ze=Ye/k+Ke;if(Ue.height<ze){const lt=ze-Ue.height,kt=Xe[De+Ue.rowspan-1];kt.height+=lt,kt.tdList.forEach(oi=>{oi.height+=lt,oi.realHeight?oi.realHeight+=lt:oi.realHeight=oi.height})}let ot=0,wt=0,Rt=0;for(;Rt<Ue.rowspan;){const lt=Xe[Rt+De]||Xe[De];ot+=lt.minHeight,wt+=lt.height,Rt++}Ue.realMinHeight=ot,Ue.realHeight=wt,Ue.mainHeight=ze}}const gt=this.tableParticle.getTrListGroupByCol(Xe);for(let De=0;De<gt.length;De++){const et=gt[De];let Ee=-1;for(let Ue=0;Ue<et.tdList.length;Ue++){const xt=et.tdList[Ue],Ye=xt.realHeight,ze=xt.mainHeight,ot=xt.realMinHeight,wt=ze<ot?Ye-ot:Ye-ze;(!~Ee||wt<Ee)&&(Ee=wt)}if(Ee>0){const Ue=Xe[De];Ue.height-=Ee,Ue.tdList.forEach(xt=>{xt.height-=Ee,xt.realHeight-=Ee})}}this.tableParticle.computeRowColInfo(A);const rs=this.tableParticle.getTableHeight(A),ih=this.tableParticle.getTableWidth(A);A.width=ih,A.height=rs;const KN=ih*k,ur=rs*k;if(q.width=KN,q.height=ur,q.boundingBoxDescent=ur,q.boundingBoxAscent=-It,((d=x[me+1])==null?void 0:d.type)===D.TABLE&&(q.boundingBoxAscent-=It),I){const De=this.getHeight(),et=this.getMainOuterHeight();let Ee=et;for(let Ye=0;Ye<J.length;Ye++){const ze=J[Ye],ot=ze.offsetY||0;ze.height+Ee+ot>De||(h=J[Ye-1])!=null&&h.isPageBreak?Ee=et+ze.height+ot:Ee+=ze.height+ot}const Ue=It*2*k,xt=A.trList[0].height*k;if((Ee+xt+Ue>De||A.pagingIndex!==0&&A.trList[0].pagingRepeat)&&(Ee=et),Ee+Ue+ur>De){const Ye=A.trList;let ze=0,ot=0,wt=0;if(Ye.length>1)for(let Rt=0;Rt<Ye.length;Rt++){const lt=Ye[Rt],kt=lt.height*k;if(Ee+Ue+wt+kt>De){const oi=lt.tdList.reduce((_i,go)=>_i+go.colspan,0);((u=A.colgroup)==null?void 0:u.length)!==oi&&(ot=0);break}else ze=Rt+1,ot=Ye.length-ze,wt+=kt}if(ot){const Rt=Ye.splice(ze,ot),lt=Rt.reduce((Pn,fr)=>Pn+fr.height,0),kt=lt*k,oi=A.pagingId||pe();A.pagingId=oi,A.height-=lt,q.height-=kt,q.boundingBoxDescent-=kt;const _i=Ne(A);_i.pagingId=oi,_i.pagingIndex=A.pagingIndex+1;const go=Ye.filter(Pn=>Pn.pagingRepeat);if(go.length){const Pn=Ne(go);Pn.forEach(fr=>fr.id=pe()),Rt.unshift(...Pn)}_i.trList=Rt,_i.id=pe(),this.spliceElementList(x,me+1,0,[_i])}}if(A.pagingId){const Ye=this.position.getPositionContext();if(Ye.isTable){let ze=-1,ot=-1,wt=me;for(;wt<x.length;){const Rt=x[wt];if(Rt.pagingId!==A.pagingId)break;const lt=Rt.trList.findIndex(kt=>kt.id===Ye.trId);if(~lt){ze=wt,ot=lt;break}wt++}~ze&&(Ye.index=ze,Ye.trIndex=ot,this.position.setPositionContext(Ye))}}}}else if(A.type===D.SEPARATOR){const{separator:{lineWidth:Pe}}=this.options;A.width=_e/k,q.width=_e,q.height=Pe*k,q.boundingBoxAscent=-It,q.boundingBoxDescent=-It+q.height}else if(A.type===D.PAGE_BREAK)A.width=_e/k,q.width=_e,q.height=C;else if(A.type===D.RADIO||A.controlComponent===E.RADIO){const{width:Pe,height:Ke,gap:Xe}=this.options.radio,gt=Pe+Xe*2;A.width=gt,q.width=gt*k,q.height=Ke*k}else if(A.type===D.CHECKBOX||A.controlComponent===E.CHECKBOX){const{width:Pe,height:Ke,gap:Xe}=this.options.checkbox,gt=Pe+Xe*2;A.width=gt,q.width=gt*k,q.height=Ke*k}else if(A.type===D.TAB)q.width=W*k,q.height=C*k,q.boundingBoxDescent=0,q.boundingBoxAscent=q.height;else if(A.type===D.BLOCK){if(!A.width)q.width=_e;else{const Pe=A.width*k;q.width=Math.min(Pe,_e)}q.height=A.height*k,q.boundingBoxDescent=q.height,q.boundingBoxAscent=0}else{const Pe=A.size||C;(A.type===D.SUPERSCRIPT||A.type===D.SUBSCRIPT)&&(A.actualSize=Math.ceil(Pe*.6)),q.height=(A.actualSize||Pe)*k,K.font=this.getElementFont(A);const Ke=this.textParticle.measureText(K,A);q.width=Ke.width*k,A.letterSpacing&&(q.width+=A.letterSpacing*k),q.boundingBoxAscent=(A.value===j?A.size||C:Ke.actualBoundingBoxAscent)*k,q.boundingBoxDescent=Ke.actualBoundingBoxDescent*k,A.type===D.SUPERSCRIPT?q.boundingBoxAscent+=q.height/2:A.type===D.SUBSCRIPT&&(q.boundingBoxDescent+=q.height/2)}const $d=A.imgDisplay!==re.INLINE&&A.type===D.IMAGE||A.type===D.LATEX?q.height+It:q.boundingBoxAscent+It,On=It+q.boundingBoxAscent+q.boundingBoxDescent+It,Wt=Object.assign(A,{metrics:q,left:0,style:this.getElementFont(A,k)});(f=Wt.control)!=null&&f.minWidth&&(Wt.controlComponent&&(Ie+=q.width),Wt.controlComponent===E.POSTFIX&&(this.control.setMinWidthControlInfo({row:Se,rowElement:Wt,availableWidth:_e,controlRealWidth:Ie}),Ie=0));const Ze=x[me-1];let jd=x[me+1],fo=Se.width+q.width;if(this.options.wordBreak===gs.BREAK_WORD&&(!Ze?.type||Ze?.type===D.TEXT)&&(!A.type||A.type===D.TEXT)){const Pe=`${Ze?.value||""}${A.value}`;if(this.WORD_LIKE_REG.test(Pe)){const{width:Xe,endElement:gt}=this.textParticle.measureWord(K,x,me),rs=Xe*k;rs<=_e&&(fo+=rs,jd=gt)}const Ke=this.textParticle.measurePunctuationWidth(K,jd);fo+=Ke*k}A.listId&&(A.listId!==we?ve=0:A.value===j&&!A.listWrap&&ve++),we=A.listId;const qd=this.position.setSurroundPosition({pageNo:ae,rowElement:Wt,row:Se,rowElementRect:{x:G,y:se,height:On,width:q.width},availableWidth:_e,surroundElementList:X});G=qd.x,fo+=qd.rowIncreaseWidth,G+=q.width;const eh=A.type===D.SEPARATOR||A.type===D.TABLE||Ze?.type===D.TABLE||Ze?.type===D.BLOCK||A.type===D.BLOCK||Ze?.imgDisplay===re.INLINE||A.imgDisplay===re.INLINE||Ze?.listId!==A.listId||Ze?.areaId!==A.areaId&&!((g=A.area)!=null&&g.hide)||((R=A.control)==null?void 0:R.flexDirection)===bo.COLUMN&&(A.controlComponent===E.CHECKBOX||A.controlComponent===E.RADIO)&&Ze?.controlComponent===E.VALUE||me!==0&&A.value===j&&!((p=A.area)!=null&&p.hide),th=fo>_e,hr=eh||th;if(hr){const Pe={width:q.width,height:On,startIndex:me,elementList:[Wt],ascent:$d,rowIndex:Se.rowIndex+1,rowFlex:((M=x[me])==null?void 0:M.rowFlex)||((S=x[me+1])==null?void 0:S.rowFlex),isPageBreak:A.type===D.PAGE_BREAK};if(Wt.controlComponent!==E.PREFIX&&((b=Wt.control)==null?void 0:b.indentation)===Eo.VALUE_START){const Ke=Se.elementList.findIndex(Xe=>Xe.controlId===Wt.controlId&&Xe.controlComponent!==E.PREFIX);if(~Ke){const gt=this.position.computeRowPosition({row:Se,innerWidth:this.getInnerWidth()})[Ke];gt&&(Pe.offsetX=gt.coordinate.leftTop[0])}}A.listId&&(Pe.isList=!0,Pe.offsetX=_.get(A.listId),Pe.listIndex=ve),Pe.offsetY=!V&&((P=A.area)!=null&&P.top)&&A.areaId!==((N=x[me-1])==null?void 0:N.areaId)?A.area.top*k:0,J.push(Pe)}else Se.width+=q.width,me===0&&(qi(x[1])||(m=x[1])!=null&&m.areaId)?(Se.height=H,Se.ascent=H):Se.height<On&&(Se.height=On,Se.ascent=$d),Se.elementList.push(Wt);if((hr||me===x.length-1)&&(Se.isWidthNotEnough=th&&!eh,!Se.isSurround&&(Ze?.rowFlex===Re.JUSTIFY||Ze?.rowFlex===Re.ALIGNMENT&&Se.isWidthNotEnough))){const Pe=((T=Se.elementList[0])==null?void 0:T.value)===j?Se.elementList.slice(1):Se.elementList,Ke=(_e-Se.width)/(Pe.length-1);for(let Xe=0;Xe<Pe.length-1;Xe++){const gt=Pe[Xe];gt.metrics.width+=Ke}Se.width=_e}if(hr){G=F,se+=Se.height,I&&!V&&w&&(se-L+v+On>w||A.type===D.PAGE_BREAK)&&(se=L,kf(X,ae),ae+=1),Wt.left=0;const Pe=J[J.length-1];G=this.position.setSurroundPosition({pageNo:ae,rowElement:Wt,row:Pe,rowElementRect:{x:G,y:se,height:On,width:q.width},availableWidth:_e,surroundElementList:X}).x,G+=q.width}}return J}_computePageList(){var e;const t=[[]],{pageMode:i,pageNumber:{maxPageNo:n}}=this.options,s=this.getHeight(),l=this.getMainOuterHeight();let a=l,c=0;if(i===bi.CONTINUITY){t[0]=this.rowList,a+=this.rowList.reduce((f,g)=>f+g.height+(g.offsetY||0),0);const d=this.getPagePixelRatio(),h=this.pageList[0],u=Number(h.style.height.replace("px",""));if(a>u)h.style.height=`${a}px`,h.height=a*d;else{const f=a<s?s:a;h.style.height=`${f}px`,h.height=f*d}this._initPageContext(this.ctxList[0])}else for(let d=0;d<this.rowList.length;d++){const h=this.rowList[d],u=h.offsetY||0;if(h.height+u+a>s||(e=this.rowList[d-1])!=null&&e.isPageBreak){if(Number.isInteger(n)&&c>=n){this.elementList=this.elementList.slice(0,h.startIndex);break}a=l+h.height+u,t.push([h]),c++}else a+=h.height+u,t[c].push(h)}return t}_drawHighlight(e,t){const{rowList:i,positionList:n,elementList:s}=t,l=this.getDefaultBasicRowMarginHeight(),a=this.getHighlightMarginHeight();for(let c=0;c<i.length;c++){const d=i[c];for(let h=0;h<d.elementList.length;h++){const u=d.elementList[h],f=d.elementList[h-1],g=u.highlight||this.control.getControlHighlight(s,d.startIndex+h);if(g){f&&f.highlight&&f.highlight!==u.highlight&&this.highlight.render(e);const{coordinate:{leftTop:[R,p]}}=n[d.startIndex+h],M=u.left||0;this.highlight.recordFillInfo(e,R-M,p+l-a,u.metrics.width+M,d.height-2*l+2*a,g)}else f?.highlight&&this.highlight.render(e)}this.highlight.render(e)}}drawRow(e,t){var i,n,s,l,a,c,d,h,u;this._drawHighlight(e,t);const{scale:f,table:{tdPadding:g},group:R,lineBreak:p}=this.options,{rowList:M,pageNo:S,elementList:b,positionList:P,startIndex:N,zone:m,isDrawLineBreak:T=!p.disabled}=t,y=this.mode===ce.PRINT,{isCrossRowCol:x,tableId:I}=this.range.getRange();let V=N;for(let F=0;F<M.length;F++){const L=M[F],w={x:0,y:0,width:0,height:0};let v=null;for(let X=0;X<L.elementList.length;X++){const C=L.elementList[X],Z=C.metrics,{ascent:k,coordinate:{leftTop:[Q,Y]}}=P[L.startIndex+X],W=L.elementList[X-1];if(((i=C.control)!=null&&i.hide||(n=C.area)!=null&&n.hide)&&!this.isDesignMode())this.textParticle.complete();else if(C.type===D.IMAGE)this.textParticle.complete(),C.imgDisplay!==re.SURROUND&&C.imgDisplay!==re.FLOAT_TOP&&C.imgDisplay!==re.FLOAT_BOTTOM&&this.imageParticle.render(e,C,Q,Y+k);else if(C.type===D.LATEX)this.textParticle.complete(),this.laTexParticle.render(e,C,Q,Y+k);else if(C.type===D.TABLE)x&&(w.x=Q,w.y=Y,v=C),this.tableParticle.render(e,C,Q,Y);else if(C.type===D.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(e,C,Q,Y+k);else if(C.type===D.DATE){const _=L.elementList[X+1];(!W||W.dateId!==C.dateId)&&this.textParticle.complete(),this.textParticle.record(e,C,Q,Y+k),(!_||_.dateId!==C.dateId)&&this.textParticle.complete()}else C.type===D.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(e,C,Q,Y+k)):C.type===D.SUBSCRIPT?(this.underline.render(e),this.textParticle.complete(),this.subscriptParticle.render(e,C,Q,Y+k)):C.type===D.SEPARATOR?this.separatorParticle.render(e,C,Q,Y):C.type===D.PAGE_BREAK?this.mode!==ce.CLEAN&&!y&&this.pageBreakParticle.render(e,C,Q,Y):C.type===D.CHECKBOX||C.controlComponent===E.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:e,x:Q,y:Y+k,index:X,row:L})):C.type===D.RADIO||C.controlComponent===E.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:e,x:Q,y:Y+k,index:X,row:L})):C.type===D.TAB?this.textParticle.complete():C.rowFlex===Re.ALIGNMENT||C.rowFlex===Re.JUSTIFY?(this.textParticle.record(e,C,Q,Y+k),this.textParticle.complete()):C.type===D.BLOCK?(this.textParticle.complete(),this.blockParticle.render(S,C,Q,Y+k)):(C.left&&this.textParticle.complete(),this.textParticle.record(e,C,Q,Y+k),(C.width||C.letterSpacing||Xu.test(C.value))&&this.textParticle.complete());if(T&&!y&&this.mode!==ce.CLEAN&&!L.isWidthNotEnough&&X===L.elementList.length-1&&this.lineBreakParticle.render(e,C,Q,Y+L.height/2),(s=C.control)!=null&&s.border){(l=W?.control)!=null&&l.border&&W.controlId!==C.controlId&&this.control.drawBorder(e);const _=this.getElementRowMargin(C);this.control.recordBorderInfo(Q,Y+_,C.metrics.width,L.height-2*_)}else(a=W?.control)!=null&&a.border&&this.control.drawBorder(e);if(C.underline||(c=C.control)!=null&&c.underline){W?.type===D.SUBSCRIPT&&C.type!==D.SUBSCRIPT&&this.underline.render(e);const _=this.getElementRowMargin(C),J=C.left||0;let G=0;C.type===D.SUBSCRIPT&&(G=this.subscriptParticle.getOffsetY(C));const se=(d=C.control)!=null&&d.underline?this.options.underlineColor:C.color;this.underline.recordFillInfo(e,Q-J,Y+L.height-_+G,Z.width+J,0,se,(h=C.textDecoration)==null?void 0:h.style)}else(W?.underline||(u=W?.control)!=null&&u.underline)&&this.underline.render(e);if(C.strikeout){if(!C.type||yt.includes(C.type)){W&&(W.type===D.SUBSCRIPT&&C.type!==D.SUBSCRIPT||W.type===D.SUPERSCRIPT&&C.type!==D.SUPERSCRIPT||this.getElementSize(W)!==this.getElementSize(C))&&this.strikeout.render(e);const _=this.textParticle.measureBasisWord(e,this.getElementFont(C));let J=Y+k+_.actualBoundingBoxDescent*f-Z.height/2;C.type===D.SUBSCRIPT?J+=this.subscriptParticle.getOffsetY(C):C.type===D.SUPERSCRIPT&&(J+=this.superscriptParticle.getOffsetY(C)),this.strikeout.recordFillInfo(e,Q,J,Z.width)}}else W?.strikeout&&this.strikeout.render(e);const{zone:H,startIndex:U,endIndex:K}=this.range.getRange();if(H===m&&U!==K&&U<=V&&V<=K){const _=this.position.getPositionContext();if(!_.isTable&&!C.tdId||_.tdId===C.tdId)if(U===V){const J=b[U+1];J&&J.value===j&&(w.x=Q+Z.width,w.y=Y,w.height=L.height,w.width+=this.options.rangeMinWidth)}else{let J=Z.width;J===0&&L.elementList.length===1&&(J=this.options.rangeMinWidth),w.width||(w.x=Q,w.y=Y,w.height=L.height),w.width+=J}}if(!R.disabled&&C.groupIds&&this.group.recordFillInfo(C,Q,Y,Z.width,L.height),V++,C.type===D.TABLE){const _=g[1]+g[3];for(let J=0;J<C.trList.length;J++){const G=C.trList[J];for(let se=0;se<G.tdList.length;se++){const ae=G.tdList[se];this.drawRow(e,{elementList:ae.value,positionList:ae.positionList,rowList:ae.rowList,pageNo:S,startIndex:0,innerWidth:(ae.width-_)*f,zone:m,isDrawLineBreak:T})}}}}if(L.isList&&this.listParticle.drawListStyle(e,L,P[L.startIndex]),this.textParticle.complete(),this.control.drawBorder(e),this.underline.render(e),this.strikeout.render(e),this.group.render(e),!y){if(w.width&&w.height){const{x:X,y:C,width:Z,height:k}=w;this.range.render(e,X,C,Z,k)}if(x&&v&&v.id===I){const{coordinate:{leftTop:[X,C]}}=P[L.startIndex];this.tableParticle.drawRange(e,v,X,C)}}}}_drawFloat(e,t){const{scale:i}=this.options,n=this.position.getFloatPositionList(),{imgDisplays:s,pageNo:l}=t;for(let a=0;a<n.length;a++){const c=n[a],d=c.element;if((l===c.pageNo||c.zone===de.HEADER||c.zone==de.FOOTER)&&d.imgDisplay&&s.includes(d.imgDisplay)&&d.type===D.IMAGE){const h=d.imgFloatPosition;this.imageParticle.render(e,d,h.x*i,h.y*i)}}}_clearPage(e){const t=this.ctxList[e],i=this.pageList[e];t.clearRect(0,0,Math.max(i.width,this.getWidth()),Math.max(i.height,this.getHeight())),this.blockParticle.clear()}_drawPage(e){var t,i;const{elementList:n,positionList:s,rowList:l,pageNo:a}=e,{inactiveAlpha:c,pageMode:d,header:h,footer:u,pageNumber:f,lineNumber:g,pageBorder:R}=this.options,p=this.mode===ce.PRINT,M=this.getInnerWidth(),S=this.ctxList[a];S.globalAlpha=this.zone.isMainActive()?1:c,this._clearPage(a),this.background.render(S,a),p||this.area.render(S,a),d!==bi.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(S,a),p||this.margin.render(S,a),this._drawFloat(S,{pageNo:a,imgDisplays:[re.FLOAT_BOTTOM]}),p||this.control.renderHighlightList(S,a);const b=(t=l[0])==null?void 0:t.startIndex;this.drawRow(S,{elementList:n,positionList:s,rowList:l,pageNo:a,startIndex:b,innerWidth:M,zone:de.MAIN}),this.getIsPagingMode()&&(h.disabled||this.header.render(S,a),f.disabled||this.pageNumber.render(S,a),u.disabled||this.footer.render(S,a)),this._drawFloat(S,{pageNo:a,imgDisplays:[re.FLOAT_TOP,re.SURROUND]}),!p&&this.search.getSearchKeyword()&&this.search.render(S,a),this.elementList.length<=1&&!((i=this.elementList[0])!=null&&i.listId)&&this.placeholder.render(S),g.disabled||this.lineNumber.render(S,a),R.disabled||this.pageBorder.render(S),this.badge.render(S,a)}_disconnectLazyRender(){var e;(e=this.lazyRenderIntersectionObserver)==null||e.disconnect()}_lazyRender(){const e=this.position.getOriginalMainPositionList(),t=this.getOriginalMainElementList();this._disconnectLazyRender(),this.lazyRenderIntersectionObserver=new IntersectionObserver(i=>{i.forEach(n=>{if(n.isIntersecting){const s=Number(n.target.dataset.index);this._drawPage({elementList:t,positionList:e,rowList:this.pageRowList[s],pageNo:s})}})}),this.pageList.forEach(i=>{this.lazyRenderIntersectionObserver.observe(i)})}_immediateRender(){const e=this.position.getOriginalMainPositionList(),t=this.getOriginalMainElementList();for(let i=0;i<this.pageRowList.length;i++)this._drawPage({elementList:t,positionList:e,rowList:this.pageRowList[i],pageNo:i})}render(e){this.renderCount++;const{header:t,footer:i}=this.options,{isSubmitHistory:n=!0,isSetCursor:s=!0,isCompute:l=!0,isLazy:a=!0,isInit:c=!1,isSourceHistory:d=!1,isFirstRender:h=!1}=e||{};let{curIndex:u}=e||{};const f=this.getInnerWidth(),g=this.getIsPagingMode(),R=this.pageRowList.length;if(l){this.position.setFloatPositionList([]),g&&(t.disabled||this.header.compute(),i.disabled||this.footer.compute());const S=this.getMargins(),b=this.getHeight(),P=this.header.getExtraHeight(),N=this.getMainOuterHeight(),m=S[3],T=S[0]+P,y=Br(this.elementList);if(this.rowList=this.computeRowList({startX:m,startY:T,pageHeight:b,mainOuterHeight:N,isPagingMode:g,innerWidth:f,surroundElementList:y,elementList:this.elementList}),this.pageRowList=this._computePageList(),this.position.computePositionList(),this.area.compute(),this.mode!==ce.PRINT){const x=this.search.getSearchKeyword();x&&this.search.compute(x),this.control.computeHighlightList()}}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let S=0;S<this.pageRowList.length;S++)this.pageList[S]||this._createPage(S);const p=this.pageRowList.length,M=this.pageList.length;if(M>p){const S=M-p;this.ctxList.splice(p,S),this.pageList.splice(p,S).forEach(b=>b.remove())}a&&g?this._lazyRender():this._immediateRender(),s?u=this.setCursor(u):this.range.getIsSelection()&&this.cursor.focus(),(n&&!h||u!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(u),wr(()=>{this.range.setRangeStyle(),l&&this.control.getActiveControl()&&this.control.reAwakeControl(),l&&!this.isReadonly()&&this.position.getPositionContext().isTable&&this.tableTool.render(),l&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),R!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(n||d)&&!c&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"))})}setCursor(e){var t;const i=this.position.getPositionContext(),n=this.position.getPositionList();if(i.isTable){const{index:l,trIndex:a,tdIndex:c}=i,h=(t=this.getOriginalElementList()[l].trList)==null?void 0:t[a].tdList[c].positionList;e===void 0&&h&&(e=h.length-1);const u=h?.[e];this.position.setCursorPosition(u||null)}else this.position.setCursorPosition(e!==void 0?n[e]:null);let s=!0;if(e!==void 0&&i.isImage&&i.isDirectHit){const a=this.getElementList()[e];if(Ju.includes(a.type)){s=!1;const c=this.position.getCursorPosition();this.previewer.updateResizer(a,c)}}return this.cursor.drawCursor({isShow:s}),e}submitHistory(e){const t=this.position.getPositionContext(),i=Yo(this.elementList),n=Yo(this.header.getElementList()),s=Yo(this.footer.getElementList()),l=Ne(this.range.getRange()),a=this.pageNo,c=Ne(t),d=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(d),this.setPageNo(a),this.position.setPositionContext(Ne(c)),this.header.setElementList(Ne(n)),this.footer.setElementList(Ne(s)),this.elementList=Ne(i),this.range.replaceRange(Ne(l)),this.render({curIndex:e,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}}class RR{constructor(e){O(this,"executeMode"),O(this,"executeCut"),O(this,"executeCopy"),O(this,"executePaste"),O(this,"executeSelectAll"),O(this,"executeBackspace"),O(this,"executeSetRange"),O(this,"executeReplaceRange"),O(this,"executeSetPositionContext"),O(this,"executeForceUpdate"),O(this,"executeBlur"),O(this,"executeUndo"),O(this,"executeRedo"),O(this,"executePainter"),O(this,"executeApplyPainterStyle"),O(this,"executeFormat"),O(this,"executeFont"),O(this,"executeSize"),O(this,"executeSizeAdd"),O(this,"executeSizeMinus"),O(this,"executeBold"),O(this,"executeItalic"),O(this,"executeUnderline"),O(this,"executeStrikeout"),O(this,"executeSuperscript"),O(this,"executeSubscript"),O(this,"executeColor"),O(this,"executeHighlight"),O(this,"executeTitle"),O(this,"executeList"),O(this,"executeRowFlex"),O(this,"executeRowMargin"),O(this,"executeInsertTable"),O(this,"executeInsertTableTopRow"),O(this,"executeInsertTableBottomRow"),O(this,"executeInsertTableLeftCol"),O(this,"executeInsertTableRightCol"),O(this,"executeDeleteTableRow"),O(this,"executeDeleteTableCol"),O(this,"executeDeleteTable"),O(this,"executeMergeTableCell"),O(this,"executeCancelMergeTableCell"),O(this,"executeSplitVerticalTableCell"),O(this,"executeSplitHorizontalTableCell"),O(this,"executeTableTdVerticalAlign"),O(this,"executeTableBorderType"),O(this,"executeTableBorderColor"),O(this,"executeTableTdBorderType"),O(this,"executeTableTdSlashType"),O(this,"executeTableTdBackgroundColor"),O(this,"executeTableSelectAll"),O(this,"executeImage"),O(this,"executeHyperlink"),O(this,"executeDeleteHyperlink"),O(this,"executeCancelHyperlink"),O(this,"executeEditHyperlink"),O(this,"executeSeparator"),O(this,"executePageBreak"),O(this,"executeAddWatermark"),O(this,"executeDeleteWatermark"),O(this,"executeSearch"),O(this,"executeSearchNavigatePre"),O(this,"executeSearchNavigateNext"),O(this,"executeReplace"),O(this,"executePrint"),O(this,"executeReplaceImageElement"),O(this,"executeSaveAsImageElement"),O(this,"executeChangeImageDisplay"),O(this,"executePageMode"),O(this,"executePageScale"),O(this,"executePageScaleRecovery"),O(this,"executePageScaleMinus"),O(this,"executePageScaleAdd"),O(this,"executePaperSize"),O(this,"executePaperDirection"),O(this,"executeSetPaperMargin"),O(this,"executeSetMainBadge"),O(this,"executeSetAreaBadge"),O(this,"executeInsertElementList"),O(this,"executeInsertArea"),O(this,"executeSetAreaProperties"),O(this,"executeLocationArea"),O(this,"executeAppendElementList"),O(this,"executeUpdateElementById"),O(this,"executeDeleteElementById"),O(this,"executeSetValue"),O(this,"executeRemoveControl"),O(this,"executeTranslate"),O(this,"executeSetLocale"),O(this,"executeLocationCatalog"),O(this,"executeWordTool"),O(this,"executeSetHTML"),O(this,"executeSetGroup"),O(this,"executeDeleteGroup"),O(this,"executeLocationGroup"),O(this,"executeSetZone"),O(this,"executeSetControlValue"),O(this,"executeSetControlValueList"),O(this,"executeSetControlExtension"),O(this,"executeSetControlExtensionList"),O(this,"executeSetControlProperties"),O(this,"executeSetControlPropertiesList"),O(this,"executeSetControlHighlight"),O(this,"executeLocationControl"),O(this,"executeInsertControl"),O(this,"executeUpdateOptions"),O(this,"executeInsertTitle"),O(this,"executeFocus"),O(this,"getCatalog"),O(this,"getImage"),O(this,"getOptions"),O(this,"getValue"),O(this,"getValueAsync"),O(this,"getAreaValue"),O(this,"getHTML"),O(this,"getText"),O(this,"getWordCount"),O(this,"getCursorPosition"),O(this,"getRange"),O(this,"getRangeText"),O(this,"getRangeContext"),O(this,"getRangeRow"),O(this,"getRangeParagraph"),O(this,"getKeywordRangeList"),O(this,"getKeywordContext"),O(this,"getPaperMargin"),O(this,"getSearchNavigateInfo"),O(this,"getLocale"),O(this,"getGroupIds"),O(this,"getControlValue"),O(this,"getControlList"),O(this,"getContainer"),O(this,"getTitleValue"),O(this,"getPositionContextByEvent"),O(this,"getElementById"),this.executeMode=e.mode.bind(e),this.executeCut=e.cut.bind(e),this.executeCopy=e.copy.bind(e),this.executePaste=e.paste.bind(e),this.executeSelectAll=e.selectAll.bind(e),this.executeBackspace=e.backspace.bind(e),this.executeSetRange=e.setRange.bind(e),this.executeReplaceRange=e.replaceRange.bind(e),this.executeSetPositionContext=e.setPositionContext.bind(e),this.executeForceUpdate=e.forceUpdate.bind(e),this.executeBlur=e.blur.bind(e),this.executeUndo=e.undo.bind(e),this.executeRedo=e.redo.bind(e),this.executePainter=e.painter.bind(e),this.executeApplyPainterStyle=e.applyPainterStyle.bind(e),this.executeFormat=e.format.bind(e),this.executeFont=e.font.bind(e),this.executeSize=e.size.bind(e),this.executeSizeAdd=e.sizeAdd.bind(e),this.executeSizeMinus=e.sizeMinus.bind(e),this.executeBold=e.bold.bind(e),this.executeItalic=e.italic.bind(e),this.executeUnderline=e.underline.bind(e),this.executeStrikeout=e.strikeout.bind(e),this.executeSuperscript=e.superscript.bind(e),this.executeSubscript=e.subscript.bind(e),this.executeColor=e.color.bind(e),this.executeHighlight=e.highlight.bind(e),this.executeTitle=e.title.bind(e),this.executeList=e.list.bind(e),this.executeRowFlex=e.rowFlex.bind(e),this.executeRowMargin=e.rowMargin.bind(e),this.executeInsertTable=e.insertTable.bind(e),this.executeInsertTableTopRow=e.insertTableTopRow.bind(e),this.executeInsertTableBottomRow=e.insertTableBottomRow.bind(e),this.executeInsertTableLeftCol=e.insertTableLeftCol.bind(e),this.executeInsertTableRightCol=e.insertTableRightCol.bind(e),this.executeDeleteTableRow=e.deleteTableRow.bind(e),this.executeDeleteTableCol=e.deleteTableCol.bind(e),this.executeDeleteTable=e.deleteTable.bind(e),this.executeMergeTableCell=e.mergeTableCell.bind(e),this.executeCancelMergeTableCell=e.cancelMergeTableCell.bind(e),this.executeSplitVerticalTableCell=e.splitVerticalTableCell.bind(e),this.executeSplitHorizontalTableCell=e.splitHorizontalTableCell.bind(e),this.executeTableTdVerticalAlign=e.tableTdVerticalAlign.bind(e),this.executeTableBorderType=e.tableBorderType.bind(e),this.executeTableBorderColor=e.tableBorderColor.bind(e),this.executeTableTdBorderType=e.tableTdBorderType.bind(e),this.executeTableTdSlashType=e.tableTdSlashType.bind(e),this.executeTableTdBackgroundColor=e.tableTdBackgroundColor.bind(e),this.executeTableSelectAll=e.tableSelectAll.bind(e),this.executeImage=e.image.bind(e),this.executeHyperlink=e.hyperlink.bind(e),this.executeDeleteHyperlink=e.deleteHyperlink.bind(e),this.executeCancelHyperlink=e.cancelHyperlink.bind(e),this.executeEditHyperlink=e.editHyperlink.bind(e),this.executeSeparator=e.separator.bind(e),this.executePageBreak=e.pageBreak.bind(e),this.executeAddWatermark=e.addWatermark.bind(e),this.executeDeleteWatermark=e.deleteWatermark.bind(e),this.executeSearch=e.search.bind(e),this.executeSearchNavigatePre=e.searchNavigatePre.bind(e),this.executeSearchNavigateNext=e.searchNavigateNext.bind(e),this.executeReplace=e.replace.bind(e),this.executePrint=e.print.bind(e),this.executeReplaceImageElement=e.replaceImageElement.bind(e),this.executeSaveAsImageElement=e.saveAsImageElement.bind(e),this.executeChangeImageDisplay=e.changeImageDisplay.bind(e),this.executePageMode=e.pageMode.bind(e),this.executePageScale=e.pageScale.bind(e),this.executePageScaleRecovery=e.pageScaleRecovery.bind(e),this.executePageScaleMinus=e.pageScaleMinus.bind(e),this.executePageScaleAdd=e.pageScaleAdd.bind(e),this.executePaperSize=e.paperSize.bind(e),this.executePaperDirection=e.paperDirection.bind(e),this.executeSetPaperMargin=e.setPaperMargin.bind(e),this.executeSetMainBadge=e.setMainBadge.bind(e),this.executeSetAreaBadge=e.setAreaBadge.bind(e),this.getAreaValue=e.getAreaValue.bind(e),this.executeInsertArea=e.insertArea.bind(e),this.executeSetAreaProperties=e.setAreaProperties.bind(e),this.executeLocationArea=e.locationArea.bind(e),this.executeInsertElementList=e.insertElementList.bind(e),this.executeAppendElementList=e.appendElementList.bind(e),this.executeUpdateElementById=e.updateElementById.bind(e),this.executeDeleteElementById=e.deleteElementById.bind(e),this.executeSetValue=e.setValue.bind(e),this.executeRemoveControl=e.removeControl.bind(e),this.executeTranslate=e.translate.bind(e),this.executeSetLocale=e.setLocale.bind(e),this.executeLocationCatalog=e.locationCatalog.bind(e),this.executeWordTool=e.wordTool.bind(e),this.executeSetHTML=e.setHTML.bind(e),this.executeSetGroup=e.setGroup.bind(e),this.executeDeleteGroup=e.deleteGroup.bind(e),this.executeLocationGroup=e.locationGroup.bind(e),this.executeSetZone=e.setZone.bind(e),this.executeUpdateOptions=e.updateOptions.bind(e),this.executeInsertTitle=e.insertTitle.bind(e),this.executeFocus=e.focus.bind(e),this.getImage=e.getImage.bind(e),this.getOptions=e.getOptions.bind(e),this.getValue=e.getValue.bind(e),this.getValueAsync=e.getValueAsync.bind(e),this.getHTML=e.getHTML.bind(e),this.getText=e.getText.bind(e),this.getWordCount=e.getWordCount.bind(e),this.getCursorPosition=e.getCursorPosition.bind(e),this.getRange=e.getRange.bind(e),this.getRangeText=e.getRangeText.bind(e),this.getRangeContext=e.getRangeContext.bind(e),this.getRangeRow=e.getRangeRow.bind(e),this.getRangeParagraph=e.getRangeParagraph.bind(e),this.getKeywordRangeList=e.getKeywordRangeList.bind(e),this.getKeywordContext=e.getKeywordContext.bind(e),this.getCatalog=e.getCatalog.bind(e),this.getPaperMargin=e.getPaperMargin.bind(e),this.getSearchNavigateInfo=e.getSearchNavigateInfo.bind(e),this.getLocale=e.getLocale.bind(e),this.getGroupIds=e.getGroupIds.bind(e),this.getContainer=e.getContainer.bind(e),this.getTitleValue=e.getTitleValue.bind(e),this.getPositionContextByEvent=e.getPositionContextByEvent.bind(e),this.getElementById=e.getElementById.bind(e),this.executeSetControlValue=e.setControlValue.bind(e),this.executeSetControlValueList=e.setControlValueList.bind(e),this.executeSetControlExtension=e.setControlExtension.bind(e),this.executeSetControlExtensionList=e.setControlExtensionList.bind(e),this.executeSetControlProperties=e.setControlProperties.bind(e),this.executeSetControlPropertiesList=e.setControlPropertiesList.bind(e),this.executeSetControlHighlight=e.setControlHighlight.bind(e),this.getControlValue=e.getControlValue.bind(e),this.getControlList=e.getControlList.bind(e),this.executeLocationControl=e.locationControl.bind(e),this.executeInsertControl=e.insertControl.bind(e)}}function pR(r,e){return r===1125&&e===1593?{size:"a3",width:"297mm",height:"420mm"}:r===794&&e===1123?{size:"a4",width:"210mm",height:"297mm"}:r===565&&e===796?{size:"a5",width:"148mm",height:"210mm"}:{size:"",width:`${r}px`,height:`${e}px`}}function mR(r,e){const{width:t,height:i,direction:n=At.VERTICAL}=e,s=document.createElement("iframe");s.style.visibility="hidden",s.style.position="absolute",s.style.left="0",s.style.top="0",s.style.width="0",s.style.height="0",s.style.border="none",document.body.append(s);const l=s.contentWindow,a=l.document;a.open();const c=document.createElement("div"),d=pR(t,i);r.forEach(f=>{const g=document.createElement("img");g.style.width=n===At.HORIZONTAL?d.height:d.width,g.style.height=n===At.HORIZONTAL?d.width:d.height,g.src=f,c.append(g)});const h=document.createElement("style"),u=`
88
+ * {
89
+ margin: 0;
90
+ padding: 0;
91
+ }
92
+ @page {
93
+ margin: 0;
94
+ size: ${d.size} ${n===At.HORIZONTAL?"landscape":"portrait"};
95
+ }`;h.append(document.createTextNode(u)),setTimeout(()=>{a.write(`${h.outerHTML}${c.innerHTML}`),l.print(),a.close(),window.addEventListener("mouseover",()=>{s?.remove()},{once:!0})})}class SR{constructor(e){O(this,"draw"),O(this,"range"),O(this,"position"),O(this,"historyManager"),O(this,"canvasEvent"),O(this,"options"),O(this,"control"),O(this,"workerManager"),O(this,"searchManager"),O(this,"i18n"),O(this,"zone"),O(this,"tableOperate"),this.draw=e,this.range=e.getRange(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.canvasEvent=e.getCanvasEvent(),this.options=e.getOptions(),this.control=e.getControl(),this.workerManager=e.getWorkerManager(),this.searchManager=e.getSearch(),this.i18n=e.getI18n(),this.zone=e.getZone(),this.tableOperate=e.getTableOperate()}mode(e){this.draw.setMode(e)}cut(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.cut()}copy(e){this.canvasEvent.copy(e)}paste(e){this.draw.isReadonly()||this.draw.isDisabled()||Yf(this.canvasEvent,e)}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.draw.getElementList(),{startIndex:i,endIndex:n}=this.range.getRange(),s=i===n;if(s&&t[i].value===j&&i===0)return;s?this.draw.spliceElementList(t,i,1):this.draw.spliceElementList(t,i+1,n-i);const l=s?i-1:i;this.range.setRange(l,l),this.draw.render({curIndex:l})}setRange(e,t,i,n,s,l,a){if(e<0||t<0||t<e)return;this.range.setRange(e,t,i,n,s,l,a);const c=e===t;this.draw.render({curIndex:c?e:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:c})}replaceRange(e){this.setRange(e.startIndex,e.endIndex,e.tableId,e.startTdIndex,e.endTdIndex,e.startTrIndex,e.endTrIndex)}setPositionContext(e){const{tableId:t,startTrIndex:i,startTdIndex:n}=e,s=this.draw.getOriginalElementList();if(t){const l=s.findIndex(h=>h.id===t);if(!~l)return;const c=s[l].trList[i],d=c.tdList[n];this.position.setPositionContext({isTable:!0,index:l,trIndex:i,tdIndex:n,tdId:d.id,trId:c.id,tableId:t})}else this.position.setPositionContext({isTable:!1})}forceUpdate(e){const{isSubmitHistory:t=!1}=e||{};this.range.clearRange(),this.draw.render({isSubmitHistory:t,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(e){if(!e.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const t=this.range.getSelection();if(!t)return;const i={};t.forEach(n=>{Kt.forEach(l=>{const a=l;i[a]===void 0&&(i[a]=n[a])})}),this.draw.setPainterStyle(i,e)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const n=this.range.getSelectionElementList();let s={},l=[];if(n?.length)l=n,s={isSetCursor:!1};else{const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j&&(l.push(d),s={curIndex:a})}l.length&&(l.forEach(a=>{Kt.forEach(c=>{delete a[c]})}),this.draw.render(s))}font(e,t){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length)s.forEach(l=>{l.font=e}),this.draw.render({isSetCursor:!1});else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?d.font=e:(this.range.setDefaultStyle({font:e}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}size(e,t){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:s,maxSize:l,defaultSize:a}=this.options;if(e<s||e>l)return;let c={},d=[];const h=this.range.getTextLikeSelectionElementList();if(h?.length)d=h,c={isSetCursor:!1};else{const{endIndex:f}=this.range.getRange(),R=this.draw.getElementList()[f];R?.value===j?(d.push(R),c={curIndex:f}):(this.range.setDefaultStyle({size:e}),this.draw.render({curIndex:f,isCompute:!1,isSubmitHistory:!1}))}if(!d.length)return;let u=!1;d.forEach(f=>{!f.size&&e===a||f.size&&f.size===e||(f.size=e,u=!0)}),u&&this.draw.render(c)}sizeAdd(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:n,maxSize:s}=this.options,l=this.range.getTextLikeSelectionElementList();let a={},c=[];if(l?.length)c=l,a={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),f=this.draw.getElementList()[h];if(f?.value===j)c.push(f),a={curIndex:h};else{const g=this.range.getDefaultStyle(),R=g?.size||f.size||n;this.range.setDefaultStyle({size:R+2>s?s:R+2}),this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}}if(!c.length)return;let d=!1;c.forEach(h=>{h.size||(h.size=n),!(h.size>=s)&&(h.size+2>s?h.size=s:h.size+=2,d=!0)}),d&&this.draw.render(a)}sizeMinus(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:n,minSize:s}=this.options,l=this.range.getTextLikeSelectionElementList();let a={},c=[];if(l?.length)c=l,a={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),f=this.draw.getElementList()[h];if(f?.value===j)c.push(f),a={curIndex:h};else{const g=this.range.getDefaultStyle(),R=g?.size||f.size||n;this.range.setDefaultStyle({size:R-2<s?s:R-2}),this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}}if(!c.length)return;let d=!1;c.forEach(h=>{h.size||(h.size=n),!(h.size<=s)&&(h.size-2<s?h.size=s:h.size-=2,d=!0)}),d&&this.draw.render(a)}bold(e){var t;const{isIgnoreDisabledRule:i=!1}=e||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length){const l=s.findIndex(a=>!a.bold);s.forEach(a=>{a.bold=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?d.bold=!d.bold:(this.range.setDefaultStyle({bold:d.bold?!1:!((t=this.range.getDefaultStyle())!=null&&t.bold)}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}italic(e){var t;const{isIgnoreDisabledRule:i=!1}=e||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length){const l=s.findIndex(a=>!a.italic);s.forEach(a=>{a.italic=!!~l}),this.draw.render({isSetCursor:!1})}else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?d.italic=!d.italic:(this.range.setDefaultStyle({italic:d.italic?!1:!((t=this.range.getDefaultStyle())!=null&&t.italic)}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}underline(e,t){var i;const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const l=this.range.getSelectionElementList();if(l?.length){const a=l.some(c=>!c.underline||!e&&c.textDecoration||e&&!c.textDecoration||e&&c.textDecoration&&!Zu(c.textDecoration,e));l.forEach(c=>{c.underline=a,a&&e?c.textDecoration=e:delete c.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let a=!0;const{endIndex:c}=this.range.getRange(),h=this.draw.getElementList()[c];h?.value===j?h.underline=!h.underline:(this.range.setDefaultStyle({underline:h?.underline?!1:!((i=this.range.getDefaultStyle())!=null&&i.underline)}),a=!1),this.draw.render({isSubmitHistory:a,curIndex:c,isCompute:!1})}}strikeout(e){var t;const{isIgnoreDisabledRule:i=!1}=e||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length){const l=s.findIndex(a=>!a.strikeout);s.forEach(a=>{a.strikeout=!!~l}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?d.strikeout=!d.strikeout:(this.range.setDefaultStyle({strikeout:d.strikeout?!1:!((t=this.range.getDefaultStyle())!=null&&t.strikeout)}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}superscript(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const n=this.range.getSelectionElementList();if(!n)return;const s=n.findIndex(l=>l.type===D.SUPERSCRIPT);n.forEach(l=>{~s?l.type===D.SUPERSCRIPT&&(l.type=D.TEXT,delete l.actualSize):(!l.type||l.type===D.TEXT||l.type===D.SUBSCRIPT)&&(l.type=D.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const n=this.range.getSelectionElementList();if(!n)return;const s=n.findIndex(l=>l.type===D.SUBSCRIPT);n.forEach(l=>{~s?l.type===D.SUBSCRIPT&&(l.type=D.TEXT,delete l.actualSize):(!l.type||l.type===D.TEXT||l.type===D.SUPERSCRIPT)&&(l.type=D.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(e,t){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length)s.forEach(l=>{e?l.color=e:delete l.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?e?d.color=e:delete d.color:(this.range.setDefaultStyle({color:e||void 0}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}highlight(e,t){const{isIgnoreDisabledRule:i=!1}=t||{};if(!i&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const s=this.range.getSelectionElementList();if(s?.length)s.forEach(l=>{e?l.highlight=e:delete l.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let l=!0;const{endIndex:a}=this.range.getRange(),d=this.draw.getElementList()[a];d?.value===j?e?d.highlight=e:delete d.highlight:(this.range.setDefaultStyle({highlight:e||void 0}),l=!1),this.draw.render({isSubmitHistory:l,curIndex:a,isCompute:!1})}}title(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return;const s=this.draw.getElementList(),l=i===n?this.range.getRangeParagraphElementList():s.slice(i+1,n+1);if(!l||!l.length)return;const a=pe(),c=this.draw.getOptions().title;l.forEach(u=>{!u.type&&u.value===j||(e?(u.level=e,u.titleId=a,Kr(u)&&(u.size=c[Ur[e]],u.bold=!0)):u.titleId&&(delete u.titleId,delete u.title,delete u.level,delete u.size,delete u.bold))});const d=i===n,h=d?n:i;this.draw.render({curIndex:h,isSetCursor:d})}list(e,t){this.draw.isReadonly()||this.draw.getListParticle().setList(e,t)}rowFlex(e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return;const s=this.range.getRangeRowElementList();if(!s)return;s.forEach(c=>{c.rowFlex=e});const l=i===n,a=l?n:i;this.draw.render({curIndex:a,isSetCursor:l})}rowMargin(e){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return;const s=this.range.getRangeRowElementList();if(!s)return;s.forEach(c=>{c.rowMargin=e});const l=i===n,a=l?n:i;this.draw.render({curIndex:a,isSetCursor:l})}insertTable(e,t){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.tableOperate.insertTable(e,t)}insertTableTopRow(){this.draw.isReadonly()||this.tableOperate.insertTableTopRow()}insertTableBottomRow(){this.draw.isReadonly()||this.tableOperate.insertTableBottomRow()}insertTableLeftCol(){this.draw.isReadonly()||this.tableOperate.insertTableLeftCol()}insertTableRightCol(){this.draw.isReadonly()||this.tableOperate.insertTableRightCol()}deleteTableRow(){this.draw.isReadonly()||this.tableOperate.deleteTableRow()}deleteTableCol(){this.draw.isReadonly()||this.tableOperate.deleteTableCol()}deleteTable(){this.draw.isReadonly()||this.tableOperate.deleteTable()}mergeTableCell(){this.draw.isReadonly()||this.tableOperate.mergeTableCell()}cancelMergeTableCell(){this.draw.isReadonly()||this.tableOperate.cancelMergeTableCell()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(e){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(e)}tableBorderType(e){this.draw.isReadonly()||this.tableOperate.tableBorderType(e)}tableBorderColor(e){this.draw.isReadonly()||this.tableOperate.tableBorderColor(e)}tableTdBorderType(e){this.draw.isReadonly()||this.tableOperate.tableTdBorderType(e)}tableTdSlashType(e){this.draw.isReadonly()||this.tableOperate.tableTdSlashType(e)}tableTdBackgroundColor(e){this.draw.isReadonly()||this.tableOperate.tableTdBackgroundColor(e)}tableSelectAll(){this.tableOperate.tableSelectAll()}hyperlink(e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:n,endIndex:s}=this.range.getRange();if(!~n&&!~s)return;const l=this.draw.getElementList(),{valueList:a,url:c}=e,d=pe(),h=a?.map(g=>({url:c,hyperlinkId:d,value:g.value,type:D.HYPERLINK}));if(!h)return;const u=n+1;$e(l,h,n,{editorOptions:this.options}),this.draw.spliceElementList(l,u,n===s?0:s-n,h);const f=u+h.length-1;this.range.setRange(f,f),this.draw.render({curIndex:f})}getHyperlinkRange(){let e=-1,t=-1;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return null;const s=this.draw.getElementList(),l=s[i];if(l.type!==D.HYPERLINK)return null;let a=i;for(;a>0;){if(s[a].hyperlinkId!==l.hyperlinkId){e=a+1;break}a--}let c=i+1;for(;c<s.length;){if(s[c].hyperlinkId!==l.hyperlinkId){t=c-1;break}c++}return c===s.length&&(t=c-1),!~e||!~t?null:[e,t]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.getHyperlinkRange();if(!t)return;const i=this.draw.getElementList(),[n,s]=t;this.draw.spliceElementList(i,n,s-n+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const l=n-1;this.range.setRange(l,l),this.draw.render({curIndex:l})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.getHyperlinkRange();if(!t)return;const i=this.draw.getElementList(),[n,s]=t;for(let a=n;a<=s;a++){const c=i[a];delete c.type,delete c.url,delete c.hyperlinkId,delete c.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l,isCompute:!1})}editHyperlink(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const i=this.getHyperlinkRange();if(!i)return;const n=this.draw.getElementList(),[s,l]=i;for(let c=s;c<=l;c++){const d=n[c];d.url=e}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:a}=this.range.getRange();this.draw.render({curIndex:a,isCompute:!1})}separator(e){if(this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:n,endIndex:s}=this.range.getRange();if(!~n&&!~s)return;const l=this.draw.getElementList();let a=-1;const c=l[s+1];if(c&&c.type===D.SEPARATOR){if(c.dashArray&&c.dashArray.join()===e.join())return;a=s,c.dashArray=e}else{const d={value:Lr,type:D.SEPARATOR,dashArray:e};$e(l,[d],n,{editorOptions:this.options}),n!==0&&l[n].value===j?(this.draw.spliceElementList(l,n,1,[d]),a=n-1):(this.draw.spliceElementList(l,n+1,0,[d]),a=n)}this.range.setRange(a,a),this.draw.render({curIndex:a})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:D.PAGE_BREAK,value:Lr}])}addWatermark(e){if(this.draw.isReadonly())return;const i=this.draw.getOptions(),{color:n,size:s,opacity:l,font:a,gap:c}=Uo;i.watermark.data=e.data,i.watermark.color=e.color||n,i.watermark.size=e.size||s,i.watermark.opacity=e.opacity||l,i.watermark.font=e.font||a,i.watermark.repeat=!!e.repeat,i.watermark.gap=e.gap||c,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const t=this.draw.getOptions();t.watermark&&t.watermark.data&&(t.watermark=B({},Uo),this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(e){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:i,endIndex:n}=this.range.getRange();if(!~i&&!~n)return null;const{id:s,conceptId:l,value:a,width:c,height:d,imgDisplay:h}=e,u=s||pe();return this.insertElementList([{value:a,width:c,height:d,conceptId:l,id:u,type:D.IMAGE,imgDisplay:h}]),u}search(e){this.searchManager.setSearchKeyword(e),this.draw.render({isSetCursor:!1,isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(e,t){this.draw.getSearch().replace(e,t)}async print(){const{scale:e,printPixelRatio:t,paperDirection:i,width:n,height:s}=this.options;e!==1&&this.draw.setPageScale(1);const l=await this.draw.getDataURL({pixelRatio:t,mode:ce.PRINT});mR(l,{width:n,height:s,direction:i}),e!==1&&this.draw.setPageScale(e)}replaceImageElement(e){const{startIndex:t}=this.range.getRange(),n=this.draw.getElementList()[t];!n||n.type!==D.IMAGE||(n.value=e,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:e}=this.range.getRange(),i=this.draw.getElementList()[e];!i||i.type!==D.IMAGE||Ir(i.value,`${i.id}.png`)}changeImageDisplay(e,t){if(e.imgDisplay===t)return;e.imgDisplay=t;const{startIndex:i,endIndex:n}=this.range.getRange();if(t===re.SURROUND||t===re.FLOAT_TOP||t===re.FLOAT_BOTTOM){const s=this.position.getPositionList(),{pageNo:l,coordinate:{leftTop:a}}=s[i];e.imgFloatPosition={pageNo:l,x:a[0],y:a[1]}}else delete e.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:n})}getImage(e){return this.draw.getDataURL(e)}getOptions(){return this.options}getValue(e){return this.draw.getValue(e)}getValueAsync(e){return this.draw.getWorkerManager().getValue(e)}getAreaValue(e){return this.draw.getArea().getAreaValue(e)}getHTML(){const e=this.options,t=this.draw.getHeaderElementList(),i=this.draw.getOriginalMainElementList(),n=this.draw.getFooterElementList();return{header:yn(t,e).innerHTML,main:yn(i,e).innerHTML,footer:yn(n,e).innerHTML}}getText(){const e=this.draw.getHeaderElementList(),t=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Fn(e),main:Fn(t),footer:Fn(i)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRange(){return Ne(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){var e,t;const i=this.range.getRange(),{startIndex:n,endIndex:s}=i;if(!~n&&!~s)return null;const l=n===s,a=this.range.toString(),c=be(this.range.getSelectionElementList()||[]),d=this.draw.getElementList(),h=ji(d[l?n:n+1],{extraPickAttrs:["id","controlComponent"]}),u=ji(d[s],{extraPickAttrs:["id","controlComponent"]}),f=this.draw.getRowList(),g=this.position.getPositionList(),R=g[n],p=g[s],M=R.pageNo,S=p.pageNo,b=R.rowIndex,P=p.rowIndex,N=f[b],m=f[P];let T=0,y=0;this.draw.getCursor().getHitLineStartIndex()||(T=((e=N.elementList[0])==null?void 0:e.value)===j?R.index-N.startIndex:R.index-N.startIndex+1),R===p?y=T:y=((t=m.elementList[0])==null?void 0:t.value)===j?p.index-m.startIndex:p.index-m.startIndex+1;const x=[],I=this.draw.getOriginalHeight(),V=this.draw.getOriginalPageGap(),F=this.position.getSelectionPositionList();if(F){let W=null,H=0,U=null;for(let K=0;K<F.length;K++){const{rowNo:_,pageNo:J,coordinate:{leftTop:G,rightTop:se},lineHeight:ae}=F[K];W===null||W!==_?(U&&x.push(U),U={x:G[0],y:G[1]+J*(I+V),width:se[0]-G[0],height:ae},W=_,H=G[0]):U.width=se[0]-H,K===F.length-1&&U&&x.push(U)}}else{const H=this.position.getPositionList()[s],{coordinate:{rightTop:U},pageNo:K,lineHeight:_}=H;x.push({x:U[0],y:U[1]+K*(I+V),width:0,height:_})}const L=this.draw.getZone().getZone(),{isTable:w,trIndex:v,tdIndex:X,index:C}=this.position.getPositionContext();let Z=null;if(w){const H=this.draw.getOriginalElementList()[C]||null;H&&(Z=be([H])[0])}let k=null,Q=null,Y=n-1;for(;Y>0;){const W=d[Y],H=d[Y-1];if(W.titleId&&W.titleId!==H?.titleId){k=W.titleId,Q=g[Y].pageNo;break}Y--}return Ne({isCollapsed:l,startElement:h,endElement:u,startPageNo:M,endPageNo:S,startRowNo:b,endRowNo:P,startColNo:T,endColNo:y,rangeRects:x,zone:L,isTable:w,trIndex:v??null,tdIndex:X??null,tableElement:Z,selectionText:a,selectionElementList:c,titleId:k,titleStartPageNo:Q})}getRangeRow(){const e=this.range.getRangeRowElementList();return e?be(e):null}getRangeParagraph(){const e=this.range.getRangeParagraphElementList();return e?be(e):null}getKeywordRangeList(e){return this.range.getKeywordRangeList(e)}getKeywordContext(e){var t,i,n,s;const l=this.getKeywordRangeList(e);if(!l.length)return null;const a=[],c=this.position.getOriginalMainPositionList(),d=this.draw.getOriginalMainElementList();for(let h=0;h<l.length;h++){const u=l[h],{startIndex:f,endIndex:g,tableId:R,startTrIndex:p,startTdIndex:M}=u;let S=c;if(u.tableId){const N=d.find(m=>m.id===R);N&&(S=((s=(n=(i=(t=N.trList)==null?void 0:t[p])==null?void 0:i.tdList)==null?void 0:n[M])==null?void 0:s.positionList)||[])}const b=Ne(S[f]),P=Ne(S[g]);a.push({range:u,startPosition:b,endPosition:P})}return a}pageMode(e){this.draw.setPageMode(e)}pageScale(e){e!==this.options.scale&&this.draw.setPageScale(e)}pageScaleRecovery(){const{scale:e}=this.options;e!==1&&this.draw.setPageScale(1)}pageScaleMinus(){const{scale:e}=this.options,t=e*10-1;t>=5&&this.draw.setPageScale(t/10)}pageScaleAdd(){const{scale:e}=this.options,t=e*10+1;t<=30&&this.draw.setPageScale(t/10)}paperSize(e,t){this.draw.setPaperSize(e,t)}paperDirection(e){this.draw.setPaperDirection(e)}getPaperMargin(){return this.options.margins}setPaperMargin(e){return this.draw.setPaperMargin(e)}setMainBadge(e){this.draw.getBadge().setMainBadge(e),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(e){this.draw.getBadge().setAreaBadgeMap(e),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(e,t={}){if(!e.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:n=!0}=t;n||this.range.shrinkRange();const s=Ne(e),{startIndex:l}=this.range.getRange(),a=this.draw.getElementList();$e(a,s,l,{isBreakWhenWrap:!0,editorOptions:this.options}),this.draw.insertElementList(s,t)}appendElementList(e,t){!e.length||this.draw.isReadonly()||this.draw.appendElementList(Ne(e),t)}updateElementById(e){const{id:t,conceptId:i}=e;if(!t&&!i)return;const n=[];function s(a){let c=0;for(;c<a.length;){const d=a[c];if(c++,d.type===D.TABLE){const h=d.trList;for(let u=0;u<h.length;u++){const f=h[u];for(let g=0;g<f.tdList.length;g++){const R=f.tdList[g];s(R.value)}}}(t&&d.id===t||i&&d.conceptId===i)&&n.push({elementList:a,index:c-1})}}const l=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of l)s(a);if(n.length){for(let a=0;a<n.length;a++){const{elementList:c,index:d}=n[a],h=c[d],u=be([B(B({},h),e.properties)],{extraPickAttrs:["id"]});Ci(Ai,h,u[0]),tt(u,{isHandleFirstElement:!1,editorOptions:this.options}),c[d]=u[0]}this.draw.render({isSetCursor:!1})}}deleteElementById(e){const{id:t,conceptId:i}=e;if(!t&&!i)return;let n=!1;function s(a){let c=0;for(;c<a.length;){const d=a[c];if(d.type===D.TABLE){const h=d.trList;for(let u=0;u<h.length;u++){const f=h[u];for(let g=0;g<f.tdList.length;g++){const R=f.tdList[g];s(R.value)}}}(t&&d.id===t||i&&d.conceptId===i)&&(n=!0,a.splice(c,1),c--),c++}}const l=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const a of l)s(a);n&&this.draw.render({isSetCursor:!1})}getElementById(e){const{id:t,conceptId:i}=e,n=[];if(!t&&!i)return n;const s=a=>{let c=0;for(;c<a.length;){const d=a[c];if(c++,d.type===D.TABLE){const h=d.trList;for(let u=0;u<h.length;u++){const f=h[u];for(let g=0;g<f.tdList.length;g++){const R=f.tdList[g];s(R.value)}}}t&&d.id!==t||i&&d.conceptId!==i||n.push(d)}},l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of l)s(a);return be(n,{extraPickAttrs:["id"]})}setValue(e,t){this.draw.setValue(e,t)}removeControl(e){if(e?.id||e?.conceptId){const{id:t,conceptId:i}=e;let n=!1;const s=a=>{let c=a.length-1;for(;c>=0;){const d=a[c];if(d.type===D.TABLE){const h=d.trList;for(let u=0;u<h.length;u++){const f=h[u];for(let g=0;g<f.tdList.length;g++){const R=f.tdList[g];s(R.value)}}}c--,!(!d.control||t&&d.controlId!==t||i&&d.control.conceptId!==i)&&(n=!0,a.splice(c+1,1))}},l=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const a of l)s(a);n&&this.draw.render({isSetCursor:!1})}else{const{startIndex:t,endIndex:i}=this.range.getRange();if(t!==i||!this.draw.getElementList()[t].controlId)return;const a=this.draw.getControl().removeControl(t);if(a===null)return;this.range.setRange(a,a),this.draw.render({curIndex:a})}}translate(e){return this.i18n.t(e)}setLocale(e){this.i18n.setLocale(e)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(e){var t;const i=this.draw.getOriginalMainElementList();let n=-1;for(let s=0;s<i.length;s++)if(i[s].titleId===e&&((t=i[s+1])==null?void 0:t.titleId)!==e){n=s;break}~n&&(this.position.setPositionContext({isTable:!1}),this.range.setRange(n,n),this.draw.render({curIndex:n,isCompute:!1,isSubmitHistory:!1}))}wordTool(){const e=this.draw.getMainElementList();let t=!1;for(let i=0;i<e.length;i++)if(e[i].value===j)for(;i+1<e.length;){const s=e[i+1];if(s.value!==j&&s.value!==Lo)break;e.splice(i+1,1),t=!0}if(t)this.draw.render({isSetCursor:!1});else{const i=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:i})}}setHTML(e){const{header:t,main:i,footer:n}=e,s=this.draw.getOriginalInnerWidth(),l=a=>a!==void 0?Vn(a,{innerWidth:s}):void 0;this.setValue({header:l(t),main:l(i),footer:l(n)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(e){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(e)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(e){const t=this.draw.getOriginalMainElementList(),i=this.draw.getGroup().getContextByGroupId(t,e);if(!i)return;const{isTable:n,index:s,trIndex:l,tdIndex:a,tdId:c,trId:d,tableId:h,endIndex:u}=i;this.position.setPositionContext({isTable:n,index:s,trIndex:l,tdIndex:a,tdId:c,trId:d,tableId:h}),this.range.setRange(u,u),this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}setZone(e){this.draw.getZone().setZone(e)}getControlValue(e){return this.draw.getControl().getValueById(e)}setControlValue(e){this.draw.getControl().setValueListById([e])}setControlValueList(e){this.draw.getControl().setValueListById(e)}setControlExtension(e){this.draw.getControl().setExtensionListById([e])}setControlExtensionList(e){this.draw.getControl().setExtensionListById(e)}setControlProperties(e){this.draw.getControl().setPropertiesListById([e])}setControlPropertiesList(e){this.draw.getControl().setPropertiesListById(e)}setControlHighlight(e){this.draw.getControl().setHighlightList(e),this.draw.render({isSubmitHistory:!1})}updateOptions(e){const t=Zo(e);Object.entries(t).forEach(([i,n])=>{Reflect.set(this.options,i,n)}),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(e,t){function i(s,l){var a,c,d;let h=0;for(;h<s.length;){const u=s[h];if(h++,u.type===D.TABLE){const g=u.trList;for(let R=0;R<g.length;R++){const p=g[R];for(let M=0;M<p.tdList.length;M++){const S=p.tdList[M],b=i(S.value,l);if(b)return oe(B({},b),{positionContext:{isTable:!0,index:h-1,trIndex:R,tdIndex:M,tdId:u.tdId,trId:u.trId,tableId:u.tableId}})}}}if(u?.controlId!==e)continue;let f=h-1;if(t?.position===pt.OUTER_AFTER){if(!(u.controlComponent===E.POSTFIX&&((a=s[h+1])==null?void 0:a.controlComponent)!==E.POST_TEXT))continue}else if(t?.position===pt.OUTER_BEFORE)f-=1;else if(t?.position===pt.AFTER){if(f-=1,u.controlComponent!==E.PLACEHOLDER&&u.controlComponent!==E.POSTFIX&&u.controlComponent!==E.POST_TEXT)continue}else if(u.controlComponent!==E.PREFIX&&u.controlComponent!==E.PRE_TEXT||((c=s[h])==null?void 0:c.controlComponent)===E.PREFIX||((d=s[h])==null?void 0:d.controlComponent)===E.PRE_TEXT)continue;return{zone:l,range:{startIndex:f,endIndex:f},positionContext:{isTable:!1}}}return null}const n=[{zone:de.HEADER,elementList:this.draw.getHeaderElementList()},{zone:de.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:de.FOOTER,elementList:this.draw.getFooterElementList()}];for(const s of n){const l=i(s.elementList,s.zone);if(l){this.setZone(l.zone),this.position.setPositionContext(l.positionContext),this.range.replaceRange(l.range),this.draw.render({curIndex:l.range.startIndex,isCompute:!1,isSubmitHistory:!1});break}}}insertControl(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const i=Ne(e),{startIndex:n}=this.range.getRange(),s=this.draw.getElementList(),l=Ms(s,n);if(!l)return;const a=[...xn,...Wi,...hs,...Ai];Ci(a,l,i),this.draw.insertElementList([i])}getContainer(){return this.draw.getContainer()}getTitleValue(e){const{conceptId:t}=e,i=[],n=(l,a)=>{var c;let d=0;for(;d<l.length;){const h=l[d];if(d++,h.type===D.TABLE){const g=h.trList;for(let R=0;R<g.length;R++){const p=g[R];for(let M=0;M<p.tdList.length;M++){const S=p.tdList[M];n(S.value,a)}}}if(((c=h?.title)==null?void 0:c.conceptId)!==t)continue;const u=[];let f=d;for(;f<l.length;){const g=l[f];if(f++,h.titleId!==g.titleId){if(g.level&&Do[g.level]<=Do[h.level])break;u.push(g)}}i.push(oe(B({},h.title),{value:Fn(u),elementList:be(u),zone:a})),d=f}},s=[{zone:de.HEADER,elementList:this.draw.getHeaderElementList()},{zone:de.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:de.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:l,elementList:a}of s)n(a,l);return i}getPositionContextByEvent(e,t={}){var i,n,s;const l=(i=e.target)==null?void 0:i.dataset.index;if(!l)return null;const{isMustDirectHit:a=!0}=t,c=Number(l),d=this.position.getPositionByXY({x:e.offsetX,y:e.offsetY,pageNo:c}),{isDirectHit:h,isTable:u,index:f,trIndex:g,tdIndex:R,tdValueIndex:p,zone:M}=d;if(a&&!h||M&&M!==this.zone.getZone())return null;let S=null,b=null;const P=this.draw.getOriginalElementList();let N=null;const m=this.position.getOriginalPositionList();if(u){const y=(n=P[f].trList)==null?void 0:n[g].tdList[R];b=y?.value[p]||null,N=((s=y?.positionList)==null?void 0:s[p])||null,S={element:P[f],trIndex:g,tdIndex:R}}else b=P[f]||null,N=m[f]||null;let T=null;if(N){const{pageNo:y,coordinate:{leftTop:x,rightTop:I},lineHeight:V}=N,F=this.draw.getOriginalHeight(),L=this.draw.getOriginalPageGap();T={x:x[0],y:x[1]+y*(F+L),width:I[0]-x[0],height:V}}return{pageNo:c,element:b,rangeRect:T,tableInfo:S}}insertTitle(e){var t;if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=Ne(e),{startIndex:s}=this.range.getRange(),l=this.draw.getElementList(),a=Ms(l,s);if(!a)return;const c=[...xn,...Wi,...hs,...Ai];(t=n.valueList)==null||t.forEach(d=>{Ci(c,a,d)}),this.draw.insertElementList([n])}focus(e){var t,i;const{position:n=pt.AFTER,isMoveCursorToVisible:s=!0,rowNo:l,range:a}=e||{};let c=-1;if(a)this.range.replaceRange(a),c=n===pt.BEFORE?a.startIndex:a.endIndex;else if(wo(l)){const h=this.draw.getOriginalRowList();if(c=n===pt.BEFORE?(t=h[l])==null?void 0:t.startIndex:((i=h[l+1])==null?void 0:i.startIndex)-1,!wo(c))return;this.range.setRange(c,c)}else c=n===pt.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(c,c);const d={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};if(~c&&this.range.getIsCollapsed()&&(d.curIndex=c,d.isSetCursor=!0),this.draw.render(d),s){const h=this.draw.getPosition().getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:h[c],direction:He.DOWN})}}insertArea(e){return this.draw.getArea().insertArea(e)}setAreaProperties(e){this.draw.getArea().setAreaProperties(e)}locationArea(e){const t=this.draw.getArea().getContextByAreaId(e);if(!t)return;const{range:{endIndex:i},elementPosition:n}=t;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1});const s=this.draw.getCursor();this.position.setCursorPosition(n),s.drawCursor({hitLineStartIndex:i}),s.moveCursorToVisible({cursorPosition:n,direction:He.UP})}}class MR{constructor(){O(this,"rangeStyleChange"),O(this,"visiblePageNoListChange"),O(this,"intersectionPageNoChange"),O(this,"pageSizeChange"),O(this,"pageScaleChange"),O(this,"saved"),O(this,"contentChange"),O(this,"controlChange"),O(this,"controlContentChange"),O(this,"pageModeChange"),O(this,"zoneChange"),this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class NR{constructor(e){O(this,"contextMenuList"),O(this,"getContextMenuList"),O(this,"shortcutList"),O(this,"langMap");const{contextMenu:t,shortcut:i,i18n:n}=e;this.contextMenuList=t.registerContextMenuList.bind(t),this.getContextMenuList=t.getContextMenuList.bind(t),this.shortcutList=i.registerShortcutList.bind(i),this.langMap=n.registerLangMap.bind(n)}}const pa={SELECTED_TEXT:"%s"},kn={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_SURROUND:"imageTextWrapSurround",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_DASH:"tableBorderDash",BORDER_EXTERNAL:"tableBorderExternal",BORDER_INTERNAL:"tableBorderInternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell"}},{CONTROL:{DELETE:bR}}=kn,LR=[{key:bR,i18nPath:"contextmenu.control.delete",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&!!((e=r.startElement)!=null&&e.controlId)&&r.options.mode!==ce.FORM},callback:r=>{r.executeRemoveControl()}}],{GLOBAL:{CUT:OR,COPY:PR,PASTE:TR,SELECT_ALL:IR,PRINT:xR}}=kn,wR=[{key:OR,i18nPath:"contextmenu.global.cut",shortCut:`${vi?"⌘":"Ctrl"} + X`,when:r=>!r.isReadonly,callback:r=>{r.executeCut()}},{key:PR,i18nPath:"contextmenu.global.copy",shortCut:`${vi?"⌘":"Ctrl"} + C`,when:r=>r.editorHasSelection||r.isCrossRowCol,callback:r=>{r.executeCopy()}},{key:TR,i18nPath:"contextmenu.global.paste",shortCut:`${vi?"⌘":"Ctrl"} + V`,when:r=>!r.isReadonly&&r.editorTextFocus,callback:r=>{r.executePaste()}},{key:IR,i18nPath:"contextmenu.global.selectAll",shortCut:`${vi?"⌘":"Ctrl"} + A`,when:r=>r.editorTextFocus,callback:r=>{r.executeSelectAll()}},{isDivider:!0},{key:xR,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:r=>{r.executePrint()}}],{HYPERLINK:{DELETE:yR,CANCEL:VR,EDIT:FR}}=kn,XR=[{key:yR,i18nPath:"contextmenu.hyperlink.delete",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===D.HYPERLINK},callback:r=>{r.executeDeleteHyperlink()}},{key:VR,i18nPath:"contextmenu.hyperlink.cancel",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===D.HYPERLINK},callback:r=>{r.executeCancelHyperlink()}},{key:FR,i18nPath:"contextmenu.hyperlink.edit",when:r=>{var e;return!r.isReadonly&&((e=r.startElement)==null?void 0:e.type)===D.HYPERLINK},callback:(r,e)=>{var t;const i=window.prompt(r.executeTranslate("contextmenu.hyperlink.edit"),(t=e.startElement)==null?void 0:t.url);i&&r.executeEditHyperlink(i)}}],{IMAGE:{CHANGE:CR,SAVE_AS:vR,TEXT_WRAP:WR,TEXT_WRAP_EMBED:kR,TEXT_WRAP_UP_DOWN:DR,TEXT_WRAP_SURROUND:ER,TEXT_WRAP_FLOAT_TOP:UR,TEXT_WRAP_FLOAT_BOTTOM:ZR}}=kn,YR=[{key:CR,i18nPath:"contextmenu.image.change",icon:"image-change",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===D.IMAGE},callback:r=>{const e=document.createElement("input");e.type="file",e.accept=".png, .jpg, .jpeg",e.onchange=()=>{const t=e.files[0],i=new FileReader;i.readAsDataURL(t),i.onload=()=>{const n=i.result;r.executeReplaceImageElement(n)}},e.click()}},{key:vR,i18nPath:"contextmenu.image.saveAs",icon:"image",when:r=>{var e;return!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===D.IMAGE},callback:r=>{r.executeSaveAsImageElement()}},{key:WR,i18nPath:"contextmenu.image.textWrap",when:r=>{var e;return!r.isReadonly&&!r.editorHasSelection&&((e=r.startElement)==null?void 0:e.type)===D.IMAGE},childMenus:[{key:kR,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,re.BLOCK)}},{key:DR,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,re.INLINE)}},{key:ER,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,re.SURROUND)}},{key:UR,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,re.FLOAT_TOP)}},{key:ZR,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(r,e)=>{r.executeChangeImageDisplay(e.startElement,re.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:QR,BORDER_ALL:KR,BORDER_EMPTY:HR,BORDER_DASH:BR,BORDER_EXTERNAL:GR,BORDER_INTERNAL:_R,BORDER_TD:AR,BORDER_TD_TOP:JR,BORDER_TD_LEFT:zR,BORDER_TD_BOTTOM:$R,BORDER_TD_RIGHT:jR,BORDER_TD_BACK:qR,BORDER_TD_FORWARD:ep,VERTICAL_ALIGN:tp,VERTICAL_ALIGN_TOP:ip,VERTICAL_ALIGN_MIDDLE:np,VERTICAL_ALIGN_BOTTOM:sp,INSERT_ROW_COL:op,INSERT_TOP_ROW:lp,INSERT_BOTTOM_ROW:rp,INSERT_LEFT_COL:ap,INSERT_RIGHT_COL:cp,DELETE_ROW_COL:dp,DELETE_ROW:hp,DELETE_COL:up,DELETE_TABLE:fp,MERGE_CELL:gp,CANCEL_MERGE_CELL:Rp}}=kn,pp=[{isDivider:!0},{key:QR,i18nPath:"contextmenu.table.border",icon:"border-all",when:r=>!r.isReadonly&&r.isInTable&&r.options.mode!==ce.FORM,childMenus:[{key:KR,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:r=>{r.executeTableBorderType(ut.ALL)}},{key:HR,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:r=>{r.executeTableBorderType(ut.EMPTY)}},{key:BR,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:r=>{r.executeTableBorderType(ut.DASH)}},{key:GR,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:r=>{r.executeTableBorderType(ut.EXTERNAL)}},{key:_R,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:r=>{r.executeTableBorderType(ut.INTERNAL)}},{key:AR,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:JR,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mt.TOP)}},{key:jR,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mt.RIGHT)}},{key:$R,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mt.BOTTOM)}},{key:zR,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:r=>{r.executeTableTdBorderType(Mt.LEFT)}},{key:ep,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:r=>{r.executeTableTdSlashType($i.FORWARD)}},{key:qR,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:r=>{r.executeTableTdSlashType($i.BACK)}}]}]},{key:tp,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:r=>!r.isReadonly&&r.isInTable&&r.options.mode!==ce.FORM,childMenus:[{key:ip,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Ae.TOP)}},{key:np,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Ae.MIDDLE)}},{key:sp,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:r=>{r.executeTableTdVerticalAlign(Ae.BOTTOM)}}]},{key:op,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:r=>!r.isReadonly&&r.isInTable&&r.options.mode!==ce.FORM,childMenus:[{key:lp,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:r=>{r.executeInsertTableTopRow()}},{key:rp,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:r=>{r.executeInsertTableBottomRow()}},{key:ap,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:r=>{r.executeInsertTableLeftCol()}},{key:cp,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:r=>{r.executeInsertTableRightCol()}}]},{key:dp,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:r=>!r.isReadonly&&r.isInTable&&r.options.mode!==ce.FORM,childMenus:[{key:hp,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:r=>{r.executeDeleteTableRow()}},{key:up,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:r=>{r.executeDeleteTableCol()}},{key:fp,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:r=>{r.executeDeleteTable()}}]},{key:gp,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:r=>!r.isReadonly&&r.isCrossRowCol&&r.options.mode!==ce.FORM,callback:r=>{r.executeMergeTableCell()}},{key:Rp,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:r=>!r.isReadonly&&r.isInTable&&r.options.mode!==ce.FORM,callback:r=>{r.executeCancelMergeTableCell()}}];class mp{constructor(e,t){O(this,"options"),O(this,"draw"),O(this,"command"),O(this,"range"),O(this,"position"),O(this,"i18n"),O(this,"container"),O(this,"contextMenuList"),O(this,"contextMenuContainerList"),O(this,"contextMenuRelationShip"),O(this,"context"),O(this,"_proxyContextMenuEvent",i=>{this.context=this._getContext();const n=this._filterMenuList(this.contextMenuList);n.some(l=>!l.isDivider)&&(this.dispose(),this._render({contextMenuList:n,left:i.x,top:i.y})),i.preventDefault()}),O(this,"_handleSideEffect",i=>{if(this.contextMenuContainerList.length){const n=i?.composedPath()[0]||i.target;cs(n,l=>!!l&&l.nodeType===1&&l.getAttribute(Ni)===ci.CONTEXTMENU)||this.dispose()}}),this.options=e.getOptions(),this.draw=e,this.command=t,this.range=e.getRange(),this.position=e.getPosition(),this.i18n=e.getI18n(),this.container=e.getContainer(),this.context=null,this.contextMenuList=[...wR,...pp,...YR,...LR,...XR],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(e){var t;const{contextMenuDisableKeys:i}=this.options,n=[];for(let s=0;s<e.length;s++){const l=e[s];l.disable||l.key&&i.includes(l.key)||(l.isDivider||(t=l.when)!=null&&t.call(l,this.context))&&n.push(l)}return n}_getContext(){const e=this.draw.isReadonly(),{isCrossRowCol:t,startIndex:i,endIndex:n}=this.range.getRange(),s=!!(~i||~n),l=s&&i!==n,{isTable:a,trIndex:c,tdIndex:d,index:h}=this.position.getPositionContext();let u=null;if(a){const b=this.draw.getOriginalElementList()[h]||null;b&&(u=be([b],{extraPickAttrs:["id"]})[0])}const f=a&&!!t,g=this.draw.getElementList(),R=g[i]||null,p=g[n]||null,M=this.draw.getZone().getZone();return{startElement:R,endElement:p,isReadonly:e,editorHasSelection:l,editorTextFocus:s,isCrossRowCol:f,zone:M,isInTable:a,trIndex:c??null,tdIndex:d??null,tableElement:u,options:this.options}}_createContextMenuContainer(){const e=document.createElement("div");return e.classList.add(`${ie}-contextmenu-container`),e.setAttribute(Ni,ci.CONTEXTMENU),this.container.append(e),e}_render(e){var t;const{contextMenuList:i,left:n,top:s,parentMenuContainer:l}=e,a=this._createContextMenuContainer(),c=document.createElement("div");c.classList.add(`${ie}-contextmenu-content`);let d=null;l&&this.contextMenuRelationShip.set(l,a);for(let S=0;S<i.length;S++){const b=i[S];if(b.isDivider){if(S!==0&&S!==i.length-1&&!((t=i[S-1])!=null&&t.isDivider)){const P=document.createElement("div");P.classList.add(`${ie}-contextmenu-divider`),c.append(P)}}else{const P=document.createElement("div");if(P.classList.add(`${ie}-contextmenu-item`),b.childMenus){const y=this._filterMenuList(b.childMenus);y.some(I=>!I.isDivider)&&(P.classList.add(`${ie}-contextmenu-sub-item`),P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(a);const I=P.getBoundingClientRect(),V=I.left+I.width,F=I.top;d=this._render({contextMenuList:y,left:V,top:F,parentMenuContainer:a})},P.onmouseleave=I=>{(!d||!d.contains(I.relatedTarget))&&this._setHoverStatus(P,!1)})}else P.onmouseenter=()=>{this._setHoverStatus(P,!0),this._removeSubMenu(a)},P.onmouseleave=()=>{this._setHoverStatus(P,!1)},P.onclick=()=>{b.callback&&this.context&&b.callback(this.command,this.context),this.dispose()};const N=document.createElement("i");P.append(N),b.icon&&N.classList.add(`${ie}-contextmenu-${b.icon}`);const m=document.createElement("span"),T=b.i18nPath?this._formatName(this.i18n.t(b.i18nPath)):this._formatName(b.name||"");if(m.append(document.createTextNode(T)),P.append(m),b.shortCut){const y=document.createElement("span");y.classList.add(`${ie}-shortcut`),y.append(document.createTextNode(b.shortCut)),P.append(y)}c.append(P)}}a.append(c),a.style.display="block";const h=window.innerWidth,u=a.getBoundingClientRect(),f=u.width,g=n+f>h?n-f:n;a.style.left=`${g}px`;const R=window.innerHeight,p=u.height,M=s+p>R?s-p:s;return a.style.top=`${M}px`,this.contextMenuContainerList.push(a),a}_removeSubMenu(e){const t=this.contextMenuRelationShip.get(e);t&&(this._removeSubMenu(t),t.remove(),this.contextMenuRelationShip.delete(e))}_setHoverStatus(e,t){var i;t?((i=e.parentNode)==null||i.querySelectorAll(`${ie}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),e.classList.add("hover")):e.classList.remove("hover")}_formatName(e){const t=Object.values(pa),i=new RegExp(`${t.join("|")}`);let n=e;if(i.test(n)){const s=new RegExp(pa.SELECTED_TEXT,"g");if(s.test(n)){const l=this.range.toString();n=n.replace(s,l)}}return n}registerContextMenuList(e){this.contextMenuList.push(...e)}dispose(){this.contextMenuContainerList.forEach(e=>e.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const Sp=[{key:le.X,ctrl:!0,shift:!0,callback:r=>{r.executeStrikeout()}},{key:le.LEFT_BRACKET,mod:!0,callback:r=>{r.executeSizeAdd()}},{key:le.RIGHT_BRACKET,mod:!0,callback:r=>{r.executeSizeMinus()}},{key:le.B,mod:!0,callback:r=>{r.executeBold()}},{key:le.I,mod:!0,callback:r=>{r.executeItalic()}},{key:le.U,mod:!0,callback:r=>{r.executeUnderline()}},{key:vi?le.COMMA:le.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:r=>{r.executeSuperscript()}},{key:vi?le.PERIOD:le.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:r=>{r.executeSubscript()}},{key:le.L,mod:!0,callback:r=>{r.executeRowFlex(Re.LEFT)}},{key:le.E,mod:!0,callback:r=>{r.executeRowFlex(Re.CENTER)}},{key:le.R,mod:!0,callback:r=>{r.executeRowFlex(Re.RIGHT)}},{key:le.J,mod:!0,callback:r=>{r.executeRowFlex(Re.ALIGNMENT)}},{key:le.J,mod:!0,shift:!0,callback:r=>{r.executeRowFlex(Re.JUSTIFY)}}],Mp=[{key:le.ZERO,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(null)}},{key:le.ONE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.FIRST)}},{key:le.TWO,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.SECOND)}},{key:le.THREE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.THIRD)}},{key:le.FOUR,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.FOURTH)}},{key:le.FIVE,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.FIFTH)}},{key:le.SIX,alt:!0,ctrl:!0,callback:r=>{r.executeTitle(Ce.SIXTH)}}],Np=[{key:le.I,shift:!0,mod:!0,callback:r=>{r.executeList(Gt.UL,ht.DISC)}},{key:le.U,shift:!0,mod:!0,callback:r=>{r.executeList(Gt.OL)}}];class bp{constructor(e,t){O(this,"command"),O(this,"globalShortcutList"),O(this,"agentShortcutList"),O(this,"_globalKeydown",n=>{this.globalShortcutList.length&&this._execute(n,this.globalShortcutList)}),this.command=t,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...Sp,...Mp,...Np]),this._addEvent(),e.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(e){for(let t=e.length-1;t>=0;t--){const i=e[t];i.isGlobal?this.globalShortcutList.unshift(i):this.agentShortcutList.unshift(i)}}registerShortcutList(e){this._addShortcutList(e)}_agentKeydown(e){this.agentShortcutList.length&&this._execute(e,this.agentShortcutList)}_execute(e,t){var i;for(let n=0;n<t.length;n++){const s=t[n];if((s.mod?Jt(e)===!!s.mod:e.ctrlKey===!!s.ctrl&&e.metaKey===!!s.meta)&&e.shiftKey===!!s.shift&&e.altKey===!!s.alt&&e.key.toLowerCase()===s.key.toLowerCase()){s.disable||((i=s?.callback)==null||i.call(s,this.command),e.preventDefault());break}}}}class Lp{constructor(e){O(this,"editor"),this.editor=e}use(e,t){e(this.editor,t)}}class Op{constructor(){O(this,"eventHub"),this.eventHub=new Map}on(e,t){if(!e||typeof t!="function")return;const i=this.eventHub.get(e)||new Set;i.add(t),this.eventHub.set(e,i)}emit(e,t){if(!e)return;const i=this.eventHub.get(e);if(i){if(i.size===1)return[...i][0](t);i.forEach(n=>n(t))}}off(e,t){if(!e||typeof t!="function")return;const i=this.eventHub.get(e);i&&i.delete(t)}isSubscribe(e){const t=this.eventHub.get(e);return!!t&&t.size>0}}class Pp{constructor(){O(this,"paste"),O(this,"copy"),O(this,"drop")}}class Tp{constructor(e,t,i={}){O(this,"command"),O(this,"listener"),O(this,"eventBus"),O(this,"override"),O(this,"register"),O(this,"destroy"),O(this,"use");const n=Zo(i);t=Ne(t);let s=[],l=[],a=[];Array.isArray(t)?l=t:(s=t.header||[],l=t.main,a=t.footer||[]),[s,l,a].forEach(g=>{tt(g,{editorOptions:n,isForceCompensation:!0})}),this.listener=new MR,this.eventBus=new Op,this.override=new Pp;const d=new gR(e,n,{header:s,main:l,footer:a},this.listener,this.eventBus,this.override);this.command=new RR(new SR(d));const h=new mp(d,this.command),u=new bp(d,this.command);this.register=new NR({contextMenu:h,shortcut:u,i18n:d.getI18n()}),this.destroy=()=>{d.destroy(),u.removeEvent(),h.removeEvent()};const f=new Lp(this);this.use=f.use.bind(f)}}class Et{options;mask;container;inputList;constructor(e){this.options=e,this.mask=null,this.container=null,this.inputList=[],this._render()}_render(){const{title:e,data:t,onClose:i,onCancel:n,onConfirm:s}=this.options,l=document.createElement("div");l.classList.add("dialog-mask"),l.setAttribute(Ni,ci.COMPONENT),document.body.append(l);const a=document.createElement("div");a.classList.add("dialog-container"),a.setAttribute(Ni,ci.COMPONENT);const c=document.createElement("div");c.classList.add("dialog"),a.append(c);const d=document.createElement("div");d.classList.add("dialog-title");const h=document.createElement("span");h.append(document.createTextNode(e));const u=document.createElement("i");u.onclick=()=>{i&&i(),this._dispose()},d.append(h),d.append(u),c.append(d);const f=document.createElement("div");f.classList.add("dialog-option");for(let M=0;M<t.length;M++){const S=t[M],b=document.createElement("div");if(b.classList.add("dialog-option__item"),S.label){const N=document.createElement("span");N.append(document.createTextNode(S.label)),b.append(N),S.required&&N.classList.add("dialog-option__item--require")}let P;S.type==="select"?(P=document.createElement("select"),S.options?.forEach(N=>{const m=document.createElement("option");m.value=N.value,m.label=N.label,P.append(m)})):S.type==="textarea"?P=document.createElement("textarea"):(P=document.createElement("input"),P.type=S.type),S.width&&(P.style.width=`${S.width}px`),S.height&&(P.style.height=`${S.height}px`),P.name=S.name,P.value=S.value||"",P instanceof HTMLSelectElement||(P.placeholder=S.placeholder||""),b.append(P),f.append(b),this.inputList.push(P)}c.append(f);const g=document.createElement("div");g.classList.add("dialog-menu");const R=document.createElement("button");R.classList.add("dialog-menu__cancel"),R.append(document.createTextNode("取消")),R.type="button",R.onclick=()=>{n&&n(),this._dispose()},g.append(R);const p=document.createElement("button");p.append(document.createTextNode("确定")),p.type="submit",p.onclick=()=>{if(s){const M=this.inputList.map(S=>({name:S.name,value:S.value}));s(M)}this._dispose()},g.append(p),c.append(g),document.body.append(a),this.container=a,this.mask=l}_dispose(){this.mask?.remove(),this.container?.remove()}}function Ip(r){switch(r){case"comment":case"prolog":case"doctype":case"cdata":return{color:"#008000",italic:!0};case"namespace":return{opacity:.7};case"string":return{color:"#A31515"};case"punctuation":case"operator":return{color:"#393A34"};case"url":case"symbol":case"number":case"boolean":case"variable":case"constant":case"inserted":return{color:"#36acaa"};case"atrule":case"keyword":case"attr-value":return{color:"#0000ff"};case"function":return{color:"#b9a40a"};case"deleted":case"tag":return{color:"#9a050f"};case"selector":return{color:"#00009f"};case"important":return{color:"#e90",bold:!0};case"italic":return{italic:!0};case"class-name":case"property":return{color:"#2B91AF"};case"attr-name":case"regex":case"entity":return{color:"#ff0000"};default:return null}}function xp(r){const e=[];function t(i){for(let n=0;n<i.length;n++){const s=i[n];if(typeof s=="string")e.push({content:s});else if(Array.isArray(s.content))t(s.content);else{const{type:l,content:a}=s;typeof a=="string"&&e.push({type:l,content:a,...Ip(l)})}}}return t(r),e}const wp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M6%202.763v7.544l-4.29-3.73zM13%2014v-3a4%204%200%2000-4-4H6V6h3a5%205%200%20015%205v3h-1z'%20fill='%233D4757'/%3e%3c/svg%3e",yp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3%2014v-3a4%204%200%20014-4h3V6H7a5%205%200%2000-5%205v3h1zm7.016-11.282v7.543l4.29-3.73z'%20fill='%233D4757'/%3e%3c/svg%3e",Vp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%202v2.5H4a.5.5%200%2000-.5.5v2a.5.5%200%2000.5.5h9a.5.5%200%2000.5-.5V5a.5.5%200%2000-.5-.5H9.5V2a.5.5%200%2000-.5-.5H8a.5.5%200%2000-.5.5z'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M13%207h1v4h-1z'/%3e%3cpath%20d='M11%2013a2%202%200%20002-2V8.764A3%203%200%20118.764%2013H11z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M1%2013h10v1H1z'/%3e%3cpath%20d='M1%2013a2%202%200%20002-2V8.764A3%203%200%20011%2014v-1z'%20fill='%233D4757'/%3e%3cpath%20fill='%233D4757'%20d='M3%207h1v4H3z'/%3e%3c/g%3e%3c/svg%3e",Fp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M8.213%2013H6.8l6.636-6.636-4.243-4.243-7.07%207.071L5.928%2013H4.515L1.06%209.546a.5.5%200%20010-.707L8.839%201.06a.5.5%200%2001.707%200l4.95%204.95a.5.5%200%20010%20.707L8.213%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M4.536%206.364l4.95%204.95-.707.707-4.95-4.95zM4.521%2013h10.03v1H5.496z'/%3e%3c/g%3e%3c/svg%3e",Xp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3cpath%20d='M12%204V2h1v2h2v1h-2v2h-1V5h-2V4h2z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e",Cp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20fill-rule='nonzero'%20d='M11%204h4v1h-4z'/%3e%3cpath%20d='M6.215%203.29H7.64L11.855%2014H10.52l-1.14-3H4.46l-1.14%203H2L6.215%203.29zM4.85%209.965h4.14L6.965%204.61h-.06L4.85%209.965z'/%3e%3c/g%3e%3c/svg%3e",vp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.131%206.9c2.035%200%202.569-.9%202.569-1.869%200-.968-.64-1.831-2.623-1.831H5.2v3.7h2.931zm.524%205.9c2.045%200%202.545-1.305%202.545-2.3%200-.985-.506-2.4-2.81-2.4H5.2v4.7h3.455zM4%202h4.71c2.367%200%203.19%201.583%203.19%203s-.325%201.852-1.1%202.5c1.2.5%201.569%201.379%201.6%203%20.03%201.606-.586%203.5-3.769%203.5H4V2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Wp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.017%203L8.08%2013H9v1H6v-1h1.182L9%203H8V2h3v1h-.983z'%20fill='%233D4757'/%3e%3c/svg%3e",kp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%202v6a3%203%200%20106%200V2h1v6a4%204%200%2011-8%200V2h1zM4%2013h8v1H4z'%20fill='%233D4757'/%3e%3c/svg%3e",Dp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M10.42%207.903H6.692a9.182%209.182%200%2001-.41-.172%205.54%205.54%200%2001-.814-.447%202.955%202.955%200%2001-.655-.595%202.728%202.728%200%2001-.44-.777%202.877%202.877%200%2001-.162-1.006c0-.472.094-.888.282-1.25.188-.36.453-.663.793-.907s.747-.43%201.22-.558A5.97%205.97%200%20018.063%202c.504%200%20.95.049%201.337.147.387.097.725.23%201.013.398.287.169.53.365.73.59a3.337%203.337%200%2001.772%201.486c.03.13.054.255.073.379h-1.276a2.393%202.393%200%2000-.22-.615%202.315%202.315%200%2000-.59-.724%202.467%202.467%200%2000-.834-.44%203.376%203.376%200%2000-1.005-.146%204.69%204.69%200%2000-.958.097%202.77%202.77%200%2000-.839.314%201.765%201.765%200%2000-.597.566c-.152.233-.229.518-.229.854%200%20.348.086.642.258.884.171.241.401.449.689.622.287.174.615.323.983.448s.749.247%201.142.367c.31.097.62.196.934.297a8.439%208.439%200%2001.973.38zm1.376%201c.175.217.315.466.418.746.105.285.158.612.158.98%200%20.554-.104%201.041-.312%201.462-.207.42-.496.772-.867%201.054-.37.282-.81.495-1.32.64A6.12%206.12%200%20018.205%2014c-.543%200-1.071-.09-1.586-.273a4.44%204.44%200%2001-1.374-.773%203.873%203.873%200%2001-.97-1.217%203.695%203.695%200%2001-.395-1.612h1.27c.028.407.122.78.282%201.12a2.835%202.835%200%20001.581%201.465c.363.138.76.207%201.192.207.387%200%20.758-.042%201.112-.126a2.85%202.85%200%2000.938-.399%202.01%202.01%200%2000.647-.708c.16-.29.241-.642.241-1.054%200-.337-.087-.623-.261-.86a2.333%202.333%200%2000-.69-.61%204.651%204.651%200%2000-.495-.257h2.099z'/%3e%3cpath%20d='M3%207h10v1H3z'/%3e%3c/g%3e%3c/svg%3e",Ep="data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_superscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%206.3V7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.3-.2.6-.5.7-.6.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.3-.2.6l-.9-.1c.1-.4.2-.7.5-.9s.6-.3%201-.3.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5s-.2.4-.4.5c-.1.1-.3.3-.6.5s-.4.4-.4.5c-.1.1-.1.2-.2.3l1.7-.1z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.4%208.5l4%205.5H10L6.7%209.4%203.4%2014H2l4-5.5L2%203h1.4l3.3%204.6L10%203h1.3L7.4%208.5z'/%3e%3c/g%3e%3c/svg%3e",Up="data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_subscript'%3e%3cpath%20id='_x32_'%20class='st0'%20d='M15%2013.3v.7h-3c0-.3.1-.5.3-.8.2-.2.5-.6%201-1%20.4-.3.6-.5.7-.7.1-.2.2-.3.2-.5s-.1-.3-.2-.4c-.1-.1-.2-.1-.4-.1s-.3%200-.4.1-.2.4-.2.7l-.9-.1c.1-.4.2-.7.5-.9.3-.2.6-.3%201-.3s.8.1%201%20.3c.3.2.4.5.4.8%200%20.2%200%20.4-.1.5-.1.2-.2.3-.3.5-.1.1-.3.3-.6.5s-.4.4-.5.4c-.1.1-.1.2-.2.3H15z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M7.2%208.5l4%205.5H9.8L6.5%209.4%203.2%2014H1.8l4-5.5-4-5.5h1.4l3.3%204.6L9.8%203h1.3L7.2%208.5z'/%3e%3c/g%3e%3c/svg%3e",Zp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.997%203.429L6.398%208h3.2L7.997%203.429zM8.497%202L12%2012h-1L9.949%209h-3.9L5%2012H4L7.496%202h1z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Yp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M13.31%205h-1.92a2.203%202.203%200%2000-.39-.034c-.135%200-.27.012-.402.034H10v.18c-.578.256-1%20.714-1%201.214v1.928c0%20.196.117.43.3.658v1.23a3.543%203.543%200%2001-.3-.4V11H8V1h1v4.265C9%204.763%2010%204%2010.942%204c1.19%200%201.92.422%202.367%201zM2%206c-.03-.498-.175-2%202.5-2C7.11%204%207%205%207%206.902V11H5.984v-.993c.38.662-.115.993-1.484.993C2.708%2011%202%209.931%202%209c0-1.428.447-2%202.5-2h1.484c0-1%20.031-2-1.484-2-1.533%200-1.577.485-1.577%201H2zm2.5%202C3.601%208%203%207.768%203%209c0%201.31.438%201%201.5%201%20.617%200%201.484-.665%201.484-1.847V8H4.5z'/%3e%3cpath%20d='M13.085%206.316l-2.814%203a1%201%200%20101.458%201.368l2.815-3a1%201%200%2000-1.459-1.368z'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e",Qp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M14%201a1%201%200%20011%201v12a1%201%200%2001-1%201H2a1%201%200%2001-1-1V2a1%201%200%20011-1h12zm0%201H2v12h12V2z'%20fill-rule='nonzero'/%3e%3cpath%20fill-rule='nonzero'%20d='M4%2011h8v1H4zm0-3h4v1H4zm0-3h2v1H4z'/%3e%3cpath%20d='M9%205h1v4H9z'/%3e%3cpath%20d='M7%205h5v1H7z'/%3e%3c/g%3e%3c/svg%3e",Kp="data:image/svg+xml,%3csvg%20height='16'%20viewBox='0%200%2016%2016'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2zm0-3h8v1H2zm0-3h12v1H2zm0-6h12v1H2zm0%203h8v1H2z'%20fill='%233d4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Hp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm2-3h8v1H4v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm2%203h8v1H4V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Bp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm4-3h8v1H6v-1zM2%207h12v1H2V7zm0-6h12v1H2V1zm4%203h8v1H6V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Gp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2013h12v1H2v-1zm0-3h12v1H2v-1zm0-3h12v1H2V7zm0-6h12v1H2V1zm0%203h12v1H2V4z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",_p="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M2%2010.5H14M2%2013.5H14'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3cpath%20stroke='%233D4757'%20fill='%233D4757'%20d='M14%203.5L12%201.5M14%203.5L12%205.5M14%203.5L2%203.5M4%201.5L2%203.5M2%203.5L4%205.5'%20stroke-linecap='round'%20stroke-linejoin='miter'%3e%3c/path%3e%3c/svg%3e",Ap="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2014h12v1H2v-1zm7-5h5v1H9V9zm0-3h5v1H9V6zM2%201h12v1H2V1zm2.5%203L7%207H2zm0%208L7%209H2z'%20fill='%233D4757'%20fill-rule='evenodd'/%3e%3c/svg%3e",Jp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20fill='%233D4757'%20d='M7%2012h7v1H7zm0-5h7v1H7zm0-5h7v1H7zM3%204V2H2V1h2v3h1v1H2V4h1z'/%3e%3cpath%20d='M2%206h3v1H2V6zm0%203h3v1H2V9z'%20fill='%234F4F4F'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M4.5%206L5%207l-2.5%203L2%209z'/%3e%3cpath%20d='M4%2014l-1-2H2v-1h3v1H4l1%202v1H2v-1h2z'%20fill='%233D4757'/%3e%3c/g%3e%3c/svg%3e",zp="data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_0-公共_x2F_02工具栏_x2F_插入图片-16px-'%3e%3cg%20id='Group-19'%20transform='translate(1%201)'%3e%3cpath%20id='Combined-Shape'%20class='st0'%20d='M1%200h12c.6%200%201%20.4%201%201v11c0%20.6-.4%201-1%201H1c-.6%200-1-.4-1-1V1c0-.6.4-1%201-1zm0%201v11h12V1H1z'/%3e%3ccircle%20id='椭圆形'%20class='st0'%20cx='10'%20cy='4'%20r='1'/%3e%3cpath%20id='Path'%20class='st0'%20d='M8.5%2011.2l-4-4.1L1%2010.7V9.2c1.7-1.6%202.7-2.5%203-2.8.4-.5.7-.4%201%200L8.5%2010%2011%207.3c.4-.5.6-.5%201-.1l2%202.8v1.5l-2.5-3.4-3%203.1z'/%3e%3c/g%3e%3c/g%3e%3c/svg%3e",$p="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20x='.5'%20y='.5'%20width='12'%20height='12'%20rx='1'%20transform='translate(1%201)'%20stroke='%233D4757'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M2%209h12v1H2zm0-4h12v1H2z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M5%201h1v13H5zm4%200h1v13H9z'/%3e%3c/g%3e%3c/svg%3e",jp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='rotate(45%205.5%2013.328)'%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7%206H6V3.515a2.5%202.5%200%2010-5%200V6H0V3.515a3.5%203.5%200%20117%200V6zm0%204v2.5a3.5%203.5%200%2001-7%200V10h1v2.5a2.5%202.5%200%20105%200V10h1z'%20fill-rule='nonzero'/%3e%3crect%20x='3.062'%20y='5.209'%20width='1'%20height='5.5'%20rx='.5'/%3e%3c/g%3e%3c/svg%3e",qp="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M3.9%202.8l2.01%202.506c.2.25.58.25.78%200L8.7%202.799l2.01%202.507c.2.25.58.25.78%200l2.4-2.993-.78-.626-2.01%202.507-2.01-2.507a.5.5%200%2000-.78%200L6.3%204.194%204.29%201.687a.5.5%200%2000-.78%200l-2.4%203%20.78.625L3.9%202.8zM1%208h13v1H1zm0%204h3v1H1zm5%200h3v1H6zm5%200h3v1h-3z'%20fill='%233D4757'/%3e%3c/svg%3e",em="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3crect%20stroke='%233D4757'%20x='2.5'%20y='1.5'%20width='11'%20height='13'%20rx='1'/%3e%3cpath%20d='M4%207h8v1H4V7zm0-2h8v1H4V5zm0%206h8v1H4v-1zm0-2h8v1H4V9z'%20fill='%23909AA9'%20fill-rule='nonzero'/%3e%3cpath%20d='M6%205.623c.36-.354.936-.638%202-.604%201.785.057%202-.008%202%201.894v4.098H8.984v-.993c1.046.662.885.993-.484.993-1.792%200-2.5-1.068-2.5-2%200-1.427.447-2%202.5-2h.484c0-1-.006-1.007-.984-1-.978.008-1.419.437-2%20.437v-.825zm2.5%202.389c-.899%200-1.5-.232-1.5%201%200%201.31.438%201%201.5%201%20.617%200%20.484-.665.484-1.848v-.152H8.5z'%20fill='%233D4757'/%3e%3c/g%3e%3c/svg%3e",tm="data:image/svg+xml,%3csvg%20width='14'%20height='14'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20stroke='%23525C6F'%20stroke-linejoin='round'%20d='M4%204.5L1.5%207%204%209.5M10%204.5L12.5%207%2010%209.5'%3e%3c/path%3e%3crect%20fill='%23525C6F'%20transform='scale(1%20-1)%20rotate(70%2016.711%200)'%20x='2.671'%20y='6.53'%20width='8'%20height='1'%20rx='.2'%3e%3c/rect%3e%3c/g%3e%3c/svg%3e",im="data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:none;stroke:%233d4757}.st1{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_02插入_x2F_分页-16px'%3e%3cpath%20id='矩形'%20class='st0'%20d='M5.5%202.5h7c.6%200%201%20.4%201%201v3c0%20.6-.4%201-1%201h-7c-.6%200-1-.4-1-1v-3c0-.6.4-1%201-1z'/%3e%3cpath%20id='三角形'%20class='st1'%20d='M4%208.5L1%206v5z'/%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.8%209.5H5c-.3%200-.5.2-.5.5v4c0%20.3.2.5.5.5h8c.3%200%20.5-.2.5-.5v-1.8l-2.7-2.7z'/%3e%3cpath%20id='矩形_1_'%20class='st1'%20d='M10%2010h1v3h-1z'/%3e%3cpath%20id='矩形-copy-2'%20class='st1'%20d='M10%2012h3v1h-3z'/%3e%3c/g%3e%3c/svg%3e",nm="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M9.793%201.5H3a.5.5%200%2000-.5.5v12a.5.5%200%2000.5.5h9a.5.5%200%2000.5-.5V4.207L9.793%201.5z'%20stroke='%233D4757'/%3e%3cg%20fill='%233D4757'%3e%3cpath%20d='M7%207h1v5H7z'/%3e%3cpath%20d='M5%207h5v1H5z'/%3e%3c/g%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M9%202h1v3H9z'/%3e%3cpath%20fill='%233D4757'%20fill-rule='nonzero'%20d='M9%204h3v1H9z'/%3e%3c/g%3e%3c/svg%3e",sm="data:image/svg+xml,%3csvg%20version='1.1'%20id='图层_1'%20xmlns='http://www.w3.org/2000/svg'%20x='0'%20y='0'%20viewBox='0%200%2016%2016'%20xml:space='preserve'%3e%3cstyle%3e.st0{fill:%233d4757}%3c/style%3e%3cg%20id='_x30_1-文字_x2F_01开始_x2F_任务列表-16px'%3e%3cpath%20id='合并形状'%20class='st0'%20d='M10.1%202H2v11h11V8.7l1-1V13c0%20.6-.4%201-1%201H2c-.6%200-1-.4-1-1V2c0-.6.4-1%201-1h9.1l-1%201z'/%3e%3cpath%20id='路径'%20class='st0'%20d='M7.7%208.5l5.7-5.8.9.8-6.1%205.9-.5.5-3.9-3.4.8-.7z'/%3e%3c/g%3e%3c/svg%3e",om="data:image/svg+xml,%3csvg%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='12'%20cy='12'%20r='10'%20stroke='%233d4757'%20stroke-width='1.5'%20fill='none'%20/%3e%3ccircle%20cx='12'%20cy='12'%20r='3.5'%20fill='%233d4757'%20/%3e%3c/svg%3e",lm="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3cpath%20d='M9%2013.5H2.982a.5.5%200%2001-.404-.794l3.208-4.412a.5.5%200%20000-.588L2.578%203.294a.5.5%200%2001.404-.794H9'%20stroke='%233D4757'/%3e%3cpath%20d='M14.447%207l.809.588-2.139%202.942%202.139%202.942-.81.588-1.946-2.68-1.947%202.68-.809-.588%202.138-2.942-2.138-2.942.81-.588L12.5%209.679%2014.447%207z'%20fill='%233D4757'/%3e%3c/g%3e%3c/svg%3e",rm="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M7.5%2014.154a5.654%205.654%200%20100-11.308%205.654%205.654%200%20000%2011.308zm0%20.846a6.5%206.5%200%20110-13%206.5%206.5%200%20010%2013z'%20fill-rule='nonzero'/%3e%3cpath%20d='M8%208h4v1H7V4h1v4z'/%3e%3c/g%3e%3c/svg%3e",am="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%3e%3cpath%20d='M8.923%2011v1h-2A2%202%200%20015%2010.55c.328-.15.638-.335.923-.55a1%201%200%20001%201h2zm0-6h-2a1%201%200%2000-1%201A4.997%204.997%200%20005%205.45%202%202%200%20016.923%204h2v1z'/%3e%3cpath%20d='M4%2010a2%202%200%20100-4%202%202%200%20000%204zm0%201a3%203%200%20110-6%203%203%200%20010%206zm6-9a1%201%200%2000-1%201v3a1%201%200%20001%201h3a1%201%200%20001-1V3a1%201%200%2000-1-1h-3zm0-1h3a2%202%200%20012%202v3a2%202%200%2001-2%202h-3a2%202%200%2001-2-2V3a2%202%200%20012-2zm0%2010a1%201%200%2000-1%201v1a1%201%200%20001%201h3a1%201%200%20001-1v-1a1%201%200%2000-1-1h-3zm0-1h3a2%202%200%20012%202v1a2%202%200%2001-2%202h-3a2%202%200%2001-2-2v-1a2%202%200%20012-2z'/%3e%3c/g%3e%3c/svg%3e",cm="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='none'%20fill-rule='evenodd'%3e%3ccircle%20stroke='%233D4757'%20cx='6'%20cy='6'%20r='4.5'/%3e%3cpath%20d='M10.061%2010.968L8.707%209.414l.707-.707%201.514%201.457.435-.404%202.632%202.462a1.154%201.154%200%2001.05%201.635%201.184%201.184%200%2001-1.655.064l-2.788-2.527.46-.426z'%20fill='%233D4757'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e",dm="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%233D4757'%20fill-rule='evenodd'%3e%3cpath%20d='M12%204h-1V2H5v2H4V2a1%201%200%20011-1h6a1%201%200%20011%201v2zm0%205v4a1%201%200%2001-1%201H5a1%201%200%2001-1-1V9h1v4h6V9h1z'/%3e%3cpath%20d='M12%2012v-1h2V5H2v6h2v1H2a1%201%200%2001-1-1V5a1%201%200%20011-1h12a1%201%200%20011%201v6a1%201%200%2001-1%201h-2z'/%3e%3cpath%20d='M3%208h10v1H3zm8-2h2v1h-2z'/%3e%3c/g%3e%3c/svg%3e",ma="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h118v1H4z'%20fill-rule='evenodd'/%3e%3c/svg%3e",hm="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h118v1H4zm0%203h118v1H4z'/%3e%3c/svg%3e",Sa="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h4v1H4zm5%200h4v1H9zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h4v1h-4zm5%200h3v1h-3z'%20fill-rule='evenodd'/%3e%3c/svg%3e",Ma="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h1v1H4zm12%200h1v1h-1zM6%2010h1v1H6zm12%200h1v1h-1zM8%2010h1v1H8zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm2%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm2%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm2%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm2%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1zm12%200h1v1h-1zm-10%200h1v1h-1z'%20fill-rule='evenodd'/%3e%3c/svg%3e",um="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='none'%20stroke='%23000000'%20d='M4%2010%20Q6%208,8%2010%20T12%2010%20T16%2010%20T20%2010%20T24%2010%20T28%2010%20T32%2010%20T36%2010%20T40%2010%20T44%2010%20T48%2010%20T52%2010%20T56%2010%20T60%2010%20T64%2010%20T68%2010%20T72%2010%20T76%2010%20T80%2010%20T84%2010%20T88%2010%20T92%2010%20T96%2010%20T100%2010%20T104%2010%20T108%2010%20T112%2010%20T116%2010%20T120%2010%20T124%2010'/%3e%3c/svg%3e",fm="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5%2010h4v1H5zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4zm8%200h4v1h-4z'%20fill-rule='evenodd'/%3e%3c/svg%3e",gm="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h6v1H4zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3zm6%200h6v1h-6zm9%200h3v1h-3z'%20fill-rule='evenodd'/%3e%3c/svg%3e",Rm="data:image/svg+xml,%3csvg%20width='126'%20height='20'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4%2010h5v1H4zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2zm4%200h5v1h-5zm7%200h2v1h-2zm4%200h2v1h-2z'%20fill-rule='evenodd'/%3e%3c/svg%3e",pm="data:image/svg+xml,%3csvg%20width='4'%20height='7'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%236F6F6F'%20d='M0%203.5L4%200v7z'%20fill-rule='evenodd'/%3e%3c/svg%3e",mm="data:image/svg+xml,%3csvg%20width='4'%20height='7'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill='%236F6F6F'%20d='M4%203.5L0%200v7z'%20fill-rule='evenodd'/%3e%3c/svg%3e",Sm=["title"],Mm=["title"],Nm={class:"options"},bm=["title"],Lm={class:"options"},Om={class:"options"},Pm=["title"],Tm=["title"],Im=["title"],xm=["title"],wm=["title"],ym={class:"options"},Vm={class:"options"},Fm={class:"options"},Xm={class:"options"},Cm={class:"options"},vm={class:"menu-item__search__collapse__search"},Wm={class:"arrow-left"},km={class:"arrow-right"},Dm=Le(o.defineComponent({__name:"toolbar",props:{items:{type:Array,default(){return["simple"]}},editor:{type:Object}},setup(r,{expose:e}){const t=r,i=o.ref(),n=o.computed(()=>{let F=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Watermark","Codeblock","PageBreak","Control","Checkbox","Radio","Latex","Date","Block","Divider","Search","SearchCollapse","Print"];return t.items&&(t.items.length>1?F=t.items:t.items[0]=="simple"&&(F=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Codeblock","Divider","Search","SearchCollapse","Print"])),F});function s(){return i.value?.clientHeight}function l(){return i.value?.clientWidth}const a=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent);function c(F,L){console.log("exec cmd "+F+",params:",L),F!="Separator"&&Array.isArray(L)?t.editor?.command["execute"+F](L[0],L[1]):t.editor?.command["execute"+F](L)}function d(F,L){const w=L.target.getBoundingClientRect(),v=i.value.querySelector("."+F+" .options");v.classList.toggle("visible"),v.style.top=w.height+w.top+"px"}let h=!0,u;function f(){h?(h=!1,u=window.setTimeout(()=>{h=!0,t.editor?.command.executePainter({isDblclick:!1})},200)):window.clearTimeout(u)}function g(){h=!0,window.clearTimeout(u),t.editor?.command.executePainter({isDblclick:!0})}function R(){new Et({title:"LaTeX",data:[{type:"textarea",height:100,name:"value",placeholder:"请输入LaTeX文本"}],onConfirm:F=>{const L=F.find(w=>w.name==="value")?.value;L&&t.editor?.command.executeInsertElementList([{type:D.LATEX,value:L}])}})}function p(F){t.editor?.command.executeInsertElementList([{type:F,checkbox:{value:!1},value:""}])}function M(F,L){const w=L.target.getBoundingClientRect(),v=i.value.querySelector("."+F+" .options");v.classList.toggle("visible"),v.style.top=w.height+w.top+"px";const X=oh();v.firstChild.childNodes.forEach(C=>{const Z=C.attributes.getNamedItem("label-format").value;C.innerText=X.format(Z),C.onclick=()=>{t.editor?.command.executeInsertElementList([{type:D.DATE,dateFormat:C.attributes.getNamedItem("data-format").value,valueList:[{value:C.innerText.trim()}]}])}})}function S(){new Et({title:"内容块",data:[{type:"select",label:"类型",name:"type",value:"iframe",required:!0,options:[{label:"网址",value:"iframe"},{label:"视频",value:"video"}]},{type:"number",label:"宽度",name:"width",placeholder:"请输入宽度(默认页面内宽度)"},{type:"number",label:"高度",name:"height",required:!0,placeholder:"请输入高度"},{type:"input",label:"地址",name:"src",required:!1,placeholder:"请输入地址"},{type:"textarea",label:"HTML",height:100,name:"srcdoc",required:!1,placeholder:"请输入HTML代码(仅网址类型有效)"}],onConfirm:F=>{const L=F.find(Q=>Q.name==="type")?.value;if(!L)return;const w=F.find(Q=>Q.name==="width")?.value,v=F.find(Q=>Q.name==="height")?.value;if(!v)return;const X=F.find(Q=>Q.name==="src")?.value,C=F.find(Q=>Q.name==="srcdoc")?.value,Z={type:L};if(Z.type===_t.IFRAME){if(!X&&!C)return;Z.iframeBlock={src:X,srcdoc:C}}else if(Z.type===_t.VIDEO){if(!X)return;Z.videoBlock={src:X}}const k={type:D.BLOCK,value:"",height:Number(v),block:Z};w&&(k.width=Number(w)),t.editor?.command.executeInsertElementList([k])}})}function b(F){const L=F.target.getBoundingClientRect(),w=i.value.querySelector(".menu-item__table__collapse");w.style.display="block",w.style.top=L.height+L.top+"px",w.style.left=L.left-270/2+"px";const v=i.value.querySelector(".menu-item__table__collapse .table-close"),X=i.value.querySelector(".menu-item__table__collapse .table-select"),C=i.value.querySelector(".menu-item__table__collapse .table-panel"),Z=[];i.value.querySelector(".menu-item__table__collapse .table-panel table").firstChild.childNodes.forEach(Y=>{Z.push(Y.childNodes)});let k=0,Q=0;C.onmousemove=Y=>{const{offsetX:K,offsetY:_}=Y;Z.forEach(J=>{J.forEach(G=>{G.classList.remove("active")})}),k=Math.ceil(K/22)||1,Q=Math.ceil(_/26)||1,Z.forEach((J,G)=>{J.forEach((se,ae)=>{ae<k&&G<Q&&se.classList.add("active")})}),X.innerText=`${Q}×${k}`},C.onclick=()=>{w.style.display="none",t.editor?.command.executeInsertTable(Q,k)},v.onclick=Y=>{Y.stopPropagation(),w.style.display="none"}}function P(){const F=i.value.querySelector(".menu-item__image .image");F.click(),F.onchange=function(){const L=F.files[0],w=new FileReader;w.readAsDataURL(L),w.onload=function(){const v=new Image,X=w.result;v.src=X,v.onload=function(){t.editor?.command.executeImage({value:X,width:v.width,height:v.height}),F.value=""}}}}function N(){new Et({title:"超链接",data:[{type:"text",label:"文本",name:"name",required:!0,placeholder:"请输入文本",value:t.editor?.command.getRangeText()},{type:"text",label:"链接",name:"url",required:!0,placeholder:"请输入链接"}],onConfirm:F=>{const L=F.find(v=>v.name==="name")?.value;if(!L)return;const w=F.find(v=>v.name==="url")?.value;w&&t.editor?.command.executeHyperlink({type:D.HYPERLINK,value:"",url:w,valueList:mt(L).map(v=>({value:v,size:16}))})}})}function m(F){F==="add"?new Et({title:"水印",data:[{type:"text",label:"内容",name:"data",required:!0,placeholder:"请输入内容"},{type:"color",label:"颜色",name:"color",required:!0,value:"#AEB5C0"},{type:"number",label:"字体大小",name:"size",required:!0,value:"120"},{type:"number",label:"透明度",name:"opacity",required:!0,value:"0.3"},{type:"select",label:"重复",name:"repeat",value:"0",required:!1,options:[{label:"不重复",value:"0"},{label:"重复",value:"1"}]},{type:"number",label:"水平间隔",name:"horizontalGap",required:!1,value:"10"},{type:"number",label:"垂直间隔",name:"verticalGap",required:!1,value:"10"}],onConfirm:L=>{if(~L.findIndex(C=>!C.value))return;const v=L.reduce((C,Z)=>(C[Z.name]=Z.value,C),{}),X=v.repeat==="1";t.editor?.command.executeAddWatermark({data:v.data,color:v.color,size:Number(v.size),opacity:Number(v.opacity),repeat:X,gap:X&&v.horizontalGap&&v.verticalGap?[Number(v.horizontalGap),Number(v.verticalGap)]:void 0})}}):t.editor?.command.executeDeleteWatermark()}function T(){new Et({title:"代码块",data:[{type:"textarea",name:"codeblock",placeholder:"请输入代码",width:500,height:300}],onConfirm:F=>{const L=F.find(C=>C.name==="codeblock")?.value;if(!L)return;const w=gr.tokenize(L,gr.languages.javascript),v=xp(w),X=[];for(let C=0;C<v.length;C++){const Z=v[C],k=mt(Z.content);for(let Q=0;Q<k.length;Q++){const W={value:k[Q]};Z.color&&(W.color=Z.color),Z.bold&&(W.bold=!0),Z.italic&&(W.italic=!0),X.push(W)}}X.unshift({value:`
96
+ `}),t.editor?.command.executeInsertElementList(X)}})}function y(F){const L=F.target.getBoundingClientRect(),w=i.value.querySelector(".menu-item__search__collapse");w.style.display="block",w.style.top=L.height+L.top+"px",w.style.left=L.left-260/2+"px";const v=i.value.querySelector(".menu-item__search__collapse__search input"),X=i.value.querySelector(".menu-item__search__collapse__replace input"),C=w.querySelector(".search-result");v.focus();const Z=()=>{const k=t.editor?.command.getSearchNavigateInfo();if(k){const{index:Q,count:Y}=k;C.innerText=`${Q}/${Y}`}else C.innerText=""};w.querySelector("span").onclick=()=>{w.style.display="none",v.value="",X.value="",t.editor?.command.executeSearch(null),Z()},v.oninput=()=>{t.editor?.command.executeSearch(v.value||null),Z()},v.onkeydown=k=>{k.key==="Enter"&&(t.editor?.command.executeSearch(v.value||null),Z())},w.querySelector("button").onclick=()=>{const k=v.value,Q=X.value;k&&Q&&k!==Q&&t.editor?.command.executeReplace(Q)},w.querySelector(".arrow-left").onclick=()=>{t.editor?.command.executeSearchNavigatePre(),Z()},w.querySelector(".arrow-right").onclick=()=>{t.editor?.command.executeSearchNavigateNext(),Z()}}function x(){const F=i.value.querySelector(".menu-item__color .input-color");F.oninput=function(){t.editor?.command.executeColor(F.value)},F.click()}function I(){const F=i.value.querySelector(".menu-item__highlight .input-highlight");F.oninput=function(){t.editor?.command.executeHighlight(F.value)},F.click()}function V(F){switch(F){case he.TEXT:new Et({title:"文本控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"}],onConfirm:L=>{const w=L.find(X=>X.name==="placeholder")?.value;if(!w)return;const v=L.find(X=>X.name==="value")?.value||"";t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,value:v?[{value:v}]:null,placeholder:w}})}});break;case he.SELECT:new Et({title:"列举控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
97
+ [{
98
+ "value":"有",
99
+ "code":"98175"
100
+ }]`}],onConfirm:L=>{const w=L.find(C=>C.name==="placeholder")?.value;if(!w)return;const v=L.find(C=>C.name==="valueSets")?.value;if(!v)return;const X=L.find(C=>C.name==="code")?.value;t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,code:X,value:null,placeholder:w,valueSets:JSON.parse(v)}})}});break;case he.CHECKBOX:new Et({title:"复选框控件",data:[{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值,多个值以英文逗号分割"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
101
+ [{
102
+ "value":"有",
103
+ "code":"98175"
104
+ }]`}],onConfirm:L=>{const w=L.find(X=>X.name==="valueSets")?.value;if(!w)return;const v=L.find(X=>X.name==="code")?.value;t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,code:v,value:null,valueSets:JSON.parse(w)}})}});break;case he.RADIO:new Et({title:"单选框控件",data:[{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
105
+ [{
106
+ "value":"有",
107
+ "code":"98175"
108
+ }]`}],onConfirm:L=>{const w=L.find(X=>X.name==="valueSets")?.value;if(!w)return;const v=L.find(X=>X.name==="code")?.value;t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,code:v,value:null,valueSets:JSON.parse(w)}})}});break;case he.DATE:new Et({title:"日期控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"},{type:"select",label:"日期格式",name:"dateFormat",value:"yyyy-MM-dd hh:mm:ss",required:!0,options:[{label:"yyyy-MM-dd hh:mm:ss",value:"yyyy-MM-dd hh:mm:ss"},{label:"yyyy-MM-dd",value:"yyyy-MM-dd"}]}],onConfirm:L=>{const w=L.find(C=>C.name==="placeholder")?.value;if(!w)return;const v=L.find(C=>C.name==="value")?.value||"",X=L.find(C=>C.name==="dateFormat")?.value||"";t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,dateFormat:X,value:v?[{value:v}]:null,placeholder:w}})}});break;case he.NUMBER:new Et({title:"数值控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"}],onConfirm:L=>{const w=L.find(X=>X.name==="placeholder")?.value;if(!w)return;const v=L.find(X=>X.name==="value")?.value||"";t.editor?.command.executeInsertControl({type:D.CONTROL,value:"",control:{type:F,value:v?[{value:v}]:null,placeholder:w}})}});break}}return o.onMounted(()=>{window.addEventListener("click",F=>{const L=i.value?.querySelector(".visible");!L||L.contains(F.target)||L.classList.remove("visible")},{capture:!0}),t.editor&&(t.editor.listener.rangeStyleChange=F=>{if(console.log("style change:"+F.type,F),F.type===D.TEXT){const L=i.value,w=L.querySelector(".menu-item__font .select");w&&(w.textContent=F.font);const v=L.querySelector(".menu-item__size .select");if(v){const U={56:"初号",48:"小初",34:"一号",32:"小一",29:"二号",24:"小二",21:"三号",20:"小三",18:"四号",16:"小四",14:"五号",12:"小五",10:"六号",8:"小六",7:"七号",6:"八号"};v.textContent=U[F.size]||"小四"}const X=L.querySelector(".menu-item__bold");X&&X.classList.toggle("active",F.bold);const C=L.querySelector(".menu-item__italic");C&&C.classList.toggle("active",F.italic);const Z=L.querySelector(".menu-item__underline");Z&&Z.classList.toggle("active",F.underline);const k=L.querySelector(".menu-item__strikeout");k&&k.classList.toggle("active",F.strikeout);const Q=L.querySelector(".menu-item__color span");Q&&(Q.style.backgroundColor=F.color||"#000000");const Y=L.querySelector(".menu-item__highlight span");Y&&(Y.style.backgroundColor=F.highlight);const W=L.querySelector(".menu-item__title .select");if(W){const U={null:"正文",first:"标题1",second:"标题2",third:"标题3",fourth:"标题4",fifth:"标题5",sixth:"标题6"};W.textContent=U[F.level]||"正文"}["left","center","right","alignment","justify"].forEach(U=>{const K=L.querySelector(`.menu-item__${U}`);K&&K.classList.toggle("active",F.rowFlex===U)})}})}),e({getHeight:s,getWidth:l}),(F,L)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"dom",ref:i,class:"unione-rich-toolbar menu","editor-component":"menu"},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,(w,v)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[w=="Undo"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__undo",key:w,title:`撤销(${o.unref(a)?"⌘":"Ctrl"}+Z)`,onClick:L[0]||(L[0]=X=>c("Undo"))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(wp)})`})},null,4)],8,Sm)):o.createCommentVNode("",!0),w=="Redo"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__redo",key:w,title:`重做(${o.unref(a)?"⌘":"Ctrl"}+Y)`,onClick:L[1]||(L[1]=X=>c("Redo"))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(yp)})`})},null,4)],8,Mm)):o.createCommentVNode("",!0),w=="Painter"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__painter",key:w,title:"格式刷(双击可连续使用)",onClick:f,onDblclick:g},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Vp)})`})},null,4)],32)):o.createCommentVNode("",!0),w=="Format"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__format",key:w,title:"清除格式",onClick:L[2]||(L[2]=X=>c("Format")),"data-item":"Format"},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Fp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Divider"?(o.openBlock(),o.createElementBlock("div",{class:"menu-divider",key:w+v,"data-item":"Divider"})):o.createCommentVNode("",!0),w=="Font"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__font",onClick:L[19]||(L[19]=X=>d("menu-item__font",X)),style:{display:"none"},key:w},[L[98]||(L[98]=o.createElementVNode("span",{class:"select",title:"字体"},"微软雅黑",-1)),o.createElementVNode("div",{class:"options",ref_for:!0,ref:"fontOptions"},[o.createElementVNode("ul",null,[o.createElementVNode("li",{onClick:L[3]||(L[3]=X=>c("Font","Microsoft YaHei")),style:{"font-family":"'Microsoft YaHei'"}}," 微软雅黑 "),o.createElementVNode("li",{onClick:L[4]||(L[4]=X=>c("Font","华文宋体")),style:{"font-family":"'华文宋体'"}}," 华文宋体 "),o.createElementVNode("li",{onClick:L[5]||(L[5]=X=>c("Font","华文黑体")),style:{"font-family":"'华文黑体'"}}," 华文黑体 "),o.createElementVNode("li",{onClick:L[6]||(L[6]=X=>c("Font","华文仿宋")),style:{"font-family":"'华文仿宋'"}}," 华文仿宋 "),o.createElementVNode("li",{onClick:L[7]||(L[7]=X=>c("Font","华文楷体")),style:{"font-family":"'华文楷体'"}}," 华文楷体 "),o.createElementVNode("li",{onClick:L[8]||(L[8]=X=>c("Font","华文琥珀")),style:{"font-family":"'华文琥珀'"}}," 华文琥珀 "),o.createElementVNode("li",{onClick:L[9]||(L[9]=X=>c("Font","华文楷体")),style:{"font-family":"'华文楷体'"}}," 华文楷体 "),o.createElementVNode("li",{onClick:L[10]||(L[10]=X=>c("Font","华文隶书")),style:{"font-family":"'华文隶书'"}}," 华文隶书 "),o.createElementVNode("li",{onClick:L[11]||(L[11]=X=>c("Font","华文新魏")),style:{"font-family":"'华文新魏'"}}," 华文新魏 "),o.createElementVNode("li",{onClick:L[12]||(L[12]=X=>c("Font","华文行楷")),style:{"font-family":"'华文行楷'"}}," 华文行楷 "),o.createElementVNode("li",{onClick:L[13]||(L[13]=X=>c("Font","华文中宋")),style:{"font-family":"'华文中宋'"}}," 华文中宋 "),o.createElementVNode("li",{onClick:L[14]||(L[14]=X=>c("Font","华文彩云")),style:{"font-family":"'华文彩云'"}}," 华文彩云 "),o.createElementVNode("li",{onClick:L[15]||(L[15]=X=>c("Font","Arial")),style:{"font-family":"'Arial'"}},"Arial"),o.createElementVNode("li",{onClick:L[16]||(L[16]=X=>c("Font","Segoe UI")),style:{"font-family":"'Segoe UI'"}}," Segoe UI "),o.createElementVNode("li",{onClick:L[17]||(L[17]=X=>c("Font","Ink Free")),style:{"font-family":"'Ink Free'"}}," Ink Free "),o.createElementVNode("li",{onClick:L[18]||(L[18]=X=>c("Font","Fantasy")),style:{"font-family":"'Fantasy'"}},"Fantasy")])],512)])):o.createCommentVNode("",!0),w=="Size"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__size",onClick:L[36]||(L[36]=X=>d("menu-item__size",X)),key:w},[L[99]||(L[99]=o.createElementVNode("span",{class:"select",title:"字体"},"小四",-1)),o.createElementVNode("div",Nm,[o.createElementVNode("ul",null,[o.createElementVNode("li",{onClick:L[20]||(L[20]=X=>c("Size",56))},"初号"),o.createElementVNode("li",{onClick:L[21]||(L[21]=X=>c("Size",48))},"小初"),o.createElementVNode("li",{onClick:L[22]||(L[22]=X=>c("Size",34))},"一号"),o.createElementVNode("li",{onClick:L[23]||(L[23]=X=>c("Size",32))},"小一"),o.createElementVNode("li",{onClick:L[24]||(L[24]=X=>c("Size",29))},"二号"),o.createElementVNode("li",{onClick:L[25]||(L[25]=X=>c("Size",24))},"小二"),o.createElementVNode("li",{onClick:L[26]||(L[26]=X=>c("Size",21))},"三号"),o.createElementVNode("li",{onClick:L[27]||(L[27]=X=>c("Size",20))},"小三"),o.createElementVNode("li",{onClick:L[28]||(L[28]=X=>c("Size",18))},"四号"),o.createElementVNode("li",{onClick:L[29]||(L[29]=X=>c("Size",16))},"小四"),o.createElementVNode("li",{onClick:L[30]||(L[30]=X=>c("Size",14))},"五号"),o.createElementVNode("li",{onClick:L[31]||(L[31]=X=>c("Size",12))},"小五"),o.createElementVNode("li",{onClick:L[32]||(L[32]=X=>c("Size",10))},"六号"),o.createElementVNode("li",{onClick:L[33]||(L[33]=X=>c("Size",8))},"小六"),o.createElementVNode("li",{onClick:L[34]||(L[34]=X=>c("Size",7))},"七号"),o.createElementVNode("li",{onClick:L[35]||(L[35]=X=>c("Size",6))},"八号")])])])):o.createCommentVNode("",!0),w=="SizeAdd"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__size-add",onClick:L[37]||(L[37]=X=>c("SizeAdd")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Xp)})`})},null,4)])):o.createCommentVNode("",!0),w=="SizeMinus"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__size-minus",onClick:L[38]||(L[38]=X=>c("SizeMinus")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Cp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Bold"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__bold",onClick:L[39]||(L[39]=X=>c("Bold")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(vp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Italic"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__italic",onClick:L[40]||(L[40]=X=>c("Italic")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Wp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Underline"?(o.openBlock(),o.createElementBlock("div",{title:`下划线(${o.unref(a)?"⌘":"Ctrl"}+U)`,class:"menu-item menu-item__underline",onClick:L[46]||(L[46]=X=>d("menu-item__underline",X)),"data-item":"Underline",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(kp)})`})},null,4),L[100]||(L[100]=o.createElementVNode("span",{class:"select"},null,-1)),o.createElementVNode("div",Lm,[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-decoration-style":"solid",onClick:L[41]||(L[41]=X=>c("Underline",{style:"solid"}))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(ma)})`})},null,4)]),o.createElementVNode("li",{"data-decoration-style":"double",onClick:L[42]||(L[42]=X=>c("Underline",{style:"double"}))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(hm)})`})},null,4)]),o.createElementVNode("li",{"data-decoration-style":"dashed",onClick:L[43]||(L[43]=X=>c("Underline",{style:"dashed"}))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Sa)})`})},null,4)]),o.createElementVNode("li",{"data-decoration-style":"dotted",onClick:L[44]||(L[44]=X=>c("Underline",{style:"dotted"}))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Ma)})`})},null,4)]),o.createElementVNode("li",{"data-decoration-style":"wavy",onClick:L[45]||(L[45]=X=>c("Underline",{style:"wavy"}))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(um)})`})},null,4)])])])],8,bm)):o.createCommentVNode("",!0),w=="Strikeout"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__strikeout",title:"删除线(Ctrl+Shift+X)",onClick:L[47]||(L[47]=X=>c("Strikeout")),"data-item":"Strikeout",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Dp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Superscript"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__superscript",onClick:L[48]||(L[48]=X=>c("Superscript")),"data-item":"Superscript",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Ep)})`})},null,4)])):o.createCommentVNode("",!0),w=="Subscript"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__subscript",onClick:L[49]||(L[49]=X=>c("Subscript")),"data-item":"Subscript",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Up)})`})},null,4)])):o.createCommentVNode("",!0),w=="Color"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__color",title:"字体颜色",onClick:x,"data-item":"Color",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Zp)})`})},null,4),L[101]||(L[101]=o.createElementVNode("span",null,null,-1)),L[102]||(L[102]=o.createElementVNode("input",{type:"color",class:"input-color"},null,-1))])):o.createCommentVNode("",!0),w=="Highlight"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__highlight",title:"高亮",onClick:I,"data-item":"Highlight",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Yp)})`})},null,4),L[103]||(L[103]=o.createElementVNode("span",null,null,-1)),L[104]||(L[104]=o.createElementVNode("input",{type:"color",class:"input-highlight"},null,-1))])):o.createCommentVNode("",!0),w=="Title"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__title",onClick:L[57]||(L[57]=X=>d("menu-item__title",X)),"data-item":"Title",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Qp)})`})},null,4),L[105]||(L[105]=o.createElementVNode("span",{class:"select",title:"切换标题"},"正文",-1)),o.createElementVNode("div",Om,[o.createElementVNode("ul",null,[o.createElementVNode("li",{style:{"font-size":"16px"},onClick:L[50]||(L[50]=X=>c("Title",null))},"正文"),o.createElementVNode("li",{"data-level":"first",style:{"font-size":"26px"},onClick:L[51]||(L[51]=X=>c("Title","first"))},"标题1"),o.createElementVNode("li",{"data-level":"second",style:{"font-size":"24px"},onClick:L[52]||(L[52]=X=>c("Title","second"))},"标题2"),o.createElementVNode("li",{"data-level":"third",style:{"font-size":"22px"},onClick:L[53]||(L[53]=X=>c("Title","third"))},"标题3"),o.createElementVNode("li",{"data-level":"fourth",style:{"font-size":"20px"},onClick:L[54]||(L[54]=X=>c("Title","fourth"))},"标题4"),o.createElementVNode("li",{"data-level":"fifth",style:{"font-size":"18px"},onClick:L[55]||(L[55]=X=>c("Title","fifth"))},"标题5"),o.createElementVNode("li",{"data-level":"sixth",style:{"font-size":"16px"},onClick:L[56]||(L[56]=X=>c("Title","sixth"))},"标题6")])])])):o.createCommentVNode("",!0),w=="RowFlexLeft"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__left",onClick:L[58]||(L[58]=X=>c("RowFlex","left")),title:`左对齐(${o.unref(a)?"⌘":"Ctrl"}+L)`,"data-item":"RowFlexLeft",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Kp)})`})},null,4)],8,Pm)):o.createCommentVNode("",!0),w=="RowFlexCenter"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__center",onClick:L[59]||(L[59]=X=>c("RowFlex","center")),title:`居中对齐(${o.unref(a)?"⌘":"Ctrl"}+E)`,"data-item":"RowFlexCenter",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Hp)})`})},null,4)],8,Tm)):o.createCommentVNode("",!0),w=="RowFlexRight"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__right",onClick:L[60]||(L[60]=X=>c("RowFlex","right")),title:`右对齐(${o.unref(a)?"⌘":"Ctrl"}+R)`,"data-item":"RowFlexRight",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Bp)})`})},null,4)],8,Im)):o.createCommentVNode("",!0),w=="RowFlexAlignment"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__alignment",onClick:L[61]||(L[61]=X=>c("RowFlex","alignment")),title:`两端对齐(${o.unref(a)?"⌘":"Ctrl"}+J)`,"data-item":"RowFlexAlignment",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Gp)})`})},null,4)],8,xm)):o.createCommentVNode("",!0),w=="RowFlexJustify"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__justify",onClick:L[62]||(L[62]=X=>c("RowFlex","justify")),title:`分散对齐(${o.unref(a)?"⌘":"Ctrl"}+Shift+J)`,"data-item":"RowFlexJustify",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(_p)})`})},null,4)],8,wm)):o.createCommentVNode("",!0),w=="RowMargin"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__row-margin",onClick:L[70]||(L[70]=X=>d("menu-item__row-margin",X)),"data-item":"RowMargin",key:w},[o.createElementVNode("i",{title:"行间距",style:o.normalizeStyle({backgroundImage:`url(${o.unref(Ap)})`})},null,4),o.createElementVNode("div",ym,[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-rowmargin":"1",onClick:L[63]||(L[63]=X=>c("RowMargin",1))},"1"),o.createElementVNode("li",{"data-rowmargin":"1.25",onClick:L[64]||(L[64]=X=>c("RowMargin",1.25))},"1.25"),o.createElementVNode("li",{"data-rowmargin":"1.5",onClick:L[65]||(L[65]=X=>c("RowMargin",1.5))},"1.5"),o.createElementVNode("li",{"data-rowmargin":"1.75",onClick:L[66]||(L[66]=X=>c("RowMargin",1.75))},"1.75"),o.createElementVNode("li",{"data-rowmargin":"2",onClick:L[67]||(L[67]=X=>c("RowMargin",2))},"2"),o.createElementVNode("li",{"data-rowmargin":"2.5",onClick:L[68]||(L[68]=X=>c("RowMargin",2.5))},"2.5"),o.createElementVNode("li",{"data-rowmargin":"3",onClick:L[69]||(L[69]=X=>c("RowMargin",3))},"3")])])])):o.createCommentVNode("",!0),w=="List"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__list",onClick:L[76]||(L[76]=X=>d("menu-item__list",X)),key:w},[o.createElementVNode("i",{title:"列表",style:o.normalizeStyle({backgroundImage:`url(${o.unref(Jp)})`})},null,4),o.createElementVNode("div",Vm,[o.createElementVNode("ul",null,[L[111]||(L[111]=o.createElementVNode("li",null,[o.createElementVNode("label",null,"取消列表")],-1)),o.createElementVNode("li",{"data-list-type":"ol","data-list-style":"decimal",onClick:L[71]||(L[71]=X=>c("List",["ol","decimal"]))},L[106]||(L[106]=[o.createElementVNode("label",null,"有序列表:",-1),o.createElementVNode("ol",null,[o.createElementVNode("li",null,"________")],-1)])),o.createElementVNode("li",{"data-list-type":"ul","data-list-style":"checkbox",onClick:L[72]||(L[72]=X=>c("List",["ul","checkbox"]))},L[107]||(L[107]=[o.createElementVNode("label",null,"复选框列表:",-1),o.createElementVNode("ul",{style:{"list-style-type":"'☑️ '"}},[o.createElementVNode("li",null,"________")],-1)])),o.createElementVNode("li",{"data-list-type":"ul","data-list-style":"disc",onClick:L[73]||(L[73]=X=>c("List",["ul","disc"]))},L[108]||(L[108]=[o.createElementVNode("label",null,"实心圆点列表:",-1),o.createElementVNode("ul",{style:{"list-style-type":"disc"}},[o.createElementVNode("li",null,"________")],-1)])),o.createElementVNode("li",{"data-list-type":"ul","data-list-style":"circle",onClick:L[74]||(L[74]=X=>c("List",["ul","circle"]))},L[109]||(L[109]=[o.createElementVNode("label",null,"空心圆点列表:",-1),o.createElementVNode("ul",{style:{"list-style-type":"circle"}},[o.createElementVNode("li",null,"________")],-1)])),o.createElementVNode("li",{"data-list-type":"ul","data-list-style":"square",onClick:L[75]||(L[75]=X=>c("List",["ul","square"]))},L[110]||(L[110]=[o.createElementVNode("label",null,"空心方块列表:",-1),o.createElementVNode("ul",{style:{"list-style-type":"'☐ '"}},[o.createElementVNode("li",null,"________")],-1)]))])])])):o.createCommentVNode("",!0),w=="Table"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__table",onClick:b,key:w},[o.createElementVNode("i",{title:"表格",style:o.normalizeStyle({backgroundImage:`url(${o.unref($p)})`})},null,4),L[112]||(L[112]=o.createStaticVNode('<div class="menu-item__table__collapse" data-v-638f4090><div class="table-close" data-v-638f4090>×</div><div class="table-title" data-v-638f4090><span class="table-select" data-v-638f4090>插入</span><span data-v-638f4090>表格</span></div><div class="table-panel" data-v-638f4090><table data-v-638f4090><tbody data-v-638f4090><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr><tr class="table-row" data-v-638f4090><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td><td class="table-cel" data-v-638f4090></td></tr></tbody></table></div></div>',1))])):o.createCommentVNode("",!0),w=="Image"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__image",onClick:P,key:w},[o.createElementVNode("i",{title:"图片",style:o.normalizeStyle({backgroundImage:`url(${o.unref(zp)})`})},null,4),L[113]||(L[113]=o.createElementVNode("input",{type:"file",class:"image",accept:".png, .jpg, .jpeg, .svg, .gif"},null,-1))])):o.createCommentVNode("",!0),w=="Hyperlink"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__hyperlink",onClick:N,key:w},[o.createElementVNode("i",{title:"超链接",style:o.normalizeStyle({backgroundImage:`url(${o.unref(jp)})`})},null,4)])):o.createCommentVNode("",!0),w=="Separator"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__separator",onClick:L[83]||(L[83]=X=>d("menu-item__separator",X)),key:w},[o.createElementVNode("i",{title:"分割线",style:o.normalizeStyle({backgroundImage:`url(${o.unref(qp)})`})},null,4),o.createElementVNode("div",Fm,[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-separator":"0,0",onClick:L[77]||(L[77]=X=>c("Separator",[0,0]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(ma)})`})},null,4)]),o.createElementVNode("li",{"data-separator":"1,1",onClick:L[78]||(L[78]=X=>c("Separator",[1,1]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Ma)})`})},null,4)]),o.createElementVNode("li",{"data-separator":"3,1",onClick:L[79]||(L[79]=X=>c("Separator",[3,1]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Sa)})`})},null,4)]),o.createElementVNode("li",{"data-separator":"4,4",onClick:L[80]||(L[80]=X=>c("Separator",[4,4]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(fm)})`})},null,4)]),o.createElementVNode("li",{"data-separator":"7,3,3,3",onClick:L[81]||(L[81]=X=>c("Separator",[7,3,3,3]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(gm)})`})},null,4)]),o.createElementVNode("li",{"data-separator":"6,2,2,2,2,2",onClick:L[82]||(L[82]=X=>c("Separator",[6,2,2,2,2,2]))},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(Rm)})`})},null,4)])])])])):o.createCommentVNode("",!0),w=="Watermark"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__watermark",onClick:L[86]||(L[86]=X=>d("menu-item__watermark",X)),key:w},[o.createElementVNode("i",{title:"水印(添加、删除)",style:o.normalizeStyle({backgroundImage:`url(${o.unref(em)})`})},null,4),o.createElementVNode("div",Xm,[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-menu":"add",onClick:L[84]||(L[84]=X=>m("add"))},"添加水印"),o.createElementVNode("li",{"data-menu":"delete",onClick:L[85]||(L[85]=X=>m("delete"))},"删除水印")])])])):o.createCommentVNode("",!0),w=="Codeblock"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__codeblock",title:"代码块",onClick:T,key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(tm)})`})},null,4)])):o.createCommentVNode("",!0),w=="PageBreak"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__page-break",title:"分页符",key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(im)})`})},null,4)])):o.createCommentVNode("",!0),w=="Control"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__control",onClick:L[93]||(L[93]=X=>d("menu-item__control",X)),key:w},[o.createElementVNode("i",{title:"控件",style:o.normalizeStyle({backgroundImage:`url(${o.unref(nm)})`})},null,4),o.createElementVNode("div",Cm,[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-control":"text",onClick:L[87]||(L[87]=X=>V("text"))},"文本"),o.createElementVNode("li",{"data-control":"number",onClick:L[88]||(L[88]=X=>V("number"))},"数值"),o.createElementVNode("li",{"data-control":"select",onClick:L[89]||(L[89]=X=>V("select"))},"列举"),o.createElementVNode("li",{"data-control":"date",onClick:L[90]||(L[90]=X=>V("date"))},"日期"),o.createElementVNode("li",{"data-control":"checkbox",onClick:L[91]||(L[91]=X=>V("checkbox"))},"复选框"),o.createElementVNode("li",{"data-control":"radio",onClick:L[92]||(L[92]=X=>V("radio"))},"单选框")])])])):o.createCommentVNode("",!0),w=="Checkbox"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__checkbox",title:"复选框",onClick:L[94]||(L[94]=X=>p("checkbox")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(sm)})`})},null,4)])):o.createCommentVNode("",!0),w=="Radio"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__radio",title:"单选框",onClick:L[95]||(L[95]=X=>p("radio")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(om)})`})},null,4)])):o.createCommentVNode("",!0),w=="Latex"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__latex",title:"LateX",onClick:R,key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(lm)})`})},null,4)])):o.createCommentVNode("",!0),w=="Date"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__date",onClick:L[96]||(L[96]=X=>M("menu-item__date",X)),key:w},[o.createElementVNode("i",{title:"日期",style:o.normalizeStyle({backgroundImage:`url(${o.unref(rm)})`})},null,4),L[114]||(L[114]=o.createElementVNode("div",{class:"options"},[o.createElementVNode("ul",null,[o.createElementVNode("li",{"data-format":"yyyy-MM-dd","label-format":"YYYY-MM-DD"}),o.createElementVNode("li",{"data-format":"yyyy-MM-dd hh:mm:ss","label-format":"YYYY-MM-DD HH:mm:ss"})])],-1))])):o.createCommentVNode("",!0),w=="Block"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__block",title:"内容块",onClick:S,key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(am)})`})},null,4)])):o.createCommentVNode("",!0),w=="Search"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__search","data-menu":"search",onClick:y,key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(cm)})`})},null,4)])):o.createCommentVNode("",!0),w=="SearchCollapse"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__search__collapse","data-menu":"search","data-item":"SearchCollapse",key:w},[o.createElementVNode("div",vm,[L[115]||(L[115]=o.createElementVNode("input",{type:"text"},null,-1)),L[116]||(L[116]=o.createElementVNode("label",{class:"search-result"},null,-1)),o.createElementVNode("div",Wm,[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(pm)})`})},null,4)]),o.createElementVNode("div",km,[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(mm)})`})},null,4)]),L[117]||(L[117]=o.createElementVNode("span",null,"×",-1))]),L[118]||(L[118]=o.createElementVNode("div",{class:"menu-item menu-item__search__collapse__replace"},[o.createElementVNode("input",{type:"text"}),o.createElementVNode("button",null,"替换")],-1))])):o.createCommentVNode("",!0),w=="Print"?(o.openBlock(),o.createElementBlock("div",{class:"menu-item menu-item__print","data-menu":"print",onClick:L[97]||(L[97]=X=>c("Print")),key:w},[o.createElementVNode("i",{style:o.normalizeStyle({backgroundImage:`url(${o.unref(dm)})`})},null,4)])):o.createCommentVNode("",!0)],64))),256))],512))}}),[["__scopeId","data-v-638f4090"]]),Em=Le(o.defineComponent({__name:"richText",props:o.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},model:{type:String,default:"edit"},toolbar:{type:Array,default:()=>[]}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(r,{expose:e}){const t=r,i=o.useModel(r,"value"),n=o.ref(!1),s=o.computed(()=>t.editor?.widget(t.wid)||t.widget||{}),l=o.computed(()=>t.editor?.model.value||t.model);o.computed(()=>s.value.props||{});const a=o.ref(),c=o.ref(),d=o.ref(),h=o.ref();o.onMounted(()=>{u()});function u(){const f=d.value.clientWidth,g=a.value.getHeight()-c.value?.getHeight()||0;console.log("width:"+f+",height:"+g),h.value=new Tp(d.value,[],{mode:l.value=="edit"?"edit":"readonly",locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"Microsoft YaHei",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:f,height:g,scale:1,pageGap:0,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[0,0,0,0],pageMode:"continuity",renderMode:"speed",defaultHyperlinkColor:"#0000FF",paperDirection:"vertical",inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:"break-word",printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:["A-Za-z"],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,watermark:{data:"Unione Form Vue",type:"text",width:100,height:30,color:"#AEB5C0",opacity:.3,size:120,font:"Microsoft YaHei",repeat:!0,gap:[10,10],numberType:"arabic"},pageNumber:{bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:"center",format:"第{pageNo}页/共{pageCount}页",numberType:"arabic",disabled:!0,startPageNo:1,fromPageNo:0,maxPageNo:null},placeholder:{data:"请输入正文",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},zone:{tipDisabled:!1},table:{tdPadding:[0,5,5,5],defaultTrMinHeight:42,defaultColMinWidth:40,defaultBorderColor:"#000000"},header:{top:30,inactiveAlpha:1,maxHeightRadio:"half",disabled:!0,editable:!0},footer:{bottom:30,inactiveAlpha:1,maxHeightRadio:"half",disabled:!0,editable:!0},control:{placeholderColor:"#9c9b9b",bracketColor:"#000000",prefix:"{",postfix:"}",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},checkbox:{width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:"bottom"},radio:{width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:"bottom"},cursor:{width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},title:{defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},group:{opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!0,deletable:!0},pageBreak:{font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},background:{color:"#FFFFFF",image:"",size:"cover",repeat:"no-repeat",applyPageNumbers:[]},lineBreak:{disabled:!0,color:"#CCCCCC",lineWidth:1.5},separator:{lineWidth:1,strokeStyle:"#000000"},lineNumber:{size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:"continuity"},pageBorder:{color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},badge:{top:0,left:5},modeRule:{print:{imagePreviewerDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1}}}),h.value.listener.contentChange=()=>{h.value.command.getValueAsync().then(({data:R})=>{i.value=R})},i.value&&(h.value.command.executeSetValue(JSON.parse(JSON.stringify(i.value))),n.value=!0)}return o.watch(i,()=>{i.value&&n.value==!1&&(h.value.command.executeSetValue(JSON.parse(JSON.stringify(i.value))),n.value=!0)}),o.watch(l,()=>{t.editor?.command.executeMode(l.value=="edit"?"edit":"readonly")}),e({}),(f,g)=>(o.openBlock(),o.createBlock(Mi,{class:"unione-rich-text",model:t.editor?.model.value,"setting-title":"富文本设置",ref_key:"richTextDom",ref:a},{default:o.withCtx(()=>[l.value=="edit"&&h.value?(o.openBlock(),o.createBlock(Dm,{key:0,ref_key:"canvasMenuDom",ref:c,editor:h.value,items:r.toolbar},null,8,["editor","items"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"canvasEditorDom",ref:d,class:"canvas-editor"},null,512)]),_:1},8,["model"]))}}),[["__scopeId","data-v-d2ae02a6"]]),Um={class:"page-setting-dialog"},Dn=o.defineComponent({__name:"page",props:{settingTitle:{type:String,default:"页面设置"},editor:{type:Object,required:!1}},emits:["setting","saving"],setup(r,{emit:e}){const t=r,i=o.computed(()=>t.editor?.model?.value),n=te.useSession(),s=o.computed(()=>n.getPrincipal()),l=o.ref(!1);o.provide("closeSetting",()=>{t.editor?.save().then(f=>{l.value=!1})});function a(){l.value=!0}function c(){t.editor?.save().then(f=>{console.log("res",f)})}function d(){t.editor?.save().then(f=>{console.log("res",f)})}const h=o.ref("");function u(f){h.value||(h.value=i.value),f?t.editor?.setModel("edit"):t.editor?.setModel(h.value)}return(f,g)=>{const R=o.resolveComponent("SettingOutlined"),p=o.resolveComponent("a-tooltip"),M=o.resolveComponent("SaveOutlined"),S=o.resolveComponent("FormOutlined"),b=o.resolveComponent("StopOutlined"),P=o.resolveComponent("a-modal");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["unione-page",i.value])},[i.value=="edit"&&f.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(o.openBlock(),o.createBlock(p,{key:0,title:r.settingTitle},{default:o.withCtx(()=>[o.createVNode(R,{class:"page-setting",onClick:a})]),_:1},8,["title"])):o.createCommentVNode("",!0),i.value=="edit"&&f.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(o.openBlock(),o.createBlock(p,{key:1,title:"保存页面"},{default:o.withCtx(()=>[o.createVNode(M,{class:"btn-save",onClick:c})]),_:1})):o.createCommentVNode("",!0),i.value!="edit"&&s.value?.userRoles?.includes("FORM-ADMIN")?(o.openBlock(),o.createBlock(p,{key:2,title:"编辑页面"},{default:o.withCtx(()=>[o.createVNode(S,{class:"btn-edit",onClick:g[0]||(g[0]=N=>u(!0))})]),_:1})):o.createCommentVNode("",!0),i.value=="edit"&&f.$slots["page-setting"]&&s.value?.userRoles?.includes("FORM-ADMIN")?(o.openBlock(),o.createBlock(p,{key:3,title:"退出编辑"},{default:o.withCtx(()=>[o.createVNode(b,{class:"btn-edit",onClick:g[1]||(g[1]=N=>u(!1))})]),_:1})):o.createCommentVNode("",!0),o.renderSlot(f.$slots,"default"),i.value=="edit"?(o.openBlock(),o.createBlock(P,{key:4,title:t.settingTitle,open:l.value,"onUpdate:open":g[2]||(g[2]=N=>l.value=N),centered:"",width:"85%",onOk:d},{default:o.withCtx(()=>[o.createElementVNode("div",Um,[o.renderSlot(f.$slots,"page-setting")])]),_:3},8,["title","open"])):o.createCommentVNode("",!0)],2)}}}),Zm={class:"unione-props-setting data-field-manage"},Ym={key:0},Qm={key:1},Km={key:2},Hm={key:3},Bm={key:4},Gm={key:5},_m={key:6},Am=["onClick"],Jm=["onClick"],zm=["onClick"],$m={key:1},jm=Le(o.defineComponent({__name:"dataFieldMange",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:f})=>f+1},{title:"名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"标题",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"数据类型",dataIndex:"dataType",key:"dataType",width:"80px",align:"center"},{title:"长度",dataIndex:"dataLen",key:"dataLen",width:"60px",align:"center"},{title:"小数点",dataIndex:"dataPrec",key:"dataPrec",width:"60px",align:"center"},{title:"默认值",dataIndex:"defaultValue",key:"defaultValue",width:"60px",align:"center"},{title:"主键",dataIndex:"isPk",key:"isPk",width:"40px",align:"center"},{title:"外键",dataIndex:"isFk",key:"isFk",width:"30px",align:"center"},{title:"非空",dataIndex:"isNull",key:"isNull",width:"30px",align:"center"},{title:"同步",dataIndex:"syncDbEnable",key:"syncDbEnable",width:"30px",align:"center"},{title:"备注",dataIndex:"descs",key:"descs",width:"140px",align:"center"}]),t=o.useModel(r,"modelValue"),i=o.ref({selectedRowKeys:[],columnWidth:"25px",onChange:f=>{f.forEach(g=>{i.value.selectedRowKeys.includes(g)||i.value.selectedRowKeys.push(g);const R=[];t.value.forEach(p=>{!f.includes(p.name)&&i.value.selectedRowKeys.includes(p.name)&&R.push(p.name)}),R.length&&(i.value.selectedRowKeys=i.value.selectedRowKeys.filter(p=>!R.includes(p)))})}}),n={mounted:f=>f.focus()},s=o.ref({});function l(){const f=Object.keys(s.value);if(f.length)for(let g in f){const R=t.value.filter(p=>p.name==g);if(R&&R[0]){let p=s.value[g];Object.keys(p).forEach(M=>{R[0][M]=p[M]})}}s.value={}}function a(f,g){l();const R={};R[g]=f[g]||"",s.value[f.name]=R}function c(f,g){if(!f||!g){s.value={};return}const R=s.value[f.name][g];if(g=="name"&&t.value.filter(M=>M[g]==R&&M.name!=f.name).length>0){ge.Modal.warn({title:"提示信息",content:"字段名称["+R+"]已存在"});return}f[g]=R,s.value={}}function d(f,g){t.value.filter(p=>p.name==f.name).forEach(p=>{p[g]=!p[g]})}function h(){if(l(),t.value.filter(R=>R.name=="new_").length>0){s.value.new_={name:"new_"};return}const g={title:"",name:"new_",isPk:!1};t.value.push(g),s.value[g.name]={name:"new_"}}function u(){if(!i.value.selectedRowKeys.length){ge.Modal.info({title:"提示信息",content:"请选择要删除的字段!"});return}ge.Modal.confirm({title:"确认信息",content:"确定要删除选中的["+i.value.selectedRowKeys.length+"]字段么?",onOk:()=>{t.value=t.value.filter(f=>!i.value.selectedRowKeys.includes(f.name)),i.value.selectedRowKeys=[]}})}return(f,g)=>{const R=o.resolveComponent("a-button"),p=o.resolveComponent("a-tooltip"),M=o.resolveComponent("a-input"),S=o.resolveComponent("a-input-number"),b=o.resolveComponent("a-select-option"),P=o.resolveComponent("a-select"),N=o.resolveComponent("a-checkbox"),m=o.resolveComponent("a-table");return o.openBlock(),o.createElementBlock("div",Zm,[o.createVNode(R,{class:"btn btn-add",type:"primary",onClick:h,size:"small"},{default:o.withCtx(()=>g[1]||(g[1]=[o.createTextVNode("新增")])),_:1}),o.createVNode(R,{class:"btn btn-delete",type:"primary",danger:"",onClick:u,size:"small"},{default:o.withCtx(()=>g[2]||(g[2]=[o.createTextVNode(" 删除 ")])),_:1}),o.createVNode(m,{columns:e.value,"data-source":t.value,pagination:!1,bordered:"","row-selection":i.value,scroll:{x:1150},"row-key":"name",size:"small",sticky:""},{headerCell:o.withCtx(({column:T})=>[T.key==="name"?(o.openBlock(),o.createElementBlock("span",Ym,[g[3]||(g[3]=o.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="title"?(o.openBlock(),o.createElementBlock("span",Qm,[g[4]||(g[4]=o.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="descs"?(o.openBlock(),o.createElementBlock("span",Km,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="dataLen"?(o.openBlock(),o.createElementBlock("span",Hm,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="dataPrec"?(o.openBlock(),o.createElementBlock("span",Bm,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="defaultValue"?(o.openBlock(),o.createElementBlock("span",Gm,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="dataType"?(o.openBlock(),o.createElementBlock("span",_m,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(T.title),1)])):o.createCommentVNode("",!0),T.key==="isPk"?(o.openBlock(),o.createBlock(p,{key:7,title:"至少配置一个主键字段"},{default:o.withCtx(()=>[g[5]||(g[5]=o.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),o.createTextVNode(o.toDisplayString(T.title),1)]),_:2},1024)):o.createCommentVNode("",!0),T.key==="isFk"?(o.openBlock(),o.createBlock(p,{key:8,title:"是否是外键字段"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(T.title),1)]),_:2},1024)):o.createCommentVNode("",!0),T.key==="isNull"?(o.openBlock(),o.createBlock(p,{key:9,title:"是否允许为空"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(T.title),1)]),_:2},1024)):o.createCommentVNode("",!0),T.key==="syncDbEnable"?(o.openBlock(),o.createBlock(p,{key:10,title:"是否同步到数据库"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(T.title),1)]),_:2},1024)):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:T,text:y,record:x})=>[["name","title","descs","defaultValue"].includes(T.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(T.dataIndex))&&!y&&"empty"]),onClick:I=>a(x,T.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(T.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(M,{key:0,value:s.value[x.name][T.dataIndex],"onUpdate:value":I=>s.value[x.name][T.dataIndex]=I,onBlur:I=>c(x,T.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[n]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(y||" "),1)],64))],10,Am)):o.createCommentVNode("",!0),["dataLen","dataPrec"].includes(T.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(T.dataIndex))&&!y&&"empty"]),onClick:I=>a(x,T.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(T.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(S,{key:0,value:s.value[x.name][T.dataIndex],"onUpdate:value":I=>s.value[x.name][T.dataIndex]=I,onBlur:I=>c(x,T.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[n]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(y||" "),1)],64))],10,Jm)):["dataType"].includes(T.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!s.value[x.name]||!Object.keys(s.value[x.name]).includes(T.dataIndex))&&!y&&"empty"]),onClick:I=>a(x,T.dataIndex)},[s.value[x.name]&&Object.keys(s.value[x.name]).includes(T.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(P,{key:0,value:x[T.dataIndex],"onUpdate:value":I=>x[T.dataIndex]=I,onBlur:g[0]||(g[0]=I=>c())},{default:o.withCtx(()=>[o.createVNode(b,{key:"String",value:"String"}),o.createVNode(b,{key:"Long",value:"Long"}),o.createVNode(b,{key:"Short",value:"Short"}),o.createVNode(b,{key:"Integer",value:"Integer"}),o.createVNode(b,{key:"Float",value:"Float"}),o.createVNode(b,{key:"Double",value:"Double"}),o.createVNode(b,{key:"Date",value:"Date"}),o.createVNode(b,{key:"Timestamp",value:"Timestamp"})]),_:2},1032,["value","onUpdate:value"])),[[n]]):(o.openBlock(),o.createElementBlock("span",$m,o.toDisplayString(y),1))],10,zm)):["syncDbEnable","isFk","isPk"].includes(T.dataIndex)?(o.openBlock(),o.createBlock(N,{key:3,checked:x[T.dataIndex],onClick:I=>d(x,T.dataIndex)},null,8,["checked","onClick"])):["isNull"].includes(T.dataIndex)?(o.openBlock(),o.createBlock(N,{key:4,checked:!x[T.dataIndex],onClick:I=>d(x,T.dataIndex)},null,8,["checked","onClick"])):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])])}}}),[["__scopeId","data-v-f6307a23"]]),qm={class:"unione-props-setting data-field-setting"},e0={key:0},t0=["onClick"],i0={class:"field-txt"},n0=["onClick"],s0={key:1,class:"field-txt"},o0=["onClick"],l0={key:1},r0=["onClick"],a0={key:0,class:"field-txt"},c0={key:4,class:"edit-field"},d0={key:0},h0=["onClick"],u0=Le(o.defineComponent({__name:"dataFieldSetting",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:S})=>S+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"列表",dataIndex:"isList",key:"isList",width:"40px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"40px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"40px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"60px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),t=o.useModel(r,"modelValue"),i={mounted:S=>S.focus()},n=o.ref({});function s(){const S=Object.keys(n.value);if(S.length)for(let b in S){const P=t.value.filter(N=>N.name==b);if(P&&P[0]){let N=n.value[b];Object.keys(N).forEach(m=>{m=="convertName"?(P[0].convert||(P[0].convert={}),P[0].convert.type=N[m]):P[0][m]=N[m]})}}n.value={}}function l(S,b){s();const P={};b=="convertName"?(S.convert||(S.convert={}),P[b]=S.convert?.type):P[b]=S[b]||"",n.value[S.name]=P}function a(S,b){{n.value={};return}}function c(S,b){t.value.filter(N=>N.name==S.name).forEach(N=>{N[b]=!N[b]})}const d=o.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{d.value.visible=!1}});function h(S,b){const P=t.value.filter(m=>m.name==S.name);P.forEach(m=>{b!="isSort"?m[b]=!0:m[b]=!m[b]});const N=P[0];if(!(!N||b=="isSort")){switch(d.value.prop=b,d.value.field=S,N.show||(N.show={}),b){case"isQuery":N.show.query||(N.show.query={}),d.value.show=N.show.query,d.value.title=`查询设置/${S.title}(${S.name})`;break;case"isForm":N.show.form||(N.show.form={}),d.value.show=N.show.form,d.value.title=`表单设置/${S.title}(${S.name})`;break;case"isView":N.show.view||(N.show.view={}),d.value.show=N.show.view,d.value.title=`详情设置/${S.title}(${S.name})`;break;case"isList":N.show.list||(N.show.list={}),d.value.show=N.show.list,d.value.title=`列头设置/${S.title}(${S.name})`;break}d.value.visible=!0}}const u=o.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:S=>{const b=u.value.options.filter(P=>P.value==S);return b[0]?b[0].label:S}}),f=o.ref({visible:!1,field:{},props:{},showInfo:S=>{let b="";return S.rules&&(b=S.rules.filter(P=>P.enable).length||""),b&&(b="("+b+")"),b},toSetting:()=>{const S=f.value.props,b={name:"range",trigger:S.trigger,whitespace:S.whitespace,message:S.rangeMessage};S.rangeMin!=null&&S.rangeMin!=null&&(b.min=S.rangeMin,b.enable=!0),S.rangeMax!=null&&S.rangeMax!=null&&(b.max=S.rangeMax,b.enable=!0);const P={name:"reg",trigger:S.trigger,whitespace:S.whitespace,message:S.regMessage};S.regExpress&&(P.pattern=S.regExpress,P.enable=!0),f.value.field.rules=[b,P],f.value.visible=!1,f.value.props={},console.log("rule",f.value.field.rules)}});function g(S){f.value.visible=!0,f.value.field=S;const b=S.rules||[],P={trigger:"change",whitespace:!0};b.forEach(N=>{N.name=="reg"&&(P.trigger=N.trigger,P.whitespace=N.whitespace,P.regExpress=N.pattern,P.regMessage=N.message),N.name=="range"&&(P.rangeMin=N.min,P.rangeMax=N.max,P.rangeMessage=N.message)}),f.value.props=P}const R=o.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:S=>{const b=R.value.widgets.filter(P=>P.value==S);return b[0]?b[0].label:S},toSetting:()=>{}}),p=o.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{p.value.convert.options||(p.value.convert.options=[]),p.value.convert.options.push({label:"",value:""})},toDelOption:(S,b)=>{p.value.convert.options.splice(S,1)},toSetting:()=>{p.value.visible=!1}});function M(S){p.value.visible=!0,p.value.field=S,p.value.convert=S.convert||{}}return(S,b)=>{const P=o.resolveComponent("ToolOutlined"),N=o.resolveComponent("a-button"),m=o.resolveComponent("a-select"),T=o.resolveComponent("a-checkbox"),y=o.resolveComponent("a-table"),x=o.resolveComponent("a-input-number"),I=o.resolveComponent("a-form-item"),V=o.resolveComponent("a-input"),F=o.resolveComponent("a-form"),L=o.resolveComponent("a-modal"),w=o.resolveComponent("a-col"),v=o.resolveComponent("a-row"),X=o.resolveComponent("a-select-option"),C=o.resolveComponent("a-divider"),Z=o.resolveComponent("a-checkbox-group");return o.openBlock(),o.createElementBlock("div",qm,[o.createVNode(y,{columns:e.value,"data-source":t.value,bordered:"",scroll:{x:1e3},pagination:!1,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:k})=>[["widget","queryType","rules","convertName"].includes(k.key)?(o.openBlock(),o.createElementBlock("span",e0,[o.createVNode(P),o.createTextVNode(" "+o.toDisplayString(k.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:k,text:Q,record:Y})=>[["rules"].includes(k.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",!f.value.showInfo(Y)&&"empty"]),onClick:W=>g(Y)},[o.createElementVNode("span",i0,o.toDisplayString(f.value.showInfo(Y)),1),f.value.showInfo(Y)?(o.openBlock(),o.createBlock(N,{key:0,type:"link"},{default:o.withCtx(()=>b[22]||(b[22]=[o.createTextVNode("设置")])),_:1})):o.createCommentVNode("",!0)],10,t0)):["widget"].includes(k.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!n.value[Y.name]||!Object.keys(n.value[Y.name]).includes(k.dataIndex))&&!Q&&"empty"]),onClick:W=>l(Y,k.dataIndex)},[n.value[Y.name]&&Object.keys(n.value[Y.name]).includes(k.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(m,{key:0,value:Y[k.dataIndex],"onUpdate:value":W=>Y[k.dataIndex]=W,allowClear:!0,options:R.value.widgets,onBlur:b[0]||(b[0]=W=>a())},null,8,["value","onUpdate:value","options"])),[[i]]):(o.openBlock(),o.createElementBlock("span",s0,o.toDisplayString(R.value.widgetName(Q)),1))],10,n0)):["queryType"].includes(k.dataIndex)?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[Y.isQuery?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!n.value[Y.name]||!Object.keys(n.value[Y.name]).includes(k.dataIndex))&&!Q&&"empty"]),onClick:W=>l(Y,k.dataIndex)},[n.value[Y.name]&&Object.keys(n.value[Y.name]).includes(k.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(m,{key:0,value:Y[k.dataIndex],"onUpdate:value":W=>Y[k.dataIndex]=W,allowClear:!0,options:u.value.options,onBlur:b[1]||(b[1]=W=>a())},null,8,["value","onUpdate:value","options"])),[[i]]):(o.openBlock(),o.createElementBlock("span",l0,o.toDisplayString(u.value.showLabel(Q)),1))],10,o0)):o.createCommentVNode("",!0)],64)):["convertName"].includes(k.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(["edit-field",(!n.value[Y.name]||!Object.keys(n.value[Y.name]).includes(k.dataIndex))&&!Y.convert?.type&&"empty"]),onClick:W=>l(Y,k.dataIndex)},[n.value[Y.name]&&Object.keys(n.value[Y.name]).includes(k.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(m,{key:0,value:Y.convert.type,"onUpdate:value":W=>Y.convert.type=W,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],allowClear:!0,onBlur:b[2]||(b[2]=W=>a())},null,8,["value","onUpdate:value"])),[[i]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[Y.convert?.type?(o.openBlock(),o.createElementBlock("span",a0,o.toDisplayString(Y.convert.type=="dict"?"字典":"静态"),1)):o.createCommentVNode("",!0),Y.convert?.type?(o.openBlock(),o.createBlock(N,{key:1,type:"link",onClick:o.withModifiers(W=>M(Y),["stop"])},{default:o.withCtx(()=>b[23]||(b[23]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],64))],10,r0)):["isQuery","isForm","isView","isList","isSort"].includes(k.dataIndex)?(o.openBlock(),o.createElementBlock("div",c0,[o.createVNode(T,{checked:Y[k.dataIndex],onClick:W=>c(Y,k.dataIndex)},null,8,["checked","onClick"]),o.createVNode(N,{type:"link",onClick:W=>h(Y,k.dataIndex)},{default:o.withCtx(()=>b[24]||(b[24]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])])):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(L,{visible:d.value.visible,"onUpdate:visible":b[9]||(b[9]=k=>d.value.visible=k),title:d.value.title,onOk:d.value.toSetting},{default:o.withCtx(()=>[o.createVNode(F,{model:d.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:o.withCtx(()=>[o.createVNode(I,{label:"显示顺序"},{default:o.withCtx(()=>[o.createVNode(x,{value:d.value.show.index,"onUpdate:value":b[3]||(b[3]=k=>d.value.show.index=k)},null,8,["value"])]),_:1}),["isQuery"].includes(d.value.prop)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(I,{key:0,label:"显示宽度"},{default:o.withCtx(()=>[o.createVNode(V,{value:d.value.show.width,"onUpdate:value":b[4]||(b[4]=k=>d.value.show.width=k)},null,8,["value"])]),_:1})),["isForm","isView"].includes(d.value.prop)?(o.openBlock(),o.createBlock(I,{key:1,label:"标题宽度"},{default:o.withCtx(()=>[o.createVNode(V,{value:d.value.show.labelWidth,"onUpdate:value":b[5]||(b[5]=k=>d.value.show.labelWidth=k)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isForm","isView"].includes(d.value.prop)?(o.openBlock(),o.createBlock(I,{key:2,label:"控件宽度"},{default:o.withCtx(()=>[o.createVNode(V,{value:d.value.show.valueWidth,"onUpdate:value":b[6]||(b[6]=k=>d.value.show.valueWidth=k)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isList"].includes(d.value.prop)?(o.openBlock(),o.createBlock(I,{key:3,label:"固定位置"},{default:o.withCtx(()=>[o.createVNode(m,{value:d.value.show.fixed,"onUpdate:value":b[7]||(b[7]=k=>d.value.show.fixed=k),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["isList"].includes(d.value.prop)?(o.openBlock(),o.createBlock(I,{key:4,label:"对齐方式"},{default:o.withCtx(()=>[o.createVNode(m,{value:d.value.show.align,"onUpdate:value":b[8]||(b[8]=k=>d.value.show.align=k),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),o.createVNode(L,{visible:p.value.visible,"onUpdate:visible":b[11]||(b[11]=k=>p.value.visible=k),title:p.value.convert.type=="dict"?"字典设置":"选项设置",onOk:p.value.toSetting},{default:o.withCtx(()=>[p.value.convert.type!="dict"?(o.openBlock(),o.createElementBlock("div",d0,[o.createVNode(N,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:p.value.toAddOption},{default:o.withCtx(()=>b[25]||(b[25]=[o.createTextVNode("新增")])),_:1},8,["onClick"]),o.createVNode(y,{columns:p.value.optionColumn,"data-source":p.value.convert.options,size:"small"},{bodyCell:o.withCtx(({column:k,text:Q,record:Y,index:W})=>[k.dataIndex==="label"?(o.openBlock(),o.createBlock(V,{key:0,value:Y.label,"onUpdate:value":H=>Y.label=H,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),k.dataIndex==="value"?(o.openBlock(),o.createBlock(V,{key:1,value:Y.value,"onUpdate:value":H=>Y.value=H,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),k.dataIndex==="action"?(o.openBlock(),o.createElementBlock("a",{key:2,onClick:H=>p.value.toDelOption(W,Y)},"删除",8,h0)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):o.createCommentVNode("",!0),p.value.convert.type=="dict"?(o.openBlock(),o.createBlock(F,{key:1,model:p.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:o.withCtx(()=>[o.createVNode(v,{type:"flex",style:{width:"100%"}},{default:o.withCtx(()=>[o.createVNode(w,{span:24,order:1},{default:o.withCtx(()=>[o.createVNode(I,{label:"字典名称:"},{default:o.withCtx(()=>[o.createVNode(V,{value:p.value.convert.dict,"onUpdate:value":b[10]||(b[10]=k=>p.value.convert.dict=k)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):o.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),o.createVNode(L,{visible:R.value.visible,"onUpdate:visible":b[13]||(b[13]=k=>R.value.visible=k),title:"控件设置",onOk:R.value.toSetting},{default:o.withCtx(()=>[o.createVNode(F,{model:R.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:o.withCtx(()=>[R.value.field.widget=="a-select"?(o.openBlock(),o.createBlock(I,{key:0,label:"下拉框类型"},{default:o.withCtx(()=>[o.createVNode(m,{value:R.value.props.mode,"onUpdate:value":b[12]||(b[12]=k=>R.value.props.mode=k),allowClear:!0},{default:o.withCtx(()=>[o.createVNode(X,{value:"multiple"},{default:o.withCtx(()=>b[26]||(b[26]=[o.createTextVNode("多选")])),_:1}),o.createVNode(X,{value:"tags"},{default:o.withCtx(()=>b[27]||(b[27]=[o.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),o.createVNode(L,{visible:f.value.visible,"onUpdate:visible":b[21]||(b[21]=k=>f.value.visible=k),title:"规则设置",onOk:f.value.toSetting},{default:o.withCtx(()=>[o.createVNode(F,{model:f.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(C,{orientation:"left"},{default:o.withCtx(()=>b[28]||(b[28]=[o.createTextVNode("基本设置")])),_:1}),o.createVNode(I,{label:"触发时机"},{default:o.withCtx(()=>[o.createVNode(Z,{value:f.value.props.trigger,"onUpdate:value":b[14]||(b[14]=k=>f.value.props.trigger=k),options:["change","blur"]},null,8,["value"])]),_:1}),f.value.field.isNull?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(I,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:o.withCtx(()=>[o.createVNode(T,{value:f.value.props.whitespace,"onUpdate:value":b[15]||(b[15]=k=>f.value.props.whitespace=k),checked:f.value.props.whitespace},{default:o.withCtx(()=>b[29]||(b[29]=[o.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),o.createVNode(C,{orientation:"left"},{default:o.withCtx(()=>b[30]||(b[30]=[o.createTextVNode("数值区间")])),_:1}),o.createVNode(I,{label:"有效区间"},{default:o.withCtx(()=>[o.createVNode(x,{value:f.value.props.rangeMin,"onUpdate:value":b[16]||(b[16]=k=>f.value.props.rangeMin=k)},null,8,["value"]),b[31]||(b[31]=o.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),o.createVNode(x,{value:f.value.props.rangeMax,"onUpdate:value":b[17]||(b[17]=k=>f.value.props.rangeMax=k)},null,8,["value"])]),_:1}),o.createVNode(I,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(V,{value:f.value.props.rangeMessage,"onUpdate:value":b[18]||(b[18]=k=>f.value.props.rangeMessage=k)},null,8,["value"])]),_:1}),o.createVNode(C,{orientation:"left"},{default:o.withCtx(()=>b[32]||(b[32]=[o.createTextVNode("正则验证")])),_:1}),o.createVNode(I,{label:"表达式"},{default:o.withCtx(()=>[o.createVNode(V,{value:f.value.props.regExpress,"onUpdate:value":b[19]||(b[19]=k=>f.value.props.regExpress=k)},null,8,["value"])]),_:1}),o.createVNode(I,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(V,{value:f.value.props.regMessage,"onUpdate:value":b[20]||(b[20]=k=>f.value.props.regMessage=k)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-ef9b9849"]]),f0={class:"unione-props-setting data-field"},g0=Le(o.defineComponent({__name:"dataField",props:o.mergeModels({filter:{type:Array,default(){return[]}}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(r){const e=o.useModel(r,"modelValue");return(t,i)=>{const n=o.resolveComponent("OrderedListOutlined"),s=o.resolveComponent("a-tab-pane"),l=o.resolveComponent("ToolOutlined"),a=o.resolveComponent("a-tabs");return o.openBlock(),o.createElementBlock("div",f0,[o.createVNode(a,null,{default:o.withCtx(()=>[o.createVNode(s,{key:"field-mange"},{tab:o.withCtx(()=>[o.createVNode(n),i[2]||(i[2]=o.createTextVNode("字段管理 "))]),default:o.withCtx(()=>[o.createVNode(jm,{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=c=>e.value=c)},null,8,["modelValue"])]),_:1}),o.createVNode(s,{key:"field-setting"},{tab:o.withCtx(()=>[o.createVNode(l),i[3]||(i[3]=o.createTextVNode("字段设置 "))]),default:o.withCtx(()=>[o.createVNode(u0,{modelValue:e.value,"onUpdate:modelValue":i[1]||(i[1]=c=>e.value=c)},null,8,["modelValue"])]),_:1})]),_:1})])}}}),[["__scopeId","data-v-008d1148"]]),R0={key:0,class:"data-model-list"},p0=["onClick"],m0=Le(o.defineComponent({__name:"dataDefine",props:{limit:{type:Number,default:100},editor:{type:Object,required:!0}},setup(r,{expose:e}){const t=o.computed(()=>n.editor.dataModels()),i=o.ref({sn:"new_",title:"新建数据",fields:[]});o.onMounted(()=>{t.value&&t.value[0]&&(i.value=t.value[0])});const n=r;function s(u){i.value=u}function l(){if(t.value.length>=n.limit){ge.Modal.warn({title:"提示信息",content:"数据模型数量超出限制!"});return}const u=lh.v4(),f={sn:u,title:"新建数据",name:"new_",fields:[]};i.value=f,console.log("data model added",f),n.editor.dataModel(u,f)}const a={title:[{required:!0,message:"数据标题不能为空",trigger:"change"}],name:[{required:!0,message:"数据名称不能为空",trigger:"change"}],url:[{required:!0,message:"数据URl不能为空",trigger:"change"}]},c=o.ref(),d=o.inject("closeSetting");function h(){c.value.validate().then(u=>{d&&d()})}return e({toSaving:h}),(u,f)=>{const g=o.resolveComponent("a-input"),R=o.resolveComponent("a-form-item"),p=o.resolveComponent("a-textarea"),M=o.resolveComponent("a-form");return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["unione-props-setting","data-define",n.limit<=1&&"center"])},[n.limit>1?(o.openBlock(),o.createElementBlock("div",R0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.value,S=>(o.openBlock(),o.createElementBlock("div",{key:S.sn,class:o.normalizeClass(["title",i.value&&i.value.sn==S.sn&&"slt"]),onClick:b=>s(S)},o.toDisplayString(S.title),11,p0))),128)),o.createElementVNode("div",{class:"title btn-add",onClick:l},"+")])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["data-model-form",n.limit<=1&&"center"])},[o.createVNode(M,{ref_key:"formObj",ref:c,rules:a,model:i.value,"label-col":{span:4},"wrapper-col":{span:20}},{default:o.withCtx(()=>[o.createVNode(R,{label:"数据标题",name:"title",required:""},{default:o.withCtx(()=>[o.createVNode(g,{value:i.value.title,"onUpdate:value":f[0]||(f[0]=S=>i.value.title=S)},null,8,["value"])]),_:1}),o.createVNode(R,{label:"数据名称",name:"name",required:""},{default:o.withCtx(()=>[o.createVNode(g,{value:i.value.name,"onUpdate:value":f[1]||(f[1]=S=>i.value.name=S)},null,8,["value"])]),_:1}),o.createVNode(R,{label:"数据URL",name:"url",required:"",tooltip:"数据请求url,统一使用post请求,保存接口:url/save,修改接口:url/update,查询接口:url/find,删除接口:url/delete,详情接口:url/detail"},{default:o.withCtx(()=>[o.createVNode(g,{value:i.value.url,"onUpdate:value":f[2]||(f[2]=S=>i.value.url=S)},null,8,["value"])]),_:1}),o.createVNode(R,{label:"数据说明",name:"descs"},{default:o.withCtx(()=>[o.createVNode(p,{value:i.value.descs,"onUpdate:value":f[3]||(f[3]=S=>i.value.descs=S)},null,8,["value"])]),_:1})]),_:1},8,["model"]),o.createVNode(g0,{modelValue:i.value.fields,"onUpdate:modelValue":f[4]||(f[4]=S=>i.value.fields=S)},null,8,["modelValue"])],2)],2)}}}),[["__scopeId","data-v-6be2cc50"]]),S0={class:"unione-props-setting unione-page-setting"},En=Le(o.defineComponent({__name:"pageSetting",props:{editor:{type:Object,required:!0}},setup(r){const e=r,t=o.ref({});return o.onMounted(()=>{t.value=e.editor.define.value}),(i,n)=>{const s=o.resolveComponent("a-form-item"),l=o.resolveComponent("a-input"),a=o.resolveComponent("a-switch"),c=o.resolveComponent("a-textarea"),d=o.resolveComponent("a-form"),h=o.resolveComponent("a-tab-pane"),u=o.resolveComponent("a-tabs");return o.openBlock(),o.createElementBlock("div",S0,[o.createVNode(u,{type:"card"},{default:o.withCtx(()=>[o.createVNode(h,{key:"pageDefine",tab:"页面设置"},{default:o.withCtx(()=>[o.createVNode(d,{model:t.value,name:"basic","label-col":{span:5},"wrapper-col":{span:16},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[t.value.sn&&t.value.sn!="new_"?(o.openBlock(),o.createBlock(s,{key:0,label:"页面编码"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.value.sn)+"/V"+o.toDisplayString(t.value.vers),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(s,{label:"页面标题",required:""},{default:o.withCtx(()=>[o.createVNode(l,{value:t.value.title,"onUpdate:value":n[0]||(n[0]=f=>t.value.title=f)},null,8,["value"])]),_:1}),o.createVNode(s,{label:"页面组件",required:""},{default:o.withCtx(()=>[o.createVNode(l,{value:t.value.component,"onUpdate:value":n[1]||(n[1]=f=>t.value.component=f)},null,8,["value"])]),_:1}),o.createVNode(s,{label:"icon图标"},{default:o.withCtx(()=>[o.createVNode(l,{value:t.value.icon,"onUpdate:value":n[2]||(n[2]=f=>t.value.icon=f)},null,8,["value"])]),_:1}),o.createVNode(s,{label:"是否全局"},{default:o.withCtx(()=>[o.createVNode(a,{checked:t.value.isGlobal,"onUpdate:checked":n[3]||(n[3]=f=>t.value.isGlobal=f),checkedValue:1,checkedChildren:"是",unCheckedChildren:"否",unCheckedValue:0},null,8,["checked"])]),_:1}),o.createVNode(s,{label:"是否模版"},{default:o.withCtx(()=>[o.createVNode(a,{checked:t.value.isTmpl,"onUpdate:checked":n[4]||(n[4]=f=>t.value.isTmpl=f),checkedValue:1,checkedChildren:"是",unCheckedChildren:"否",unCheckedValue:0},null,8,["checked"])]),_:1}),o.createVNode(s,{label:"页面备注"},{default:o.withCtx(()=>[o.createVNode(c,{value:t.value.descs,"onUpdate:value":n[5]||(n[5]=f=>t.value.descs=f),placeholder:"请输入页面备注...",rows:4},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1}),o.createVNode(h,{key:"dataDefine",tab:"数据设置"},{default:o.withCtx(()=>[o.createVNode(m0,{editor:r.editor},null,8,["editor"])]),_:1})]),_:1})])}}}),[["__scopeId","data-v-2420ce7a"]]),Na=Le(o.defineComponent({__name:"editor",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},pageDefine:{type:Object,required:!1}},setup(r){console.log("unione page view setup .....");const e=r,t={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgetList:[],dataModels:[]},component:"unione-page-view"},i=new Fi,n=o.computed(()=>i.$widgetList.value||[]);o.watch(()=>e.pageDefine,l=>{l&&i.load(s.value,l)});const s=o.ref("new_");return o.onMounted(()=>{const l=o.inject("route");console.log("unione page view route",l),s.value=e.psn||l?.query?.psn||l?.meta?.psn||"new_",console.log("unione page view,psn:"+s.value),i.setModel("run"),i.load(s.value,e.pageDefine||t)}),(l,a)=>(o.openBlock(),o.createBlock(Dn,{class:"unione-page-view","setting-title":"页面设置",editor:o.unref(i)},o.createSlots({default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.value,c=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(c.render||c.widget),{key:c.wid,wid:c.wid,widget:c,editor:o.unref(i)},null,8,["wid","widget","editor"]))),128))]),_:2},[o.unref(i)?{name:"page-setting",fn:o.withCtx(()=>[o.createVNode(En,{editor:o.unref(i)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"]))}}),[["__scopeId","data-v-f792d0b4"]]),M0={class:"form-btns"},ba=o.defineComponent({__name:"form",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},pageDefine:{type:Object,required:!1}},setup(r){const e=o.inject("router"),t=r,i={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[],dsnList:[]},component:"unione-page-view"},n=new Fi,s=o.computed(()=>n.$widgetList.value||[]),l=o.computed(()=>{const u=n.define.value?.configs?.btns||[],f=u.map(g=>g.name);if(!f.includes("save")){const g={title:"保存",type:"primary",index:0,visible:!0,size:"default",name:"save"};u.splice(g.index,0,g)}if(!f.includes("submit")){const g={title:"提交",type:"primary",index:1,visible:!0,size:"default",name:"submit"};let R=g.index||1;u.splice(R,0,g)}if(!f.includes("reset")){const g={title:"重置",type:"default",index:2,visible:!0,size:"default",props:{danger:!0},name:"reset"};u.splice(g.index,0,g)}if(!f.includes("back")){const g={title:"返回",type:"default",index:3,visible:!0,size:"default",name:"back"};u.splice(g.index,0,g)}return n.model.value=="view"&&u.filter(g=>["save","submit","reset"].includes(g.name)).forEach(g=>{g.visible=!1}),u});function a({btn:u,event:f}){u.name=="save"&&c(),u.name=="reset",u.name=="back"&&d()}async function c(){const u=n.dataManager().form();let f={};for(let g in u){const R=await u[g].validate();if(n.dataManager().psn()==g){for(let p in f)R[p]=f[p];f=R}else f[g]=R}console.log("=======form data=====",f),n.dataManager().primary().save({data:f,params:n.dataManager().params}).then(g=>{console.log("save result:",g)})}function d(){e.back()}o.watch(()=>t.pageDefine,u=>{u&&n.load(h.value,u)});const h=o.ref("new_");return o.onMounted(()=>{const u=o.inject("route");console.log("unione page view route",u),h.value=t.psn||u?.query?.psn||u?.meta?.psn||"new_",console.log("unione page view,psn:"+h.value),n.setModel(u?.query?.model||u?.meta?.model||"run"),u?.query&&n.dataManager().params(u.query),n.load(h.value,t.pageDefine||i)}),(u,f)=>{const g=o.resolveComponent("unione-btn");return o.openBlock(),o.createBlock(Dn,{class:"unione-page-form","setting-title":"页面设置",editor:o.unref(n)},o.createSlots({default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(s.value,R=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(R.widget),{key:R.wid,wid:R.wid,widget:R,editor:o.unref(n)},null,8,["wid","widget","editor"]))),128)),o.createElementVNode("div",M0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,R=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:R.name},[R.visible!=!1?(o.openBlock(),o.createBlock(g,{key:0,widget:R,editor:o.unref(n),ctx:{},onClick:a},null,8,["widget","editor"])):o.createCommentVNode("",!0)],64))),128))])]),_:2},[o.unref(n)?{name:"page-setting",fn:o.withCtx(()=>[o.createVNode(En,{editor:o.unref(n)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"])}}}),N0=["onMouseover"],b0={key:0,class:"node-opts"},L0={class:"form-warp"},O0={class:"form-btns"},La=o.defineComponent({__name:"tree",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},storage:{type:Object,required:!0},fields:{type:Array,required:!1},setting:{type:Object,required:!0},opts:{type:Object,required:!1},btns:{type:Object,required:!1},event:{type:Object,required:!1}},emits:["btnClick","treeClick"],setup(r,{emit:e}){const t=te.useDialog(),i=o.inject("router"),n=r,s={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[],dsnList:[]},component:"unione-page-tree"};function l(){if(n.fields?.length){const H={widget:"unione-form",dsn:"primary",primary:!0,widgets:n.fields};s.configs.widgets=[H]}s.configs.dsnList=["primary"],a.dataManager().use("primary","form").store(n.storage),s.configs.btns=n.btns||[],n.btns==!1&&(s.configs.btns=!1),s.configs.opts=n.opts||[],n.opts==!1&&(s.configs.opts=!1),s.configs.event=n.event||{},s.configs.setting=n.setting||{}}const a=new Fi,c=o.ref(!1),d=o.ref([]),h=o.ref({}),u=o.ref(null),f=o.ref(null),g=o.ref([]),R=o.ref([]),p=o.ref(0),M=o.computed(()=>{const H={disabled:!1,draggable:!1,multiple:!1,selectable:!0,checkable:!1,showLine:!0,showIcon:!0,idField:"id",pidField:"pid",labelField:"title",leafField:"isLeaf",iconField:"iconName",...n.setting?.tree||{}};return a.define.value?.configs?.tree||H}),S=o.computed(()=>{const H=a.define.value?.configs?.opts;if(typeof H=="boolean"&&H==!1)return!1;const U=(H||[]).map(_=>typeof _=="string"?{name:_,visible:!1}:_),K=[];return U.forEach(_=>{K.push(_.name)}),console.log("opts addBtn",U),U.filter(_=>_.name=="add")[0]||{visible:!0,name:"add",icon:"PlusOutlined",title:"新建",props:{block:!0,type:"dashed"}}}),b=o.computed(()=>{const H=a.define.value?.configs?.opts;if(typeof H=="boolean"&&H==!1)return[];const U=(H||[]).map(J=>typeof J=="string"?{name:J,visible:!1}:J),K=[],_=[];return U.forEach(J=>{_.push(J.name),J.name!="add"&&K.push(J)}),_.includes("delete")||K.splice(1,0,{visible:!0,name:"delete",icon:"DeleteOutlined",tooltip:"删除",props:{type:"text"}}),_.includes("child")||K.splice(2,0,{visible:!0,name:"child",icon:"PlusOutlined",tooltip:"创建下级",props:{type:"text"}}),console.log("opts menuBtn",K),K});function P({btn:H,event:U},K){U.stopPropagation();const _=h.value[K[M.value.idField]];if(console.log("onTreeMenuClick,btn:",H),console.log("onTreeMenuClick,node:",K),console.log("onTreeMenuClick,curentNode:",_),H.name=="child"){const J=h.value[_[M.value.idField]];J.isLeaf=!1,u.value={},u.value[M.value.pidField]=J[M.value.idField],u.value[M.value.labelField]="新建...",u.value[M.value.idField]="new_"+p.value,u.value.parentNode=J,p.value=p.value+1,J.children||(J.children=[],R.value.push(J[M.value.idField])),v.value.createNode&&v.value.createNode(u.value,J,a.dataManager().params()),h.value[u.value[M.value.idField]]=u.value,J.children.push(u.value),g.value=[u.value[M.value.idField]],a.dataManager().primary().setValue(u.value)}H.name=="delete"&&(_[M.value.idField]&&(_[M.value.idField]+"").startsWith("new_")?(_.parentNode?_.parentNode.children=_.parentNode.children.filter(J=>J[M.value.idField]!=_[M.value.idField]):d.value=d.value.filter(J=>J[M.value.idField]!=_[M.value.idField]),delete h.value[_[M.value.idField]]):a.dataManager().primary().deleteByIds([_[M.value.idField]]).then(()=>{if(_.parentNode){const J=h.value[_[M.value.pidField]];J.children=J.children.filter(G=>G[M.value.idField]!=_[M.value.idField])}else d.value=d.value.filter(J=>J[M.value.idField]!=_[M.value.idField]);delete h.value[_[M.value.idField]]}))}function N(H,{expanded:U,node:K}){U&&(u.value=K.dataRef,a.dataManager().primary().setValue(u.value),L())}function m(H,U){U.selected?(u.value=U.node.dataRef,a.dataManager().primary().setValue(u.value)):u.value&&(g.value=[u.value[M.value.idField]]),Z("treeClick",{keys:H,event:U})}const T=o.computed(()=>{if(n.storage?.orderBy){const H=n.storage.orderBy.split(" ");return[{name:H[0],asc:H[1].toLowerCase()=="asc"}]}return[]});o.watch(()=>n.params,()=>{c.value&&(d.value=[],h.value={},u.value=null,g.value=[],R.value=[],p.value=0,a.dataManager().params(n.params||{}),console.log("params changed props.params",n.params),L())}),o.watch(()=>u.value,()=>{console.log("active node changed",u.value),x(!u.value)});const y=o.ref(null);o.watch(y,()=>{y.value&&u.value&&a.dataManager().primary().setValue(u.value)});function x(H=!0){const U=a.dataManager().form();for(let K in U)U[K].setDisabled(H)}function I(){if(u.value={},u.value[M.value.pidField]=-1,u.value[M.value.labelField]="新建...",u.value[M.value.idField]="new_"+p.value,p.value=p.value+1,v.value.createNode&&v.value.createNode(u.value,null,a.dataManager().params()),u.value[M.value.pidField]==-1)d.value.push(u.value);else{const H=h.value[u.value[M.value.pidField]];H?(H.children||(H.children=[]),H.children.push(u.value)):d.value.push(u.value)}g.value=[u.value[M.value.idField]],h.value[u.value[M.value.idField]]=u.value,a.dataManager().primary().setValue(u.value)}const V=o.ref(""),F=So(()=>{a.dataManager().primary().find({page:1,pageSize:9999,keywords:V.value,needCount:!1,body:M.value.async==!1?null:{},sorts:T.value}).then(H=>{if(h.value={},d.value=[],H.body?.length){const U={};H.body.forEach(K=>{U[K[M.value.idField]]=K}),H.body.forEach(K=>{const _=U[K[M.value.pidField]];_?(_.children||(_.children=[],_.isLeaf=!1),_.children.push(K)):d.value.push(K)})}})},400);function L(){const H={};if(H[M.value.pidField]=n.params[M.value.pidField]||-1,u.value){if(u.value.children?.length||M.value.async==!1)return;H[M.value.pidField]=u.value[M.value.idField],a.dataManager().primary().find({page:1,pageSize:999,body:H,sorts:T.value}).then(U=>{u.value.children=U.body||[],u.value.children.forEach(K=>{K.isLeaf=!!K[M.value.leafField],h.value[K[M.value.idField]]=K,K.parentNode=h.value[K[M.value.pidField]]})})}else{const U=M.value.async==!1?null:{page:1,pageSize:999,body:H,sorts:T.value};a.dataManager().primary().find(U).then(K=>{if(M.value.async==!1){if(d.value=[],K.body?.length){const _={};K.body.forEach(J=>{_[J[M.value.idField]]=J}),K.body.forEach(J=>{const G=_[J[M.value.pidField]];G?(G.children||(G.children=[],G.isLeaf=!1),G.children.push(J)):d.value.push(J)})}}else d.value=K.body||[],d.value.forEach(_=>{_.isLeaf=!!_[M.value.leafField],h.value[_[M.value.idField]]=_})})}}const w=o.computed(()=>a.$widgetList.value||[]),v=o.computed(()=>{const H={...a.define.value?.configs?.event||{}};for(const U in H)H[U]&&typeof H[U]!="function"&&H[U].enable&&H[U].scriptText&&(U=="createNode"?H[U]=new Function("node","parent","params",H[U].scriptText):H[U]=new Function("data","event",H[U].scriptText));return H}),X=o.computed(()=>a.define.value?.configs?.setting||n.setting||{});o.provide("pageSetting",X.value);const C=o.computed(()=>{const H=a.define.value?.configs?.btns;if(typeof H=="boolean"&&H==!1)return[];const U=(a.define.value?.configs?.btns||[]).map(_=>typeof _=="string"?{name:_,visible:!1}:{size:"default",..._}),K=U.map(_=>_.name);if(!K.includes("save")){const _={title:"保存",type:"primary",index:0,visible:!0,size:"default",name:"save"};U.splice(_.index,0,_)}if(!K.includes("reset")){const _={title:"重置",type:"default",index:1,visible:!0,size:"default",props:{danger:!0},name:"reset"};U.splice(_.index,0,_)}if(!K.includes("back")){const _={title:"返回",type:"default",index:U.length,visible:!0,size:"default",name:"back"};U.splice(_.index,0,_)}return a.model.value=="view"&&U.filter(_=>["save","submit","reset"].includes(_.name)).forEach(_=>{_.visible=!1}),U}),Z=e;function k({btn:H,event:U}){H.name=="save"&&Q({btn:H,event:U}),H.name=="reset",H.name=="back"&&Y(),Z("btnClick",{btn:H,event:U})}async function Q(H){const U=a.dataManager().form();let K={...u.value};for(let _ in U){const J=await U[_].validate();if(a.dataManager().psn()==_)for(let G in J)K[G]=J[G];else K[_]=J}if(K[M.value.pidField]&&(K[M.value.pidField]+"").startsWith("new_")){t.error({content:"请先保存父节点!"});return}K[M.value.idField]&&(K[M.value.idField]+"").startsWith("new_")&&delete K[M.value.idField],delete K.parentNode,delete K.children,K[M.value.leafField]=K[M.value.leafField]?1:0,v.value.preSave&&v.value.preSave(K,H),console.log("=======form data=====",K),a.dataManager().primary().save({data:K}).then(_=>{console.log("save result:",_),u.value[M.value.idField]=_.body,g.value=[_.body],h.value[_.body]=u.value,u.value.children?.forEach(J=>{J[M.value.pidField]=_.body}),v.value.postSaved&&v.value.postSaved(K,H)})}function Y(){i.back()}const W=o.ref("new_");return o.onMounted(()=>{const H=o.inject("route");console.log("unione page tree route",H),W.value=n.psn||H?.query?.psn||H?.meta?.psn||"new_",console.log("unione page tree,psn:"+W.value),a.setModel(H?.query?.model||H?.meta?.model||"run");const U={...n.params||{},...H?.query||{},...H?.params||{}};a.dataManager().params(U),l(),a.load(W.value,s),o.nextTick(()=>{x(!0)}),L(),c.value=!0}),(H,U)=>{const K=o.resolveComponent("SearchOutlined"),_=o.resolveComponent("a-input"),J=o.resolveComponent("unione-btn"),G=o.resolveComponent("a-tree");return o.openBlock(),o.createBlock(Dn,{class:"unione-page-tree","setting-title":"页面设置",editor:o.unref(a)},o.createSlots({default:o.withCtx(()=>[o.createElementVNode("div",{class:"tree-warp",onContextmenu:U[4]||(U[4]=o.withModifiers(()=>{},["prevent"]))},[o.createVNode(_,{size:"small",class:"input-search",placeholder:"输入关键字搜索...",value:V.value,"onUpdate:value":U[0]||(U[0]=se=>V.value=se),onChange:o.unref(F),onPressEnter:o.unref(F)},{suffix:o.withCtx(()=>[o.createVNode(K)]),_:1},8,["value","onChange","onPressEnter"]),S.value?(o.openBlock(),o.createBlock(J,{key:0,widget:S.value,onClick:I},null,8,["widget"])):o.createCommentVNode("",!0),o.createVNode(G,{"show-line":M.value.showLine,"show-icon":M.value.showIcon,disabled:M.value.disabled,blockNode:!0,draggable:M.value.draggable,multiple:M.value.multiple,selectable:M.value.selectable,checkable:M.value.checkable,fieldNames:{title:M.value.labelField,key:M.value.idField},selectedKeys:g.value,"onUpdate:selectedKeys":U[2]||(U[2]=se=>g.value=se),expandedKeys:R.value,"onUpdate:expandedKeys":U[3]||(U[3]=se=>R.value=se),"tree-data":d.value,onExpand:N,onSelect:m},o.createSlots({icon:o.withCtx(({dataRef:se})=>[se[M.value.iconField]?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(se[M.value.iconField]),{key:0,class:"node-icon"})):o.createCommentVNode("",!0)]),_:2},[b.value?.length?{name:"title",fn:o.withCtx(({dataRef:se})=>[o.createElementVNode("div",{class:"node-label",onMouseover:()=>f.value=se,onMouseleave:U[1]||(U[1]=()=>f.value=null)},[o.createElementVNode("span",null,o.toDisplayString(se[M.value.labelField]),1),u.value&&u.value[M.value.idField]==se[M.value.idField]||f.value&&f.value[M.value.idField]==se[M.value.idField]?(o.openBlock(),o.createElementBlock("div",b0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(b.value,ae=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[!v.value.btnVisible||v.value.btnVisible(ae,se)?(o.openBlock(),o.createBlock(J,{key:ae.name,widget:ae,ctx:{node:se},onClick:we=>P(we,se)},null,8,["widget","ctx","onClick"])):o.createCommentVNode("",!0)],64))),256))])):o.createCommentVNode("",!0)],40,N0)]),key:"0"}:void 0]),1032,["show-line","show-icon","disabled","draggable","multiple","selectable","checkable","fieldNames","selectedKeys","expandedKeys","tree-data"])],32),o.createElementVNode("div",L0,[o.renderSlot(H.$slots,"form-warp",{class:"form-warp"},()=>[o.createElementVNode("div",{ref_key:"formWarp",ref:y},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(w.value,se=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(se.widget),{key:se.wid,wid:se.wid,widget:se,editor:o.unref(a)},null,8,["wid","widget","editor"]))),128)),o.createElementVNode("div",O0,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.value,se=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:se.name},[se.visible!=!1?(o.openBlock(),o.createBlock(J,{key:0,widget:se,editor:o.unref(a),disabled:!u.value,ctx:{},onClick:k},null,8,["widget","editor","disabled"])):o.createCommentVNode("",!0)],64))),128))])],512)])])]),_:2},[o.unref(a)?{name:"page-setting",fn:o.withCtx(()=>[o.createVNode(En,{editor:o.unref(a)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"])}}}),Oa=o.defineComponent({__name:"list",props:{psn:{type:String,required:!1},params:{type:Object,default(){return{}}},storage:{type:Object,required:!0},fields:{type:Array,required:!0},queryBtns:{type:Array,required:!1},operation:{type:Object,required:!1},selection:{type:Object,required:!1},leftBtns:{type:Object,required:!1},rightBtns:{type:Object,required:!1}},emits:["btnClick"],setup(r,{expose:e,emit:t}){const i=r,n=o.ref(null),s={sn:"new_",title:"新建页面",types:"code",vers:1,configs:{widgets:[{widget:"unione-query",dsn:"",primary:!0,fields:[]},{widget:"unione-table",dsn:"",columns:[]}],dsnList:[]},component:"unione-page-list"};function l(){if(i.fields?.length){s.configs.widgets[0].dsn="primary",s.configs.widgets[0].fields=i.fields.filter(P=>P.isQuery),s.configs.widgets[0].btns=i.queryBtns||[],s.configs.widgets[0].params=i.params||{},s.configs.dsnList=["primary"],s.configs.widgets[1].dsn="primary";const b=i.fields.filter(P=>P.isPk)[0];b&&b.name&&(s.configs.widgets[1].dataKey=b.name),s.configs.widgets[1].columns=i.fields.filter(P=>P.hidden!=!0),s.configs.widgets[1].operation=te.utils.obj.ext(s.configs.widgets[1].operation,i.operation||{}),i.operation==!1&&(s.configs.widgets[1].operation=!1),i.selection==!1&&(s.configs.widgets[1].selection=!1),s.configs.widgets[1].leftBtns=i.leftBtns==!1?!1:i.leftBtns||[],s.configs.widgets[1].rightBtns=i.rightBtns==!1?!1:i.rightBtns||[],a.dataManager().use("primary","list").store(i.storage)}}const a=new Fi,c=o.computed(()=>a.$widgetList.value||[]),d=t;function h(b){d("btnClick",b)}const u=o.ref("new_");o.onMounted(()=>{const b=o.inject("route");console.log("unione page view route",b),u.value=i.psn||b?.query?.psn||b?.meta?.psn||"new_",console.log("unione page view,psn:"+u.value),a.setModel(b?.query?.model||b?.meta?.model||"run");const P={...i.params||{},...b?.query||{},...b?.params||{}};a.dataManager().params(P),l(),a.load(u.value,s)});function f(){return a.dataManager().use("primary","list")}function g(b){b?a.ebus.$emit("table-list-search",b):a.ebus.$emit("table-list-reload")}function R(b){a.dataManager().params(b),a.ebus.$emit("query-form-params",b),a.ebus.$emit("table-list-search",{params:b})}function p(){return n.value?n.value[0]:null}function M(){return n.value?n.value[0].getSelected():null}function S(){n.value&&n.value[0].clearSelected()}return e({storage:f,editor:a,reload:g,setParams:R,getTable:p,getSelected:M,clearSelected:S}),(b,P)=>(o.openBlock(),o.createBlock(Dn,{class:"unione-page-list","setting-title":"页面设置",editor:o.unref(a)},o.createSlots({default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.value,N=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:N.wid},[N.widget=="unione-table"?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(N.widget),{key:0,wid:N.wid,widget:N,editor:o.unref(a),onBtnClick:h,ref_for:!0,ref_key:"table",ref:n},null,40,["wid","widget","editor"])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(N.widget),{key:1,wid:N.wid,widget:N,editor:o.unref(a),onBtnClick:h},null,40,["wid","widget","editor"]))],64))),128))]),_:2},[o.unref(a)?{name:"page-setting",fn:o.withCtx(()=>[o.createVNode(En,{editor:o.unref(a)},null,8,["editor"])]),key:"0"}:void 0]),1032,["editor"]))}}),Di={release(r){return te.axios.admin({url:"/api/data/define/release",method:"post",data:r})},find(r){return te.axios.admin({url:"/api/data/define/find",method:"post",data:r})},save(r){return te.axios.admin({url:"/api/data/define/save",method:"post",data:r})},delete(r){return te.axios.admin({url:"/api/data/define/delete",method:"post",data:r})},detail(r){return te.axios.admin({url:"/api/data/define/detail",method:"post",headers:{"Content-Type":"application/json"},data:r})},loadFromDb(r){return te.axios.admin({url:"/api/data/define/load/from/db",method:"post",headers:{"Content-Type":"multipart/form-data"},data:r})},impFromDb(r){return te.axios.admin({url:"/api/data/define/imp/from/db",method:"post",headers:{"Content-Type":"multipart/form-data"},data:r})}},P0={class:"unione-page list-page"},T0=Le(o.defineComponent({__name:"list",setup(r){const e=Dt(),t=te.useDialog(),i=o.inject("router"),n=o.ref({fields:[{title:"标题",name:"title"},{title:"名称",name:"name"},{title:"状态",name:"status"},{title:"类别",name:"category"}]}),s=o.ref({leftBtns:[{visible:!1,name:"delBatch"},{title:"从数据库导入",icon:"FunnelPlotOutlined",name:"impFromDb",props:{danger:!0,ghost:!0}},{title:"代码生成",icon:"CodeOutlined",name:"genCode"}],rightBtns:[{visible:!1,name:"downTmpl"}],columns:[{title:"类别",name:"category"},{title:"标题",name:"title"},{title:"名称",name:"name"},{title:"编码",name:"sn"},{title:"版本",name:"vers"},{title:"发布时间",name:"publishDate"},{title:"创建时间",name:"created"},{title:"状态",name:"status"}],operation:{title:"操作",width:190,btns:[{title:"预览",name:"view"},{title:"版本发布",name:"release",props:{danger:!0}},{title:"版本管理",name:"vers"},{title:"配置管理",name:"configs"},{title:"权限管理",name:"permis"},{title:"权限分配",name:"auth"},{title:"复制",name:"copy"}],count:2,more:{layout:"vertical"}}});o.onMounted(()=>{a()});const l=o.ref({pagination:{total:0,current:1,pageSize:20},loading:!1,params:{},data:[]});function a(){l.value.loading=!0,Di.find({page:l.value.pagination.current,pageSize:l.value.pagination.pageSize,body:l.value.params,keywords:l.value.keywords}).then(N=>{l.value.data=N.body,l.value.pagination.total=N.total*1}).finally(()=>{l.value.loading=!1})}function c(N){l.value.pagination.current=N.pagination.current,l.value.pagination.pageSize=N.pagination.pageSize,a()}function d({params:N,keywords:m}){l.value.pagination.current=1,l.value.params=N,l.value.keywords=m,a()}function h({btn:N,event:m,row:T}){console.log("table btn click",N,m,T),(N.name=="add"||N.name=="edit")&&i.push({path:"/dev/data/define/edit",query:T?{id:T.id}:{}}),N.name=="impFromDb"&&(f.value=!0),N.name=="release"&&u(T),N.name=="view"&&i.push({path:e.listPageUrl,query:{psn:T.sn+":list",model:"preview"}})}function u(N){t.confirm({content:"确定要发布当前数据么?",onOk:()=>{Di.release([N.id]).then(m=>{m.success?(t.success({title:"发布成功",content:m.body}),a()):t.error({title:"发布失败",content:m.body})})}})}const f=o.ref(!1),g=o.ref({keywords:{visible:!1},fields:[{title:"数据源",name:"dsId",value:1,visible:!0,widget:"unione-select-box",convert:{types:"local",url:"/api/data/source/find",search:!0}},{title:"名称",name:"tableName",visible:!0}],btns:[{visible:!1,name:"reset"},{name:"advanced",visible:!1},{name:"imp",title:"提交",props:{danger:!0}}]}),R=o.ref({leftBtns:!1,rightBtns:!1,columns:[{title:"名称",name:"name"},{title:"标题",name:"title"}],operation:!1}),p=o.ref({pagination:{total:0,current:1,pageSize:10},loading:!1,params:{},data:[]});function M(N){!N||!Object.keys(N).length||!N.dsId||(ge.message.loading("数据加载中..."),p.value.params=N,p.value.loading=!0,Di.loadFromDb(N).then(m=>{p.value.loading=!1,ge.message.destroy(),m.success?(m.body.forEach(T=>{T.checkable=!!T.id}),p.value.data=m.body,p.value.pagination.total=m.body.length):ge.message.error(m.message)}))}function S(N){p.value.pagination.current=N.pagination.current,p.value.pagination.pageSize=N.pagination.pageSize}const b=o.ref();function P({btn:N}){if(N.name!="imp")return;const m=b.value.getSelected();m?.keys?.length?t.confirm({content:"确定导入选中的"+m.keys.length+"条记录么?",onOk:()=>{ge.message.loading("数据导入中..."),Di.impFromDb({dsId:p.value.params.dsId,tables:m.keys.join()}).then(T=>{ge.message.destroy(),T.success?(t.success({content:T.message}),l.value.pagination.current=1,a()):t.error({context:T.message})})}}):t.error({content:"请选择目标记录!"})}return(N,m)=>{const T=o.resolveComponent("UnioneQuery"),y=o.resolveComponent("UnioneTable"),x=o.resolveComponent("a-drawer");return o.openBlock(),o.createElementBlock("div",P0,[o.createVNode(T,{widget:n.value,onQuery:d,onReset:d},null,8,["widget"]),o.createVNode(y,{widget:s.value,dataList:l.value.data,loading:l.value.loading,pagination:l.value.pagination,onChange:c,onBtnClick:h},null,8,["widget","dataList","loading","pagination"]),o.createVNode(x,{title:"从数据库中导入",width:550,visible:f.value,"onUpdate:visible":m[0]||(m[0]=I=>f.value=I),placement:"left"},{default:o.withCtx(()=>[o.createVNode(T,{widget:g.value,onQuery:M,onReset:M,onBtnClick:P,class:"load-table-form"},null,8,["widget"]),o.createVNode(y,{widget:R.value,dataList:p.value.data,loading:p.value.loading,pagination:p.value.pagination,onChange:S,rowKey:"name",ref_key:"loadTableObj",ref:b},null,8,["widget","dataList","loading","pagination"])]),_:1},8,["visible"])])}}}),[["__scopeId","data-v-165bc175"]]),I0={class:"unione-props-setting data-field-manage"},x0={key:0},w0={key:1},y0=["onClick"],V0=["onClick"],F0=["onClick"],X0={key:1},C0=Le(o.defineComponent({__name:"dataFieldMange",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:g})=>g+1},{title:"名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"标题",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"数据类型",dataIndex:"dataType",key:"dataType",width:"80px",align:"center"},{title:"长度",dataIndex:"dataLen",key:"dataLen",width:"60px",align:"center"},{title:"小数点",dataIndex:"dataPrec",key:"dataPrec",width:"60px",align:"center"},{title:"默认值",dataIndex:"dataValue",key:"dataValue",width:"60px",align:"center"},{title:"主键",dataIndex:"isPk",key:"isPk",width:"40px",align:"center"},{title:"外键",dataIndex:"isFk",key:"isFk",width:"30px",align:"center"},{title:"非空",dataIndex:"isNull",key:"isNull",width:"30px",align:"center"},{title:"同步",dataIndex:"syncEnable",key:"syncEnable",width:"30px",align:"center"},{title:"备注",dataIndex:"descs",key:"descs",width:"140px",align:"center"}]),t=o.useModel(r,"modelValue"),i=o.ref({selectedRowKeys:[],columnWidth:"25px",onChange:g=>{g.forEach(R=>{i.value.selectedRowKeys.includes(R)||i.value.selectedRowKeys.push(R);const p=[];t.value.forEach(M=>{!g.includes(M.name)&&i.value.selectedRowKeys.includes(M.name)&&p.push(M.name)}),p.length&&(i.value.selectedRowKeys=i.value.selectedRowKeys.filter(M=>!p.includes(M)))})}}),n={mounted:g=>g.focus()},s=o.ref({});function l(){const g=Object.keys(s.value);if(g.length)for(let R in g){const p=t.value.filter(M=>M.name==R);if(p&&p[0]){let M=s.value[R];Object.keys(M).forEach(S=>{p[0][S]=M[S]})}}s.value={}}function a(g,R){l();const p={};p[R]=g[R]||"",s.value[g.name]=p}function c(g,R){if(!g||!R){s.value={};return}const p=s.value[g.name][R];if(R=="name"&&t.value.filter(S=>S[R]==p&&S.name!=g.name).length>0){ge.Modal.warn({title:"提示信息",content:"字段名称["+p+"]已存在"});return}g[R]=p,s.value={}}function d(g,R){const p=t.value.filter(M=>M.name==g.name)[0];return R=="isFk"?p.configs?.fkey?.enable:p[R]==1}function h(g,R){const p=t.value.filter(M=>M.name==g.name)[0];R=="isFk"?(p.configs||(p.configs={}),p.configs.fkey||(p.configs.fkey={}),p.configs.fkey.enable=!p.configs.fkey.enable):p[R]!=1?p[R]=1:p[R]=0}function u(){if(l(),t.value.filter(p=>p.name=="new_").length>0){s.value.new_={name:"new_"};return}const R={title:"",name:"new_",dataType:"String",isPk:0};t.value.push(R),s.value[R.name]={name:"new_"}}function f(){if(!i.value.selectedRowKeys.length){ge.Modal.info({title:"提示信息",content:"请选择要删除的字段!"});return}ge.Modal.confirm({title:"确认信息",content:"确定要删除选中的["+i.value.selectedRowKeys.length+"]字段么?",onOk:()=>{t.value=t.value.filter(g=>!i.value.selectedRowKeys.includes(g.name)),i.value.selectedRowKeys=[]}})}return(g,R)=>{const p=o.resolveComponent("a-button"),M=o.resolveComponent("a-tooltip"),S=o.resolveComponent("a-input"),b=o.resolveComponent("a-input-number"),P=o.resolveComponent("a-select-option"),N=o.resolveComponent("a-select"),m=o.resolveComponent("a-checkbox"),T=o.resolveComponent("a-table");return o.openBlock(),o.createElementBlock("div",I0,[o.createVNode(p,{class:"btn btn-add",type:"primary",onClick:u,size:"small"},{default:o.withCtx(()=>R[1]||(R[1]=[o.createTextVNode("新增")])),_:1}),o.createVNode(p,{class:"btn btn-delete",type:"primary",danger:"",onClick:f,size:"small"},{default:o.withCtx(()=>R[2]||(R[2]=[o.createTextVNode(" 删除 ")])),_:1}),o.createVNode(T,{columns:e.value,"data-source":t.value,pagination:!0,bordered:"","row-selection":i.value,scroll:{x:1150},"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:y})=>[["name","title"].includes(y.key)?(o.openBlock(),o.createElementBlock("span",x0,[R[3]||(R[3]=o.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(y.title),1)])):o.createCommentVNode("",!0),["descs","dataLen","dataPrec","dataValue","dataType"].includes(y.key)?(o.openBlock(),o.createElementBlock("span",w0,[o.createVNode(o.unref(li.FormOutlined)),o.createTextVNode(" "+o.toDisplayString(y.title),1)])):o.createCommentVNode("",!0),y.key==="isPk"?(o.openBlock(),o.createBlock(M,{key:2,title:"至少配置一个主键字段"},{default:o.withCtx(()=>[R[4]||(R[4]=o.createElementVNode("span",{style:{color:"red","margin-right":"3px","font-size":"16px"}},"*",-1)),o.createTextVNode(o.toDisplayString(y.title),1)]),_:2},1024)):o.createCommentVNode("",!0),y.key==="isFk"?(o.openBlock(),o.createBlock(M,{key:3,title:"是否是外键字段"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(y.title),1)]),_:2},1024)):o.createCommentVNode("",!0),y.key==="isNull"?(o.openBlock(),o.createBlock(M,{key:4,title:"是否允许为空"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(y.title),1)]),_:2},1024)):o.createCommentVNode("",!0),y.key==="syncEnable"?(o.openBlock(),o.createBlock(M,{key:5,title:"是否同步到数据库"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(y.title),1)]),_:2},1024)):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:y,text:x,record:I})=>[["name","title","descs","dataValue"].includes(y.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!s.value[I.name]||!Object.keys(s.value[I.name]).includes(y.dataIndex))&&!x&&"empty"]),onClick:V=>a(I,y.dataIndex)},[s.value[I.name]&&Object.keys(s.value[I.name]).includes(y.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(S,{key:0,value:s.value[I.name][y.dataIndex],"onUpdate:value":V=>s.value[I.name][y.dataIndex]=V,onBlur:V=>c(I,y.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[n]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(x||" "),1)],64))],10,y0)):o.createCommentVNode("",!0),["dataLen","dataPrec"].includes(y.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!s.value[I.name]||!Object.keys(s.value[I.name]).includes(y.dataIndex))&&!x&&"empty"]),onClick:V=>a(I,y.dataIndex)},[s.value[I.name]&&Object.keys(s.value[I.name]).includes(y.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(b,{key:0,value:s.value[I.name][y.dataIndex],"onUpdate:value":V=>s.value[I.name][y.dataIndex]=V,onBlur:V=>c(I,y.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[n]]):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(x||" "),1)],64))],10,V0)):["dataType"].includes(y.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!s.value[I.name]||!Object.keys(s.value[I.name]).includes(y.dataIndex))&&!x&&"empty"]),onClick:V=>a(I,y.dataIndex)},[s.value[I.name]&&Object.keys(s.value[I.name]).includes(y.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(N,{key:0,value:I[y.dataIndex],"onUpdate:value":V=>I[y.dataIndex]=V,onBlur:R[0]||(R[0]=V=>c())},{default:o.withCtx(()=>[o.createVNode(P,{key:"String",value:"String"}),o.createVNode(P,{key:"Long",value:"Long"}),o.createVNode(P,{key:"Short",value:"Short"}),o.createVNode(P,{key:"Integer",value:"Integer"}),o.createVNode(P,{key:"Float",value:"Float"}),o.createVNode(P,{key:"Double",value:"Double"}),o.createVNode(P,{key:"Date",value:"Date"}),o.createVNode(P,{key:"Timestamp",value:"Timestamp"})]),_:2},1032,["value","onUpdate:value"])),[[n]]):(o.openBlock(),o.createElementBlock("span",X0,o.toDisplayString(x),1))],10,F0)):["syncEnable","isFk","isPk"].includes(y.dataIndex)?(o.openBlock(),o.createBlock(m,{key:3,checked:d(I,y.dataIndex),onClick:V=>h(I,y.dataIndex)},null,8,["checked","onClick"])):["isNull"].includes(y.dataIndex)?(o.openBlock(),o.createBlock(m,{key:4,checked:!d(I,y.dataIndex),onClick:V=>h(I,y.dataIndex)},null,8,["checked","onClick"])):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])])}}}),[["__scopeId","data-v-4020e3f0"]]),Pa=1024;let v0=0,zo=class{constructor(e,t){this.from=e,this.to=t}};class Te{constructor(e={}){this.id=v0++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Nt.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}Te.closedBy=new Te({deserialize:r=>r.split(" ")}),Te.openedBy=new Te({deserialize:r=>r.split(" ")}),Te.group=new Te({deserialize:r=>r.split(" ")}),Te.isolate=new Te({deserialize:r=>{if(r&&r!="rtl"&&r!="ltr"&&r!="auto")throw new RangeError("Invalid value for isolate: "+r);return r||"auto"}}),Te.contextHash=new Te({perNode:!0}),Te.lookAhead=new Te({perNode:!0}),Te.mounted=new Te({perNode:!0});class Os{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[Te.mounted.id]}}const W0=Object.create(null);class Nt{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):W0,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new Nt(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(n)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Te.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return i=>{for(let n=i.prop(Te.group),s=-1;s<(n?n.length:0);s++){let l=t[s<0?i.name:n[s]];if(l)return l}}}}Nt.none=new Nt("",Object.create(null),0,8);class $o{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let n=null;for(let s of e){let l=s(i);l&&(n||(n=Object.assign({},i.props)),n[l[0].id]=l[1])}t.push(n?new Nt(i.name,n,i.id,i.flags):i)}return new $o(t)}}const Ps=new WeakMap,Ta=new WeakMap;var je;(function(r){r[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays"})(je||(je={}));class Be{constructor(e,t,i,n,s){if(this.type=e,this.children=t,this.positions=i,this.length=n,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,a]of s)this.props[typeof l=="number"?l:l.id]=a}}toString(){let e=Os.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let n=i.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new el(this.topNode,e)}cursorAt(e,t=0,i=0){let n=Ps.get(this)||this.topNode,s=new el(n);return s.moveTo(e,t),Ps.set(this,s._tree),s}get topNode(){return new Ft(this,0,0,null)}resolve(e,t=0){let i=Un(Ps.get(this)||this.topNode,e,t,!1);return Ps.set(this,i),i}resolveInner(e,t=0){let i=Un(Ta.get(this)||this.topNode,e,t,!0);return Ta.set(this,i),i}resolveStack(e,t=0){return E0(this,e,t)}iterate(e){let{enter:t,leave:i,from:n=0,to:s=this.length}=e,l=e.mode||0,a=(l&je.IncludeAnonymous)>0;for(let c=this.cursor(l|je.IncludeAnonymous);;){let d=!1;if(c.from<=s&&c.to>=n&&(!a&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;d=!0}for(;d&&i&&(a||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:il(Nt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,n)=>new Be(this.type,t,i,n,this.propValues),e.makeTree||((t,i,n)=>new Be(Nt.none,t,i,n)))}static build(e){return U0(e)}}Be.empty=new Be(Nt.none,[],[],0);class jo{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new jo(this.buffer,this.index)}}class Oi{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Nt.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],n=this.set.types[t],s=n.name;if(/\W/.test(s)&&!n.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let l=[];for(;e<i;)l.push(this.childString(e)),e=this.buffer[e+3];return s+"("+l.join(",")+")"}findChild(e,t,i,n,s){let{buffer:l}=this,a=-1;for(let c=e;c!=t&&!(Ia(s,n,l[c+1],l[c+2])&&(a=c,i>0));c=l[c+3]);return a}slice(e,t,i){let n=this.buffer,s=new Uint16Array(t-e),l=0;for(let a=e,c=0;a<t;){s[c++]=n[a++],s[c++]=n[a++]-i;let d=s[c++]=n[a++]-i;s[c++]=n[a++]-e,l=Math.max(l,d)}return new Oi(s,l,this.set)}}function Ia(r,e,t,i){switch(r){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Un(r,e,t,i){for(var n;r.from==r.to||(t<1?r.from>=e:r.from>e)||(t>-1?r.to<=e:r.to<e);){let l=!i&&r instanceof Ft&&r.index<0?null:r.parent;if(!l)return r;r=l}let s=i?0:je.IgnoreOverlays;if(i)for(let l=r,a=l.parent;a;l=a,a=l.parent)l instanceof Ft&&l.index<0&&((n=a.enter(e,t,s))===null||n===void 0?void 0:n.from)!=l.from&&(r=a);for(;;){let l=r.enter(e,t,s);if(!l)return r;r=l}}class xa{cursor(e=0){return new el(this,e)}getChild(e,t=null,i=null){let n=wa(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return wa(this,e,t,i)}resolve(e,t=0){return Un(this,e,t,!1)}resolveInner(e,t=0){return Un(this,e,t,!0)}matchContext(e){return qo(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(i=t,t=n.prevSibling):t=n}return i}get node(){return this}get next(){return this.parent}}class Ft extends xa{constructor(e,t,i,n){super(),this._tree=e,this.from=t,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,n,s=0){for(let l=this;;){for(let{children:a,positions:c}=l._tree,d=t>0?a.length:-1;e!=d;e+=t){let h=a[e],u=c[e]+l.from;if(Ia(n,i,u,u+h.length)){if(h instanceof Oi){if(s&je.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,i-u,n);if(f>-1)return new Pi(new k0(l,h,e,u),null,f)}else if(s&je.IncludeAnonymous||!h.type.isAnonymous||tl(h)){let f;if(!(s&je.IgnoreMounts)&&(f=Os.get(h))&&!f.overlay)return new Ft(f.tree,u,e,l);let g=new Ft(h,u,e,l);return s&je.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?h.children.length-1:0,t,i,n)}}}if(s&je.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let n;if(!(i&je.IgnoreOverlays)&&(n=Os.get(this._tree))&&n.overlay){let s=e-this.from;for(let{from:l,to:a}of n.overlay)if((t>0?l<=s:l<s)&&(t<0?a>=s:a>s))return new Ft(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function wa(r,e,t,i){let n=r.cursor(),s=[];if(!n.firstChild())return s;if(t!=null){for(let l=!1;!l;)if(l=n.type.is(t),!n.nextSibling())return s}for(;;){if(i!=null&&n.type.is(i))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return i==null?s:[]}}function qo(r,e,t=e.length-1){for(let i=r.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class k0{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Pi extends xa{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new Pi(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&je.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Pi(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Pi(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Pi(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,s=i.buffer[this.index+3];if(s>n){let l=i.buffer[this.index+1];e.push(i.slice(n,s,l)),t.push(0)}return new Be(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ya(r){if(!r.length)return null;let e=0,t=r[0];for(let s=1;s<r.length;s++){let l=r[s];(l.from>t.from||l.to<t.to)&&(t=l,e=s)}let i=t instanceof Ft&&t.index<0?null:t.parent,n=r.slice();return i?n[e]=i:n.splice(e,1),new D0(n,t)}class D0{constructor(e,t){this.heads=e,this.node=t}get next(){return ya(this.heads)}}function E0(r,e,t){let i=r.resolveInner(e,t),n=null;for(let s=i instanceof Ft?i:i.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(n||(n=[i])).push(l.resolve(e,t)),s=l}else{let l=Os.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let a=new Ft(l.tree,l.overlay[0].from+s.from,-1,s);(n||(n=[i])).push(Un(a,e,t,!1))}}return n?ya(n):i}class el{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ft)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return e?e instanceof Ft?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&je.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&je.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&je.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index<n.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(n.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=n)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let a=i._tree.children[s];if(this.mode&je.IncludeAnonymous||a instanceof Oi||!a.type.isAnonymous||tl(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let n=this.index,s=this.stack.length;s>=0;){for(let l=e;l;l=l._parent)if(l.index==n){if(n==this.index)return l;t=l,i=s+1;break e}n=this.stack[--s]}for(let n=i;n<this.stack.length;n++)t=new Pi(this.buffer,t,this.stack[n]);return this.bufferNode=new Pi(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let n=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;n&&t&&t(this),n=this.type.isAnonymous,!this.nextSibling();){if(!i)return;this.parent(),i--,n=!0}}}matchContext(e){if(!this.buffer)return qo(this.node,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let n=e.length-1,s=this.stack.length-1;n>=0;s--){if(s<0)return qo(this.node,e,n);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[n]&&e[n]!=l.name)return!1;n--}}return!0}}function tl(r){return r.children.some(e=>e instanceof Oi||!e.type.isAnonymous||tl(e))}function U0(r){var e;let{buffer:t,nodeSet:i,maxBufferLength:n=Pa,reused:s=[],minRepeatType:l=i.types.length}=r,a=Array.isArray(t)?new jo(t,t.length):t,c=i.types,d=0,h=0;function u(m,T,y,x,I,V){let{id:F,start:L,end:w,size:v}=a,X=h;for(;v<0;)if(a.next(),v==-1){let Y=s[F];y.push(Y),x.push(L-m);return}else if(v==-3){d=F;return}else if(v==-4){h=F;return}else throw new RangeError(`Unrecognized record size: ${v}`);let C=c[F],Z,k,Q=L-m;if(w-L<=n&&(k=M(a.pos-T,I))){let Y=new Uint16Array(k.size-k.skip),W=a.pos-k.size,H=Y.length;for(;a.pos>W;)H=S(k.start,Y,H);Z=new Oi(Y,w-k.start,i),Q=k.start-m}else{let Y=a.pos-v;a.next();let W=[],H=[],U=F>=l?F:-1,K=0,_=w;for(;a.pos>Y;)U>=0&&a.id==U&&a.size>=0?(a.end<=_-n&&(R(W,H,L,K,a.end,_,U,X),K=W.length,_=a.end),a.next()):V>2500?f(L,Y,W,H):u(L,Y,W,H,U,V+1);if(U>=0&&K>0&&K<W.length&&R(W,H,L,K,L,_,U,X),W.reverse(),H.reverse(),U>-1&&K>0){let J=g(C);Z=il(C,W,H,0,W.length,0,w-L,J,J)}else Z=p(C,W,H,w-L,X-w)}y.push(Z),x.push(Q)}function f(m,T,y,x){let I=[],V=0,F=-1;for(;a.pos>T;){let{id:L,start:w,end:v,size:X}=a;if(X>4)a.next();else{if(F>-1&&w<F)break;F<0&&(F=v-n),I.push(L,w,v),V++,a.next()}}if(V){let L=new Uint16Array(V*4),w=I[I.length-2];for(let v=I.length-3,X=0;v>=0;v-=3)L[X++]=I[v],L[X++]=I[v+1]-w,L[X++]=I[v+2]-w,L[X++]=X;y.push(new Oi(L,I[2]-w,i)),x.push(w-m)}}function g(m){return(T,y,x)=>{let I=0,V=T.length-1,F,L;if(V>=0&&(F=T[V])instanceof Be){if(!V&&F.type==m&&F.length==x)return F;(L=F.prop(Te.lookAhead))&&(I=y[V]+F.length+L)}return p(m,T,y,x,I)}}function R(m,T,y,x,I,V,F,L){let w=[],v=[];for(;m.length>x;)w.push(m.pop()),v.push(T.pop()+y-I);m.push(p(i.types[F],w,v,V-I,L-V)),T.push(I-y)}function p(m,T,y,x,I=0,V){if(d){let F=[Te.contextHash,d];V=V?[F].concat(V):[F]}if(I>25){let F=[Te.lookAhead,I];V=V?[F].concat(V):[F]}return new Be(m,T,y,x,V)}function M(m,T){let y=a.fork(),x=0,I=0,V=0,F=y.end-n,L={size:0,start:0,skip:0};e:for(let w=y.pos-m;y.pos>w;){let v=y.size;if(y.id==T&&v>=0){L.size=x,L.start=I,L.skip=V,V+=4,x+=4,y.next();continue}let X=y.pos-v;if(v<0||X<w||y.start<F)break;let C=y.id>=l?4:0,Z=y.start;for(y.next();y.pos>X;){if(y.size<0)if(y.size==-3)C+=4;else break e;else y.id>=l&&(C+=4);y.next()}I=Z,x+=v,V+=C}return(T<0||x==m)&&(L.size=x,L.start=I,L.skip=V),L.size>4?L:void 0}function S(m,T,y){let{id:x,start:I,end:V,size:F}=a;if(a.next(),F>=0&&x<l){let L=y;if(F>4){let w=a.pos-(F-4);for(;a.pos>w;)y=S(m,T,y)}T[--y]=L,T[--y]=V-m,T[--y]=I-m,T[--y]=x}else F==-3?d=x:F==-4&&(h=x);return y}let b=[],P=[];for(;a.pos>0;)u(r.start||0,r.bufferStart||0,b,P,-1,0);let N=(e=r.length)!==null&&e!==void 0?e:b.length?P[0]+b[0].length:0;return new Be(c[r.topID],b.reverse(),P.reverse(),N)}const Va=new WeakMap;function Ts(r,e){if(!r.isAnonymous||e instanceof Oi||e.type!=r)return 1;let t=Va.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=r||!(i instanceof Be)){t=1;break}t+=Ts(r,i)}Va.set(e,t)}return t}function il(r,e,t,i,n,s,l,a,c){let d=0;for(let R=i;R<n;R++)d+=Ts(r,e[R]);let h=Math.ceil(d*1.5/8),u=[],f=[];function g(R,p,M,S,b){for(let P=M;P<S;){let N=P,m=p[P],T=Ts(r,R[P]);for(P++;P<S;P++){let y=Ts(r,R[P]);if(T+y>=h)break;T+=y}if(P==N+1){if(T>h){let y=R[N];g(y.children,y.positions,0,y.children.length,p[N]+b);continue}u.push(R[N])}else{let y=p[P-1]+R[P-1].length-m;u.push(il(r,R,p,N,P,m,y,null,c))}f.push(m+b-s)}}return g(e,t,i,n,0),(a||c)(u,f,l)}class Ei{constructor(e,t,i,n,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let n=[new Ei(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&n.push(s);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],s=1,l=e.length?e[0]:null;for(let a=0,c=0,d=0;;a++){let h=a<t.length?t[a]:null,u=h?h.fromA:1e9;if(u-c>=i)for(;l&&l.from<u;){let f=l;if(c>=f.from||u<=f.to||d){let g=Math.max(f.from,c)-d,R=Math.min(f.to,u)-d;f=g>=R?null:new Ei(g,R,f.tree,f.offset+d,a>0,!!h)}if(f&&n.push(f),l.to>u)break;l=s<e.length?e[s++]:null}if(!h)break;c=h.toA,d=h.toA-h.toB}return n}}class Fa{startParse(e,t,i){return typeof e=="string"&&(e=new Z0(e)),i=i?i.length?i.map(n=>new zo(n.from,n.to)):[new zo(0,0)]:[new zo(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let s=n.advance();if(s)return s}}}class Z0{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new Te({perNode:!0});class Is{constructor(e,t,i,n,s,l,a,c,d,h=0,u){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=s,this.score=l,this.buffer=a,this.bufferBase=c,this.curContext=d,this.lookAhead=h,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new Is(e,[],t,i,i,0,[],0,n?new Xa(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,n=e&65535,{parser:s}=this.p,l=this.reducePos<this.pos-25;l&&this.setLookAhead(this.pos);let a=s.dynamicPrecedence(n);if(a&&(this.score+=a),i==0){this.pushState(s.getGoto(this.state,n,!0),this.reducePos),n<s.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(n,this.reducePos);return}let c=this.stack.length-(i-1)*3-(e&262144?6:0),d=c?this.stack[c-2]:this.p.ranges[0].from,h=this.reducePos-d;h>=2e3&&!(!((t=this.p.parser.nodeSet.types[n])===null||t===void 0)&&t.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=h));let u=c?this.stack[c-1]:0,f=this.bufferBase+this.buffer.length-u;if(n<s.minRepeatTerm||e&131072){let g=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,d,g,f+4,!0)}if(e&262144)this.state=this.stack[c];else{let g=this.stack[c-3];this.state=s.getGoto(g,n,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(n,d)}storeNode(e,t,i,n=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this,a=this.buffer.length;if(a==0&&l.parent&&(a=l.bufferBase-l.parent.bufferBase,l=l.parent),a>0&&l.buffer[a-4]==0&&l.buffer[a-1]>-1){if(t==i)return;if(l.buffer[a-2]>=t){l.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,n);else{let l=this.buffer.length;if(l>0&&this.buffer[l-4]!=0){let a=!1;for(let c=l;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){a=!0;break}if(a)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,n>4&&(n-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=n}}shift(e,t,i,n){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=n,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,n,4);else{let s=e,{parser:l}=this.p;(n>this.pos||t<=l.maxNode)&&(this.pos=n,l.stateFlag(s,1)||(this.reducePos=n)),this.pushState(s,i),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,n,4)}}apply(e,t,i,n){e&65536?this.reduce(e):this.shift(e,t,i,n)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new Is(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Y0(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let s=0,l;s<t.length;s+=2)(l=t[s+1])!=this.state&&this.p.parser.hasAction(l,e)&&n.push(t[s],l);if(this.stack.length<120)for(let s=0;n.length<8&&s<t.length;s+=2){let l=t[s+1];n.some((a,c)=>c&1&&a==l)||n.push(t[s],l)}t=n}let i=[];for(let n=0;n<t.length&&i.length<4;n+=2){let s=t[n+1];if(s==this.state)continue;let l=this.split();l.pushState(s,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(t[n],this.pos),l.reducePos=this.pos,l.score-=200,i.push(l)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let i=t>>19,n=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],n,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(n,s)=>{if(!t.includes(n))return t.push(n),e.allActions(n,l=>{if(!(l&393216))if(l&65536){let a=(l>>19)-s;if(a>1){let c=l&65535,d=this.stack.length-a*3;if(d>=0&&e.getGoto(this.stack[d],c,!1)>=0)return a<<19|65536|c}}else{let a=i(l,s+1);if(a!=null)return a}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Xa(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Xa{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Y0{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class xs{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new xs(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new xs(this.stack,this.pos,this.index)}}function ws(r,e=Uint16Array){if(typeof r!="string")return r;let t=null;for(let i=0,n=0;i<r.length;){let s=0;for(;;){let l=r.charCodeAt(i++),a=!1;if(l==126){s=65535;break}l>=92&&l--,l>=34&&l--;let c=l-32;if(c>=46&&(c-=46,a=!0),s+=c,a)break;s*=46}t?t[n++]=s:t=new e(s)}return t}class ys{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ca=new ys;class Q0{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ca,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!n)return null;let l=this.ranges[--n];s-=i.from-l.to,i=l}for(;t<0?s>i.to:s>=i.to;){if(n==this.ranges.length-1)return null;let l=this.ranges[++n];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,n;if(t>=0&&t<this.chunk.length)i=this.pos+e,n=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let l=this.rangeIndex,a=this.range;for(;a.to<=i;)a=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-i)),n=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),n}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ca,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class on{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;K0(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}on.prototype.contextual=on.prototype.fallback=on.prototype.extend=!1,on.prototype.fallback=on.prototype.extend=!1;function K0(r,e,t,i,n,s){let l=0,a=1<<i,{dialect:c}=t.p.parser;e:for(;a&r[l];){let d=r[l+1];for(let g=l+3;g<d;g+=2)if((r[g+1]&a)>0){let R=r[g];if(c.allows(R)&&(e.token.value==-1||e.token.value==R||H0(R,e.token.value,n,s))){e.acceptToken(R);break}}let h=e.next,u=0,f=r[l+2];if(e.next<0&&f>u&&r[d+f*3-3]==65535){l=r[d+f*3-1];continue e}for(;u<f;){let g=u+f>>1,R=d+g+(g<<1),p=r[R],M=r[R+1]||65536;if(h<p)f=g;else if(h>=M)u=g+1;else{l=r[R+2],e.advance();continue e}}break}}function va(r,e,t){for(let i=e,n;(n=r[i])!=65535;i++)if(n==t)return i-e;return-1}function H0(r,e,t,i){let n=va(t,i,e);return n<0||va(t,i,r)<n}const Ot=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let nl=null;function Wa(r,e,t){let i=r.cursor(je.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(r.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:r.length}}class B0{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Wa(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Wa(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],n=this.index[t];if(n==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[n],l=this.start[t]+i.positions[n];if(l>e)return this.nextStart=l,null;if(s instanceof Be){if(l==e){if(l<this.safeFrom)return null;let a=l+s.length;if(a<=this.safeTo){let c=s.prop(Te.lookAhead);if(!c||a+c<this.fragment.to)return s}}this.index[t]++,l+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class G0{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new ys)}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:s}=n,l=n.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,c=0;for(let d=0;d<s.length;d++){if(!(1<<d&l))continue;let h=s[d],u=this.tokens[d];if(!(i&&!h.fallback)&&((h.contextual||u.start!=e.pos||u.mask!=l||u.context!=a)&&(this.updateCachedToken(u,h,e),u.mask=l,u.context=a),u.lookAhead>u.end+25&&(c=Math.max(u.lookAhead,c)),u.value!=0)){let f=t;if(u.extended>-1&&(t=this.addActions(e,u.extended,u.end,t)),t=this.addActions(e,u.value,u.end,t),!h.extend&&(i=u,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!i&&e.pos==this.stream.end&&(i=new ys,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ys,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){let n=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(n,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l<s.specialized.length;l++)if(s.specialized[l]==e.value){let a=s.specializers[l](this.stream.read(e.start,e.end),i);if(a>=0&&i.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(n+1)}putAction(e,t,i,n){for(let s=0;s<n;s+=3)if(this.actions[s]==e)return n;return this.actions[n++]=e,this.actions[n++]=t,this.actions[n++]=i,n}addActions(e,t,i,n){let{state:s}=e,{parser:l}=e.p,{data:a}=l;for(let c=0;c<2;c++)for(let d=l.stateSlot(s,c?2:1);;d+=3){if(a[d]==65535)if(a[d+1]==1)d=ui(a,d+2);else{n==0&&a[d+1]==2&&(n=this.putAction(ui(a,d+2),t,i,n));break}a[d]==t&&(n=this.putAction(ui(a,d+1),t,i,n))}return n}}class _0{constructor(e,t,i,n){this.parser=e,this.input=t,this.ranges=n,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Q0(t,n),this.tokens=new G0(e,this.stream),this.topTerm=e.top[1];let{from:s}=n[0];this.stacks=[Is.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new B0(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],n,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let a=e[l];for(;;){if(this.tokens.mainToken=null,a.pos>t)i.push(a);else{if(this.advanceStack(a,i,e))continue;{n||(n=[],s=[]),n.push(a);let c=this.tokens.getMainToken(a);s.push(c.value,c.end)}}break}}if(!i.length){let l=n&&J0(n);if(l)return Ot&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw Ot&&n&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&n){let l=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,s,i);if(l)return Ot&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((a,c)=>c.score-a.score);i.length>l;)i.pop();i.some(a=>a.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l<i.length-1;l++){let a=i[l];for(let c=l+1;c<i.length;c++){let d=i[c];if(a.sameState(d)||a.buffer.length>500&&d.buffer.length>500)if((a.score-d.score||a.buffer.length-d.buffer.length)>0)i.splice(c--,1);else{i.splice(l--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let l=1;l<i.length;l++)i[l].pos<this.minStackPos&&(this.minStackPos=i[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let n=e.pos,{parser:s}=this,l=Ot?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,h=d?e.curContext.hash:0;for(let u=this.fragments.nodeAt(n);u;){let f=this.parser.nodeSet.types[u.type.id]==u.type?s.getGoto(e.state,u.type.id):-1;if(f>-1&&u.length&&(!d||(u.prop(Te.contextHash)||0)==h))return e.useNode(u,f),Ot&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(u.type.id)})`),!0;if(!(u instanceof Be)||u.children.length==0||u.positions[0]>0)break;let g=u.children[0];if(g instanceof Be&&u.positions[0]==0)u=g;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ot&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let d=0;d<c.length;){let h=c[d++],u=c[d++],f=c[d++],g=d==c.length||!i,R=g?e:e.split(),p=this.tokens.mainToken;if(R.apply(h,u,p?p.start:R.pos,f),Ot&&console.log(l+this.stackID(R)+` (via ${h&65536?`reduce of ${s.getName(h&65535)}`:"shift"} for ${s.getName(u)} @ ${n}${R==e?"":", split"})`),g)return!0;R.pos>n?t.push(R):i.push(R)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return ka(e,t),!0}}runRecovery(e,t,i){let n=null,s=!1;for(let l=0;l<e.length;l++){let a=e[l],c=t[l<<1],d=t[(l<<1)+1],h=Ot?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),Ot&&console.log(h+this.stackID(a)+" (restarted)"),this.advanceFully(a,i))))continue;let u=a.split(),f=h;for(let g=0;u.forceReduce()&&g<10&&(Ot&&console.log(f+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,i));g++)Ot&&(f=this.stackID(u)+" -> ");for(let g of a.recoverByInsert(c))Ot&&console.log(h+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,i);this.stream.end>a.pos?(d==a.pos&&(d++,c=0),a.recoverByDelete(c,d),Ot&&console.log(h+this.stackID(a)+` (via recover-delete ${this.parser.getName(c)})`),ka(a,i)):(!n||n.score<a.score)&&(n=a)}return n}stackToTree(e){return e.close(),Be.build({buffer:xs.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(nl||(nl=new WeakMap)).get(e);return t||nl.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function ka(r,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==r.pos&&i.sameState(r)){e[t].score<r.score&&(e[t]=r);return}}e.push(r)}class A0{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}class Vs extends Fa{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let i=Object.keys(e.topRules).map(a=>e.topRules[a][1]),n=[];for(let a=0;a<t.length;a++)n.push([]);function s(a,c,d){n[a].push([c,c.deserialize(String(d))])}if(e.nodeProps)for(let a of e.nodeProps){let c=a[0];typeof c=="string"&&(c=Te[c]);for(let d=1;d<a.length;){let h=a[d++];if(h>=0)s(h,c,a[d++]);else{let u=a[d+-h];for(let f=-h;f>0;f--)s(a[d++],c,u);d++}}}this.nodeSet=new $o(t.map((a,c)=>Nt.define({name:c>=this.minRepeatTerm?void 0:a,id:c,props:n[c],top:i.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Pa;let l=ws(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Da),this.states=ws(e.states,Uint32Array),this.data=ws(e.stateData),this.goto=ws(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new on(l,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new _0(this,e,t,i);for(let s of this.wrappers)n=s(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let s=n[t+1];;){let l=n[s++],a=l&1,c=n[s++];if(a&&i)return c;for(let d=s+(l>>1);s<d;s++)if(n[s]==e)return c;if(a)return-1}}hasAction(e,t){let i=this.data;for(let n=0;n<2;n++)for(let s=this.stateSlot(e,n?2:1),l;;s+=3){if((l=i[s])==65535)if(i[s+1]==1)l=i[s=ui(i,s+2)];else{if(i[s+1]==2)return ui(i,s+2);break}if(l==t||l==0)return ui(i,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),n=i?t(i):void 0;for(let s=this.stateSlot(e,1);n==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=ui(this.data,s+2);else break;n=t(ui(this.data,s+1))}return n}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=ui(this.data,i+2);else break;if(!(this.data[i+2]&1)){let n=this.data[i+1];t.some((s,l)=>l&1&&s==n)||t.push(this.data[i],n)}}return t}configure(e){let t=Object.assign(Object.create(Vs.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let n=e.tokenizers.find(s=>s.from==i);return n?n.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,n)=>{let s=e.specializers.find(a=>a.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[n]=Da(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let n=null;for(let s=0;s<t.length;s++)if(!i[s])for(let l=this.dialects[t[s]],a;(a=this.data[l++])!=65535;)(n||(n=new Uint8Array(this.maxTerm+1)))[a]=1;return new A0(e,i,n)}static deserialize(e){return new Vs(e)}}function ui(r,e){return r[e]|r[e+1]<<16}function J0(r){let e=null;for(let t of r){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function Da(r){if(r.external){let e=r.extend?1:0;return(t,i)=>r.external(t,i)<<1|e}return r.get}let z0=0;class Xt{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=z0++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Xt&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let n=new Xt(i,[],null,[]);if(n.set.push(n),t)for(let s of t.set)n.set.push(s);return n}static defineModifier(e){let t=new Fs(e);return i=>i.modified.indexOf(t)>-1?i:Fs.get(i.base||i,i.modified.concat(t).sort((n,s)=>n.id-s.id))}}let $0=0;class Fs{constructor(e){this.name=e,this.instances=[],this.id=$0++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(a=>a.base==e&&j0(t,a.modified));if(i)return i;let n=[],s=new Xt(e.name,n,e,t);for(let a of t)a.instances.push(s);let l=q0(t);for(let a of e.set)if(!a.modified.length)for(let c of l)n.push(Fs.get(a,c));return s}}function j0(r,e){return r.length==e.length&&r.every((t,i)=>t==e[i])}function q0(r){let e=[[]];for(let t=0;t<r.length;t++)for(let i=0,n=e.length;i<n;i++)e.push(e[i].concat(r[t]));return e.sort((t,i)=>i.length-t.length)}function Ea(r){let e=Object.create(null);for(let t in r){let i=r[t];Array.isArray(i)||(i=[i]);for(let n of t.split(" "))if(n){let s=[],l=2,a=n;for(let u=0;;){if(a=="..."&&u>0&&u+3==n.length){l=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!f)throw new RangeError("Invalid path: "+n);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),u+=f[0].length,u==n.length)break;let g=n[u++];if(u==n.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+n);a=n.slice(u)}let c=s.length-1,d=s[c];if(!d)throw new RangeError("Invalid path: "+n);let h=new sl(i,l,c>0?s.slice(0,c):null);e[d]=h.sort(e[d])}}return eS.add(e)}const eS=new Te;class sl{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}sl.empty=new sl([],2,null);function Ua(r,e){let t=Object.create(null);for(let s of r)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let l of s.tag)t[l.id]=s.class;let{scope:i,all:n=null}=e||{};return{style:s=>{let l=n;for(let a of s)for(let c of a.set){let d=t[c.id];if(d){l=l?l+" "+d:d;break}}return l},scope:i}}const $=Xt.define,Xs=$(),Ti=$(),Za=$(Ti),Ya=$(Ti),Ii=$(),Cs=$(Ii),ol=$(Ii),zt=$(),Ui=$(zt),$t=$(),jt=$(),ll=$(),Zn=$(ll),vs=$(),z={comment:Xs,lineComment:$(Xs),blockComment:$(Xs),docComment:$(Xs),name:Ti,variableName:$(Ti),typeName:Za,tagName:$(Za),propertyName:Ya,attributeName:$(Ya),className:$(Ti),labelName:$(Ti),namespace:$(Ti),macroName:$(Ti),literal:Ii,string:Cs,docString:$(Cs),character:$(Cs),attributeValue:$(Cs),number:ol,integer:$(ol),float:$(ol),bool:$(Ii),regexp:$(Ii),escape:$(Ii),color:$(Ii),url:$(Ii),keyword:$t,self:$($t),null:$($t),atom:$($t),unit:$($t),modifier:$($t),operatorKeyword:$($t),controlKeyword:$($t),definitionKeyword:$($t),moduleKeyword:$($t),operator:jt,derefOperator:$(jt),arithmeticOperator:$(jt),logicOperator:$(jt),bitwiseOperator:$(jt),compareOperator:$(jt),updateOperator:$(jt),definitionOperator:$(jt),typeOperator:$(jt),controlOperator:$(jt),punctuation:ll,separator:$(ll),bracket:Zn,angleBracket:$(Zn),squareBracket:$(Zn),paren:$(Zn),brace:$(Zn),content:zt,heading:Ui,heading1:$(Ui),heading2:$(Ui),heading3:$(Ui),heading4:$(Ui),heading5:$(Ui),heading6:$(Ui),contentSeparator:$(zt),list:$(zt),quote:$(zt),emphasis:$(zt),strong:$(zt),link:$(zt),monospace:$(zt),strikethrough:$(zt),inserted:$(),deleted:$(),changed:$(),invalid:$(),meta:vs,documentMeta:$(vs),annotation:$(vs),processingInstruction:$(vs),definition:Xt.defineModifier("definition"),constant:Xt.defineModifier("constant"),function:Xt.defineModifier("function"),standard:Xt.defineModifier("standard"),local:Xt.defineModifier("local"),special:Xt.defineModifier("special")};for(let r in z){let e=z[r];e instanceof Xt&&(e.name=r)}Ua([{tag:z.link,class:"tok-link"},{tag:z.heading,class:"tok-heading"},{tag:z.emphasis,class:"tok-emphasis"},{tag:z.strong,class:"tok-strong"},{tag:z.keyword,class:"tok-keyword"},{tag:z.atom,class:"tok-atom"},{tag:z.bool,class:"tok-bool"},{tag:z.url,class:"tok-url"},{tag:z.labelName,class:"tok-labelName"},{tag:z.inserted,class:"tok-inserted"},{tag:z.deleted,class:"tok-deleted"},{tag:z.literal,class:"tok-literal"},{tag:z.string,class:"tok-string"},{tag:z.number,class:"tok-number"},{tag:[z.regexp,z.escape,z.special(z.string)],class:"tok-string2"},{tag:z.variableName,class:"tok-variableName"},{tag:z.local(z.variableName),class:"tok-variableName tok-local"},{tag:z.definition(z.variableName),class:"tok-variableName tok-definition"},{tag:z.special(z.variableName),class:"tok-variableName2"},{tag:z.definition(z.propertyName),class:"tok-propertyName tok-definition"},{tag:z.typeName,class:"tok-typeName"},{tag:z.namespace,class:"tok-namespace"},{tag:z.className,class:"tok-className"},{tag:z.macroName,class:"tok-macroName"},{tag:z.propertyName,class:"tok-propertyName"},{tag:z.operator,class:"tok-operator"},{tag:z.comment,class:"tok-comment"},{tag:z.meta,class:"tok-meta"},{tag:z.invalid,class:"tok-invalid"},{tag:z.punctuation,class:"tok-punctuation"}]);const tS=Ea({String:z.string,Number:z.number,"True False":z.bool,PropertyName:z.propertyName,Null:z.null,",":z.separator,"[ ]":z.squareBracket,"{ }":z.brace}),iS=Vs.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[tS],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});let rl=[],Qa=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<r.length;e++)(e%2?Qa:rl).push(t=t+r[e])})();function nS(r){if(r<768)return!1;for(let e=0,t=rl.length;;){let i=e+t>>1;if(r<rl[i])t=i;else if(r>=Qa[i])e=i+1;else return!0;if(e==t)return!1}}function Ka(r){return r>=127462&&r<=127487}const Ha=8205;function sS(r,e,t=!0,i=!0){return(t?Ba:oS)(r,e,i)}function Ba(r,e,t){if(e==r.length)return e;e&&Ga(r.charCodeAt(e))&&_a(r.charCodeAt(e-1))&&e--;let i=al(r,e);for(e+=Aa(i);e<r.length;){let n=al(r,e);if(i==Ha||n==Ha||t&&nS(n))e+=Aa(n),i=n;else if(Ka(n)){let s=0,l=e-2;for(;l>=0&&Ka(al(r,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function oS(r,e,t){for(;e>0;){let i=Ba(r,e-2,t);if(i<e)return i;e--}return 0}function al(r,e){let t=r.charCodeAt(e);if(!_a(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return Ga(i)?(t-55296<<10)+(i-56320)+65536:t}function Ga(r){return r>=56320&&r<57344}function _a(r){return r>=55296&&r<56320}function Aa(r){return r<65536?1:2}class Oe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=ln(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),qt.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ln(this,e,t);let i=[];return this.decompose(e,t,i,0),qt.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new Yn(this),s=new Yn(e);for(let l=t,a=t;;){if(n.next(l),s.next(l),l=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(a+=n.value.length,n.done||a>=i)return!0}}iter(e=1){return new Yn(this,e)}iterRange(e,t=this.length){return new za(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new $a(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Oe.empty:e.length<=32?new Qe(e):qt.from(Qe.split(e,[]))}}class Qe extends Oe{constructor(e,t=lS(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.text[s],a=n+l.length;if((t?i:a)>=e)return new rS(n,a,i,l);n=a+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new Qe(Ja(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let l=i.pop(),a=Ws(s.text,l.text.slice(),0,s.length);if(a.length<=32)i.push(new Qe(a,l.length+s.length));else{let c=a.length>>1;i.push(new Qe(a.slice(0,c)),new Qe(a.slice(c)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof Qe))return super.replace(e,t,i);[e,t]=ln(this,e,t);let n=Ws(this.text,Ws(i.text,Ja(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new Qe(n,s):qt.from(Qe.split(n,[]),s)}sliceString(e,t=this.length,i=`
109
+ `){[e,t]=ln(this,e,t);let n="";for(let s=0,l=0;s<=t&&l<this.text.length;l++){let a=this.text[l],c=s+a.length;s>e&&l&&(n+=i),e<c&&t>s&&(n+=a.slice(Math.max(0,e-s),t-s)),s=c+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,i.length==32&&(t.push(new Qe(i,n)),i=[],n=-1);return n>-1&&t.push(new Qe(i,n)),t}}class qt extends Oe{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.children[s],a=n+l.length,c=i+l.lines-1;if((t?c:a)>=e)return l.lineInner(e,t,i,n);n=a+1,i=c+1}}decompose(e,t,i,n){for(let s=0,l=0;l<=t&&s<this.children.length;s++){let a=this.children[s],c=l+a.length;if(e<=c&&t>=l){let d=n&((l<=e?1:0)|(c>=t?2:0));l>=e&&c<=t&&!d?i.push(a):a.decompose(e-l,t-l,i,d)}l=c+1}}replace(e,t,i){if([e,t]=ln(this,e,t),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let l=this.children[n],a=s+l.length;if(e>=s&&t<=a){let c=l.replace(e-s,t-s,i),d=this.lines-l.lines+c.lines;if(c.lines<d>>4&&c.lines>d>>6){let h=this.children.slice();return h[n]=c,new qt(h,this.length-(t-e)+i.length)}return super.replace(s,a,c)}s=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
110
+ `){[e,t]=ln(this,e,t);let n="";for(let s=0,l=0;s<this.children.length&&l<=t;s++){let a=this.children[s],c=l+a.length;l>e&&s&&(n+=i),e<c&&t>l&&(n+=a.sliceString(e-l,t-l,i)),l=c+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof qt))return 0;let i=0,[n,s,l,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==l||s==a)return i;let c=this.children[n],d=e.children[s];if(c!=d)return i+c.scanIdentical(d,t);i+=c.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let g of e)i+=g.lines;if(i<32){let g=[];for(let R of e)R.flatten(g);return new Qe(g,t)}let n=Math.max(32,i>>5),s=n<<1,l=n>>1,a=[],c=0,d=-1,h=[];function u(g){let R;if(g.lines>s&&g instanceof qt)for(let p of g.children)u(p);else g.lines>l&&(c>l||!c)?(f(),a.push(g)):g instanceof Qe&&c&&(R=h[h.length-1])instanceof Qe&&g.lines+R.lines<=32?(c+=g.lines,d+=g.length+1,h[h.length-1]=new Qe(R.text.concat(g.text),R.length+1+g.length)):(c+g.lines>n&&f(),c+=g.lines,d+=g.length+1,h.push(g))}function f(){c!=0&&(a.push(h.length==1?h[0]:qt.from(h,d)),d=-1,c=h.length=0)}for(let g of e)u(g);return f(),a.length==1?a[0]:new qt(a,t)}}Oe.empty=new Qe([""],0);function lS(r){let e=-1;for(let t of r)e+=t.length+1;return e}function Ws(r,e,t=0,i=1e9){for(let n=0,s=0,l=!0;s<r.length&&n<=i;s++){let a=r[s],c=n+a.length;c>=t&&(c>i&&(a=a.slice(0,i-n)),n<t&&(a=a.slice(t-n)),l?(e[e.length-1]+=a,l=!1):e.push(a)),n=c+1}return e}function Ja(r,e,t){return Ws(r,[""],e,t)}class Yn{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Qe?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],l=s>>1,a=n instanceof Qe?n.text.length:n.children.length;if(l==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
111
+ `,this;e--}else if(n instanceof Qe){let c=n.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=n.children[l+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof Qe?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class za{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Yn(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class $a{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Oe.prototype[Symbol.iterator]=function(){return this.iter()},Yn.prototype[Symbol.iterator]=za.prototype[Symbol.iterator]=$a.prototype[Symbol.iterator]=function(){return this});class rS{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function ln(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function fi(r,e,t=!0,i=!0){return sS(r,e,t,i)}const cl=/\r\n?|\n/;var Pt=function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r}(Pt||(Pt={}));class gi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],l=this.sections[t++];l<0?(e(i,n,s),n+=s):n+=l,i+=s}}iterChangedRanges(e,t=!1){dl(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new gi(e)}composeDesc(e){return this.empty?e:e.empty?this:ja(this,e)}mapDesc(e,t=!1){return e.empty?this:hl(this,e,t)}mapPos(e,t=-1,i=Pt.Simple){let n=0,s=0;for(let l=0;l<this.sections.length;){let a=this.sections[l++],c=this.sections[l++],d=n+a;if(c<0){if(d>e)return s+(e-n);s+=a}else{if(i!=Pt.Simple&&d>=e&&(i==Pt.TrackDel&&n<e&&d>e||i==Pt.TrackBefore&&n<e||i==Pt.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!a)return e==n||t<0?s:s+c;s+=c}n=d}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let s=this.sections[i++],l=this.sections[i++],a=n+s;if(l>=0&&n<=t&&a>=e)return n<e&&a>t?"cover":!0;n=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new gi(e)}static create(e){return new gi(e)}}class qe extends gi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return dl(this,(t,i,n,s,l)=>e=e.replace(n,n+(i-t),l),!1),e}mapDesc(e,t=!1){return hl(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,s=0;n<t.length;n+=2){let l=t[n],a=t[n+1];if(a>=0){t[n]=a,t[n+1]=l;let c=n>>1;for(;i.length<c;)i.push(Oe.empty);i.push(l?e.slice(s,s+l):Oe.empty)}s+=l}return new qe(t,i)}compose(e){return this.empty?e:e.empty?this:ja(this,e,!0)}map(e,t=!1){return e.empty?this:hl(this,e,t,!0)}iterChanges(e,t=!1){dl(this,e,t)}get desc(){return gi.create(this.sections)}filter(e){let t=[],i=[],n=[],s=new Qn(this);e:for(let l=0,a=0;;){let c=l==e.length?1e9:e[l++];for(;a<c||a==c&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,c-a);rt(n,h,-1);let u=s.ins==-1?-1:s.off==0?s.ins:0;rt(t,h,u),u>0&&xi(i,t,s.text),s.forward(h),a+=h}let d=e[l++];for(;a<d;){if(s.done)break e;let h=Math.min(s.len,d-a);rt(t,h,-1),rt(n,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),a+=h}}return{changes:new qe(t,i),filtered:gi.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):n==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let n=[],s=[],l=0,a=null;function c(h=!1){if(!h&&!n.length)return;l<t&&rt(n,t-l,-1);let u=new qe(n,s);a=a?a.compose(u.map(a)):u,n=[],s=[],l=0}function d(h){if(Array.isArray(h))for(let u of h)d(u);else if(h instanceof qe){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);c(),a=a?a.compose(h.map(a)):h}else{let{from:u,to:f=u,insert:g}=h;if(u>f||u<0||f>t)throw new RangeError(`Invalid change range ${u} to ${f} (in doc of length ${t})`);let R=g?typeof g=="string"?Oe.of(g.split(i||cl)):g:Oe.empty,p=R.length;if(u==f&&p==0)return;u<l&&c(),u>l&&rt(n,u-l,-1),rt(n,f-u,p),xi(s,n,R),l=f}}return d(e),c(!a),a}static empty(e){return new qe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;n<e.length;n++){let s=e[n];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,a)=>a&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<n;)i.push(Oe.empty);i[n]=Oe.of(s.slice(1)),t.push(s[0],i[n].length)}}}return new qe(t,i)}static createSet(e,t){return new qe(e,t)}}function rt(r,e,t,i=!1){if(e==0&&t<=0)return;let n=r.length-2;n>=0&&t<=0&&t==r[n+1]?r[n]+=e:n>=0&&e==0&&r[n]==0?r[n+1]+=t:i?(r[n]+=e,r[n+1]+=t):r.push(e,t)}function xi(r,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<r.length)r[r.length-1]=r[r.length-1].append(t);else{for(;r.length<i;)r.push(Oe.empty);r.push(t)}}function dl(r,e,t){let i=r.inserted;for(let n=0,s=0,l=0;l<r.sections.length;){let a=r.sections[l++],c=r.sections[l++];if(c<0)n+=a,s+=a;else{let d=n,h=s,u=Oe.empty;for(;d+=a,h+=c,c&&i&&(u=u.append(i[l-2>>1])),!(t||l==r.sections.length||r.sections[l+1]<0);)a=r.sections[l++],c=r.sections[l++];e(n,d,s,h,u),n=d,s=h}}}function hl(r,e,t,i=!1){let n=[],s=i?[]:null,l=new Qn(r),a=new Qn(e);for(let c=-1;;){if(l.done&&a.len||a.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&a.ins==-1){let d=Math.min(l.len,a.len);rt(n,d,-1),l.forward(d),a.forward(d)}else if(a.ins>=0&&(l.ins<0||c==l.i||l.off==0&&(a.len<l.len||a.len==l.len&&!t))){let d=a.len;for(rt(n,a.ins,-1);d;){let h=Math.min(l.len,d);l.ins>=0&&c<l.i&&l.len<=h&&(rt(n,0,l.ins),s&&xi(s,n,l.text),c=l.i),l.forward(h),d-=h}a.next()}else if(l.ins>=0){let d=0,h=l.len;for(;h;)if(a.ins==-1){let u=Math.min(h,a.len);d+=u,h-=u,a.forward(u)}else if(a.ins==0&&a.len<h)h-=a.len,a.next();else break;rt(n,d,c<l.i?l.ins:0),s&&c<l.i&&xi(s,n,l.text),c=l.i,l.forward(l.len-h)}else{if(l.done&&a.done)return s?qe.createSet(n,s):gi.create(n);throw new Error("Mismatched change set lengths")}}}function ja(r,e,t=!1){let i=[],n=t?[]:null,s=new Qn(r),l=new Qn(e);for(let a=!1;;){if(s.done&&l.done)return n?qe.createSet(i,n):gi.create(i);if(s.ins==0)rt(i,s.len,0,a),s.next();else if(l.len==0&&!l.done)rt(i,0,l.ins,a),n&&xi(n,i,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,l.len),d=i.length;if(s.ins==-1){let h=l.ins==-1?-1:l.off?0:l.ins;rt(i,c,h,a),n&&h&&xi(n,i,l.text)}else l.ins==-1?(rt(i,s.off?0:s.len,c,a),n&&xi(n,i,s.textBit(c))):(rt(i,s.off?0:s.len,l.off?0:l.ins,a),n&&!l.off&&xi(n,i,l.text));a=(s.ins>c||l.ins>=0&&l.len>c)&&(a||i.length>d),s.forward2(c),l.forward(c)}}}}class Qn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Oe.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Oe.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Zi{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Zi(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ne.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ne.range(this.anchor,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ne.range(e.anchor,e.head)}static create(e,t,i){return new Zi(e,t,i)}}class ne{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ne.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ne([this.main],0)}addRange(e,t=!0){return ne.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,ne.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ne(e.ranges.map(t=>Zi.fromJSON(t)),e.main)}static single(e,t=e){return new ne([ne.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let s=e[n];if(s.empty?s.from<=i:s.from<i)return ne.normalized(e.slice(),t);i=s.to}return new ne(e,t)}static cursor(e,t=0,i,n){return Zi.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(n??16777215)<<6)}static range(e,t,i,n){let s=(i??16777215)<<6|(n==null?7:Math.min(6,n));return t<e?Zi.create(t,e,48|s):Zi.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((n,s)=>n.from-s.from),t=e.indexOf(i);for(let n=1;n<e.length;n++){let s=e[n],l=e[n-1];if(s.empty?s.from<=l.to:s.from<l.to){let a=l.from,c=Math.max(s.to,l.to);n<=t&&t--,e.splice(--n,2,s.anchor>s.head?ne.range(c,a):ne.range(a,c))}}return new ne(e,t)}}function qa(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let ul=0;class ue{constructor(e,t,i,n,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=ul++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new ue(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:fl),!!e.static,e.enables)}of(e){return new ks([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ks(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ks(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function fl(r,e){return r==e||r.length==e.length&&r.every((t,i)=>t===e[i])}class ks{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=ul++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,s=this.id,l=e[s]>>1,a=this.type==2,c=!1,d=!1,h=[];for(let u of this.dependencies)u=="doc"?c=!0:u=="selection"?d=!0:((t=e[u.id])!==null&&t!==void 0?t:1)&1||h.push(e[u.id]);return{create(u){return u.values[l]=i(u),1},update(u,f){if(c&&f.docChanged||d&&(f.docChanged||f.selection)||gl(u,h)){let g=i(u);if(a?!ec(g,u.values[l],n):!n(g,u.values[l]))return u.values[l]=g,1}return 0},reconfigure:(u,f)=>{let g,R=f.config.address[s];if(R!=null){let p=Zs(f,R);if(this.dependencies.every(M=>M instanceof ue?f.facet(M)===u.facet(M):M instanceof Yi?f.field(M,!1)==u.field(M,!1):!0)||(a?ec(g=i(u),p,n):n(g=i(u),p)))return u.values[l]=p,0}else g=i(u);return u.values[l]=g,1}}}}function ec(r,e,t){if(r.length!=e.length)return!1;for(let i=0;i<r.length;i++)if(!t(r[i],e[i]))return!1;return!0}function gl(r,e){let t=!1;for(let i of e)Hn(r,i)&1&&(t=!0);return t}function aS(r,e,t){let i=t.map(c=>r[c.id]),n=t.map(c=>c.type),s=i.filter(c=>!(c&1)),l=r[e.id]>>1;function a(c){let d=[];for(let h=0;h<i.length;h++){let u=Zs(c,i[h]);if(n[h]==2)for(let f of u)d.push(f);else d.push(u)}return e.combine(d)}return{create(c){for(let d of i)Hn(c,d);return c.values[l]=a(c),1},update(c,d){if(!gl(c,s))return 0;let h=a(c);return e.compare(h,c.values[l])?0:(c.values[l]=h,1)},reconfigure(c,d){let h=gl(c,i),u=d.config.facets[e.id],f=d.facet(e);if(u&&!h&&fl(t,u))return c.values[l]=f,0;let g=a(c);return e.compare(g,f)?(c.values[l]=f,0):(c.values[l]=g,1)}}}const Ds=ue.define({static:!0});class Yi{constructor(e,t,i,n,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(e){let t=new Yi(ul++,e.create,e.update,e.compare||((i,n)=>i===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ds).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,n)=>{let s=i.values[t],l=this.updateF(s,n);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,n)=>{let s=i.facet(Ds),l=n.facet(Ds),a;return(a=s.find(c=>c.field==this))&&a!=l.find(c=>c.field==this)?(i.values[t]=a.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Ds.of({field:this,create:e})]}get extension(){return this}}const Qi={lowest:4,low:3,default:2,high:1,highest:0};function Kn(r){return e=>new tc(e,r)}const cS={highest:Kn(Qi.highest),high:Kn(Qi.high),default:Kn(Qi.default),low:Kn(Qi.low),lowest:Kn(Qi.lowest)};class tc{constructor(e,t){this.inner=e,this.prec=t}}class Es{of(e){return new Rl(this,e)}reconfigure(e){return Es.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Rl{constructor(e,t){this.compartment=e,this.inner=t}}class Us{constructor(e,t,i,n,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],s=Object.create(null),l=new Map;for(let f of dS(e,t,l))f instanceof Yi?n.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let a=Object.create(null),c=[],d=[];for(let f of n)a[f.id]=d.length<<1,d.push(g=>f.slot(g));let h=i?.config.facets;for(let f in s){let g=s[f],R=g[0].facet,p=h&&h[f]||[];if(g.every(M=>M.type==0))if(a[R.id]=c.length<<1|1,fl(p,g))c.push(i.facet(R));else{let M=R.combine(g.map(S=>S.value));c.push(i&&R.compare(M,i.facet(R))?i.facet(R):M)}else{for(let M of g)M.type==0?(a[M.id]=c.length<<1|1,c.push(M.value)):(a[M.id]=d.length<<1,d.push(S=>M.dynamicSlot(S)));a[R.id]=d.length<<1,d.push(M=>aS(M,R,g))}}let u=d.map(f=>f(a));return new Us(e,l,u,a,c,s)}}function dS(r,e,t){let i=[[],[],[],[],[]],n=new Map;function s(l,a){let c=n.get(l);if(c!=null){if(c<=a)return;let d=i[c].indexOf(l);d>-1&&i[c].splice(d,1),l instanceof Rl&&t.delete(l.compartment)}if(n.set(l,a),Array.isArray(l))for(let d of l)s(d,a);else if(l instanceof Rl){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(l.compartment)||l.inner;t.set(l.compartment,d),s(d,a)}else if(l instanceof tc)s(l.inner,l.prec);else if(l instanceof Yi)i[a].push(l),l.provides&&s(l.provides,a);else if(l instanceof ks)i[a].push(l),l.facet.extensions&&s(l.facet.extensions,Qi.default);else{let d=l.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(d,a)}}return s(r,Qi.default),i.reduce((l,a)=>l.concat(a))}function Hn(r,e){if(e&1)return 2;let t=e>>1,i=r.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[t]=4;let n=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|n}function Zs(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const ic=ue.define(),pl=ue.define({combine:r=>r.some(e=>e),static:!0}),nc=ue.define({combine:r=>r.length?r[0]:void 0,static:!0}),sc=ue.define(),oc=ue.define(),lc=ue.define(),rc=ue.define({combine:r=>r.length?r[0]:!1});class rn{constructor(e,t){this.type=e,this.value=t}static define(){return new hS}}class hS{of(e){return new rn(this,e)}}class uS{constructor(e){this.map=e}of(e){return new Je(this,e)}}class Je{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Je(this.type,t)}is(e){return this.type==e}static define(e={}){return new uS(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let s=n.map(t);s&&i.push(s)}return i}}Je.reconfigure=Je.define(),Je.appendConfig=Je.define();class at{constructor(e,t,i,n,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&qa(i,t.newLength),s.some(a=>a.type==at.time)||(this.annotations=s.concat(at.time.of(Date.now())))}static create(e,t,i,n,s,l){return new at(e,t,i,n,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(at.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}at.time=rn.define(),at.userEvent=rn.define(),at.addToHistory=rn.define(),at.remote=rn.define();function fS(r,e){let t=[];for(let i=0,n=0;;){let s,l;if(i<r.length&&(n==e.length||e[n]>=r[i]))s=r[i++],l=r[i++];else if(n<e.length)s=e[n++],l=e[n++];else return t;!t.length||t[t.length-1]<s?t.push(s,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function ac(r,e,t){var i;let n,s,l;return t?(n=e.changes,s=qe.empty(e.changes.length),l=r.changes.compose(e.changes)):(n=e.changes.map(r.changes),s=r.changes.mapDesc(e.changes,!0),l=r.changes.compose(n)),{changes:l,selection:e.selection?e.selection.map(s):(i=r.selection)===null||i===void 0?void 0:i.map(n),effects:Je.mapEffects(r.effects,n).concat(Je.mapEffects(e.effects,s)),annotations:r.annotations.length?r.annotations.concat(e.annotations):e.annotations,scrollIntoView:r.scrollIntoView||e.scrollIntoView}}function ml(r,e,t){let i=e.selection,n=an(e.annotations);return e.userEvent&&(n=n.concat(at.userEvent.of(e.userEvent))),{changes:e.changes instanceof qe?e.changes:qe.of(e.changes||[],t,r.facet(nc)),selection:i&&(i instanceof ne?i:ne.single(i.anchor,i.head)),effects:an(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}function cc(r,e,t){let i=ml(r,e.length?e[0]:{},r.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let l=!!e[s].sequential;i=ac(i,ml(r,e[s],l?i.changes.newLength:r.doc.length),l)}let n=at.create(r,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return RS(t?gS(n):n)}function gS(r){let e=r.startState,t=!0;for(let n of e.facet(sc)){let s=n(r);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:fS(t,s))}if(t!==!0){let n,s;if(t===!1)s=r.changes.invertedDesc,n=qe.empty(e.doc.length);else{let l=r.changes.filter(t);n=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}r=at.create(e,n,r.selection&&r.selection.map(s),Je.mapEffects(r.effects,s),r.annotations,r.scrollIntoView)}let i=e.facet(oc);for(let n=i.length-1;n>=0;n--){let s=i[n](r);s instanceof at?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof at?r=s[0]:r=cc(e,an(s),!1)}return r}function RS(r){let e=r.startState,t=e.facet(lc),i=r;for(let n=t.length-1;n>=0;n--){let s=t[n](r);s&&Object.keys(s).length&&(i=ac(i,ml(e,s,r.changes.newLength),!0))}return i==r?r:at.create(e,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const pS=[];function an(r){return r==null?pS:Array.isArray(r)?r:[r]}var Ri=function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r}(Ri||(Ri={}));const mS=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Sl;try{Sl=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function SS(r){if(Sl)return Sl.test(r);for(let e=0;e<r.length;e++){let t=r[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||mS.test(t)))return!0}return!1}function MS(r){return e=>{if(!/\S/.test(e))return Ri.Space;if(SS(e))return Ri.Word;for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>-1)return Ri.Word;return Ri.Other}}class ye{constructor(e,t,i,n,s,l){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)Hn(this,a<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Hn(this,i),Zs(this,i)}update(...e){return cc(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:n}=t;for(let a of e.effects)a.is(Es.reconfigure)?(t&&(n=new Map,t.compartments.forEach((c,d)=>n.set(d,c)),t=null),n.set(a.value.compartment,a.value.extension)):a.is(Je.reconfigure)?(t=null,i=a.value):a.is(Je.appendConfig)&&(t=null,i=an(i).concat(a.value));let s;t?s=e.startState.values.slice():(t=Us.resolve(i,n,this),s=new ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(c,d)=>d.reconfigure(c,this),null).values);let l=e.startState.facet(pl)?e.newSelection:e.newSelection.asSingle();new ye(t,e.newDoc,l,s,(a,c)=>c.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ne.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),s=[i.range],l=an(i.effects);for(let a=1;a<t.ranges.length;a++){let c=e(t.ranges[a]),d=this.changes(c.changes),h=d.map(n);for(let f=0;f<a;f++)s[f]=s[f].map(h);let u=n.mapDesc(d,!0);s.push(c.range.map(u)),n=n.compose(h),l=Je.mapEffects(l,h).concat(Je.mapEffects(an(c.effects),u))}return{changes:n,selection:ne.create(s,t.mainIndex),effects:l}}changes(e=[]){return e instanceof qe?e:qe.of(e,this.doc.length,this.facet(ye.lineSeparator))}toText(e){return Oe.of(e.split(this.facet(ye.lineSeparator)||cl))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Hn(this,t),Zs(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof Yi&&this.config.address[n.id]!=null&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let l=i[s],a=e[s];n.push(l.init(c=>l.spec.fromJSON(a,c)))}}return ye.create({doc:e.doc,selection:ne.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=Us.resolve(e.extensions||[],new Map),i=e.doc instanceof Oe?e.doc:Oe.of((e.doc||"").split(t.staticFacet(ye.lineSeparator)||cl)),n=e.selection?e.selection instanceof ne?e.selection:ne.single(e.selection.anchor,e.selection.head):ne.single(0);return qa(n,i.length),t.staticFacet(pl)||(n=n.asSingle()),new ye(t,i,n,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(ye.tabSize)}get lineBreak(){return this.facet(ye.lineSeparator)||`
112
+ `}get readOnly(){return this.facet(rc)}phrase(e,...t){for(let i of this.facet(ye.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let s=+(n||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let s of this.facet(ic))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&n.push(l[e]);return n}charCategorizer(e){return MS(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,a=e-i;for(;l>0;){let c=fi(t,l,!1);if(s(t.slice(c,l))!=Ri.Word)break;l=c}for(;a<n;){let c=fi(t,a);if(s(t.slice(a,c))!=Ri.Word)break;a=c}return l==a?null:ne.range(l+i,a+i)}}ye.allowMultipleSelections=pl,ye.tabSize=ue.define({combine:r=>r.length?r[0]:4}),ye.lineSeparator=nc,ye.readOnly=rc,ye.phrases=ue.define({compare(r,e){let t=Object.keys(r),i=Object.keys(e);return t.length==i.length&&t.every(n=>r[n]==e[n])}}),ye.languageData=ic,ye.changeFilter=sc,ye.transactionFilter=oc,ye.transactionExtender=lc,Es.reconfigure=Je.define();class cn{eq(e){return this==e}range(e,t=e){return Bn.create(e,t,this)}}cn.prototype.startSide=cn.prototype.endSide=0,cn.prototype.point=!1,cn.prototype.mapMode=Pt.TrackDel;class Bn{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Bn(e,t,i)}}function Ml(r,e){return r.from-e.from||r.value.startSide-e.value.startSide}class Nl{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let s=i?this.to:this.from;for(let l=n,a=s.length;;){if(l==a)return l;let c=l+a>>1,d=s[c]-e||(i?this.value[c].endSide:this.value[c].startSide)-t;if(c==l)return d>=0?l:a;d>=0?a=c:l=c+1}}between(e,t,i,n){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);s<l;s++)if(n(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let i=[],n=[],s=[],l=-1,a=-1;for(let c=0;c<this.value.length;c++){let d=this.value[c],h=this.from[c]+e,u=this.to[c]+e,f,g;if(h==u){let R=t.mapPos(h,d.startSide,d.mapMode);if(R==null||(f=g=R,d.startSide!=d.endSide&&(g=t.mapPos(h,d.endSide),g<f)))continue}else if(f=t.mapPos(h,d.startSide),g=t.mapPos(u,d.endSide),f>g||f==g&&d.startSide>0&&d.endSide<=0)continue;(g-f||d.endSide-d.startSide)<0||(l<0&&(l=f),d.point&&(a=Math.max(a,g-f)),i.push(d),n.push(f-l),s.push(g-l))}return{mapped:i.length?new Nl(n,s,i,a):null,pos:l}}}class We{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new We(e,t,i,n)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(Ml)),this.isEmpty)return t.length?We.of(t):this;let a=new hc(this,null,-1).goto(0),c=0,d=[],h=new Ys;for(;a.value||c<t.length;)if(c<t.length&&(a.from-t[c].from||a.startSide-t[c].value.startSide)>=0){let u=t[c++];h.addInner(u.from,u.to,u.value)||d.push(u)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(c==t.length||this.chunkEnd(a.chunkIndex)<t[c].from)&&(!l||n>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&h.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!l||n>a.to||s<a.from||l(a.from,a.to,a.value))&&(h.addInner(a.from,a.to,a.value)||d.push(Bn.create(a.from,a.to,a.value))),a.next());return h.finishInner(this.nextLayer.isEmpty&&!d.length?We.empty:this.nextLayer.update({add:d,filter:l,filterFrom:n,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],n=-1;for(let l=0;l<this.chunk.length;l++){let a=this.chunkPos[l],c=this.chunk[l],d=e.touchesRange(a,a+c.length);if(d===!1)n=Math.max(n,c.maxPoint),t.push(c),i.push(e.mapPos(a));else if(d===!0){let{mapped:h,pos:u}=c.map(a,e);h&&(n=Math.max(n,h.maxPoint),t.push(h),i.push(u))}}let s=this.nextLayer.map(e);return t.length==0?s:new We(i,t,s||We.empty,n)}between(e,t,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let s=this.chunkPos[n],l=this.chunk[n];if(t>=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Gn.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Gn.from(e).goto(t)}static compare(e,t,i,n,s=-1){let l=e.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),a=t.filter(u=>u.maxPoint>0||!u.isEmpty&&u.maxPoint>=s),c=dc(l,a,i),d=new _n(l,c,s),h=new _n(a,c,s);i.iterGaps((u,f,g)=>uc(d,u,h,f,g,n)),i.empty&&i.length==0&&uc(d,0,h,0,0,n)}static eq(e,t,i=0,n){n==null&&(n=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),l=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let a=dc(s,l),c=new _n(s,a,0).goto(i),d=new _n(l,a,0).goto(i);for(;;){if(c.to!=d.to||!Ll(c.active,d.active)||c.point&&(!d.point||!c.point.eq(d.point)))return!1;if(c.to>n)return!0;c.next(),d.next()}}static spans(e,t,i,n,s=-1){let l=new _n(e,null,s).goto(t),a=t,c=l.openStart;for(;;){let d=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),u=l.pointFrom<t?h.length+1:l.point.startSide<0?h.length:Math.min(h.length,c);n.point(a,d,l.point,h,u,l.pointRank),c=Math.min(l.openEnd(d),h.length)}else d>a&&(n.span(a,d,l.active,c),c=l.openEnd(d));if(l.to>i)return c+(l.point&&l.to>i?1:0);a=l.to,l.next()}}static of(e,t=!1){let i=new Ys;for(let n of e instanceof Bn?[e]:t?NS(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return We.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=We.empty;n=n.nextLayer)t=new We(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}We.empty=new We([],[],null,-1);function NS(r){if(r.length>1)for(let e=r[0],t=1;t<r.length;t++){let i=r[t];if(Ml(e,i)>0)return r.slice().sort(Ml);e=i}return r}We.empty.nextLayer=We.empty;class Ys{finishChunk(e){this.chunks.push(new Nl(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Ys)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(We.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=We.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function dc(r,e,t){let i=new Map;for(let s of r)for(let l=0;l<s.chunk.length;l++)s.chunk[l].maxPoint<=0&&i.set(s.chunk[l],s.chunkPos[l]);let n=new Set;for(let s of e)for(let l=0;l<s.chunk.length;l++){let a=i.get(s.chunk[l]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[l]&&!t?.touchesRange(a,a+s.chunk[l].length)&&n.add(s.chunk[l])}return n}class hc{constructor(e,t,i,n=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let n=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(n)||this.layer.chunkEnd(this.chunkIndex)<e||n.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Gn{constructor(e){this.heap=e}static from(e,t=null,i=-1){let n=[];for(let s=0;s<e.length;s++)for(let l=e[s];!l.isEmpty;l=l.nextLayer)l.maxPoint>=i&&n.push(new hc(l,t,i,s));return n.length==1?n[0]:new Gn(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)bl(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)bl(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),bl(this.heap,0)}}}function bl(r,e){for(let t=r[e];;){let i=(e<<1)+1;if(i>=r.length)break;let n=r[i];if(i+1<r.length&&n.compare(r[i+1])>=0&&(n=r[i+1],i++),t.compare(n)<0)break;r[i]=t,r[e]=n,e=i}}class _n{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Gn.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Qs(this.active,e),Qs(this.activeTo,e),Qs(this.activeRank,e),this.minActive=fc(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||n-this.activeTo[t])>0;)t++;Ks(this.active,t,i),Ks(this.activeTo,t,n),Ks(this.activeRank,t,s),e&&Ks(e,t,this.cursor.from),this.minActive=fc(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Qs(i,n)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let n=i.length-1;n>=0&&i[n]<e;n--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function uc(r,e,t,i,n,s){r.goto(e),t.goto(i);let l=i+n,a=i,c=i-e;for(;;){let d=r.to+c-t.to,h=d||r.endSide-t.endSide,u=h<0?r.to+c:t.to,f=Math.min(u,l);if(r.point||t.point?r.point&&t.point&&(r.point==t.point||r.point.eq(t.point))&&Ll(r.activeForPoint(r.to),t.activeForPoint(t.to))||s.comparePoint(a,f,r.point,t.point):f>a&&!Ll(r.active,t.active)&&s.compareRange(a,f,r.active,t.active),u>l)break;(d||r.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(u),a=u,h<=0&&r.next(),h>=0&&t.next()}}function Ll(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!=e[t]&&!r[t].eq(e[t]))return!1;return!0}function Qs(r,e){for(let t=e,i=r.length-1;t<i;t++)r[t]=r[t+1];r.pop()}function Ks(r,e,t){for(let i=r.length-1;i>=e;i--)r[i+1]=r[i];r[e]=t}function fc(r,e){let t=-1,i=1e9;for(let n=0;n<e.length;n++)(e[n]-i||r[n].endSide-r[t].endSide)<0&&(t=n,i=e[n]);return t}function bS(r,e,t,i){for(let n=0,s=0;;){if(s>=e)return n;if(n==r.length)break;s+=r.charCodeAt(n)==9?t-s%t:1,n=fi(r,n)}return i===!0?-1:r.length}const Ol="ͼ",gc=typeof Symbol>"u"?"__"+Ol:Symbol.for(Ol),Pl=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class wi{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,a,c,d){let h=[],u=/^@(\w+)\b/.exec(l[0]),f=u&&u[1]=="keyframes";if(u&&a==null)return c.push(l[0]+";");for(let g in a){let R=a[g];if(/&/.test(g))s(g.split(/,\s*/).map(p=>l.map(M=>p.replace(/&/,M))).reduce((p,M)=>p.concat(M)),R,c);else if(R&&typeof R=="object"){if(!u)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(n(g),R,h,f)}else R!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+R+";")}(h.length||f)&&c.push((i&&!u&&!d?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)s(n(l),e[l],this.rules)}getRules(){return this.rules.join(`
113
+ `)}static newName(){let e=Rc[gc]||1;return Rc[gc]=e+1,Ol+e.toString(36)}static mount(e,t,i){let n=e[Pl],s=i&&i.nonce;n?s&&n.setNonce(s):n=new LS(e,s),n.mount(Array.isArray(t)?t:[t],e)}}let pc=new Map;class LS{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=pc.get(i);if(s)return e[Pl]=s;this.sheet=new n.CSSStyleSheet,pc.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pl]=this}mount(e,t){let i=this.sheet,n=0,s=0;for(let l=0;l<e.length;l++){let a=e[l],c=this.modules.indexOf(a);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,a),i)for(let d=0;d<a.rules.length;d++)i.insertRule(a.rules[d],n++)}else{for(;s<c;)n+=this.modules[s++].rules.length;n+=a.rules.length,s++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
114
+ `;this.styleTag.textContent=l;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}for(var dn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Tl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},it=0;it<10;it++)dn[48+it]=dn[96+it]=String(it);for(var it=1;it<=24;it++)dn[it+111]="F"+it;for(var it=65;it<=90;it++)dn[it]=String.fromCharCode(it+32),Tl[it]=String.fromCharCode(it);for(var Il in dn)Tl.hasOwnProperty(Il)||(Tl[Il]=dn[Il]);function An(r){let e;return r.nodeType==11?e=r.getSelection?r:r.ownerDocument:e=r,e.getSelection()}function xl(r,e){return e?r==e||r.contains(e.nodeType!=1?e.parentNode:e):!1}function Hs(r,e){if(!e.anchorNode)return!1;try{return xl(r,e.anchorNode)}catch{return!1}}function Jn(r){return r.nodeType==3?Hi(r,0,r.nodeValue.length).getClientRects():r.nodeType==1?r.getClientRects():[]}function zn(r,e,t,i){return t?mc(r,e,t,i,-1)||mc(r,e,t,i,1):!1}function Ki(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e}function Bs(r){return r.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(r.nodeName)}function mc(r,e,t,i,n){for(;;){if(r==t&&e==i)return!0;if(e==(n<0?0:ei(r))){if(r.nodeName=="DIV")return!1;let s=r.parentNode;if(!s||s.nodeType!=1)return!1;e=Ki(r)+(n<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(n<0?-1:0)],r.nodeType==1&&r.contentEditable=="false")return!1;e=n<0?ei(r):0}else return!1}}function ei(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Gs(r,e){let t=e?r.left:r.right;return{left:t,right:t,top:r.top,bottom:r.bottom}}function OS(r){let e=r.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:r.innerWidth,top:0,bottom:r.innerHeight}}function Sc(r,e){let t=e.width/r.offsetWidth,i=e.height/r.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-r.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-r.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function PS(r,e,t,i,n,s,l,a){let c=r.ownerDocument,d=c.defaultView||window;for(let h=r,u=!1;h&&!u;)if(h.nodeType==1){let f,g=h==c.body,R=1,p=1;if(g)f=OS(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(u=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let b=h.getBoundingClientRect();({scaleX:R,scaleY:p}=Sc(h,b)),f={left:b.left,right:b.left+h.clientWidth*R,top:b.top,bottom:b.top+h.clientHeight*p}}let M=0,S=0;if(n=="nearest")e.top<f.top?(S=e.top-(f.top+l),t>0&&e.bottom>f.bottom+S&&(S=e.bottom-f.bottom+l)):e.bottom>f.bottom&&(S=e.bottom-f.bottom+l,t<0&&e.top-S<f.top&&(S=e.top-(f.top+l)));else{let b=e.bottom-e.top,P=f.bottom-f.top;S=(n=="center"&&b<=P?e.top+b/2-P/2:n=="start"||n=="center"&&t<0?e.top-l:e.bottom-P+l)-f.top}if(i=="nearest"?e.left<f.left?(M=e.left-(f.left+s),t>0&&e.right>f.right+M&&(M=e.right-f.right+s)):e.right>f.right&&(M=e.right-f.right+s,t<0&&e.left<f.left+M&&(M=e.left-(f.left+s))):M=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==a?e.left-s:e.right-(f.right-f.left)+s)-f.left,M||S)if(g)d.scrollBy(M,S);else{let b=0,P=0;if(S){let N=h.scrollTop;h.scrollTop+=S/p,P=(h.scrollTop-N)*p}if(M){let N=h.scrollLeft;h.scrollLeft+=M/R,b=(h.scrollLeft-N)*R}e={left:e.left-b,top:e.top-P,right:e.right-b,bottom:e.bottom-P},b&&Math.abs(b-M)<1&&(i="nearest"),P&&Math.abs(P-S)<1&&(n="nearest")}if(g)break;(e.top<f.top||e.bottom>f.bottom||e.left<f.left||e.right>f.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function TS(r){let e=r.ownerDocument,t,i;for(let n=r.parentNode;n&&!(n==e.body||t&&i);)if(n.nodeType==1)!i&&n.scrollHeight>n.clientHeight&&(i=n),!t&&n.scrollWidth>n.clientWidth&&(t=n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;return{x:t,y:i}}class IS{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?ei(t):0),i,Math.min(e.focusOffset,i?ei(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let hn=null;function Mc(r){if(r.setActive)return r.setActive();if(hn)return r.focus(hn);let e=[];for(let t=r;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(r.focus(hn==null?{get preventScroll(){return hn={preventScroll:!0},!0}}:void 0),!hn){hn=!1;for(let t=0;t<e.length;){let i=e[t++],n=e[t++],s=e[t++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let Nc;function Hi(r,e,t=e){let i=Nc||(Nc=document.createRange());return i.setEnd(r,t),i.setStart(r,e),i}function un(r,e,t,i){let n={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:n.altKey,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,metaKey:n.metaKey}=i);let s=new KeyboardEvent("keydown",n);s.synthetic=!0,r.dispatchEvent(s);let l=new KeyboardEvent("keyup",n);return l.synthetic=!0,r.dispatchEvent(l),s.defaultPrevented||l.defaultPrevented}function xS(r){for(;r;){if(r&&(r.nodeType==9||r.nodeType==11&&r.host))return r;r=r.assignedSlot||r.parentNode}return null}function bc(r){for(;r.attributes.length;)r.removeAttributeNode(r.attributes[0])}function wS(r,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,ei(t));;)if(i){if(t.nodeType!=1)return!1;let n=t.childNodes[i-1];n.contentEditable=="false"?i--:(t=n,i=ei(t))}else{if(t==r)return!0;i=Ki(t),t=t.parentNode}}function Lc(r){return r.scrollTop>Math.max(1,r.scrollHeight-r.clientHeight-4)}function Oc(r,e){for(let t=r,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=ei(t)}else if(t.parentNode&&!Bs(t))i=Ki(t),t=t.parentNode;else return null}}function Pc(r,e){for(let t=r,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!Bs(t))i=Ki(t)+1,t=t.parentNode;else return null}}class ct{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new ct(e.parentNode,Ki(e),t)}static after(e,t){return new ct(e.parentNode,Ki(e)+1,t)}}const wl=[];class Ve{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,n=null,s;for(let l of this.children){if(l.flags&7){if(!l.dom&&(s=n?n.nextSibling:i.firstChild)){let a=Ve.get(s);(!a||!a.parent&&a.canReuseDOM(l))&&l.reuseDOM(s)}l.sync(e,t),l.flags&=-8}if(s=n?n.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&s!=l.dom&&(t.written=!0),l.dom.parentNode==i)for(;s&&s!=l.dom;)s=Tc(s);else i.insertBefore(l.dom,s);n=l.dom}for(s=n?n.nextSibling:i.firstChild,s&&t&&t.node==i&&(t.written=!0);s;)s=Tc(s)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let n=ei(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;n==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?n=-1:n=1),e=s}n<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Ve.get(i);)i=i.nextSibling;if(!i)return this.length;for(let n=0,s=0;;n++){let l=this.children[n];if(l.dom==i)return s;s+=l.length+l.breakAfter}}domBoundsAround(e,t,i=0){let n=-1,s=-1,l=-1,a=-1;for(let c=0,d=i,h=i;c<this.children.length;c++){let u=this.children[c],f=d+u.length;if(d<e&&f>t)return u.domBoundsAround(e,t,d);if(f>=e&&n==-1&&(n=c,s=d),d>t&&u.dom.parentNode==this.dom){l=c,a=h;break}h=f,d=f+u.breakAfter}return{from:s,to:a<0?i+this.length:a,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l<this.children.length&&l>=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=wl){this.markDirty();for(let n=e;n<t;n++){let s=this.children[n];s.parent==this&&i.indexOf(s)<0&&s.destroy()}i.length<250?this.children.splice(e,t-e,...i):this.children=[].concat(this.children.slice(0,e),i,this.children.slice(t));for(let n=0;n<i.length;n++)i[n].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new Ic(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,i,n,s,l){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}Ve.prototype.breakAfter=0;function Tc(r){let e=r.nextSibling;return r.parentNode.removeChild(r),e}class Ic{constructor(e,t,i){this.children=e,this.pos=t,this.i=i,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function xc(r,e,t,i,n,s,l,a,c){let{children:d}=r,h=d.length?d[e]:null,u=s.length?s[s.length-1]:null,f=u?u.breakAfter:l;if(!(e==i&&h&&!l&&!f&&s.length<2&&h.merge(t,n,s.length?u:null,t==0,a,c))){if(i<d.length){let g=d[i];g&&(n<g.length||g.breakAfter&&u?.breakAfter)?(e==i&&(g=g.split(n),n=0),!f&&u&&g.merge(0,n,u,!0,0,c)?s[s.length-1]=g:((n||g.children.length&&!g.children[0].length)&&g.merge(0,n,null,!1,0,c),s.push(g))):g?.breakAfter&&(u?u.breakAfter=1:l=1),i++}for(h&&(h.breakAfter=l,t>0&&(!l&&s.length&&h.merge(t,h.length,s[0],!1,a,0)?h.breakAfter=s.shift().breakAfter:(t<h.length||h.children.length&&h.children[h.children.length-1].length==0)&&h.merge(t,h.length,null,!1,a,0),e++));e<i&&s.length;)if(d[i-1].become(s[s.length-1]))i--,s.pop(),c=s.length?0:a;else if(d[e].become(s[0]))e++,s.shift(),a=s.length?0:c;else break;!s.length&&e&&i<d.length&&!d[e-1].breakAfter&&d[i].merge(0,0,d[e-1],!1,a,c)&&e--,(e<i||s.length)&&r.replaceChildren(e,i,s)}}function wc(r,e,t,i,n,s){let l=r.childCursor(),{i:a,off:c}=l.findPos(t,1),{i:d,off:h}=l.findPos(e,-1),u=e-t;for(let f of i)u+=f.length;r.length+=u,xc(r,d,h,a,c,i,0,n,s)}let bt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},yl=typeof document<"u"?document:{documentElement:{style:{}}};const Vl=/Edge\/(\d+)/.exec(bt.userAgent),yc=/MSIE \d/.test(bt.userAgent),Fl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(bt.userAgent),_s=!!(yc||Fl||Vl),Vc=!_s&&/gecko\/(\d+)/i.test(bt.userAgent),Xl=!_s&&/Chrome\/(\d+)/.exec(bt.userAgent),Fc="webkitFontSmoothing"in yl.documentElement.style,Xc=!_s&&/Apple Computer/.test(bt.vendor),Cc=Xc&&(/Mobile\/\w+/.test(bt.userAgent)||bt.maxTouchPoints>2);var ee={mac:Cc||/Mac/.test(bt.platform),windows:/Win/.test(bt.platform),linux:/Linux|X11/.test(bt.platform),ie:_s,ie_version:yc?yl.documentMode||6:Fl?+Fl[1]:Vl?+Vl[1]:0,gecko:Vc,gecko_version:Vc?+(/Firefox\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,chrome:!!Xl,chrome_version:Xl?+Xl[1]:0,ios:Cc,android:/Android\b/.test(bt.userAgent),webkit:Fc,safari:Xc,webkit_version:Fc?+(/\bAppleWebKit\/(\d+)/.exec(bt.userAgent)||[0,0])[1]:0,tabSize:yl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const yS=256;class Ut extends Ve{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Ut)||this.length-(t-e)+i.length>yS||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Ut(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new ct(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return VS(this.dom,e,t)}}class pi extends Ve{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let n of t)n.setParent(this)}setAttrs(e){if(bc(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,n,s,l){return i&&(!(i instanceof pi&&i.mark.eq(this.mark))||e&&s<=0||t<this.length&&l<=0)?!1:(wc(this,e,t,i?i.children.slice():[],s-1,l-1),this.markDirty(),!0)}split(e){let t=[],i=0,n=-1,s=0;for(let a of this.children){let c=i+a.length;c>e&&t.push(i<e?a.split(e-i):a),n<0&&i>=e&&(n=s),i=c,s++}let l=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new pi(this.mark,t,l)}domAtPos(e){return vc(this,e)}coordsAt(e,t){return kc(this,e,t)}}function VS(r,e,t){let i=r.nodeValue.length;e>i&&(e=i);let n=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?ee.chrome||ee.gecko||(e?(n--,l=1):s<i&&(s++,l=-1)):t<0?n--:s<i&&s++;let a=Hi(r,n,s).getClientRects();if(!a.length)return null;let c=a[(l?l<0:t>=0)?0:a.length-1];return ee.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,d=>d.width)||c),l?Gs(c,l<0):c||null}class Bi extends Ve{static create(e,t,i){return new Bi(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=Bi.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,i,n,s,l){return i&&(!(i instanceof Bi)||!this.widget.compare(i.widget)||e>0&&s<=0||t<this.length&&l<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}become(e){return e instanceof Bi&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Oe.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,i=t&&t.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):Oe.empty}domAtPos(e){return(this.length?e==0:this.side>0)?ct.before(this.dom):ct.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let n=this.dom.getClientRects(),s=null;if(!n.length)return null;let l=this.side?this.side<0:e>0;for(let a=l?n.length-1:0;s=n[a],!(e>0?a==0:a==n.length-1||s.top<s.bottom);a+=l?-1:1);return Gs(s,!l)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class fn extends Ve{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof fn&&e.side==this.side}split(){return new fn(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?ct.before(this.dom):ct.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Oe.empty}get isHidden(){return!0}}Ut.prototype.children=Bi.prototype.children=fn.prototype.children=wl;function vc(r,e){let t=r.dom,{children:i}=r,n=0;for(let s=0;n<i.length;n++){let l=i[n],a=s+l.length;if(!(a==s&&l.getSide()<=0)){if(e>s&&e<a&&l.dom.parentNode==t)return l.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=n;s>0;s--){let l=i[s-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let s=n;s<i.length;s++){let l=i[s];if(l.dom.parentNode==t)return l.domAtPos(0)}return new ct(t,0)}function Wc(r,e,t){let i,{children:n}=r;t>0&&e instanceof pi&&n.length&&(i=n[n.length-1])instanceof pi&&i.mark.eq(e.mark)?Wc(i,e.children[0],t-1):(n.push(e),e.setParent(r)),r.length+=e.length}function kc(r,e,t){let i=null,n=-1,s=null,l=-1;function a(d,h){for(let u=0,f=0;u<d.children.length&&f<=h;u++){let g=d.children[u],R=f+g.length;R>=h&&(g.children.length?a(g,h-f):(!s||s.isHidden&&(t>0||XS(s,g)))&&(R>h||f==R&&g.getSide()>0)?(s=g,l=h-f):(f<h||f==R&&g.getSide()<0&&!g.isHidden)&&(i=g,n=h-f)),f=R}}a(r,e);let c=(t<0?i:s)||i||s;return c?c.coordsAt(Math.max(0,c==i?n:l),t):FS(r)}function FS(r){let e=r.dom.lastChild;if(!e)return r.dom.getBoundingClientRect();let t=Jn(e);return t[t.length-1]||null}function XS(r,e){let t=r.coordsAt(0,1),i=e.coordsAt(0,1);return t&&i&&i.top<t.bottom}function Cl(r,e){for(let t in r)t=="class"&&e.class?e.class+=" "+r.class:t=="style"&&e.style?e.style+=";"+r.style:e[t]=r[t];return e}const Dc=Object.create(null);function As(r,e,t){if(r==e)return!0;r||(r=Dc),e||(e=Dc);let i=Object.keys(r),n=Object.keys(e);if(i.length-(t&&i.indexOf(t)>-1?1:0)!=n.length-(t&&n.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(n.indexOf(s)==-1||r[s]!==e[s]))return!1;return!0}function vl(r,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?r.style.cssText="":r.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?r.style.cssText=t[n]:r.setAttribute(n,t[n]));return i}function CS(r){let e=Object.create(null);for(let t=0;t<r.attributes.length;t++){let i=r.attributes[t];e[i.name]=i.value}return e}class Wl{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var ti=function(r){return r[r.Text=0]="Text",r[r.WidgetBefore=1]="WidgetBefore",r[r.WidgetAfter=2]="WidgetAfter",r[r.WidgetRange=3]="WidgetRange",r}(ti||(ti={}));class dt extends cn{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new $n(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new yi(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,n;if(e.isBlockGap)i=-5e8,n=4e8;else{let{start:s,end:l}=Ec(e,t);i=(s?t?-3e8:-1:5e8)-1,n=(l?t?2e8:1:-6e8)+1}return new yi(e,i,n,t,e.widget||null,!0)}static line(e){return new jn(e)}static set(e,t=!1){return We.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}dt.none=We.empty;class $n extends dt{constructor(e){let{start:t,end:i}=Ec(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof $n&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&As(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}$n.prototype.point=!1;class jn extends dt{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof jn&&this.spec.class==e.spec.class&&As(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}jn.prototype.mapMode=Pt.TrackBefore,jn.prototype.point=!0;class yi extends dt{constructor(e,t,i,n,s,l){super(t,i,s,e),this.block=n,this.isReplace=l,this.mapMode=n?t<=0?Pt.TrackBefore:Pt.TrackAfter:Pt.TrackDel}get type(){return this.startSide!=this.endSide?ti.WidgetRange:this.startSide<=0?ti.WidgetBefore:ti.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof yi&&vS(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}yi.prototype.point=!0;function Ec(r,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=r;return t==null&&(t=r.inclusive),i==null&&(i=r.inclusive),{start:t??e,end:i??e}}function vS(r,e){return r==e||!!(r&&e&&r.compare(e))}function Js(r,e,t,i=0){let n=t.length-1;n>=0&&t[n]+i>=r?t[n]=Math.max(t[n],e):t.push(r,e)}class Ge extends Ve{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,s,l){if(i){if(!(i instanceof Ge))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),wc(this,e,t,i?i.children.slice():[],s,l),!0}split(e){let t=new Ge;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let s=i;s<this.children.length;s++)t.append(this.children[s],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){As(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Wc(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Cl(t,this.attrs||{})),i&&(this.attrs=Cl({class:i},this.attrs||{}))}domAtPos(e){return vc(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(bc(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(vl(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let n=this.dom.lastChild;for(;n&&Ve.get(n)instanceof pi;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=Ve.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!ee.ios||!this.children.some(s=>s instanceof Ut))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Ut)||/[^ -~]/.test(i.text))return null;let n=Jn(i.dom);if(n.length!=1)return null;e+=n[0].width,t=n[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=kc(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,s=i.bottom-i.top;if(Math.abs(s-n.lineHeight)<2&&n.textHeight<s){let l=(s-n.textHeight)/2;return{top:i.top+l,bottom:i.bottom-l,left:i.left,right:i.left}}}return i}become(e){return e instanceof Ge&&this.children.length==0&&e.children.length==0&&As(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let i=0,n=0;i<e.children.length;i++){let s=e.children[i],l=n+s.length;if(l>=t){if(s instanceof Ge)return s;if(l>t)break}n=l+s.breakAfter}return null}}class mi extends Ve{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,s,l){return i&&(!(i instanceof mi)||!this.widget.compare(i.widget)||e>0&&s<=0||t<this.length&&l<=0)?!1:(this.length=e+(i?i.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?ct.before(this.dom):ct.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let i=new mi(this.widget,t,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return wl}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Oe.empty}domBoundsAround(){return null}become(e){return e instanceof mi&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);return i||(this.widget instanceof kl?null:Gs(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:i}=this.deco;return t==i?!1:e<0?t<0:i>0}}class kl extends Wl{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class qn{constructor(e,t,i,n){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=n,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof mi&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ge),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(zs(new fn(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof mi)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:l,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(zs(new Ut(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,s,l){if(this.disallowBlockEffectsFor[l]&&i instanceof yi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(i instanceof yi)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new mi(i.widget||gn.block,a,i));else{let c=Bi.create(i.widget||gn.inline,a,a?0:i.startSide),d=this.atCursorPos&&!c.isEditable&&s<=n.length&&(e<t||i.startSide>0),h=!c.isEditable&&(e<t||s>n.length||i.startSide<=0),u=this.getLine();this.pendingBuffer==2&&!d&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),d&&(u.append(zs(new fn(1),n),s),s=n.length+Math.max(0,s-n.length)),u.append(zs(c,n),s),this.atCursorPos=h,this.pendingBuffer=h?e<t||s>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,i,n,s){let l=new qn(e,t,i,s);return l.openEnd=We.spans(n,t,i,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function zs(r,e){for(let t of e)r=new pi(t,[r],r.length);return r}class gn extends Wl{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}gn.inline=new gn("span"),gn.block=new gn("div");var nt=function(r){return r[r.LTR=0]="LTR",r[r.RTL=1]="RTL",r}(nt||(nt={}));const Gi=nt.LTR,Dl=nt.RTL;function Uc(r){let e=[];for(let t=0;t<r.length;t++)e.push(1<<+r[t]);return e}const WS=Uc("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),kS=Uc("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),El=Object.create(null),ii=[];for(let r of["()","[]","{}"]){let e=r.charCodeAt(0),t=r.charCodeAt(1);El[e]=t,El[t]=-e}function Zc(r){return r<=247?WS[r]:1424<=r&&r<=1524?2:1536<=r&&r<=1785?kS[r-1536]:1774<=r&&r<=2220?4:8192<=r&&r<=8204?256:64336<=r&&r<=65023?4:1}const DS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vi{get dir(){return this.level%2?Dl:Gi}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,n){let s=-1;for(let l=0;l<e.length;l++){let a=e[l];if(a.from<=t&&a.to>=t){if(a.level==i)return l;(s<0||(n!=0?n<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function Yc(r,e){if(r.length!=e.length)return!1;for(let t=0;t<r.length;t++){let i=r[t],n=e[t];if(i.from!=n.from||i.to!=n.to||i.direction!=n.direction||!Yc(i.inner,n.inner))return!1}return!0}const Fe=[];function ES(r,e,t,i,n){for(let s=0;s<=i.length;s++){let l=s?i[s-1].to:e,a=s<i.length?i[s].from:t,c=s?256:n;for(let d=l,h=c,u=c;d<a;d++){let f=Zc(r.charCodeAt(d));f==512?f=h:f==8&&u==4&&(f=16),Fe[d]=f==4?2:f,f&7&&(u=f),h=f}for(let d=l,h=c,u=c;d<a;d++){let f=Fe[d];if(f==128)d<a-1&&h==Fe[d+1]&&h&24?f=Fe[d]=h:Fe[d]=256;else if(f==64){let g=d+1;for(;g<a&&Fe[g]==64;)g++;let R=d&&h==8||g<t&&Fe[g]==8?u==1?1:8:256;for(let p=d;p<g;p++)Fe[p]=R;d=g-1}else f==8&&u==1&&(Fe[d]=1);h=f,f&7&&(u=f)}}}function US(r,e,t,i,n){let s=n==1?2:1;for(let l=0,a=0,c=0;l<=i.length;l++){let d=l?i[l-1].to:e,h=l<i.length?i[l].from:t;for(let u=d,f,g,R;u<h;u++)if(g=El[f=r.charCodeAt(u)])if(g<0){for(let p=a-3;p>=0;p-=3)if(ii[p+1]==-g){let M=ii[p+2],S=M&2?n:M&4?M&1?s:n:0;S&&(Fe[u]=Fe[ii[p]]=S),a=p;break}}else{if(ii.length==189)break;ii[a++]=u,ii[a++]=f,ii[a++]=c}else if((R=Fe[u])==2||R==1){let p=R==n;c=p?0:1;for(let M=a-3;M>=0;M-=3){let S=ii[M+2];if(S&2)break;if(p)ii[M+2]|=2;else{if(S&4)break;ii[M+2]|=4}}}}}function ZS(r,e,t,i){for(let n=0,s=i;n<=t.length;n++){let l=n?t[n-1].to:r,a=n<t.length?t[n].from:e;for(let c=l;c<a;){let d=Fe[c];if(d==256){let h=c+1;for(;;)if(h==a){if(n==t.length)break;h=t[n++].to,a=n<t.length?t[n].from:e}else if(Fe[h]==256)h++;else break;let u=s==1,f=(h<e?Fe[h]:i)==1,g=u==f?u?1:2:i;for(let R=h,p=n,M=p?t[p-1].to:r;R>c;)R==M&&(R=t[--p].from,M=p?t[p-1].to:r),Fe[--R]=g;c=h}else s=d,c++}}}function Ul(r,e,t,i,n,s,l){let a=i%2?2:1;if(i%2==n%2)for(let c=e,d=0;c<t;){let h=!0,u=!1;if(d==s.length||c<s[d].from){let p=Fe[c];p!=a&&(h=!1,u=p==16)}let f=!h&&a==1?[]:null,g=h?i:i+1,R=c;e:for(;;)if(d<s.length&&R==s[d].from){if(u)break e;let p=s[d];if(!h)for(let M=p.to,S=d+1;;){if(M==t)break e;if(S<s.length&&s[S].from==M)M=s[S++].to;else{if(Fe[M]==a)break e;break}}if(d++,f)f.push(p);else{p.from>c&&l.push(new Vi(c,p.from,g));let M=p.direction==Gi!=!(g%2);Zl(r,M?i+1:i,n,p.inner,p.from,p.to,l),c=p.to}R=p.to}else{if(R==t||(h?Fe[R]!=a:Fe[R]==a))break;R++}f?Ul(r,c,R,i+1,n,f,l):c<R&&l.push(new Vi(c,R,g)),c=R}else for(let c=t,d=s.length;c>e;){let h=!0,u=!1;if(!d||c>s[d-1].to){let p=Fe[c-1];p!=a&&(h=!1,u=p==16)}let f=!h&&a==1?[]:null,g=h?i:i+1,R=c;e:for(;;)if(d&&R==s[d-1].to){if(u)break e;let p=s[--d];if(!h)for(let M=p.from,S=d;;){if(M==e)break e;if(S&&s[S-1].to==M)M=s[--S].from;else{if(Fe[M-1]==a)break e;break}}if(f)f.push(p);else{p.to<c&&l.push(new Vi(p.to,c,g));let M=p.direction==Gi!=!(g%2);Zl(r,M?i+1:i,n,p.inner,p.from,p.to,l),c=p.from}R=p.from}else{if(R==e||(h?Fe[R-1]!=a:Fe[R-1]==a))break;R--}f?Ul(r,R,c,i+1,n,f,l):R<c&&l.push(new Vi(R,c,g)),c=R}}function Zl(r,e,t,i,n,s,l){let a=e%2?2:1;ES(r,n,s,i,a),US(r,n,s,i,a),ZS(n,s,i,a),Ul(r,n,s,e,t,i,l)}function YS(r,e,t){if(!r)return[new Vi(0,0,e==Dl?1:0)];if(e==Gi&&!t.length&&!DS.test(r))return Qc(r.length);if(t.length)for(;r.length>Fe.length;)Fe[Fe.length]=256;let i=[],n=e==Gi?0:1;return Zl(r,n,n,t,0,r.length,i),i}function Qc(r){return[new Vi(0,r,0)]}let Kc="";function QS(r,e,t,i,n){var s;let l=i.head-r.from,a=Vi.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=e[a],d=c.side(n,t);if(l==d){let f=a+=n?1:-1;if(f<0||f>=e.length)return null;c=e[a=f],l=c.side(!n,t),d=c.side(n,t)}let h=fi(r.text,l,c.forward(n,t));(h<c.from||h>c.to)&&(h=d),Kc=r.text.slice(Math.min(l,h),Math.max(l,h));let u=a==(n?e.length-1:0)?null:e[a+(n?1:-1)];return u&&h==d&&u.level+(n?0:1)<c.level?ne.cursor(u.side(!n,t)+r.from,u.forward(n,t)?1:-1,u.level):ne.cursor(h+r.from,c.forward(n,t)?-1:1,c.level)}function KS(r,e,t){for(let i=e;i<t;i++){let n=Zc(r.charCodeAt(i));if(n==1)return Gi;if(n==2||n==4)return Dl}return Gi}const Hc=ue.define(),Bc=ue.define(),Gc=ue.define(),_c=ue.define(),Yl=ue.define(),Ac=ue.define(),Jc=ue.define(),Ql=ue.define(),Kl=ue.define(),zc=ue.define({combine:r=>r.some(e=>e)}),HS=ue.define({combine:r=>r.some(e=>e)}),$c=ue.define();class Rn{constructor(e,t="nearest",i="nearest",n=5,s=5,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Rn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Rn(ne.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $s=Je.define({map:(r,e)=>r.map(e)}),jc=Je.define();function ni(r,e,t){let i=r.facet(_c);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Si=ue.define({combine:r=>r.length?r[0]:!0});let BS=0;const pn=ue.define({combine(r){return r.filter((e,t)=>{for(let i=0;i<t;i++)if(r[i].plugin==e.plugin)return!1;return!0})}});class mn{constructor(e,t,i,n,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=n,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(pn.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(pn.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:n,provide:s,decorations:l}=t||{};return new mn(BS++,e,i,n,a=>{let c=[];return l&&c.push(es.of(d=>{let h=d.plugin(a);return h?l(h):dt.none})),s&&c.push(s(a)),c})}static fromClass(e,t){return mn.define((i,n)=>new e(i,n),t)}}class Hl{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(ni(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ni(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){ni(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const qc=ue.define(),Bl=ue.define(),es=ue.define(),ed=ue.define(),Gl=ue.define(),td=ue.define();function id(r,e){let t=r.state.facet(td);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(r):s),n=[];return We.spans(i,e.from,e.to,{point(){},span(s,l,a,c){let d=s-e.from,h=l-e.from,u=n;for(let f=a.length-1;f>=0;f--,c--){let g=a[f].spec.bidiIsolate,R;if(g==null&&(g=KS(e.text,d,h)),c>0&&u.length&&(R=u[u.length-1]).to==d&&R.direction==g)R.to=h,u=R.inner;else{let p={from:d,to:h,direction:g,inner:[]};u.push(p),u=p.inner}}}}),n}const nd=ue.define();function sd(r){let e=0,t=0,i=0,n=0;for(let s of r.state.facet(nd)){let l=s(r);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(n=Math.max(n,l.bottom)))}return{left:e,right:t,top:i,bottom:n}}const ts=ue.define();class Ct{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new Ct(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let n=0,s=0,l=0,a=0;;n++){let c=n==e.length?null:e[n],d=l-a,h=c?c.fromB:1e9;for(;s<t.length&&t[s]<h;){let u=t[s],f=t[s+1],g=Math.max(a,u),R=Math.min(h,f);if(g<=R&&new Ct(g+d,R+d,g,R).addToSet(i),f>h)break;s+=2}if(!c)return i;new Ct(c.fromA,c.toA,c.fromB,c.toB).addToSet(i),l=c.toA,a=c.toB}}}class js{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=qe.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let n=[];this.changes.iterChangedRanges((s,l,a,c)=>n.push(new Ct(s,l,a,c))),this.changedRanges=n}static create(e,t,i){return new js(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class od extends Ve{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=dt.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Ge],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Ct(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:h})=>h<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!jS(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let s=n>-1?_S(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:d,to:h}=this.hasComposition;i=new Ct(d,h,e.changes.mapPos(d,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ee.ie||ee.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,a=this.updateDeco(),c=zS(l,a,e.changes);return i=Ct.extendWithRanges(i,c),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=ee.chrome||ee.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||n.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let l of this.children)l instanceof mi&&l.widget instanceof kl&&s.push(l.dom);n.updateGaps(s)}updateChildren(e,t,i){let n=i?i.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let l=n.length-1;;l--){let a=l>=0?n[l]:null;if(!a)break;let{fromA:c,toA:d,fromB:h,toB:u}=a,f,g,R,p;if(i&&i.range.fromB<u&&i.range.toB>h){let N=qn.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),m=qn.build(this.view.state.doc,i.range.toB,u,this.decorations,this.dynamicDecorationMap);g=N.breakAtStart,R=N.openStart,p=m.openEnd;let T=this.compositionView(i);m.breakAtStart?T.breakAfter=1:m.content.length&&T.merge(T.length,T.length,m.content[0],!1,m.openStart,0)&&(T.breakAfter=m.content[0].breakAfter,m.content.shift()),N.content.length&&T.merge(0,0,N.content[N.content.length-1],!0,0,N.openEnd)&&N.content.pop(),f=N.content.concat(T).concat(m.content)}else({content:f,breakAtStart:g,openStart:R,openEnd:p}=qn.build(this.view.state.doc,h,u,this.decorations,this.dynamicDecorationMap));let{i:M,off:S}=s.findPos(d,1),{i:b,off:P}=s.findPos(c,-1);xc(this,b,P,M,S,f,g,R,p)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(jc)&&(this.editContextFormatting=i.value)}compositionView(e){let t=new Ut(e.text.nodeValue);t.flags|=8;for(let{deco:n}of e.marks)t=new pi(n,[t],t.length);let i=new Ge;return i.append(t,0),i}fixCompositionDOM(e){let t=(s,l)=>{l.flags|=8|(l.children.some(c=>c.flags&7)?1:0),this.markedForComposition.add(l);let a=Ve.get(s);a&&a!=l&&(a.dom=null),l.setDOM(s)},i=this.childPos(e.range.fromB,1),n=this.children[i.i];t(e.line,n);for(let s=e.marks.length-1;s>=-1;s--)i=n.childPos(i.off,1),n=n.children[i.i],t(s>=0?e.marks[s].node:e.text,n)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,s=!n&&!(this.view.state.facet(Si)||this.dom.tabIndex>-1)&&Hs(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c=this.moveToLine(this.domAtPos(a.anchor)),d=a.empty?c:this.moveToLine(this.domAtPos(a.head));if(ee.gecko&&a.empty&&!this.hasComposition&&GS(c)){let u=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(u,c.node.childNodes[c.offset]||null)),c=d=new ct(u,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||(!zn(c.node,c.offset,h.anchorNode,h.anchorOffset)||!zn(d.node,d.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{ee.android&&ee.chrome&&this.dom.contains(h.focusNode)&&$S(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let u=An(this.view.root);if(u)if(a.empty){if(ee.gecko){let f=AS(c.node,c.offset);if(f&&f!=3){let g=(f==1?Oc:Pc)(c.node,c.offset);g&&(c=new ct(g.node,g.offset))}}u.collapse(c.node,c.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(c.node,c.offset);try{u.extend(d.node,d.offset)}catch{}}else{let f=document.createRange();a.anchor>a.head&&([c,d]=[d,c]),f.setEnd(d.node,d.offset),f.setStart(c.node,c.offset),u.removeAllRanges(),u.addRange(f)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,d)),this.impreciseAnchor=c.precise?null:new ct(h.anchorNode,h.anchorOffset),this.impreciseHead=d.precise?null:new ct(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&zn(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=An(e.root),{anchorNode:n,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=Ge.find(this,t.head);if(!l)return;let a=l.posAtStart;if(t.head==a||t.head==a+l.length)return;let c=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!c||!d||c.bottom>d.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&i.collapse(n,s)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let n=e.offset;!i&&n<t.childNodes.length;n++){let s=Ve.get(t.childNodes[n]);s instanceof Ge&&(i=s.domAtPos(0))}for(let n=e.offset-1;!i&&n>=0;n--){let s=Ve.get(t.childNodes[n]);s instanceof Ge&&(i=s.domAtPos(s.length))}return i?new ct(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=Ve.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let n=this.children[t];if(i<n.length||n instanceof Ge)break;t++,i=0}return this.children[t].domAtPos(i)}coordsAt(e,t){let i=null,n=0;for(let s=this.length,l=this.children.length-1;l>=0;l--){let a=this.children[l],c=s-a.breakAfter,d=c-a.length;if(c<e)break;if(d<=e&&(d<e||a.covers(-1))&&(c>e||a.covers(1))&&(!i||a instanceof Ge&&!(i instanceof Ge&&t>=0)))i=a,n=d;else if(i&&d==e&&c==e&&a instanceof mi&&Math.abs(t)<2){if(a.deco.startSide<0)break;l&&(i=null)}s=d}return i?i.coordsAt(e-n,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),n=this.children[t];if(!(n instanceof Ge))return null;for(;n.children.length;){let{i:a,off:c}=n.childPos(i,1);for(;;a++){if(a==n.children.length)return null;if((n=n.children[a]).length)break}i=c}if(!(n instanceof Ut))return null;let s=fi(n.text,i);if(s==i)return null;let l=Hi(n.dom,i,s).getClientRects();for(let a=0;a<l.length;a++){let c=l[a];if(a==l.length-1||c.top<c.bottom&&c.left<c.right)return c}return null}measureVisibleLineHeights(e){let t=[],{from:i,to:n}=e,s=this.view.contentDOM.clientWidth,l=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,c=this.view.textDirection==nt.LTR;for(let d=0,h=0;h<this.children.length;h++){let u=this.children[h],f=d+u.length;if(f>n)break;if(d>=i){let g=u.dom.getBoundingClientRect();if(t.push(g.height),l){let R=u.dom.lastChild,p=R?Jn(R):[];if(p.length){let M=p[p.length-1],S=c?M.right-g.left:g.right-M.left;S>a&&(a=S,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=f)}}}d=f+u.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?nt.RTL:nt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Ge){let l=s.measureTextSize();if(l)return l}let e=document.createElement("div"),t,i,n;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Jn(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,n=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ic(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let s=n==t.viewports.length?null:t.viewports[n],l=s?s.from-1:this.length;if(l>i){let a=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(dt.replace({widget:new kl(a),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return dt.set(e)}updateDeco(){let e=1,t=this.view.state.facet(es).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,n=this.view.state.facet(ed).map((s,l)=>{let a=typeof s=="function";return a&&(i=!0),a?s(this.view):s});for(n.length&&(this.dynamicDecorationMap[e++]=i,t.push(We.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet($c))try{if(d(this.view,e.range,e))return!0}catch(h){ni(this.view.state,h,"scroll handler")}let{range:t}=e,i=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),n;if(!i)return;!t.empty&&(n=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let s=sd(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:a,offsetHeight:c}=this.view.scrollDOM;PS(this.view.scrollDOM,l,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==nt.LTR)}}function GS(r){return r.node.nodeType==1&&r.node.firstChild&&(r.offset==0||r.node.childNodes[r.offset-1].contentEditable=="false")&&(r.offset==r.node.childNodes.length||r.node.childNodes[r.offset].contentEditable=="false")}function ld(r,e){let t=r.observer.selectionRange;if(!t.focusNode)return null;let i=Oc(t.focusNode,t.focusOffset),n=Pc(t.focusNode,t.focusOffset),s=i||n;if(n&&i&&n.node!=i.node){let a=Ve.get(n.node);if(!a||a instanceof Ut&&a.text!=n.node.nodeValue)s=n;else if(r.docView.lastCompositionAfterCursor){let c=Ve.get(i.node);!c||c instanceof Ut&&c.text!=i.node.nodeValue||(s=n)}}if(r.docView.lastCompositionAfterCursor=s!=i,!s)return null;let l=e-s.offset;return{from:l,to:l+s.node.nodeValue.length,node:s.node}}function _S(r,e,t){let i=ld(r,t);if(!i)return null;let{node:n,from:s,to:l}=i,a=n.nodeValue;if(/[\n\r]/.test(a)||r.state.doc.sliceString(i.from,i.to)!=a)return null;let c=e.invertedDesc,d=new Ct(c.mapPos(s),c.mapPos(l),s,l),h=[];for(let u=n.parentNode;;u=u.parentNode){let f=Ve.get(u);if(f instanceof pi)h.push({node:u,deco:f.mark});else{if(f instanceof Ge||u.nodeName=="DIV"&&u.parentNode==r.contentDOM)return{range:d,text:n,marks:h,line:u};if(u!=r.contentDOM)h.push({node:u,deco:new $n({inclusive:!0,attributes:CS(u),tagName:u.tagName.toLowerCase()})});else return null}}}function AS(r,e){return r.nodeType!=1?0:(e&&r.childNodes[e-1].contentEditable=="false"?1:0)|(e<r.childNodes.length&&r.childNodes[e].contentEditable=="false"?2:0)}let JS=class{constructor(){this.changes=[]}compareRange(e,t){Js(e,t,this.changes)}comparePoint(e,t){Js(e,t,this.changes)}boundChange(e){Js(e,e,this.changes)}};function zS(r,e,t){let i=new JS;return We.compare(r,e,t,i),i.changes}function $S(r,e){for(let t=r;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function jS(r,e){let t=!1;return e&&r.iterChangedRanges((i,n)=>{i<e.to&&n>e.from&&(t=!0)}),t}function qS(r,e,t=1){let i=r.charCategorizer(e),n=r.doc.lineAt(e),s=e-n.from;if(n.length==0)return ne.cursor(e);s==0?t=1:s==n.length&&(t=-1);let l=s,a=s;t<0?l=fi(n.text,s,!1):a=fi(n.text,s);let c=i(n.text.slice(l,a));for(;l>0;){let d=fi(n.text,l,!1);if(i(n.text.slice(d,l))!=c)break;l=d}for(;a<n.length;){let d=fi(n.text,a);if(i(n.text.slice(a,d))!=c)break;a=d}return ne.range(l+n.from,a+n.from)}function eM(r,e){return e.left>r?e.left-r:Math.max(0,r-e.right)}function tM(r,e){return e.top>r?e.top-r:Math.max(0,r-e.bottom)}function _l(r,e){return r.top<e.bottom-1&&r.bottom>e.top+1}function rd(r,e){return e<r.top?{top:e,left:r.left,right:r.right,bottom:r.bottom}:r}function ad(r,e){return e>r.bottom?{top:r.top,left:r.left,right:r.right,bottom:e}:r}function Al(r,e,t){let i,n,s,l,a=!1,c,d,h,u;for(let R=r.firstChild;R;R=R.nextSibling){let p=Jn(R);for(let M=0;M<p.length;M++){let S=p[M];n&&_l(n,S)&&(S=rd(ad(S,n.bottom),n.top));let b=eM(e,S),P=tM(t,S);if(b==0&&P==0)return R.nodeType==3?cd(R,e,t):Al(R,e,t);(!i||l>P||l==P&&s>b)&&(i=R,n=S,s=b,l=P,a=b?e<S.left?M>0:M<p.length-1:!0),b==0?t>S.bottom&&(!h||h.bottom<S.bottom)?(c=R,h=S):t<S.top&&(!u||u.top>S.top)&&(d=R,u=S):h&&_l(h,S)?h=ad(h,S.bottom):u&&_l(u,S)&&(u=rd(u,S.top))}}if(h&&h.bottom>=t?(i=c,n=h):u&&u.top<=t&&(i=d,n=u),!i)return{node:r,offset:0};let f=Math.max(n.left,Math.min(n.right,e));if(i.nodeType==3)return cd(i,f,t);if(a&&i.contentEditable!="false")return Al(i,f,t);let g=Array.prototype.indexOf.call(r.childNodes,i)+(e>=(n.left+n.right)/2?1:0);return{node:r,offset:g}}function cd(r,e,t){let i=r.nodeValue.length,n=-1,s=1e9,l=0;for(let a=0;a<i;a++){let c=Hi(r,a,a+1).getClientRects();for(let d=0;d<c.length;d++){let h=c[d];if(h.top==h.bottom)continue;l||(l=e-h.left);let u=(h.top>t?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&u<s){let f=e>=(h.left+h.right)/2,g=f;if((ee.chrome||ee.gecko)&&Hi(r,a).getBoundingClientRect().left==h.right&&(g=!f),u<=0)return{node:r,offset:a+(g?1:0)};n=a+(g?1:0),s=u}}}return{node:r,offset:n>-1?n:l>0?r.nodeValue.length:0}}function dd(r,e,t,i=-1){var n,s;let l=r.contentDOM.getBoundingClientRect(),a=l.top+r.viewState.paddingTop,c,{docHeight:d}=r.viewState,{x:h,y:u}=e,f=u-a;if(f<0)return 0;if(f>d)return r.state.doc.length;for(let N=r.viewState.heightOracle.textHeight/2,m=!1;c=r.elementAtHeight(f),c.type!=ti.Text;)for(;f=i>0?c.bottom+N:c.top-N,!(f>=0&&f<=d);){if(m)return t?null:0;m=!0,i=-i}u=a+f;let g=c.from;if(g<r.viewport.from)return r.viewport.from==0?0:t?null:hd(r,l,c,h,u);if(g>r.viewport.to)return r.viewport.to==r.state.doc.length?r.state.doc.length:t?null:hd(r,l,c,h,u);let R=r.dom.ownerDocument,p=r.root.elementFromPoint?r.root:R,M=p.elementFromPoint(h,u);M&&!r.contentDOM.contains(M)&&(M=null),M||(h=Math.max(l.left+1,Math.min(l.right-1,h)),M=p.elementFromPoint(h,u),M&&!r.contentDOM.contains(M)&&(M=null));let S,b=-1;if(M&&((n=r.docView.nearest(M))===null||n===void 0?void 0:n.isEditable)!=!1){if(R.caretPositionFromPoint){let N=R.caretPositionFromPoint(h,u);N&&({offsetNode:S,offset:b}=N)}else if(R.caretRangeFromPoint){let N=R.caretRangeFromPoint(h,u);N&&({startContainer:S,startOffset:b}=N,(!r.contentDOM.contains(S)||ee.safari&&iM(S,b,h)||ee.chrome&&nM(S,b,h))&&(S=void 0))}S&&(b=Math.min(ei(S),b))}if(!S||!r.docView.dom.contains(S)){let N=Ge.find(r.docView,g);if(!N)return f>c.top+c.height/2?c.to:c.from;({node:S,offset:b}=Al(N.dom,h,u))}let P=r.docView.nearest(S);if(!P)return null;if(P.isWidget&&((s=P.dom)===null||s===void 0?void 0:s.nodeType)==1){let N=P.dom.getBoundingClientRect();return e.y<N.top||e.y<=N.bottom&&e.x<=(N.left+N.right)/2?P.posAtStart:P.posAtEnd}else return P.localPosFromDOM(S,b)+P.posAtStart}function hd(r,e,t,i,n){let s=Math.round((i-e.left)*r.defaultCharacterWidth);if(r.lineWrapping&&t.height>r.defaultLineHeight*1.5){let a=r.viewState.heightOracle.textHeight,c=Math.floor((n-t.top-(r.defaultLineHeight-a)*.5)/a);s+=c*r.viewState.heightOracle.lineLength}let l=r.state.sliceDoc(t.from,t.to);return t.from+bS(l,s,r.state.tabSize)}function iM(r,e,t){let i,n=r;if(r.nodeType!=3||e!=(i=r.nodeValue.length))return!1;for(;;){let s=n.nextSibling;if(s){if(s.nodeName=="BR")break;return!1}else{let l=n.parentNode;if(!l||l.nodeName=="DIV")break;n=l}}return Hi(r,i-1,i).getBoundingClientRect().right>t}function nM(r,e,t){if(e!=0)return!1;for(let n=r;;){let s=n.parentNode;if(!s||s.nodeType!=1||s.firstChild!=n)return!1;if(s.classList.contains("cm-line"))break;n=s}let i=r.nodeType==1?r.getBoundingClientRect():Hi(r,0,Math.max(r.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function sM(r,e,t){let i=r.lineBlockAt(e);if(Array.isArray(i.type)){let n;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!n||s.type==ti.Text&&(n.type!=s.type||(t<0?s.from<e:s.to>e)))&&(n=s)}}return n||i}return i}function oM(r,e,t,i){let n=sM(r,e.head,e.assoc||-1),s=!i||n.type!=ti.Text||!(r.lineWrapping||n.widgetLineBreaks)?null:r.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(s){let l=r.dom.getBoundingClientRect(),a=r.textDirectionAt(n.from),c=r.posAtCoords({x:t==(a==nt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(c!=null)return ne.cursor(c,t?-1:1)}return ne.cursor(t?n.to:n.from,t?-1:1)}function ud(r,e,t,i){let n=r.state.doc.lineAt(e.head),s=r.bidiSpans(n),l=r.textDirectionAt(n.from);for(let a=e,c=null;;){let d=QS(n,s,l,a,t),h=Kc;if(!d){if(n.number==(t?r.state.doc.lines:1))return a;h=`
115
+ `,n=r.state.doc.line(n.number+(t?1:-1)),s=r.bidiSpans(n),d=r.visualLineSide(n,!t)}if(c){if(!c(h))return a}else{if(!i)return d;c=i(h)}a=d}}function lM(r,e,t){let i=r.state.charCategorizer(e),n=i(t);return s=>{let l=i(s);return n==Ri.Space&&(n=l),n==l}}function rM(r,e,t,i){let n=e.head,s=t?1:-1;if(n==(t?r.state.doc.length:0))return ne.cursor(n,e.assoc);let l=e.goalColumn,a,c=r.contentDOM.getBoundingClientRect(),d=r.coordsAtPos(n,e.assoc||-1),h=r.documentTop;if(d)l==null&&(l=d.left-c.left),a=s<0?d.top:d.bottom;else{let g=r.viewState.lineBlockAt(n);l==null&&(l=Math.min(c.right-c.left,r.defaultCharacterWidth*(n-g.from))),a=(s<0?g.top:g.bottom)+h}let u=c.left+l,f=i??r.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let R=a+(f+g)*s,p=dd(r,{x:u,y:R},!1,s);if(R<c.top||R>c.bottom||(s<0?p<n:p>n)){let M=r.docView.coordsForChar(p),S=!M||R<M.top?-1:1;return ne.cursor(p,S,void 0,l)}}}function qs(r,e,t){for(;;){let i=0;for(let n of r)n.between(e-1,e+1,(s,l,a)=>{if(e>s&&e<l){let c=i||t||(e-s<l-e?-1:1);e=c<0?s:l,i=c}});if(!i)return e}}function Jl(r,e,t){let i=qs(r.state.facet(Gl).map(n=>n(r)),t.from,e.head>t.from?-1:1);return i==t.from?t:ne.cursor(i,i<t.from?1:-1)}const is="￿";class aM{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=is}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let s=this.text.length;this.readNode(n);let l=n.nextSibling;if(l==t)break;let a=Ve.get(n),c=Ve.get(l);(a&&c?a.breakAfter:(a?a.breakAfter:Bs(n))||Bs(l)&&(n.nodeName!="BR"||n.cmIgnore)&&this.text.length>s)&&this.lineBreak(),n=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(a=n.exec(t))&&(s=a.index,l=a[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=l-1);i=s+l}}readNode(e){if(e.cmIgnore)return;let t=Ve.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(cM(e,i.node,i.offset)?t:0))}}function cM(r,e,t){for(;;){if(!e||t<ei(e))return!1;if(e==r)return!0;t=Ki(e)+1,e=e.parentNode}}class fd{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class dM{constructor(e,t,i,n){this.typeOver=n,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let a=s||l?[]:fM(e),c=new aM(a,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=gM(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!xl(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),d=l&&l.node==a.anchorNode&&l.offset==a.anchorOffset||!xl(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((ee.ios||ee.chrome)&&e.state.selection.main.empty&&c!=d&&(h.from>0||h.to<e.state.doc.length)){let u=Math.min(c,d),f=Math.max(c,d),g=h.from-u,R=h.to-f;(g==0||g==1||u==0)&&(R==0||R==-1||f==e.state.doc.length)&&(c=0,d=e.state.doc.length)}this.newSel=ne.single(d,c)}}}function gd(r,e){let t,{newSel:i}=e,n=r.state.selection.main,s=r.inputState.lastKeyTime>Date.now()-100?r.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=n.from,d=null;(s===8||ee.android&&e.text.length<a-l)&&(c=n.to,d="end");let h=uM(r.state.doc.sliceString(l,a,is),e.text,c-l,d);h&&(ee.chrome&&s==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==is+is&&h.toB--,t={from:l+h.from,to:l+h.toA,insert:Oe.of(e.text.slice(h.from,h.toB).split(is))})}else i&&(!r.hasFocus&&r.state.facet(Si)||i.main.eq(n))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!n.empty&&i&&i.main.empty?t={from:n.from,to:n.to,insert:r.state.doc.slice(n.from,n.to)}:(ee.mac||ee.android)&&t&&t.from==t.to&&t.from==n.head-1&&/^\. ?$/.test(t.insert.toString())&&r.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=ne.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:Oe.of([t.insert.toString().replace("."," ")])}):t&&t.from>=n.from&&t.to<=n.to&&(t.from!=n.from||t.to!=n.to)&&n.to-n.from-(t.to-t.from)<=4?t={from:n.from,to:n.to,insert:r.state.doc.slice(n.from,t.from).append(t.insert).append(r.state.doc.slice(t.to,n.to))}:ee.chrome&&t&&t.from==t.to&&t.from==n.head&&t.insert.toString()==`
116
+ `&&r.lineWrapping&&(i&&(i=ne.single(i.main.anchor-1,i.main.head-1)),t={from:n.from,to:n.to,insert:Oe.of([" "])}),t)return zl(r,t,i,s);if(i&&!i.main.eq(n)){let l=!1,a="select";return r.inputState.lastSelectionTime>Date.now()-50&&(r.inputState.lastSelectionOrigin=="select"&&(l=!0),a=r.inputState.lastSelectionOrigin),r.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function zl(r,e,t,i=-1){if(ee.ios&&r.inputState.flushIOSKey(e))return!0;let n=r.state.selection.main;if(ee.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&r.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&un(r.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&un(r.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&un(r.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();r.inputState.composing>=0&&r.inputState.composing++;let l,a=()=>l||(l=hM(r,e,t));return r.state.facet(Ac).some(c=>c(r,e.from,e.to,s,a))||r.dispatch(a()),!0}function hM(r,e,t){let i,n=r.state,s=n.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&r.inputState.composing<0){let a=s.from<e.from?n.sliceDoc(s.from,e.from):"",c=s.to>e.to?n.sliceDoc(e.to,s.to):"";i=n.replaceSelection(r.state.toText(a+e.insert.sliceString(0,void 0,r.state.lineBreak)+c))}else{let a=n.changes(e),c=t&&t.main.to<=a.newLength?t.main:void 0;if(n.selection.ranges.length>1&&r.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let d=r.state.sliceDoc(e.from,e.to),h,u=t&&ld(r,t.main.head);if(u){let R=e.insert.length-(e.to-e.from);h={from:u.from,to:u.to-R}}else h=r.state.doc.lineAt(s.head);let f=s.to-e.to,g=s.to-s.from;i=n.changeByRange(R=>{if(R.from==s.from&&R.to==s.to)return{changes:a,range:c||R.map(a)};let p=R.to-f,M=p-d.length;if(R.to-R.from!=g||r.state.sliceDoc(M,p)!=d||R.to>=h.from&&R.from<=h.to)return{range:R};let S=n.changes({from:M,to:p,insert:e.insert}),b=R.to-s.to;return{changes:S,range:c?ne.range(Math.max(0,c.anchor+b),Math.max(0,c.head+b)):R.map(S)}})}else i={changes:a,selection:c&&n.selection.replaceRange(c)}}let l="input.type";return(r.composing||r.inputState.compositionPendingChange&&r.inputState.compositionEndedAt>Date.now()-50)&&(r.inputState.compositionPendingChange=!1,l+=".compose",r.inputState.compositionFirstChange&&(l+=".start",r.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:l,scrollIntoView:!0})}function uM(r,e,t,i){let n=Math.min(r.length,e.length),s=0;for(;s<n&&r.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==n&&r.length==e.length)return null;let l=r.length,a=e.length;for(;l>0&&a>0&&r.charCodeAt(l-1)==e.charCodeAt(a-1);)l--,a--;if(i=="end"){let c=Math.max(0,s-Math.min(l,a));t-=l+c-s}if(l<s&&r.length<e.length){let c=t<=s&&t>=l?s-t:0;s-=c,a=s+(a-l),l=s}else if(a<s){let c=t<=s&&t>=a?s-t:0;s-=c,l=s+(l-a),a=s}return{from:s,toA:l,toB:a}}function fM(r){let e=[];if(r.root.activeElement!=r.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}=r.observer.selectionRange;return t&&(e.push(new fd(t,i)),(n!=t||s!=i)&&e.push(new fd(n,s))),e}function gM(r,e){if(r.length==0)return null;let t=r[0].pos,i=r.length==2?r[1].pos:t;return t>-1&&i>-1?ne.single(t+e,i+e):null}class RM{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ee.safari&&e.contentDOM.addEventListener("input",()=>null),ee.gecko&&XM(e.contentDOM.ownerDocument)}handleEvent(e){!PM(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=pM(e),i=this.handlers,n=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,a=i[s];a&&l!=!a.handlers.length&&(n.removeEventListener(s,this.handleEvent),a=null),a||n.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&n.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&SM.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ee.android&&ee.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return ee.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=pd.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||mM.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,un(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ee.safari&&!ee.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function Rd(r,e){return(t,i)=>{try{return e.call(r,i,t)}catch(n){ni(t.state,n)}}}function pM(r){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of r){let n=i.spec,s=n&&n.plugin.domEventHandlers,l=n&&n.plugin.domEventObservers;if(s)for(let a in s){let c=s[a];c&&t(a).handlers.push(Rd(i.value,c))}if(l)for(let a in l){let c=l[a];c&&t(a).observers.push(Rd(i.value,c))}}for(let i in Zt)t(i).handlers.push(Zt[i]);for(let i in vt)t(i).observers.push(vt[i]);return e}const pd=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],mM="dthko",SM=[16,17,18,20,91,92,224,225],eo=6;function to(r){return Math.max(0,r)*.7+8}function MM(r,e){return Math.max(Math.abs(r.clientX-e.clientX),Math.abs(r.clientY-e.clientY))}class NM{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=TS(e.contentDOM),this.atoms=e.state.facet(Gl).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(ye.allowMultipleSelections)&&bM(e,t),this.dragging=OM(e,t)&&Td(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&MM(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,n=0,s=0,l=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let c=sd(this.view);e.clientX-c.left<=n+eo?t=-to(n-e.clientX):e.clientX+c.right>=l-eo&&(t=to(e.clientX-l)),e.clientY-c.top<=s+eo?i=-to(s-e.clientY):e.clientY+c.bottom>=a-eo&&(i=to(e.clientY-a)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;i<e.ranges.length;i++){let n=e.ranges[i],s=null;if(n.empty){let l=qs(this.atoms,n.from,0);l!=n.from&&(s=ne.cursor(l,-1))}else{let l=qs(this.atoms,n.from,-1),a=qs(this.atoms,n.to,1);(l!=n.from||a!=n.to)&&(s=ne.range(n.from==n.anchor?l:a,n.from==n.head?l:a))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?ne.create(t,e.mainIndex):e}select(e){let{view:t}=this,i=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function bM(r,e){let t=r.state.facet(Hc);return t.length?t[0](e):ee.mac?e.metaKey:e.ctrlKey}function LM(r,e){let t=r.state.facet(Bc);return t.length?t[0](e):ee.mac?!e.altKey:!e.ctrlKey}function OM(r,e){let{main:t}=r.state.selection;if(t.empty)return!1;let i=An(r.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let s=0;s<n.length;s++){let l=n[s];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function PM(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=r.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Ve.get(t))&&i.ignoreEvent(e))return!1;return!0}const Zt=Object.create(null),vt=Object.create(null),md=ee.ie&&ee.ie_version<15||ee.ios&&ee.webkit_version<604;function TM(r){let e=r.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{r.focus(),t.remove(),Sd(r,t.value)},50)}function io(r,e,t){for(let i of r.facet(e))t=i(t,r);return t}function Sd(r,e){e=io(r.state,Ql,e);let{state:t}=r,i,n=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if($l!=null&&t.selection.ranges.every(c=>c.empty)&&$l==s.toString()){let c=-1;i=t.changeByRange(d=>{let h=t.doc.lineAt(d.from);if(h.from==c)return{range:d};c=h.from;let u=t.toText((l?s.line(n++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:u},range:ne.cursor(d.from+u.length)}})}else l?i=t.changeByRange(c=>{let d=s.line(n++);return{changes:{from:c.from,to:c.to,insert:d.text},range:ne.cursor(c.from+d.length)}}):i=t.replaceSelection(s);r.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}vt.scroll=r=>{r.inputState.lastScrollTop=r.scrollDOM.scrollTop,r.inputState.lastScrollLeft=r.scrollDOM.scrollLeft},Zt.keydown=(r,e)=>(r.inputState.setSelectionOrigin("select"),e.keyCode==27&&r.inputState.tabFocusMode!=0&&(r.inputState.tabFocusMode=Date.now()+2e3),!1),vt.touchstart=(r,e)=>{r.inputState.lastTouchTime=Date.now(),r.inputState.setSelectionOrigin("select.pointer")},vt.touchmove=r=>{r.inputState.setSelectionOrigin("select.pointer")},Zt.mousedown=(r,e)=>{if(r.observer.flush(),r.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of r.state.facet(Gc))if(t=i(r,e),t)break;if(!t&&e.button==0&&(t=wM(r,e)),t){let i=!r.hasFocus;r.inputState.startMouseSelection(new NM(r,e,t,i)),i&&r.observer.ignore(()=>{Mc(r.contentDOM);let s=r.root.activeElement;s&&!s.contains(r.contentDOM)&&s.blur()});let n=r.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}return!1};function Md(r,e,t,i){if(i==1)return ne.cursor(e,t);if(i==2)return qS(r.state,e,t);{let n=Ge.find(r.docView,e),s=r.state.doc.lineAt(n?n.posAtEnd:e),l=n?n.posAtStart:s.from,a=n?n.posAtEnd:s.to;return a<r.state.doc.length&&a==s.to&&a++,ne.range(l,a)}}let Nd=(r,e,t)=>e>=t.top&&e<=t.bottom&&r>=t.left&&r<=t.right;function IM(r,e,t,i){let n=Ge.find(r.docView,e);if(!n)return 1;let s=e-n.posAtStart;if(s==0)return 1;if(s==n.length)return-1;let l=n.coordsAt(s,-1);if(l&&Nd(t,i,l))return-1;let a=n.coordsAt(s,1);return a&&Nd(t,i,a)?1:l&&l.bottom>=i?-1:1}function bd(r,e){let t=r.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:IM(r,t,e.clientX,e.clientY)}}const xM=ee.ie&&ee.ie_version<=11;let Ld=null,Od=0,Pd=0;function Td(r){if(!xM)return r.detail;let e=Ld,t=Pd;return Ld=r,Pd=Date.now(),Od=!e||t>Date.now()-400&&Math.abs(e.clientX-r.clientX)<2&&Math.abs(e.clientY-r.clientY)<2?(Od+1)%3:1}function wM(r,e){let t=bd(r,e),i=Td(e),n=r.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),n=n.map(s.changes))},get(s,l,a){let c=bd(r,s),d,h=Md(r,c.pos,c.bias,i);if(t.pos!=c.pos&&!l){let u=Md(r,t.pos,t.bias,i),f=Math.min(u.from,h.from),g=Math.max(u.to,h.to);h=f<h.from?ne.range(f,g):ne.range(g,f)}return l?n.replaceRange(n.main.extend(h.from,h.to)):a&&i==1&&n.ranges.length>1&&(d=yM(n,c.pos))?d:a?n.addRange(h):ne.create([h])}}}function yM(r,e){for(let t=0;t<r.ranges.length;t++){let{from:i,to:n}=r.ranges[t];if(i<=e&&n>=e)return ne.create(r.ranges.slice(0,t).concat(r.ranges.slice(t+1)),r.mainIndex==t?0:r.mainIndex-(r.mainIndex>t?1:0))}return null}Zt.dragstart=(r,e)=>{let{selection:{main:t}}=r.state;if(e.target.draggable){let n=r.docView.nearest(e.target);if(n&&n.isWidget){let s=n.posAtStart,l=s+n.length;(s>=t.to||l<=t.from)&&(t=ne.range(s,l))}}let{inputState:i}=r;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",io(r.state,Kl,r.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1},Zt.dragend=r=>(r.inputState.draggedContent=null,!1);function Id(r,e,t,i){if(t=io(r.state,Ql,t),!t)return;let n=r.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=r.inputState,l=i&&s&&LM(r,e)?{from:s.from,to:s.to}:null,a={from:n,insert:t},c=r.state.changes(l?[l,a]:a);r.focus(),r.dispatch({changes:c,selection:{anchor:c.mapPos(n,-1),head:c.mapPos(n,1)},userEvent:l?"move.drop":"input.drop"}),r.inputState.draggedContent=null}Zt.drop=(r,e)=>{if(!e.dataTransfer)return!1;if(r.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),n=0,s=()=>{++n==t.length&&Id(r,e,i.filter(l=>l!=null).join(r.state.lineBreak),!1)};for(let l=0;l<t.length;l++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(i[l]=a.result),s()},a.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Id(r,e,i,!0),!0}return!1},Zt.paste=(r,e)=>{if(r.state.readOnly)return!0;r.observer.flush();let t=md?null:e.clipboardData;return t?(Sd(r,t.getData("text/plain")||t.getData("text/uri-list")),!0):(TM(r),!1)};function VM(r,e){let t=r.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),r.focus()},50)}function FM(r){let e=[],t=[],i=!1;for(let n of r.selection.ranges)n.empty||(e.push(r.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:s}of r.selection.ranges){let l=r.doc.lineAt(s);l.number>n&&(e.push(l.text),t.push({from:l.from,to:Math.min(r.doc.length,l.to+1)})),n=l.number}i=!0}return{text:io(r,Kl,e.join(r.lineBreak)),ranges:t,linewise:i}}let $l=null;Zt.copy=Zt.cut=(r,e)=>{let{text:t,ranges:i,linewise:n}=FM(r.state);if(!t&&!n)return!1;$l=n?t:null,e.type=="cut"&&!r.state.readOnly&&r.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=md?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(VM(r,t),!1)};const xd=rn.define();function wd(r,e){let t=[];for(let i of r.facet(Jc)){let n=i(r,e);n&&t.push(n)}return t.length?r.update({effects:t,annotations:xd.of(!0)}):null}function yd(r){setTimeout(()=>{let e=r.hasFocus;if(e!=r.inputState.notifiedFocused){let t=wd(r.state,e);t?r.dispatch(t):r.update([])}},10)}vt.focus=r=>{r.inputState.lastFocusTime=Date.now(),!r.scrollDOM.scrollTop&&(r.inputState.lastScrollTop||r.inputState.lastScrollLeft)&&(r.scrollDOM.scrollTop=r.inputState.lastScrollTop,r.scrollDOM.scrollLeft=r.inputState.lastScrollLeft),yd(r)},vt.blur=r=>{r.observer.clearSelectionRange(),yd(r)},vt.compositionstart=vt.compositionupdate=r=>{r.observer.editContext||(r.inputState.compositionFirstChange==null&&(r.inputState.compositionFirstChange=!0),r.inputState.composing<0&&(r.inputState.composing=0))},vt.compositionend=r=>{r.observer.editContext||(r.inputState.composing=-1,r.inputState.compositionEndedAt=Date.now(),r.inputState.compositionPendingKey=!0,r.inputState.compositionPendingChange=r.observer.pendingRecords().length>0,r.inputState.compositionFirstChange=null,ee.chrome&&ee.android?r.observer.flushSoon():r.inputState.compositionPendingChange?Promise.resolve().then(()=>r.observer.flush()):setTimeout(()=>{r.inputState.composing<0&&r.docView.hasComposition&&r.update([])},50))},vt.contextmenu=r=>{r.inputState.lastContextMenu=Date.now()},Zt.beforeinput=(r,e)=>{var t,i;if(e.inputType=="insertReplacementText"&&r.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let a=l[0],c=r.posAtDOM(a.startContainer,a.startOffset),d=r.posAtDOM(a.endContainer,a.endOffset);return zl(r,{from:c,to:d,insert:r.state.toText(s)},null),!0}}let n;if(ee.chrome&&ee.android&&(n=pd.find(s=>s.inputType==e.inputType))&&(r.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&r.hasFocus&&(r.contentDOM.blur(),r.focus())},100)}return ee.ios&&e.inputType=="deleteContentForward"&&r.observer.flushSoon(),ee.safari&&e.inputType=="insertText"&&r.inputState.composing>=0&&setTimeout(()=>vt.compositionend(r,e),20),!1};const Vd=new Set;function XM(r){Vd.has(r)||(Vd.add(r),r.addEventListener("copy",()=>{}),r.addEventListener("cut",()=>{}))}const Fd=["pre-wrap","normal","pre-line","break-spaces"];let Sn=!1;function Xd(){Sn=!1}class CM{constructor(e){this.lineWrapping=e,this.doc=Oe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Fd.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let n=e[i];n<0?i++:this.heightSamples[Math.floor(n*10)]||(t=!0,this.heightSamples[Math.floor(n*10)]=!0)}return t}refresh(e,t,i,n,s,l){let a=Fd.indexOf(e)>-1,c=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=s,c){this.heightSamples={};for(let d=0;d<l.length;d++){let h=l[d];h<0?d++:this.heightSamples[Math.floor(h*10)]=!0}}return c}}class vM{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class si{constructor(e,t,i,n,s){this.from=e,this.length=t,this.top=i,this.height=n,this._content=s}get type(){return typeof this._content=="number"?ti.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof yi?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new si(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var ke=function(r){return r[r.ByPos=0]="ByPos",r[r.ByHeight=1]="ByHeight",r[r.ByPosNoHeight=2]="ByPosNoHeight",r}(ke||(ke={}));const no=.001;class ft{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>no&&(Sn=!0),this.height=e)}replace(e,t,i){return ft.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let s=this,l=i.doc;for(let a=n.length-1;a>=0;a--){let{fromA:c,toA:d,fromB:h,toB:u}=n[a],f=s.lineAt(c,ke.ByPosNoHeight,i.setDoc(t),0,0),g=f.to>=d?f:s.lineAt(d,ke.ByPosNoHeight,i,0,0);for(u+=g.to-d,d=g.to;a>0&&f.from<=n[a-1].toA;)c=n[a-1].fromA,h=n[a-1].fromB,a--,c<f.from&&(f=s.lineAt(c,ke.ByPosNoHeight,i,0,0));h+=f.from-c,c=f.from;let R=jl.build(i.setDoc(l),e,h,u);s=so(s,s.replace(c,d,R))}return s.updateHeight(i,0)}static empty(){return new Tt(0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,n=0,s=0;for(;;)if(t==i)if(n>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),i+=1+a.break,n-=a.size}else if(s>n*2){let a=e[i];a.break?e.splice(i,1,a.left,null,a.right):e.splice(i,1,a.left,a.right),i+=2+a.break,s-=a.size}else break;else if(n<s){let a=e[t++];a&&(n+=a.size)}else{let a=e[--i];a&&(s+=a.size)}let l=0;return e[t-1]==null?(l=1,t--):e[t]==null&&(l=1,i++),new WM(ft.of(e.slice(0,t)),l,ft.of(e.slice(i)))}}function so(r,e){return r==e?r:(r.constructor!=e.constructor&&(Sn=!0),e)}ft.prototype.size=1;class Cd extends ft{constructor(e,t,i){super(e,t),this.deco=i}blockAt(e,t,i,n){return new si(n,this.length,i,this.height,this.deco||0)}lineAt(e,t,i,n,s){return this.blockAt(0,i,n,s)}forEachLine(e,t,i,n,s,l){e<=s+this.length&&t>=s&&l(this.blockAt(0,i,n,s))}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Tt extends Cd{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,n){return new si(n,this.length,i,this.height,this.breaks)}replace(e,t,i){let n=i[0];return i.length==1&&(n instanceof Tt||n instanceof st&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof st?n=new Tt(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):ft.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class st extends ft{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,s=n-i+1,l,a=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*s);l=c/s,this.length>s+1&&(a=(this.height-c)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:n,perLine:l,perChar:a}}blockAt(e,t,i,n){let{firstLine:s,lastLine:l,perLine:a,perChar:c}=this.heightMetrics(t,n);if(t.lineWrapping){let d=n+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),h=t.doc.lineAt(d),u=a+h.length*c,f=Math.max(i,e-u/2);return new si(h.from,h.length,f,u,0)}else{let d=Math.max(0,Math.min(l-s,Math.floor((e-i)/a))),{from:h,length:u}=t.doc.line(s+d);return new si(h,u,i+a*d,a,0)}}lineAt(e,t,i,n,s){if(t==ke.ByHeight)return this.blockAt(e,i,n,s);if(t==ke.ByPosNoHeight){let{from:g,to:R}=i.doc.lineAt(e);return new si(g,R-g,0,0,0)}let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s),d=i.doc.lineAt(e),h=a+d.length*c,u=d.number-l,f=n+a*u+c*(d.from-s-u);return new si(d.from,d.length,Math.max(n,Math.min(f,n+this.height-h)),h,0)}forEachLine(e,t,i,n,s,l){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:c,perChar:d}=this.heightMetrics(i,s);for(let h=e,u=n;h<=t;){let f=i.doc.lineAt(h);if(h==e){let R=f.number-a;u+=c*R+d*(e-s-R)}let g=c+d*f.length;l(new si(f.from,f.length,u,g,0)),u+=g,h=f.to+1}}replace(e,t,i){let n=this.length-t;if(n>0){let s=i[i.length-1];s instanceof st?i[i.length-1]=new st(s.length+n):i.push(null,new st(n-1))}if(e>0){let s=i[0];s instanceof st?i[0]=new st(e+s.length):i.unshift(new st(e-1),null)}return ft.of(i)}decomposeLeft(e,t){t.push(new st(e-1),null)}decomposeRight(e,t){t.push(null,new st(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let s=t+this.length;if(n&&n.from<=t+this.length&&n.more){let l=[],a=Math.max(t,n.from),c=-1;for(n.from>t&&l.push(new st(n.from-t-1).updateHeight(e,t));a<=s&&n.more;){let h=e.doc.lineAt(a).length;l.length&&l.push(null);let u=n.heights[n.index++];c==-1?c=u:Math.abs(u-c)>=no&&(c=-2);let f=new Tt(h,u);f.outdated=!1,l.push(f),a+=h+1}a<=s&&l.push(null,new st(s-a).updateHeight(e,a));let d=ft.of(l);return(c<0||Math.abs(d.height-this.height)>=no||Math.abs(c-this.heightMetrics(e,t).perLine)>=no)&&(Sn=!0),so(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class WM extends ft{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,n){let s=i+this.left.height;return e<s?this.left.blockAt(e,t,i,n):this.right.blockAt(e,t,s,n+this.left.length+this.break)}lineAt(e,t,i,n,s){let l=n+this.left.height,a=s+this.left.length+this.break,c=t==ke.ByHeight?e<l:e<a,d=c?this.left.lineAt(e,t,i,n,s):this.right.lineAt(e,t,i,l,a);if(this.break||(c?d.to<a:d.from>a))return d;let h=t==ke.ByPosNoHeight?ke.ByPosNoHeight:ke.ByPos;return c?d.join(this.right.lineAt(a,h,i,l,a)):this.left.lineAt(a,h,i,n,s).join(d)}forEachLine(e,t,i,n,s,l){let a=n+this.left.height,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,t,i,n,s,l),t>=c&&this.right.forEachLine(e,t,i,a,c,l);else{let d=this.lineAt(c,ke.ByPos,i,n,s);e<d.from&&this.left.forEachLine(e,d.from-1,i,n,s,l),d.to>=e&&d.from<=t&&l(d),t>d.to&&this.right.forEachLine(d.to+1,t,i,a,c,l)}}replace(e,t,i){let n=this.left.length+this.break;if(t<n)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let a of i)s.push(a);if(e>0&&vd(s,l-1),t<this.length){let a=s.length;this.decomposeRight(t,s),vd(s,a)}return ft.of(s)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<n&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ft.of(this.break?[e,null,t]:[e,t]):(this.left=so(this.left,e),this.right=so(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:s,right:l}=this,a=t+s.length+this.break,c=null;return n&&n.from<=t+s.length&&n.more?c=s=s.updateHeight(e,t,i,n):s.updateHeight(e,t,i),n&&n.from<=a+l.length&&n.more?c=l=l.updateHeight(e,a,i,n):l.updateHeight(e,a,i),c?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function vd(r,e){let t,i;r[e]==null&&(t=r[e-1])instanceof st&&(i=r[e+1])instanceof st&&r.splice(e-1,3,new st(t.length+1+i.length))}const kM=5;class jl{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof Tt?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Tt(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let l=t-e;i.block?this.addBlock(new Cd(l,n,i)):(l||s||n>=kM)&&this.addLineDeco(n,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Tt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new st(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Tt)return e;let t=new Tt(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Tt)&&!this.isCovered?this.nodes.push(new Tt(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let n of this.nodes)n instanceof Tt&&n.updateHeight(this.oracle,i),i+=n?n.length:1;return this.nodes}static build(e,t,i,n){let s=new jl(i,e);return We.spans(t,i,n,s,0),s.finish(i)}}function DM(r,e,t){let i=new EM;return We.compare(r,e,t,i,0),i.changes}class EM{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,n){(e<t||i&&i.heightRelevant||n&&n.heightRelevant)&&Js(e,t,this.changes,5)}}function UM(r,e){let t=r.getBoundingClientRect(),i=r.ownerDocument,n=i.defaultView||window,s=Math.max(0,t.left),l=Math.min(n.innerWidth,t.right),a=Math.max(0,t.top),c=Math.min(n.innerHeight,t.bottom);for(let d=r.parentNode;d&&d!=i.body;)if(d.nodeType==1){let h=d,u=window.getComputedStyle(h);if((h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth)&&u.overflow!="visible"){let f=h.getBoundingClientRect();s=Math.max(s,f.left),l=Math.min(l,f.right),a=Math.max(a,f.top),c=Math.min(d==r.parentNode?n.innerHeight:c,f.bottom)}d=u.position=="absolute"||u.position=="fixed"?h.offsetParent:h.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:a-(t.top+e),bottom:Math.max(a,c)-(t.top+e)}}function ZM(r){let e=r.getBoundingClientRect(),t=r.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function YM(r,e){let t=r.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class ql{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],s=t[i];if(n.from!=s.from||n.to!=s.to||n.size!=s.size)return!1}return!0}draw(e,t){return dt.replace({widget:new QM(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class QM extends Wl{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Wd{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=kd,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=nt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Bl).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new CM(t),this.stateDeco=e.facet(es).filter(i=>typeof i!="function"),this.heightMap=ft.empty().applyChanges(this.stateDeco,Oe.empty,this.heightOracle.setDoc(e.doc),[new Ct(0,0,0,e.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=dt.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>n>=s&&n<=l)){let{from:s,to:l}=this.lineBlockAt(n);e.push(new oo(s,l))}}return this.viewports=e.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?kd:new er(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ns(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(es).filter(h=>typeof h!="function");let n=e.changedRanges,s=Ct.extendWithRanges(n,DM(i,this.stateDeco,e?e.changes:qe.empty(this.state.doc.length))),l=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Xd(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||Sn)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let d=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(HS)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?nt.RTL:nt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let d=0,h=0;if(a.width&&a.height){let{scaleX:N,scaleY:m}=Sc(t,a);(N>.005&&Math.abs(this.scaleX-N)>.005||m>.005&&Math.abs(this.scaleY-m)>.005)&&(this.scaleX=N,this.scaleY=m,d|=16,l=c=!0)}let u=(parseInt(i.paddingTop)||0)*this.scaleY,f=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=u||this.paddingBottom!=f)&&(this.paddingTop=u,this.paddingBottom=f,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=Lc(e.scrollDOM);let R=(this.printing?YM:UM)(t,this.paddingTop),p=R.top-this.pixelViewport.top,M=R.bottom-this.pixelViewport.bottom;this.pixelViewport=R;let S=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(S!=this.inView&&(this.inView=S,S&&(c=!0)),!this.inView&&!this.scrollTarget&&!ZM(e.dom))return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),c){let N=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(N)&&(l=!0),l||n.lineWrapping&&Math.abs(b-this.contentDOMWidth)>n.charWidth){let{lineHeight:m,charWidth:T,textHeight:y}=e.docView.measureTextSize();l=m>0&&n.refresh(s,m,T,y,Math.max(5,b/T),N),l&&(e.docView.minWidth=0,d|=16)}p>0&&M>0?h=Math.max(p,M):p<0&&M<0&&(h=Math.min(p,M)),Xd();for(let m of this.viewports){let T=m.from==this.viewport.from?N:e.docView.measureVisibleLineHeights(m);this.heightMap=(l?ft.empty().applyChanges(this.stateDeco,Oe.empty,this.heightOracle,[new Ct(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,l,new vM(m.from,T))}Sn&&(d|=2)}let P=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),d|=this.updateForViewport()),(d&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:a}=this,c=new oo(n.lineAt(l-i*1e3,ke.ByHeight,s,0,0).from,n.lineAt(a+(1-i)*1e3,ke.ByHeight,s,0,0).to);if(t){let{head:d}=t.range;if(d<c.from||d>c.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),u=n.lineAt(d,ke.ByPos,s,0,0),f;t.y=="center"?f=(u.top+u.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&d<c.from?f=u.top:f=u.bottom-h,c=new oo(n.lineAt(f-1e3/2,ke.ByHeight,s,0,0).from,n.lineAt(f+h+1e3/2,ke.ByHeight,s,0,0).to)}}return c}mapViewport(e,t){let i=t.mapPos(e.from,-1),n=t.mapPos(e.to,1);return new oo(this.heightMap.lineAt(i,ke.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,ke.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(e,ke.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,ke.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:a}=this;return(e==0||n<=l-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(i,250)))&&n>l-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let n of e)t.touchesRange(n.from,n.to)||i.push(new ql(t.mapPos(n.from),t.mapPos(n.to),n.size,n.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,s=n>>1,l=n<<1;if(this.defaultTextDirection!=nt.LTR&&!i)return[];let a=[],c=(h,u,f,g)=>{if(u-h<s)return;let R=this.state.selection.main,p=[R.from];R.empty||p.push(R.to);for(let S of p)if(S>h&&S<u){c(h,S-10,f,g),c(S+10,u,f,g);return}let M=HM(e,S=>S.from>=f.from&&S.to<=f.to&&Math.abs(S.from-h)<s&&Math.abs(S.to-u)<s&&!p.some(b=>S.from<b&&S.to>b));if(!M){if(u<f.to&&t&&i&&t.visibleRanges.some(P=>P.from<=u&&P.to>=u)){let P=t.moveToLineBoundary(ne.cursor(u),!1,!0).head;P>h&&(u=P)}let S=this.gapSize(f,h,u,g),b=i||S<2e6?S:2e6;M=new ql(h,u,S,b)}a.push(M)},d=h=>{if(h.length<l||h.type!=ti.Text)return;let u=KM(h.from,h.to,this.stateDeco);if(u.total<l)return;let f=this.scrollTarget?this.scrollTarget.range.head:null,g,R;if(i){let p=n/this.heightOracle.lineLength*this.heightOracle.lineHeight,M,S;if(f!=null){let b=ro(u,f),P=((this.visibleBottom-this.visibleTop)/2+p)/h.height;M=b-P,S=b+P}else M=(this.visibleTop-h.top-p)/h.height,S=(this.visibleBottom-h.top+p)/h.height;g=lo(u,M),R=lo(u,S)}else{let p=u.total*this.heightOracle.charWidth,M=n*this.heightOracle.charWidth,S=0;if(p>2e6)for(let T of e)T.from>=h.from&&T.from<h.to&&T.size!=T.displaySize&&T.from*this.heightOracle.charWidth+S<this.pixelViewport.left&&(S=T.size-T.displaySize);let b=this.pixelViewport.left+S,P=this.pixelViewport.right+S,N,m;if(f!=null){let T=ro(u,f),y=((P-b)/2+M)/p;N=T-y,m=T+y}else N=(b-M)/p,m=(P+M)/p;g=lo(u,N),R=lo(u,m)}g>h.from&&c(h.from,g,h,u),R<h.to&&c(R,h.to,h,u)};for(let h of this.viewportLines)Array.isArray(h.type)?h.type.forEach(d):d(h);return a}gapSize(e,t,i,n){let s=ro(n,i)-ro(n,t);return this.heightOracle.lineWrapping?e.height*s:n.total*this.heightOracle.charWidth*s}updateLineGaps(e){ql.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=dt.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];We.spans(t,this.viewport.from,this.viewport.to,{span(s,l){i.push({from:s,to:l})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let s=0;s<i.length&&!(n&8);s++){let l=this.visibleRanges[s],a=i[s];(l.from!=a.from||l.to!=a.to)&&(n|=4,e&&e.mapPos(l.from,-1)==a.from&&e.mapPos(l.to,1)==a.to||(n|=8))}return this.visibleRanges=i,n}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ns(this.heightMap.lineAt(e,ke.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||ns(this.heightMap.lineAt(this.scaler.fromDOM(e),ke.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ns(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class oo{constructor(e,t){this.from=e,this.to=t}}function KM(r,e,t){let i=[],n=r,s=0;return We.spans(t,r,e,{span(){},point(l,a){l>n&&(i.push({from:n,to:l}),s+=l-n),n=a}},20),n<e&&(i.push({from:n,to:e}),s+=e-n),{total:s,ranges:i}}function lo({total:r,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(r*t);for(let n=0;;n++){let{from:s,to:l}=e[n],a=l-s;if(i<=a)return s+i;i-=a}}function ro(r,e){let t=0;for(let{from:i,to:n}of r.ranges){if(e<=n){t+=e-i;break}t+=n-i}return t/r.total}function HM(r,e){for(let t of r)if(e(t))return t}const kd={toDOM(r){return r},fromDOM(r){return r},scale:1,eq(r){return r==this}};class er{constructor(e,t,i){let n=0,s=0,l=0;this.viewports=i.map(({from:a,to:c})=>{let d=t.lineAt(a,ke.ByPos,e,0,0).top,h=t.lineAt(c,ke.ByPos,e,0,0).bottom;return n+=h-d,{from:a,to:c,top:d,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let a of this.viewports)a.domTop=l+(a.top-s)*this.scale,l=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return n+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,n=s.domBottom}}fromDOM(e){for(let t=0,i=0,n=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return i+(e-n)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,n=s.domBottom}}eq(e){return e instanceof er?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function ns(r,e){if(e.scale==1)return r;let t=e.toDOM(r.top),i=e.toDOM(r.bottom);return new si(r.from,r.length,t,i-t,Array.isArray(r._content)?r._content.map(n=>ns(n,e)):r._content)}const ao=ue.define({combine:r=>r.join(" ")}),tr=ue.define({combine:r=>r.indexOf(!0)>-1}),ir=wi.newName(),Dd=wi.newName(),Ed=wi.newName(),Ud={"&light":"."+Dd,"&dark":"."+Ed};function nr(r,e,t){return new wi(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return r;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):r+" "+i}})}const BM=nr("."+ir,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},Ud),GM={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},sr=ee.ie&&ee.ie_version<=11;class _M{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new IS,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(ee.ie&&ee.ie_version<=11||ee.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ee.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ee.chrome&&ee.chrome_version<126)&&(this.editContext=new JM(e),e.state.facet(Si)&&(e.contentDOM.editContext=this.editContext.editContext)),sr&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(Si)?i.root.activeElement!=this.dom:!Hs(this.dom,n))return;let s=n.anchorNode&&i.docView.nearest(n.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(ee.ie&&ee.ie_version<=11||ee.android&&ee.chrome)&&!i.state.selection.main.empty&&n.focusNode&&zn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=An(e.root);if(!t)return!1;let i=ee.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&AM(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=Hs(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&wS(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,GM),sr&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),sr&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let n=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&un(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(n=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Hs(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new dM(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,n=gd(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=Zd(t,e.previousSibling||e.target.previousSibling,-1),n=Zd(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Si)!=e.state.facet(Si)&&(e.view.contentDOM.editContext=e.state.facet(Si)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Zd(r,e,t){for(;e;){let i=Ve.get(e);if(i&&i.parent==r)return i;let n=e.parentNode;e=n!=r.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function Yd(r,e){let t=e.startContainer,i=e.startOffset,n=e.endContainer,s=e.endOffset,l=r.docView.domAtPos(r.state.selection.main.anchor);return zn(l.node,l.offset,n,s)&&([t,i,n,s]=[n,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:s}}function AM(r,e){if(e.getComposedRanges){let n=e.getComposedRanges(r.root)[0];if(n)return Yd(r,n)}let t=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return r.contentDOM.addEventListener("beforeinput",i,!0),r.dom.ownerDocument.execCommand("indent"),r.contentDOM.removeEventListener("beforeinput",i,!0),t?Yd(r,t):null}class JM{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let n=e.state.selection.main,{anchor:s,head:l}=n,a=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:a,drifted:!1});let d={from:a,to:c,insert:Oe.of(i.text.split(`
117
+ `))};if(d.from==this.from&&s<this.from?d.from=s:d.to==this.to&&s>this.to&&(d.to=s),d.from==d.to&&!d.insert.length){let h=ne.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));h.main.eq(n)||e.dispatch({selection:h,userEvent:"select"});return}if((ee.mac||ee.android)&&d.from==l-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(d={from:a,to:c,insert:Oe.of([i.text.replace("."," ")])}),this.pendingContextChange=d,!e.state.readOnly){let h=this.to-this.from+(d.to-d.from+d.insert.length);zl(e,d,ne.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=i=>{let n=[],s=null;for(let l=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);l<a;l++){let c=e.coordsForChar(l);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||s||new DOMRect,n.push(s)}t.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=i=>{let n=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,a=s.underlineThickness;if(l!="None"&&a!="None"){let c=this.toEditorPos(s.rangeStart),d=this.toEditorPos(s.rangeEnd);if(c<d){let h=`text-decoration: underline ${l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;n.push(dt.mark({attributes:{style:h}}).range(c,d))}}}e.dispatch({effects:jc.of(dt.set(n))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=An(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((s,l,a,c,d)=>{if(i)return;let h=d.length-(l-s);if(n&&l>=n.to)if(n.from==s&&n.to==l&&n.insert.eq(d)){n=this.pendingContextChange=null,t+=h,this.to+=h;return}else n=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=h,this.to+=h;else if(s<this.to){if(s<this.from||l>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),d.toString()),this.to+=h}t+=h}),n&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(n=>!n.isUserEvent("input.type")&&n.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class xe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(n=>n.forEach(s=>i(s,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||xS(e.parent)||document,this.viewState=new Wd(e.state||ye.create(e)),e.scrollTo&&e.scrollTo.is($s)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(pn).map(n=>new Hl(n));for(let n of this.plugins)n.update(this);this.observer=new _M(this),this.inputState=new RM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new od(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof at?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,n,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,a=0,c=null;e.some(f=>f.annotation(xd))?(this.inputState.notifiedFocused=l,a=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=wd(s,l),c||(a=1));let d=this.observer.delayedAndroidKey,h=null;if(d?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(ye.phrases)!=this.state.facet(ye.phrases))return this.setState(s);n=js.create(this,s,e),n.flags|=a;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(u&&(u=u.map(f.changes)),f.scrollIntoView){let{main:g}=f.state.selection;u=new Rn(g.empty?g:ne.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of f.effects)g.is($s)&&(u=g.value.clip(this.state))}this.viewState.update(n,u),this.bidiCache=co.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(ts)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(ao)!=n.state.facet(ao)&&(this.viewState.mustMeasureContent=!0),(t||i||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let f of this.state.facet(Yl))try{f(n)}catch(g){ni(this.state,g,"update listener")}(c||h)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),h&&!gd(this,h)&&d.force&&un(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Wd(e),this.plugins=e.facet(pn).map(i=>new Hl(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new od(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(pn),i=e.state.facet(pn);if(t!=i){let n=[];for(let s of i){let l=t.indexOf(s);if(l<0)n.push(new Hl(s));else{let a=this.plugins[l];a.mustUpdate=e,n.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n<this.plugins.length;n++)this.plugins[n].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){ni(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(l<0)if(Lc(i))s=-1,l=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(n);s=g.from,l=g.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];c&4||([this.measureRequests,d]=[d,this.measureRequests]);let h=d.map(g=>{try{return g.read(this)}catch(R){return ni(this.state,R),Qd}}),u=js.create(this,this.state,[]),f=!1;u.flags|=c,t?t.flags|=c:t=u,this.updateState=2,u.empty||(this.updatePlugins(u),this.inputState.update(u),this.updateAttrs(),f=this.docView.update(u),f&&this.docViewUpdate());for(let g=0;g<d.length;g++)if(h[g]!=Qd)try{let R=d[g];R.write&&R.write(h[g],this)}catch(R){ni(this.state,R)}if(f&&this.docView.updateSelection(!0),!u.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let R=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-l;if(R>1||R<-1){n=n+R,i.scrollTop=n/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Yl))a(t)}get themeClasses(){return ir+" "+(this.state.facet(tr)?Ed:Dd)+" "+this.state.facet(ao)}updateAttrs(){let e=Kd(this,qc,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Si)?"true":"false",class:"cm-content",style:`${ee.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Kd(this,Bl,t);let i=this.observer.ignore(()=>{let n=vl(this.contentDOM,this.contentAttrs,t),s=vl(this.dom,this.editorAttrs,e);return n||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(xe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(ts);let e=this.state.facet(xe.cspNonce);wi.mount(this.root,this.styleModules.concat(BM).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Jl(this,e,ud(this,e,t,i))}moveByGroup(e,t){return Jl(this,e,ud(this,e,t,i=>lM(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return ne.cursor(s.side(t,n)+e.from,s.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return oM(this,e,t,i)}moveVertically(e,t,i){return Jl(this,e,rM(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),dd(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),s=this.bidiSpans(n),l=s[Vi.find(s,e-n.from,-1,t)];return Gs(i,l.dir==nt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(zc)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>zM)return Qc(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||Yc(s.isolates,i=id(this,e))))return s.order;i||(i=id(this,e));let n=YS(e.text,t,i);return this.bidiCache.push(new co(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ee.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Mc(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return $s.of(new Rn(typeof e=="number"?ne.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return $s.of(new Rn(ne.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return mn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return mn.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=wi.newName(),n=[ao.of(i),ts.of(nr(`.${i}`,e))];return t&&t.dark&&n.push(tr.of(!0)),n}static baseTheme(e){return cS.lowest(ts.of(nr("."+ir,e,Ud)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&Ve.get(i)||Ve.get(e);return((t=n?.rootView)===null||t===void 0?void 0:t.view)||null}}xe.styleModule=ts,xe.inputHandler=Ac,xe.clipboardInputFilter=Ql,xe.clipboardOutputFilter=Kl,xe.scrollHandler=$c,xe.focusChangeEffect=Jc,xe.perLineTextDirection=zc,xe.exceptionSink=_c,xe.updateListener=Yl,xe.editable=Si,xe.mouseSelectionStyle=Gc,xe.dragMovesSelection=Bc,xe.clickAddsSelectionRange=Hc,xe.decorations=es,xe.outerDecorations=ed,xe.atomicRanges=Gl,xe.bidiIsolatedRanges=td,xe.scrollMargins=nd,xe.darkTheme=tr,xe.cspNonce=ue.define({combine:r=>r.length?r[0]:""}),xe.contentAttributes=Bl,xe.editorAttributes=qc,xe.lineWrapping=xe.contentAttributes.of({class:"cm-lineWrapping"}),xe.announce=Je.define();const zM=4096,Qd={};class co{constructor(e,t,i,n,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:nt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let l=e[s];l.dir==n&&!t.touchesRange(l.from,l.to)&&i.push(new co(t.mapPos(l.from,1),t.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return i}}function Kd(r,e,t){for(let i=r.state.facet(e),n=i.length-1;n>=0;n--){let s=i[n],l=typeof s=="function"?s(r):s;l&&Cl(l,t)}return t}class Mn extends cn{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Mn.prototype.elementClass="",Mn.prototype.toDOM=void 0,Mn.prototype.mapMode=Pt.TrackBefore,Mn.prototype.startSide=Mn.prototype.endSide=-1,Mn.prototype.point=!0;var or;const Nn=new Te;function $M(r){return ue.define({combine:r?e=>e.concat(r):void 0})}const jM=new Te;class Yt{constructor(e,t,i=[],n=""){this.data=e,this.name=n,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return lr(this)}}),this.parser=t,this.extension=[Ln.of(this),ye.languageData.of((s,l,a)=>{let c=Hd(s,l,a),d=c.type.prop(Nn);if(!d)return[];let h=s.facet(d),u=c.type.prop(jM);if(u){let f=c.resolve(l-c.from,a);for(let g of u)if(g.test(f,s)){let R=s.facet(g.facet);return g.type=="replace"?R:R.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return Hd(e,t,i).type.prop(Nn)==this.data}findRegions(e){let t=e.facet(Ln);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(s,l)=>{if(s.prop(Nn)==this.data){i.push({from:l,to:l+s.length});return}let a=s.prop(Te.mounted);if(a){if(a.tree.prop(Nn)==this.data){if(a.overlay)for(let c of a.overlay)i.push({from:c.from+l,to:c.to+l});else i.push({from:l,to:l+s.length});return}else if(a.overlay){let c=i.length;if(n(a.tree,a.overlay[0].from+l),i.length>c)return}}for(let c=0;c<s.children.length;c++){let d=s.children[c];d instanceof Be&&n(d,s.positions[c]+l)}};return n(lr(e),0),i}get allowsNesting(){return!0}}Yt.setState=Je.define();function Hd(r,e,t){let i=r.facet(Ln),n=lr(r).topNode;if(!i||i.allowsNesting)for(let s=n;s;s=s.enter(e,t,je.ExcludeBuffers))s.type.isTop&&(n=s);return n}class ho extends Yt{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=$M(e.languageData);return new ho(t,e.parser.configure({props:[Nn.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new ho(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function lr(r){let e=r.field(Yt.state,!1);return e?e.tree:Be.empty}class qM{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let ss=null;class uo{constructor(e,t,i=[],n,s,l,a,c){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=s,this.viewport=l,this.skipped=a,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new uo(e,t,[],Be.empty,0,i,[],null)}startParse(){return this.parser.startParse(new qM(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Be.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(Ei.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ei.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ss;ss=this;try{return e()}finally{ss=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Bd(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:s,viewport:l,skipped:a}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((d,h,u,f)=>c.push({fromA:d,toA:h,fromB:u,toB:f})),i=Ei.applyChanges(i,c),n=Be.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){a=[];for(let d of this.skipped){let h=e.mapPos(d.from,1),u=e.mapPos(d.to,-1);h<u&&a.push({from:h,to:u})}}}return new uo(this.parser,t,i,n,s,l,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:n,to:s}=this.skipped[i];n<e.to&&s>e.from&&(this.fragments=Bd(this.fragments,n,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Fa{createParse(t,i,n){let s=n[0].from,l=n[n.length-1].to;return{parsedPos:s,advance(){let c=ss;if(c){for(let d of n)c.tempSkipped.push(d);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=l,new Be(Nt.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ss}}function Bd(r,e,t){return Ei.applyChanges(r,[{fromA:e,toA:t,fromB:e,toB:t}])}class bn{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new bn(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=uo.create(e.facet(Ln).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new bn(i)}}Yt.state=Yi.define({create:bn.init,update(r,e){for(let t of e.effects)if(t.is(Yt.setState))return t.value;return e.startState.facet(Ln)!=e.state.facet(Ln)?bn.init(e.state):r.apply(e)}});let Gd=r=>{let e=setTimeout(()=>r(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Gd=r=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(r,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const rr=typeof navigator<"u"&&(!((or=navigator.scheduling)===null||or===void 0)&&or.isInputPending)?()=>navigator.scheduling.isInputPending():null,eN=mn.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Yt.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Yt.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Gd(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,s=i.field(Yt.state);if(s.tree==s.context.tree&&s.context.isDone(n+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!rr?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<n&&i.doc.length>n+1e3,c=s.context.work(()=>rr&&rr()||Date.now()>l,n+(a?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Yt.setState.of(new bn(s.context))})),this.chunkBudget>0&&!(c&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ni(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ln=ue.define({combine(r){return r.length?r[0]:null},enables:r=>[Yt.state,eN,xe.contentAttributes.compute([r],e=>{let t=e.facet(r);return t&&t.name?{"data-language":t.name}:{}})]});class tN{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const iN=new Te;function _d({except:r,units:e=1}={}){return t=>{let i=r&&r.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const nN=new Te;function sN(r){let e=r.firstChild,t=r.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?r.to:t.from}:null}class ar{constructor(e,t){this.specs=e;let i;function n(a){let c=wi.newName();return(i||(i=Object.create(null)))["."+c]=a,c}const s=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,l=t.scope;this.scope=l instanceof Yt?a=>a.prop(Nn)==l.data:l?a=>a==l:void 0,this.style=Ua(e.map(a=>({tag:a.tag,class:a.class||n(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=i?new wi(i):null,this.themeType=t.themeType}static define(e,t){return new ar(e,t||{})}}z.meta,z.link,z.heading,z.emphasis,z.strong,z.strikethrough,z.keyword,z.atom,z.bool,z.url,z.contentSeparator,z.labelName,z.literal,z.inserted,z.string,z.deleted,z.regexp,z.escape,z.string,z.variableName,z.variableName,z.typeName,z.namespace,z.className,z.variableName,z.macroName,z.propertyName,z.comment,z.invalid;const oN=Object.create(null),Ad=[Nt.none],Jd=[],zd=Object.create(null),lN=Object.create(null);for(let[r,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])lN[r]=rN(oN,e);function cr(r,e){Jd.indexOf(r)>-1||(Jd.push(r),console.warn(e))}function rN(r,e){let t=[];for(let a of e.split(" ")){let c=[];for(let d of a.split(".")){let h=r[d]||z[d];h?typeof h=="function"?c.length?c=c.map(h):cr(d,`Modifier ${d} used at start of tag`):c.length?cr(d,`Tag ${d} used as modifier`):c=Array.isArray(h)?h:[h]:cr(d,`Unknown highlighting tag ${d}`)}for(let d of c)t.push(d)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(a=>a.id),s=zd[n];if(s)return s.id;let l=zd[n]=Nt.define({id:Ad.length,name:i,props:[Ea({[i]:t})]});return Ad.push(l),l.id}nt.RTL,nt.LTR;const aN=ho.define({name:"json",parser:iS.configure({props:[iN.add({Object:_d({except:/^\s*\}/}),Array:_d({except:/^\s*\]/})}),nN.add({"Object Array":sN})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function cN(){return new tN(aN)}const dr=[{name:"tel",title:"手机号",express:"^1[3-9]\\d{9}$",error:"手机号不正确"},{name:"email",title:"邮箱",express:"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$",error:"邮箱不正确"},{name:"idcard",title:"身份证号码",express:"(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$)|(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)",error:"身份证号码不正确"}];function dN(){const r=Dt();if(r.formRules?.length){const e={};dr.forEach(i=>{e[i.name]=i});const t=[...dr];return r.formRules.forEach(i=>{const n=e[i.name];n?Object.assign(n,i):t.push(n)}),t}return dr}const hN={loadAdvances:dN},uN={class:"unione-props-setting data-field-setting"},fN={key:0},gN=["onClick"],RN={class:"field-txt"},pN=["onClick"],mN={key:1,class:"field-txt"},SN=["onClick"],MN={key:0,class:"field-txt"},NN={key:3,class:"edit-field"},bN=["onClick"],LN=Le(o.defineComponent({__name:"dataFieldSetting",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=o.ref([cN()]),t=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:N})=>N+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"form",key:"form",width:"40px",align:"center"},{title:"详情",dataIndex:"view",key:"view",width:"40px",align:"center"},{title:"列表",dataIndex:"list",key:"list",width:"40px",align:"center"},{title:"排序",dataIndex:"sort",key:"sort",width:"40px",align:"center"},{title:"查询",dataIndex:"query",key:"query",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),i=o.useModel(r,"modelValue"),n={mounted:N=>N.focus()},s=o.ref({});function l(){const N=Object.keys(s.value);if(N.length)for(let m in N){const T=i.value.filter(y=>y.name==m);if(T&&T[0]){let y=s.value[m];Object.keys(y).forEach(x=>{x=="convertName"?(T[0].convert||(T[0].convert={}),T[0].convert.type=y[x]):T[0][x]=y[x]})}}s.value={}}function a(N,m){l();const T={};m=="convertName"?(N.convert||(N.convert={}),T[m]=N.convert?.type):T[m]=N[m]||"",s.value[N.name]=T}function c(N,m){{s.value={};return}}function d(N,m){switch(m){case"query":return N.configs?.query?.enable;case"form":return N.configs?.show?.form?.enable;case"view":return N.configs?.show?.view?.enable;case"list":return N.configs?.show?.list?.enable;case"sort":return N.configs?.sort?.enable}}function h(N,m){switch(m){case"query":N.configs=te.utils.obj.ext(N.configs,{query:{enable:!1}}),N.configs.query.enable=!N.configs.query.enable;break;case"form":N.configs=te.utils.obj.ext(N.configs,{show:{form:{enable:!1}}}),N.configs.show.form.enable=!N.configs.show.form.enable;break;case"view":N.configs=te.utils.obj.ext(N.configs,{show:{view:{enable:!1}}}),N.configs.show.view.enable=!N.configs.show.view.enable;break;case"list":N.configs=te.utils.obj.ext(N.configs,{show:{list:{enable:!1}}}),N.configs.show.list.enable=!N.configs.show.list.enable;break;case"sort":N.configs=te.utils.obj.ext(N.configs,{sort:{enable:!1}}),N.configs.sort.enable=!N.configs.sort.enable;break}console.log("record.configs",N.configs)}const u=o.ref({title:"列头设置",prop:"list",visible:!1,field:{},show:{},toSetting:()=>{u.value.visible=!1}});function f(N,m){switch(u.value.prop=m,u.value.field=N,N.configs||(N.configs={}),N.configs.show||(N.configs.show={}),m){case"query":N.configs.query||(N.configs.query={}),N.configs.query.types||(N.configs.query.types="EQ"),u.value.show=N.configs.query,u.value.title=`查询设置/${N.title}(${N.name})`;break;case"form":N.configs.show.form||(N.configs.show.form={}),u.value.show=N.configs.show.form,u.value.title=`表单设置/${N.title}(${N.name})`;break;case"view":N.configs.show.view||(N.configs.show.view={}),u.value.show=N.configs.show.view,u.value.title=`详情设置/${N.title}(${N.name})`;break;case"list":N.configs.show.list||(N.configs.show.list={}),u.value.show=N.configs.show.list,u.value.title=`列头设置/${N.title}(${N.name})`;break;case"sort":N.configs.sort||(N.configs.sort={}),u.value.show=N.configs.sort,u.value.title=`排序设置/${N.title}(${N.name})`;break}u.value.visible=!0}const g=o.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:N=>{const m=g.value.options.filter(T=>T.value==N);return m[0]?m[0].label:N}}),R=o.ref({visible:!1,field:{},props:{},advances:hN.loadAdvances(),showInfo:N=>{let m=0;if(N.configs?.rule){const T=N.configs.rule;T.advance&&m++,typeof T.rangeMin<"u"&&m++,typeof T.rangeMax<"u"&&m++,typeof T.regExpress<"u"&&m++}if(m>0)return"("+m+")"},toSetting:()=>{const N=R.value.props;R.value.field.configs=te.utils.obj.ext(R.value.field.configs,{rule:{...N}}),R.value.visible=!1,R.value.props={}}});function p(N){R.value.visible=!0,R.value.field=N,R.value.props=N.configs?.rule||{}}const M=o.ref({visible:!1,field:{},widget:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-input-number",label:"数值框"},{value:"unione-check-box",label:"多选框"},{value:"unione-radio-box",label:"单选框"},{value:"unione-switch-box",label:"开关"},{value:"unione-select-box",label:"下拉框"},{value:"unione-tree-box",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-slider",label:"滑块"},{value:"a-textarea",label:"文本域"}],widgetName:N=>{const m=N.configs?.widget?.name,T=M.value.widgets.filter(y=>y.value==m);return T[0]?T[0].label:m},toSetting:(N,m)=>{N.configs||(N.configs={}),N.configs.widget||(N.configs.widget={}),N.configs.widget.name=m},toclose:()=>{M.value.visible=!1}});function S(N){M.value.field=N,N.configs=te.utils.obj.ext(N.configs,{widget:{props:{}}}),M.value.widget=N.configs.widget,M.value.visible=!0}const b=o.ref({visible:!1,field:{},convert:{},types:[{value:"dict",label:"字典"},{value:"option",label:"静态"},{value:"dbtable",label:"数据集"},{value:"remote",label:"远程接口"},{value:"local",label:"本地接口"}],optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],getTypes:(N,m="--")=>b.value.types.filter(T=>T.value==N)[0]?.label||m,toAddOption:()=>{b.value.convert.options||(b.value.convert.options=[]),b.value.convert.options.push({label:"",value:""})},toDelOption:(N,m)=>{b.value.convert.options.splice(N,1)},toSetting:()=>{b.value.visible=!1}});function P(N){b.value.visible=!0,b.value.field=N,N.configs||(N.configs={}),N.configs.convert||(N.configs.convert={}),b.value.convert=N.configs.convert}return(N,m)=>{const T=o.resolveComponent("ToolOutlined"),y=o.resolveComponent("a-button"),x=o.resolveComponent("a-select"),I=o.resolveComponent("a-checkbox"),V=o.resolveComponent("a-table"),F=o.resolveComponent("a-switch"),L=o.resolveComponent("a-form-item"),w=o.resolveComponent("a-select-option"),v=o.resolveComponent("a-input-number"),X=o.resolveComponent("a-form"),C=o.resolveComponent("a-modal"),Z=o.resolveComponent("a-input"),k=o.resolveComponent("unione-select-box"),Q=o.resolveComponent("a-checkbox-group"),Y=o.resolveComponent("unione-section");return o.openBlock(),o.createElementBlock("div",uN,[o.createVNode(V,{columns:t.value,"data-source":i.value,bordered:"",scroll:{x:1e3},pagination:!0,"row-key":"name",size:"small"},{headerCell:o.withCtx(({column:W})=>[["widget","queryType","rules","convertName"].includes(W.key)?(o.openBlock(),o.createElementBlock("span",fN,[o.createVNode(T),o.createTextVNode(" "+o.toDisplayString(W.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:W,text:H,record:U})=>[["rules"].includes(W.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",!R.value.showInfo(U)&&"empty"]),onClick:K=>p(U)},[o.createElementVNode("span",RN,o.toDisplayString(R.value.showInfo(U)),1),R.value.showInfo(U)?(o.openBlock(),o.createBlock(y,{key:0,type:"link"},{default:o.withCtx(()=>m[50]||(m[50]=[o.createTextVNode("设置")])),_:1})):o.createCommentVNode("",!0)],10,gN)):["widget"].includes(W.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!s.value[U.name]||!Object.keys(s.value[U.name]).includes(W.dataIndex))&&!H&&"empty"]),onClick:K=>a(U,W.dataIndex)},[s.value[U.name]&&Object.keys(s.value[U.name]).includes(W.dataIndex)?o.withDirectives((o.openBlock(),o.createBlock(x,{key:0,value:U.configs?.widget?.name,allowClear:!0,options:M.value.widgets,onChange:K=>M.value.toSetting(U,K),onBlur:m[0]||(m[0]=K=>c())},null,8,["value","options","onChange"])),[[n]]):(o.openBlock(),o.createElementBlock("span",mN,o.toDisplayString(M.value.widgetName(U)),1)),o.createVNode(y,{type:"link",onClick:o.withModifiers(K=>S(U),["stop"])},{default:o.withCtx(()=>m[51]||(m[51]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])],10,pN)):["convertName"].includes(W.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!s.value[U.name]||!Object.keys(s.value[U.name]).includes(W.dataIndex))&&!U.convert?.type&&"empty"]),onClick:K=>P(U)},[U.configs?.convert?.types?(o.openBlock(),o.createElementBlock("span",MN,o.toDisplayString(b.value.getTypes(U.configs.convert.types)),1)):o.createCommentVNode("",!0)],10,SN)):["query","form","view","list","sort"].includes(W.dataIndex)?(o.openBlock(),o.createElementBlock("div",NN,[o.createVNode(I,{checked:d(U,W.dataIndex),onClick:K=>h(U,W.dataIndex)},null,8,["checked","onClick"]),o.createVNode(y,{type:"link",onClick:K=>f(U,W.dataIndex)},{default:o.withCtx(()=>m[52]||(m[52]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])])):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(C,{visible:u.value.visible,"onUpdate:visible":m[14]||(m[14]=W=>u.value.visible=W),width:600,title:u.value.title,onOk:u.value.toSetting},{default:o.withCtx(()=>[o.createVNode(X,{model:u.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:o.normalizeClass(["field-setting-form","form-mix",u.value.prop])},{default:o.withCtx(()=>[o.createVNode(L,{label:"启用状态"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.show.enable,"onUpdate:checked":m[1]||(m[1]=W=>u.value.show.enable=W),checkedChildren:"启用",unCheckedChildren:"停用"},null,8,["checked"])]),_:1}),u.value.prop=="sort"?(o.openBlock(),o.createBlock(L,{key:0,label:"默认排序"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.show.defoult,"onUpdate:checked":m[2]||(m[2]=W=>u.value.show.defoult=W),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),u.value.prop=="sort"?(o.openBlock(),o.createBlock(L,{key:1,label:"排序方式"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.show.asc,"onUpdate:checked":m[3]||(m[3]=W=>u.value.show.asc=W),checkedChildren:"升序",unCheckedChildren:"降序"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),u.value.prop=="query"&&u.value.show.types=="ADVANCE"?(o.openBlock(),o.createBlock(L,{key:2,label:"高级查询"})):o.createCommentVNode("",!0),u.value.prop=="query"?(o.openBlock(),o.createBlock(L,{key:3,label:"默认查询",tooltip:"开启后该字段加入关键字查询"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.show.defoult,"onUpdate:checked":m[4]||(m[4]=W=>u.value.show.defoult=W),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),u.value.prop=="query"?(o.openBlock(),o.createBlock(L,{key:4,label:"默认显示",tooltip:"开启后,在查询表单中默认显示该查询字段"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.show.visible,"onUpdate:checked":m[5]||(m[5]=W=>u.value.show.visible=W),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),u.value.prop=="query"?(o.openBlock(),o.createBlock(L,{key:5,label:"查询方式"},{default:o.withCtx(()=>[o.createVNode(x,{value:u.value.show.types,"onUpdate:value":m[6]||(m[6]=W=>u.value.show.types=W)},{default:o.withCtx(()=>[o.createVNode(w,{key:"EQ",value:"EQ"},{default:o.withCtx(()=>m[53]||(m[53]=[o.createTextVNode("精确查询")])),_:1}),o.createVNode(w,{key:"LIKE",value:"LIKE"},{default:o.withCtx(()=>m[54]||(m[54]=[o.createTextVNode("模糊查询")])),_:1}),o.createVNode(w,{key:"LLIKE",value:"LLIKE"},{default:o.withCtx(()=>m[55]||(m[55]=[o.createTextVNode("左模糊")])),_:1}),o.createVNode(w,{key:"RLIKE",value:"RLIKE"},{default:o.withCtx(()=>m[56]||(m[56]=[o.createTextVNode("右模糊")])),_:1}),o.createVNode(w,{key:"RANGE",value:"RANGE"},{default:o.withCtx(()=>m[57]||(m[57]=[o.createTextVNode("范围查询")])),_:1}),o.createVNode(w,{key:"ADVANCE",value:"ADVANCE"},{default:o.withCtx(()=>m[58]||(m[58]=[o.createTextVNode("高级查询")])),_:1})]),_:1},8,["value"])]),_:1})):o.createCommentVNode("",!0),["query","sort"].includes(u.value.prop)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(L,{key:6,label:"显示顺序",tooltip:"默认根据字段顺序显示,若需调整字段显示顺序,可以通过这里设置!"},{default:o.withCtx(()=>[o.createVNode(v,{value:u.value.show.index,"onUpdate:value":m[7]||(m[7]=W=>u.value.show.index=W)},null,8,["value"])]),_:1})),["form","view"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:7,label:"显示宽度",tooltip:"字段显示宽度,0-24,设置成0,根据表单默认配置"},{default:o.withCtx(()=>[o.createVNode(v,{min:0,max:24,value:u.value.show.width,"onUpdate:value":m[8]||(m[8]=W=>u.value.show.width=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["list"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:8,label:"显示宽度",tooltip:"字段显示宽度"},{default:o.withCtx(()=>[o.createVNode(v,{min:0,value:u.value.show.width,"onUpdate:value":m[9]||(m[9]=W=>u.value.show.width=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["form","view"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:9,label:"标题宽度",tooltip:"表单title部分显示宽度,0-24"},{default:o.withCtx(()=>[o.createVNode(v,{min:0,max:24,value:u.value.show.labelWidth,"onUpdate:value":m[10]||(m[10]=W=>u.value.show.labelWidth=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["form","view"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:10,label:"控件宽度",tooltip:"表单组件部分显示宽度,0-24"},{default:o.withCtx(()=>[o.createVNode(v,{min:0,max:24,value:u.value.show.valueWidth,"onUpdate:value":m[11]||(m[11]=W=>u.value.show.valueWidth=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["list"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:11,label:"固定位置"},{default:o.withCtx(()=>[o.createVNode(x,{value:u.value.show.fixed,"onUpdate:value":m[12]||(m[12]=W=>u.value.show.fixed=W),allowClear:"",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["list"].includes(u.value.prop)?(o.openBlock(),o.createBlock(L,{key:12,label:"对齐方式"},{default:o.withCtx(()=>[o.createVNode(x,{value:u.value.show.align,"onUpdate:value":m[13]||(m[13]=W=>u.value.show.align=W),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model","class"])]),_:1},8,["visible","title","onOk"]),o.createVNode(C,{visible:b.value.visible,"onUpdate:visible":m[33]||(m[33]=W=>b.value.visible=W),width:600,title:b.value.getTypes(b.value.convert.types,"转换")+"设置",onOk:b.value.toSetting},{default:o.withCtx(()=>[o.createVNode(X,{model:b.value.convert,name:"basic","label-col":{span:5},"wrapper-col":{span:17},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(L,{label:"转换类型"},{default:o.withCtx(()=>[o.createVNode(x,{value:b.value.convert.types,"onUpdate:value":m[15]||(m[15]=W=>b.value.convert.types=W),allowClear:!0,options:b.value.types},null,8,["value","options"])]),_:1}),["unione-select-box","unione-tree-box"].includes(b.value.field.widget?.name)?(o.openBlock(),o.createBlock(L,{key:0,label:"是否搜索"},{default:o.withCtx(()=>[o.createVNode(F,{checked:u.value.convert.search,"onUpdate:checked":m[16]||(m[16]=W=>u.value.convert.search=W),checkedChildren:"启用",unCheckedChildren:"停用"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="option"?(o.openBlock(),o.createBlock(L,{key:1,label:"选项设置"},{default:o.withCtx(()=>[o.createVNode(y,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:b.value.toAddOption},{default:o.withCtx(()=>m[59]||(m[59]=[o.createTextVNode("新增")])),_:1},8,["onClick"]),o.createVNode(V,{columns:b.value.optionColumn,"data-source":b.value.convert.options,size:"small"},{bodyCell:o.withCtx(({column:W,record:H,index:U})=>[W.dataIndex==="label"?(o.openBlock(),o.createBlock(Z,{key:0,value:H.label,"onUpdate:value":K=>H.label=K,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),W.dataIndex==="value"?(o.openBlock(),o.createBlock(Z,{key:1,value:H.value,"onUpdate:value":K=>H.value=K,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):o.createCommentVNode("",!0),W.dataIndex==="action"?(o.openBlock(),o.createElementBlock("a",{key:2,onClick:K=>b.value.toDelOption(U,H)},"删除",8,bN)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1})):o.createCommentVNode("",!0),["dbtable","remote"].includes(b.value.convert.types)?(o.openBlock(),o.createBlock(L,{key:2,label:"数据源"},{default:o.withCtx(()=>[o.createVNode(k,{value:b.value.convert.dsId,"onUpdate:value":m[17]||(m[17]=W=>b.value.convert.dsId=W),convert:{types:"local",url:"/api/data/source/find",search:!0}},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:3,label:"table名称"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableName,"onUpdate:value":m[18]||(m[18]=W=>b.value.convert.tableName=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:4,label:"table名称"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableName,"onUpdate:value":m[19]||(m[19]=W=>b.value.convert.tableName=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"&&["unione-tree-box"].includes(b.value.field.widget?.name)?(o.openBlock(),o.createBlock(L,{key:5,label:"主键字段"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.idField,"onUpdate:value":m[20]||(m[20]=W=>b.value.convert.idField=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"&&["unione-tree-box"].includes(b.value.field.widget?.name)?(o.openBlock(),o.createBlock(L,{key:6,label:"父级字段"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.pidField,"onUpdate:value":m[21]||(m[21]=W=>b.value.convert.pidField=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:7,label:"value字段"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.valueField,"onUpdate:value":m[22]||(m[22]=W=>b.value.convert.valueField=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:8,label:"label字段"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.labelField,"onUpdate:value":m[23]||(m[23]=W=>b.value.convert.labelField=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:9,label:"扩展字段",tooltip:"默认只加载value,label字段,可以通过该属性加载其他更多字段,多个字段用逗号分隔"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableField,"onUpdate:value":m[24]||(m[24]=W=>b.value.convert.tableField=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:10,label:"数据过滤",tooltip:"支持数据条件过滤,eg:sex=1"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableWhere,"onUpdate:value":m[25]||(m[25]=W=>b.value.convert.tableWhere=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:11,label:"数据排序",tooltip:"设置数据进行排序方式,eg:age desc"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableOrder,"onUpdate:value":m[26]||(m[26]=W=>b.value.convert.tableOrder=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:12,label:"数据排序",tooltip:"设置数据进行排序方式,eg:age desc"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.tableOrder,"onUpdate:value":m[27]||(m[27]=W=>b.value.convert.tableOrder=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:13,label:"异步加载"},{default:o.withCtx(()=>[o.createVNode(F,{checked:b.value.convert.isAsync,"onUpdate:checked":m[28]||(m[28]=W=>b.value.convert.isAsync=W),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dbtable"?(o.openBlock(),o.createBlock(L,{key:14,label:"分页加载"},{default:o.withCtx(()=>[o.createVNode(F,{checked:b.value.convert.isPaging,"onUpdate:checked":m[29]||(m[29]=W=>b.value.convert.isPaging=W),checkedChildren:"是",unCheckedChildren:"否"},null,8,["checked"])]),_:1})):o.createCommentVNode("",!0),b.value.convert.types=="dict"?(o.openBlock(),o.createBlock(L,{key:15,label:"字典名称"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.dictName,"onUpdate:value":m[30]||(m[30]=W=>b.value.convert.dictName=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["local","remote"].includes(b.value.convert.types)?(o.openBlock(),o.createBlock(L,{key:16,label:"接口地址",tooltip:"统一使用POST请求,json提交,标准结构:{body:{参数}}"},{default:o.withCtx(()=>[o.createVNode(Z,{value:b.value.convert.url,"onUpdate:value":m[31]||(m[31]=W=>b.value.convert.url=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),["local","remote"].includes(b.value.convert.types)?(o.openBlock(),o.createBlock(L,{key:17,label:"接口参数",tooltip:"标准json对象/数组,直接使用该参数进行接口请求,请求确保结构和接口匹配!"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn.Codemirror),{modelValue:b.value.convert.params,"onUpdate:modelValue":m[32]||(m[32]=W=>b.value.convert.params=W),placeholder:"接口请求参数,eg:{sex:1}",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:e.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),o.createVNode(C,{visible:M.value.visible,"onUpdate:visible":m[40]||(m[40]=W=>M.value.visible=W),width:600,title:"控件设置",onOk:M.value.toclose},{default:o.withCtx(()=>[o.createVNode(X,{model:M.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(L,{label:"组件类型"},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(x,{value:M.value.widget.name,"onUpdate:value":m[34]||(m[34]=W=>M.value.widget.name=W),allowClear:!0,options:M.value.widgets},null,8,["value","options"]),[[n]])]),_:1}),o.createVNode(L,{label:"输入提示"},{default:o.withCtx(()=>[o.createVNode(Z,{value:M.value.widget.placeholder,"onUpdate:value":m[35]||(m[35]=W=>M.value.widget.placeholder=W)},null,8,["value"])]),_:1}),o.createVNode(L,{label:"帮助说明"},{default:o.withCtx(()=>[o.createVNode(Z,{value:M.value.widget.help,"onUpdate:value":m[36]||(m[36]=W=>M.value.widget.help=W)},null,8,["value"])]),_:1}),o.createVNode(L,{label:"提示文本"},{default:o.withCtx(()=>[o.createVNode(Z,{value:M.value.widget.tooltip,"onUpdate:value":m[37]||(m[37]=W=>M.value.widget.tooltip=W)},null,8,["value"])]),_:1}),["a-date-picker"].includes(M.value.widget.name)?(o.openBlock(),o.createBlock(L,{key:0,label:"显示格式"},{default:o.withCtx(()=>[o.createVNode(Z,{value:M.value.field.dataFormat,"onUpdate:value":m[38]||(m[38]=W=>M.value.field.dataFormat=W)},null,8,["value"])]),_:1})):o.createCommentVNode("",!0),M.value.widget.name=="unione-select-box"?(o.openBlock(),o.createBlock(L,{key:1,label:"下拉框类型"},{default:o.withCtx(()=>[o.createVNode(x,{value:M.value.widget.props.mode,"onUpdate:value":m[39]||(m[39]=W=>M.value.widget.props.mode=W),allowClear:!0},{default:o.withCtx(()=>[o.createVNode(w,{value:"multiple"},{default:o.withCtx(()=>m[60]||(m[60]=[o.createTextVNode("多选")])),_:1}),o.createVNode(w,{value:"tags"},{default:o.withCtx(()=>m[61]||(m[61]=[o.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):o.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),o.createVNode(C,{visible:R.value.visible,"onUpdate:visible":m[49]||(m[49]=W=>R.value.visible=W),width:600,title:"规则设置",onOk:R.value.toSetting},{default:o.withCtx(()=>[o.createVNode(X,{model:R.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(Y,{title:"基本设置",type:"line"},{default:o.withCtx(()=>[o.createVNode(L,{label:"触发时机"},{default:o.withCtx(()=>[o.createVNode(Q,{value:R.value.props.trigger,"onUpdate:value":m[41]||(m[41]=W=>R.value.props.trigger=W),options:["change","blur"]},null,8,["value"])]),_:1}),R.value.field.isNull?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(L,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:o.withCtx(()=>[o.createVNode(I,{checked:R.value.props.whitespace,"onUpdate:checked":m[42]||(m[42]=W=>R.value.props.whitespace=W)},{default:o.withCtx(()=>m[62]||(m[62]=[o.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["checked"])]),_:1})),o.createVNode(L,{label:"预设类型"},{default:o.withCtx(()=>[o.createVNode(x,{options:R.value.advances,fieldNames:{label:"title",value:"name"},value:R.value.props.advance,"onUpdate:value":m[43]||(m[43]=W=>R.value.props.advance=W)},null,8,["options","value"])]),_:1})]),_:1}),["Long","Short","Integer","Float","Double"].includes(R.value.field.dataType)?(o.openBlock(),o.createBlock(Y,{key:0,title:"数值验证",type:"line"},{default:o.withCtx(()=>[o.createVNode(L,{label:"有效区间"},{default:o.withCtx(()=>[o.createVNode(v,{value:R.value.props.rangeMin,"onUpdate:value":m[44]||(m[44]=W=>R.value.props.rangeMin=W)},null,8,["value"]),m[63]||(m[63]=o.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),o.createVNode(v,{value:R.value.props.rangeMax,"onUpdate:value":m[45]||(m[45]=W=>R.value.props.rangeMax=W)},null,8,["value"])]),_:1}),o.createVNode(L,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(Z,{value:R.value.props.rangeMessage,"onUpdate:value":m[46]||(m[46]=W=>R.value.props.rangeMessage=W)},null,8,["value"])]),_:1})]),_:1})):o.createCommentVNode("",!0),o.createVNode(Y,{title:"正则验证",type:"line"},{default:o.withCtx(()=>[o.createVNode(L,{label:"表达式"},{default:o.withCtx(()=>[o.createVNode(Z,{value:R.value.props.regExpress,"onUpdate:value":m[47]||(m[47]=W=>R.value.props.regExpress=W)},null,8,["value"])]),_:1}),o.createVNode(L,{label:"错误提示"},{default:o.withCtx(()=>[o.createVNode(Z,{value:R.value.props.regMessage,"onUpdate:value":m[48]||(m[48]=W=>R.value.props.regMessage=W)},null,8,["value"])]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-d5938ab8"]]),ON={class:"unione-props-setting data-field-fkey"},PN={key:0},TN=["onClick"],IN=["onClick"],xN=["onClick"],wN=["onClick"],yN=["onClick"],VN=["onClick"],FN=["onClick"],XN=["onClick"],CN=Le(o.defineComponent({__name:"dataFieldFKeys",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=te.useDialog(),t=o.ref([{title:"序号",dataIndex:"index",key:"index",width:"35px",fixed:"left",align:"center",customRender:({index:f})=>f+1},{title:"字段名称",dataIndex:"name",key:"name",width:"100px",fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"100px",fixed:"left",align:"center"},{title:"关联数据名称",dataIndex:"dsnName",key:"dsnName",width:"120px",align:"center"},{title:"关联数据标题",dataIndex:"dsnTitle",key:"dsnTitle",width:"150px",align:"center"},{title:"关联字段",dataIndex:"fieldName",key:"fieldName",width:"100px",align:"center"},{title:"显示字段",dataIndex:"labelName",key:"labelName",width:"120px",align:"center"}]),i=o.useModel(r,"modelValue"),n=o.computed(()=>i.value.filter(f=>f.configs?.fkey?.enable)||[]),s=o.ref({});function l(){s.value={}}function a(f,g){l();const R={};R[g]=f.configs.fkey[g]||"",s.value[f.name]=R}function c(f,g,R){f.configs.fkey.dsn=g,f.configs.fkey.dsnName=R.name,f.configs.fkey.dsnTitle=R.title,f.configs.fkey.dsnId=R.id}function d(f,g,R,p){f.configs.fkey[g]=R,g=="fieldName"&&(f.configs.fkey.fieldTitle=p.title),g=="labelName"&&(f.configs.fkey.labelTitle=p.title)}function h(f){u.value.record=f,u.value.visible=!0,u.value.fields=f.configs?.fkey?.fields||[]}const u=o.ref({visible:!1,record:null,editField:{},fields:[],columns:[{title:"字段名称",dataIndex:"title",key:"title",width:"100px",align:"center"},{title:"显示宽度",dataIndex:"width",key:"width",width:"60px",align:"center"},{title:"显示顺序",dataIndex:"index",key:"index",width:"60px",align:"center"},{title:"操作",dataIndex:"action",key:"action",width:"60px",align:"center"}],toEditField:(f,g)=>{u.value.editField[f]=g},onShowFieldChange:(f,g,R)=>{f.name=R.name,f.title=R.title},toAddField:()=>{u.value.fields.push({name:"",title:""}),u.value.editField[u.value.fields.length-1]="title"},toDelField:f=>{e.confirm({content:"确定要删除该字段么?",onOk:()=>{u.value.fields.splice(f,1)}})},toSetting:()=>{u.value.visible=!1,u.value.record.configs=te.utils.obj.ext(u.value.record.configs,{fkey:{fields:u.value.fields}})}});return(f,g)=>{const R=o.resolveComponent("FormOutlined"),p=o.resolveComponent("unione-select-box"),M=o.resolveComponent("a-button"),S=o.resolveComponent("a-table"),b=o.resolveComponent("a-input-number"),P=o.resolveComponent("a-modal");return o.openBlock(),o.createElementBlock("div",ON,[o.createVNode(S,{columns:t.value,"data-source":n.value,bordered:"","row-key":"name",size:"small",pagination:!1},{headerCell:o.withCtx(({column:N})=>[["dsnName","dsnTitle","fieldName","labelName"].includes(N.key)?(o.openBlock(),o.createElementBlock("span",PN,[o.createVNode(R),o.createTextVNode(" "+o.toDisplayString(N.title),1)])):o.createCommentVNode("",!0)]),bodyCell:o.withCtx(({column:N,record:m})=>[["dsnName"].includes(N.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",(!s.value[m.name]||!Object.keys(s.value[m.name]).includes(N.dataIndex))&&!m.configs?.fkey?.dsnName&&"empty"]),onClick:T=>a(m,N.dataIndex)},[s.value[m.name]&&Object.keys(s.value[m.name]).includes(N.dataIndex)?(o.openBlock(),o.createBlock(p,{key:0,value:s.value[m.name][N.dataIndex],"onUpdate:value":T=>s.value[m.name][N.dataIndex]=T,convert:{types:"local",url:"/api/data/define/find",valueField:"sn",labelField:"name",search:!0},onBlur:l,onSelect:(T,y)=>c(m,T,y)},null,8,["value","onUpdate:value","onSelect"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(m.configs?.fkey?.dsnName),1)],64))],10,TN)):["dsnTitle"].includes(N.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",(!s.value[m.name]||!Object.keys(s.value[m.name]).includes(N.dataIndex))&&!m.configs?.fkey?.dsnTitle&&"empty"]),onClick:T=>a(m,N.dataIndex)},[s.value[m.name]&&Object.keys(s.value[m.name]).includes(N.dataIndex)?(o.openBlock(),o.createBlock(p,{key:0,value:s.value[m.name][N.dataIndex],"onUpdate:value":T=>s.value[m.name][N.dataIndex]=T,convert:{types:"local",url:"/api/data/define/find",valueField:"sn",labelField:"title",search:!0},onBlur:l,onSelect:(T,y)=>c(m,T,y)},null,8,["value","onUpdate:value","onSelect"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(m.configs?.fkey?.dsnTitle),1)],64))],10,IN)):o.createCommentVNode("",!0),["fieldName"].includes(N.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",(!s.value[m.name]||!Object.keys(s.value[m.name]).includes(N.dataIndex))&&!m.configs?.fkey?.fieldName&&"empty"]),onClick:T=>a(m,N.dataIndex)},[s.value[m.name]&&m.configs?.fkey?.dsn&&Object.keys(s.value[m.name]).includes(N.dataIndex)?(o.openBlock(),o.createBlock(p,{key:0,value:s.value[m.name][N.dataIndex],"onUpdate:value":T=>s.value[m.name][N.dataIndex]=T,convert:{types:"local",url:"/api/data/field/find",params:{body:{defineId:m.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:l,onSelect:(T,y)=>d(m,"fieldName",T,y)},null,8,["value","onUpdate:value","convert","onSelect"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(m.configs?.fkey?.fieldTitle),1)],64))],10,xN)):["labelName"].includes(N.dataIndex)?(o.openBlock(),o.createElementBlock("div",{key:3,class:o.normalizeClass(["edit-field",(!s.value[m.name]||!Object.keys(s.value[m.name]).includes(N.dataIndex))&&!m.configs?.fkey?.labelName&&"empty"]),onClick:T=>a(m,N.dataIndex)},[s.value[m.name]&&m.configs?.fkey?.dsn&&Object.keys(s.value[m.name]).includes(N.dataIndex)?(o.openBlock(),o.createBlock(p,{key:0,value:s.value[m.name][N.dataIndex],"onUpdate:value":T=>s.value[m.name][N.dataIndex]=T,convert:{types:"local",url:"/api/data/field/find",params:{body:{defineId:m.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:l,onSelect:(T,y)=>d(m,"labelName",T,y)},null,8,["value","onUpdate:value","convert","onSelect"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(m.configs?.fkey?.labelTitle)+" ",1),m.configs?.fkey?.labelName?(o.openBlock(),o.createBlock(M,{key:0,type:"link",onClick:o.withModifiers(T=>h(m),["stop"])},{default:o.withCtx(()=>g[4]||(g[4]=[o.createTextVNode("设置")])),_:2},1032,["onClick"])):o.createCommentVNode("",!0)],64))],10,wN)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),o.createVNode(P,{visible:u.value.visible,"onUpdate:visible":g[3]||(g[3]=N=>u.value.visible=N),width:600,title:"更多显示字段",class:"data-field-fkey",onOk:u.value.toSetting},{default:o.withCtx(()=>[o.createVNode(M,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:u.value.toAddField},{default:o.withCtx(()=>g[5]||(g[5]=[o.createTextVNode("新增")])),_:1},8,["onClick"]),o.createVNode(S,{columns:u.value.columns,"data-source":u.value.fields,size:"small"},{bodyCell:o.withCtx(({column:N,record:m,index:T,text:y})=>[N.dataIndex==="title"?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["edit-field",u.value.editField!="title"&&!y&&"empty"]),onClick:x=>u.value.toEditField(T,N.dataIndex)},[u.value.editField[T]=="title"?(o.openBlock(),o.createBlock(p,{key:0,value:m[m.dataIndex],"onUpdate:value":x=>m[m.dataIndex]=x,convert:{types:"local",url:"/api/data/field/find",search:!0,params:{body:{defineId:u.value.record.configs.fkey.dsnId},pageSize:1e3},valueField:"name",labelField:"title"},onBlur:g[0]||(g[0]=x=>u.value.editField={}),onSelect:(x,I)=>u.value.onShowFieldChange(m,x,I)},null,8,["value","onUpdate:value","convert","onSelect"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(y),1)],64))],10,yN)):o.createCommentVNode("",!0),N.dataIndex==="width"?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["edit-field",u.value.editField!="width"&&!y&&"empty"]),onClick:x=>u.value.toEditField(T,N.dataIndex)},[u.value.editField[T]=="width"?(o.openBlock(),o.createBlock(b,{key:0,onBlur:g[1]||(g[1]=x=>u.value.editField={}),value:m.width,"onUpdate:value":x=>m.width=x,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(y),1)],64))],10,VN)):o.createCommentVNode("",!0),N.dataIndex==="index"?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["edit-field",u.value.editField!="wiindexdth"&&!y&&"empty"]),onClick:x=>u.value.toEditField(T,N.dataIndex)},[u.value.editField[T]=="index"?(o.openBlock(),o.createBlock(b,{key:0,onBlur:g[2]||(g[2]=x=>u.value.editField={}),value:m.index,"onUpdate:value":x=>m.index=x,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(o.toDisplayString(y),1)],64))],10,FN)):o.createCommentVNode("",!0),N.dataIndex==="action"?(o.openBlock(),o.createElementBlock("a",{key:3,onClick:x=>u.value.toDelField(T)},"删除",8,XN)):o.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-84143692"]]),vN={class:"unione-props-setting data-filter"},WN={class:"title"},kN={class:"name"},DN={class:"action"},EN=Le(o.defineComponent({__name:"dataFilters",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(r){const e=te.useDialog(),t=o.useModel(r,"modelValue");function i(){a.value.visible=!0,a.value.filter={},a.value.name=null}function n(d){a.value.visible=!0,a.value.filter={...d},a.value.name=d.name}function s(d){e.confirm({content:"确定要删除该过滤对象么?",onOk:()=>{t.value.splice(d,1)}})}const l=o.ref(),a=o.ref({visible:!1,name:null,filter:{},rules:{title:[{required:!0,message:"过滤标题不能为空"}],name:[{required:!0,message:"过滤名称不能为空"}],filter:[{required:!0,message:"过滤脚本不能为空"}]},toSetting:()=>{l.value.validate().then(d=>{if(a.value.name){const h=t.value.filter(u=>u.name==a.value.name)[0];if(!h){e.error({content:"过滤记录未找到"});return}if(a.value.name!=a.value.filter.name&&t.value.filter(f=>f.name==a.value.filter.name).length){e.error({content:"过滤名称已存在!"});return}Object.keys(d).forEach(u=>{h[u]=d[u]})}else{if(t.value.filter(u=>u.name==a.value.filter.name).length){e.error({content:"过滤名称已存在!"});return}t.value.push(d)}a.value.visible=!1})}});function c(){const d=[];a.value.filter.filter||(a.value.filter.filter=""),d.push("-- @if(isNotEmpty(params."),d.push(a.value.filter.name||"xxx"),d.push(") && !isBlank(params."),d.push(a.value.filter.name||"xxx"),d.push(`)
118
+ `),d.push(" AND XXX=#{params."),d.push(a.value.filter.name||"xxx"),d.push(`}
119
+ `),d.push(`-- @}
120
+ `),a.value.filter.filter=a.value.filter.filter+d.join("")}return(d,h)=>{const u=o.resolveComponent("a-button"),f=o.resolveComponent("a-card"),g=o.resolveComponent("PlusOutlined"),R=o.resolveComponent("a-empty"),p=o.resolveComponent("a-input"),M=o.resolveComponent("a-form-item"),S=o.resolveComponent("a-textarea"),b=o.resolveComponent("a-tag"),P=o.resolveComponent("a-form"),N=o.resolveComponent("a-modal");return o.openBlock(),o.createElementBlock("div",vN,[(t.value.length,o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.value,(m,T)=>(o.openBlock(),o.createBlock(f,{class:"filter-box",size:"small",key:T},{default:o.withCtx(()=>[o.createElementVNode("div",WN,"过滤标题:"+o.toDisplayString(m.title),1),o.createElementVNode("div",kN,"过滤名称:"+o.toDisplayString(m.name),1),o.createElementVNode("div",DN,[o.createVNode(u,{size:"small",onClick:y=>n(m)},{default:o.withCtx(()=>h[4]||(h[4]=[o.createTextVNode("编辑")])),_:2},1032,["onClick"]),o.createVNode(u,{danger:"",size:"small",onClick:y=>s(T)},{default:o.withCtx(()=>h[5]||(h[5]=[o.createTextVNode("删除")])),_:2},1032,["onClick"])])]),_:2},1024))),128)),o.createVNode(f,{class:"filter-box btn-add",size:"small",onClick:i},{default:o.withCtx(()=>[o.createVNode(g,{class:"btn"})]),_:1})],64)),o.createVNode(N,{visible:a.value.visible,"onUpdate:visible":h[3]||(h[3]=m=>a.value.visible=m),width:600,title:"设置数据过滤",class:"data-filter",onOk:a.value.toSetting},{default:o.withCtx(()=>[o.createVNode(P,{ref_key:"filterForm",ref:l,model:a.value.filter,rules:a.value.rules,name:"basic","label-col":{span:4},"wrapper-col":{span:18},class:"form-mix"},{default:o.withCtx(()=>[o.createVNode(M,{label:"过滤标题",name:"title"},{default:o.withCtx(()=>[o.createVNode(p,{value:a.value.filter.title,"onUpdate:value":h[0]||(h[0]=m=>a.value.filter.title=m)},null,8,["value"])]),_:1}),o.createVNode(M,{label:"过滤名称",name:"name"},{default:o.withCtx(()=>[o.createVNode(p,{value:a.value.filter.name,"onUpdate:value":h[1]||(h[1]=m=>a.value.filter.name=m)},null,8,["value"])]),_:1}),o.createVNode(M,{label:"过滤脚本",name:"filter",tooltip:"使用beetsql语法,参数获取方式params.xxx,判断参数是否为空isNotEmpty(params.xxx) && !isBlank(params.xxx)"},{default:o.withCtx(()=>[o.createVNode(S,{value:a.value.filter.filter,"onUpdate:value":h[2]||(h[2]=m=>a.value.filter.filter=m),autosize:{minRows:10},style:{"padding-top":"20px"}},null,8,["value"]),o.createVNode(b,{class:"btn-tmpl",color:"blue",onClick:c},{default:o.withCtx(()=>h[6]||(h[6]=[o.createTextVNode("插入模版")])),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["visible","onOk"])])}}}),[["__scopeId","data-v-a600b93f"]]),UN={class:"unione-page form-page data-define-edit"},ZN={class:"actions"},YN=Le(o.defineComponent({__name:"edit",setup(r){const e=te.useDialog(),t=o.inject("route"),i=o.inject("router"),n=o.ref(),s=o.ref({isPrimary:!1,fields:[{title:"数据类型",name:"category",control:"unione-select-box",value:"sql",convert:{types:"dict",dictName:"DATACATEGORY"}},{title:"数据源",name:"dsId",control:"unione-select-box",convert:{types:"local",url:"/api/data/source/find",search:!0},props:{required:!0}},{title:"自定义",name:"isCustom",control:"unione-switch-box",value:0,convert:{types:"dict",dictName:"TUREORFALSE"}},{title:"数据标题",name:"title",dataLen:10,props:{required:!0}},{title:"数据名称",name:"name",props:{required:!0},rules:{whitespace:!0}},{title:"数据编码",name:"sn",dataLen:50},{title:"描述",name:"descs",control:"a-textarea",view:{width:3}}],setting:{showColumn:2,labelWidth:6}}),l=o.ref(),a=o.ref({isPrimary:!1,fields:[{title:"列表模版",name:"listTmpl",control:"unione-select-box",value:"normal",convert:{types:"option",options:[{value:"normal",label:"标准"}]},props:{required:!0}},{title:"表单风格",name:"showColumn",control:"unione-select-box",value:2,convert:{types:"option",options:[{value:1,label:"一列"},{value:2,label:"二列"},{value:3,label:"三列"}]},props:{required:!0}},{title:"标题宽度",name:"labelWidth",control:"a-input-number",value:9,rule:{rangeMin:1,rangeMax:24},props:{required:!0}}],setting:{showColumn:2,labelWidth:6}}),c=o.ref({configs:{fields:[],filters:[]}}),d=o.ref(!1);function h(){i.back()}function u(){e.confirm({content:"确定要发布当前数据么?",onOk:()=>{Di.release([c.value.id]).then(p=>{p.success?(e.success({title:"发布成功",content:p.body}),R(c.value.id)):e.error({title:"发布失败",content:p.body})})}})}async function f(){const p=await n.value.validate(),M={...c.value,...p};M.configs.show=await l.value.getValue(),console.log("formData",M),ge.message.loading({content:"提交中..."}),d.value=!0,Di.save(M).then(S=>{ge.message.destroy(),S.success?(c.value=S.body,n.value.setValue(S.body),l.value.setValue(S.body.configs?.show||{}),ge.message.success("保存成功!")):ge.message.error(S.message)}).finally(()=>{d.value=!1})}const g=o.ref(!1);o.onMounted(()=>{t.query.id&&R(t.query.id)});function R(p){ge.message.loading({content:"加载中..."}),Di.detail(p).then(M=>{M.success?(c.value=M.body,n.value.setValue(M.body),l.value.setValue(M.body.configs?.show||{}),ge.message.destroy()):ge.message.error(M.message)})}return(p,M)=>{const S=o.resolveComponent("unione-form"),b=o.resolveComponent("unione-section"),P=o.resolveComponent("OrderedListOutlined"),N=o.resolveComponent("a-tab-pane"),m=o.resolveComponent("ToolOutlined"),T=o.resolveComponent("ApiOutlined"),y=o.resolveComponent("FunnelPlotOutlined"),x=o.resolveComponent("a-tabs"),I=o.resolveComponent("a-button");return o.openBlock(),o.createElementBlock("div",UN,[o.createVNode(b,{title:"基础信息",type:"line"},{default:o.withCtx(()=>[o.createVNode(S,{form:s.value,ref_key:"formBaseObj",ref:n},null,8,["form"])]),_:1}),o.createVNode(b,{class:"page-setting-section",title:"页面配置",type:g.value&&"line",location:g.value?"left":"right",reactive:"",modelValue:g.value,"onUpdate:modelValue":M[0]||(M[0]=V=>g.value=V)},{default:o.withCtx(()=>[o.createVNode(S,{form:a.value,ref_key:"pageSettingObj",ref:l},null,8,["form"])]),_:1},8,["type","location","modelValue"]),o.createVNode(x,null,{default:o.withCtx(()=>[o.createVNode(N,{key:"field-mange"},{tab:o.withCtx(()=>[o.createVNode(P),M[5]||(M[5]=o.createTextVNode("字段管理 "))]),default:o.withCtx(()=>[o.createVNode(C0,{modelValue:c.value.configs.fields,"onUpdate:modelValue":M[1]||(M[1]=V=>c.value.configs.fields=V)},null,8,["modelValue"])]),_:1}),o.createVNode(N,{key:"field-setting"},{tab:o.withCtx(()=>[o.createVNode(m),M[6]||(M[6]=o.createTextVNode("字段设置 "))]),default:o.withCtx(()=>[o.createVNode(LN,{modelValue:c.value.configs.fields,"onUpdate:modelValue":M[2]||(M[2]=V=>c.value.configs.fields=V)},null,8,["modelValue"])]),_:1}),o.createVNode(N,{key:"field-fkeys"},{tab:o.withCtx(()=>[o.createVNode(T),M[7]||(M[7]=o.createTextVNode("外键设置 "))]),default:o.withCtx(()=>[o.createVNode(CN,{modelValue:c.value.configs.fields,"onUpdate:modelValue":M[3]||(M[3]=V=>c.value.configs.fields=V)},null,8,["modelValue"])]),_:1}),o.createVNode(N,{key:"data-filter"},{tab:o.withCtx(()=>[o.createVNode(y),M[8]||(M[8]=o.createTextVNode("数据过滤 "))]),default:o.withCtx(()=>[o.createVNode(EN,{modelValue:c.value.configs.filters,"onUpdate:modelValue":M[4]||(M[4]=V=>c.value.configs.filters=V)},null,8,["modelValue"])]),_:1})]),_:1}),o.createElementVNode("div",ZN,[o.createVNode(I,{type:"primary",onClick:f,loading:d.value},{default:o.withCtx(()=>M[9]||(M[9]=[o.createTextVNode("保存")])),_:1},8,["loading"]),c.value.id?(o.openBlock(),o.createBlock(I,{key:0,danger:"",onClick:u,loading:d.value},{default:o.withCtx(()=>M[10]||(M[10]=[o.createTextVNode("发布")])),_:1},8,["loading"])):o.createCommentVNode("",!0),o.createVNode(I,{onClick:h},{default:o.withCtx(()=>M[11]||(M[11]=[o.createTextVNode("返回")])),_:1})])])}}}),[["__scopeId","data-v-3eeab6e6"]]),QN={UnioneEditor:Fi,locales:po,loadConfig:Dt,DataStorage:mo,Convertor:ri,install(r,e){te.loadConfig(e);const t=Dt(e);t.axios&&te.axios.create(t.axios),r.component("UnioneBtn",Nh),r.component("UnioneTabs",Lh),r.component("UnioneSection",wh),r.component("UnioneQuery",Sr),r.component("UnioneTable",Mr),r.component("UnioneRichText",Em),r.component("UnioneFormItem",Gh),r.component("UnioneForm",Qh),r.component("UnioneSelectBox",_h),r.component("UnioneSwitchBox",Ah),r.component("UnioneRadioBox",Jh),r.component("UnioneCheckBox",zh),r.component("UnionePwdBox",$h),r.component("UnionePageEditor",Na),r.component("UnionePageForm",ba),r.component("UnionePageTree",La),r.component("UnionePageList",Oa)}};Me.Convertor=ri,Me.DataStorage=mo,Me.UnioneDataDefineEdit=YN,Me.UnioneDataDefineList=T0,Me.UnioneEditor=Fi,Me.UnionePage=Dn,Me.UnionePageEditor=Na,Me.UnionePageForm=ba,Me.UnionePageList=Oa,Me.UnionePageSetting=En,Me.UnionePageTree=La,Me.UnioneQueryForm=Sr,Me.UnioneTableList=Mr,Me.default=QN,Me.loadConfig=Dt,Me.locales=po,Me.useDebounce=So,Me.utils=mu,Object.defineProperties(Me,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});