chunk-06b32ebc.c8b46170.js 564 KB

123456
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-06b32ebc"],{"0b13":function(e,t,i){},1148:function(e,t,i){"use strict";var n=i("a691"),o=i("1d80");e.exports="".repeat||function(e){var t=String(o(this)),i="",r=n(e);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(i+=t);return i}},"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"13d5":function(e,t,i){"use strict";var n=i("23e7"),o=i("d58f").left,r=i("a640"),s=i("ae40"),a=r("reduce"),l=s("reduce",{1:0});n({target:"Array",proto:!0,forced:!a||!l},{reduce:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},1913:function(e,t,i){"use strict";var n=i("23e7"),o=i("857a"),r=i("af03");n({target:"String",proto:!0,forced:r("fontsize")},{fontsize:function(e){return o(this,"font","size",e)}})},"1f9f":function(e,t,i){"use strict";var n=i("411e"),o=i.n(n);o.a},2168:function(e,t,i){},2532:function(e,t,i){"use strict";var n=i("23e7"),o=i("5a34"),r=i("1d80"),s=i("ab13");n({target:"String",proto:!0,forced:!s("includes")},{includes:function(e){return!!~String(r(this)).indexOf(o(e),arguments.length>1?arguments[1]:void 0)}})},"2db0":function(e,t,i){i("c975"),i("ac1f"),i("466d"),i("5319"),UE.Editor.prototype.getKfContent=function(e){var t=this,i=t.getActionUrl(t.getOpt("scrawlActionName")),n=UE.utils.serializeParam(t.queryCommandValue("serverparam"))||"",o=UE.utils.formatUrl(i+(-1==i.indexOf("?")?"?":"&")+n),r=0,s=t.body.getElementsByTagName("img"),a=[];function l(){r>=a.length&&(t.sync(),e(t.getContent()))}UE.utils.each(s,(function(e){var t=e.getAttribute("src").match(/^[^;]+/)[0];"data:image/png"===t&&a.push(e)})),0==a.length?l():UE.utils.each(a,(function(e){var i={};i[t.getOpt("scrawlFieldName")]=e.getAttribute("src").replace(/^[^,]+,/,""),i.onsuccess=function(i){var n=UE.utils.str2json(i.responseText),o=t.options.scrawlUrlPrefix+n.url;e.setAttribute("src",o),e.setAttribute("_src",o),r++,l()},i.onerror=function(e){console.error(e),r++,l()},UE.ajax.request(o,i)}))}},"2e32":function(e,t){UE.I18N["zh-cn"]={labelMap:{anchor:"锚点",undo:"撤销",redo:"重做",bold:"加粗",indent:"首行缩进",snapscreen:"截图",italic:"斜体",underline:"下划线",strikethrough:"删除线",subscript:"下标",fontborder:"字符边框",superscript:"上标",formatmatch:"格式刷",source:"源代码",blockquote:"引用",pasteplain:"纯文本粘贴模式",selectall:"全选",print:"打印",preview:"预览",horizontal:"分隔线",removeformat:"清除格式",time:"时间",date:"日期",unlink:"取消链接",insertrow:"前插入行",insertcol:"前插入列",mergeright:"右合并单元格",mergedown:"下合并单元格",deleterow:"删除行",deletecol:"删除列",splittorows:"拆分成行",splittocols:"拆分成列",splittocells:"完全拆分单元格",deletecaption:"删除表格标题",inserttitle:"插入标题",mergecells:"合并多个单元格",deletetable:"删除表格",cleardoc:"清空文档",insertparagraphbeforetable:"表格前插入行",insertcode:"代码语言",fontfamily:"字体",fontsize:"字号",paragraph:"段落格式",simpleupload:"单图上传",insertimage:"多图上传",edittable:"表格属性",edittd:"单元格属性",link:"超链接",emotion:"表情",spechars:"特殊字符",searchreplace:"查询替换",map:"Baidu地图",gmap:"Google地图",insertvideo:"视频",help:"帮助",justifyleft:"居左对齐",justifyright:"居右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",forecolor:"字体颜色",backcolor:"背景色",insertorderedlist:"有序列表",insertunorderedlist:"无序列表",fullscreen:"全屏",directionalityltr:"从左向右输入",directionalityrtl:"从右向左输入",rowspacingtop:"段前距",rowspacingbottom:"段后距",pagebreak:"分页",insertframe:"插入Iframe",imagenone:"默认",imageleft:"左浮动",imageright:"右浮动",attachment:"附件",imagecenter:"居中",wordimage:"图片转存",lineheight:"行间距",edittip:"编辑提示",customstyle:"自定义标题",autotypeset:"自动排版",webapp:"百度应用",touppercase:"字母大写",tolowercase:"字母小写",background:"背景",template:"模板",scrawl:"涂鸦",music:"音乐",inserttable:"插入表格",drafts:"从草稿箱加载",charts:"图表"},insertorderedlist:{num:"1,2,3...",num1:"1),2),3)...",num2:"(1),(2),(3)...",cn:"一,二,三....",cn1:"一),二),三)....",cn2:"(一),(二),(三)....",decimal:"1,2,3...","lower-alpha":"a,b,c...","lower-roman":"i,ii,iii...","upper-alpha":"A,B,C...","upper-roman":"I,II,III..."},insertunorderedlist:{circle:"○ 大圆圈",disc:"● 小黑点",square:"■ 小方块 ",dash:"— 破折号",dot:" 。 小圆圈"},paragraph:{p:"段落",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{songti:"宋体",kaiti:"楷体",heiti:"黑体",lishu:"隶书",yahei:"微软雅黑",andaleMono:"andale mono",arial:"arial",arialBlack:"arial black",comicSansMs:"comic sans ms",impact:"impact",timesNewRoman:"times new roman"},customstyle:{tc:"标题居中",tl:"标题居左",im:"强调",hi:"明显强调"},autoupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},simpleupload:{exceedSizeError:"文件大小超出限制",exceedTypeError:"文件格式不允许",jsonEncodeError:"服务器返回格式错误",loading:"正在上传...",loadError:"上传错误",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!"},elementPathTip:"元素路径",wordCountTip:"字数统计",wordCountMsg:"当前已输入{#count}个字符, 您还可以输入{#leave}个字符。 ",wordOverFlowMsg:'<span style="color:red;">字数超出最大允许值,服务器可能拒绝保存!</span>',ok:"确认",cancel:"取消",closeDialog:"关闭对话框",tableDrag:"表格拖动必须引入uiUtils.js文件!",autofloatMsg:"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!",loadconfigError:"获取后台配置项请求出错,上传功能将不能正常使用!",loadconfigFormatError:"后台配置项返回格式出错,上传功能将不能正常使用!",loadconfigHttpError:"请求后台配置项http错误,上传功能将不能正常使用!",snapScreen_plugin:{browserMsg:"仅支持IE浏览器!",callBackErrorMsg:"服务器返回数据有误,请检查配置项之后重试。",uploadErrorMsg:"截图上传失败,请检查服务器端环境! "},insertcode:{as3:"ActionScript 3",bash:"Bash/Shell",cpp:"C/C++",css:"CSS",cf:"ColdFusion","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"HTML",java:"Java",jfx:"JavaFX",js:"JavaScript",pl:"Perl",php:"PHP",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"SQL",vb:"Visual Basic",xml:"XML"},confirmClear:"确定清空当前文档么?",contextMenu:{delete:"删除",selectall:"全选",deletecode:"删除代码",cleardoc:"清空文档",confirmclear:"确定清空当前文档么?",unlink:"删除超链接",paragraph:"段落格式",edittable:"表格属性",aligntd:"单元格对齐方式",aligntable:"表格对齐方式",tableleft:"左浮动",tablecenter:"居中显示",tableright:"右浮动",edittd:"单元格属性",setbordervisible:"设置表格边线可见",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",table:"表格",inserttable:"插入表格",deletetable:"删除表格",insertparagraphbefore:"前插入段落",insertparagraphafter:"后插入段落",deleterow:"删除当前行",deletecol:"删除当前列",insertrow:"前插入行",insertcol:"左插入列",insertrownext:"后插入行",insertcolnext:"右插入列",insertcaption:"插入表格名称",deletecaption:"删除表格名称",inserttitle:"插入表格标题行",deletetitle:"删除表格标题行",inserttitlecol:"插入表格标题列",deletetitlecol:"删除表格标题列",averageDiseRow:"平均分布各行",averageDisCol:"平均分布各列",mergeright:"向右合并",mergeleft:"向左合并",mergedown:"向下合并",mergecells:"合并单元格",splittocells:"完全拆分单元格",splittocols:"拆分成列",splittorows:"拆分成行",tablesort:"表格排序",enablesort:"设置表格可排序",disablesort:"取消表格可排序",reversecurrent:"逆序当前",orderbyasc:"按ASCII字符升序",reversebyasc:"按ASCII字符降序",orderbynum:"按数值大小升序",reversebynum:"按数值大小降序",borderbk:"边框底纹",setcolor:"表格隔行变色",unsetcolor:"取消表格隔行变色",setbackground:"选区背景隔行",unsetbackground:"取消选区背景",redandblue:"红蓝相间",threecolorgradient:"三色渐变",copy:"复制(Ctrl + c)",copymsg:"浏览器不支持,请使用 'Ctrl + c'",paste:"粘贴(Ctrl + v)",pastemsg:"浏览器不支持,请使用 'Ctrl + v'"},copymsg:"浏览器不支持,请使用 'Ctrl + c'",pastemsg:"浏览器不支持,请使用 'Ctrl + v'",anthorMsg:"链接",clearColor:"清空颜色",standardColor:"标准颜色",themeColor:"主题颜色",property:"属性",default:"默认",modify:"修改",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中",justify:"默认",clear:"清除",anchorMsg:"锚点",delete:"删除",clickToUpload:"点击上传",unset:"尚未设置语言文件",t_row:"行",t_col:"列",more:"更多",pasteOpt:"粘贴选项",pasteSourceFormat:"保留源格式",tagFormat:"只保留标签",pasteTextFormat:"只保留文本",autoTypeSet:{mergeLine:"合并空行",delLine:"清除空行",removeFormat:"清除格式",indent:"首行缩进",alignment:"对齐方式",imageFloat:"图片浮动",removeFontsize:"清除字号",removeFontFamily:"清除字体",removeHtml:"清除冗余HTML代码",pasteFilter:"粘贴过滤",run:"执行",symbol:"符号转换",bdc2sb:"全角转半角",tobdc:"半角转全角"},background:{static:{lang_background_normal:"背景设置",lang_background_local:"在线图片",lang_background_set:"选项",lang_background_none:"无背景色",lang_background_colored:"有背景色",lang_background_color:"颜色设置",lang_background_netimg:"网络图片",lang_background_align:"对齐方式",lang_background_position:"精确定位",repeatType:{options:["居中","横向重复","纵向重复","平铺","自定义"]}},noUploadImage:"当前未上传过任何图片!",toggleSelect:"单击可切换选中状态\n原图尺寸: "},insertimage:{static:{lang_tab_remote:"插入图片",lang_tab_upload:"本地上传",lang_tab_online:"在线管理",lang_tab_search:"图片搜索",lang_input_url:"地 址:",lang_input_size:"大 小:",lang_input_width:"宽度",lang_input_height:"高度",lang_input_border:"边 框:",lang_input_vhspace:"边 距:",lang_input_title:"描 述:",lang_input_align:"图片浮动方式:",lang_imgLoading:" 图片加载中……",lang_start_upload:"开始上传",lock:{title:"锁定宽高比例"},searchType:{title:"图片类型",options:["新闻","壁纸","表情","头像"]},searchTxt:{value:"请输入搜索关键词"},searchBtn:{value:"百度一下"},searchReset:{value:"清空搜索"},noneAlign:{title:"无浮动"},leftAlign:{title:"左浮动"},rightAlign:{title:"右浮动"},centerAlign:{title:"居中独占一行"}},uploadSelectFile:"点击选择图片",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",uploadNoPreview:"不能预览",updateStatusReady:"选中_张图片,共_KB。",updateStatusConfirm:"已成功上传_张照片,_张照片上传失败",updateStatusFinish:"共_张(_KB),_张上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错",remoteLockError:"宽高不正确,不能所定比例",numError:"请输入正确的长度或者宽度值!例如:123,400",imageUrlError:"不允许的图片格式或者图片域!",imageLoadError:"图片加载失败!请检查链接地址或网络状态!",searchRemind:"请输入搜索关键词",searchLoading:"图片加载中,请稍后……",searchRetry:" :( ,抱歉,没有找到图片!请重试一次!"},attachment:{static:{lang_tab_upload:"上传附件",lang_tab_online:"在线附件",lang_start_upload:"开始上传",lang_drop_remind:"可以将文件拖到这里,单次最多可选100个文件"},uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"已成功上传_个文件,_个文件上传失败",updateStatusFinish:"共_个(_KB),_个上传成功",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},insertvideo:{static:{lang_tab_insertV:"插入视频",lang_tab_searchV:"搜索视频",lang_tab_uploadV:"上传视频",lang_video_url:"视频网址",lang_video_size:"视频尺寸",lang_videoW:"宽度",lang_videoH:"高度",lang_alignment:"对齐方式",videoSearchTxt:{value:"请输入搜索关键字!"},videoType:{options:["全部","热门","娱乐","搞笑","体育","科技","综艺"]},videoSearchBtn:{value:"百度一下"},videoSearchReset:{value:"清空结果"},lang_input_fileStatus:" 当前未上传文件",startUpload:{style:"background:url(upload.png) no-repeat;"},lang_upload_size:"视频尺寸",lang_upload_width:"宽度",lang_upload_height:"高度",lang_upload_alignment:"对齐方式",lang_format_advice:"建议使用mp4格式."},numError:"请输入正确的数值,如123,400",floatLeft:"左浮动",floatRight:"右浮动",'"default"':"默认",block:"独占一行",urlError:"输入的视频地址有误,请检查后再试!",loading:" &nbsp;视频加载中,请等待……",clickToSelect:"点击选中",goToSource:"访问源视频",noVideo:" &nbsp; &nbsp;抱歉,找不到对应的视频,请重试!",browseFiles:"浏览文件",uploadSuccess:"上传成功!",delSuccessFile:"从成功队列中移除",delFailSaveFile:"移除保存失败文件",statusPrompt:" 个文件已上传! ",flashVersionError:"当前Flash版本过低,请更新FlashPlayer后重试!",flashLoadingError:"Flash加载失败!请检查路径或网络状态",fileUploadReady:"等待上传……",delUploadQueue:"从上传队列中移除",limitPrompt1:"单次不能选择超过",limitPrompt2:"个文件!请重新选择!",delFailFile:"移除失败文件",fileSizeLimit:"文件大小超出限制!",emptyFile:"空文件无法上传!",fileTypeError:"文件类型不允许!",unknownError:"未知错误!",fileUploading:"上传中,请等待……",cancelUpload:"取消上传",netError:"网络错误",failUpload:"上传失败!",serverIOError:"服务器IO错误!",noAuthority:"无权限!",fileNumLimit:"上传个数限制",failCheck:"验证失败,本次上传被跳过!",fileCanceling:"取消中,请等待……",stopUploading:"上传已停止……",uploadSelectFile:"点击选择文件",uploadAddFile:"继续添加",uploadStart:"开始上传",uploadPause:"暂停上传",uploadContinue:"继续上传",uploadRetry:"重试上传",uploadDelete:"删除",uploadTurnLeft:"向左旋转",uploadTurnRight:"向右旋转",uploadPreview:"预览中",updateStatusReady:"选中_个文件,共_KB。",updateStatusConfirm:"成功上传_个,_个失败",updateStatusFinish:"共_个(_KB),_个成功上传",updateStatusError:",_张上传失败。",errorNotSupport:"WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。",errorLoadConfig:"后端配置项没有正常加载,上传插件不能正常使用!",errorExceedSize:"文件大小超出",errorFileType:"文件格式不允许",errorInterrupt:"文件传输中断",errorUploadRetry:"上传失败,请重试",errorHttp:"http请求错误",errorServerUpload:"服务器返回出错"},webapp:{tip1:"本功能由百度APP提供,如看到此页面,请各位站长首先申请百度APPKey!",tip2:"申请完成之后请至ueditor.config.js中配置获得的appkey! ",applyFor:"点此申请",anthorApi:"百度API"},template:{static:{lang_template_bkcolor:"背景颜色",lang_template_clear:"保留原有内容",lang_template_select:"选择模板"},blank:"空白文档",blog:"博客文章",resume:"个人简历",richText:"图文混排",sciPapers:"科技论文"},scrawl:{static:{lang_input_previousStep:"上一步",lang_input_nextsStep:"下一步",lang_input_clear:"清空",lang_input_addPic:"添加背景",lang_input_ScalePic:"缩放背景",lang_input_removePic:"删除背景",J_imgTxt:{title:"添加背景图片"}},noScarwl:"尚未作画,白纸一张~",scrawlUpLoading:"涂鸦上传中,别急哦~",continueBtn:"继续",imageError:"糟糕,图片读取失败了!",backgroundUploading:"背景图片上传中,别急哦~"},music:{static:{lang_input_tips:"输入歌手/歌曲/专辑,搜索您感兴趣的音乐!",J_searchBtn:{value:"搜索歌曲"}},emptyTxt:"未搜索到相关音乐结果,请换一个关键词试试。",chapter:"歌曲",singer:"歌手",special:"专辑",listenTest:"试听"},anchor:{static:{lang_input_anchorName:"锚点名字:"}},charts:{static:{lang_data_source:"数据源:",lang_chart_format:"图表格式:",lang_data_align:"数据对齐方式",lang_chart_align_same:"数据源与图表X轴Y轴一致",lang_chart_align_reverse:"数据源与图表X轴Y轴相反",lang_chart_title:"图表标题",lang_chart_main_title:"主标题:",lang_chart_sub_title:"子标题:",lang_chart_x_title:"X轴标题:",lang_chart_y_title:"Y轴标题:",lang_chart_tip:"提示文字",lang_cahrt_tip_prefix:"提示文字前缀:",lang_cahrt_tip_description:"仅饼图有效, 当鼠标移动到饼图中相应的块上时,提示框内的文字的前缀",lang_chart_data_unit:"数据单位",lang_chart_data_unit_title:"单位:",lang_chart_data_unit_description:"显示在每个数据点上的数据的单位, 比如: 温度的单位 ℃",lang_chart_type:"图表类型:",lang_prev_btn:"上一个",lang_next_btn:"下一个"}},emotion:{static:{lang_input_choice:"精选",lang_input_Tuzki:"兔斯基",lang_input_BOBO:"BOBO",lang_input_lvdouwa:"绿豆蛙",lang_input_babyCat:"baby猫",lang_input_bubble:"泡泡",lang_input_youa:"有啊"}},gmap:{static:{lang_input_address:"地址",lang_input_search:"搜索",address:{value:"北京"}},searchError:"无法定位到该地址!"},help:{static:{lang_input_about:"关于UEditor",lang_input_shortcuts:"快捷键",lang_input_introduction:"UEditor是由百度web前端研发部开发的所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点。开源基于BSD协议,允许自由使用和修改代码。",lang_Txt_shortcuts:"快捷键",lang_Txt_func:"功能",lang_Txt_bold:"给选中字设置为加粗",lang_Txt_copy:"复制选中内容",lang_Txt_cut:"剪切选中内容",lang_Txt_Paste:"粘贴",lang_Txt_undo:"重新执行上次操作",lang_Txt_redo:"撤销上一次操作",lang_Txt_italic:"给选中字设置为斜体",lang_Txt_underline:"给选中字加下划线",lang_Txt_selectAll:"全部选中",lang_Txt_visualEnter:"软回车",lang_Txt_fullscreen:"全屏"}},insertframe:{static:{lang_input_address:"地址:",lang_input_width:"宽度:",lang_input_height:"高度:",lang_input_isScroll:"允许滚动条:",lang_input_frameborder:"显示框架边框:",lang_input_alignMode:"对齐方式:",align:{title:"对齐方式",options:["默认","左对齐","右对齐","居中"]}},enterAddress:"请输入地址!"},link:{static:{lang_input_text:"文本内容:",lang_input_url:"链接地址:",lang_input_title:"标题:",lang_input_target:"是否在新窗口打开:"},validLink:"只支持选中一个链接时生效",httpPrompt:"您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀"},map:{static:{lang_city:"城市",lang_address:"地址",city:{value:"北京"},lang_search:"搜索",lang_dynamicmap:"插入动态地图"},cityMsg:"请选择城市",errorMsg:"抱歉,找不到该位置!"},searchreplace:{static:{lang_tab_search:"查找",lang_tab_replace:"替换",lang_search1:"查找",lang_search2:"查找",lang_replace:"替换",lang_searchReg:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_searchReg1:"支持正则表达式,添加前后斜杠标示为正则表达式,例如“/表达式/”",lang_case_sensitive1:"区分大小写",lang_case_sensitive2:"区分大小写",nextFindBtn:{value:"下一个"},preFindBtn:{value:"上一个"},nextReplaceBtn:{value:"下一个"},preReplaceBtn:{value:"上一个"},repalceBtn:{value:"替换"},repalceAllBtn:{value:"全部替换"}},getEnd:"已经搜索到文章末尾!",getStart:"已经搜索到文章头部",countMsg:"总共替换了{#count}处!"},snapscreen:{static:{lang_showMsg:"截图功能需要首先安装UEditor截图插件! ",lang_download:"点此下载",lang_step1:"第一步,下载UEditor截图插件并运行安装。",lang_step2:"第二步,插件安装完成后即可使用,如不生效,请重启浏览器后再试!"}},spechars:{static:{},tsfh:"特殊字符",lmsz:"罗马字符",szfh:"数学字符",rwfh:"日文字符",xlzm:"希腊字母",ewzm:"俄文字符",pyzm:"拼音字母",yyyb:"英语音标",zyzf:"其他"},edittable:{static:{lang_tableStyle:"表格样式",lang_insertCaption:"添加表格名称行",lang_insertTitle:"添加表格标题行",lang_insertTitleCol:"添加表格标题列",lang_orderbycontent:"使表格内容可排序",lang_tableSize:"自动调整表格尺寸",lang_autoSizeContent:"按表格文字自适应",lang_autoSizePage:"按页面宽度自适应",lang_example:"示例",lang_borderStyle:"表格边框",lang_color:"颜色:"},captionName:"表格名称",titleName:"标题",cellsName:"内容",errorMsg:"有合并单元格,不可排序"},edittip:{static:{lang_delRow:"删除整行",lang_delCol:"删除整列"}},edittd:{static:{lang_tdBkColor:"背景颜色:"}},formula:{static:{}},wordimage:{static:{lang_resave:"转存步骤",uploadBtn:{src:"upload.png",alt:"上传"},clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},lang_step:"1、点击顶部复制按钮,将地址复制到剪贴板;2、点击添加照片按钮,在弹出的对话框中使用Ctrl+V粘贴地址;3、点击打开后选择图片上传流程。"},fileType:"图片",flashError:"FLASH初始化失败,请检查FLASH插件是否正确安装!",netError:"网络连接错误,请重试!",copySuccess:"图片地址已经复制!",flashI18n:{}},autosave:{saving:"保存中...",success:"本地保存成功"}}},3004:function(e,t,i){"use strict";var n=i("48f6"),o=i.n(n);o.a},3381:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"answer_sheet",style:"height:"+e.answerSheetHeight+"px"},[i("div",{ref:"box",staticClass:"card_edit-wrap"},e._l(e.bigTopicPageArr,(function(t,n){return i("paper",{key:n,class:"pageindex-"+n,attrs:{content:t,totalPageNum:e.bigTopicPageArr.length,pageIndex:n},on:{showEditBigTopic:e.showEditBigTopic,ueBlur:e.ueBlur}})})),1),i("div",{staticClass:"card_setting-wrap"},[i("setting",{on:{showAddBigTopic:e.showAddBigTopic,restAnswerSheet:e.restAnswerSheet}}),e.cardSetting.allowEdit?e._e():i("div",{staticClass:"set-disable"})],1),i("button",{staticClass:"btn btn-go-back",on:{click:e.goBack}},[e._v("返回")]),i("el-dialog",{attrs:{title:"设置",visible:e.dialogVisibleIsAddTopic,width:"915px","before-close":e.handleCloseAddTopic,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogVisibleIsAddTopic=t},open:e.showBigTopicDialog}},[i("AddTopic",{ref:"AddTopic",attrs:{"is-edit":e.isEdit,"edit-model-id":e.editNo},on:{cancel:function(t){e.dialogVisibleIsAddTopic=!1}}})],1)],1)},o=[],r=(i("99af"),i("4de4"),i("c740"),i("4160"),i("caad"),i("d81d"),i("a434"),i("a9e3"),i("d3b7"),i("6062"),i("3ca3"),i("159b"),i("ddb0"),i("2909")),s=i("5530"),a=(i("a630"),i("c975"),i("fb6a"),i("2f62")),l=i("60a6"),c=i("8a6d"),d={computed:Object(s["a"])({},Object(a["b"])("answerSheet",["bigTopicPageArr","answerCardType","initPageFlag","squareSize","paperListData","chageSomePageIndex","changeUeReadyHeightArr"])),watch:{initPageFlag:function(){var e=this;this.$nextTick((function(){e.loading=e.$loading.service({lock:!0,text:"正在排版中,请勿操作页面!",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"}),e.scrollPageIndex=null,e.baseRect.w=document.querySelectorAll(".paper-item-js")[0].offsetWidth-60,e.baseRect.h=document.querySelectorAll(".paper-item-js")[0].offsetHeight-100,e.paperInfoH=document.querySelector(".paper-info-index").offsetHeight,e.initPage(0)}))},chageSomePageIndex:{deep:!0,handler:function(e){null!==e.flag&&(this.loading=this.$loading.service({lock:!0,text:"正在排版中,请勿操作页面!",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"}),e.isToCurPage&&(this.scrollPageIndex=e.index),this.baseRect.w=document.querySelectorAll(".paper-item-js")[0].offsetWidth-60,this.baseRect.h=document.querySelectorAll(".paper-item-js")[0].offsetHeight-100,this.paperInfoH=document.querySelector(".paper-info-index").offsetHeight,this.initPage(e.index))}},changeUeReadyHeightArr:function(){this.setChangeUeReadyHeight.length>0&&this.UeReadyHeightChangeReloadPage()}},data:function(){return{baseRect:{w:0,h:0},paperInfoH:0,arrH:[],loading:null,scrollPageIndex:null,isRunInitPage:!1,isRunSetInterval:!1}},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setBigTopicPageArr:l["j"],setChangeUeReadyHeight:l["e"]})),{},{initPage:function(e){var t,i=this;if(this.bigTopicPageArr.length>9)return this.loading.close(),!1;var n=[],o=[];this.isRunInitPage=!0,setTimeout((function(){t=document.querySelector(".pageindex-".concat(e)),n=Array.from(t.querySelectorAll(".paper-topic-content")),o=Array.from(t.querySelectorAll("img")),i.changePage(t,n,o,e),i.isRunInitPage=!1}),900)},changePage:function(e,t,i,n){this.arrH=t.map((function(e){return e.offsetHeight}));for(var o=0==n?this.paperInfoH:0,r=0;r<this.arrH.length;r++)if(o+=this.arrH[r],o>this.baseRect.h){var s=Array.from(t[r].children),a=0,l=JSON.parse(JSON.stringify(this.bigTopicPageArr[n][r]));[1,2,11].includes(l.questionTypeId)&&!l.isQuestionText?this.sortChoice(l,s,a,o,r,n):[1,2,11].includes(l.questionTypeId)&&l.isQuestionText?this.sortTopicContent(l,s,a,o,r,n):[5].includes(l.questionTypeId)&&!l.isQuestionText?this.sortFill(l,s,a,o,r,n):[5].includes(l.questionTypeId)&&l.isQuestionText?this.sortTopicFill(l,s,a,o,r,n):[7,17,27].includes(l.questionTypeId)?17===l.questionTypeId&&l.QuestionTextList?this.sortTopicChoose(l,s,a,o,r,n):this.sortExplain(l,s,a,o,r,n):[77].includes(l.questionTypeId)&&8==l.topicConfigureData.subject?this.sortExplain(l,s,a,o,r,n):[77].includes(l.questionTypeId)&&9==l.topicConfigureData.subject?this.sortArticleCn(l,s,a,o,r,n):(this.bigTopicPageArr.push(JSON.parse(JSON.stringify(this.bigTopicPageArr))[n].slice(r)),this.bigTopicPageArr[n]=[]);break}n==this.bigTopicPageArr.length-1&&(this.loading.close(),null!==this.scrollPageIndex&&(document.querySelector(".card_edit-wrap").scrollTop=this.getDisTop(document.querySelector(".pageindex-".concat(this.scrollPageIndex))),this.scrollPageIndex=null))},getDisTop:function(e){var t=e.offsetTop,i=e.offsetParent;while(null!==i)t+=i.offsetTop,i=i.offsetParent;return t},sortChoice:function(e,t,i,n,o,r){var s,a,l,c,d,u,m;if(e.isLast?(s=Array.from(t[0].querySelectorAll("ul")),a=0==e.topicConfigureData.direction?parseInt((s[0].offsetHeight-20)/s[0].children[0].offsetHeight):parseInt((s[0].offsetWidth-20)/s[0].children[0].offsetWidth),l=(t[0].offsetHeight-4)/s[0].offsetHeight,c=Math.ceil(s.length/l)):(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h?(m=!0,this.setNextPage(r,o,d,u,m)):(s=Array.from(t[1].querySelectorAll("ul")),a=e.topicConfigureData.direction?parseInt((s[0].offsetWidth-20)/s[0].children[0].offsetWidth):parseInt((s[0].offsetHeight-20)/s[0].children[0].offsetHeight),l=(t[1].offsetHeight-4)/s[0].offsetHeight,c=Math.ceil(s.length/l))),!m)for(var p=0;p<l;p++)if(i+=s[0].offsetHeight,n-this.arrH[o]+i+4>this.baseRect.h){0==p?(d=e.questions,u=[]):(d=JSON.parse(JSON.stringify(e.questions)).splice(p*c*a),u=JSON.parse(JSON.stringify(e.questions)).splice(0,p*c*a)),n=0,this.setNextPage(r,o,d,u,m);break}},sortTopicContent:function(e,t,i,n,o,r){var s,a,l,c,d,u,m;if(e.isLast?s=t:(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h?c=!0:s=Array.from(t[1].parentNode.querySelectorAll(".topic-box-border"))),!c)for(var p=0;p<s.length;p++)if(i+=s[p].offsetHeight,n-this.arrH[o]+i>this.baseRect.h){u=p;var h=s[p].querySelector(".title")&&s[p].querySelector(".title").offsetHeight||0,f=i-s[p].offsetHeight;if(f+=h,n-this.arrH[o]+f>this.baseRect.h){d=!0;break}d=!1;var g=Array.from(s[p].querySelectorAll("li"));if(0==e.questions[p].listType){for(var b=0;b<g.length;b++)if(f+=g[b].offsetHeight,n-this.arrH[o]+f>this.baseRect.h){m=b;break}break}if(1==e.questions[p].listType){m=0;break}for(var v=0;v<g.length;v++)if(!1&v&&(f+=g[v].offsetHeight,n-this.arrH[o]+f>this.baseRect.h)){m=v;break}break}this.setNextPage(r,o,a,l,c,d,u,m)},sortFill:function(e,t,i,n,o,r){var s,a,l,c,d;if(e.isLast?s=Array.from(t[0].querySelectorAll(".fill-item")):(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h?(d=!0,this.setNextPage(r,o,l,c,d)):s=Array.from(t[1].querySelectorAll(".fill-item"))),!d){e.topicConfigureData.columns=e.topicConfigureData.columns||1,e.topicConfigureData.rowLineHeight=e.topicConfigureData.rowLineHeight||40,a=Math.ceil(s.length/e.topicConfigureData.columns);for(var u=0;u<a;u++)if(i+=e.topicConfigureData.rowLineHeight,n-this.arrH[o]+i+20+4>this.baseRect.h){0==u?(l=e.questions,c=[]):(l=JSON.parse(JSON.stringify(e.questions)).splice(u*e.topicConfigureData.columns),c=JSON.parse(JSON.stringify(e.questions)).splice(0,u*e.topicConfigureData.columns)),n=0,this.setNextPage(r,o,l,c,d);break}}},sortTopicFill:function(e,t,i,n,o,r){var s,a,l,c;if(e.isLast?s=t:(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h?c=!0:s=Array.from(t[1].parentNode.querySelectorAll(".topic-box-border"))),!c)for(var d=0;d<s.length;d++)if(i+=s[d].offsetHeight,n-this.arrH[o]+i>this.baseRect.h){a=JSON.parse(JSON.stringify(e.questions)).splice(d),l=JSON.parse(JSON.stringify(e.questions)).splice(0,d);break}this.setNextPage(r,o,a,l,c)},setNextPage:function(e,t,i,n,o,s,a,l){var c,d,u=this;[7,17].includes(this.bigTopicPageArr[e][t].questionTypeId)||o||(s?(c=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(t),c[0].questions=c[0].questions.splice(a),d=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(0,t+1)),d[t].questions=0==a?[]:d[t].questions.splice(0,a),this.$set(this.bigTopicPageArr,e,d),this.bigTopicPageArr.push(c),this.bigTopicPageArr[e+1][0].isLast=!0):this.bigTopicPageArr[e][t].isQuestionText?(c=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(t),d=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(0,t+1)),5===c[0].questionTypeId?(d[t].questions=JSON.parse(JSON.stringify(n)),c[0].questions=JSON.parse(JSON.stringify(i))):(d[t].questions=JSON.parse(JSON.stringify(d[t].questions.splice(0,a+1))),d[t].questions[a].queOptions=0==l?[]:d[t].questions[a].queOptions.splice(0,l),c[0].questions=JSON.parse(JSON.stringify(c[0].questions.splice(a))),c[0].questions[0].queOptions=c[0].questions[0].queOptions.splice(l),c[0].questions[0].isOnlyShowOption=!0),c[0].isLast=!0,this.$set(this.bigTopicPageArr,e,d),this.bigTopicPageArr.push(c)):(this.bigTopicPageArr.push(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(t)),this.bigTopicPageArr[e+1][0].isLast=!0,this.bigTopicPageArr[e+1][0].questions=JSON.parse(JSON.stringify(i)),0===n.length?(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(0,t+1)),this.bigTopicPageArr[e][t].questions=[]):(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].splice(0,t+1)),this.bigTopicPageArr[e][t].questions=JSON.parse(JSON.stringify(n)))));if(o){var m=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t),p=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t));this.$set(this.bigTopicPageArr,e,p),this.bigTopicPageArr.push(m)}this.setBigTopicPageArr(JSON.parse(JSON.stringify(this.bigTopicPageArr))),this.bigTopicPageArr.length>e+1&&this.$nextTick((function(){u.initPage(e+1)}))},sortTopicChoose:function(e,t,i,n,o,r){for(var s,a,l,c,d,u=this.baseRect.h-(n-this.arrH[o]),m=0,p=0;p<t.length;p++){var h=t[p];if(m+=h.offsetHeight,m>u)if(e.isLast)s=t;else{if(0!==p){if(1===p){d=!0,s=Array.from(t[1].parentNode.querySelectorAll(".title"));for(var f=0;f<s.length;f++)if(i+=s[f].offsetHeight,n-this.arrH[o]+t[0].offsetHeight+i>this.baseRect.h){a=JSON.parse(JSON.stringify(e.QuestionTextList)).splice(f),l=JSON.parse(JSON.stringify(e.QuestionTextList)).splice(0,f);break}break}d=!1;var g=m-u,b=h.querySelector("iframe"),v=b.contentDocument.body,y=v.innerHTML.indexOf("<script")>-1,C=JSON.parse(JSON.stringify(e.questions[p-2]));""==v.innerHTML&&""!=C.contentHtml&&(y=!0),a=e.questions.splice(p-1),l=e.questions.splice(0,p-1);var x=1===l[l.length-1].cutId?h.offsetHeight-g-45:h.offsetHeight-g,w={curHtml:"",overHtml:""};x<30?(a.unshift(JSON.parse(JSON.stringify(l[l.length-1]))),l.splice(l.length-1,1)):(y?w.curHtml=C.contentHtml:w=this.explainTopicContentCut(x,v),l[l.length-1].contentHtml=w.curHtml,l[l.length-1].TopicAreaHeight=x,g<20&&(g=20),C.contentHtml=w.overHtml,C.cutId=C.cutId+1,C.TopicAreaHeight=g,a.unshift(C));break}c=!0}}this.setTopicChoosePaging(r,o,a,l,c,d)},sortExplain:function(e,t,i,n,o,r){var s=[],a=[],l=this.baseRect.h-(n-this.arrH[o]);if(l<100)return this.setExplainPaging(r,o,e.questions,s),!1;for(var c=0;c<t.length;c++){var d=t[c];if(i+=d.offsetHeight,i>l){if(e.isLast){var u=i-l,m=d.querySelector("iframe"),p=m.contentDocument.body,h=p.innerHTML.indexOf("<script")>-1,f=JSON.parse(JSON.stringify(e.questions[c]));""==p.innerHTML&&""!=f.contentHtml&&(h=!0),a=e.questions.splice(c+1),s=e.questions.splice(0,c+1);var g=1===s[s.length-1].cutId?d.offsetHeight-u-45:d.offsetHeight-u,b={curHtml:"",overHtml:""};g<30?(a.unshift(JSON.parse(JSON.stringify(s[s.length-1]))),s.splice(s.length-1,1)):(h?b.curHtml=f.contentHtml:b=this.explainTopicContentCut(g,p),s[s.length-1].contentHtml=b.curHtml,s[s.length-1].TopicAreaHeight=g,u<20&&(u=20),f.contentHtml=b.overHtml,f.cutId=f.cutId+1,f.TopicAreaHeight=u,a.unshift(f))}else{if(0===c){s=[],a=e.questions;break}var v=i-l+10+16,y=d.querySelector("iframe"),C=y.contentDocument.body,x=C.innerHTML.indexOf("<script")>-1,w=JSON.parse(JSON.stringify(e.questions[c-1]));""==C.innerHTML&&""!=w.contentHtml&&(x=!0),a=e.questions.splice(c),s=e.questions.splice(0,c);var T=1===s[s.length-1].cutId?d.offsetHeight-v-45-10:d.offsetHeight-v-10,N={curHtml:"",overHtml:""};T<30?(a.unshift(JSON.parse(JSON.stringify(s[s.length-1]))),s.splice(s.length-1,1)):(x?N.curHtml=w.contentHtml:N=this.explainTopicContentCut(T,C),s[s.length-1].contentHtml=N.curHtml,s[s.length-1].TopicAreaHeight=T,v<20&&(v=20),w.contentHtml=N.overHtml,w.cutId=w.cutId+1,w.TopicAreaHeight=v,a.unshift(w))}break}}this.setExplainPaging(r,o,a,s)},explainQuestionsCut:function(e,t,i,n,o){var r=e.querySelector("iframe"),s=r.contentDocument.body,a=t-i,l=JSON.parse(JSON.stringify(n.questions[o-1])),c=n.questions.splice(o),d=n.questions.splice(0,o),u=1===d[d.length-1].cutId?e.offsetHeight-a-45:e.offsetHeight-a,m=this.explainTopicContentCut(u,s);return d[d.length-1].contentHtml=m.curHtml,d[d.length-1].TopicAreaHeight=u,a<20&&(a=20),l.contentHtml=m.overHtml,l.cutId=l.cutId+1,l.TopicAreaHeight=a,c.unshift(l),{overArr:c,curArr:d}},explainTopicContentCut:function(e,t){var i=0,n="",o="";return Object(r["a"])(t.children).forEach((function(t){i+=t.offsetHeight,i>e-16?o+=t.outerHTML:n+=t.outerHTML})),{curHtml:n,overHtml:o}},sortArticle:function(e,t,i,n,o,r){var s,a,l,c,d,u,m=this;if(s=document.querySelector(".article-chinese").offsetWidth,a=parseInt(s/this.squareSize.w),l=Math.ceil((e.topicConfigureData.compositionNumber-(e.topicConfigureData.startPositionNumber||1))/a),e.isLast||(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h&&(c=!0,this.setNextPage(r,o,d,u,c))),!c)for(var p=0;p<l;p++)if(i+=this.squareSize.h+10,n-this.arrH[o]+i>this.baseRect.h){this.bigTopicPageArr.push(JSON.parse(JSON.stringify(this.bigTopicPageArr))[r].slice(o)),this.bigTopicPageArr[r+1][0].isLast=!0;var h=void 0;h=this.bigTopicPageArr[r-1]&&this.bigTopicPageArr[r-1][this.bigTopicPageArr[r-1].length-1]&&77==this.bigTopicPageArr[r-1][this.bigTopicPageArr[r-1].length-1].questionTypeId?this.bigTopicPageArr[r-1][this.bigTopicPageArr[r-1].length-1].topicConfigureData.compositionNumber:0,this.bigTopicPageArr[r][o].topicConfigureData.compositionNumber=(p-1)*a+h,this.bigTopicPageArr[r+1][0].topicConfigureData.startPositionNumber=1+(p-1)*a+h,this.bigTopicPageArr[r+1][0].questions[0].cutId=this.bigTopicPageArr[r+1][0].questions[0].cutId+1,this.setBigTopicPageArr(JSON.parse(JSON.stringify(this.bigTopicPageArr))),this.bigTopicPageArr.length>r+1&&this.$nextTick((function(){m.initPage(r+1)}));break}},setExplainPaging:function(e,t,i,n){var o=this;if(0===i.length&&0===n.length)return!1;var s=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t)[0];if(s.isLast=0!==n.length,s.questions=JSON.parse(JSON.stringify(i)),this.bigTopicPageArr[e+1]){var a=this.bigTopicPageArr[e+1][0]?this.bigTopicPageArr[e+1][0].modelId:0;if(s.modelId===a){var l=s.questions[s.questions.length-1],c=this.bigTopicPageArr[e+1][0].questions[0];if(l.alias===c.alias){c.TopicAreaHeight=c.TopicAreaHeight+l.TopicAreaHeight,c.contentHtml=c.contentHtml+l.contentHtml;for(var d=0;d<i.length-1;d++)this.bigTopicPageArr[e+1][0].questions.unshift(i[d])}else for(var u=0;u<i.length;u++)this.bigTopicPageArr[e+1][0].questions.unshift(i[u])}else this.bigTopicPageArr[e+1].unshift(s)}else{var m=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t);m[0]=s,this.bigTopicPageArr.push(m)}0===n.length?this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t)):(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t+1)),this.bigTopicPageArr[e][t].questions=JSON.parse(JSON.stringify(n))),this.setBigTopicPageArr(JSON.parse(JSON.stringify(this.bigTopicPageArr))),this.bigTopicPageArr.length>e+1&&this.$nextTick((function(){o.initPage(e+1)}))},setTopicChoosePaging:function(e,t,i,n,o,s){var a=this;if(!i&&!n||0===i.length&&0===n.length)return!1;var l=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t)[0];if(o)if(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t)),this.bigTopicPageArr[e+1]){var c=this.bigTopicPageArr[e+1][0]?this.bigTopicPageArr[e+1][0].modelId:0;if(l.modelId===c){var d=l.questions[l.questions.length-1],u=this.bigTopicPageArr[e+1][0].questions[0];if(d.alias===u.alias){u.TopicAreaHeight=u.TopicAreaHeight+d.TopicAreaHeight,u.contentHtml=u.contentHtml+d.contentHtml;for(var m=0;m<i.length-1;m++)this.bigTopicPageArr[e+1][0].questions.unshift(i[m])}else for(var p=0;p<i.length;p++)this.bigTopicPageArr[e+1][0].questions.unshift(i[p])}else this.bigTopicPageArr[e+1].unshift(l)}else{var h=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t);h[0]=l,this.bigTopicPageArr.push(h)}else if(s){if(l.isLast=0!==n.length,l.QuestionTextList=JSON.parse(JSON.stringify(i)),this.bigTopicPageArr[e+1])if(l.modelId===this.bigTopicPageArr[e+1][0].modelId){var f=l.questions[l.questions.length-1],g=this.bigTopicPageArr[e+1][0].questions[0];f.alias===g.alias&&(g.TopicAreaHeight=g.TopicAreaHeight+f.TopicAreaHeight,g.contentHtml=g.contentHtml+f.contentHtml)}else this.bigTopicPageArr[e+1].unshift(l);else{var b=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t);b[0]=l,this.bigTopicPageArr.push(b)}0===n.length?this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t)):(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t+1)),this.bigTopicPageArr[e][t].questions=[],this.bigTopicPageArr[e][t].QuestionTextList=JSON.parse(JSON.stringify(n)))}else{if(l.isLast=!0,l.questions=JSON.parse(JSON.stringify(i)),l.QuestionTextList=null,this.bigTopicPageArr[e+1])if(l.modelId===this.bigTopicPageArr[e+1][0].modelId){var v=l.questions[l.questions.length-1],y=this.bigTopicPageArr[e+1][0].questions[0];v.alias===y.alias&&(y.TopicAreaHeight=y.TopicAreaHeight+v.TopicAreaHeight,y.contentHtml=y.TopicAreaHeight+v.contentHtml)}else this.bigTopicPageArr[e+1].unshift(l);else{var C=JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(t);C[0]=l,this.bigTopicPageArr.push(C)}0===n.length?this.bigTopicPageArr[e][t].questions=[]:(this.bigTopicPageArr[e]=Object(r["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr))[e].slice(0,t+1)),this.bigTopicPageArr[e][t].questions=JSON.parse(JSON.stringify(n)))}this.setBigTopicPageArr(JSON.parse(JSON.stringify(this.bigTopicPageArr))),this.bigTopicPageArr.length>e+1&&this.$nextTick((function(){a.initPage(e+1)}))},sortArticleCn:function(e,t,i,n,o,r){var s,a=[],l=[],c=this.baseRect.h-(n-this.arrH[o]),d=Array.from(document.querySelectorAll(".article-chinese"));0==d.length&&Array.from(document.querySelectorAll(".paper-topic-content")),s=this.cardSetting.hasBindingLine?r==this.bigTopicPageArr.length-1?d[d.length-1].offsetWidth:(this.pageIndex,d[0].offsetWidth):document.querySelector(".article-chinese").offsetWidth;for(var u=0;u<t.length;u++){var m=t[u];if(i+=m.offsetHeight,i>c){if(e.isLast){var p=i-c,h=JSON.parse(JSON.stringify(e.questions[u]));if(l=e.questions.splice(u+1),a=e.questions.splice(0,u+1),h.TopicAreaHeight>0){var f=m.querySelector("iframe"),g=f.contentDocument.body,b=1===a[a.length-1].cutId?m.offsetHeight-p-45:m.offsetHeight-p,v={curHtml:"",overHtml:""};if(g.scrollHeight>p)b<30?(l.unshift(JSON.parse(JSON.stringify(a[a.length-1]))),a.splice(a.length-1,1)):(v=this.explainTopicContentCut(b,g),a[a.length-1].contentHtml=v.curHtml,a[a.length-1].TopicAreaHeight=b,p<20&&(p=20),h.contentHtml=v.overHtml,h.cutId=h.cutId+1,h.TopicAreaHeight=p,l.unshift(h));else{var y=void 0,C=void 0,x=void 0;if(y=parseInt(s/this.squareSize.w),C=Math.ceil((e.topicConfigureData.compositionNumber-(e.topicConfigureData.startPositionNumber||1)+1)/y),e.isLast||(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h&&(x=!0,this.setNextPage(r,o,l,a,x))),!x)for(var w=0,T=0;T<C;T++)if(w+=this.squareSize.h+10,w>b-g.scrollHeight){var N=1===a[a.length-1].startPositionNumber?1:a[a.length-1].startPositionNumber-1;a[a.length-1].endPositionNumber=(T-1)*y+N-1,h.startPositionNumber=(T-1)*y+N,h.cutId=h.cutId+1,h.TopicAreaHeight=0,l.unshift(h);break}}}else{var S=void 0,E=void 0,U=void 0;if(S=parseInt(s/this.squareSize.w),E=Math.ceil((e.topicConfigureData.compositionNumber-(e.topicConfigureData.startPositionNumber||1)+1)/S),e.isLast||(i+=t[0].offsetHeight,n-this.arrH[o]+i>this.baseRect.h&&(U=!0,this.setNextPage(r,o,l,a,U))),!U)for(var _=0,k=0;k<E;k++)if(_+=this.squareSize.h+10,_>m.offsetHeight-p-12){var A=1===a[a.length-1].startPositionNumber?1:a[a.length-1].startPositionNumber-1;a[a.length-1].endPositionNumber=(k-1)*S+A-1,h.startPositionNumber=(k-1)*S+A,h.cutId=h.cutId+1,h.TopicAreaHeight=0,l.unshift(h);break}}}else{if(0===u){a=[],l=e.questions;break}var I=i-c,B=m.querySelector("iframe"),O=B.contentDocument.body,D=JSON.parse(JSON.stringify(e.questions[u-1]));l=e.questions.splice(u),a=e.questions.splice(0,u);var L=1===a[a.length-1].cutId?m.offsetHeight-I-45:m.offsetHeight-I;if(D.TopicAreaHeight>c){var P={curHtml:"",overHtml:""};L<30?(l.unshift(JSON.parse(JSON.stringify(a[a.length-1]))),a.splice(a.length-1,1)):(P=this.explainTopicContentCut(L,O),a[a.length-1].contentHtml=P.curHtml,a[a.length-1].TopicAreaHeight=L,a[a.length-1].isShowArticleCn=!1,a[a.length-1].endPositionNumber=0,a[a.length-1].startPositionNumber=0,I<20&&(I=20),D.contentHtml=P.overHtml,D.cutId=D.cutId+1,D.TopicAreaHeight=Number(D.TopicAreaHeight)-Number(L),D.isShowArticleCn=!0,l.unshift(D))}else if(L<30)l.unshift(JSON.parse(JSON.stringify(a[a.length-1]))),a.splice(a.length-1,1);else{var R=void 0,H=void 0;R=parseInt(s/this.squareSize.w),H=Math.ceil((e.topicConfigureData.compositionNumber-(e.topicConfigureData.startPositionNumber||1)+1)/R);for(var q=0,M=0;M<H;M++)if(q+=this.squareSize.h+10,q>c-D.TopicAreaHeight-45-12){var j=1===a[a.length-1].startPositionNumber?1:a[a.length-1].startPositionNumber-1;a[a.length-1].endPositionNumber=(M-1)*R+j-1,a[a.length-1].endPositionNumber<1&&(a[a.length-1].endPositionNumber=0,a[a.length-1].isShowArticleCn=!1),D.startPositionNumber=(M-1)*R+j,D.cutId=D.cutId+1,D.TopicAreaHeight=0,D.contentHtml="",D.isShowArticleCn=!0,l.unshift(D);break}}}break}}this.setExplainPaging(r,o,l,a)},UeReadyHeightChangeReloadPage:function(){var e=this;if(!this.isRunSetInterval){var t=null;this.isRunInitPage?t=setInterval((function(){this.setIntervalReloadPage()}),1e3):setTimeout((function(){e.isRunInitPage||(e.ReloadPage(),clearInterval(t))}),200)}},ReloadPage:function(){var e=this,t=Math.min.apply(Math,e.changeUeReadyHeightArr),i=JSON.parse(JSON.stringify(e.bigTopicPageArr)).splice(0,t),n=Object(c["a"])(JSON.parse(JSON.stringify(e.bigTopicPageArr)).splice(t),!1,!0);if(i.push(n),t==i.length-1&&1==i[t].length&&(!i[t][0].questions||0==i[t][0].questions.length))return i.pop(),void e.setBigTopicPageArr(i);e.setBigTopicPageArr(i),this.$nextTick((function(){e.initPage(t),e.setChangeUeReadyHeight([])}))},setIntervalReloadPage:function(){var e=this;this.isRunInitPage||setTimeout((function(){e.isRunInitPage||e.ReloadPage()}),200)}})},u=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"card_setting"},[i("div",{directives:[{name:"show",rawName:"v-show",value:!e.isSetAnswer,expression:"!isSetAnswer"}],staticClass:"card_setting-topic"},[i("h3",{staticClass:"card_setting-title"},[e._v("选择答题卡布局")]),i("div",{staticClass:"card_setting-box"},[i("div",{staticClass:"card_setting-item"},[i("div",{staticClass:"name"},[e._v("纸张")]),i("div",{staticClass:"content"},[i("el-radio-group",{on:{change:e.changePageSize},model:{value:e.cardSetting.paperSize,callback:function(t){e.$set(e.cardSetting,"paperSize",t)},expression:"cardSetting.paperSize"}},[i("el-radio",{attrs:{label:1}},[e._v("A3")]),i("el-radio",{attrs:{label:2}},[e._v("A4")]),i("el-radio",{attrs:{label:3}},[e._v("16K(185*260)")]),i("el-radio",{attrs:{label:4}},[e._v("8K(260*370)")]),i("el-radio",{attrs:{label:5}},[e._v("8K(270*390)")])],1)],1)]),i("div",{staticClass:"card_setting-item"},[i("div",{staticClass:"name"},[e._v("方向")]),i("div",{staticClass:"content"},[i("el-radio-group",{on:{change:e.changePageDirection},model:{value:e.cardSetting.direction,callback:function(t){e.$set(e.cardSetting,"direction",t)},expression:"cardSetting.direction"}},[i("el-radio",{attrs:{label:1,disabled:e.isDisabledDirection(1)}},[e._v("横版")]),i("el-radio",{attrs:{label:2,disabled:e.isDisabledDirection(2)}},[e._v("竖版")])],1)],1)]),i("div",{staticClass:"card_setting-item border_b"},[i("div",{staticClass:"name"},[e._v("分栏")]),i("div",{staticClass:"content"},[i("div",{staticClass:"layoutList"},[i("div",{staticClass:"layoutItem",class:e.cardColumnClass(1),on:{click:function(t){"disabled"!=e.cardColumnClass(1)&&e.setCardColumn(1)}}},[e._m(0),i("em",[e._v("一栏")]),i("b",{staticClass:"icon_current"})]),i("div",{staticClass:"layoutItem",class:e.cardColumnClass(2),on:{click:function(t){"disabled"!=e.cardColumnClass(2)&&e.setCardColumn(2)}}},[e._m(1),i("em",[e._v("两栏")]),i("b",{staticClass:"icon_current"})]),i("div",{staticClass:"layoutItem",class:e.cardColumnClass(3),on:{click:function(t){"disabled"!=e.cardColumnClass(3)&&e.setCardColumn(3)}}},[e._m(2),i("em",[e._v("三栏")]),i("b",{staticClass:"icon_current"})])])])]),i("div",{staticClass:"card_setting-item border_b"},[i("div",{staticClass:"name"},[e._v("装订线")]),i("div",{staticClass:"content"},[i("el-radio-group",{on:{change:e.saveCardSetting},model:{value:e.cardSetting.hasBindingLine,callback:function(t){e.$set(e.cardSetting,"hasBindingLine",t)},expression:"cardSetting.hasBindingLine"}},[i("el-radio",{attrs:{label:1,disabled:e.cardSetting.cardLength>12&&[3,4,5].includes(e.cardSetting.paperSize)||4==e.cardSetting.paperSize&&3==e.cardSetting.column}},[e._v("有")]),i("el-radio",{attrs:{label:0}},[e._v("无")])],1)],1)]),i("div",{staticClass:"card_setting-item border_b"},[i("div",{staticClass:"name"},[e._v("信息栏")]),i("div",{staticClass:"content"},[i("el-radio-group",{on:{change:e.setPaperInfoMsg},model:{value:e.cardSetting.hasPaperMsg,callback:function(t){e.$set(e.cardSetting,"hasPaperMsg",t)},expression:"cardSetting.hasPaperMsg"}},[i("el-radio",{attrs:{label:!0}},[e._v("有")]),i("el-radio",{attrs:{label:!1}},[e._v("无")])],1),i("div",{staticClass:"centerBox"},[i("span",{staticClass:"iconfont icontishi1",on:{mouseenter:function(t){return e.enterLinesTips()},mouseleave:function(t){return e.leaveLinesTips()}}},[e.tipsBox1?i("b",[e._v("选择“有”,还可以在左侧答题卡编辑页进行内容修改配置!")]):e._e()])])],1)]),i("div",{staticClass:"card_setting-item border_b"},[i("div",{staticClass:"name"},[e._v("考号")]),i("div",{staticClass:"content"},[i("el-checkbox-group",{attrs:{disabled:e.cardSetting.useQrCode},on:{change:e.changePageExaminationNumberType},model:{value:e.cardSetting.examinationNumberType,callback:function(t){e.$set(e.cardSetting,"examinationNumberType",t)},expression:"cardSetting.examinationNumberType"}},[i("el-checkbox",{attrs:{label:1,disabled:e.setDisabled(1)}},[e._v("填涂考号")]),i("el-checkbox",{attrs:{label:2,disabled:e.setDisabled(2)}},[e._v("条形码")])],1),1===e.paperSource?i("el-switch",{staticStyle:{display:"block","margin-top":"10px"},attrs:{"active-color":"#409EFF","inactive-color":"#bbb","active-text":"使用二维码"},on:{change:e.changePageUseQrCode},model:{value:e.cardSetting.useQrCode,callback:function(t){e.$set(e.cardSetting,"useQrCode",t)},expression:"cardSetting.useQrCode"}}):e._e(),1===e.paperSource?i("div",{staticClass:"centerBox ewmCenterBox"},[i("span",{staticClass:"iconfont icontishi1 ewmFont",on:{mouseenter:function(t){return e.enterEwmTips()},mouseleave:function(t){return e.leaveEwmTips()}}},[e.tipsBox2?i("b",[e._v("使用二维码,将给每个考生都生成一份定制答题卡,请慎重!")]):e._e()])]):e._e()],1)])]),i("div",{staticClass:"overBox"},[i("div",{staticClass:"subject-list"},e._l(e.bigTopicArr,(function(t,n){return i("div",{key:n,staticClass:"card_setting-item"},[e.isShowBigTopicNo(t)?[i("div",{staticClass:"name"},[e._v(e._s(e.getTopicTypeText(t.questionTypeId)))]),i("div",{staticClass:"content"},e._l(t.topicConfigureData.topicTypeArr,(function(t,n){return i("div",{key:n,staticClass:"s-num"},[e._v(e._s(t.startNo)+"~"+e._s(t.endNo))])})),0)]:e._e()],2)})),0),0===e.paperSource?i("div",{staticClass:"edit-topic-btn-box"},[i("button",{staticClass:"btn btn-add-topic",on:{click:e.showAddBigTopic}},[e._v("+ 添加试题")]),i("span",{staticClass:"btn-set-answer",on:{click:e.showSelectSetAnswer}},[e._v("设置客观题答案")])]):e._e()]),i("div",{staticClass:"btn-card-box"},[i("button",{staticClass:"btn btn-card-preview",on:{click:e.goPreview}},[e._v("预览")]),i("button",{staticClass:"btn btn-card-save",class:{disabled:e.isAllowEdit},attrs:{disabled:e.isAllowEdit},on:{click:e.savePage}},[e._v(e._s(e.cardSetting.allowEdit?"保存":"编辑"))]),i("button",{staticClass:"btn btn-card-down",class:{disabled:e.isDisabledBtnDown},attrs:{disabled:e.isDisabledBtnDown},on:{click:e.downPdfAll}},[e._v(e._s(e.cardSetting.useQrCode?"生成":"下载"))])])]),i("div",{directives:[{name:"show",rawName:"v-show",value:e.isSetAnswer,expression:"isSetAnswer"}],staticClass:"card_setting-answer"},[i("SetAnswer",{on:{cancel:function(t){e.isSetAnswer=!1}}})],1),i("div",{directives:[{name:"show",rawName:"v-show",value:e.isShowToPdfHtml,expression:"isShowToPdfHtml"}],staticClass:"to-pdf-html-box"},[i("toPdfHtml",{ref:"toPdfHtml"})],1),i("el-dialog",{attrs:{title:"提示",visible:e.centerDialogVisible,width:"30%",center:""},on:{"update:visible":function(t){e.centerDialogVisible=t}}},[i("p",{staticStyle:{"text-align":"center","font-size":"16px",color:"#000000"}},[e._v(e._s(e.tipsContent))]),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:function(t){""==e.cardSetting.title?e.centerDialogVisible=!1:e.showSelectSetAnswer()}}},[e._v("去设置")]),i("el-button",{on:{click:function(t){e.centerDialogVisible=!1}}},[e._v("关闭")])],1)])],1)},m=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",[i("i")])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",[i("i"),i("i")])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",[i("i"),i("i"),i("i")])}],p=(i("b0c0"),i("b64b"),i("2532"),i("53ca")),h=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"set-select-answer"},[i("h3",{staticClass:"card_setting-title"},[e._v("设置客观题答案")]),i("div",{staticClass:"set-select-list"},e._l(e.topicList,(function(t){return i("div",{key:t.alias,staticClass:"answer-item"},[i("span",{staticClass:"number"},[e._v(e._s(t.alias))]),i("span",{staticClass:"topic-type-name"},[e._v(e._s(t.questionTypeText))]),i("p",{staticClass:"option-box"},e._l(t.optionList,(function(n){return i("i",{key:n.value,staticClass:"answer-option",class:{active:n.isAnswer},on:{click:function(i){return e.setAnswer(n,t)}}},[e._v(e._s(n.value))])})),0)])})),0),i("div",{staticClass:"btn-card-box"},[i("button",{staticClass:"btn btn-card-save",on:{click:e.saveSelectAnswer}},[e._v("保存")]),i("button",{staticClass:"btn btn-card-go_back",on:{click:e.cancel}},[e._v("返回")])])])},f=[],g=(i("07ac"),{name:"SetAnswer",components:{},filters:{},props:{},data:function(){return{topicData:[{alias:"1",answer:"",questionTypeId:1,questionTypeText:"单选题",optionsCount:4},{alias:"2",answer:"",questionTypeId:2,questionTypeText:"多选题",optionsCount:7}],topicList:[]}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["bigTopicArr","topicTypes"])),watch:{bigTopicArr:{handler:function(){this.getDefaultData()},deep:!0}},mounted:function(){this.getDefaultData()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setBigTopicArr:l["b"]})),{},{getDefaultData:function(){var e=this;this.topicData=[],this.topicList=[],Object.values(this.bigTopicArr).forEach((function(t){if([1,2,11].includes(t.questionTypeId)){for(var i,n=0;n<t.questions.length;n++)1==t.questionTypeId?t.questions[n].questionTypeText="单选题":2==t.questionTypeId?t.questions[n].questionTypeText="多选题":11==t.questionTypeId&&(t.questions[n].questionTypeText="不定项");(i=e.topicData).push.apply(i,Object(r["a"])(t.questions))}})),this.topicData.forEach((function(t){var i=JSON.parse(JSON.stringify(t));i.optionList=e.getOptionList(t),e.topicList.push(i)}))},saveSelectAnswer:function(){var e=this;this.topicList.forEach((function(t,i){var n="";t.optionList.forEach((function(e){e.isAnswer&&(n+=""==n?e.value:","+e.value)})),e.topicData[i].answer=n})),this.setBigTopicArr(this.bigTopicArr),this.cancel()},cancel:function(){this.$emit("cancel",!1)},getOptionList:function(e){for(var t=[],i=0;i<e.optionCount;i++)t.push({value:String.fromCharCode(65+i),isAnswer:e.answer.includes(String.fromCharCode(65+i))});return t},setAnswer:function(e,t){1===t.questionTypeId?t.optionList.forEach((function(t){t.value===e.value?t.isAnswer=!0:t.isAnswer=!1})):e.isAnswer=!e.isAnswer}})}),b=g,v=(i("8762"),i("2877")),y=Object(v["a"])(b,h,f,!1,null,"3d0172cd",null),C=y.exports,x=i("29d1"),w=i("ab12");i("0481"),i("13d5"),i("4069"),i("ac1f"),i("1276");function T(e){var t=0,i=0;while(e.offsetParent&&!N(e,"pageindex-"))t+=e.offsetLeft,i+=e.offsetTop,e=e.offsetParent;return{x:t,y:i}}function N(e,t){return e.className.includes(t)}function S(e,t){var i=JSON.parse(JSON.stringify(T(e))),n=JSON.parse(JSON.stringify(T(t)));return{x:n.x-i.x,y:n.y-i.y+(t.className.includes("iconnum_")?0:2),width:t.offsetWidth,height:t.offsetHeight}}var E={data:function(){return{wordsArr:["A","B","C","D","E","F","G","H","I","J","K","L","M"],scoreTypeArr:["","2/3/5","2/3/4/6","2/4"],pages:[{pageNo:"",questions:[],location:[],imge:{}},{pageNo:"",questions:[],location:[],imge:{}}]}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting","bigTopicPageArr","paperSource","subject"])),methods:{topicTypeJsToC:function(e){return 1==e?{type:0}:2==e?{type:8}:11==e?{type:5}:5==e?{type:3}:7==e||27==e?{type:1,marktype:0}:17==e?{type:2}:77==e?{type:1,marktype:9==this.subject?4:10}:void 0},getAllTopicPos:function(e,t){var i="",n=null;[1,2,11].includes(t)?i=".option-li":[5].includes(t)?i=".fill-item":[7,17,27,77].includes(t)&&(i=".topic-explain"),n=this.getPageFirstElement(i,t,e),this.getTopicPos(n.firstEle,n.firstJson,1,n.firstEleLenArr,t),this.getTopicPos(n.lastEle,n.lastJson,2,n.lastEleLenArr,t)},commonChoicPos:function(e,t,i,n,o,r){var s={},a=Array.from(t[i].querySelectorAll(".iconfont"));s.direction=n.topicConfigureData.direction||0,s.modelId=n.modelId,s.answer=n.questions[i].answer,s.id=String(n.questions[i].questionNum),s.name=n.questions[i].alias,s.type=this.topicTypeJsToC(n.questions[i].questionTypeId).type,s.score={full:n.questions[i].fullScore},s.opt=[];for(var l=0;l<a.length;l++)s.opt.push(S(e,a[l])),s.opt[l].x=s.opt[l].x+2+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),s.opt[l].optName=this.wordsArr[l];return s},commonFillPos:function(e,t,i,n,o,r){var s={};return s.column=n.topicConfigureData.column||1,s.modelId=n.modelId,s.id=String(n.questions[i].questionNum),s.name=n.questions[i].alias,s.rowLinHeight=n.topicConfigureData.rowLinHeight||40,s.scoreStyle=this.scoreTypeArr[n.topicConfigureData.scoreStyle&&n.topicConfigureData.scoreStyle-1||0],s.type=this.topicTypeJsToC(n.questions[i].questionTypeId).type,s.cut=S(e,t[i]),s.cut.x=s.cut.x+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),s.scorebox=S(e,t[i].querySelector("strong")),s.scorebox.x=s.scorebox.x+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),s.scorebox.Score=s.scoreStyle.split("/"),s.scorebox.type=3,s},commonExplainPos:function(e,t,i,n,o,r){var s=Array.from(t[i].querySelectorAll(".optional-span")),a={};if(a.modelId=n.modelId,17==n.questionTypeId){1==this.paperSource?(a.select=n.questions[i].required,a.total=n.questions[i].total):(a.select=n.topicConfigureData.topicTypeArr[0].chooseSelectOption,a.total=n.topicConfigureData.topicTypeArr[0].chooseOption);for(var l="",c=0;c<a.total;c++)l+=parseInt(n.questions[i].questionNum)+c+(c!=a.total-1?",":"");a.id=l}else a.id=String(n.questions[i].questionNum);a.editorId=n.questions[i].alias,a.marktype=this.topicTypeJsToC(n.questionTypeId).marktype,a.type=this.topicTypeJsToC(n.questionTypeId).type,a.selectqts=[];for(var d=0;d<s.length;d++)a.selectqts.push(S(e,s[d])),a.selectqts[d].x=a.selectqts[d].x+2+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),a.selectqts[d].optName=this.wordsArr[d];if(a.cut=S(e,t[i]),a.cut.x=a.cut.x+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),a.cut.y=a.cut.y+10,a.cut.height=a.cut.height-10,a.cut.linkparm=n.questions[i].cutId-1,t[i].querySelector(".no-scoring")){var u=S(e,t[i].querySelector(".scoring-box")),m=S(e,t[i].querySelector(".no-scoring"));u.x=u.x+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0),a.scorebox={width:u.width-m.width,height:u.height,x:u.x,y:u.y}}else t[i].querySelector(".scoring-box")?(a.scorebox=S(e,t[i].querySelector(".scoring-box")),a.scorebox.x=a.scorebox.x+document.querySelector(".pageindex-0").offsetWidth*o-(this.cardSetting.hasBindingLine&&0!=o&&1==r?20:0)):a.scorebox={};return a.scoreLimit=n.questions[i].scoreLimit||n.topicConfigureData.scoreLimit,a.scorebox.limit=n.questions[i].fullScore,a.scorebox.point=n.questions[i].point||n.topicConfigureData.hasHalfScore?1:0,a.scorebox.type=(n.questions[i].scoreLimit||n.topicConfigureData.scoreLimit)<17?1:2,a},getTopicPos:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;if(0!=e.length)for(var s,a=0,l=0;l<n.length;l++)if(n[l]>0)for(var c=a;c<e.length;c++){s=document.querySelectorAll(".main-dot")[e[c].getAttribute("data-pageIndex")];var d={};if([1,2,11].includes(o)?d=this.commonChoicPos(s,e,c,t,l,i):[5].includes(o)?d=this.commonFillPos(s,e,c,t,l,i):[7,17,27,77].includes(o)&&(d=this.commonExplainPos(s,e,c,t,l,i)),this.pages[i-1].questions.push(d),a++,0===l){if(a==n[l])break}else{var u=Object(r["a"])(n).splice(0,l),m=u.reduce((function(e,t){return e+t}));if(a-m==n[l])break}}},getPageFirstElement:function(e,t,i){var n=this.setTopicPageContent(e,t,i,1),o=this.setTopicPageContent(e,t,i,2);return{firstEle:n.eleArr,firstJson:this.resetTopicJson(n.objArr,t,i),firstEleLenArr:n.pageEle,lastEle:o.eleArr,lastJson:this.resetTopicJson(o.objArr,t,i),lastEleLenArr:o.pageEle}},setTopicPageContent:function(e,t,i){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=[],r=[],s=[],a=[],l=Array.from(document.querySelectorAll(".paper-item-js")),d=1==n?0:this.cardSetting.column,u=d;u<this.cardSetting.column*n;u++)if(u<l.length){var m=Array.from(l[u].querySelectorAll(e));o.push(l[u]?m:[]),s.push(JSON.parse(JSON.stringify(this.bigTopicPageArr[u]))),a.push(m.filter((function(e){return e.getAttribute("data-type")==t&&e.getAttribute("data-modelId")==i})).length)}return o=o.flat().filter((function(e){return e.getAttribute("data-type")==t&&e.getAttribute("data-modelId")==i})),r=o.length>0?Object(c["a"])(s,!0):[],{eleArr:o,pageEle:a,objArr:r}},resetTopicJson:function(e,t,i){var n=e.filter((function(e){return e.questionTypeId===t&&!e.isQuestionText&&e.modelId==i})),o={};if(0!=n.length){o=JSON.parse(JSON.stringify(n[0]));for(var s=0;s<n.length;s++){var a;if(s>0)(a=o.questions).push.apply(a,Object(r["a"])(JSON.parse(JSON.stringify(n[s].questions))))}}return o},pageSide:function(){var e=document.querySelector(".unique-code"),t=document.querySelectorAll(".paper-item-js")[0],i=t.offsetWidth*this.cardSetting.column,n=t.offsetHeight,o=e.offsetWidth,r=e.offsetHeight,s=T(e),a=[];a.push(s),a.push({x:.35*i,y:20}),a.push({x:i-30-o,y:20}),a.push({x:s.x,y:n-20-r}),a.push({x:i-30-o,y:n-20-r});var l=a.map((function(e){return{x:e.x,y:e.y,width:o,height:r}}));this.pages[0].location=l,this.pages[1].location=JSON.parse(JSON.stringify(l)),this.pages[1].location[0].x=30,this.pages[1].location[1].x=i-.35*i-o,this.pages[1].location[2].x=i-(this.cardSetting.hasBindingLine?50:30)-o,this.pages[1].location[3].x=30,this.pages[1].location[4].x=i-(this.cardSetting.hasBindingLine?50:30)-o},pointWay:function(e){var t=this;this.$nextTick((function(){var i,n=Array.from(document.querySelectorAll(".paper-item"))[0],o=document.querySelector(".notice-ewm");t.cardSetting.useQrCode&&o&&(i=S(e,o));var r,s,a={height:n.offsetHeight,width:n.offsetWidth*t.cardSetting.column},l=document.querySelector(".absent-mark"),c=S(e,l);r=document.querySelector(".code-img"),!t.cardSetting.useQrCode&&r&&(s=S(e,r));var d={object:{}};d.object=s,t.pages[0].studentcode_bar=d,t.pages[0].QrCode=i,t.pages[0].absent=c,t.pages.map((function(e,t){e.imge=a,e.pageNo=t+1}))}))},identCard:function(e){if(this.pages[0].studentcode_fill={},this.cardSetting.examinationNumberType.includes(1)){for(var t=[],i=document.querySelector(".card-id"),n=document.querySelector(".unique-li").offsetWidth,o=0;o<i.children.length;o++){t[o]={},t[o].group=[];for(var r=0;r<i.querySelector("ul").children.length;r++){var s=S(e,i.querySelector("ul").children[r].children[0]);s.optName=r,s.x=s.x+o*n,t[o].group.push(JSON.parse(JSON.stringify(s)))}}this.pages[0].studentcode_fill.object=t}}}},U={name:"Setting",components:{SetAnswer:C,toPdfHtml:w["a"]},mixins:[E],data:function(){return{isSetAnswer:!1,bigTopicList:[],curDateTime:null,isShowToPdfHtml:!1,pdfHtml:"",pdf_url:"",tipsBox1:!1,tipsBox2:!1,saveLoading:!1,centerDialogVisible:!1,tipsContent:""}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["paperSource","sizeConfig","bigTopicArr","topicTypes","cardSetting","initPageFlag","bigTopicArr","bigTopicPageArr","paperListData","testFormData","sizeConfig","answerCardType","isAnswerCardTypeChange"])),{},{calcPaperSize:function(){var e=this.cardSetting.paperSize,t=this.cardSetting.direction,i=this.sizeConfig[e].width,n=this.sizeConfig[e].height,o=1===t?n:i,r=1===t?i:n;return{width:o,height:r}},isAllowEdit:function(){return 0==this.paperSource&&2==this.testFormData.type},isDisabledBtnDown:function(){var e=!0;return e=this.cardSetting.useQrCode?!!this.cardSetting.allowEdit:!!this.cardSetting.allowEdit||!this.pdf_url,e}}),watch:{testFormData:{handler:function(){this.pdf_url=this.testFormData.pdf_url},deep:!0}},mounted:function(){this.getDefaultData()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setCardSetting:l["c"],setBigTopicArr:l["b"],setBigTopicPageArr:l["j"],setInitPageFlag:l["f"],setTestFormData:l["n"],setAnswerCardType:l["a"]})),{},{getDefaultData:function(){this.bigTopicList=this.bigTopicArr,this.pdf_url=this.testFormData.pdf_url},setPosInfo:function(){this.pages=[{pageNo:"",questions:[],location:[],imge:{}},{pageNo:"",questions:[],location:[],imge:{}}];var e=document.querySelector(".unique-code");for(var t in this.bigTopicArr)[1,2,11,5,7,17,27,77].includes(this.bigTopicArr[t].questionTypeId)&&this.getAllTopicPos(t,this.bigTopicArr[t].questionTypeId);this.pageSide(e),this.pointWay(e),this.cardSetting.useQrCode||this.identCard(e);var i={};i.examGroupId=this.cardSetting.examGroupId,i.title=this.cardSetting.title,i.useQrCode=this.cardSetting.useQrCode?1:0,i.pdfHtml=this.pdfHtml,i.pdf_url="",i.position={},i.position.paper=this.sizeConfig[this.cardSetting.paperSize].name,i.position.width=1==this.cardSetting.direction?this.sizeConfig[this.cardSetting.paperSize].height:this.sizeConfig[this.cardSetting.paperSize].width,i.position.height=1==this.cardSetting.direction?this.sizeConfig[this.cardSetting.paperSize].width:this.sizeConfig[this.cardSetting.paperSize].height,i.online_card_version="2.0.0",i.position.online_card_version="2.0.0",i.position.columns=this.cardSetting.column,i.position.totalPage=2*this.cardSetting.column,i.position.useQrCode=this.cardSetting.useQrCode?1:0,i.position.school_card_status=this.cardSetting.cardStatus,i.position.cardSetting=this.cardSetting,i.position.bigTopicArr=this.bigTopicArr,i.position.bigTopicPageArr=this.bigTopicPageArr,i.position.paperListData=this.paperListData,i.position.pages=this.pages,i.position.answerCardType=this.answerCardType,i.question_info={};var n=[];for(var o in this.bigTopicArr)n.push.apply(n,Object(r["a"])(this.bigTopicArr[o].questions));return i.question_info.content=JSON.parse(JSON.stringify(n)),i.sheet_answer={},i.sheet_halfscore={},i.sheet_score={},n.forEach((function(e){e.answer&&[1,2,11].includes(e.questionTypeId)&&(i.sheet_answer[e.questionNum]=e.answer),i.sheet_halfscore[e.questionNum]&&(i.sheet_halfscore[e.questionNum]=e.halfScore),i.sheet_score[e.questionNum]=String(e.fullScore)})),i.timu={KeGuanTi:i.question_info.content.filter((function(e){return 1==e.questionTypeId||2==e.questionTypeId||11==e.questionTypeId})).length,TianKongTi:i.question_info.content.filter((function(e){return 5==e.questionTypeId})).length,XuanZuoTi:i.question_info.content.filter((function(e){return 17==e.questionTypeId})).length,ZhuGuanTi:i.question_info.content.filter((function(e){return 7==e.questionTypeId})).length},i},savePage:function(){var e=this,t=this;if(!this.cardSetting.allowEdit)return(1===this.answerCardType||this.isAnswerCardTypeChange)&&(2===this.answerCardType?(this.setAnswerCardType(1),this.$confirm("当前考试已被设为“题卡合一”模式,是否确定更改?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$message({type:"success",message:"考试已被设置为【题卡合一】,请注意答题卡以被重置!"}),e.$emit("restAnswerSheet",!0)})).catch((function(){e.$message({type:"info",message:"已取消"})}))):this.$confirm(this.isAnswerCardTypeChange?"当前考试已被设为“题卡分离”模式,是否确定更改?":"当前考试为“题卡合一”模式,是否还原为系统默认排版样式?”","提示",{confirmButtonText:this.isAnswerCardTypeChange?"确定":"确认还原",cancelButtonText:this.isAnswerCardTypeChange?"取消":"不还原",type:"warning"}).then((function(){1===e.answerCardType?(e.setAnswerCardType(2),e.$message({type:"success",message:"考试已被设置为【题卡分离】,请注意答题卡以被重置!"})):e.setAnswerCardType(1),e.$emit("restAnswerSheet",!0)})).catch((function(){e.$message({type:"info",message:"已取消"})}))),this.cardSetting.allowEdit=!this.cardSetting.allowEdit,void this.setCardSetting(this.cardSetting);if(0==this.paperSource){var i=1,n=[],o=0,r="";for(var s in this.bigTopicArr)n.push(this.bigTopicArr[s]);n.forEach((function(t){t.questions.forEach((function(n){n.questionNum=i,i++,17==t.questionTypeId&&(r!=t.modelId&&(r=t.modelId,o++),n.groupid=JSON.parse(JSON.stringify(o))),e.bigTopicPageArr.forEach((function(e){e.forEach((function(e){for(var t=0;t<e.questions.length;t++)if(e.questions[t].alias==n.alias){e.questions[t].questionNum=n.questionNum;break}}))}))}))})),this.setBigTopicArr(this.bigTopicArr),this.setBigTopicPageArr(this.bigTopicPageArr)}var a=this.bigTopicPageArr.length;if(a>2*this.cardSetting.column)return this.$message.error("超出"+2*this.cardSetting.column+"页,请重新编辑后再保存!"),!1;if(""==this.cardSetting.title)return this.centerDialogVisible=!0,this.tipsContent="考试名称不能为空!",!1;var l=!1;for(var c in this.bigTopicArr)[1,2,11].includes(this.bigTopicArr[c].questionTypeId)&&this.bigTopicArr[c].questions.forEach((function(e){""==e.answer&&(l=!0)}));if(l)return this.centerDialogVisible=!0,this.tipsContent="请设置答案!",!1;this.cardSetting.allowEdit=!1,this.setCardSetting(this.cardSetting),this.saveLoading=this.$loading.service({lock:!0,text:"保存中...",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"}),this.isShowToPdfHtml=!0,this.$refs.toPdfHtml.getDefaultData(),setTimeout((function(){e.$nextTick((function(){var i=e.setPosInfo();Array.from(document.querySelectorAll(".blank-page")).forEach((function(e){e.style.height=document.querySelectorAll(".paper-item")[0].offsetHeight-100+"px"}));var n={width:"210mm",height:"297mm",name:"pdf",examGroupId:e.cardSetting.examGroupId,pdfHtml:e.pdfHtml};n.width=e.calcPaperSize.width+"mm",n.height=e.calcPaperSize.height+"mm",n.name=e.cardSetting.title,n.pdfHtml=e.getPdfHtml();var o=new FormData;Object.keys(n).forEach((function(e){o.append(e,n[e])})),Object(x["b"])(o).then((function(n){if(0==n.success)return e.$message.error("生成pdf失败,请稍后再试!"),e.cardSetting.allowEdit=!0,e.setCardSetting(e.cardSetting),t.saveLoading.close(),!1;if(e.pdf_url=n.data,i.pdf_url=n.data,i.pdfHtml=e.pdfHtml,t.testFormData.pdf_url=n.data,t.setTestFormData(t.testFormData),0==e.paperSource){e.testFormData.editType=1,e.testFormData.pdf_url=n.data;var o={testFormData:e.testFormData,savePrintInfo:i};localStorage.setItem("upDataThreeCard",JSON.stringify(o)),t.saveLoading.close(),e.$message.success("保存成功!")}else{var r=i,s=new FormData,a=new Blob([t.pdfHtml],{type:"text/plain;charset=utf-8"});t.isShowToPdfHtml=!1,Object.keys(r).forEach((function(e){"object"===Object(p["a"])(r[e])?s.append(e,JSON.stringify(r[e])):s.append(e,r[e])})),s.append("pdfTemplate",a,"pdfTepmlate.txt"),Object(x["d"])(s).then((function(e){t.saveLoading.close(),console.log(e),t.$message.success("保存成功!")})).catch((function(i){console.log(i),t.saveLoading.close(),t.cardSetting.allowEdit=!0,t.setCardSetting(e.cardSetting),t.$message.error("保存失败,请稍后再试!")}))}})).catch((function(){e.saveLoading.close(),t.cardSetting.allowEdit=!0,t.setCardSetting(e.cardSetting),t.$message.error("保存失败,请稍后再试!")}))}))}),200)},changePageSize:function(){var e=this.isDisabledDirection(this.cardSetting.direction);e&&(this.cardSetting.direction=1===this.cardSetting.direction?2:1,this.changePageDirection()),this.isDisabledCardColumn(this.cardSetting.column)&&this.changePageDirection(),this.saveCardSetting()},isDisabledDirection:function(e){var t=1===e?"horizontal":"vertical";return!this.sizeConfig[this.cardSetting.paperSize].direction[t].length>0},changePageDirection:function(){if(this.isDisabledCardColumn(this.cardSetting.column)){var e=1===this.cardSetting.direction?"horizontal":"vertical";this.cardSetting.column=this.sizeConfig[this.cardSetting.paperSize].direction[e][0]}this.saveCardSetting()},setCardColumn:function(e){this.isDisabledCardColumn(e)||(this.cardSetting.column=e),this.saveCardSetting()},cardColumnClass:function(e){return e===this.cardSetting.column?"current":this.isDisabledCardColumn(e)?"disabled":""},isDisabledCardColumn:function(e){var t=1===this.cardSetting.direction?"horizontal":"vertical",i=this.sizeConfig[this.cardSetting.paperSize].direction[t].indexOf(e);return i<=-1},changePageExaminationNumberType:function(){this.saveCardSetting()},changePageUseQrCode:function(e){var t=this;this.cardSetting.useQrCode=!1,e?this.$confirm("使用二维码,将给每个考试都生成一份定制答题卡,是否确定使用?","提示",{confirmButtonText:"仍要使用",cancelButtonText:"取消",type:"warning"}).then((function(){t.cardSetting.useQrCode=!0,t.cardSetting.examinationNumberType=[],t.saveCardSetting()})).catch((function(){t.$message({type:"info",message:"已取消"}),t.cardSetting.useQrCode=!1})):(this.cardSetting.examinationNumberType=[1,2],this.saveCardSetting())},showAddBigTopic:function(){this.$emit("showAddBigTopic",!0)},setPaperInfoMsg:function(){this.cardSetting.examInfoConfig.forEach((function(e){return e.isShow=!0})),this.setCardSetting(this.cardSetting),this.saveCardSetting()},saveCardSetting:function(){3==this.cardSetting.column&&4==this.cardSetting.paperSize&&(this.cardSetting.hasBindingLine=0),this.setCodeRules(),this.setCardSetting(this.cardSetting),(new Date).getTime()-this.curDateTime<2e3||(this.curDateTime=(new Date).getTime(),this.setBigTopicPageArr([Object(c["a"])(this.bigTopicPageArr)]),this.setInitPageFlag(!this.initPageFlag))},showSelectSetAnswer:function(){this.centerDialogVisible=!1,this.isSetAnswer=!0},getTopicTypeText:function(e){var t="";return this.topicTypes.forEach((function(i){e==i.value&&(t=i.label)})),t},goPreview:function(){this.$router.push({path:"/AnswerSheetPreview",query:{exam_group_id:this.cardSetting.examGroupId}})},getPdfHtml:function(){var e="";return e+="<!DOCTYPE html>",e+='<html lang="en">',e+="<head>",e+='<meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge">',e+="<title>Document</title>",e=e+'<link rel="stylesheet" href="'+{apiBaseUrl:"http://zsyas2.zhixinhuixue.com",siteUrl:"http://zsyas2.zhixinhuixue.com/vue/index.html#",phpPath:"http://zsyas2.zhixinhuixue.com/vue",phpBaseUrl:"/",xiaoben:"http://xbas2.schcur.com"}.phpPath+'/answer-sheet/toPdfHtml.css">',e=e+'<link rel="stylesheet" href="'+{apiBaseUrl:"http://zsyas2.zhixinhuixue.com",siteUrl:"http://zsyas2.zhixinhuixue.com/vue/index.html#",phpPath:"http://zsyas2.zhixinhuixue.com/vue",phpBaseUrl:"/",xiaoben:"http://xbas2.schcur.com"}.phpPath+'/answer-sheet/fonts/iconfont.css">',e+="</head>",e+="<body>",e+=this.$refs.toPdfHtml.$el.outerHTML,e+="</body></html>",this.pdfHtml=e,e},downPdf:function(e){var t=this,i={width:"210mm",height:"297mm",name:"pdf",examGroupId:this.cardSetting.examGroupId,pdfHtml:this.pdfHtml},n=new FormData;Object.keys(i).forEach((function(e){n.append(e,i[e])})),this.isShowToPdfHtml=!1,Object(x["b"])(n).then((function(i){return 0==i.success?(t.$message.error("生成pdf失败,请稍后再试!"),!1):(t.pdf_url=i.data,1===e?Promise.resolve(i):void(location.href={apiBaseUrl:"http://zsyas2.zhixinhuixue.com",siteUrl:"http://zsyas2.zhixinhuixue.com/vue/index.html#",phpPath:"http://zsyas2.zhixinhuixue.com/vue",phpBaseUrl:"/",xiaoben:"http://xbas2.schcur.com"}.apiBaseUrl+"/third/download?url="+i.data+"&title=pdf-"+t.cardSetting.title+".pdf"))}))},downPdfAll:function(){var e=this,t=this,i=this.bigTopicPageArr.length;if(i>2*this.cardSetting.column)return this.$message.error("超出"+2*this.cardSetting.column+"页,请重新编辑后再保存!"),!1;this.cardSetting.useQrCode?this.$confirm("该操作会把该场考试下面的所有班级学生考试模板进行批量生成。请勿重复生成!","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){var e=new FormData;e.append("exam_group_id",t.cardSetting.examGroupId),Object(x["e"])(e).then((function(e){1===e.status&&t.$message({type:"success",message:"后台批量生成中!"})}))})).catch((function(){e.$message({type:"info",message:"已取消"})})):location.href={apiBaseUrl:"http://zsyas2.zhixinhuixue.com",siteUrl:"http://zsyas2.zhixinhuixue.com/vue/index.html#",phpPath:"http://zsyas2.zhixinhuixue.com/vue",phpBaseUrl:"/",xiaoben:"http://xbas2.schcur.com"}.apiBaseUrl+"/third/download?url="+this.pdf_url+"&title=pdf-"+this.cardSetting.title+".pdf"},enterLinesTips:function(){this.tipsBox1=!0},leaveLinesTips:function(){this.tipsBox1=!1},enterEwmTips:function(){this.tipsBox2=!0},leaveEwmTips:function(){this.tipsBox2=!1},isShowBigTopicNo:function(e){var t=e.topicConfigureData.topicTypeArr[0];return""!=t.startNo&&""!=t.endNo},setDisabled:function(e){return this.cardSetting.examinationNumberType.includes(e)&&1==this.cardSetting.examinationNumberType.length||this.cardSetting.cardLength>12&&[3,4,5].includes(this.cardSetting.paperSize)},setCodeRules:function(){var e=this.cardSetting.cardLength<15&&([1,2].includes(this.cardSetting.paperSize)||!(this.cardSetting.cardLength>12&&[3,4,5].includes(this.cardSetting.paperSize)));e||this.cardSetting.useQrCode||(this.cardSetting.examinationNumberType=[1],this.cardSetting.hasBindingLine=0)}})},_=U,k=(i("82cc"),i("43fd"),Object(v["a"])(_,u,m,!1,null,"3de457e1",null)),A=k.exports,I=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-item paper-item-js",style:{width:e.calcPaperSize.width+"mm",height:e.calcPaperSize.height+"mm"}},[e.cardSetting.hasBindingLine&&0==e.pageIndex?i("paper-line",{attrs:{PaperLineFlag:e.cardSetting.hasBindingLine}}):e._e(),i("paper-content",e._g(e._b({attrs:{PaperLineFlag:e.cardSetting.hasBindingLine,content:e.content,paperColumn:e.cardSetting.column,pageIndex:e.pageIndex}},"paper-content",e.$attrs,!1),e.$listeners)),i("div",{staticClass:"page-num-cur"},[e._v("第"+e._s(e.pageIndex+1)+"页 共"+e._s(e.totalPageNum)+"页")]),i("div",{staticClass:"page-direction"},[e._v("第"+e._s(Math.ceil((e.pageIndex+1)/(2*e.cardSetting.column)))+"张纸"+e._s(Math.ceil((e.pageIndex+1)/e.cardSetting.column)%2==1?"正面":"反面")+" "+e._s(Math.ceil(e.pageIndex%e.cardSetting.column+1)))]),i("span",{class:["main-dot",{"unique-code":0==e.pageIndex,"unique-code-50":e.cardSetting.hasBindingLine&&0==e.pageIndex}],attrs:{"data-option":"bl"}}),e.cardSetting.allowEdit?e._e():i("div",{staticClass:"set-disable"}),0==e.content.length&&1==e.totalPageNum?i("div",{staticClass:"add-topic-tips"},[e._v(" 请添加试题 ")]):e._e()],1)},B=[],O=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["paper-line",{"line-left":1===e.PaperLineFlag,"line-right":2===e.PaperLineFlag}]},[1===e.PaperLineFlag?i("div",{staticClass:"examinee-info"},[!e.cardSetting.examinationNumberType.includes(1)&&e.cardSetting.examinationNumberType.includes(2)?i("div",{staticClass:"item"},[i("span",{staticClass:"red bineLineClassName"}),e._m(0)]):e._e(),i("div",{staticClass:"item"},[i("span",{staticClass:"red bindLineExamineeName"},[e.cardSetting.useQrCode?e._l("系统自动生成姓名信息",(function(t){return i("b",{key:t},[e._v(e._s(t))])})):e._e()],2),e._m(1)]),i("div",{staticClass:"item"},[i("span",{staticClass:"red bineLineClassName"},[e.cardSetting.useQrCode?e._l("系统自动生成班级信息",(function(t){return i("b",{key:t},[e._v(e._s(t))])})):e._e()],2),e._m(2)])]):e._e(),e._m(3)])},D=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("em",[i("i",[e._v(":")]),i("i",[e._v("号")]),i("i",[e._v("考")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("em",[i("i",[e._v(":")]),i("i",[e._v("名")]),i("i",[e._v("姓")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("em",[i("i",[e._v(":")]),i("i",[e._v("级")]),i("i",[e._v("班")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"line"},[i("span",[e._v("线")]),i("span",[e._v("订")]),i("span",[e._v("装")])])}],L={name:"PaperLine",props:{PaperLineFlag:{type:Number,default:0}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"]))},P=L,R=(i("4442"),Object(v["a"])(P,O,D,!1,null,"157042cb",null)),H=R.exports,q=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["paper-content",{"line-left":e.PaperLineFlag&&0==e.pageIndex,"line-right":e.PaperLineFlag&&e.pageIndex==2*e.paperColumn-1}]},[0==e.pageIndex?i("paper-info"):e._e(),i("paper-topic",e._g(e._b({attrs:{pageIndex:e.pageIndex}},"paper-topic",e.$attrs,!1),e.$listeners))],1)},M=[],j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-info-index"},[i("PaperTitle"),0==e.cardSetting.hasBindingLine?i("GradeAndName"):e._e(),e.cardSetting.hasPaperMsg?i("PaperInfo"):e._e(),i("PaperAttention"),i("PaperCard")],1)},$=[],F=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-title"},[i("textarea",{directives:[{name:"model",rawName:"v-model",value:e.cardSetting.title,expression:"cardSetting.title"}],attrs:{name:"name"},domProps:{value:e.cardSetting.title},on:{change:e.setTitle,input:function(t){t.target.composing||e.$set(e.cardSetting,"title",t.target.value)}}})])},z=[],V={name:"PaperTitle",computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"])),methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setCardSetting:l["c"]})),{},{setTitle:function(){this.setCardSetting(this.cardSetting)}})},W=V,J=(i("a546"),Object(v["a"])(W,F,z,!1,null,"21c9330c",null)),Q=J.exports,X=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-grade clearfix"},[i("div",{staticClass:"item"},[i("em",[e._v("班级:")]),i("span",{staticClass:"red className"},[e._v(e._s(e.cardSetting.useQrCode?"系统自动生成班级信息":""))])]),i("div",{staticClass:"item"},[i("em",[e._v("姓名:")]),i("span",{staticClass:"red examineeName"},[e._v(e._s(e.cardSetting.useQrCode?"系统自动生成姓名信息":""))])]),!e.cardSetting.examinationNumberType.includes(1)&&e.cardSetting.examinationNumberType.includes(2)?i("div",{staticClass:"item"},[i("em",[e._v("考号:")]),i("span",{staticClass:"red examineeName"})]):e._e()])},Y=[],G={name:"GradeAndName",computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"]))},K=G,Z=(i("70dc"),Object(v["a"])(K,X,Y,!1,null,"d5b317d0",null)),ee=Z.exports,te=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-info clearfix"},[e._l(e.infoList,(function(t){return i("span",{key:t.id},[e._v(e._s(t.name)+":"),i("input",{directives:[{name:"model",rawName:"v-model",value:t.text,expression:"info.text"}],staticClass:"input-paper-info",class:{number:t.id<2},attrs:{readonly:1===t.id,maxlength:"9"},domProps:{value:t.text},on:{change:e.setInfoList,input:function(i){i.target.composing||e.$set(t,"text",i.target.value)}}}),e._v(e._s(t.units))])})),i("div",{staticClass:"btn-paper-info iconfont iconedit",on:{click:e.editInfo}}),i("el-dialog",{attrs:{title:"设置",visible:e.paperInfoDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"400px",center:""},on:{"update:visible":function(t){e.paperInfoDialog=t}}},[e._l(e.cardSettingTemp.examInfoConfig,(function(t,n){return i("el-checkbox",{key:n,attrs:{size:"small",label:t.id},model:{value:t.isShow,callback:function(i){e.$set(t,"isShow",i)},expression:"item.isShow"}},[e._v(e._s(t.name))])})),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],2)],2)},ie=[],ne={name:"PaperInfo",data:function(){return{paperInfoDialog:!1,checkedTempInfo:[0,1,2,3],checkedInfo:[0,1,2,3],cardSettingTemp:{examInfoConfig:[]}}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"])),{},{infoList:function(){var e=[];return this.cardSetting.examInfoConfig.forEach((function(t){t.isShow&&e.push(t)})),e}}),methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setCardSetting:l["c"]})),{},{editInfo:function(){this.paperInfoDialog=!0,this.cardSettingTemp=JSON.parse(JSON.stringify(this.cardSetting))},setInfoList:function(){this.setCardSetting(this.cardSetting)},confirm:function(){this.paperInfoDialog=!1;var e=this.cardSettingTemp.examInfoConfig.filter((function(e){return 1==e.isShow}));this.cardSettingTemp.hasPaperMsg=0!=e.length,this.setCardSetting(this.cardSettingTemp)},cancel:function(){this.paperInfoDialog=!1,this.checkedTempInfo=Object(r["a"])(this.checkedInfo)}})},oe=ne,re=(i("ebb6"),Object(v["a"])(oe,te,ie,!1,null,"4db8cda5",null)),se=re.exports,ae=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"paper-attention"},[n("div",{class:["notice-info","page-width-"+(e.calcPaperSize.width>165?"default":"small")]},[n("i",{staticClass:"simple-border right"}),n("i",{staticClass:"simple-border"}),n("div",{staticClass:"tips-info"},[e._m(0),n("div",{staticClass:"notice-detail"},[e.isShowAttention(0)?n("p",[e._v("1、考生务必正确书写班级、姓名,请填涂系统准考证号。")]):e._e(),e.isShowAttention(1)?n("p",[e._v("1、考生务必正确书写班级、姓名,请填涂学校准考证号。")]):e._e(),e._l(e.attentionList,(function(t,i){return n("p",{key:i},[e._v(e._s(e.cardSetting.useQrCode?i+1:i+2)+"、"+e._s(t))])}))],2)]),n("div",{staticClass:"warming-info"},[n("div",{staticClass:"notice-ewm"},[e.cardSetting.useQrCode?n("i",{staticClass:"cover red"},[e._v("系统生成"),n("br"),e._v("考生二维码")]):e._e(),e.cardSetting.useQrCode?e._e():n("img",{staticClass:"dtk-ewm",attrs:{id:"dtk-ewm",src:i("50dc")}})]),e._m(1)])])])},le=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("h3",{staticClass:"notice-title"},[i("i",[e._v("注")]),i("i",[e._v("意")]),i("i",[e._v("事")]),i("i",[e._v("项")])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"noticeLose"},[i("h4",[e._v("缺考标记 "),i("i",{staticClass:"absent-mark"})]),i("p",[e._v("考生禁止填涂缺考标记!")]),i("p",[e._v("只能由监考老师负责填涂。")])])}],ce=i("f35d"),de={name:"PaperAttention",data:function(){return{attentionOne:["考生务必正确书写班级、姓名,请填涂系统准考证号。","考生务必正确书写班级、姓名,请填涂学校准考证号。"],attentionList:["考生务必用2B铅笔填涂。","考生务必在答题卡指定位置作答,并保持卷面整洁。","如需要条形码,则考生务必要在指定位置正确贴好条形码。","教师务必使用红笔阅卷。"]}},methods:{isShowAttention:function(e){return 0===e?!this.cardSetting.useQrCode&&0==this.cardSetting.cardStatus:1!==e||!this.cardSetting.useQrCode&&1==this.cardSetting.cardStatus}},mixins:[ce["a"]]},ue=de,me=(i("cd95"),Object(v["a"])(ue,ae,le,!1,null,"439bd28c",null)),pe=me.exports,he=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"paper-card"},[e.cardSetting.examinationNumberType.includes(1)?i("div",{staticClass:"exam-id card-flex"},[i("div",{staticClass:"card-id clearfix"},e._l(Number(e.cardSetting.cardLength),(function(t){return i("div",{key:"id_"+t,staticClass:"fl"},[i("span",{staticClass:"square"}),i("ul",e._l(10,(function(e){return i("li",{key:e,class:{"unique-li":1==e&&1==t}},[i("span",{class:["iconfont","iconnum_"+(e-1)]})])})),0)])})),0),e.cardSetting.examinationNumberType.includes(2)&&([1,2].includes(this.cardSetting.paperSize)||e.cardSetting.cardLength<13&&[3,4,5].includes(e.cardSetting.paperSize))?i("div",{staticClass:"card-code clearfix"},[e._m(0)]):e._e()]):e._e(),!e.cardSetting.examinationNumberType.includes(1)&&e.cardSetting.examinationNumberType.includes(2)?i("div",{staticClass:"exam-code card-flex"},[e._m(1)]):e._e()])},fe=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"code-img fr"},[i("div",{staticClass:"code-words"},[i("i",[e._v("条")]),i("i",[e._v("形")]),i("i",[e._v("码")])])])},function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"card-code clearfix"},[i("div",{staticClass:"code-img fl"},[i("div",{staticClass:"code-words cross-code"},[i("i",[e._v("条")]),i("i",[e._v("形")]),i("i",[e._v("码")])])])])}],ge={name:"PaperCard",computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"])),mixins:[ce["a"]]},be=ge,ve=(i("9614"),Object(v["a"])(be,he,fe,!1,null,"8562ea80",null)),ye=ve.exports,Ce={name:"PaperInfoIndex",components:{PaperTitle:Q,GradeAndName:ee,PaperInfo:se,PaperAttention:pe,PaperCard:ye},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting"]))},xe=Ce,we=Object(v["a"])(xe,j,$,!1,null,null,null),Te=we.exports,Ne=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{},e._l(e.content,(function(t,n){return i("div",{key:"topic_"+n,class:["content-"+n,"paper-topic-content"]},[t.isLast?e._e():i("TopicTitle",{attrs:{titleInfo:e.setTopicTitle(t),txt:t}}),t.isQuestionText?e._e():[[1,2,11].includes(t.questionTypeId)?i("TopicChoice",e._g(e._b({class:"topic-"+t.questionTypeId,attrs:{topicInfo:t.questions,modelId:t.modelId,setConfig:t.topicConfigureData}},"TopicChoice",e.$attrs,!1),e.$listeners)):e._e(),5==t.questionTypeId?i("TopicFill",e._g(e._b({attrs:{topicInfo:t.questions,modelId:t.modelId,setConfig:t.topicConfigureData}},"TopicFill",e.$attrs,!1),e.$listeners)):e._e()],[7,17,27].includes(t.questionTypeId)?[17===t.questionTypeId&&t.QuestionTextList?i("ChooseTopic",{attrs:{topic:t.QuestionTextList}}):e._e(),e._l(t.questions,(function(n){return i("TopicExplain",e._g(e._b({key:""+n.alias+n.ChooseArea+n.cutId+Math.random(),class:{"choose-topic":17===t.questionTypeId},attrs:{topicInfo:n,setConfig:t}},"TopicExplain",e.$attrs,!1),e.$listeners))}))]:e._e(),1===e.answerCardType&&1==t.isQuestionText?e._l(t.questions,(function(e,t){return i("Topic",{key:t,attrs:{topicContent:e}})})):e._e(),[77].includes(t.questionTypeId)&&9==e.subject?e._l(t.questions,(function(n){return i("TopicExplain",e._g(e._b({key:""+n.alias+n.cutId+Math.random(),staticClass:"article-topic",attrs:{topicInfo:n,setConfig:t}},"TopicExplain",e.$attrs,!1),e.$listeners))})):e._e(),[77].includes(t.questionTypeId)&&8==e.subject?e._l(t.questions,(function(n){return i("TopicExplain",e._g(e._b({key:""+n.alias+n.cutId+Math.random(),staticClass:"article-topic",attrs:{topicInfo:n,setConfig:t}},"TopicExplain",e.$attrs,!1),e.$listeners))})):e._e()],2)})),0)},Se=[],Ee=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("h3",{staticClass:"topic-title big-topic-title",staticStyle:{height:"auto"}},[e._v(e._s(e.titleInfo.topicTitleText)),i("span",[e._v(e._s(e.titleInfo.topicSubTitleText))])])},Ue=[],_e={name:"TopicTitle",data:function(){return{}},props:{titleInfo:{type:Object,default:function(){return{}}}}},ke=_e,Ae=(i("98e7"),Object(v["a"])(ke,Ee,Ue,!1,null,null,null)),Ie=Ae.exports,Be=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"topic-choice clearfix",class:["flex-direction-"+e.form.direction,{"topic-box-border":e.optionsArr.length>0}]},[i("div",{staticClass:"btn-paper-info iconfont iconedit",on:{click:e.openSet}}),0==e.paperSource?i("div",{staticClass:"del-btn iconfont icondelete",on:{click:e.delTopic}}):e._e(),e._l(e.optionsArr,(function(t,n){return i("ul",{key:n,staticClass:"single-option clearfix"},e._l(t,(function(t,n){return i("li",{key:n,staticClass:"clearfix option-li",attrs:{"data-pageIndex":e.pageIndex,"data-modelId":e.modelId,"data-type":t.questionTypeId}},[i("em",[e._v(e._s(t.alias))]),e._l(parseInt(t.optionCount),(function(e,t){return i("span",{key:t,class:["iconfont","iconwords_"+t]})}))],2)})),0)})),i("el-dialog",{attrs:{title:"设置",visible:e.topicSetDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"30%",center:""},on:{"update:visible":function(t){e.topicSetDialog=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"选择排列方向"}},[i("el-radio-group",{model:{value:e.form.tempDirection,callback:function(t){e.$set(e.form,"tempDirection",t)},expression:"form.tempDirection"}},e._l(e.form.infoList,(function(t,n){return i("el-radio",{key:n,attrs:{label:t.id}},[e._v(e._s(t.name))])})),1)],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],2)},Oe=[],De=i("fbd4"),Le={name:"TopicChoice",mixins:[De["a"]],props:{topicInfo:{type:Array,default:function(){return[]}},setConfig:{type:Object,default:function(){return{}}},modelId:{type:String},pageIndex:{type:Number,default:null}},watch:{topicInfo:{handler:function(e){this.isMounted&&(this.form.direction=this.setConfig.direction||0,this.form.tempDirection=this.setConfig.direction||0,this.sortOptions(e))},deep:!0}},data:function(){return{optionsArr:[],topicSetDialog:!1,form:{direction:0,tempDirection:0,infoList:[{id:0,name:"横向"},{id:1,name:"纵向"}]},isMounted:!1}},created:function(){this.form.direction=this.setConfig.direction||0,this.form.tempDirection=this.setConfig.direction||0},mounted:function(){this.sortOptions(this.topicInfo),this.isMounted=!0},methods:{sortOptions:function(e){var t=this;this.optionsArr=[],e.forEach((function(e,i){t.optionsArr[parseInt(i/5)]||(t.optionsArr[parseInt(i/5)]=[]),t.optionsArr[parseInt(i/5)].push(e)}))},openSet:function(){0!==this.paperSource?this.topicSetDialog=!0:this.$emit("showEditBigTopic",this.modelId)},confirm:function(){var e=this;if(this.topicSetDialog=!1,this.form.direction=this.form.tempDirection,1==this.paperSource){var t=[];t=Object(c["a"])(this.bigTopicPageArr),t=t.map((function(t){return t.modelId==e.modelId&&(t.topicConfigureData.direction=e.form.direction),t})),this.setBigTopicPageArr([t]),this.setInitPageFlag(!this.initPageFlag)}},cancel:function(){this.topicSetDialog=!1,this.form.tempDirection=this.form.direction}}},Pe=Le,Re=(i("5eed"),Object(v["a"])(Pe,Be,Oe,!1,null,"83c167da",null)),He=Re.exports,qe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"topic-fill",class:[{"topic-box-border":e.topicInfo.length>0}]},[i("div",{staticClass:"btn-paper-info iconfont iconedit",on:{click:e.openSet}}),0==e.paperSource?i("div",{staticClass:"del-btn iconfont icondelete",on:{click:e.delTopic}}):e._e(),i("div",{staticClass:"subjectCol clearfix ",class:["","col-"+(e.setConfig.columns||1)]},e._l(e.topicInfo,(function(t,n){return i("div",{key:n,staticClass:"fill-item clearfix",style:{height:(e.setConfig.rowLineHeight||40)+"px"},attrs:{"data-pageIndex":e.pageIndex,"data-type":t.questionTypeId,"data-modelId":e.modelId}},[i("span",[e._v(e._s(t.alias)+"、")]),i("em",{style:{height:(e.setConfig.rowLineHeight||40)+"px"}}),i("strong",e._l(e.form.scoreArr,(function(t){return i("i",{key:t},[e._v(e._s(t))])})),0)])})),0),i("el-dialog",{attrs:{title:"设置",visible:e.topicSetDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"30%",center:""},on:{"update:visible":function(t){e.topicSetDialog=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"每行列数"}},[i("el-select",{attrs:{placeholder:"请选择列数"},model:{value:e.form.columnCount,callback:function(t){e.$set(e.form,"columnCount",t)},expression:"form.columnCount"}},e._l(e.form.columnCountArr,(function(e){return i("el-option",{key:e,attrs:{value:e,label:e}})})),1)],1),i("el-form-item",{attrs:{label:"行间距"}},[i("el-select",{attrs:{placeholder:"请选择间距"},model:{value:e.form.rowLineHeight,callback:function(t){e.$set(e.form,"rowLineHeight",t)},expression:"form.rowLineHeight"}},e._l(e.form.rowHieightArr,(function(e){return i("el-option",{key:e,attrs:{value:e,label:e+"px"}})})),1)],1),i("el-form-item",{attrs:{label:"手写打分"}},[i("el-select",{attrs:{placeholder:"请选择分数"},model:{value:e.form.scoreBoxCount,callback:function(t){e.$set(e.form,"scoreBoxCount",t)},expression:"form.scoreBoxCount"}},e._l(e.form.scoreBoxArr,(function(t,n){return i("el-option",{key:n,attrs:{value:n,label:t.label,disabled:1!=t.id&&t.id!=e.scoreA&&t.id!=e.scoreB&&t.id!=e.scorec}})})),1)],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},Me=[],je={name:"TopicFill",mixins:[De["a"]],props:{topicInfo:{type:Array,default:function(){return[]}},setConfig:{type:Object,default:function(){return{}}},modelId:{type:String},pageIndex:{type:Number,default:null}},watch:{setConfig:{handler:function(){this.isMounted&&this.initFill()},deep:!0}},data:function(){return{topicSetDialog:!1,form:{columnCount:1,rowLineHeight:40,scoreBoxCount:0,columnCountArr:[1,2,3],rowHieightArr:[30,35,40,45,50],scoreBoxArr:[{id:1,label:"空白方框"},{id:2,label:"2/3/5"},{id:3,label:"2/3/4/6"},{id:4,label:"2/4"}],scoreArr:[2,3,5]},isMounted:!1,scoreA:1,scoreB:1,scorec:1,scoreFull:[]}},mounted:function(){this.initFill(),this.questionScore(),this.isMounted=!0},methods:{questionScore:function(){for(var e=0;e<this.topicInfo.length;e++)this.scoreFull.push(this.topicInfo[e].fullScore);for(var t=0;t<this.form.scoreBoxArr.length;t++)if(t>0)for(var i=0;i<this.topicInfo.length;i++)this.form.scoreBoxArr[t].label.includes(this.topicInfo[i].fullScore)&&Math.max.apply(Math,Object(r["a"])(this.form.scoreBoxArr[t].label.split("/")))<=Math.max.apply(Math,Object(r["a"])(this.scoreFull))?1==t?this.scoreA=2:2==t?this.scoreB=3:3==t&&(this.scorec=4):1==t?this.scoreA=1:2==t?this.scoreB=1:3==t&&(this.scorec=1)},initFill:function(){var e=this;this.form.scoreBoxArr.forEach((function(t,i){t.id==e.setConfig.scoreStyle&&(e.form.scoreBoxCount=i)})),this.form.columnCount=this.setConfig.columns||1,this.form.scoreArr=0==this.form.scoreBoxCount?[""]:this.form.scoreBoxArr[this.form.scoreBoxCount].label.split("/")},openSet:function(){0!==this.paperSource?this.topicSetDialog=!0:this.$emit("showEditBigTopic",this.modelId)},confirm:function(){var e=this;if(this.topicSetDialog=!1,1==this.paperSource){var t=[];t=Object(c["a"])(this.bigTopicPageArr),t=t.map((function(t){return t.modelId==e.modelId&&(t.topicConfigureData.columns=e.form.columnCount,t.topicConfigureData.rowLineHeight=e.form.rowLineHeight,t.topicConfigureData.scoreStyle=e.form.scoreBoxArr[e.form.scoreBoxCount].id),t})),this.setBigTopicPageArr([t]),this.setInitPageFlag(!this.initPageFlag)}},cancel:function(){this.topicSetDialog=!1}}},$e=je,Fe=(i("753f"),Object(v["a"])($e,qe,Me,!1,null,"5bfb97c8",null)),ze=Fe.exports,Ve=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"topic-item topic-explain",attrs:{"data-pageIndex":e.pageIndex,"data-type":e.setConfig.questionTypeId,"data-modelId":e.setConfig.modelId}},[e.isArticleChOver?e._e():i("div",{ref:"topicModule",staticClass:"module"},[1===e.topicInfo.cutId?i("div",{staticClass:"scoring-box"},[e._l(e.topicScore,(function(t,n){return i("span",{key:"score_"+n},[e._v(e._s(t))])})),e.isShowNoScoring?i("span",{staticClass:"no-scoring",style:{width:e.noScoringW+"px"}},[e._v("禁打分区")]):e._e()],2):e._e(),i("div",{staticClass:"btn-edit-big-topic-box"},[i("span",{staticClass:"btn-drag",on:{mousedown:e.moveTopicAreaHeight}}),1===e.topicInfo.cutId?i("span",{staticClass:"btn-setting btn-paper-info iconfont iconedit",on:{click:e.showEditBigTopic}}):e._e(),1===e.topicInfo.cutId&&0===e.paperSource?i("span",{staticClass:"btn-del del-btn iconfont icondelete",on:{click:e.delTopic}}):e._e(),1!==e.topicInfo.cutId?i("span",{staticClass:"btn-del-topic-over",on:{click:function(t){return t.stopPropagation(),e.delTopicOver(t)}}},[i("i",{staticClass:"el-icon-close"})]):e._e()]),17===e.topicInfo.questionTypeId&&1===e.topicInfo.cutId?i("div",{staticClass:"optional-box"},e._l(e.ChooseOptData,(function(e,t){return i("span",{key:"opt_"+e,class:["iconfont","optional-span","iconwords_"+t]})})),0):e._e(),i("div",{staticClass:"topic-answer-area",style:{height:e.TopicAreaHeight+"px"}},[i("div",{staticClass:"topic-content",on:{"!mouseleave":function(t){return e.mouseEvent(0)},"!mouseenter":function(t){return e.mouseEvent(1)}}},[i("UeCard",{ref:"ueCard",attrs:{height:e.TopicAreaHeight},on:{ready:e.ueReady,ueBlur:e.ueBlur},model:{value:e.topicInfo.contentHtml,callback:function(t){e.$set(e.topicInfo,"contentHtml",t)},expression:"topicInfo.contentHtml"}}),i("div",{directives:[{name:"show",rawName:"v-show",value:0==e.showUeTitle,expression:"showUeTitle==false"}],staticClass:"no-drug-shadow",attrs:{"data-index":e.setConfig.questionTypeId}})],1)]),i("el-dialog",{attrs:{title:"设置",visible:e.dialogVisibleIsAddTopic,width:"915px","before-close":e.handleCloseAddTopic,"destroy-on-close":!1},on:{"update:visible":function(t){e.dialogVisibleIsAddTopic=t}}},[i("AddTopic",{ref:"AddTopic",attrs:{"is-edit":!0,"edit-model-id":e.modelId},on:{cancel:function(t){e.dialogVisibleIsAddTopic=!1}}})],1),i("el-dialog",{attrs:{title:"设置",visible:e.topicSetDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"30%",center:""},on:{"update:visible":function(t){e.topicSetDialog=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px"}},[i("el-form-item",{attrs:{label:"分值上限"}},[i("el-select",{attrs:{placeholder:"请选择分数"},model:{value:e.form.scoreBoxCount,callback:function(t){e.$set(e.form,"scoreBoxCount",t)},expression:"form.scoreBoxCount"}},e._l(e.form.scoreBoxArr,(function(e,t){return i("el-option",{key:"index_"+t,attrs:{value:e.id,label:e.label}})})),1)],1),i("el-form-item",{attrs:{label:""}},[i("el-checkbox",{model:{value:e.form.halfScore,callback:function(t){e.$set(e.form,"halfScore",t)},expression:"form.halfScore"}},[e._v("加入0.5分")])],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1),77===e.setConfig.questionTypeId&&9===e.topicInfo.subject&&e.topicInfo.isShowArticleCn?i("ArticleCh",{attrs:{wordsCountCh:e.setWordsCountCh,pageIndex:e.pageIndex}}):e._e()],1)},We=[],Je=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"ueCard",staticClass:"ue ue-card"},[i("script",{attrs:{id:e.randomId,type:"text/plain"}})])},Qe=[];i("4d63"),i("25f0"),i("5319"),i("841c"),i("4437"),i("b9fe"),i("2e32"),i("946b"),i("2db0"),i("a019");function Xe(e,t,i){var n={type:1,latexUse:i};sessionStorage.editKityFormula=JSON.stringify(n);var o=new UE.ui.Dialog({iframeUrl:e.options.UEDITOR_HOME_URL+"kityformula-plugin/kityFormulaDialog.html",editor:e,name:t,title:"插入公式 - zhixinhuixue",cssRules:"width:783px; height: 386px;",buttons:[{className:"edui-okbutton",label:"确定",onclick:function(){o.close(!0)}},{className:"edui-cancelbutton",label:"取消",onclick:function(){o.close(!1)}}]});o.open()}i("f327");var Ye={name:"Ue",props:{isSave:Boolean,value:{type:String,default:""},height:Number,showTitle:Boolean},data:function(){return{ue:null,randomId:"editor_"+1e17*Math.random(),scriptTagStatus:2,UEditorConfig:{toolbars:[["formatmatch","undo","redo","fontsize","bold","italic","underline","subscript","superscript","removeformat","lineheight","justifyleft","justifycenter","justifyright","justifyjustify","simpleupload","horizontal","spechars","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","kityformula","chineselattice","horizontalline"]],enableAutoSave:!1,enableContextMenu:!1,imagePopup:!1,initialFrameHeight:20,UEDITOR_HOME_URL:"ueditor/"},imgDrag:{isDrag:!1,diffX:0,diffY:0,offsetWidth:0,offsetHeight:0},text:""}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["topicBlur"])),watch:{isSave:function(e){e&&this.$emit("input",this.getUEContent())},value:function(e){e!==this.text&&this.setText(e)},height:function(e){this.ue.setHeight(e)},showTitle:function(e){e?this.showUeTitle():this.hideUeTitle()}},mounted:function(){this.initEditor()},beforeDestroy:function(){null!==this.ue&&this.ue.textarea&&this.ue.destroy&&this.ue.destroy()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setTopicBlur:l["p"]})),{},{initEditor:function(){var e=this,t=this;2===this.scriptTagStatus&&null===this.ue&&this.$nextTick((function(){e.ue=window.UE.getEditor(e.randomId,e.UEditorConfig),e.ue.addListener("ready",(function(){""!=e.value&&e.setText(e.value),e.ue.setHeight(e.height),e.pasteEvent(e.ue),e.addImgDragMousedown(),e.addImgDragMousemove(),e.addImgDragMouseup(),e.$nextTick((function(){e.$emit("ready",e.ue)})),e.ue.body.addEventListener("click",(function(e){var i=e.target||e.srcElement,n=i.getAttribute("data-latex");if(-1!==i.className.indexOf("mathType")){var o=i.src.substring(i.src.indexOf("?")+1);Xe(t.ue,"chineselattice",o)}if(null==n)return!1;n.length>0&&Xe(t.ue,"chineselattice",n)})),e.topicBlur||(document.body.addEventListener("click",(function(t){t.target.className.includes("edui-default")||e.hideUeTitle()})),e.setTopicBlur(!0)),e.ue.addListener("contentChange",(function(){t.text=t.getUEContent(),t.$emit("input",t.getUEContent())})),e.ue.addListener("blur",(function(){t.text=t.getUEContent(),t.$emit("input",t.getUEContent()),t.$emit("ueBlur",!0)})),e.ue.addListener("focus",(function(){e.hideUeTitle(),e.showUeTitle()}))}))}))},getUEContent:function(){return this.ue.getContent()},setText:function(e){this.ue.setContent(e)},pasteEvent:function(e){var t=this,i=["nobr"],n=["zhixinhuixue.com","zhixinhuixue.cn","zhixinhuixue.net","xueping.com","xueping365.com"];e.addListener("beforepaste",(function(e,o,r){if(""!=o.html){for(var s=0;s<i.length;s++){var a=new RegExp("<"+i[s]+"[^>]+>","gi");-1!=o.html.indexOf(i[s])&&(o.html=o.html.replace(a,""))}if(-1!=o.html.indexOf("img")){var l=[],c=!0,d=JSON.stringify(o.html);if(o.html.search("xueping365")>-1){var u=d.replace(/xueping365.com/g,"zhixinhuixue.net");o.html=decodeURIComponent(JSON.parse(u))}o.html.replace(/<img\ssrc=[\'"](.+?)[\'"]\>/gi,(function(e,t){l.push(t);for(var i=0;i<n.length;i++)-1!=t.indexOf(n[i])&&(c=!1)}));var m=o.html.search("loadingclass");m>-1&&(c=!1),c&&(o.html="",t.$message({type:"info",message:"禁止复制包含外部地址图片(或插入空小图标)的内容 如需上传图片请通过编辑器(或插入空)上传"}))}}else o.html=""}))},addImgDragMousedown:function(){var e=this;this.ue.body.addEventListener("mousedown",(function(t){var i=t.target||t.srcElement;"IMG"===i.tagName&&-1===i.className.indexOf("mathType")?(t.stopPropagation(),t.preventDefault(),e.imgDrag.offsetWidth=i.offsetWidth,e.imgDrag.offsetHeight=i.offsetHeight,e.imgDrag.diffX=t.clientX-i.offsetLeft,e.imgDrag.diffY=t.clientY-i.offsetTop,e.imgDrag.isDrag=!0):e.ue.focus(!0)}))},addImgDragMousemove:function(){var e=this;this.ue.body.addEventListener("mousemove",(function(t){var i=t.target||t.srcElement;if("IMG"===i.tagName&&e.imgDrag.isDrag){t.stopPropagation(),t.preventDefault();var n=t.clientX-e.imgDrag.diffX,o=t.clientY-e.imgDrag.diffY;n<0?n=0:n>e.ue.window.innerWidth-e.imgDrag.offsetWidth&&(n=e.ue.window.innerWidth-e.imgDrag.offsetWidth),o<0?o=0:o>e.ue.window.innerHeight-e.imgDrag.offsetHeight&&(o=e.ue.window.innerHeight-e.imgDrag.offsetHeight),i.style.position="absolute",i.style.left=n+"px",i.style.top=o+"px"}}))},addImgDragMouseup:function(){var e=this;this.ue.body.addEventListener("mouseup",(function(t){e.imgDrag.isDrag=!1}))},showUeTitle:function(){this.$refs.ueCard.getElementsByClassName("edui-editor-toolbarbox")[0].style.display="block"},hideUeTitle:function(){var e=document.querySelectorAll(".edui-editor-toolbarbox");e.forEach((function(e){return e.style.display="none"}))}})},Ge=Ye,Ke=(i("c2e7"),Object(v["a"])(Ge,Je,Qe,!1,null,null,null)),Ze=Ke.exports,et=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"add-topic"},[i("div",{staticClass:"edit-topic-content"},[i("div",{staticClass:"top"},[i("div",{staticClass:"topic-title"},[i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("大题号")]),i("el-select",{staticClass:"select-big_topic-number",attrs:{size:"mini",placeholder:"请选择"},model:{value:e.topicConfigureData.BigNo,callback:function(t){e.$set(e.topicConfigureData,"BigNo",t)},expression:"topicConfigureData.BigNo"}},e._l(e.bigQuestionNos,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("题型标题")]),i("el-input",{staticClass:"input-big_topic-name",attrs:{size:"mini",maxlength:"10",placeholder:"请输入题型标题名称"},nativeOn:{keyup:function(t){return e.trimLR(t)}},model:{value:e.topicConfigureData.name,callback:function(t){e.$set(e.topicConfigureData,"name",t)},expression:"topicConfigureData.name"}})],1),i("span",{staticClass:"color-red"},[e._v(e._s(e.errMsg))])]),e._l(e.topicConfigureData.topicTypeArr,(function(t,n){return i("div",{key:n,staticClass:"topic-type"},[i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("题类")]),i("el-select",{staticClass:"select-topic-topicType",attrs:{size:"mini",placeholder:"请选择题类"},on:{change:function(t){return e.addTopicList(e.topicConfigureData)}},model:{value:e.topicConfigureData.topicType,callback:function(t){e.$set(e.topicConfigureData,"topicType",t)},expression:"topicConfigureData.topicType"}},e._l(e.topicTypeOptions,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("span",{directives:[{name:"show",rawName:"v-show",value:17==e.topicConfigureData.topicType,expression:"topicConfigureData.topicType==17"}],staticClass:"topic-edit-item"},[i("el-select",{staticClass:"select-choose_topic",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.addTopicList(e.topicConfigureData)}},model:{value:t.chooseOption,callback:function(i){e.$set(t,"chooseOption",i)},expression:"topicConfig.chooseOption"}},e._l(e.chooseOptions,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" 选 "),i("el-select",{staticClass:"select-choose_topic",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.addTopicList(e.topicConfigureData)}},model:{value:t.chooseSelectOption,callback:function(i){e.$set(t,"chooseSelectOption",i)},expression:"topicConfig.chooseSelectOption"}},e._l(e.chooseSelectOptions,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("span",{staticClass:"topic-edit-item"},[e._v(" 从"),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:"题号"},on:{change:function(i){e.checkNumber(t,"startNo"),e.addTopicList(e.topicConfigureData)},input:function(i){return e.checkNumber(t,"startNo")}},model:{value:t.startNo,callback:function(i){e.$set(t,"startNo",i)},expression:"topicConfig.startNo"}})],1),i("span",{staticClass:"topic-edit-item"},[e._v(" 到"),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:"题号"},on:{change:function(i){e.checkNumber(t,"endNo"),e.addTopicList(e.topicConfigureData)},input:function(i){return e.checkNumber(t,"endNo")}},model:{value:t.endNo,callback:function(i){e.$set(t,"endNo",i)},expression:"topicConfig.endNo"}}),e._v("题 ")],1),i("span",{directives:[{name:"show",rawName:"v-show",value:e.isSelectType,expression:"isSelectType"}],staticClass:"topic-edit-item"},[e._v(" 每题"),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(i){e.checkOptNumber(t,"optionsNumber"),e.addTopicList(e.topicConfigureData)}},model:{value:t.optionsNumber,callback:function(i){e.$set(t,"optionsNumber",i)},expression:"topicConfig.optionsNumber"}}),e._v("个选项 ")],1),i("span",{staticClass:"topic-edit-item"},[e._v(" 每题"),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(i){e.checkScore(t),e.addTopicList(e.topicConfigureData)}},model:{value:t.score,callback:function(i){e.$set(t,"score",i)},expression:"topicConfig.score"}}),e._v("分 ")],1),i("span",{directives:[{name:"show",rawName:"v-show",value:e.isMoreSelectType,expression:"isMoreSelectType"}],staticClass:"topic-edit-item"},[e._v(" 半对"),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(i){e.checkHalfScore(t),e.addTopicList(e.topicConfigureData)}},model:{value:t.halfScore,callback:function(i){e.$set(t,"halfScore",i)},expression:"topicConfig.halfScore"}}),e._v("分 ")],1),e.isZongHe&&17===e.topicConfigureData.topicType?i("SubjectSelect",{attrs:{"subject-id":e.topicConfigureData.subject},on:{subjectChange:e.ChooseChangeSubject}}):e._e(),i("span",{directives:[{name:"show",rawName:"v-show",value:17!=e.topicConfigureData.topicType,expression:"topicConfigureData.topicType!=17"}],staticClass:"topic-edit-item"},[i("i",{directives:[{name:"show",rawName:"v-show",value:e.topicList.length>0,expression:"topicList.length>0"}],staticClass:"el-icon-circle-plus-outline btn-add-topic-type",on:{click:e.addTopicType}}),i("i",{directives:[{name:"show",rawName:"v-show",value:0==e.topicList.length,expression:"topicList.length==0"}],staticClass:"el-icon-circle-plus-outline btn-add-topic-type disabled"})]),i("span",{directives:[{name:"show",rawName:"v-show",value:e.topicConfigureData.topicTypeArr.length>1,expression:"topicConfigureData.topicTypeArr.length>1"}],staticClass:"topic-edit-item"},[i("i",{staticClass:"el-icon-remove-outline btn-del-topic-type",on:{click:function(t){return e.delTopicType(n)}}})])],1)}))],2),e.topicList.length>0?i("div",{key:"topicList",staticClass:"topic-list"},e._l(e.topicList,(function(e,t){return i("div",{key:e.alias,staticClass:"topic-list-item"},[i("MinTopicEditItem",{attrs:{"min-topic-data":e,idx:t}})],1)})),0):i("div",{key:"topicList",staticClass:"topic-list"},[i("p",{staticClass:"msg"},[e._v("请添加题目")])]),e.isSelectType?i("div",{staticClass:"topic-card-setting"},[i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("选项排列方向")]),i("el-radio-group",{model:{value:e.topicConfigureData.direction,callback:function(t){e.$set(e.topicConfigureData,"direction",t)},expression:"topicConfigureData.direction"}},[i("el-radio",{attrs:{label:0}},[e._v("横向")]),i("el-radio",{attrs:{label:1}},[e._v("纵向")])],1)],1)]):e._e(),e.isFillInBlank?i("div",{staticClass:"topic-card-setting"},[i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("答题卡布局")]),e._v(" 每行 "),i("el-select",{staticClass:"select-big_topic-number",attrs:{size:"mini",placeholder:"请选择"},model:{value:e.topicConfigureData.columns,callback:function(t){e.$set(e.topicConfigureData,"columns",t)},expression:"topicConfigureData.columns"}},e._l(e.columns,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1),e._v(" 列 ")],1),i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("行高")]),i("el-select",{staticClass:"select-big_topic-number",attrs:{size:"mini",placeholder:"请选择"},model:{value:e.topicConfigureData.rowLineHeight,callback:function(t){e.$set(e.topicConfigureData,"rowLineHeight",t)},expression:"topicConfigureData.rowLineHeight"}},e._l(e.lineHeights,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("手写打分")]),i("el-select",{staticClass:"select-big_topic-number",attrs:{size:"mini",placeholder:"请选择"},model:{value:e.topicConfigureData.scoreStyle,callback:function(t){e.$set(e.topicConfigureData,"scoreStyle",t)},expression:"topicConfigureData.scoreStyle"}},e._l(e.scoreOpt,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1),i("span",[e._v("仅对线下阅卷打分")])],1)]):e._e(),e.isAnswer?i("div",{staticClass:"topic-card-setting"},[i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("手写打分")]),i("el-select",{staticClass:"select-big_topic-number",attrs:{size:"mini",placeholder:"请选择"},model:{value:e.topicConfigureData.scoreLimit,callback:function(t){e.$set(e.topicConfigureData,"scoreLimit",t)},expression:"topicConfigureData.scoreLimit"}},e._l(e.scoreMaxOptions,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1),i("span",{staticClass:"topic-edit-item"},[i("el-checkbox",{model:{value:e.topicConfigureData.hasHalfScore,callback:function(t){e.$set(e.topicConfigureData,"hasHalfScore",t)},expression:"topicConfigureData.hasHalfScore"}},[e._v("加入0.5分")]),i("span",[e._v("(仅对线下阅卷打分)")])],1),e.isCompositionZH?i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("作文字数")]),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini"},model:{value:e.topicConfigureData.compositionNumber,callback:function(t){e.$set(e.topicConfigureData,"compositionNumber",t)},expression:"topicConfigureData.compositionNumber"}})],1):e._e(),e.isCompositionEN?i("span",{staticClass:"topic-edit-item"},[i("label",[e._v("英语作文横线行数")]),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini"},model:{value:e.topicConfigureData.compositionRows,callback:function(t){e.$set(e.topicConfigureData,"compositionRows",t)},expression:"topicConfigureData.compositionRows"}})],1):e._e()]):e._e()]),i("div",{staticClass:"btn-box"},[i("button",{staticClass:"btn btn-topic-edit-save",on:{click:e.save}},[e._v("保存")]),i("button",{staticClass:"btn btn-topic-edit-cancel",on:{click:e.cancel}},[e._v("取消")])])])},tt=[],it=(i("cb29"),i("a15b"),i("f1ed")),nt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"min-topic-box"},[i("div",{staticClass:"min-topic"},[i("div",{staticClass:"left"},[i("span",{staticClass:"number"},[e._v(e._s(e.minTopicData.alias))]),e.isSelectType||77===e.minTopicData.questionTypeId||17===e.minTopicData.questionTypeId?e._e():i("span",{staticClass:"btn-add-min-topic",on:{click:e.addMiniTopic}},[i("i",[e._v("+")]),e._v("添加小题 ")])]),i("div",{staticClass:"con"},[e._v(e._s(e.minTopicData.questionTypeText))]),e.isSelectType?i("div",{staticClass:"right"},[this.isZongHe&&17!==e.minTopicData.questionTypeId?i("SubjectSelect",{attrs:{"subject-id":e.minTopicData.subject},on:{subjectChange:e.ChangeSubject}}):e._e(),i("span",[e._v(" 选项数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.checkOptNumber(e.minTopicData,"optionsCount")}},model:{value:e.minTopicData.optionsCount,callback:function(t){e.$set(e.minTopicData,"optionsCount",t)},expression:"minTopicData.optionsCount"}})],1),i("span",[e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.checkScore(e.minTopicData,"fullScore")}},model:{value:e.minTopicData.fullScore,callback:function(t){e.$set(e.minTopicData,"fullScore",t)},expression:"minTopicData.fullScore"}})],1),e.isMoreSelectType?i("span",[e._v(" 半分 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.checkHalfScore(e.minTopicData,"halfScore",e.minTopicData.fullScore)}},model:{value:e.minTopicData.halfScore,callback:function(t){e.$set(e.minTopicData,"halfScore",t)},expression:"minTopicData.halfScore"}})],1):e._e()],1):e._e(),e.hasSmQuestionTopic?i("div",{staticClass:"right"},[this.isZongHe&&17!==e.minTopicData.questionTypeId?i("SubjectSelect",{attrs:{"subject-id":e.minTopicData.subject},on:{subjectChange:e.ChangeSubject}}):e._e(),17!==e.minTopicData.questionTypeId&&0==e.minTopicData.smTopic.length?i("div",{staticClass:"min-question-box"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"小问不需要单独设置模板区域但是每小问需批阅判分",placement:"top"}},[i("i",{staticClass:"el-icon-warning-outline"})]),i("el-switch",{staticClass:"switch-is_question",attrs:{size:"mini","active-color":"#409EFF","inactive-color":"#bbb","active-text":"含小问"},on:{change:function(t){return e.changeTopicQues(e.minTopicData,e.minTopicData.hasSmQuestion)}},model:{value:e.minTopicData.hasSmQuestion,callback:function(t){e.$set(e.minTopicData,"hasSmQuestion",t)},expression:"minTopicData.hasSmQuestion"}}),i("el-input",{staticClass:"input-min_topic-number",attrs:{disabled:!e.minTopicData.hasSmQuestion,size:"mini",placeholder:""},on:{change:function(t){return e.addQuestion(e.minTopicData)}},model:{value:e.minTopicData.topicQues,callback:function(t){e.$set(e.minTopicData,"topicQues",t)},expression:"minTopicData.topicQues"}})],1):e._e(),e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{disabled:17==e.minTopicData.questionTypeId,size:"mini",placeholder:""},on:{change:function(t){return e.checkScore(e.minTopicData,"fullScore")}},model:{value:e.minTopicData.fullScore,callback:function(t){e.$set(e.minTopicData,"fullScore",t)},expression:"minTopicData.fullScore"}})],1):e._e(),77==e.minTopicData.questionTypeId?i("div",{staticClass:"right"},[e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{disabled:!0,size:"mini",placeholder:""},on:{change:function(t){return e.checkScore(e.minTopicData,"fullScore")}},model:{value:e.minTopicData.fullScore,callback:function(t){e.$set(e.minTopicData,"fullScore",t)},expression:"minTopicData.fullScore"}})],1):e._e()]),i("div",{staticClass:"min-question"},e._l(e.minTopicData.smQuestion,(function(t){return i("div",{key:t.alias,staticClass:"min-question-item"},[i("div",{staticClass:"left"},[i("span",{staticClass:"number"},[e._v(e._s(t.alias))])]),i("div",{staticClass:"right"},[e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(i){e.checkScore(t,"score"),e.allAsk(e.minTopicData)}},model:{value:t.score,callback:function(i){e.$set(t,"score",i)},expression:"minQuestion.score"}})],1)])})),0),i("div",{staticClass:"mini-topic"},e._l(e.minTopicData.smTopic,(function(t){return i("div",{key:t.topicEditorIndex,staticClass:"mini-topic-item"},[i("div",{staticClass:"mini-topic-title"},[i("div",{staticClass:"left"},[i("i",{staticClass:"el-icon-remove-outline btn-del-mini-topic",on:{click:function(i){return e.delMiniTopic(t)}}}),i("span",{staticClass:"number"},[e._v(e._s(t.alias))])]),i("div",{staticClass:"con"},[e._v(e._s(e.topicTypeName(t.questionTypeId)))]),i("div",{staticClass:"right"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"小问不需要单独设置模板区域但是每小问需批阅判分",placement:"top"}},[i("i",{staticClass:"el-icon-warning-outline"})]),i("el-switch",{staticClass:"switch-is_question",attrs:{size:"mini","active-color":"#409EFF","inactive-color":"#bbb","active-text":"含小问"},on:{change:function(i){return e.changeTopicQues(t,t.hasSmQuestion)}},model:{value:t.hasSmQuestion,callback:function(i){e.$set(t,"hasSmQuestion",i)},expression:"miniTopic.hasSmQuestion"}}),i("el-input",{staticClass:"input-min_topic-number",attrs:{disabled:!t.hasSmQuestion,size:"mini",placeholder:""},on:{change:function(i){return e.addQuestion(t)}},model:{value:t.topicQues,callback:function(i){e.$set(t,"topicQues",i)},expression:"miniTopic.topicQues"}}),e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(i){return e.checkScore(t,"fullScore")},blur:function(t){return e.allScore()}},model:{value:t.fullScore,callback:function(i){e.$set(t,"fullScore",i)},expression:"miniTopic.fullScore"}})],1)]),i("div",{staticClass:"mini-question"},e._l(t.smQuestion,(function(n){return i("div",{key:n.alias,staticClass:"mini-question-item"},[i("div",{staticClass:"left"},[i("span",{staticClass:"number"},[e._v(e._s(n.alias))])]),i("div",{staticClass:"right"},[e._v(" 分数 "),i("el-input",{staticClass:"input-min_topic-number",attrs:{size:"mini",placeholder:""},on:{change:function(t){return e.checkScore(n,"score")},blur:function(i){return e.allAsk(t)}},model:{value:n.score,callback:function(t){e.$set(n,"score",t)},expression:"miniQuestion.score"}})],1)])})),0)])})),0)])},ot=[],rt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"subjectSelect"},[i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:this.tipsText,placement:"top"}},[i("i",{staticClass:"el-icon-warning-outline"})]),i("el-select",{staticClass:"select-subject",attrs:{size:"mini",placeholder:"请选择"},on:{change:e.subjectChange},model:{value:e.isSubject,callback:function(t){e.isSubject=t},expression:"isSubject"}},e._l(e.options,(function(e){return i("el-option",{key:e.id,attrs:{label:e.label,value:e.id}})})),1)],1)},st=[],at={name:"subjectSelect",components:{},filters:{},props:{subjectId:Number},data:function(){return{isSubject:12,options:[{label:"物理",id:12},{label:"化学",id:13},{label:"生物",id:14}],wenzong:[{label:"政治",id:15},{label:"历史",id:16},{label:"地理",id:17}],lizong:[{label:"物理",id:12},{label:"化学",id:13},{label:"生物",id:14}],tipsText:"请选择当前题目所属的学科,用以生成各科考试成绩"}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["subject"])),watch:{subjectId:function(e,t){t!=e&&(this.isSubject=this.subjectId)}},created:function(){19===this.subject?this.options=this.wenzong:18===this.subject&&(this.options=this.lizong),this.isSubject=this.subjectId},mounted:function(){},methods:{subjectChange:function(){this.$emit("subjectChange",this.isSubject)}}},lt=at,ct=(i("c29e"),Object(v["a"])(lt,rt,st,!1,null,"00f80942",null)),dt=ct.exports,ut={name:"MinTopicEditItem",components:{SubjectSelect:dt},filters:{},props:{minTopicData:Object,idx:Number},data:function(){return{}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["topicTypeObj","subject"])),{},{isSelectType:function(){return[1,2,11].includes(this.minTopicData.questionTypeId)},isMoreSelectType:function(){return[2,11].includes(this.minTopicData.questionTypeId)},hasSmQuestionTopic:function(){return[7,17,5].includes(this.minTopicData.questionTypeId)},isZongHe:function(){return[18,19].includes(this.subject)}}),watch:{},created:function(){this.minTopicData.smTopic&&this.minTopicData.smTopic.length>0&&this.allScore()},mounted:function(){},methods:{addMiniTopic:function(){this.minTopicData.smQuestion.length&&this.$message({message:"不能同时拥有小题和小问",type:"warning"}),this.minTopicData.smQuestion=[];var e={alias:this.minTopicData.topicNo+"."+(this.minTopicData.smTopic.length+1),hasSmQuestion:!1,score:"",fullScore:"",smQuestion:[],topicQues:"",topicEditorIndex:this.minTopicData.topicNo+"_"+(this.minTopicData.smTopic.length+1),questionTypeId:this.minTopicData.questionTypeId};this.minTopicData.fullScore="",this.minTopicData.smTopic.push(e)},addQuestion:function(e){var t=e.topicQues.replace(/[^0-9 .]/g,"");e.topicQues=Math.round(t),e.smQuestion=[];for(var i=0;i<e.topicQues;i++){var n={alias:e.alias+"("+(e.smQuestion.length+1)+")",score:""};e.smQuestion.push(n)}},topicTypeName:function(e){return this.topicTypeObj[e]},checkNumber:function(e,t){var i=e[t].replace(/[^0-9 .]/g,"");e[t]=Math.round(i)},allScore:function(){var e=0;this.minTopicData.smTopic.forEach((function(t){e+=Number(t.fullScore)})),this.minTopicData.fullScore=e},allAsk:function(e){var t=0;e.smQuestion.forEach((function(e){t+=Number(e.score)})),e.fullScore=t,this.minTopicData.smTopic.length>0&&this.allScore()},checkOptNumber:function(e,t){var i=e[t].replace(/[^0-9 .]/g,"");i=Math.round(i),i>7?i=7:i<2&&(i=2),e[t]=i},checkScore:function(e,t){var i=e[t].replace(/[^0-9 .]/g,"");e[t]=.5*Math.round(i/.5)||""},checkHalfScore:function(e,t,i){var n=e[t].replace(/[^0-9 .]/g,"");n=.5*Math.round(n/.5),e[t]=n>i-.5?i-.5:n},ChangeSubject:function(e){this.minTopicData.subject=e},changeTopicQues:function(e,t){!1===t?(e.topicQues="",e.smQuestion=[]):""!=e.topicQues&&void 0!=e.topicQues||(e.topicQues="2",this.addQuestion(e))},delMiniTopic:function(e){var t=this.minTopicData.smTopic.findIndex((function(t){return t.alias==e.alias}));this.minTopicData.smTopic.splice(t,1)}}},mt=ut,pt=(i("4fc7"),Object(v["a"])(mt,nt,ot,!1,null,"23bfd8ee",null)),ht=pt.exports,ft={name:"AddTopic",components:{MinTopicEditItem:ht,SubjectSelect:dt},filters:{},props:{subjectId:Number,isEdit:Boolean,editModelId:String},data:function(){return{bigQuestionNos:[],topicTypeOptions:[],topicConfigureData:{BigNo:"一",name:"",topicType:"",subject:12,direction:0,columns:1,rowLineHeight:40,scoreStyle:1,scoreLimit:15,hasHalfScore:!1,compositionNumber:800,compositionRows:10,topicTypeArr:[{startNo:"",endNo:"",optionsNumber:"",chooseOption:2,chooseSelectOption:1,score:"",halfScore:""}]},newTopicConfigureData:{BigNo:"一",name:"",topicType:"",subject:12,direction:0,columns:1,rowLineHeight:40,scoreStyle:1,scoreLimit:15,hasHalfScore:!1,compositionNumber:800,compositionRows:10,topicTypeArr:[{startNo:"",endNo:"",optionsNumber:"4",chooseOption:2,chooseSelectOption:1,score:"",halfScore:""}]},topicList:[],defaultTopicConfig:{startNo:"",endNo:"",optionsNumber:"",chooseOption:2,chooseSelectOption:1,score:"",halfScore:""},chooseOptions:[{label:"二",value:2},{label:"三",value:3},{label:"四",value:4}],chooseSelectOptions:[{label:"一",value:1}],defaultTopicItem:{isQuestion:!1,topicQues:"",score:""},columns:[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3}],lineHeights:[{label:"30px",value:30},{label:"35px",value:35},{label:"40px",value:40},{label:"45px",value:45},{label:"50px",value:50}],scoreOpt:[{label:"空白方框",value:1,disabled:!1},{label:"2/3/5",value:2,disabled:!1},{label:"2/3/4/6",value:3,disabled:!1},{label:"2/4",value:4,disabled:!1}],scoreMaxOptions:[{label:"上限15",value:15,disabled:!1},{label:"上限16",value:16,disabled:!1},{label:"上限29",value:29,disabled:!1},{label:"上限49",value:49,disabled:!1},{label:"上限69",value:69,disabled:!1}],topicNoArr:[],errMsg:"",isRunWatch:!0}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["topicTypes","subject","bigTopicArr","initPageFlag","cardSetting","bigTopicPageArr","chageSomePageIndex"])),{},{isSelectType:function(){return[1,2,11].includes(this.topicConfigureData.topicType)},isMoreSelectType:function(){return[2,11].includes(this.topicConfigureData.topicType)},isFillInBlank:function(){return 5===this.topicConfigureData.topicType},isAnswer:function(){return[7,17,77].includes(this.topicConfigureData.topicType)},isChooseAnswer:function(){return 17===this.topicConfigureData.topicType},isComposition:function(){return 77===this.topicConfigureData.topicType},isCompositionZH:function(){return 77===this.topicConfigureData.topicType&&9===this.subject},isCompositionEN:function(){return 77===this.topicConfigureData.topicType&&8===this.subject},hasSmQuestionTopic:function(){return[5,7,17].includes(this.topicConfigureData.topicType)},isZongHe:function(){return[18,19].includes(this.subject)}}),watch:{topicList:{handler:function(e){this.questionsChangeEdit(e)},deep:!0}},mounted:function(){this.getDefaultData()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setBigTopicArr:l["b"],setPaperListData:l["k"],setBigTopicPageArr:l["j"],setInitPageFlag:l["f"],setCardSetting:l["c"],setChangeSomePageIndex:l["d"]})),{},{trimLR:function(){this.topicConfigureData.name=this.topicConfigureData.name.replace(/\s/g,"")},getDefaultData:function(){var e=this;this.errMsg="",this.isEdit?(this.isRunWatch=!1,this.topicConfigureData=this.bigTopicArr[this.editModelId].topicConfigureData,this.topicList=this.bigTopicArr[this.editModelId].topicList):(this.topicConfigureData=JSON.parse(JSON.stringify(this.newTopicConfigureData)),this.topicList=[]),this.calcBigNo(),this.isEdit||(this.topicConfigureData.BigNo=this.bigQuestionNos[0].value,this.isZongHe?18===this.subject?this.topicConfigureData.subject=12:this.topicConfigureData.subject=15:this.topicConfigureData.subject=this.subject);var t=Object.values(this.bigTopicArr);this.topicNoArr=[],t.forEach((function(t){t.topicConfigureData.BigNo!=e.topicConfigureData.BigNo&&t.topicList.forEach((function(t){e.topicNoArr.push(t.topicNo)}))})),this.topicTypeOptions=[],this.topicTypes.forEach((function(t){3===e.subject?11!==t.value&&77!==t.value&&27!==t.value&&e.topicTypeOptions.push(t):8===e.subject||9===e.subject?2!==t.value&&27!==t.value&&e.topicTypeOptions.push(t):2!==t.value&&77!==t.value&&27!==t.value&&e.topicTypeOptions.push(t)}))},calcBigNo:function(){for(var e=[],t=1;t<100;t++){var i=Object(it["a"])(t);e.push({label:i,value:i})}var n=[];for(var o in this.bigTopicArr)n.push(this.bigTopicArr[o].topicConfigureData.BigNo);n.forEach((function(t){e.forEach((function(i,n){i.label==t&&e.splice(n,1)}))})),this.bigQuestionNos=e},addTopicType:function(){var e=JSON.parse(JSON.stringify(this.defaultTopicConfig));e.optionsNumber=e.optionsNumber||"4",this.topicConfigureData.topicTypeArr.push(e)},delTopicType:function(e){if(this.topicConfigureData.topicTypeArr.length>1)this.topicConfigureData.topicTypeArr.splice(e,1);else{var t=JSON.parse(JSON.stringify(this.defaultTopicConfig));this.topicConfigureData.topicTypeArr[0]=t}this.addTopicList(this.topicConfigureData)},setQuestionNum:function(e){var t=String(e).split("."),i=null,n=null,o=null,r=null;return 1==t.length?r=t[0]:(1==t[0].length||3==t[0].length?i=1==t[0].length?999+t[0]:t[0]:2==t[0].length&&(i=t[0].includes("0")?t[0]:t[0].substring(0,1)),n=t[0],o=t[1],r=i+n+o),parseInt(r)},addTopicList:function(e){var t=this;if(!this.addTopicListDataVerification(e))return this.topicList=[],!1;var i=this;this.topicList=[];var n={};this.isSelectType&&(n={optionsCount:e.optionsNumber},this.isMoreSelectType&&(n.halfScore=e.halfScore)),e.topicTypeArr.forEach((function(o){if(Number(o.startNo)<1)return!1;t.isSelectType&&(n={optionsCount:o.optionsNumber},t.isMoreSelectType&&(n.halfScore=o.halfScore));for(var r=17==e.topicType?o.chooseOption:Number(o.endNo)-Number(o.startNo)+1,a=0;a<r;a++){var l=Object(s["a"])({alias:Number(o.startNo)+a,answer:"",fullScore:o.score,markQuestionType:5,markType:"0",questionNo:Number(o.startNo)+a,topicNo:Number(o.startNo)+a,questionTypeId:e.topicType,questionTypeText:"",score:o.score,subject:i.subject,smTopic:[],smQuestion:[],hasSmQuestion:!1,topicQues:""},n);i.isZongHe&&(17!==e.topicType?18==i.subject?l.subject=12:l.subject=15:l.subject=e.subject),l.questionTypeText=i.getTopicTypeText(e.topicType),i.topicList.push(l)}}))},addTopicListDataVerification:function(e){var t=this,i=this,n=[];if(e.topicTypeArr.forEach((function(o){if(""==o.endNo)return n.push("题号格式错误"),!1;var r=Number(o.startNo),s=Number(o.endNo);if(r<1)return o.startNo="",n.push("题号格式错误"),!1;var a=t.topicNoArr.includes(r);if(a)return i.errMsg="题号格式错误",n.push("题号格式错误"),!1;if(s<r)return i.errMsg="题号格式错误",n.push("题号格式错误"),!1;var l=t.topicNoArr.includes(s);if(l)return o.endNo="",i.errMsg="题号格式错误",n.push("题号格式错误"),!1;var c=Number(o.endNo)-Number(o.startNo)+1;if(17===e.topicType&&c!==o.chooseOption)return o.endNo="",i.errMsg="题号格式错误",n.push("题号格式错误"),!1;for(var d=[],u=r;u<r+c;u++)d.push(u);for(var m=function(e){i.topicNoArr.forEach((function(t){if(t==d[e])return o.startNo="",o.endNo="",i.errMsg="题号格式错误",n.push("题号格式错误"),!1}))},p=0;p<d.length;p++)m(p)})),e.topicTypeArr.length>1){var o=[];if(e.topicTypeArr.forEach((function(e){for(var t=Number(e.startNo),i=Number(e.endNo),n=i-t+1,r=t;r<t+n;r++)o.push(r)})),Object(it["c"])(o))return i.errMsg="题号格式错误",n.push("题号格式错误"),!1}return 0===n.length&&(i.errMsg="",!0)},getTopicTypeText:function(e){var t="";return this.topicTypes.forEach((function(i){e==i.value&&(t=i.label)})),t},cancel:function(){this.$emit("cancel",!1)},saveBigTopicVerification:function(){var e=this;if(""==this.topicConfigureData.name)return this.$message.error("大题名称不能为空!"),!1;if(""==this.topicConfigureData.topicType)return e.errMsg="题型没有选择",!1;if(0==this.topicList.length)return e.errMsg="试题数量不能为空",!1;var t=!1;if(this.topicList.forEach((function(e){""!=e.fullScore&&0!=e.fullScore||(t=!0)})),t)return e.errMsg="分数设置不正确",!1;var i=!1;return this.topicList.forEach((function(t){var n=0;if([1,2,11].includes(t.questionTypeId)&&Number(t.optionsCount)<2)return e.errMsg="选项设置错误",i=!0,!1;if(t.smQuestion.length>0){var o=0;if(t.smQuestion.forEach((function(t){if(Number(t.score)<1)return e.errMsg="小问分数设置错误",i=!0,!1;o=Number(o)+Number(t.score)})),Number(t.fullScore)!==Number(o))return e.errMsg="小问分数设置错误",i=!0,!1}return t.smTopic.length>0&&(t.smTopic.forEach((function(t){if(Number(t.fullScore)<1)return e.errMsg="小问分数设置错误",i=!0,!1;if(n+=Number(t.fullScore),t.smQuestion.length>0){var o=0;if(t.smQuestion.forEach((function(t){if(Number(t.fullScore)<1)return e.errMsg="小问分数设置错误",i=!0,!1;o+=Number(t.score)})),Number(t.fullScore)!==Number(o))return e.errMsg="小问分数设置错误",i=!0,!1}})),Number(t.fullScore)!==Number(n))?(e.errMsg="小题分数设置错误",i=!0,!1):void 0})),!i&&(e.errMsg="",!0)},save:function(){var e,t=this;if(!this.saveBigTopicVerification())return!1;var i=0;if(this.isEdit)i=this.editModelId;else if(i="modelId",0==Object.keys(this.bigTopicArr).length){var n=Object.keys(this.bigTopicArr).length;i="modelId"+ ++n}else{var o=Object.keys(this.bigTopicArr).sort().pop();i="modelId"+(Number(o.replace(/[^0-9]/gi,""))+1)}var s=this.bigTopicArr;s[i]={modelId:i,bigTitle:this.topicConfigureData.BigNo+"、"+this.topicConfigureData.name,subtitle:"",questionTypeId:this.topicConfigureData.topicType,topicConfigureData:this.topicConfigureData,topicList:this.topicList,questions:[]},s[i].questions=this.formatTopicList();var a=JSON.parse(JSON.stringify(s[i]));this.setBigTopicArr(JSON.parse(JSON.stringify(s)));var l=[];l=(e=l).concat.apply(e,Object(r["a"])(Object.values(s))),l.forEach((function(e){if(e.modelId==i&&17===e.questionTypeId){var t=JSON.parse(JSON.stringify(e.questions)),n=t[0];if(n.contentHtml=t[0].alias+"~"+t[t.length-1].alias+"、",e.topicConfigureData.topicTypeArr[0].chooseSelectOption>1){e.questions=[];for(var o=0;o<e.topicConfigureData.topicTypeArr[0].chooseSelectOption;o++){var r=JSON.parse(JSON.stringify(n));r.ChooseArea=o+1,e.questions.push(r)}}else n.ChooseArea=1,e.questions=[n];a=e}})),this.setPaperListData(l);var c=0;if(l.forEach((function(e){e.questions.forEach((function(e){c+=e.fullScore}))})),this.cardSetting.examInfoConfig.forEach((function(e){1===e.id&&(e.text=c)})),this.isEdit){var d=0;this.bigTopicPageArr.forEach((function(e,t){e.forEach((function(n,o){n.modelId==i&&(n.isLast?e.splice(o,1):(e.fill(a,o,o+1),d=t))}))})),this.setSomePageReset(d,!1,this.bigTopicPageArr)}else{var u=this.bigTopicPageArr.length;this.bigTopicPageArr[u-1].push(a),this.setBigTopicPageArr(this.bigTopicPageArr),this.$nextTick((function(){t.setChangeSomePageIndex({index:u-1,isToCurPage:!1,flag:!t.chageSomePageIndex.flag})}))}this.cancel()},formatTopicList:function(){var e=this,t=[];return this.topicList.forEach((function(i,n){if(e.hasSmQuestionTopic)if(i.smTopic.length>0)i.smTopic.forEach((function(n){var o={questionNum:e.setQuestionNum(n.alias),questionTypeId:77===n.questionTypeId?7:n.questionTypeId,markType:77===n.questionTypeId?4:0,fullScore:n.fullScore,optionCount:n.optionsCount,answer:"",subject:i.subject,alias:n.alias,scores:"",TopicAreaHeight:200,contentHtml:n.alias+"、",cutId:1,isShowArticleCn:!0,startPositionNumber:1,endPositionNumber:e.topicConfigureData.compositionNumber};n.smQuestion.length&&(o.scores=n.smQuestion.map((function(e){return e.score})).join(",")),t.push(o)}));else{var o={questionNum:e.setQuestionNum(i.alias),questionTypeId:77===i.questionTypeId?7:i.questionTypeId,markType:77===i.questionTypeId?4:0,fullScore:i.fullScore,optionCount:i.optionsCount,answer:"",subject:i.subject,alias:i.alias,scores:"",TopicAreaHeight:200,contentHtml:i.alias+"、",cutId:1,isShowArticleCn:!0,startPositionNumber:1,endPositionNumber:e.topicConfigureData.compositionNumber};17===i.questionTypeId&&(o.isChooseTopicFirst=0===n),o.scores=i.smQuestion.map((function(e){return e.score})).join(","),t.push(o)}else{var r={questionNum:e.setQuestionNum(i.alias),questionTypeId:77===i.questionTypeId?7:i.questionTypeId,markType:77===i.questionTypeId?4:0,fullScore:i.fullScore,optionCount:i.optionsCount,answer:"",subject:i.subject,alias:i.alias,scores:"",TopicAreaHeight:200,contentHtml:i.alias+"、",cutId:1,isShowArticleCn:!0,startPositionNumber:1,endPositionNumber:e.topicConfigureData.compositionNumber};if(77===e.topicConfigureData.topicType&&9===e.subject&&(r.TopicAreaHeight=30),77===e.topicConfigureData.topicType&&8===e.subject){for(var s="",a=0;a<e.topicConfigureData.compositionRows;a++){var l=0===a?'<p class="horizontal-line">'+i.alias+"、</p>":'<p class="horizontal-line"></p>';s+=l}s+="<p></p>",r.contentHtml=s}2!==e.topicConfigureData.topicType&&11!==e.topicConfigureData.topicType||(r.halfScore=i.halfScore),t.push(r)}})),t},setSomePageReset:function(e,t,i){var n=this,o=JSON.parse(JSON.stringify(i)).splice(0,e),r=Object(c["a"])(JSON.parse(JSON.stringify(i)).splice(e),!1,!0);if(o.push(r),e==o.length-1&&1==o[e].length&&(!o[e][0].questions||0==o[e][0].questions.length))return o.pop(),void this.setBigTopicPageArr(o);this.setBigTopicPageArr(o),this.$nextTick((function(){n.setChangeSomePageIndex({index:e,isToCurPage:!0,flag:!n.chageSomePageIndex.flag})}))},questionsChangeEdit:function(e){var t=this,i=[];if(e.forEach((function(e){i.push(e.fullScore),t.isMoreSelectType&&e.halfScore>Number(e.fullScore)-.5&&(Number(e.fullScore)>0?e.halfScore=e.fullScore-.5:(e.halfScore="",e.fullScore=""))})),5===this.topicConfigureData.topicType){if(this.scoreOpt.forEach((function(e){var t=!0;if(e.value>1)for(var n=0;n<i.length;n++)-1==e.label.indexOf(i[n])&&(t=!1),""==e.label&&(t=!0);e.disabled=!t})),this.isRunWatch){for(var n=0;n<this.scoreOpt.length;n++)if(!this.scoreOpt[n].disabled){this.topicConfigureData.scoreStyle=this.scoreOpt[n].value;break}""!=this.topicConfigureData.scoreStyle&&this.scoreOpt.forEach((function(e){e.value===t.topicConfigureData.scoreStyle&&e.disabled&&(t.topicConfigureData.scoreStyle="")}))}}else if(this.isAnswer){var o=Math.max.apply(Math,i);this.scoreMaxOptions.forEach((function(e){e.value<o?e.disabled=!0:e.disabled=!1,"77"==t.topicConfigureData.topicType?16!==e.value&&49!==e.value||(e.disabled=!0):69===e.value&&(e.disabled=!0)}));var r=[];this.scoreMaxOptions.forEach((function(e){(e.value>o||e.value==o)&&r.push(e)})),this.isRunWatch&&(this.topicConfigureData.scoreLimit=r[0].value),this.isRunWatch||(this.isRunWatch=!0)}},checkNumber:function(e,t){var i=/^([1-9]\d*|[0]{1,1})$/;i.test(e[t])?this.$nextTick((function(){var i=Math.min(e[t],200);e[t]=i})):e[t]=""},checkOptNumber:function(e,t){var i=e[t].replace(/[^0-9 .]/g,"");i=Math.round(i),i>7?i=7:i<2&&(i=2),e[t]=i},checkScore:function(e){var t=e.score.replace(/[^0-9 .]/g,"");e.score=.5*Math.round(t/.5)||""},checkHalfScore:function(e){var t=e.halfScore.replace(/[^0-9 .]/g,"");t=.5*Math.round(t/.5),t>e.score-.5?e.halfScore=e.score-.5:e.halfScore=t},ChooseChangeSubject:function(e){this.topicConfigureData.subject=e,this.addTopicList(this.topicConfigureData)}})},gt=ft,bt=(i("6a1b"),Object(v["a"])(gt,et,tt,!1,null,"f097a990",null)),vt=bt.exports,yt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"article-chinese",style:{padding:e.rectPadding/2+"px"}},[i("svg",{staticClass:"article-svg",style:{height:e.totalRowsArr.length/2*(e.squareSize.h+10)-e.squareSize.h-10+"px"},attrs:{xmlns:"http://www.w3.org/2000/svg",version:"1.1"}},[i("rect",{ref:"rect",staticClass:"article-rect",attrs:{width:"100%",height:"100%"}}),e._l(e.textArr,(function(t,n){return i("text",{key:"text_"+n,attrs:{x:t.x,y:t.y,fill:"#000"}},[e._v(e._s(t.count))])})),e._l(e.totalRowsArr,(function(t,n){return i("line",{directives:[{name:"show",rawName:"v-show",value:n!=e.totalRowsArr.length-1,expression:"index!=totalRowsArr.length-1"}],key:"total_"+n,staticStyle:{stroke:"rgb(0,0,0)","stroke-width":"0.8"},attrs:{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}})})),e._l(e.lineArr,(function(e,t){return i("line",{key:t,staticStyle:{stroke:"rgb(0,0,0)","stroke-width":"0.8"},attrs:{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}})}))],2)])},Ct=[],xt={name:"ArticleCh",mixins:[ce["a"]],props:{wordsCountCh:{type:Object,default:function(){return{start:1,end:1}}},pageIndex:Number},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["squareSize"])),data:function(){return{svgWidth:0,lineArr:[],totalRowsArr:[],textArr:[],rectPadding:0,isMounted:!1}},methods:{startX:function(){var e=parseInt(this.svgWidth/this.squareSize.w);if(e<1)return!1;this.rectPadding=this.svgWidth-this.squareSize.w*e;var t=Math.ceil((this.wordsCountCh.end-this.wordsCountCh.start+1)/e);this.totalRowsArr=[];for(var i=0;i<t+1;i++)this.totalRowsArr.push({x1:0,y1:i*(this.squareSize.h+10)-10,x2:this.svgWidth,y2:i*(this.squareSize.h+10)-10}),this.totalRowsArr.push({x1:0,y1:i*(this.squareSize.h+10),x2:this.svgWidth,y2:i*(this.squareSize.h+10)});for(var n=0;n<e*t;n++)if(this.lineArr.push({x1:parseInt(n%e)*this.squareSize.w,y1:0===n?parseInt(n/e)*this.squareSize.h:parseInt(n/e)*(this.squareSize.h+10),x2:parseInt(n%e)*this.squareSize.w,y2:0===n?parseInt(n/e)*this.squareSize.h+this.squareSize.h:parseInt(n/e)*(this.squareSize.h+10)+this.squareSize.h}),(n+this.wordsCountCh.start)%100==0){var o=void 0,r=void 0;o=n%e*this.squareSize.w,r=Math.ceil(n/e)*(this.squareSize.h+10),this.textArr.push({x:o,y:r,count:n+this.wordsCountCh.start})}}},mounted:function(){var e=document.querySelectorAll(".card_edit-wrap")[0],t=Array.from(e.querySelectorAll(".article-chinese"));this.cardSetting.hasBindingLine?this.pageIndex==this.bigTopicPageArr.length-1?this.svgWidth=t[t.length-1].offsetWidth:(this.pageIndex,this.svgWidth=t[0].offsetWidth):this.svgWidth=document.querySelector(".article-chinese").offsetWidth,this.isMounted=!0,this.startX()}},wt=xt,Tt=(i("8ccd"),Object(v["a"])(wt,yt,Ct,!1,null,"28fbf992",null)),Nt=Tt.exports,St={name:"TopicExplain",props:{topicInfo:{type:Object,default:function(){return[]}},setConfig:{type:Object,default:function(){return{}}},pageIndex:{type:Number,default:null}},components:{UeCard:Ze,AddTopic:vt,ArticleCh:Nt},data:function(){return{showUeTitle:!1,dialogVisibleIsAddTopic:!1,TopicAreaHeight:200,modelId:"",isMove:!1,bit:[0,1,2,3,4,5,6,7,8,9],scoreLimitMap:{16:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16],15:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],29:{tenPlace:[1,2]},49:{tenPlace:[1,2,3,4]},69:{tenPlace:[1,2,3,4,5,6]}},scoreLimitMapArr:[15,16,29,49],noScoringW:48,ChooseOptData:[],topicSetDialog:!1,form:{scoreBoxCount:15,halfScore:!1,scoreBoxArr:[{id:15,label:"上限15分"},{id:16,label:"上限16分"},{id:29,label:"上限29分"},{id:49,label:"上限49分"}]}}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["bigTopicArr","bigTopicPageArr","paperListData","initPageFlag","paperSource","cardSetting","chageSomePageIndex","isExplainMove","changeUeReadyHeightArr"])),{},{topicScore:function(){var e=0,t=Number(this.topicInfo.fullScore),i=!1;1===this.paperSource?(e=this.topicInfo.scoreLimit,i=1==this.topicInfo.point):(e=this.setConfig.topicConfigureData.scoreLimit,i=this.setConfig.topicConfigureData.hasHalfScore);var n=[];if(e<17)if(t>15)n=this.scoreLimitMap[e];else for(var o=0;o<t+1;o++)n.push(o);else n.push("十位"),n=n.concat(this.scoreLimitMap[e].tenPlace),n.push("个位"),n=n.concat(this.bit);return i&&n.push("0.5"),n},isShowNoScoring:function(){var e=0,t=this.topicInfo.fullScore;return e=1===this.paperSource?this.topicInfo.scoreLimit:this.setConfig.topicConfigureData.scoreLimit,e<17&&t<e},isArticleChOver:function(){return this.topicInfo.TopicAreaHeight<1&&77===this.setConfig.questionTypeId&&9===this.topicInfo.subject},setWordsCountCh:function(){return{start:this.topicInfo.startPositionNumber||1,end:this.topicInfo.endPositionNumber}}}),watch:{topicInfo:{handler:function(){this.getDefaultData()},deep:!0}},created:function(){this.form.scoreBoxCount=this.topicInfo.scoreLimit,this.form.halfScore=1==this.topicInfo.point,this.getDefaultData()},mounted:function(){this.setNoScoringW()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setBigTopicArr:l["b"],setPaperListData:l["k"],setBigTopicPageArr:l["j"],setInitPageFlag:l["f"],setChangeSomePageIndex:l["d"],setExplainMove:l["h"],setChangeUeReadyHeight:l["e"]})),{},{confirm:function(){this.topicSetDialog=!1,1==this.paperSource&&(this.topicInfo.scoreLimit=this.form.scoreBoxCount,this.topicInfo.point=this.form.halfScore?1:0)},mouseEvent:function(e){this.isExplainMove||(this.showUeTitle=0!==e)},cancel:function(){this.topicSetDialog=!1},getDefaultData:function(){this.TopicAreaHeight=this.topicInfo.TopicAreaHeight,17==this.setConfig.questionTypeId&&this.getChooseOptData()},getChooseOptData:function(){this.ChooseOptData=[];for(var e=this.setConfig.topicConfigureData.topicTypeArr[0].chooseOption,t=0;t<e;t++){var i=String.fromCharCode(65+t);this.ChooseOptData.push(i)}},setNoScoringW:function(){if(void 0===this.$refs.topicModule)return!1;var e=this.$refs.topicModule.offsetWidth;this.noScoringW=(16-this.topicInfo.fullScore)*(e/18),this.noScoringW<48&&(this.noScoringW=48)},setTopicAreaHeight:function(){var e=this;this.TopicAreaHeight=this.$refs.ueCard.ue.body.scrollHeight,this.topicInfo.TopicAreaHeight!=this.TopicAreaHeight&&(this.topicInfo.TopicAreaHeight=this.TopicAreaHeight+16,setTimeout((function(){e.setSomePageReset()}),500))},setSomePageReset:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=JSON.parse(JSON.stringify(this.bigTopicPageArr)).splice(0,this.pageIndex),n=Object(c["a"])(JSON.parse(JSON.stringify(this.bigTopicPageArr)).splice(this.pageIndex),!1,!0);if(i.push(n),this.pageIndex==i.length-1&&1==i[this.pageIndex].length&&(!i[this.pageIndex][0].questions||0==i[this.pageIndex][0].questions.length))return i.pop(),void this.setBigTopicPageArr(i);this.setBigTopicPageArr(i),this.$nextTick((function(){e.setChangeSomePageIndex({index:e.pageIndex,isToCurPage:t,flag:!e.chageSomePageIndex.flag})}))},moveTopicAreaHeight:function(e){var t=this,i=[],n=0;this.$refs.ueCard.ue.body.querySelectorAll("img").forEach((function(e){-1===e.className.indexOf("mathType")&&i.push(e.offsetTop+e.offsetHeight)})),this.$refs.ueCard.ue.body.querySelectorAll("p").forEach((function(e){n=e.offsetHeight+n}));var o=Math.max.apply(Math,i),r=o>n?o:n;r<20&&(r=20);var s=t.TopicAreaHeight,a=e.pageY,l=0;this.isMove=!0,this.setExplainMove(this.isMove),document.addEventListener("mousemove",(function(e){if(t.isMove){l=e.pageY-a;var i=s+l;t.TopicAreaHeight=i>r?i:r}}),!0),document.addEventListener("mouseup",this.stopMoveTopicAreaHeight,!1)},stopMoveTopicAreaHeight:function(){this.isMove=!1,this.setExplainMove(this.isMove),this.topicInfo.TopicAreaHeight=this.TopicAreaHeight,this.setSomePageReset(!0),document.removeEventListener("mouseup",this.stopMoveTopicAreaHeight,!1)},handleCloseAddTopic:function(){this.dialogVisibleIsAddTopic=!1},showEditBigTopic:function(){if(0===this.paperSource)return this.modelId=this.setConfig.modelId,void(this.dialogVisibleIsAddTopic=!0);this.topicSetDialog=!0},editTopicData:function(){var e,t=this,i=[],n=0,o="";this.bigTopicPageArr.forEach((function(e){e.forEach((function(e){t.setConfig.modelId===e.modelId&&e.questions.forEach((function(e){e.alias===t.topicInfo.alias&&i.push(e)}))}))})),i.forEach((function(e){n+=e.TopicAreaHeight,o+=e.contentHtml}));var s=JSON.parse(JSON.stringify(this.bigTopicArr));s[this.setConfig.modelId].questions.forEach((function(e){e.alias===t.topicInfo.alias&&(e.TopicAreaHeight=n,e.contentHtml=o)}));var a=[];a=(e=a).concat.apply(e,Object(r["a"])(Object.values(this.bigTopicArr))),this.setBigTopicPageArr([Object(r["a"])(JSON.parse(JSON.stringify(a)))]),this.setInitPageFlag(!this.initPageFlag)},delTopicOver:function(){var e=this,t=this.setConfig.questions.findIndex((function(t){return t.alias==e.topicInfo.alias}));if(""!=this.topicInfo.contentHtml)if(t>0)this.setConfig.questions[t-1].contentHtml=this.setConfig.questions[t-1].contentHtml+this.topicInfo.contentHtml;else{var i=this.bigTopicPageArr[this.pageIndex-1].length-1;this.bigTopicPageArr[this.pageIndex-1][i].contentHtml=this.bigTopicPageArr[this.pageIndex-1][i].contentHtml+this.topicInfo.contentHtml}this.setConfig.questions.splice(t,1),this.setSomePageReset()},ueReady:function(){this.TopicAreaHeight=this.$refs.ueCard.ue.body.scrollHeight,this.topicInfo.TopicAreaHeight!=this.TopicAreaHeight&&(this.topicInfo.TopicAreaHeight=this.TopicAreaHeight+16,this.changeUeReadyHeightArr.push(this.pageIndex),this.setChangeUeReadyHeight(this.changeUeReadyHeightArr))},getAnswerMinScoreLimit:function(e){for(var t,i=16,n=0;t=this.scoreLimitMapArr[n++];)if(t>=e){i=t;break}return i},ueBlur:function(){this.setTopicAreaHeight(),this.$emit("ueBlur",!0)},delTopic:function(){var e=this,t=this;this.$confirm("确定要删除当前题目吗?","提示",{cancelButtonText:"取消",confirmButtonText:"确定",callback:function(i){if("confirm"==i){var n=Object(c["a"])(e.bigTopicPageArr),o=0;n.forEach((function(e,i){if(e.modelId==t.setConfig.modelId){var r=e.questions.findIndex((function(e){return e.alias==t.topicInfo.alias}));e.questions.splice(r,1),0===e.questions.length&&n.splice(i,1)}e.questions.forEach((function(e){o+=e.fullScore}))})),e.cardSetting.examInfoConfig.forEach((function(e){1===e.id&&(e.text=o)}));var r=JSON.parse(JSON.stringify(e.bigTopicArr)),s=r[e.setConfig.modelId].questions.findIndex((function(e){return e.alias==t.topicInfo.alias}));if(r[e.setConfig.modelId].questions.splice(s,1),r[e.setConfig.modelId].topicList.forEach((function(i,n){var o=String(t.topicInfo.alias).indexOf(".");o>-1?i.smTopic.forEach((function(o,s){o.alias==t.topicInfo.alias&&(i.smTopic.splice(s,1),0==i.smTopic.length&&r[e.setConfig.modelId].topicList.splice(n,1))})):i.alias==t.topicInfo.alias&&r[e.setConfig.modelId].topicList.splice(n,1)})),0==r[e.setConfig.modelId].questions.length)delete r[e.setConfig.modelId];else if(17==r[e.setConfig.modelId].questionTypeId)delete r[e.setConfig.modelId];else{var a=t.topicInfo.alias,l=parseInt(t.topicInfo.alias),d=r[e.setConfig.modelId].topicConfigureData.topicTypeArr,u=[];r[e.setConfig.modelId].questions.forEach((function(e){u.push(parseInt(e.alias))}));var m=u.indexOf(l);-1==m&&d.forEach((function(e,t){if(l==e.startNo||l==e.endNo)e.startNo==e.endNo?d.length>1?d.splice(t,1):(d[t].startNo="",d[t].endNo=""):l==e.startNo?e.startNo=Number(e.startNo)+1:e.endNo=Number(e.endNo)-1;else if(l>e.startNo&&l<e.endNo){var i=JSON.parse(JSON.stringify(e));1==u.length?(e.endNo=u[0],e.startNo=u[0]):1==parseInt(a)?e.startNo=u[0]:(e.endNo=parseInt(Number(a))-1,i.startNo=parseInt(Number(a))+1,d.splice(t+1,0,i))}}))}e.setBigTopicArr(r),e.setBigTopicPageArr([n]),e.setInitPageFlag(!e.initPageFlag),e.$message({type:"info",message:"删除成功"})}}})},arrayUnique:function(e){for(var t={},i=[],n=0;n<e.length;n++)t[e[n]]||(t[e[n]]=!0,i.push(e[n]));return i}})},Et=St,Ut=(i("3004"),Object(v["a"])(Et,Ve,We,!1,null,"880f498c",null)),_t=Ut.exports,kt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"topic topic-box-border",style:{"line-height":(e.topicContent.rowLineHeight||30)+"px","font-size":(e.topicContent.fontSizeCount||14)+"px"}},[i("div",{staticClass:"btn-paper-info iconfont iconedit",on:{click:function(t){e.topicSetDialog=!0}}}),e.topicContent.isOnlyShowOption?e._e():i("div",{staticClass:"title",style:{"line-height":(e.topicContent.rowLineHeight||30)+"px"}},[i("span",{staticClass:"topic-no"},[e._v(e._s(e.topicContent.alias)+"、")]),i("div",{staticClass:"title-content",domProps:{innerHTML:e._s(e.topicContent.queBody)}})]),[1,2,11].includes(e.topicContent.questionTypeId)&&e.topicContent.queOptions.length>0?i("ol",{staticClass:"options"},e._l(e.topicContent.queOptions,(function(t,n){return i("li",{key:n,class:["option-item","option-"+n,"list-style-"+e.topicContent.listType]},[i("span",{staticClass:"options-words"},[e._v(e._s(e.words[t.index])+".")]),i("span",{domProps:{innerHTML:e._s(t.content)}})])})),0):e._e(),i("el-dialog",{attrs:{title:"设置",visible:e.topicSetDialog,"close-on-click-modal":!1,"close-on-press-escape":!1,"show-close":!1,width:"30%",center:""},on:{"update:visible":function(t){e.topicSetDialog=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,"label-width":"100px"}},[[1,2,11].includes(e.topicContent.questionTypeId)?i("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.topicContent.queOptions,expression:"topicContent.queOptions"}],attrs:{label:"选项每行列数"}},[i("el-select",{attrs:{placeholder:"请选择选项每行列数"},model:{value:e.form.columnCount,callback:function(t){e.$set(e.form,"columnCount",t)},expression:"form.columnCount"}},e._l(e.form.columnCountArr,(function(e){return i("el-option",{key:e.id,attrs:{value:e.id,label:e.label}})})),1)],1):e._e(),i("el-form-item",{attrs:{label:"行间距"}},[i("el-select",{attrs:{placeholder:"请选择行间距"},model:{value:e.form.rowLineHeight,callback:function(t){e.$set(e.form,"rowLineHeight",t)},expression:"form.rowLineHeight"}},e._l(e.form.rowHieightArr,(function(e){return i("el-option",{key:e,attrs:{value:e,label:e+"px"}})})),1)],1),i("el-form-item",{attrs:{label:"字体大小"}},[i("el-select",{attrs:{placeholder:"请选择字体大小"},model:{value:e.form.fontSizeCount,callback:function(t){e.$set(e.form,"fontSizeCount",t)},expression:"form.fontSizeCount"}},e._l(e.form.fontSizeArr,(function(e){return i("el-option",{key:e,attrs:{value:e,label:e+"px"}})})),1)],1)],1),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},At=[],It={name:"Topic",data:function(){return{topicSetDialog:!1,fillSetting:{columnCount:1,rowLineHeight:30,fontSizeCount:12},form:{columnCount:0,rowLineHeight:30,fontSizeCount:12,columnCountArr:[{id:0,label:1,num:0},{id:2,label:2,num:2},{id:1,label:4,num:1}],rowHieightArr:[25,30,35,40,45,50],fontSizeArr:[12,14,16,18]},words:["A","B","C","D","E","F","G","H","I","J","K","L","M"]}},props:{topicContent:{type:Object,default:function(){return{}}}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["paperSource","bigTopicPageArr","initPageFlag"])),mounted:function(){this.initTopic()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setBigTopicPageArr:l["j"],setInitPageFlag:l["f"]})),{},{initTopic:function(){this.form.columnCount=this.topicContent.listType,this.form.rowLineHeight=this.topicContent.rowLineHeight||30,this.form.fontSizeCount=this.topicContent.fontSizeCount||14},confirm:function(){var e=this;this.topicSetDialog=!1;var t=Object(c["a"])(this.bigTopicPageArr);t.forEach((function(t){t.questionTypeId==e.topicContent.questionTypeId&&t.isQuestionText&&t.questions.forEach((function(i,n){if(i.questionNum==e.topicContent.questionNum){var o=e.form.columnCountArr.findIndex((function(t){return t.id==e.form.columnCount}));t.questions[n].listType=e.form.columnCountArr[o].num,t.questions[n].rowLineHeight=e.form.rowLineHeight,t.questions[n].fontSizeCount=e.form.fontSizeCount}}))})),this.setBigTopicPageArr([t]),this.setInitPageFlag(!this.initPageFlag)},cancel:function(){this.topicSetDialog=!1}})},Bt=It,Ot=(i("648b"),Object(v["a"])(Bt,kt,At,!1,null,"25803e6b",null)),Dt=Ot.exports,Lt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"choose-topic"},e._l(e.topic,(function(t){return i("div",{key:t.alias,staticClass:"title"},[i("span",{staticClass:"topic-no"},[e._v(e._s(t.alias)+"、")]),i("div",{staticClass:"title-content clearfix",domProps:{innerHTML:e._s(t.queBody)}})])})),0)},Pt=[],Rt={name:"ChooseTopic",components:{},filters:{},props:{topic:Array},data:function(){return{}},computed:{},watch:{},created:function(){},mounted:function(){},methods:{}},Ht=Rt,qt=(i("a347"),Object(v["a"])(Ht,Lt,Pt,!1,null,"312c12a8",null)),Mt=qt.exports,jt={name:"PaperTopic",components:{TopicTitle:Ie,TopicChoice:He,TopicFill:ze,TopicExplain:_t,Topic:Dt,ChooseTopic:Mt},props:{content:{type:Array,default:function(){return[]}}},computed:Object(s["a"])({},Object(a["b"])("answerSheet",["answerCardType","subject","paperSource","bigTopicArr"])),methods:{setTopicTitle:function(e){var t=e.bigTitle,i="";return 1!=this.paperSource||e.isQuestionText||(i=e.subtitle),{topicTitleText:t,topicSubTitleText:i}}}},$t=jt,Ft=Object(v["a"])($t,Ne,Se,!1,null,null,null),zt=Ft.exports,Vt={name:"PaperContent",components:{PaperInfo:Te,PaperTopic:zt},props:{PaperLineFlag:{type:Number,default:0},pageIndex:{type:Number,default:null},paperColumn:{type:Number,default:null}},data:function(){return{}}},Wt=Vt,Jt=(i("1f9f"),Object(v["a"])(Wt,q,M,!1,null,"32ce722d",null)),Qt=Jt.exports,Xt={name:"PaperIndex",components:{PaperLine:H,PaperContent:Qt},mixins:[ce["a"]],props:{pageIndex:{type:Number,default:null},totalPageNum:{type:Number,default:null},content:{type:Array,default:function(){return[]}}}},Yt=Xt,Gt=(i("8fd5"),Object(v["a"])(Yt,I,B,!1,null,"f3de01f0",null)),Kt=Gt.exports,Zt={name:"AnswerSheet",components:{Setting:A,Paper:Kt,AddTopic:vt},mixins:[d],data:function(){return{cardType:0,dialogVisibleIsAddTopic:!1,grade:1,TopicsData:{card_status:0,printClassStatus:0},isEdit:!1,editNo:"",paperData:[],cardSettings:{paperSize:5,direction:1,column:2,hasBindingLine:0,hasPaperMsg:!0,examinationNumberType:[1,2],useQrCode:!1,title:"",examInfoConfig:[{id:0,name:"时间",isShow:!0,text:"100",units:"分钟"},{id:1,name:"满分",isShow:!0,text:"",units:"分"},{id:2,name:"命卷人",isShow:!0,text:"",units:""},{id:3,name:"审核人",isShow:!0,text:"",units:""}],cardStatus:0,cardLength:9,examStatus:0,grade:1,examGroupId:0},editType:0,scoreLimitMapArr:[15,16,29,49]}},computed:Object(s["a"])(Object(s["a"])({},Object(a["b"])("answerSheet",["cardSetting","bigTopicArr","paperListData","topicTypes","bigTopicPageArr","initPageFlag","paperSource","isPreviewBack","testFormData"])),{},{answerSheetHeight:function(){return window.innerHeight}}),mounted:function(){this.getDefaultData()},methods:Object(s["a"])(Object(s["a"])({},Object(a["c"])("answerSheet",{setCardSetting:l["c"],setBigTopicArr:l["b"],setPaperListData:l["k"],setBigTopicPageArr:l["j"],setAnswerCardType:l["a"],setPaperSource:l["l"],setInitPageFlag:l["f"],setTestFormData:l["n"],setSubject:l["m"],setIsPreviewBack:l["i"],setIsAnswerCardTypeChange:l["g"]})),{},{getDefaultData:function(){var e=this;if(this.isPreviewBack)return this.setIsPreviewBack(!1),!1;if(this.cardSettings=this.cardSetting,this.cardSettings.examGroupId=this.$route.query.exam_group_id,this.cardType=Number(this.$route.query.card_type),this.editType=this.$route.query.editType,void 0===this.cardType)return this.$message.error("无法获取答题卡类型!"),!1;if(void 0===this.cardSettings.examGroupId)return this.$message.error("无法获取考试id!"),!1;if(this.setPaperSource(this.cardType),1===this.cardType){var t=new FormData;t.append("examGroupId",this.cardSettings.examGroupId),Object(x["c"])(t).then((function(t){e.TopicsData=JSON.parse(JSON.stringify(t));var i="";t.position&&(i=JSON.parse(t.position));var n=!1;if(i.bigTopicArr){n=!0;var o=1==i.answerCardType?1:2;t.paperTplType!=o&&e.setIsAnswerCardTypeChange(!0)}if(n){var r=1==i.answerCardType?1:2;e.setAnswerCardType(r),e.setEditZXHX(t,i)}else e.setAnswerCardType(1==t.paperTplType?1:0),e.setNewZXHX(t)})).catch((function(e){console.log(e)}))}else{var i=localStorage.getItem("upDataThreeCard");if(void 0!=i){if(null==i)return!1;var n=JSON.parse(i);this.setTestFormData(n.testFormData),this.editType=n.testFormData.editType,void 0===this.editType&&(this.editType=0),this.grade=n.testFormData.grade,this.setSubject(Number(n.testFormData.subjectId)),1===this.editType?this.setEditThree(n):this.setNewThree(n)}}},classificationTree:function(e){var t=this,i=[],n=0;return e.forEach((function(e){var o=i.findIndex((function(t){return t.questionTypeId===e.questionTypeId}));if(o>-1)i[o].questions.push(e);else{var r="modelId"+ ++n,s={modelId:r,bigTitle:Object(it["a"])(n)+"、"+t.getTopicTypeText(e.questionTypeId),subtitle:"",questionTypeId:e.questionTypeId,topicConfigureData:{},questions:[e]};i.push(s)}})),i.forEach((function(e){e.subtitle=t.setSubTitle(e)})),i},setSubTitle:function(e){var t="";if(1==this.paperSource&&!e.isQuestionText){var i=e.questions[0],n=e.questions.map((function(e){return e.fullScore})),o=!(Object(r["a"])(new Set(n)).length>1),s="";o||e.questions.forEach((function(e){s+="第".concat(e.questionNum,"题").concat(e.fullScore,"分,")})),1==e.questionTypeId?t="(本大题共".concat(i.total,"小题,").concat(o?"每小题"+i.fullScore+"分,":s,"共").concat(i.questionTypeFullScore,"分。在每小题给出的").concat(i.optionCount,"个选项中,只有一项是符合题目要求的。把答案填涂在答题卡上。)"):[2,11].includes(e.questionTypeId)?t="(本大题共".concat(i.total,"小题,").concat(o?"每小题"+i.fullScore+"分,":s,"共").concat(i.questionTypeFullScore,"分。在每小题给出的").concat(i.optionCount,"个选项中,有两项及以上是符合题目要求的。把答案填涂在答题卡上。)"):[5].includes(e.questionTypeId)?t="(本大题共".concat(i.total,"小题,").concat(o?"每小题"+i.fullScore+"分,":s,"共").concat(i.questionTypeFullScore,"分。把答案填写在答题卡相应的题号后的横线上。)"):[7].includes(e.questionTypeId)||[27].includes(e.questionTypeId)?t="(本大题共".concat(i.total,"小题,").concat(o?"每小题"+i.fullScore+"分,":s,"共").concat(i.questionTypeFullScore,"分。解答写出相应的文字说明、证明过程或演算步骤。)"):[17].includes(e.questionTypeId)&&(t="(本题包括".concat(i.total,"小题,请选定其中").concat(i.required,"小题,并在相应的答题区域内作答,请用2B铅笔涂黑(示例:■)。若多做,则按作答的前一小题评分。解答应写出文字说明、证明过程或演算步骤。)"))}return t},setNewZXHX:function(e){var t=this,i=this;this.cardSettings.title=e.object.paperName,this.cardSetting.examInfoConfig.forEach((function(t){switch(t.id){case 0:t.text=e.object.wpTimes;break;case 1:t.text=e.object.fullScore;break;case 2:t.text=e.object.wpAuthor;break;case 3:t.text=e.object.wpReviewer;break}})),this.cardSettings.cardLength=e.object.school_card_length,this.cardSettings.cardStatus=e.object.school_card_status,this.setCardSetting(this.cardSettings),this.paperData=this.classificationTree(e.object.questions);var n={},o=JSON.parse(JSON.stringify(this.paperData));if(o.forEach((function(e){e.topicConfigureData.topicTypeArr=[{startNo:e.questions[0].questionNum,endNo:e.questions[e.questions.length-1].questionNum}],n[e.modelId]=e})),this.setBigTopicArr(n),1==e.paperTplType){var s,a=JSON.parse(JSON.stringify(this.paperData.filter((function(e){return![7,17,27].includes(e.questionTypeId)}))));a.forEach((function(e){e.isQuestionText=!0,[1,2,11].includes(e.questionTypeId)&&e.questions.forEach((function(e){e.queOptions.forEach((function(e,t){return e.index=t}))}))})),(s=this.paperData).splice.apply(s,[a.length,0].concat(Object(r["a"])(a)))}this.paperData.forEach((function(i){if([7,27].includes(i.questionTypeId))i.questions.forEach((function(i){i.TopicAreaHeight=200,i.contentHtml=1==e.paperTplType?i.questionNum+"、"+i.queBody+i.matchPicture:i.questionNum+"、"+i.matchPicture,i.cutId=1,i.alias=i.questionNum,i.ChooseArea=1,i.scoreLimit=t.getAnswerMinScoreLimit(i.fullScore),i.point=0}));else if(17===i.questionTypeId){i.topicConfigureData.topicTypeArr=[{chooseOption:i.questions[0].total,chooseSelectOption:i.questions[0].required}],1==e.paperTplType&&(i.QuestionTextList=JSON.parse(JSON.stringify(i.questions)),i.QuestionTextList.forEach((function(e){e.alias=e.questionNum})));var n=JSON.parse(JSON.stringify(i.questions)),o=n[0];if(o.alias=o.questionNum,o.cutId=1,o.TopicAreaHeight=200,o.scoreLimit=t.getAnswerMinScoreLimit(o.fullScore),o.point=0,o.contentHtml=n[0].questionNum+"~"+n[n.length-1].questionNum+"、",o.required>1){i.questions=[];for(var r=0;r<o.required;r++){var s=JSON.parse(JSON.stringify(o));s.ChooseArea=r+1,i.questions.push(s)}}else o.ChooseArea=1,i.questions=[o]}else i.questions.forEach((function(e){e.alias=e.questionNum,[1,2,11].includes(e.questionTypeId)&&e.queOptions.forEach((function(e,t){e.index=t}))}))})),this.setPaperListData(this.paperData),this.setBigTopicPageArr([JSON.parse(JSON.stringify(this.paperData))]),this.$nextTick((function(){i.setInitPageFlag(!t.initPageFlag)}))},setEditZXHX:function(e,t){this.cardSettings=t.cardSetting,this.setCardSetting(this.cardSettings),this.setBigTopicArr(t.bigTopicArr),this.setPaperListData(t.paperListData),this.setBigTopicPageArr(JSON.parse(JSON.stringify(t.bigTopicPageArr)));var i={pdf_url:e.online_card_pdf};this.setTestFormData(i)},setNewThree:function(e){var t=this;this.cardSettings.title=e.testFormData.examName;var i=new FormData;i.append("grade",this.grade),Object(x["a"])(i).then((function(e){t.cardSettings.cardLength=e.data.card_length,t.cardSettings.cardStatus=e.data.card_status,t.setCardSetting(t.cardSettings)}))},setEditThree:function(e){this.cardSettings=e.savePrintInfo.position.cardSetting,this.cardSettings.examGroupId=e.testFormData.examGroupId,this.setCardSetting(this.cardSettings),this.setBigTopicArr(e.savePrintInfo.position.bigTopicArr),this.setPaperListData(e.savePrintInfo.position.paperListData),this.setBigTopicPageArr(JSON.parse(JSON.stringify(e.savePrintInfo.position.bigTopicPageArr)))},getTopicTypeText:function(e){var t="";return 1==e?"选择题":(this.topicTypes.forEach((function(i){e==i.value&&(t=i.label)})),t)},handleCloseAddTopic:function(){this.dialogVisibleIsAddTopic=!1},showAddBigTopic:function(){this.isEdit=!1,this.editNo="",this.dialogVisibleIsAddTopic=!0},showEditBigTopic:function(e){this.isEdit=!0,this.editNo=e,this.dialogVisibleIsAddTopic=!0},showBigTopicDialog:function(){var e=this;this.$refs.AddTopic&&this.$nextTick((function(){e.$refs.AddTopic.getDefaultData()}))},ueBlur:function(){this.setBigTopicPageArr(this.bigTopicPageArr)},getAnswerMinScoreLimit:function(e){for(var t,i=15,n=0;t=this.scoreLimitMapArr[n++];)if(t>=e){i=t;break}return i},goBack:function(){this.testFormData.referrerUrl?window.location.href=this.testFormData.referrerUrl+"/isCardReturn=true":window.history.back()},restAnswerSheet:function(){this.setNewZXHX(this.TopicsData)}})},ei=Zt,ti=(i("cb79"),i("d356"),Object(v["a"])(ei,n,o,!1,null,"5632b639",null));t["default"]=ti.exports},"38cf":function(e,t,i){var n=i("23e7"),o=i("1148");n({target:"String",proto:!0},{repeat:o})},"408a":function(e,t,i){var n=i("c6b6");e.exports=function(e){if("number"!=typeof e&&"Number"!=n(e))throw TypeError("Incorrect invocation");return+e}},"411e":function(e,t,i){},"43fd":function(e,t,i){"use strict";var n=i("5def"),o=i.n(n);o.a},4437:function(e,t,i){i("a15b"),i("ac1f"),i("5319"),i("1276"),function(){var e=window.UEDITOR_HOME_URL||i(),t=window.__phpBaseUrl+"online/uploadFile";function i(e,t){return o(e||self.document.URL||self.location.href,t||n())}function n(){var e=document.getElementsByTagName("script");return e[e.length-1].src}function o(e,t){var i=t;return/^(\/|\\\\)/.test(t)?i=/^.+?\w(\/|\\\\)/.exec(e)[0]+t.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(t)||(e=e.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),i=e+""+t),r(i)}function r(e){var t=/^[a-z]+:\/\//.exec(e)[0],i=null,n=[];e=e.replace(t,"").split("?")[0].split("#")[0],e=e.replace(/\\/g,"/").split(/\//),e[e.length-1]="";while(e.length)".."===(i=e.shift())?n.pop():"."!==i&&n.push(i);return t+n.join("/")}window.UEDITOR_CONFIG={UEDITOR_HOME_URL:e,serverUrl:t,toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imageright","imagecenter","|","simpleupload","insertimage","emotion","scrawl","insertvideo","music","attachment","map","gmap","insertframe","insertcode","webapp","pagebreak","template","background","|","horizontal","date","time","spechars","snapscreen","wordimage","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","charts","|","print","preview","searchreplace","drafts","help"]],elementPathEnabled:!1,wordCount:!1,autoFloatEnabled:!1,catchRemoteImageEnable:!1,xssFilterRules:!0,inputXssFilter:!0,outputXssFilter:!0,whiteList:{a:["target","href","title","class","style"],abbr:["title","class","style"],address:["class","style"],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","loop","preload","src","class","style"],b:["class","style"],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite","class","style"],br:[],caption:["class","style"],center:[],cite:[],code:["class","style"],col:["align","valign","span","width","class","style"],colgroup:["align","valign","span","width","class","style"],dd:["class","style"],del:["datetime"],details:["open"],div:["class","style"],dl:["class","style"],dt:["class","style"],em:["class","style"],font:["color","size","face"],footer:[],h1:["class","style"],h2:["class","style"],h3:["class","style"],h4:["class","style"],h5:["class","style"],h6:["class","style"],header:[],hr:[],i:["class","style"],img:["src","alt","title","width","height","id","_src","loadingclass","class","data-latex"],ins:["datetime"],li:["class","style"],mark:[],nav:[],ol:["class","style"],p:["class","style"],pre:["class","style"],s:[],section:[],small:[],span:["class","style"],sub:["class","style"],sup:["class","style"],strong:["class","style"],table:["width","border","align","valign","class","style"],tbody:["align","valign","class","style"],td:["width","rowspan","colspan","align","valign","class","style"],tfoot:["align","valign","class","style"],th:["width","rowspan","colspan","align","valign","class","style"],thead:["align","valign","class","style"],tr:["rowspan","align","valign","class","style"],tt:[],u:[],ul:["class","style"],video:["autoplay","controls","loop","preload","src","height","width","class","style"]}},window.UE={getUEBasePath:i}}()},4442:function(e,t,i){"use strict";var n=i("5aec"),o=i.n(n);o.a},"48f6":function(e,t,i){},"491d":function(e,t,i){},"498a":function(e,t,i){"use strict";var n=i("23e7"),o=i("58a8").trim,r=i("c8d2");n({target:"String",proto:!0,forced:r("trim")},{trim:function(){return o(this)}})},"4fc7":function(e,t,i){"use strict";var n=i("d3a4"),o=i.n(n);o.a},"5a34":function(e,t,i){var n=i("44e7");e.exports=function(e){if(n(e))throw TypeError("The method doesn't accept regular expressions");return e}},"5aec":function(e,t,i){},"5def":function(e,t,i){},"5eed":function(e,t,i){"use strict";var n=i("491d"),o=i.n(n);o.a},6062:function(e,t,i){"use strict";var n=i("6d61"),o=i("6566");e.exports=n("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),o)},"648b":function(e,t,i){"use strict";var n=i("da93"),o=i.n(n);o.a},6566:function(e,t,i){"use strict";var n=i("9bf2").f,o=i("7c73"),r=i("e2cc"),s=i("0366"),a=i("19aa"),l=i("2266"),c=i("7dd0"),d=i("2626"),u=i("83ab"),m=i("f183").fastKey,p=i("69f3"),h=p.set,f=p.getterFor;e.exports={getConstructor:function(e,t,i,c){var d=e((function(e,n){a(e,d,t),h(e,{type:t,index:o(null),first:void 0,last:void 0,size:0}),u||(e.size=0),void 0!=n&&l(n,e[c],e,i)})),p=f(t),g=function(e,t,i){var n,o,r=p(e),s=b(e,t);return s?s.value=i:(r.last=s={index:o=m(t,!0),key:t,value:i,previous:n=r.last,next:void 0,removed:!1},r.first||(r.first=s),n&&(n.next=s),u?r.size++:e.size++,"F"!==o&&(r.index[o]=s)),e},b=function(e,t){var i,n=p(e),o=m(t);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key==t)return i};return r(d.prototype,{clear:function(){var e=this,t=p(e),i=t.index,n=t.first;while(n)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete i[n.index],n=n.next;t.first=t.last=void 0,u?t.size=0:e.size=0},delete:function(e){var t=this,i=p(t),n=b(t,e);if(n){var o=n.next,r=n.previous;delete i.index[n.index],n.removed=!0,r&&(r.next=o),o&&(o.previous=r),i.first==n&&(i.first=o),i.last==n&&(i.last=r),u?i.size--:t.size--}return!!n},forEach:function(e){var t,i=p(this),n=s(e,arguments.length>1?arguments[1]:void 0,3);while(t=t?t.next:i.first){n(t.value,t.key,this);while(t&&t.removed)t=t.previous}},has:function(e){return!!b(this,e)}}),r(d.prototype,i?{get:function(e){var t=b(this,e);return t&&t.value},set:function(e,t){return g(this,0===e?0:e,t)}}:{add:function(e){return g(this,e=0===e?0:e,e)}}),u&&n(d.prototype,"size",{get:function(){return p(this).size}}),d},setStrong:function(e,t,i){var n=t+" Iterator",o=f(t),r=f(n);c(e,t,(function(e,t){h(this,{type:n,target:e,state:o(e),kind:t,last:void 0})}),(function(){var e=r(this),t=e.kind,i=e.last;while(i&&i.removed)i=i.previous;return e.target&&(e.last=i=i?i.next:e.state.first)?"keys"==t?{value:i.key,done:!1}:"values"==t?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),i?"entries":"values",!i,!0),d(t)}}},"6a1b":function(e,t,i){"use strict";var n=i("0b13"),o=i.n(n);o.a},"6aa2":function(e,t,i){},"6d61":function(e,t,i){"use strict";var n=i("23e7"),o=i("da84"),r=i("94ca"),s=i("6eeb"),a=i("f183"),l=i("2266"),c=i("19aa"),d=i("861d"),u=i("d039"),m=i("1c7e"),p=i("d44e"),h=i("7156");e.exports=function(e,t,i){var f=-1!==e.indexOf("Map"),g=-1!==e.indexOf("Weak"),b=f?"set":"add",v=o[e],y=v&&v.prototype,C=v,x={},w=function(e){var t=y[e];s(y,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(g&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!d(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!d(e))&&t.call(this,0===e?0:e)}:function(e,i){return t.call(this,0===e?0:e,i),this})};if(r(e,"function"!=typeof v||!(g||y.forEach&&!u((function(){(new v).entries().next()})))))C=i.getConstructor(t,e,f,b),a.REQUIRED=!0;else if(r(e,!0)){var T=new C,N=T[b](g?{}:-0,1)!=T,S=u((function(){T.has(1)})),E=m((function(e){new v(e)})),U=!g&&u((function(){var e=new v,t=5;while(t--)e[b](t,t);return!e.has(-0)}));E||(C=t((function(t,i){c(t,C,e);var n=h(new v,t,C);return void 0!=i&&l(i,n[b],n,f),n})),C.prototype=y,y.constructor=C),(S||U)&&(w("delete"),w("has"),f&&w("get")),(U||N)&&w(b),g&&y.clear&&delete y.clear}return x[e]=C,n({global:!0,forced:C!=v},x),p(C,e),g||i.setStrong(C,e,f),C}},7037:function(e,t,i){function n(t){return"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}i("a4d3"),i("e01a"),i("d28b"),i("d3b7"),i("3ca3"),i("ddb0"),e.exports=n},"70dc":function(e,t,i){"use strict";var n=i("6aa2"),o=i.n(n);o.a},"753f":function(e,t,i){"use strict";var n=i("2168"),o=i.n(n);o.a},"7b90":function(e,t,i){},"82cc":function(e,t,i){"use strict";var n=i("8c55"),o=i.n(n);o.a},"841c":function(e,t,i){"use strict";var n=i("d784"),o=i("825a"),r=i("1d80"),s=i("129f"),a=i("14c3");n("search",1,(function(e,t,i){return[function(t){var i=r(this),n=void 0==t?void 0:t[e];return void 0!==n?n.call(t,i):new RegExp(t)[e](String(i))},function(e){var n=i(t,e,this);if(n.done)return n.value;var r=o(e),l=String(this),c=r.lastIndex;s(c,0)||(r.lastIndex=0);var d=a(r,l);return s(r.lastIndex,c)||(r.lastIndex=c),null===d?-1:d.index}]}))},"84a7":function(e,t,i){},"857a":function(e,t,i){var n=i("1d80"),o=/"/g;e.exports=function(e,t,i,r){var s=String(n(e)),a="<"+t;return""!==i&&(a+=" "+i+'="'+String(r).replace(o,"&quot;")+'"'),a+">"+s+"</"+t+">"}},8762:function(e,t,i){"use strict";var n=i("90b2"),o=i.n(n);o.a},"8c55":function(e,t,i){},"8ccd":function(e,t,i){"use strict";var n=i("84a7"),o=i.n(n);o.a},"8fd5":function(e,t,i){"use strict";var n=i("ce59"),o=i.n(n);o.a},"90b2":function(e,t,i){},"93db":function(e,t,i){},"946b":function(e,t){UE.registerUI("kityformula",(function(e,t){var i=new UE.ui.Dialog({iframeUrl:e.options.UEDITOR_HOME_URL+"kityformula-plugin/kityFormulaDialog.html",editor:e,name:t,title:"插入公式 - zhixinhuixue",cssRules:"width:783px; height: 386px;",buttons:[{className:"edui-okbutton",label:"确定",onclick:function(){i.close(!0)}},{className:"edui-cancelbutton",label:"取消",onclick:function(){i.close(!1)}}]});e.ready((function(){UE.utils.cssRule("kfformula","img.kfformula{vertical-align: middle;}",e.document)}));var n=e.options.UEDITOR_HOME_URL+"kityformula-plugin/kf-icon.png",o=document.createElement("a");o.href=n,o.href=o.href,n=o.href;var r=new UE.ui.Button({name:"插入"+t,title:"插入公式",cssRules:'background: url("'+n+'") !important',onclick:function(){i.render(),i.open()}});return e.addListener("selectionchange",(function(){var i=e.queryCommandState(t);-1==i?(r.setDisabled(!0),r.setChecked(!1)):(r.setDisabled(!1),r.setChecked(i))})),r}))},9602:function(e,t,i){},9614:function(e,t,i){"use strict";var n=i("b5c5"),o=i.n(n);o.a},"98e7":function(e,t,i){"use strict";var n=i("93db"),o=i.n(n);o.a},9911:function(e,t,i){"use strict";var n=i("23e7"),o=i("857a"),r=i("af03");n({target:"String",proto:!0,forced:r("link")},{link:function(e){return o(this,"a","href",e)}})},"9e54":function(e,t,i){},a019:function(e,t,i){i("d3b7"),i("ac1f"),i("25f0"),i("5319"),i("1276"),UE.plugins["defaultfilter"]=function(){var e=this;e.setOpt({allowDivTransToP:!0,disabledTableInTable:!0,rgb2Hex:!0}),e.addInputRule((function(t){var i,n=this.options.allowDivTransToP;function o(e){while(e&&"element"==e.type){if("td"==e.tagName)return!0;e=e.parentNode}return!1}t.traversal((function(t){if("element"==t.type){if(!UE.dom.dtd.$cdata[t.tagName]&&e.options.autoClearEmptyNode&&UE.dom.dtd.$inline[t.tagName]&&!UE.dom.dtd.$empty[t.tagName]&&(!t.attrs||UE.utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!UE.utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"style":case"script":t.setAttr({cdata_tag:t.tagName,cdata_data:t.innerHTML()||"",_ue_custom_node_:"true"}),t.tagName="div",t.innerHTML("");break;case"a":(i=t.getAttr("href"))&&t.setAttr("_href",i);break;case"img":t.setAttr("_src",t.getAttr("src"));break;case"span":UE.browser.webkit&&(i=t.getStyle("white-space"))&&/nowrap|normal/.test(i)&&(t.setStyle("white-space",""),e.options.autoClearEmptyNode&&UE.utils.isEmptyObject(t.attrs)&&t.parentNode.removeChild(t,!0)),i=t.getAttr("id"),i&&/^_baidu_bookmark_/i.test(i)&&t.parentNode.removeChild(t);break;case"p":(i=t.getAttr("align"))&&(t.setAttr("align"),t.setStyle("text-align",i)),UE.utils.each(t.children,(function(e){if("element"==e.type&&"p"==e.tagName){var i=e.nextSibling();t.parentNode.insertAfter(e,t);var n=e;while(i){var o=i.nextSibling();t.parentNode.insertAfter(i,n),n=i,i=o}return!1}})),t.firstChild()||t.innerHTML(UE.browser.ie?"&nbsp;":"<br/>");break;case"div":if(t.getAttr("cdata_tag"))break;if(i=t.getAttr("class"),i&&/^line number\d+/.test(i))break;if(!n)break;var r,s=UE.uNode.createElement("p");while(r=t.firstChild())"text"!=r.type&&UE.dom.dtd.$block[r.tagName]?s.firstChild()?(t.parentNode.insertBefore(s,t),s=UE.uNode.createElement("p")):t.parentNode.insertBefore(r,t):s.appendChild(r);s.firstChild()&&t.parentNode.insertBefore(s,t),t.parentNode.removeChild(t);break;case"dl":t.tagName="ul";break;case"dt":case"dd":t.tagName="li";break;case"li":var a=t.getAttr("class");a&&/list\-/.test(a)||t.setAttr();var l=t.getNodesByTagName("ol ul");UE.utils.each(l,(function(e){t.parentNode.insertAfter(e,t)}));break;case"td":case"th":case"caption":t.children&&t.children.length||t.appendChild(UE.browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":e.options.disabledTableInTable&&o(t)&&(t.parentNode.insertBefore(UE.uNode.createText(t.innerText()),t),t.parentNode.removeChild(t))}}}))})),e.addOutputRule((function(t){var i;t.traversal((function(t){if("element"==t.type){if(e.options.autoClearEmptyNode&&UE.dom.dtd.$inline[t.tagName]&&!UE.dom.dtd.$empty[t.tagName]&&(!t.attrs||UE.utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!UE.utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"div":(i=t.getAttr("cdata_tag"))&&(t.tagName=i,t.appendChild(UE.uNode.createText(t.getAttr("cdata_data"))),t.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(i=t.getAttr("_href"))&&t.setAttr({href:UE.utils.html(i),_href:""});break;case"span":if(i=t.getAttr("id"),i&&/^_baidu_bookmark_/i.test(i)&&t.parentNode.removeChild(t),e.getOpt("rgb2Hex")){var n=t.getAttr("style");n&&t.setAttr("style",n.replace(/rgba?\(([\d,\s]+)\)/g,(function(e,t){var i=t.split(",");if(i.length>3)return"";t="#";for(var n,o=0;n=i[o++];)n=parseInt(n.replace(/[^\d]/gi,""),10).toString(16),t+=1==n.length?"0"+n:n;return t.toUpperCase()})))}break;case"img":(i=t.getAttr("_src"))&&t.setAttr({src:t.getAttr("_src"),_src:""})}}}))}))}},a15b:function(e,t,i){"use strict";var n=i("23e7"),o=i("44ad"),r=i("fc6a"),s=i("a640"),a=[].join,l=o!=Object,c=s("join",",");n({target:"Array",proto:!0,forced:l||!c},{join:function(e){return a.call(r(this),void 0===e?",":e)}})},a347:function(e,t,i){"use strict";var n=i("d8dc"),o=i.n(n);o.a},a546:function(e,t,i){"use strict";var n=i("c9de"),o=i.n(n);o.a},ab13:function(e,t,i){var n=i("b622"),o=n("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[o]=!1,"/./"[e](t)}catch(n){}}return!1}},af03:function(e,t,i){var n=i("d039");e.exports=function(e){return n((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},b5c5:function(e,t,i){},b680:function(e,t,i){"use strict";var n=i("23e7"),o=i("a691"),r=i("408a"),s=i("1148"),a=i("d039"),l=1..toFixed,c=Math.floor,d=function(e,t,i){return 0===t?i:t%2===1?d(e,t-1,i*e):d(e*e,t/2,i)},u=function(e){var t=0,i=e;while(i>=4096)t+=12,i/=4096;while(i>=2)t+=1,i/=2;return t},m=l&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!a((function(){l.call({})}));n({target:"Number",proto:!0,forced:m},{toFixed:function(e){var t,i,n,a,l=r(this),m=o(e),p=[0,0,0,0,0,0],h="",f="0",g=function(e,t){var i=-1,n=t;while(++i<6)n+=e*p[i],p[i]=n%1e7,n=c(n/1e7)},b=function(e){var t=6,i=0;while(--t>=0)i+=p[t],p[t]=c(i/e),i=i%e*1e7},v=function(){var e=6,t="";while(--e>=0)if(""!==t||0===e||0!==p[e]){var i=String(p[e]);t=""===t?i:t+s.call("0",7-i.length)+i}return t};if(m<0||m>20)throw RangeError("Incorrect fraction digits");if(l!=l)return"NaN";if(l<=-1e21||l>=1e21)return String(l);if(l<0&&(h="-",l=-l),l>1e-21)if(t=u(l*d(2,69,1))-69,i=t<0?l*d(2,-t,1):l/d(2,t,1),i*=4503599627370496,t=52-t,t>0){g(0,i),n=m;while(n>=7)g(1e7,0),n-=7;g(d(10,n,1),0),n=t-1;while(n>=23)b(1<<23),n-=23;b(1<<n),g(1,1),b(2),f=v()}else g(0,i),g(1<<-t,0),f=v()+s.call("0",m);return m>0?(a=f.length,f=h+(a<=m?"0."+s.call("0",m-a)+f:f.slice(0,a-m)+"."+f.slice(a-m))):f=h+f,f}})},b9fe:function(module,exports,__webpack_require__){__webpack_require__("99af"),__webpack_require__("4de4"),__webpack_require__("c975"),__webpack_require__("a15b"),__webpack_require__("baa5"),__webpack_require__("fb6a"),__webpack_require__("a434"),__webpack_require__("b0c0"),__webpack_require__("a9e3"),__webpack_require__("b680"),__webpack_require__("d3b7"),__webpack_require__("4d63"),__webpack_require__("ac1f"),__webpack_require__("25f0"),__webpack_require__("466d"),__webpack_require__("38cf"),__webpack_require__("5319"),__webpack_require__("841c"),__webpack_require__("1276"),__webpack_require__("498a"),__webpack_require__("1913"),__webpack_require__("9911");var _typeof=__webpack_require__("7037");
  2. /*!
  3. * UEditor
  4. * version: ueditor
  5. * build: Wed Dec 26 2018 17:25:05 GMT+0800 (CST)
  6. */(function(){UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var baidu=window.baidu||{};window.baidu=baidu,window.UE=baidu.editor=window.UE||{},UE.plugins={},UE.commands={},UE.instants={},UE.I18N={},UE._customizeUI={},UE.version="1.4.3";var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,i={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};i.gecko="Gecko"==navigator.product&&!i.webkit&&!i.opera&&!i.ie;var n=0;if(i.ie){var o=e.match(/(?:msie\s([\w.]+))/),r=e.match(/(?:trident.*rv:([\w.]+))/);n=o&&r&&o[1]&&r[1]?Math.max(1*o[1],1*r[1]):o&&o[1]?1*o[1]:r&&r[1]?1*r[1]:0,i.ie11Compat=11==document.documentMode,i.ie9Compat=9==document.documentMode,i.ie8=!!document.documentMode,i.ie8Compat=8==document.documentMode,i.ie7Compat=7==n&&!document.documentMode||7==document.documentMode,i.ie6Compat=n<7||i.quirks,i.ie9above=n>8,i.ie9below=n<9,i.ie11above=n>10,i.ie11below=n<11}if(i.gecko){var s=e.match(/rv:([\d\.]+)/);s&&(s=s[1].split("."),n=1e4*s[0]+100*(s[1]||0)+1*(s[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(i.chrome=+RegExp["$1"]),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(i.safari=+(RegExp["$1"]||RegExp["$2"])),i.opera&&(n=parseFloat(t.version())),i.webkit&&(n=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),i.version=n,i.isCompatible=!i.mobile&&(i.ie&&n>=6||i.gecko&&n>=10801||i.opera&&n>=9.5||i.air&&n>=1||i.webkit&&n>=522||!1),i}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(e,t,i){if(null!=e)if(e.length===+e.length){for(var n=0,o=e.length;n<o;n++)if(!1===t.call(i,e[n],n,e))return!1}else for(var r in e)if(e.hasOwnProperty(r)&&!1===t.call(i,e[r],r,e))return!1},makeInstance:function(e){var t=new Function;return t.prototype=e,e=new t,t.prototype=null,e},extend:function(e,t,i){if(t)for(var n in t)i&&e.hasOwnProperty(n)||(e[n]=t[n]);return e},extend2:function(e){for(var t=arguments,i=1;i<t.length;i++){var n=t[i];for(var o in n)e.hasOwnProperty(o)||(e[o]=n[o])}return e},inherits:function(e,t){var i=e.prototype,n=utils.makeInstance(t.prototype);return utils.extend(n,i,!0),e.prototype=n,n.constructor=e},bind:function(e,t){return function(){return e.apply(t,arguments)}},defer:function(e,t,i){var n;return function(){i&&clearTimeout(n),n=setTimeout(e,t)}},indexOf:function(e,t,i){var n=-1;return i=this.isNumber(i)?i:0,this.each(e,(function(e,o){if(o>=i&&e===t)return n=o,!1})),n},removeItem:function(e,t){for(var i=0,n=e.length;i<n;i++)e[i]===t&&(e.splice(i,1),i--)},trim:function(e){return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(e){if(!e)return{};e=utils.isArray(e)?e:e.split(",");for(var t,i=0,n={};t=e[i++];)n[t.toUpperCase()]=n[t]=1;return n},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,(function(e,t){return t?e:{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]})):""},unhtmlForUrl:function(e,t){return e?e.replace(t||/[<">']/g,(function(e){return{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]})):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,(function(e){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">","&#39;":"'","&nbsp;":" "}[e]})):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={float:void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,(function(e){return e.charAt(1).toUpperCase()})))}}(),loadFile:function(){var e=[];function t(t,i){try{for(var n,o=0;n=e[o++];)if(n.doc===t&&n.url==(i.src||i.href))return n}catch(r){return null}}return function(i,n,o){var r=t(i,n);if(r)r.ready?o&&o():r.funs.push(o);else if(e.push({doc:i,url:n.src||n.href,funs:[o]}),i.body){if(!n.id||!i.getElementById(n.id)){var s=i.createElement(n.tag);for(var a in delete n.tag,n)s.setAttribute(a,n[a]);s.onload=s.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(r=t(i,n),r.funs.length>0){r.ready=1;for(var e;e=r.funs.pop();)e()}s.onload=s.onreadystatechange=null}},s.onerror=function(){throw Error("The load "+(n.href||n.src)+" fails,check the url settings of file ueditor.config.js ")},i.getElementsByTagName("head")[0].appendChild(s)}}else{var l=[];for(var a in n)"tag"!=a&&l.push(a+'="'+n[a]+'"');i.write("<"+n.tag+" "+l.join(" ")+" ></"+n.tag+">")}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var i=t.split(",");if(i.length>3)return"";t="#";for(var n,o=0;n=i[o++];)n=parseInt(n.replace(/[^\d]/gi,""),10).toString(16),t+=1==n.length?"0"+n:n;t=t.toUpperCase()}return t},optCss:function(e){var t,i;function n(e,t){if(!e)return"";var i=e.top,n=e.bottom,o=e.left,r=e.right,s="";if(i&&o&&n&&r)s+=";"+t+":"+(i==n&&n==o&&o==r?i:i==n&&o==r?i+" "+o:o==r?i+" "+o+" "+n:i+" "+r+" "+n+" "+o)+";";else for(var a in e)s+=";"+t+"-"+a+":"+e[a]+";";return s}return e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,(function(e,n,o,r){if(1==r.split(" ").length)switch(n){case"padding":return!t&&(t={}),t[o]=r,"";case"margin":return!i&&(i={}),i[o]=r,"";case"border":return"initial"==r?"":e}return e})),e+=n(t,"padding")+n(i,"margin"),e.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,(function(e,t){return t?t+";;":";"}))},clone:function(e,t){var i;for(var n in t=t||{},e)e.hasOwnProperty(n)&&(i=e[n],"object"==_typeof(i)?(t[n]=utils.isArray(i)?[]:{},utils.clone(e[n],t[n])):t[n]=i);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,(function(i,n,o){e=n,t=o})),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){var e=[];function t(t){t.isReady=!0;for(var i;i=e.pop();i());}return function(i,n){n=n||window;var o=n.document;i&&e.push(i),"complete"===o.readyState?t(o):(o.isReady&&t(o),browser.ie&&11!=browser.version?(function(){if(!o.isReady){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}t(o)}}(),n.attachEvent("onload",(function(){t(o)}))):(o.addEventListener("DOMContentLoaded",(function(){o.removeEventListener("DOMContentLoaded",arguments.callee,!1),t(o)}),!1),n.addEventListener("load",(function(){t(o)}),!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(e,t,i){var n,o;return void 0===t||t&&t.nodeType&&9==t.nodeType?(i=t&&t.nodeType&&9==t.nodeType?t:i||document,n=i.indexList||(i.indexList={}),o=n[e],void 0!==o?i.styleSheets[o].cssText:void 0):(i=i||document,n=i.indexList||(i.indexList={}),o=n[e],""===t?void 0!==o&&(i.styleSheets[o].cssText="",delete n[e],!0):(void 0!==o?sheetStyle=i.styleSheets[o]:(sheetStyle=i.createStyleSheet("",o=i.styleSheets.length),n[e]=o),void(sheetStyle.cssText=t)))}:function(e,t,i){var n;return void 0===t||t&&t.nodeType&&9==t.nodeType?(i=t&&t.nodeType&&9==t.nodeType?t:i||document,n=i.getElementById(e),n?n.innerHTML:void 0):(i=i||document,n=i.getElementById(e),""===t?!!n&&(n.parentNode.removeChild(n),!0):void(n?n.innerHTML=t:(n=i.createElement("style"),n.id=e,n.innerHTML=t,i.getElementsByTagName("head")[0].appendChild(n))))},sort:function(e,t){t=t||function(e,t){return e.localeCompare(t)};for(var i=0,n=e.length;i<n;i++)for(var o=i,r=e.length;o<r;o++)if(t(e[i],e[o])>0){var s=e[i];e[i]=e[o],e[o]=s}return e},serializeParam:function(e){var t=[];for(var i in e)if("method"!=i&&"timeout"!=i&&"async"!=i)if("function"!=_typeof(e[i]).toLowerCase()&&"object"!=_typeof(e[i]).toLowerCase())t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));else if(utils.isArray(e[i]))for(var n=0;n<e[i].length;n++)t.push(encodeURIComponent(i)+"[]="+encodeURIComponent(e[i][n]));return t.join("&")},formatUrl:function(e){var t=e.replace(/&&/g,"&");return t=t.replace(/\?&/g,"?"),t=t.replace(/&$/g,""),t=t.replace(/&#/g,"#"),t=t.replace(/&+/g,"&"),t},isCrossDomainUrl:function(e){var t=document.createElement("a");return t.href=e,browser.ie&&(t.href=t.href),!(t.protocol==location.protocol&&t.hostname==location.hostname&&(t.port==location.port||"80"==t.port&&""==location.port||""==t.port&&"80"==location.port))},clearEmptyAttrs:function(e){for(var t in e)""===e[t]&&delete e[t];return e},str2json:function(e){return utils.isString(e)?window.JSON?JSON.parse(e):new Function("return "+utils.trim(e||""))():null},json2str:function(){if(window.JSON)return JSON.stringify;{var e={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function t(t){return/["\\\x00-\x1f]/.test(t)&&(t=t.replace(/["\\\x00-\x1f]/g,(function(t){var i=e[t];return i||(i=t.charCodeAt(),"\\u00"+Math.floor(i/16).toString(16)+(i%16).toString(16))}))),'"'+t+'"'}function i(e){var t,i,n,o=["["],r=e.length;for(i=0;i<r;i++)switch(n=e[i],_typeof(n)){case"undefined":case"function":case"unknown":break;default:t&&o.push(","),o.push(utils.json2str(n)),t=1}return o.push("]"),o.join("")}function n(e){return e<10?"0"+e:e}function o(e){return'"'+e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+'"'}return function(e){switch(_typeof(e)){case"undefined":return"undefined";case"number":return isFinite(e)?String(e):"null";case"string":return t(e);case"boolean":return String(e);default:if(null===e)return"null";if(utils.isArray(e))return i(e);if(utils.isDate(e))return o(e);var n,r,s=["{"],a=utils.json2str;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l))switch(r=e[l],_typeof(r)){case"undefined":case"unknown":case"function":break;default:n&&s.push(","),n=1,s.push(a(l)+":"+a(r))}return s.push("}"),s.join("")}}}}()};utils.each(["String","Function","Array","Number","RegExp","Object","Date"],(function(e){UE.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}}));var EventBase=UE.EventBase=function(){};function getListener(e,t,i){var n;return t=t.toLowerCase(),(n=e.__allListeners||i&&(e.__allListeners={}))&&(n[t]||i&&(n[t]=[]))}EventBase.prototype={addListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var i,n=0;i=e[n++];)getListener(this,i,!0).push(t)},on:function(e,t){return this.addListener(e,t)},off:function(e,t){return this.removeListener(e,t)},trigger:function(){return this.fireEvent.apply(this,arguments)},removeListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var i,n=0;i=e[n++];)utils.removeItem(getListener(this,i)||[],t)},fireEvent:function(){var e=arguments[0];e=utils.trim(e).split(" ");for(var t,i=0;t=e[i++];){var n,o,r,s=getListener(this,t);if(s){r=s.length;while(r--)if(s[r]){if(o=s[r].apply(this,arguments),!0===o)return o;void 0!==o&&(n=o)}}(o=this["on"+t.toLowerCase()])&&(n=o.apply(this,arguments))}return n}};var dtd=dom.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=utils.extend2,i=e({isindex:1,fieldset:1}),n=e({input:1,button:1,select:1,textarea:1,label:1}),o=t(e({a:1}),n),r=t({iframe:1},o),s=e({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),a=e({ins:1,del:1,script:1,style:1}),l=t(e({b:1,acronym:1,bdo:1,var:1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),a),c=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),d=t(e({p:1}),c),u=t(e({iframe:1}),c,n),m=e({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,var:1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),p=t(e({a:0}),u),h=e({tr:1}),f=e({"#":1}),g=t(e({param:1}),m),b=t(e({form:1}),i,r,s,d),v=e({li:1,ol:1,ul:1}),y=e({style:1,script:1}),C=e({base:1,link:1,meta:1,title:1}),x=t(C,y),w=e({head:1,body:1}),T=e({html:1}),N=e({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),S=e({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return e({$nonBodyContent:t(T,w,C),$block:N,$inline:p,$inlineWithA:t(e({a:1}),p),$body:t(e({script:1,style:1}),N),$cdata:e({script:1,style:1}),$empty:S,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:e({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,var:1}),$removeEmptyBlock:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),html:w,head:x,style:f,script:f,body:b,base:{},link:{},meta:{},title:f,col:{},tr:e({td:1,th:1}),img:{},embed:{},colgroup:e({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:b,td:b,br:{},th:b,center:b,kbd:p,button:t(d,s),basefont:{},h5:p,h4:p,samp:p,h6:p,ol:v,h1:p,h3:p,option:f,h2:p,form:t(i,r,s,d),select:e({optgroup:1,option:1}),font:p,ins:p,menu:v,abbr:p,label:p,table:e({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:p,tfoot:h,cite:p,li:b,input:{},iframe:b,strong:p,textarea:f,noframes:b,big:p,small:p,span:e({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:p,dt:p,sub:p,optgroup:e({option:1}),param:{},bdo:p,var:p,div:b,object:g,sup:p,dd:b,strike:p,area:{},dir:v,map:t(e({area:1,form:1,p:1}),i,a,s),applet:g,dl:e({dt:1,dd:1}),del:p,isindex:{},fieldset:t(e({legend:1}),m),thead:h,ul:v,acronym:p,b:p,a:t(e({a:1}),u),blockquote:t(e({td:1,tr:1,tbody:1,li:1}),b),caption:p,i:p,u:p,tbody:h,s:p,address:t(r,d),tt:p,legend:p,q:p,pre:t(l,o),p:t(e({a:1}),p),em:p,dfn:p})}();function getDomNode(e,t,i,n,o,r){var s,a=n&&e[t];!a&&(a=e[i]);while(!a&&(s=(s||e).parentNode)){if("BODY"==s.tagName||r&&!r(s))return null;a=s[i]}return a&&o&&!o(a)?getDomNode(a,t,i,!1,o):a}var attrFix=ie&&browser.version<9?{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},styleBlock=utils.listToMap(["-webkit-box","-moz-box","block","list-item","table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption"]),domUtils=dom.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:ie&&"6"==browser.version?"\ufeff":"​",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(e,t){if(e===t)return 0;var i,n=[e],o=[t];i=e;while(i=i.parentNode){if(i===t)return 10;n.push(i)}i=t;while(i=i.parentNode){if(i===e)return 20;o.push(i)}if(n.reverse(),o.reverse(),n[0]!==o[0])return 1;var r=-1;while(r++,n[r]===o[r]);e=n[r],t=o[r];while(e=e.nextSibling)if(e===t)return 4;return 2},getNodeIndex:function(e,t){var i=e,n=0;while(i=i.previousSibling)t&&3==i.nodeType?i.nodeType!=i.nextSibling.nodeType&&n++:n++;return n},inDoc:function(e,t){return 10==domUtils.getPosition(e,t)},findParent:function(e,t,i){if(e&&!domUtils.isBody(e)){e=i?e:e.parentNode;while(e){if(!t||t(e)||domUtils.isBody(e))return t&&!t(e)&&domUtils.isBody(e)?null:e;e=e.parentNode}}return null},findParentByTagName:function(e,t,i,n){return t=utils.listToMap(utils.isArray(t)?t:[t]),domUtils.findParent(e,(function(e){return t[e.tagName]&&!(n&&n(e))}),i)},findParents:function(e,t,i,n){var o=t&&(i&&i(e)||!i)?[e]:[];while(e=domUtils.findParent(e,i))o.push(e);return n?o:o.reverse()},insertAfter:function(e,t){return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t)},remove:function(e,t){var i,n=e.parentNode;if(n){if(t&&e.hasChildNodes())while(i=e.firstChild)n.insertBefore(i,e);n.removeChild(e)}return e},getNextDomNode:function(e,t,i,n){return getDomNode(e,"firstChild","nextSibling",t,i,n)},getPreDomNode:function(e,t,i,n){return getDomNode(e,"lastChild","previousSibling",t,i,n)},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getCommonAncestor:function(e,t){if(e===t)return e;var i=[e],n=[t],o=e,r=-1;while(o=o.parentNode){if(o===t)return o;i.push(o)}o=t;while(o=o.parentNode){if(o===e)return o;n.push(o)}i.reverse(),n.reverse();while(r++,i[r]===n[r]);return 0==r?null:i[r-1]},clearEmptySibling:function(e,t,i){function n(e,t){var i;while(e&&!domUtils.isBookmarkNode(e)&&(domUtils.isEmptyInlineElement(e)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)))i=e[t],domUtils.remove(e),e=i}!t&&n(e.nextSibling,"nextSibling"),!i&&n(e.previousSibling,"previousSibling")},split:function(e,t){var i=e.ownerDocument;if(browser.ie&&t==e.nodeValue.length){var n=i.createTextNode("");return domUtils.insertAfter(e,n)}var o=e.splitText(t);if(browser.ie8){var r=i.createTextNode("");domUtils.insertAfter(o,r),domUtils.remove(r)}return o},isWhitespace:function(e){return!new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)},getXY:function(e){var t=0,i=0;while(e.offsetParent)i+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:i}},on:function(e,t,i){var n=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=n.length;if(o)while(o--)if(t=n[o],e.addEventListener)e.addEventListener(t,i,!1);else{i._d||(i._d={els:[]});var r=t+i.toString(),s=utils.indexOf(i._d.els,e);i._d[r]&&-1!=s||(-1==s&&i._d.els.push(e),i._d[r]||(i._d[r]=function(e){return i.call(e.srcElement,e||window.event)}),e.attachEvent("on"+t,i._d[r]))}e=null},un:function(e,t,i){var n=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=n.length;if(o)while(o--)if(t=n[o],e.removeEventListener)e.removeEventListener(t,i,!1);else{var r=t+i.toString();try{e.detachEvent("on"+t,i._d?i._d[r]:i)}catch(a){}if(i._d&&i._d[r]){var s=utils.indexOf(i._d.els,e);-1!=s&&i._d.els.splice(s,1),0==i._d.els.length&&delete i._d[r]}}},isSameElement:function(e,t){if(e.tagName!=t.tagName)return!1;var i=e.attributes,n=t.attributes;if(!ie&&i.length!=n.length)return!1;for(var o,r,s=0,a=0,l=0;o=i[l++];){if("style"==o.nodeName){if(o.specified&&s++,domUtils.isSameStyle(e,t))continue;return!1}if(ie){if(!o.specified)continue;s++,r=n.getNamedItem(o.nodeName)}else r=t.attributes[o.nodeName];if(!r.specified||o.nodeValue!=r.nodeValue)return!1}if(ie){for(l=0;r=n[l++];)r.specified&&a++;if(s!=a)return!1}return!0},isSameStyle:function(e,t){var i=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),n=t.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){if(i=e.style,n=t.style,i.length!=n.length)return!1;for(var o in i)if(!/^(\d+|csstext)$/i.test(o)&&i[o]!=n[o])return!1;return!0}if(!i||!n)return i==n;if(i=i.split(";"),n=n.split(";"),i.length!=n.length)return!1;for(var r,s=0;r=i[s++];)if(-1==utils.indexOf(n,r))return!1;return!0},isBlockElm:function(e){return 1==e.nodeType&&(dtd.$block[e.tagName]||styleBlock[domUtils.getComputedStyle(e,"display")])&&!dtd.$nonChild[e.tagName]},isBody:function(e){return e&&1==e.nodeType&&"body"==e.tagName.toLowerCase()},breakParent:function(e,t){var i,n,o,r=e,s=e;do{r=r.parentNode,n?(i=r.cloneNode(!1),i.appendChild(n),n=i,i=r.cloneNode(!1),i.appendChild(o),o=i):(n=r.cloneNode(!1),o=n.cloneNode(!1));while(i=s.previousSibling)n.insertBefore(i,n.firstChild);while(i=s.nextSibling)o.appendChild(i);s=r}while(t!==r);return i=t.parentNode,i.insertBefore(n,t),i.insertBefore(o,t),i.insertBefore(e,o),domUtils.remove(t),e},isEmptyInlineElement:function(e){if(1!=e.nodeType||!dtd.$removeEmpty[e.tagName])return 0;e=e.firstChild;while(e){if(domUtils.isBookmarkNode(e))return 0;if(1==e.nodeType&&!domUtils.isEmptyInlineElement(e)||3==e.nodeType&&!domUtils.isWhitespace(e))return 0;e=e.nextSibling}return 1},trimWhiteTextNode:function(e){function t(t){var i;while((i=e[t])&&3==i.nodeType&&domUtils.isWhitespace(i))e.removeChild(i)}t("firstChild"),t("lastChild")},mergeChild:function(e,t,i){for(var n,o=domUtils.getElementsByTagName(e,e.tagName.toLowerCase()),r=0;n=o[r++];)if(n.parentNode&&!domUtils.isBookmarkNode(n))if("span"!=n.tagName.toLowerCase())domUtils.isSameElement(e,n)&&domUtils.remove(n,!0);else{if(e===n.parentNode&&(domUtils.trimWhiteTextNode(e),1==e.childNodes.length)){e.style.cssText=n.style.cssText+";"+e.style.cssText,domUtils.remove(n,!0);continue}if(n.style.cssText=e.style.cssText+";"+n.style.cssText,i){var s=i.style;if(s){s=s.split(";");for(var a,l=0;a=s[l++];)n.style[utils.cssStyleToDomStyle(a.split(":")[0])]=a.split(":")[1]}}domUtils.isSameStyle(n,e)&&domUtils.remove(n,!0)}},getElementsByTagName:function(e,t,i){if(i&&utils.isString(i)){var n=i;i=function(e){return domUtils.hasClass(e,n)}}t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var o,r=[],s=0;o=t[s++];)for(var a,l=e.getElementsByTagName(o),c=0;a=l[c++];)i&&!i(a)||r.push(a);return r},mergeToParent:function(e){var t=e.parentNode;while(t&&dtd.$removeEmpty[t.tagName]){if(t.tagName==e.tagName||"A"==t.tagName){if(domUtils.trimWhiteTextNode(t),"SPAN"==t.tagName&&!domUtils.isSameStyle(t,e)||"A"==t.tagName&&"SPAN"==e.tagName){if(t.childNodes.length>1||t!==e.parentNode){e.style.cssText=t.style.cssText+";"+e.style.cssText,t=t.parentNode;continue}t.style.cssText+=";"+e.style.cssText,"A"==t.tagName&&(t.style.textDecoration="underline")}if("A"!=t.tagName){t===e.parentNode&&domUtils.remove(e,!0);break}}t=t.parentNode}},mergeSibling:function(e,t,i){function n(e,t,i){var n;if((n=i[e])&&!domUtils.isBookmarkNode(n)&&1==n.nodeType&&domUtils.isSameElement(i,n)){while(n.firstChild)"firstChild"==t?i.insertBefore(n.lastChild,i.firstChild):i.appendChild(n.firstChild);domUtils.remove(n)}}!t&&n("previousSibling","firstChild",e),!i&&n("nextSibling","lastChild",e)},unSelectable:ie&&browser.ie9below||browser.opera?function(e){e.onselectstart=function(){return!1},e.onclick=e.onkeyup=e.onkeydown=function(){return!1},e.unselectable="on",e.setAttribute("unselectable","on");for(var t,i=0;t=e.all[i++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.msUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0;i=t[n++];){switch(i=attrFix[i]||i,i){case"className":e[i]="";break;case"style":e.style.cssText="";var o=e.getAttributeNode("style");!browser.ie&&o&&e.removeAttributeNode(o)}e.removeAttribute(i)}},createElement:function(e,t,i){return domUtils.setAttributes(e.createElement(t),i)},setAttributes:function(e,t){for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];switch(i){case"class":e.className=n;break;case"style":e.style.cssText=e.style.cssText+";"+n;break;case"innerHTML":e[i]=n;break;case"value":e.value=n;break;default:e.setAttribute(attrFix[i]||i,n)}}return e},getComputedStyle:function(e,t){var i="width height top left";if(i.indexOf(t)>-1)return e["offset"+t.replace(/^\w/,(function(e){return e.toUpperCase()}))]+"px";if(3==e.nodeType&&(e=e.parentNode),browser.ie&&browser.version<9&&"font-size"==t&&!e.style.fontSize&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]){var n=e.ownerDocument.createElement("span");n.style.cssText="padding:0;border:0;font-family:simsun;",n.innerHTML=".",e.appendChild(n);var o=n.offsetHeight;return e.removeChild(n),n=null,o+"px"}try{var r=domUtils.getStyle(e,t)||(window.getComputedStyle?domUtils.getWindow(e).getComputedStyle(e,"").getPropertyValue(t):(e.currentStyle||e.style)[utils.cssStyleToDomStyle(t)])}catch(s){return""}return utils.transUnitToPx(utils.fixColor(t,r))},removeClasses:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,o=e.className;i=t[n++];)o=o.replace(new RegExp("\\b"+i+"\\b"),"");o=utils.trim(o).replace(/[ ]{2,}/g," "),o?e.className=o:domUtils.removeAttributes(e,["class"])},addClass:function(e,t){if(e){t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,o=e.className;i=t[n++];)new RegExp("\\b"+i+"\\b").test(o)||(o+=" "+i);e.className=utils.trim(o)}},hasClass:function(e,t){if(utils.isRegExp(t))return t.test(e.className);t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0,o=e.className;i=t[n++];)if(!new RegExp("\\b"+i+"\\b","i").test(o))return!1;return n-1==t.length},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(e,t){browser.ie?("color"==t&&(t="(^|;)"+t),e.style.cssText=e.style.cssText.replace(new RegExp(t+"[^:]*:[^;]+;?","ig"),"")):e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(utils.cssStyleToDomStyle(t)),e.style.cssText||domUtils.removeAttributes(e,["style"])},getStyle:function(e,t){var i=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,i)},setStyle:function(e,t,i){e.style[utils.cssStyleToDomStyle(t)]=i,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(e,t){for(var i in t)t.hasOwnProperty(i)&&domUtils.setStyle(e,i,t[i])},removeDirtyAttr:function(e){for(var t,i=0,n=e.getElementsByTagName("*");t=n[i++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var i=0,n=e.firstChild;t=t||function(){return 1};while(n)t(n)&&i++,n=n.nextSibling;return i},isEmptyNode:function(e){return!e.firstChild||0==domUtils.getChildCount(e,(function(e){return!domUtils.isBr(e)&&!domUtils.isBookmarkNode(e)&&!domUtils.isWhitespace(e)}))},clearSelectedArr:function(e){var t;while(t=e.pop())domUtils.removeAttributes(t,["class"])},scrollToView:function(e,t,i){var n=function(){var e=t.document,i="CSS1Compat"==e.compatMode;return{width:(i?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(i?e.documentElement.clientHeight:e.body.clientHeight)||0}},o=function(e){if("pageXOffset"in e)return{x:e.pageXOffset||0,y:e.pageYOffset||0};var t=e.document;return{x:t.documentElement.scrollLeft||t.body.scrollLeft||0,y:t.documentElement.scrollTop||t.body.scrollTop||0}},r=n().height,s=-1*r+i;s+=e.offsetHeight||0;var a=domUtils.getXY(e);s+=a.y;var l=o(t).y;(s>l||s<l-r)&&t.scrollTo(0,s+(s<0?-20:20))},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(e,t){if(3!=e.nodeType)return!1;var i=e.nodeValue;return t?new RegExp("^"+domUtils.fillChar).test(i):!i.replace(new RegExp(domUtils.fillChar,"g"),"").length},isStartInblock:function(e){var t,i=e.cloneRange(),n=0,o=i.startContainer;if(1==o.nodeType&&o.childNodes[i.startOffset]){o=o.childNodes[i.startOffset];var r=o.previousSibling;while(r&&domUtils.isFillChar(r))o=r,r=r.previousSibling}this.isFillChar(o,!0)&&1==i.startOffset&&(i.setStartBefore(o),o=i.startContainer);while(o&&domUtils.isFillChar(o))t=o,o=o.previousSibling;t&&(i.setStartBefore(t),o=i.startContainer),1==o.nodeType&&domUtils.isEmptyNode(o)&&1==i.startOffset&&i.setStart(o,0).collapse(!0);while(!i.startOffset){if(o=i.startContainer,domUtils.isBlockElm(o)||domUtils.isBody(o)){n=1;break}var s;r=i.startContainer.previousSibling;if(r){while(r&&domUtils.isFillChar(r))s=r,r=r.previousSibling;s?i.setStartBefore(s):i.setStartBefore(i.startContainer)}else i.setStartBefore(i.startContainer)}return n&&!domUtils.isBody(i.startContainer)?1:0},isEmptyBlock:function(e,t){if(e){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[  \t\r\n"+domUtils.fillChar+"]","g"),e[browser.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var i in dtd.$isNotEmpty)if(e.getElementsByTagName(i).length)return 0;return 1}},setViewportOffset:function(e,t){var i=0|parseInt(e.style.left),n=0|parseInt(e.style.top),o=e.getBoundingClientRect(),r=t.left-o.left,s=t.top-o.top;r&&(e.style.left=i+r+"px"),s&&(e.style.top=n+s+"px")},fillNode:function(e,t){var i=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(i)},moveChild:function(e,t,i){while(e.firstChild)i&&t.firstChild?t.insertBefore(e.lastChild,t.firstChild):t.appendChild(e.firstChild)},hasNoAttributes:function(e){return browser.ie?/^<\w+\s*?>/.test(e.outerHTML):0==e.attributes.length},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},isTagNode:function(e,t){return 1==e.nodeType&&new RegExp("\\b"+e.tagName+"\\b","i").test(t)},filterNodeList:function(e,t,i){var n=[];if(!utils.isFunction(t)){var o=t;t=function(e){return-1!=utils.indexOf(utils.isArray(o)?o:o.split(" "),e.tagName.toLowerCase())}}return utils.each(e,(function(e){t(e)&&n.push(e)})),0==n.length?null:1!=n.length&&i?n:n[0]},isInNodeEndBoundary:function(e,t){var i=e.startContainer;if(3==i.nodeType&&e.startOffset!=i.nodeValue.length)return 0;if(1==i.nodeType&&e.startOffset!=i.childNodes.length)return 0;while(i!==t){if(i.nextSibling)return 0;i=i.parentNode}return 1},isBoundaryNode:function(e,t){var i;while(!domUtils.isBody(e))if(i=e,e=e.parentNode,i!==e[t])return!1;return!0},fillHtml:browser.ie11below?"&nbsp;":"<br/>"},fillCharReg=new RegExp(domUtils.fillChar,"g");(function(){var e,t=0,i=domUtils.fillChar;function n(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function o(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function r(e,t,i,o){return 1==t.nodeType&&(dtd.$empty[t.tagName]||dtd.$nonChild[t.tagName])&&(i=domUtils.getNodeIndex(t)+(e?0:1),t=t.parentNode),e?(o.startContainer=t,o.startOffset=i,o.endContainer||o.collapse(!0)):(o.endContainer=t,o.endOffset=i,o.startContainer||o.collapse(!1)),n(o),o}function s(e,t){var i,n,o=e.startContainer,r=e.endContainer,s=e.startOffset,a=e.endOffset,l=e.document,c=l.createDocumentFragment();if(1==o.nodeType&&(o=o.childNodes[s]||(i=o.appendChild(l.createTextNode("")))),1==r.nodeType&&(r=r.childNodes[a]||(n=r.appendChild(l.createTextNode("")))),o===r&&3==o.nodeType)return c.appendChild(l.createTextNode(o.substringData(s,a-s))),t&&(o.deleteData(s,a-s),e.collapse(!0)),c;for(var d,u,m=c,p=domUtils.findParents(o,!0),h=domUtils.findParents(r,!0),f=0;p[f]==h[f];)f++;for(var g,b=f;g=p[b];b++){d=g.nextSibling,g==o?i||(3==e.startContainer.nodeType?(m.appendChild(l.createTextNode(o.nodeValue.slice(s))),t&&o.deleteData(s,o.nodeValue.length-s)):m.appendChild(t?o:o.cloneNode(!0))):(u=g.cloneNode(!1),m.appendChild(u));while(d){if(d===r||d===h[b])break;g=d.nextSibling,m.appendChild(t?d:d.cloneNode(!0)),d=g}m=u}m=c,p[f]||(m.appendChild(p[f-1].cloneNode(!1)),m=m.firstChild);var v;for(b=f;v=h[b];b++){if(d=v.previousSibling,v==r?n||3!=e.endContainer.nodeType||(m.appendChild(l.createTextNode(r.substringData(0,a))),t&&r.deleteData(0,a)):(u=v.cloneNode(!1),m.appendChild(u)),b!=f||!p[f])while(d){if(d===o)break;v=d.previousSibling,m.insertBefore(t?d:d.cloneNode(!0),m.firstChild),d=v}m=u}return t&&e.setStartBefore(h[f]?p[f]?h[f]:p[f-1]:h[f-1]).collapse(!0),i&&domUtils.remove(i),n&&domUtils.remove(n),c}var a=dom.Range=function(e){var t=this;t.startContainer=t.startOffset=t.endContainer=t.endOffset=null,t.document=e,t.collapsed=!0};function l(t,i){try{if(e&&domUtils.inDoc(e,t))if(e.nodeValue.replace(fillCharReg,"").length)e.nodeValue=e.nodeValue.replace(fillCharReg,"");else{var n=e.parentNode;domUtils.remove(e);while(n&&domUtils.isEmptyInlineElement(n)&&(browser.safari?!(domUtils.getPosition(n,i)&domUtils.POSITION_CONTAINS):!n.contains(i)))e=n.parentNode,domUtils.remove(n),n=e}}catch(o){}}function c(e,t){var i;e=e[t];while(e&&domUtils.isFillChar(e))i=e[t],domUtils.remove(e),e=i}a.prototype={cloneContents:function(){return this.collapsed?null:s(this,0)},deleteContents:function(){var e;return this.collapsed||s(this,1),browser.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},extractContents:function(){return this.collapsed?null:s(this,2)},setStart:function(e,t){return r(!0,e,t,this)},setEnd:function(e,t){return r(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new a(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){var t,i=this,n=i.collapsed;function o(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}while(1==i.startContainer.nodeType&&(t=i.startContainer.childNodes[i.startOffset])&&o(t))i.setStart(t,0);if(n)return i.collapse(!0);if(!e)while(1==i.endContainer.nodeType&&i.endOffset>0&&(t=i.endContainer.childNodes[i.endOffset-1])&&o(t))i.setEnd(t,t.childNodes.length);return i},getCommonAncestor:function(e,t){var i=this,n=i.startContainer,r=i.endContainer;return n===r?e&&o(this)&&(n=n.childNodes[i.startOffset],1==n.nodeType)?n:t&&3==n.nodeType?n.parentNode:n:domUtils.getCommonAncestor(n,r)},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,i=this.startOffset,n=this.collapsed,o=this.endContainer;if(3==t.nodeType){if(0==i)this.setStartBefore(t);else if(i>=t.nodeValue.length)this.setStartAfter(t);else{var r=domUtils.split(t,i);t===o?this.setEnd(r,this.endOffset-i):t.parentNode===o&&(this.endOffset+=1),this.setStartBefore(r)}if(n)return this.collapse(!0)}return e||(i=this.endOffset,o=this.endContainer,3==o.nodeType&&(0==i?this.setEndBefore(o):(i<o.nodeValue.length&&domUtils.split(o,i),this.setEndAfter(o)))),this},txtToElmBoundary:function(e){function t(e,t){var i=e[t+"Container"],n=e[t+"Offset"];3==i.nodeType&&(n?n>=i.nodeValue.length&&e["set"+t.replace(/(\w)/,(function(e){return e.toUpperCase()}))+"After"](i):e["set"+t.replace(/(\w)/,(function(e){return e.toUpperCase()}))+"Before"](i))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,i=1;11==e.nodeType&&(t=e.firstChild,i=e.childNodes.length),this.trimBoundary(!0);var n=this.startContainer,o=this.startOffset,r=n.childNodes[o];return r?n.insertBefore(e,r):n.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+i),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,i){var n,o=this.document.createElement("span");return o.style.cssText="display:none;line-height:0px;",o.appendChild(this.document.createTextNode("‍")),o.id="_baidu_bookmark_start_"+(i?"":t++),this.collapsed||(n=o.cloneNode(!0),n.id="_baidu_bookmark_end_"+(i?"":t++)),this.insertNode(o),n&&this.collapse().insertNode(n).setEndBefore(n),this.setStartAfter(o),{start:e?o.id:o,end:n?e?n.id:n:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,i=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),i?(this.setEndBefore(i),domUtils.remove(i)):this.collapse(!0),this},enlarge:function(e,t){var i,n,o=domUtils.isBody,r=this.document.createTextNode("");if(e){n=this.startContainer,1==n.nodeType?n.childNodes[this.startOffset]?i=n=n.childNodes[this.startOffset]:(n.appendChild(r),i=n=r):i=n;while(1){if(domUtils.isBlockElm(n)){n=i;while((i=n.previousSibling)&&!domUtils.isBlockElm(i))n=i;this.setStartBefore(n);break}i=n,n=n.parentNode}n=this.endContainer,1==n.nodeType?((i=n.childNodes[this.endOffset])?n.insertBefore(r,i):n.appendChild(r),i=n=r):i=n;while(1){if(domUtils.isBlockElm(n)){n=i;while((i=n.nextSibling)&&!domUtils.isBlockElm(i))n=i;this.setEndAfter(n);break}i=n,n=n.parentNode}r.parentNode===this.endContainer&&this.endOffset--,domUtils.remove(r)}if(!this.collapsed){while(0==this.startOffset){if(t&&t(this.startContainer))break;if(o(this.startContainer))break;this.setStartBefore(this.startContainer)}while(this.endOffset==(1==this.endContainer.nodeType?this.endContainer.childNodes.length:this.endContainer.nodeValue.length)){if(t&&t(this.endContainer))break;if(o(this.endContainer))break;this.setEndAfter(this.endContainer)}}return this},enlargeToBlockElm:function(e){while(!domUtils.isBlockElm(this.startContainer))this.setStartBefore(this.startContainer);if(!e)while(!domUtils.isBlockElm(this.endContainer))this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){while(!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length)this.setStartAfter(this.startContainer);while(!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(e,t,i){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,(function(e){return 1==e.nodeType&&domUtils.isBlockElm(e)})).adjustmentBoundary();var n,o,r=this.createBookmark(),s=r.end,a=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},l=domUtils.getNextDomNode(r.start,!1,a),c=this.cloneRange();while(l&&domUtils.getPosition(l,s)&domUtils.POSITION_PRECEDING)if(3==l.nodeType||dtd[e][l.tagName]){c.setStartBefore(l),n=l;while(n&&(3==n.nodeType||dtd[e][n.tagName])&&n!==s)o=n,n=domUtils.getNextDomNode(n,1==n.nodeType,null,(function(t){return dtd[e][t.tagName]}));var d,u,m=c.setEndAfter(o).extractContents();if(i&&i.length>0){var p,h;h=p=i[0].cloneNode(!1);for(var f,g=1;f=i[g++];)p.appendChild(f.cloneNode(!1)),p=p.firstChild;d=p}else d=c.document.createElement(e);if(t&&domUtils.setAttributes(d,t),d.appendChild(m),c.insertNode(i?h:d),"span"==e&&t.style&&/text\-decoration/.test(t.style)&&(u=domUtils.findParentByTagName(d,"a",!0))?(domUtils.setAttributes(u,t),domUtils.remove(d,!0),d=u):(domUtils.mergeSibling(d),domUtils.clearEmptySibling(d)),domUtils.mergeChild(d,t),l=domUtils.getNextDomNode(d,!1,a),domUtils.mergeToParent(d),n===s)break}else l=domUtils.getNextDomNode(l,!0,a);return this.moveToBookmark(r)},removeInlineStyle:function(e){if(this.collapsed)return this;e=utils.isArray(e)?e:[e],this.shrinkBoundary().adjustmentBoundary();var t=this.startContainer,i=this.endContainer;while(1){if(1==t.nodeType){if(utils.indexOf(e,t.tagName.toLowerCase())>-1)break;if("body"==t.tagName.toLowerCase()){t=null;break}}t=t.parentNode}while(1){if(1==i.nodeType){if(utils.indexOf(e,i.tagName.toLowerCase())>-1)break;if("body"==i.tagName.toLowerCase()){i=null;break}}i=i.parentNode}var n,o,r=this.createBookmark();t&&(o=this.cloneRange().setEndBefore(r.start).setStartBefore(t),n=o.extractContents(),o.insertNode(n),domUtils.clearEmptySibling(t,!0),t.parentNode.insertBefore(r.start,t)),i&&(o=this.cloneRange().setStartAfter(r.end).setEndAfter(i),n=o.extractContents(),o.insertNode(n),domUtils.clearEmptySibling(i,!1,!0),i.parentNode.insertBefore(r.end,i.nextSibling));var s,a=domUtils.getNextDomNode(r.start,!1,(function(e){return 1==e.nodeType}));while(a&&a!==r.end)s=domUtils.getNextDomNode(a,!0,(function(e){return 1==e.nodeType})),utils.indexOf(e,a.tagName.toLowerCase())>-1&&domUtils.remove(a,!0),a=s;return this.moveToBookmark(r)},getClosedNode:function(){var e;if(!this.collapsed){var t=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(o(t)){var i=t.startContainer.childNodes[t.startOffset];i&&1==i.nodeType&&(dtd.$empty[i.tagName]||dtd.$nonChild[i.tagName])&&(e=i)}}return e},select:browser.ie?function(t,n){var o;this.collapsed||this.shrinkBoundary();var r=this.getClosedNode();if(r&&!n){try{o=this.document.body.createControlRange(),o.addElement(r),o.select()}catch(h){}return this}var s,a=this.createBookmark(),d=a.start;if(o=this.document.body.createTextRange(),o.moveToElementText(d),o.moveStart("character",1),this.collapsed){if(!t&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(i),m=this.document.createElement("span");m.appendChild(this.document.createTextNode(i)),d.parentNode.insertBefore(m,d),d.parentNode.insertBefore(u,d),l(this.document,u),e=u,c(m,"previousSibling"),c(d,"nextSibling"),o.moveStart("character",-1),o.collapse(!0)}}else{var p=this.document.body.createTextRange();s=a.end,p.moveToElementText(s),o.setEndPoint("EndToEnd",p)}this.moveToBookmark(a),m&&domUtils.remove(m);try{o.select()}catch(h){}return this}:function(t){function n(e){function t(t,i,n){3==t.nodeType&&t.nodeValue.length<i&&(e[n+"Offset"]=t.nodeValue.length)}t(e.startContainer,e.startOffset,"start"),t(e.endContainer,e.endOffset,"end")}var o,r=domUtils.getWindow(this.document),s=r.getSelection();if(browser.gecko?this.document.body.focus():r.focus(),s){if(s.removeAllRanges(),this.collapsed&&!t){var a=this.startContainer,d=a;1==a.nodeType&&(d=a.childNodes[this.startOffset]),3==a.nodeType&&this.startOffset||(d?d.previousSibling&&3==d.previousSibling.nodeType:a.lastChild&&3==a.lastChild.nodeType)||(o=this.document.createTextNode(i),this.insertNode(o),l(this.document,o),c(o,"previousSibling"),c(o,"nextSibling"),e=o,this.setStart(o,browser.webkit?1:0).collapse(!0))}var u=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType){d=this.startContainer.childNodes[this.startOffset];if(d){while(d&&domUtils.isBlockElm(d)){if(1!=d.nodeType||!d.childNodes[0])break;d=d.childNodes[0]}d&&this.setStartBefore(d).collapse(!0)}else d=this.startContainer.lastChild,d&&domUtils.isBr(d)&&this.setStartBefore(d).collapse(!0)}n(this),u.setStart(this.startContainer,this.startOffset),u.setEnd(this.endContainer,this.endOffset),s.addRange(u)}return this},scrollToView:function(e,t){e=e?window:domUtils.getWindow(this.document);var i=this,n=i.document.createElement("span");return n.innerHTML="&nbsp;",i.cloneRange().insertNode(n),domUtils.scrollToView(n,e,t),domUtils.remove(n),i},inFillChar:function(){var e=this.startContainer;return!(!this.collapsed||3!=e.nodeType||e.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"").length+1!=e.nodeValue.length)},createAddress:function(e,t){var i={},n=this;function o(e){for(var i,o=e?n.startContainer:n.endContainer,r=domUtils.findParents(o,!0,(function(e){return!domUtils.isBody(e)})),s=[],a=0;i=r[a++];)s.push(domUtils.getNodeIndex(i,t));var l=0;if(t)if(3==o.nodeType){var c=o.previousSibling;while(c&&3==c.nodeType)l+=c.nodeValue.replace(fillCharReg,"").length,c=c.previousSibling;l+=e?n.startOffset:n.endOffset}else if(o=o.childNodes[e?n.startOffset:n.endOffset],o)l=domUtils.getNodeIndex(o,t);else{o=e?n.startContainer:n.endContainer;var d=o.firstChild;while(d)if(domUtils.isFillChar(d))d=d.nextSibling;else if(l++,3==d.nodeType)while(d&&3==d.nodeType)d=d.nextSibling;else d=d.nextSibling}else l=e?domUtils.isFillChar(o)?0:n.startOffset:n.endOffset;return l<0&&(l=0),s.push(l),s}return i.startAddress=o(!0),e||(i.endAddress=n.collapsed?[].concat(i.startAddress):o()),i},moveToAddress:function(e,t){var i=this;function n(e,t){for(var n,o,r,s=i.document.body,a=0,l=e.length;a<l;a++)if(r=e[a],n=s,s=s.childNodes[r],!s){o=r;break}t?s?i.setStartBefore(s):i.setStart(n,o):s?i.setEndBefore(s):i.setEnd(n,o)}return n(e.startAddress,!0),!t&&e.endAddress&&n(e.endAddress),i},equals:function(e){for(var t in this)if(this.hasOwnProperty(t)&&this[t]!==e[t])return!1;return!0},traversal:function(e,t){if(this.collapsed)return this;var i=this.createBookmark(),n=i.end,o=domUtils.getNextDomNode(i.start,!1,t);while(o&&o!==n&&domUtils.getPosition(o,n)&domUtils.POSITION_PRECEDING){var r=domUtils.getNextDomNode(o,!1,t);e(o),o=r}return this.moveToBookmark(i)}}})(),function(){function e(e,t){var i=domUtils.getNodeIndex;e=e.duplicate(),e.collapse(t);var n=e.parentElement();if(!n.hasChildNodes())return{container:n,offset:0};var o,r,s=n.children,a=e.duplicate(),l=0,c=s.length-1,d=-1;while(l<=c){d=Math.floor((l+c)/2),o=s[d],a.moveToElementText(o);var u=a.compareEndPoints("StartToStart",e);if(u>0)c=d-1;else{if(!(u<0))return{container:n,offset:i(o)};l=d+1}}if(-1==d){if(a.moveToElementText(n),a.setEndPoint("StartToStart",e),r=a.text.replace(/(\r\n|\r)/g,"\n").length,s=n.childNodes,!r)return o=s[s.length-1],{container:o,offset:o.nodeValue.length};var m=s.length;while(r>0)r-=s[--m].nodeValue.length;return{container:s[m],offset:-r}}if(a.collapse(u>0),a.setEndPoint(u>0?"StartToStart":"EndToStart",e),r=a.text.replace(/(\r\n|\r)/g,"\n").length,!r)return dtd.$empty[o.tagName]||dtd.$nonChild[o.tagName]?{container:n,offset:i(o)+(u>0?0:1)}:{container:o,offset:u>0?0:o.childNodes.length};while(r>0)try{var p=o;o=o[u>0?"previousSibling":"nextSibling"],r-=o.nodeValue.length}catch(h){return{container:n,offset:i(p)}}return{container:o,offset:u>0?-r:o.nodeValue.length+r}}function t(t,i){if(t.item)i.selectNode(t.item(0));else{var n=e(t,!0);i.setStart(n.container,n.offset),0!=t.compareEndPoints("StartToEnd",t)&&(n=e(t,!1),i.setEnd(n.container,n.offset))}return i}function i(e){var t;try{t=e.getNative().createRange()}catch(n){return null}var i=t.item?t.item(0):t.parentElement();return(i.ownerDocument||i)===e.document?t:null}var n=dom.Selection=function(e){var t,n=this;n.document=e,browser.ie9below&&(t=domUtils.getWindow(e).frameElement,domUtils.on(t,"beforedeactivate",(function(){n._bakIERange=n.getIERange()})),domUtils.on(t,"activate",(function(){try{!i(n)&&n._bakIERange&&n._bakIERange.select()}catch(e){}n._bakIERange=null}))),t=e=null};n.prototype={rangeInBody:function(e,t){var i=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return i===this.document.body||domUtils.inDoc(i,this.document)},getNative:function(){var e=this.document;try{return e?browser.ie9below?e.selection:domUtils.getWindow(e).getSelection():null}catch(t){return null}},getIERange:function(){var e=i(this);return!e&&this._bakIERange?this._bakIERange:e},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var e=this.getStart();return e?domUtils.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(browser.ie9below){var e=i(this);return!(!e||!this.rangeInBody(e))}return!!this.getNative().rangeCount}catch(t){return!1}},getRange:function(){var e=this;function i(t){var i=e.document.body.firstChild,n=t.collapsed;while(i&&i.firstChild)t.setStart(i,0),i=i.firstChild;t.startContainer||t.setStart(e.document.body,0),n&&t.collapse(!0)}if(null!=e._cachedRange)return this._cachedRange;var n=new baidu.editor.dom.Range(e.document);if(browser.ie9below){var o=e.getIERange();if(o)try{t(o,n)}catch(l){i(n)}else i(n)}else{var r=e.getNative();if(r&&r.rangeCount){var s=r.getRangeAt(0),a=r.getRangeAt(r.rangeCount-1);n.setStart(s.startContainer,s.startOffset).setEnd(a.endContainer,a.endOffset),n.collapsed&&domUtils.isBody(n.startContainer)&&!n.startOffset&&i(n)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;i(n)}}return this._bakRange=n},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,i,n,o=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!o)return this.document.body.firstChild;if(o.item)return o.item(0);e=o.duplicate(),e.text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),n=i=o.parentElement();while(i=i.parentNode)if(i==t){t=n;break}}else if(o.shrinkBoundary(),t=o.startContainer,1==t.nodeType&&t.hasChildNodes()&&(t=t.childNodes[Math.min(t.childNodes.length-1,o.startOffset)]),3==t.nodeType)return t.parentNode;return t},getText:function(){var e,t;return this.isFocus()&&(e=this.getNative())?(t=browser.ie9below?e.createRange():e.getRangeAt(0),browser.ie9below?t.text:t.toString()):""},clearRange:function(){this.getNative()[browser.ie9below?"empty":"removeAllRanges"]()}}}(),function(){var e,t=0;function i(e,t){var i;if(t.textarea)if(utils.isString(t.textarea)){for(var n,o=0,r=domUtils.getElementsByTagName(e,"textarea");n=r[o++];)if(n.id=="ueditor_textarea_"+t.options.textarea){i=n;break}}else i=t.textarea;i||(e.appendChild(i=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=i),!i.getAttribute("name")&&i.setAttribute("name",t.options.textarea),i.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function n(e){for(var t in e)return t}function o(e){e.langIsReady=!0,e.fireEvent("langReady")}var r=UE.Editor=function(e){var i=this;i.uid=t++,EventBase.call(i),i.commands={},i.options=utils.extend(utils.clone(e||{}),UEDITOR_CONFIG,!0),i.shortcutkeys={},i.inputRules=[],i.outputRules=[],i.setOpt(r.defaultOptions(i)),i.loadServerConfig(),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:i.options.langPath+i.options.lang+"/"+i.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},(function(){UE.plugin.load(i),o(i)})):(i.options.lang=n(UE.I18N),UE.plugin.load(i),o(i)),UE.instants["ueditorInstant"+i.uid]=i};r.prototype={registerCommand:function(e,t){this.commands[e]=t},ready:function(e){var t=this;e&&(t.isReady?e.apply(t):t.addListener("ready",e))},setOpt:function(e,t){var i={};utils.isString(e)?i[e]=t:i=e,utils.extend(this.options,i,!0)},getOpt:function(e){return this.options[e]},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode,i=e.textarea;i?i.style.display="":(i=document.createElement("textarea"),t.parentNode.insertBefore(i,t)),i.style.width=e.iframe.offsetWidth+"px",i.style.height=e.iframe.offsetHeight+"px",i.value=e.getContent(),i.id=e.key,t.innerHTML="",domUtils.remove(t);var n=e.key;for(var o in e)e.hasOwnProperty(o)&&delete this[o];UE.delEditor(n)},render:function(e){var t=this,i=t.options,n=function(t){return parseInt(domUtils.getComputedStyle(e,t))};if(utils.isString(e)&&(e=document.getElementById(e)),e){i.initialFrameWidth?i.minFrameWidth=i.initialFrameWidth:i.minFrameWidth=i.initialFrameWidth=e.offsetWidth,i.initialFrameHeight?i.minFrameHeight=i.initialFrameHeight:i.initialFrameHeight=i.minFrameHeight=e.offsetHeight,e.style.width=/%$/.test(i.initialFrameWidth)?"100%":i.initialFrameWidth-n("padding-left")-n("padding-right")+"px",e.style.height=/%$/.test(i.initialFrameHeight)?"100%":i.initialFrameHeight-n("padding-top")-n("padding-bottom")+"px",e.style.zIndex=i.zIndex;var o=(ie&&browser.version<9?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}</style>"+(i.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+utils.unhtml(i.iframeCssUrl)+"'/>":"")+(i.initialStyle?"<style>"+i.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(ie?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){editor = window.parent.UE.instants['ueditorInstant"+t.uid+"'];editor._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);<\/script></html>";e.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+t.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(i.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+o+'");document.close();}())'})),e.style.overflow="hidden",setTimeout((function(){/%$/.test(i.initialFrameWidth)&&(i.minFrameWidth=i.initialFrameWidth=e.offsetWidth),/%$/.test(i.initialFrameHeight)&&(i.minFrameHeight=i.initialFrameHeight=e.offsetHeight,e.style.height=i.initialFrameHeight+"px")}))}},_setup:function(e){var t,n=this,o=n.options;ie?(e.body.disabled=!0,e.body.contentEditable=!0,e.body.disabled=!1):e.body.contentEditable=!0,e.body.spellcheck=!1,n.document=e,n.window=e.defaultView||e.parentWindow,n.iframe=n.window.frameElement,n.body=e.body,n.selection=new dom.Selection(e),browser.gecko&&(t=this.selection.getNative())&&t.removeAllRanges(),this._initEvents();for(var r=this.iframe.parentNode;!domUtils.isBody(r);r=r.parentNode)if("FORM"==r.tagName){n.form=r,n.options.autoSyncData?domUtils.on(n.window,"blur",(function(){i(r,n)})):domUtils.on(r,"submit",(function(){i(this,n)}));break}if(o.initialContent)if(o.autoClearinitialContent){var s=n.execCommand;n.execCommand=function(){return n.fireEvent("firstBeforeExecCommand"),s.apply(n,arguments)},this._setDefaultContent(o.initialContent)}else this.setContent(o.initialContent,!1,!0);domUtils.isEmptyNode(n.body)&&(n.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"),o.focus&&setTimeout((function(){n.focus(n.options.focusInEnd),!n.options.autoClearinitialContent&&n._selectionChange()}),0),n.container||(n.container=this.iframe.parentNode),o.fullscreen&&n.ui&&n.ui.setFullScreen(!0);try{n.document.execCommand("2D-position",!1,!1)}catch(a){}try{n.document.execCommand("enableInlineTableEditing",!1,!1)}catch(a){}try{n.document.execCommand("enableObjectResizing",!1,!1)}catch(a){}n._bindshortcutKeys(),n.isReady=1,n.fireEvent("ready"),o.onready&&o.onready.call(n),browser.ie9below||domUtils.on(n.window,["blur","focus"],(function(e){if("blur"==e.type){n._bakRange=n.selection.getRange();try{n._bakNativeRange=n.selection.getNative().getRangeAt(0),n.selection.getNative().removeAllRanges()}catch(e){n._bakNativeRange=null}}else try{n._bakRange&&n._bakRange.select()}catch(e){}})),browser.gecko&&browser.version<=10902&&(n.body.contentEditable=!1,setTimeout((function(){n.body.contentEditable=!0}),100),setInterval((function(){n.body.style.height=n.iframe.offsetHeight-20+"px"}),100)),!o.isShow&&n.setHide(),o.readonly&&n.setDisabled()},sync:function(e){var t=this,n=e?document.getElementById(e):domUtils.findParent(t.iframe.parentNode,(function(e){return"FORM"==e.tagName}),!0);n&&i(n,t)},setHeight:function(e,t){e!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=e+"px"),!t&&(this.options.minFrameHeight=this.options.initialFrameHeight=e),this.body.style.height=e+"px",!t&&this.trigger("setHeight")},addshortcutkey:function(e,t){var i={};t?i[e]=t:i=e,utils.extend(this.shortcutkeys,i)},_bindshortcutKeys:function(){var e=this,t=this.shortcutkeys;e.addListener("keydown",(function(i,n){var o=n.keyCode||n.which;for(var r in t)for(var s,a=t[r].split(","),l=0;s=a[l++];){s=s.split(":");var c=s[0],d=s[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(c.toLowerCase())||/^(\d+)$/.test(c))&&("ctrl"==RegExp.$1&&(n.ctrlKey||n.metaKey)&&(""==RegExp.$2||n[RegExp.$2.slice(1)+"Key"])&&o==RegExp.$3||o==RegExp.$1)&&(-1!=e.queryCommandState(r,d)&&e.execCommand(r,d),domUtils.preventDefault(n))}}))},getContent:function(e,t,i,n,o){var r=this;if(e&&utils.isFunction(e)&&(t=e,e=""),t?!t():!this.hasContents())return"";r.fireEvent("beforegetcontent");var s=UE.htmlparser(r.body.innerHTML,n);return r.filterOutputRule(s),r.fireEvent("aftergetcontent",e,s),s.toHtml(o)},getAllHtml:function(){var e=this,t=[];if(e.fireEvent("getAllHtml",t),browser.ie&&browser.version>8){var i="";utils.each(e.document.styleSheets,(function(e){i+=e.href?'<link rel="stylesheet" type="text/css" href="'+e.href+'" />':"<style>"+e.cssText+"</style>"})),utils.each(e.document.getElementsByTagName("script"),(function(e){i+=e.outerHTML}))}return"<html><head>"+(e.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+e.options.charset+'"/>':"")+(i||e.document.getElementsByTagName("head")[0].innerHTML)+t.join("\n")+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+e.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var e=new RegExp(domUtils.fillChar,"g"),t=this.body.innerHTML.replace(/[\n\r]/g,"");return t=t.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,(function(e,t,i){return dtd.$block[i]?"\n":t||""})),t.replace(e,"").replace(/\u00a0/g," ").replace(/&nbsp;/g," ")},getContentTxt:function(){var e=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(e,"").replace(/\u00a0/g," ")},setContent:function(e,t,n){var o=this;o.fireEvent("beforesetcontent",e);var r,s=UE.htmlparser(e);function a(e){return"DIV"==e.tagName&&e.getAttribute("cdata_tag")}if(o.filterInputRule(s),e=s.toHtml(),o.body.innerHTML=(t?o.body.innerHTML:"")+e,"p"==o.options.enterTag){var l,c=this.body.firstChild;if(!c||1==c.nodeType&&(dtd.$cdata[c.tagName]||a(c)||domUtils.isCustomeNode(c))&&c===this.body.lastChild)this.body.innerHTML="<p>"+(browser.ie?"&nbsp;":"<br/>")+"</p>"+this.body.innerHTML;else{var d=o.document.createElement("p");while(c){while(c&&(3==c.nodeType||1==c.nodeType&&dtd.p[c.tagName]&&!dtd.$cdata[c.tagName]))l=c.nextSibling,d.appendChild(c),c=l;if(d.firstChild){if(!c){o.body.appendChild(d);break}c.parentNode.insertBefore(d,c),d=o.document.createElement("p")}c=c.nextSibling}}}o.fireEvent("aftersetcontent"),o.fireEvent("contentchange"),!n&&o._selectionChange(),o._bakRange=o._bakIERange=o._bakNativeRange=null,browser.gecko&&(r=this.selection.getNative())&&r.removeAllRanges(),o.options.autoSyncData&&o.form&&i(o.form,o)},focus:function(e){try{var t=this,i=t.selection.getRange();if(e){var n=t.body.lastChild;n&&1==n.nodeType&&!dtd.$empty[n.tagName]&&(domUtils.isEmptyBlock(n)?i.setStartAtFirst(n):i.setStartAtLast(n),i.collapse(!0)),i.setCursor(!0)}else{if(!i.collapsed&&domUtils.isBody(i.startContainer)&&0==i.startOffset){n=t.body.firstChild;n&&1==n.nodeType&&!dtd.$empty[n.tagName]&&i.setStartAtFirst(n).collapse(!0)}i.select(!0)}this.fireEvent("focus selectionchange")}catch(o){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var e=this.selection.getNative();if(e.empty&&browser.ie){var t=document.body.createTextRange();t.moveToElementText(document.body),t.collapse(!0),t.select(),e.empty()}else e.removeAllRanges()},_initEvents:function(){var e=this,t=e.document,i=e.window;e._proxyDomEvent=utils.bind(e._proxyDomEvent,e),domUtils.on(t,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],e._proxyDomEvent),domUtils.on(i,["focus","blur"],e._proxyDomEvent),domUtils.on(e.body,"drop",(function(t){browser.gecko&&t.stopPropagation&&t.stopPropagation(),e.fireEvent("contentchange")})),domUtils.on(t,["mouseup","keydown"],(function(t){"keydown"==t.type&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)||2!=t.button&&e._selectionChange(250,t)}))},_proxyDomEvent:function(e){return!1!==this.fireEvent("before"+e.type.replace(/^on/,"").toLowerCase())&&(!1!==this.fireEvent(e.type.replace(/^on/,""),e)&&this.fireEvent("after"+e.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(t,i){var n,o,r=this,s=!1;if(browser.ie&&browser.version<9&&i&&"mouseup"==i.type){var a=this.selection.getRange();a.collapsed||(s=!0,n=i.clientX,o=i.clientY)}clearTimeout(e),e=setTimeout((function(){if(r.selection&&r.selection.getNative()){var e,t;if(s&&"None"==r.selection.getNative().type){e=r.document.body.createTextRange();try{e.moveToPoint(n,o)}catch(a){e=null}}e&&(t=r.selection.getIERange,r.selection.getIERange=function(){return e}),r.selection.cache(),t&&(r.selection.getIERange=t),r.selection._cachedRange&&r.selection._cachedStartElement&&(r.fireEvent("beforeselectionchange"),r.fireEvent("selectionchange",!!i),r.fireEvent("afterselectionchange"),r.selection.clear())}}),t||50)},_callCmdFn:function(e,t){var i,n,o=t[0].toLowerCase();return i=this.commands[o]||UE.commands[o],n=i&&i[e],i&&n||"queryCommandState"!=e?n?n.apply(this,t):void 0:0},execCommand:function(e){e=e.toLowerCase();var t,i=this,n=i.commands[e]||UE.commands[e];return n&&n.execCommand?(n.notNeedUndo||i.__hasEnterExecCommand?(t=this._callCmdFn("execCommand",arguments),!i.__hasEnterExecCommand&&!n.ignoreContentChange&&!i._ignoreContentChange&&i.fireEvent("contentchange")):(i.__hasEnterExecCommand=!0,-1!=i.queryCommandState.apply(i,arguments)&&(i.fireEvent("saveScene"),i.fireEvent.apply(i,["beforeexeccommand",e].concat(arguments)),t=this._callCmdFn("execCommand",arguments),i.fireEvent.apply(i,["afterexeccommand",e].concat(arguments)),i.fireEvent("saveScene")),i.__hasEnterExecCommand=!1),!i.__hasEnterExecCommand&&!n.ignoreContentChange&&!i._ignoreContentChange&&i._selectionChange(),t):null},queryCommandState:function(e){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(e){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(e){if(e)for(var t,i=0;t=e[i++];)if(this.document.getElementsByTagName(t).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(e=["div"],i=0;t=e[i++];)for(var n,o=domUtils.getElementsByTagName(this.document,t),r=0;n=o[r++];)if(domUtils.isCustomeNode(n))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var e,t=this;if("false"==t.body.contentEditable){t.body.contentEditable=!0,e=t.selection.getRange();try{e.moveToBookmark(t.lastBk),delete t.lastBk}catch(i){e.setStartAtFirst(t.body).collapse(!0)}e.select(!0),t.bkqueryCommandState&&(t.queryCommandState=t.bkqueryCommandState,delete t.bkqueryCommandState),t.bkqueryCommandValue&&(t.queryCommandValue=t.bkqueryCommandValue,delete t.bkqueryCommandValue),t.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(e){var t=this;e=e?utils.isArray(e)?e:[e]:[],"true"==t.body.contentEditable&&(t.lastBk||(t.lastBk=t.selection.getRange().createBookmark(!0)),t.body.contentEditable=!1,t.bkqueryCommandState=t.queryCommandState,t.bkqueryCommandValue=t.queryCommandValue,t.queryCommandState=function(i){return-1!=utils.indexOf(e,i)?t.bkqueryCommandState.apply(t,arguments):-1},t.queryCommandValue=function(i){return-1!=utils.indexOf(e,i)?t.bkqueryCommandValue.apply(t,arguments):null},t.fireEvent("selectionchange"))},disable:function(e){return this.setDisabled(e)},_setDefaultContent:function(){function e(){var t=this;t.document.getElementById("initContent")&&(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",t.removeListener("firstBeforeExecCommand focus",e),setTimeout((function(){t.focus(),t._selectionChange()}),0))}return function(t){var i=this;i.body.innerHTML='<p id="initContent">'+t+"</p>",i.addListener("firstBeforeExecCommand focus",e)}}(),setShow:function(){var e=this,t=e.selection.getRange();if("none"==e.container.style.display){try{t.moveToBookmark(e.lastBk),delete e.lastBk}catch(i){t.setStartAtFirst(e.body).collapse(!0)}setTimeout((function(){t.select(!0)}),100),e.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var e=this;e.lastBk||(e.lastBk=e.selection.getRange().createBookmark(!0)),e.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(e){if(!this.options)return"";var t=UE.I18N[this.options.lang];if(!t)throw Error("not import language file");e=(e||"").split(".");for(var i,n=0;i=e[n++];)if(t=t[i],!t)break;return t},getContentLength:function(e,t){var i=this.getContent(!1,!1,!0).length;if(e){t=(t||[]).concat(["hr","img","iframe"]),i=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var n,o=0;n=t[o++];)i+=this.document.getElementsByTagName(n).length}return i},addInputRule:function(e){this.inputRules.push(e)},filterInputRule:function(e){for(var t,i=0;t=this.inputRules[i++];)t.call(this,e)},addOutputRule:function(e){this.outputRules.push(e)},filterOutputRule:function(e){for(var t,i=0;t=this.outputRules[i++];)t.call(this,e)},getActionUrl:function(e){var t=this.getOpt(e)||e,i=this.getOpt("imageUrl"),n=this.getOpt("serverUrl");return!n&&i&&(n=i.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2")),n?(n=n+(-1==n.indexOf("?")?"?":"&")+"action="+(t||""),utils.formatUrl(n)):""}},utils.inherits(r,EventBase)}(),UE.Editor.defaultOptions=function(e){var t=e.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:t+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:t+"lang/",theme:"default",themePath:t+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){var me=this;function showErrorMsg(e){console&&console.error(e)}setTimeout((function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function onsuccess(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}}))},UE.Editor.prototype.isServerConfigLoaded=function(){var e=this;return e._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(e){if(e&&utils.isFunction(e)){var t=this,i=function i(){e.apply(t,arguments),t.removeListener("serverConfigLoaded",i)};t.isServerConfigLoaded()?e.call(t,"serverConfigLoaded"):t.addListener("serverConfigLoaded",i)}}}(),UE.ajax=function(){var e="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP"),e="ActiveXObject('Msxml2.XMLHTTP')"}catch(r){try{new ActiveXObject("Microsoft.XMLHTTP"),e="ActiveXObject('Microsoft.XMLHTTP')"}catch(r){}}var t=new Function("return new "+e);function i(e){var t=[];for(var i in e)if("method"!=i&&"timeout"!=i&&"async"!=i&&"dataType"!=i&&"callback"!=i&&void 0!=e[i]&&null!=e[i])if("function"!=_typeof(e[i]).toLowerCase()&&"object"!=_typeof(e[i]).toLowerCase())t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));else if(utils.isArray(e[i]))for(var n=0;n<e[i].length;n++)t.push(encodeURIComponent(i)+"[]="+encodeURIComponent(e[i][n]));return t.join("&")}function n(e,n){var o=t(),r=!1,s={method:"POST",timeout:5e3,async:!0,data:{},onsuccess:function(){},onerror:function(){}};if("object"===_typeof(e)&&(n=e,e=n.url),o&&e){var a=n?utils.extend(s,n):s,l=i(a);utils.isEmptyObject(a.data)||(l+=(l?"&":"")+i(a.data));var c=setTimeout((function(){4!=o.readyState&&(r=!0,o.abort(),clearTimeout(c))}),a.timeout),d=a.method.toUpperCase(),u=e+(-1==e.indexOf("?")?"?":"&")+("POST"==d?"":l+"&noCache="+ +new Date);o.open(d,u,a.async),o.onreadystatechange=function(){4==o.readyState&&(r||200!=o.status?a.onerror(o):a.onsuccess(o))},"POST"==d?(o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.send(l)):o.send(null)}}function o(e,t){var n,o,s,a=t.onsuccess||function(){},l=document.createElement("SCRIPT"),c=t||{},d=c["charset"],u=c["jsonp"]||"callback",m=c["timeOut"]||0,p=new RegExp("(\\?|&)"+u+"=([^&]*)");utils.isFunction(a)?(n="bd__editor__"+Math.floor(2147483648*Math.random()).toString(36),window[n]=g(0)):utils.isString(a)?n=a:(s=p.exec(e))&&(n=s[2]),e=e.replace(p,"$1"+u+"="+n),e.search(p)<0&&(e+=(e.indexOf("?")<0?"?":"&")+u+"="+n);var h=i(t);function f(e,t,i){e.setAttribute("type","text/javascript"),e.setAttribute("defer","defer"),i&&e.setAttribute("charset",i),e.setAttribute("src",t),document.getElementsByTagName("head")[0].appendChild(e)}function g(e){return function(){try{if(e)c.onerror&&c.onerror();else try{clearTimeout(o),a.apply(window,arguments)}catch(r){}}catch(t){c.onerror&&c.onerror.call(window,t)}finally{c.oncomplete&&c.oncomplete.apply(window,arguments),l.parentNode&&l.parentNode.removeChild(l),window[n]=null;try{delete window[n]}catch(r){}}}}utils.isEmptyObject(t.data)||(h+=(h?"&":"")+i(t.data)),h&&(e=e.replace(/\?/,"?"+h+"&")),l.onerror=g(1),m&&(o=setTimeout(g(1),m)),f(l,e,d)}return{request:function(e,t){t&&"jsonp"==t.dataType?o(e,t):n(e,t)},getJSONP:function(e,t,i){var n={data:t,oncomplete:i};o(e,n)}}}();var filterWord=UE.filterWord=function(){function e(e){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test(e)}function t(e){return e=e.replace(/[\d.]+\w+/g,(function(e){return utils.transUnitToPx(e)})),e}function i(e){return e.replace(/[\t\r\n]+/g," ").replace(/<!--[\s\S]*?-->/gi,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,(function(e){if(browser.opera)return"";try{if(/Bitmap/i.test(e))return"";var i=e.match(/width:([ \d.]*p[tx])/i)[1],n=e.match(/height:([ \d.]*p[tx])/i)[1],o=e.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+t(i)+'" height="'+t(n)+'" src="'+o+'" />'}catch(r){return""}})).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,(function(e,t,i,n){return"class"==t&&"MsoListParagraph"==n?e:""})).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,(function(e,t,i){return i.replace(/[\t\r\n ]+/g," ")})).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,(function(e,i,n,o){for(var r,s=[],a=o.replace(/^\s+|\s+$/,"").replace(/&#39;/g,"'").replace(/&quot;/gi,"'").replace(/[\d.]+(cm|pt)/g,(function(e){return utils.transUnitToPx(e)})).split(/;\s*/g),l=0;r=a[l];l++){var c,d,u=r.split(":");if(2==u.length){if(c=u[0].toLowerCase(),d=u[1].toLowerCase(),/^(background)\w*/.test(c)&&0==d.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(c)&&/^0\w+$/.test(d))continue;switch(c){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/<table/.test(i)||(s[l]=c.replace(/^mso-|-alt$/g,"")+":"+t(d));continue;case"horiz-align":s[l]="text-align:"+d;continue;case"vert-align":s[l]="vertical-align:"+d;continue;case"font-color":case"mso-foreground":s[l]="color:"+d;continue;case"mso-background":case"mso-highlight":s[l]="background:"+d;continue;case"mso-default-height":s[l]="min-height:"+t(d);continue;case"mso-default-width":s[l]="min-width:"+t(d);continue;case"mso-padding-between-alt":s[l]="border-collapse:separate;border-spacing:"+t(d);continue;case"text-line-through":"single"!=d&&"double"!=d||(s[l]="text-decoration:line-through");continue;case"mso-zero-height":"yes"==d&&(s[l]="display:none");continue;case"margin":if(!/[1-9]/.test(d))continue}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(c)||/text\-indent|padding|margin/.test(c)&&/\-[\d.]+/.test(d))continue;s[l]=c+":"+u[1]}}return i+(s.length?' style="'+s.join(";").replace(/;{2,}/g,";")+'"':"")}))}return function(t){return e(t)?i(t):t}}();(function(){var e=UE.uNode=function(e){this.type=e.type,this.data=e.data,this.tagName=e.tagName,this.parentNode=e.parentNode,this.attrs=e.attrs||{},this.children=e.children},t={href:1,src:1,_src:1,_href:1,cdata_data:1},i={style:1,script:1},n=" ",o="\n";function r(e,t,i){return e.push(o),t+(i?1:-1)}function s(e,t){for(var i=0;i<t;i++)e.push(n)}function a(e,t,i,n){switch(e.type){case"root":for(var o,u=0;o=e.children[u++];)i&&"element"==o.type&&!dtd.$inlineWithA[o.tagName]&&u>1&&(r(t,n,!0),s(t,n)),a(o,t,i,n);break;case"text":l(e,t);break;case"element":c(e,t,i,n);break;case"comment":d(e,t,i)}return t}function l(e,t){"pre"==e.parentNode.tagName?t.push(e.data):t.push(i[e.parentNode.tagName]?utils.html(e.data):e.data.replace(/[ ]{2}/g," &nbsp;"))}function c(e,i,n,o){var l="";if(e.attrs){l=[];var c=e.attrs;for(var d in c)l.push(d+(void 0!==c[d]?'="'+(t[d]?utils.html(c[d]).replace(/["]/g,(function(e){return"&quot;"})):utils.unhtml(c[d]))+'"':""));l=l.join(" ")}if(i.push("<"+e.tagName+(l?" "+l:"")+(dtd.$empty[e.tagName]?"/":"")+">"),n&&!dtd.$inlineWithA[e.tagName]&&"pre"!=e.tagName&&e.children&&e.children.length&&(o=r(i,o,!0),s(i,o)),e.children&&e.children.length)for(var u,m=0;u=e.children[m++];)n&&"element"==u.type&&!dtd.$inlineWithA[u.tagName]&&m>1&&(r(i,o),s(i,o)),a(u,i,n,o);dtd.$empty[e.tagName]||(n&&!dtd.$inlineWithA[e.tagName]&&"pre"!=e.tagName&&e.children&&e.children.length&&(o=r(i,o),s(i,o)),i.push("</"+e.tagName+">"))}function d(e,t){t.push("\x3c!--"+e.data+"--\x3e")}function u(e,t){var i;if("element"==e.type&&e.getAttr("id")==t)return e;if(e.children&&e.children.length)for(var n,o=0;n=e.children[o++];)if(i=u(n,t))return i}function m(e,t,i){if("element"==e.type&&e.tagName==t&&i.push(e),e.children&&e.children.length)for(var n,o=0;n=e.children[o++];)m(n,t,i)}function p(e,t){if(e.children&&e.children.length)for(var i,n=0;i=e.children[n];)p(i,t),i.parentNode&&(i.children&&i.children.length&&t(i),i.parentNode&&n++);else t(e)}e.createElement=function(t){return/[<>]/.test(t)?UE.htmlparser(t).children[0]:new e({type:"element",children:[],tagName:t})},e.createText=function(e,t){return new UE.uNode({type:"text",data:t?e:utils.unhtml(e||"")})},e.prototype={toHtml:function(e){var t=[];return a(this,t,e,0),t.join("")},innerHTML:function(e){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(e)){if(this.children)for(var t=0;i=this.children[t++];)i.parentNode=null;this.children=[];var i,n=UE.htmlparser(e);for(t=0;i=n.children[t++];)this.children.push(i),i.parentNode=this;return this}n=new UE.uNode({type:"root",children:this.children});return n.toHtml()},innerText:function(t,i){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(t){if(this.children)for(var n,o=0;n=this.children[o++];)n.parentNode=null;return this.children=[],this.appendChild(e.createText(t,i)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var e,t=this.parentNode,i=0;e=t.children[i];i++)if(e===this)return 0==i?null:t.children[i-1]},nextSibling:function(){for(var e,t=this.parentNode,i=0;e=t.children[i++];)if(e===this)return t.children[i]},replaceChild:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n,1,e),t.parentNode=null,e.parentNode=this,e}},appendChild:function(e){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),e.parentNode&&e.parentNode.removeChild(e);for(var t,i=0;t=this.children[i];i++)if(t===e){this.children.splice(i,1);break}return this.children.push(e),e.parentNode=this,e}},insertBefore:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n,0,e),e.parentNode=this,e}},insertAfter:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n+1,0,e),e.parentNode=this,e}},removeChild:function(e,t){if(this.children)for(var i,n=0;i=this.children[n];n++)if(i===e){if(this.children.splice(n,1),i.parentNode=null,t&&i.children&&i.children.length)for(var o,r=0;o=i.children[r];r++)this.children.splice(n+r,0,o),o.parentNode=this;return i}},getAttr:function(e){return this.attrs&&this.attrs[e.toLowerCase()]},setAttr:function(e,t){if(e)if(this.attrs||(this.attrs={}),utils.isObject(e))for(var i in e)e[i]?this.attrs[i.toLowerCase()]=e[i]:delete this.attrs[i];else t?this.attrs[e.toLowerCase()]=t:delete this.attrs[e];else delete this.attrs},getIndex:function(){for(var e,t=this.parentNode,i=0;e=t.children[i];i++)if(e===this)return i;return-1},getNodeById:function(e){var t;if(this.children&&this.children.length)for(var i,n=0;i=this.children[n++];)if(t=u(i,e))return t},getNodesByTagName:function(e){e=utils.trim(e).replace(/[ ]{2,}/g," ").split(" ");var t=[],i=this;return utils.each(e,(function(e){if(i.children&&i.children.length)for(var n,o=0;n=i.children[o++];)m(n,e,t)})),t},getStyle:function(e){var t=this.getAttr("style");if(!t)return"";var i=new RegExp("(^|;)\\s*"+e+":([^;]+)","i"),n=t.match(i);return n&&n[0]?n[2]:""},setStyle:function(e,t){function i(e,t){var i=new RegExp("(^|;)\\s*"+e+":([^;]+;?)","gi");n=n.replace(i,"$1"),t&&(n=e+":"+utils.unhtml(t)+";"+n)}var n=this.getAttr("style");if(n||(n=""),utils.isObject(e))for(var o in e)i(o,e[o]);else i(e,t);this.setAttr("style",utils.trim(n))},traversal:function(e){return this.children&&this.children.length&&p(this,e),this}}})();var htmlparser=UE.htmlparser=function(e,t){var i=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,n=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,o={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};e=e.replace(new RegExp(domUtils.fillChar,"g"),""),t||(e=e.replace(new RegExp("[\\r\\t\\n"+(t?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(t?"":" ")+"]*","g"),(function(e,i){return i&&o[i.toLowerCase()]?e.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):e.replace(new RegExp("^[\\r\\n"+(t?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(t?"":" ")+"]+$"),"")})));var r={href:1,src:1},s=UE.uNode,a={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},l={ol:"li",ul:"li"};function c(e,t){if(l[e.tagName]){var i=s.createElement(l[e.tagName]);e.appendChild(i),i.appendChild(s.createText(t)),e=i}else e.appendChild(s.createText(t))}function d(e,t,i){var o;if(o=a[t]){var l,c=e;while("root"!=c.type){if(utils.isArray(o)?-1!=utils.indexOf(o,c.tagName):o==c.tagName){e=c,l=!0;break}c=c.parentNode}l||(e=d(e,utils.isArray(o)?o[0]:o))}var u=new s({parentNode:e,type:"element",tagName:t.toLowerCase(),children:dtd.$empty[t]?null:[]});if(i){var m,p={};while(m=n.exec(i))p[m[1].toLowerCase()]=r[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);u.attrs=p}return e.children.push(u),dtd.$empty[t]?e:u}function u(e,t){e.children.push(new s({type:"comment",data:t,parentNode:e}))}var m,p=0,h=0,f=new s({type:"root",children:[]}),g=f;while(m=i.exec(e)){p=m.index;try{if(p>h&&c(g,e.slice(h,p)),m[3])dtd.$cdata[g.tagName]?c(g,m[0]):g=d(g,m[3].toLowerCase(),m[4]);else if(m[1]){if("root"!=g.type)if(dtd.$cdata[g.tagName]&&!dtd.$cdata[m[1]])c(g,m[0]);else{var b=g;while("element"==g.type&&g.tagName!=m[1].toLowerCase())if(g=g.parentNode,"root"==g.type)throw g=b,"break";g=g.parentNode}}else m[2]&&u(g,m[2])}catch(v){}h=i.lastIndex}return h<e.length&&c(g,e.slice(h)),f},filterNode=UE.filterNode=function(){function e(t,i){switch(t.type){case"text":break;case"element":var n;if(n=i[t.tagName])if("-"===n)t.parentNode.removeChild(t);else if(utils.isFunction(n)){var o=t.parentNode,r=t.getIndex();if(n(t),t.parentNode){if(t.children)for(var s=0;m=t.children[s];)e(m,i),m.parentNode&&s++}else for(s=r;m=o.children[s];)e(m,i),m.parentNode&&s++}else{var a=n["$"];if(a&&t.attrs){var l,c={};for(var d in a){if(l=t.getAttr(d),"style"==d&&utils.isArray(a[d])){var u=[];utils.each(a[d],(function(e){var i;(i=t.getStyle(e))&&u.push(e+":"+i)})),l=u.join(";")}l&&(c[d]=l)}t.attrs=c}if(t.children)for(s=0;m=t.children[s];)e(m,i),m.parentNode&&s++}else if(dtd.$cdata[t.tagName])t.parentNode.removeChild(t);else{o=t.parentNode,r=t.getIndex();t.parentNode.removeChild(t,!0);var m;for(s=r;m=o.children[s];)e(m,i),m.parentNode&&s++}break;case"comment":t.parentNode.removeChild(t)}}return function(t,i){if(utils.isEmptyObject(i))return t;var n;(n=i["-"])&&utils.each(n.split(" "),(function(e){i[e]="-"}));for(var o,r=0;o=t.children[r];)e(o,i),o.parentNode&&r++;return t}}();UE.plugin=function(){var e={};return{register:function(t,i,n,o){n&&utils.isFunction(n)&&(o=n,n=null),e[t]={optionName:n||t,execFn:i,afterDisabled:o}},load:function(t){utils.each(e,(function(e){var i=e.execFn.call(t);!1!==t.options[e.optionName]?i&&utils.each(i,(function(e,i){switch(i.toLowerCase()){case"shortcutkey":t.addshortcutkey(e);break;case"bindevents":utils.each(e,(function(e,i){t.addListener(i,e)}));break;case"bindmultievents":utils.each(utils.isArray(e)?e:[e],(function(e){var i=utils.trim(e.type).split(/\s+/);utils.each(i,(function(i){t.addListener(i,e.handler)}))}));break;case"commands":utils.each(e,(function(e,i){t.commands[i]=e}));break;case"outputrule":t.addOutputRule(e);break;case"inputrule":t.addInputRule(e);break;case"defaultoptions":t.setOpt(e)}})):e.afterDisabled&&e.afterDisabled.call(t)})),utils.each(UE.plugins,(function(e){e.call(t)}))},run:function(t,i){var n=e[t];n&&n.exeFn.call(i)}}}();var keymap=UE.keymap={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,CapsLock:20,Esc:27,Spacebar:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Del:46,NumLock:144,Cmd:91,"=":187,"-":189,b:66,i:73,z:90,y:89,v:86,x:88,s:83,n:78},LocalStorage=UE.LocalStorage=function(){var e=window.localStorage||i()||null,t="localStorage";return{saveLocalData:function(t,i){return!(!e||!i)&&(e.setItem(t,i),!0)},getLocalData:function(t){return e?e.getItem(t):null},removeItem:function(t){e&&e.removeItem(t)}};function i(){var e=document.createElement("div");return e.style.display="none",e.addBehavior?(e.addBehavior("#default#userdata"),{getItem:function(i){var n=null;try{document.body.appendChild(e),e.load(t),n=e.getAttribute(i),document.body.removeChild(e)}catch(o){}return n},setItem:function(i,n){document.body.appendChild(e),e.setAttribute(i,n),e.save(t),document.body.removeChild(e)},removeItem:function(i){document.body.appendChild(e),e.removeAttribute(i),e.save(t),document.body.removeChild(e)}}):null}}();(function(){var e="ueditor_preference";UE.Editor.prototype.setPreferences=function(t,i){var n={};utils.isString(t)?n[t]=i:n=t;var o=LocalStorage.getLocalData(e);o&&(o=utils.str2json(o))?utils.extend(o,n):o=n,o&&LocalStorage.saveLocalData(e,utils.json2str(o))},UE.Editor.prototype.getPreferences=function(t){var i=LocalStorage.getLocalData(e);return i&&(i=utils.str2json(i))?t?i[t]:i:null},UE.Editor.prototype.removePreferences=function(t){var i=LocalStorage.getLocalData(e);i&&(i=utils.str2json(i))&&(i[t]=void 0,delete i[t]),i&&LocalStorage.saveLocalData(e,utils.json2str(i))}})(),UE.plugins["defaultfilter"]=function(){var e=this;e.setOpt({allowDivTransToP:!0,disabledTableInTable:!0}),e.addInputRule((function(t){var i,n=this.options.allowDivTransToP;function o(e){while(e&&"element"==e.type){if("td"==e.tagName)return!0;e=e.parentNode}return!1}t.traversal((function(t){if("element"==t.type){if(!dtd.$cdata[t.tagName]&&e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"style":case"script":t.setAttr({cdata_tag:t.tagName,cdata_data:t.innerHTML()||"",_ue_custom_node_:"true"}),t.tagName="div",t.innerHTML("");break;case"a":(i=t.getAttr("href"))&&t.setAttr("_href",i);break;case"img":if((i=t.getAttr("src"))&&/^data:/.test(i)){t.parentNode.removeChild(t);break}t.setAttr("_src",t.getAttr("src"));break;case"span":browser.webkit&&(i=t.getStyle("white-space"))&&/nowrap|normal/.test(i)&&(t.setStyle("white-space",""),e.options.autoClearEmptyNode&&utils.isEmptyObject(t.attrs)&&t.parentNode.removeChild(t,!0)),i=t.getAttr("id"),i&&/^_baidu_bookmark_/i.test(i)&&t.parentNode.removeChild(t);break;case"p":(i=t.getAttr("align"))&&(t.setAttr("align"),t.setStyle("text-align",i)),utils.each(t.children,(function(e){if("element"==e.type&&"p"==e.tagName){var i=e.nextSibling();t.parentNode.insertAfter(e,t);var n=e;while(i){var o=i.nextSibling();t.parentNode.insertAfter(i,n),n=i,i=o}return!1}})),t.firstChild()||t.innerHTML(browser.ie?"&nbsp;":"<br/>");break;case"div":if(t.getAttr("cdata_tag"))break;if(i=t.getAttr("class"),i&&/^line number\d+/.test(i))break;if(!n)break;var r,s=UE.uNode.createElement("p");while(r=t.firstChild())"text"!=r.type&&UE.dom.dtd.$block[r.tagName]?s.firstChild()?(t.parentNode.insertBefore(s,t),s=UE.uNode.createElement("p")):t.parentNode.insertBefore(r,t):s.appendChild(r);s.firstChild()&&t.parentNode.insertBefore(s,t),t.parentNode.removeChild(t);break;case"dl":t.tagName="ul";break;case"dt":case"dd":t.tagName="li";break;case"li":var a=t.getAttr("class");a&&/list\-/.test(a)||t.setAttr();var l=t.getNodesByTagName("ol ul");UE.utils.each(l,(function(e){t.parentNode.insertAfter(e,t)}));break;case"td":case"th":case"caption":t.children&&t.children.length||t.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":e.options.disabledTableInTable&&o(t)&&(t.parentNode.insertBefore(UE.uNode.createText(t.innerText()),t),t.parentNode.removeChild(t))}}}))})),e.addOutputRule((function(t){var i;t.traversal((function(t){if("element"==t.type){if(e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"div":(i=t.getAttr("cdata_tag"))&&(t.tagName=i,t.appendChild(UE.uNode.createText(t.getAttr("cdata_data"))),t.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(i=t.getAttr("_href"))&&t.setAttr({href:utils.html(i),_href:""});break;case"span":i=t.getAttr("id"),i&&/^_baidu_bookmark_/i.test(i)&&t.parentNode.removeChild(t);break;case"img":(i=t.getAttr("_src"))&&t.setAttr({src:t.getAttr("_src"),_src:""})}}}))}))},UE.commands["inserthtml"]={execCommand:function(e,t,i){var n,o,r=this;if(t&&!0!==r.fireEvent("beforeinserthtml",t)){if(n=r.selection.getRange(),o=n.document.createElement("div"),o.style.display="inline",!i){var s=UE.htmlparser(t);r.options.filterRules&&UE.filterNode(s,r.options.filterRules),r.filterInputRule(s),t=s.toHtml()}if(o.innerHTML=utils.trim(t),!n.collapsed){var a=n.startContainer;if(domUtils.isFillChar(a)&&n.setStartBefore(a),a=n.endContainer,domUtils.isFillChar(a)&&n.setEndAfter(a),n.txtToElmBoundary(),n.endContainer&&1==n.endContainer.nodeType&&(a=n.endContainer.childNodes[n.endOffset],a&&domUtils.isBr(a)&&n.setEndAfter(a)),0==n.startOffset&&(a=n.startContainer,domUtils.isBoundaryNode(a,"firstChild")&&(a=n.endContainer,n.endOffset==(3==a.nodeType?a.nodeValue.length:a.childNodes.length)&&domUtils.isBoundaryNode(a,"lastChild")&&(r.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",n.setStart(r.body.firstChild,0).collapse(!0)))),!n.collapsed&&n.deleteContents(),1==n.startContainer.nodeType){var l=n.startContainer.childNodes[n.startOffset];if(l&&domUtils.isBlockElm(l)&&(b=l.previousSibling)&&domUtils.isBlockElm(b)){n.setEnd(b,b.childNodes.length).collapse();while(l.firstChild)b.appendChild(l.firstChild);domUtils.remove(l)}}}var c,d,u,m=0;n.inFillChar()&&(l=n.startContainer,domUtils.isFillChar(l)?(n.setStartBefore(l).collapse(!0),domUtils.remove(l)):domUtils.isFillChar(l,!0)&&(l.nodeValue=l.nodeValue.replace(fillCharReg,""),n.startOffset--,n.collapsed&&n.collapse(!0)));var p=domUtils.findParentByTagName(n.startContainer,"li",!0);if(p){var h;while(l=o.firstChild){while(l&&(3==l.nodeType||!domUtils.isBlockElm(l)||"HR"==l.tagName))v=l.nextSibling,n.insertNode(l).collapse(),h=l,l=v;if(l)if(/^(ol|ul)$/i.test(l.tagName)){while(l.firstChild)h=l.firstChild,domUtils.insertAfter(p,l.firstChild),p=p.nextSibling;domUtils.remove(l)}else{var f;v=l.nextSibling,f=r.document.createElement("li"),domUtils.insertAfter(p,f),f.appendChild(l),h=l,l=v,p=f}}p=domUtils.findParentByTagName(n.startContainer,"li",!0),domUtils.isEmptyBlock(p)&&domUtils.remove(p),h&&n.setStartAfter(h).collapse(!0).select(!0)}else{while(l=o.firstChild){if(m){var g=r.document.createElement("p");while(l&&(3==l.nodeType||!dtd.$block[l.tagName]))u=l.nextSibling,g.appendChild(l),l=u;g.firstChild&&(l=g)}if(n.insertNode(l),u=l.nextSibling,!m&&l.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(l)&&(c=domUtils.findParent(l,(function(e){return domUtils.isBlockElm(e)})),c&&"body"!=c.tagName.toLowerCase()&&(!dtd[c.tagName][l.nodeName]||l.parentNode!==c))){if(dtd[c.tagName][l.nodeName]){d=l.parentNode;while(d!==c)b=d,d=d.parentNode}else b=c;domUtils.breakParent(l,b||d);var b=l.previousSibling;domUtils.trimWhiteTextNode(b),b.childNodes.length||domUtils.remove(b),!browser.ie&&(v=l.nextSibling)&&domUtils.isBlockElm(v)&&v.lastChild&&!domUtils.isBr(v.lastChild)&&v.appendChild(r.document.createElement("br")),m=1}var v=l.nextSibling;if(!o.firstChild&&v&&domUtils.isBlockElm(v)){n.setStart(v,0).collapse(!0);break}n.setEndAfter(l).collapse()}if(l=n.startContainer,u&&domUtils.isBr(u)&&domUtils.remove(u),domUtils.isBlockElm(l)&&domUtils.isEmptyNode(l))if(u=l.nextSibling)domUtils.remove(l),1==u.nodeType&&dtd.$block[u.tagName]&&n.setStart(u,0).collapse(!0).shrinkBoundary();else try{l.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}catch(y){n.setStartBefore(l),domUtils.remove(l)}try{n.select(!0)}catch(y){}}setTimeout((function(){n=r.selection.getRange(),n.scrollToView(r.autoHeightEnabled,r.autoHeightEnabled?domUtils.getXY(r.iframe).y:0),r.fireEvent("afterinserthtml",t)}),200)}}},UE.plugins["autotypeset"]=function(){this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:utils.extend({div:1},dtd.$removeEmpty),indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1}});var e,t=this,i=t.options.autotypeset,n={selectTdClass:1,pagebreak:1,anchorclass:1},o={li:1},r={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1};function s(t,i){return t&&3!=t.nodeType?domUtils.isBr(t)?1:t&&t.parentNode&&r[t.tagName.toLowerCase()]?e&&e.contains(t)||t.getAttribute("pagebreak")?0:i?!domUtils.isEmptyBlock(t):domUtils.isEmptyBlock(t,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function a(e){e.style.cssText||(domUtils.removeAttributes(e,["style"]),"span"==e.tagName.toLowerCase()&&domUtils.hasNoAttributes(e)&&domUtils.remove(e,!0))}function l(t,r){var l,u=this;if(r){if(!i.pasteFilter)return;l=u.document.createElement("div"),l.innerHTML=r.html}else l=u.document.body;for(var m,p=domUtils.getElementsByTagName(l,"*"),h=0;m=p[h++];)if(!0!==u.fireEvent("excludeNodeinautotype",m)){if(i.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),a(m)),i.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),a(m)),s(m)){if(i.mergeEmptyline){var f=m.nextSibling,g=domUtils.isBr(m);while(s(f)){if(v=f,f=v.nextSibling,g&&(!f||f&&!domUtils.isBr(f)))break;domUtils.remove(v)}}if(i.removeEmptyline&&domUtils.inDoc(m,l)&&!o[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(f=m.nextSibling,f&&!domUtils.isBr(f)))continue;domUtils.remove(m);continue}}if(s(m,!0)&&"SPAN"!=m.tagName&&(i.indent&&(m.style.textIndent=i.indentValue),i.textAlign&&(m.style.textAlign=i.textAlign)),i.removeClass&&m.className&&!n[m.className.toLowerCase()]){if(e&&e.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(i.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(r){var b=m;switch(i.imageBlockLine){case"left":case"right":case"none":var v,y,C=b.parentNode;while(dtd.$inline[C.tagName]||"A"==C.tagName)C=C.parentNode;if(v=C,"P"==v.tagName&&"center"==domUtils.getStyle(v,"text-align")&&!domUtils.isBody(v)&&1==domUtils.getChildCount(v,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})))if(y=v.previousSibling,f=v.nextSibling,y&&f&&1==y.nodeType&&1==f.nodeType&&y.tagName==f.tagName&&domUtils.isBlockElm(y)){y.appendChild(v.firstChild);while(f.firstChild)y.appendChild(f.firstChild);domUtils.remove(v),domUtils.remove(f)}else domUtils.setStyle(v,"text-align","");domUtils.setStyle(b,"float",i.imageBlockLine);break;case"center":if("center"!=u.queryCommandValue("imagefloat")){C=b.parentNode,domUtils.setStyle(b,"float","none"),v=b;while(C&&1==domUtils.getChildCount(C,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))&&(dtd.$inline[C.tagName]||"A"==C.tagName))v=C,C=C.parentNode;var x=u.document.createElement("p");domUtils.setAttributes(x,{style:"text-align:center"}),v.parentNode.insertBefore(x,v),x.appendChild(v),domUtils.setStyle(v,"float","")}}}else{var w=u.selection.getRange();w.selectNode(m).select(),u.execCommand("imagefloat",i.imageBlockLine)}i.removeEmptyNode&&i.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(i.tobdc){var T=UE.htmlparser(l.innerHTML);T.traversal((function(e){"text"==e.type&&(e.data=d(e.data))})),l.innerHTML=T.toHtml()}if(i.bdc2sb){T=UE.htmlparser(l.innerHTML);T.traversal((function(e){"text"==e.type&&(e.data=c(e.data))})),l.innerHTML=T.toHtml()}r&&(r.html=l.innerHTML)}function c(e){for(var t="",i=0;i<e.length;i++){var n=e.charCodeAt(i);t+=n>=65281&&n<=65373?String.fromCharCode(e.charCodeAt(i)-65248):12288==n?String.fromCharCode(e.charCodeAt(i)-12288+32):e.charAt(i)}return t}function d(e){e=utils.html(e);for(var t="",i=0;i<e.length;i++)32==e.charCodeAt(i)?t+=String.fromCharCode(12288):e.charCodeAt(i)<127?t+=String.fromCharCode(e.charCodeAt(i)+65248):t+=e.charAt(i);return t}function u(){var e=t.getPreferences("autotypeset");utils.extend(t.options.autotypeset,e)}i&&(u(),i.pasteFilter&&t.addListener("beforepaste",l),t.commands["autotypeset"]={execCommand:function(){t.removeListener("beforepaste",l),i.pasteFilter&&t.addListener("beforepaste",l),l.call(t)}})},UE.plugin.register("autosubmit",(function(){return{shortcutkey:{autosubmit:"ctrl+13"},commands:{autosubmit:{execCommand:function(){var e=this,t=domUtils.findParentByTagName(e.iframe,"form",!1);if(t){if(!1===e.fireEvent("beforesubmit"))return;e.sync(),t.submit()}}}}}})),UE.plugin.register("background",(function(){var e,t=this,i="editor_background",n=new RegExp("body[\\s]*\\{(.+)\\}","i");function o(e){var t={},i=e.split(";");return utils.each(i,(function(e){var i=e.indexOf(":"),n=utils.trim(e.substr(0,i)).toLowerCase();n&&(t[n]=utils.trim(e.substr(i+1)||""))})),t}function r(e){if(e){var n=[];for(var o in e)e.hasOwnProperty(o)&&n.push(o+":"+e[o]+"; ");utils.cssRule(i,n.length?"body{"+n.join("")+"}":"",t.document)}else utils.cssRule(i,"",t.document)}var s=t.hasContents;return t.hasContents=function(){return!!t.queryCommandValue("background")||s.apply(t,arguments)},{bindEvents:{getAllHtml:function(e,i){var n=this.body,o=domUtils.getComputedStyle(n,"background-image"),r="";r=o.indexOf(t.options.imagePath)>0?o.substring(o.indexOf(t.options.imagePath),o.length-1).replace(/"|\(|\)/gi,""):"none"!=o?o.replace(/url\("?|"?\)/gi,""):"";var s='<style type="text/css">body{',a={"background-color":domUtils.getComputedStyle(n,"background-color")||"#ffffff","background-image":r?"url("+r+")":"","background-repeat":domUtils.getComputedStyle(n,"background-repeat")||"","background-position":browser.ie?domUtils.getComputedStyle(n,"background-position-x")+" "+domUtils.getComputedStyle(n,"background-position-y"):domUtils.getComputedStyle(n,"background-position"),height:domUtils.getComputedStyle(n,"height")};for(var l in a)a.hasOwnProperty(l)&&(s+=l+":"+a[l]+"; ");s+="}</style> ",i.push(s)},aftersetcontent:function(){0==e&&r()}},inputRule:function(t){e=!1,utils.each(t.getNodesByTagName("p"),(function(t){var i=t.getAttr("data-background");i&&(e=!0,r(o(i)),t.parentNode.removeChild(t))}))},outputRule:function(e){var t=this,o=(utils.cssRule(i,t.document)||"").replace(/[\n\r]+/g,"").match(n);o&&e.appendChild(UE.uNode.createElement('<p style="display:none;" data-background="'+utils.trim(o[1].replace(/"/g,"").replace(/[\s]+/g," "))+'"><br/></p>'))},commands:{background:{execCommand:function(e,t){r(t)},queryCommandValue:function(){var e=this,t=(utils.cssRule(i,e.document)||"").replace(/[\n\r]+/g,"").match(n);return t?o(t[1]):null},notNeedUndo:!0}}}})),UE.commands["imagefloat"]={execCommand:function(e,t){var i=this,n=i.selection.getRange();if(!n.collapsed){var o=n.getClosedNode();if(o&&"IMG"==o.tagName)switch(t){case"left":case"right":case"none":var r,s,a,l=o.parentNode;while(dtd.$inline[l.tagName]||"A"==l.tagName)l=l.parentNode;if(r=l,"P"==r.tagName&&"center"==domUtils.getStyle(r,"text-align")){if(!domUtils.isBody(r)&&1==domUtils.getChildCount(r,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})))if(s=r.previousSibling,a=r.nextSibling,s&&a&&1==s.nodeType&&1==a.nodeType&&s.tagName==a.tagName&&domUtils.isBlockElm(s)){s.appendChild(r.firstChild);while(a.firstChild)s.appendChild(a.firstChild);domUtils.remove(r),domUtils.remove(a)}else domUtils.setStyle(r,"text-align","");n.selectNode(o).select()}domUtils.setStyle(o,"float","none"==t?"":t),"none"==t&&domUtils.removeAttributes(o,"align");break;case"center":if("center"!=i.queryCommandValue("imagefloat")){l=o.parentNode,domUtils.setStyle(o,"float",""),domUtils.removeAttributes(o,"align"),r=o;while(l&&1==domUtils.getChildCount(l,(function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))&&(dtd.$inline[l.tagName]||"A"==l.tagName))r=l,l=l.parentNode;n.setStartBefore(r).setCursor(!1),l=i.document.createElement("div"),l.appendChild(r),domUtils.setStyle(r,"float",""),i.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+l.innerHTML+"</p>"),r=i.document.getElementById("_img_parent_tmp"),r.removeAttribute("id"),r=r.firstChild,n.selectNode(r).select(),a=r.parentNode.nextSibling,a&&domUtils.isEmptyNode(a)&&domUtils.remove(a)}break}}},queryCommandValue:function(){var e,t,i=this.selection.getRange();return i.collapsed?"none":(e=i.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?(t=domUtils.getComputedStyle(e,"float")||e.getAttribute("align"),"none"==t&&(t="center"==domUtils.getComputedStyle(e.parentNode,"text-align")?"center":t),{left:1,right:1,center:1}[t]?t:"none"):"none")},queryCommandState:function(){var e,t=this.selection.getRange();return t.collapsed?-1:(e=t.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?0:-1)}},UE.commands["insertimage"]={execCommand:function(e,t){if(t=utils.isArray(t)?t:[t],t.length){var i=this,n=i.selection.getRange(),o=n.getClosedNode();if(!0!==i.fireEvent("beforeinsertimage",t)){if(!o||!/img/i.test(o.tagName)||"edui-faked-video"==o.className&&-1==o.className.indexOf("edui-upload-video")||o.getAttribute("word_img")){var r,s=[],a="";if(r=t[0],1==t.length)u(r),a='<img src="'+r.src+'" '+(r._src?' _src="'+r._src+'" ':"")+(r.width?'width="'+r.width+'" ':"")+(r.height?' height="'+r.height+'" ':"")+("left"==r["floatStyle"]||"right"==r["floatStyle"]?' style="float:'+r["floatStyle"]+';"':"")+(r.title&&""!=r.title?' title="'+r.title+'"':"")+(r.border&&"0"!=r.border?' border="'+r.border+'"':"")+(r.alt&&""!=r.alt?' alt="'+r.alt+'"':"")+(r.hspace&&"0"!=r.hspace?' hspace = "'+r.hspace+'"':"")+(r.vspace&&"0"!=r.vspace?' vspace = "'+r.vspace+'"':"")+"/>","center"==r["floatStyle"]&&(a='<p style="text-align: center">'+a+"</p>"),s.push(a);else for(var l=0;r=t[l++];)u(r),a="<p "+("center"==r["floatStyle"]?'style="text-align: center" ':"")+'><img src="'+r.src+'" '+(r.width?'width="'+r.width+'" ':"")+(r._src?' _src="'+r._src+'" ':"")+(r.height?' height="'+r.height+'" ':"")+' style="'+(r["floatStyle"]&&"center"!=r["floatStyle"]?"float:"+r["floatStyle"]+";":"")+(r.border||"")+'" '+(r.title?' title="'+r.title+'"':"")+" /></p>",s.push(a);i.execCommand("insertHtml",s.join(""))}else{var c=t.shift(),d=c["floatStyle"];delete c["floatStyle"],domUtils.setAttributes(o,c),i.execCommand("imagefloat",d),t.length>0&&(n.setStartAfter(o).setCursor(!1,!0),i.execCommand("insertimage",t))}i.fireEvent("afterinsertimage",t)}}function u(e){utils.each("width,height,border,hspace,vspace".split(","),(function(t){e[t]&&(e[t]=parseInt(e[t],10)||0)})),utils.each("src,_src".split(","),(function(t){e[t]&&(e[t]=utils.unhtmlForUrl(e[t]))})),utils.each("title,alt".split(","),(function(t){e[t]&&(e[t]=utils.unhtml(e[t]))}))}}},UE.plugins["justify"]=function(){var e=domUtils.isBlockElm,t={left:1,right:1,center:1,justify:1},i=function(t,i){var n=t.createBookmark(),o=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};t.enlarge(!0);var r,s=t.createBookmark(),a=domUtils.getNextDomNode(s.start,!1,o),l=t.cloneRange();while(a&&!(domUtils.getPosition(a,s.end)&domUtils.POSITION_FOLLOWING))if(3!=a.nodeType&&e(a))a=domUtils.getNextDomNode(a,!0,o);else{l.setStartBefore(a);while(a&&a!==s.end&&!e(a))r=a,a=domUtils.getNextDomNode(a,!1,null,(function(t){return!e(t)}));l.setEndAfter(r);var c=l.getCommonAncestor();if(!domUtils.isBody(c)&&e(c))domUtils.setStyles(c,utils.isString(i)?{"text-align":i}:i),a=c;else{var d=t.document.createElement("p");domUtils.setStyles(d,utils.isString(i)?{"text-align":i}:i);var u=l.extractContents();d.appendChild(u),l.insertNode(d),a=d}a=domUtils.getNextDomNode(a,!1,o)}return t.moveToBookmark(s).moveToBookmark(n)};UE.commands["justify"]={execCommand:function(e,t){var n,o=this.selection.getRange();return o.collapsed&&(n=this.document.createTextNode("p"),o.insertNode(n)),i(o,t),n&&(o.setStartBefore(n).collapse(!0),domUtils.remove(n)),o.select(),!0},queryCommandValue:function(){var e=this.selection.getStart(),i=domUtils.getComputedStyle(e,"text-align");return t[i]?i:"left"},queryCommandState:function(){var e=this.selection.getStart(),t=e&&domUtils.findParentByTagName(e,["td","th","caption"],!0);return t?-1:0}}},UE.plugins["font"]=function(){var e=this,t={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},i={underline:1,strikethrough:1,fontborder:1},n={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};function o(e){var t;while(t=e.parentNode){if("SPAN"!=t.tagName||1!=domUtils.getChildCount(t,(function(e){return!domUtils.isBookmarkNode(e)&&!domUtils.isBr(e)})))break;t.style.cssText+=e.style.cssText,domUtils.remove(e,!0),e=t}}function r(e,t,i){if(n[t]&&(e.adjustmentBoundary(),!e.collapsed&&1==e.startContainer.nodeType)){var o=e.startContainer.childNodes[e.startOffset];if(o&&domUtils.isTagNode(o,"span")){var r=e.createBookmark();utils.each(domUtils.getElementsByTagName(o,"span"),(function(e){e.parentNode&&!domUtils.isBookmarkNode(e)&&("backcolor"==t&&domUtils.getComputedStyle(e,"background-color").toLowerCase()===i||(domUtils.removeStyle(e,n[t]),0==e.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(e,!0)))})),e.moveToBookmark(r)}}}function s(e,t,i){var n,s=e.collapsed,a=e.createBookmark();if(s){n=a.start.parentNode;while(dtd.$inline[n.tagName])n=n.parentNode}else n=domUtils.getCommonAncestor(a.start,a.end);utils.each(domUtils.getElementsByTagName(n,"span"),(function(e){if(e.parentNode&&!domUtils.isBookmarkNode(e))if(/\s*border\s*:\s*none;?\s*/i.test(e.style.cssText))/^\s*border\s*:\s*none;?\s*$/.test(e.style.cssText)?domUtils.remove(e,!0):domUtils.removeStyle(e,"border");else{if(/border/i.test(e.style.cssText)&&"SPAN"==e.parentNode.tagName&&/border/i.test(e.parentNode.style.cssText)&&(e.style.cssText=e.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=t||"none"!=i){var n=e.nextSibling;while(n&&1==n.nodeType&&"SPAN"==n.tagName)if(domUtils.isBookmarkNode(n)&&"fontborder"==t)e.appendChild(n),n=e.nextSibling;else{if(n.style.cssText==e.style.cssText&&(domUtils.moveChild(n,e),domUtils.remove(n)),e.nextSibling===n)break;n=e.nextSibling}}if(o(e),browser.ie&&browser.version>8){var r=domUtils.findParent(e,(function(e){return"SPAN"==e.tagName&&/background-color/.test(e.style.cssText)}));r&&!/background-color/.test(e.style.cssText)&&(e.style.backgroundColor=r.style.backgroundColor)}}})),e.moveToBookmark(a),r(e,t,i)}for(var a in e.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),e.addInputRule((function(e){utils.each(e.getNodesByTagName("u s del font strike"),(function(e){if("font"==e.tagName){var t=[];for(var i in e.attrs)switch(i){case"size":t.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[e.attrs[i]]||e.attrs[i])+"px");break;case"color":t.push("color:"+e.attrs[i]);break;case"face":t.push("font-family:"+e.attrs[i]);break;case"style":t.push(e.attrs[i])}e.attrs={style:t.join(";")}}else{var n="u"==e.tagName?"underline":"line-through";e.attrs={style:(e.getAttr("style")||"")+"text-decoration:"+n+";"}}e.tagName="span"}))})),t)(function(e,t){UE.commands[e]={execCommand:function(n,o){o=o||(this.queryCommandState(n)?"none":"underline"==n?"underline":"fontborder"==n?"1px solid #000":"line-through");var r,a=this,l=this.selection.getRange();if("default"==o)l.collapsed&&(r=a.document.createTextNode("font"),l.insertNode(r).select()),a.execCommand("removeFormat","span,a",t),r&&(l.setStartBefore(r).collapse(!0),domUtils.remove(r)),s(l,n,o),l.select();else if(l.collapsed){var c=domUtils.findParentByTagName(l.startContainer,"span",!0);if(r=a.document.createTextNode("font"),!c||c.children.length||c[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(l.insertNode(r),l.selectNode(r).select(),c=l.document.createElement("span"),i[e]){if(domUtils.findParentByTagName(r,"a",!0))return l.setStartBefore(r).setCursor(),void domUtils.remove(r);a.execCommand("removeFormat","span,a",t)}if(c.style.cssText=t+":"+o,r.parentNode.insertBefore(c,r),!browser.ie||browser.ie&&9==browser.version){var d=c.parentNode;while(!domUtils.isBlockElm(d))"SPAN"==d.tagName&&(c.style.cssText=d.style.cssText+";"+c.style.cssText),d=d.parentNode}opera?setTimeout((function(){l.setStart(c,0).collapse(!0),s(l,n,o),l.select()})):(l.setStart(c,0).collapse(!0),s(l,n,o),l.select())}else l.insertNode(r),i[e]&&(l.selectNode(r).select(),a.execCommand("removeFormat","span,a",t,null),c=domUtils.findParentByTagName(r,"span",!0),l.setStartBefore(r)),c&&(c.style.cssText+=";"+t+":"+o),l.collapse(!0).select();domUtils.remove(r)}else i[e]&&a.queryCommandValue(e)&&a.execCommand("removeFormat","span,a",t),l=a.selection.getRange(),l.applyInlineStyle("span",{style:t+":"+o}),s(l,n,o),l.select();return!0},queryCommandValue:function(e){var i=this.selection.getStart();if("underline"==e||"strikethrough"==e){var n,o=i;while(o&&!domUtils.isBlockElm(o)&&!domUtils.isBody(o)){if(1==o.nodeType&&(n=domUtils.getComputedStyle(o,t),"none"!=n))return n;o=o.parentNode}return"none"}if("fontborder"==e){var r,s=i;while(s&&dtd.$inline[s.tagName]){if((r=domUtils.getComputedStyle(s,"border"))&&/1px/.test(r)&&/solid/.test(r))return r;s=s.parentNode}return""}if("FontSize"==e){var a=domUtils.getComputedStyle(i,t);s=/^([\d\.]+)(\w+)$/.exec(a);return s?Math.floor(s[1])+s[2]:a}return domUtils.getComputedStyle(i,t)},queryCommandState:function(e){if(!i[e])return 0;var t=this.queryCommandValue(e);return"fontborder"==e?/1px/.test(t)&&/solid/.test(t):"underline"==e?/underline/.test(t):/line\-through/.test(t)}}})(a,t[a])},UE.plugins["link"]=function(){function e(e){var t=e.startContainer,i=e.endContainer;(t=domUtils.findParentByTagName(t,"a",!0))&&e.setStartBefore(t),(i=domUtils.findParentByTagName(i,"a",!0))&&e.setEndAfter(i)}function t(t,i,n){var o=t.cloneRange(),r=n.queryCommandValue("link");e(t=t.adjustmentBoundary());var s=t.startContainer;if(1==s.nodeType&&r&&(s=s.childNodes[t.startOffset],s&&1==s.nodeType&&"A"==s.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(s[browser.ie?"innerText":"textContent"])&&(s[browser.ie?"innerText":"textContent"]=utils.html(i.textValue||i.href))),o.collapsed&&!r||(t.removeInlineStyle("a"),o=t.cloneRange()),o.collapsed){var a=t.document.createElement("a"),l="";i.textValue?(l=utils.html(i.textValue),delete i.textValue):l=utils.html(i.href),domUtils.setAttributes(a,i),s=domUtils.findParentByTagName(o.startContainer,"a",!0),s&&domUtils.isInNodeEndBoundary(o,s)&&t.setStartAfter(s).collapse(!0),a[browser.ie?"innerText":"textContent"]=l,t.insertNode(a).selectNode(a)}else t.applyInlineStyle("a",i)}UE.commands["unlink"]={execCommand:function(){var t,i=this.selection.getRange();i.collapsed&&!domUtils.findParentByTagName(i.startContainer,"a",!0)||(t=i.createBookmark(),e(i),i.removeInlineStyle("a").moveToBookmark(t).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands["link"]={execCommand:function(e,i){var n;i._href&&(i._href=utils.unhtml(i._href,/[<">]/g)),i.href&&(i.href=utils.unhtml(i.href,/[<">]/g)),i.textValue&&(i.textValue=utils.unhtml(i.textValue,/[<">]/g)),t(n=this.selection.getRange(),i,this),n.collapse().select(!0)},queryCommandValue:function(){var e,t=this.selection.getRange();if(!t.collapsed){t.shrinkBoundary();var i=3!=t.startContainer.nodeType&&t.startContainer.childNodes[t.startOffset]?t.startContainer.childNodes[t.startOffset]:t.startContainer,n=3==t.endContainer.nodeType||0==t.endOffset?t.endContainer:t.endContainer.childNodes[t.endOffset-1],o=t.getCommonAncestor();if(e=domUtils.findParentByTagName(o,"a",!0),!e&&1==o.nodeType)for(var r,s,a,l=o.getElementsByTagName("a"),c=0;a=l[c++];)if(r=domUtils.getPosition(a,i),s=domUtils.getPosition(a,n),(r&domUtils.POSITION_FOLLOWING||r&domUtils.POSITION_CONTAINS)&&(s&domUtils.POSITION_PRECEDING||s&domUtils.POSITION_CONTAINS)){e=a;break}return e}if(e=t.startContainer,e=1==e.nodeType?e:e.parentNode,e&&(e=domUtils.findParentByTagName(e,"a",!0))&&!domUtils.isInNodeEndBoundary(t,e))return e},queryCommandState:function(){var e=this.selection.getRange().getClosedNode(),t=e&&("edui-faked-video"==e.className||-1!=e.className.indexOf("edui-upload-video"));return t?-1:0}}},UE.plugins["insertframe"]=function(){var e=this;function t(){e._iframe&&delete e._iframe}e.addListener("selectionchange",(function(){t()}))},UE.commands["scrawl"]={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins["removeformat"]=function(){var e=this;e.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),e.commands["removeformat"]={execCommand:function(e,t,i,n,o){var r,s,a=new RegExp("^(?:"+(t||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),l=i?[]:(n||this.options.removeFormatAttributes).split(","),c=new dom.Range(this.document),d=function(e){return 1==e.nodeType};function u(e){if(3==e.nodeType||"span"!=e.tagName.toLowerCase())return 0;if(browser.ie){var t=e.attributes;if(t.length){for(var i=0,n=t.length;i<n;i++)if(t[i].specified)return 0;return 1}}return!e.attributes.length}function m(e){var t=e.createBookmark();if(e.collapsed&&e.enlarge(!0),!o){var n=domUtils.findParentByTagName(e.startContainer,"a",!0);n&&e.setStartBefore(n),n=domUtils.findParentByTagName(e.endContainer,"a",!0),n&&e.setEndAfter(n)}r=e.createBookmark(),f=r.start;while((s=f.parentNode)&&!domUtils.isBlockElm(s))domUtils.breakParent(f,s),domUtils.clearEmptySibling(f);if(r.end){f=r.end;while((s=f.parentNode)&&!domUtils.isBlockElm(s))domUtils.breakParent(f,s),domUtils.clearEmptySibling(f);var c,m=domUtils.getNextDomNode(r.start,!1,d);while(m){if(m==r.end)break;c=domUtils.getNextDomNode(m,!0,d),dtd.$empty[m.tagName.toLowerCase()]||domUtils.isBookmarkNode(m)||(a.test(m.tagName)?i?(domUtils.removeStyle(m,i),u(m)&&"text-decoration"!=i&&domUtils.remove(m,!0)):domUtils.remove(m,!0):dtd.$tableContent[m.tagName]||dtd.$list[m.tagName]||(domUtils.removeAttributes(m,l),u(m)&&domUtils.remove(m,!0))),m=c}}var p=r.start.parentNode;!domUtils.isBlockElm(p)||dtd.$tableContent[p.tagName]||dtd.$list[p.tagName]||domUtils.removeAttributes(p,l),p=r.end.parentNode,r.end&&domUtils.isBlockElm(p)&&!dtd.$tableContent[p.tagName]&&!dtd.$list[p.tagName]&&domUtils.removeAttributes(p,l),e.moveToBookmark(r).moveToBookmark(t);var h,f=e.startContainer,g=e.collapsed;while(1==f.nodeType&&domUtils.isEmptyNode(f)&&dtd.$removeEmpty[f.tagName])h=f.parentNode,e.setStartBefore(f),e.startContainer===e.endContainer&&e.endOffset--,domUtils.remove(f),f=h;if(!g){f=e.endContainer;while(1==f.nodeType&&domUtils.isEmptyNode(f)&&dtd.$removeEmpty[f.tagName])h=f.parentNode,e.setEndBefore(f),domUtils.remove(f),f=h}}c=this.selection.getRange(),m(c),c.select()}}},UE.plugins["blockquote"]=function(){var e=this;function t(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),"blockquote")}e.commands["blockquote"]={execCommand:function(e,i){var n=this.selection.getRange(),o=t(this),r=dtd.blockquote,s=n.createBookmark();if(o){var a=n.startContainer,l=domUtils.isBlockElm(a)?a:domUtils.findParent(a,(function(e){return domUtils.isBlockElm(e)})),c=n.endContainer,d=domUtils.isBlockElm(c)?c:domUtils.findParent(c,(function(e){return domUtils.isBlockElm(e)}));l=domUtils.findParentByTagName(l,"li",!0)||l,d=domUtils.findParentByTagName(d,"li",!0)||d,"LI"==l.tagName||"TD"==l.tagName||l===o||domUtils.isBody(l)?domUtils.remove(o,!0):domUtils.breakParent(l,o),l!==d&&(o=domUtils.findParentByTagName(d,"blockquote"),o&&("LI"==d.tagName||"TD"==d.tagName||domUtils.isBody(d)?o.parentNode&&domUtils.remove(o,!0):domUtils.breakParent(d,o)));for(var u,m=domUtils.getElementsByTagName(this.document,"blockquote"),p=0;u=m[p++];)u.childNodes.length?domUtils.getPosition(u,l)&domUtils.POSITION_FOLLOWING&&domUtils.getPosition(u,d)&domUtils.POSITION_PRECEDING&&domUtils.remove(u,!0):domUtils.remove(u)}else{var h=n.cloneRange(),f=1==h.startContainer.nodeType?h.startContainer:h.startContainer.parentNode,g=f,b=1;while(1){if(domUtils.isBody(f)){g!==f?n.collapsed?(h.selectNode(g),b=0):h.setStartBefore(g):h.setStart(f,0);break}if(!r[f.tagName]){n.collapsed?h.selectNode(g):h.setStartBefore(g);break}g=f,f=f.parentNode}if(b){g=f=f=1==h.endContainer.nodeType?h.endContainer:h.endContainer.parentNode;while(1){if(domUtils.isBody(f)){g!==f?h.setEndAfter(g):h.setEnd(f,f.childNodes.length);break}if(!r[f.tagName]){h.setEndAfter(g);break}g=f,f=f.parentNode}}f=n.document.createElement("blockquote"),domUtils.setAttributes(f,i),f.appendChild(h.extractContents()),h.insertNode(f);var v,y=domUtils.getElementsByTagName(f,"blockquote");for(p=0;v=y[p++];)v.parentNode&&domUtils.remove(v,!0)}n.moveToBookmark(s).select()},queryCommandState:function(){return t(this)?1:0}}},UE.commands["touppercase"]=UE.commands["tolowercase"]={execCommand:function(e){var t=this,i=t.selection.getRange();if(i.collapsed)return i;var n=i.createBookmark(),o=n.end,r=function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)},s=domUtils.getNextDomNode(n.start,!1,r);while(s&&domUtils.getPosition(s,o)&domUtils.POSITION_PRECEDING)if(3==s.nodeType&&(s.nodeValue=s.nodeValue["touppercase"==e?"toUpperCase":"toLowerCase"]()),s=domUtils.getNextDomNode(s,!0,r),s===o)break;i.moveToBookmark(n).select()}},UE.commands["indent"]={execCommand:function(){var e=this,t=e.queryCommandState("indent")?"0em":e.options.indentValue||"2em";e.execCommand("Paragraph","p",{style:"text-indent:"+t})},queryCommandState:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e&&e.style.textIndent&&parseInt(e.style.textIndent)?1:0}},UE.commands["print"]={execCommand:function(){this.window.print()},notNeedUndo:1},UE.commands["preview"]={execCommand:function(){var e=window.open("","_blank",""),t=e.document;t.open(),t.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src="'+this.options.UEDITOR_HOME_URL+"ueditor.parse.js\"><\/script><script>setTimeout(function(){uParse('div',{rootPath: '"+this.options.UEDITOR_HOME_URL+"'})},300)<\/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>"),t.close()},notNeedUndo:1},UE.plugins["selectall"]=function(){var e=this;e.commands["selectall"]={execCommand:function(){var e=this,t=e.body,i=e.selection.getRange();i.selectNodeContents(t),domUtils.isEmptyBlock(t)&&(browser.opera&&t.firstChild&&1==t.firstChild.nodeType&&i.setStartAtFirst(t.firstChild),i.collapse(!0)),i.select(!0)},notNeedUndo:1},e.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins["paragraph"]=function(){var e=this,t=domUtils.isBlockElm,i=["TD","LI","PRE"],n=function(e,n,o,r){var s,a=e.createBookmark(),l=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};e.enlarge(!0);var c,d=e.createBookmark(),u=domUtils.getNextDomNode(d.start,!1,l),m=e.cloneRange();while(u&&!(domUtils.getPosition(u,d.end)&domUtils.POSITION_FOLLOWING))if(3!=u.nodeType&&t(u))u=domUtils.getNextDomNode(u,!0,l);else{m.setStartBefore(u);while(u&&u!==d.end&&!t(u))c=u,u=domUtils.getNextDomNode(u,!1,null,(function(e){return!t(e)}));m.setEndAfter(c),s=e.document.createElement(n),o&&(domUtils.setAttributes(s,o),r&&"customstyle"==r&&o.style&&(s.style.cssText=o.style)),s.appendChild(m.extractContents()),domUtils.isEmptyNode(s)&&domUtils.fillChar(e.document,s),m.insertNode(s);var p=s.parentNode;t(p)&&!domUtils.isBody(s.parentNode)&&-1==utils.indexOf(i,p.tagName)&&(r&&"customstyle"==r||(p.getAttribute("dir")&&s.setAttribute("dir",p.getAttribute("dir")),p.style.cssText&&(s.style.cssText=p.style.cssText+";"+s.style.cssText),p.style.textAlign&&!s.style.textAlign&&(s.style.textAlign=p.style.textAlign),p.style.textIndent&&!s.style.textIndent&&(s.style.textIndent=p.style.textIndent),p.style.padding&&!s.style.padding&&(s.style.padding=p.style.padding)),o&&/h\d/i.test(p.tagName)&&!/h\d/i.test(s.tagName)?(domUtils.setAttributes(p,o),r&&"customstyle"==r&&o.style&&(p.style.cssText=o.style),domUtils.remove(s,!0),s=p):domUtils.remove(s.parentNode,!0)),u=-1!=utils.indexOf(i,p.tagName)?p:s,u=domUtils.getNextDomNode(u,!1,l)}return e.moveToBookmark(d).moveToBookmark(a)};e.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),e.commands["paragraph"]={execCommand:function(e,t,i,o){var r=this.selection.getRange();if(r.collapsed){var s=this.document.createTextNode("p");if(r.insertNode(s),browser.ie){var a=s.previousSibling;a&&domUtils.isWhitespace(a)&&domUtils.remove(a),a=s.nextSibling,a&&domUtils.isWhitespace(a)&&domUtils.remove(a)}}if(r=n(r,t,i,o),s){r.setStartBefore(s).collapse(!0);var l=s.parentNode;domUtils.remove(s),domUtils.isBlockElm(l)&&domUtils.isEmptyNode(l)&&domUtils.fillNode(this.document,l)}if(browser.gecko&&r.collapsed&&1==r.startContainer.nodeType){var c=r.startContainer.childNodes[r.startOffset];c&&1==c.nodeType&&c.tagName.toLowerCase()==t&&r.setStart(c,0).collapse(!0)}return r.select(),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e?e.tagName.toLowerCase():""}}},function(){var e=domUtils.isBlockElm,t=function(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),(function(e){return e&&1==e.nodeType&&e.getAttribute("dir")}))},i=function(i,n,o){var r,s=function(e){return 1==e.nodeType?!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)},a=t(n);if(a&&i.collapsed)return a.setAttribute("dir",o),i;r=i.createBookmark(),i.enlarge(!0);var l,c=i.createBookmark(),d=domUtils.getNextDomNode(c.start,!1,s),u=i.cloneRange();while(d&&!(domUtils.getPosition(d,c.end)&domUtils.POSITION_FOLLOWING))if(3!=d.nodeType&&e(d))d=domUtils.getNextDomNode(d,!0,s);else{u.setStartBefore(d);while(d&&d!==c.end&&!e(d))l=d,d=domUtils.getNextDomNode(d,!1,null,(function(t){return!e(t)}));u.setEndAfter(l);var m=u.getCommonAncestor();if(!domUtils.isBody(m)&&e(m))m.setAttribute("dir",o),d=m;else{var p=i.document.createElement("p");p.setAttribute("dir",o);var h=u.extractContents();p.appendChild(h),u.insertNode(p),d=p}d=domUtils.getNextDomNode(d,!1,s)}return i.moveToBookmark(c).moveToBookmark(r)};UE.commands["directionality"]={execCommand:function(e,t){var n=this.selection.getRange();if(n.collapsed){var o=this.document.createTextNode("d");n.insertNode(o)}return i(n,this,t),o&&(n.setStartBefore(o).collapse(!0),domUtils.remove(o)),n.select(),!0},queryCommandValue:function(){var e=t(this);return e?e.getAttribute("dir"):"ltr"}}}(),UE.plugins["horizontal"]=function(){var e=this;e.commands["horizontal"]={execCommand:function(e){var t=this;if(-1!==t.queryCommandState(e)){t.execCommand("insertHtml","<hr>");var i,n=t.selection.getRange(),o=n.startContainer;if(1==o.nodeType&&!o.childNodes[n.startOffset])(i=o.childNodes[n.startOffset-1])&&1==i.nodeType&&"HR"==i.tagName&&("p"==t.options.enterTag?(i=t.document.createElement("p"),n.insertNode(i),n.setStart(i,0).setCursor()):(i=t.document.createElement("br"),n.insertNode(i),n.setStartBefore(i).setCursor()));return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},e.addListener("delkeydown",(function(e,t){var i=this.selection.getRange();if(i.txtToElmBoundary(!0),domUtils.isStartInblock(i)){var n=i.startContainer,o=n.previousSibling;if(o&&domUtils.isTagNode(o,"hr"))return domUtils.remove(o),i.select(),domUtils.preventDefault(t),!0}}))},UE.commands["time"]=UE.commands["date"]={execCommand:function(e,t){var i=new Date;function n(e,t){var i=("0"+e.getHours()).slice(-2),n=("0"+e.getMinutes()).slice(-2),o=("0"+e.getSeconds()).slice(-2);return t=t||"hh:ii:ss",t.replace(/hh/gi,i).replace(/ii/gi,n).replace(/ss/gi,o)}function o(e,t){var i=("000"+e.getFullYear()).slice(-4),n=i.slice(-2),o=("0"+(e.getMonth()+1)).slice(-2),r=("0"+e.getDate()).slice(-2);return t=t||"yyyy-mm-dd",t.replace(/yyyy/gi,i).replace(/yy/gi,n).replace(/mm/gi,o).replace(/dd/gi,r)}this.execCommand("insertHtml","time"==e?n(i,t):o(i,t))}},UE.plugins["rowspacing"]=function(){var e=this;e.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),e.commands["rowspacing"]={execCommand:function(e,t,i){return this.execCommand("paragraph","p",{style:"margin-"+i+":"+t+"px"}),!0},queryCommandValue:function(e,t){var i,n=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return domUtils.isBlockElm(e)}));return n?(i=domUtils.getComputedStyle(n,"margin-"+t).replace(/[^\d]/g,""),i||0):0}}},UE.plugins["lineheight"]=function(){var e=this;e.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),e.commands["lineheight"]={execCommand:function(e,t){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==t?"normal":t+"em")}),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return domUtils.isBlockElm(e)}));if(e){var t=domUtils.getComputedStyle(e,"line-height");return"normal"==t?1:t.replace(/[^\d.]*/gi,"")}}}},UE.plugins["insertcode"]=function(){var e=this;e.ready((function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",e.document)})),e.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),e.commands["insertcode"]={execCommand:function(e,t){var i=this,n=i.selection.getRange(),o=domUtils.findParentByTagName(n.startContainer,"pre",!0);if(o)o.className="brush:"+t+";toolbar:false;";else{var r="";if(n.collapsed)r=browser.ie&&browser.ie11below?browser.version<=8?"&nbsp;":"":"<br/>";else{var s=n.extractContents(),a=i.document.createElement("div");a.appendChild(s),utils.each(UE.filterNode(UE.htmlparser(a.innerHTML.replace(/[\r\t]/g,"")),i.options.filterTxtRules).children,(function(e){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==e.type?"br"==e.tagName?r+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="\n":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/\n$/.test(r)||(r+="\n")):r+=e.data+"\n",!e.nextSibling()&&/\n$/.test(r)&&(r=r.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==e.type?"br"==e.tagName?r+="<br>":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="<br>":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/br>$/.test(r)||(r+="<br>")):r+=e.data+"<br>",!e.nextSibling()&&/<br>$/.test(r)&&(r=r.replace(/<br>$/,""));else if(r+="element"==e.type?dtd.$empty[e.tagName]?"":e.innerText():e.data,!/br\/?\s*>$/.test(r)){if(!e.nextSibling())return;r+="<br>"}}))}i.execCommand("inserthtml",'<pre id="coder"class="brush:'+t+';toolbar:false">'+r+"</pre>",!0),o=i.document.getElementById("coder"),domUtils.removeAttributes(o,"id");var l=o.previousSibling;l&&(3==l.nodeType&&1==l.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(l))&&domUtils.remove(l);n=i.selection.getRange();domUtils.isEmptyBlock(o)?n.setStart(o,0).setCursor(!1,!0):n.selectNodeContents(o).select()}},queryCommandValue:function(){var e=this.selection.getStartElementPath(),t="";return utils.each(e,(function(e){if("PRE"==e.nodeName){var i=e.className.match(/brush:([^;]+)/);return t=i&&i[1]?i[1]:"",!1}})),t}},e.addInputRule((function(e){utils.each(e.getNodesByTagName("pre"),(function(e){var t=e.getNodesByTagName("br");if(t.length)browser.ie&&browser.ie11below&&browser.version>8&&utils.each(t,(function(e){var t=UE.uNode.createText("\n");e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}));else if(!(browser.ie&&browser.ie11below&&browser.version>8)){var i=e.innerText().split(/\n/);e.innerHTML(""),utils.each(i,(function(t){t.length&&e.appendChild(UE.uNode.createText(t)),e.appendChild(UE.uNode.createElement("br"))}))}}))})),e.addOutputRule((function(e){utils.each(e.getNodesByTagName("pre"),(function(e){var t="";utils.each(e.children,(function(e){"text"==e.type?t+=e.data.replace(/[ ]/g,"&nbsp;").replace(/\n$/,""):"br"==e.tagName?t+="\n":t+=dtd.$empty[e.tagName]?e.innerText():""})),e.innerText(t.replace(/(&nbsp;|\n)+$/,""))}))})),e.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};e.queryCommandState;e.queryCommandState=function(e){var t=this;return!t.notNeedCodeQuery[e.toLowerCase()]&&t.selection&&t.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},e.addListener("beforeenterkeydown",(function(){var t=e.selection.getRange(),i=domUtils.findParentByTagName(t.startContainer,"pre",!0);if(i){if(e.fireEvent("saveScene"),t.collapsed||t.deleteContents(),!browser.ie||browser.ie9above){var n=e.document.createElement("br");t.insertNode(n).setStartAfter(n).collapse(!0);var o=n.nextSibling;o||browser.ie&&!(browser.version>10)?t.setStartAfter(n):t.insertNode(n.cloneNode(!1)),i=n.previousSibling;while(i)if(u=i,i=i.previousSibling,!i||"BR"==i.nodeName){i=u;break}if(i){var r="";while(i&&"BR"!=i.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(i.nodeValue))r+=i.nodeValue,i=i.nextSibling;if("BR"!=i.nodeName){var s=i.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));s&&s[1]&&(r+=s[1])}r&&(r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r))}t.collapse(!0).select(!0)}else if(browser.version>8){var a=e.document.createTextNode("\n"),l=t.startContainer;if(0==t.startOffset){var c=l.previousSibling;if(c){t.insertNode(a);var d=e.document.createTextNode(" ");t.setStartAfter(a).insertNode(d).setStart(d,0).collapse(!0).select(!0)}}else{t.insertNode(a).setStartAfter(a);d=e.document.createTextNode(" ");l=t.startContainer.childNodes[t.startOffset],l&&!/^\n/.test(l.nodeValue)&&t.setStartBefore(a),t.insertNode(d).setStart(d,0).collapse(!0).select(!0)}}else{var u;n=e.document.createElement("br");t.insertNode(n),t.insertNode(e.document.createTextNode(domUtils.fillChar)),t.setStartAfter(n),i=n.previousSibling;while(i)if(u=i,i=i.previousSibling,!i||"BR"==i.nodeName){i=u;break}if(i){r="";while(i&&"BR"!=i.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(i.nodeValue))r+=i.nodeValue,i=i.nextSibling;if("BR"!=i.nodeName){s=i.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));s&&s[1]&&(r+=s[1])}r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r)}t.collapse(!0).select()}return e.fireEvent("saveScene"),!0}})),e.addListener("tabkeydown",(function(t,i){var n=e.selection.getRange(),o=domUtils.findParentByTagName(n.startContainer,"pre",!0);if(o){if(e.fireEvent("saveScene"),i.shiftKey);else if(n.collapsed){var r=e.document.createTextNode(" ");n.insertNode(r).setStartAfter(r).collapse(!0).select(!0)}else{var s=n.createBookmark(),a=s.start.previousSibling;while(a){if(o.firstChild===a&&!domUtils.isBr(a)){o.insertBefore(e.document.createTextNode(" "),a);break}if(domUtils.isBr(a)){o.insertBefore(e.document.createTextNode(" "),a.nextSibling);break}a=a.previousSibling}var l=s.end;a=s.start.nextSibling,o.firstChild===s.start&&o.insertBefore(e.document.createTextNode(" "),a.nextSibling);while(a&&a!==l){if(domUtils.isBr(a)&&a.nextSibling){if(a.nextSibling===l)break;o.insertBefore(e.document.createTextNode(" "),a.nextSibling)}a=a.nextSibling}n.moveToBookmark(s).select()}return e.fireEvent("saveScene"),!0}})),e.addListener("beforeinserthtml",(function(e,t){var i=this,n=i.selection.getRange(),o=domUtils.findParentByTagName(n.startContainer,"pre",!0);if(o){n.collapsed||n.deleteContents();var r="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(t),i.options.filterTxtRules).children,(function(e){"element"==e.type?"br"==e.tagName?r+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?r+="\n":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data})),/\n$/.test(r)||(r+="\n")):r+=e.data+"\n",!e.nextSibling()&&/\n$/.test(r)&&(r=r.replace(/\n$/,""))}));var s=i.document.createTextNode(utils.html(r.replace(/&nbsp;/g," ")));n.insertNode(s).selectNode(s).select()}else{var a=i.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(t),i.options.filterTxtRules).children,(function(e){"element"==e.type?"br"==e.tagName?a.appendChild(i.document.createElement("br")):dtd.$empty[e.tagName]||(utils.each(e.children,(function(t){"element"==t.type?"br"==t.tagName?a.appendChild(i.document.createElement("br")):dtd.$empty[e.tagName]||a.appendChild(i.document.createTextNode(utils.html(t.innerText().replace(/&nbsp;/g," ")))):a.appendChild(i.document.createTextNode(utils.html(t.data.replace(/&nbsp;/g," "))))})),"BR"!=a.lastChild.nodeName&&a.appendChild(i.document.createElement("br"))):a.appendChild(i.document.createTextNode(utils.html(e.data.replace(/&nbsp;/g," ")))),e.nextSibling()||"BR"!=a.lastChild.nodeName||a.removeChild(a.lastChild)})),n.insertNode(a).select()}return!0}})),e.addListener("keydown",(function(e,t){var i=this,n=t.keyCode||t.which;if(40==n){var o,r=i.selection.getRange(),s=r.startContainer;if(r.collapsed&&(o=domUtils.findParentByTagName(r.startContainer,"pre",!0))&&!o.nextSibling){var a=o.lastChild;while(a&&"BR"==a.nodeName)a=a.previousSibling;(a===s||r.startContainer===o&&r.startOffset==o.childNodes.length)&&(i.execCommand("insertparagraph"),domUtils.preventDefault(t))}}})),e.addListener("delkeydown",(function(t,i){var n=this.selection.getRange();n.txtToElmBoundary(!0);var o=n.startContainer;if(domUtils.isTagNode(o,"pre")&&n.collapsed&&domUtils.isStartInblock(n)){var r=e.document.createElement("p");return domUtils.fillNode(e.document,r),o.parentNode.insertBefore(r,o),domUtils.remove(o),n.setStart(r,0).setCursor(!1,!0),domUtils.preventDefault(i),!0}}))},UE.commands["cleardoc"]={execCommand:function(e){var t=this,i=t.options.enterTag,n=t.selection.getRange();"br"==i?(t.body.innerHTML="<br/>",n.setStart(t.body,0).setCursor()):(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",n.setStart(t.body.firstChild,0).setCursor(!1,!0)),setTimeout((function(){t.fireEvent("clearDoc")}),0)}},UE.plugin.register("anchor",(function(){return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}",this.document)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var t;(t=e.getAttr("anchorname"))&&(e.tagName="a",e.setAttr({anchorname:"",name:t,class:""}))}))},inputRule:function(e){utils.each(e.getNodesByTagName("a"),(function(e){e.getAttr("name")&&!e.getAttr("href")&&(e.tagName="img",e.setAttr({anchorname:e.getAttr("name"),class:"anchorclass"}),e.setAttr("name"))}))},commands:{anchor:{execCommand:function(e,t){var i=this.selection.getRange(),n=i.getClosedNode();if(n&&n.getAttribute("anchorname"))t?n.setAttribute("anchorname",t):(i.setStartBefore(n).setCursor(),domUtils.remove(n));else if(t){var o=this.document.createElement("img");i.collapse(!0),domUtils.setAttributes(o,{anchorname:t,class:"anchorclass"}),i.insertNode(o).setStartAfter(o).setCursor(!1,!0)}}}}}})),UE.plugins["wordcount"]=function(){var e,t=this;t.setOpt("wordCount",!0),t.addListener("contentchange",(function(){t.fireEvent("wordcount")})),t.addListener("ready",(function(){var t=this;domUtils.on(t.body,"keyup",(function(i){var n=i.keyCode||i.which,o={16:1,18:1,20:1,37:1,38:1,39:1,40:1};n in o||(clearTimeout(e),e=setTimeout((function(){t.fireEvent("wordcount")}),200))}))}))},UE.plugins["pagebreak"]=function(){var e=this,t=["td"];function i(t){if(domUtils.isEmptyBlock(t)){var i,n=t.firstChild;while(n&&1==n.nodeType&&domUtils.isEmptyBlock(n))i=n,n=n.firstChild;!i&&(i=t),domUtils.fillNode(e.document,i)}}function n(e){return e&&1==e.nodeType&&"HR"==e.tagName&&"pagebreak"==e.className}e.setOpt("pageBreakTag","_ueditor_page_break_tag_"),e.ready((function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",e.document)})),e.addInputRule((function(t){t.traversal((function(t){if("text"==t.type&&t.data==e.options.pageBreakTag){var i=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');t.parentNode.insertBefore(i,t),t.parentNode.removeChild(t)}}))})),e.addOutputRule((function(t){utils.each(t.getNodesByTagName("hr"),(function(t){if("pagebreak"==t.getAttr("class")){var i=UE.uNode.createText(e.options.pageBreakTag);t.parentNode.insertBefore(i,t),t.parentNode.removeChild(t)}}))})),e.commands["pagebreak"]={execCommand:function(){var o=e.selection.getRange(),r=e.document.createElement("hr");domUtils.setAttributes(r,{class:"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(r);var s=domUtils.findParentByTagName(o.startContainer,t,!0),a=[];if(s)switch(s.tagName){case"TD":if(u=s.parentNode,u.previousSibling)u.parentNode.insertBefore(r,u),a=domUtils.findParents(r);else{var l=domUtils.findParentByTagName(u,"table");l.parentNode.insertBefore(r,l),a=domUtils.findParents(r,!0)}u=a[1],r!==u&&domUtils.breakParent(r,u),e.fireEvent("afteradjusttable",e.document)}else{if(!o.collapsed){o.deleteContents();var c=o.startContainer;while(!domUtils.isBody(c)&&domUtils.isBlockElm(c)&&domUtils.isEmptyNode(c))o.setStartBefore(c).collapse(!0),domUtils.remove(c),c=o.startContainer}o.insertNode(r);var d,u=r.parentNode;while(!domUtils.isBody(u))domUtils.breakParent(r,u),d=r.nextSibling,d&&domUtils.isEmptyBlock(d)&&domUtils.remove(d),u=r.parentNode;d=r.nextSibling;var m=r.previousSibling;if(n(m)?domUtils.remove(m):m&&i(m),d)n(d)?domUtils.remove(d):i(d),o.setEndAfter(r).collapse(!1);else{var p=e.document.createElement("p");r.parentNode.appendChild(p),domUtils.fillNode(e.document,p),o.setStart(p,0).collapse(!0)}o.select(!0)}}}},UE.plugin.register("wordimage",(function(){var e=this,t=[];return{commands:{wordimage:{execCommand:function(){for(var t,i=domUtils.getElementsByTagName(e.body,"img"),n=[],o=0;t=i[o++];){var r=t.getAttribute("word_img");r&&n.push(r)}return n},queryCommandState:function(){t=domUtils.getElementsByTagName(e.body,"img");for(var i,n=0;i=t[n++];)if(i.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(t){utils.each(t.getNodesByTagName("img"),(function(t){var i=t.attrs,n=parseInt(i.width)<128||parseInt(i.height)<43,o=e.options,r=o.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";i["src"]&&/^(?:(file:\/+))/.test(i["src"])&&t.setAttr({width:i.width,height:i.height,alt:i.alt,word_img:i.src,src:r,style:"background:url("+(n?o.themePath+o.theme+"/images/word.gif":o.langPath+o.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})}))}}})),UE.plugins["dragdrop"]=function(){var e=this;e.ready((function(){domUtils.on(this.body,"dragend",(function(){var t=e.selection.getRange(),i=t.getClosedNode()||e.selection.getStart();if(i&&"IMG"==i.tagName){var n,o=i.previousSibling;while(n=i.nextSibling){if(1!=n.nodeType||"SPAN"!=n.tagName||n.firstChild)break;domUtils.remove(n)}(!o||1!=o.nodeType||domUtils.isEmptyBlock(o))&&o||n&&(!n||domUtils.isEmptyBlock(n))||(o&&"P"==o.tagName&&!domUtils.isEmptyBlock(o)?(o.appendChild(i),domUtils.moveChild(n,o),domUtils.remove(n)):n&&"P"==n.tagName&&!domUtils.isEmptyBlock(n)&&n.insertBefore(i,n.firstChild),o&&"P"==o.tagName&&domUtils.isEmptyBlock(o)&&domUtils.remove(o),n&&"P"==n.tagName&&domUtils.isEmptyBlock(n)&&domUtils.remove(n),t.selectNode(i).select(),e.fireEvent("saveScene"))}}))})),e.addListener("keyup",(function(t,i){var n=i.keyCode||i.which;if(13==n){var o,r=e.selection.getRange();(o=domUtils.findParentByTagName(r.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(o,"text-align")&&domUtils.removeStyle(o,"text-align")}}))},UE.plugins["undo"]=function(){var e,t=this,i=t.options.maxUndoCount||20,n=t.options.maxInputCount||20,o=new RegExp(domUtils.fillChar+"|</hr>","gi"),r={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},s=t.options.autoClearEmptyNode;function a(e,t){if(e.length!=t.length)return 0;for(var i=0,n=e.length;i<n;i++)if(e[i]!=t[i])return 0;return 1}function l(e,t){return e.collapsed!=t.collapsed?0:a(e.startAddress,t.startAddress)&&a(e.endAddress,t.endAddress)?1:0}function c(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.undo=function(){if(this.hasUndo){if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();while(this.list[this.index].content==this.list[this.index-1].content)if(this.index--,0==this.index)return this.restore(0);this.restore(--this.index)}},this.redo=function(){if(this.hasRedo){while(this.list[this.index].content==this.list[this.index+1].content)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}},this.restore=function(){var e=this.editor,t=this.list[this.index],i=UE.htmlparser(t.content.replace(o,""));e.options.autoClearEmptyNode=!1,e.filterInputRule(i),e.options.autoClearEmptyNode=s,e.document.body.innerHTML=i.toHtml(),e.fireEvent("afterscencerestore"),browser.ie&&utils.each(domUtils.getElementsByTagName(e.document,"td th caption p"),(function(t){domUtils.isEmptyNode(t)&&domUtils.fillNode(e.document,t)}));try{var n=new dom.Range(e.document).moveToAddress(t.address);n.select(r[n.startContainer.nodeName.toLowerCase()])}catch(a){}this.update(),this.clearKey(),e.fireEvent("reset",!0)},this.getScene=function(){var e=this.editor,t=e.selection.getRange(),i=t.createAddress(!1,!0);e.fireEvent("beforegetscene");var n=UE.htmlparser(e.body.innerHTML);e.options.autoClearEmptyNode=!1,e.filterOutputRule(n),e.options.autoClearEmptyNode=s;var o=n.toHtml();return e.fireEvent("aftergetscene"),{address:i,content:o}},this.save=function(n,o){clearTimeout(e);var r=this.getScene(o),s=this.list[this.index];s&&s.content!=r.content&&t.trigger("contentchange"),s&&s.content==r.content&&(n||l(s.address,r.address))||(this.list=this.list.slice(0,this.index+1),this.list.push(r),this.list.length>i&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){u=0,null}}t.undoManger=new c,t.undoManger.editor=t,t.addListener("saveScene",(function(){var e=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,e)})),t.addListener("reset",(function(e,t){t||this.undoManger.reset()})),t.commands["redo"]=t.commands["undo"]={execCommand:function(e){this.undoManger[e]()},queryCommandState:function(e){return this.undoManger["has"+("undo"==e.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var d={16:1,17:1,18:1,37:1,38:1,39:1,40:1},u=0,m=!1;t.addListener("ready",(function(){domUtils.on(this.body,"compositionstart",(function(){m=!0})),domUtils.on(this.body,"compositionend",(function(){m=!1}))})),t.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var p=!0;t.addListener("keydown",(function(t,i){var o=this,r=i.keyCode||i.which;if(!d[r]&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey&&!i.altKey){if(m)return;if(!o.selection.getRange().collapsed)return o.undoManger.save(!1,!0),void(p=!1);function s(e){e.undoManger.save(!1,!0),e.fireEvent("selectionchange")}0==o.undoManger.list.length&&o.undoManger.save(!0),clearTimeout(e),e=setTimeout((function(){if(m)var e=setInterval((function(){m||(s(o),clearInterval(e))}),300);else s(o)}),200),r,u++,u>=n&&s(o)}})),t.addListener("keyup",(function(e,t){var i=t.keyCode||t.which;if(!d[i]&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey){if(m)return;p||(this.undoManger.save(!1,!0),p=!0)}})),t.stopCmdUndo=function(){t.__hasEnterExecCommand=!0},t.startCmdUndo=function(){t.__hasEnterExecCommand=!1}},UE.plugin.register("copy",(function(){var e=this;function t(){ZeroClipboard.config({debug:!1,swfPath:e.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var t=e.zeroclipboard=new ZeroClipboard;t.on("copy",(function(t){var i=t.client,n=e.selection.getRange(),o=document.createElement("div");o.appendChild(n.cloneContents()),i.setText(o.innerText||o.textContent),i.setHtml(o.innerHTML),n.select()})),t.on("mouseover mouseout",(function(e){var t=e.target;"mouseover"==e.type?domUtils.addClass(t,"edui-state-hover"):"mouseout"==e.type&&domUtils.removeClasses(t,"edui-state-hover")})),t.on("wrongflash noflash",(function(){ZeroClipboard.destroy()}))}return{bindEvents:{ready:function(){browser.ie||(window.ZeroClipboard?t():utils.loadFile(document,{src:e.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},(function(){t()})))}},commands:{copy:{execCommand:function(t){e.document.execCommand("copy")||alert(e.getLang("copymsg"))}}}}})),UE.plugins["paste"]=function(){function e(e){var t=this.document;if(!t.getElementById("baidu_pastebin")){var i=this.selection.getRange(),n=i.createBookmark(),o=t.createElement("div");o.id="baidu_pastebin",browser.webkit&&o.appendChild(t.createTextNode(domUtils.fillChar+domUtils.fillChar)),t.body.appendChild(o),n.start.style.display="",o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(n.start).y+"px",i.selectNodeContents(o).select(!0),setTimeout((function(){if(browser.webkit)for(var r,s=0,a=t.querySelectorAll("#baidu_pastebin");r=a[s++];){if(!domUtils.isEmptyNode(r)){o=r;break}domUtils.remove(r)}try{o.parentNode.removeChild(o)}catch(l){}i.moveToBookmark(n).select(!0),e(o)}),0)}}var t,i,n,o=this;function r(e){return e.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,(function(e,t,i,n){return i=i.toLowerCase(),{img:1}[i]?e:(n=n.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,(function(e,t,i){return{src:1,href:1,name:1}[t.toLowerCase()]?t+"="+i+" ":""})),{span:1,div:1}[i]?"":"<"+t+i+" "+utils.trim(n)+">")}))}function s(e){var s;if(e.firstChild){for(var a,l=domUtils.getElementsByTagName(e,"span"),c=0;a=l[c++];)"_baidu_cut_start"!=a.id&&"_baidu_cut_end"!=a.id||domUtils.remove(a);if(browser.webkit){var d,u=e.querySelectorAll("div br");for(c=0;d=u[c++];){var m=d.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="<p><br/></p>",domUtils.remove(m))}var p,h=e.querySelectorAll("#baidu_pastebin");for(c=0;p=h[c++];){var f=o.document.createElement("p");p.parentNode.insertBefore(f,p);while(p.firstChild)f.appendChild(p.firstChild);domUtils.remove(p)}var g=e.querySelectorAll("meta");for(c=0;v=g[c++];)domUtils.remove(v);u=e.querySelectorAll("br");for(c=0;v=u[c++];)/^apple-/i.test(v.className)&&domUtils.remove(v)}if(browser.gecko){var b=e.querySelectorAll("[_moz_dirty]");for(c=0;v=b[c++];)v.removeAttribute("_moz_dirty")}if(!browser.ie){var v,y=e.querySelectorAll("span.Apple-style-span");for(c=0;v=y[c++];)domUtils.remove(v,!0)}s=e.innerHTML,s=UE.filterWord(s);var C=UE.htmlparser(s);if(o.options.filterRules&&UE.filterNode(C,o.options.filterRules),o.filterInputRule(C),browser.webkit){var x=C.lastChild();x&&"element"==x.type&&"br"==x.tagName&&C.removeChild(x),utils.each(o.body.querySelectorAll("div"),(function(e){domUtils.isEmptyBlock(e)&&domUtils.remove(e,!0)}))}if(s={html:C.toHtml()},o.fireEvent("beforepaste",s,C),!s.html)return;C=UE.htmlparser(s.html,!0),1===o.queryCommandState("pasteplain")?o.execCommand("insertHtml",UE.filterNode(C,o.options.filterTxtRules).toHtml(),!0):(UE.filterNode(C,o.options.filterTxtRules),t=C.toHtml(),i=s.html,n=o.selection.getRange().createAddress(!0),o.execCommand("insertHtml",!0===o.getOpt("retainOnlyLabelPasted")?r(i):i,!0)),o.fireEvent("afterpaste",s)}}o.setOpt({retainOnlyLabelPasted:!1}),o.addListener("pasteTransfer",(function(e,s){if(n&&t&&i&&t!=i){var a=o.selection.getRange();if(a.moveToAddress(n,!0),!a.collapsed){while(!domUtils.isBody(a.startContainer)){var l=a.startContainer;if(1==l.nodeType){if(l=l.childNodes[a.startOffset],!l){a.setStartBefore(a.startContainer);continue}var c=l.previousSibling;c&&3==c.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(c.nodeValue)&&a.setStartBefore(c)}if(0!=a.startOffset)break;a.setStartBefore(a.startContainer)}while(!domUtils.isBody(a.endContainer)){var d=a.endContainer;if(1==d.nodeType){if(d=d.childNodes[a.endOffset],!d){a.setEndAfter(a.endContainer);continue}var u=d.nextSibling;u&&3==u.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(u.nodeValue)&&a.setEndAfter(u)}if(a.endOffset!=a.endContainer[3==a.endContainer.nodeType?"nodeValue":"childNodes"].length)break;a.setEndAfter(a.endContainer)}}a.deleteContents(),a.select(!0),o.__hasEnterExecCommand=!0;var m=i;2===s?m=r(m):s&&(m=t),o.execCommand("inserthtml",m,!0),o.__hasEnterExecCommand=!1;var p=o.selection.getRange();while(!domUtils.isBody(p.startContainer)&&!p.startOffset&&p.startContainer[3==p.startContainer.nodeType?"nodeValue":"childNodes"].length)p.setStartBefore(p.startContainer);var h=p.createAddress(!0);n.endAddress=h.startAddress}})),o.addListener("ready",(function(){domUtils.on(o.body,"cut",(function(){var e=o.selection.getRange();!e.collapsed&&o.undoManger&&o.undoManger.save()})),domUtils.on(o.body,browser.ie||browser.opera?"keydown":"paste",(function(t){(!browser.ie&&!browser.opera||(t.ctrlKey||t.metaKey)&&"86"==t.keyCode)&&e.call(o,(function(e){s(e)}))}))})),o.commands["paste"]={execCommand:function(t){browser.ie?(e.call(o,(function(e){s(e)})),o.document.execCommand("paste")):alert(o.getLang("pastemsg"))}}},UE.plugins["pasteplain"]=function(){var e=this;e.setOpt({pasteplain:!1,filterTxtRules:function(){function e(e){e.tagName="p",e.setStyle()}function t(e){e.parentNode.removeChild(e,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(e){var t,i=UE.uNode.createElement("p");while(t=e.firstChild())"text"!=t.type&&UE.dom.dtd.$block[t.tagName]?i.firstChild()?(e.parentNode.insertBefore(i,e),i=UE.uNode.createElement("p")):e.parentNode.insertBefore(t,e):i.appendChild(t);i.firstChild()&&e.parentNode.insertBefore(i,e),e.parentNode.removeChild(e)},ol:t,ul:t,dl:t,dt:t,dd:t,li:t,caption:e,th:e,tr:e,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,td:function(e){var t=!!e.innerText();t&&e.parentNode.insertAfter(UE.uNode.createText(" &nbsp; &nbsp;"),e),e.parentNode.removeChild(e,e.innerText())}}}()});var t=e.options.pasteplain;e.commands["pasteplain"]={queryCommandState:function(){return t?1:0},execCommand:function(){t=0|!t},notNeedUndo:1}},UE.plugins["list"]=function(){var e=this,t={TD:1,PRE:1,BLOCKQUOTE:1},i={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};function n(e){var t=[];for(var i in e)t.push(i);return t}e.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var o={OL:n(e.options.insertorderedlist),UL:n(e.options.insertunorderedlist)},r=e.options.listiconpath;for(var s in i)e.options.insertorderedlist.hasOwnProperty(s)||e.options.insertunorderedlist.hasOwnProperty(s)||delete i[s];function a(e){var t=e.className;return domUtils.hasClass(e,/custom_/)?t.match(/custom_(\w+)/)[1]:domUtils.getStyle(e,"list-style-type")}function l(e,t){utils.each(domUtils.getElementsByTagName(e,"ol ul"),(function(n){if(domUtils.inDoc(n,e)){var r=n.parentNode;if(r.tagName==n.tagName){var s=a(n)||("OL"==n.tagName?"decimal":"disc"),l=a(r)||("OL"==r.tagName?"decimal":"disc");if(s==l){var u=utils.indexOf(o[n.tagName],s);u=u+1==o[n.tagName].length?0:u+1,d(n,o[n.tagName][u])}}var m=0,p=2;domUtils.hasClass(n,/custom_/)?/[ou]l/i.test(r.tagName)&&domUtils.hasClass(r,/custom_/)||(p=1):/[ou]l/i.test(r.tagName)&&domUtils.hasClass(r,/custom_/)&&(p=3);var h=domUtils.getStyle(n,"list-style-type");h&&(n.style.cssText="list-style-type:"+h),n.className=utils.trim(n.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+p,utils.each(domUtils.getElementsByTagName(n,"li"),(function(e){if(e.style.cssText&&(e.style.cssText=""),e.firstChild){if(e.parentNode===n){if(m++,domUtils.hasClass(n,/custom_/)){var t=1,o=a(n);if("OL"==n.tagName){if(o)switch(o){case"cn":case"cn1":case"cn2":m>10&&(m%10==0||m>10&&m<20)?t=2:m>20&&(t=3);break;case"num2":m>9&&(t=2)}e.className="list-"+i[o]+m+" list-"+o+"-paddingleft-"+t}else e.className="list-"+i[o]+" list-"+o+"-paddingleft"}else e.className=e.className.replace(/list-[\w\-]+/gi,"");var r=e.getAttribute("class");null===r||r.replace(/\s/g,"")||domUtils.removeAttributes(e,"class")}}else domUtils.remove(e)})),!t&&c(n,n.tagName.toLowerCase(),a(n)||domUtils.getStyle(n,"list-style-type"),!0)}}))}function c(e,t,i,n){var o=e.nextSibling;o&&1==o.nodeType&&o.tagName.toLowerCase()==t&&(a(o)||domUtils.getStyle(o,"list-style-type")||("ol"==t?"decimal":"disc"))==i&&(domUtils.moveChild(o,e),0==o.childNodes.length&&domUtils.remove(o)),o&&domUtils.isFillChar(o)&&domUtils.remove(o);var r=e.previousSibling;r&&1==r.nodeType&&r.tagName.toLowerCase()==t&&(a(r)||domUtils.getStyle(r,"list-style-type")||("ol"==t?"decimal":"disc"))==i&&domUtils.moveChild(e,r),r&&domUtils.isFillChar(r)&&domUtils.remove(r),!n&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),a(e)&&l(e.ownerDocument,!0)}function d(e,t){i[t]&&(e.className="custom_"+t);try{domUtils.setStyle(e,"list-style-type",t)}catch(n){}}function u(e){var t=e.previousSibling;t&&domUtils.isEmptyBlock(t)&&domUtils.remove(t),t=e.nextSibling,t&&domUtils.isEmptyBlock(t)&&domUtils.remove(t)}function m(e){while(e&&!domUtils.isBody(e)){if("TABLE"==e.nodeName)return null;if("LI"==e.nodeName)return e;e=e.parentNode}}e.ready((function(){var t=[];for(var n in i){if("dash"==n||"dot"==n)t.push("li.list-"+i[n]+"{background-image:url("+r+i[n]+".gif)}"),t.push("ul.custom_"+n+"{list-style:none;}ul.custom_"+n+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var o=0;o<99;o++)t.push("li.list-"+i[n]+o+"{background-image:url("+r+"list-"+i[n]+o+".gif)}");t.push("ol.custom_"+n+"{list-style:none;}ol.custom_"+n+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(n){case"cn":t.push("li.list-"+n+"-paddingleft-1{padding-left:25px}"),t.push("li.list-"+n+"-paddingleft-2{padding-left:40px}"),t.push("li.list-"+n+"-paddingleft-3{padding-left:55px}");break;case"cn1":t.push("li.list-"+n+"-paddingleft-1{padding-left:30px}"),t.push("li.list-"+n+"-paddingleft-2{padding-left:40px}"),t.push("li.list-"+n+"-paddingleft-3{padding-left:55px}");break;case"cn2":t.push("li.list-"+n+"-paddingleft-1{padding-left:40px}"),t.push("li.list-"+n+"-paddingleft-2{padding-left:55px}"),t.push("li.list-"+n+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":t.push("li.list-"+n+"-paddingleft-1{padding-left:25px}");break;case"num2":t.push("li.list-"+n+"-paddingleft-1{padding-left:35px}"),t.push("li.list-"+n+"-paddingleft-2{padding-left:40px}");break;case"dash":t.push("li.list-"+n+"-paddingleft{padding-left:35px}");break;case"dot":t.push("li.list-"+n+"-paddingleft{padding-left:20px}")}}t.push(".list-paddingleft-1{padding-left:0}"),t.push(".list-paddingleft-2{padding-left:"+e.options.listDefaultPaddingLeft+"px}"),t.push(".list-paddingleft-3{padding-left:"+2*e.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+t.join("\n"),e.document)})),e.ready((function(){domUtils.on(e.body,"cut",(function(){setTimeout((function(){var t,i=e.selection.getRange();if(!i.collapsed&&(t=domUtils.findParentByTagName(i.startContainer,"li",!0))&&!t.nextSibling&&domUtils.isEmptyBlock(t)){var n,o=t.parentNode;if(n=o.previousSibling)domUtils.remove(o),i.setStartAtLast(n).collapse(!0),i.select(!0);else if(n=o.nextSibling)domUtils.remove(o),i.setStartAtFirst(n).collapse(!0),i.select(!0);else{var r=e.document.createElement("p");domUtils.fillNode(e.document,r),o.parentNode.insertBefore(r,o),domUtils.remove(o),i.setStart(r,0).collapse(!0),i.select(!0)}}}))}))})),e.addListener("beforepaste",(function(e,t){var n,r=this,s=r.selection.getRange(),l=UE.htmlparser(t.html,!0);if(n=domUtils.findParentByTagName(s.startContainer,"li",!0)){var c=n.parentNode,d="OL"==c.tagName?"ul":"ol";utils.each(l.getNodesByTagName(d),(function(t){if(t.tagName=c.tagName,t.setAttr(),t.parentNode===l)e=a(c)||("OL"==c.tagName?"decimal":"disc");else{var n=t.parentNode.getAttr("class");e=n&&/custom_/.test(n)?n.match(/custom_(\w+)/)[1]:t.parentNode.getStyle("list-style-type"),e||(e="OL"==c.tagName?"decimal":"disc")}var r=utils.indexOf(o[c.tagName],e);t.parentNode!==l&&(r=r+1==o[c.tagName].length?0:r+1);var s=o[c.tagName][r];i[s]?t.setAttr("class","custom_"+s):t.setStyle("list-style-type",s)}))}t.html=l.toHtml()})),!0===e.getOpt("disablePInList")&&e.addOutputRule((function(e){utils.each(e.getNodesByTagName("li"),(function(e){var t=[],i=0;utils.each(e.children,(function(n){if("p"==n.tagName){var o;while(o=n.children.pop())t.splice(i,0,o),o.parentNode=e,lastNode=o;if(o=t[t.length-1],!o||"element"!=o.type||"br"!=o.tagName){var r=UE.uNode.createElement("br");r.parentNode=e,t.push(r)}i=t.length}})),t.length&&(e.children=t)}))})),e.addInputRule((function(t){if(utils.each(t.getNodesByTagName("li"),(function(e){for(var t,i=UE.uNode.createElement("p"),n=0;t=e.children[n];)"text"==t.type||dtd.p[t.tagName]?i.appendChild(t):i.firstChild()?(e.insertBefore(i,t),i=UE.uNode.createElement("p"),n+=2):n++;(i.firstChild()&&!i.parentNode||!e.firstChild())&&e.appendChild(i),i.firstChild()||i.innerHTML(browser.ie?"&nbsp;":"<br/>");var o=e.firstChild(),r=o.lastChild();r&&"text"==r.type&&/^\s*$/.test(r.data)&&o.removeChild(r)})),e.options.autoTransWordToList){var n={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},o={square:"n"};function r(e,t){var i=t.firstChild();if(i&&"element"==i.type&&"span"==i.tagName&&/Wingdings|Symbol/.test(i.getStyle("font-family"))){for(var r in o)if(o[r]==i.data)return r;return"disc"}for(var r in n)if(n[r].test(e))return r}utils.each(t.getNodesByTagName("p"),(function(t){if("MsoListParagraph"==t.getAttr("class")){t.setStyle("margin",""),t.setStyle("margin-left",""),t.setAttr("class","");var o,s=t,a=t;if("li"!=t.parentNode.tagName&&(o=r(t.innerText(),t))){var l=UE.uNode.createElement(e.options.insertorderedlist.hasOwnProperty(o)?"ol":"ul");i[o]?l.setAttr("class","custom_"+o):l.setStyle("list-style-type",o);while(t&&"li"!=t.parentNode.tagName&&r(t.innerText(),t))s=t.nextSibling(),s||t.parentNode.insertBefore(l,t),d(l,t,o),t=s;!l.parentNode&&t&&t.parentNode&&t.parentNode.insertBefore(l,t)}var c=a.firstChild();c&&"element"==c.type&&"span"==c.tagName&&/^\s*(&nbsp;)+\s*$/.test(c.innerText())&&c.parentNode.removeChild(c)}function d(e,t,i){if("ol"==e.tagName)if(browser.ie){var o=t.firstChild();"element"==o.type&&"span"==o.tagName&&n[i].test(o.innerText())&&t.removeChild(o)}else t.innerHTML(t.innerHTML().replace(n[i],""));else t.removeChild(t.firstChild());var r=UE.uNode.createElement("li");r.appendChild(t),e.appendChild(r)}}))}})),e.addListener("contentchange",(function(){l(e.document)})),e.addListener("keydown",(function(t,i){function n(){i.preventDefault?i.preventDefault():i.returnValue=!1,e.fireEvent("contentchange"),e.undoManger&&e.undoManger.save()}function o(e,t){while(e&&!domUtils.isBody(e)){if(t(e))return null;if(1==e.nodeType&&/[ou]l/i.test(e.tagName))return e;e=e.parentNode}return null}var r=i.keyCode||i.which;if(13==r&&!i.shiftKey){var s=e.selection.getRange(),a=domUtils.findParent(s.startContainer,(function(e){return domUtils.isBlockElm(e)}),!0),l=domUtils.findParentByTagName(s.startContainer,"li",!0);if(a&&"PRE"!=a.tagName&&!l){var c=a.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(c)&&(a.innerHTML=c.replace(/^\s*1\s*\./,""),s.setStartAtLast(a).collapse(!0).select(),e.__hasEnterExecCommand=!0,e.execCommand("insertorderedlist"),e.__hasEnterExecCommand=!1)}var d=e.selection.getRange(),m=o(d.startContainer,(function(e){return"TABLE"==e.tagName})),p=d.collapsed?m:o(d.endContainer,(function(e){return"TABLE"==e.tagName}));if(m&&p&&m===p){if(!d.collapsed){if(m=domUtils.findParentByTagName(d.startContainer,"li",!0),p=domUtils.findParentByTagName(d.endContainer,"li",!0),!m||!p||m!==p){var h=d.cloneRange(),f=h.collapse(!1).createBookmark();d.deleteContents(),h.moveToBookmark(f);l=domUtils.findParentByTagName(h.startContainer,"li",!0);return u(l),h.select(),void n()}if(d.deleteContents(),l=domUtils.findParentByTagName(d.startContainer,"li",!0),l&&domUtils.isEmptyBlock(l))return x=l.previousSibling,next=l.nextSibling,v=e.document.createElement("p"),domUtils.fillNode(e.document,v),g=l.parentNode,x&&next?(d.setStart(next,0).collapse(!0).select(!0),domUtils.remove(l)):((x||next)&&x?l.parentNode.parentNode.insertBefore(v,g.nextSibling):g.parentNode.insertBefore(v,g),domUtils.remove(l),g.firstChild||domUtils.remove(g),d.setStart(v,0).setCursor()),void n()}if(l=domUtils.findParentByTagName(d.startContainer,"li",!0),l){if(domUtils.isEmptyBlock(l)){f=d.createBookmark();var g=l.parentNode;if(l!==g.lastChild?(domUtils.breakParent(l,g),u(l)):(g.parentNode.insertBefore(l,g.nextSibling),domUtils.isEmptyNode(g)&&domUtils.remove(g)),!dtd.$list[l.parentNode.tagName])if(domUtils.isBlockElm(l.firstChild))domUtils.remove(l,!0);else{v=e.document.createElement("p"),l.parentNode.insertBefore(v,l);while(l.firstChild)v.appendChild(l.firstChild);domUtils.remove(l)}d.moveToBookmark(f).select()}else{var b=l.firstChild;if(!b||!domUtils.isBlockElm(b)){var v=e.document.createElement("p");!l.firstChild&&domUtils.fillNode(e.document,v);while(l.firstChild)v.appendChild(l.firstChild);l.appendChild(v),b=v}var y=e.document.createElement("span");d.insertNode(y),domUtils.breakParent(y,l);var C=y.nextSibling;b=C.firstChild,b||(v=e.document.createElement("p"),domUtils.fillNode(e.document,v),C.appendChild(v),b=v),domUtils.isEmptyNode(b)&&(b.innerHTML="",domUtils.fillNode(e.document,b)),d.setStart(b,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(y);var x=C.previousSibling;x&&domUtils.isEmptyBlock(x)&&(x.innerHTML="<p></p>",domUtils.fillNode(e.document,x.firstChild))}n()}}}if(8==r&&(d=e.selection.getRange(),d.collapsed&&domUtils.isStartInblock(d)&&(h=d.cloneRange().trimBoundary(),l=domUtils.findParentByTagName(d.startContainer,"li",!0),l&&domUtils.isStartInblock(h)))){if(m=domUtils.findParentByTagName(d.startContainer,"p",!0),m&&m!==l.firstChild){g=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,g),u(m),e.fireEvent("contentchange"),d.setStart(m,0).setCursor(!1,!0),e.fireEvent("saveScene"),void domUtils.preventDefault(i)}if(l&&(x=l.previousSibling)){if(46==r&&l.childNodes.length)return;if(dtd.$list[x.tagName]&&(x=x.lastChild),e.undoManger&&e.undoManger.save(),b=l.firstChild,domUtils.isBlockElm(b))if(domUtils.isEmptyNode(b)){x.appendChild(b),d.setStart(b,0).setCursor(!1,!0);while(l.firstChild)x.appendChild(l.firstChild)}else y=e.document.createElement("span"),d.insertNode(y),domUtils.isEmptyBlock(x)&&(x.innerHTML=""),domUtils.moveChild(l,x),d.setStartBefore(y).collapse(!0).select(!0),domUtils.remove(y);else if(domUtils.isEmptyNode(l)){v=e.document.createElement("p");x.appendChild(v),d.setStart(v,0).setCursor()}else{d.setEnd(x,x.childNodes.length).collapse().select(!0);while(l.firstChild)x.appendChild(l.firstChild)}return domUtils.remove(l),e.fireEvent("contentchange"),e.fireEvent("saveScene"),void domUtils.preventDefault(i)}if(l&&!l.previousSibling){g=l.parentNode,f=d.createBookmark();if(domUtils.isTagNode(g.parentNode,"ol ul"))g.parentNode.insertBefore(l,g),domUtils.isEmptyNode(g)&&domUtils.remove(g);else{while(l.firstChild)g.parentNode.insertBefore(l.firstChild,g);domUtils.remove(l),domUtils.isEmptyNode(g)&&domUtils.remove(g)}return d.moveToBookmark(f).setCursor(!1,!0),e.fireEvent("contentchange"),e.fireEvent("saveScene"),void domUtils.preventDefault(i)}}})),e.addListener("keyup",(function(t,i){var n=i.keyCode||i.which;if(8==n){var o,r=e.selection.getRange();(o=domUtils.findParentByTagName(r.startContainer,["ol","ul"],!0))&&c(o,o.tagName.toLowerCase(),a(o)||domUtils.getComputedStyle(o,"list-style-type"),!0)}})),e.addListener("tabkeydown",(function(){var t=e.selection.getRange();function i(t){if(-1!=e.options.maxListLevel){var i=t.parentNode,n=0;while(/[ou]l/i.test(i.tagName))n++,i=i.parentNode;if(n>=e.options.maxListLevel)return!0}}var n=domUtils.findParentByTagName(t.startContainer,"li",!0);if(n){var r;if(!t.collapsed){e.fireEvent("saveScene"),r=t.createBookmark();for(var s,l,u=0,m=domUtils.findParents(n);l=m[u++];)if(domUtils.isTagNode(l,"ol ul")){s=l;break}var p=n;if(r.end)while(p&&!(domUtils.getPosition(p,r.end)&domUtils.POSITION_FOLLOWING))if(i(p))p=domUtils.getNextDomNode(p,!1,null,(function(e){return e!==s}));else{f=p.parentNode,g=e.document.createElement(f.tagName),b=utils.indexOf(o[g.tagName],a(f)||domUtils.getComputedStyle(f,"list-style-type"));var h=b+1==o[g.tagName].length?0:b+1;v=o[g.tagName][h];d(g,v),f.insertBefore(g,p);while(p&&!(domUtils.getPosition(p,r.end)&domUtils.POSITION_FOLLOWING)){if(n=p.nextSibling,g.appendChild(p),!n||domUtils.isTagNode(n,"ol ul")){if(n){while(n=n.firstChild)if("LI"==n.tagName)break}else n=domUtils.getNextDomNode(p,!1,null,(function(e){return e!==s}));break}p=n}c(g,g.tagName.toLowerCase(),v),p=n}return e.fireEvent("contentchange"),t.moveToBookmark(r).select(),!0}if(i(n))return!0;var f=n.parentNode,g=e.document.createElement(f.tagName),b=utils.indexOf(o[g.tagName],a(f)||domUtils.getComputedStyle(f,"list-style-type"));b=b+1==o[g.tagName].length?0:b+1;var v=o[g.tagName][b];if(d(g,v),domUtils.isStartInblock(t))return e.fireEvent("saveScene"),r=t.createBookmark(),f.insertBefore(g,n),g.appendChild(n),c(g,g.tagName.toLowerCase(),v),e.fireEvent("contentchange"),t.moveToBookmark(r).select(!0),!0}})),e.commands["insertorderedlist"]=e.commands["insertunorderedlist"]={execCommand:function(e,i){i||(i="insertorderedlist"==e.toLowerCase()?"decimal":"disc");var n=this,o=this.selection.getRange(),r=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},s="insertorderedlist"==e.toLowerCase()?"ol":"ul",l=n.document.createDocumentFragment();o.adjustmentBoundary().shrinkBoundary();var u,p,h,f,g=o.createBookmark(!0),b=m(n.document.getElementById(g.start)),v=0,y=m(n.document.getElementById(g.end)),C=0;if(b||y){if(b&&(u=b.parentNode),g.end||(y=b),y&&(p=y.parentNode),u===p){while(b!==y){if(f=b,b=b.nextSibling,!domUtils.isBlockElm(f.firstChild)){var x=n.document.createElement("p");while(f.firstChild)x.appendChild(f.firstChild);f.appendChild(x)}l.appendChild(f)}if(f=n.document.createElement("span"),u.insertBefore(f,y),!domUtils.isBlockElm(y.firstChild)){x=n.document.createElement("p");while(y.firstChild)x.appendChild(y.firstChild);y.appendChild(x)}l.appendChild(y),domUtils.breakParent(f,u),domUtils.isEmptyNode(f.previousSibling)&&domUtils.remove(f.previousSibling),domUtils.isEmptyNode(f.nextSibling)&&domUtils.remove(f.nextSibling);var w=a(u)||domUtils.getComputedStyle(u,"list-style-type")||("insertorderedlist"==e.toLowerCase()?"decimal":"disc");if(u.tagName.toLowerCase()==s&&w==i){for(var T=0,N=n.document.createDocumentFragment();L=l.firstChild;)if(domUtils.isTagNode(L,"ol ul"))N.appendChild(L);else while(L.firstChild)N.appendChild(L.firstChild),domUtils.remove(L);f.parentNode.insertBefore(N,f)}else h=n.document.createElement(s),d(h,i),h.appendChild(l),f.parentNode.insertBefore(h,f);return domUtils.remove(f),h&&c(h,s,i),void o.moveToBookmark(g).select()}if(b){while(b){if(f=b.nextSibling,domUtils.isTagNode(b,"ol ul"))l.appendChild(b);else{var S=n.document.createDocumentFragment(),E=0;while(b.firstChild)domUtils.isBlockElm(b.firstChild)&&(E=1),S.appendChild(b.firstChild);if(E)l.appendChild(S);else{var U=n.document.createElement("p");U.appendChild(S),l.appendChild(U)}domUtils.remove(b)}b=f}u.parentNode.insertBefore(l,u.nextSibling),domUtils.isEmptyNode(u)?(o.setStartBefore(u),domUtils.remove(u)):o.setStartAfter(u),v=1}if(y&&domUtils.inDoc(p,n.document)){b=p.firstChild;while(b&&b!==y){if(f=b.nextSibling,domUtils.isTagNode(b,"ol ul"))l.appendChild(b);else{S=n.document.createDocumentFragment(),E=0;while(b.firstChild)domUtils.isBlockElm(b.firstChild)&&(E=1),S.appendChild(b.firstChild);E?l.appendChild(S):(U=n.document.createElement("p"),U.appendChild(S),l.appendChild(U)),domUtils.remove(b)}b=f}var _=domUtils.createElement(n.document,"div",{tmpDiv:1});domUtils.moveChild(y,_),l.appendChild(_),domUtils.remove(y),p.parentNode.insertBefore(l,p),o.setEndBefore(p),domUtils.isEmptyNode(p)&&domUtils.remove(p),C=1}}v||o.setStartBefore(n.document.getElementById(g.start)),g.end&&!C&&o.setEndAfter(n.document.getElementById(g.end)),o.enlarge(!0,(function(e){return t[e.tagName]})),l=n.document.createDocumentFragment();var k=o.createBookmark(),A=domUtils.getNextDomNode(k.start,!1,r),I=o.cloneRange(),B=domUtils.isBlockElm;while(A&&A!==k.end&&domUtils.getPosition(A,k.end)&domUtils.POSITION_PRECEDING)if(3==A.nodeType||dtd.li[A.tagName]){if(1==A.nodeType&&dtd.$list[A.tagName]){while(A.firstChild)l.appendChild(A.firstChild);D=domUtils.getNextDomNode(A,!1,r),domUtils.remove(A),A=D;continue}D=A,I.setStartBefore(A);while(A&&A!==k.end&&(!B(A)||domUtils.isBookmarkNode(A)))D=A,A=domUtils.getNextDomNode(A,!1,null,(function(e){return!t[e.tagName]}));A&&B(A)&&(f=domUtils.getNextDomNode(D,!1,r),f&&domUtils.isBookmarkNode(f)&&(A=domUtils.getNextDomNode(f,!1,r),D=f)),I.setEndAfter(D),A=domUtils.getNextDomNode(D,!1,r);var O=o.document.createElement("li");if(O.appendChild(I.extractContents()),domUtils.isEmptyNode(O)){var D=o.document.createElement("p");while(O.firstChild)D.appendChild(O.firstChild);O.appendChild(D)}l.appendChild(O)}else A=domUtils.getNextDomNode(A,!0,r);o.moveToBookmark(k).collapse(!0),h=n.document.createElement(s),d(h,i),h.appendChild(l),o.insertNode(h),c(h,s,i);T=0;for(var L,P=domUtils.getElementsByTagName(h,"div");L=P[T++];)L.getAttribute("tmpDiv")&&domUtils.remove(L,!0);o.moveToBookmark(g).select()},queryCommandState:function(e){for(var t,i="insertorderedlist"==e.toLowerCase()?"ol":"ul",n=this.selection.getStartElementPath(),o=0;t=n[o++];){if("TABLE"==t.nodeName)return 0;if(i==t.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(e){for(var t,i,n="insertorderedlist"==e.toLowerCase()?"ol":"ul",o=this.selection.getStartElementPath(),r=0;i=o[r++];){if("TABLE"==i.nodeName){t=null;break}if(n==i.nodeName.toLowerCase()){t=i;break}}return t?a(t)||domUtils.getComputedStyle(t,"list-style-type"):null}}},function(){var e={textarea:function(e,t){var i=t.ownerDocument.createElement("textarea");return i.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px",t.onresize=function(){i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px"}),t.appendChild(i),{setContent:function(e){i.value=e},getContent:function(){return i.value},select:function(){var e;browser.ie?(e=i.createTextRange(),e.collapse(!0),e.select()):(i.setSelectionRange(0,0),i.focus())},dispose:function(){t.removeChild(i),t.onresize=null,i=null,t=null}}},codemirror:function(e,t){var i=window.CodeMirror(t,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),n=i.getWrapperElement();return n.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',i.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",i.refresh(),{getCodeMirror:function(){return i},setContent:function(e){i.setValue(e)},getContent:function(){return i.getValue()},select:function(){i.focus()},dispose:function(){t.removeChild(n),n=null,i=null}}}};UE.plugins["source"]=function(){var t,i,n,o,r,s=this,a=this.options,l=!1;function c(t){return e["codemirror"==a.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](s,t)}a.sourceEditor=browser.ie?"textarea":a.sourceEditor||"codemirror",s.setOpt({sourceEditorFirst:!1}),s.commands["source"]={execCommand:function(){if(l=!l,l){r=s.selection.getRange().createAddress(!1,!0),s.undoManger&&s.undoManger.save(!0),browser.gecko&&(s.body.contentEditable=!1),n=s.iframe.style.cssText,s.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",s.fireEvent("beforegetcontent");var e=UE.htmlparser(s.body.innerHTML);s.filterOutputRule(e),e.traversal((function(e){if("element"==e.type)switch(e.tagName){case"td":case"th":case"caption":e.children&&1==e.children.length&&"br"==e.firstChild().tagName&&e.removeChild(e.firstChild());break;case"pre":e.innerText(e.innerText().replace(/&nbsp;/g," "))}})),s.fireEvent("aftergetcontent");var a=e.toHtml(!0);t=c(s.iframe.parentNode),t.setContent(a),i=s.setContent,s.setContent=function(e){var i=UE.htmlparser(e);s.filterInputRule(i),e=i.toHtml(),t.setContent(e)},setTimeout((function(){t.select(),s.addListener("fullscreenchanged",(function(){try{t.getCodeMirror().refresh()}catch(e){}}))})),o=s.getContent,s.getContent=function(){return t.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>"}}else{s.iframe.style.cssText=n;var d=t.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>";d=d.replace(new RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),(function(e,t){return t&&!dtd.$inlineWithA[t.toLowerCase()]?e.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):e.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")})),s.setContent=i,s.setContent(d),t.dispose(),t=null,s.getContent=o;var u=s.body.firstChild;if(u||(s.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",u=s.body.firstChild),s.undoManger&&s.undoManger.save(!0),browser.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(m),s.body.contentEditable=!1,setTimeout((function(){domUtils.setViewportOffset(m,{left:-32768,top:0}),m.focus(),setTimeout((function(){s.body.contentEditable=!0,s.selection.getRange().moveToAddress(r).select(!0),domUtils.remove(m)}))}))}else try{s.selection.getRange().moveToAddress(r).select(!0)}catch(p){}}this.fireEvent("sourcemodechanged",l)},queryCommandState:function(){return 0|l},notNeedUndo:1};var d=s.queryCommandState;s.queryCommandState=function(e){return e=e.toLowerCase(),l?e in{source:1,fullscreen:1}?1:-1:d.apply(this,arguments)},"codemirror"==a.sourceEditor&&s.addListener("ready",(function(){utils.loadFile(document,{src:a.codeMirrorJsUrl||a.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},(function(){a.sourceEditorFirst&&setTimeout((function(){s.execCommand("source")}),0)})),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:a.codeMirrorCssUrl||a.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})}))}}(),UE.plugins["enterkey"]=function(){var e,t=this,i=t.options.enterTag;t.addListener("keyup",(function(i,n){var o=n.keyCode||n.which;if(13==o){var r,s=t.selection.getRange(),a=s.startContainer;if(browser.ie)t.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(e)){if(browser.gecko){var l=domUtils.findParentByTagName(a,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0);l||(t.document.execCommand("formatBlock",!1,"<p>"),r=1)}else if(1==a.nodeType){var c,d=t.document.createTextNode("");if(s.insertNode(d),c=domUtils.findParentByTagName(d,"div",!0),c){var u=t.document.createElement("p");while(c.firstChild)u.appendChild(c.firstChild);c.parentNode.insertBefore(u,c),domUtils.remove(c),s.setStartBefore(d).setCursor(),r=1}domUtils.remove(d)}t.undoManger&&r&&t.undoManger.save()}browser.opera&&s.select()}}})),t.addListener("keydown",(function(n,o){var r=o.keyCode||o.which;if(13==r){if(t.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(o);t.fireEvent("saveScene",!0,!0),e="";var s=t.selection.getRange();if(!s.collapsed){var a=s.startContainer,l=s.endContainer,c=domUtils.findParentByTagName(a,"td",!0),d=domUtils.findParentByTagName(l,"td",!0);if(c&&d&&c!==d||!c&&d||c&&!d)return void(o.preventDefault?o.preventDefault():o.returnValue=!1)}if("p"==i)browser.ie||(a=domUtils.findParentByTagName(s.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),a||browser.opera?(e=a.tagName,"p"==a.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(a)):(t.document.execCommand("formatBlock",!1,"<p>"),browser.gecko&&(s=t.selection.getRange(),a=domUtils.findParentByTagName(s.startContainer,"p",!0),a&&domUtils.removeDirtyAttr(a))));else if(o.preventDefault?o.preventDefault():o.returnValue=!1,s.collapsed){m=s.document.createElement("br"),s.insertNode(m);var u=m.parentNode;u.lastChild===m?(m.parentNode.insertBefore(m.cloneNode(!0),m),s.setStartBefore(m)):s.setStartAfter(m),s.setCursor()}else if(s.deleteContents(),a=s.startContainer,1==a.nodeType&&(a=a.childNodes[s.startOffset])){while(1==a.nodeType){if(dtd.$empty[a.tagName])return s.setStartBefore(a).setCursor(),t.undoManger&&t.undoManger.save(),!1;if(!a.firstChild){var m=s.document.createElement("br");return a.appendChild(m),s.setStart(a,0).setCursor(),t.undoManger&&t.undoManger.save(),!1}a=a.firstChild}a===s.startContainer.childNodes[s.startOffset]?(m=s.document.createElement("br"),s.insertNode(m).setCursor()):s.setStart(a,0).setCursor()}else m=s.document.createElement("br"),s.insertNode(m).setStartAfter(m).setCursor()}}))},UE.plugins["keystrokes"]=function(){var e=this,t=!0;e.addListener("keydown",(function(i,n){var o=n.keyCode||n.which,r=e.selection.getRange();if(!r.collapsed&&!(n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)&&(o>=65&&o<=90||o>=48&&o<=57||o>=96&&o<=111||{13:1,8:1,46:1}[o])){var s=r.startContainer;if(domUtils.isFillChar(s)&&r.setStartBefore(s),s=r.endContainer,domUtils.isFillChar(s)&&r.setEndAfter(s),r.txtToElmBoundary(),r.endContainer&&1==r.endContainer.nodeType&&(s=r.endContainer.childNodes[r.endOffset],s&&domUtils.isBr(s)&&r.setEndAfter(s)),0==r.startOffset&&(s=r.startContainer,domUtils.isBoundaryNode(s,"firstChild")&&(s=r.endContainer,r.endOffset==(3==s.nodeType?s.nodeValue.length:s.childNodes.length)&&domUtils.isBoundaryNode(s,"lastChild"))))return e.fireEvent("saveScene"),e.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",r.setStart(e.body.firstChild,0).setCursor(!1,!0),void e._selectionChange()}if(o==keymap.Backspace){if(r=e.selection.getRange(),t=r.collapsed,e.fireEvent("delkeydown",n))return;var a,l;if(r.collapsed&&r.inFillChar()&&(a=r.startContainer,domUtils.isFillChar(a)?(r.setStartBefore(a).shrinkBoundary(!0).collapse(!0),domUtils.remove(a)):(a.nodeValue=a.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),r.startOffset--,r.collapse(!0).select(!0))),a=r.getClosedNode())return e.fireEvent("saveScene"),r.setStartBefore(a),domUtils.remove(a),r.setCursor(),e.fireEvent("saveScene"),void domUtils.preventDefault(n);if(!browser.ie&&(a=domUtils.findParentByTagName(r.startContainer,"table",!0),l=domUtils.findParentByTagName(r.endContainer,"table",!0),a&&!l||!a&&l||a!==l))return void n.preventDefault()}if(o==keymap.Tab){var c={ol:1,ul:1,table:1};if(e.fireEvent("tabkeydown",n))return void domUtils.preventDefault(n);var d=e.selection.getRange();e.fireEvent("saveScene");for(var u=0,m="",p=e.options.tabSize||4,h=e.options.tabNode||"&nbsp;";u<p;u++)m+=h;var f=e.document.createElement("span");if(f.innerHTML=m+domUtils.fillChar,d.collapsed)d.insertNode(f.cloneNode(!0).firstChild).setCursor(!0);else{var g=function(e){return domUtils.isBlockElm(e)&&!c[e.tagName.toLowerCase()]};if(a=domUtils.findParent(d.startContainer,g,!0),l=domUtils.findParent(d.endContainer,g,!0),a&&l&&a===l)d.deleteContents(),d.insertNode(f.cloneNode(!0).firstChild).setCursor(!0);else{var b=d.createBookmark();d.enlarge(!0);var v=d.createBookmark(),y=domUtils.getNextDomNode(v.start,!1,g);while(y&&!(domUtils.getPosition(y,v.end)&domUtils.POSITION_FOLLOWING))y.insertBefore(f.cloneNode(!0).firstChild,y.firstChild),y=domUtils.getNextDomNode(y,!1,g);d.moveToBookmark(v).moveToBookmark(b).select()}}domUtils.preventDefault(n)}if(browser.gecko&&46==o&&(d=e.selection.getRange(),d.collapsed&&(a=d.startContainer,domUtils.isEmptyBlock(a)))){var C=a.parentNode;while(1==domUtils.getChildCount(C)&&!domUtils.isBody(C))a=C,C=C.parentNode;a===C.lastChild&&n.preventDefault()}else;})),e.addListener("keyup",(function(e,i){var n,o=i.keyCode||i.which,r=this;if(o==keymap.Backspace){if(r.fireEvent("delkeyup"))return;if(n=r.selection.getRange(),n.collapsed){var s=["h1","h2","h3","h4","h5","h6"];if((c=domUtils.findParentByTagName(n.startContainer,s,!0))&&domUtils.isEmptyBlock(c)){var a=c.previousSibling;if(a&&"TABLE"!=a.nodeName)return domUtils.remove(c),void n.setStartAtLast(a).setCursor(!1,!0);var l=c.nextSibling;if(l&&"TABLE"!=l.nodeName)return domUtils.remove(c),void n.setStartAtFirst(l).setCursor(!1,!0)}if(domUtils.isBody(n.startContainer)){var c=domUtils.createElement(r.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"});n.insertNode(c).setStart(c,0).setCursor(!1,!0)}}if(!t&&(3==n.startContainer.nodeType||1==n.startContainer.nodeType&&domUtils.isEmptyBlock(n.startContainer)))if(browser.ie){var d=n.document.createElement("span");n.insertNode(d).setStartBefore(d).collapse(!0),n.select(),domUtils.remove(d)}else n.select()}}))},UE.plugins["fiximgclick"]=function(){var e=!1;function t(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}return function(){var i=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];t.prototype={init:function(e){var t=this;t.editor=e,t.startPos=this.prePos={x:0,y:0},t.dragId=-1;var i=[],n=t.cover=document.createElement("div"),o=t.resizer=document.createElement("div");n.id=t.editor.ui.id+"_imagescale_cover",n.style.cssText="position:absolute;display:none;z-index:"+t.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(n,"mousedown click",(function(){t.hide()}));for(var r=0;r<8;r++)i.push('<span class="edui-editor-imagescale-hand'+r+'"></span>');o.id=t.editor.ui.id+"_imagescale",o.className="edui-editor-imagescale",o.innerHTML=i.join(""),o.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+t.editor.options.zIndex+";",t.editor.ui.getDom().appendChild(n),t.editor.ui.getDom().appendChild(o),t.initStyle(),t.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var e=this;e.startPos.x=e.startPos.y=0,e.isDraging=!1},_eventHandler:function(t){var i=this;switch(t.type){case"mousedown":var n=t.target||t.srcElement;-1!=n.className.indexOf("edui-editor-imagescale-hand")&&-1==i.dragId&&(i.dragId=n.className.slice(-1),i.startPos.x=i.prePos.x=t.clientX,i.startPos.y=i.prePos.y=t.clientY,domUtils.on(i.doc,"mousemove",i.proxy(i._eventHandler,i)));break;case"mousemove":-1!=i.dragId&&(i.updateContainerStyle(i.dragId,{x:t.clientX-i.prePos.x,y:t.clientY-i.prePos.y}),i.prePos.x=t.clientX,i.prePos.y=t.clientY,e=!0,i.updateTargetElement());break;case"mouseup":-1!=i.dragId&&(i.updateContainerStyle(i.dragId,{x:t.clientX-i.prePos.x,y:t.clientY-i.prePos.y}),i.updateTargetElement(),i.target.parentNode&&i.attachTo(i.target),i.dragId=-1),domUtils.un(i.doc,"mousemove",i.proxy(i._eventHandler,i)),e&&(e=!1,i.editor.fireEvent("contentchange"));break;default:break}},updateTargetElement:function(){var e=this;domUtils.setStyles(e.target,{width:e.resizer.style.width,height:e.resizer.style.height}),e.target.width=parseInt(e.resizer.style.width),e.target.height=parseInt(e.resizer.style.height),e.attachTo(e.target)},updateContainerStyle:function(e,t){var n,o=this,r=o.resizer;0!=i[e][0]&&(n=parseInt(r.style.left)+t.x,r.style.left=o._validScaledProp("left",n)+"px"),0!=i[e][1]&&(n=parseInt(r.style.top)+t.y,r.style.top=o._validScaledProp("top",n)+"px"),0!=i[e][2]&&(n=r.clientWidth+i[e][2]*t.x,r.style.width=o._validScaledProp("width",n)+"px"),0!=i[e][3]&&(n=r.clientHeight+i[e][3]*t.y,r.style.height=o._validScaledProp("height",n)+"px")},_validScaledProp:function(e,t){var i=this.resizer,n=document;switch(t=isNaN(t)?0:t,e){case"left":return t<0?0:t+i.clientWidth>n.clientWidth?n.clientWidth-i.clientWidth:t;case"top":return t<0?0:t+i.clientHeight>n.clientHeight?n.clientHeight-i.clientHeight:t;case"width":return t<=0?1:t+i.offsetLeft>n.clientWidth?n.clientWidth-i.offsetLeft:t;case"height":return t<=0?1:t+i.offsetTop>n.clientHeight?n.clientHeight-i.offsetTop:t}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var e=this,t=domUtils.getXY(e.editor.ui.getDom()),i=domUtils.getXY(e.editor.iframe);domUtils.setStyles(e.cover,{width:e.editor.iframe.offsetWidth+"px",height:e.editor.iframe.offsetHeight+"px",top:i.y-t.y+"px",left:i.x-t.x+"px",position:"absolute",display:""})},show:function(e){var t=this;t.resizer.style.display="block",e&&t.attachTo(e),domUtils.on(this.resizer,"mousedown",t.proxy(t._eventHandler,t)),domUtils.on(t.doc,"mouseup",t.proxy(t._eventHandler,t)),t.showCover(),t.editor.fireEvent("afterscaleshow",t),t.editor.fireEvent("saveScene")},hide:function(){var e=this;e.hideCover(),e.resizer.style.display="none",domUtils.un(e.resizer,"mousedown",e.proxy(e._eventHandler,e)),domUtils.un(e.doc,"mouseup",e.proxy(e._eventHandler,e)),e.editor.fireEvent("afterscalehide",e)},proxy:function(e,t){return function(i){return e.apply(t||this,arguments)}},attachTo:function(e){var t=this,i=t.target=e,n=this.resizer,o=domUtils.getXY(i),r=domUtils.getXY(t.editor.iframe),s=domUtils.getXY(n.parentNode);domUtils.setStyles(n,{width:i.width+"px",height:i.height+"px",left:r.x+o.x-t.editor.document.body.scrollLeft-s.x-parseInt(n.style.borderLeftWidth)+"px",top:r.y+o.y-t.editor.document.body.scrollTop-s.y-parseInt(n.style.borderTopWidth)+"px"})}}}(),function(){var e,i=this;i.setOpt("imageScaleEnabled",!0),!browser.ie&&i.options.imageScaleEnabled&&i.addListener("click",(function(n,o){var r=i.selection.getRange(),s=r.getClosedNode();if(s&&"IMG"==s.tagName&&"false"!=i.body.contentEditable){if(-1!=s.className.indexOf("edui-faked-music")||s.getAttribute("anchorname")||domUtils.hasClass(s,"loadingclass")||domUtils.hasClass(s,"loaderrorclass"))return;if(!e){e=new t,e.init(i),i.ui.getDom().appendChild(e.resizer);var a,l=function(t){e.hide(),e.target&&i.selection.getRange().selectNode(e.target).select()},c=function(e){var t=e.target||e.srcElement;!t||void 0!==t.className&&-1!=t.className.indexOf("edui-editor-imagescale")||l(e)};i.addListener("afterscaleshow",(function(e){i.addListener("beforekeydown",l),i.addListener("beforemousedown",c),domUtils.on(document,"keydown",l),domUtils.on(document,"mousedown",c),i.selection.getNative().removeAllRanges()})),i.addListener("afterscalehide",(function(t){i.removeListener("beforekeydown",l),i.removeListener("beforemousedown",c),domUtils.un(document,"keydown",l),domUtils.un(document,"mousedown",c);var n=e.target;n.parentNode&&i.selection.getRange().selectNode(n).select()})),domUtils.on(e.resizer,"mousedown",(function(t){i.selection.getNative().removeAllRanges();var n=t.target||t.srcElement;n&&-1==n.className.indexOf("edui-editor-imagescale-hand")&&(a=setTimeout((function(){e.hide(),e.target&&i.selection.getRange().selectNode(n).select()}),200))})),domUtils.on(e.resizer,"mouseup",(function(e){var t=e.target||e.srcElement;t&&-1==t.className.indexOf("edui-editor-imagescale-hand")&&clearTimeout(a)}))}e.show(s)}else e&&"none"!=e.resizer.style.display&&e.hide()})),browser.webkit&&i.addListener("click",(function(e,t){if("IMG"==t.target.tagName&&"false"!=i.body.contentEditable){var n=new dom.Range(i.document);n.selectNode(t.target).select()}}))}}(),UE.plugin.register("autolink",(function(){return browser.ie?{}:{bindEvents:{reset:function(){0},keydown:function(e,t){var i=this,n=t.keyCode||t.which;if(32==n||13==n){var o,r,s=i.selection.getNative(),a=s.getRangeAt(0).cloneRange(),l=a.startContainer;while(1==l.nodeType&&a.startOffset>0){if(l=a.startContainer.childNodes[a.startOffset-1],!l)break;a.setStart(l,1==l.nodeType?l.childNodes.length:l.nodeValue.length),a.collapse(!0),l=a.startContainer}do{if(0==a.startOffset){l=a.startContainer.previousSibling;while(l&&1==l.nodeType)l=l.lastChild;if(!l||domUtils.isFillChar(l))break;o=l.nodeValue.length}else l=a.startContainer,o=a.startOffset;a.setStart(l,o-1),r=a.toString().charCodeAt(0)}while(160!=r&&32!=r);if(a.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){while(a.toString().length){if(/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(a.toString()))break;try{a.setStart(a.startContainer,a.startOffset+1)}catch(m){l=a.startContainer;while(!(next=l.nextSibling)){if(domUtils.isBody(l))return;l=l.parentNode}a.setStart(next,0)}}if(domUtils.findParentByTagName(a.startContainer,"a",!0))return;var c,d=i.document.createElement("a"),u=i.document.createTextNode(" ");i.undoManger&&i.undoManger.save(),d.appendChild(a.extractContents()),d.href=d.innerHTML=d.innerHTML.replace(/<[^>]+>/g,""),c=d.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),c=/^(?:https?:\/\/)/gi.test(c)?c:"http://"+c,d.setAttribute("_src",utils.html(c)),d.href=utils.html(c),a.insertNode(d),d.parentNode.insertBefore(u,d.nextSibling),a.setStart(u,0),a.collapse(!0),s.removeAllRanges(),s.addRange(a),i.undoManger&&i.undoManger.save()}}}}}}),(function(){var e={37:1,38:1,39:1,40:1,13:1,32:1};function t(e){if(3==e.nodeType)return null;if("A"==e.nodeName)return e;var t=e.lastChild;while(t){if("A"==t.nodeName)return t;if(3==t.nodeType){if(domUtils.isWhitespace(t)){t=t.previousSibling;continue}return null}t=t.lastChild}}browser.ie&&this.addListener("keyup",(function(i,n){var o=this,r=n.keyCode;if(e[r]){var s=o.selection.getRange(),a=s.startContainer;if(13==r){while(a&&!domUtils.isBody(a)&&!domUtils.isBlockElm(a))a=a.parentNode;if(a&&!domUtils.isBody(a)&&"P"==a.nodeName){var l=a.previousSibling;if(l&&1==l.nodeType){l=t(l);l&&!l.getAttribute("_href")&&domUtils.remove(l,!0)}}}else if(32==r)3==a.nodeType&&/^\s$/.test(a.nodeValue)&&(a=a.previousSibling,a&&"A"==a.nodeName&&!a.getAttribute("_href")&&domUtils.remove(a,!0));else if(a=domUtils.findParentByTagName(a,"a",!0),a&&!a.getAttribute("_href")){var c=s.createBookmark();domUtils.remove(a,!0),s.moveToBookmark(c).select(!0)}}}))})),UE.plugins["autoheight"]=function(){var e=this;if(e.autoHeightEnabled=!1!==e.options.autoHeightEnabled,e.autoHeightEnabled){var t,i,n,o,r=0,s=e.options;e.addListener("fullscreenchanged",(function(e,t){o=t})),e.addListener("destroy",(function(){e.removeListener("contentchange afterinserthtml keyup mouseup",a)})),e.enableAutoHeight=function(){var e=this;if(e.autoHeightEnabled){var i=e.document;e.autoHeightEnabled=!0,t=i.body.style.overflowY,i.body.style.overflowY="hidden",e.addListener("contentchange afterinserthtml keyup mouseup",a),setTimeout((function(){a.call(e)}),browser.gecko?100:0),e.fireEvent("autoheightchanged",e.autoHeightEnabled)}},e.disableAutoHeight=function(){e.body.style.overflowY=t||"",e.removeListener("contentchange",a),e.removeListener("keyup",a),e.removeListener("mouseup",a),e.autoHeightEnabled=!1,e.fireEvent("autoheightchanged",e.autoHeightEnabled)},e.on("setHeight",(function(){e.disableAutoHeight()})),e.addListener("ready",(function(){var t,i;e.enableAutoHeight(),domUtils.on(browser.ie?e.body:e.document,browser.webkit?"dragover":"drop",(function(){clearTimeout(t),t=setTimeout((function(){a.call(e)}),100)})),window.onscroll=function(){null===i?i=this.scrollY:0==this.scrollY&&0!=i&&(e.window.scrollTo(0,0),i=null)}}))}function a(){var e=this;clearTimeout(n),o||(!e.queryCommandState||e.queryCommandState&&1!=e.queryCommandState("source"))&&(n=setTimeout((function(){var t=e.body.lastChild;while(t&&1!=t.nodeType)t=t.previousSibling;t&&1==t.nodeType&&(t.style.clear="both",i=Math.max(domUtils.getXY(t).y+t.offsetHeight+25,Math.max(s.minFrameHeight,s.initialFrameHeight)),i!=r&&(i!==parseInt(e.iframe.parentNode.style.height)&&(e.iframe.parentNode.style.height=i+"px"),e.body.style.height=i+"px",r=i),domUtils.removeStyle(t,"clear"))}),50))}},UE.plugins["autofloat"]=function(){var e=this,t=e.getLang();e.setOpt({topOffset:0});var i=!1!==e.options.autoFloatEnabled,n=e.options.topOffset;if(i){var o,r,s,a,l=UE.ui.uiUtils,c=browser.ie&&browser.version<=6,d=browser.quirks,u=document.createElement("div"),m=!0,p=utils.defer((function(){v()}),browser.ie?200:100,!0);e.addListener("destroy",(function(){domUtils.un(window,["scroll","resize"],v),e.removeListener("keydown",p)})),e.addListener("ready",(function(){if(h(e)){if(!e.ui)return;a=l.getClientRect,r=e.ui.getDom("toolbarbox"),s=a(r).top,o=r.style.cssText,u.style.height=r.offsetHeight+"px",c&&f(),domUtils.on(window,["scroll","resize"],v),e.addListener("keydown",p),e.addListener("beforefullscreenchange",(function(e,t){t&&b()})),e.addListener("fullscreenchanged",(function(e,t){t||v()})),e.addListener("sourcemodechanged",(function(e,t){setTimeout((function(){v()}),0)})),e.addListener("clearDoc",(function(){setTimeout((function(){v()}),0)}))}}))}function h(){return UE.ui?1:(alert(t.autofloatMsg),0)}function f(){var e=document.body.style;e.backgroundImage='url("about:blank")',e.backgroundAttachment="fixed"}function g(){var t=domUtils.getXY(r),i=domUtils.getComputedStyle(r,"position"),o=domUtils.getComputedStyle(r,"left");r.style.width=r.offsetWidth+"px",r.style.zIndex=1*e.options.zIndex+1,r.parentNode.insertBefore(u,r),c||d&&browser.ie?("absolute"!=r.style.position&&(r.style.position="absolute"),r.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-s+n+"px"):(browser.ie7Compat&&m&&(m=!1,r.style.left=domUtils.getXY(r).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=r.style.position&&(r.style.position="fixed",r.style.top=n+"px",("absolute"==i||"relative"==i)&&parseFloat(o)&&(r.style.left=t.x+"px")))}function b(){m=!0,u.parentNode&&u.parentNode.removeChild(u),r.style.cssText=o}function v(){var t=a(e.container),i=e.options.toolbarTopOffset||0;t.top<0&&t.bottom-r.offsetHeight>i?g():b()}},UE.plugins["video"]=function(){var e=this;function t(t,i,n,o,r,s,a){var l;switch(t=utils.unhtmlForUrl(t),r=utils.unhtml(r),s=utils.unhtml(s).trim(),i=parseInt(i,10)||0,n=parseInt(n,10)||0,a){case"image":l="<img "+(o?'id="'+o+'"':"")+' width="'+i+'" height="'+n+'" _url="'+t+'" class="'+s.replace(/\bvideo-js\b/,"")+'" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+e.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(r?"float:"+r+";":"")+'" />';break;case"embed":l='<embed type="application/x-shockwave-flash" class="'+s+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+utils.html(t)+'" width="'+i+'" height="'+n+'"'+(r?' style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';break;case"video":var c=t.substr(t.lastIndexOf(".")+1);"ogv"==c&&(c="ogg"),l="<video"+(o?' id="'+o+'"':"")+' class="'+s+' video-js" '+(r?' style="float:'+r+'"':"")+' controls preload="none" width="'+i+'" height="'+n+'" src="'+t+'" data-setup="{}"><source src="'+t+'" type="video/'+c+'" /></video>';break}return l}function i(e,i){utils.each(e.getNodesByTagName(i?"img":"embed video"),(function(e){var n=e.getAttr("class");if(n&&-1!=n.indexOf("edui-faked-video")){var o=t(i?e.getAttr("_url"):e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),null,e.getStyle("float")||"",n,i?"embed":"image");e.parentNode.replaceChild(UE.uNode.createElement(o),e)}if(n&&-1!=n.indexOf("edui-upload-video")){o=t(i?e.getAttr("_url"):e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),null,e.getStyle("float")||"",n,i?"video":"image");e.parentNode.replaceChild(UE.uNode.createElement(o),e)}}))}e.addOutputRule((function(e){i(e,!0)})),e.addInputRule((function(e){i(e)})),e.commands["insertvideo"]={execCommand:function(i,n,o){n=utils.isArray(n)?n:[n];for(var r,s,a=[],l="tmpVedio",c=0,d=n.length;c<d;c++)s=n[c],r="upload"==o?"edui-upload-video video-js vjs-default-skin":"edui-faked-video",a.push(t(s.url,s.width||420,s.height||280,l+c,null,r,"image"));e.execCommand("inserthtml",a.join(""),!0);var u=this.selection.getRange();for(c=0,d=n.length;c<d;c++){var m=this.document.getElementById("tmpVedio"+c);domUtils.removeAttributes(m,"id"),u.selectNode(m).select(),e.execCommand("imagefloat",n[c].align)}},queryCommandState:function(){var t=e.selection.getRange().getClosedNode(),i=t&&("edui-faked-video"==t.className||-1!=t.className.indexOf("edui-upload-video"));return i?1:0}}},function(){var e=UE.UETable=function(e){this.table=e,this.indexTable=[],this.selectedTds=[],this.cellsRange={},this.update(e)};function t(e){}e.removeSelectedClass=function(e){utils.each(e,(function(e){domUtils.removeClasses(e,"selectTdClass")}))},e.addSelectedClass=function(e){utils.each(e,(function(e){domUtils.addClass(e,"selectTdClass")}))},e.isEmptyBlock=function(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var i in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(i)&&e.getElementsByTagName(i).length)return 0;return 1},e.getWidth=function(e){return e?parseInt(domUtils.getComputedStyle(e,"width"),10):0},e.getTableCellAlignState=function(e){!utils.isArray(e)&&(e=[e]);var t={},i=["align","valign"],n=null,o=!0;return utils.each(e,(function(e){return utils.each(i,(function(i){if(n=e.getAttribute(i),!t[i]&&n)t[i]=n;else if(!t[i]||n!==t[i])return o=!1,!1})),o})),o?t:null},e.getTableItemsByRange=function(e){var t=e.selection.getStart();t&&t.id&&0===t.id.indexOf("_baidu_bookmark_start_")&&t.nextSibling&&(t=t.nextSibling);var i=t&&domUtils.findParentByTagName(t,["td","th"],!0),n=i&&i.parentNode,o=t&&domUtils.findParentByTagName(t,"caption",!0),r=o?o.parentNode:n&&n.parentNode.parentNode;return{cell:i,tr:n,table:r,caption:o}},e.getUETableBySelected=function(t){var i=e.getTableItemsByRange(t).table;return i&&i.ueTable&&i.ueTable.selectedTds.length?i.ueTable:null},e.getDefaultValue=function(e,t){var i,n,o,r,s={thin:"0px",medium:"1px",thick:"2px"};if(t)return a=t.getElementsByTagName("td")[0],r=domUtils.getComputedStyle(t,"border-left-width"),i=parseInt(s[r]||r,10),r=domUtils.getComputedStyle(a,"padding-left"),n=parseInt(s[r]||r,10),r=domUtils.getComputedStyle(a,"border-left-width"),o=parseInt(s[r]||r,10),{tableBorder:i,tdPadding:n,tdBorder:o};t=e.document.createElement("table"),t.insertRow(0).insertCell(0).innerHTML="xxx",e.body.appendChild(t);var a=t.getElementsByTagName("td")[0];return r=domUtils.getComputedStyle(t,"border-left-width"),i=parseInt(s[r]||r,10),r=domUtils.getComputedStyle(a,"padding-left"),n=parseInt(s[r]||r,10),r=domUtils.getComputedStyle(a,"border-left-width"),o=parseInt(s[r]||r,10),domUtils.remove(t),{tableBorder:i,tdPadding:n,tdBorder:o}},e.getUETable=function(t){var i=t.tagName.toLowerCase();return t="td"==i||"th"==i||"caption"==i?domUtils.findParentByTagName(t,"table",!0):t,t.ueTable||(t.ueTable=new e(t)),t.ueTable},e.cloneCell=function(e,t,i){if(!e||utils.isString(e))return this.table.ownerDocument.createElement(e||"td");var n=domUtils.hasClass(e,"selectTdClass");n&&domUtils.removeClasses(e,"selectTdClass");var o=e.cloneNode(!0);return t&&(o.rowSpan=o.colSpan=1),!i&&domUtils.removeAttributes(o,"width height"),!i&&domUtils.removeAttributes(o,"style"),o.style.borderLeftStyle="",o.style.borderTopStyle="",o.style.borderLeftColor=e.style.borderRightColor,o.style.borderLeftWidth=e.style.borderRightWidth,o.style.borderTopColor=e.style.borderBottomColor,o.style.borderTopWidth=e.style.borderBottomWidth,n&&domUtils.addClass(e,"selectTdClass"),o},e.prototype={getMaxRows:function(){for(var e,t=this.table.rows,i=1,n=0;e=t[n];n++){for(var o,r=1,s=0;o=e.cells[s++];)r=Math.max(o.rowSpan||1,r);i=Math.max(r+n,i)}return i},getMaxCols:function(){for(var e,t=this.table.rows,i=0,n={},o=0;e=t[o];o++){for(var r,s=0,a=0;r=e.cells[a++];)if(s+=r.colSpan||1,r.rowSpan&&r.rowSpan>1)for(var l=1;l<r.rowSpan;l++)n["row_"+(o+l)]?n["row_"+(o+l)]++:n["row_"+(o+l)]=r.colSpan||1;s+=n["row_"+o]||0,i=Math.max(s,i)}return i},getCellColIndex:function(e){},getHSideCell:function(e,i){try{var n,o,r=this.getCellInfo(e),s=this.selectedTds.length,a=this.cellsRange;return!i&&(s?!a.beginColIndex:!r.colIndex)||i&&(s?a.endColIndex==this.colsNum-1:r.colIndex==this.colsNum-1)?null:(n=s?a.beginRowIndex:r.rowIndex,o=i?s?a.endColIndex+1:r.colIndex+1:s?a.beginColIndex-1:r.colIndex<1?0:r.colIndex-1,this.getCell(this.indexTable[n][o].rowIndex,this.indexTable[n][o].cellIndex))}catch(l){t(l)}},getTabNextCell:function(e,t){var i,n=this.getCellInfo(e),o=t||n.rowIndex,r=n.colIndex+1+(n.colSpan-1);try{i=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(s){try{o=1*o+1,r=0,i=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(s){}}return i},getVSideCell:function(e,i,n){try{var o,r,s=this.getCellInfo(e),a=this.selectedTds.length&&!n,l=this.cellsRange;return!i&&0==s.rowIndex||i&&(a?l.endRowIndex==this.rowsNum-1:s.rowIndex+s.rowSpan>this.rowsNum-1)?null:(o=i?a?l.endRowIndex+1:s.rowIndex+s.rowSpan:a?l.beginRowIndex-1:s.rowIndex-1,r=a?l.beginColIndex:s.colIndex,this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex))}catch(c){t(c)}},getSameEndPosCells:function(e,i){try{for(var n="x"===i.toLowerCase(),o=domUtils.getXY(e)[n?"x":"y"]+e["offset"+(n?"Width":"Height")],r=this.table.rows,s=null,a=[],l=0;l<this.rowsNum;l++){s=r[l].cells;for(var c,d=0;c=s[d++];){var u=domUtils.getXY(c)[n?"x":"y"]+c["offset"+(n?"Width":"Height")];if(u>o&&n)break;if((e==c||o==u)&&(1==c[n?"colSpan":"rowSpan"]&&a.push(c),n))break}}return a}catch(m){t(m)}},setCellContent:function(e,t){e.innerHTML=t||(browser.ie?domUtils.fillChar:"<br />")},cloneCell:e.cloneCell,getSameStartPosXCells:function(e){try{for(var i,n=domUtils.getXY(e).x+e.offsetWidth,o=this.table.rows,r=[],s=0;s<this.rowsNum;s++){i=o[s].cells;for(var a,l=0;a=i[l++];){var c=domUtils.getXY(a).x;if(c>n)break;if(c==n&&1==a.colSpan){r.push(a);break}}}return r}catch(d){t(d)}},update:function(e){this.table=e||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];var t=this.table.rows,i=this.getMaxRows(),n=i-t.length,o=this.getMaxCols();while(n--)this.table.insertRow(t.length);this.rowsNum=i,this.colsNum=o;for(var r=0,s=t.length;r<s;r++)this.indexTable[r]=new Array(o);for(var a,l=0;a=t[l];l++)for(var c,d=0,u=a.cells;c=u[d];d++){c.rowSpan>i&&(c.rowSpan=i);var m=d,p=c.rowSpan||1,h=c.colSpan||1;while(this.indexTable[l][m])m++;for(var f=0;f<p;f++)for(var g=0;g<h;g++)this.indexTable[l+f][m+g]={rowIndex:l,cellIndex:d,colIndex:m,rowSpan:p,colSpan:h}}for(f=0;f<i;f++)for(g=0;g<o;g++)void 0===this.indexTable[f][g]&&(a=t[f],c=a.cells[a.cells.length-1],c=c?c.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(c),1!==c.colSpan&&(c.colSpan=1),1!==c.rowSpan&&(c.rowSpan=1),a.appendChild(c),this.indexTable[f][g]={rowIndex:f,cellIndex:c.cellIndex,colIndex:g,rowSpan:1,colSpan:1});var b=domUtils.getElementsByTagName(this.table,"td"),v=[];if(utils.each(b,(function(e){domUtils.hasClass(e,"selectTdClass")&&v.push(e)})),v.length){var y=v[0],C=v[v.length-1],x=this.getCellInfo(y),w=this.getCellInfo(C);this.selectedTds=v,this.cellsRange={beginRowIndex:x.rowIndex,beginColIndex:x.colIndex,endRowIndex:w.rowIndex+w.rowSpan-1,endColIndex:w.colIndex+w.colSpan-1}}if(!domUtils.hasClass(this.table.rows[0],"firstRow")){domUtils.addClass(this.table.rows[0],"firstRow");for(r=1;r<this.table.rows.length;r++)domUtils.removeClasses(this.table.rows[r],"firstRow")}},getCellInfo:function(e){if(e)for(var t=e.cellIndex,i=e.parentNode.rowIndex,n=this.indexTable[i],o=this.colsNum,r=t;r<o;r++){var s=n[r];if(s.rowIndex===i&&s.cellIndex===t)return s}},getCell:function(e,t){return e<this.rowsNum&&this.table.rows[e].cells[t]||null},deleteCell:function(e,t){t="number"==typeof t?t:e.parentNode.rowIndex;var i=this.table.rows[t];i.deleteCell(e.cellIndex)},getCellsRange:function(e,t){function i(e,t,o,r){var s,a,l,c=e,d=t,u=o,m=r;if(e>0)for(a=t;a<r;a++)s=n.indexTable[e][a],l=s.rowIndex,l<e&&(c=Math.min(l,c));if(r<n.colsNum)for(l=e;l<o;l++)s=n.indexTable[l][r],a=s.colIndex+s.colSpan-1,a>r&&(m=Math.max(a,m));if(o<n.rowsNum)for(a=t;a<r;a++)s=n.indexTable[o][a],l=s.rowIndex+s.rowSpan-1,l>o&&(u=Math.max(l,u));if(t>0)for(l=e;l<o;l++)s=n.indexTable[l][t],a=s.colIndex,a<t&&(d=Math.min(s.colIndex,d));return c!=e||d!=t||u!=o||m!=r?i(c,d,u,m):{beginRowIndex:e,beginColIndex:t,endRowIndex:o,endColIndex:r}}try{var n=this,o=n.getCellInfo(e);if(e===t)return{beginRowIndex:o.rowIndex,beginColIndex:o.colIndex,endRowIndex:o.rowIndex+o.rowSpan-1,endColIndex:o.colIndex+o.colSpan-1};var r=n.getCellInfo(t),s=Math.min(o.rowIndex,r.rowIndex),a=Math.min(o.colIndex,r.colIndex),l=Math.max(o.rowIndex+o.rowSpan-1,r.rowIndex+r.rowSpan-1),c=Math.max(o.colIndex+o.colSpan-1,r.colIndex+r.colSpan-1);return i(s,a,l,c)}catch(d){}},getCells:function(e){this.clearSelected();for(var t,i,n,o=e.beginRowIndex,r=e.beginColIndex,s=e.endRowIndex,a=e.endColIndex,l={},c=[],d=o;d<=s;d++)for(var u=r;u<=a;u++){t=this.indexTable[d][u],i=t.rowIndex,n=t.colIndex;var m=i+"|"+n;if(!l[m]){if(l[m]=1,i<d||n<u||i+t.rowSpan-1>s||n+t.colSpan-1>a)return null;c.push(this.getCell(i,t.cellIndex))}}return c},clearSelected:function(){e.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(t){var i=this.getCells(t);e.addSelectedClass(i),this.selectedTds=i,this.cellsRange=t},isFullRow:function(){var e=this.cellsRange;return e.endColIndex-e.beginColIndex+1==this.colsNum},isFullCol:function(){var e=this.cellsRange,t=this.table,i=t.getElementsByTagName("th"),n=e.endRowIndex-e.beginRowIndex+1;return i.length?n==this.rowsNum||n==this.rowsNum-1:n==this.rowsNum},getNextCell:function(e,i,n){try{var o,r,s=this.getCellInfo(e),a=this.selectedTds.length&&!n,l=this.cellsRange;return!i&&0==s.rowIndex||i&&(a?l.endRowIndex==this.rowsNum-1:s.rowIndex+s.rowSpan>this.rowsNum-1)?null:(o=i?a?l.endRowIndex+1:s.rowIndex+s.rowSpan:a?l.beginRowIndex-1:s.rowIndex-1,r=a?l.beginColIndex:s.colIndex,this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex))}catch(c){t(c)}},getPreviewCell:function(e,i){try{var n,o,r=this.getCellInfo(e),s=this.selectedTds.length,a=this.cellsRange;return!i&&(s?!a.beginColIndex:!r.colIndex)||i&&(s?a.endColIndex==this.colsNum-1:r.rowIndex>this.colsNum-1)?null:(n=i?s?a.beginRowIndex:r.rowIndex<1?0:r.rowIndex-1:s?a.beginRowIndex:r.rowIndex,o=i?s?a.endColIndex+1:r.colIndex:s?a.beginColIndex-1:r.colIndex<1?0:r.colIndex-1,this.getCell(this.indexTable[n][o].rowIndex,this.indexTable[n][o].cellIndex))}catch(l){t(l)}},moveContent:function(t,i){if(!e.isEmptyBlock(i))if(e.isEmptyBlock(t))t.innerHTML=i.innerHTML;else{var n=t.lastChild;3!=n.nodeType&&dtd.$block[n.tagName]||t.appendChild(t.ownerDocument.createElement("br"));while(n=i.firstChild)t.appendChild(n)}},mergeRight:function(e){var t=this.getCellInfo(e),i=t.colIndex+t.colSpan,n=this.indexTable[t.rowIndex][i],o=this.getCell(n.rowIndex,n.cellIndex);e.colSpan=t.colSpan+n.colSpan,e.removeAttribute("width"),this.moveContent(e,o),this.deleteCell(o,n.rowIndex),this.update()},mergeDown:function(e){var t=this.getCellInfo(e),i=t.rowIndex+t.rowSpan,n=this.indexTable[i][t.colIndex],o=this.getCell(n.rowIndex,n.cellIndex);e.rowSpan=t.rowSpan+n.rowSpan,e.removeAttribute("height"),this.moveContent(e,o),this.deleteCell(o,n.rowIndex),this.update()},mergeRange:function(){var e=this.cellsRange,t=this.getCell(e.beginRowIndex,this.indexTable[e.beginRowIndex][e.beginColIndex].cellIndex);if("TH"==t.tagName&&e.endRowIndex!==e.beginRowIndex){var i=this.indexTable,n=this.getCellInfo(t);t=this.getCell(1,i[1][n.colIndex].cellIndex),e=this.getCellsRange(t,this.getCell(i[this.rowsNum-1][n.colIndex].rowIndex,i[this.rowsNum-1][n.colIndex].cellIndex))}for(var o,r=this.getCells(e),s=0;o=r[s++];)o!==t&&(this.moveContent(t,o),this.deleteCell(o));if(t.rowSpan=e.endRowIndex-e.beginRowIndex+1,t.rowSpan>1&&t.removeAttribute("height"),t.colSpan=e.endColIndex-e.beginColIndex+1,t.colSpan>1&&t.removeAttribute("width"),t.rowSpan==this.rowsNum&&1!=t.colSpan&&(t.colSpan=1),t.colSpan==this.colsNum&&1!=t.rowSpan){var a=t.parentNode.rowIndex;if(this.table.deleteRow){s=a+1;for(var l=a+1,c=t.rowSpan;s<c;s++)this.table.deleteRow(l)}else for(s=0,c=t.rowSpan-1;s<c;s++){var d=this.table.rows[a+1];d.parentNode.removeChild(d)}t.rowSpan=1}this.update()},insertRow:function(e,t){var i,n=this.colsNum,o=this.table,r=o.insertRow(e),s="string"==typeof t&&"TH"==t.toUpperCase();function a(e,t,i){if(0==e){var n=i.nextSibling||i.previousSibling,o=n.cells[e];"TH"==o.tagName&&(o=t.ownerDocument.createElement("th"),o.appendChild(t.firstChild),i.insertBefore(o,t),domUtils.remove(t))}else if("TH"==t.tagName){var r=t.ownerDocument.createElement("td");r.appendChild(t.firstChild),i.insertBefore(r,t),domUtils.remove(t)}}if(0==e||e==this.rowsNum)for(var l=0;l<n;l++)i=this.cloneCell(t,!0),this.setCellContent(i),i.getAttribute("vAlign")&&i.setAttribute("vAlign",i.getAttribute("vAlign")),r.appendChild(i),s||a(l,i,r);else{var c=this.indexTable[e];for(l=0;l<n;l++){var d=c[l];d.rowIndex<e?(i=this.getCell(d.rowIndex,d.cellIndex),i.rowSpan=d.rowSpan+1):(i=this.cloneCell(t,!0),this.setCellContent(i),r.appendChild(i)),s||a(l,i,r)}}return this.update(),r},deleteRow:function(e){for(var t=this.table.rows[e],i=this.indexTable[e],n=this.colsNum,o=0,r=0;r<n;){var s=i[r],a=this.getCell(s.rowIndex,s.cellIndex);if(a.rowSpan>1&&s.rowIndex==e){var l=a.cloneNode(!0);l.rowSpan=a.rowSpan-1,l.innerHTML="",a.rowSpan=1;var c,d=e+1,u=this.table.rows[d],m=this.getPreviewMergedCellsNum(d,r)-o;m<r?(c=r-m-1,domUtils.insertAfter(u.cells[c],l)):u.cells.length&&u.insertBefore(l,u.cells[0]),o+=1}r+=a.colSpan||1}var p=[],h={};for(r=0;r<n;r++){var f=i[r].rowIndex,g=i[r].cellIndex,b=f+"_"+g;h[b]||(h[b]=1,a=this.getCell(f,g),p.push(a))}var v=[];utils.each(p,(function(e){1==e.rowSpan?e.parentNode.removeChild(e):v.push(e)})),utils.each(v,(function(e){e.rowSpan--})),t.parentNode.removeChild(t),this.update()},insertCol:function(e,t,i){var n,o,r,s=this.rowsNum,a=0,l=parseInt((this.table.offsetWidth-20*(this.colsNum+1)-(this.colsNum+1))/(this.colsNum+1),10),c="string"==typeof t&&"TH"==t.toUpperCase();function d(e,t,i){if(0==e){var n=t.nextSibling||t.previousSibling;"TH"==n.tagName&&(n=t.ownerDocument.createElement("th"),n.appendChild(t.firstChild),i.insertBefore(n,t),domUtils.remove(t))}else if("TH"==t.tagName){var o=t.ownerDocument.createElement("td");o.appendChild(t.firstChild),i.insertBefore(o,t),domUtils.remove(t)}}if(0==e||e==this.colsNum)for(;a<s;a++)n=this.table.rows[a],r=n.cells[0==e?e:n.cells.length],o=this.cloneCell(t,!0),this.setCellContent(o),o.setAttribute("vAlign",o.getAttribute("vAlign")),r&&o.setAttribute("width",r.getAttribute("width")),e?domUtils.insertAfter(n.cells[n.cells.length-1],o):n.insertBefore(o,n.cells[0]),c||d(a,o,n);else for(;a<s;a++){var u=this.indexTable[a][e];u.colIndex<e?(o=this.getCell(u.rowIndex,u.cellIndex),o.colSpan=u.colSpan+1):(n=this.table.rows[a],r=n.cells[u.cellIndex],o=this.cloneCell(t,!0),this.setCellContent(o),o.setAttribute("vAlign",o.getAttribute("vAlign")),r&&o.setAttribute("width",r.getAttribute("width")),r?n.insertBefore(o,r):n.appendChild(o)),c||d(a,o,n)}this.update(),this.updateWidth(l,i||{tdPadding:10,tdBorder:1})},updateWidth:function(t,i){var n=this.table,o=e.getWidth(n)-2*i.tdPadding-i.tdBorder+t;if(o<n.ownerDocument.body.offsetWidth)n.setAttribute("width",o);else{var r=domUtils.getElementsByTagName(this.table,"td th");utils.each(r,(function(e){e.setAttribute("width",t)}))}},deleteCol:function(e){for(var t=this.indexTable,i=this.table.rows,n=this.table.getAttribute("width"),o=0,r=this.rowsNum,s={},a=0;a<r;){var l=t[a],c=l[e],d=c.rowIndex+"_"+c.colIndex;if(!s[d]){s[d]=1;var u=this.getCell(c.rowIndex,c.cellIndex);o||(o=u&&parseInt(u.offsetWidth/u.colSpan,10).toFixed(0)),u.colSpan>1?u.colSpan--:i[a].deleteCell(c.cellIndex),a+=c.rowSpan||1}}this.table.setAttribute("width",n-o),this.update()},splitToCells:function(e){var t=this,i=this.splitToRows(e);utils.each(i,(function(e){t.splitToCols(e)}))},splitToRows:function(e){var t=this.getCellInfo(e),i=t.rowIndex,n=t.colIndex,o=[];e.rowSpan=1,o.push(e);for(var r=i,s=i+t.rowSpan;r<s;r++)if(r!=i){var a=this.table.rows[r],l=a.insertCell(n-this.getPreviewMergedCellsNum(r,n));l.colSpan=t.colSpan,this.setCellContent(l),l.setAttribute("vAlign",e.getAttribute("vAlign")),l.setAttribute("align",e.getAttribute("align")),e.style.cssText&&(l.style.cssText=e.style.cssText),o.push(l)}return this.update(),o},getPreviewMergedCellsNum:function(e,t){for(var i=this.indexTable[e],n=0,o=0;o<t;){var r=i[o].colSpan,s=i[o].rowIndex;n+=r-(s==e?1:0),o+=r}return n},splitToCols:function(e){var t=(e.offsetWidth/e.colSpan-22).toFixed(0),i=this.getCellInfo(e),n=i.rowIndex,o=i.colIndex,r=[];e.colSpan=1,e.setAttribute("width",t),r.push(e);for(var s=o,a=o+i.colSpan;s<a;s++)if(s!=o){var l=this.table.rows[n],c=l.insertCell(this.indexTable[n][s].cellIndex+1);if(c.rowSpan=i.rowSpan,this.setCellContent(c),c.setAttribute("vAlign",e.getAttribute("vAlign")),c.setAttribute("align",e.getAttribute("align")),c.setAttribute("width",t),e.style.cssText&&(c.style.cssText=e.style.cssText),"TH"==e.tagName){var d=e.ownerDocument.createElement("th");d.appendChild(c.firstChild),d.setAttribute("vAlign",e.getAttribute("vAlign")),d.rowSpan=c.rowSpan,l.insertBefore(d,c),domUtils.remove(c)}r.push(c)}return this.update(),r},isLastCell:function(e,t,i){t=t||this.rowsNum,i=i||this.colsNum;var n=this.getCellInfo(e);return n.rowIndex+n.rowSpan==t&&n.colIndex+n.colSpan==i},getLastCell:function(e){e=e||this.table.getElementsByTagName("td");this.getCellInfo(e[0]);var t,i=this,n=e[0],o=n.parentNode,r=0,s=0;return utils.each(e,(function(e){e.parentNode==o&&(s+=e.colSpan||1),r+=e.rowSpan*e.colSpan||1})),t=r/s,utils.each(e,(function(e){if(i.isLastCell(e,t,s))return n=e,!1})),n},selectRow:function(e){var t=this.indexTable[e],i=this.getCell(t[0].rowIndex,t[0].cellIndex),n=this.getCell(t[this.colsNum-1].rowIndex,t[this.colsNum-1].cellIndex),o=this.getCellsRange(i,n);this.setSelected(o)},selectTable:function(){var e=this.table.getElementsByTagName("td"),t=this.getCellsRange(e[0],e[e.length-1]);this.setSelected(t)},setBackground:function(e,t){if("string"===typeof t)utils.each(e,(function(e){e.style.backgroundColor=t}));else if("object"===_typeof(t)){t=utils.extend({repeat:!0,colorList:["#ddd","#fff"]},t);for(var i,n=this.getCellInfo(e[0]).rowIndex,o=0,r=t.colorList,s=function(e,t,i){return e[t]?e[t]:i?e[t%e.length]:""},a=0;i=e[a++];){var l=this.getCellInfo(i);i.style.backgroundColor=s(r,n+o==l.rowIndex?o:++o,t.repeat)}}},removeBackground:function(e){utils.each(e,(function(e){e.style.backgroundColor=""}))}}}(),function(){var e=UE.UETable,t=function(t){return e.getTableItemsByRange(t)},i=function(t){return e.getUETableBySelected(t)},n=function(t,i){return e.getDefaultValue(t,i)},o=function(t){return e.getUETable(t)};function r(e,t){var i=domUtils.getElementsByTagName(e,"td th");utils.each(i,(function(e){e.removeAttribute("width")})),e.setAttribute("width",s(t,!0,n(t,e)));var o=[];setTimeout((function(){utils.each(i,(function(e){1==e.colSpan&&o.push(e.offsetWidth)})),utils.each(i,(function(e,t){1==e.colSpan&&e.setAttribute("width",o[t]+"")}))}),0)}function s(e,t,i){var n=e.body;return n.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(n,"margin-left"),10):0)-2*i.tableBorder-(e.options.offsetWidth||0)}function a(e){var i=t(e).cell;if(i){var n=o(i);return n.selectedTds.length?n.selectedTds:[i]}return[]}UE.commands["inserttable"]={queryCommandState:function(){return t(this).table?-1:0},execCommand:function(e,t){function i(e,t){for(var i=[],n=e.numRows,o=e.numCols,r=0;r<n;r++){i.push("<tr"+(0==r?' class="firstRow"':"")+">");for(var s=0;s<o;s++)i.push('<td width="'+t+'" vAlign="'+e.tdvalign+'" >'+(browser.ie&&browser.version<11?domUtils.fillChar:"<br/>")+"</td>");i.push("</tr>")}return"<table><tbody>"+i.join("")+"</tbody></table>"}t||(t=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var o=this,r=this.selection.getRange(),s=r.startContainer,a=domUtils.findParent(s,(function(e){return domUtils.isBlockElm(e)}),!0)||o.body,l=n(o),c=a.offsetWidth,d=Math.floor(c/t.numCols-2*l.tdPadding-l.tdBorder);!t.tdvalign&&(t.tdvalign=o.options.tdvalign),o.execCommand("inserthtml",i(t,d))}},UE.commands["insertparagraphbeforetable"]={queryCommandState:function(){return t(this).cell?0:-1},execCommand:function(){var e=t(this).table;if(e){var i=this.document.createElement("p");i.innerHTML=browser.ie?"&nbsp;":"<br />",e.parentNode.insertBefore(i,e),this.selection.getRange().setStart(i,0).setCursor()}}},UE.commands["deletetable"]={queryCommandState:function(){var e=this.selection.getRange();return domUtils.findParentByTagName(e.startContainer,"table",!0)?0:-1},execCommand:function(e,t){var i=this.selection.getRange();if(t=t||domUtils.findParentByTagName(i.startContainer,"table",!0),t){var n=t.nextSibling;n||(n=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"}),t.parentNode.insertBefore(n,t)),domUtils.remove(t),i=this.selection.getRange(),3==n.nodeType?i.setStartBefore(n):i.setStart(n,0),i.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands["cellalign"]={queryCommandState:function(){return a(this).length?0:-1},execCommand:function(e,t){var i=a(this);if(i.length)for(var n,o=0;n=i[o++];)n.setAttribute("align",t)}},UE.commands["cellvalign"]={queryCommandState:function(){return a(this).length?0:-1},execCommand:function(e,t){var i=a(this);if(i.length)for(var n,o=0;n=i[o++];)n.setAttribute("vAlign",t)}},UE.commands["insertcaption"]={queryCommandState:function(){var e=t(this).table;return e&&0==e.getElementsByTagName("caption").length?1:-1},execCommand:function(){var e=t(this).table;if(e){var i=this.document.createElement("caption");i.innerHTML=browser.ie?domUtils.fillChar:"<br/>",e.insertBefore(i,e.firstChild);var n=this.selection.getRange();n.setStart(i,0).setCursor()}}},UE.commands["deletecaption"]={queryCommandState:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");return t?0==t.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");if(t){domUtils.remove(t.getElementsByTagName("caption")[0]);var i=this.selection.getRange();i.setStart(t.rows[0].cells[0],0).setCursor()}}},UE.commands["inserttitle"]={queryCommandState:function(){var e=t(this).table;if(e){var i=e.rows[0];return"th"!=i.cells[i.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=t(this).table;e&&o(e).insertRow(0,"th");var i=e.getElementsByTagName("th")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands["deletetitle"]={queryCommandState:function(){var e=t(this).table;if(e){var i=e.rows[0];return"th"==i.cells[i.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=t(this).table;e&&domUtils.remove(e.rows[0]);var i=e.getElementsByTagName("td")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands["inserttitlecol"]={queryCommandState:function(){var e=t(this).table;if(e){var i=e.rows[e.rows.length-1];return i.getElementsByTagName("th").length?-1:0}return-1},execCommand:function(e){var i=t(this).table;i&&o(i).insertCol(0,"th"),r(i,this);var n=i.getElementsByTagName("th")[0];this.selection.getRange().setStart(n,0).setCursor(!1,!0)}},UE.commands["deletetitlecol"]={queryCommandState:function(){var e=t(this).table;if(e){var i=e.rows[e.rows.length-1];return i.getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var e=t(this).table;if(e)for(var i=0;i<e.rows.length;i++)domUtils.remove(e.rows[i].children[0]);r(e,this);var n=e.getElementsByTagName("td")[0];this.selection.getRange().setStart(n,0).setCursor(!1,!0)}},UE.commands["mergeright"]={queryCommandState:function(e){var i=t(this),n=i.table,r=i.cell;if(!n||!r)return-1;var s=o(n);if(s.selectedTds.length)return-1;var a=s.getCellInfo(r),l=a.colIndex+a.colSpan;if(l>=s.colsNum)return-1;var c=s.indexTable[a.rowIndex][l],d=n.rows[c.rowIndex].cells[c.cellIndex];return d&&r.tagName==d.tagName&&c.rowIndex==a.rowIndex&&c.rowSpan==a.rowSpan?0:-1},execCommand:function(e){var i=this.selection.getRange(),n=i.createBookmark(!0),r=t(this).cell,s=o(r);s.mergeRight(r),i.moveToBookmark(n).select()}},UE.commands["mergedown"]={queryCommandState:function(e){var i=t(this),n=i.table,r=i.cell;if(!n||!r)return-1;var s=o(n);if(s.selectedTds.length)return-1;var a=s.getCellInfo(r),l=a.rowIndex+a.rowSpan;if(l>=s.rowsNum)return-1;var c=s.indexTable[l][a.colIndex],d=n.rows[c.rowIndex].cells[c.cellIndex];return d&&r.tagName==d.tagName&&c.colIndex==a.colIndex&&c.colSpan==a.colSpan?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this).cell,r=o(n);r.mergeDown(n),e.moveToBookmark(i).select()}},UE.commands["mergecells"]={queryCommandState:function(){return i(this)?0:-1},execCommand:function(){var e=i(this);if(e&&e.selectedTds.length){var t=e.selectedTds[0];e.mergeRange();var n=this.selection.getRange();domUtils.isEmptyBlock(t)?n.setStart(t,0).collapse(!0):n.selectNodeContents(t),n.select()}}},UE.commands["insertrow"]={queryCommandState:function(){var e=t(this),i=e.cell;return i&&("TD"==i.tagName||"TH"==i.tagName&&e.tr!==e.table.rows[0])&&o(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this),r=n.cell,s=n.table,a=o(s),l=a.getCellInfo(r);if(a.selectedTds.length)for(var c=a.cellsRange,d=0,u=c.endRowIndex-c.beginRowIndex+1;d<u;d++)a.insertRow(c.beginRowIndex,r);else a.insertRow(l.rowIndex,r);e.moveToBookmark(i).select(),"enabled"===s.getAttribute("interlaced")&&this.fireEvent("interlacetable",s)}},UE.commands["insertrownext"]={queryCommandState:function(){var e=t(this),i=e.cell;return i&&"TD"==i.tagName&&o(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this),r=n.cell,s=n.table,a=o(s),l=a.getCellInfo(r);if(a.selectedTds.length)for(var c=a.cellsRange,d=0,u=c.endRowIndex-c.beginRowIndex+1;d<u;d++)a.insertRow(c.endRowIndex+1,r);else a.insertRow(l.rowIndex+l.rowSpan,r);e.moveToBookmark(i).select(),"enabled"===s.getAttribute("interlaced")&&this.fireEvent("interlacetable",s)}},UE.commands["deleterow"]={queryCommandState:function(){var e=t(this);return e.cell?0:-1},execCommand:function(){var e=t(this).cell,i=o(e),n=i.cellsRange,r=i.getCellInfo(e),s=i.getVSideCell(e),a=i.getVSideCell(e,!0),l=this.selection.getRange();if(utils.isEmptyObject(n))i.deleteRow(r.rowIndex);else for(var c=n.beginRowIndex;c<n.endRowIndex+1;c++)i.deleteRow(n.beginRowIndex);var d=i.table;if(d.getElementsByTagName("td").length)if(1==r.rowSpan||r.rowSpan==n.endRowIndex-n.beginRowIndex+1)(a||s)&&l.selectNodeContents(a||s).setCursor(!1,!0);else{var u=i.getCell(r.rowIndex,i.indexTable[r.rowIndex][r.colIndex].cellIndex);u&&l.selectNodeContents(u).setCursor(!1,!0)}else{var m=d.nextSibling;domUtils.remove(d),m&&l.setStart(m,0).setCursor(!1,!0)}"enabled"===d.getAttribute("interlaced")&&this.fireEvent("interlacetable",d)}},UE.commands["insertcol"]={queryCommandState:function(e){var i=t(this),n=i.cell;return n&&("TD"==n.tagName||"TH"==n.tagName&&n!==i.tr.cells[0])&&o(i.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(e){var i=this.selection.getRange(),n=i.createBookmark(!0);if(-1!=this.queryCommandState(e)){var r=t(this).cell,s=o(r),a=s.getCellInfo(r);if(s.selectedTds.length)for(var l=s.cellsRange,c=0,d=l.endColIndex-l.beginColIndex+1;c<d;c++)s.insertCol(l.beginColIndex,r);else s.insertCol(a.colIndex,r);i.moveToBookmark(n).select(!0)}}},UE.commands["insertcolnext"]={queryCommandState:function(){var e=t(this),i=e.cell;return i&&o(e.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this).cell,r=o(n),s=r.getCellInfo(n);if(r.selectedTds.length)for(var a=r.cellsRange,l=0,c=a.endColIndex-a.beginColIndex+1;l<c;l++)r.insertCol(a.endColIndex+1,n);else r.insertCol(s.colIndex+s.colSpan,n);e.moveToBookmark(i).select()}},UE.commands["deletecol"]={queryCommandState:function(){var e=t(this);return e.cell?0:-1},execCommand:function(){var e=t(this).cell,i=o(e),n=i.cellsRange,r=i.getCellInfo(e),s=i.getHSideCell(e),a=i.getHSideCell(e,!0);if(utils.isEmptyObject(n))i.deleteCol(r.colIndex);else for(var l=n.beginColIndex;l<n.endColIndex+1;l++)i.deleteCol(n.beginColIndex);var c=i.table,d=this.selection.getRange();if(c.getElementsByTagName("td").length)domUtils.inDoc(e,this.document)?d.setStart(e,0).setCursor(!1,!0):a&&domUtils.inDoc(a,this.document)?d.selectNodeContents(a).setCursor(!1,!0):s&&domUtils.inDoc(s,this.document)&&d.selectNodeContents(s).setCursor(!0,!0);else{var u=c.nextSibling;domUtils.remove(c),u&&d.setStart(u,0).setCursor(!1,!0)}}},UE.commands["splittocells"]={queryCommandState:function(){var e=t(this),i=e.cell;if(!i)return-1;var n=o(e.table);return n.selectedTds.length>0?-1:i&&(i.colSpan>1||i.rowSpan>1)?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this).cell,r=o(n);r.splitToCells(n),e.moveToBookmark(i).select()}},UE.commands["splittorows"]={queryCommandState:function(){var e=t(this),i=e.cell;if(!i)return-1;var n=o(e.table);return n.selectedTds.length>0?-1:i&&i.rowSpan>1?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this).cell,r=o(n);r.splitToRows(n),e.moveToBookmark(i).select()}},UE.commands["splittocols"]={queryCommandState:function(){var e=t(this),i=e.cell;if(!i)return-1;var n=o(e.table);return n.selectedTds.length>0?-1:i&&i.colSpan>1?0:-1},execCommand:function(){var e=this.selection.getRange(),i=e.createBookmark(!0),n=t(this).cell,r=o(n);r.splitToCols(n),e.moveToBookmark(i).select()}},UE.commands["adaptbytext"]=UE.commands["adaptbywindow"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e){var i=t(this),n=i.table;if(n)if("adaptbywindow"==e)r(n,this);else{var o=domUtils.getElementsByTagName(n,"td th");utils.each(o,(function(e){e.removeAttribute("width")})),n.removeAttribute("width")}}},UE.commands["averagedistributecol"]={queryCommandState:function(){var e=i(this);return e&&(e.isFullRow()||e.isFullCol())?0:-1},execCommand:function(e){var t=this,o=i(t);function r(){var e,i=o.table,r=0,s=0,a=n(t,i);if(o.isFullRow())r=i.offsetWidth,s=o.colsNum;else for(var l,c=o.cellsRange.beginColIndex,d=o.cellsRange.endColIndex,u=c;u<=d;)l=o.selectedTds[u],r+=l.offsetWidth,u+=l.colSpan,s+=1;return e=Math.ceil(r/s)-2*a.tdBorder-2*a.tdPadding,e}function s(e){utils.each(domUtils.getElementsByTagName(o.table,"th"),(function(e){e.setAttribute("width","")}));var t=o.isFullRow()?domUtils.getElementsByTagName(o.table,"td"):o.selectedTds;utils.each(t,(function(t){1==t.colSpan&&t.setAttribute("width",e)}))}o&&o.selectedTds.length&&s(r())}},UE.commands["averagedistributerow"]={queryCommandState:function(){var e=i(this);return e?e.selectedTds&&/th/gi.test(e.selectedTds[0].tagName)?-1:e.isFullRow()||e.isFullCol()?0:-1:-1},execCommand:function(e){var t=this,o=i(t);function r(){var e,i,r=0,s=o.table,a=n(t,s),l=parseInt(domUtils.getComputedStyle(s.getElementsByTagName("td")[0],"padding-top"));if(o.isFullCol()){var c,d,u=domUtils.getElementsByTagName(s,"caption"),m=domUtils.getElementsByTagName(s,"th");u.length>0&&(c=u[0].offsetHeight),m.length>0&&(d=m[0].offsetHeight),r=s.offsetHeight-(c||0)-(d||0),i=0==m.length?o.rowsNum:o.rowsNum-1}else{for(var p=o.cellsRange.beginRowIndex,h=o.cellsRange.endRowIndex,f=0,g=domUtils.getElementsByTagName(s,"tr"),b=p;b<=h;b++)r+=g[b].offsetHeight,f+=1;i=f}return e=browser.ie&&browser.version<9?Math.ceil(r/i):Math.ceil(r/i)-2*a.tdBorder-2*l,e}function s(e){var t=o.isFullCol()?domUtils.getElementsByTagName(o.table,"td"):o.selectedTds;utils.each(t,(function(t){1==t.rowSpan&&t.setAttribute("height",e)}))}o&&o.selectedTds.length&&s(r())}},UE.commands["cellalignment"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var n=this,o=i(n);if(o)utils.each(o.selectedTds,(function(e){domUtils.setAttributes(e,t)}));else{var r=n.selection.getStart(),s=r&&domUtils.findParentByTagName(r,["td","th","caption"],!0);/caption/gi.test(s.tagName)?(s.style.textAlign=t.align,s.style.verticalAlign=t.vAlign):domUtils.setAttributes(s,t),n.selection.getRange().setCursor(!0)}},queryCommandValue:function(e){var i=t(this).cell;if(i||(i=a(this)[0]),i){var n=UE.UETable.getUETable(i).selectedTds;return!n.length&&(n=i),UE.UETable.getTableCellAlignState(n)}return null}},UE.commands["tablealignment"]={queryCommandState:function(){return browser.ie&&browser.version<8?-1:t(this).table?0:-1},execCommand:function(e,t){var i=this,n=i.selection.getStart(),o=n&&domUtils.findParentByTagName(n,["table"],!0);o&&o.setAttribute("align",t)}},UE.commands["edittable"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var i=this.selection.getRange(),n=domUtils.findParentByTagName(i.startContainer,"table");if(n){var o=domUtils.getElementsByTagName(n,"td").concat(domUtils.getElementsByTagName(n,"th"),domUtils.getElementsByTagName(n,"caption"));utils.each(o,(function(e){e.style.borderColor=t}))}}},UE.commands["edittd"]={queryCommandState:function(){return t(this).table?0:-1},execCommand:function(e,t){var n=this,o=i(n);if(o)utils.each(o.selectedTds,(function(e){e.style.backgroundColor=t}));else{var r=n.selection.getStart(),s=r&&domUtils.findParentByTagName(r,["td","th","caption"],!0);s&&(s.style.backgroundColor=t)}}},UE.commands["settablebackground"]={queryCommandState:function(){return a(this).length>1?0:-1},execCommand:function(e,t){var i,n;i=a(this),n=o(i[0]),n.setBackground(i,t)}},UE.commands["cleartablebackground"]={queryCommandState:function(){var e=a(this);if(!e.length)return-1;for(var t,i=0;t=e[i++];)if(""!==t.style.backgroundColor)return 0;return-1},execCommand:function(){var e=a(this),t=o(e[0]);t.removeBackground(e)}},UE.commands["interlacetable"]=UE.commands["uninterlacetable"]={queryCommandState:function(e){var i=t(this).table;if(!i)return-1;var n=i.getAttribute("interlaced");return"interlacetable"==e?"enabled"===n?-1:0:n&&"disabled"!==n?0:-1},execCommand:function(e,i){var n=t(this).table;"interlacetable"==e?(n.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",n,i)):(n.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",n))}},UE.commands["setbordervisible"]={queryCommandState:function(e){var i=t(this).table;return i?0:-1},execCommand:function(){var e=t(this).table;utils.each(domUtils.getElementsByTagName(e,"td"),(function(e){e.style.borderWidth="1px",e.style.borderStyle="solid"}))}}}(),UE.plugins["table"]=function(){var e=this,t=null,i=5,n=!1,o=5,r=10,s=0,a=null,l=360,c=UE.UETable,d=function(e){return c.getUETable(e)},u=function(e){return c.getUETableBySelected(e)},m=function(e,t){return c.getDefaultValue(e,t)},p=function(e){return c.removeSelectedClass(e)};function h(e){}e.ready((function(){var e=this,t=e.selection.getText;e.selection.getText=function(){var i=u(e);if(i){var n="";return utils.each(i.selectedTds,(function(e){n+=e[browser.ie?"innerText":"textContent"]})),n}return t.call(e.selection)}}));var f=null,g=null,b="",v=!1,y=null,C=!1,x=null,w=null,T=!1,N=!0;e.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:e.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),e.getUETable=d;var S={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};function E(e,t){U(e,"width",!0),U(e,"height",!0)}function U(e,t,i){e.style[t]&&(i&&e.setAttribute(t,parseInt(e.style[t],10)),e.style[t]="")}function _(e){return"TD"==e.tagName||"TH"==e.tagName?e:(t=domUtils.findParentByTagName(e,"td",!0)||domUtils.findParentByTagName(e,"th",!0))?t:null;var t}function k(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var i in dtd.$isNotEmpty)if(e.getElementsByTagName(i).length)return 0;return 1}function A(t){return t.pageX||t.pageY?{x:t.pageX,y:t.pageY}:{x:t.clientX+e.document.body.scrollLeft-e.document.body.clientLeft,y:t.clientY+e.document.body.scrollTop-e.document.body.clientTop}}function I(t){if(!G())try{var i,o=_(t.target||t.srcElement);if(n&&(e.body.style.webkitUserSelect="none",(Math.abs(a.x-t.clientX)>r||Math.abs(a.y-t.clientY)>r)&&(z(),n=!1,s=0,W(t))),b&&w)return s=0,e.body.style.webkitUserSelect="none",e.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),i=A(t),R(e,!0,b,i,o),void("h"==b?x.style.left=L(w,t)+"px":"v"==b&&(x.style.top=P(w,t)+"px"));if(o){if(!0===e.fireEvent("excludetable",o))return;i=A(t);var l=H(o,i),c=domUtils.findParentByTagName(o,"table",!0);if(D(c,o,t,!0)){if(!0===e.fireEvent("excludetable",c))return;e.body.style.cursor="url("+e.options.cursorpath+"h.png),pointer"}else if(D(c,o,t)){if(!0===e.fireEvent("excludetable",c))return;e.body.style.cursor="url("+e.options.cursorpath+"v.png),pointer"}else{e.body.style.cursor="text";/\d/.test(l)&&(l=l.replace(/\d/,""),o=d(o).getPreviewCell(o,"v"==l)),R(e,!!o&&!!l,o?l:"",i,o)}}else B(!1,c,e)}catch(u){h(u)}}function B(e,t,i){if(e)O(t,i);else{if(C)return;setTimeout((function(){!C&&y&&y.parentNode&&y.parentNode.removeChild(y)}),2e3)}}function O(e,t){var i,n=domUtils.getXY(e),o=e.ownerDocument;if(y&&y.parentNode)return y;function r(n,o){clearTimeout(i),i=setTimeout((function(){t.fireEvent("tableClicked",e,o)}),300)}function s(n){clearTimeout(i);var o=d(e),r=e.rows[0].cells[0],s=o.getLastCell(),a=o.getCellsRange(r,s);t.selection.getRange().setStart(r,0).setCursor(!1,!0),o.setSelected(a)}y=o.createElement("div"),y.contentEditable=!1,y.innerHTML="",y.style.cssText="width:15px;height:15px;background-image:url("+t.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(n.y-15)+"px;left:"+n.x+"px;",domUtils.unSelectable(y),y.onmouseover=function(e){C=!0},y.onmouseout=function(e){C=!1},domUtils.on(y,"click",(function(e,t){r(t,this)})),domUtils.on(y,"dblclick",(function(e,t){s(t)})),domUtils.on(y,"dragstart",(function(e,t){domUtils.preventDefault(t)})),o.body.appendChild(y)}function D(e,t,i,n){var o=A(i),r=H(t,o);if(n){var s=e.getElementsByTagName("caption")[0],a=s?s.offsetHeight:0;return"v1"==r&&o.y-domUtils.getXY(e).y-a<8}return"h1"==r&&o.x-domUtils.getXY(e).x<8}function L(t,n){var o=d(t);if(o){var r=o.getSameEndPosCells(t,"x")[0],s=o.getSameStartPosXCells(t)[0],a=A(n).x,l=(r?domUtils.getXY(r).x:domUtils.getXY(o.table).x)+20,c=s?domUtils.getXY(s).x+s.offsetWidth-20:e.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(e.body,"width"),10);return l+=i,c-=i,a<l?l:a>c?c:a}}function P(e,t){try{var i=domUtils.getXY(e).y,n=A(t).y;return n<i?i:n}catch(o){h(o)}}function R(e,t,i,n,o){try{e.body.style.cursor="h"==i?"col-resize":"v"==i?"row-resize":"text",browser.ie&&(!i||T||u(e)?re(e):(oe(e,e.document),se(i,o))),v=t}catch(r){h(r)}}function H(e,t){var i=domUtils.getXY(e);return i?i.x+e.offsetWidth-t.x<o?"h":t.x-i.x<o?"h1":i.y+e.offsetHeight-t.y<o?"v":t.y-i.y<o?"v1":"":""}function q(t,i){if(!G())if(a={x:i.clientX,y:i.clientY},2==i.button){var n=u(e),o=!1;if(n){var r=ce(e,i);utils.each(n.selectedTds,(function(e){e===r&&(o=!0)})),o?(r=n.selectedTds[0],setTimeout((function(){e.selection.getRange().setStart(r,0).setCursor(!1,!0)}),0)):(p(domUtils.getElementsByTagName(e.body,"th td")),n.clearSelected())}}else j(i)}function M(t){s=0,t=t||e.window.event;var i,n=_(t.target||t.srcElement);if(n&&(i=H(n,A(t)))){if(re(e),"h1"==i)if(i="h",D(domUtils.findParentByTagName(n,"table"),n,t))e.execCommand("adaptbywindow");else if(n=d(n).getPreviewCell(n),n){var o=e.selection.getRange();o.selectNodeContents(n).setCursor(!0,!0)}if("h"==i){var r=d(n),a=r.table,l=Z(n,a,!0);l=F(l,"left"),r.width=r.offsetWidth;var c=[],u=[];utils.each(l,(function(e){c.push(e.offsetWidth)})),utils.each(l,(function(e){e.removeAttribute("width")})),window.setTimeout((function(){var e=!0;utils.each(l,(function(t,i){var n=t.offsetWidth;if(n>c[i])return e=!1,!1;u.push(n)}));var t=e?u:c;utils.each(l,(function(e,i){e.width=t[i]-ne()}))}),0)}}}function j(t){if(p(domUtils.getElementsByTagName(e.body,"td th")),utils.each(e.document.getElementsByTagName("table"),(function(e){e.ueTable=null})),f=ce(e,t),f){var i=domUtils.findParentByTagName(f,"table",!0);ut=d(i),ut&&ut.clearSelected(),v?$(t):(e.document.body.style.webkitUserSelect="",T=!0,e.addListener("mouseover",Q))}}function $(e){browser.ie&&(e=V(e)),z(),n=!0,t=setTimeout((function(){W(e)}),l)}function F(e,t){for(var i=[],n=null,o=0,r=e.length;o<r;o++)n=e[o][t],n&&i.push(n);return i}function z(){t&&clearTimeout(t),t=null}function V(e){var t=["pageX","pageY","clientX","clientY","srcElement","target"],i={};if(e)for(var n,o,r=0;n=t[r];r++)o=e[n],o&&(i[n]=o);return i}function W(t){if(n=!1,f=t.target||t.srcElement,f){var i=H(f,A(t));/\d/.test(i)&&(i=i.replace(/\d/,""),f=d(f).getPreviewCell(f,"v"==i)),re(e),oe(e,e.document),e.fireEvent("saveScene"),se(i,f),T=!0,b=i,w=f}}function J(e,t){if(!G()){if(z(),n=!1,v&&(s=++s%3,a={x:t.clientX,y:t.clientY},setTimeout((function(){s>0&&s--}),l),2===s))return s=0,void M(t);if(2!=t.button){var i=this,o=i.selection.getRange(),r=domUtils.findParentByTagName(o.startContainer,"table",!0),c=domUtils.findParentByTagName(o.endContainer,"table",!0);if((r||c)&&(r===c?(r=domUtils.findParentByTagName(o.startContainer,["td","th","caption"],!0),c=domUtils.findParentByTagName(o.endContainer,["td","th","caption"],!0),r!==c&&i.selection.clearRange()):i.selection.clearRange()),T=!1,i.document.body.style.webkitUserSelect="",b&&w&&(i.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),s=0,x=i.document.getElementById("ue_tableDragLine"),x)){var u=domUtils.getXY(w),m=domUtils.getXY(x);switch(b){case"h":Y(w,m.x-u.x);break;case"v":K(w,m.y-u.y-w.offsetHeight);break;default:}return b="",w=null,re(i),void i.fireEvent("saveScene")}if(f){var p=d(f),h=p?p.selectedTds[0]:null;if(h)o=new dom.Range(i.document),domUtils.isEmptyBlock(h)?o.setStart(h,0).setCursor(!1,!0):o.selectNodeContents(h).shrinkBoundary().setCursor(!1,!0);else if(o=i.selection.getRange().shrinkBoundary(),!o.collapsed){r=domUtils.findParentByTagName(o.startContainer,["td","th"],!0),c=domUtils.findParentByTagName(o.endContainer,["td","th"],!0);(r&&!c||!r&&c||r&&c&&r!==c)&&o.setCursor(!1,!0)}f=null,i.removeListener("mouseover",Q)}else{var g=domUtils.findParentByTagName(t.target||t.srcElement,"td",!0);if(g||(g=domUtils.findParentByTagName(t.target||t.srcElement,"th",!0)),g&&("TD"==g.tagName||"TH"==g.tagName)){if(!0===i.fireEvent("excludetable",g))return;o=new dom.Range(i.document),o.setStart(g,0).setCursor(!1,!0)}}i._selectionChange(250,t)}}}function Q(e,t){if(!G()){var i=this,n=t.target||t.srcElement;if(g=domUtils.findParentByTagName(n,"td",!0)||domUtils.findParentByTagName(n,"th",!0),f&&g&&("TD"==f.tagName&&"TD"==g.tagName||"TH"==f.tagName&&"TH"==g.tagName)&&domUtils.findParentByTagName(f,"table")==domUtils.findParentByTagName(g,"table")){var o=d(g);if(f!=g){i.document.body.style.webkitUserSelect="none",i.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var r=o.getCellsRange(f,g);o.setSelected(r)}else i.document.body.style.webkitUserSelect="",o.clearSelected()}t.preventDefault?t.preventDefault():t.returnValue=!1}}function X(e,t,i){var n=parseInt(domUtils.getComputedStyle(e,"line-height"),10),o=i+t;t=o<n?n:o,e.style.height&&(e.style.height=""),1==e.rowSpan?e.setAttribute("height",t):e.removeAttribute&&e.removeAttribute("height")}function Y(e,t){var i=d(e);if(i){var n=i.table,o=Z(e,n);if(n.style.width="",n.removeAttribute("width"),t=ee(t,e,o),e.nextSibling){utils.each(o,(function(e){e.left.width=+e.left.width+t,e.right&&(e.right.width=+e.right.width-t)}))}else utils.each(o,(function(e){e.left.width-=-t}))}}function G(){return"false"===e.body.contentEditable}function K(e,t){if(!(Math.abs(t)<10)){var i=d(e);if(i)for(var n,o=i.getSameEndPosCells(e,"y"),r=o[0]?o[0].offsetHeight:0,s=0;n=o[s++];)X(n,t,r)}}function Z(e,t,i){if(t||(t=domUtils.findParentByTagName(e,"table")),!t)return null;domUtils.getNodeIndex(e);var n=e,o=t.rows,r=0;while(n)1===n.nodeType&&(r+=n.colSpan||1),n=n.previousSibling;n=null;var s=[];return utils.each(o,(function(e){var t=e.cells,n=0;utils.each(t,(function(e){return n+=e.colSpan||1,n===r?(s.push({left:e,right:e.nextSibling||null}),!1):n>r?(i&&s.push({left:e}),!1):void 0}))})),s}function ee(e,t,n){if(e-=ne(),e<0)return 0;e-=te(t);var o=e<0?"left":"right";return e=Math.abs(e),utils.each(n,(function(t){var n=t[o];n&&(e=Math.min(e,te(n)-i))})),e=e<0?0:e,"left"===o?-e:e}function te(e){var t=0;t=e.offsetWidth-ne();e.nextSibling||(t-=ie(e)),t=t<0?0:t;try{e.width=t}catch(i){}return t}function ie(e){if(tab=domUtils.findParentByTagName(e,"table",!1),void 0===tab.offsetVal){var t=e.previousSibling;tab.offsetVal=t&&e.offsetWidth-t.offsetWidth===c.borderWidth?c.borderWidth:0}return tab.offsetVal}function ne(){if(void 0===c.tabcellSpace){var t=e.document.createElement("table"),i=e.document.createElement("tbody"),n=e.document.createElement("tr"),o=e.document.createElement("td"),r=null;o.style.cssText="border: 0;",o.width=1,n.appendChild(o),n.appendChild(r=o.cloneNode(!1)),i.appendChild(n),t.appendChild(i),t.style.cssText="visibility: hidden;",e.body.appendChild(t),c.paddingSpace=o.offsetWidth-1;var s=t.offsetWidth;o.style.cssText="",r.style.cssText="",c.borderWidth=(t.offsetWidth-s)/3,c.tabcellSpace=c.paddingSpace+c.borderWidth,e.body.removeChild(t)}return ne=function(){return c.tabcellSpace},c.tabcellSpace}function oe(e,t){T||(x=e.document.createElement("div"),domUtils.setAttributes(x,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),e.body.appendChild(x))}function re(e){var t;if(!T)while(t=e.document.getElementById("ue_tableDragLine"))domUtils.remove(t)}function se(e,t){if(t){var i,n=domUtils.findParentByTagName(t,"table"),o=n.getElementsByTagName("caption"),r=n.offsetWidth,s=n.offsetHeight-(o.length>0?o[0].offsetHeight:0),a=domUtils.getXY(n),l=domUtils.getXY(t);switch(e){case"h":i="height:"+s+"px;top:"+(a.y+(o.length>0?o[0].offsetHeight:0))+"px;left:"+(l.x+t.offsetWidth),x.style.cssText=i+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":i="width:"+r+"px;left:"+a.x+"px;top:"+(l.y+t.offsetHeight),x.style.cssText=i+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)";break;default:}}}function ae(e,t){for(var i,n,o=domUtils.getElementsByTagName(e.body,"table"),r=0;n=o[r++];){var s=domUtils.getElementsByTagName(n,"td");s[0]&&(t?(i=s[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(i)&&domUtils.addClass(n,"noBorderTable")):domUtils.removeClasses(n,"noBorderTable"))}}function le(e,t,i){var n=e.body;return n.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(n,"margin-left"),10):0)-2*i.tableBorder-(e.options.offsetWidth||0)}function ce(e,t){var i=domUtils.findParentByTagName(t.target||t.srcElement,["td","th"],!0),n=null;if(!i)return null;if(n=H(i,A(t)),!i)return null;if("h1"===n&&i.previousSibling){var o=domUtils.getXY(i),r=i.offsetWidth;Math.abs(o.x+r-t.clientX)>r/3&&(i=i.previousSibling)}else if("v1"===n&&i.parentNode.previousSibling){o=domUtils.getXY(i);var s=i.offsetHeight;Math.abs(o.y+s-t.clientY)>s/3&&(i=i.parentNode.previousSibling.firstChild)}return i&&!0!==e.fireEvent("excludetable",i)?i:null}e.ready((function(){var t,i,n,o;utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",e.document),e.addListener("keydown",(function(e,o){var r=this,s=o.keyCode||o.which;if(8==s){var a=u(r);a&&a.selectedTds.length&&(a.isFullCol()?r.execCommand("deletecol"):a.isFullRow()?r.execCommand("deleterow"):r.fireEvent("delcells"),domUtils.preventDefault(o));var l=domUtils.findParentByTagName(r.selection.getStart(),"caption",!0),c=r.selection.getRange();if(c.collapsed&&l&&k(l)){r.fireEvent("saveScene");var d=l.parentNode;domUtils.remove(l),d&&c.setStart(d.rows[0].cells[0],0).setCursor(!1,!0),r.fireEvent("saveScene")}}if(46==s&&(a=u(r),a)){r.fireEvent("saveScene");for(var m=0;y=a.selectedTds[m++];)domUtils.fillNode(r.document,y);r.fireEvent("saveScene"),domUtils.preventDefault(o)}if(13==s){var p=r.selection.getRange();l=domUtils.findParentByTagName(p.startContainer,"caption",!0);if(l){d=domUtils.findParentByTagName(l,"table");return p.collapsed?l&&p.setStart(d.rows[0].cells[0],0).setCursor(!1,!0):(p.deleteContents(),r.fireEvent("saveScene")),void domUtils.preventDefault(o)}if(p.collapsed){d=domUtils.findParentByTagName(p.startContainer,"table");if(d){var h=d.rows[0].cells[0],f=domUtils.findParentByTagName(r.selection.getStart(),["td","th"],!0),g=d.previousSibling;if(h===f&&(!g||1==g.nodeType&&"TABLE"==g.tagName)&&domUtils.isStartInblock(p)){var b=domUtils.findParent(r.selection.getStart(),(function(e){return domUtils.isBlockElm(e)}),!0);b&&(/t(h|d)/i.test(b.tagName)||b===f.firstChild)&&(r.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(o))}}}}if((o.ctrlKey||o.metaKey)&&"67"==o.keyCode){t=null;a=u(r);if(a){var v=a.selectedTds;i=a.isFullCol(),n=a.isFullRow(),t=[[a.cloneCell(v[0],null,!0)]];var y;for(m=1;y=v[m];m++)y.parentNode!==v[m-1].parentNode?t.push([a.cloneCell(y,null,!0)]):t[t.length-1].push(a.cloneCell(y,null,!0))}}})),e.addListener("tablehasdeleted",(function(){R(this,!1,"",null),y&&domUtils.remove(y)})),e.addListener("beforepaste",(function(e,o){var r=this,s=r.selection.getRange();if(domUtils.findParentByTagName(s.startContainer,"caption",!0)){var a=r.document.createElement("div");return a.innerHTML=o.html,void(o.html=a[browser.ie9below?"innerText":"textContent"])}var l=u(r);if(t){r.fireEvent("saveScene");s=r.selection.getRange();var p,h,f=domUtils.findParentByTagName(s.startContainer,["td","th"],!0);if(f){var g=d(f);if(n){var b=g.getCellInfo(f).rowIndex;"TH"==f.tagName&&b++;for(var v=0;T=t[v++];){for(var y=g.insertRow(b++,"td"),C=0;_=T[C];C++){var x=y.cells[C];x||(x=y.insertCell(C)),x.innerHTML=_.innerHTML,_.getAttribute("width")&&x.setAttribute("width",_.getAttribute("width")),_.getAttribute("vAlign")&&x.setAttribute("vAlign",_.getAttribute("vAlign")),_.getAttribute("align")&&x.setAttribute("align",_.getAttribute("align")),_.style.cssText&&(x.style.cssText=_.style.cssText)}for(C=0;_=y.cells[C];C++){if(!T[C])break;_.innerHTML=T[C].innerHTML,T[C].getAttribute("width")&&_.setAttribute("width",T[C].getAttribute("width")),T[C].getAttribute("vAlign")&&_.setAttribute("vAlign",T[C].getAttribute("vAlign")),T[C].getAttribute("align")&&_.setAttribute("align",T[C].getAttribute("align")),T[C].style.cssText&&(_.style.cssText=T[C].style.cssText)}}}else{if(i){U=g.getCellInfo(f);for(var w=0,T=(C=0,t[0]);_=T[C++];)w+=_.colSpan||1;for(r.__hasEnterExecCommand=!0,v=0;v<w;v++)r.execCommand("insertcol");r.__hasEnterExecCommand=!1,f=g.table.rows[0].cells[U.cellIndex],"TH"==f.tagName&&(f=g.table.rows[1].cells[U.cellIndex])}for(v=0;T=t[v++];){p=f;for(C=0;_=T[C++];)if(f)f.innerHTML=_.innerHTML,_.getAttribute("width")&&f.setAttribute("width",_.getAttribute("width")),_.getAttribute("vAlign")&&f.setAttribute("vAlign",_.getAttribute("vAlign")),_.getAttribute("align")&&f.setAttribute("align",_.getAttribute("align")),_.style.cssText&&(f.style.cssText=_.style.cssText),h=f,f=f.nextSibling;else{var S=_.cloneNode(!0);domUtils.removeAttributes(S,["class","rowSpan","colSpan"]),h.parentNode.appendChild(S)}if(f=g.getNextCell(p,!0,!0),!t[v])break;if(!f){var U=g.getCellInfo(p);g.table.insertRow(g.table.rows.length),g.update(),f=g.getVSideCell(p,!0)}}}g.update()}else{l=r.document.createElement("table");for(v=0;T=t[v++];){var _;for(y=l.insertRow(l.rows.length),C=0;_=T[C++];)S=c.cloneCell(_,null,!0),domUtils.removeAttributes(S,["class"]),y.appendChild(S);2==C&&S.rowSpan>1&&(S.rowSpan=1)}var A=m(r),I=r.body.offsetWidth-(N?2*parseInt(domUtils.getComputedStyle(r.body,"margin-left"),10):0)-2*A.tableBorder-(r.options.offsetWidth||0);r.execCommand("insertHTML","<table "+(i&&n?'width="'+I+'"':"")+">"+l.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}return r.fireEvent("contentchange"),r.fireEvent("saveScene"),o.html="",!0}var B;a=r.document.createElement("div");a.innerHTML=o.html,B=a.getElementsByTagName("table"),domUtils.findParentByTagName(r.selection.getStart(),"table")?(utils.each(B,(function(e){domUtils.remove(e)})),domUtils.findParentByTagName(r.selection.getStart(),"caption",!0)&&(a.innerHTML=a[browser.ie?"innerText":"textContent"])):utils.each(B,(function(e){E(e,!0),domUtils.removeAttributes(e,["style","border"]),utils.each(domUtils.getElementsByTagName(e,"td"),(function(e){k(e)&&domUtils.fillNode(r.document,e),E(e,!0)}))})),o.html=a.innerHTML})),e.addListener("afterpaste",(function(){utils.each(domUtils.getElementsByTagName(e.body,"table"),(function(t){if(t.offsetWidth>e.body.offsetWidth){var i=m(e,t);t.style.width=e.body.offsetWidth-(N?2*parseInt(domUtils.getComputedStyle(e.body,"margin-left"),10):0)-2*i.tableBorder-(e.options.offsetWidth||0)+"px"}}))})),e.addListener("blur",(function(){t=null})),e.addListener("keydown",(function(){clearTimeout(o),o=setTimeout((function(){var t=e.selection.getRange(),i=domUtils.findParentByTagName(t.startContainer,["th","td"],!0);if(i){var n=i.parentNode.parentNode.parentNode;n.offsetWidth>n.getAttribute("width")&&(i.style.wordBreak="break-all")}}),100)})),e.addListener("selectionchange",(function(){R(e,!1,"",null)})),e.addListener("contentchange",(function(){var e=this;if(re(e),!u(e)){var t=e.selection.getRange(),i=t.startContainer;i=domUtils.findParentByTagName(i,["td","th"],!0),utils.each(domUtils.getElementsByTagName(e.document,"table"),(function(t){!0!==e.fireEvent("excludetable",t)&&(t.ueTable=new c(t),t.onmouseover=function(){e.fireEvent("tablemouseover",t)},t.onmousemove=function(){e.fireEvent("tablemousemove",t),e.options.tableDragable&&B(!0,this,e),utils.defer((function(){e.fireEvent("contentchange",50)}),!0)},t.onmouseout=function(){e.fireEvent("tablemouseout",t),R(e,!1,"",null),re(e)},t.onclick=function(t){t=e.window.event||t;var i=_(t.target||t.srcElement);if(i){var n,o=d(i),r=o.table,s=o.getCellInfo(i),a=e.selection.getRange();if(D(r,i,t,!0)){var l=o.getCell(o.indexTable[o.rowsNum-1][s.colIndex].rowIndex,o.indexTable[o.rowsNum-1][s.colIndex].cellIndex);t.shiftKey&&o.selectedTds.length?o.selectedTds[0]!==l?(n=o.getCellsRange(o.selectedTds[0],l),o.setSelected(n)):a&&a.selectNodeContents(l).select():i!==l?(n=o.getCellsRange(i,l),o.setSelected(n)):a&&a.selectNodeContents(l).select()}else if(D(r,i,t)){var c=o.getCell(o.indexTable[s.rowIndex][o.colsNum-1].rowIndex,o.indexTable[s.rowIndex][o.colsNum-1].cellIndex);t.shiftKey&&o.selectedTds.length?o.selectedTds[0]!==c?(n=o.getCellsRange(o.selectedTds[0],c),o.setSelected(n)):a&&a.selectNodeContents(c).select():i!==c?(n=o.getCellsRange(i,c),o.setSelected(n)):a&&a.selectNodeContents(c).select()}}})})),ae(e,!0)}})),domUtils.on(e.document,"mousemove",I),domUtils.on(e.document,"mouseout",(function(t){var i=t.target||t.srcElement;"TABLE"==i.tagName&&R(e,!1,"",null)})),e.addListener("interlacetable",(function(e,t,i){if(t)for(var n=this,o=t.rows,r=o.length,s=function(e,t,i){return e[t]?e[t]:i?e[t%e.length]:""},a=0;a<r;a++)o[a].className=s(i||n.options.classList,a,!0)})),e.addListener("uninterlacetable",(function(e,t){if(t)for(var i=this,n=t.rows,o=i.options.classList,r=n.length,s=0;s<r;s++)domUtils.removeClasses(n[s],o)})),e.addListener("mousedown",q),e.addListener("mouseup",J),domUtils.on(e.body,"dragstart",(function(t){J.call(e,"dragstart",t)})),e.addOutputRule((function(e){utils.each(e.getNodesByTagName("div"),(function(e){"ue_tableDragLine"==e.getAttr("id")&&e.parentNode.removeChild(e)}))}));var r=0;e.addListener("mousedown",(function(){r=0})),e.addListener("tabkeydown",(function(){var t=this.selection.getRange(),i=t.getCommonAncestor(!0,!0),n=domUtils.findParentByTagName(i,"table");if(n){if(domUtils.findParentByTagName(i,"caption",!0)){var o=domUtils.getElementsByTagName(n,"th td");o&&o.length&&t.setStart(o[0],0).setCursor(!1,!0)}else{o=domUtils.findParentByTagName(i,["td","th"],!0);var s=d(o);r=o.rowSpan>1?r:s.getCellInfo(o).rowIndex;var a=s.getTabNextCell(o,r);a?k(a)?t.setStart(a,0).setCursor(!1,!0):t.selectNodeContents(a).select():(e.fireEvent("saveScene"),e.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),e.__hasEnterExecCommand=!1,t=this.selection.getRange(),t.setStart(n.rows[n.rows.length-1].cells[0],0).setCursor(),e.fireEvent("saveScene"))}return!0}})),browser.ie&&e.addListener("selectionchange",(function(){R(this,!1,"",null)})),e.addListener("keydown",(function(e,t){var i=this,n=t.keyCode||t.which;if(8!=n&&46!=n){var o=!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey;o&&p(domUtils.getElementsByTagName(i.body,"td"));var r=u(i);r&&o&&r.clearSelected()}})),e.addListener("beforegetcontent",(function(){ae(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),(function(e){domUtils.isEmptyNode(e)&&(e.innerHTML="&nbsp;")}))})),e.addListener("aftergetcontent",(function(){ae(this,!0)})),e.addListener("getAllHtml",(function(){p(e.document.getElementsByTagName("td"))})),e.addListener("fullscreenchanged",(function(t,i){if(!i){var n=this.body.offsetWidth/document.body.offsetWidth,o=domUtils.getElementsByTagName(this.body,"table");utils.each(o,(function(t){if(t.offsetWidth<e.body.offsetWidth)return!1;var i=domUtils.getElementsByTagName(t,"td"),o=[];utils.each(i,(function(e){o.push(e.offsetWidth)}));for(var r,s=0;r=i[s];s++)r.setAttribute("width",Math.floor(o[s]*n));t.setAttribute("width",Math.floor(le(e,N,m(e))))}))}}));var s=e.execCommand;e.execCommand=function(e,t){var i=this;e=e.toLowerCase();var n,o,r=u(i),a=new dom.Range(i.document),l=i.commands[e]||UE.commands[e];if(l){if(!r||S[e]||l.notNeedUndo||i.__hasEnterExecCommand)o=s.apply(i,arguments);else{i.__hasEnterExecCommand=!0,i.fireEvent("beforeexeccommand",e),n=r.selectedTds;for(var c,d,m,p=-2,h=-2,f=0;m=n[f];f++)k(m)?a.setStart(m,0).setCursor(!1,!0):a.selectNode(m).select(!0),d=i.queryCommandState(e),c=i.queryCommandValue(e),-1!=d&&(p===d&&h===c||(i._ignoreContentChange=!0,o=s.apply(i,arguments),i._ignoreContentChange=!1),p=i.queryCommandState(e),h=i.queryCommandValue(e),domUtils.isEmptyBlock(m)&&domUtils.fillNode(i.document,m));a.setStart(n[0],0).shrinkBoundary(!0).setCursor(!1,!0),i.fireEvent("contentchange"),i.fireEvent("afterexeccommand",e),i.__hasEnterExecCommand=!1,i._selectionChange()}return o}}}))},UE.UETable.prototype.sortTable=function(e,t){var i=this.table,n=i.rows,o=[],r="TH"===n[0].cells[0].tagName,s=0;if(this.selectedTds.length){for(var a=this.cellsRange,l=a.endRowIndex+1,c=a.beginRowIndex;c<l;c++)o[c]=n[c];o.splice(0,a.beginRowIndex),s=a.endRowIndex+1===this.rowsNum?0:a.endRowIndex+1}else for(c=0,l=n.length;c<l;c++)o[c]=n[c];var d={reversecurrent:function(e,t){return 1},orderbyasc:function(e,t){var i=e.innerText||e.textContent,n=t.innerText||t.textContent;return i.localeCompare(n)},reversebyasc:function(e,t){var i=e.innerHTML,n=t.innerHTML;return n.localeCompare(i)},orderbynum:function(e,t){var i=e[browser.ie?"innerText":"textContent"].match(/\d+/),n=t[browser.ie?"innerText":"textContent"].match(/\d+/);return i&&(i=+i[0]),n&&(n=+n[0]),(i||0)-(n||0)},reversebynum:function(e,t){var i=e[browser.ie?"innerText":"textContent"].match(/\d+/),n=t[browser.ie?"innerText":"textContent"].match(/\d+/);return i&&(i=+i[0]),n&&(n=+n[0]),(n||0)-(i||0)}};i.setAttribute("data-sort-type",t&&"string"===typeof t&&d[t]?t:""),r&&o.splice(0,1),o=utils.sort(o,(function(i,n){var o;return o=t&&"function"===typeof t?t.call(this,i.cells[e],n.cells[e]):t&&"number"===typeof t?1:t&&"string"===typeof t&&d[t]?d[t].call(this,i.cells[e],n.cells[e]):d["orderbyasc"].call(this,i.cells[e],n.cells[e]),o}));var u=i.ownerDocument.createDocumentFragment(),m=0;for(l=o.length;m<l;m++)u.appendChild(o[m]);var p=i.getElementsByTagName("tbody")[0];s?p.insertBefore(u,n[s-a.endRowIndex+a.beginRowIndex-1]):p.appendChild(u)},UE.plugins["tablesort"]=function(){var e=this,t=UE.UETable,i=function(e){return t.getUETable(e)},n=function(e){return t.getTableItemsByRange(e)};e.ready((function(){utils.cssRule("tablesort","table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right; background-image:url("+e.options.themePath+e.options.theme+"/images/sortable.png);}",e.document),e.addListener("afterexeccommand",(function(e,t){"mergeright"!=t&&"mergedown"!=t&&"mergecells"!=t||this.execCommand("disablesort")}))})),UE.commands["sorttable"]={queryCommandState:function(){var e=this,t=n(e);if(!t.cell)return-1;for(var i,o=t.table,r=o.getElementsByTagName("td"),s=0;i=r[s++];)if(1!=i.rowSpan||1!=i.colSpan)return-1;return 0},execCommand:function(e,t){var o=this,r=o.selection.getRange(),s=r.createBookmark(!0),a=n(o),l=a.cell,c=i(a.table),d=c.getCellInfo(l);c.sortTable(d.cellIndex,t),r.moveToBookmark(s);try{r.select()}catch(u){}}},UE.commands["enablesort"]=UE.commands["disablesort"]={queryCommandState:function(e){var t=n(this).table;if(t&&"enablesort"==e)for(var i=domUtils.getElementsByTagName(t,"th td"),o=0;o<i.length;o++)if(i[o].getAttribute("colspan")>1||i[o].getAttribute("rowspan")>1)return-1;return t?"enablesort"==e^"sortEnabled"!=t.getAttribute("data-sort")?-1:0:-1},execCommand:function(e){var t=n(this).table;t.setAttribute("data-sort","enablesort"==e?"sortEnabled":"sortDisabled"),"enablesort"==e?domUtils.addClass(t,"sortEnabled"):domUtils.removeClasses(t,"sortEnabled")}}},UE.plugins["contextmenu"]=function(){var e=this;if(e.setOpt("enableContextMenu",!0),!1!==e.getOpt("enableContextMenu")){var t,i=e.getLang("contextMenu"),n=e.options.contextMenu||[{label:i["selectall"],cmdName:"selectall"},{label:i.cleardoc,cmdName:"cleardoc",exec:function(){confirm(i.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:i.unlink,cmdName:"unlink"},"-",{group:i.paragraph,icon:"justifyjustify",subMenu:[{label:i.justifyleft,cmdName:"justify",value:"left"},{label:i.justifyright,cmdName:"justify",value:"right"},{label:i.justifycenter,cmdName:"justify",value:"center"},{label:i.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:i.table,icon:"table",subMenu:[{label:i.inserttable,cmdName:"inserttable"},{label:i.deletetable,cmdName:"deletetable"},"-",{label:i.deleterow,cmdName:"deleterow"},{label:i.deletecol,cmdName:"deletecol"},{label:i.insertcol,cmdName:"insertcol"},{label:i.insertcolnext,cmdName:"insertcolnext"},{label:i.insertrow,cmdName:"insertrow"},{label:i.insertrownext,cmdName:"insertrownext"},"-",{label:i.insertcaption,cmdName:"insertcaption"},{label:i.deletecaption,cmdName:"deletecaption"},{label:i.inserttitle,cmdName:"inserttitle"},{label:i.deletetitle,cmdName:"deletetitle"},{label:i.inserttitlecol,cmdName:"inserttitlecol"},{label:i.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:i.mergecells,cmdName:"mergecells"},{label:i.mergeright,cmdName:"mergeright"},{label:i.mergedown,cmdName:"mergedown"},"-",{label:i.splittorows,cmdName:"splittorows"},{label:i.splittocols,cmdName:"splittocols"},{label:i.splittocells,cmdName:"splittocells"},"-",{label:i.averageDiseRow,cmdName:"averagedistributerow"},{label:i.averageDisCol,cmdName:"averagedistributecol"},"-",{label:i.edittd,cmdName:"edittd",exec:function(){UE.ui["edittd"]&&new UE.ui["edittd"](this),this.getDialog("edittd").open()}},{label:i.edittable,cmdName:"edittable",exec:function(){UE.ui["edittable"]&&new UE.ui["edittable"](this),this.getDialog("edittable").open()}},{label:i.setbordervisible,cmdName:"setbordervisible"}]},{group:i.tablesort,icon:"tablesort",subMenu:[{label:i.enablesort,cmdName:"enablesort"},{label:i.disablesort,cmdName:"disablesort"},"-",{label:i.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:i.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:i.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:i.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:i.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:i.borderbk,icon:"borderBack",subMenu:[{label:i.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:i.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:i.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:i.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:i.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:i.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:i.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:i.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:i.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:i.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:i.tableright,value:"right"}]},"-",{label:i.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:i.insertparagraphafter,cmdName:"insertparagraph"},{label:i["copy"],cmdName:"copy"},{label:i["paste"],cmdName:"paste"}];if(n.length){var o=UE.ui.uiUtils;e.addListener("contextmenu",(function(r,s){var a=o.getViewportOffsetByEvent(s);e.fireEvent("beforeselectionchange"),t&&t.destroy();for(var l,c=0,d=[];l=n[c];c++){var u;(function(t){if("-"==t)(u=d[d.length-1])&&"-"!==u&&d.push("-");else if(t.hasOwnProperty("group")){for(var n,o=0,r=[];n=t.subMenu[o];o++)(function(t){"-"==t?(u=r[r.length-1])&&"-"!==u?r.push("-"):r.splice(r.length-1):(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query():e.queryCommandState(t.cmdName))>-1&&r.push({label:t.label||e.getLang("contextMenu."+t.cmdName+(t.value||""))||"",className:"edui-for-"+t.cmdName+(t.className?" edui-for-"+t.cmdName+"-"+t.className:""),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})})(n);if(r.length){function s(){switch(t.icon){case"table":return e.getLang("contextMenu.table");case"justifyjustify":return e.getLang("contextMenu.paragraph");case"aligntd":return e.getLang("contextMenu.aligntd");case"aligntable":return e.getLang("contextMenu.aligntable");case"tablesort":return i.tablesort;case"borderBack":return i.borderbk;default:return""}}d.push({label:s(),className:"edui-for-"+t.icon,subMenu:{items:r,editor:e}})}}else(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query.call(e):e.queryCommandState(t.cmdName))>-1&&d.push({label:t.label||e.getLang("contextMenu."+t.cmdName),className:"edui-for-"+(t.icon?t.icon:t.cmdName+(t.value||"")),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})})(l)}if("-"==d[d.length-1]&&d.pop(),t=new UE.ui.Menu({items:d,className:"edui-contextmenu",editor:e}),t.render(),t.showAt(a),e.fireEvent("aftershowcontextmenu",t),domUtils.preventDefault(s),browser.ie){var m;try{m=e.selection.getNative().createRange()}catch(h){return}if(m.item){var p=new dom.Range(e.document);p.selectNode(m.item(0)).select(!0,!0)}}})),e.addListener("aftershowcontextmenu",(function(t,i){if(e.zeroclipboard){var n=i.items;for(var o in n)"edui-for-copy"==n[o].className&&e.zeroclipboard.clip(n[o].getDom())}}))}}},UE.plugins["shortcutmenu"]=function(){var e,t=this,i=t.options.shortcutMenu||[];i.length&&(t.addListener("contextmenu mouseup",(function(t,n){var o=this,r={type:t,target:n.target||n.srcElement,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY};if(setTimeout((function(){var n=o.selection.getRange();!1!==n.collapsed&&"contextmenu"!=t||(e||(e=new baidu.editor.ui.ShortCutMenu({editor:o,items:i,theme:o.options.theme,className:"edui-shortcutmenu"}),e.render(),o.fireEvent("afterrendershortcutmenu",e)),e.show(r,!!UE.plugins["contextmenu"]))})),"contextmenu"==t&&(domUtils.preventDefault(n),browser.ie9below)){var s;try{s=o.selection.getNative().createRange()}catch(n){return}if(s.item){var a=new dom.Range(o.document);a.selectNode(s.item(0)).select(!0,!0)}}})),t.addListener("keydown",(function(t){"keydown"==t&&e&&!e.isHidden&&e.hide()})))},UE.plugins["basestyle"]=function(){var e={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},t=function(e,t){return domUtils.filterNodeList(e.selection.getStartElementPath(),t)},i=this;for(var n in i.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),i.addInputRule((function(e){utils.each(e.getNodesByTagName("b i"),(function(e){switch(e.tagName){case"b":e.tagName="strong";break;case"i":e.tagName="em"}}))})),e)(function(e,n){i.commands[e]={execCommand:function(e){var o=i.selection.getRange(),r=t(this,n);if(o.collapsed){if(r){var s=i.document.createTextNode("");o.insertNode(s).removeInlineStyle(n),o.setStartBefore(s),domUtils.remove(s)}else{var a=o.document.createElement(n[0]);"superscript"!=e&&"subscript"!=e||(s=i.document.createTextNode(""),o.insertNode(s).removeInlineStyle(["sub","sup"]).setStartBefore(s).collapse(!0)),o.insertNode(a).setStart(a,0)}o.collapse(!0)}else"superscript"!=e&&"subscript"!=e||r&&r.tagName.toLowerCase()==e||o.removeInlineStyle(["sub","sup"]),r?o.removeInlineStyle(n):o.applyInlineStyle(n[0]);o.select()},queryCommandState:function(){return t(this,n)?1:0}}})(n,e[n])},UE.plugins["elementpath"]=function(){var e,t,i=this;i.setOpt("elementPathEnabled",!0),i.options.elementPathEnabled&&(i.commands["elementpath"]={execCommand:function(n,o){var r=t[o],s=i.selection.getRange();e=1*o,s.selectNode(r).select()},queryCommandValue:function(){var i=[].concat(this.selection.getStartElementPath()).reverse(),n=[];t=i;for(var o,r=0;o=i[r];r++)if(3!=o.nodeType){var s=o.tagName.toLowerCase();if("img"==s&&o.getAttribute("anchorname")&&(s="anchor"),n[r]=s,e==r){e=-1;break}}return n}})},UE.plugins["formatmatch"]=function(){var e,t=this,i=[],n=0;function o(r,s){if(browser.webkit)var a="IMG"==s.target.tagName?s.target:null;function l(e){return m&&e.selectNode(m),e.applyInlineStyle(i[i.length-1].tagName,null,i)}t.undoManger&&t.undoManger.save();var c=t.selection.getRange(),d=a||c.getClosedNode();if(e&&d&&"IMG"==d.tagName)d.style.cssText+=";float:"+(e.style.cssFloat||e.style.styleFloat||"none")+";display:"+(e.style.display||"inline"),e=null;else if(!e){var u=c.collapsed;if(u){var m=t.document.createTextNode("match");c.insertNode(m).select()}t.__hasEnterExecCommand=!0;var p=t.options.removeFormatAttributes;t.options.removeFormatAttributes="",t.execCommand("removeformat"),t.options.removeFormatAttributes=p,t.__hasEnterExecCommand=!1,c=t.selection.getRange(),i.length&&l(c),m&&c.setStartBefore(m).collapse(!0),c.select(),m&&domUtils.remove(m)}t.undoManger&&t.undoManger.save(),t.removeListener("mouseup",o),n=0}t.addListener("reset",(function(){i=[],n=0})),t.commands["formatmatch"]={execCommand:function(r){if(n)return n=0,i=[],void t.removeListener("mouseup",o);var s=t.selection.getRange();if(e=s.getClosedNode(),!e||"IMG"!=e.tagName){s.collapse(!0).shrinkBoundary();var a=s.startContainer;i=domUtils.findParents(a,!0,(function(e){return!domUtils.isBlockElm(e)&&1==e.nodeType}));for(var l,c=0;l=i[c];c++)if("A"==l.tagName){i.splice(c,1);break}}t.addListener("mouseup",o),n=1},queryCommandState:function(){return n},notNeedUndo:1}},UE.plugin.register("searchreplace",(function(){var e=this,t={table:1,tbody:1,tr:1,ol:1,ul:1};function i(e,t,i){var n=t.searchStr;-1==t.dir&&(e=e.split("").reverse().join(""),n=n.split("").reverse().join(""),i=e.length-i);var o,r=new RegExp(n,"g"+(t.casesensitive?"":"i"));while(o=r.exec(e))if(o.index>=i)return-1==t.dir?e.length-o.index-t.searchStr.length:o.index;return-1}function n(e,n,o){var r,s,a=o.all||1==o.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(e)&&(e=e.firstChild);while(e){if(r=3==e.nodeType?e.nodeValue:e[browser.ie?"innerText":"textContent"],s=i(r,o,n),0,-1!=s)return{node:e,index:s};e=domUtils[a](e);while(e&&t[e.nodeName.toLowerCase()])e=domUtils[a](e,!0);e&&(n=-1==o.dir?(3==e.nodeType?e.nodeValue:e[browser.ie?"innerText":"textContent"]).length:0)}}function o(e,t,i){var n,r=0,s=e.firstChild,a=0;while(s){if(3==s.nodeType){if(a=s.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,r+=a,r>=t)return{node:s,index:a-(r-t)}}else if(!dtd.$empty[s.tagName]&&(a=s[browser.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,r+=a,r>=t&&(n=o(s,a-(r-t),i),n)))return n;s=domUtils.getNextDomNode(s)}}function r(e,t){var i,r=e.selection.getRange(),a=t.searchStr,l=e.document.createElement("span");if(l.innerHTML="$$ueditor_searchreplace_key$$",r.shrinkBoundary(!0),!r.collapsed){r.select();var c=e.selection.getText();if(new RegExp("^"+t.searchStr+"$",t.casesensitive?"":"i").test(c)){if(void 0!=t.replaceStr)return s(r,t.replaceStr),r.select(),!0;r.collapse(-1==t.dir)}}r.insertNode(l),r.enlargeToBlockElm(!0),i=r.startContainer;var d=i[browser.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");r.setStartBefore(l),domUtils.remove(l);var u=n(i,d,t);if(u){var m=o(u.node,u.index,a),p=o(u.node,u.index+a.length,a);return r.setStart(m.node,m.index).setEnd(p.node,p.index),void 0!==t.replaceStr&&s(r,t.replaceStr),r.select(),!0}r.setCursor()}function s(t,i){i=e.document.createTextNode(i),t.deleteContents().insertNode(i)}return{commands:{searchreplace:{execCommand:function(t,i){utils.extend(i,{all:!1,casesensitive:!1,dir:1},!0);var n=0;if(i.all){var o=e.selection.getRange(),s=e.body.firstChild;s&&1==s.nodeType?(o.setStart(s,0),o.shrinkBoundary(!0)):3==s.nodeType&&o.setStartBefore(s),o.collapse(!0).select(!0),void 0!==i.replaceStr&&e.fireEvent("saveScene");while(r(this,i))n++;n&&e.fireEvent("saveScene")}else void 0!==i.replaceStr&&e.fireEvent("saveScene"),r(this,i)&&n++,n&&e.fireEvent("saveScene");return n},notNeedUndo:1}}}})),UE.plugins["customstyle"]=function(){var e=this;e.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),e.commands["customstyle"]={execCommand:function(e,t){var i,n,o=this,r=t.tag,s=domUtils.findParent(o.selection.getStart(),(function(e){return e.getAttribute("label")}),!0),a={};for(var l in t)void 0!==t[l]&&(a[l]=t[l]);if(delete a.tag,s&&s.getAttribute("label")==t.label){if(i=this.selection.getRange(),n=i.createBookmark(),i.collapsed)if(dtd.$block[s.tagName]){var c=o.document.createElement("p");domUtils.moveChild(s,c),s.parentNode.insertBefore(c,s),domUtils.remove(s)}else domUtils.remove(s,!0);else{var d=domUtils.getCommonAncestor(n.start,n.end),u=domUtils.getElementsByTagName(d,r);new RegExp(r,"i").test(d.tagName)&&u.push(d);for(var m,p=0;m=u[p++];)if(m.getAttribute("label")==t.label){var h=domUtils.getPosition(m,n.start),f=domUtils.getPosition(m,n.end);if((h&domUtils.POSITION_FOLLOWING||h&domUtils.POSITION_CONTAINS)&&(f&domUtils.POSITION_PRECEDING||f&domUtils.POSITION_CONTAINS)&&dtd.$block[r]){c=o.document.createElement("p");domUtils.moveChild(m,c),m.parentNode.insertBefore(c,m)}domUtils.remove(m,!0)}s=domUtils.findParent(d,(function(e){return e.getAttribute("label")==t.label}),!0),s&&domUtils.remove(s,!0)}i.moveToBookmark(n).select()}else if(dtd.$block[r]){if(this.execCommand("paragraph",r,a,"customstyle"),i=o.selection.getRange(),!i.collapsed){i.collapse(),s=domUtils.findParent(o.selection.getStart(),(function(e){return e.getAttribute("label")==t.label}),!0);var g=o.document.createElement("p");domUtils.insertAfter(s,g),domUtils.fillNode(o.document,g),i.setStart(g,0).setCursor()}}else{if(i=o.selection.getRange(),i.collapsed)return s=o.document.createElement(r),domUtils.setAttributes(s,a),void i.insertNode(s).setStart(s,0).setCursor();n=i.createBookmark(),i.applyInlineStyle(r,a).moveToBookmark(n).select()}},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),(function(e){return e.getAttribute("label")}));return e?e.getAttribute("label"):""}},e.addListener("keyup",(function(t,i){var n=i.keyCode||i.which;if(32==n||13==n){var o=e.selection.getRange();if(o.collapsed){var r=domUtils.findParent(e.selection.getStart(),(function(e){return e.getAttribute("label")}),!0);if(r&&dtd.$block[r.tagName]&&domUtils.isEmptyNode(r)){var s=e.document.createElement("p");domUtils.insertAfter(r,s),domUtils.fillNode(e.document,s),domUtils.remove(r),o.setStart(s,0).setCursor()}}}}))},UE.plugins["catchremoteimage"]=function(){var me=this,ajax=UE.ajax;!1!==me.options.catchRemoteImageEnable&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",(function(){me.fireEvent("catchRemoteImage")})),me.addListener("catchRemoteImage",(function(){for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],imgs=domUtils.getElementsByTagName(me.document,"img"),test=function(e,t){if(-1!=e.indexOf(location.host)||/(^\.)|(^\/)/.test(e))return!0;if(t)for(var i,n=0;i=t[n++];)if(-1!==e.indexOf(i))return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img")){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&remoteImages.push(src)}function catchremoteimage(e,t){var i=utils.serializeParam(me.queryCommandValue("serverparam"))||"",n=utils.formatUrl(catcherActionUrl+(-1==catcherActionUrl.indexOf("?")?"?":"&")+i),o=utils.isCrossDomainUrl(n),r={method:"POST",dataType:o?"jsonp":"",timeout:6e4,onsuccess:t["success"],onerror:t["error"]};r[catcherFieldName]=e,ajax.request(n,r)}remoteImages.length&&catchremoteimage(remoteImages,{success:function success(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list;for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",j=0;cj=list[j++];)if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.setAttributes(ci,{src:newSrc,_src:newSrc});break}me.fireEvent("catchremotesuccess")},error:function(){me.fireEvent("catchremoteerror")}})})))},UE.plugin.register("snapscreen",(function(){var me=this,snapplugin;function getLocation(e){var t,i=document.createElement("a"),n=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return i.href=e,browser.ie&&(i.href=i.href),t=i.search,n&&(t=t+(-1==t.indexOf("?")?"?":"&")+n,t=t.replace(/[&]+/gi,"&")),{port:i.port,hostname:i.hostname,path:i.pathname+t||+i.hash}}return{commands:{snapscreen:{execCommand:function execCommand(cmd){var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout((function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(e){return void me.ui._dialogs["snapscreenDialog"].open()}onSuccess(res)}),50)},queryCommandState:function(){return-1!=navigator.userAgent.indexOf("Windows",0)?0:-1}}}}})),UE.commands["insertparagraph"]={execCommand:function(e,t){var i,n=this,o=n.selection.getRange(),r=o.startContainer;while(r){if(domUtils.isBody(r))break;i=r,r=r.parentNode}if(i){var s=n.document.createElement("p");t?i.parentNode.insertBefore(s,i):i.parentNode.insertBefore(s,i.nextSibling),domUtils.fillNode(n.document,s),o.setStart(s,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",(function(){var e=this;function t(t,i){return i?'<iframe class="edui-faked-webapp" title="'+t.title+'" '+(t.align&&!t.cssfloat?'align="'+t.align+'"':"")+(t.cssfloat?'style="float:'+t.cssfloat+'"':"")+'width="'+t.width+'" height="'+t.height+'" scrolling="no" frameborder="0" src="'+t.url+'" logo_url = "'+t.logo+'"></iframe>':'<img title="'+t.title+'" width="'+t.width+'" height="'+t.height+'" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" _logo_url="'+t.logo+'" style="background:url('+t.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+t.url+'" '+(t.align&&!t.cssfloat?'align="'+t.align+'"':"")+(t.cssfloat?'style="float:'+t.cssfloat+'"':"")+"/>"}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var i;if("edui-faked-webapp"==e.getAttr("class")){i=t({title:e.getAttr("title"),width:e.getAttr("width"),height:e.getAttr("height"),align:e.getAttr("align"),cssfloat:e.getStyle("float"),url:e.getAttr("_url"),logo:e.getAttr("_logo_url")},!0);var n=UE.uNode.createElement(i);e.parentNode.replaceChild(n,e)}}))},inputRule:function(e){utils.each(e.getNodesByTagName("iframe"),(function(e){if("edui-faked-webapp"==e.getAttr("class")){var i=UE.uNode.createElement(t({title:e.getAttr("title"),width:e.getAttr("width"),height:e.getAttr("height"),align:e.getAttr("align"),cssfloat:e.getStyle("float"),url:e.getAttr("src"),logo:e.getAttr("logo_url")}));e.parentNode.replaceChild(i,e)}}))},commands:{webapp:{execCommand:function(e,i){var n=this,o=t(utils.extend(i,{align:"none"}),!1);n.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode(),i=t&&"edui-faked-webapp"==t.className;return i?1:0}}}}})),UE.plugins["template"]=function(){UE.commands["template"]={execCommand:function(e,t){t.html&&this.execCommand("inserthtml",t.html)}},this.addListener("click",(function(e,t){var i=t.target||t.srcElement,n=this.selection.getRange(),o=domUtils.findParent(i,(function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e}),!0);o&&n.selectNode(o).shrinkBoundary().select()})),this.addListener("keydown",(function(e,t){var i=this.selection.getRange();if(!i.collapsed&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&!t.altKey){var n=domUtils.findParent(i.startContainer,(function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e}),!0);n&&domUtils.removeClasses(n,["ue_t"])}}))},UE.plugin.register("music",(function(){var e=this;function t(t,i,n,o,r,s){return s?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+t+'" width="'+i+'" height="'+n+'" '+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' width="'+i+'" height="'+n+'" _url="'+t+'" class="edui-faked-music" src="'+e.options.langPath+e.options.lang+'/images/music.png" />'}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){var i;if("edui-faked-music"==e.getAttr("class")){var n=e.getStyle("float"),o=e.getAttr("align");i=t(e.getAttr("_url"),e.getAttr("width"),e.getAttr("height"),o,n,!0);var r=UE.uNode.createElement(i);e.parentNode.replaceChild(r,e)}}))},inputRule:function(e){utils.each(e.getNodesByTagName("embed"),(function(e){if("edui-faked-music"==e.getAttr("class")){var i=e.getStyle("float"),n=e.getAttr("align");html=t(e.getAttr("src"),e.getAttr("width"),e.getAttr("height"),n,i,!1);var o=UE.uNode.createElement(html);e.parentNode.replaceChild(o,e)}}))},commands:{music:{execCommand:function(e,i){var n=this,o=t(i.url,i.width||400,i.height||95,"none",!1);n.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode(),i=t&&"edui-faked-music"==t.className;return i?1:0}}}}})),UE.plugin.register("autoupload",(function(){function e(e,t){var i,n,o,r,s,a,l,c,d=t,u=/image\/\w+/i.test(e.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(i=d.getOpt(u+"FieldName"),n=d.getOpt(u+"UrlPrefix"),o=d.getOpt(u+"MaxSize"),r=d.getOpt(u+"AllowFiles"),s=d.getActionUrl(d.getOpt(u+"ActionName")),l=function(e){var t=d.document.getElementById(m);t&&domUtils.remove(t),d.fireEvent("showmessage",{id:m,content:e,type:"error",timeout:4e3})},"image"==u?(a='<img class="loadingclass" id="'+m+'" src="'+d.options.themePath+d.options.theme+'/images/spacer.gif" title="'+(d.getLang("autoupload.loading")||"")+'" >',c=function(e){var t=n+e.url,i=d.document.getElementById(m);i&&(i.setAttribute("src",t),i.setAttribute("_src",t),i.setAttribute("title",e.title||""),i.setAttribute("alt",e.original||""),i.removeAttribute("id"),domUtils.removeClasses(i,"loadingclass"))}):(a='<p><img class="loadingclass" id="'+m+'" src="'+d.options.themePath+d.options.theme+'/images/spacer.gif" title="'+(d.getLang("autoupload.loading")||"")+'" ></p>',c=function(e){var t=n+e.url,i=d.document.getElementById(m),o=d.selection.getRange(),r=o.createBookmark();o.selectNode(i).select(),d.execCommand("insertfile",{url:t}),o.moveToBookmark(r).select()}),d.execCommand("inserthtml",a),d.getOpt(u+"ActionName"))if(e.size>o)l(d.getLang("autoupload.exceedSizeError"));else{var p=e.name?e.name.substr(e.name.lastIndexOf(".")):"";if(p&&"image"!=u||r&&-1==(r.join("")+".").indexOf(p.toLowerCase()+"."))l(d.getLang("autoupload.exceedTypeError"));else{var h=new XMLHttpRequest,f=new FormData,g=utils.serializeParam(d.queryCommandValue("serverparam"))||"",b=utils.formatUrl(s+(-1==s.indexOf("?")?"?":"&")+g);f.append(i,e,e.name||"blob."+e.type.substr("image/".length)),f.append("type","ajax"),h.open("post",b,!0),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.addEventListener("load",(function(e){try{var t=new Function("return "+utils.trim(e.target.response))();"SUCCESS"==t.state&&t.url?c(t):l(t.state)}catch(i){l(d.getLang("autoupload.loadError"))}})),h.send(f)}}else l(d.getLang("autoupload.errorLoadConfig"))}function t(e){return e.clipboardData&&e.clipboardData.items&&1==e.clipboardData.items.length&&/^image\//.test(e.clipboardData.items[0].type)?e.clipboardData.items:null}function i(e){return e.dataTransfer&&e.dataTransfer.files?e.dataTransfer.files:null}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)})),utils.each(e.getNodesByTagName("p"),(function(e){/\bloadpara\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)}))},bindEvents:{ready:function(n){var o=this;window.FormData&&window.FileReader&&(domUtils.on(o.body,"paste drop",(function(n){var r,s=!1;if(r="paste"==n.type?t(n):i(n),r){var a,l=r.length;while(l--)a=r[l],a.getAsFile&&(a=a.getAsFile()),a&&a.size>0&&(e(a,o),s=!0);s&&n.preventDefault()}})),domUtils.on(o.body,"dragover",(function(e){"Files"==e.dataTransfer.types[0]&&e.preventDefault()})),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document))}}}})),UE.plugin.register("autosave",(function(){var e=this,t=new Date,i=20,n=null;function o(o){var r;new Date-t<i||(o.hasContents()?(t=new Date,o._saveFlag=null,r=e.body.innerHTML,!1!==o.fireEvent("beforeautosave",{content:r})&&(e.setPreferences(n,r),o.fireEvent("afterautosave",{content:r}))):n&&e.removePreferences(n))}return{defaultOptions:{saveInterval:500,enableAutoSave:!0},bindEvents:{ready:function(){var t="-drafts-data",i=null;i=e.key?e.key+t:(e.container.parentNode.id||"ue-common")+t,n=(location.protocol+location.host+location.pathname).replace(/[.:\/]/g,"_")+i},contentchange:function(){e.getOpt("enableAutoSave")&&n&&(e._saveFlag&&window.clearTimeout(e._saveFlag),e.options.saveInterval>0?e._saveFlag=window.setTimeout((function(){o(e)}),e.options.saveInterval):o(e))}},commands:{clearlocaldata:{execCommand:function(t,i){n&&e.getPreferences(n)&&e.removePreferences(n)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(t,i){return n&&e.getPreferences(n)||""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(t,i){n&&(e.body.innerHTML=e.getPreferences(n)||"<p>"+domUtils.fillHtml+"</p>",e.focus(!0))},queryCommandState:function(){return n?null===e.getPreferences(n)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}})),UE.plugin.register("charts",(function(){var e=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(i,n){var o=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),r=[],s={};if(!o)return!1;if(!t(o))return e.fireEvent("chartserror"),!1;for(var a in s.title=n.title||"",s.subTitle=n.subTitle||"",s.xTitle=n.xTitle||"",s.yTitle=n.yTitle||"",s.suffix=n.suffix||"",s.tip=n.tip||"",s.dataFormat=n.tableDataFormat||"",s.chartType=n.chartType||0,s)s.hasOwnProperty(a)&&r.push(a+":"+s[a]);o.setAttribute("data-chart",r.join(";")),domUtils.addClass(o,"edui-charts-table")},queryCommandState:function(e,i){var n=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return n&&t(n)?0:-1}}},inputRule:function(e){utils.each(e.getNodesByTagName("table"),(function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style")}))},outputRule:function(e){utils.each(e.getNodesByTagName("table"),(function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style","display: none;")}))}};function t(e){var t=null,i=0;if(e.rows.length<2)return!1;if(e.rows[0].cells.length<2)return!1;t=e.rows[0].cells,i=t.length;for(var n=0;r=t[n];n++)if("th"!==r.tagName.toLowerCase())return!1;var o;for(n=1;o=e.rows[n];n++){if(o.cells.length!=i)return!1;if("th"!==o.cells[0].tagName.toLowerCase())return!1;for(var r,s=1;r=o.cells[s];s++){var a=utils.trim(r.innerText||r.textContent||"");if(a=a.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(a))return!1}}return!0}})),UE.plugin.register("section",(function(){function e(e){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function t(t){var i=new e;return utils.extend(i,t)}function i(e,t){for(var i=t,n=0;n<e.length;n++){if(!i.childNodes)return null;i=i.childNodes[e[n]]}return i}var n=this;return{bindMultiEvents:{type:"aftersetcontent afterscencerestore",handler:function(){n.fireEvent("updateSections")}},bindEvents:{ready:function(){n.fireEvent("updateSections"),domUtils.on(n.body,"drop paste",(function(){n.fireEvent("updateSections")}))},afterexeccommand:function(e,t){"paragraph"==t&&n.fireEvent("updateSections")},keyup:function(e,t){var i=this,n=i.selection.getRange();if(1!=n.collapsed)i.fireEvent("updateSections");else{var o=t.keyCode||t.which;13!=o&&8!=o&&46!=o||i.fireEvent("updateSections")}}},commands:{getsections:{execCommand:function(e,i){for(var n=i||["h1","h2","h3","h4","h5","h6"],o=0;o<n.length;o++)"string"==typeof n[o]?n[o]=function(e){return function(t){return t.tagName==e.toUpperCase()}}(n[o]):"function"!=typeof n[o]&&(n[o]=function(e){return null});function r(e){for(var t=0;t<n.length;t++)if(n[t](e))return t;return-1}var s=this,a=t({level:-1,title:"root"}),l=a;function c(e,i){for(var n,o,a,d=null,u=e.childNodes,m=0,p=u.length;m<p;m++)if(a=u[m],n=r(a),n>=0){var h=s.selection.getRange().selectNode(a).createAddress(!0).startAddress,f=t({tag:a.tagName,title:a.innerText||a.textContent||"",level:n,dom:a,startAddress:utils.clone(h,[]),endAddress:utils.clone(h,[]),children:[]});l.nextSection=f,f.previousSection=l,o=l;while(n<=o.level)o=o.parentSection;f.parentSection=o,o.children.push(f),d=l=f}else 1===a.nodeType&&c(a,i),d&&d.endAddress[d.endAddress.length-1]++}return c(s.body,a),a},notNeedUndo:!0},movesection:{execCommand:function(e,t,n,o){var r,s,a=this;if(t&&n&&-1!=n.level&&(r=o?n.endAddress:n.startAddress,s=i(r,a.body),r&&s&&!m(t.startAddress,t.endAddress,r))){var l,c,d=i(t.startAddress,a.body),u=i(t.endAddress,a.body);if(o){l=u;while(l&&!(domUtils.getPosition(d,l)&domUtils.POSITION_FOLLOWING)){if(c=l.previousSibling,domUtils.insertAfter(s,l),l==d)break;l=c}}else{l=d;while(l&&!(domUtils.getPosition(l,u)&domUtils.POSITION_FOLLOWING)){if(c=l.nextSibling,s.parentNode.insertBefore(l,s),l==u)break;l=c}}a.fireEvent("updateSections")}function m(e,t,i){for(var n=!1,o=!1,r=0;r<e.length;r++){if(r>=i.length)break;if(i[r]>e[r]){n=!0;break}if(i[r]<e[r])break}for(r=0;r<t.length;r++){if(r>=i.length)break;if(i[r]<e[r]){o=!0;break}if(i[r]>e[r])break}return n&&o}}},deletesection:{execCommand:function(e,t,i){var n=this;if(t){var o,r=l(t.startAddress),s=l(t.endAddress),a=r;if(i)domUtils.remove(a);else while(a&&domUtils.inDoc(s,n.document)&&!(domUtils.getPosition(a,s)&domUtils.POSITION_FOLLOWING))o=a.nextSibling,domUtils.remove(a),a=o;n.fireEvent("updateSections")}function l(e){for(var t=n.body,i=0;i<e.length;i++){if(!t.childNodes)return null;t=t.childNodes[e[i]]}return t}}},selectsection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var i=this,n=i.selection.getRange(),o={startAddress:utils.clone(t.startAddress,[]),endAddress:utils.clone(t.endAddress,[])};return o.endAddress[o.endAddress.length-1]++,n.moveToAddress(o).select().scrollToView(),!0},notNeedUndo:!0},scrolltosection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var i=this,n=i.selection.getRange(),o={startAddress:t.startAddress,endAddress:t.endAddress};return o.endAddress[o.endAddress.length-1]++,n.moveToAddress(o).scrollToView(),!0},notNeedUndo:!0}}}})),UE.plugin.register("simpleupload",(function(){var e,t=this,i=(+new Date).toString(36);function n(){var n=e.offsetWidth||20,o=e.offsetHeight||20,r="display:block;width:"+n+"px;height:"+o+"px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;",s=document.createElement("form"),a=document.createElement("input");s.id="edui_form_"+i,s.enctype="multipart/form-data",s.style=r,a.id="edui_input_"+i,a.type="file",a.accept="image/*",a.name=t.options.imageFieldName,a.style=r,s.appendChild(a),e.appendChild(s),a.addEventListener("change",(function(e){if(a.value){var i="loading_"+(+new Date).toString(36),n=t.getActionUrl(t.getOpt("imageActionName")),o=utils.serializeParam(t.queryCommandValue("serverparam"))||"",r=utils.formatUrl(n+(-1==n.indexOf("?")?"?":"&")+o),l=t.getOpt("imageAllowFiles");if(t.focus(),t.execCommand("inserthtml",'<img class="loadingclass" id="'+i+'" src="'+t.options.themePath+t.options.theme+'/images/spacer.gif" title="'+(t.getLang("simpleupload.loading")||"")+'" >'),t.getOpt("imageActionName")){var c=a.value,d=c?c.substr(c.lastIndexOf(".")):"";if(!d||l&&-1==(l.join("")+".").indexOf(d.toLowerCase()+"."))p(t.getLang("simpleupload.exceedTypeError"));else{var u=new XMLHttpRequest;if(u.open("post",r,!0),t.options.headers&&"[object Object]"===Object.prototype.toString.apply(t.options.headers))for(var m in t.options.headers)u.setRequestHeader(m,t.options.headers[m]);u.onload=function(){if(u.status>=200&&u.status<300||304==u.status){var e=JSON.parse(u.responseText),n=t.options.imageUrlPrefix+e.url;"SUCCESS"==e.state&&e.url?(loader=t.document.getElementById(i),loader.setAttribute("src",n),loader.setAttribute("_src",n),loader.setAttribute("title",e.title||""),loader.setAttribute("alt",e.original||""),loader.removeAttribute("id"),domUtils.removeClasses(loader,"loadingclass"),t.fireEvent("contentchange")):p(e.state)}else p(t.getLang("simpleupload.loadError"))},u.onerror=function(){p(t.getLang("simpleupload.loadError"))},u.send(new FormData(s)),s.reset()}}else p(t.getLang("autoupload.errorLoadConfig"))}function p(e){if(i){var n=t.document.getElementById(i);n&&domUtils.remove(n),t.fireEvent("showmessage",{id:i,content:e,type:"error",timeout:4e3})}}}))}return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(i,o){e=o,t.afterConfigReady(n)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),(function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)}))}}})),UE.plugin.register("serverparam",(function(){var e={};return{commands:{serverparam:{execCommand:function(t,i,n){void 0===i||null===i?e={}:utils.isString(i)?void 0===n||null===n?delete e[i]:e[i]=n:utils.isObject(i)?utils.extend(e,i,!0):utils.isFunction(i)&&utils.extend(e,i(),!0)},queryCommandValue:function(){return e||{}}}}}})),UE.plugin.register("insertfile",(function(){var e=this;function t(e){var t=e.substr(e.lastIndexOf(".")+1).toLowerCase(),i={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return i[t]?i[t]:i["txt"]}return{commands:{insertfile:{execCommand:function(i,n){n=utils.isArray(n)?n:[n];var o,r,s,a,l="",c=e.getOpt("UEDITOR_HOME_URL"),d=c+("/"==c.substr(c.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(o=0;o<n.length;o++)r=n[o],s=d+t(r.url),a=r.title||r.url.substr(r.url.lastIndexOf("/")+1),l+='<p style="line-height: 16px;"><img style="vertical-align: middle; margin-right: 2px;" src="'+s+'" _src="'+s+'" /><a style="font-size:12px; color:#0066cc;" href="'+r.url+'" title="'+a+'">'+a+"</a></p>";e.execCommand("insertHtml",l)}}}}})),UE.plugins.xssFilter=function(){var e=UEDITOR_CONFIG,t=e.whitList;function i(e){var i=e.tagName,n=e.attrs;if(!t.hasOwnProperty(i))return e.parentNode.removeChild(e),!1;UE.utils.each(n,(function(n,o){-1===t[i].indexOf(o)&&e.setAttr(o)}))}t&&e.xssFilterRules&&(this.options.filterRules=function(){var e={};return UE.utils.each(t,(function(t,n){e[n]=function(e){return i(e)}})),e}());var n=[];UE.utils.each(t,(function(e,t){n.push(t)})),t&&e.inputXssFilter&&this.addInputRule((function(e){e.traversal((function(e){if("element"!==e.type)return!1;i(e)}))})),t&&e.outputXssFilter&&this.addOutputRule((function(e){e.traversal((function(e){if("element"!==e.type)return!1;i(e)}))}))};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){var e=baidu.editor.browser,t=baidu.editor.dom.domUtils,i="$EDITORUI",n=window[i]={},o="ID"+i,r=0,s=baidu.editor.ui.uiUtils={uid:function(e){return e?e[o]||(e[o]=++r):++r},hook:function(e,t){var i;return e&&e._callbacks?i=e:(i=function(){var t;e&&(t=e.apply(this,arguments));var n=i._callbacks,o=n.length;while(o--){var r=n[o].apply(this,arguments);void 0===t&&(t=r)}return t},i._callbacks=[]),i._callbacks.push(t),i},createElementByHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,t=t.firstChild,t.parentNode.removeChild(t),t},getViewportElement:function(){return e.ie&&e.quirks?document.body:document.documentElement},getClientRect:function(e){var i;try{i=e.getBoundingClientRect()}catch(r){i={left:0,top:0,height:0,width:0}}var n,o={left:Math.round(i.left),top:Math.round(i.top),height:Math.round(i.bottom-i.top),width:Math.round(i.right-i.left)};while((n=e.ownerDocument)!==document&&(e=t.getWindow(n).frameElement))i=e.getBoundingClientRect(),o.left+=i.left,o.top+=i.top;return o.bottom=o.top+o.height,o.right=o.left+o.width,o},getViewportRect:function(){var e=s.getViewportElement(),t=0|(window.innerWidth||e.clientWidth),i=0|(window.innerHeight||e.clientHeight);return{left:0,top:0,height:i,width:t,bottom:i,right:t}},setViewportOffset:function(e,i){var n=s.getFixedLayer();e.parentNode===n?(e.style.left=i.left+"px",e.style.top=i.top+"px"):t.setViewportOffset(e,i)},getEventOffset:function(e){var t=e.target||e.srcElement,i=s.getClientRect(t),n=s.getViewportOffsetByEvent(e);return{left:n.left-i.left,top:n.top-i.top}},getViewportOffsetByEvent:function(e){var i=e.target||e.srcElement,n=t.getWindow(i).frameElement,o={left:e.clientX,top:e.clientY};if(n&&i.ownerDocument!==document){var r=s.getClientRect(n);o.left+=r.left,o.top+=r.top}return o},setGlobal:function(e,t){return n[e]=t,i+'["'+e+'"]'},unsetGlobal:function(e){delete n[e]},copyAttributes:function(i,n){var o=n.attributes,r=o.length;while(r--){var s=o[r];"style"==s.nodeName||"class"==s.nodeName||e.ie&&!s.specified||i.setAttribute(s.nodeName,s.nodeValue)}n.className&&t.addClass(i,n.className),n.style.cssText&&(i.style.cssText+=";"+n.style.cssText)},removeStyle:function(e,t){if(e.style.removeProperty)e.style.removeProperty(t);else{if(!e.style.removeAttribute)throw"";e.style.removeAttribute(t)}},contains:function(e,t){return e&&t&&e!==t&&(e.contains?e.contains(t):16&e.compareDocumentPosition(t))},startDrag:function(e,t,i){i=i||document;var n=e.clientX,o=e.clientY;function r(e){var i=e.clientX-n,r=e.clientY-o;t.ondragmove(i,r,e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}if(i.addEventListener){function s(e){i.removeEventListener("mousemove",r,!0),i.removeEventListener("mouseup",s,!0),window.removeEventListener("mouseup",s,!0),t.ondragstop()}i.addEventListener("mousemove",r,!0),i.addEventListener("mouseup",s,!0),window.addEventListener("mouseup",s,!0),e.preventDefault()}else{var a=e.srcElement;function l(){a.releaseCapture(),a.detachEvent("onmousemove",r),a.detachEvent("onmouseup",l),a.detachEvent("onlosecaptrue",l),t.ondragstop()}a.setCapture(),a.attachEvent("onmousemove",r),a.attachEvent("onmouseup",l),a.attachEvent("onlosecaptrue",l),e.returnValue=!1}t.ondragstart()},getFixedLayer:function(){var t=document.getElementById("edui_fixedlayer");return null==t&&(t=document.createElement("div"),t.id="edui_fixedlayer",document.body.appendChild(t),e.ie&&e.version<=8?(t.style.position="absolute",l(),setTimeout(a)):t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0"),t},makeUnselectable:function(t){if(e.opera||e.ie&&e.version<9){if(t.unselectable="on",t.hasChildNodes())for(var i=0;i<t.childNodes.length;i++)1==t.childNodes[i].nodeType&&s.makeUnselectable(t.childNodes[i])}else void 0!==t.style.MozUserSelect?t.style.MozUserSelect="none":void 0!==t.style.WebkitUserSelect?t.style.WebkitUserSelect="none":void 0!==t.style.KhtmlUserSelect&&(t.style.KhtmlUserSelect="none")}};function a(){var e=document.getElementById("edui_fixedlayer");s.setViewportOffset(e,{left:0,top:0})}function l(e){t.on(window,"scroll",a),t.on(window,"resize",baidu.editor.utils.defer(a,0,!0))}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.EventBase,n=baidu.editor.ui.UIBase=function(){};n.prototype={className:"",uiName:"",initOptions:function(e){var i=this;for(var n in e)i[n]=e[n];this.id=this.id||"edui"+t.uid()},initUIBase:function(){this._globalKey=e.unhtml(t.setGlobal(this.id,this))},render:function(e){for(var i,n=this.renderHtml(),o=t.createElementByHtml(n),r=domUtils.getElementsByTagName(o,"*"),s="edui-"+(this.theme||this.editor.options.theme),a=document.getElementById("edui_fixedlayer"),l=0;i=r[l++];)domUtils.addClass(i,s);domUtils.addClass(o,s),a&&(a.className="",domUtils.addClass(a,s));var c=this.getDom();null!=c?(c.parentNode.replaceChild(o,c),t.copyAttributes(o,c)):("string"==typeof e&&(e=document.getElementById(e)),e=e||t.getFixedLayer(),domUtils.addClass(e,s),e.appendChild(o)),this.postRender()},getDom:function(e){return e?document.getElementById(this.id+"_"+e):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(e){var t="edui-"+this.uiName;return e.replace(/##/g,this.id).replace(/%%-/g,this.uiName?t+"-":"").replace(/%%/g,(this.uiName?t:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var e=this.getDom();e&&baidu.editor.dom.domUtils.remove(e),t.unsetGlobal(this.id)}},e.inherits(n,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,i=baidu.editor.ui.Separator=function(e){this.initOptions(e),this.initSeparator()};i.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}},e.inherits(i,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,i=baidu.editor.ui.UIBase,n=baidu.editor.ui.uiUtils,o=baidu.editor.ui.Mask=function(e){this.initOptions(e),this.initUIBase()};o.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onclick="return $$._onClick(event, this);" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var e=this;t.on(window,"resize",(function(){setTimeout((function(){e.isHidden()||e._fill()}))}))},show:function(e){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=e},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(e,t){this.fireEvent("click",e,t)},_fill:function(){var e=this.getDom(),t=n.getViewportRect();e.style.width=t.width+"px",e.style.height=t.height+"px"}},e.inherits(o,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.dom.domUtils,n=baidu.editor.ui.UIBase,o=baidu.editor.ui.Popup=function(e){this.initOptions(e),this.initPopup()},r=[];function s(e,t){for(var i=0;i<r.length;i++){var n=r[i];if(!n.isHidden()&&!1!==n.queryAutoHide(t)){if(e&&/scroll/gi.test(e.type)&&"edui-wordpastepop"==n.className)return;n.hide()}}r.length&&n.editor.fireEvent("afterhidepop")}o.postHide=s;var a=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];o.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase(),r.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%" onmousedown="return false;"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+this.getContentHtmlTpl()+" </div> </div></div>"},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:n.prototype.postRender,postRender:function(){if(this.content instanceof n&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var e=(document.documentElement.clientHeight||document.body.clientHeight)-80,o=this.getDom().offsetHeight,r=t.getClientRect(this.combox.getDom()).top,s=this.getDom("content"),a=this.getDom("body").getElementsByTagName("iframe"),l=this;a.length&&(a=a[0]);while(r+o>e)o-=30;s.style.height=o+"px",a&&(a.style.height=o+"px"),window.XMLHttpRequest?i.on(s,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,e.wheelDelta?s.scrollTop-=e.wheelDelta/120*60:s.scrollTop-=e.detail/-3*60})):i.on(this.getDom(),"mousewheel",(function(e){e.returnValue=!1,l.getDom("content").scrollTop-=e.wheelDelta/120*60}))}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var e=this.getDom("content");return t.getClientRect(e)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var e=this.getDom("body");e.style.width="",e.style.height="";var t=this.mesureSize();if(this.captureWheel){e.style.width=-(-20-t.width)+"px";var i=parseInt(this.getDom("content").style.height,10);!window.isNaN(i)&&(t.height=i)}else e.style.width=t.width+"px";return e.style.height=t.height+"px",this.__size=t,this.captureWheel&&(this.getDom("content").style.overflow="auto"),t},showAnchor:function(e,i){this.showAnchorRect(t.getClientRect(e),i)},showAnchorRect:function(e,n,o){this._doAutoRender();var r=t.getViewportRect();this.getDom().style.visibility="hidden",this._show();var s,l,c,d,u=this.fitSize();n?(s=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,c=s?e.left-u.width:e.right,d=l?e.bottom-u.height:e.top):(s=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,c=s?e.right-u.width:e.left,d=l?e.top-u.height:e.bottom);var m=this.getDom();t.setViewportOffset(m,{left:c,top:d}),i.removeClasses(m,a),m.className+=" "+a[2*(l?1:0)+(s?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(e){var t=e.left,i=e.top,n={left:t,top:i,right:t,bottom:i,height:0,width:0};this.showAnchorRect(n,!1,!0)},_show:function(){if(this._hidden){var e=this.getDom();e.style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(e){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,e||this.fireEvent("hide"))},queryAutoHide:function(e){return!e||!t.contains(this.getDom(),e)}},e.inherits(o,n),i.on(document,"mousedown",(function(e){var t=e.target||e.srcElement;s(e,t)})),i.on(window,"scroll",(function(e,t){s(e,t)}))}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,i=baidu.editor.ui.ColorPicker=function(e){this.initOptions(e),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};i.prototype={getHtmlTpl:function(){return o(this.noColorText,this.editor)},_onTableClick:function(e){var t=e.target||e.srcElement,i=t.getAttribute("data-color");i&&this.fireEvent("pickcolor",i)},_onTableOver:function(e){var t=e.target||e.srcElement,i=t.getAttribute("data-color");i&&(this.getDom("preview").style.backgroundColor=i)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},e.inherits(i,t);var n="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",");function o(e,t){for(var i='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+e+'</div></div><table class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+t.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',o=0;o<n.length;o++)o&&o%10===0&&(i+="</tr>"+(60==o?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+t.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==o?' class="edui-colorpicker-tablefirstrow"':"")+">"),i+=o<70?'<td style="padding: 0 2px;"><a hidefocus title="'+n[o]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+n[o]+'" style="background-color:#'+n[o]+";border:solid #ccc;"+(o<10||o>=60?"border-width:1px;":o>=10&&o<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return i+="</tr></table></div>",i}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,n=baidu.editor.ui.TablePicker=function(e){this.initOptions(e),this.initTablePicker()};n.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},_UIBase_render:i.prototype.render,render:function(e){this._UIBase_render(e),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(e,t){var i=this.getDom("overlay").style,n=this.lengthOfCellSide;i.width=e*n+"px",i.height=t*n+"px";var o=this.getDom("label");o.innerHTML=e+this.editor.getLang("t_col")+" x "+t+this.editor.getLang("t_row"),this.numCols=e,this.numRows=t},_onMouseOver:function(e,i){var n=e.relatedTarget||e.fromElement;t.contains(i,n)||i===n||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(e,i){var n=e.relatedTarget||e.toElement;t.contains(i,n)||i===n||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(e,i){this.getDom("overlay").style;var n=t.getEventOffset(e),o=this.lengthOfCellSide,r=Math.ceil(n.left/o),s=Math.ceil(n.top/o);this._track(r,s)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},e.inherits(n,i)}(),function(){var e=baidu.editor.browser,t=baidu.editor.dom.domUtils,i=baidu.editor.ui.uiUtils,n='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(e.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){var e=this._Stateful_dGetHtmlTpl();return e.replace(/stateful/g,(function(){return n}))},Stateful_onMouseEnter:function(e,t){this.target=t,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(e,t){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(e,t){var n=e.relatedTarget;i.contains(t,n)||t===n||this.Stateful_onMouseEnter(e,t)},Stateful_onMouseOut:function(e,t){var n=e.relatedTarget;i.contains(t,n)||t===n||this.Stateful_onMouseLeave(e,t)},Stateful_onMouseDown:function(e,t){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(e,t){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(e){return t.hasClass(this.getStateDom(),"edui-state-"+e)},addState:function(e){this.hasState(e)||(this.getStateDom().className+=" edui-state-"+e)},removeState:function(e){this.hasState(e)&&t.removeClasses(this.getStateDom(),["edui-state-"+e])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(e){!this.isDisabled()&&e?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(e){e?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,i=baidu.editor.ui.Stateful,n=baidu.editor.ui.Button=function(e){if(e.name){var t=e.name,i=e.cssRules;e.className||(e.className="edui-for-"+t),e.cssRules=".edui-default .edui-for-"+t+" .edui-icon {"+i+"}"}this.initOptions(e),this.initButton()};n.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&e.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return $$._onMouseDown(event, this);" onclick="return $$._onClick(event, this);">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(e){var t=e.target||e.srcElement,i=t&&t.tagName&&t.tagName.toLowerCase();if("input"==i||"object"==i||"object"==i)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(e){var t=this.getDom("label");t.innerHTML=e}},e.inherits(n,t),e.extend(n.prototype,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),n=baidu.editor.ui.Stateful,o=baidu.editor.ui.SplitButton=function(e){this.initOptions(e),this.initSplitButton()};o.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var e=this.popup;this.popup=null,this.setPopup(e)}},_UIBase_postRender:i.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(i){this.popup!==i&&(null!=this.popup&&this.popup.dispose(),i.addListener("show",e.bind(this._onPopupShow,this)),i.addListener("hide",e.bind(this._onPopupHide,this)),i.addListener("postrender",e.bind((function(){i.getDom("body").appendChild(t.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(t.getClientRect(this.getDom()).width+20)+'px"></div>')),i.getDom().className+=" "+this.className}),this)),this.popup=i)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var e=t.getClientRect(this.getDom());e.top-=this.popup.SHADOW_RADIUS,e.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(e)},_onArrowClick:function(e,t){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},e.inherits(o,i),e.extend(o.prototype,n,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.ui.ColorPicker,n=baidu.editor.ui.Popup,o=baidu.editor.ui.SplitButton,r=baidu.editor.ui.ColorButton=function(e){this.initOptions(e),this.initColorButton()};r.prototype={initColorButton:function(){var e=this;this.popup=new n({content:new i({noColorText:e.editor.getLang("clearColor"),editor:e.editor,onpickcolor:function(t,i){e._onPickColor(i)},onpicknocolor:function(t,i){e._onPickNoColor(i)}}),editor:e.editor}),this.initSplitButton()},_SplitButton_postRender:o.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(t.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>')),this.getDom().className+=" edui-colorbutton"},setColor:function(e){this.getDom("colorlump").style.backgroundColor=e,this.color=e},_onPickColor:function(e){!1!==this.fireEvent("pickcolor",e)&&(this.setColor(e),this.popup.hide())},_onPickNoColor:function(e){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}},e.inherits(r,o)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,i=baidu.editor.ui.TablePicker,n=baidu.editor.ui.SplitButton,o=baidu.editor.ui.TableButton=function(e){this.initOptions(e),this.initTableButton()};o.prototype={initTableButton:function(){var e=this;this.popup=new t({content:new i({editor:e.editor,onpicktable:function(t,i,n){e._onPickTable(i,n)}}),editor:e.editor}),this.initSplitButton()},_onPickTable:function(e,t){!1!==this.fireEvent("picktable",e,t)&&this.popup.hide()}},e.inherits(o,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,i=baidu.editor.ui.AutoTypeSetPicker=function(e){this.initOptions(e),this.initAutoTypeSetPicker()};i.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this.editor,t=e.options.autotypeset,i=e.getLang("autoTypeSet"),n="textAlignValue"+e.uid,o="imageBlockLineValue"+e.uid,r="symbolConverValue"+e.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap><input type="checkbox" name="mergeEmptyline" '+(t["mergeEmptyline"]?"checked":"")+">"+i.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(t["removeEmptyline"]?"checked":"")+">"+i.delLine+'</td></tr><tr><td nowrap><input type="checkbox" name="removeClass" '+(t["removeClass"]?"checked":"")+">"+i.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(t["indent"]?"checked":"")+">"+i.indent+'</td></tr><tr><td nowrap><input type="checkbox" name="textAlign" '+(t["textAlign"]?"checked":"")+">"+i.alignment+'</td><td colspan="2" id="'+n+'"><input type="radio" name="'+n+'" value="left" '+(t["textAlign"]&&"left"==t["textAlign"]?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+n+'" value="center" '+(t["textAlign"]&&"center"==t["textAlign"]?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+n+'" value="right" '+(t["textAlign"]&&"right"==t["textAlign"]?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="imageBlockLine" '+(t["imageBlockLine"]?"checked":"")+">"+i.imageFloat+'</td><td nowrap id="'+o+'"><input type="radio" name="'+o+'" value="none" '+(t["imageBlockLine"]&&"none"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("default")+'<input type="radio" name="'+o+'" value="left" '+(t["imageBlockLine"]&&"left"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+o+'" value="center" '+(t["imageBlockLine"]&&"center"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+o+'" value="right" '+(t["imageBlockLine"]&&"right"==t["imageBlockLine"]?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="clearFontSize" '+(t["clearFontSize"]?"checked":"")+">"+i.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(t["clearFontFamily"]?"checked":"")+">"+i.removeFontFamily+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="removeEmptyNode" '+(t["removeEmptyNode"]?"checked":"")+">"+i.removeHtml+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="pasteFilter" '+(t["pasteFilter"]?"checked":"")+">"+i.pasteFilter+'</td></tr><tr><td nowrap><input type="checkbox" name="symbolConver" '+(t["bdc2sb"]||t["tobdc"]?"checked":"")+">"+i.symbol+'</td><td id="'+r+'"><input type="radio" name="bdc" value="bdc2sb" '+(t["bdc2sb"]?"checked":"")+">"+i.bdc2sb+'<input type="radio" name="bdc" value="tobdc" '+(t["tobdc"]?"checked":"")+">"+i.tobdc+'</td><td nowrap align="right"><button >'+i.run+"</button></td></tr></table></div></div>"},_UIBase_render:t.prototype.render},e.inherits(i,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,i=baidu.editor.ui.AutoTypeSetPicker,n=baidu.editor.ui.SplitButton,o=baidu.editor.ui.AutoTypeSetButton=function(e){this.initOptions(e),this.initAutoTypeSetButton()};function r(t){for(var i,n={},o=t.getDom(),r=t.editor.uid,s=null,a=null,l=domUtils.getElementsByTagName(o,"input"),c=l.length-1;i=l[c--];)if(s=i.getAttribute("type"),"checkbox"==s)if(a=i.getAttribute("name"),n[a]&&delete n[a],i.checked){var d=document.getElementById(a+"Value"+r);if(d){if(/input/gi.test(d.tagName))n[a]=d.value;else for(var u,m=d.getElementsByTagName("input"),p=m.length-1;u=m[p--];)if(u.checked){n[a]=u.value;break}}else n[a]=!0}else n[a]=!1;else n[i.getAttribute("value")]=i.checked;var h,f=domUtils.getElementsByTagName(o,"select");for(c=0;h=f[c++];){var g=h.getAttribute("name");n[g]=n[g]?h.value:""}e.extend(t.editor.options.autotypeset,n),t.editor.setPreferences("autotypeset",n)}o.prototype={initAutoTypeSetButton:function(){var e=this;this.popup=new t({content:new i({editor:e.editor}),editor:e.editor,hide:function(){!this._hidden&&this.getDom()&&(r(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var n=0;this.popup.addListener("postRenderAfter",(function(){var t=this;if(!n){var i=this.getDom(),o=i.getElementsByTagName("button")[0];o.onclick=function(){r(t),e.editor.execCommand("autotypeset"),t.hide()},domUtils.on(i,"click",(function(i){var n=i.target||i.srcElement,o=e.editor.uid;if(n&&"INPUT"==n.tagName){if("imageBlockLine"==n.name||"textAlign"==n.name||"symbolConver"==n.name)for(var s=n.checked,a=document.getElementById(n.name+"Value"+o),l=a.getElementsByTagName("input"),c={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},d=0;d<l.length;d++)s?l[d].value==c[n.name]&&(l[d].checked="checked"):l[d].checked=!1;if(n.name=="imageBlockLineValue"+o||n.name=="textAlignValue"+o||"bdc"==n.name){var u=n.parentNode.previousSibling.getElementsByTagName("input");u&&(u[0].checked=!0)}r(t)}})),n=1}})),this.initSplitButton()}},e.inherits(o,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,i=baidu.editor.ui.Stateful,n=baidu.editor.ui.UIBase,o=baidu.editor.ui.CellAlignPicker=function(e){this.initOptions(e),this.initSelected(),this.initCellAlignPicker()};o.prototype={initSelected:function(){var e={valign:{top:0,middle:1,bottom:2},align:{left:0,center:1,right:2},count:3};this.selected&&(this.selectedIndex=e.valign[this.selected.valign]*e.count+e.align[this.selected.align])},initCellAlignPicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){for(var e=["left","center","right"],t=9,i=null,n=-1,o=[],r=0;r<t;r++)i=this.selectedIndex===r?' class="edui-cellalign-selected" ':"",n=r%3,0===n&&o.push("<tr>"),o.push('<td index="'+r+'" '+i+' stateful><div class="edui-icon edui-'+e[n]+'"></div></td>'),2===n&&o.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+o.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(e){var i=e.target||e.srcElement;/icon/.test(i.className)&&(this.items[i.parentNode.getAttribute("index")].onclick(),t.postHide(e))},_UIBase_render:n.prototype.render},e.inherits(o,n),e.extend(o.prototype,i,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Stateful,i=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,o=baidu.editor.ui.PastePicker=function(e){this.initOptions(e),this.initPastePicker()};o.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+'" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(e){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",e)},_onClick:function(e){var t=domUtils.getNextDomNode(e),n=i.getViewportRect().height,o=i.getClientRect(t);o.top+o.height>n?t.style.top=-o.height-e.offsetHeight+"px":t.style.top="",/hidden/gi.test(domUtils.getComputedStyle(t,"visibility"))?(t.style.visibility="visible",domUtils.addClass(e,"edui-state-opened")):(t.style.visibility="hidden",domUtils.removeClasses(e,"edui-state-opened"))},_UIBase_render:n.prototype.render},e.inherits(o,n),e.extend(o.prototype,t,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,n=baidu.editor.ui.Toolbar=function(e){this.initOptions(e),this.initToolbar()};n.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(e,t){void 0===t?this.items.push(e):this.items.splice(t,0,e)},getHtmlTpl:function(){for(var e=[],t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+e.join("")+"</div>"},postRender:function(){for(var e=this.getDom(),i=0;i<this.items.length;i++)this.items[i].postRender();t.makeUnselectable(e)},_onMouseDown:function(e){var t=e.target||e.srcElement,i=t&&t.tagName&&t.tagName.toLowerCase();if("input"==i||"object"==i||"object"==i)return!1}},e.inherits(n,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,i=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,o=baidu.editor.ui.Popup,r=baidu.editor.ui.Stateful,s=baidu.editor.ui.CellAlignPicker,a=baidu.editor.ui.Menu=function(e){this.initOptions(e),this.initMenu()},l={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return!0}};a.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];"-"==t?this.items[e]=this.getSeparator():t instanceof c||(t.editor=this.editor,t.theme=this.editor.options.theme,this.items[e]=this.createItem(t))}},getSeparator:function(){return l},createItem:function(e){return e.menu=this,new c(e)},_Popup_getContentHtmlTpl:o.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();for(var e=[],t=0;t<this.items.length;t++){var i=this.items[t];e[t]=i.renderHtml()}return'<div class="%%-body">'+e.join("")+"</div>"},_Popup_postRender:o.prototype.postRender,postRender:function(){for(var e=this,n=0;n<this.items.length;n++){var o=this.items[n];o.ownerMenu=this,o.postRender()}t.on(this.getDom(),"mouseover",(function(t){t=t||event;var n=t.relatedTarget||t.fromElement,o=e.getDom();i.contains(o,n)||o===n||e.fireEvent("over")})),this._Popup_postRender()},queryAutoHide:function(e){if(e){if(i.contains(this.getDom(),e))return!1;for(var t=0;t<this.items.length;t++){var n=this.items[t];if(!1===n.queryAutoHide(e))return!1}}},clearItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];clearTimeout(t._showingTimer),clearTimeout(t._closingTimer),t.subMenu&&t.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&t.remove(this.getDom()),this.clearItems()},dispose:function(){this.destroy()}},e.inherits(a,o);var c=baidu.editor.ui.MenuItem=function(e){if(this.initOptions(e),this.initUIBase(),this.Stateful_init(),this.subMenu&&!(this.subMenu instanceof a))if(e.className&&-1!=e.className.indexOf("aligntd")){var i=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment"),this.subMenu=new o({content:new s(this.subMenu),parentMenu:i,editor:i.editor,destroy:function(){this.getDom()&&t.remove(this.getDom())}}),this.subMenu.addListener("postRenderAfter",(function(){t.on(this.getDom(),"mouseover",(function(){i.addState("opened")}))}))}else this.subMenu=new a(this.subMenu)};c.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:!0,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var e=this;this.addListener("over",(function(){e.ownerMenu.fireEvent("submenuover",e),e.subMenu&&e.delayShowSubMenu()})),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",(function(){e.delayHideSubMenu()})),this.subMenu.addListener("over",(function(){clearTimeout(e._closingTimer),e._closingTimer=null,e.addState("opened")})),this.ownerMenu.addListener("hide",(function(){e.hideSubMenu()})),this.ownerMenu.addListener("submenuover",(function(t,i){i!==e&&e.delayHideSubMenu()})),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(t){return(!t||!i.contains(e.getDom(),t))&&this._bakQueryAutoHide(t)}),this.getDom().style.tabIndex="-1",i.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var e=this;e.isDisabled()||(e.addState("opened"),clearTimeout(e._showingTimer),clearTimeout(e._closingTimer),e._closingTimer=null,e._showingTimer=setTimeout((function(){e.showSubMenu()}),250))},delayHideSubMenu:function(){var e=this;e.isDisabled()||(e.removeState("opened"),clearTimeout(e._showingTimer),e._closingTimer||(e._closingTimer=setTimeout((function(){e.hasState("opened")||e.hideSubMenu(),e._closingTimer=null}),400)))},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(e){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(e)},_onClick:function(e,t){this.hasState("disabled")||!1!==this.fireEvent("click",e,t)&&(this.subMenu?this.showSubMenu():o.postHide(e))},showSubMenu:function(){var e=i.getClientRect(this.getDom());e.right-=5,e.left+=2,e.width-=7,e.top-=4,e.bottom+=4,e.height+=8,this.subMenu.showAnchorRect(e,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},e.inherits(c,n),e.extend(c.prototype,r,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.ui.Menu,n=baidu.editor.ui.SplitButton,o=baidu.editor.ui.Combox=function(e){this.initOptions(e),this.initCombox()};o.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var e=this;this.items=this.items||[];for(var t=0;t<this.items.length;t++){var n=this.items[t];n.uiName="listitem",n.index=t,n.onclick=function(){e.selectByIndex(this.index)}}this.popup=new i({items:this.items,uiName:"list",editor:this.editor,captureWheel:!0,combox:this}),this.initSplitButton()},_SplitButton_postRender:n.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.setLabel(this.label||""),this.setValue(this.initValue||"")},showPopup:function(){var e=t.getClientRect(this.getDom());e.top+=1,e.bottom-=1,e.height-=2,this.popup.showAnchorRect(e)},getValue:function(){return this.value},setValue:function(e){var t=this.indexByValue(e);-1!=t?(this.selectedIndex=t,this.setLabel(this.items[t].label),this.value=this.items[t].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(e)),this.value=e)},setLabel:function(e){this.getDom("button_body").innerHTML=e,this.label=e},getLabelForUnknowValue:function(e){return e},indexByValue:function(e){for(var t=0;t<this.items.length;t++)if(e==this.items[t].value)return t;return-1},getItem:function(e){return this.items[e]},selectByIndex:function(e){e<this.items.length&&!1!==this.fireEvent("select",e)&&(this.selectedIndex=e,this.value=this.items[e].value,this.setLabel(this.items[e].label))}},e.inherits(o,n)}(),function(){var e,t,i,n=baidu.editor.utils,o=baidu.editor.dom.domUtils,r=baidu.editor.ui.uiUtils,s=baidu.editor.ui.Mask,a=baidu.editor.ui.UIBase,l=baidu.editor.ui.Button,c=baidu.editor.ui.Dialog=function(e){if(e.name){var t=e.name,i=e.cssRules;e.className||(e.className="edui-for-"+t),i&&(e.cssRules=".edui-default .edui-for-"+t+" .edui-dialog-content {"+i+"}")}this.initOptions(n.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(e,t){return t?this.onok():this.oncancel()},holdScroll:!1},e)),this.initDialog()};c.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var o=this,r=this.editor.options.theme;if(this.cssRules&&n.cssRule("edui-customize-"+this.name+"-style",this.cssRules),this.initUIBase(),this.modalMask=e||(e=new s({className:"edui-dialog-modalmask",theme:r,onclick:function(){i&&i.close(!1)}})),this.dragMask=t||(t=new s({className:"edui-dialog-dragmask",theme:r})),this.closeButton=new l({className:"edui-dialog-closebutton",title:o.closeDialog,theme:r,onclick:function(){o.close(!1)}}),this.fullscreen&&this.initResizeEvent(),this.buttons)for(var a=0;a<this.buttons.length;a++)this.buttons[a]instanceof l||(this.buttons[a]=new l(n.extend(this.buttons[a],{editor:this.editor},!0)))},initResizeEvent:function(){var e=this;o.on(window,"resize",(function(){e._hidden||void 0===e._hidden||(e.__resizeTimer&&window.clearTimeout(e.__resizeTimer),e.__resizeTimer=window.setTimeout((function(){e.__resizeTimer=null;var t=e.getDom(),i=e.getDom("content"),n=UE.ui.uiUtils.getClientRect(t),o=UE.ui.uiUtils.getClientRect(i),s=r.getViewportRect();i.style.width=s.width-n.width+o.width+"px",i.style.height=s.height-n.height+o.height+"px",t.style.width=s.width+"px",t.style.height=s.height+"px",e.fireEvent("resize")}),100))}))},fitSize:function(){var e=this.getDom("body"),t=this.mesureSize();return e.style.width=t.width+"px",e.style.height=t.height+"px",t},safeSetOffset:function(e){var t=this,i=t.getDom(),n=r.getViewportRect(),o=r.getClientRect(i),s=e.left;s+o.width>n.right&&(s=n.right-o.width);var a=e.top;a+o.height>n.bottom&&(a=n.bottom-o.height),i.style.left=Math.max(s,0)+"px",i.style.top=Math.max(a,0)+"px"},showAtCenter:function(){var e=r.getViewportRect();if(this.fullscreen){var t=this.getDom(),i=this.getDom("content");t.style.display="block";var n=UE.ui.uiUtils.getClientRect(t),s=UE.ui.uiUtils.getClientRect(i);t.style.left="-100000px",i.style.width=e.width-n.width+s.width+"px",i.style.height=e.height-n.height+s.height+"px",t.style.width=e.width+"px",t.style.height=e.height+"px",t.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var a=this.fitSize(),l=0|this.getDom("titlebar").offsetHeight,c=e.width/2-a.width/2,d=e.height/2-(a.height-l)/2-l,u=this.getDom();this.safeSetOffset({left:Math.max(0|c,0),top:Math.max(0|d,0)}),o.hasClass(u,"edui-state-centered")||(u.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var e="";return"string"==typeof this.content?e=this.content:this.iframeUrl&&(e='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>'),e},getHtmlTpl:function(){var e="";if(this.buttons){for(var t=[],i=0;i<this.buttons.length;i++)t[i]=this.buttons[i].renderHtml();e='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+t.join("")+"</div></div>"}return'<div id="##" class="%%"><div '+(this.fullscreen?'class="%%-wrap edui-dialog-fullscreen-flag"':'class="%%"')+'><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+e+"</div></div></div>"},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var e=this;if(this.addListener("show",(function(){e.modalMask.show(this.getDom().style.zIndex-2)})),this.addListener("hide",(function(){e.modalMask.hide()})),this.buttons)for(var t=0;t<this.buttons.length;t++)this.buttons[t].postRender();o.on(window,"resize",(function(){setTimeout((function(){e.isHidden()||e.safeSetOffset(r.getClientRect(e.getDom()))}))})),this._hide()},mesureSize:function(){var e=this.getDom("body"),t=r.getClientRect(this.getDom("content")).width,i=e.style;return i.width=t,r.getClientRect(e)},_onTitlebarMouseDown:function(e,t){if(this.draggable){r.getViewportRect();var i,n=this;r.startDrag(e,{ondragstart:function(){i=r.getClientRect(n.getDom()),n.getDom("contmask").style.visibility="visible",n.dragMask.show(n.getDom().style.zIndex-1)},ondragmove:function(e,t){var o=i.left+e,r=i.top+t;n.safeSetOffset({left:o,top:r})},ondragstop:function(){n.getDom("contmask").style.visibility="hidden",o.removeClasses(n.getDom(),["edui-state-centered"]),n.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml(),this.fireEvent("dialogafterreset")},_show:function(){this._hidden&&(this.getDom().style.display="",this.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*this.editor.container.style.zIndex+10),this._hidden=!1,this.fireEvent("show"),baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden},_hide:function(){if(!this._hidden){var e=this.getDom();e.style.display="none",e.style.zIndex="",e.style.width="",e.style.height="",this._hidden=!0,this.fireEvent("hide")}},open:function(){if(this.autoReset)try{this.reset()}catch(e){this.render(),this.open()}if(this.showAtCenter(),this.iframeUrl)try{this.getDom("iframe").focus()}catch(t){}i=this},_onCloseButtonClick:function(e,t){this.close(!1)},close:function(e){if(!1!==this.fireEvent("close",e)){this.fullscreen&&(document.documentElement.style.overflowX=this._originalContext.html.overflowX,document.documentElement.style.overflowY=this._originalContext.html.overflowY,document.body.style.overflowX=this._originalContext.body.overflowX,document.body.style.overflowY=this._originalContext.body.overflowY,delete this._originalContext),this._hide();var t=this.getDom("content"),i=this.getDom("iframe");if(t&&i){var n=i.contentDocument||i.contentWindow.document;n&&(n.body.innerHTML=""),o.remove(t)}}}},n.inherits(c,a)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Menu,i=baidu.editor.ui.SplitButton,n=baidu.editor.ui.MenuButton=function(e){this.initOptions(e),this.initMenuButton()};n.prototype={initMenuButton:function(){var e=this;this.uiName="menubutton",this.popup=new t({items:e.items,className:e.className,editor:e.editor}),this.popup.addListener("show",(function(){for(var t=this,i=0;i<t.items.length;i++)t.items[i].removeState("checked"),t.items[i].value==e._value&&(t.items[i].addState("checked"),this.value=e._value)})),this.initSplitButton()},setValue:function(e){this._value=e}},e.inherits(n,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,i=baidu.editor.ui.SplitButton,n=baidu.editor.ui.MultiMenuPop=function(e){this.initOptions(e),this.initMultiMenu()};n.prototype={initMultiMenu:function(){var e=this;this.popup=new t({content:"",editor:e.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+e.id+'_iframe" src="'+e.iframeUrl+'" frameborder="0"></iframe>',e.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*e.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},e.inherits(n,i)}(),function(){var e,t=baidu.editor.ui,i=t.UIBase,n=t.uiUtils,o=baidu.editor.utils,r=baidu.editor.dom.domUtils,s=[],a=!1,l=t.ShortCutMenu=function(e){this.initOptions(e),this.initShortCutMenu()};function c(e){var t=e.target||e.srcElement,i=r.findParent(t,(function(e){return r.hasClass(e,"edui-shortcutmenu")||r.hasClass(e,"edui-popup")}),!0);if(!i)for(var n,o=0;n=s[o++];)n.hide()}l.postHide=c,l.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),s.push(this)},initEvent:function(){var t=this,i=t.editor.document;r.on(i,"mousemove",(function(i){if(!1===t.isHidden){if(t.getSubMenuMark()||"contextmenu"==t.eventType)return;var n=!0,o=t.getDom(),r=o.offsetWidth,s=o.offsetHeight,a=r/2+t.SPACE,l=s/2,c=Math.abs(i.screenX-t.left),d=Math.abs(i.screenY-t.top);clearTimeout(e),e=setTimeout((function(){d>0&&d<l?t.setOpacity(o,"1"):d>l&&d<l+70?(t.setOpacity(o,"0.5"),n=!1):d>l+70&&d<l+140&&t.hide(),n&&c>0&&c<a?t.setOpacity(o,"1"):c>a&&c<a+70?t.setOpacity(o,"0.5"):c>a+70&&c<a+140&&t.hide()}))}})),browser.chrome&&r.on(i,"mouseout",(function(e){var i=e.relatedTarget||e.toElement;null!=i&&"HTML"!=i.tagName||t.hide()})),t.editor.addListener("afterhidepop",(function(){t.isHidden||(a=!0)}))},initItems:function(){if(o.isArray(this.items))for(var e=0,i=this.items.length;e<i;e++){var n=this.items[e].toLowerCase();t[n]&&(this.items[e]=new t[n](this.editor),this.items[e].className+=" edui-shortcutsubmenu ")}},setOpacity:function(e,t){browser.ie&&browser.version<9?e.style.filter="alpha(opacity = "+100*parseFloat(t)+");":e.style.opacity=t},getSubMenuMark:function(){a=!1;for(var e,t=n.getFixedLayer(),i=r.getElementsByTagName(t,"div",(function(e){return r.hasClass(e,"edui-shortcutsubmenu edui-popup")})),o=0;e=i[o++];)"none"!=e.style.display&&(a=!0);return a},show:function(e,t){var i=this,o={},s=this.getDom(),a=n.getFixedLayer();function l(e){e.left<0&&(e.left=0),e.top<0&&(e.top=0),s.style.cssText="position:absolute;left:"+e.left+"px;top:"+e.top+"px;"}function c(e){e.tagName||(e=e.getDom()),o.left=parseInt(e.style.left),o.top=parseInt(e.style.top),o.top-=s.offsetHeight+15,l(o)}if(i.eventType=e.type,s.style.cssText="display:block;left:-9999px","contextmenu"==e.type&&t){var d=r.getElementsByTagName(a,"div","edui-contextmenu")[0];d?c(d):i.editor.addListener("aftershowcontextmenu",(function(e,t){c(t)}))}else o=n.getViewportOffsetByEvent(e),o.top-=s.offsetHeight+i.SPACE,o.left+=i.SPACE+20,l(o),i.setOpacity(s,.2);i.isHidden=!1,i.left=e.screenX+s.offsetWidth/2-i.SPACE,i.top=e.screenY-s.offsetHeight/2-i.SPACE,i.editor&&(s.style.zIndex=1*i.editor.container.style.zIndex+10,a.style.zIndex=s.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none"),this.isHidden=!0},postRender:function(){if(o.isArray(this.items))for(var e,t=0;e=this.items[t++];)e.postRender()},getHtmlTpl:function(){var e;if(o.isArray(this.items)){e=[];for(var t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();e=e.join("")}else e=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+e+"</div>"}},o.inherits(l,i),r.on(document,"mousedown",(function(e){c(e)})),r.on(window,"scroll",(function(e){c(e)}))}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,i=baidu.editor.ui.Breakline=function(e){this.initOptions(e),this.initSeparator()};i.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}},e.inherits(i,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,i=baidu.editor.ui.UIBase,n=baidu.editor.ui.Message=function(e){this.initOptions(e),this.initMessage()};n.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-message %%"> <div id="##_closer" class="edui-message-closer">×</div> <div id="##_body" class="edui-message-body edui-message-type-info"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-message-content"> </div> </div></div>'},reset:function(e){var t=this;e.keepshow||(clearTimeout(this.timer),t.timer=setTimeout((function(){t.hide()}),e.timeout||4e3)),void 0!==e.content&&t.setContent(e.content),void 0!==e.type&&t.setType(e.type),t.show()},postRender:function(){var e=this,i=this.getDom("closer");i&&t.on(i,"click",(function(){e.hide()}))},setContent:function(e){this.getDom("content").innerHTML=e},setType:function(e){e=e||"info";var t=this.getDom("body");t.className=t.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+e)},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var e=this.getDom("body").match(/edui-message-type-([\w-]+)/);return e?e[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var e=this.getDom();e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))}},e.inherits(n,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui,i=t.Dialog;t.buttons={},t.Dialog=function(e){var t=new i(e);return t.addListener("hide",(function(){if(t.editor){var e=t.editor;try{if(browser.gecko){var i=e.window.scrollY,n=e.window.scrollX;e.body.focus(),e.window.scrollTo(n,i)}else e.focus()}catch(o){}}})),t};for(var n={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},o=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts"],r=0;l=o[r++];)l=l.toLowerCase(),t[l]=function(e){return function(i){var n=new t.Button({className:"edui-for-"+e,title:i.options.labelMap[e]||i.getLang("labelMap."+e)||"",onclick:function(){i.execCommand(e)},theme:i.options.theme,showText:!1});return t.buttons[e]=n,i.addListener("selectionchange",(function(t,o,r){var s=i.queryCommandState(e);-1==s?(n.setDisabled(!0),n.setChecked(!1)):r||(n.setDisabled(!1),n.setChecked(s))})),n}}(l);t.cleardoc=function(e){var i=new t.Button({className:"edui-for-cleardoc",title:e.options.labelMap.cleardoc||e.getLang("labelMap.cleardoc")||"",theme:e.options.theme,onclick:function(){confirm(e.getLang("confirmClear"))&&e.execCommand("cleardoc")}});return t.buttons["cleardoc"]=i,e.addListener("selectionchange",(function(){i.setDisabled(-1==e.queryCommandState("cleardoc"))})),i};var s={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var a in s)(function(e,i){for(var n,o=0;n=i[o++];)(function(i){t[e.replace("float","")+i]=function(n){var o=new t.Button({className:"edui-for-"+e.replace("float","")+i,title:n.options.labelMap[e.replace("float","")+i]||n.getLang("labelMap."+e.replace("float","")+i)||"",theme:n.options.theme,onclick:function(){n.execCommand(e,i)}});return t.buttons[e]=o,n.addListener("selectionchange",(function(t,r,s){o.setDisabled(-1==n.queryCommandState(e)),o.setChecked(n.queryCommandValue(e)==i&&!s)})),o}})(n)})(a,s[a]);var l;for(r=0;l=["backcolor","forecolor"][r++];)t[l]=function(e){return function(i){var n=new t.ColorButton({className:"edui-for-"+e,color:"default",title:i.options.labelMap[e]||i.getLang("labelMap."+e)||"",editor:i,onpickcolor:function(t,n){i.execCommand(e,n)},onpicknocolor:function(){i.execCommand(e,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){i.execCommand(e,this.color)}});return t.buttons[e]=n,i.addListener("selectionchange",(function(){n.setDisabled(-1==i.queryCommandState(e))})),n}}(l);var c={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var a in c)(function(i,o){for(var r,s=0;r=o[s++];)browser.opera&&"searchreplace"===r||function(o){t[o]=function(r,s,a){var l;s=s||(r.options.iframeUrlMap||{})[o]||n[o],a=r.options.labelMap[o]||r.getLang("labelMap."+o)||"",s&&(l=new t.Dialog(e.extend({iframeUrl:r.ui.mapUrl(s),editor:r,className:"edui-for-"+o,title:a,holdScroll:"insertimage"===o,fullscreen:/charts|preview/.test(o),closeDialog:r.getLang("closeDialog")},"ok"==i?{buttons:[{className:"edui-okbutton",label:r.getLang("ok"),editor:r,onclick:function(){l.close(!0)}},{className:"edui-cancelbutton",label:r.getLang("cancel"),editor:r,onclick:function(){l.close(!1)}}]}:{})),r.ui._dialogs[o+"Dialog"]=l);var c=new t.Button({className:"edui-for-"+o,title:a,onclick:function(){if(l)switch(o){case"wordimage":var e=r.execCommand("wordimage");e&&e.length&&(l.render(),l.open());break;case"scrawl":-1!=r.queryCommandState("scrawl")&&(l.render(),l.open());break;default:l.render(),l.open()}},theme:r.options.theme,disabled:"scrawl"==o&&-1==r.queryCommandState("scrawl")||"charts"==o});return t.buttons[o]=c,r.addListener("selectionchange",(function(){var e={edittable:1};if(!(o in e)){var t=r.queryCommandState(o);c.getDom()&&(c.setDisabled(-1==t),c.setChecked(t))}})),c}}(r.toLowerCase())})(a,c[a]);t.snapscreen=function(e,i,o){o=e.options.labelMap["snapscreen"]||e.getLang("labelMap.snapscreen")||"";var r=new t.Button({className:"edui-for-snapscreen",title:o,onclick:function(){e.execCommand("snapscreen")},theme:e.options.theme});if(t.buttons["snapscreen"]=r,i=i||(e.options.iframeUrlMap||{})["snapscreen"]||n["snapscreen"],i){var s=new t.Dialog({iframeUrl:e.ui.mapUrl(i),editor:e,className:"edui-for-snapscreen",title:o,buttons:[{className:"edui-okbutton",label:e.getLang("ok"),editor:e,onclick:function(){s.close(!0)}},{className:"edui-cancelbutton",label:e.getLang("cancel"),editor:e,onclick:function(){s.close(!1)}}]});s.render(),e.ui._dialogs["snapscreenDialog"]=s}return e.addListener("selectionchange",(function(){r.setDisabled(-1==e.queryCommandState("snapscreen"))})),r},t.insertcode=function(i,n,o){n=i.options["insertcode"]||[],o=i.options.labelMap["insertcode"]||i.getLang("labelMap.insertcode")||"";var r=[];e.each(n,(function(e,t){r.push({label:e,value:t,theme:i.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})}));var s=new t.Combox({editor:i,items:r,onselect:function(e,t){i.execCommand("insertcode",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-insertcode",indexByValue:function(e){if(e)for(var t,i=0;t=this.items[i];i++)if(-1!=t.value.indexOf(e))return i;return-1}});return t.buttons["insertcode"]=s,i.addListener("selectionchange",(function(e,t,n){if(!n){var r=i.queryCommandState("insertcode");if(-1==r)s.setDisabled(!0);else{s.setDisabled(!1);var a=i.queryCommandValue("insertcode");if(!a)return void s.setValue(o);a&&(a=a.replace(/['"]/g,"").split(",")[0]),s.setValue(a)}}})),s},t.fontfamily=function(i,n,o){if(n=i.options["fontfamily"]||[],o=i.options.labelMap["fontfamily"]||i.getLang("labelMap.fontfamily")||"",n.length){for(var r,s=0,a=[];r=n[s];s++){var l=i.getLang("fontfamily")[r.name]||"";(function(t,n){a.push({label:t,value:n,theme:i.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+e.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(r.label||l,r.val)}var c=new t.Combox({editor:i,items:a,onselect:function(e,t){i.execCommand("FontFamily",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-fontfamily",indexByValue:function(e){if(e)for(var t,i=0;t=this.items[i];i++)if(-1!=t.value.indexOf(e))return i;return-1}});return t.buttons["fontfamily"]=c,i.addListener("selectionchange",(function(e,t,n){if(!n){var o=i.queryCommandState("FontFamily");if(-1==o)c.setDisabled(!0);else{c.setDisabled(!1);var r=i.queryCommandValue("FontFamily");r&&(r=r.replace(/['"]/g,"").split(",")[0]),c.setValue(r)}}})),c}},t.fontsize=function(e,i,n){if(n=e.options.labelMap["fontsize"]||e.getLang("labelMap.fontsize")||"",i=i||e.options["fontsize"]||[],i.length){for(var o=[],r=0;r<i.length;r++){var s=i[r]+"px";o.push({label:s,value:s,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var a=new t.Combox({editor:e,items:o,title:n,initValue:n,onselect:function(t,i){e.execCommand("FontSize",this.items[i].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return t.buttons["fontsize"]=a,e.addListener("selectionchange",(function(t,i,n){if(!n){var o=e.queryCommandState("FontSize");-1==o?a.setDisabled(!0):(a.setDisabled(!1),a.setValue(e.queryCommandValue("FontSize")))}})),a}},t.paragraph=function(i,n,o){if(o=i.options.labelMap["paragraph"]||i.getLang("labelMap.paragraph")||"",n=i.options["paragraph"]||[],!e.isEmptyObject(n)){var r=[];for(var s in n)r.push({value:s,label:n[s]||i.getLang("paragraph")[s],theme:i.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}});var a=new t.Combox({editor:i,items:r,title:o,initValue:o,className:"edui-for-paragraph",onselect:function(e,t){i.execCommand("Paragraph",this.items[t].value)},onbuttonclick:function(){this.showPopup()}});return t.buttons["paragraph"]=a,i.addListener("selectionchange",(function(e,t,n){if(!n){var o=i.queryCommandState("Paragraph");if(-1==o)a.setDisabled(!0);else{a.setDisabled(!1);var r=i.queryCommandValue("Paragraph"),s=a.indexByValue(r);-1!=s?a.setValue(r):a.setValue(a.initValue)}}})),a}},t.customstyle=function(e){var i=e.options["customstyle"]||[],n=e.options.labelMap["customstyle"]||e.getLang("labelMap.customstyle")||"";if(i.length){for(var o,r=e.getLang("customstyle"),s=0,a=[];o=i[s++];)(function(t){var i={};i.label=t.label?t.label:r[t.name],i.style=t.style,i.className=t.className,i.tag=t.tag,a.push({label:i.label,value:i,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+i.tag+" "+(i.className?' class="'+i.className+'"':"")+(i.style?' style="'+i.style+'"':"")+">"+i.label+"</"+i.tag+"></div>"}})})(o);var l=new t.Combox({editor:e,items:a,title:n,initValue:n,className:"edui-for-customstyle",onselect:function(t,i){e.execCommand("customstyle",this.items[i].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(e){for(var t,i=0;t=this.items[i++];)if(t.label==e)return i-1;return-1}});return t.buttons["customstyle"]=l,e.addListener("selectionchange",(function(t,i,n){if(!n){var o=e.queryCommandState("customstyle");if(-1==o)l.setDisabled(!0);else{l.setDisabled(!1);var r=e.queryCommandValue("customstyle"),s=l.indexByValue(r);-1!=s?l.setValue(r):l.setValue(l.initValue)}}})),l}},t.inserttable=function(e,i,n){n=e.options.labelMap["inserttable"]||e.getLang("labelMap.inserttable")||"";var o=new t.TableButton({editor:e,title:n,className:"edui-for-inserttable",onpicktable:function(t,i,n){e.execCommand("InsertTable",{numRows:n,numCols:i,border:1})},onbuttonclick:function(){this.showPopup()}});return t.buttons["inserttable"]=o,e.addListener("selectionchange",(function(){o.setDisabled(-1==e.queryCommandState("inserttable"))})),o},t.lineheight=function(e){var i=e.options.lineheight||[];if(i.length){for(var n,o=0,r=[];n=i[o++];)r.push({label:n,value:n,theme:e.options.theme,onclick:function(){e.execCommand("lineheight",this.value)}});var s=new t.MenuButton({editor:e,className:"edui-for-lineheight",title:e.options.labelMap["lineheight"]||e.getLang("labelMap.lineheight")||"",items:r,onbuttonclick:function(){var t=e.queryCommandValue("LineHeight")||this.value;e.execCommand("LineHeight",t)}});return t.buttons["lineheight"]=s,e.addListener("selectionchange",(function(){var t=e.queryCommandState("LineHeight");if(-1==t)s.setDisabled(!0);else{s.setDisabled(!1);var i=e.queryCommandValue("LineHeight");i&&s.setValue((i+"").replace(/cm/,"")),s.setChecked(t)}})),s}};for(var d,u=["top","bottom"],m=0;d=u[m++];)(function(e){t["rowspacing"+e]=function(i){var n=i.options["rowspacing"+e]||[];if(!n.length)return null;for(var o,r=0,s=[];o=n[r++];)s.push({label:o,value:o,theme:i.options.theme,onclick:function(){i.execCommand("rowspacing",this.value,e)}});var a=new t.MenuButton({editor:i,className:"edui-for-rowspacing"+e,title:i.options.labelMap["rowspacing"+e]||i.getLang("labelMap.rowspacing"+e)||"",items:s,onbuttonclick:function(){var t=i.queryCommandValue("rowspacing",e)||this.value;i.execCommand("rowspacing",t,e)}});return t.buttons[e]=a,i.addListener("selectionchange",(function(){var t=i.queryCommandState("rowspacing",e);if(-1==t)a.setDisabled(!0);else{a.setDisabled(!1);var n=i.queryCommandValue("rowspacing",e);n&&a.setValue((n+"").replace(/%/,"")),a.setChecked(t)}})),a}})(d);for(var p,h=["insertorderedlist","insertunorderedlist"],f=0;p=h[f++];)(function(e){t[e]=function(i){var n=i.options[e],o=function(){i.execCommand(e,this.value)},r=[];for(var s in n)r.push({label:n[s]||i.getLang()[e][s]||"",value:s,theme:i.options.theme,onclick:o});var a=new t.MenuButton({editor:i,className:"edui-for-"+e,title:i.getLang("labelMap."+e)||"",items:r,onbuttonclick:function(){var t=i.queryCommandValue(e)||this.value;i.execCommand(e,t)}});return t.buttons[e]=a,i.addListener("selectionchange",(function(){var t=i.queryCommandState(e);if(-1==t)a.setDisabled(!0);else{a.setDisabled(!1);var n=i.queryCommandValue(e);a.setValue(n),a.setChecked(t)}})),a}})(p);t.fullscreen=function(e,i){i=e.options.labelMap["fullscreen"]||e.getLang("labelMap.fullscreen")||"";var n=new t.Button({className:"edui-for-fullscreen",title:i,theme:e.options.theme,onclick:function(){e.ui&&e.ui.setFullScreen(!e.ui.isFullScreen()),this.setChecked(e.ui.isFullScreen())}});return t.buttons["fullscreen"]=n,e.addListener("selectionchange",(function(){var t=e.queryCommandState("fullscreen");n.setDisabled(-1==t),n.setChecked(e.ui.isFullScreen())})),n},t["emotion"]=function(e,i){var o="emotion",r=new t.MultiMenuPop({title:e.options.labelMap[o]||e.getLang("labelMap."+o)||"",editor:e,className:"edui-for-"+o,iframeUrl:e.ui.mapUrl(i||(e.options.iframeUrlMap||{})[o]||n[o])});return t.buttons[o]=r,e.addListener("selectionchange",(function(){r.setDisabled(-1==e.queryCommandState(o))})),r},t.autotypeset=function(e){var i=new t.AutoTypeSetButton({editor:e,title:e.options.labelMap["autotypeset"]||e.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){e.execCommand("autotypeset")}});return t.buttons["autotypeset"]=i,e.addListener("selectionchange",(function(){i.setDisabled(-1==e.queryCommandState("autotypeset"))})),i},t["simpleupload"]=function(e){var i="simpleupload",n=new t.Button({className:"edui-for-"+i,title:e.options.labelMap[i]||e.getLang("labelMap."+i)||"",onclick:function(){},theme:e.options.theme,showText:!1});return t.buttons[i]=n,e.addListener("ready",(function(){var t=n.getDom("body"),i=t.children[0];e.fireEvent("simpleuploadbtnready",i)})),e.addListener("selectionchange",(function(t,o,r){var s=e.queryCommandState(i);-1==s?(n.setDisabled(!0),n.setChecked(!1)):r||(n.setDisabled(!1),n.setChecked(s))})),n}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,n=baidu.editor.dom.domUtils,o=[];function r(e){this.initOptions(e),this.initEditorUI()}r.prototype={uiName:"editor",initEditorUI:function(){this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var e=this.editor,t=this;e.addListener("ready",(function(){if(e.getDialog=function(t){return e.ui._dialogs[t+"Dialog"]},n.on(e.window,"scroll",(function(e){baidu.editor.ui.Popup.postHide(e)})),e.ui._actualFrameWidth=e.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&e.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),e.options.elementPathEnabled&&(e.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+e.getLang("elementPathTip")+":</div>"),e.options.wordCount){function i(){s(e,t),n.un(e.document,"click",arguments.callee)}n.on(e.document,"click",i),e.ui.getDom("wordcount").innerHTML=e.getLang("wordCountTip")}e.ui._scale(),e.options.scaleEnabled?(e.autoHeightEnabled&&e.disableAutoHeight(),t.enableScale()):t.disableScale(),e.options.elementPathEnabled||e.options.wordCount||e.options.scaleEnabled||(e.ui.getDom("elementpath").style.display="none",e.ui.getDom("wordcount").style.display="none",e.ui.getDom("scale").style.display="none"),e.selection.isFocus()&&e.fireEvent("selectionchange",!1,!0)})),e.addListener("mousedown",(function(e,t){var i=t.target||t.srcElement;baidu.editor.ui.Popup.postHide(t,i),baidu.editor.ui.ShortCutMenu.postHide(t)})),e.addListener("delcells",(function(){UE.ui["edittip"]&&new UE.ui["edittip"](e),e.getDialog("edittip").open()}));var i,o,r=!1;function s(e,t){e.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:e.options.wordCountMsg||e.getLang("wordCountMsg"),wordOverFlowMsg:e.options.wordOverFlowMsg||e.getLang("wordOverFlowMsg")});var i=e.options,n=i.maximumWords,o=i.wordCountMsg,r=i.wordOverFlowMsg,s=t.getDom("wordcount");if(i.wordCount){var a=e.getContentLength(!0);a>n?(s.innerHTML=r,e.fireEvent("wordcountoverflow")):s.innerHTML=o.replace("{#leave}",n-a).replace("{#count}",a)}}e.addListener("afterpaste",(function(){e.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(i=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:e}),editor:e,className:"edui-wordpastepop"}),i.render()),r=!0)})),e.addListener("afterinserthtml",(function(){clearTimeout(o),o=setTimeout((function(){if(i&&(r||e.ui._isTransfer)){if(i.isHidden()){var t=n.createElement(e.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"}),o=e.selection.getRange();o.insertNode(t);var s=getDomNode(t,"firstChild","previousSibling");s&&i.showAnchor(3==s.nodeType?s.parentNode:s),n.remove(t)}else i.show();delete e.ui._isTransfer,r=!1}}),200)})),e.addListener("contextmenu",(function(e,t){baidu.editor.ui.Popup.postHide(t)})),e.addListener("keydown",(function(e,t){i&&i.dispose(t);var n=t.keyCode||t.which;t.altKey&&90==n&&UE.ui.buttons["fullscreen"].onclick()})),e.addListener("wordcount",(function(e){s(this,t)})),e.addListener("selectionchange",(function(){e.options.elementPathEnabled&&t[(-1==e.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"](),e.options.scaleEnabled&&t[(-1==e.queryCommandState("scale")?"dis":"en")+"ableScale"]()}));var a=new baidu.editor.ui.Popup({editor:e,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),e.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(t){this.hide(),e.ui._dialogs[t]&&e.ui._dialogs[t].open()},_onImgSetFloat:function(t){this.hide(),e.execCommand("imagefloat",t)},_setIframeAlign:function(e){var t=a.anchorEl,i=t.cloneNode(!0);switch(e){case-2:i.setAttribute("align","");break;case-1:i.setAttribute("align","left");break;case 1:i.setAttribute("align","right");break}t.parentNode.insertBefore(i,t),n.remove(t),a.anchorEl=i,a.showAnchor(a.anchorEl)},_updateIframe:function(){var t=e._iframe=a.anchorEl;n.hasClass(t,"ueditor_baidumap")?(e.selection.getRange().selectNode(t).select(),e.ui._dialogs.mapDialog.open(),a.hide()):(e.ui._dialogs.insertframeDialog.open(),a.hide())},_onRemoveButtonClick:function(t){e.execCommand(t),this.hide()},queryAutoHide:function(t){return t&&t.ownerDocument==e.document&&("img"==t.tagName.toLowerCase()||n.findParentByTagName(t,"a",!0))?t!==a.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,t)}});a.render(),e.options.imagePopup&&(e.addListener("mouseover",(function(t,i){i=i||window.event;var n=i.target||i.srcElement;if(e.ui._dialogs.insertframeDialog&&/iframe/gi.test(n.tagName)){var o=a.formatHtml("<nobr>"+e.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+e.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+e.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">'+e.getLang("justifyright")+'</span>&nbsp;&nbsp; <span onclick="$$._updateIframe( this);" class="edui-clickable">'+e.getLang("modify")+"</span></nobr>");o?(a.getDom("content").innerHTML=o,a.anchorEl=n,a.showAnchor(a.anchorEl)):a.hide()}})),e.addListener("selectionchange",(function(t,i){if(i){var o="",r="",s=e.selection.getRange().getClosedNode(),l=e.ui._dialogs;if(s&&"IMG"==s.tagName){var c="insertimageDialog";if(-1==s.className.indexOf("edui-faked-video")&&-1==s.className.indexOf("edui-upload-video")||(c="insertvideoDialog"),-1!=s.className.indexOf("edui-faked-webapp")&&(c="webappDialog"),-1!=s.src.indexOf("http://api.map.baidu.com")&&(c="mapDialog"),-1!=s.className.indexOf("edui-faked-music")&&(c="musicDialog"),-1!=s.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(c="gmapDialog"),s.getAttribute("anchorname")&&(c="anchorDialog",o=a.formatHtml("<nobr>"+e.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+e.getLang("modify")+"</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+e.getLang("delete")+"</span></nobr>")),s.getAttribute("word_img")&&(e.word_img=[s.getAttribute("word_img")],c="wordimageDialog"),(n.hasClass(s,"loadingclass")||n.hasClass(s,"loaderrorclass"))&&(c=""),!l[c])return;r="<nobr>"+e.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+e.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+e.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+e.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+e.getLang("justifycenter")+"</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('"+c+'\');" class="edui-clickable">'+e.getLang("modify")+"</span></nobr>",!o&&(o=a.formatHtml(r))}if(e.ui._dialogs.linkDialog){var d,u=e.queryCommandValue("link");if(u&&(d=u.getAttribute("_href")||u.getAttribute("href",2))){var m=d;d.length>30&&(m=d.substring(0,20)+"..."),o&&(o+='<div style="height:5px;"></div>'),o+=a.formatHtml("<nobr>"+e.getLang("anthorMsg")+': <a target="_blank" href="'+d+'" title="'+d+'" >'+m+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+e.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+e.getLang("clear")+"</span></nobr>"),a.showAnchor(u)}}o?(a.getDom("content").innerHTML=o,a.anchorEl=s||u,a.showAnchor(a.anchorEl)):a.hide()}})))},_initToolbars:function(){for(var e=this.editor,t=this.toolbars||[],i=[],n=0;n<t.length;n++){for(var o=t[n],r=new baidu.editor.ui.Toolbar({theme:e.options.theme}),s=0;s<o.length;s++){var a=o[s],l=null;if("string"==typeof a){if(a=a.toLowerCase(),"|"==a&&(a="Separator"),"||"==a&&(a="Breakline"),baidu.editor.ui[a]&&(l=new baidu.editor.ui[a](e)),"fullscreen"==a){i&&i[0]?i[0].items.splice(0,0,l):l&&r.items.splice(0,0,l);continue}}else l=a;l&&l.id&&r.add(l)}i[n]=r}for(var c in UE._customizeUI){var d,u,m=UE._customizeUI[c];m.id&&m.id!=e.key||(d=m.execFn.call(e,e,c),d&&(u=m.index,void 0===u&&(u=r.items.length),r.add(d,u)))}this.toolbars=i},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div><div id="##_message_holder" class="%%-messageholder"></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'},showWordImageDialog:function(){this._dialogs["wordimageDialog"].open()},renderToolbarBoxHtml:function(){for(var e=[],t=0;t<this.toolbars.length;t++)e.push(this.toolbars[t].renderHtml());return e.join("")},setFullScreen:function(e){var t=this.editor,i=t.container.parentNode.parentNode;if(this._fullscreen!=e){if(this._fullscreen=e,this.editor.fireEvent("beforefullscreenchange",e),baidu.editor.browser.gecko)var n=t.selection.getRange().createBookmark();if(e){while("BODY"!=i.tagName){var r=baidu.editor.dom.domUtils.getComputedStyle(i,"position");o.push(r),i.style.position="static",i=i.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow,this._bakBodyOverflow=document.body.style.overflow,this._bakAutoHeight=this.editor.autoHeightEnabled,this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this._bakEditorContaninerWidth=t.iframe.parentNode.offsetWidth,this._bakAutoHeight&&(t.autoHeightEnabled=!1,this.editor.disableAutoHeight()),document.documentElement.style.overflow="hidden",window.scrollTo(0,window.scrollY),this._bakCssText=this.getDom().style.cssText,this._bakCssText1=this.getDom("iframeholder").style.cssText,t.iframe.parentNode.style.width="",this._updateFullScreen()}else{while("BODY"!=i.tagName)i.style.position=o.shift(),i=i.parentNode;this.getDom().style.cssText=this._bakCssText,this.getDom("iframeholder").style.cssText=this._bakCssText1,this._bakAutoHeight&&(t.autoHeightEnabled=!0,this.editor.enableAutoHeight()),document.documentElement.style.overflow=this._bakHtmlOverflow,document.body.style.overflow=this._bakBodyOverflow,t.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px",window.scrollTo(0,this._bakScrollTop)}if(browser.gecko&&"true"===t.body.contentEditable){var s=document.createElement("input");document.body.appendChild(s),t.body.contentEditable=!1,setTimeout((function(){s.focus(),setTimeout((function(){t.body.contentEditable=!0,t.fireEvent("fullscreenchanged",e),t.selection.getRange().moveToBookmark(n).select(!0),baidu.editor.dom.domUtils.remove(s),e&&window.scroll(0,0)}),0)}),0)}"true"===t.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",e),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var e=t.getViewportRect();if(this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+e.width+"px;height:"+e.height+"px;z-index:"+(1*this.getDom().style.zIndex+100),t.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0}),this.editor.setHeight(e.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0),!0),browser.gecko)try{window.onresize()}catch(i){}}},_updateElementPath:function(){var e,t=this.getDom("elementpath");if(this.elementPathEnabled&&(e=this.editor.queryCommandValue("elementpath"))){for(var i,n=[],o=0;i=e[o];o++)n[o]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;'+o+'&quot;);">'+i+"</span>");t.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+n.join(" &gt; ")+"</div>"}else t.style.display="none"},disableElementPath:function(){var e=this.getDom("elementpath");e.innerHTML="",e.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){var e=this.getDom("elementpath");e.style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){var e=document,t=this.editor,i=t.container,o=t.document,r=this.getDom("toolbarbox"),s=this.getDom("bottombar"),a=this.getDom("scale"),l=this.getDom("scalelayer"),c=!1,d=null,u=0,m=t.options.minFrameWidth,p=0,h=0,f=0,g=0;function b(){d=n.getXY(i),u||(u=t.options.minFrameHeight+r.offsetHeight+s.offsetHeight),l.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+i.offsetWidth+"px;height:"+i.offsetHeight+"px;z-index:"+(t.options.zIndex+1),n.on(e,"mousemove",y),n.on(o,"mouseup",C),n.on(e,"mouseup",C)}var v=this;function y(t){x();var i=t||window.event;p=i.pageX||e.documentElement.scrollLeft+i.clientX,h=i.pageY||e.documentElement.scrollTop+i.clientY,f=p-d.x,g=h-d.y,f>=m&&(c=!0,l.style.width=f+"px"),g>=u&&(c=!0,l.style.height=g+"px")}function C(){c&&(c=!1,t.ui._actualFrameWidth=l.offsetWidth-2,i.style.width=t.ui._actualFrameWidth+"px",t.setHeight(l.offsetHeight-s.offsetHeight-r.offsetHeight-2,!0)),l&&(l.style.display="none"),x(),n.un(e,"mousemove",y),n.un(o,"mouseup",C),n.un(e,"mouseup",C)}function x(){browser.ie?e.selection.clear():window.getSelection().removeAllRanges()}this.editor.addListener("fullscreenchanged",(function(e,t){if(t)v.disableScale();else if(v.editor.options.scaleEnabled){v.enableScale();var i=v.editor.document.createElement("span");v.editor.body.appendChild(i),v.editor.body.style.height=Math.max(n.getXY(i).y,v.editor.iframe.offsetHeight-20)+"px",n.remove(i)}})),this.enableScale=function(){1!=t.queryCommandState("source")&&(a.style.display="",this.scaleEnabled=!0,n.on(a,"mousedown",b))},this.disableScale=function(){a.style.display="none",this.scaleEnabled=!1,n.un(a,"mousedown",b)}},isFullScreen:function(){return this._fullscreen},postRender:function(){i.prototype.postRender.call(this);for(var e=0;e<this.toolbars.length;e++)this.toolbars[e].postRender();var t,n=this,o=baidu.editor.dom.domUtils,r=function(){clearTimeout(t),t=setTimeout((function(){n._updateFullScreen()}))};o.on(window,"resize",r),n.addListener("destroy",(function(){o.un(window,"resize",r),clearTimeout(t)}))},showToolbarMsg:function(e,t){if(this.getDom("toolbarmsg_label").innerHTML=e,this.getDom("toolbarmsg").style.display="",!t){var i=this.getDom("upload_dialog");i.style.display="none"}},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(e){return e?e.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var e=this.getDom();"1"==e.style.zoom?e.style.zoom="100%":e.style.zoom="1"}},e.inherits(r,baidu.editor.ui.UIBase);var s={};UE.ui.Editor=function(t){var i=new UE.Editor(t);i.options.editor=i,e.loadFile(document,{href:i.options.themePath+i.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var o=i.render;return i.render=function(t){t.constructor===String&&(i.key=t,s[t]=i),e.domReady((function(){function e(){if(i.setOpt({labelMap:i.options.labelMap||i.getLang("labelMap")}),new r(i.options),t&&(t.constructor===String&&(t=document.getElementById(t)),t&&t.getAttribute("name")&&(i.options.textarea=t.getAttribute("name")),t&&/script|textarea/gi.test(t.tagName))){var e=document.createElement("div");t.parentNode.insertBefore(e,t);var s=t.value||t.innerHTML;i.options.initialContent=/^[\t\r\n ]*$/.test(s)?i.options.initialContent:s.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><"),t.className&&(e.className=t.className),t.style.cssText&&(e.style.cssText=t.style.cssText),/textarea/i.test(t.tagName)?(i.textarea=t,i.textarea.style.display="none"):t.parentNode.removeChild(t),t.id&&(e.id=t.id,n.removeAttributes(t,"id")),t=e,t.innerHTML=""}n.addClass(t,"edui-"+i.options.theme),i.ui.render(t);var a=i.options;i.container=i.ui.getDom();for(var l=n.findParents(t,!0),c=[],d=0;m=l[d];d++)c[d]=m.style.display,m.style.display="block";if(a.initialFrameWidth)a.minFrameWidth=a.initialFrameWidth;else{a.minFrameWidth=a.initialFrameWidth=t.offsetWidth;var u=t.style.width;/%$/.test(u)&&(a.initialFrameWidth=u)}a.initialFrameHeight?a.minFrameHeight=a.initialFrameHeight:a.initialFrameHeight=a.minFrameHeight=t.offsetHeight;var m;for(d=0;m=l[d];d++)m.style.display=c[d];t.style.height&&(t.style.height=""),i.container.style.width=a.initialFrameWidth+(/%$/.test(a.initialFrameWidth)?"":"px"),i.container.style.zIndex=a.zIndex,o.call(i,i.ui.getDom("iframeholder")),i.fireEvent("afteruiready")}i.langIsReady?e():i.addListener("langReady",e)}))},i},UE.getEditor=function(e,t){var i=s[e];return i||(i=s[e]=new UE.ui.Editor(t),i.render(e)),i},UE.delEditor=function(e){var t;(t=s[e])&&(t.key&&t.destroy(),delete s[e])},UE.registerUI=function(t,i,n,o){e.each(t.split(/\s+/),(function(e){UE._customizeUI[e]={id:o,execFn:i,index:n}}))}}(),UE.registerUI("message",(function(e){var t,i=baidu.editor.ui,n=i.Message,o=[],r=e;function s(){var e=r.ui.getDom("toolbarbox");e&&(t.style.top=e.offsetHeight+3+"px"),t.style.zIndex=Math.max(r.options.zIndex,r.iframe.style.zIndex)+1}r.addListener("ready",(function(){t=document.getElementById(r.ui.id+"_message_holder"),s()})),r.addListener("showmessage",(function(e,i){i=utils.isString(i)?{content:i}:i;var a=new n({timeout:i.timeout,type:i.type,content:i.content,keepshow:i.keepshow,editor:r}),l=i.id||"msg_"+(+new Date).toString(36);return a.render(t),o[l]=a,a.reset(i),s(),l})),r.addListener("updatemessage",(function(e,i,n){n=utils.isString(n)?{content:n}:n;var r=o[i];r.render(t),r&&r.reset(n)})),r.addListener("hidemessage",(function(e,t){var i=o[t];i&&i.hide()}))})),UE.registerUI("autosave",(function(e){var t=null,i=null;e.on("afterautosave",(function(){clearTimeout(t),t=setTimeout((function(){i&&e.trigger("hidemessage",i),i=e.trigger("showmessage",{content:e.getLang("autosave.success"),timeout:2e3})}),2e3)}))}))})()},baa5:function(e,t,i){var n=i("23e7"),o=i("e58c");n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},bb2f:function(e,t,i){var n=i("d039");e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},c29e:function(e,t,i){"use strict";var n=i("9602"),o=i.n(n);o.a},c2e7:function(e,t,i){"use strict";var n=i("d743"),o=i.n(n);o.a},c8d2:function(e,t,i){var n=i("d039"),o=i("5899"),r="​…᠎";e.exports=function(e){return n((function(){return!!o[e]()||r[e]()!=r||o[e].name!==e}))}},c9de:function(e,t,i){},cb29:function(e,t,i){var n=i("23e7"),o=i("81d5"),r=i("44d2");n({target:"Array",proto:!0},{fill:o}),r("fill")},cb79:function(e,t,i){"use strict";var n=i("f38e"),o=i.n(n);o.a},cd95:function(e,t,i){"use strict";var n=i("9e54"),o=i.n(n);o.a},ce59:function(e,t,i){},d356:function(e,t,i){"use strict";var n=i("dfc8"),o=i.n(n);o.a},d3a4:function(e,t,i){},d743:function(e,t,i){},d8dc:function(e,t,i){},da93:function(e,t,i){},dfc8:function(e,t,i){},ebb6:function(e,t,i){"use strict";var n=i("7b90"),o=i.n(n);o.a},f183:function(e,t,i){var n=i("d012"),o=i("861d"),r=i("5135"),s=i("9bf2").f,a=i("90e3"),l=i("bb2f"),c=a("meta"),d=0,u=Object.isExtensible||function(){return!0},m=function(e){s(e,c,{value:{objectID:"O"+ ++d,weakData:{}}})},p=function(e,t){if(!o(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!r(e,c)){if(!u(e))return"F";if(!t)return"E";m(e)}return e[c].objectID},h=function(e,t){if(!r(e,c)){if(!u(e))return!0;if(!t)return!1;m(e)}return e[c].weakData},f=function(e){return l&&g.REQUIRED&&u(e)&&!r(e,c)&&m(e),e},g=e.exports={REQUIRED:!1,fastKey:p,getWeakData:h,onFreeze:f};n[c]=!0},f327:function(e,t){UE.registerUI("horizontalline",(function(e,t){var i=new UE.ui.Dialog({iframeUrl:e.options.UEDITOR_HOME_URL+"horizontal-line/HorizontalLineDialog.html",editor:e,name:t,title:"插入答题横线",cssRules:"width:430px; height: 188px;",buttons:[{className:"edui-okbutton",label:"确定",onclick:function(){i.close(!0)}},{className:"edui-cancelbutton",label:"取消",onclick:function(){i.close(!1)}}]});e.ready((function(){UE.utils.cssRule("kfformula","img.kfformula{vertical-align: middle;}",e.document)}));var n=e.options.UEDITOR_HOME_URL+"horizontal-line/horizontal-line-icon.png",o=document.createElement("a");o.href=n,o.href=o.href,n=o.href;var r=new UE.ui.Button({name:"插入"+t,title:"插入答题横线-"+t,cssRules:'background: url("'+n+'") !important',onclick:function(){i.render(),i.open()}});return e.addListener("selectionchange",(function(){var i=e.queryCommandState(t);-1==i?(r.setDisabled(!0),r.setChecked(!1)):(r.setDisabled(!1),r.setChecked(i))})),r}))},f38e:function(e,t,i){}}]);