(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-604adfe6","chunk-1789ada2","chunk-291a9e54"],{"0893":function(e,t,n){"use strict";n.r(t);n("99af"),n("b0c0");var r=function(){var e=this,t=e._self._c;return t("div",[t("a-card",{staticStyle:{"margin-bottom":"10px"},attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{ref:"queryForm",attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-row",{attrs:{gutter:32}},[t("a-col",{attrs:{span:8}},[t("a-form-item",{attrs:{label:"流程名称"}},[t("a-input",{attrs:{placeholder:"请输入名称","allow-clear":""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery.apply(null,arguments)}},model:{value:e.queryParam.name,callback:function(t){e.$set(e.queryParam,"name",t)},expression:"queryParam.name"}})],1)],1),t("a-col",[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"right"}},[t("a-button",{attrs:{type:"primary"},on:{click:e.handleQuery}},[t("a-icon",{attrs:{type:"search"}}),e._v("查询")],1),t("a-button",{staticStyle:{"margin-left":"8px"},on:{click:e.resetQuery}},[t("a-icon",{attrs:{type:"redo"}}),e._v("重置")],1)],1)])],1)],1)],1)]),t("a-card",{staticClass:"table-card",attrs:{bordered:!1}},[t("el-dialog",{attrs:{title:e.title,visible:e.open,width:"500px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"看看",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入看看"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),t("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1),t("el-dialog",{attrs:{title:e.upload.title,visible:e.upload.open,width:"400px","append-to-body":""},on:{"update:visible":function(t){return e.$set(e.upload,"open",t)}}},[t("el-upload",{ref:"upload",attrs:{limit:1,accept:".xml",headers:e.upload.headers,action:e.upload.url+"?name="+e.upload.name+"&category="+e.upload.category,disabled:e.upload.isUploading,"on-progress":e.handleFileUploadProgress,"on-success":e.handleFileSuccess,"auto-upload":!1,drag:""}},[t("i",{staticClass:"el-icon-upload"}),t("div",{staticClass:"el-upload__text"},[e._v(" 将文件拖到此处，或 "),t("em",[e._v("点击上传")])]),t("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v(" 流程名称："),t("el-input",{model:{value:e.upload.name,callback:function(t){e.$set(e.upload,"name",t)},expression:"upload.name"}}),e._v(" 流程分类："),t("el-input",{model:{value:e.upload.category,callback:function(t){e.$set(e.upload,"category",t)},expression:"upload.category"}})],1),t("div",{staticClass:"el-upload__tip",staticStyle:{color:"red"},attrs:{slot:"tip"},slot:"tip"},[e._v("提示：仅允许导入“bpmn20.xml”格式文件！")])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{type:"primary"},on:{click:e.submitFileForm}},[e._v("确 定")]),t("el-button",{on:{click:function(t){e.upload.open=!1}}},[e._v("取 消")])],1)],1),t("el-dialog",{attrs:{title:e.readImage.title,visible:e.readImage.open,width:"70%","append-to-body":""},on:{"update:visible":function(t){return e.$set(e.readImage,"open",t)}}},[t("flow",{attrs:{xmlData:e.xmlData}})],1),t("el-dialog",{attrs:{title:e.formTitle,visible:e.formConfOpen,width:"50%","append-to-body":""},on:{"update:visible":function(t){e.formConfOpen=t}}},[t("div",{staticClass:"test-form"},[t("parser",{key:(new Date).getTime(),attrs:{"form-conf":e.formConf}})],1)]),t("el-dialog",{attrs:{title:e.formDeployTitle,visible:e.formDeployOpen,width:"60%","append-to-body":""},on:{"update:visible":function(t){e.formDeployOpen=t}}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:10,xs:24}},[t("el-table",{ref:"singleTable",staticStyle:{width:"100%"},attrs:{data:e.formList,border:"","highlight-current-row":""},on:{"current-change":e.handleCurrentChange}},[t("el-table-column",{attrs:{label:"表单编号",align:"center",prop:"formId"}}),t("el-table-column",{attrs:{label:"表单名称",align:"center",prop:"formName"}}),t("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(n){return[t("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){return e.submitFormDeploy(n.row)}}},[e._v("确定")])]}}])})],1),t("pagination",{directives:[{name:"show",rawName:"v-show",value:e.formTotal>0,expression:"formTotal>0"}],attrs:{small:"",layout:"prev, pager, next",total:e.formTotal,page:e.queryParam.pageNum,limit:e.queryParam.pageSize},on:{"update:page":function(t){return e.$set(e.queryParam,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParam,"pageSize",t)},pagination:e.ListFormDeploy}})],1),t("a-col",{attrs:{span:14,xs:24}},[e.currentRow?t("div",[t("parser",{key:(new Date).getTime(),attrs:{"form-conf":e.currentRow}})],1):e._e()])],1)],1),e.arg?t("el-drawer",{attrs:{title:"流程定义",size:"90%","append-to-body":!1,"modal-append-to-body":!1,visible:e.arg},on:{"update:visible":function(t){e.arg=t}}},[t("model",{attrs:{deploymentId:e.deploymentId},on:{ok:e.getList}})],1):e._e(),t("advance-table",{attrs:{title:"流程管理",pagination:{current:e.queryParam.pageNum,pageSize:e.queryParam.pageSize,total:e.total,showSizeChanger:!0,showLessItems:!0,showQuickJumper:!0,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条，总计 ").concat(e," 条")},onChange:e.changeSize,onShowSizeChange:e.onShowSizeChange},tableKey:"base-definition-index-table",rowKey:"id",size:"middle",columns:e.columns,"data-source":e.definitionList,loading:e.loading,"format-conditions":!0,"row-selection":{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},on:{change:e.handleTableChange,refresh:e.getList},scopedSlots:e._u([{key:"name",fn:function(n){var r=n.text,i=n.record;return t("span",{},[t("a",{on:{click:function(t){return e.handleReadImage(i.deploymentId)}}},[e._v(" "+e._s(r)+" ")])])}},{key:"formId",fn:function(n){var r=n.text,i=n.record;return t("span",{},[r?t("a",{on:{click:function(t){return e.handleForm(r)}}},[e._v(" "+e._s(i.formName)+" ")]):t("a",[e._v("无")])])}},{key:"version",fn:function(n){var r=n.text;n.record;return t("span",{},[t("a-tag",{attrs:{color:"blue"}},[e._v("v"+e._s(r))])],1)}},{key:"suspensionState",fn:function(n){var r=n.text;n.record;return t("span",{},[1==r?t("a-tag",{attrs:{color:"green"}},[e._v("激活")]):e._e(),2==r?t("a-tag",{attrs:{color:"orange"}},[e._v("挂起")]):e._e()],1)}},{key:"operation",fn:function(n){n.text;var r=n.record;return t("span",{},[t("a",{on:{click:function(t){return e.handleLoadXml(r)}}},[e._v(" 编辑 ")]),t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:deployment:remove"],expression:"['system:deployment:remove']"}],attrs:{type:"vertical"}}),t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:deployment:remove"],expression:"['system:deployment:remove']"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v(" 删除 ")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-dropdown",[t("a",{staticClass:"ant-dropdown-link",on:{click:function(e){return e.preventDefault()}}},[e._v(" 更多操作"),t("a-icon",{attrs:{type:"down"}})],1),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[null==r.formId?t("a-menu-item",[t("a",{on:{click:function(t){return e.handleAddForm(r)}}},[e._v("配置表单")])]):e._e(),1===r.suspensionState?t("a-menu-item",[t("a",{on:{click:function(t){return e.handleUpdateSuspensionState(r)}}},[e._v("挂起")])]):e._e(),2===r.suspensionState?t("a-menu-item",[t("a",{on:{click:function(t){return e.handleUpdateSuspensionState(r)}}},[e._v("激活")])]):e._e()],1)],1)],1)}}])},[t("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[t("a-button",{attrs:{type:"primary"},on:{click:e.handleImport}},[t("a-icon",{attrs:{type:"import"}}),e._v("导入 ")],1),t("a-button",{on:{click:e.handleLoadXml}},[t("a-icon",{attrs:{type:"plus"}}),e._v("新增 ")],1)],1)])],1)],1)},i=[],o=(n("d81d"),n("b64b"),n("1538")),a=n("5f87"),s=n("b775");function l(e){return Object(s["b"])({url:"/flowable/form/list",method:"get",params:e})}function c(e){return Object(s["b"])({url:"/flowable/form/"+e,method:"get"})}function u(e){return Object(s["b"])({url:"/flowable/form/addDeployForm",method:"post",data:e})}var d=n("589b"),p=n("251b"),f=n("5d9e"),h=(n("8ded"),{name:"Definition",components:{AdvanceTable:f["a"],flow:d["default"],model:p["default"]},data:function(){return{arg:!1,loading:!0,ids:[],selectedRowKeys:[],selectedRows:[],single:!0,multiple:!0,showSearch:!0,total:0,labelCol:{span:6},wrapperCol:{span:18},definitionList:[],title:"",open:!1,formConfOpen:!1,formTitle:"",formDeployOpen:!1,formDeployTitle:"",formList:[],formTotal:0,formConf:{},readImage:{open:!1,src:""},upload:{open:!1,title:"",isUploading:!1,name:null,category:null,headers:{Authorization:"Bearer "+Object(a["a"])()},url:"/flowable/definition/import"},defaultValue:"-/-",queryParam:{pageNum:1,pageSize:10,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},formQueryParams:{pageNum:1,pageSize:10},columns:[{title:"流程编号",dataIndex:"deploymentId",ellipsis:!0,align:"left"},{title:"流程标识",dataIndex:"key",align:"center"},{title:"流程分类",dataIndex:"category",align:"center"},{title:"流程名称",dataIndex:"name",scopedSlots:{customRender:"name"},align:"center"},{title:"业务表单",dataIndex:"formId",scopedSlots:{customRender:"formId"},align:"center"},{title:"流程版本",dataIndex:"version",scopedSlots:{customRender:"version"},align:"center"},{title:"状态",dataIndex:"suspensionState",scopedSlots:{customRender:"suspensionState"},align:"center"},{title:"部署时间",dataIndex:"deploymentTime",align:"center",width:"180"},{title:"操作",dataIndex:"operation",align:"center",width:"200px",scopedSlots:{customRender:"operation"}}],formDeployParam:{formId:null,deployId:null},deploymentId:void 0,currentRow:null,xmlData:"",form:{},rules:{}}},created:function(){this.getList()},activated:function(){this.getList()},methods:{getList:function(){var e=this;this.arg=!1,this.loading=!0,Object(o["g"])(this.queryParam).then((function(t){e.definitionList=t.data.list,e.total=t.data.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={id:null,name:null,category:null,key:null,tenantId:null,deployTime:null,derivedFrom:null,derivedFromRoot:null,parentDeploymentId:null,engineVersion:null},this.resetForm("form")},handleQuery:function(){this.queryParam.pageNum=1,this.getList()},resetQuery:function(){this.queryParam=this.$options.data().queryParam,this.handleQuery()},handleAdd:function(){this.reset(),this.open=!0,this.title="添加流程定义"},handleLoadXml:function(e){this.deploymentId=e.deploymentId,this.$router.push({name:"FlowableDefinitionModel",params:{deploymentId:e.deploymentId}})},handleReadImage:function(e){var t=this;this.readImage.title="流程图",this.readImage.open=!0,Object(o["h"])(e).then((function(e){t.xmlData=e.data}))},handleForm:function(e){var t=this;c(e).then((function(e){t.formTitle="表单详情",t.formConfOpen=!0,t.formConf=JSON.parse(e.data.formContent)}))},handleDefinitionStart:function(e){var t=this;Object(o["b"])(e.id).then((function(e){t.$message.success(e.msg,3)}))},handleAddForm:function(e){this.formDeployParam.deployId=e.deploymentId,this.ListFormDeploy()},ListFormDeploy:function(){var e=this;l(this.formQueryParams).then((function(t){e.formList=t.rows,e.formTotal=t.total,e.formDeployOpen=!0,e.formDeployTitle="挂载表单"}))},submitFormDeploy:function(e){var t=this;this.formDeployParam.formId=e.formId,u(this.formDeployParam).then((function(e){t.getList(),t.formDeployOpen=!1,t.$message.success(e.msg,3)}))},handleCurrentChange:function(e){e&&(this.currentRow=JSON.parse(e.formContent))},handleUpdateSuspensionState:function(e){var t=this,n=1;1===e.suspensionState&&(n=2);var r={deployId:e.deploymentId,state:n};Object(o["m"])(r).then((function(e){t.getList(),t.$message.success(e.msg,3)}))},handleUpdate:function(e){var t=this;this.reset();var n=e.id||this.ids;getDeployment(n).then((function(e){t.form=e.data,t.open=!0,t.title="修改流程定义"}))},submitForm:function(){var e=this,t=this;this.$refs["form"].validate((function(n){n&&(null!=e.form.id?Object(o["l"])(e.form).then((function(e){t.getList(),t.open=!1,t.$message.success("修改成功",3)})):Object(o["a"])(e.form).then((function(e){t.getList(),t.open=!1,t.$message.success("新增成功",3)})))}))},handleDelete:function(e){var t=this,n={deployId:e.deploymentId,procDefId:e.id};this.$confirm({title:"确认删除所选中数据?",onOk:function(){return Object(o["c"])(n).then((function(){t.onSelectChange([],[]),t.getList(),t.$message.success("删除成功",3)}))},onCancel:function(){}})},handleExport:function(){var e=this,t=this.queryParam;this.$elConfirm("是否确认导出所有流程定义数据项?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){return Object(o["d"])(t)})).then((function(t){e.download(t.msg)}))},handleImport:function(){this.upload.title="bpmn20.xml文件导入",this.upload.open=!0},handleFileUploadProgress:function(e,t,n){this.upload.isUploading=!0},handleFileSuccess:function(e,t,n){this.upload.open=!1,this.upload.isUploading=!1,this.$refs.upload.clearFiles(),this.$elMsg(e.msg),this.getList()},submitFileForm:function(){this.$refs.upload.submit()},onSelectChange:function(e,t){this.selectedRowKeys=e,this.selectedRows=t,this.ids=this.selectedRows.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},onShowSizeChange:function(e,t){this.queryParam.pageSize=t,this.getList()},changeSize:function(e,t){this.queryParam.pageNum=e,this.queryParam.pageSize=t,this.getList()},handleTableChange:function(e,t,n){void 0!==n.field&&null!==n.field&&""!==n.field&&(this.queryParam.orderByColumn="a."+n.field,this.queryParam.isAsc=n.order),this.getList()},dataChange:function(e,t){var n=moment(e).format("YYYY-MM-DD");this.queryParam.deployTime=n}}}),m=h,g=n("2877"),v=Object(g["a"])(m,r,i,!1,null,null,null);t["default"]=v.exports},"093d":function(e,t,n){"use strict";n("a1fa")},1538:function(e,t,n){"use strict";n.d(t,"g",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"m",(function(){return s})),n.d(t,"n",(function(){return l})),n.d(t,"i",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"e",(function(){return d})),n.d(t,"j",(function(){return p})),n.d(t,"a",(function(){return f})),n.d(t,"l",(function(){return h})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return g})),n.d(t,"k",(function(){return v}));var r=n("b775");function i(e){return Object(r["b"])({url:"/flowable/definition/list",method:"get",params:e})}function o(e,t){return Object(r["b"])({url:"/flowable/definition/start/"+e,method:"post",data:t})}function a(e){return Object(r["b"])({url:"/flowable/task/processVariables/"+e,method:"get"})}function s(e){return Object(r["b"])({url:"/flowable/definition/updateState/edit",method:"post",params:e})}function l(e){return Object(r["b"])({url:"/flowable/definition/userList",method:"get",params:e})}function c(e){return Object(r["b"])({url:"/flowable/definition/roleList",method:"get",params:e})}function u(e){return Object(r["b"])({url:"/flowable/definition/readXml/"+e,method:"get"})}function d(e){return Object(r["b"])({url:"/flowable/task/flowViewer/"+e,method:"get"})}function p(e){return Object(r["b"])({url:"/flowable/definition/save",method:"post",data:e})}function f(e){return Object(r["b"])({url:"/system/deployment",method:"post",data:e})}function h(e){return Object(r["b"])({url:"/system/deployment/edit",method:"post",data:e})}function m(e){return Object(r["b"])({url:"/flowable/definition/delete/",method:"post",params:e})}function g(e){return Object(r["b"])({url:"/system/deployment/export",method:"get",params:e})}function v(){return Object(r["b"])({url:"/flowable/definition/selectOptionList",method:"get"})}},"251b":function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e._self._c;return t("div",{attrs:{id:"app"}},[t("bpmn-modeler",{ref:"refNode",attrs:{xml:e.xml,"is-view":!1,users:e.users,groups:e.groups,categories:e.categorys,"categories-fields":e.categoriesFields},on:{save:e.save,showXML:e.showXML,dataType:e.dataType}}),t("el-dialog",{attrs:{title:e.xmlTitle,visible:e.xmlOpen,width:"60%","append-to-body":""},on:{"update:visible":function(t){e.xmlOpen=t}}},[t("div",[t("pre",{directives:[{name:"highlight",rawName:"v-highlight"}]},[e._v("           "),t("code",{staticClass:"xml"},[e._v("\n                "+e._s(e.xmlContent)+"\n           ")]),e._v("\n        ")])])])],1)},i=[],o=(n("b0c0"),n("d3b7"),n("159b"),n("1538")),a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"flow-containers",class:{"view-mode":e.isView},staticStyle:{height:"100%"}},[t("a-layout",{staticStyle:{height:"100%"}},[t("a-layout-header",{staticStyle:{"border-bottom":"1px solid rgb(218 218 218)",height:"auto","background-color":"#fff"},attrs:{theme:"light"}},[t("div",{staticStyle:{display:"flex",padding:"5px 0px","justify-content":"space-between"}},[t("a-space",[t("a-upload",{attrs:{name:"file",action:"",accept:"application/xml",showUploadList:!1,beforeUpload:e.openBpmn}},[t("a-tooltip",{attrs:{effect:"dark",title:"打开",placement:"bottom"}},[t("a-button",[t("i",{staticClass:"iconfont icon-file-open"})])],1)],1),t("a-tooltip",{attrs:{effect:"dark",title:"新建",placement:"bottom"}},[t("a-button",{on:{click:e.newDiagram}},[t("i",{staticClass:"iconfont icon-add"})])],1),t("a-tooltip",{attrs:{effect:"dark",title:"自适应屏幕",placement:"bottom"}},[t("a-button",{on:{click:e.fitViewport}},[t("i",{staticClass:"iconfont icon-browse"})])],1),t("a-tooltip",{attrs:{effect:"dark",title:"放大",placement:"bottom"}},[t("a-button",{on:{click:function(t){return e.zoomViewport(!0)}}},[t("i",{staticClass:"iconfont icon-zoom-out"})])],1),t("a-tooltip",{attrs:{effect:"dark",title:"缩小",placement:"bottom"}},[t("a-button",{on:{click:function(t){return e.zoomViewport(!1)}}},[t("i",{staticClass:"iconfont icon-zoom-in"})])],1),t("a-tooltip",{attrs:{effect:"dark",title:"后退",placement:"bottom"}},[t("a-button",{on:{click:function(t){e.modeler.get("commandStack").undo()}}},[t("i",{staticClass:"iconfont icon-left"})])],1),t("a-tooltip",{attrs:{title:"前进",placement:"bottom"}},[t("a-button",{on:{click:function(t){e.modeler.get("commandStack").redo()}}},[t("i",{staticClass:"iconfont icon-right"})])],1),e._t("header-left")],2),t("a-space",[e._t("header-right"),e.rightActionConfig.showCode&&e.rightActionConfig.showCode.show?t("a-button",{on:{click:e.showXML}},[e.rightActionConfig.showCode.icon?t("i",{staticClass:"iconfont icon-browse"}):e._e(),e._v(e._s(e.rightActionConfig.showCode.label)+" ")]):e._e(),e.rightActionConfig.downloadXML&&e.rightActionConfig.downloadXML.show?t("a-button",{on:{click:function(t){return e.saveXML(!0)}}},[e.rightActionConfig.downloadXML.icon?t("i",{staticClass:"iconfont icon-download"}):e._e(),e._v(e._s(e.rightActionConfig.downloadXML.label)+" ")]):e._e(),e.rightActionConfig.downloadSVG&&e.rightActionConfig.downloadSVG.show?t("a-button",{on:{click:function(t){return e.saveImg("svg",!0)}}},[e.rightActionConfig.downloadSVG.icon?t("i",{staticClass:"iconfont icon-download"}):e._e(),e._v(e._s(e.rightActionConfig.downloadSVG.label)+" ")]):e._e(),e.rightActionConfig.save&&e.rightActionConfig.save.show?t("a-button",{attrs:{type:"primary"},on:{click:e.save}},[e.rightActionConfig.save.icon?t("i",{staticClass:"iconfont icon-upload"}):e._e(),e._v(e._s(e.rightActionConfig.save.label)+" ")]):e._e()],2)],1)]),t("a-layout",{staticStyle:{"align-items":"stretch"}},[t("a-layout-content",{staticStyle:{padding:"0","margin-top":"10px"}},[t("div",{ref:"canvas",staticClass:"canvas"})]),t("a-layout-sider",{staticClass:"sider",staticStyle:{background:"#fff","min-width":"40px",width:"40px","max-width":"40px","border-left":"1px solid #eeeeee","box-shadow":"0 0 8px #cccccc"}},[t("div",{staticStyle:{width:"100%","text-align":"center"},on:{click:function(t){e.panelVisible=!0}}},[e.panelExist?t("i",{staticClass:"iconfont icon-left-graph",staticStyle:{"font-size":"32px"}}):e._e()]),t("a-drawer",{attrs:{width:"400px",placement:"right",closable:!1,visible:e.panelVisible&&e.panelExist,"get-container":!1,"wrap-style":{position:"absolute"}}},[t("template",{slot:"title"},[t("i",{staticClass:"iconfont icon-right-graph",staticStyle:{"font-size":"32px"},on:{click:function(t){e.panelVisible=!1}}}),t("span",[e._v(e._s(e.panelTitle))])]),e.modeler?t("panel",{ref:"panel",attrs:{filters:e.panelFilters,modeler:e.modeler,users:e.users,groups:e.groups,categories:e.categories,"categories-fields":e.categoriesFields,"associate-form-config":e.associateFormConfig,"associate-form-data-options":e.associateFormDataOptions,"assignee-data-source":e.assigneeDataSource,"due-date-data-source":e.dueDateDataSource,"follow-up-date-data-source":e.followUpDateDataSource,"initiator-data-source":e.initiatorDataSource,"skip-expression-data-source":e.skipExpressionDataSource,"condition-expression-data-source":e.conditionExpressionDataSource,"candidate-user-data-source":e.candidateUserDataSource,"candidate-group-data-source":e.candidateGroupDataSource},on:{showForm:e.showAssociateForm,createForm:e.createAssociateForm,change:e.handlePanelChange}}):e._e()],2)],1)],1)],1),t("a-modal",{staticStyle:{height:"800px"},attrs:{title:"XML",width:"60%"},scopedSlots:e._u([{key:"footer",fn:function(){},proxy:!0}]),model:{value:e.codeVisible,callback:function(t){e.codeVisible=t},expression:"codeVisible"}},[t("div",{staticClass:"codediv"},[t("codemirror",{attrs:{options:e.options},model:{value:e.xmlCode,callback:function(t){e.xmlCode=t},expression:"xmlCode"}})],1)])],1)},s=[],l=(n("3b18"),n("f64c")),c=n("c7eb"),u=n("1da1"),d=(n("7db0"),n("ac1f"),n("3ca3"),n("5319"),n("498a"),n("ddb0"),n("2b3d"),n("bf19"),n("9861"),{"Activate the global connect tool":"激活全局连接工具","Append {type}":"添加 {type}","Add Lane above":"在上面添加道","Divide into two Lanes":"分割成两个道","Divide into three Lanes":"分割成三个道","Add Lane below":"在下面添加道","Append compensation activity":"追加补偿活动","Change type":"修改类型","Connect using Association":"使用关联连接","Connect using Sequence/MessageFlow or Association":"使用顺序/消息流或者关联连接","Connect using DataInputAssociation":"使用数据输入关联连接",Remove:"移除","Activate the hand tool":"激活抓手工具","Activate the lasso tool":"激活套索工具","Activate the create/remove space tool":"激活创建/删除空间工具","Create expanded SubProcess":"创建扩展子过程","Create IntermediateThrowEvent/BoundaryEvent":"创建中间抛出事件/边界事件","Create Pool/Participant":"创建池/参与者","Parallel Multi Instance":"并行多重事件","Sequential Multi Instance":"时序多重事件",DataObjectReference:"数据对象参考",DataStoreReference:"数据存储参考",Loop:"循环","Ad-hoc":"即席","Create {type}":"创建 {type}",Task:"任务","Send Task":"发送任务","Receive Task":"接收任务","User Task":"用户任务","Manual Task":"手工任务","Business Rule Task":"业务规则任务","Service Task":"服务任务","Script Task":"脚本任务","Call Activity":"调用活动","Sub Process (collapsed)":"子流程（折叠的）","Sub Process (expanded)":"子流程（展开的）","Start Event":"开始事件",StartEvent:"开始事件","Intermediate Throw Event":"中间事件","End Event":"结束事件",EndEvent:"结束事件","Create Gateway":"创建网关","Create Intermediate/Boundary Event":"创建中间/边界事件","Message Start Event":"消息开始事件","Timer Start Event":"定时开始事件","Conditional Start Event":"条件开始事件","Signal Start Event":"信号开始事件","Error Start Event":"错误开始事件","Escalation Start Event":"升级开始事件","Compensation Start Event":"补偿开始事件","Message Start Event (non-interrupting)":"消息开始事件（非中断）","Timer Start Event (non-interrupting)":"定时开始事件（非中断）","Conditional Start Event (non-interrupting)":"条件开始事件（非中断）","Signal Start Event (non-interrupting)":"信号开始事件（非中断）","Escalation Start Event (non-interrupting)":"升级开始事件（非中断）","Message Intermediate Catch Event":"消息中间捕获事件","Message Intermediate Throw Event":"消息中间抛出事件","Timer Intermediate Catch Event":"定时中间捕获事件","Escalation Intermediate Throw Event":"升级中间抛出事件","Conditional Intermediate Catch Event":"条件中间捕获事件","Link Intermediate Catch Event":"链接中间捕获事件","Link Intermediate Throw Event":"链接中间抛出事件","Compensation Intermediate Throw Event":"补偿中间抛出事件","Signal Intermediate Catch Event":"信号中间捕获事件","Signal Intermediate Throw Event":"信号中间抛出事件","Message End Event":"消息结束事件","Escalation End Event":"定时结束事件","Error End Event":"错误结束事件","Cancel End Event":"取消结束事件","Compensation End Event":"补偿结束事件","Signal End Event":"信号结束事件","Terminate End Event":"终止结束事件","Message Boundary Event":"消息边界事件","Message Boundary Event (non-interrupting)":"消息边界事件（非中断）","Timer Boundary Event":"定时边界事件","Timer Boundary Event (non-interrupting)":"定时边界事件（非中断）","Escalation Boundary Event":"升级边界事件","Escalation Boundary Event (non-interrupting)":"升级边界事件（非中断）","Conditional Boundary Event":"条件边界事件","Conditional Boundary Event (non-interrupting)":"条件边界事件（非中断）","Error Boundary Event":"错误边界事件","Cancel Boundary Event":"取消边界事件","Signal Boundary Event":"信号边界事件","Signal Boundary Event (non-interrupting)":"信号边界事件（非中断）","Compensation Boundary Event":"补偿边界事件","Exclusive Gateway":"互斥网关","Parallel Gateway":"并行网关","Inclusive Gateway":"相容网关","Complex Gateway":"复杂网关","Event based Gateway":"事件网关",Transaction:"转运","Sub Process":"子流程","Event Sub Process":"事件子流程","Collapsed Pool":"折叠池","Expanded Pool":"展开池","no parent for {element} in {parent}":"在{parent}里，{element}没有父类","no shape type specified":"没有指定的形状类型","flow elements must be children of pools/participants":"流元素必须是池/参与者的子类","out of bounds release":"out of bounds release","more than {count} child lanes":"子道大于{count} ","element required":"元素不能为空","diagram not part of bpmn:Definitions":"流程图不符合bpmn规范","no diagram to display":"没有可展示的流程图","no process or collaboration to display":"没有可展示的流程/协作","element {element} referenced by {referenced}#{property} not yet drawn":"由{referenced}#{property}引用的{element}元素仍未绘制","already rendered {element}":"{element} 已被渲染","failed to import {element}":"导入{element}失败",Id:"标识",Name:"名称",General:"常规",Details:"详情","Message Name":"消息名称",Message:"消息",Initiator:"创建者","Asynchronous Continuations":"持续异步","Asynchronous Before":"异步前","Asynchronous After":"异步后","Job Configuration":"工作配置",Exclusive:"排除","Job Priority":"工作优先级","Retry Time Cycle":"重试时间周期",Documentation:"文档","Element Documentation":"元素文档","History Configuration":"历史配置","History Time To Live":"历史的生存时间",Forms:"表单","Form Key":"表单key","Form Fields":"表单字段","Business Key":"业务key","Form Field":"表单字段",ID:"编号",Type:"类型",Label:"名称","Default Value":"默认值",Validation:"校验","Add Constraint":"添加约束",Config:"配置",Properties:"属性","Add Property":"添加属性",Value:"值",Listeners:"监听器","Execution Listener":"执行监听","Event Type":"事件类型","Listener Type":"监听器类型","Java Class":"Java类",Expression:"表达式","Must provide a value":"必须提供一个值","Delegate Expression":"代理表达式",Script:"脚本","Script Format":"脚本格式","Script Type":"脚本类型","Inline Script":"内联脚本","External Script":"外部脚本",Resource:"资源","Field Injection":"字段注入",Extensions:"扩展","Input/Output":"输入/输出","Input Parameters":"输入参数","Output Parameters":"输出参数",Parameters:"参数","Output Parameter":"输出参数","Timer Definition Type":"定时器定义类型","Timer Definition":"定时器定义",Date:"日期",Duration:"持续",Cycle:"循环",Signal:"信号","Signal Name":"信号名称",Escalation:"升级",Error:"错误","Link Name":"链接名称",Condition:"条件名称","Variable Name":"变量名称","Variable Event":"变量事件","Specify more than one variable change event as a comma separated list.":"多个变量事件以逗号隔开","Wait for Completion":"等待完成","Activity Ref":"活动参考","Version Tag":"版本标签",Executable:"可执行文件","External Task Configuration":"扩展任务配置","Task Priority":"任务优先级",External:"外部",Connector:"连接器","Must configure Connector":"必须配置连接器","Connector Id":"连接器编号",Implementation:"实现方式","Field Injections":"字段注入",Fields:"字段","Result Variable":"结果变量",Topic:"主题","Configure Connector":"配置连接器","Input Parameter":"输入参数",Assignee:"代理人","Candidate Users":"候选用户","Candidate Groups":"候选组","Due Date":"到期时间","Follow Up Date":"跟踪日期",Priority:"优先级","The follow up date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式，如： ${someDate} ,或者一个ISO标准日期，如：2015-06-26T09:54:00","The due date as an EL expression (e.g. ${someDate} or an ISO date (e.g. 2015-06-26T09:54:00)":"跟踪日期必须符合EL表达式，如： ${someDate} ,或者一个ISO标准日期，如：2015-06-26T09:54:00",Variables:"变量"}),p={"bpmn:Process":"流程","bpmn:SubProcess":"子流程","bpmn:CallActivity":"调用活动","bpmn:StartEvent":"开始事件","bpmn:IntermediateThrowEvent":"中间事件","bpmn:Task":"任务","bpmn:SendTask":"发送任务","bpmn:ReceiveTask":"接收任务","bpmn:UserTask":"用户任务","bpmn:ManualTask":"手工任务","bpmn:BusinessRuleTask":"业务规则任务","bpmn:ServiceTask":"服务任务","bpmn:ScriptTask":"脚本任务","bpmn:EndEvent":"结束事件","bpmn:SequenceFlow":"流程线","bpmn:ExclusiveGateway":"互斥网关","bpmn:ParallelGateway":"并行网关","bpmn:InclusiveGateway":"相容网关","bpmn:ComplexGateway":"复杂网关","bpmn:EventBasedGateway":"事件网关"};function f(e,t){return t=t||{},e=d[e]||e,e.replace(/{([^}]+)}/g,(function(e,n){var r=t[n];return null!==d[t[n]]&&"undefined"!==d[t[n]]&&(r=d[t[n]]),r||"{"+n+"}"}))}var h=n("7024"),m=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.getComponent,expression:"getComponent"}],ref:"propertyPanel",staticClass:"property-panel"},[e.nodeName?t("div",{staticStyle:{display:"none"}},[e._v(e._s(e.nodeName))]):e._e(),e.element?t(e.getComponent,{tag:"component",attrs:{filters:e.filters,element:e.element,modeler:e.modeler,users:e.users,groups:e.groups,categories:e.categories,"categories-fields":e.categoriesFields,"associate-form-config":e.associateFormConfig,"associate-form-data-options":e.associateFormDataOptions,"assignee-data-source":e.assigneeDataSource,"due-date-data-source":e.dueDateDataSource,"follow-up-date-data-source":e.followUpDateDataSource,"initiator-data-source":e.initiatorDataSource,"skip-expression-data-source":e.skipExpressionDataSource,"condition-expression-data-source":e.conditionExpressionDataSource,"candidate-user-data-source":e.candidateUserDataSource,"candidate-group-data-source":e.candidateGroupDataSource},on:{showForm:e.showAssociateForm,createForm:e.createAssociateForm}}):e._e()],1)},g=[],v=(n("caad"),n("4de4"),function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:8,offset:0},"wrapper-col":{span:14,offset:0},layout:"horizontal"}},[t("a-form-model-item",{attrs:{label:"节点ID",prop:"id"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入节点ID","allow-clear":""},model:{value:e.formData.id,callback:function(t){e.$set(e.formData,"id",t)},expression:"formData.id"}})],1),t("a-form-model-item",{attrs:{label:"节点名称",prop:"name"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入节点名称","allow-clear":""},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),e.filter("nodeDocumentation")?e._e():t("a-form-model-item",{attrs:{label:"节点描述",prop:"documentation"}},[t("a-textarea",{style:{width:"100%"},attrs:{placeholder:"请输入节点描述","auto-size":{minRows:1,maxRows:2},"allow-clear":""},model:{value:e.formData.documentation,callback:function(t){e.$set(e.formData,"documentation",t)},expression:"formData.documentation"}})],1),e.filter("executionListener")?e._e():t("a-form-model-item",{attrs:{label:"执行监听器",prop:"executionListener"}},[t("a-badge",{attrs:{count:e.getExecutionListenerLength}},[t("a-button",{attrs:{type:"default"},on:{click:e.handleShowExecutionListener}},[e._v(" 编辑 ")])],1)],1),e.filter("taskListener")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.taskListener,expression:"!!showConfig.taskListener"}],attrs:{label:"任务监听器",prop:"taskListener"}},[t("a-badge",{attrs:{count:e.computedTaskListenerLength}},[t("a-button",{attrs:{type:"default"},on:{click:function(t){e.taskListenerVisible=!0}}},[e._v(" 编辑 ")])],1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.userType,expression:"!!showConfig.userType"}],attrs:{label:"分配",prop:"userType"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请选择人员类型","allow-clear":""},on:{change:e.handleUserTypeChange},model:{value:e.formData.userType,callback:function(t){e.$set(e.formData,"userType",t)},expression:"formData.userType"}},e._l(e.userTypeOptions,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.value,disabled:n.disabled}},[e._v(e._s(n.label))])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.dataType&&"initiator"!==e.formData.userType,expression:"!!showConfig.dataType && formData.userType !== 'initiator'"}],attrs:{label:"指定方式",prop:"dataType"}},[t("a-radio-group",{on:{change:e.handleClearAssignee},model:{value:e.formData.dataType,callback:function(t){e.$set(e.formData,"dataType",t)},expression:"formData.dataType"}},[t("a-radio-button",{attrs:{value:"fixed"}},[e._v(" 固定 ")]),t("a-radio-button",{attrs:{value:"dynamic"}},[e._v(" 动态 ")])],1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.assignee&&e.formData.dataType&&"fixed"==e.formData.dataType&&"assignee"===e.formData.userType,expression:"!!showConfig.assignee &&formData.dataType && formData.dataType =='fixed' && formData.userType === 'assignee'"}],attrs:{label:"指定人员",prop:"assignee"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请委派指定人员","allow-clear":""},model:{value:e.formData.assignee,callback:function(t){e.$set(e.formData,"assignee",t)},expression:"formData.assignee"}},e._l(e.users,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.id,disabled:n.disabled}},[e._v(e._s(n.name))])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.assignee&&e.formData.dataType&&"dynamic"==e.formData.dataType&&"assignee"===e.formData.userType,expression:"!!showConfig.assignee &&formData.dataType && formData.dataType =='dynamic' && formData.userType === 'assignee'"}],attrs:{label:"指定人员",prop:"assignee"}},[t("a-auto-complete",{attrs:{placeholder:"指定人员表达式","data-source":e.assigneeDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.assignee,callback:function(t){e.$set(e.formData,"assignee",t)},expression:"formData.assignee"}})],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.candidateUsers&&"candidateUsers"===e.formData.userType&&"fixed"==e.formData.dataType,expression:"!!showConfig.candidateUsers && formData.userType === 'candidateUsers'&& formData.dataType =='fixed'"}],attrs:{label:"候选人员",prop:"candidateUsers"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请选择候选人员",mode:"multiple","allow-clear":""},model:{value:e.formData.candidateUsers,callback:function(t){e.$set(e.formData,"candidateUsers",t)},expression:"formData.candidateUsers"}},e._l(e.users,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.id,disabled:n.disabled}},[e._v(e._s(n.name))])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.candidateUsers&&e.formData.dataType&&"dynamic"==e.formData.dataType&&"candidateUsers"===e.formData.userType,expression:"!!showConfig.candidateUsers &&formData.dataType && formData.dataType =='dynamic' && formData.userType === 'candidateUsers'"}],attrs:{label:"候选人员",prop:"candidateUsers"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{mode:"tags","token-separators":[","],placeholder:"候选人员表达式"},model:{value:e.formData.candidateUsers,callback:function(t){e.$set(e.formData,"candidateUsers",t)},expression:"formData.candidateUsers"}},e._l(e.candidateUserDataSource,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n}},[e._v(" "+e._s(n)+" ")])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.candidateGroups&&"candidateGroups"===e.formData.userType&&"fixed"==e.formData.dataType,expression:"!!showConfig.candidateGroups && formData.userType === 'candidateGroups'&& formData.dataType =='fixed'"}],attrs:{label:"候选组",prop:"candidateGroups"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请选择候选组",mode:"multiple","allow-clear":""},model:{value:e.formData.candidateGroups,callback:function(t){e.$set(e.formData,"candidateGroups",t)},expression:"formData.candidateGroups"}},e._l(e.groups,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.id,disabled:n.disabled}},[e._v(e._s(n.name))])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.candidateGroups&&e.formData.dataType&&"dynamic"==e.formData.dataType&&"candidateGroups"===e.formData.userType,expression:"!!showConfig.candidateGroups &&formData.dataType && formData.dataType =='dynamic' && formData.userType === 'candidateGroups'"}],attrs:{label:"候选组",prop:"candidateGroups"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{mode:"tags","token-separators":[","],placeholder:"候选组表达式"},model:{value:e.formData.candidateGroups,callback:function(t){e.$set(e.formData,"candidateGroups",t)},expression:"formData.candidateGroups"}},e._l(e.candidateGroupDataSource,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n}},[e._v(" "+e._s(n)+" ")])})),1)],1),e.filter("multiInstance")?e._e():t("a-form-model-item",{attrs:{label:"多实例",prop:"multiInstance"}},[this.element.businessObject.loopCharacteristics?t("a-badge",[t("i",{staticClass:"iconfont icon-spot",staticStyle:{color:"#f5222d"},attrs:{slot:"count"},slot:"count"}),t("a-button",{attrs:{type:"default"},on:{click:function(t){e.multiInstanceVisible=!0}}},[e._v(" 编辑 ")])],1):t("a-button",{attrs:{type:"default"},on:{click:function(t){e.multiInstanceVisible=!0}}},[e._v(" 编辑 ")])],1),e.filter("async")?e._e():t("a-form-model-item",{attrs:{label:"异步",prop:"async"}},[t("a-switch",{model:{value:e.formData.async,callback:function(t){e.$set(e.formData,"async",t)},expression:"formData.async"}})],1),e.filter("priority")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.priority,expression:"!!showConfig.priority"}],attrs:{label:"优先级",prop:"priority"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入优先级","allow-clear":""},model:{value:e.formData.priority,callback:function(t){e.$set(e.formData,"priority",t)},expression:"formData.priority"}})],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&!1===e.associateFormConfig.enable,expression:"!!showConfig.formKey && associateFormConfig.enable === false"}],attrs:{label:"表单标识",prop:"formKey"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入表单标识","allow-clear":""},model:{value:e.formData.formKey,callback:function(t){e.$set(e.formData,"formKey",t)},expression:"formData.formKey"}})],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&e.associateFormConfig.enable,expression:"!!showConfig.formKey && associateFormConfig.enable"}],attrs:{label:"表单挂载",prop:"formKey"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请选择表单","allow-clear":""},model:{value:e.formData.formKey,callback:function(t){e.$set(e.formData,"formKey",t)},expression:"formData.formKey"}},e._l(e.associateFormDataOptions,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.value,disabled:n.disabled}},[e._v(e._s(n.name))])})),1)],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&e.associateFormConfig.enable&&(e.associateFormConfig.isPreview||e.associateFormConfig.isCreate),expression:"!!showConfig.formKey && associateFormConfig.enable && (associateFormConfig.isPreview || associateFormConfig.isCreate)"}],attrs:{label:" ",colon:!1}},[t("a-space",[e.associateFormConfig.isPreview?t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.showAssociateForm(e.formData.formKey)}}},[e._v(" 查看表单 ")]):e._e(),e.associateFormConfig.isCreate?t("a-button",{attrs:{type:"primary"},on:{click:e.createAssociateForm}},[e._v(" 创建表单 ")]):e._e()],1)],1),e.filter("skipExpression")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.skipExpression,expression:"!!showConfig.skipExpression"}],attrs:{label:"跳过条件",prop:"skipExpression"}},[t("a-auto-complete",{attrs:{placeholder:"跳过条件表达式","data-source":e.skipExpressionDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.skipExpression,callback:function(t){e.$set(e.formData,"skipExpression",t)},expression:"formData.skipExpression"}})],1),e.filter("isForCompensation")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.isForCompensation,expression:"!!showConfig.isForCompensation"}],attrs:{label:"是否为补偿",prop:"isForCompensation"}},[t("a-switch",{model:{value:e.formData.isForCompensation,callback:function(t){e.$set(e.formData,"isForCompensation",t)},expression:"formData.isForCompensation"}})],1),e.filter("triggerable")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.triggerable,expression:"!!showConfig.triggerable"}],attrs:{label:"服务任务可触发",prop:"triggerable"}},[t("a-switch",{model:{value:e.formData.triggerable,callback:function(t){e.$set(e.formData,"triggerable",t)},expression:"formData.triggerable"}})],1),e.filter("autoStoreVariables")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.autoStoreVariables,expression:"!!showConfig.autoStoreVariables"}],attrs:{label:"自动存储变量",prop:"autoStoreVariables"}},[t("a-switch",{model:{value:e.formData.autoStoreVariables,callback:function(t){e.$set(e.formData,"autoStoreVariables",t)},expression:"formData.autoStoreVariables"}})],1),e.filter("exclude")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.exclude,expression:"!!showConfig.exclude"}],attrs:{label:"排除",prop:"exclude"}},[t("a-switch",{model:{value:e.formData.exclude,callback:function(t){e.$set(e.formData,"exclude",t)},expression:"formData.exclude"}})],1),e.filter("ruleVariablesInput")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.ruleVariablesInput,expression:"!!showConfig.ruleVariablesInput"}],attrs:{label:"输入变量",prop:"ruleVariablesInput"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入变量","allow-clear":""},model:{value:e.formData.ruleVariablesInput,callback:function(t){e.$set(e.formData,"ruleVariablesInput",t)},expression:"formData.ruleVariablesInput"}})],1),e.filter("")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.rules,expression:"!!showConfig.rules"}],attrs:{label:"规则",prop:"rules"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入规则","allow-clear":""},model:{value:e.formData.rules,callback:function(t){e.$set(e.formData,"rules",t)},expression:"formData.rules"}})],1),e.filter("resultVariable")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.resultVariable,expression:"!!showConfig.resultVariable"}],attrs:{label:"结果变量",prop:"resultVariable"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入结果变量","allow-clear":""},model:{value:e.formData.resultVariable,callback:function(t){e.$set(e.formData,"resultVariable",t)},expression:"formData.resultVariable"}})],1),e.filter("class")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.class,expression:"!!showConfig.class"}],attrs:{label:"类",prop:"class"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入类","allow-clear":""},model:{value:e.formData.class,callback:function(t){e.$set(e.formData,"class",t)},expression:"formData.class"}})],1),e.filter("dueDate")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.dueDate,expression:"!!showConfig.dueDate"}],attrs:{label:"过期时间",prop:"dueDate"}},[t("a-auto-complete",{attrs:{placeholder:"过期时间表达式","data-source":e.dueDateDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.dueDate,callback:function(t){e.$set(e.formData,"dueDate",t)},expression:"formData.dueDate"}})],1),e.filter("followUpDate")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.followUpDate,expression:"!!showConfig.followUpDate"}],attrs:{label:"观察时间",prop:"followUpDate"}},[t("a-auto-complete",{attrs:{placeholder:"观察时间表达式","data-source":e.followUpDateDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.followUpDate,callback:function(t){e.$set(e.formData,"followUpDate",t)},expression:"formData.followUpDate"}})],1)],1),t("a-modal",{attrs:{title:"执行监听器",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleExecutionListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.executionListenerVisible,callback:function(t){e.executionListenerVisible=t},expression:"executionListenerVisible"}},[t("executionListener",{ref:"executionListener",attrs:{element:e.element,modeler:e.modeler}})],1),t("a-modal",{attrs:{title:"任务监听器",width:"600px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleTaskListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.taskListenerVisible,callback:function(t){e.taskListenerVisible=t},expression:"taskListenerVisible"}},[t("taskListener",{ref:"taskListener",attrs:{element:e.element,modeler:e.modeler}})],1),t("a-modal",{attrs:{title:"多实例",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleMultiInstance}},[e._v("确定")]),t("a-button",{attrs:{type:"primary"},on:{click:e.handleClearMultiInstance}},[e._v("清空")])]},proxy:!0}]),model:{value:e.multiInstanceVisible,callback:function(t){e.multiInstanceVisible=t},expression:"multiInstanceVisible"}},[t("multiInstance",{ref:"multiInstance",attrs:{element:e.element,modeler:e.modeler}})],1)],1)}),y=[],b=(n("cd17"),n("ed3b")),w=(n("a15b"),{"bpmn:EndEvent":{},"bpmn:StartEvent":{initiator:!0,formKey:!0},"bpmn:SequenceFlow":{skipExpression:!0,conditionExpression:!0},"bpmn:UserTask":{userType:!0,dataType:!0,assignee:!0,candidateUsers:!0,candidateGroups:!0,async:!0,priority:!0,formKey:!0,skipExpression:!0,dueDate:!0,followUpDate:!0,taskListener:!0},"bpmn:ServiceTask":{async:!0,skipExpression:!0,isForCompensation:!0,triggerable:!0,class:!0},"bpmn:ScriptTask":{async:!0,isForCompensation:!0,resultVariable:!0,autoStoreVariables:!0},"bpmn:ManualTask":{async:!0,isForCompensation:!0},"bpmn:ReceiveTask":{async:!0,isForCompensation:!0},"bpmn:SendTask":{async:!0,isForCompensation:!0},"bpmn:BusinessRuleTask":{async:!0,isForCompensation:!0,ruleVariablesInput:!0,rules:!0,resultVariable:!0,exclude:!0}}),x={props:{filters:{type:Array,default:function(){return[]}},associateFormConfig:{type:Object,default:function(){return{enable:!1,isPreview:!0,isCreate:!0}}},associateFormDataOptions:{type:Array,default:function(){return[]}},modeler:{type:Object,required:!0},element:{type:Object,required:!0},categories:{type:Array,default:function(){return[]}},skipExpressionDataSource:{type:Array,default:function(){return[]}},conditionExpressionDataSource:{type:Array,default:function(){return[]}}},watch:{"formData.id":function(e){this.updateProperties({id:e})},"formData.name":function(e){this.updateProperties({name:e})},"formData.documentation":function(e){if(e){var t=this.modeler.get("moddle").create("bpmn:Documentation",{text:e});this.updateProperties({documentation:[t]})}else this.updateProperties({documentation:[]})}},methods:{updateProperties:function(e){var t=this.modeler.get("modeling");t.updateProperties(this.element,e)},getSignalElements:function(){var e=[];return this.rootElements=this.modeler.getDefinitions().rootElements,this.rootElements.length>0&&this.rootElements.forEach((function(t){"bpmn:Signal"===t.$type&&e.push(t)})),e},getSignalElementIds:function(){var e=[];return this.rootElements=this.modeler.getDefinitions().rootElements,this.rootElements.length>0&&this.rootElements.forEach((function(t){"bpmn:Signal"===t.$type&&e.push(t.id)})),e},getMessageElements:function(){var e=[];return this.rootElements=this.modeler.getDefinitions().rootElements,this.rootElements.length>0&&this.rootElements.forEach((function(t){"bpmn:Message"===t.$type&&e.push(t)})),e},getMessageElementIds:function(){var e=[];return this.rootElements=this.modeler.getDefinitions().rootElements,this.rootElements.length>0&&this.rootElements.forEach((function(t){"bpmn:Message"===t.$type&&e.push(t.id)})),e},filter:function(e){return-1!==this.filters.indexOf(e)},showAssociateForm:function(e){this.$emit("showForm",e)},createAssociateForm:function(){this.$emit("createForm")}},computed:{elementType:function(){var e=this.element.businessObject;return e.eventDefinitions?e.eventDefinitions[0].$type:e.$type},showConfig:function(){return w[this.elementType]||{}}}},C=function(){var e=this,t=e._self._c;return t("div",[t("a-button",{staticClass:"editable-add-btn",staticStyle:{"margin-bottom":"8px"},attrs:{type:"primary"},on:{click:e.handleEditableAdd}},[e._v("新增")]),t("a-table",{attrs:{rowKey:function(e,t){return t},dataSource:e.formData.executionListener,columns:e.columns},scopedSlots:e._u([{key:"event",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.event,callback:function(t){e.$set(r,"event",t)},expression:"record.event"}},[t("a-select-option",{attrs:{value:"start"}},[e._v(" Start ")]),t("a-select-option",{attrs:{value:"end"}},[e._v(" End ")]),t("a-select-option",{attrs:{value:"take"}},[e._v(" Take ")])],1)]}},{key:"type",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.type,callback:function(t){e.$set(r,"type",t)},expression:"record.type"}},[t("a-select-option",{attrs:{value:"class"}},[e._v(" 类 ")]),t("a-select-option",{attrs:{value:"expression"}},[e._v(" 表达式 ")]),t("a-select-option",{attrs:{value:"delegateExpression"}},[e._v(" 委托表达式 ")])],1)]}},{key:"className",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入类名"},model:{value:r.className,callback:function(t){e.$set(r,"className",t)},expression:"record.className"}})]}},{key:"params",fn:function(n,r,i){return[t("a-badge",{attrs:{count:n?n.length:0}},[t("a-button",{on:{click:function(t){return e.configParam(i)}}},[e._v("配置")])],1)]}},{key:"action",fn:function(n,r,i){return[t("a-popconfirm",{attrs:{title:"是否删除?"},on:{confirm:function(){return e.onDelete(i)}}},[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])]}}])}),t("a-modal",{attrs:{title:"监听器参数",width:"700px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleListenerParam}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.listenerParamVisible,callback:function(t){e.listenerParamVisible=t},expression:"listenerParamVisible"}},[t("listenerParam",{ref:"listenerParam",attrs:{list:e.formData.executionListener.length>0&&null!==e.nowIndex?e.formData.executionListener[e.nowIndex].params:[]}})],1)],1)},S=[],k=(n("d81d"),n("a434"),function(){var e=this,t=e._self._c;return t("div",[t("a-button",{staticClass:"editable-add-btn",staticStyle:{"margin-bottom":"8px"},attrs:{type:"primary"},on:{click:e.handleParamEditableAdd}},[e._v("新增")]),t("a-table",{attrs:{rowKey:function(e,t){return t},dataSource:e.list,columns:e.columns},scopedSlots:e._u([{key:"type",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.type,callback:function(t){e.$set(r,"type",t)},expression:"record.type"}},[t("a-select-option",{attrs:{value:"stringValue"}},[e._v(" 字符串 ")]),t("a-select-option",{attrs:{value:"expression"}},[e._v(" 表达式 ")])],1)]}},{key:"name",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入名称"},model:{value:r.name,callback:function(t){e.$set(r,"name",t)},expression:"record.name"}})]}},{key:"value",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入值"},model:{value:r.value,callback:function(t){e.$set(r,"value",t)},expression:"record.value"}})]}},{key:"action",fn:function(n,r,i){return[t("a-popconfirm",{attrs:{title:"是否删除?"},on:{confirm:function(){return e.onParamDelete(i)}}},[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])]}}])})],1)}),D=[],L={props:{list:{type:Array,default:function(){return[]}}},data:function(){return{columns:[{title:"类型",dataIndex:"type",key:"type",scopedSlots:{customRender:"type"}},{title:"名称",dataIndex:"name",key:"name",scopedSlots:{customRender:"name"}},{title:"值",dataIndex:"value",key:"value",scopedSlots:{customRender:"value"}},{title:"操作",dataIndex:"action",key:"action",scopedSlots:{customRender:"action"}}]}},computed:{},methods:{onParamDelete:function(e){this.list.splice(e,1)},handleParamEditableAdd:function(){this.list.push({name:"",type:"stringValue",value:""})},getParams:function(){if(void 0===this.list||0===this.list.length)return[];var e=!0;return this.list.forEach((function(t){""!==t.name&&""!==t.value||(e=!1)})),e?this.list:void 0}}},T=L,E=(n("2aaf"),n("2877")),A=Object(E["a"])(T,k,D,!1,null,"7a5dbd82",null),M=A.exports,O={components:{listenerParam:M},mixins:[x],data:function(){return{listenerParamVisible:!1,nowIndex:null,formData:{executionListener:[]},columns:[{title:"事件",dataIndex:"event",key:"event",scopedSlots:{customRender:"event"}},{title:"类型",dataIndex:"type",key:"type",scopedSlots:{customRender:"type"}},{title:"类名",dataIndex:"className",key:"className",scopedSlots:{customRender:"className"}},{title:"参数",dataIndex:"params",key:"params",scopedSlots:{customRender:"params"}},{title:"操作",dataIndex:"action",key:"action",scopedSlots:{customRender:"action"}}]}},computed:{},mounted:function(){var e,t;this.formData.executionListener=null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t?void 0:t.values.filter((function(e){return"flowable:ExecutionListener"===e.$type})).map((function(e){var t,n,r;return"class"in e&&(r="class"),"expression"in e&&(r="expression"),"delegateExpression"in e&&(r="delegateExpression"),{event:e.event,type:r,className:e[r],params:null!==(t=null===(n=e.fields)||void 0===n?void 0:n.map((function(e){var t;return"stringValue"in e&&(t="stringValue"),"expression"in e&&(t="expression"),{name:e.name,type:t,value:e[t]}})))&&void 0!==t?t:[]}})))&&void 0!==e?e:[]},methods:{onDelete:function(e){this.formData.executionListener.splice(e,1)},handleEditableAdd:function(){this.formData.executionListener.push({event:"start",className:"",type:"class",params:[]})},handleListenerParam:function(){if(null!==this.nowIndex){var e=this.$refs.listenerParam.getParams();void 0===e?l["a"].error("请填写完整"):(this.formData.executionListener[this.nowIndex].params=e,this.listenerParamVisible=!1)}},configParam:function(e){this.nowIndex=e;var t=this.formData.executionListener[e];t.params||(t.params=[]),this.listenerParamVisible=!0},updateElement:function(){var e,t=this;if(null!==(e=this.formData.executionListener)&&void 0!==e&&e.length){var n,r,i=this.element.businessObject.get("extensionElements");i||(i=this.modeler.get("moddle").create("bpmn:ExtensionElements")),i.values=null!==(n=null===(r=i.values)||void 0===r?void 0:r.filter((function(e){return"flowable:ExecutionListener"!==e.$type})))&&void 0!==n?n:[],this.formData.executionListener.forEach((function(e){var n=t.modeler.get("moddle").create("flowable:ExecutionListener");n["event"]=e.event,n[e.type]=e.className,e.params&&e.params.length&&e.params.forEach((function(e){var r=t.modeler.get("moddle").create("flowable:Field");r["name"]=e.name,r[e.type]=e.value,n.get("fields").push(r)})),i.get("values").push(n)})),this.updateProperties({extensionElements:i})}else{var o,a,s=this.element.businessObject["extensionElements"];if(s)s.values=null!==(o=null===(a=s.values)||void 0===a?void 0:a.filter((function(e){return"flowable:ExecutionListener"!==e.$type})))&&void 0!==o?o:[]}},closeDialog:function(){var e=!0;return this.formData.executionListener.forEach((function(t){(!t.className||""===t.className||t.className.length<=0)&&(e=!1)})),e&&this.updateElement(),e}}},N=O,I=(n("093d"),Object(E["a"])(N,C,S,!1,null,"7775e741",null)),P=I.exports,F={components:{executionListener:P},data:function(){return{executionListenerVisible:!1,executionListenerLength:0,dialogName:null}},methods:{computedExecutionListenerLength:function(){var e,t;this.executionListenerLength=null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)&&void 0!==e?e:0},getExecutionListenerLength:function(){var e,t;return null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)&&void 0!==e?e:0},handleExecutionListener:function(){var e=this.$refs.executionListener.closeDialog();e?(this.computedExecutionListenerLength(),this.executionListenerVisible=!1):l["a"].error("请补充信息")},handleShowExecutionListener:function(){this.executionListenerVisible=!0}}},_=function(){var e=this,t=e._self._c;return t("div",[t("a-button",{staticClass:"editable-add-btn",staticStyle:{"margin-bottom":"8px"},attrs:{type:"primary"},on:{click:e.handleEditableAdd}},[e._v("新增")]),t("a-table",{attrs:{rowKey:function(e,t){return t},dataSource:e.formData.taskListener,columns:e.columns},scopedSlots:e._u([{key:"event",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.event,callback:function(t){e.$set(r,"event",t)},expression:"record.event"}},[t("a-select-option",{attrs:{value:"create"}},[e._v(" Create ")]),t("a-select-option",{attrs:{value:"assignment"}},[e._v(" Assignment ")]),t("a-select-option",{attrs:{value:"complete"}},[e._v(" Complete ")]),t("a-select-option",{attrs:{value:"delete"}},[e._v(" Delete ")])],1)]}},{key:"type",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.type,callback:function(t){e.$set(r,"type",t)},expression:"record.type"}},[t("a-select-option",{attrs:{value:"class"}},[e._v(" 类 ")]),t("a-select-option",{attrs:{value:"expression"}},[e._v(" 表达式 ")]),t("a-select-option",{attrs:{value:"delegateExpression"}},[e._v(" 委托表达式 ")])],1)]}},{key:"className",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入类名"},model:{value:r.className,callback:function(t){e.$set(r,"className",t)},expression:"record.className"}})]}},{key:"params",fn:function(n,r,i){return[t("a-badge",{attrs:{count:n?n.length:0}},[t("a-button",{on:{click:function(t){return e.configParam(i)}}},[e._v("配置")])],1)]}},{key:"action",fn:function(n,r,i){return[t("a-popconfirm",{attrs:{title:"是否删除?"},on:{confirm:function(){return e.onDelete(i)}}},[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])]}}])}),t("a-modal",{attrs:{title:"监听器参数",width:"700px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleListenerParam}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.listenerParamVisible,callback:function(t){e.listenerParamVisible=t},expression:"listenerParamVisible"}},[t("listenerParam",{ref:"listenerParam",attrs:{list:e.formData.taskListener.length>0&&null!==e.nowIndex?e.formData.taskListener[e.nowIndex].params:[]}})],1)],1)},R=[],W={components:{listenerParam:M},mixins:[x],data:function(){return{dialogVisible:!0,listenerParamVisible:!1,nowIndex:null,formData:{taskListener:[]},columns:[{title:"事件",dataIndex:"event",key:"event",scopedSlots:{customRender:"event"}},{title:"类型",dataIndex:"type",key:"type",scopedSlots:{customRender:"type"}},{title:"类名",dataIndex:"className",key:"className",scopedSlots:{customRender:"className"}},{title:"参数",dataIndex:"params",key:"params",scopedSlots:{customRender:"params"}},{title:"操作",dataIndex:"action",key:"action",scopedSlots:{customRender:"action"}}]}},computed:{},mounted:function(){var e,t;this.formData.taskListener=null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t?void 0:t.values.filter((function(e){return"flowable:TaskListener"===e.$type})).map((function(e){var t,n,r;return"class"in e&&(r="class"),"expression"in e&&(r="expression"),"delegateExpression"in e&&(r="delegateExpression"),{event:e.event,type:r,className:e[r],params:null!==(t=null===(n=e.fields)||void 0===n?void 0:n.map((function(e){var t;return"stringValue"in e&&(t="stringValue"),"expression"in e&&(t="expression"),{name:e.name,type:t,value:e[t]}})))&&void 0!==t?t:[]}})))&&void 0!==e?e:[]},methods:{onDelete:function(e){this.formData.taskListener.splice(e,1)},handleEditableAdd:function(){this.formData.taskListener.push({event:"create",className:"",type:"class",params:[]})},configParam:function(e){this.nowIndex=e;var t=this.formData.taskListener[e];t.params||(t.params=[]),this.listenerParamVisible=!0},handleListenerParam:function(){if(null!==this.nowIndex){var e=this.$refs.listenerParam.getParams();void 0===e?l["a"].error("请填写完整"):(this.formData.taskListener[this.nowIndex].params=e,this.listenerParamVisible=!1)}},finishConfigParam:function(e){this.listenerParamVisible=!1;var t=this.formData.taskListener[this.nowIndex];t.params=e,this.$set(this.formData.taskListener[this.nowIndex],this.nowIndex,t),this.nowIndex=null},updateElement:function(){var e,t=this;if(null!==(e=this.formData.taskListener)&&void 0!==e&&e.length){var n,r,i=this.element.businessObject.get("extensionElements");i||(i=this.modeler.get("moddle").create("bpmn:ExtensionElements")),i.values=null!==(n=null===(r=i.values)||void 0===r?void 0:r.filter((function(e){return"flowable:TaskListener"!==e.$type})))&&void 0!==n?n:[],this.formData.taskListener.forEach((function(e){var n=t.modeler.get("moddle").create("flowable:TaskListener");n["event"]=e.event,n[e.type]=e.className,e.params&&e.params.length&&e.params.forEach((function(e){var r=t.modeler.get("moddle").create("flowable:Field");r["name"]=e.name,r[e.type]=e.value,n.get("fields").push(r)})),i.get("values").push(n)})),this.updateProperties({extensionElements:i})}else{var o,a,s=this.element.businessObject["extensionElements"];if(s)s.values=null!==(o=null===(a=s.values)||void 0===a?void 0:a.filter((function(e){return"flowable:TaskListener"!==e.$type})))&&void 0!==o?o:[]}},closeDialog:function(){var e=!0;return this.formData.taskListener.forEach((function(t){(!t.className||""===t.className||t.className.length<=0)&&(e=!1)})),e&&this.updateElement(),e}}},V=W,z=(n("3777"),Object(E["a"])(V,_,R,!1,null,"3b3e67b5",null)),B=z.exports,$=function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:4,offset:0},"wrapper-col":{span:14,offset:0},layout:"horizontal"}},[t("a-row",{staticStyle:{"margin-bottom":"20px"}},[t("a-alert",{attrs:{type:"info","show-icon":""}},[t("span",{attrs:{slot:"description"},slot:"description"},[e._v(" 按照BPMN2.0规范的要求，用于为每个实例创建执行的父执行，会提供下列变量:"),t("br"),e._v(" nrOfInstances：实例总数。"),t("br"),e._v(" nrOfActiveInstances：当前活动的（即未完成的），实例数量。对于顺序多实例，这个值总为1。"),t("br"),e._v(" nrOfCompletedInstances：已完成的实例数量。"),t("br"),e._v(" loopCounter：给定实例在for-each循环中的index。"),t("br")])])],1),t("a-form-model-item",{attrs:{prop:"collection"}},[t("span",{attrs:{slot:"label"},slot:"label"},[e._v(" 集合 "),t("a-tooltip",[t("template",{slot:"title"},[e._v(" 属性会作为表达式进行解析。如果表达式解析为字符串而不是一个集合，"),t("br"),e._v(" 不论是因为本身配置的就是静态字符串值，还是表达式计算结果为字符串，"),t("br"),e._v(" 这个字符串都会被当做变量名，并从流程变量中用于获取实际的集合。 ")]),t("i",{staticClass:"iconfont icon-info",staticStyle:{color:"#0a97ce"}})],2)],1),t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入集合","allow-clear":""},model:{value:e.formData.collection,callback:function(t){e.$set(e.formData,"collection",t)},expression:"formData.collection"}})],1),t("a-form-model-item",{attrs:{prop:"elementVariable"}},[t("span",{attrs:{slot:"label"},slot:"label"},[e._v(" 元素变量 "),t("a-tooltip",[t("template",{slot:"title"},[e._v(" 每创建一个用户任务前，先以该元素变量为label，集合中的一项为value，"),t("br"),e._v(" 创建（局部）流程变量，该局部流程变量被用于指派用户任务。"),t("br"),e._v(" 一般来说，该字符串应与指定人员变量相同。 ")]),t("i",{staticClass:"iconfont icon-info",staticStyle:{color:"#0a97ce"}})],2)],1),t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入元素变量","allow-clear":""},model:{value:e.formData.elementVariable,callback:function(t){e.$set(e.formData,"elementVariable",t)},expression:"formData.elementVariable"}})],1),t("a-form-model-item",{attrs:{label:"执行方式",prop:"isSequential"}},[t("a-radio-group",{model:{value:e.formData.isSequential,callback:function(t){e.$set(e.formData,"isSequential",t)},expression:"formData.isSequential"}},e._l(e.isSequentialOptions,(function(n,r){return t("a-radio",{key:r,attrs:{value:n.value,disabled:n.disabled}},[e._v(e._s(n.label))])})),1)],1),t("a-form-model-item",{attrs:{prop:"completionCondition"}},[t("span",{attrs:{slot:"label"},slot:"label"},[e._v(" 完成条件 "),t("a-tooltip",[t("template",{slot:"title"},[e._v(" 多实例活动在所有实例都完成时结束，然而也可以指定一个表达式，在每个实例"),t("br"),e._v(" 结束时进行计算。当表达式计算为true时，将销毁所有剩余的实例，并结束多实例"),t("br"),e._v(" 活动，继续执行流程。例如 ${nrOfCompletedInstances/nrOfInstances >= 0.6 }，"),t("br"),e._v(" 表示当任务完成60%时，该节点就算完成' ")]),t("i",{staticClass:"iconfont icon-info",staticStyle:{color:"#0a97ce"}})],2)],1),t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入单行文本","allow-clear":""},model:{value:e.formData.completionCondition,callback:function(t){e.$set(e.formData,"completionCondition",t)},expression:"formData.completionCondition"}})],1)],1)],1)},H=[],j=(n("b64b"),n("5530"));function U(e){var t=Object(j["a"])(Object(j["a"])({},e.businessObject),e.businessObject.$attrs);return G(t)}function G(e){for(var t in e)if(0===t.indexOf("flowable:")){var n=t.replace("flowable:","");e[n]=e[t],delete e[t]}return e=K(e),e}function K(e){if("documentation"in e){var t="";e.documentation.forEach((function(e){t+=e.text})),e.documentation=t}return e}function q(e){return"conditionExpression"in e&&(e.conditionExpression=e.conditionExpression.body),e}function X(e){for(var t in e){var n;if("candidateUsers"===t)e.userType="candidateUsers",e[t]=(null===(n=e[t])||void 0===n?void 0:n.split(","))||[];else if("candidateGroups"===t){var r;e.userType="candidateGroups",e[t]=(null===(r=e[t])||void 0===r?void 0:r.split(","))||[]}}return e}var Y={mixins:[x],data:function(){return{formData:{collection:void 0,elementVariable:void 0,isSequential:!0,completionCondition:void 0},rules:{collection:[{required:!1,message:"请输入集合",trigger:"blur"}],elementVariable:[{required:!1,message:"请输入元素变量",trigger:"blur"}],isSequential:[{required:!1,message:"执行方式不能为空",trigger:"change"}],completionCondition:[{required:!1,message:"请输入单行文本",trigger:"blur"}]},isSequentialOptions:[{label:"串行",value:!0},{label:"并行",value:!1}]}},computed:{},mounted:function(){var e,t,n=JSON.parse(JSON.stringify(null!==(e=this.element.businessObject.loopCharacteristics)&&void 0!==e?e:{}));n.completionCondition=null===(t=n.completionCondition)||void 0===t?void 0:t.body,this.formData=G(n)},methods:{updateElement:function(){if(null!==this.formData.isSequential&&void 0!==this.formData.isSequential){var e=this.element.businessObject.get("loopCharacteristics");if(e||(e=this.modeler.get("moddle").create("bpmn:MultiInstanceLoopCharacteristics")),e["isSequential"]=this.formData.isSequential,e["collection"]=this.formData.collection,e["elementVariable"]=this.formData.elementVariable,this.formData.completionCondition){var t=this.modeler.get("moddle").create("bpmn:Expression",{body:this.formData.completionCondition});e["completionCondition"]=t}this.updateProperties({loopCharacteristics:e})}else delete this.element.businessObject.loopCharacteristics},save:function(){var e=this,t=!1;return this.$refs["form"].validate((function(n){n&&(e.updateElement(),t=!0)})),t},clear:function(){this.$refs["form"].resetFields()}}},J=Y,Z=(n("c184"),Object(E["a"])(J,$,H,!1,null,"72bcfa23",null)),Q=Z.exports,ee={components:{taskListener:B,multiInstance:Q},mixins:[x,F],props:{users:{type:Array,required:!0},groups:{type:Array,required:!0},assigneeDataSource:{type:Array,default:function(){return[]}},dueDateDataSource:{type:Array,default:function(){return[]}},followUpDateDataSource:{type:Array,default:function(){return[]}},candidateUserDataSource:{type:Array,default:function(){return[]}},candidateGroupDataSource:{type:Array,default:function(){return[]}}},data:function(){return{taskListenerVisible:!1,multiInstanceVisible:!1,userTypeOptions:[{label:"指定人员",value:"assignee"},{label:"候选人员",value:"candidateUsers"},{label:"候选组",value:"candidateGroups"},{label:"流程发起人",value:"initiator"}],dialogName:"",taskListenerLength:0,hasMultiInstance:!1,formData:{id:void 0,name:void 0,documentation:void 0,executionListener:void 0,taskListener:void 0,userType:void 0,dataType:"fixed",assignee:void 0,candidateUsers:[],candidateGroups:[],multiInstance:void 0,async:!1,priority:void 0,formKey:void 0,skipExpression:void 0,isForCompensation:!1,triggerable:!1,autoStoreVariables:!1,exclude:!1,asyncBefore:!1,asyncAfter:!1,exclusive:!1,scriptFormat:void 0,scriptType:void 0,resource:void 0,script:void 0,ruleVariablesInput:void 0,rules:void 0,resultVariable:void 0,dueDate:"${dueDate}",followUpDate:"${followUpDate}",class:void 0},rules:{id:[{required:!0,message:"请输入节点ID",trigger:"blur"}],name:[{required:!0,message:"请输入节点名称",trigger:"blur"}],documentation:[],userType:[{required:!0,message:"请选择人员类型",trigger:"change"}],mode:[{required:!0,message:"指定方式不能为空",trigger:"change"}],assignee:[{required:!0,message:"请委派指定人员",trigger:"change"}],candidateUsers:[{required:!0,type:"array",message:"请至少选择一个候选人员",trigger:"change"}],candidateGroups:[{required:!0,message:"请选择候选组",trigger:"change"}]},scriptTypeOptions:[{label:"外部资源",value:"outside"},{label:"内联脚本",value:"inside"}]}},computed:{},watch:{"formData.userType":function(e,t){var n=this;if(t){var r=["assignee","candidateUsers","candidateGroups"];r.forEach((function(e){delete n.element.businessObject.$attrs["flowable:".concat(e)],delete n.formData[e]}))}this.updateProperties({"flowable:userType":e})},"formData.dataType":function(e){"initiator"!==this.formData.userType?this.updateProperties({"flowable:dataType":e}):delete this.element.businessObject.$attrs["flowable:dataType"]},"formData.assignee":function(e){var t=["assignee","initiator"];-1!==t.indexOf(this.formData.userType)?"initiator"===this.formData.userType?(this.formData.assignee="${INITIATOR}",this.updateProperties({"flowable:assignee":"${INITIATOR}"})):this.updateProperties({"flowable:assignee":e}):delete this.element.businessObject.$attrs["flowable:assignee"]},"formData.candidateUsers":function(e){"candidateUsers"===this.formData.userType?this.updateProperties({"flowable:candidateUsers":null===e||void 0===e?void 0:e.join(",")}):delete this.element.businessObject.$attrs["flowable:candidateUsers"]},"formData.candidateGroups":function(e){"candidateGroups"===this.formData.userType?this.updateProperties({"flowable:candidateGroups":null===e||void 0===e?void 0:e.join(",")}):delete this.element.businessObject.$attrs["flowable:candidateGroups"]},"formData.async":function(e){""===e&&(e=null),this.updateProperties({"flowable:async":e})},"formData.dueDate":function(e){""===e&&(e=null),this.updateProperties({"flowable:dueDate":e})},"formData.followUpDate":function(e){""===e&&(e=null),this.updateProperties({"flowable:followUpDate":e})},"formData.formKey":function(e){""===e&&(e=null),this.updateProperties({"flowable:formKey":e})},"formData.priority":function(e){""===e&&(e=null),this.updateProperties({"flowable:priority":e})},"formData.skipExpression":function(e){""===e&&(e=null),this.updateProperties({"flowable:skipExpression":e})},"formData.isForCompensation":function(e){""===e&&(e=null),this.updateProperties({isForCompensation:e})},"formData.triggerable":function(e){""===e&&(e=null),this.updateProperties({"flowable:triggerable":e})},"formData.class":function(e){""===e&&(e=null),this.updateProperties({"flowable:class":e})},"formData.autoStoreVariables":function(e){""===e&&(e=null),this.updateProperties({"flowable:autoStoreVariables":e})},"formData.exclude":function(e){""===e&&(e=null),this.updateProperties({"flowable:exclude":e})},"formData.ruleVariablesInput":function(e){""===e&&(e=null),this.updateProperties({"flowable:ruleVariablesInput":e})},"formData.rules":function(e){""===e&&(e=null),this.updateProperties({"flowable:rules":e})},"formData.resultVariable":function(e){""===e&&(e=null),this.updateProperties({"flowable:resultVariable":e})}},created:function(){var e=U(this.element);e=X(e),this.formData=e,this.computedExecutionListenerLength(),this.computedHasMultiInstance()},methods:{handleClearAssignee:function(){var e,t,n=this;("assignee"!==this.formData.userType||void 0!==this.formData.assignee&&""!==this.formData.assignee.trim())&&("candidateUsers"!==this.formData.userType||void 0!==this.formData.candidateUsers&&0!==(null===(e=this.formData.candidateUsers)||void 0===e?void 0:e.length))&&("candidateGroups"!==this.formData.userType||void 0!==this.formData.candidateGroups&&0!==(null===(t=this.formData.candidateGroups)||void 0===t?void 0:t.length))&&b["a"].confirm({title:"是否需要清除原来的数据?",content:"如果需要将会清除已经分配的信息",okText:"需要",cancelText:"不需要",onOk:function(){var e=["assignee","candidateUsers","candidateGroups"];e.forEach((function(e){delete n.element.businessObject.$attrs["flowable:".concat(e)],n.formData[e]=void 0}))},onCancel:function(){}})},handleClearMultiInstance:function(){this.$refs.multiInstance.clear()},handleMultiInstance:function(){var e=this.$refs.multiInstance.save();e&&(this.multiInstanceVisible=!1)},handleTaskListener:function(){var e=this.$refs.taskListener.closeDialog();e?this.taskListenerVisible=!1:l["a"].error("请补充信息")},computedTaskListenerLength:function(){var e,t;return null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.filter((function(e){return"flowable:TaskListener"===e.$type})).length)&&void 0!==e?e:0},computedHasMultiInstance:function(){this.element.businessObject.loopCharacteristics?this.hasMultiInstance=!0:this.hasMultiInstance=!1},handleUserTypeChange:function(){"initiator"===this.formData.userType&&(this.formData.assignee="${INITIATOR}",this.updateProperties({"flowable:assignee":"${INITIATOR}"}))}}},te=ee,ne=Object(E["a"])(te,v,y,!1,null,null,null),re=ne.exports,ie=function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:6,offset:0},"wrapper-col":{span:16,offset:1},layout:"horizontal"}},[t("a-form-model-item",{attrs:{label:"节点ID",prop:"id"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入流程标识","allow-clear":""},model:{value:e.formData.id,callback:function(t){e.$set(e.formData,"id",t)},expression:"formData.id"}})],1),t("a-form-model-item",{attrs:{label:"节点名称",prop:"name"}},[t("a-input",{attrs:{placeholder:"请输入流程名称","allow-clear":""},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),t("a-form-model-item",{attrs:{label:"节点描述",prop:"documentation"}},[t("a-textarea",{style:{width:"100%"},attrs:{placeholder:"请输入流程描述","auto-size":{minRows:4,maxRows:4},"allow-clear":""},model:{value:e.formData.documentation,callback:function(t){e.$set(e.formData,"documentation",t)},expression:"formData.documentation"}})],1),e.filter("executionListener")?e._e():t("a-form-model-item",{attrs:{label:"执行监听器"}},[t("a-badge",{attrs:{count:e.getExecutionListenerLength}},[t("a-button",{on:{click:e.handleShowExecutionListener}},[e._v("编辑")])],1)],1),e.filter("initiator")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.initiator,expression:"!!showConfig.initiator"}],attrs:{label:"发起人",prop:"formKey"}},[t("a-auto-complete",{attrs:{placeholder:"发起人","data-source":e.initiatorDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.initiator,callback:function(t){e.$set(e.formData,"initiator",t)},expression:"formData.initiator"}})],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&!1===e.associateFormConfig.enable,expression:"!!showConfig.formKey && associateFormConfig.enable === false"}],attrs:{label:"表单标识",prop:"formKey"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入表单标识","allow-clear":""},model:{value:e.formData.formKey,callback:function(t){e.$set(e.formData,"formKey",t)},expression:"formData.formKey"}})],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&e.associateFormConfig.enable,expression:"!!showConfig.formKey && associateFormConfig.enable"}],attrs:{label:"表单挂载",prop:"formKey"}},[t("a-select",{style:{width:"100%"},attrs:{placeholder:"请选择人员类型","allow-clear":""},model:{value:e.formData.formKey,callback:function(t){e.$set(e.formData,"formKey",t)},expression:"formData.formKey"}},e._l(e.associateFormDataOptions,(function(n,r){return t("a-select-option",{key:r,attrs:{value:n.value,disabled:n.disabled}},[e._v(e._s(n.label))])})),1)],1),e.filter("formKey")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.formKey&&e.associateFormConfig.enable&&(e.associateFormConfig.isPreview||e.associateFormConfig.isCreate),expression:"!!showConfig.formKey && associateFormConfig.enable && (associateFormConfig.isPreview || associateFormConfig.isCreate)"}],attrs:{label:" ",colon:!1}},[t("a-space",[e.associateFormConfig.isPreview?t("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.showAssociateForm(e.formData.formKey)}}},[e._v(" 查看表单 ")]):e._e(),e.associateFormConfig.isCreate?t("a-button",{attrs:{type:"primary"},on:{click:e.createAssociateForm}},[e._v(" 创建表单 ")]):e._e()],1)],1)],1),t("a-modal",{attrs:{title:"执行监听器",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleExecutionListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.executionListenerVisible,callback:function(t){e.executionListenerVisible=t},expression:"executionListenerVisible"}},[t("executionListener",{ref:"executionListener",attrs:{element:e.element,modeler:e.modeler}})],1)],1)},oe=[],ae={mixins:[x,F],props:{initiatorDataSource:{type:Array,default:function(){return[]}}},data:function(){return{formData:{category:void 0,id:void 0,name:void 0,documentation:void 0,initiator:"initiator",formKey:void 0},rules:{category:[{required:!0,message:"请选择流程分类",trigger:"change"}],id:[{required:!0,message:"请输入流程标识",trigger:"blur"}],name:[{required:!0,message:"请输入流程名称",trigger:"blur"}],documentation:[]}}},computed:{},watch:{"formData.initiator":function(e){""===e&&(e=null),this.updateProperties({"flowable:initiator":e})},"formData.formKey":function(e){""===e&&(e=null),this.updateProperties({"flowable:formKey":e})}},created:function(){this.formData=U(this.element)}},se=ae,le=Object(E["a"])(se,ie,oe,!1,null,null,null),ce=le.exports,ue=function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:6,offset:0},"wrapper-col":{span:16,offset:1},layout:"horizontal"}},[e.filter("category")?e._e():t("a-form-model-item",{attrs:{label:"流程分类",prop:"processCategory"}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{"dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":e.categories,placeholder:"请选择流程分类",replaceFields:e.categoriesFields,"tree-default-expand-all":""},model:{value:e.formData.processCategory,callback:function(t){e.$set(e.formData,"processCategory",t)},expression:"formData.processCategory"}})],1),t("a-form-model-item",{attrs:{label:"流程标识",prop:"id"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入流程标识","allow-clear":""},model:{value:e.formData.id,callback:function(t){e.$set(e.formData,"id",t)},expression:"formData.id"}})],1),t("a-form-model-item",{attrs:{label:"流程名称",prop:"name"}},[t("a-input",{attrs:{placeholder:"请输入流程名称","allow-clear":""},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),e.filter("documentation")?e._e():t("a-form-model-item",{attrs:{label:"流程描述",prop:"documentation"}},[t("a-textarea",{style:{width:"100%"},attrs:{placeholder:"请输入流程描述","auto-size":{minRows:4,maxRows:4},"allow-clear":""},model:{value:e.formData.documentation,callback:function(t){e.$set(e.formData,"documentation",t)},expression:"formData.documentation"}})],1),e.filter("executionListener")?e._e():t("a-form-model-item",{attrs:{label:"执行监听器"}},[t("a-badge",{attrs:{count:e.getExecutionListenerLength}},[t("a-button",{on:{click:e.handleShowExecutionListener}},[e._v("编辑")])],1)],1),e.filter("signal")?e._e():t("a-form-model-item",{attrs:{label:"信号定义"}},[t("a-badge",{attrs:{count:e.signals.length}},[t("a-button",{on:{click:e.showSignal}},[e._v("编辑")])],1)],1),e.filter("message")?e._e():t("a-form-model-item",{attrs:{label:"消息定义"}},[t("a-badge",{attrs:{count:e.messages.length}},[t("a-button",{on:{click:e.showMessage}},[e._v("编辑")])],1)],1)],1),t("a-modal",{attrs:{title:"执行监听器",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleExecutionListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.executionListenerVisible,callback:function(t){e.executionListenerVisible=t},expression:"executionListenerVisible"}},[t("executionListener",{ref:"executionListener",attrs:{element:e.element,modeler:e.modeler}})],1),t("a-modal",{attrs:{title:"信号定义",width:"700px"},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.finishSignal}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.signalVisible,callback:function(t){e.signalVisible=t},expression:"signalVisible"}},[t("signal",{ref:"signal",attrs:{element:e.element,modeler:e.modeler,signals:e.signals}})],1),t("a-modal",{attrs:{title:"消息",width:"700px"},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.finishMessage}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.messageVisible,callback:function(t){e.messageVisible=t},expression:"messageVisible"}},[t("message",{ref:"message",attrs:{element:e.element,modeler:e.modeler,messages:e.messages}})],1)],1)},de=[],pe=function(){var e=this,t=e._self._c;return t("div",[t("a-button",{staticClass:"editable-add-btn",staticStyle:{"margin-bottom":"8px"},attrs:{type:"primary"},on:{click:e.handleEditableAdd}},[e._v("新增")]),t("a-table",{attrs:{rowKey:function(e,t){return t},dataSource:e.formData.signal,columns:e.columns},scopedSlots:e._u([{key:"scope",fn:function(n,r){return[t("a-select",{staticStyle:{width:"120px"},attrs:{"default-value":n},model:{value:r.scope,callback:function(t){e.$set(r,"scope",t)},expression:"record.scope"}},[t("a-select-option",{attrs:{value:"global"}},[e._v(" 全局 ")]),t("a-select-option",{attrs:{value:"processInstance"}},[e._v(" 流程实例 ")])],1)]}},{key:"id",fn:function(n,r){return[t("a-input",{attrs:{placeholder:r.placeholder?r.placeholder:"请输入id"},on:{blur:function(t){return e.handleId(r)}},model:{value:r.id,callback:function(t){e.$set(r,"id",t)},expression:"record.id"}})]}},{key:"name",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入名称"},model:{value:r.name,callback:function(t){e.$set(r,"name",t)},expression:"record.name"}})]}},{key:"action",fn:function(n,r,i){return[t("a-popconfirm",{attrs:{title:"是否删除?"},on:{confirm:function(){return e.onDelete(i,r.id)}}},[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])]}}])})],1)},fe=[],he={mixins:[x],props:{signals:{type:Array,default:function(){return[]}}},data:function(){return{rootElements:void 0,signalIds:[],formData:{signal:this.signals},columns:[{title:"作用域",dataIndex:"scope",key:"scope",scopedSlots:{customRender:"scope"}},{title:"id",dataIndex:"id",key:"id",scopedSlots:{customRender:"id"}},{title:"名称",dataIndex:"name",key:"name",scopedSlots:{customRender:"name"}},{title:"操作",dataIndex:"action",key:"action",scopedSlots:{customRender:"action"}}]}},computed:{},mounted:function(){this.getSignalElements()},methods:{handleId:function(e){var t=[];this.formData.signal.forEach((function(n){-1!==t.indexOf(e.id)?(e.id=void 0,e.placeholder="id不能相同"):t.push(n.id)}))},onDelete:function(e,t){this.rootElements=this.modeler.getDefinitions().rootElements;for(var n=0;n<this.rootElements.length;n++){var r=this.rootElements[n];"bpmn:Signal"===r.$type&&r.id===t&&(this.formData.signal.splice(e,1),this.rootElements.splice(n,1))}},handleEditableAdd:function(){this.formData.signal.push({scope:"global",id:"",name:""})},updateElement:function(){var e=this,t=this.getSignalElementIds();this.formData.signal.forEach((function(n){var r=[];if(-1===r.indexOf(n.id)&&-1===t.indexOf(n.id)){var i=e.modeler.get("moddle").create("bpmn:Signal");i["id"]=n.id,i["name"]=n.name,i.$attrs["flowable:scope"]=n.scope,e.rootElements.push(i)}r.push(n.id)}))},saveSignal:function(){if(void 0===this.formData.signal||0===this.formData.signal.length)return!0;var e=!0;return this.formData.signal.forEach((function(t){""!==t.name&&""!==t.id||(e=!1)})),e&&this.updateElement(),e}}},me=he,ge=(n("3752"),Object(E["a"])(me,pe,fe,!1,null,"79bd7756",null)),ve=ge.exports,ye=function(){var e=this,t=e._self._c;return t("div",[t("a-button",{staticClass:"editable-add-btn",staticStyle:{"margin-bottom":"8px"},attrs:{type:"primary"},on:{click:e.handleEditableAdd}},[e._v("新增")]),t("a-table",{attrs:{rowKey:function(e,t){return t},dataSource:e.formData.messages,columns:e.columns},scopedSlots:e._u([{key:"id",fn:function(n,r){return[t("a-input",{attrs:{placeholder:r.placeholder?r.placeholder:"请输入id"},on:{blur:function(t){return e.handleId(r)}},model:{value:r.id,callback:function(t){e.$set(r,"id",t)},expression:"record.id"}})]}},{key:"name",fn:function(n,r){return[t("a-input",{attrs:{placeholder:"请输入名称"},model:{value:r.name,callback:function(t){e.$set(r,"name",t)},expression:"record.name"}})]}},{key:"action",fn:function(n,r,i){return[t("a-popconfirm",{attrs:{title:"是否删除?"},on:{confirm:function(){return e.onDelete(i,r.id)}}},[t("a",{attrs:{href:"javascript:;"}},[e._v("删除")])])]}}])})],1)},be=[],we={mixins:[x],props:{messages:{type:Array,default:function(){return[]}}},data:function(){return{rootElements:void 0,signalIds:[],formData:{messages:this.messages},columns:[{title:"id",dataIndex:"id",key:"id",scopedSlots:{customRender:"id"}},{title:"名称",dataIndex:"name",key:"name",scopedSlots:{customRender:"name"}},{title:"操作",dataIndex:"action",key:"action",scopedSlots:{customRender:"action"}}]}},computed:{},mounted:function(){this.getMessageElements()},methods:{handleId:function(e){var t=[];this.formData.messages.forEach((function(n){-1!==t.indexOf(e.id)?(e.id=void 0,e.placeholder="id不能相同"):t.push(n.id)}))},onDelete:function(e,t){this.rootElements=this.modeler.getDefinitions().rootElements;for(var n=0;n<this.rootElements.length;n++){var r=this.rootElements[n];"bpmn:Message"===r.$type&&r.id===t&&(this.formData.messages.splice(e,1),this.rootElements.splice(n,1))}},handleEditableAdd:function(){this.formData.messages.push({id:"",name:""})},updateElement:function(){var e=this,t=this.getMessageElementIds();this.formData.messages.forEach((function(n){var r=[];if(-1===r.indexOf(n.id)&&-1===t.indexOf(n.id)){var i=e.modeler.get("moddle").create("bpmn:Message",n);e.rootElements.push(i)}r.push(n.id)}))},saveMessage:function(){if(void 0===this.formData.messages||0===this.formData.messages.length)return!0;var e=!0;return this.formData.messages.forEach((function(t){""!==t.name&&""!==t.id||(e=!1)})),e&&this.updateElement(),e}}},xe=we,Ce=(n("d681"),Object(E["a"])(xe,ye,be,!1,null,"15c82825",null)),Se=Ce.exports,ke={components:{Message:Se,signal:ve},mixins:[x,F],props:{categoriesFields:{type:Object,default:function(){return{children:"children",title:"name",key:"id",value:"id"}}}},data:function(){return{signalVisible:!1,signals:[],messageVisible:!1,messages:[],signalLength:0,formData:{processCategory:void 0,id:void 0,name:void 0,documentation:void 0},rules:{processC:[{required:!0,message:"请选择流程分类",trigger:"change"}],id:[{required:!0,message:"请输入流程标识",trigger:"blur"}],name:[{required:!0,message:"请输入流程名称",trigger:"blur"}],documentation:[]}}},computed:{},watch:{"formData.processCategory":function(e){""===e&&(e=null),this.updateProperties({"flowable:processCategory":e})}},created:function(){this.formData=U(this.element)},methods:{computedSignalLength:function(){var e,t;this.signalLength=null!==(e=null===(t=this.element.businessObject.extensionElements)||void 0===t||null===(t=t.values)||void 0===t?void 0:t.length)&&void 0!==e?e:0},showSignal:function(){this.signals=this.getSignalElements(),this.signalVisible=!0},finishSignal:function(){var e=this.$refs.signal.saveSignal();e?this.signalVisible=!1:l["a"].error("信息填写不完善")},showMessage:function(){this.messages=this.getMessageElements(),this.messageVisible=!0},finishMessage:function(){var e=this.$refs.message.saveMessage();e?this.messageVisible=!1:l["a"].error("信息填写不完善")}}},De=ke,Le=Object(E["a"])(De,ue,de,!1,null,null,null),Te=Le.exports,Ee=function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:6,offset:0},"wrapper-col":{span:16,offset:1},layout:"horizontal"}},[t("a-form-model-item",{attrs:{label:"节点ID",prop:"id"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入流程标识","allow-clear":""},model:{value:e.formData.id,callback:function(t){e.$set(e.formData,"id",t)},expression:"formData.id"}})],1),t("a-form-model-item",{attrs:{label:"节点名称",prop:"name"}},[t("a-input",{attrs:{placeholder:"请输入流程名称","allow-clear":""},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),e.filter("nodeDocumentation")?e._e():t("a-form-model-item",{attrs:{label:"节点描述",prop:"documentation"}},[t("a-textarea",{style:{width:"100%"},attrs:{placeholder:"请输入流程描述","auto-size":{minRows:4,maxRows:4},"allow-clear":""},model:{value:e.formData.documentation,callback:function(t){e.$set(e.formData,"documentation",t)},expression:"formData.documentation"}})],1),e.filter("executionListener")?e._e():t("a-form-model-item",{attrs:{label:"执行监听器"}},[t("a-badge",{attrs:{count:e.getExecutionListenerLength}},[t("a-button",{on:{click:e.handleShowExecutionListener}},[e._v("编辑")])],1)],1),e.filter("conditionExpression")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.conditionExpression,expression:"!!showConfig.conditionExpression"}],attrs:{label:"跳转条件",prop:"conditionExpression"}},[t("a-auto-complete",{attrs:{placeholder:"跳转条件表达式","data-source":e.conditionExpressionDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.conditionExpression,callback:function(t){e.$set(e.formData,"conditionExpression",t)},expression:"formData.conditionExpression"}})],1),e.filter("skipExpression")?e._e():t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:!!e.showConfig.skipExpression,expression:"!!showConfig.skipExpression"}],attrs:{label:"跳过条件",prop:"skipExpression"}},[t("a-auto-complete",{attrs:{placeholder:"跳过条件表达式","data-source":e.skipExpressionDataSource,"filter-option":"","allow-clear":""},model:{value:e.formData.skipExpression,callback:function(t){e.$set(e.formData,"skipExpression",t)},expression:"formData.skipExpression"}})],1)],1),t("a-modal",{attrs:{title:"执行监听器",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleExecutionListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.executionListenerVisible,callback:function(t){e.executionListenerVisible=t},expression:"executionListenerVisible"}},[t("executionListener",{ref:"executionListener",attrs:{element:e.element,modeler:e.modeler}})],1)],1)},Ae=[],Me={mixins:[x,F],data:function(){return{formData:{category:void 0,id:void 0,name:void 0,documentation:void 0,skipExpression:void 0,conditionExpression:void 0},rules:{category:[{required:!0,message:"请选择流程分类",trigger:"change"}],id:[{required:!0,message:"请输入流程标识",trigger:"blur"}],name:[{required:!0,message:"请输入流程名称",trigger:"blur"}],documentation:[]}}},computed:{},watch:{"formData.conditionExpression":function(e){if(e){var t=this.modeler.get("moddle").create("bpmn:FormalExpression",{body:e});this.updateProperties({conditionExpression:t})}else this.updateProperties({conditionExpression:null})},"formData.skipExpression":function(e){""===e&&(e=null),this.updateProperties({"flowable:skipExpression":e})}},created:function(){var e=U(this.element);e=q(e),this.formData=e}},Oe=Me,Ne=Object(E["a"])(Oe,Ee,Ae,!1,null,null,null),Ie=Ne.exports,Pe=function(){var e=this,t=e._self._c;return t("div",[t("a-form-model",{ref:"form",attrs:{model:e.formData,rules:e.rules,"label-col":{span:6,offset:0},"wrapper-col":{span:16,offset:1},layout:"horizontal"}},[t("a-form-model-item",{attrs:{label:"节点ID",prop:"id"}},[t("a-input",{style:{width:"100%"},attrs:{placeholder:"请输入流程标识","allow-clear":""},model:{value:e.formData.id,callback:function(t){e.$set(e.formData,"id",t)},expression:"formData.id"}})],1),t("a-form-model-item",{attrs:{label:"节点名称",prop:"name"}},[t("a-input",{attrs:{placeholder:"请输入流程名称","allow-clear":""},model:{value:e.formData.name,callback:function(t){e.$set(e.formData,"name",t)},expression:"formData.name"}})],1),e.filter("nodeDocumentation")?e._e():t("a-form-model-item",{attrs:{label:"节点描述",prop:"documentation"}},[t("a-textarea",{style:{width:"100%"},attrs:{placeholder:"请输入流程描述","auto-size":{minRows:4,maxRows:4},"allow-clear":""},model:{value:e.formData.documentation,callback:function(t){e.$set(e.formData,"documentation",t)},expression:"formData.documentation"}})],1),e.filter("executionListener")?e._e():t("a-form-model-item",{attrs:{label:"执行监听器"}},[t("a-badge",{attrs:{count:e.getExecutionListenerLength}},[t("a-button",{on:{click:e.handleShowExecutionListener}},[e._v("编辑")])],1)],1),e.filter("async")?e._e():t("a-form-model-item",{attrs:{label:"异步",prop:"async"}},[t("a-switch",{model:{value:e.formData.async,callback:function(t){e.$set(e.formData,"async",t)},expression:"formData.async"}})],1)],1),t("a-modal",{attrs:{title:"执行监听器",width:"800px",maskClosable:!1,closable:!1},scopedSlots:e._u([{key:"footer",fn:function(){return[t("a-button",{key:"submit",attrs:{type:"primary"},on:{click:e.handleExecutionListener}},[e._v("关闭")])]},proxy:!0}]),model:{value:e.executionListenerVisible,callback:function(t){e.executionListenerVisible=t},expression:"executionListenerVisible"}},[t("executionListener",{ref:"executionListener",attrs:{element:e.element,modeler:e.modeler}})],1)],1)},Fe=[],_e={mixins:[x,F],data:function(){return{formData:{category:void 0,id:void 0,name:void 0,documentation:void 0},rules:{category:[{required:!0,message:"请选择流程分类",trigger:"change"}],id:[{required:!0,message:"请输入流程标识",trigger:"blur"}],name:[{required:!0,message:"请输入流程名称",trigger:"blur"}],documentation:[]}}},computed:{},watch:{"formData.async":function(e){""===e&&(e=null),this.updateProperties({"flowable:async":e})}},created:function(){this.formData=U(this.element)}},Re=_e,We=Object(E["a"])(Re,Pe,Fe,!1,null,null,null),Ve=We.exports,ze={name:"PropertyPanel",components:{processPanel:Te,taskPanel:re,startEndPanel:ce,sequenceFlowPanel:Ie,gatewayPanel:Ve},props:{categoriesFields:{type:Object},filters:{type:Array},associateFormConfig:{type:Object},associateFormDataOptions:{type:Array,default:function(){return[]}},users:{type:Array,required:!0},groups:{type:Array,required:!0},categories:{type:Array,required:!0},modeler:{type:Object,required:!0},initiatorDataSource:{type:Array,default:function(){return[]}},assigneeDataSource:{type:Array,default:function(){return[]}},dueDateDataSource:{type:Array,default:function(){return[]}},followUpDateDataSource:{type:Array,default:function(){return[]}},skipExpressionDataSource:{type:Array,default:function(){return[]}},conditionExpressionDataSource:{type:Array,default:function(){return[]}},candidateUserDataSource:{type:Array,default:function(){return[]}},candidateGroupDataSource:{type:Array,default:function(){return[]}}},data:function(){return{element:null,form:{id:"",name:"",color:null},roles:[{value:"manager",label:"经理"},{value:"personnel",label:"人事"},{value:"charge",label:"主管"}]}},computed:{getComponent:function(){var e,t=null===(e=this.element)||void 0===e?void 0:e.type;return["bpmn:IntermediateThrowEvent","bpmn:StartEvent","bpmn:EndEvent"].includes(t)?"startEndPanel":["bpmn:UserTask","bpmn:Task","bpmn:SendTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:BusinessRuleTask","bpmn:ServiceTask","bpmn:ScriptTask"].includes(t)?"taskPanel":"bpmn:SequenceFlow"===t?"sequenceFlowPanel":["bpmn:InclusiveGateway","bpmn:ExclusiveGateway","bpmn:ParallelGateway","bpmn:EventBasedGateway"].includes(t)?"gatewayPanel":"bpmn:Process"===t?"processPanel":null},nodeName:function(){if(this.element){var e=this.element.businessObject,t=null!==e&&void 0!==e&&e.eventDefinitions?e.eventDefinitions[0].$type:e.$type,n=p[t]||t;return this.$emit("change",n),n}return""}},mounted:function(){this.handleModeler()},methods:{handleModeler:function(){var e=this;this.modeler.on("root.added",(function(t){"bpmn:Process"===t.element.type&&(e.element=null,e.$nextTick().then((function(){e.element=t.element})))})),this.modeler.on("element.click",(function(t){var n=t.element;"bpmn:Process"===n.type&&(e.element=n)})),this.modeler.on("selection.changed",(function(t){e.element=null;var n=t.newSelection[0];n&&e.$nextTick().then((function(){e.element=n}))}))},showAssociateForm:function(e){this.$emit("showForm",e)},createAssociateForm:function(){this.$emit("createForm")}}},Be=ze,$e=(n("e10e"),Object(E["a"])(Be,m,g,!1,null,null,null)),He=$e.exports,je=n("d4ec"),Ue=n("bee2"),Ge=function(){function e(){Object(je["a"])(this,e),this.controls=[],this.init()}return Object(Ue["a"])(e,[{key:"init",value:function(){this.controls=[{action:"hand-tool",title:"抓手"},{action:"lasso-tool",title:"套索"},{action:"space-tool",title:"空间"},{action:"global-connect-tool",title:"连接"},{action:"create.start-event",title:"开始"},{action:"create.intermediate-event",title:"中间"},{action:"create.end-event",title:"结束"},{action:"create.exclusive-gateway",title:"网关"},{action:"create.task",title:"任务"},{action:"create.user-task",title:"用户任务"},{action:"create.user-sign-task",title:"会签任务"},{action:"create.subprocess-expanded",title:"子流程"},{action:"create.data-object",title:"数据对象"},{action:"create.data-store",title:"数据存储"},{action:"create.participant-expanded",title:"扩展流程"},{action:"create.group",title:"分组"}]}},{key:"getControl",value:function(e){var t=this.controls.filter((function(t){return t.action===e}));return t[0]||{}}}])}();n("99af"),n("fb6a"),n("25f0");function Ke(){return Math.random().toString(36).slice(-8)}var qe=function(){return'<?xml version="1.0" encoding="UTF-8"?>\n    <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:bioc="http://bpmn.io/schema/bpmn/biocolor/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" targetNamespace="http://www.flowable.org/processdef">\n      <process id="process_'.concat(Ke(),'" name="name_').concat(Ke(),'">\n        <startEvent id="startNode1" name="开始" />\n      </process>\n      <bpmndi:BPMNDiagram id="BPMNDiagram_flow">\n        <bpmndi:BPMNPlane id="BPMNPlane_flow" bpmnElement="T-2d89e7a3-ba79-4abd-9f64-ea59621c258c">\n          <bpmndi:BPMNShape id="BPMNShape_startNode1" bpmnElement="startNode1" bioc:stroke="">\n            <omgdc:Bounds x="240" y="200" width="30" height="30" />\n            <bpmndi:BPMNLabel>\n              <omgdc:Bounds x="242" y="237" width="23" height="14" />\n            </bpmndi:BPMNLabel>\n          </bpmndi:BPMNShape>\n        </bpmndi:BPMNPlane>\n      </bpmndi:BPMNDiagram>\n    </definitions>\n    ')},Xe=n("4c3b"),Ye=n("8f94"),Je=(n("a7be"),n("acdf"),n("d5e0"),["子流程","调用活动"]),Ze={name:"WorkflowBpmnModeler",components:{panel:He,codemirror:Ye["codemirror"]},props:{categoriesFields:{type:Object},panelFilters:{type:Array},paletteToolShow:{type:Boolean,default:function(){return!0}},paletteFilters:{type:Array,default:function(){return[]}},rightActionConfig:{type:Object,default:function(){return{showCode:{show:!0,icon:!0,label:"XML"},downloadXML:{show:!0,icon:!0,label:"XML"},downloadSVG:{show:!0,icon:!0,label:"SVG"},save:{show:!0,icon:!0,label:"保存"}}}},xml:{type:String,default:""},users:{type:Array,default:function(){return[]}},groups:{type:Array,default:function(){return[]}},categories:{type:Array,default:function(){return[]}},isView:{type:Boolean,default:!1},associateFormConfig:{type:Object},associateFormDataOptions:{type:Array,default:function(){return[]}},assigneeDataSource:{type:Array,default:function(){return["#{approval}","${approverId}","${INITIATOR}"]}},dueDateDataSource:{type:Array,default:function(){return["${dueDate}"]}},followUpDateDataSource:{type:Array,default:function(){return["${followUpDate}"]}},initiatorDataSource:{type:Array,default:function(){return["initiator"]}},skipExpressionDataSource:{type:Array,default:function(){return[]}},conditionExpressionDataSource:{type:Array,default:function(){return["${approve}","${!approve}"]}},candidateUserDataSource:{type:Array,default:function(){return[]}},candidateGroupDataSource:{type:Array,default:function(){return[]}}},data:function(){return{panelTitle:"",panelVisible:!0,panelExist:!1,modeler:null,taskList:[],zoom:1,codeVisible:!1,xmlCode:"",options:{tabSize:2,theme:"rubyblue",lineNumbers:!0,mode:"xml",line:!0,styleActiveLine:!0,readOnly:!0,hintOptions:{completeSingle:!0}}}},watch:{xml:function(e){e&&this.createNewDiagram(e)}},mounted:function(){this.isView?this.modeler=new h["a"]({container:this.$refs.canvas,additionalModules:[{translate:["value",f],paletteProvider:["value",""],labelEditingProvider:["value",""],contextPadProvider:["value",""],bendpoints:["value",{}],zoomScroll:["value",""],moveCanvas:["value",""],move:["value",""]}],moddleExtensions:{flowable:Xe}}):this.modeler=new h["a"]({container:this.$refs.canvas,additionalModules:[{translate:["value",f]}],moddleExtensions:{flowable:Xe}}),this.xml?this.createNewDiagram(this.xml):this.newDiagram()},methods:{handlePanelChange:function(e){""===e.trim()?this.panelExist=!1:-1===Je.indexOf(e.trim())?this.panelExist=!0:this.panelExist=!1,this.panelTitle=e},newDiagram:function(){this.createNewDiagram(qe())},fitViewport:function(){this.zoom=this.modeler.get("canvas").zoom("fit-viewport");var e=document.querySelector(".flow-containers .viewport").getBBox(),t=this.modeler.get("canvas").viewbox(),n={x:e.x+e.width/2-65,y:e.y+e.height/2};this.modeler.get("canvas").viewbox({x:n.x-t.width/2,y:n.y-t.height/2,width:t.width,height:t.height}),this.zoom=e.width/t.width*1.8},zoomViewport:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.zoom=this.modeler.get("canvas").zoom(),this.zoom+=e?.1:-.1,this.modeler.get("canvas").zoom(this.zoom)},createNewDiagram:function(e){var t=this;return Object(u["a"])(Object(c["a"])().mark((function n(){return Object(c["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e=e.replace(/<!\[CDATA\[(.+?)]]>/g,(function(e,t){return t.replace(/</g,"&lt;")})),n.prev=1,n.next=4,t.modeler.importXML(e);case 4:t.adjustPalette(),t.fitViewport(),n.next=10;break;case 8:n.prev=8,n.t0=n["catch"](1);case 10:case"end":return n.stop()}}),n,null,[[1,8]])})))()},adjustPalette:function(){try{var e=this.$refs.canvas,t=e.children[0].children[1].children[4];if(!t)return;var n={width:"130px",padding:"5px",background:"white",left:"20px",borderRadius:0};for(var r in n)t.style[r]=n[r];var i=t.children[0],o=i.children;for(var a in this.paletteToolShow||(o[0].style["display"]="none"),o){var s=o[a];for(var l in s.children){var c=s.children[l],u={display:"flex",justifyContent:"flex-start",alignItems:"center",width:"100%",padding:"5px"};if(c.className&&c.dataset&&-1!==c.className.indexOf("entry")){var d=(new Ge).getControl(c.dataset.action);for(var p in c.innerHTML="<div style='font-size: 14px;font-weight:500;margin-left:15px;'>".concat(d["title"],"</div>"),u)c.style[p]=u[p];if(-1!==this.paletteFilters.indexOf(c.dataset.action)){c.style["display"]="none";continue}}}}}catch(f){}},fillColor:function(){var e=this,t=this.modeler.get("canvas");this.modeler._definitions.rootElements[0].flowElements.forEach((function(n){if("bpmn:UserTask"===n.$type){var r,i=e.taskList.find((function(e){return e.key===n.id}))||{completed:!0},o=e.taskList.find((function(e){return!e.completed})),a=e.taskList[e.taskList.length-1];if(i)t.addMarker(n.id,i.completed?"highlight":"highlight-todo"),null===(r=n.outgoing)||void 0===r||r.forEach((function(r){var s=e.taskList.find((function(e){return e.key===r.targetRef.id}));s?t.addMarker(r.id,s.completed?"highlight":"highlight-todo"):"bpmn:ExclusiveGateway"===r.targetRef.$type?(t.addMarker(r.id,i.completed?"highlight":"highlight-todo"),t.addMarker(r.targetRef.id,i.completed?"highlight":"highlight-todo")):"bpmn:EndEvent"===r.targetRef.$type&&(o||a.key!==n.id||(t.addMarker(r.id,"highlight"),t.addMarker(r.targetRef.id,"highlight")),i.completed||(t.addMarker(r.id,"highlight-todo"),t.addMarker(r.targetRef.id,"highlight-todo")))}))}else"bpmn:ExclusiveGateway"===n.$type&&n.outgoing.forEach((function(n){var r=e.taskList.find((function(e){return e.key===n.targetRef.id}));r&&t.addMarker(n.id,r.completed?"highlight":"highlight-todo")}));"bpmn:StartEvent"===n.$type&&n.outgoing.forEach((function(r){var i=e.taskList.find((function(e){return e.key===r.targetRef.id}));if(i)return t.addMarker(r.id,"highlight"),void t.addMarker(n.id,"highlight")}))}))},getProcess:function(){var e=this.getProcessElement();return{id:e.id,name:e.name,category:e.$attrs["flowable:processCategory"]}},getProcessElement:function(){for(var e=this.modeler.getDefinitions().rootElements,t=0;t<e.length;t++)if("bpmn:Process"===e[t].$type)return e[t]},showXML:function(){var e=this;return Object(u["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.saveXML(!1);case 2:e.xmlCode=t.sent,e.codeVisible=!0;case 4:case"end":return t.stop()}}),t)})))()},saveXML:function(){var e=arguments,t=this;return Object(u["a"])(Object(c["a"])().mark((function n(){var r,i,o;return Object(c["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.length>0&&void 0!==e[0]&&e[0],n.prev=1,n.next=4,t.modeler.saveXML({format:!0});case 4:return i=n.sent,o=i.xml,r&&t.downloadFile("".concat(t.getProcessElement().name,".bpmn20.xml"),o,"application/xml"),n.abrupt("return",o);case 10:n.prev=10,n.t0=n["catch"](1);case 12:case"end":return n.stop()}}),n,null,[[1,10]])})))()},saveImg:function(){var e=arguments,t=this;return Object(u["a"])(Object(c["a"])().mark((function n(){var r,i,o;return Object(c["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return e.length>0&&void 0!==e[0]?e[0]:"svg",r=e.length>1&&void 0!==e[1]&&e[1],n.prev=2,n.next=5,t.modeler.saveSVG({format:!0});case 5:return i=n.sent,o=i.svg,r&&t.downloadFile(t.getProcessElement().name,o,"image/svg+xml"),n.abrupt("return",o);case 11:n.prev=11,n.t0=n["catch"](2);case 13:case"end":return n.stop()}}),n,null,[[2,11]])})))()},save:function(){var e=this;return Object(u["a"])(Object(c["a"])().mark((function t(){var n,r,i,o;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=e.getProcess(),t.next=3,e.saveXML();case 3:return r=t.sent,t.next=6,e.saveImg();case 6:i=t.sent,o={process:n,xml:r,svg:i},e.$emit("save",o),window.parent.postMessage(o,"*");case 10:case"end":return t.stop()}}),t)})))()},openBpmn:function(e){var t=this;if("text/xml"===e.type){var n=new FileReader;return n.readAsText(e,"utf-8"),n.onload=function(){t.createNewDiagram(n.result)},!1}l["a"].error("需要打开bpmn20.xml文件")},downloadFile:function(e,t,n){var r=document.createElement("a"),i=window.URL.createObjectURL(new Blob([t],{type:n}));r.href=i,r.download=e,r.click(),window.URL.revokeObjectURL(i)},showAssociateForm:function(e){this.$emit("showForm",e)},createAssociateForm:function(){this.$emit("createForm")}}},Qe=Ze,et=(n("e7a3"),Object(E["a"])(Qe,a,s,!1,null,"6e30e840",null)),tt=et.exports;tt.install=function(e){return e.component(tt.name,tt)};var nt=tt,rt=n("347e"),it=n.n(rt),ot=n("1487"),at=n.n(ot),st=(n("9f21"),{name:"Model",components:{bpmnModeler:nt,vkbeautify:it.a},props:{deploymentId:{type:String,default:""}},directives:{highlight:function(e){var t=e.querySelectorAll("pre code");t.forEach((function(e){at.a.highlightBlock(e)}))}},data:function(){return{xml:"",modeler:"",xmlOpen:!1,xmlTitle:"",xmlContent:"",users:[],groups:[],categorys:[],categoriesFields:{children:"children",title:"dictLabel",key:"id",value:"dictValue"}}},activated:function(){var e=this,t=this.$route.params&&this.$route.params.deploymentId;t&&this.getModelDetail(t),this.getDicts("sys_process_category").then((function(t){e.categorys=t.data})),this.getDataList()},methods:{getModelDetail:function(e){var t=this;Object(o["h"])(e).then((function(e){t.xml=e.data,t.modeler=e.data}))},save:function(e){var t=this,n={name:e.process.name,category:e.process.category,xml:e.xml};this.showLoading(),Object(o["j"])(n).then((function(e){t.hideLoading(),t.$elMsg("保存成功"),t.$emit("ok"),t.$store.dispatch("tagsView/delView",t.$route),t.$router.go(-1)}))},getDataList:function(){var e=this;this.users=[],this.groups=[],Object(o["n"])().then((function(t){e.users=t.data})),Object(o["i"])().then((function(t){t.data.forEach((function(t){var n={id:t.id,name:t.roleName};e.groups.push(n)}))}))},showXML:function(e){this.xmlTitle="xml查看",this.xmlOpen=!0,this.xmlContent=it.a.xml(e)},dataType:function(e){this.users=[],this.groups=[],this.getDataList()}}}),lt=st,ct=(n("2e5a"),Object(E["a"])(lt,r,i,!1,null,"69cf7caa",null));t["default"]=ct.exports},"2aaf":function(e,t,n){"use strict";n("a596")},"2e5a":function(e,t,n){"use strict";n("f5f2")},"316a":function(e,t,n){},"347e":function(e,t){
/**
* vkBeautify - javascript plugin to pretty-print or minify text in XML, JSON, CSS and SQL formats.
*
* Copyright (c) 2012 Vadim Kiryukhin
* vkiryukhin @ gmail.com
* http://www.eslinstructor.net/vkbeautify/
*
* Dual licensed under the MIT and GPL licenses:
*   http://www.opensource.org/licenses/mit-license.php
*   http://www.gnu.org/licenses/gpl.html
*
*   Pretty print
*
*        vkbeautify.xml(text [,indent_pattern]);
*        vkbeautify.json(text [,indent_pattern]);
*        vkbeautify.css(text [,indent_pattern]);
*        vkbeautify.sql(text [,indent_pattern]);
*
*        @text - String; text to beatufy;
*        @indent_pattern - Integer | String;
*                Integer:  number of white spaces;
*                String:   character string to visualize indentation ( can also be a set of white spaces )
*   Minify
*
*        vkbeautify.xmlmin(text [,preserve_comments]);
*        vkbeautify.jsonmin(text);
*        vkbeautify.cssmin(text [,preserve_comments]);
*        vkbeautify.sqlmin(text);
*
*        @text - String; text to minify;
*        @preserve_comments - Bool; [optional];
*                Set this flag to true to prevent removing comments from @text ( minxml and mincss functions only. )
*
*   Examples:
*        vkbeautify.xml(text); // pretty print XML
*        vkbeautify.json(text, 4 ); // pretty print JSON
*        vkbeautify.css(text, '. . . .'); // pretty print CSS
*        vkbeautify.sql(text, '----'); // pretty print SQL
*
*        vkbeautify.xmlmin(text, true);// minify XML, preserve comments
*        vkbeautify.jsonmin(text);// minify JSON
*        vkbeautify.cssmin(text);// minify CSS, remove comments ( default )
*        vkbeautify.sqlmin(text);// minify SQL
*
*/
function n(e){var t="    ";if(isNaN(parseInt(e)))t=e;else switch(e){case 1:t=" ";break;case 2:t="  ";break;case 3:t="   ";break;case 4:t="    ";break;case 5:t="     ";break;case 6:t="      ";break;case 7:t="       ";break;case 8:t="        ";break;case 9:t="         ";break;case 10:t="          ";break;case 11:t="           ";break;case 12:t="            ";break}for(var n=["\n"],r=0;r<100;r++)n.push(n[r]+t);return n}function r(){this.step="    ",this.shift=n(this.step)}function i(e,t){return t-(e.replace(/\(/g,"").length-e.replace(/\)/g,"").length)}function o(e,t){return e.replace(/\s{1,}/g," ").replace(/ AND /gi,"~::~"+t+t+"AND ").replace(/ BETWEEN /gi,"~::~"+t+"BETWEEN ").replace(/ CASE /gi,"~::~"+t+"CASE ").replace(/ ELSE /gi,"~::~"+t+"ELSE ").replace(/ END /gi,"~::~"+t+"END ").replace(/ FROM /gi,"~::~FROM ").replace(/ GROUP\s{1,}BY/gi,"~::~GROUP BY ").replace(/ HAVING /gi,"~::~HAVING ").replace(/ IN /gi," IN ").replace(/ JOIN /gi,"~::~JOIN ").replace(/ CROSS~::~{1,}JOIN /gi,"~::~CROSS JOIN ").replace(/ INNER~::~{1,}JOIN /gi,"~::~INNER JOIN ").replace(/ LEFT~::~{1,}JOIN /gi,"~::~LEFT JOIN ").replace(/ RIGHT~::~{1,}JOIN /gi,"~::~RIGHT JOIN ").replace(/ ON /gi,"~::~"+t+"ON ").replace(/ OR /gi,"~::~"+t+t+"OR ").replace(/ ORDER\s{1,}BY/gi,"~::~ORDER BY ").replace(/ OVER /gi,"~::~"+t+"OVER ").replace(/\(\s{0,}SELECT /gi,"~::~(SELECT ").replace(/\)\s{0,}SELECT /gi,")~::~SELECT ").replace(/ THEN /gi," THEN~::~"+t).replace(/ UNION /gi,"~::~UNION~::~").replace(/ USING /gi,"~::~USING ").replace(/ WHEN /gi,"~::~"+t+"WHEN ").replace(/ WHERE /gi,"~::~WHERE ").replace(/ WITH /gi,"~::~WITH ").replace(/ ALL /gi," ALL ").replace(/ AS /gi," AS ").replace(/ ASC /gi," ASC ").replace(/ DESC /gi," DESC ").replace(/ DISTINCT /gi," DISTINCT ").replace(/ EXISTS /gi," EXISTS ").replace(/ NOT /gi," NOT ").replace(/ NULL /gi," NULL ").replace(/ LIKE /gi," LIKE ").replace(/\s{0,}SELECT /gi,"SELECT ").replace(/\s{0,}UPDATE /gi,"UPDATE ").replace(/ SET /gi," SET ").replace(/~::~{1,}/g,"~::~").split("~::~")}r.prototype.xml=function(e,t){var r=e.replace(/>\s{0,}</g,"><").replace(/</g,"~::~<").replace(/\s*xmlns\:/g,"~::~xmlns:").replace(/\s*xmlns\=/g,"~::~xmlns=").split("~::~"),i=r.length,o=!1,a=0,s="",l=0,c=t?n(t):this.shift;for(l=0;l<i;l++)r[l].search(/<!/)>-1?(s+=c[a]+r[l],o=!0,(r[l].search(/-->/)>-1||r[l].search(/\]>/)>-1||r[l].search(/!DOCTYPE/)>-1)&&(o=!1)):r[l].search(/-->/)>-1||r[l].search(/\]>/)>-1?(s+=r[l],o=!1):/^<\w/.exec(r[l-1])&&/^<\/\w/.exec(r[l])&&/^<[\w:\-\.\,]+/.exec(r[l-1])==/^<\/[\w:\-\.\,]+/.exec(r[l])[0].replace("/","")?(s+=r[l],o||a--):r[l].search(/<\w/)>-1&&-1==r[l].search(/<\//)&&-1==r[l].search(/\/>/)?s=s+=o?r[l]:c[a++]+r[l]:r[l].search(/<\w/)>-1&&r[l].search(/<\//)>-1?s=s+=o?r[l]:c[a]+r[l]:r[l].search(/<\//)>-1?s=s+=o?r[l]:c[--a]+r[l]:r[l].search(/\/>/)>-1?s=s+=o?r[l]:c[a]+r[l]:r[l].search(/<\?/)>-1||r[l].search(/xmlns\:/)>-1||r[l].search(/xmlns\=/)>-1?s+=c[a]+r[l]:s+=r[l];return"\n"==s[0]?s.slice(1):s},r.prototype.json=function(e,t){t=t||this.step;return"undefined"===typeof JSON?e:"string"===typeof e?JSON.stringify(JSON.parse(e),null,t):"object"===typeof e?JSON.stringify(e,null,t):e},r.prototype.css=function(e,t){var r=e.replace(/\s{1,}/g," ").replace(/\{/g,"{~::~").replace(/\}/g,"~::~}~::~").replace(/\;/g,";~::~").replace(/\/\*/g,"~::~/*").replace(/\*\//g,"*/~::~").replace(/~::~\s{0,}~::~/g,"~::~").split("~::~"),i=r.length,o=0,a="",s=0,l=t?n(t):this.shift;for(s=0;s<i;s++)/\{/.exec(r[s])?a+=l[o++]+r[s]:/\}/.exec(r[s])?a+=l[--o]+r[s]:(/\*\\/.exec(r[s]),a+=l[o]+r[s]);return a.replace(/^\n{1,}/,"")},r.prototype.sql=function(e,t){var r=e.replace(/\s{1,}/g," ").replace(/\'/gi,"~::~'").split("~::~"),a=r.length,s=[],l=0,c=this.step,u=0,d="",p=0,f=t?n(t):this.shift;for(p=0;p<a;p++)s=p%2?s.concat(r[p]):s.concat(o(r[p],c));for(a=s.length,p=0;p<a;p++){u=i(s[p],u),/\s{0,}\s{0,}SELECT\s{0,}/.exec(s[p])&&(s[p]=s[p].replace(/\,/g,",\n"+c+c)),/\s{0,}\s{0,}SET\s{0,}/.exec(s[p])&&(s[p]=s[p].replace(/\,/g,",\n"+c+c)),/\s{0,}\(\s{0,}SELECT\s{0,}/.exec(s[p])?(l++,d+=f[l]+s[p]):/\'/.exec(s[p])?(u<1&&l&&l--,d+=s[p]):(d+=f[l]+s[p],u<1&&l&&l--)}return d=d.replace(/^\n{1,}/,"").replace(/\n{1,}/g,"\n"),d},r.prototype.xmlmin=function(e,t){var n=t?e:e.replace(/\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>/g,"").replace(/[ \r\n\t]{1,}xmlns/g," xmlns");return n.replace(/>\s{0,}</g,"><")},r.prototype.jsonmin=function(e){return"undefined"===typeof JSON?e:JSON.stringify(JSON.parse(e),null,0)},r.prototype.cssmin=function(e,t){var n=t?e:e.replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g,"");return n.replace(/\s{1,}/g," ").replace(/\{\s{1,}/g,"{").replace(/\}\s{1,}/g,"}").replace(/\;\s{1,}/g,";").replace(/\/\*\s{1,}/g,"/*").replace(/\*\/\s{1,}/g,"*/")},r.prototype.sqlmin=function(e){return e.replace(/\s{1,}/g," ").replace(/\s{1,}\(/,"(").replace(/\s{1,}\)/,")")},e.exports=new r},3752:function(e,t,n){"use strict";n("80ff")},3777:function(e,t,n){"use strict";n("fadf")},"4c3b":function(e){e.exports=JSON.parse('{"name":"Flowable","uri":"http://flowable.org/bpmn","prefix":"flowable","xml":{"tagAlias":"lowerCase"},"associations":[],"types":[{"name":"InOutBinding","superClass":["Element"],"isAbstract":true,"properties":[{"name":"source","isAttr":true,"type":"String"},{"name":"sourceExpression","isAttr":true,"type":"String"},{"name":"target","isAttr":true,"type":"String"},{"name":"businessKey","isAttr":true,"type":"String"},{"name":"local","isAttr":true,"type":"Boolean","default":false},{"name":"variables","isAttr":true,"type":"String"}]},{"name":"In","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity"]}},{"name":"Out","superClass":["InOutBinding"],"meta":{"allowedIn":["bpmn:CallActivity"]}},{"name":"AsyncCapable","isAbstract":true,"extends":["bpmn:Activity","bpmn:Gateway","bpmn:Event"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false},{"name":"asyncBefore","isAttr":true,"type":"Boolean","default":false},{"name":"asyncAfter","isAttr":true,"type":"Boolean","default":false},{"name":"exclusive","isAttr":true,"type":"Boolean","default":true}]},{"name":"flowable:in","superClass":["Element"],"properties":[{"name":"source","type":"string","isAttr":true},{"name":"target","type":"string","isAttr":true}]},{"name":"flowable:out","superClass":["Element"],"properties":[{"name":"source","type":"string","isAttr":true},{"name":"target","type":"string","isAttr":true}]},{"name":"BoundaryEvent","superClass":["CatchEvent"],"properties":[{"name":"cancelActivity","default":true,"isAttr":true,"type":"Boolean"},{"name":"attachedToRef","type":"Activity","isAttr":true,"isReference":true}]},{"name":"JobPriorized","isAbstract":true,"extends":["bpmn:Process","flowable:AsyncCapable"],"properties":[{"name":"jobPriority","isAttr":true,"type":"String"}]},{"name":"SignalEventDefinition","isAbstract":true,"extends":["bpmn:SignalEventDefinition"],"properties":[{"name":"async","isAttr":true,"type":"Boolean","default":false}]},{"name":"ErrorEventDefinition","isAbstract":true,"extends":["bpmn:ErrorEventDefinition"],"properties":[{"name":"errorCodeVariable","isAttr":true,"type":"String"},{"name":"errorMessageVariable","isAttr":true,"type":"String"}]},{"name":"Error","isAbstract":true,"extends":["bpmn:Error"],"properties":[{"name":"flowable:errorMessage","isAttr":true,"type":"String"}]},{"name":"PotentialStarter","superClass":["Element"],"properties":[{"name":"resourceAssignmentExpression","type":"bpmn:ResourceAssignmentExpression"}]},{"name":"UserTask","isAbstract":true,"extends":["bpmn:UserTask"],"properties":[{"name":"timerEventDefinition","type":"Expression"},{"name":"multiInstanceLoopCharacteristics","type":"MultiInstanceLoopCharacteristics"}]},{"name":"StartEvent","isAbstract":true,"extends":["bpmn:StartEvent"],"properties":[{"name":"timerEventDefinition","type":"Expression"}]},{"name":"FormSupported","isAbstract":true,"extends":["bpmn:StartEvent","bpmn:UserTask"],"properties":[{"name":"formHandlerClass","isAttr":true,"type":"String"},{"name":"formKey","isAttr":true,"type":"String"}]},{"name":"TemplateSupported","isAbstract":true,"extends":["bpmn:Process","bpmn:FlowElement"],"properties":[{"name":"modelerTemplate","isAttr":true,"type":"String"}]},{"name":"Initiator","isAbstract":true,"extends":["bpmn:StartEvent"],"properties":[{"name":"initiator","isAttr":true,"type":"String"}]},{"name":"ScriptTask","isAbstract":true,"extends":["bpmn:ScriptTask"],"properties":[{"name":"resultVariable","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Process","isAbstract":true,"extends":["bpmn:Process"],"properties":[{"name":"candidateStarterGroups","isAttr":true,"type":"String"},{"name":"candidateStarterUsers","isAttr":true,"type":"String"},{"name":"versionTag","isAttr":true,"type":"String"},{"name":"historyTimeToLive","isAttr":true,"type":"String"},{"name":"isStartableInTasklist","isAttr":true,"type":"Boolean","default":true}]},{"name":"EscalationEventDefinition","isAbstract":true,"extends":["bpmn:EscalationEventDefinition"],"properties":[{"name":"escalationCodeVariable","isAttr":true,"type":"String"}]},{"name":"FormalExpression","isAbstract":true,"extends":["bpmn:FormalExpression"],"properties":[{"name":"resource","isAttr":true,"type":"String"}]},{"name":"Assignable","extends":["bpmn:UserTask"],"properties":[{"name":"candidateGroups","isAttr":true,"type":"String"},{"name":"dueDate","isAttr":true,"type":"String"},{"name":"followUpDate","isAttr":true,"type":"String"},{"name":"priority","isAttr":true,"type":"String"}]},{"name":"CallActivity","extends":["bpmn:CallActivity"],"properties":[{"name":"calledElementBinding","isAttr":true,"type":"String","default":"latest"},{"name":"calledElementVersion","isAttr":true,"type":"String"},{"name":"calledElementVersionTag","isAttr":true,"type":"String"},{"name":"calledElementTenantId","isAttr":true,"type":"String"},{"name":"caseRef","isAttr":true,"type":"String"},{"name":"caseBinding","isAttr":true,"type":"String","default":"latest"},{"name":"caseVersion","isAttr":true,"type":"String"},{"name":"caseTenantId","isAttr":true,"type":"String"},{"name":"variableMappingClass","isAttr":true,"type":"String"},{"name":"variableMappingDelegateExpression","isAttr":true,"type":"String"}]},{"name":"ServiceTaskLike","extends":["bpmn:ServiceTask","bpmn:BusinessRuleTask","bpmn:SendTask","bpmn:MessageEventDefinition"],"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"resultVariable","isAttr":true,"type":"String"}]},{"name":"ExclusiveGateway","isAbstract":true,"extends":["bpmn:ExclusiveGateway"],"properties":[{"name":"serviceClass","isAttr":true,"type":"String"}]},{"name":"DmnCapable","extends":["bpmn:BusinessRuleTask"],"properties":[{"name":"decisionRef","isAttr":true,"type":"String"},{"name":"decisionRefBinding","isAttr":true,"type":"String","default":"latest"},{"name":"decisionRefVersion","isAttr":true,"type":"String"},{"name":"mapDecisionResult","isAttr":true,"type":"String","default":"resultList"},{"name":"decisionRefTenantId","isAttr":true,"type":"String"}]},{"name":"ExternalCapable","extends":["flowable:ServiceTaskLike"],"properties":[{"name":"type","isAttr":true,"type":"String"},{"name":"topic","isAttr":true,"type":"String"}]},{"name":"TaskPriorized","extends":["bpmn:Process","flowable:ExternalCapable"],"properties":[{"name":"taskPriority","isAttr":true,"type":"String"}]},{"name":"Properties","superClass":["Element"],"meta":{"allowedIn":["*"]},"properties":[{"name":"values","type":"Property","isMany":true}]},{"name":"Property","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"value","type":"String","isAttr":true}]},{"name":"Connector","superClass":["Element"],"meta":{"allowedIn":["flowable:ServiceTaskLike"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"}]},{"name":"InputOutput","superClass":["Element"],"meta":{"allowedIn":["bpmn:FlowNode","flowable:Connector"]},"properties":[{"name":"inputOutput","type":"InputOutput"},{"name":"connectorId","type":"String"},{"name":"inputParameters","isMany":true,"type":"InputParameter"},{"name":"outputParameters","isMany":true,"type":"OutputParameter"}]},{"name":"InputOutputParameter","properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"InputOutputParameterDefinition","isAbstract":true},{"name":"List","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"items","isMany":true,"type":"InputOutputParameterDefinition"}]},{"name":"Map","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"entries","isMany":true,"type":"Entry"}]},{"name":"Entry","properties":[{"name":"key","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"},{"name":"definition","type":"InputOutputParameterDefinition"}]},{"name":"Value","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"id","isAttr":true,"type":"String"},{"name":"name","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Script","superClass":["InputOutputParameterDefinition"],"properties":[{"name":"scriptFormat","isAttr":true,"type":"String"},{"name":"resource","isAttr":true,"type":"String"},{"name":"value","isBody":true,"type":"String"}]},{"name":"Field","superClass":["Element"],"meta":{"allowedIn":["flowable:ServiceTaskLike","flowable:ExecutionListener","flowable:TaskListener"]},"properties":[{"name":"name","isAttr":true,"type":"String"},{"name":"expression","isAttr":true,"type":"expression"},{"name":"string","type":"string"},{"name":"stringValue","isAttr":true,"type":"String"}]},{"name":"string","superClass":["Element"],"meta":{"allowedIn":["flowable:Field"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"expression","superClass":["Element"],"meta":{"allowedIn":["flowable:Field"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"InputParameter","superClass":["InputOutputParameter"]},{"name":"OutputParameter","superClass":["InputOutputParameter"]},{"name":"Collectable","isAbstract":true,"extends":["bpmn:MultiInstanceLoopCharacteristics"],"superClass":["flowable:AsyncCapable"],"properties":[{"name":"collection","isAttr":true,"type":"String"},{"name":"elementVariable","isAttr":true,"type":"String"}]},{"name":"SequenceFlow","superClass":["FlowElement"],"properties":[{"name":"isImmediate","isAttr":true,"type":"Boolean"},{"name":"conditionExpression","type":"Expression"},{"name":"sourceRef","type":"FlowNode","isAttr":true,"isReference":true},{"name":"targetRef","type":"FlowNode","isAttr":true,"isReference":true}]},{"name":"MultiInstanceLoopCharacteristics","superClass":["LoopCharacteristics"],"properties":[{"name":"isSequential","default":false,"isAttr":true,"type":"Boolean"},{"name":"behavior","type":"MultiInstanceBehavior","default":"All","isAttr":true},{"name":"loopCardinality","type":"Expression","xml":{"serialize":"xsi:type"}},{"name":"loopDataInputRef","type":"ItemAwareElement","isReference":true},{"name":"loopDataOutputRef","type":"ItemAwareElement","isReference":true},{"name":"inputDataItem","type":"DataInput","xml":{"serialize":"property"}},{"name":"outputDataItem","type":"DataOutput","xml":{"serialize":"property"}},{"name":"complexBehaviorDefinition","type":"ComplexBehaviorDefinition","isMany":true},{"name":"completionCondition","type":"Expression","xml":{"serialize":"xsi:type"}},{"name":"oneBehaviorEventRef","type":"EventDefinition","isAttr":true,"isReference":true},{"name":"noneBehaviorEventRef","type":"EventDefinition","isAttr":true,"isReference":true}]},{"name":"FailedJobRetryTimeCycle","superClass":["Element"],"meta":{"allowedIn":["flowable:AsyncCapable","bpmn:MultiInstanceLoopCharacteristics"]},"properties":[{"name":"body","isBody":true,"type":"String"}]},{"name":"ExecutionListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:Task","bpmn:ServiceTask","bpmn:UserTask","bpmn:BusinessRuleTask","bpmn:ScriptTask","bpmn:ReceiveTask","bpmn:ManualTask","bpmn:ExclusiveGateway","bpmn:SequenceFlow","bpmn:ParallelGateway","bpmn:InclusiveGateway","bpmn:EventBasedGateway","bpmn:StartEvent","bpmn:IntermediateCatchEvent","bpmn:IntermediateThrowEvent","bpmn:EndEvent","bpmn:BoundaryEvent","bpmn:CallActivity","bpmn:SubProcess","bpmn:Process"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true}]},{"name":"TaskListener","superClass":["Element"],"meta":{"allowedIn":["bpmn:UserTask"]},"properties":[{"name":"expression","isAttr":true,"type":"String"},{"name":"class","isAttr":true,"type":"String"},{"name":"delegateExpression","isAttr":true,"type":"String"},{"name":"event","isAttr":true,"type":"String"},{"name":"script","type":"Script"},{"name":"fields","type":"Field","isMany":true}]},{"name":"FormProperty","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"id","type":"String","isAttr":true},{"name":"name","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"required","type":"String","isAttr":true},{"name":"readable","type":"String","isAttr":true},{"name":"writable","type":"String","isAttr":true},{"name":"variable","type":"String","isAttr":true},{"name":"expression","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"default","type":"String","isAttr":true},{"name":"values","type":"Value","isMany":true}]},{"name":"FormData","superClass":["Element"],"meta":{"allowedIn":["bpmn:StartEvent","bpmn:UserTask"]},"properties":[{"name":"fields","type":"FormField","isMany":true},{"name":"businessKey","type":"String","isAttr":true}]},{"name":"FormField","superClass":["Element"],"properties":[{"name":"id","type":"String","isAttr":true},{"name":"label","type":"String","isAttr":true},{"name":"type","type":"String","isAttr":true},{"name":"datePattern","type":"String","isAttr":true},{"name":"defaultValue","type":"String","isAttr":true},{"name":"properties","type":"Properties"},{"name":"validation","type":"Validation"},{"name":"values","type":"Value","isMany":true}]},{"name":"Validation","superClass":["Element"],"properties":[{"name":"constraints","type":"Constraint","isMany":true}]},{"name":"Constraint","superClass":["Element"],"properties":[{"name":"name","type":"String","isAttr":true},{"name":"config","type":"String","isAttr":true}]},{"name":"ConditionalEventDefinition","isAbstract":true,"extends":["bpmn:ConditionalEventDefinition"],"properties":[{"name":"variableName","isAttr":true,"type":"String"},{"name":"variableEvent","isAttr":true,"type":"String"}]}],"emumerations":[]}')},"56b3":function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\/(\d+)/.exec(e),d=u&&+u[1],p=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),g=f&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),v=/Android/.test(e),y=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),w=/\bCrOS\b/.test(e),x=/win/i.test(t),C=p&&e.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(p=!1,l=!0);var S=b&&(c||p&&(null==C||C<12.11)),k=n||a&&s>=9;function D(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,T=function(e,t){var n=e.className,r=D(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function E(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function A(e,t){return E(e).appendChild(t)}function M(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function O(e,t,n,r){var i=M(e,t,n,r);return i.setAttribute("role","presentation"),i}function N(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function I(e){var t,n=e.ownerDocument||e;try{t=e.activeElement}catch(r){t=n.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement)t=t.shadowRoot.activeElement;return t}function P(e,t){var n=e.className;D(t).test(n)||(e.className+=(n?" ":"")+t)}function F(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!D(n[r]).test(t)&&(t+=" "+n[r]);return t}L=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var _=function(e){e.select()};function R(e){return e.display.wrapper.ownerDocument}function W(e){return V(e.display.wrapper)}function V(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function z(e){return R(e).defaultView}function B(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function $(e,t,n){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===n&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function H(e,t,n,r,i){null==t&&(t=e.search(/[^\s\u00a0]/),-1==t&&(t=e.length));for(var o=r||0,a=i||0;;){var s=e.indexOf("\t",o);if(s<0||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}g?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(_=function(e){try{e.select()}catch(t){}});var j=function(){this.id=null,this.f=null,this.time=0,this.handler=B(this.onTimeout,this)};function U(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}j.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},j.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};var G=50,K={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},X={origin:"*mouse"},Y={origin:"+move"};function J(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);-1==o&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var Z=[""];function Q(e){while(Z.length<=e)Z.push(ee(Z)+" ");return Z[e]}function ee(e){return e[e.length-1]}function te(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function ne(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function re(){}function ie(e,t){var n;return Object.create?n=Object.create(e):(re.prototype=e,n=new re),t&&$(t,n),n}var oe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ae(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||oe.test(e))}function se(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ae(e))||t.test(e):ae(e)}function le(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ce=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ue(e){return e.charCodeAt(0)>=768&&ce.test(e)}function de(e,t,n){while((n<0?t>0:t<e.length)&&ue(e.charAt(t)))t+=n;return t}function pe(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function fe(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var he=null;function me(e,t,n){var r;he=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:he=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:he=i)}return null!=r?r:he}var ge=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!r.test(e))return!1;for(var u=e.length,d=[],p=0;p<u;++p)d.push(n(e.charCodeAt(p)));for(var f=0,h=c;f<u;++f){var m=d[f];"m"==m?d[f]=h:h=m}for(var g=0,v=c;g<u;++g){var y=d[g];"1"==y&&"r"==v?d[g]="n":o.test(y)&&(v=y,"r"==y&&(d[g]="R"))}for(var b=1,w=d[0];b<u-1;++b){var x=d[b];"+"==x&&"1"==w&&"1"==d[b+1]?d[b]="1":","!=x||w!=d[b+1]||"1"!=w&&"n"!=w||(d[b]=w),w=x}for(var C=0;C<u;++C){var S=d[C];if(","==S)d[C]="N";else if("%"==S){var k=void 0;for(k=C+1;k<u&&"%"==d[k];++k);for(var D=C&&"!"==d[C-1]||k<u&&"1"==d[k]?"1":"N",L=C;L<k;++L)d[L]=D;C=k-1}}for(var T=0,E=c;T<u;++T){var A=d[T];"L"==E&&"1"==A?d[T]="L":o.test(A)&&(E=A)}for(var M=0;M<u;++M)if(i.test(d[M])){var O=void 0;for(O=M+1;O<u&&i.test(d[O]);++O);for(var N="L"==(M?d[M-1]:c),I="L"==(O<u?d[O]:c),P=N==I?N?"L":"R":c,F=M;F<O;++F)d[F]=P;M=O-1}for(var _,R=[],W=0;W<u;)if(a.test(d[W])){var V=W;for(++W;W<u&&a.test(d[W]);++W);R.push(new l(0,V,W))}else{var z=W,B=R.length,$="rtl"==t?1:0;for(++W;W<u&&"L"!=d[W];++W);for(var H=z;H<W;)if(s.test(d[H])){z<H&&(R.splice(B,0,new l(1,z,H)),B+=$);var j=H;for(++H;H<W&&s.test(d[H]);++H);R.splice(B,0,new l(2,j,H)),B+=$,z=H}else++H;z<W&&R.splice(B,0,new l(1,z,W))}return"ltr"==t&&(1==R[0].level&&(_=e.match(/^\s+/))&&(R[0].from=_[0].length,R.unshift(new l(0,0,_[0].length))),1==ee(R).level&&(_=e.match(/\s+$/))&&(ee(R).to-=_[0].length,R.push(new l(0,u-_[0].length,u)))),"rtl"==t?R.reverse():R}}();function ve(e,t){var n=e.order;return null==n&&(n=e.order=ge(e.text,t)),n}var ye=[],be=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ye).concat(n)}};function we(e,t){return e._handlers&&e._handlers[t]||ye}function xe(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=U(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ce(e,t){var n=we(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Se(e,t,n){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ce(e,n||t.type,e,t),Ae(t)||t.codemirrorIgnore}function ke(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==U(n,t[r])&&n.push(t[r])}function De(e,t){return we(e,t).length>0}function Le(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){xe(this,e,t)}}function Te(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ae(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){Te(e),Ee(e)}function Oe(e){return e.target||e.srcElement}function Ne(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ie,Pe,Fe=function(){if(a&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function _e(e){if(null==Ie){var t=M("span","​");A(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ie=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ie?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Re(e){if(null!=Pe)return Pe;var t=A(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return E(e),!(!n||n.left==n.right)&&(Pe=r.right-n.right<3)}var We=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ve=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},ze=function(){var e=M("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Be=null;function $e(e){if(null!=Be)return Be;var t=A(e,M("span","x")),n=t.getBoundingClientRect(),r=L(t,0,1).getBoundingClientRect();return Be=Math.abs(n.left-r.left)>1}var He={},je={};function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),He[e]=t}function Ge(e,t){je[e]=t}function Ke(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),e=ie(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=Ke(t);var n=He[t.name];if(!n)return qe(e,"text/plain");var r=n(e,t);if(Xe.hasOwnProperty(t.name)){var i=Xe[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var Xe={};function Ye(e,t){var n=Xe.hasOwnProperty(e)?Xe[e]:Xe[e]={};$(t,n)}function Je(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ze(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Qe(e,t,n){return!e.startState||e.startState(t,n)}var et=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function tt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function nt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,(function(e){var o=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i})),r}function rt(e,t,n){var r=[];return e.iter(t,n,(function(e){r.push(e.text)})),r}function it(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ot(e){if(null==e.parent)return null;for(var t=e.parent,n=U(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function at(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a],l=s.height;if(t<l)break;t-=l}return n+a}function st(e,t){return t>=e.first&&t<e.first+e.size}function lt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ct(e,t,n){if(void 0===n&&(n=null),!(this instanceof ct))return new ct(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ut(e,t){return e.line-t.line||e.ch-t.ch}function dt(e,t){return e.sticky==t.sticky&&0==ut(e,t)}function pt(e){return ct(e.line,e.ch)}function ft(e,t){return ut(e,t)<0?t:e}function ht(e,t){return ut(e,t)<0?e:t}function mt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function gt(e,t){if(t.line<e.first)return ct(e.first,0);var n=e.first+e.size-1;return t.line>n?ct(n,tt(e,n).text.length):vt(t,tt(e,t.line).text.length)}function vt(e,t){var n=e.ch;return null==n||n>t?ct(e.line,t):n<0?ct(e.line,0):e}function yt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=gt(e,t[r]);return n}et.prototype.eol=function(){return this.pos>=this.string.length},et.prototype.sol=function(){return this.pos==this.lineStart},et.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},et.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},et.prototype.eat=function(e){var t,n=this.string.charAt(this.pos);if(t="string"==typeof e?n==e:n&&(e.test?e.test(n):e(n)),t)return++this.pos,n},et.prototype.eatWhile=function(e){var t=this.pos;while(this.eat(e));return this.pos>t},et.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},et.prototype.skipToEnd=function(){this.pos=this.string.length},et.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},et.prototype.backUp=function(e){this.pos-=e},et.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},et.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},et.prototype.match=function(e,t,n){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return!1!==t&&(this.pos+=e.length),!0},et.prototype.current=function(){return this.string.slice(this.start,this.pos)},et.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},et.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},et.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var bt=function(e,t){this.state=e,this.lookAhead=t},wt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function xt(e,t,n,r){var i=[e.state.modeGen],o={};Mt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,Mt(e,t.text,s.mode,n,(function(e,t){var n=l;while(c<e){var r=i[l];r>e&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;n<l;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"overlay "+t}}),o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Ct(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=St(e,ot(t)),i=t.text.length>e.options.maxHighlightLength&&Je(e.doc.mode,r.state),o=xt(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function St(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new wt(r,!0,t);var o=Ot(e,t,n),a=o>r.first&&tt(r,o-1).stateAfter,s=a?wt.fromSaved(r,a,o):new wt(r,Qe(r.mode),o);return r.iter(o,t,(function(n){kt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&r<i.viewTo?s.save():null,s.nextLine()})),n&&(r.modeFrontier=s.line),s}function kt(e,t,n,r){var i=e.doc.mode,o=new et(t,e.options.tabSize,n);o.start=o.pos=r||0,""==t&&Dt(i,n.state);while(!o.eol())Lt(i,o,n.state),o.start=o.pos}function Dt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=Ze(e,t);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Lt(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Ze(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}wt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},wt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=e)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},wt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wt.fromSaved=function(e,t,n){return t instanceof bt?new wt(e,Je(e.mode,t.state),n,t.lookAhead):new wt(e,Je(e.mode,t),n)},wt.prototype.save=function(e){var t=!1!==e?Je(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new bt(t,this.maxLookAhead):t};var Tt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Et(e,t,n,r){var i,o=e.doc,a=o.mode;t=gt(o,t);var s,l=tt(o,t.line),c=St(e,t.line,n),u=new et(l.text,e.options.tabSize,c);r&&(s=[]);while((r||u.pos<t.ch)&&!u.eol())u.start=u.pos,i=Lt(a,u,c.state),r&&s.push(new Tt(u,i,Je(o.mode,c.state)));return r?s:new Tt(u,i,c.state)}function At(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";null==t[r]?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Mt(e,t,n,r,i,o,a){var s=n.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new et(t,e.options.tabSize,r),p=e.options.addModeClass&&[null];""==t&&At(Dt(n,r.state),o);while(!d.eol()){if(d.pos>e.options.maxHighlightLength?(s=!1,a&&kt(e,t,r,d.pos),d.pos=t.length,l=null):l=At(Lt(n,d,r.state,p),o),p){var f=p[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){while(c<d.start)c=Math.min(d.start,c+5e3),i(c,u);u=l}d.start=d.pos}while(c<d.pos){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}function Ot(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=tt(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof bt?c.lookAhead:0)<=o.modeFrontier))return s;var u=H(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}function Nt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=tt(e,r).stateAfter;if(i&&(!(i instanceof bt)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var It=!1,Pt=!1;function Ft(){It=!0}function _t(){Pt=!0}function Rt(e,t,n){this.marker=e,this.from=t,this.to=n}function Wt(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Vt(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function zt(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Bt(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(s||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){var l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Rt(a,o.from,l?null:o.to))}}return r}function $t(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Rt(a,l?null:o.from-t,null==o.to?null:o.to-t))}}return r}function Ht(e,t){if(t.full)return null;var n=st(e,t.from.line)&&tt(e,t.from.line).markedSpans,r=st(e,t.to.line)&&tt(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=0==ut(t.from,t.to),s=Bt(n,i,a),l=$t(r,o,a),c=1==t.text.length,u=ee(t.text).length+(c?i:0);if(s)for(var d=0;d<s.length;++d){var p=s[d];if(null==p.to){var f=Wt(l,p.marker);f?c&&(p.to=null==f.to?null:f.to+u):p.to=i}}if(l)for(var h=0;h<l.length;++h){var m=l[h];if(null!=m.to&&(m.to+=u),null==m.from){var g=Wt(s,m.marker);g||(m.from=u,c&&(s||(s=[])).push(m))}else m.from+=u,c&&(s||(s=[])).push(m)}s&&(s=jt(s)),l&&l!=s&&(l=jt(l));var v=[s];if(!c){var y,b=t.text.length-2;if(b>0&&s)for(var w=0;w<s.length;++w)null==s[w].to&&(y||(y=[])).push(new Rt(s[w].marker,null,null));for(var x=0;x<b;++x)v.push(y);v.push(l)}return v}function jt(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ut(e,t,n){var r=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;!n.readOnly||r&&-1!=U(r,n)||(r||(r=[])).push(n)}})),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],s=a.find(0),l=0;l<i.length;++l){var c=i[l];if(!(ut(c.to,s.from)<0||ut(c.from,s.to)>0)){var u=[l,1],d=ut(c.from,s.from),p=ut(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}function Gt(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function Kt(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function qt(e){return e.inclusiveLeft?-1:0}function Xt(e){return e.inclusiveRight?1:0}function Yt(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var r=e.find(),i=t.find(),o=ut(r.from,i.from)||qt(e)-qt(t);if(o)return-o;var a=ut(r.to,i.to)||Xt(e)-Xt(t);return a||t.id-e.id}function Jt(e,t){var n,r=Pt&&e.markedSpans;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!n||Yt(n,i.marker)<0)&&(n=i.marker);return n}function Zt(e){return Jt(e,!0)}function Qt(e){return Jt(e,!1)}function en(e,t){var n,r=Pt&&e.markedSpans;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!n||Yt(n,o.marker)<0)&&(n=o.marker)}return n}function tn(e,t,n,r,i){var o=tt(e,t),a=Pt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=ut(c.from,n)||qt(l.marker)-qt(i),d=ut(c.to,r)||Xt(l.marker)-Xt(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ut(c.to,n)>=0:ut(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ut(c.from,r)<=0:ut(c.from,r)<0)))return!0}}}function nn(e){var t;while(t=Zt(e))e=t.find(-1,!0).line;return e}function rn(e){var t;while(t=Qt(e))e=t.find(1,!0).line;return e}function on(e){var t,n;while(t=Qt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function an(e,t){var n=tt(e,t),r=nn(n);return n==r?t:ot(r)}function sn(e,t){if(t>e.lastLine())return t;var n,r=tt(e,t);if(!ln(e,r))return t;while(n=Qt(r))r=n.find(1,!0).line;return ot(r)+1}function ln(e,t){var n=Pt&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],r.marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&cn(e,t,r))return!0}}function cn(e,t,n){if(null==n.to){var r=n.marker.find(1,!0);return cn(e,r.line,Wt(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(null==i.to||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&cn(e,t,i))return!0}function un(e){e=nn(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==n)break;t+=s.height}return t}function dn(e){if(0==e.height)return 0;var t,n=e.text.length,r=e;while(t=Zt(r)){var i=t.find(0,!0);r=i.from.line,n+=i.from.ch-i.to.ch}r=e;while(t=Qt(r)){var o=t.find(0,!0);n-=r.text.length-o.from.ch,r=o.to.line,n+=r.text.length-o.to.ch}return n}function pn(e){var t=e.display,n=e.doc;t.maxLine=tt(n,n.first),t.maxLineLength=dn(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=dn(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var fn=function(e,t,n){this.text=e,Kt(this,t),this.height=n?n(this):1};function hn(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Gt(e),Kt(e,n);var i=r?r(e):1;i!=e.height&&it(e,i)}function mn(e){e.parent=null,Gt(e)}fn.prototype.lineNo=function(){return ot(this)},Le(fn);var gn={},vn={};function yn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?vn:gn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function bn(e,t){var n=O("span",null,null,l?"padding-right: .1px":null),r={pre:O("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=xn,Re(e.display.measure)&&(a=ve(o,e.doc.direction))&&(r.addToken=Sn(r.addToken,a)),r.map=[];var s=t!=e.display.externalMeasured&&ot(o);Dn(o,r,Ct(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(_e(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var c=r.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ce(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function wn(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function xn(e,t,n,r,i,o,l){if(t){var c,u=e.splitSpaces?Cn(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();var f=0;while(1){d.lastIndex=f;var h=d.exec(t),m=h?h.index-f:t.length-f;if(m){var g=document.createTextNode(u.slice(f,f+m));a&&s<9?c.appendChild(M("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!h)break;f+=m+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=c.appendChild(M("span",Q(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=c.appendChild(M("span","\r"==h[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),a&&s<9?c.appendChild(M("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||r||i||p||o||l){var w=n||"";r&&(w+=r),i&&(w+=i);var x=M("span",[c],w,o);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&x.setAttribute(C,l[C]);return e.content.appendChild(x)}e.content.appendChild(c)}}function Cn(e,t){if(e.length>1&&!/  /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!n||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),r+=o,n=" "==o}return r}function Sn(e,t){return function(n,r,i,o,a,s,l){i=i?i+" cm-force-border":"cm-force-border";for(var c=n.pos,u=c+r.length;;){for(var d=void 0,p=0;p<t.length;p++)if(d=t[p],d.to>c&&d.from<=c)break;if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function kn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Dn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,p,f=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=c=u=s="",p=null,d=null,v=1/0;for(var y=[],b=void 0,w=0;w<r.length;++w){var x=r[w],C=x.marker;if("bookmark"==C.type&&x.from==h&&C.widgetNode)y.push(C);else if(x.from<=h&&(null==x.to||x.to>h||C.collapsed&&x.to==h&&x.from==h)){if(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),C.className&&(l+=" "+C.className),C.css&&(s=(s?s+";":"")+C.css),C.startStyle&&x.from==h&&(u+=" "+C.startStyle),C.endStyle&&x.to==v&&(b||(b=[])).push(C.endStyle,x.to),C.title&&((p||(p={})).title=C.title),C.attributes)for(var S in C.attributes)(p||(p={}))[S]=C.attributes[S];C.collapsed&&(!d||Yt(d.marker,C)<0)&&(d=x)}else x.from>h&&v>x.from&&(v=x.from)}if(b)for(var k=0;k<b.length;k+=2)b[k+1]==v&&(c+=" "+b[k]);if(!d||d.from==h)for(var D=0;D<y.length;++D)kn(t,0,y[D]);if(d&&(d.from||0)==h){if(kn(t,(null==d.to?f+1:d.to)-h,d.marker,null==d.from),null==d.to)return;d.to==h&&(d=!1)}}if(h>=f)break;var L=Math.min(f,v);while(1){if(g){var T=h+g.length;if(!d){var E=T>L?g.slice(0,L-h):g;t.addToken(t,E,a?a+l:l,u,h+E.length==v?c:"",s,p)}if(T>=L){g=g.slice(L-h),h=L;break}h=T,u=""}g=i.slice(o,o=n[m++]),a=yn(n[m++],t.cm.options)}}else for(var A=1;A<n.length;A+=2)t.addToken(t,i.slice(o,o=n[A]),yn(n[A+1],t.cm.options))}function Ln(e,t,n){this.line=t,this.rest=on(t),this.size=this.rest?ot(ee(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ln(e,t)}function Tn(e,t,n){for(var r,i=[],o=t;o<n;o=r){var a=new Ln(e.doc,tt(e.doc,o),o);r=o+a.size,i.push(a)}return i}var En=null;function An(e){En?En.ops.push(e):e.ownsGroup=En={ops:[e],delayedCallbacks:[]}}function Mn(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function On(e,t){var n=e.ownsGroup;if(n)try{Mn(n)}finally{En=null,t(n)}}var Nn=null;function In(e,t){var n=we(e,t);if(n.length){var r,i=Array.prototype.slice.call(arguments,2);En?r=En.delayedCallbacks:Nn?r=Nn:(r=Nn=[],setTimeout(Pn,0));for(var o=function(e){r.push((function(){return n[e].apply(null,i)}))},a=0;a<n.length;++a)o(a)}}function Pn(){var e=Nn;Nn=null;for(var t=0;t<e.length;++t)e[t]()}function Fn(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?Vn(e,t):"gutter"==o?Bn(e,t,n,r):"class"==o?zn(e,t):"widget"==o&&$n(e,t,r)}t.changes=null}function _n(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function Rn(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=_n(t);t.background=r.insertBefore(M("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Wn(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):bn(e,t)}function Vn(e,t){var n=t.text.className,r=Wn(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,zn(e,t)):n&&(t.text.className=n)}function zn(e,t){Rn(e,t),t.line.wrapClass?_n(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Bn(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=_n(t);t.gutterBackground=M("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=_n(t),s=t.gutter=M("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=s.appendChild(M("div",lt(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(M("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function $n(e,t,n){t.alignable&&(t.alignable=null);for(var r=D("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);jn(e,t,n)}function Hn(e,t,n,r){var i=Wn(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),zn(e,t),Bn(e,t,n,r),jn(e,t,r),t.node}function jn(e,t,n){if(Un(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)Un(e,t.rest[r],t,n,!1)}function Un(e,t,n,r,i){if(t.widgets)for(var o=_n(n),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=M("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),Gn(l,c,n,r),e.display.input.setUneditable(c),i&&l.above?o.insertBefore(c,n.gutter||n.text):o.appendChild(c),In(l,"redraw")}}function Gn(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Kn(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!N(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),A(t.display.measure,M("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function qn(e,t){for(var n=Oe(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Xn(e){return e.lineSpace.offsetTop}function Yn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Jn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=A(e.measure,M("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function Zn(e){return G-e.display.nativeBarWidth}function Qn(e){return e.display.scroller.clientWidth-Zn(e)-e.display.barWidth}function er(e){return e.display.scroller.clientHeight-Zn(e)-e.display.barHeight}function tr(e,t,n){var r=e.options.lineWrapping,i=r&&Qn(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];Math.abs(l.bottom-c.bottom)>2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function nr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(ot(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function rr(e,t){t=nn(t);var n=ot(t),r=e.display.externalMeasured=new Ln(e.doc,t,n);r.lineN=n;var i=r.built=bn(e,r);return r.text=i.pre,A(e.display.lineMeasure,i.pre),r}function ir(e,t,n,r){return sr(e,ar(e,t),n,r)}function or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[zr(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function ar(e,t){var n=ot(t),r=or(e,n);r&&!r.text?r=null:r&&r.changes&&(Fn(e,r,n,Fr(e)),e.curOp.forceUpdate=!0),r||(r=rr(e,t));var i=nr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function sr(e,t,n,r,i){t.before&&(n=-1);var o,a=n+(r||"");return t.cache.hasOwnProperty(a)?o=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(tr(e,t.view,t.rect),t.hasHeights=!0),o=pr(e,t,n,r),o.bogus||(t.cache[a]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}var lr,cr={left:0,right:0,top:0,bottom:0};function ur(e,t,n){for(var r,i,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(i=0,o=1,a="left"):t<l?(i=t-s,o=i+1):(c==e.length-3||t==l&&e[c+3]>t)&&(o=l-s,i=o-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)while(c&&e[c-2]==e[c-3]&&e[c-1].insertLeft)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)while(c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft)r=e[(c+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:s,coverEnd:l}}function dr(e,t){var n=cr;if("left"==t){for(var r=0;r<e.length;r++)if((n=e[r]).left!=n.right)break}else for(var i=e.length-1;i>=0;i--)if((n=e[i]).left!=n.right)break;return n}function pr(e,t,n,r){var i,o=ur(t.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var p=0;p<4;p++){while(c&&ue(t.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u<o.coverEnd&&ue(t.line.text.charAt(o.coverStart+u)))++u;if(i=a&&s<9&&0==c&&u==o.coverEnd-o.coverStart?l.parentNode.getBoundingClientRect():dr(L(l,c,u).getClientRects(),r),i.left||i.right||0==c)break;u=c,c-=1,d="right"}a&&s<11&&(i=fr(e.display.measure,i))}else{var f;c>0&&(d=r="right"),i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+Pr(e.display),top:h.top,bottom:h.bottom}:cr}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;b<y.length-1;b++)if(v<y[b])break;var w=b?y[b-1]:0,x=y[b],C={left:("right"==d?i.right:i.left)-t.rect.left,right:("left"==d?i.left:i.right)-t.rect.left,top:w,bottom:x};return i.left||i.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=m,C.rbottom=g),C}function fr(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!$e(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function hr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function mr(e){e.display.externalMeasure=null,E(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)hr(e.display.view[t])}function gr(e){mr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function vr(e){return u&&v?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function yr(e){return u&&v?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function br(e){var t=nn(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Kn(n[i]));return r}function wr(e,t,n,r,i){if(!i){var o=br(t);n.top+=o,n.bottom+=o}if("line"==r)return n;r||(r="local");var a=un(t);if("local"==r?a+=Xn(e.display):a-=e.display.viewOffset,"page"==r||"window"==r){var s=e.display.lineSpace.getBoundingClientRect();a+=s.top+("window"==r?0:yr(R(e)));var l=s.left+("window"==r?0:vr(R(e)));n.left+=l,n.right+=l}return n.top+=a,n.bottom+=a,n}function xr(e,t,n){if("div"==n)return t;var r=t.left,i=t.top;if("page"==n)r-=vr(R(e)),i-=yr(R(e));else if("local"==n||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Cr(e,t,n,r,i){return r||(r=tt(e.doc,t.line)),wr(e,r,ir(e,r,t.ch,i),n)}function Sr(e,t,n,r,i,o){function a(t,a){var s=sr(e,i,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,wr(e,r,s,n)}r=r||tt(e.doc,t.line),i||(i=ar(e,r));var s=ve(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=s[t],i=1==r.level;return a(n?e-1:e,i!=n)}var d=me(s,l,c),p=he,f=u(l,d,"before"==c);return null!=p&&(f.other=u(l,p,"before"!=c)),f}function kr(e,t){var n=0;t=gt(e.doc,t),e.options.lineWrapping||(n=Pr(e.display)*t.ch);var r=tt(e.doc,t.line),i=un(r)+Xn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Dr(e,t,n,r,i){var o=ct(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Lr(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Dr(r.first,0,null,-1,-1);var i=at(r,n),o=r.first+r.size-1;if(i>o)return Dr(r.first+r.size-1,tt(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=tt(r,i);;){var s=Mr(e,a,i,t,n),l=en(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=tt(r,i=c.line)}}function Tr(e,t,n,r){r-=br(t);var i=t.text.length,o=pe((function(t){return sr(e,n,t-1).bottom<=r}),i,0);return i=pe((function(t){return sr(e,n,t).top>r}),o,i),{begin:o,end:i}}function Er(e,t,n,r){n||(n=ar(e,t));var i=wr(e,t,sr(e,n,r),"line").top;return Tr(e,t,n,i)}function Ar(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function Mr(e,t,n,r,i){i-=un(t);var o=ar(e,t),a=br(t),s=0,l=t.text.length,c=!0,u=ve(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Nr:Or)(e,t,n,o,u,r,i);c=1!=d.level,s=c?d.from:d.to-1,l=c?d.to:d.from-1}var p,f,h=null,m=null,g=pe((function(t){var n=sr(e,o,t);return n.top+=a,n.bottom+=a,!!Ar(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,l),v=!1;if(m){var y=r-m.left<m.right-r,b=y==c;g=h+(b?0:1),f=b?"after":"before",p=y?m.left:m.right}else{c||g!=l&&g!=s||g++,f=0==g?"after":g==t.text.length?"before":sr(e,o,g-(c?1:0)).bottom+a<=i==c?"after":"before";var w=Sr(e,ct(n,g,f),"line",t,o);p=w.left,v=i<w.top?-1:i>=w.bottom?1:0}return g=de(t.text,g,1),Dr(n,g,f,v,r-p)}function Or(e,t,n,r,i,o,a){var s=pe((function(s){var l=i[s],c=1!=l.level;return Ar(Sr(e,ct(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Sr(e,ct(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Ar(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l}function Nr(e,t,n,r,i,o,a){var s=Tr(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<i.length;p++){var f=i[p];if(!(f.from>=c||f.to<=l)){var h=1!=f.level,m=sr(e,r,h?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=m<o?o-m+1e9:m-o;(!u||d>g)&&(u=f,d=g)}}return u||(u=i[i.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function Ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==lr){lr=M("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)lr.appendChild(document.createTextNode("x")),lr.appendChild(M("br"));lr.appendChild(document.createTextNode("x"))}A(e.measure,lr);var n=lr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),E(e.measure),n||1}function Pr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),n=M("pre",[t],"CodeMirror-line-like");A(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Fr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:_r(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function _r(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Rr(e){var t=Ir(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Pr(e.display)-3);return function(i){if(ln(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Wr(e){var t=e.doc,n=Rr(e);t.iter((function(e){var t=n(e);t!=e.height&&it(e,t)}))}function Vr(e,t,n,r){var i=e.display;if(!n&&"true"==Oe(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(d){return null}var l,c=Lr(e,o,a);if(r&&c.xRel>0&&(l=tt(e.doc,c.line).text).length==c.ch){var u=H(l,l.length,e.options.tabSize)-l.length;c=ct(c.line,Math.max(0,Math.round((o-Jn(e.display).left)/Pr(e.display))-u))}return c}function zr(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function Br(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Pt&&an(e.doc,t)<i.viewTo&&Hr(e);else if(n<=i.viewFrom)Pt&&sn(e.doc,n+r)>i.viewFrom?Hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Hr(e);else if(t<=i.viewFrom){var o=jr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Hr(e)}else if(n>=i.viewTo){var a=jr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Hr(e)}else{var s=jr(e,t,t,-1),l=jr(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(Tn(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Hr(e)}var c=i.externalMeasured;c&&(n<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(i.externalMeasured=null))}function $r(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[zr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==U(a,n)&&a.push(n)}}}function Hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function jr(e,t,n,r){var i,o=zr(e,t),a=e.display.view;if(!Pt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(r>0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}while(an(e.doc,n)!=n){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Ur(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Tn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Tn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(zr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Tn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,zr(e,n)))),r.viewTo=n}function Gr(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];i.hidden||i.node&&!i.changes||++n}return n}function Kr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function qr(e,t){void 0===t&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var s=0;s<n.sel.ranges.length;s++)if(t||s!=n.sel.primIndex){var l=n.sel.ranges[s];if(!(l.from().line>=e.display.viewTo||l.to().line<e.display.viewFrom)){var c=l.empty();if(a){var u=a(e,l);u&&Xr(e,u,i)}else(c||e.options.showCursorWhenSelecting)&&Xr(e,l.head,i);c||Jr(e,l,o)}}return r}function Xr(e,t,n){var r=Sr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(M("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Cr(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(M("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function Yr(e,t){return e.top-t.top||e.left-t.left}function Jr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Jn(e.display),s=a.left,l=Math.max(r.sizerWidth,Qn(e)-r.sizer.offsetLeft)-a.right,c="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(M("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==n?l-e:n)+"px;\n                             height: "+(r-t)+"px"))}function d(t,n,r){var o,a,d=tt(i,t),p=d.text.length;function f(n,r){return Cr(e,ct(t,n),"div",d,r)}function h(t,n,r){var i=Er(e,d,null,t),o="ltr"==n==("after"==r)?"left":"right",a="after"==r?i.begin:i.end-(/\s/.test(d.text.charAt(i.end-1))?2:1);return f(a,o)[o]}var m=ve(d,i.direction);return fe(m,n||0,null==r?p:r,(function(e,t,i,d){var g="ltr"==i,v=f(e,g?"left":"right"),y=f(t-1,g?"right":"left"),b=null==n&&0==e,w=null==r&&t==p,x=0==d,C=!m||d==m.length-1;if(y.top-v.top<=3){var S=(c?b:w)&&x,k=(c?w:b)&&C,D=S?s:(g?v:y).left,L=k?l:(g?y:v).right;u(D,v.top,L-D,v.bottom)}else{var T,E,A,M;g?(T=c&&b&&x?s:v.left,E=c?l:h(e,i,"before"),A=c?s:h(t,i,"after"),M=c&&w&&C?l:y.right):(T=c?h(e,i,"before"):s,E=!c&&b&&x?l:v.right,A=!c&&w&&C?s:y.left,M=c?h(t,i,"after"):l),u(T,v.top,E-T,v.bottom),v.bottom<y.top&&u(s,v.bottom,null,y.top),u(A,y.top,M-A,y.bottom)}(!o||Yr(v,o)<0)&&(o=v),Yr(y,o)<0&&(o=y),(!a||Yr(v,a)<0)&&(a=v),Yr(y,a)<0&&(a=y)})),{start:o,end:a}}var p=t.from(),f=t.to();if(p.line==f.line)d(p.line,p.ch,f.ch);else{var h=tt(i,p.line),m=tt(i,f.line),g=nn(h)==nn(m),v=d(p.line,p.ch,g?h.text.length+1:null).end,y=d(f.line,g?0:null,f.ch).start;g&&(v.top<y.top-2?(u(v.right,v.top,null,v.bottom),u(s,y.top,y.left,y.bottom)):u(v.right,v.top,y.left-v.right,v.bottom)),v.bottom<y.top&&u(s,v.bottom,null,y.top)}n.appendChild(o)}function Zr(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||ni(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Qr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ti(e))}function ei(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ni(e))}),100)}function ti(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ce(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Zr(e))}function ni(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ce(e,"blur",e,t),e.state.focused=!1,T(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function ri(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var c=t.view[l],u=e.options.lineWrapping,d=void 0,p=0;if(!c.hidden){if(i+=c.line.height,a&&s<8){var f=c.node.offsetTop+c.node.offsetHeight;d=f-n,n=f}else{var h=c.node.getBoundingClientRect();d=h.bottom-h.top,!u&&c.text.firstChild&&(p=c.text.firstChild.getBoundingClientRect().right-h.left-1)}var m=c.line.height-d;if((m>.005||m<-.005)&&(i<r&&(o-=m),it(c.line,d),ii(c.line),c.rest))for(var g=0;g<c.rest.length;g++)ii(c.rest[g]);if(p>e.display.sizerWidth){var v=Math.ceil(p/Pr(e.display));v>e.display.maxLineLength&&(e.display.maxLineLength=v,e.display.maxLine=c.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ii(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function oi(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xn(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=at(t,r),a=at(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s<o?(o=s,a=at(t,un(tt(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=a&&(o=at(t,un(tt(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ai(e,t){if(!Se(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var a=M("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Xn(e.display))+"px;\n                         height: "+(t.bottom-t.top+Zn(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function si(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?ct(t.line,t.ch+1,"before"):t,t=t.ch?ct(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Sr(e,t),l=n&&n!=t?Sr(e,n):s;i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r};var c=ci(e,i),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(gi(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(yi(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function li(e,t){var n=ci(e,t);null!=n.scrollTop&&gi(e,n.scrollTop),null!=n.scrollLeft&&yi(e,n.scrollLeft)}function ci(e,t){var n=e.display,r=Ir(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=er(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Yn(n),l=t.top<r,c=t.bottom>s-r;if(t.top<i)a.scrollTop=l?0:t.top;else if(t.bottom>i+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Qn(e)-n.gutters.offsetWidth,h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.left<p?a.scrollLeft=Math.max(0,t.left+d-(h?0:10)):t.right>f+p-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function ui(e,t){null!=t&&(hi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function di(e){hi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function pi(e,t,n){null==t&&null==n||hi(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function fi(e,t){hi(e),e.curOp.scrollToPos=t}function hi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=kr(e,t.from),r=kr(e,t.to);mi(e,n,r,t.margin)}}function mi(e,t,n,r){var i=ci(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});pi(e,i.scrollLeft,i.scrollTop)}function gi(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Ki(e,{top:t}),vi(e,t,!0),n&&Ki(e),Vi(e,100))}function vi(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function yi(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,Ji(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Yn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Zn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var wi=function(e,t,n){this.cm=n;var r=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),be(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),be(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};wi.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},wi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},wi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},wi.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new j,this.disableVert=new j},wi.prototype.enableZeroWidthBar=function(e,t,n){function r(){var i=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}e.style.visibility="",t.set(1e3,r)},wi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var xi=function(){};function Ci(e,t){t||(t=bi(e));var n=e.display.barWidth,r=e.display.barHeight;Si(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&ri(e),Si(e,bi(e)),n=e.display.barWidth,r=e.display.barHeight}function Si(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}xi.prototype.update=function(){return{bottom:0,right:0}},xi.prototype.setScrollLeft=function(){},xi.prototype.setScrollTop=function(){},xi.prototype.clear=function(){};var ki={native:wi,null:xi};function Di(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&T(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ki[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?yi(e,t):gi(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var Li=0;function Ti(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Li,markArrays:null},An(e.curOp)}function Ei(e){var t=e.curOp;t&&On(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;Ai(e)}))}function Ai(e){for(var t=e.ops,n=0;n<t.length;n++)Mi(t[n]);for(var r=0;r<t.length;r++)Oi(t[r]);for(var i=0;i<t.length;i++)Ni(t[i]);for(var o=0;o<t.length;o++)Ii(t[o]);for(var a=0;a<t.length;a++)Pi(t[a])}function Mi(e){var t=e.cm,n=t.display;$i(t),e.updateMaxLine&&pn(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Bi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Oi(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ni(e){var t=e.cm,n=t.display;e.updatedDisplay&&ri(t),e.barMeasure=bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ir(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Zn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Qn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ii(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&yi(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==I(W(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Ci(t,e.barMeasure),e.updatedDisplay&&Yi(t,e.barMeasure),e.selectionChanged&&Zr(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Qr(e.cm)}function Pi(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Gi(t,e.update),null==n.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&vi(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&yi(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=si(t,gt(r,e.scrollToPos.from),gt(r,e.scrollToPos.to),e.scrollToPos.margin);ai(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var s=0;s<o.length;++s)o[s].lines.length||Ce(o[s],"hide");if(a)for(var l=0;l<a.length;++l)a[l].lines.length&&Ce(a[l],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ce(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Fi(e,t){if(e.curOp)return t();Ti(e);try{return t()}finally{Ei(e)}}function _i(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ti(e);try{return t.apply(e,arguments)}finally{Ei(e)}}}function Ri(e){return function(){if(this.curOp)return e.apply(this,arguments);Ti(this);try{return e.apply(this,arguments)}finally{Ei(this)}}}function Wi(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ti(t);try{return e.apply(this,arguments)}finally{Ei(t)}}}function Vi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,B(zi,e))}function zi(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=St(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Je(t.mode,r.state):null,l=xt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=o.styles[p];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&kt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Vi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Fi(e,(function(){for(var t=0;t<i.length;t++)$r(e,i[t],"text")}))}}var Bi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=oi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Qn(e),this.force=n,this.dims=Fr(e),this.events=[]};function $i(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Zn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Zn(e)+"px",t.scrollbarsClipped=!0)}function Hi(e){if(e.hasFocus())return null;var t=I(W(e));if(!t||!N(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=z(e).getSelection();r.anchorNode&&r.extend&&N(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ji(e){if(e&&e.activeElt&&e.activeElt!=I(V(e.activeElt))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&N(document.body,e.anchorNode)&&N(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Gr(e))return!1;Zi(e)&&(Hr(e),t.dims=Fr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pt&&(o=an(e.doc,o),a=sn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ur(e,o,a),n.viewOffset=un(tt(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Gr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Hi(e);return l>4&&(n.lineDiv.style.display="none"),qi(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ji(c),E(n.cursorDiv),E(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Vi(e,400)),n.updateLineNumbers=null,!0}function Gi(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Qn(e))r&&(t.visible=oi(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Yn(e.display)-er(e),n.top)}),t.visible=oi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Ui(e,t))break;ri(e);var i=bi(e);Kr(e),Ci(e,i),Yi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ki(e,t){var n=new Bi(e,t);if(Ui(e,n)){ri(e),Gi(e,n);var r=bi(e);Kr(e),Ci(e,r),Yi(e,r),n.finish()}}function qi(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d<c.length;d++){var p=c[d];if(p.hidden);else if(p.node&&p.node.parentNode==o){while(a!=p.node)a=s(a);var f=i&&null!=t&&t<=u&&p.lineNumber;p.changes&&(U(p.changes,"gutter")>-1&&(f=!1),Fn(e,p,u,n)),f&&(E(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(lt(e.options,u)))),a=p.node.nextSibling}else{var h=Hn(e,p,u,n);o.insertBefore(h,a)}u+=p.size}while(a)a=s(a)}function Xi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",In(e,"gutterChanged",e)}function Yi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Zn(e)+"px"}function Ji(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=_r(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var s=n[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Zi(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=lt(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(M("div",[M("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Xi(e.display),!0}return!1}function Qi(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"CodeMirror-linenumbers"==o){if(!t)continue;r=!0}n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function eo(e){var t=e.gutters,n=e.gutterSpecs;E(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,s=t.appendChild(M("div",null,"CodeMirror-gutter "+o));a&&(s.style.cssText=a),"CodeMirror-linenumbers"==o&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Xi(e)}function to(e){eo(e.display),Br(e),Ji(e)}function no(e,t,r,i){var o=this;this.input=r,o.scrollbarFiller=M("div",null,"CodeMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"CodeMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=O("div",null,"CodeMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"CodeMirror-cursors"),o.measure=M("div",null,"CodeMirror-measure"),o.lineMeasure=M("div",null,"CodeMirror-measure"),o.lineSpace=O("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=O("div",[o.lineSpace],"CodeMirror-lines");o.mover=M("div",[c],null,"position: relative"),o.sizer=M("div",[o.mover],"CodeMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+G+"px; width: 1px;"),o.gutters=M("div",null,"CodeMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror"),u&&d>=105&&(o.wrapper.style.clipPath="inset(0px)"),o.wrapper.setAttribute("translate","no"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||n&&y||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=Qi(i.gutters,i.lineNumbers),eo(o),r.init(o)}Bi.prototype.signal=function(e,t){De(e,t)&&this.events.push(arguments)},Bi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ce.apply(null,this.events[e])};var ro=0,io=null;function oo(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}}function ao(e){var t=oo(e);return t.x*=io,t.y*=io,t}function so(e,t){u&&102==d&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=oo(t),i=r.x,o=r.y,a=io;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var s=e.display,c=s.scroller,f=c.scrollWidth>c.clientWidth,h=c.scrollHeight>c.clientHeight;if(i&&f||o&&h){if(o&&b&&l)e:for(var m=t.target,g=s.view;m!=c;m=m.parentNode)for(var v=0;v<g.length;v++)if(g[v].node==m){e.display.currentWheelTarget=m;break e}if(i&&!n&&!p&&null!=a)return o&&h&&gi(e,Math.max(0,c.scrollTop+o*a)),yi(e,Math.max(0,c.scrollLeft+i*a)),(!o||o&&h)&&Te(t),void(s.wheelStartX=null);if(o&&null!=a){var y=o*a,w=e.doc.scrollTop,x=w+s.wrapper.clientHeight;y<0?w=Math.max(0,w+y-50):x=Math.min(e.doc.height,x+y+50),Ki(e,{top:w,bottom:x})}ro<20&&0!==t.deltaMode&&(null==s.wheelStartX?(s.wheelStartX=c.scrollLeft,s.wheelStartY=c.scrollTop,s.wheelDX=i,s.wheelDY=o,setTimeout((function(){if(null!=s.wheelStartX){var e=c.scrollLeft-s.wheelStartX,t=c.scrollTop-s.wheelStartY,n=t&&s.wheelDY&&t/s.wheelDY||e&&s.wheelDX&&e/s.wheelDX;s.wheelStartX=s.wheelStartY=null,n&&(io=(io*ro+n)/(ro+1),++ro)}}),200)):(s.wheelDX+=i,s.wheelDY+=o))}}a?io=-.53:n?io=15:u?io=-.7:f&&(io=-1/3);var lo=function(e,t){this.ranges=e,this.primIndex=t};lo.prototype.primary=function(){return this.ranges[this.primIndex]},lo.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!dt(n.anchor,r.anchor)||!dt(n.head,r.head))return!1}return!0},lo.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new co(pt(this.ranges[t].anchor),pt(this.ranges[t].head));return new lo(e,this.primIndex)},lo.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},lo.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ut(t,r.from())>=0&&ut(e,r.to())<=0)return n}return-1};var co=function(e,t){this.anchor=e,this.head=t};function uo(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return ut(e.from(),t.from())})),n=U(t,i);for(var o=1;o<t.length;o++){var a=t[o],s=t[o-1],l=ut(s.to(),a.from());if(r&&!a.empty()?l>0:l>=0){var c=ht(s.from(),a.from()),u=ft(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new co(d?u:c,d?c:u))}}return new lo(t,n)}function po(e,t){return new lo([new co(e,t||e)],0)}function fo(e){return e.text?ct(e.from.line+e.text.length-1,ee(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ho(e,t){if(ut(e,t.from)<0)return e;if(ut(e,t.to)<=0)return fo(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=fo(t).ch-t.to.ch),ct(n,r)}function mo(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new co(ho(i.anchor,t),ho(i.head,t)))}return uo(e.cm,n,e.sel.primIndex)}function go(e,t,n){return e.line==t.line?ct(n.line,e.ch-t.ch+n.ch):ct(n.line+(e.line-t.line),e.ch)}function vo(e,t,n){for(var r=[],i=ct(e.first,0),o=i,a=0;a<t.length;a++){var s=t[a],l=go(s.from,i,o),c=go(fo(s),i,o);if(i=s.to,o=c,"around"==n){var u=e.sel.ranges[a],d=ut(u.head,u.anchor)<0;r[a]=new co(d?c:l,d?l:c)}else r[a]=new co(l,l)}return new lo(r,e.sel.primIndex)}function yo(e){e.doc.mode=qe(e.options,e.doc.modeOption),bo(e)}function bo(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Vi(e,100),e.state.modeGen++,e.curOp&&Br(e)}function wo(e,t){return 0==t.from.ch&&0==t.to.ch&&""==ee(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function xo(e,t,n,r){function i(e){return n?n[e]:null}function o(e,n,i){hn(e,n,i,r),In(e,"change",e,t)}function a(e,t){for(var n=[],o=e;o<t;++o)n.push(new fn(c[o],i(o),r));return n}var s=t.from,l=t.to,c=t.text,u=tt(e,s.line),d=tt(e,l.line),p=ee(c),f=i(c.length-1),h=l.line-s.line;if(t.full)e.insert(0,a(0,c.length)),e.remove(c.length,e.size-c.length);else if(wo(e,t)){var m=a(0,c.length-1);o(d,d.text,f),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)o(u,u.text.slice(0,s.ch)+p+u.text.slice(l.ch),f);else{var g=a(1,c.length-1);g.push(new fn(p+u.text.slice(l.ch),f,r)),o(u,u.text.slice(0,s.ch)+c[0],i(0)),e.insert(s.line+1,g)}else if(1==c.length)o(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),i(0)),e.remove(s.line+1,h);else{o(u,u.text.slice(0,s.ch)+c[0],i(0)),o(d,p+d.text.slice(l.ch),f);var v=a(1,c.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,v)}In(e,"change",e,t)}function Co(e,t,n){function r(e,i,o){if(e.linked)for(var a=0;a<e.linked.length;++a){var s=e.linked[a];if(s.doc!=i){var l=o&&s.sharedHist;n&&!l||(t(s.doc,l),r(s.doc,e,l))}}}r(e,null,!0)}function So(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Wr(e),yo(e),ko(e),e.options.direction=t.direction,e.options.lineWrapping||pn(e),e.options.mode=t.modeOption,Br(e)}function ko(e){("rtl"==e.doc.direction?P:T)(e.display.lineDiv,"CodeMirror-rtl")}function Do(e){Fi(e,(function(){ko(e),Br(e)}))}function Lo(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function To(e,t){var n={from:pt(t.from),to:fo(t),text:nt(e,t.from,t.to)};return Po(e,n,t.from.line,t.to.line+1),Co(e,(function(e){return Po(e,n,t.from.line,t.to.line+1)}),!0),n}function Eo(e){while(e.length){var t=ee(e);if(!t.ranges)break;e.pop()}}function Ao(e,t){return t?(Eo(e.done),ee(e.done)):e.done.length&&!ee(e.done).ranges?ee(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ee(e.done)):void 0}function Mo(e,t,n,r){var i=e.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&i.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Ao(i,i.lastOp==r)))a=ee(o.changes),0==ut(t.from,t.to)&&0==ut(t.from,a.to)?a.to=fo(t):o.changes.push(To(e,t));else{var l=ee(i.done);l&&l.ranges||Io(e.sel,i.done),o={changes:[To(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||Ce(e,"historyAdded")}function Oo(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function No(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Oo(e,o,ee(i.done),t))?i.done[i.done.length-1]=t:Io(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Eo(i.undone)}function Io(e,t){var n=ee(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Po(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Fo(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function _o(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Fo(n[i]));return r}function Ro(e,t){var n=_o(e,t),r=Ht(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(n[i]=a)}return n}function Wo(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges)r.push(n?lo.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];r.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&U(t,Number(u[1]))>-1&&(ee(s)[d]=c[d],delete c[d])}}}return r}function Vo(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ut(t,i)<0;o!=ut(n,i)<0?(i=t,t=n):o!=ut(t,n)<0&&(t=n)}return new co(i,t)}return new co(n||t,t)}function zo(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Go(e,new lo([Vo(e.sel.primary(),t,n,i)],0),r)}function Bo(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Vo(e.sel.ranges[o],t[o],null,i);var a=uo(e.cm,r,e.sel.primIndex);Go(e,a,n)}function $o(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Go(e,uo(e.cm,i,e.sel.primIndex),r)}function Ho(e,t,n,r){Go(e,po(t,n),r)}function jo(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new co(gt(e,t[n].anchor),gt(e,t[n].head))},origin:n&&n.origin};return Ce(e,"beforeSelectionChange",e,r),e.cm&&Ce(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?uo(e.cm,r.ranges,r.ranges.length-1):t}function Uo(e,t,n){var r=e.history.done,i=ee(r);i&&i.ranges?(r[r.length-1]=t,Ko(e,t,n)):Go(e,t,n)}function Go(e,t,n){Ko(e,t,n),No(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ko(e,t,n){(De(e,"beforeSelectionChange")||e.cm&&De(e.cm,"beforeSelectionChange"))&&(t=jo(e,t,n));var r=n&&n.bias||(ut(t.primary().head,e.sel.primary().head)<0?-1:1);qo(e,Yo(e,t,r,!0)),n&&!1===n.scroll||!e.cm||"nocursor"==e.cm.getOption("readOnly")||di(e.cm)}function qo(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ke(e.cm)),In(e,"cursorActivity",e))}function Xo(e){qo(e,Yo(e,e.sel,null,!1))}function Yo(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=Zo(e,a.anchor,s&&s.anchor,n,r),c=a.head==a.anchor?l:Zo(e,a.head,s&&s.head,n,r);(i||l!=a.anchor||c!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new co(l,c))}return i?uo(e.cm,i,t.primIndex):t}function Jo(e,t,n,r,i){var o=tt(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(i&&(Ce(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),p=void 0;if((r<0?u:c)&&(d=Qo(e,d,-r,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(p=ut(d,n))&&(r<0?p<0:p>0))return Jo(e,d,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=Qo(e,f,r,f.line==t.line?o:null)),f?Jo(e,f,t,r,i):null}}return t}function Zo(e,t,n,r,i){var o=r||1,a=Jo(e,t,n,o,i)||!i&&Jo(e,t,n,o,!0)||Jo(e,t,n,-o,i)||!i&&Jo(e,t,n,-o,!0);return a||(e.cantEdit=!0,ct(e.first,0))}function Qo(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?gt(e,ct(t.line-1)):null:n>0&&t.ch==(r||tt(e,t.line)).text.length?t.line<e.first+e.size-1?ct(t.line+1,0):null:new ct(t.line,t.ch+n)}function ea(e){e.setSelection(ct(e.firstLine(),0),ct(e.lastLine()),q)}function ta(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,o){t&&(r.from=gt(e,t)),n&&(r.to=gt(e,n)),i&&(r.text=i),void 0!==o&&(r.origin=o)}),Ce(e,"beforeChange",e,r),e.cm&&Ce(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function na(e,t,n){if(e.cm){if(!e.cm.curOp)return _i(e.cm,na)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"))||(t=ta(e,t,!0),t)){var r=It&&!n&&Ut(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)ra(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else ra(e,t)}}function ra(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ut(t.from,t.to)){var n=mo(e,t);Mo(e,t,n,e.cm?e.cm.curOp.id:NaN),aa(e,t,n,Ht(e,t));var r=[];Co(e,(function(e,n){n||-1!=U(r,e.history)||(da(e.history,t),r.push(e.history)),aa(e,t,null,Ht(e,t))}))}}function ia(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length;c++)if(i=s[c],n?i.ranges&&!i.equals(e.sel):!i.ranges)break;if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(i=s.pop(),!i.ranges){if(r)return void s.push(i);break}if(Io(i,l),n&&!i.equals(e.sel))return void Go(e,i,{clearRedo:!1});a=i}var u=[];Io(a,l),l.push({changes:u,generation:o.generation}),o.generation=i.generation||++o.maxGeneration;for(var d=De(e,"beforeChange")||e.cm&&De(e.cm,"beforeChange"),p=function(n){var r=i.changes[n];if(r.origin=t,d&&!ta(e,r,!1))return s.length=0,{};u.push(To(e,r));var o=n?mo(e,r):ee(s);aa(e,r,o,Ro(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:fo(r)});var a=[];Co(e,(function(e,t){t||-1!=U(a,e.history)||(da(e.history,r),a.push(e.history)),aa(e,r,null,Ro(e,r))}))},f=i.changes.length-1;f>=0;--f){var h=p(f);if(h)return h.v}}}}function oa(e,t){if(0!=t&&(e.first+=t,e.sel=new lo(te(e.sel.ranges,(function(e){return new co(ct(e.anchor.line+t,e.anchor.ch),ct(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){Br(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)$r(e.cm,r,"gutter")}}function aa(e,t,n,r){if(e.cm&&!e.cm.curOp)return _i(e.cm,aa)(e,t,n,r);if(t.to.line<e.first)oa(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);oa(e,i),t={from:ct(e.first,0),to:ct(t.to.line+i,t.to.ch),text:[ee(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:ct(o,tt(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=nt(e,t.from,t.to),n||(n=mo(e,t)),e.cm?sa(e.cm,t,r):xo(e,t,r),Ko(e,n,q),e.cantEdit&&Zo(e,ct(e.firstLine(),0))&&(e.cantEdit=!1)}}function sa(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=ot(nn(tt(r,o.line))),r.iter(l,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ke(e),xo(r,t,n,Rr(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,(function(e){var t=dn(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Nt(r,o.line),Vi(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?Br(e):o.line!=a.line||1!=t.text.length||wo(e.doc,t)?Br(e,o.line,a.line+1,c):$r(e,o.line,"text");var u=De(e,"changes"),d=De(e,"change");if(d||u){var p={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&In(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function la(e,t,n,r,i){var o;r||(r=n),ut(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),"string"==typeof t&&(t=e.splitLines(t)),na(e,{from:n,to:r,text:t,origin:i})}function ca(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ua(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var s=0;s<o.ranges.length;s++)ca(o.ranges[s].anchor,t,n,r),ca(o.ranges[s].head,t,n,r)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(n<c.from.line)c.from=ct(c.from.line+r,c.from.ch),c.to=ct(c.to.line+r,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}}function da(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;ua(e.done,n,r,i),ua(e.undone,n,r,i)}function pa(e,t,n,r){var i=t,o=t;return"number"==typeof t?o=tt(e,mt(e,t)):i=ot(t),null==i?null:(r(o,i)&&e.cm&&$r(e.cm,i,n),o)}function fa(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}function ha(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}co.prototype.from=function(){return ht(this.anchor,this.head)},co.prototype.to=function(){return ft(this.anchor,this.head)},co.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},fa.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,mn(i),In(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},ha.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),0==(t-=o))break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof fa))){var s=[];this.collapse(s),this.children=[new fa(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,s=a;s<i.lines.length;){var l=new fa(i.lines.slice(s,s+=25));i.height-=l.height,this.children.splice(++r,0,l),l.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new ha(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=U(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new ha(e.children);i.parent=e,e.children=[i,n],e=i}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=o}}};var ma=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};function ga(e,t,n){un(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ui(e,n)}function va(e,t,n,r){var i=new ma(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),pa(e,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==i.insertAt?n.push(i):n.splice(Math.min(n.length,Math.max(0,i.insertAt)),0,i),i.line=t,o&&!ln(e,t)){var r=un(t)<e.scrollTop;it(t,t.height+Kn(i)),r&&ui(o,i.height),o.curOp.forceUpdate=!0}return!0})),o&&In(o,"lineWidgetAdded",o,i,"number"==typeof t?t:ot(t)),i}ma.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=ot(n);if(null!=r&&t){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=Kn(this);it(n,Math.max(0,n.height-o)),e&&(Fi(e,(function(){ga(e,n,-o),$r(e,r,"widget")})),In(e,"lineWidgetCleared",e,this,r))}},ma.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Kn(this)-t;i&&(ln(this.doc,r)||it(r,r.height+i),n&&Fi(n,(function(){n.curOp.forceUpdate=!0,ga(n,r,i),In(n,"lineWidgetChanged",n,e,ot(r))})))},Le(ma);var ya=0,ba=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ya};function wa(e,t,n,r,i){if(r&&r.shared)return Ca(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return _i(e.cm,wa)(e,t,n,r,i);var o=new ba(e,i),a=ut(t,n);if(r&&$(r,o,!1),a>0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=O("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(tn(e,t.line,t,n,o)||t.line!=n.line&&tn(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");_t()}o.addToHistory&&Mo(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(r){c&&o.collapsed&&!c.options.lineWrapping&&nn(r)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&it(r,0),zt(r,new Rt(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){ln(e,t)&&it(t,0)})),o.clearOnEnter&&be(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ya,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Br(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)$r(c,u,"text");o.atomic&&Xo(c.doc),In(c,"markerAdded",c,o)}return o}ba.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ti(e),De(this,"clear")){var n=this.find();n&&In(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],s=Wt(a.markedSpans,this);e&&!this.collapsed?$r(e,ot(a),"text"):e&&(null!=s.to&&(i=ot(a)),null!=s.from&&(r=ot(a))),a.markedSpans=Vt(a.markedSpans,s),null==s.from&&this.collapsed&&!ln(this.doc,a)&&e&&it(a,Ir(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=nn(this.lines[l]),u=dn(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Br(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&In(e,"markerCleared",e,this,r,i),t&&Ei(e),this.parent&&this.parent.clear()}},ba.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i<this.lines.length;++i){var o=this.lines[i],a=Wt(o.markedSpans,this);if(null!=a.from&&(n=ct(t?o:ot(o),a.from),-1==e))return n;if(null!=a.to&&(r=ct(t?o:ot(o),a.to),1==e))return r}return n&&{from:n,to:r}},ba.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;t&&r&&Fi(r,(function(){var i=t.line,o=ot(t.line),a=or(r,o);if(a&&(hr(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!ln(n.doc,i)&&null!=n.height){var s=n.height;n.height=null;var l=Kn(n)-s;l&&it(i,i.height+l)}In(r,"markerChanged",r,e)}))},ba.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=U(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ba.prototype.detachLine=function(e){if(this.lines.splice(U(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Le(ba);var xa=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};function Ca(e,t,n,r,i){r=$(r),r.shared=!1;var o=[wa(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Co(e,(function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(wa(e,gt(e,t),gt(e,n),r,i));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=ee(o)})),new xa(o,a)}function Sa(e){return e.findMarks(ct(e.first,0),e.clipPos(ct(e.lastLine())),(function(e){return e.parent}))}function ka(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ut(o,a)){var s=wa(e,o,a,r.primary,r.primary.type);r.markers.push(s),s.parent=r}}}function Da(e){for(var t=function(t){var n=e[t],r=[n.primary.doc];Co(n.primary.doc,(function(e){return r.push(e)}));for(var i=0;i<n.markers.length;i++){var o=n.markers[i];-1==U(r,o.doc)&&(o.parent=null,n.markers.splice(i--,1))}},n=0;n<e.length;n++)t(n)}xa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();In(this,"clear")}},xa.prototype.find=function(e,t){return this.primary.find(e,t)},Le(xa);var La=0,Ta=function(e,t,n,r,i){if(!(this instanceof Ta))return new Ta(e,t,n,r,i);null==n&&(n=0),ha.call(this,[new fa([new fn("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=ct(n,0);this.sel=po(o),this.history=new Lo(null),this.id=++La,this.modeOption=t,this.lineSep=r,this.direction="rtl"==i?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),xo(this,{from:o,to:o,text:e}),Go(this,po(o),q)};Ta.prototype=ie(ha.prototype,{constructor:Ta,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=rt(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:Wi((function(e){var t=ct(this.first,0),n=this.first+this.size-1;na(this,{from:t,to:ct(n,tt(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&pi(this.cm,0,0),Go(this,po(t),q)})),replaceRange:function(e,t,n,r){t=gt(this,t),n=n?gt(this,n):t,la(this,e,t,n,r)},getRange:function(e,t,n){var r=nt(this,gt(this,e),gt(this,t));return!1===n?r:""===n?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(st(this,e))return tt(this,e)},getLineNumber:function(e){return ot(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=tt(this,e)),nn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return gt(this,e)},getCursor:function(e){var t,n=this.sel.primary();return t=null==e||"head"==e?n.head:"anchor"==e?n.anchor:"end"==e||"to"==e||!1===e?n.to():n.from(),t},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Wi((function(e,t,n){Ho(this,gt(this,"number"==typeof e?ct(e,t||0):e),null,n)})),setSelection:Wi((function(e,t,n){Ho(this,gt(this,e),gt(this,t||e),n)})),extendSelection:Wi((function(e,t,n){zo(this,gt(this,e),t&&gt(this,t),n)})),extendSelections:Wi((function(e,t){Bo(this,yt(this,e),t)})),extendSelectionsBy:Wi((function(e,t){var n=te(this.sel.ranges,e);Bo(this,yt(this,n),t)})),setSelections:Wi((function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new co(gt(this,e[i].anchor),gt(this,e[i].head||e[i].anchor));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Go(this,uo(this.cm,r,t),n)}})),addSelection:Wi((function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new co(gt(this,e),gt(this,t||e))),Go(this,uo(this.cm,r,r.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,r=0;r<n.length;r++){var i=nt(this,n[r].from(),n[r].to());t=t?t.concat(i):i}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=nt(this,n[r].from(),n[r].to());!1!==e&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:Wi((function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var s=t&&"end"!=t&&vo(this,r,t),l=r.length-1;l>=0;l--)na(this,r[l]);s?Uo(this,s):this.cm&&di(this.cm)})),undo:Wi((function(){ia(this,"undo")})),redo:Wi((function(){ia(this,"redo")})),undoSelection:Wi((function(){ia(this,"undo",!0)})),redoSelection:Wi((function(){ia(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Lo(this.history),Co(this,(function(t){return t.history=e.history}),!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Wo(this.history.done),undone:Wo(this.history.undone)}},setHistory:function(e){var t=this.history=new Lo(this.history);t.done=Wo(e.done.slice(0),null,!0),t.undone=Wo(e.undone.slice(0),null,!0)},setGutterMarker:Wi((function(e,t,n){return pa(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&le(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:Wi((function(e){var t=this;this.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&pa(t,n,"gutter",(function(){return n.gutterMarkers[e]=null,le(n.gutterMarkers)&&(n.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!st(this,e))return null;if(t=e,e=tt(this,e),!e)return null}else if(t=ot(e),null==t)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Wi((function(e,t,n){return pa(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(D(n).test(e[r]))return!1;e[r]+=" "+n}else e[r]=n;return!0}))})),removeLineClass:Wi((function(e,t,n){return pa(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(null==n)e[r]=null;else{var o=i.match(D(n));if(!o)return!1;var a=o.index+o[0].length;e[r]=i.slice(0,o.index)+(o.index&&a!=i.length?" ":"")+i.slice(a)||null}return!0}))})),addLineWidget:Wi((function(e,t,n){return va(this,e,t,n)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return wa(this,gt(this,e),gt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=gt(this,e),wa(this,e,e,n,"bookmark")},findMarksAt:function(e){e=gt(this,e);var t=[],n=tt(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(null==i.from||i.from<=e.ch)&&(null==i.to||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=gt(this,e),t=gt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&i==e.line&&e.ch>=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)null!=n[r].from&&e.push(n[r].marker)})),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter((function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n})),gt(this,ct(n,t))},indexFromPos:function(e){e=gt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+n})),t},copy:function(e){var t=new Ta(rt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var r=new Ta(rt(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],ka(r,Sa(this)),r},unlinkDoc:function(e){if(e instanceof Bs&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Da(Sa(this));break}}if(e.history==this.history){var r=[e.id];Co(e,(function(e){return r.push(e.id)}),!0),e.history=new Lo(null),e.history.done=Wo(this.history.done,r),e.history.undone=Wo(this.history.undone,r)}},iterLinkedDocs:function(e){Co(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):We(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Wi((function(e){"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&Do(this.cm))}))}),Ta.prototype.eachLine=Ta.prototype.iter;var Ea=0;function Aa(e){var t=this;if(Na(t),!Se(t,e)&&!qn(t.display,e)){Te(e),a&&(Ea=+new Date);var n=Vr(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),s=0,l=function(){++s==i&&_i(t,(function(){n=gt(t.doc,n);var e={from:n,to:n,text:t.doc.splitLines(o.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};na(t.doc,e),Uo(t.doc,po(gt(t.doc,n),gt(t.doc,fo(e))))}))()},c=function(e,n){if(t.options.allowDropFileTypes&&-1==U(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[n]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var p;if(t.state.draggingText&&!t.state.draggingText.copy&&(p=t.listSelections()),Ko(t.doc,po(n,n)),p)for(var f=0;f<p.length;++f)la(t.doc,"",p[f].anchor,p[f].head,"drag");t.replaceSelection(d,"around","paste"),t.display.input.focus()}}catch(h){}}}}function Ma(e,t){if(a&&(!e.state.draggingText||+new Date-Ea<100))Me(t);else if(!Se(e,t)&&!qn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=M("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",p&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),p&&n.parentNode.removeChild(n)}}function Oa(e,t){var n=Vr(e,t);if(n){var r=document.createDocumentFragment();Xr(e,n,r),e.display.dragCursor||(e.display.dragCursor=M("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),A(e.display.dragCursor,r)}}function Na(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ia(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation((function(){for(var t=0;t<n.length;t++)e(n[t])}))}}var Pa=!1;function Fa(){Pa||(_a(),Pa=!0)}function _a(){var e;be(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Ia(Ra)}),100))})),be(window,"blur",(function(){return Ia(ni)}))}function Ra(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Wa={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Va=0;Va<10;Va++)Wa[Va+48]=Wa[Va+96]=String(Va);for(var za=65;za<=90;za++)Wa[za]=String.fromCharCode(za);for(var Ba=1;Ba<=12;Ba++)Wa[Ba+111]=Wa[Ba+63235]="F"+Ba;var $a={};function Ha(e){var t,n,r,i,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))i=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);r=!0}}return t&&(e="Alt-"+e),n&&(e="Ctrl-"+e),i&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function ja(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if("..."==r){delete e[n];continue}for(var i=te(n.split(" "),Ha),o=0;o<i.length;o++){var a=void 0,s=void 0;o==i.length-1?(s=i.join(" "),a=r):(s=i.slice(0,o+1).join(" "),a="...");var l=t[s];if(l){if(l!=a)throw new Error("Inconsistent bindings for "+s)}else t[s]=a}delete e[n]}for(var c in t)e[c]=t[c];return e}function Ua(e,t,n,r){t=Xa(t);var i=t.call?t.call(e,r):t[e];if(!1===i)return"nothing";if("..."===i)return"multi";if(null!=i&&n(i))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Ua(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Ua(e,t.fallthrough[o],n,r);if(a)return a}}}function Ga(e){var t="string"==typeof e?e:Wa[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Ka(e,t,n){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(S?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(S?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!n&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function qa(e,t){if(p&&34==e.keyCode&&e["char"])return!1;var n=Wa[e.keyCode];return null!=n&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(n=e.code),Ka(n,e,t))}function Xa(e){return"string"==typeof e?$a[e]:e}function Ya(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){var o=t(n[i]);while(r.length&&ut(o.from,ee(r).to)<=0){var a=r.pop();if(ut(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}Fi(e,(function(){for(var t=r.length-1;t>=0;t--)la(e.doc,"",r[t].from,r[t].to,"+delete");di(e)}))}function Ja(e,t,n){var r=de(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Za(e,t,n){var r=Ja(e,t.ch,n);return null==r?null:new ct(t.line,r,n<0?"after":"before")}function Qa(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ve(n,t.doc.direction);if(o){var a,s=i<0?ee(o):o[0],l=i<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=ar(t,n);a=i<0?n.text.length-1:0;var d=sr(t,u,a).top;a=pe((function(e){return sr(t,u,e).top==d}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Ja(n,a,1))}else a=i<0?s.to:s.from;return new ct(r,a,c)}}return new ct(r,i<0?n.text.length:0,i<0?"before":"after")}function es(e,t,n,r){var i=ve(t,e.doc.direction);if(!i)return Za(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=me(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return Za(t,n,r);var s,l=function(e,n){return Ja(t,e instanceof ct?e.ch:e,n)},c=function(n){return e.options.lineWrapping?(s=s||ar(e,t),Er(e,t,s,n)):{begin:0,end:t.text.length}},u=c("before"==n.sticky?l(n,-1):n.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==r<0,p=l(n,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var f=d?"before":"after";return new ct(n.line,p,f)}}var h=function(e,t,r){for(var o=function(e,t){return t?new ct(n.line,l(e,1),"before"):new ct(n.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],s=t>0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c<a.to)return o(c,s);if(c=s?a.from:l(a.to,-1),r.begin<=c&&c<r.end)return o(c,s)}},m=h(o+r,r,u);if(m)return m;var g=r>0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||(m=h(r>0?0:i.length-1,r,c(g)),!m)?null:m}$a.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},$a.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},$a.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},$a.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},$a["default"]=b?$a.macDefault:$a.pcDefault;var ts={selectAll:ea,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Ya(e,(function(t){if(t.empty()){var n=tt(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ct(t.head.line+1,0)}:{from:t.head,to:ct(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ya(e,(function(t){return{from:ct(t.from().line,0),to:gt(e.doc,ct(t.to().line+1,0))}}))},delLineLeft:function(e){return Ya(e,(function(e){return{from:ct(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ya(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}}))},delWrappedLineRight:function(e){return Ya(e,(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ct(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ct(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return ns(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return is(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return rs(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),Y)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),Y)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?is(e,t.head):r}),Y)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=H(e.getLine(o.line),o.ch,r);t.push(Q(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Fi(e,(function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=tt(e.doc,i.line).text;if(o)if(i.ch==o.length&&(i=new ct(i.line,i.ch-1)),i.ch>0)i=new ct(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),ct(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=tt(e.doc,i.line-1).text;a&&(i=new ct(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),ct(i.line-1,a.length-1),i,"+transpose"))}n.push(new co(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return Fi(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);di(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ns(e,t){var n=tt(e.doc,t),r=nn(n);return r!=n&&(t=ot(r)),Qa(!0,e,r,t,1)}function rs(e,t){var n=tt(e.doc,t),r=rn(n);return r!=n&&(t=ot(r)),Qa(!0,e,n,t,-1)}function is(e,t){var n=ns(e,t.line),r=tt(e.doc,n.line),i=ve(r,e.doc.direction);if(!i||0==i[0].level){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return ct(n.line,a?0:o,n.sticky)}return n}function os(e,t,n){if("string"==typeof t&&(t=ts[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=K}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function as(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Ua(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Ua(t,e.options.extraKeys,n,e)||Ua(t,e.options.keyMap,n,e)}var ss=new j;function ls(e,t,n,r){var i=e.state.keySeq;if(i){if(Ga(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ss.set(50,(function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())})),cs(e,i+" "+t,n,r))return!0}return cs(e,t,n,r)}function cs(e,t,n,r){var i=as(e,t,r);return"multi"==i&&(e.state.keySeq=t),"handled"==i&&In(e,"keyHandled",e,t,n),"handled"!=i&&"multi"!=i||(Te(n),Zr(e)),!!i}function us(e,t){var n=qa(t,!0);return!!n&&(t.shiftKey&&!e.state.keySeq?ls(e,"Shift-"+n,t,(function(t){return os(e,t,!0)}))||ls(e,n,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return os(e,t)})):ls(e,n,t,(function(t){return os(e,t)})))}function ds(e,t,n){return ls(e,"'"+n+"'",t,(function(t){return os(e,t,!0)}))}var ps=null;function fs(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&(t.curOp.focus=I(W(t)),!Se(t,e))){a&&s<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var i=us(t,e);p&&(ps=i?r:null,i||88!=r||ze||!(b?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),n&&!b&&!i&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||hs(t)}}function hs(e){var t=e.display.lineDiv;function n(e){18!=e.keyCode&&e.altKey||(T(t,"CodeMirror-crosshair"),xe(document,"keyup",n),xe(document,"mouseover",n))}P(t,"CodeMirror-crosshair"),be(document,"keyup",n),be(document,"mouseover",n)}function ms(e){16==e.keyCode&&(this.doc.sel.shift=!1),Se(this,e)}function gs(e){var t=this;if((!e.target||e.target==t.display.input.getField())&&!(qn(t.display,e)||Se(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(p&&n==ps)return ps=null,void Te(e);if(!p||e.which&&!(e.which<10)||!us(t,e)){var i=String.fromCharCode(null==r?n:r);"\b"!=i&&(ds(t,e,i)||t.display.input.onKeyPress(e))}}}var vs,ys,bs=400,ws=function(e,t,n){this.time=e,this.pos=t,this.button=n};function xs(e,t){var n=+new Date;return ys&&ys.compare(n,e,t)?(vs=ys=null,"triple"):vs&&vs.compare(n,e,t)?(ys=new ws(n,e,t),vs=null,"double"):(vs=new ws(n,e,t),ys=null,"single")}function Cs(e){var t=this,n=t.display;if(!(Se(t,e)||n.activeTouch&&n.input.supportsTouch()))if(n.input.ensurePolled(),n.shift=e.shiftKey,qn(n,e))l||(n.scroller.draggable=!1,setTimeout((function(){return n.scroller.draggable=!0}),100));else if(!Os(t,e)){var r=Vr(t,e),i=Ne(e),o=r?xs(r,i):"single";z(t).focus(),1==i&&t.state.selectingText&&t.state.selectingText(e),r&&Ss(t,i,r,o,e)||(1==i?r?Ds(t,r,o,e):Oe(e)==n.scroller&&Te(e):2==i?(r&&zo(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):ei(t)))}}function Ss(e,t,n,r,i){var o="Click";return"double"==r?o="Double"+o:"triple"==r&&(o="Triple"+o),o=(1==t?"Left":2==t?"Middle":"Right")+o,ls(e,Ka(o,i),i,(function(t){if("string"==typeof t&&(t=ts[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,n)!=K}finally{e.state.suppressEdits=!1}return r}))}function ks(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(null==i.unit){var o=w?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==i.extend||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),null==i.addNew&&(i.addNew=b?n.metaKey:n.ctrlKey),null==i.moveOnDrag&&(i.moveOnDrag=!(b?n.altKey:n.ctrlKey)),i}function Ds(e,t,n,r){a?setTimeout(B(Qr,e),0):e.curOp.focus=I(W(e));var i,o=ks(e,n,r),s=e.doc.sel;e.options.dragDrop&&Fe&&!e.isReadOnly()&&"single"==n&&(i=s.contains(t))>-1&&(ut((i=s.ranges[i]).from(),t)<0||t.xRel>0)&&(ut(i.to(),t)>0||t.xRel<0)?Ls(e,r,t,o):Es(e,r,t,o)}function Ls(e,t,n,r){var i=e.display,o=!1,c=_i(e,(function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ei(e)),xe(i.wrapper.ownerDocument,"mouseup",c),xe(i.wrapper.ownerDocument,"mousemove",u),xe(i.scroller,"dragstart",d),xe(i.scroller,"drop",c),o||(Te(t),r.addNew||zo(e.doc,n,null,null,r.extend),l&&!f||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,be(i.wrapper.ownerDocument,"mouseup",c),be(i.wrapper.ownerDocument,"mousemove",u),be(i.scroller,"dragstart",d),be(i.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ts(e,t,n){if("char"==n)return new co(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new co(ct(t.line,0),gt(e.doc,ct(t.line+1,0)));var r=n(e,t);return new co(r.from,r.to)}function Es(e,t,n,r){a&&ei(e);var i=e.display,o=e.doc;Te(t);var s,l,c=o.sel,u=c.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new co(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new co(n,n)),n=Vr(e,t,!0,!0),l=-1;else{var d=Ts(e,n,r.unit);s=r.extend?Vo(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=u.length,Go(o,uo(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==r.unit&&!r.extend?(Go(o,uo(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):$o(o,l,s,X):(l=0,Go(o,new lo([s],0),X),c=o.sel);var p=n;function f(t){if(0!=ut(p,t))if(p=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,u=H(tt(o,n.line).text,n.ch,a),d=H(tt(o,t.line).text,t.ch,a),f=Math.min(u,d),h=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=tt(o,m).text,y=J(v,f,a);f==h?i.push(new co(ct(m,y),ct(m,y))):v.length>y&&i.push(new co(ct(m,y),ct(m,J(v,h,a))))}i.length||i.push(new co(n,n)),Go(o,uo(e,c.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,w=s,x=Ts(e,t,r.unit),C=w.anchor;ut(x.anchor,C)>0?(b=x.head,C=ht(w.from(),x.anchor)):(b=x.anchor,C=ft(w.to(),x.head));var S=c.ranges.slice(0);S[l]=As(e,new co(gt(o,C),b)),Go(o,uo(e,S,l),X)}}var h=i.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,a=Vr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=ut(a,p)){e.curOp.focus=I(W(e)),f(a);var s=oi(i,o);(a.line>=s.to||a.line<s.from)&&setTimeout(_i(e,(function(){m==n&&g(t)})),150)}else{var l=t.clientY<h.top?-20:t.clientY>h.bottom?20:0;l&&setTimeout(_i(e,(function(){m==n&&(i.scroller.scrollTop+=l,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(Te(t),i.input.focus()),xe(i.wrapper.ownerDocument,"mousemove",y),xe(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=_i(e,(function(e){0!==e.buttons&&Ne(e)?g(e):v(e)})),b=_i(e,v);e.state.selectingText=b,be(i.wrapper.ownerDocument,"mousemove",y),be(i.wrapper.ownerDocument,"mouseup",b)}function As(e,t){var n=t.anchor,r=t.head,i=tt(e.doc,n.line);if(0==ut(n,r)&&n.sticky==r.sticky)return t;var o=ve(i);if(!o)return t;var a=me(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=me(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var p=o[c+(l?-1:0)],f=l==(1==p.level),h=f?p.from:p.to,m=f?"after":"before";return n.ch==h&&n.sticky==m?t:new co(new ct(n.line,h,m),r)}function Ms(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(p){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Te(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!De(e,n))return Ae(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=i){var u=at(e.doc,o),d=e.display.gutterSpecs[l];return Ce(e,n,e,u,d.className,t),Ae(t)}}}function Os(e,t){return Ms(e,t,"gutterClick",!0)}function Ns(e,t){qn(e.display,t)||Is(e,t)||Se(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Is(e,t){return!!De(e,"gutterContextMenu")&&Ms(e,t,"gutterContextMenu",!1)}function Ps(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gr(e)}ws.prototype.compare=function(e,t,n){return this.time+bs>e&&0==ut(t,this.pos)&&n==this.button};var Fs={toString:function(){return"CodeMirror.Init"}},_s={},Rs={};function Ws(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=Fs&&i(e,t,n)}:i)}e.defineOption=n,e.Init=Fs,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,yo(e)}),!0),n("indentUnit",2,yo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){bo(e),gr(e),Br(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(ct(r,o))}r++}));for(var i=n.length-1;i>=0;i--)la(e.doc,t,n[i],ct(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Fs&&e.refresh()})),n("specialCharPlaceholder",wn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",y?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ps(e),to(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xa(t),i=n!=Fs&&Xa(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,zs,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Qi(t,e.options.lineNumbers),to(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?_r(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Ci(e)}),!0),n("scrollbarStyle","native",(function(e){Di(e),Ci(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Qi(e.options.gutters,t),to(e)}),!0),n("firstLineNumber",1,to,!0),n("lineNumberFormatter",(function(e){return e}),to,!0),n("showCursorWhenSelecting",!1,Kr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(ni(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Vs),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Kr,!0),n("singleCursorHeightPerLine",!0,Kr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,bo,!0),n("addModeClass",!1,bo,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,bo,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Vs(e,t,n){var r=n&&n!=Fs;if(!t!=!r){var i=e.display.dragFunctions,o=t?be:xe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function zs(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(T(e.display.wrapper,"CodeMirror-wrap"),pn(e)),Wr(e),Br(e),gr(e),setTimeout((function(){return Ci(e)}),100)}function Bs(e,t){var n=this;if(!(this instanceof Bs))return new Bs(e,t);this.options=t=t?$(t):{},$(_s,t,!1);var r=t.value;"string"==typeof r?r=new Ta(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Bs.inputStyles[t.inputStyle](this),o=this.display=new no(e,r,i,t);for(var c in o.wrapper.CodeMirror=this,Ps(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Di(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new j,keySeq:null,specialChars:null},t.autofocus&&!y&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),$s(this),Fa(),Ti(this),this.curOp.forceUpdate=!0,So(this,r),t.autofocus&&!y||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&ti(n)}),20):ni(this),Rs)Rs.hasOwnProperty(c)&&Rs[c](this,t[c],Fs);Zi(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Hs.length;++u)Hs[u](this);Ei(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function $s(e){var t=e.display;be(t.scroller,"mousedown",_i(e,Cs)),be(t.scroller,"dblclick",a&&s<11?_i(e,(function(t){if(!Se(e,t)){var n=Vr(e,t);if(n&&!Os(e,t)&&!qn(e.display,t)){Te(t);var r=e.findWordAt(n);zo(e.doc,r.anchor,r.head)}}})):function(t){return Se(e,t)||Te(t)}),be(t.scroller,"contextmenu",(function(t){return Ns(e,t)})),be(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ns(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),r=t.activeTouch,r.end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function l(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}be(t.scroller,"touchstart",(function(i){if(!Se(e,i)&&!o(i)&&!Os(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),be(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),be(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!qn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||l(r,r.prev)?new co(a,a):!r.prev.prev||l(r,r.prev.prev)?e.findWordAt(a):new co(ct(a.line,0),gt(e.doc,ct(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Te(n)}i()})),be(t.scroller,"touchcancel",i),be(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(gi(e,t.scroller.scrollTop),yi(e,t.scroller.scrollLeft,!0),Ce(e,"scroll",e))})),be(t.scroller,"mousewheel",(function(t){return so(e,t)})),be(t.scroller,"DOMMouseScroll",(function(t){return so(e,t)})),be(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){Se(e,t)||Me(t)},over:function(t){Se(e,t)||(Oa(e,t),Me(t))},start:function(t){return Ma(e,t)},drop:_i(e,Aa),leave:function(t){Se(e,t)||Na(e)}};var c=t.input.getField();be(c,"keyup",(function(t){return ms.call(e,t)})),be(c,"keydown",_i(e,fs)),be(c,"keypress",_i(e,gs)),be(c,"focus",(function(t){return ti(e,t)})),be(c,"blur",(function(t){return ni(e,t)}))}Bs.defaults=_s,Bs.optionHandlers=Rs;var Hs=[];function js(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=St(e,t).state:n="prev");var a=e.options.tabSize,s=tt(o,t),l=H(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==K||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?H(tt(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)p+=a,d+="\t";if(p<c&&(d+=Q(c-p)),d!=u)return la(o,d,ct(t,0),ct(t,u.length),"+input"),s.stateAfter=null,!0;for(var h=0;h<o.sel.ranges.length;h++){var m=o.sel.ranges[h];if(m.head.line==t&&m.head.ch<u.length){var g=ct(t,u.length);$o(o,h,new co(g,g));break}}}Bs.defineInitHook=function(e){return Hs.push(e)};var Us=null;function Gs(e){Us=e}function Ks(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,s="paste"==i||e.state.pasteIncoming>a,l=We(t),c=null;if(s&&r.ranges.length>1)if(Us&&Us.text.join("\n")==t){if(r.ranges.length%Us.text.length==0){c=[];for(var u=0;u<Us.text.length;u++)c.push(o.splitLines(Us.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=te(l,(function(e){return[e]})));for(var d=e.curOp.updateInput,p=r.ranges.length-1;p>=0;p--){var f=r.ranges[p],h=f.from(),m=f.to();f.empty()&&(n&&n>0?h=ct(h.line,h.ch-n):e.state.overwrite&&!s?m=ct(m.line,Math.min(tt(o,m.line).text.length,m.ch+ee(l).length)):s&&Us&&Us.lineWise&&Us.text.join("\n")==l.join("\n")&&(h=m=ct(h.line,0)));var g={from:h,to:m,text:c?c[p%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};na(e.doc,g),In(e,"inputRead",e,g)}t&&!s&&Xs(e,t),di(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function qs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||Fi(t,(function(){return Ks(t,n,0,null,"paste")})),!0}function Xs(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(t.indexOf(o.electricChars.charAt(s))>-1){a=js(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(tt(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=js(e,i.head.line,"smart"));a&&In(e,"electricInput",e,i.head.line)}}}function Ys(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:ct(i,0),head:ct(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function Js(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Zs(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),t}function Qs(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){z(this).focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&_i(this,t[e])(this,n,i),Ce(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xa(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:Ri((function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");ne(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},(function(e){return e.priority})),this.state.modeGen++,Br(this)})),removeOverlay:Ri((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(n,1),this.state.modeGen++,void Br(this)}})),indentLine:Ri((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),st(this.doc,e)&&js(this,e,t,n)})),indentSelection:Ri((function(e){for(var t=this.doc.sel.ranges,n=-1,r=0;r<t.length;r++){var i=t[r];if(i.empty())i.head.line>n&&(js(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&di(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l<n;++l)js(this,l,e);var c=this.doc.sel.ranges;0==o.ch&&t.length==c.length&&c[r].from().ch>0&&$o(this.doc,r,new co(o,c[r].to()),q)}}})),getTokenAt:function(e,t){return Et(this,e,t)},getLineTokens:function(e,t){return Et(this,ct(e),t,!0)},getTokenTypeAt:function(e){e=gt(this.doc,e);var t,n=Ct(this,tt(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]<o)){t=n[2*a+2];break}r=a+1}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!n.hasOwnProperty(t))return r;var i=n[t],o=this.getModeAt(e);if("string"==typeof o[t])i[o[t]]&&r.push(i[o[t]]);else if(o[t])for(var a=0;a<o[t].length;a++){var s=i[o[t][a]];s&&r.push(s)}else o.helperType&&i[o.helperType]?r.push(i[o.helperType]):i[o.name]&&r.push(i[o.name]);for(var l=0;l<i._global.length;l++){var c=i._global[l];c.pred(o,this)&&-1==U(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var n=this.doc;return e=mt(n,null==e?n.first+n.size-1:e),St(this,e+1,t).state},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return n=null==e?r.head:"object"==typeof e?gt(this.doc,e):e?r.from():r.to(),Sr(this,n,t||"page")},charCoords:function(e,t){return Cr(this,gt(this.doc,e),t||"page")},coordsChar:function(e,t){return e=xr(this,e,t||"page"),Lr(this,e.left,e.top)},lineAtHeight:function(e,t){return e=xr(this,{top:e,left:0},t||"page").top,at(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r,i=!1;if("number"==typeof e){var o=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>o&&(e=o,i=!0),r=tt(this.doc,e)}else r=e;return wr(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-un(r):0)},defaultTextHeight:function(){return Ir(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=Sr(this,gt(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&li(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Ri(fs),triggerOnKeyPress:Ri(gs),triggerOnKeyUp:ms,triggerOnMouseDown:Ri(Cs),execCommand:function(e){if(ts.hasOwnProperty(e))return ts[e].call(null,this)},triggerElectric:Ri((function(e){Xs(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=gt(this.doc,e),a=0;a<t;++a)if(o=el(this.doc,o,i,n,r),o.hitSide)break;return o},moveH:Ri((function(e,t){var n=this;this.extendSelectionsBy((function(r){return n.display.shift||n.doc.extend||r.empty()?el(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()}),Y)})),deleteH:Ri((function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ya(this,(function(n){var i=el(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}}))})),findPosV:function(e,t,n,r){var i=1,o=r;t<0&&(i=-1,t=-t);for(var a=gt(this.doc,e),s=0;s<t;++s){var l=Sr(this,a,"div");if(null==o?o=l.left:l.left=o,a=tl(this,l,i,n),a.hitSide)break}return a},moveV:Ri((function(e,t){var n=this,r=this.doc,i=[],o=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(a){if(o)return e<0?a.from():a.to();var s=Sr(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var l=tl(n,s,e,t);return"page"==t&&a==r.sel.primary()&&ui(n,Cr(n,l,"div").top-s.top),l}),Y),i.length)for(var a=0;a<r.sel.ranges.length;a++)r.sel.ranges[a].goalColumn=i[a]})),findWordAt:function(e){var t=this.doc,n=tt(t,e.line).text,r=e.ch,i=e.ch;if(n){var o=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=n.length||!r?++i:--r;var a=n.charAt(r),s=se(a,o)?function(e){return se(e,o)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!se(e)};while(r>0&&s(n.charAt(r-1)))--r;while(i<n.length&&s(n.charAt(i)))++i}return new co(ct(e.line,r),ct(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?P(this.display.cursorDiv,"CodeMirror-overwrite"):T(this.display.cursorDiv,"CodeMirror-overwrite"),Ce(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==I(W(this))},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ri((function(e,t){pi(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Zn(this)-this.display.barHeight,width:e.scrollWidth-Zn(this)-this.display.barWidth,clientHeight:er(this),clientWidth:Qn(this)}},scrollIntoView:Ri((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ct(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?fi(this,e):mi(this,e.from,e.to,e.margin)})),setSize:Ri((function(e,t){var n=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&mr(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){$r(n,i,"widget");break}++i})),this.curOp.forceUpdate=!0,Ce(this,"refresh",this)})),operation:function(e){return Fi(this,e)},startOperation:function(){return Ti(this)},endOperation:function(){return Ei(this)},refresh:Ri((function(){var e=this.display.cachedTextHeight;Br(this),this.curOp.forceUpdate=!0,gr(this),pi(this,this.doc.scrollLeft,this.doc.scrollTop),Xi(this.display),(null==e||Math.abs(e-Ir(this.display))>.5||this.options.lineWrapping)&&Wr(this),Ce(this,"refresh",this)})),swapDoc:Ri((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),So(this,e),gr(this),this.display.input.reset(),pi(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,In(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Le(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}function el(e,t,n,r,i){var o=t,a=n,s=tt(e,t.line),l=i&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n<e.first||n>=e.first+e.size)&&(t=new ct(n,t.ch,t.sticky),s=tt(e,n))}function u(o){var a;if("codepoint"==r){var u=s.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(u))a=null;else{var d=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new ct(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(d?2:1))),-n)}}else a=i?es(e.cm,s,t,n):Za(s,t,n);if(null==a){if(o||!c())return!1;t=Qa(i,e.cm,s,t.line,l)}else t=a;return!0}if("char"==r||"codepoint"==r)u();else if("column"==r)u(!0);else if("word"==r||"group"==r)for(var d=null,p="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;;h=!1){if(n<0&&!u(!h))break;var m=s.text.charAt(t.ch)||"\n",g=se(m,f)?"w":p&&"\n"==m?"n":!p||/\s/.test(m)?null:"p";if(!p||h||g||(g="s"),d&&d!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(d=g),n>0&&!u(!h))break}var v=Zo(e,t,o,a,!0);return dt(o,v)&&(v.hitSide=!0),v}function tl(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,z(e).innerHeight||a(e).documentElement.clientHeight),c=Math.max(l-.5*Ir(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){if(o=Lr(e,s,i),!o.outside)break;if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var nl=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new j,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function rl(e,t){var n=or(e,t.line);if(!n||n.hidden)return null;var r=tt(e.doc,t.line),i=nr(n,r,t.line),o=ve(r,e.doc.direction),a="left";if(o){var s=me(o,t.ch);a=s%2?"right":"left"}var l=ur(i.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function il(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function ol(e,t){return t&&(e.bad=!0),e}function al(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(u(),o+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(ct(r,0),ct(i+1,0),c(+f));return void(h.length&&(o=h[0].find(0))&&d(nt(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g<t.childNodes.length;g++)p(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),m&&(a=!0)}else 3==t.nodeType&&d(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;;){if(p(t),t==n)break;t=t.nextSibling,l=!1}return o}function sl(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return ol(e.clipPos(ct(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return ll(o,t,n)}}function ll(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!N(r,t))return ol(ct(ot(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?ee(e.rest):e.line;return ol(ct(ot(o),o.text.length),i)}var a=3==t.nodeType?t:null,s=t;a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,n&&(n=a.nodeValue.length));while(s.parentNode!=r)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,n,r){for(var i=-1;i<(c?c.length:0);i++)for(var o=i<0?l.map:c[i],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==n){var u=ot(i<0?e.line:e.rest[i]),d=o[a]+r;return(r<0||s!=t)&&(d=o[a+(r?1:0)]),ct(u,d)}}}var d=u(a,s,n);if(d)return ol(d,i);for(var p=s.nextSibling,f=a?a.nodeValue.length-n:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0),d)return ol(ct(d.line,d.ch-f),i);f+=p.textContent.length}for(var h=s.previousSibling,m=n;h;h=h.previousSibling){if(d=u(h,h.firstChild,-1),d)return ol(ct(d.line,d.ch+m),i);m+=h.textContent.length}}nl.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function a(e){if(o(e)&&!Se(r,e)){if(r.somethingSelected())Gs({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Ys(r);Gs({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,q),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var a=Us.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Zs(),l=s.firstChild;Js(l),r.display.lineSpace.insertBefore(s,r.display.lineSpace.firstChild),l.value=Us.text.join("\n");var c=I(V(i));_(l),setTimeout((function(){r.display.lineSpace.removeChild(s),c.focus(),c==i&&n.showPrimarySelection()}),50)}}i.contentEditable=!0,Js(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),be(i,"paste",(function(e){!o(e)||Se(r,e)||qs(e,r)||s<=11&&setTimeout(_i(r,(function(){return t.updateFromDOM()})),20)})),be(i,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),be(i,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),be(i,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),be(i,"touchstart",(function(){return n.forceCompositionEnd()})),be(i,"input",(function(){t.composing||t.readFromDOMSoon()})),be(i,"copy",a),be(i,"cut",a)},nl.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},nl.prototype.prepareSelection=function(){var e=qr(this.cm,!1);return e.focus=I(V(this.div))==this.div,e},nl.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},nl.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},nl.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),i=r.from(),o=r.to();if(t.display.viewTo==t.display.viewFrom||i.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=sl(t,e.anchorNode,e.anchorOffset),s=sl(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=ut(ht(a,s),i)||0!=ut(ft(a,s),o)){var l=t.display.view,c=i.line>=t.display.viewFrom&&rl(t,i)||{node:l[0].measure.map[2],offset:0},u=o.line<t.display.viewTo&&rl(t,o);if(!u){var d=l[l.length-1].measure,p=d.maps?d.maps[d.maps.length-1]:d.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(c&&u){var f,h=e.rangeCount&&e.getRangeAt(0);try{f=L(c.node,c.offset,u.offset,u.node)}catch(m){}f&&(!n&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),h&&null==e.anchorNode?e.addRange(h):n&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},nl.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout((function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation((function(){return e.cm.curOp.selectionChanged=!0}))}),20)},nl.prototype.showMultipleSelections=function(e){A(this.cm.display.cursorDiv,e.cursors),A(this.cm.display.selectionDiv,e.selection)},nl.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},nl.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return N(this.div,t)},nl.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&I(V(this.div))==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},nl.prototype.blur=function(){this.div.blur()},nl.prototype.getField=function(){return this.div},nl.prototype.supportsTouch=function(){return!0},nl.prototype.receivedFocus=function(){var e=this,t=this;function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.selectionInEditor()?setTimeout((function(){return e.pollSelection()}),20):Fi(this.cm,(function(){return t.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,n)},nl.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},nl.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&il(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var n=sl(t,e.anchorNode,e.anchorOffset),r=sl(t,e.focusNode,e.focusOffset);n&&r&&Fi(t,(function(){Go(t.doc,po(n,r),q),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},nl.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,n,r=this.cm,i=r.display,o=r.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>r.firstLine()&&(a=ct(a.line-1,tt(r.doc,a.line-1).length)),s.ch==tt(r.doc,s.line).text.length&&s.line<r.lastLine()&&(s=ct(s.line+1,0)),a.line<i.viewFrom||s.line>i.viewTo-1)return!1;a.line==i.viewFrom||0==(e=zr(r,a.line))?(t=ot(i.view[0].line),n=i.view[0].node):(t=ot(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=zr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=ot(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;var d=r.doc.splitLines(al(r,n,c,t,l)),p=nt(r.doc,ct(t,0),ct(l,tt(r.doc,l).text.length));while(d.length>1&&p.length>1)if(ee(d)==ee(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}var f=0,h=0,m=d[0],g=p[0],v=Math.min(m.length,g.length);while(f<v&&m.charCodeAt(f)==g.charCodeAt(f))++f;var y=ee(d),b=ee(p),w=Math.min(y.length-(1==d.length?f:0),b.length-(1==p.length?f:0));while(h<w&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1))++h;if(1==d.length&&1==p.length&&t==a.line)while(f&&f>a.ch&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1))f--,h++;d[d.length-1]=y.slice(0,y.length-h).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var x=ct(t,f),C=ct(l,p.length?ee(p).length-h:0);return d.length>1||d[0]||ut(x,C)?(la(r.doc,d,x,C,"+input"),!0):void 0},nl.prototype.ensurePolled=function(){this.forceCompositionEnd()},nl.prototype.reset=function(){this.forceCompositionEnd()},nl.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},nl.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},nl.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Fi(this.cm,(function(){return Br(e.cm)}))},nl.prototype.setUneditable=function(e){e.contentEditable="false"},nl.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||_i(this.cm,Ks)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},nl.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},nl.prototype.onContextMenu=function(){},nl.prototype.resetPosition=function(){},nl.prototype.needsContentAttribute=!0;var cl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new j,this.hasSelection=!1,this.composing=null,this.resetting=!1};function ul(e,t){if(t=t?$(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I(V(e));t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(be(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(xe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Bs((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function dl(e){e.off=xe,e.on=be,e.wheelEventPixels=ao,e.Doc=Ta,e.splitLines=We,e.countColumn=H,e.findColumn=J,e.isWordChar=ae,e.Pass=K,e.signal=Ce,e.Line=fn,e.changeEnd=fo,e.scrollbarModel=ki,e.Pos=ct,e.cmpPos=ut,e.modes=He,e.mimeModes=je,e.resolveMode=Ke,e.getMode=qe,e.modeExtensions=Xe,e.extendMode=Ye,e.copyState=Je,e.startState=Qe,e.innerMode=Ze,e.commands=ts,e.keyMap=$a,e.keyName=qa,e.isModifierKey=Ga,e.lookupKey=Ua,e.normalizeKeyMap=ja,e.StringStream=et,e.SharedTextMarker=xa,e.TextMarker=ba,e.LineWidget=ma,e.e_preventDefault=Te,e.e_stopPropagation=Ee,e.e_stop=Me,e.addClass=P,e.contains=N,e.rmClass=T,e.keyNames=Wa}cl.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!Se(r,e)){if(r.somethingSelected())Gs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Ys(r);Gs({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,q):(n.prevInput="",i.value=t.text.join("\n"),_(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(i.style.width="0px"),be(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),be(i,"paste",(function(e){Se(r,e)||qs(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),be(i,"cut",o),be(i,"copy",o),be(e.scroller,"paste",(function(t){if(!qn(e,t)&&!Se(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),be(e.lineSpace,"selectstart",(function(t){qn(e,t)||Te(t)})),be(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),be(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},cl.prototype.createField=function(e){this.wrapper=Zs(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Js(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},cl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},cl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=qr(e);if(e.options.moveInputWithCursor){var i=Sr(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},cl.prototype.showSelection=function(e){var t=this.cm,n=t.display;A(n.cursorDiv,e.cursors),A(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},cl.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&_(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null));this.resetting=!1}},cl.prototype.getField=function(){return this.textarea},cl.prototype.supportsTouch=function(){return!1},cl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!y||I(V(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},cl.prototype.blur=function(){this.textarea.blur()},cl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},cl.prototype.receivedFocus=function(){this.slowPoll()},cl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},cl.prototype.fastPoll=function(){var e=!1,t=this;function n(){var r=t.poll();r||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},cl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Ve(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(r.length,i.length);while(l<c&&r.charCodeAt(l)==i.charCodeAt(l))++l;return Fi(t,(function(){Ks(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},cl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},cl.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},cl.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Vr(n,e),c=r.scroller.scrollTop;if(o&&!p){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&_i(n,Go)(n.doc,po(o),q);var d,f=i.style.cssText,h=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(d=i.ownerDocument.defaultView.scrollY),r.input.focus(),l&&i.ownerDocument.defaultView.scrollTo(null,d),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),k){Me(e);var g=function(){xe(window,"mouseup",g),setTimeout(y,20)};be(window,"mouseup",g)}else setTimeout(y,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?_i(n,ea)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},cl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},cl.prototype.setUneditable=function(){},cl.prototype.needsContentAttribute=!1,Ws(Bs),Qs(Bs);var pl="iter insert remove copy getEditor constructor".split(" ");for(var fl in Ta.prototype)Ta.prototype.hasOwnProperty(fl)&&U(pl,fl)<0&&(Bs.prototype[fl]=function(e){return function(){return e.apply(this.doc,arguments)}}(Ta.prototype[fl]));return Le(Ta),Bs.inputStyles={textarea:cl,contenteditable:nl},Bs.defineMode=function(e){Bs.defaults.mode||"null"==e||(Bs.defaults.mode=e),Ue.apply(this,arguments)},Bs.defineMIME=Ge,Bs.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Bs.defineMIME("text/plain","null"),Bs.defineExtension=function(e,t){Bs.prototype[e]=t},Bs.defineDocExtension=function(e,t){Ta.prototype[e]=t},Bs.fromTextArea=ul,dl(Bs),Bs.version="5.65.16",Bs}))},"76f7":function(e,t,n){},"80ff":function(e,t,n){},"8f94":function(e,t,n){!function(t,r){e.exports=r(n("56b3"))}(0,(function(e){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),i=function(e){return e&&e.__esModule?e:{default:e}}(r),o=window.CodeMirror||i.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},writable:!0,configurable:!0}),t.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(e){for(var t in e)this.cminstance.setOption(t,e[t])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(e){this.handerCodeChange(e)},value:function(e){this.handerCodeChange(e)}},methods:{initialize:function(){var e=this,t=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=o.MergeView(this.$refs.mergeview,t),this.cminstance=this.codemirror.edit):(this.codemirror=o.fromTextArea(this.$refs.textarea,t),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",(function(t){e.content=t.getValue(),e.$emit&&e.$emit("input",e.content)}));var n={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter((function(e){return!n[e]&&(n[e]=!0)})).forEach((function(t){e.cminstance.on(t,(function(){for(var n=arguments.length,r=Array(n),i=0;i<n;i++)r[i]=arguments[i];e.$emit.apply(e,[t].concat(r));var o=t.replace(/([A-Z])/g,"-$1").toLowerCase();o!==t&&e.$emit.apply(e,[o].concat(r))}))})),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var e=this;this.$nextTick((function(){e.cminstance.refresh()}))},destroy:function(){var e=this.cminstance.doc.cm.getWrapperElement();e&&e.remove&&e.remove()},handerCodeChange:function(e){if(e!==this.cminstance.getValue()){var t=this.cminstance.getScrollInfo();this.cminstance.setValue(e),this.content=e,this.cminstance.scrollTo(t.left,t.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var e=this;void 0!==this.unseenLines&&void 0!==this.marker&&this.unseenLines.forEach((function(t){var n=e.cminstance.lineInfo(t);e.cminstance.setGutterMarker(t,"breakpoints",n.gutterMarkers?null:e.marker())}))},switchMerge:function(){var e=this.cminstance.doc.history,t=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=e,this.cminstance.doc.cleanGeneration=t}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n.n(r);for(var o in r)["default","default"].indexOf(o)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var a=n(5),s=n(4),l=s(i.a,a.a,!1,null,null,null);t.default=l.exports},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.install=t.codemirror=t.CodeMirror=void 0;var i=n(0),o=r(i),a=n(2),s=r(a),l=window.CodeMirror||o.default,c=function(e,t){t&&(t.options&&(s.default.props.globalOptions.default=function(){return t.options}),t.events&&(s.default.props.globalEvents.default=function(){return t.events})),e.component(s.default.name,s.default)},u={CodeMirror:l,codemirror:s.default,install:c};t.default=u,t.CodeMirror=l,t.codemirror=s.default,t.install=c},function(e,t){e.exports=function(e,t,n,r,i,o){var a,s=e=e||{},l=typeof e.default;"object"!==l&&"function"!==l||(a=e,s=e.default);var c,u="function"==typeof s?s.options:s;if(t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),n&&(u.functional=!0),i&&(u._scopeId=i),o?(c=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},u._ssrRegister=c):r&&(c=r),c){var d=u.functional,p=d?u.render:u.beforeCreate;d?(u._injectStyles=c,u.render=function(e,t){return c.call(t),p(e,t)}):u.beforeCreate=p?[].concat(p,c):[c]}return{esModule:a,exports:s,options:u}}},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vue-codemirror",class:{merge:e.merge}},[e.merge?n("div",{ref:"mergeview"}):n("textarea",{ref:"textarea",attrs:{name:e.name,placeholder:e.placeholder}})])},i=[],o={render:r,staticRenderFns:i};t.a=o}])}))},"910f":function(e,t,n){},"9a03":function(e,t,n){},"9f21":function(e,t,n){},a1fa:function(e,t,n){},a596:function(e,t,n){},a7be:function(e,t,n){},acdf:function(e,t,n){},c184:function(e,t,n){"use strict";n("9a03")},d5e0:function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];function d(e,t){function n(n){return t.tokenize=n,n(e,t)}var r,i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(m(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=p,"tag bracket"):"&"==i?(r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?"atom":"error"):(e.eatWhile(/[^&<]/),null)}function p(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){t.tokenize=d,t.state=w,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=f(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e){var t=function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=p;break}return"string"};return t.isInAttribute=!0,t}function h(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function m(e){return function(t,n){var r;while(null!=(r=t.next())){if("<"==r)return n.tokenize=m(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=d;break}return n.tokenize=m(e-1),n.tokenize(t,n)}}return"meta"}}function g(e){return e&&e.toLowerCase()}function v(e,t,n){this.prev=e.context,this.tagName=t||"",this.indent=e.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function y(e){e.context&&(e.context=e.context.prev)}function b(e,t){var n;while(1){if(!e.context)return;if(n=e.context.tagName,!l.contextGrabbers.hasOwnProperty(g(n))||!l.contextGrabbers[g(n)].hasOwnProperty(g(t)))return;y(e)}}function w(e,t,n){return"openTag"==e?(n.tagStart=t.column(),x):"closeTag"==e?C:w}function x(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",D):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",D(e,t,n)):(a="error",x)}function C(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(g(n.context.tagName))&&y(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",S):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",S(e,t,n)):(a="error",k)}function S(e,t,n){return"endTag"!=e?(a="error",S):(y(n),w)}function k(e,t,n){return a="error",S(e,t,n)}function D(e,t,n){if("word"==e)return a="attribute",L;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(g(r))?b(n,r):(b(n,r),n.context=new v(n,r,i==n.indented)),w}return a="error",D}function L(e,t,n){return"equals"==e?T:(l.allowMissing||(a="error"),D(e,t,n))}function T(e,t,n){return"string"==e?E:"word"==e&&l.allowUnquoted?(a="string",D):(a="error",D(e,t,n))}function E(e,t,n){return"string"==e?E:D(e,t,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:w,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=p&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var o=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(o&&o[1])while(i){if(i.tagName==o[2]){i=i.prev;break}if(!l.implicitlyClosed.hasOwnProperty(g(i.tagName)))break;i=i.prev}else if(o)while(i){var a=l.contextGrabbers[g(i.tagName)];if(!a||!a.hasOwnProperty(g(o[2])))break;i=i.prev}while(i&&i.prev&&!i.startOfLine)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==T&&(e.state=D)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],n=e.context;n;n=n.prev)t.push(n.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}))},d681:function(e,t,n){"use strict";n("76f7")},e10e:function(e,t,n){"use strict";n("910f")},e7a3:function(e,t,n){"use strict";n("316a")},f5f2:function(e,t,n){},fadf:function(e,t,n){}}]);