!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=256)}({0:function(e,t,n){var i;void 0===(i=function(){var e={post:function(e,t,n){var i={url:e,data:t,method:"post",dataType:"json",cache:!1,timeout:45e3},o=$.Deferred();return $.ajax(i).fail(function(){!1!==n&&$.alert("请求处理失败,请稍后尝试。"),o.reject()}).then(function(e){var t=e.code;if(0===t)o.resolve(e);else if(2===t)$.loginWindow(),o.reject(e);else{var n=e.msg;n&&$.toast(n),o.reject(e)}}),o},loadHtml:function(e,t){var n={url:e,data:t,method:"get",dataType:"html",cache:!1},i=$.Deferred();return $.ajax(n).fail(function(){$.alert("加载失败")}).then(function(e){i.resolve(e)}),i}};return e}.call(t,n,t,e))||(e.exports=i)},11:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;__WEBPACK_AMD_DEFINE_RESULT__=function(require,exports,module){return"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(e){return e<10?"0"+e:e}var cx,escapable,gap,indent,meta,rep;function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,i,o,r,a,s=gap,d=t[e];switch(d&&"object"==typeof d&&"function"==typeof d.toJSON&&(d=d.toJSON(e)),"function"==typeof rep&&(d=rep.call(t,e,d)),typeof d){case"string":return quote(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(d)){for(r=d.length,n=0;n=0&&(t.metaKey="metaKey",t.metaKeyText="⌘",t.optionKeyText="⌥",t.shiftKeyText="⇧"),t.isMobile&&(t.downEvent="touchstart",t.moveEvent="touchmove",t.upEvent="touchend"),t}.call(t,n,t,e))||(e.exports=i)},120:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(32),o=n(11),r=n(31),a=n(15),s=n(0),d=n(5);t.initPreview=function(){var e,t=$("#paper"),n=this;t.on("click.preview-image",".attach-img",function(e){var t=$(this),i=t.parent();if(i.hasClass("active")||t.hasClass("readonly")){var o=t.attr("src");n.preview(o)}else $(".image-wrapper.active").removeClass("active"),i.addClass("active")}),t.on("mousedown.preview-image",".image-wrapper",function(e){e.stopPropagation()}),$("body").on("mousedown.preview-image",function(){$(".image-wrapper.active").removeClass("active")}),t.on("mousedown.preview-image",".attach-resize",function(){e=$(this).parent().find("img");var t=$(this).data("nodeid"),n=$(this).parent().parent().index();$("body").addClass("select-disable").on("selectstart",function(){return!1}),$(window).on("mouseup.preview-image",function(){var o=e.width();i.resizeImage(t,n,o),$(window).off("mouseup.preview-image").off("mousemove.preview-image"),$("body").removeClass("select-disable").off("selectstart")}),$(window).on("mousemove.preview-image",function(t){var n=Math.round(t.pageX-e.offset().left);n<=50&&(n=50),e.width(n)}),d.logOperate("resize_image")}),t.on("click.remove-img",".attach-remove",function(){var e=$(this),t=e.data("nodeid"),n=e.parent().parent().prevAll("div:not(.uploading)").length;i.removeImage(t,n)}),t.on("click.remove-img",".attach-copy",function(){var e=$(this),t=e.data("nodeid"),n=e.parent().parent().prevAll("div:not(.uploading)").length,l=i.getNode(t).images[n],c={type:"image",data:l},u="mubu_clipboard:"+o.stringify(c),f=function(){$.toast("复制成功,您可以到相应的主题下进行粘贴")};a.desktop?(s.post("/api/electron/copy_image",{uri:l.uri,text:u}),f()):r.copy(u,f,function(){$.toast("复制失败,无法访问您的剪贴板")}),d.logOperate("copy_image")})},t.preview=function(e){var t;function n(){clearTimeout(t),t=setTimeout(function(){$(".operation").fadeOut(300)},1600)}n();var i=$(document);i.on("mousemove.operationHide",function(){$(".operation").show(),n()}),i.on("mousemove.operationOver",".operation",function(e){e.stopPropagation(),clearTimeout(t)});var o=$(".doc-img-preview-mask");if(o.remove(),0==o.length){if(o=$('
'),document.fullscreenElement||document.mozFullscreenElement||document.webkitFullscreenElement)return;$("body").append(o)}var r,a,s=o.find(".doc-img-preview-holder");s.append("
"),o.show();var d=new Image;s.find("#append-img").append(d);var l,c,u=s.find("img");u.on("load",function(){s.html(d),r=u.height(),a=u.width(),c=a-$(window).width(),l=r-$(window).height(),_(),g()}),d.src=e;var f,h,p=u;function g(){var e=p.width()>$(window).width(),t=p.height()>$(window).height();e&&t?p.css({top:0,left:0,transform:"translate(0,0)"}):t?p.css({left:"50%",top:"0",transform:"translate(-50%,0)"}):e?p.css({left:0,top:"50%",transform:"translate(0,-50%)"}):p.css({top:"50%",left:"50%",transform:"translate(-50%,-50%)"})}function v(e){var t=$(window).height(),n=$(window).width(),i=o.scrollTop(),s=o.scrollLeft(),d=l*(t/l*1.3)*((1.3*t-t)/2/(1.3*t)),u=l*(t/l/1.3)*((t-t/1.3)/2/(t/1.3)),g=c*(n/c*1.3)*((1.3*n-n)/2/(1.3*n)),v=c*(n/c/1.3)*((n-n/1.3)/2/(n/1.3)),_=a*y,b=a*w;"add"==e?(f=o.scrollTop(),h=o.scrollLeft(),$("#operation-add").siblings().find("i").css("color","#777"),_>p.width()?(p.height(1.3*p.height()),p.width(1.3*p.width()),o.scrollTop(1.3*i+d),o.scrollLeft(1.3*s+g),p.height()>t?(f=1.3*f-d,f*=r/p.height()):p.width()>n&&(h=1.3*h+g,h*=a/p.width())):m("add")):"narrow"==e?(f=o.scrollTop(),h=o.scrollLeft(),$("#operation-narrow").siblings().find("i").css("color","#777"),bt?(f=f/1.3+u+u,f*=r/p.height()):p.width()>n&&(h=h/1.3-v,h*=a/p.width())):m("narrow")):"original"==e&&(p.height()>t||p.width()>n?(o.scrollTop(f),o.scrollLeft(h)):(o.scrollTop(0),o.scrollLeft(0)))}function m(e){if("add"==e)$("#operation-add").find("i").css("color","#ccc");else if("narrow"==e){$("#operation-narrow").find("i").css("color","#ccc")}else if("original"==e){var t=$("#operation-original");t.find("i").css("color","#ccc"),t.siblings().find("i").css("color","#777")}else if("adapt"==e){var n=$("#operation-adapt");n.find("i").css("color","#ccc"),n.siblings().find("i").css("color","#777")}}var y=2.5,w=.4;function _(){var e=$(window).width()-100,t=$(window).height()-100;a>e||r>t?a/e>r/t?(p.width(e),p.height(r*e/a)):a/e==r/t?(p.width(e),p.height(r*e/a)):(p.height(t),p.width(a*t/r)):(p.width(a),p.height(r))}$("#operation-add").on("click",function(){v("add"),g()}),$("#operation-narrow").on("click",function(){v("narrow"),g()}),$("#operation-original").on("click",function(){p.width(a),p.height(r),g(),v("original"),m("original")}),$("#operation-adapt").on("click",function(){_(),g(),m("adapt")}),o.on("click",function(){o.hide(),o.remove(),$(document).off("mousemove.operationHide"),$(document).off("keydown.hide-preview")}),o.on("click","img",function(e){e.stopPropagation()}),o.on("click",".operation",function(e){e.stopPropagation()}),$(document).off("keydown.hide-preview").on("keydown.hide-preview",function(e){27==e.keyCode&&o.trigger("click")})}}.call(t,n,t,e))||(e.exports=i)},121:function(e,t,n){var i;void 0===(i=function(e,t){var i,o,r,a=n(60),s=n(3),d=n(4),l=n(5),c=n(62),u={},f=null,h=1,p="webkitfullscreenchange msfullscreenchange mozfullscreenchange fullscreenchange",g={},v=$(document.createElement("div"));function m(){var e=i[0];e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.msRequestFullscreen&&e.msRequestFullscreen()}function y(){var e;(r.empty(),null==f)?e=o.nodes:e=[u[f].node];e&&e.length>0&&s.recursive(e,function(e){!function(e){var t,n=e.id==f,i=a.render(e,!0,n),o=u[e.id].parent;if(null==o||f&&f==e.id)t=r,e.id==f&&i.addClass("root-node");else{var s=r.find("#"+o.id);0==(t=s.children(".children")).length&&(t=$('
').appendTo(s))}t.append(i)}(e)}),function(){var e=i.find(".paper-dir");if(0==e.length)return;if(!f)return void e.hide();var t=[],n=f;if(n){for(;;){var o=u[n].parent;if(null==o)break;t.push(o),n=o.id}t.reverse()}e.empty().show().append('首页>');for(var r=0;r').appendTo(e);d.text(s.htmlToText(a.text)),d.data("node-id",a.id),e.append('>')}e.off().on("click",".item",function(){var e=$(this),t=e.data("node-id"),n=t||"root",i=g[n],o=i||0;setTimeout(function(){w().scrollTop(o)},5),f=t,y(),f&&(g={})})}(),function(){r.find(".bullet").off().on("click",function(){var e=$(this).data("id"),t="root";f&&(t=f),g[t]=w().scrollTop(),f=e,y(),w().scrollTop(0)});var e=r.find(".content-wrapper");e.off().on("mouseenter",function(){var e=$(this),t=e.parent();if(t.find(".node").length>0){var n=e.children(".toggle");0==n.length&&(n=$('
').appendTo(e)).on("click",function(){var e=t.attr("id"),n=u[e].node;t.toggleClass("collapsed"),_(t),n.collapsed=!n.collapsed}),_(t)}else e.children(".toggle").remove()}),d.isMobile()&&(e.addClass("mobile-view"),e.trigger("mouseenter"))}()}function w(){return"hidden"===window.getComputedStyle(document.body).overflowY?$("#demo-screen").children(".scrollable"):$(document)}function _(e){var t=e.children(".content-wrapper").children(".toggle").find(".icon");e.hasClass("collapsed")?t.attr("class","icon icon-plus"):t.attr("class","icon icon-minus")}function b(e){if(!(h>=3&&e>0||h<=.6&&e<0)){h+=e,h=Math.round(10*h)/10;var t=i.find(".demo-wrapper");d.isFirefox()?t.css("transform","scale("+h+")"):t.css("zoom",h)}}function C(){var e=i.find(".demo-wrapper");d.isFirefox()?e.css("transform","scale("+h+")"):e.css("zoom",h)}function x(){var e=i.find(".demo-menu");if(0!=e.length){i.hasClass("night-mode")?$("#demo-mode").find(".icon").attr("class","icon icon-sun"):$("#demo-mode").find(".icon").attr("class","icon icon-moon"),e.find("li").off(),e.find("#demo-mode").on("click",function(){var e=$(this);i.toggleClass("night-mode");var t="sun";i.hasClass("night-mode")?e.find(".icon").attr("class","icon icon-sun"):(t="moon",e.find(".icon").attr("class","icon icon-moon")),l.log("change_presentation_view",{action:t})}),e.find("#demo-zoomin").on("click",function(){b(.2),l.log("change_presentation_view",{action:"zoom-in"})}),e.find("#demo-zoomout").on("click",function(){b(-.2),i.find(".demo-wrapper").css("zoom",h),l.log("change_presentation_view",{action:"zoom-out"})}),e.find("#demo-exit").on("click",function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()})}}t.play=function(e,t,n,o){h=1.5,f=o;$(document).off("keydown.demo").on("keydown.demo",function(e){219==e.keyCode&&e.preventDefault()}),$(document).off(p).on(p,function(){i.toggle(),i.is(":visible")||(v.triggerHandler("exit"),r.empty(),$(document).off("keydown.demo"),i.find(".opening").remove())}),l.log("click_presentation_mode",{action:"enter"}),(i=t).append('
正在打开...
'),m();var a=this;setTimeout(function(){a.open(e,t,n),i.find(".opening").remove()},100)},t.open=function(e,t,n){o=$.extend(!0,{},e),i=t,u={},o.nodes&&o.nodes.length>0&&s.recursive(o.nodes,function(e,t){u[e.id]={node:e,parent:t||null}}),i.find(".title").text(n),0!=(r=i.find(".node-tree")).length&&(C(),y(),x())},t.readingPlay=function(){h=1.5,C(),$(document).off(p).on(p,function(){i.toggleClass("reading"),i.hasClass("reading")&&(v.triggerHandler("exit"),h=1,i.removeClass("night-mode"),C())}),l.log("click_presentation_mode",{action:"reading-enter"}),m()},t.getRootId=function(){return f},t.toggleExpandToLevel=function(e){var t;(t=null==f?o.nodes:u[f].node.children)&&0!==t.length&&c.toggleExpandToLevel(t,e,function(e,t){u[e].node.collapsed=t;var n=r.find("#"+e);t?n.addClass("collapsed"):n.removeClass("collapsed")})},t.toggleExpandAll=function(){var e;(e=null==f?o.nodes:u[f].node.children)&&0!==e.length&&c.toggleExpandAll(e,function(e,t){u[e].node.collapsed=t;var n=r.find("#"+e);t?n.addClass("collapsed"):n.removeClass("collapsed")})},t.drillToNextSibling=function(){if(!f)return;const e=function(e){const t=u[e].parent,n=t?t.children:o.nodes;for(let t=0;t=0?n[t-1]:void 0}(f);e?(f=e.id,y()):$.toast("上方无同级主题")},t.eventEmitter=v}.call(t,n,t,e))||(e.exports=i)},122:function(e,t,n){var i;void 0===(i=function(e,t){var i,o,r,a,s,d,l,c,u=n(81),f=n(4),h=n(3),p=n(7),g=n(82),v=1,m=!1,y=!1;function w(){if(!y){i=$(".mind-map"),s=i.width(),d=i.height();var e=i.find(".topic:visible").length;if(l=s*d,e>2e3||l>8e7)$.alert({title:"无法导出",content:"思维导图尺寸太大,不能导出图片,图片最多支持2000条主题,您可以:
1. 折叠不重要的主题
2. 点击某一子主题,进入主题后,导出相应的主题
"});else{v=l<=8e6?2:l<=2e7?1.5:1,f.isMobile()&&$('
').appendTo("body"),$("#mind-download-image").text("生成中..."),y=!0,(r=$("").appendTo("body")).attr({width:s*v,height:d*v}),a=r[0].getContext("2d"),o=i.offset(),a.save(),a.scale(v,v);var t=$("#mind-bg-holder"),n=t.children("img");n.length?a.fillStyle=a.createPattern(n[0],"repeat"):a.fillStyle=t.data("color"),a.fillRect(0,0,s,d),i.find(".linker-container:visible").each(function(){var e=$(this),t=e.children("svg"),n=t.offset(),i=(n.left-o.left)/c,r=(n.top-o.top)/c;a.save(),a.translate(i,r);var s=e.attr("path-d"),d=/[A-Z]/g,l=s.match(d),u=s.split(d),f=0;a.beginPath(),$.each(u,function(e,t){if(t=$.trim(t)){var n=l[f];if("M"==n){var i=t.split(",");a.moveTo(i[0],i[1])}else if("L"==n){var o=t.split(",");a.lineTo(o[0],o[1])}else if("C"==n){var r=t.split(" "),s=r[0].split(","),d=r[1].split(","),c=r[2].split(",");a.bezierCurveTo(s[0],s[1],d[0],d[1],c[0],c[1])}else if("Q"==n){var u=t.split(" "),h=u[0].split(","),p=u[1].split(",");a.quadraticCurveTo(h[0],h[1],p[0],p[1])}f++}}),a.strokeStyle=t.attr("stroke"),a.lineWidth=parseInt(t.attr("stroke-width")),a.stroke(),a.restore()}),a.restore(),function(){a.scale(v,v),a.save(),i.find(".tp-expand-box:visible").each(function(){a.save();var e=$(this),t=e.offset(),n=(t.left-o.left)/c,i=(t.top-o.top)/c,r=e.width();if(r>12){var s=e.css("background-color");a.strokeStyle=s,a.lineWidth=2,a.beginPath(),a.moveTo(n,i+1),a.lineTo(n+r,i+1),a.stroke(),n+=3.5}a.beginPath();a.beginPath();var d={x:n+6,y:i+1};a.arc(d.x,d.y,6,2*Math.PI,!1),a.fillStyle="#fff",a.fill(),a.strokeStyle="#888",a.lineWidth=1.6,a.beginPath(),a.moveTo(d.x-3,d.y),a.lineTo(d.x+3,d.y),a.stroke(),e.parents(".tp-container").hasClass("collapsed")&&(a.beginPath(),a.moveTo(d.x,d.y-3),a.lineTo(d.x,d.y+3),a.stroke()),a.restore()}),i.find(".topic-text.root, .topic-text.sub").each(function(){a.save();var e=$(this),t=e.css("background-color"),n=parseInt(e.css("border-left-width"));a.fillStyle=t;var i=e.offset(),r=(i.left-o.left)/c,s=(i.top-o.top)/c,d=e.outerWidth(),l=e.outerHeight(),u=e.hasClass("sub")?6:10;a.beginPath(),a.moveTo(r+u,s),a.lineTo(r+d-u,s),a.quadraticCurveTo(r+d,s,r+d,s+u),a.lineTo(r+d,s+l-u),a.quadraticCurveTo(r+d,s+l,r+d-u,s+l),a.lineTo(r+u,s+l),a.quadraticCurveTo(r,s+l,r,s+l-u),a.lineTo(r,s+u),a.quadraticCurveTo(r,s,r+u,s),a.closePath(),a.fill(),n>0&&(a.strokeStyle=e.css("border-left-color"),a.lineWidth=n,a.stroke()),a.restore()}),i.find(".topic-text:visible").each(function(){a.save();var e=$(this),t=e.offset(),n=(t.left-o.left)/c,i=(t.top-o.top)/c,r=0,s=0,d=20,l="14px";e.hasClass("root")?(r=25,s=10,d=36,l="24px"):e.hasClass("sub")&&(r=15,s=6,d=27,l="16px");var u=parseInt(e.css("border-left-width")),f=l+' SourceSansPro,-apple-system,BlinkMacSystemFont,"PingFang SC",Helvetica,Arial,"Microsoft YaHei",微软雅黑,黑体,Heiti,sans-serif,SimSun,宋体,serif';a.textBaseline="middle",a.fillStyle=e.css("color");var h=$("
");h.html(e.html());var p=h[0].childNodes,g=n+r,v=0,m=i+s+d/2;u&&(m+=u,g+=u);if(p.length>0)for(var y=0;y500)for(var x=0;x500&&(m+=d,v=0),a.fillText(T,v+g,m),v+=k}else a.fillText(w,v+g,m),v+=C;a.restore()}if(e.children(".topic-note").length){(v+=5)+18>500&&(m+=d,v=0),a.beginPath();a.beginPath();var M={x:v+g+9,y:m};a.arc(M.x,M.y,9,2*Math.PI,!1),a.fillStyle="#fff6cc",a.fill(),a.strokeStyle="#4f575d",a.lineWidth=1.2;var S=M.x-5,N=M.x+5;a.beginPath(),a.moveTo(S,M.y-3),a.lineTo(N,M.y-3),a.moveTo(S,M.y),a.lineTo(N,M.y),a.moveTo(S,M.y+3),a.lineTo(N,M.y+3),a.stroke()}a.restore()}),i.find(".attach-img").each(function(){var e=$(this);if(e.is(":visible")&&!e.hasClass("loading")){var t=e.offset(),n=(t.left-o.left)/c,i=(t.top-o.top)/c,r=e.width(),s=e.height();a.drawImage(e[0],n,i,r,s)}}),g.draw(a,s,d,v);var e=_();e+=".png";var t=r[0].toDataURL("image/png");if(r.remove(),$("#mind-download-image").text("图片"),$("#mind-export-indicator").remove(),y=!1,p.onMindExport)return void p.onMindExport(t);var n=h.dataURItoBlob(t);u.downloadBlob(n,e)}()}}}function _(){var e=i.find(".topic-text.root").text();return e||(e="幕布导出"),e.length>25&&(e=e.substr(0,25)),e}t.exportMindImage=function(e,t){c=e,w()},t.exportFreeMind=function(e,t){if(!m){m=!0,i=$(".mind-map");var n=$("
"),o=$("").appendTo(n);o.attr("ID","root"),o.attr("TEXT",i.find(".topic-text.root").text()),e&&$.each(e,function(n,i){var r=t;"org"!=t&&"default"!=t||(r=n+1>Math.ceil(e.length/2)?"left":"right"),function e(t,n,i){var o=$("\n").appendTo(n),r=t.text;o.attr("TEXT",h.htmlToText(r)),o.attr("ID",t.id),i?(o.attr("STYLE","bubble"),o.attr("POSITION",i)):o.attr("STYLE","fork"),t.children&&t.children.length>0&&$.each(t.children,function(t,n){e(n,o)}),o.append("\t\t")}(i,o,r)}),n.find("node").after("\n"),n.find("node").before("\t\t");var r="\n"+n.html()+"",a={html:r=r.replace(new RegExp("text=","g"),"TEXT=").replace(new RegExp("id=","g"),"ID=").replace(new RegExp("style=","g"),"STYLE=").replace(new RegExp("position=","g"),"POSITION="),type:"mm",name:_()};$(".download-freemind").text("生成中..."),u.download("/api/export/file",a).then(function(){$(".download-freemind").text("FreeMind"),m=!1})}}}.call(t,n,t,e))||(e.exports=i)},123:function(e,t,n){var i;void 0===(i=function(e,t){t.EDITOR_TYPE={OUTLINE:"outline",MINDMAP:"mindmap",PRESENTATION:"presentation"}}.call(t,n,t,e))||(e.exports=i)},13:function(e,t,n){var i;void 0===(i=function(e,t){return{readonly:!1}}.call(t,n,t,e))||(e.exports=i)},133:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(0),o=!1,r="保存到:",a="0";t.setDirLabel=function(e){r=e},t.getDestId=function(){return a},t.load=function(e,t,n){e,o&&t||(o=!0,a="0",e.addClass("folder-selector").empty(),e.append('
'+r+'我的文档
'),i.post("/api/list/get_folder").then(function(t){e.append('
  • 我的文档
');var i={},o=[];$.each(t.data,function(e,t){i[t.id]=t}),$.each(t.data,function(e,t){if("0"==t.folderId)o.push(t);else{var n=i[t.folderId];n&&(n.children||(n.children=[])),n.children.push(t)}}),function t(i){$.each(i,function(i,o){if(n&&o.id==n)return!0;var r=e.find(".folder-"+o.folderId),a=r.children("ul");0==a.length&&(a=$("
    ").appendTo(r));var s=$('
  • ').appendTo(a);s.data("id",o.id),s.find(".item-name").text(o.name),o.children&&s.find(".indent").append(''),o.children&&t(o.children)})}(o),e.find(".expand-arrow").on("click",function(e){e.stopPropagation(),$(this).parent().parent().parent().toggleClass("expand")}),e.find(".item").on("click",function(){var t=$(this),n=t.text();a=t.parent().data("id"),$("#selector-dist").text(n),e.find(".active").removeClass("active"),t.addClass("active")})}))}}.call(t,n,t,e))||(e.exports=i)},14:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(0),o=n(26).getClientVars(),r={level:1,id:""};t.init=function(e){i.post("/api/user/current_level?document_id="+o.document.documentId).then(function(t){r=t.data,e&&e.call()})},t.get=function(){return r},t.isVip=function(){return r.level>0},t.setLevel=function(e){r.level=e}}.call(t,n,t,e))||(e.exports=i)},15:function(e,t,n){var i;void 0===(i=function(){return{desktop:!1,serverHost:""}}.call(t,n,t,e))||(e.exports=i)},16:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forEach=function(e,t){for(var n=0,i=e.length;n0){var o=n[i-1];return o.children||(o.children=[]),o.children.push(t),n.splice(i,1),this.buildMapping(),o}return null},outdentNode:function(e){var t=this;if(t.isRootSubNode(e))return null;var n=t.getParent(e),i=t.getById(e);if(null==n)return null;i.modified=(new Date).getTime(),t.removeNode(n.children,e);var o=t.getParentArray(n.id),r=t.getNodeIndex(n.id);return o.splice(r+1,0,i),t.buildMapping(),n},deleteNode:function(e){if(this.getById(e)){var t=this.getParentArray(e);this.removeNode(t,e),this.buildMapping()}},deleteNodes:function(e){var t=this;$.isArray(e)||(e=[e]),$.each(e,function(e,n){for(var i=t.getParentArray(n),o=0;o=0&&e.splice(n,1)},moveNode:function(e,t,n){var i=this,o=this.getParentArray(e);i.removeNode(o,e);var r=i.getParentArray(t),a=i.getNodeIndexInArray(r,t),s=i.getById(e);"next"==n&&a++,s.modified=(new Date).getTime(),r.splice(a,0,s),i.buildMapping()},moveNodes:function(e,t,n){var i=this;$.each(e,function(e,o){var r=o.id,a=i.getParentArray(r);i.removeNode(a,r);var s=i.getParentArray(t),d=i.getNodeIndexInArray(s,t);"next"==n&&(d=d+e+1),o.modified=(new Date).getTime(),s.splice(d,0,o)}),i.buildMapping()},relocateNode:function(e,t,n){var i,o=this.getById(n);if(e){var r=this.getById(e);if(!r)return;r.children||(r.children=[]),i=r.children}else i=this.define.nodes;o.modified=(new Date).getTime(),i.splice(t,0,o)},update:function(e){var t=this.mapping[e.id].node;t&&($.extend(!0,t,e),e.images?t.images=e.images:delete t.images,e.finish||(t.finish=!1),e.collapsed||(t.collapsed=!1),e.modified=(new Date).getTime(),this.buildMapping())},newId:function(){return i.newId()},isTopLevel:function(e){return null==this.getParent(e)||null!=this.rootNode&&this.rootNode.id==e},isRootNode:function(e){return null!=this.rootNode&&this.rootNode.id==e},isRootSubNode:function(e){var t=this.getParent(e);return null!=this.rootNode?null!=t&&t.id==this.rootNode.id:null==t},getRootSubNodes:function(){var e=this.rootNode;return null==e?this.define.nodes:e.children?e.children:[]},getDir:function(){var e=[],t=this.rootNode;if(null!=t){for(;;){var n=this.getParent(t.id);if(null==n)break;e.push(n),t=n}e.reverse()}return e},getPrevSibling:function(e){var t=this.getNodeIndex(e);if(t>0)return this.getParentArray(e)[t-1]},getNextSibling:function(e){var t=this.getNodeIndex(e),n=this.getParentArray(e);if(t=0&&e.removeAttr("href")})},t.escape=function(e){return e?("string"!=typeof e&&(e+=""),e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")):""}}.call(t,n,t,e))||(e.exports=i)},24:function(e,t,n){var i;void 0===(i=function(e,t){var i,o,r,a=n(7),s=n(37),d=n(5);function l(e,t,n,l){if(d.log("popup_leveltip",{scene:e}),a.onShowLevelTip)a.onShowLevelTip(t);else{void 0===n&&(n=!0),i||(i=$('
    ,请升级到高级版!
    了解详情
    ').appendTo("body"),o=i.children(".message")),$("#level-tip-msg").html(t);var u=$("#level-tip-extend");u.empty(),l&&u.html(l),i.show();var f=-(i.width()/2+7);i.css({left:"50%","margin-left":f+"px"}),i.addClass("visible"),o.find(".detail").off().on("click",function(){c(),n?s.openBuyUpgrade():window.open("/about/pro","_blank")}),i.find(".icon-close").off().on("click",function(){c()}),h(),i.off().on("mouseenter",function(){clearTimeout(r)}).on("mouseleave",h)}function h(){clearTimeout(r),r=setTimeout(function(){c()},5e3)}}function c(){clearTimeout(r),i.removeClass("visible").hide()}t.tipItemCount=function(){l("item_count","您当前帐号为免费版,最多只能创建"+a.freeTopicCount+"条主题,当前文档已经到达上限")},t.tipExportOPML=function(){l("export_opml","您当前帐号为免费版,无法使用导出OPML功能")},t.tipNodeStyle=function(){l("outline_style","您当前帐号为免费版,不能使用标题字号、颜色等高级文档样式")},t.tipTheme=function(){l("mind_theme","您当前帐号为免费版,不能设置思维导图的结构和风格")},t.tipExportMind=function(){l("mind_export","您当前帐号为免费版,无法使用导出思维导图功能")},t.tipViewMind=function(){l("mind_view_theme","您和此文档的作者都是幕布免费版用户,不能切换思维导图的结构和风格",!1,'如果您尚未登录,请先 登录')},t.tipViewExportMind=function(){l("mind_view_export","您和此文档的作者都是幕布免费版用户,无法使用导出思维导图功能",!1,'如果您尚未登录,请先 登录')},t.tipInsertImage=function(){l("insert_image","您当前帐号为免费版,不能添加图片")}}.call(t,n,t,e))||(e.exports=i)},25:function(e,t,n){(function(e){//! moment.js //! version : 2.10.6 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com e.exports=function(){"use strict";var t;function n(){return t.apply(null,arguments)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function o(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var n in t)r(t,n)&&(e[n]=t[n]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function s(e,t,n,i){return Ue(e,t,n,i,!0).utc()}function d(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}),e._pf}function l(e){if(null==e._isValid){var t=d(e);e._isValid=!(isNaN(e._d.getTime())||!(t.overflow<0)||t.empty||t.invalidMonth||t.invalidWeekday||t.nullInput||t.invalidFormat||t.userInvalidated),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function c(e){var t=s(NaN);return null!=e?a(d(t),e):d(t).userInvalidated=!0,t}var u=n.momentProperties=[];function f(e,t){var n,i,o;if(void 0!==t._isAMomentObject&&(e._isAMomentObject=t._isAMomentObject),void 0!==t._i&&(e._i=t._i),void 0!==t._f&&(e._f=t._f),void 0!==t._l&&(e._l=t._l),void 0!==t._strict&&(e._strict=t._strict),void 0!==t._tzm&&(e._tzm=t._tzm),void 0!==t._isUTC&&(e._isUTC=t._isUTC),void 0!==t._offset&&(e._offset=t._offset),void 0!==t._pf&&(e._pf=d(t)),void 0!==t._locale&&(e._locale=t._locale),u.length>0)for(n in u)i=u[n],void 0!==(o=t[i])&&(e[i]=o);return e}var h=!1;function p(e){f(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),!1===h&&(h=!0,n.updateOffset(this),h=!1)}function g(e){return e instanceof p||null!=e&&null!=e._isAMomentObject}function v(e){return e<0?Math.ceil(e):Math.floor(e)}function m(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=v(t)),n}function y(e,t,n){var i,o=Math.min(e.length,t.length),r=Math.abs(e.length-t.length),a=0;for(i=0;i0;){if(i=x(o.slice(0,t).join("-")))return i;if(n&&n.length>=t&&y(o,n,!0)>=t-1)break;t--}r++}return null}(e)}var S={};function $(e,t){var n=e.toLowerCase();S[n]=S[n+"s"]=S[t]=e}function N(e){return"string"==typeof e?S[e]||S[e.toLowerCase()]:void 0}function I(e){var t,n,i={};for(n in e)r(e,n)&&(t=N(n))&&(i[t]=e[n]);return i}function E(e,t){return function(i){return null!=i?(O(this,e,i),n.updateOffset(this,t),this):D(this,e)}}function D(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function O(e,t,n){return e._d["set"+(e._isUTC?"UTC":"")+t](n)}function A(e,t){var n;if("object"==typeof e)for(n in e)this.set(n,e[n]);else if("function"==typeof this[e=N(e)])return this[e](t);return this}function P(e,t,n){var i=""+Math.abs(e),o=t-i.length,r=e>=0;return(r?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+i}var L=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Y={},B={};function U(e,t,n,i){var o=i;"string"==typeof i&&(o=function(){return this[i]()}),e&&(B[e]=o),t&&(B[t[0]]=function(){return P(o.apply(this,arguments),t[1],t[2])}),n&&(B[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function z(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function j(e,t){return e.isValid()?(t=G(t,e.localeData()),Y[t]=Y[t]||function(e){var t,n,i=e.match(L);for(t=0,n=i.length;t=0&&R.test(e);)e=e.replace(R,i),R.lastIndex=0,n-=1;return e}var W=/\d/,H=/\d\d/,F=/\d{3}/,q=/\d{4}/,Z=/[+-]?\d{6}/,J=/\d\d?/,V=/\d{1,3}/,K=/\d{1,4}/,Q=/[+-]?\d{1,6}/,X=/\d+/,ee=/[+-]?\d+/,te=/Z|[+-]\d\d:?\d\d/gi,ne=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,ie={};function oe(e,t,n){ie[e]=function(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}(t)?t:function(e){return e&&n?n:t}}function re(e,t){return r(ie,e)?ie[e](t._strict,t._locale):new RegExp(function(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,o){return t||n||i||o}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e))}var ae={};function se(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(i=function(e,n){n[t]=m(e)}),n=0;n11?ue:n[fe]<1||n[fe]>me(n[ce],n[ue])?fe:n[he]<0||n[he]>24||24===n[he]&&(0!==n[pe]||0!==n[ge]||0!==n[ve])?he:n[pe]<0||n[pe]>59?pe:n[ge]<0||n[ge]>59?ge:n[ve]<0||n[ve]>999?ve:-1,d(e)._overflowDayOfYear&&(tfe)&&(t=fe),d(e).overflow=t),e}function xe(e){!1===n.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function Te(e,t){var n=!0;return a(function(){return n&&(xe(e+"\n"+(new Error).stack),n=!1),t.apply(this,arguments)},t)}var ke={};n.suppressDeprecationWarnings=!1;var Me=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Se=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],$e=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],Ne=/^\/?Date\((\-?\d+)/i;function Ie(e){var t,n,i=e._i,o=Me.exec(i);if(o){for(d(e).iso=!0,t=0,n=Se.length;t68?1900:2e3)};var Ae=E("FullYear",!1);function Pe(e,t,n){var i,o=n-t,r=n-e.day();return r>o&&(r-=7),r0?e:e-1,dayOfYear:r>0?r:De(e-1)+r}}(n,i,o,a,r),e._a[ce]=s.year,e._dayOfYear=s.dayOfYear}(e),e._dayOfYear&&(o=Le(e._a[ce],i[ce]),e._dayOfYear>De(o)&&(d(e)._overflowDayOfYear=!0),n=Ee(o,0,e._dayOfYear),e._a[ue]=n.getUTCMonth(),e._a[fe]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=r[t]=i[t];for(;t<7;t++)e._a[t]=r[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[he]&&0===e._a[pe]&&0===e._a[ge]&&0===e._a[ve]&&(e._nextDay=!0,e._a[he]=0),e._d=(e._useUTC?Ee:function(e,t,n,i,o,r,a){var s=new Date(e,t,n,i,o,r,a);return e<1970&&s.setFullYear(e),s}).apply(null,r),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[he]=24)}}function Ye(e){if(e._f!==n.ISO_8601){e._a=[],d(e).empty=!0;var t,i,o,r,a,s=""+e._i,l=s.length,c=0;for(o=G(e._f,e._locale).match(L)||[],t=0;t0&&d(e).unusedInput.push(a),s=s.slice(s.indexOf(i)+i.length),c+=i.length),B[r]?(i?d(e).empty=!1:d(e).unusedTokens.push(r),le(r,i,e)):e._strict&&!i&&d(e).unusedTokens.push(r);d(e).charsLeftOver=l-c,s.length>0&&d(e).unusedInput.push(s),!0===d(e).bigHour&&e._a[he]<=12&&e._a[he]>0&&(d(e).bigHour=void 0),e._a[he]=function(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[he],e._meridiem),Re(e),Ce(e)}else Ie(e)}function Be(e){var t=e._i,r=e._f;return e._locale=e._locale||M(e._l),null===t||void 0===r&&""===t?c({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),g(t)?new p(Ce(t)):(i(r)?function(e){var t,n,i,o,r;if(0===e._f.length)return d(e).invalidFormat=!0,void(e._d=new Date(NaN));for(o=0;othis?this:e});function We(e,t){var n,o;if(1===t.length&&i(t[0])&&(t=t[0]),!t.length)return ze();for(n=t[0],o=1;o+(e=g(e)?e:ze(e)):(g(e)?+e:+ze(e))<+this.clone().startOf(t)},Mt.isBefore=function(e,t){var n;return"millisecond"===(t=N(void 0!==t?t:"millisecond"))?+this<+(e=g(e)?e:ze(e)):(n=g(e)?+e:+ze(e),+this.clone().endOf(t)this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},Mt.isDSTShifted=function(){if(void 0!==this._isDSTShifted)return this._isDSTShifted;var e={};if(f(e,this),(e=Be(e))._a){var t=e._isUTC?s(e._a):ze(e._a);this._isDSTShifted=this.isValid()&&y(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted},Mt.isLocal=function(){return!this._isUTC},Mt.isUtcOffset=function(){return this._isUTC},Mt.isUtc=Qe,Mt.isUTC=Qe,Mt.zoneAbbr=function(){return this._isUTC?"UTC":""},Mt.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},Mt.dates=Te("dates accessor is deprecated. Use date instead.",pt),Mt.months=Te("months accessor is deprecated. Use month instead",be),Mt.years=Te("years accessor is deprecated. Use year instead",Ae),Mt.zone=Te("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()});var St=Mt;function $t(e){return e}var Nt=w.prototype;function It(e,t,n,i){var o=M(),r=s().set(i,t);return o[n](r,e)}function Et(e,t,n,i,o){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return It(e,t,n,o);var r,a=[];for(r=0;r0?"future":"past"];return"function"==typeof n?n(t):n.replace(/%s/i,t)},Nt.set=function(e){var t,n;for(n in e)"function"==typeof(t=e[n])?this[n]=t:this["_"+n]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},Nt.months=function(e){return this._months[e.month()]},Nt._months=ye,Nt.monthsShort=function(e){return this._monthsShort[e.month()]},Nt._monthsShort=we,Nt.monthsParse=function(e,t,n){var i,o,r;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(o=s([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(r="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[i]=new RegExp(r.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},Nt.week=function(e){return Pe(e,this._week.dow,this._week.doy).week},Nt._week={dow:0,doy:6},Nt.firstDayOfYear=function(){return this._week.doy},Nt.firstDayOfWeek=function(){return this._week.dow},Nt.weekdays=function(e){return this._weekdays[e.day()]},Nt._weekdays=gt,Nt.weekdaysMin=function(e){return this._weekdaysMin[e.day()]},Nt._weekdaysMin=mt,Nt.weekdaysShort=function(e){return this._weekdaysShort[e.day()]},Nt._weekdaysShort=vt,Nt.weekdaysParse=function(e){var t,n,i;for(this._weekdaysParse=this._weekdaysParse||[],t=0;t<7;t++)if(this._weekdaysParse[t]||(n=ze([2e3,1]).day(t),i="^"+this.weekdays(n,"")+"|^"+this.weekdaysShort(n,"")+"|^"+this.weekdaysMin(n,""),this._weekdaysParse[t]=new RegExp(i.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t},Nt.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},Nt._meridiemParse=/[ap]\.?m?\.?/i,Nt.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},T("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===m(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),n.lang=Te("moment.lang is deprecated. Use moment.locale instead.",T),n.langData=Te("moment.langData is deprecated. Use moment.localeData instead.",M);var Dt=Math.abs;function Ot(e,t,n,i){var o=tt(t,n);return e._milliseconds+=i*o._milliseconds,e._days+=i*o._days,e._months+=i*o._months,e._bubble()}function At(e){return e<0?Math.floor(e):Math.ceil(e)}function Pt(e){return 4800*e/146097}function Lt(e){return 146097*e/4800}function Rt(e){return function(){return this.as(e)}}var Yt=Rt("ms"),Bt=Rt("s"),Ut=Rt("m"),zt=Rt("h"),jt=Rt("d"),Gt=Rt("w"),Wt=Rt("M"),Ht=Rt("y");function Ft(e){return function(){return this._data[e]}}var qt=Ft("milliseconds"),Zt=Ft("seconds"),Jt=Ft("minutes"),Vt=Ft("hours"),Kt=Ft("days"),Qt=Ft("months"),Xt=Ft("years"),en=Math.round,tn={s:45,m:45,h:22,d:26,M:11},nn=Math.abs;function on(){var e,t,n=nn(this._milliseconds)/1e3,i=nn(this._days),o=nn(this._months);e=v(n/60),t=v(e/60),n%=60,e%=60;var r=v(o/12),a=o%=12,s=i,d=t,l=e,c=n,u=this.asSeconds();return u?(u<0?"-":"")+"P"+(r?r+"Y":"")+(a?a+"M":"")+(s?s+"D":"")+(d||l||c?"T":"")+(d?d+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var rn=He.prototype;return rn.abs=function(){var e=this._data;return this._milliseconds=Dt(this._milliseconds),this._days=Dt(this._days),this._months=Dt(this._months),e.milliseconds=Dt(e.milliseconds),e.seconds=Dt(e.seconds),e.minutes=Dt(e.minutes),e.hours=Dt(e.hours),e.months=Dt(e.months),e.years=Dt(e.years),this},rn.add=function(e,t){return Ot(this,e,t,1)},rn.subtract=function(e,t){return Ot(this,e,t,-1)},rn.as=function(e){var t,n,i=this._milliseconds;if("month"===(e=N(e))||"year"===e)return t=this._days+i/864e5,n=this._months+Pt(t),"month"===e?n:n/12;switch(t=this._days+Math.round(Lt(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},rn.asMilliseconds=Yt,rn.asSeconds=Bt,rn.asMinutes=Ut,rn.asHours=zt,rn.asDays=jt,rn.asWeeks=Gt,rn.asMonths=Wt,rn.asYears=Ht,rn.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)},rn._bubble=function(){var e,t,n,i,o,r=this._milliseconds,a=this._days,s=this._months,d=this._data;return r>=0&&a>=0&&s>=0||r<=0&&a<=0&&s<=0||(r+=864e5*At(Lt(s)+a),a=0,s=0),d.milliseconds=r%1e3,e=v(r/1e3),d.seconds=e%60,t=v(e/60),d.minutes=t%60,n=v(t/60),d.hours=n%24,a+=v(n/24),o=v(Pt(a)),s+=o,a-=At(Lt(o)),i=v(s/12),s%=12,d.days=a,d.months=s,d.years=i,this},rn.get=function(e){return this[(e=N(e))+"s"]()},rn.milliseconds=qt,rn.seconds=Zt,rn.minutes=Jt,rn.hours=Vt,rn.days=Kt,rn.weeks=function(){return v(this.days()/7)},rn.months=Qt,rn.years=Xt,rn.humanize=function(e){var t=this.localeData(),n=function(e,t,n){var i=tt(e).abs(),o=en(i.as("s")),r=en(i.as("m")),a=en(i.as("h")),s=en(i.as("d")),d=en(i.as("M")),l=en(i.as("y")),c=o0,c[4]=n,function(e,t,n,i,o){return o.relativeTime(t||1,!!n,e,i)}.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},rn.toISOString=on,rn.toString=on,rn.toJSON=on,rn.locale=lt,rn.localeData=ut,rn.toIsoString=Te("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",on),rn.lang=ct,U("X",0,0,"unix"),U("x",0,0,"valueOf"),oe("x",ee),oe("X",/[+-]?\d+(\.\d{1,3})?/),se("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),se("x",function(e,t,n){n._d=new Date(m(e))}),n.version="2.10.6",function(e){t=e}(ze),n.fn=St,n.min=function(){return We("isBefore",[].slice.call(arguments,0))},n.max=function(){return We("isAfter",[].slice.call(arguments,0))},n.utc=s,n.unix=function(e){return ze(1e3*e)},n.months=function(e,t){return Et(e,t,"months",12,"month")},n.isDate=o,n.locale=T,n.invalid=c,n.duration=tt,n.isMoment=g,n.weekdays=function(e,t){return Et(e,t,"weekdays",7,"day")},n.parseZone=function(){return ze.apply(null,arguments).parseZone()},n.localeData=M,n.isDuration=Fe,n.monthsShort=function(e,t){return Et(e,t,"monthsShort",12,"month")},n.weekdaysMin=function(e,t){return Et(e,t,"weekdaysMin",7,"day")},n.defineLocale=k,n.weekdaysShort=function(e,t){return Et(e,t,"weekdaysShort",7,"day")},n.normalizeUnits=N,n.relativeTimeThreshold=function(e,t){return void 0!==tn[e]&&(void 0===t?tn[e]:(tn[e]=t,!0))},n}()}).call(this,n(27)(e))},256:function(e,t,n){var i;void 0===(i=function(e,t){var i,o=n(121),r=n(12),a=n(87),s=n(120),d=n(0),l=n(11),c=n(4),u=n(133),f=n(24),h=n(25),p=n(257),g=(n(39),n(205)),v=n(123),m=n(30),y=!1,w={nodes:[]},_=v.EDITOR_TYPE,b=_.OUTLINE;!function(){var e=$(".view-shortcuts .menu ul"),t=$("#toolbar-expand-collapse .mobile-more-info");[{title:"全部",shortcuts:[r.metaKeyText,r.optionKeyText,r.shiftKeyText,"."],onClick:function(){o.toggleExpandAll()}},{title:"第一级",shortcuts:[r.metaKeyText,r.optionKeyText,"1"],onClick:function(){o.toggleExpandToLevel(0)}},{title:"第二级",shortcuts:[r.metaKeyText,r.optionKeyText,"2"],onClick:function(){o.toggleExpandToLevel(1)}},{title:"第三级",shortcuts:[r.metaKeyText,r.optionKeyText,"3"],onClick:function(){o.toggleExpandToLevel(2)}}].forEach(function(n){if(e.length>0){var i=$('
  • ');i.on("click",n.onClick),i.text(n.title),i.tooltip({position:"right",title:n.shortcuts.join(" + ")}),i.appendTo(e)}if(t.length>0){var o=$("
    ");o.text(n.title),o.on("click",n.onClick),o.appendTo(t)}}),$("#toolbar-expand-collapse").on("click",function(e){e.stopPropagation(),t.hasClass("info-hide")?(T(),t.removeClass("info-hide")):T()}),$(".view-shortcuts").dropdown({position:"center",side:"bottom",width:100})}(),d.post("/api/document/view/get",{docId:docId}).then(function(e){var t=e.data;t.definition&&(w=l.parse(t.definition));var n=$("#demo-screen");i=t.name,o.open(w,n,i),function(){var e=$(".view-header");if(c.isLark()){var t=$('');e.prepend(t),t.on("click",function(){history.back()})}else e.find(".site").show(),r.isMobile||e.find(".view-nav").show();$("#toolbar-mind").on("click",function(){M()}),$("#toolbar-play").on("click",function(){S()});var n=$(window).width()<360?320:360,i=$("#save-doc");i.click(function(e){e.stopPropagation()}),i.dropdown({width:n,offsetY:11,position:"right",onDrop:function(){var e=$(".folder-selector");u.setDirLabel("保存到:"),u.load(e,!0),c.isMobile()&&i.find(".menu").addClass("menu-mobile")}}),$("#edit-it").on("click",function(){window.location.href="/edit/"+docId}),$("#cancel-btn").on("click",function(){$("#save-doc").dropdown("close")}),$("#save-btn").on("click",function(){$("#save-doc").dropdown("close"),d.post("/api/list/copy_doc_to",{docId:docId,targetId:u.getDestId()}).then(function(e){$("#save-view-btn").off().on("click",function(){localStorage&&(localStorage.share_save_highlight=e.data.id),window.location.href="/list#"+e.data.folderId}),$("#save-result").dlg()}),m.collectEvent("contentpage_preserve_click")})}()}),$("#toolbar-share").on("click",function(){var e=window.location.href,t="分享一篇幕布精选文档:"+i+",快来看看吧";try{if(window.isApp)return void g.postMessage({action:"share-page",data:{url:e,title:i,message:t}})}catch(e){return void $.alert(e)}var n=encodeURIComponent(t),o=encodeURIComponent(e),r=$("");r.attr("src","/qrcode/service?data="+e+"&size=130"),$("#share-qrcode").empty().append(r);var a="http://service.weibo.com/share/share.php?title="+n+"&url="+o+"&ralateUid=5876121761";$("#share-weibo").attr("href",a);var s="http://connect.qq.com/widget/shareqq/index.html?url="+o+"&desc="+n+"&summary=&title="+n+"&site=https://mubu.com";$("#share-qq").attr("href",s);var d="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?desc=&title="+n+"&url="+o+"&summary=";$("#share-qzone").attr("href",d),$("#explore-share").dlg(),m.collectEvent("contentpage_share_click")}),$("#login-save-btn").attr("href","/login?next="+document.URL),s.initPreview();var C=$(window);function x(){$(".author-more-info").css("height","0px"),$(".mask-author").hide()}function T(){$(".mobile-more-info").addClass("info-hide")}C.on("resize",function(){$(".view-info").css("left",(C.width()+$("#paper").outerWidth())/2+25).show();C.height(),$(".view-header").height();$(".comment-wrapper").height(C.height()-$("#comment-title").outerHeight());var e=$(window).width()-$("#space-ruler").width();$("#comment-op").css("right",e)}).trigger("resize"),c.isMobile()||($(".view-header").find(".operate").tooltip(),a.init({onSettingChanged:function(e,t){return 0==viewLevel?(f.tipViewMind(),$(".mind-panel").hide(),$(".menu-list").find(".active").removeClass("active"),!1):(w[e]=t,!0)},onExport:function(){return 0!=viewLevel||(f.tipViewExportMind(),$(".mind-panel").hide(),$(".menu-list").find(".active").removeClass("active"),!1)}})),$("#menu-info").on("click",function(e){e.stopPropagation();var t=$("#menu-info .mobile-more-info");t.hasClass("info-hide")?(T(),t.removeClass("info-hide")):T()});var k=1;function M(){b=_.MINDMAP,a.open(w,i,o.getRootId()),a.eventEmitter.one("exit",function(){b=_.OUTLINE})}function S(){b=_.PRESENTATION,o.readingPlay(),o.eventEmitter.one("exit",function(){b=_.OUTLINE})}$(".author-btn").on("click",function(e){return e.stopPropagation(),$(".mask-author").show(),$(".author-more-info").css("height","150px"),T(),k=0}),$("#close-author").on("click",function(e){return e.stopPropagation(),x(),k=1}),$(".mask-author").on("click",function(){return x(),k=1}),document.addEventListener("touchmove",function(e){"0px"!=$(".author-more-info").css("height")&&0==k&&(e.preventDefault(),e.stopPropagation())},{passive:!1}),$(document).on("click",function(){T(),x()}),$(document).on("keydown",function(e){var t=e.keyCode;if(b===_.OUTLINE)if(t>=49&&t<=52&&e[r.metaKey]&&e.altKey){e.preventDefault();var n=t-49;n>=3&&(n=0),o.toggleExpandToLevel(n)}else(190==t||229==t||110==t)&&e[r.metaKey]&&e.altKey&&e.shiftKey?(o.toggleExpandAll(),e.preventDefault()):77===t&&e[r.metaKey]&&e.altKey&&e.shiftKey?(e.preventDefault(),M()):80===t&&e[r.metaKey]&&e.altKey&&e.shiftKey?(e.preventDefault(),S()):78===t&&e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),o.drillToNextSibling()):80===t&&e.ctrlKey&&e.shiftKey&&!e.metaKey&&!e.altKey&&(e.preventDefault(),o.drillToPrevSibling())}),$("#doc-praise").on("click",function(){y||(y=!0,d.post("/api/community/praise",{documentId:docId}).then(function(e){var t=$("#doc-praise-count");$(".icon-praise").toggleClass("praise-true"),e.data.result,t.text(e.data.praiseCount),$("#doc-praise").find(".operate-icon").toggleClass("active")}).always(function(){y=!1}))}),$("#doc-collect").on("click",function(e){e.stopPropagation(),y||(y=!0,d.post("/api/collect/user_collect",{documentId:docId}).then(function(e){$("#doc-collect i").hasClass("icon-heart")?($("#doc-collect i").removeClass("icon-heart").addClass("icon-heart-o"),$("#doc-collect .more-info-span").text("收藏")):($("#doc-collect i").removeClass("icon-heart-o").addClass("icon-heart"),$("#doc-collect .more-info-span").text("已收藏"));var t=$("#doc-collect-count");e.data.collect,t.text(e.data.collectCount),$("#doc-collect").find(".operate-icon").toggleClass("active")}).always(function(){y=!1}),m.collectEvent("contentpage_collect_click"))}),$("#edit-doc").on("click",function(){d.post("/api/collaborate/join_edit",{documentId:docId}).then(function(e){window.location=e.data.next})}),$("#complaint-label").on("click",function(){$("#complaints-dialog").dlg(),$("#comp-document-link").val(document.URL),$("#complaints-save-btn").off().on("click",function(){var e=$("#comp-document-link").val(),t=$("#comp-phone").val(),n=$("#comp-qq-mail").val(),i=$("#comp-summary").val();d.post("/api/document/complaint/add",{documentId:docId,documentLink:e,userPhone:t,userQQMail:n,content:i}).then(function(e){$("#complaints-dialog").dlg("close"),$.alert("举报成功!感谢您的支持。
    我们会认真核查相关信息,共同维护绿色、健康的网络环境。")})})});var N=1;function I(e,t){e||(e=1),N=e;var n=$("#comment-content");t&&n.html('

    加载中...

    '),d.post("/api/community/get_comment",{viewToken:viewToken,page:N,targetId:docId}).then(function(e){var t=$("#comment-more");N")}else i=$('

    '+(t.userName?t.userName[0]:"")+"

    ");var r=$('
    ');$('
    ').appendTo(r).append(i);var a='
    回复
    '+h(t.createTime).format("YYYY-MM-DD HH:mm")+"
    ",s=$(a).appendTo(r);s.find(".name").text(t.userName);var d=s.find(".comment-content");if(d.text(t.content),t.replyUserId){var l=$('
    ');d.before(l),l.find(".reply-name").text(t.replyUserName),$("
    ").appendTo(l).text(t.replyContent)}n.append(r)}),$(".comment-reply").off().on("click",function(){var e=$(this),t=$("#reply-comment");$("#comment-reply").dlg(),$("#reply-comment").val("").focus();var n=e.siblings(".name").text();t.attr("placeholder","回复"+n+":"),$("#comment-reply-submit").off().on("click",function(){var n=t.val().trim(),i=$(this);"提交中..."!=i.text()&&(n?(i.text("提交中..."),d.post("/api/community/add_reply_comment",{commentId:e.attr("comment-id"),replyContent:n}).then(function(){I(1,!1),$("#reply-comment").val(""),$.toast("回复成功!"),$("#comment-reply").dlg("close")}).always(function(){i.text("发表")})):(t.focus(),$.toast("回复内容不能为空哦,快去写点东西吧")))})})):n.html('

    暂时没有评论

    ')})}$("#comment-submit").on("click",function(){var e=$("#comment-info").val().trim(),t=$(this);"提交中..."!=t.text()&&(e?(t.text("提交中..."),d.post("/api/community/add_comment",{targetId:docId,content:e}).then(function(){I(1,!1),$("#comment-info").val(""),$.toast("发表成功!")}).always(function(){t.text("发表评论")})):($("#comment-info").focus(),$.toast("评论内容不能为空哦,快去写点东西吧")))}),$("#comment-news").on("click",function(e){e.stopPropagation(),x();var t=$("#explore-comment");return t.toggleClass("on"),t.hasClass("on")&&(I(1,!0),t.on("click",function(e){e.stopPropagation()})),$("#comment-more").off().on("click",function(){I(++N,!1)}),$("#close-comment-list").off().on("click",function(){t.removeClass("on")}),k=1}),"undefined"!=typeof authorId&&(p.init($(".author-info"),authorId),$(".author-info").on("click",function(e){return e.stopPropagation(),x(),k=1})),localStorage&&localStorage.mindViewTip||(localStorage&&(localStorage.mindViewTip=!0),setTimeout(function(){$(".feature-tip").remove();var e=$('
    点击这里可以查看思维导图
    ');$("#toolbar-mind").append(e),e.fadeIn(),setTimeout(function(){e.fadeOut()},8e3),$(document).on("click.tip",function(){$(document).off("click.tip"),e.remove()})},1500)),$("#link-download-app").on("click",function(){m.collectEvent("contentpage_download_click")})}.call(t,n,t,e))||(e.exports=i)},257:function(e,t,n){var i,o=n(0),r=n(25);void 0===(i=function(e,t){t.init=function(e,t){e.off().on("click",function(e){!function(e){o.post("/api/community/get_user_home_page",{userId:e}).then(function(e){var t=e.data,n='

    '+t.name[0]+"

    ";t.photo&&(n="");var i=$.parseHTML('
    '+n+'
    • 精选作品
      '+t.documentCount+"
    • 收获赞
      "+t.praiseSum+"
    • 总阅读
      "+t.readSum+"
    • 总收藏
      "+t.collectCount+"
    "),o=$("#personal-info").find(".header");o.empty().append(i),o.find(".user-name").text(t.name)}),o.post("/api/community/get_user_community_document",{userId:e}).then(function(e){if($(".list-container").html('
    加载中...
    '),e.data&&e.data.length>0){var t=$(".list-container").empty();$.each(e.data,function(e,n){var i=$('
    • 赞 '+n.praiseCount+"
    • 阅读 "+n.viewCount+"
    • 评论 "+n.commentCount+'
    • '+r(n.submitTime).format("YYYY-MM-DD HH:mm")+"
  • ");i.find(".describe").text(n.summary),i.find(".title").text(n.title),t.append(i)})}else $(".list-container").html('
    暂时没有精选作品
    ');$(".info-praise").off().on("click",function(){var e=$(this);o.post("/api/community/praise",{documentId:e.attr("data-id")}).then(function(t){t.data.result,e.text("赞 "+t.data.praiseCount)})})})}(t),e.stopPropagation();var n=$("#personal-info");n.addClass("on"),n.on("click",function(e){e.stopPropagation()}),n.hasClass("on")&&$(document).on("click.hide-info",function(){n.removeClass("on"),$(document).off("click.hide-info")})}),$(".info-close").off().on("click",function(){$("#personal-info").removeClass("on")})}}.call(t,n,t,e))||(e.exports=i)},26:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={document:Object.freeze(window.doc||{}),user:Object.freeze(window.user||{}),ws:Object.freeze(window.ws||{})};t.getClientVars=function(){return i},t.getAssetPath=function(){return window.asset_origin},t.getCdnPath=function(){return window.cdn_origin},t.getCurrentEnv=function(){return window.env}},27:function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},3:function(e,t,n){var i;void 0===(i=function(e,t){var n=0,i=0;t.newId=function(){var e=(new Date).getTime(),t=.1*Math.random()+e,o=Math.round(1e3*Math.random()).toString(16)+t.toString(16).replace(".","");return n==e?o+=++i:(n=e,i=0),o},t.recursive=function(e,t){if(e)for(var n=function(e,i,o,r,a){if($.isArray(e))for(var s=0;s0)for(var d=0;d=0&&e.splice(n,1)},t.compareArray=function(e,t){if(e.length!=t.length)return!1;for(var n=0;n0},t.moveCursorEnd=function(e){if(this.focus(e),""!=e.text()){var t=e[0];if(window.getSelection){var n=e.text().length;this.setCursorPosition(e,{start:n,end:n})}else if(document.selection){var i=document.selection.createRange();i.moveToElementText(t),i.collapse(!1),i.select()}}},t.getTextNodes=function(e){var t=[];return function e(n){for(var i=0;i0&&e(o.childNodes)}}((e=e[0]).childNodes),t},t.setCursorPosition=function(e,t){if(this.focus(e),""!=e.text()&&t){var n=this.getTextNodes(e);if(window.getSelection){for(var i,o,r,a,s=0,d=0;d=s&&t.start<=s+c&&(i=l,r=t.start-s,!t.end))break;if(t.end&&t.end>=s&&t.end<=s+c){o=l,a=t.end-s;break}s+=c}if(i||o){var u=document.createRange();i&&u.setStart(i,r),o&&u.setEnd(o,a);var f=window.getSelection();f.removeAllRanges(),f.addRange(u)}}}},t.getCursorPosition=function(){var e={start:0,end:0},t=window.getSelection();if(0==t.rangeCount)return e;var n,i=t.getRangeAt(0),o=i.startContainer,r=$(o);if(0==(n=r.is("div[contenteditable]")?r:r.parents("div[contenteditable]")).length)return e;var a=i.cloneRange();return a.selectNodeContents(n[0]),a.setEnd(i.startContainer,i.startOffset),e.start=a.toString().length,a.setEnd(i.endContainer,i.endOffset),e.end=a.toString().length,e},t.getRange=function(){return window.getSelection().getRangeAt(0)},t.focus=function(e){if(navigator.platform){var t=navigator.platform.toLowerCase();if("iphone"==t||"ipad"==t){e.length||(e=$(e));var n=document.createRange();n.setStart(e[0],0);var i=window.getSelection();return i.removeAllRanges(),void i.addRange(n)}}e.focus()},t.getContentById=function(e){return $("#"+e).children(".content-wrapper").children(".content")},t.getContentByNode=function(e){return e.children(".content-wrapper").children(".content")},t.getNodeContainer=function(e){return $("#"+e)},t.removeSelection=function(){document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges()},t.htmlToText=function(e){var t=$.parseHTML("
    ");return(t=t[0]).innerHTML=e,t.innerText},t.formatTime=function(e){var t=new Date(e),n=t.getMonth()+1;n<10&&(n="0"+n);var i=t.getDate();i<10&&(i="0"+i);var o=t.getHours();o<10&&(o="0"+o);var r=t.getMinutes();return r<10&&(r="0"+r),t.getFullYear()+"-"+n+"-"+i+" "+o+":"+r},t.dataURItoBlob=function(e){for(var t,n=atob(e.split(",")[1]),i=new ArrayBuffer(n.length),o=new Uint8Array(i),r=0;r=n.x&&e<=n.x+n.w&&t>=n.y&&t<=n.y+n.h},t.countNodeWords=function(e,t){var n={wordCount:0,nodeCount:0},i=this,o="";function r(e){o+=i.htmlToText(e.text)+",",e.note&&(o+=i.htmlToText(e.note)+","),n.nodeCount++}return t?i.recursive(e,function(e){r(e)}):$.each(e,function(e,t){r(t)}),n.wordCount=this.textCount(o),n},t.textCount=function(e){e=(e=e.replace(/[\~|\`|\!|\@|\#|\$|\%|\^|\&|\*|\(|\)|\-|\_|\+|\=|\||\\|\[|\]|\{|\}|\;|\:|\"|\'|\,|\<|\.|\>|\/|\?]{2,}/,",")).replace(/[ ]/g,",");for(var t=new RegExp("[`~!$*^()=|{}:;,\\[\\]<>/?~!@#¥&()——|{}……【】·;:”“。,、_?% % 「」『』]"),n="",i=0;i'+e+"").appendTo("body");o.css({position:"fixed",left:-500,top:-100});var r=document.createRange();r.selectNodeContents(o[0]);var a=window.getSelection();a.removeAllRanges(),a.addRange(r);try{i=document.execCommand("copy")}catch(e){i=!1}window.getSelection().removeAllRanges(),o.remove()}i?t():n()},t.parse=function(e){return 0==e.indexOf("mubu_clipboard:")?i.parse(e.substring(15)):null},t.isMubuClipboardText=function(e){return e&&0==e.indexOf("mubu_clipboard:")}}.call(t,n,t,e))||(e.exports=i)},32:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(21),o=n(3),r=n(44),a=n(69),s=n(24),d=n(14),l=n(7),c=n(60),u=n(12),f=n(61),h=n(13),p=n(94),g=n(5),v=n(62),m=n(23),y={paper:$("#paper"),wrapper:$("#node-wrapper"),name:"",open:function(e,t){t&&this.setName(t);var n=e.nodes;i.setDefine(e),r.setEngine(this),r.setNodes(n),this.painter.renderPaper(),u.isMobile||$(".paper-name").find("input").focus(),r.trigger("opened"),g.log("client_file_open")},getNode:function(e){return i.getById(e)},allowCreateNew:function(e){if(!d.isVip()&&i.getCount()+e>l.freeTopicCount)return s.tipItemCount(),!1;return!0},createPrevious:function(e,t,n){if(this.allowCreateNew(1)){var a=i.getById(e),s={cursor:{id:e,position:o.getCursorPosition()}};t&&(a.text=t,i.update(a),s.updated=[a]);var d=i.createPrevious(e,n);this.painter.renderPrevious(e,d),o.getContentById(e).html(t),n?o.focus(o.getContentById(e)):o.moveCursorEnd(o.getContentById(d.id)),s.created=[d],r.trigger("created",s)}},createNext:function(e){if(this.allowCreateNew(1)){var t,n=this.getRootNode();if(n&&e==n.id)t=i.createChild(e),this.painter.renderFirstChild(e,t);else{var a=i.getById(e);if(!o.htmlToText(a.text)&&!i.isRootSubNode(e)&&!i.getNextSibling(e))return void this.outdentNode(e);!a.collapsed&&o.hasChildren(a)?(t=i.createChild(e),this.painter.renderFirstChild(e,t)):(t=i.createNext(e),this.painter.renderNext(e,t))}var s=o.getContentById(t.id);o.focus(s);var d={cursor:{id:e,position:o.getCursorPosition()},created:[t]};r.trigger("created",d)}},createRootNext:function(){var e=i.createFirstChild();this.painter.renderNode(e,!1),o.focus(o.getContentById(e.id));var t={created:[e]};r.trigger("created",t)},appendNextNodes:function(e,t){if(0!=t.length){var n=this,a=[],s=i.getById(e);if(o.recursive(t,function(e){e.id=i.newId(),a.push(e)}),n.allowCreateNew(a.length)){var d={created:a};if(i.isRootNode(e)||s.children&&s.children.length>0)i.prependChildren(e,t),n.painter.renderChildren(e);else{if(""==o.htmlToText(s.text)&&!s.note){var l=t[0];l.id=e,i.update(l),n.painter.refreshNode(l),n.painter.renderChildren(l.id),d.updated=[l],t.splice(0,1),a.splice(0,1)}i.appendAfter(e,t);for(var c=e,u=0;u').appendTo(a)),o.getNodeContainer(e).appendTo(d);var l=o.getContentById(e);o.setCursorPosition(l,n);var c=i.getById(e);s.changed=[c],s.cursor={id:e,position:n},r.trigger("structureChanged",s),g.logOperate("tab")}},indentNodes:function(e){var t={updated:[],changed:[]};$.each(e,function(e,n){var r=n.id,a=i.indentNode(r);if(null!=a){var s=o.getNodeContainer(a.id);a.collapsed&&(a.collapsed=!1,s.removeClass("collapsed"),t.updated.push(a));var d=s.children(".children");0==d.length&&(d=$('
    ').appendTo(s)),o.getNodeContainer(r).appendTo(d),t.changed.push(n)}}),t.changed.length>0&&(r.trigger("structureChanged",t),g.logOperate("tab"))},outdentNode:function(e){var t=i.outdentNode(e);if(null!=t){var n=o.getCursorPosition(),a=o.getNodeContainer(t.id),s=o.getNodeContainer(e);a.after(s);var d=o.getContentById(e);o.setCursorPosition(d,n);var l={changed:[i.getById(e)],cursor:{id:e,position:n}};r.trigger("structureChanged",l),g.logOperate("shift-tab")}},outdentNodes:function(e){for(var t={changed:[]},n=e.length-1;n>=0;){var a=e[n],s=a.id,d=i.outdentNode(s);if(null!=d){var l=o.getNodeContainer(d.id),c=o.getNodeContainer(s);l.after(c),t.changed.splice(0,0,a)}n--}t.changed.length>0&&(r.trigger("structureChanged",t),g.logOperate("shift-tab"))},moveNode:function(e,t,n){var a=o.getNodeContainer(e);"prev"==n?o.getNodeContainer(t).before(a):o.getNodeContainer(t).after(a),i.moveNode(e,t,n),o.focus(o.getContentById(e));var s={changed:[i.getById(e)]};r.trigger("structureChanged",s),g.logOperate("move_item")},moveNodes:function(e,t,n){var a=o.getNodeContainer(t);if("prev"==n)for(var s=0;s=0;){d=e[s],l=o.getNodeContainer(d.id);a.after(l),s--}i.moveNodes(e,t,n);var c={changed:e};r.trigger("structureChanged",c),g.logOperate("move_item")},getPrevNodeId:function(e){var t,n=o.getNodeContainer(e).prev(".node");if(n.length>0)t=n.find(".content:visible:last").data("id");else if(!i.isRootNode(e)){var r=i.getParent(e);null!=r&&(t=r.id)}return t},toPrevNode:function(e,t){var n,i=this.getPrevNodeId(e);i&&(n=o.getContentById(i),t?o.moveCursorEnd(n):0==o.getCursorPosition().start?o.setCursorPosition(n,{start:0}):o.moveCursorEnd(n));return n},moveNodePrev:function(e){var t=this.getPrevNodeId(e);t&&!i.isRootNode(t)&&this.moveNode(e,t,"prev")},getNextNodeId:function(e,t){var n,r=o.getNodeContainer(e),a=null;if(t||(a=r.find(".node:visible:eq(0)")),null!=a&&0!=a.length||(a=r.next(".node:visible")),null==a||a.length>0)n=a.attr("id");else for(var s=e;;){var d=i.getParent(s);if(null==d)break;if((a=o.getNodeContainer(d.id).next(".node")).length>0){n=a.attr("id");break}s=d.id}return n},toNextNode:function(e,t){null==t&&(t=!1);var n,i=this.getNextNodeId(e,t);i&&(n=o.getContentById(i),0==o.getCursorPosition().start?o.setCursorPosition(n,{start:0}):o.moveCursorEnd(n));return n},toNextSibling:function(e){const t=i.getNextSibling(e);if(t)if(i.rootNode&&i.rootNode.id===e)this.drillNode(t.id);else{const e=o.getCursorPosition();o.setCursorPosition(o.getContentById(t.id),e)}else i.rootNode&&i.rootNode.id===e&&$.toast("下方无同级主题")},toPrevSibling:function(e){const t=i.getPrevSibling(e);if(t)if(i.rootNode&&i.rootNode.id===e)this.drillNode(t.id);else{const e=o.getCursorPosition();o.setCursorPosition(o.getContentById(t.id),e)}else i.rootNode&&i.rootNode.id===e&&$.toast("上方无同级主题")},moveNodeNext:function(e){var t=this.getNextNodeId(e,!0);if(t){var n=t,o="next",r=i.getById(t);1!=r.collapsed&&r.children&&r.children.length>0&&(n=r.children[0].id,o="prev"),this.moveNode(e,n,o)}},moveNodesNext:function(e){var t=e[e.length-1].id,n=this.getNextNodeId(t,!0);if(n){var o=n,r="next",a=i.getById(n);1!=a.collapsed&&a.children&&a.children.length>0&&(o=a.children[0].id,r="prev"),this.moveNodes(e,o,r)}},toggleFinishNode:function(e){var t=i.getById(e);t.finish=!t.finish,i.update(t),o.getNodeContainer(e).toggleClass("finished");var n={updated:[t]};r.trigger("updated",n,{finish:t.finish});var a=t.finish?"complete":"activate";return g.logOperate(a),t.finish},setFinishNode:function(e,t){$.isArray(e)||(e=[e]);var n=[];$.each(e,function(e,r){var a=i.getById(r);a.finish=t,i.update(a),t?o.getNodeContainer(r).addClass("finished"):o.getNodeContainer(r).removeClass("finished"),n.push(a)});var a={updated:n};r.trigger("updated",a,{finish:t});var s=t?"complete":"activate";g.logOperate(s)},toggleExpand:function(e){var t=i.getById(e);if(!t.children||0==t.children.length)return!1;t.collapsed=!t.collapsed,i.update(t),o.getNodeContainer(e).toggleClass("collapsed");var n={updated:[t]};r.trigger("updated",n,{collapsed:t.collapsed});var a=t.collapsed?"collapse":"expand";return g.logOperate(a),t.collapsed},toggleExpandSelfAndSibling:function(e){var t=i.getById(e),n=i.getParentArray(e),a=v.toggleExpandSelfAndSibling(t,n,function(e,t){var n=i.getById(e);n.collapsed=t,i.update(n);var r=o.getNodeContainer(e);t?r.addClass("collapsed"):r.removeClass("collapsed")});a.updated&&a.updated.length>0&&(r.trigger("updated",{updated:a.updated},{collapsed:a.collapsed}),g.logOperate(a.collapsed?"collapse":"expand"))},toggleExpandToLevel:function(e){var t,n=i.rootNode;if((t=null==n?i.define.nodes:n.children)&&0!=t.length){var a=v.toggleExpandToLevel(t,e,function(e,t){var n=i.getById(e);n.collapsed=t,i.update(n);var r=o.getNodeContainer(e);t?r.addClass("collapsed"):r.removeClass("collapsed")});a.updated&&a.updated.length>0&&(r.trigger("updated",{updated:a.updated},{collapsed:a.collapsed}),g.logOperate(a.collapsed?"collapse":"expand"))}},toggleExpandAll:function(){var e,t=i.rootNode;if((e=null==t?i.define.nodes:t.children)&&0!=e.length){var n=v.toggleExpandAll(e,function(e,t){var n=i.getById(e);n.collapsed=t,i.update(n);var r=o.getNodeContainer(e);t?r.addClass("collapsed"):r.removeClass("collapsed")});r.trigger("updated",{updated:n.updated},{collapsed:n.collapsed});var a=n.collapsed?"collapse":"expand";g.logOperate(a)}},allowNodeStyle:function(){return!!d.isVip()||(s.tipNodeStyle(),!1)},setNodeAttr:function(e,t,n){var a=this;if(!a.allowNodeStyle())return!1;$.isArray(e)||(e=[e]);var s=o.getCursorPosition(),d=[];$.each(e,function(e,o){var r=i.getById(o);r[t]=n,i.update(r),a.painter.refreshNode(r),d.push(r)});var l={updated:d};if(1==e.length)try{var c=o.getContentById(e[0]);o.setCursorPosition(c,s)}catch(e){}var u={};if(u[t]=n,r.trigger("updated",l,u),"heading"===t)g.logOperate("heading-h"+n);else if("color"===t){var f={"#333333":"black","#dc2d1e":"red","#ffaf38":"yellow","#75c940":"green","#3da8f5":"blue","#797ec9":"purple"}[n];g.logOperate("color-"+f)}return!0},setSelfAndSiblingNodeAttr:function(e,t,n){if(!this.allowNodeStyle())return!1;var a,s=this;if($.isArray(e)||(e=[e]),!e.map(function(e){var t=i.getParent(e);return t&&t.id}).every(function(e,t){return 0===t?(a=e,!0):a===e}))return!1;var d=[],l=o.getCursorPosition();i.getParentArray(e[0]).forEach(function(e){e[t]=n,i.update(e),s.painter.refreshNode(e),d.push(e)});var c={updated:d};if(1===e.length)try{var u=o.getContentById(e[0]);o.setCursorPosition(u,l)}catch(e){}var f={};if(f[t]=n,r.trigger("updated",c,f),"heading"===t)g.logOperate("heading-h"+n);else if("color"===t){var h={"#333333":"black","#dc2d1e":"red","#ffaf38":"yellow","#75c940":"green","#3da8f5":"blue","#797ec9":"purple"}[n];g.logOperate("color-"+h)}return!0},updateText:function(e,t,n){var o=i.getById(e);if(null!=o){"note"==n?o.note=t:o.text=t,i.update(o);var a={updated:[o]};r.trigger("updateText",a,{type:n})}},drillScrollHistory:{},drillNode:function(e,t){if(null==i.rootNode||e!=i.rootNode.id){var n="root";i.rootNode&&(n=i.rootNode.id),this.drillScrollHistory[n]=l.scrollContainer.scrollTop();var s={from:i.rootNode?i.rootNode.id:null,to:e||null},d=this,c=i.setRootNode(e);d.painter.renderPaper();var u=$("#dir");if(null==c)u.hide(),$(".paper-name").show();else{var f=$("#dir");f.show(),$(".paper-name").hide();var h=i.getDir();f.empty().append('首页>');for(var p=0;p').appendTo(f);m.text(o.htmlToText(v.text)),m.data("node-id",v.id),f.append('>')}}t||r.trigger("drilled",s),u.off().on("click",".item",function(e){e.preventDefault();var t=$(this).data("node-id");d.drillNode(t),g.logOperate("click_bit")});var y=!1;if("root"!==n)if(e)for(var w=n;;){var _=i.getParent(w);if(!_)break;if(_.id===e){y=!0;break}w=_.id}else y=!0;if(y){var b=e||"root",C=this.drillScrollHistory[b]||0;setTimeout(function(){l.scrollContainer.scrollTop(C)},5)}else l.scrollContainer.scrollTop(0),g.logOperate("enter_item");e||(this.drillScrollHistory={}),a.cancel()}},backDrillNode:function(){var e=i.rootNode;if(null!=e){var t=e.id,n=null,r=i.getDir();r.length>0&&(n=r[r.length-1].id),this.drillNode(n),o.moveCursorEnd(o.getContentById(t)),g.logOperate("exit_item")}},getRootNode:function(){return i.rootNode},setName:function(e){this.name=e,i.name=e,$(".paper-name").find("input").val(e),$(".doc-name").text(e),document.title=e+" - 幕布"},editName:function(e){var t={name:"nameChanged",title:e};this.name=e,i.name=e,$(".doc-name").text(e),document.title=e+" - 幕布",r.trigger("nameChanged",t)},getDocumentDefine:function(){return i.define},setSetting:function(e,t){i.define[e]=t;var n={};n[e]=t,r.trigger("settingChanged",n)},insertImage:function(e,t){var n=[],a=i.getById(e);if(!a)return!1;a.images||(a.images=[]),t.id||(t.id=o.newId()),a.images.push(t),i.update(a),f.remove(t.id),this.painter.refreshNode(a),n.push(a);var s={updated:n};r.trigger("updated",s,{images:a.images})},insertUploadingImage:function(e,t,n){t.uploading=!0,t.base64Data=n,t.id||(t.id=o.newId()),f.add(e,t);var r=i.getById(e);this.painter.refreshNode(r)},removeUploadingImage:function(e){var t=f.remove(e);if(t){var n=i.getById(t);this.painter.refreshNode(n)}},resizeImage:function(e,t,n){var o=[],a=i.getById(e);if(!a||!a.images||a.images.length<=t)return!1;a.images[t].w=n,i.update(a),o.push(a);var s={updated:o};r.trigger("updated",s,{images:a.images})},removeImage:function(e,t){var n=[],o=i.getById(e);if(!o||!o.images||o.images.length<=t)return!1;o.images.splice(t,1),i.update(o),this.painter.refreshNode(o),n.push(o);var a={updated:n};r.trigger("updated",a,{images:o.images}),g.logOperate("delete_image")},canIndent:function(e,t){if("indent"==t){i.getParentArray(e);return i.getNodeIndex(e)>0}return!i.isRootSubNode(e)&&null!=i.getParent(e)},setReadOnly:function(e){h.readonly=e;var t=$("#paper"),n=$(".action-undo, .action-redo"),i=$(".paper-name > input");e?(t.find("div[contenteditable]").removeAttr("contenteditable"),i.attr("readonly","readonly"),$(".menu-container").hide(),n.hide(),t.addClass("readonly")):(t.find(".content").attr("contenteditable",!0),t.find(".note").attr("contenteditable",!0),i.removeAttr("readonly"),n.show(),t.removeClass("readonly")),$("#share-dlg").dlg("close"),r.trigger("editorStateChanged")}};return y.painter={renderPaper:function(){var e,t=this,n=i.rootNode;if(e=null==n?i.define.nodes:[n],y.wrapper.empty(),e&&e.length>0){o.recursive(e,function(e){t.renderNode(e)});var r=$(".content:first");r.length&&!u.isMobile&&o.moveCursorEnd(r)}},setTitle:function(e){$.trim(e)||(e=""),$(".doc-name").text(e),$(".paper-name").find("input").val(e),document.title=e+" - 幕布"},refreshNode:function(e){var t=$("#"+e.id);if(0!==t.length){e.finish?t.addClass("finished"):t.removeClass("finished"),e.collapsed?i.isRootNode(e.id)||t.addClass("collapsed"):t.removeClass("collapsed");var n=t.children(".content-wrapper");n.removeClass("heading0 heading1 heading2 heading3"),e.heading&&n.addClass("heading"+e.heading);var r=o.getContentByNode(t);e.color&&"#333333"!=e.color?r.css("color",e.color):r.css("color",""),this.resetHtml(r,e.text),e.images&&e.images.length>0||f.getByNodeId(e.id).length>0?c.renderNodeImages(e,t):t.children(".attach-image-list").remove();var a=t.children(".note");if(e.note){if(0==a.length){a=$('
    '),!1===h.readonly&&a.attr("contenteditable","true");var s=t.children(".attach-image-list");s.length>0?s.after(a):t.children(".content-wrapper").after(a)}this.resetHtml(a,e.note)}else a.remove()}},createNodeDom:function(e,t){return c.render(e,t,i.isRootNode(e.id))},renderNode:function(e,t){var n;null==t&&(t=!0);var o=this.createNodeDom(e);if(i.isTopLevel(e.id))n=y.wrapper,i.isRootNode(e.id)&&o.addClass("root-node");else{var r=i.getParent(e.id),a=$("#"+r.id);0==(n=a.children(".children")).length&&(n=$('
    ').appendTo(a))}t?n.append(o):n.prepend(o)},insertNode:function(e,t,n){var i=y.wrapper;if(e){var r=o.getNodeContainer(e);if(0===r.length)return;0==(i=r.children(".children")).length&&(i=$('
    ').appendTo(r))}else if(null!=y.getRootNode())return;var a=this.createNodeDom(n);0==t?i.prepend(a):i.children(".node:eq("+(t-1)+")").after(a)},renderPrevious:function(e,t){var n=o.getNodeContainer(e),i=this.createNodeDom(t);n.before(i)},renderNext:function(e,t){var n=o.getNodeContainer(e),i=this.createNodeDom(t);n.after(i)},renderFirstChild:function(e,t){var n=o.getNodeContainer(e),i=n.children(".children");0==i.length&&(i=$('
    ').appendTo(n));var r=this.createNodeDom(t);i.prepend(r)},renderChildren:function(e){var t=this,n=i.getById(e);if(n.children){var r=o.getNodeContainer(e),a=r.children(".children");0==a.length&&(a=$('
    ').appendTo(r)),a.empty(),o.recursive(n.children,function(e){t.renderNode(e)})}},removeNode:function(e){o.getNodeContainer(e.id).remove()},resetHtml(e,t){var n=e.text(),i=window.getSelection(),r=$.parseHTML("
    "+t+"
    ");if(r=$(r),m.makeContentSafe(r),t=r.html(),i.anchorNode){var a=i.getRangeAt(0),s=p.getCursorOffset(e,$(a.startContainer),a.startOffset),d=p.getCursorOffset(e,$(a.endContainer),a.endOffset);if(e.html(t),e.get(0).contains(a.startContainer)){var l=e.text(),c=p.diffCursor(n,l,[s,d]),u=c[0],f=c[1];o.setCursorPosition(e,{start:u,end:f})}}else e.html(t)}},y}.call(t,n,t,e))||(e.exports=i)},37:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(0),o=$("#upgrade-dialog"),r=!1;function a(){r||($(".buy-upgrade").on("click",s),$(".free-invite-upgrade").on("click",d),function(){i.post("/api/user/get_invite_count",{}).then(function(e){var t=e.data.inviteCount;$("#invite-count").text(t)}),i.post("/api/user/is_wx_vip_given",{},!1).then(function(e){var t=e.data.vipGiven;0==t&&$("#public-premium").show()});var e=$("#invite-address");e.off().on("focus",function(){$(this).select()}),$("#invite-qrcode").find("img").attr("src","/qrcode/service?data="+e.val()+"&size=130"),$("#invite-copy-link").on("click",function(){var e;try{$("#invite-address").select(),e=document.execCommand("copy")}catch(t){e=!1}e?$.toast("复制成功"):$.toast("复制失败,请手动复制")}),location.href.indexOf("/exchange")>0&&$("#go-exchange").remove()}(),r=!0)}function s(){$(".upgrade-tabs div").removeClass("action-upgrade"),$(".buy-upgrade").addClass("action-upgrade"),$(".upgrade-body").show(),$(".invite-body").hide()}function d(){$(".upgrade-tabs div").removeClass("action-upgrade"),$(".free-invite-upgrade").addClass("action-upgrade"),$(".upgrade-body").hide(),$(".invite-body").show()}t.openBuyUpgrade=function(){a(),s(),o.dlg()},t.openFreeUpgrade=function(){a(),d(),o.dlg()},$("#attention").off().on("click",function(){$("#upgrade-dialog").dlg("close"),$("#attention-dialog").dlg()})}.call(t,n,t,e))||(e.exports=i)},38:function(e,t,n){(function(e){var i=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(66),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(19))},39:function(e,t,n){var i;void 0===(i=function(e){function t(e){this.mode=i.MODE_8BIT_BYTE,this.data=function(e){var t,n,i,o;for(t="",i=e.length,n=0;n=1&&o<=127?t+=e.charAt(n):o>2047?(t+=String.fromCharCode(224|o>>12&15),t+=String.fromCharCode(128|o>>6&63),t+=String.fromCharCode(128|o>>0&63)):(t+=String.fromCharCode(192|o>>6&31),t+=String.fromCharCode(128|o>>0&63));return t}(e)}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}t.prototype={getLength:function(e){return this.data.length},write:function(e){for(var t=0;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var i=-1;i<=7;i++)t+i<=-1||this.moduleCount<=t+i||(this.modules[e+n][t+i]=0<=n&&n<=6&&(0==i||6==i)||0<=i&&i<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=i&&i<=4)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var i=v.getLostPoint(this);(0==n||e>i)&&(e=i,t=n)}return t},createMovieClip:function(e,t,n){var i=e.createEmptyMovieClip(t,n);this.make();for(var o=0;o>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=i}for(n=0;n<18;n++){i=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=i}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,i=v.getBCHTypeInfo(n),o=0;o<15;o++){var r=!e&&1==(i>>o&1);o<6?this.modules[o][8]=r:o<8?this.modules[o+1][8]=r:this.modules[this.moduleCount-15+o][8]=r}for(o=0;o<15;o++){r=!e&&1==(i>>o&1);o<8?this.modules[8][this.moduleCount-o-1]=r:o<9?this.modules[8][15-o-1+1]=r:this.modules[8][15-o-1]=r}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,i=this.moduleCount-1,o=7,r=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[i][a-s]){var d=!1;r>>o&1)),v.getMask(t,i,a-s)&&(d=!d),this.modules[i][a-s]=d,-1==--o&&(r++,o=7)}if((i+=n)<0||this.moduleCount<=i){i-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,i){for(var o=_.getRSBlocks(e,t),r=new b,a=0;a8*d)throw new Error("code length overflow. ("+r.getLengthInBits()+">"+8*d+")");for(r.getLengthInBits()+4<=8*d&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*d||(r.put(n.PAD0,8),r.getLengthInBits()>=8*d));)r.put(n.PAD1,8);return n.createBytes(r,o)},n.createBytes=function(e,t){for(var n=0,i=0,o=0,r=new Array(t.length),a=new Array(t.length),s=0;s=0?f.get(h):0}}var p=0;for(c=0;c=0;)t^=v.G15<=0;)t^=v.G18<>>=1;return t},getPatternPosition:function(e){return v.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case d:return(t+n)%2==0;case l:return t%2==0;case c:return n%3==0;case u:return(t+n)%3==0;case f:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case h:return t*n%2+t*n%3==0;case p:return(t*n%2+t*n%3)%2==0;case g:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new w([1],0),n=0;n5&&(n+=3+r-5)}for(i=0;i=256;)e-=255;return m.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},y=0;y<8;y++)m.EXP_TABLE[y]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},function(e){"string"==typeof e&&(e={text:e});var t=document.createElement("canvas");(e=$.extend({},{render:t&&t.getContext?"canvas":"table",width:256,height:256,typeNumber:-1,correctLevel:s,background:"#ffffff",foreground:"#000000"},e)).element.each(function(){var t="canvas"==e.render?function(){var t=new n(e.typeNumber,e.correctLevel);t.addData(e.text),t.make();var i=document.createElement("canvas");i.width=e.width,i.height=e.height;for(var o=i.getContext("2d"),r=e.width/t.getModuleCount(),a=e.height/t.getModuleCount(),s=0;s").css("width",e.width+"px").css("height",e.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",e.background),o=e.width/t.getModuleCount(),r=e.height/t.getModuleCount(),a=0;a").css("height",r+"px").appendTo(i),d=0;d").css("width",o+"px").css("background-color",t.isDark(a,d)?e.foreground:e.background).appendTo(s);return i}();$(t).appendTo(this)})}}.call(t,n,t,e))||(e.exports=i)},4:function(e,t,n){var i;void 0===(i=function(e,t){t.isWeixin=function(){return"micromessenger"==window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i)},t.isMobile=function(){var e=window.navigator.userAgent,t=["Android","iPhone","iPod","iPad","Windows Phone","BlackBerry","MQQBrowser"];if(e.indexOf("Windows NT")<0&&e.indexOf("Macintosh")<0)for(var n=0;n=0)return!0}return!1},t.isFirefox=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>0},t.isChrome=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("chrome")>0||e.indexOf("chromium")>0},t.isSafari=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("safari")>0&&e.indexOf("version")>0&&e.indexOf("chrome")<0&&e.indexOf("chromium")<0},t.isIE=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("msie")>0||e.indexOf("rv:")>0&&e.indexOf("trident")>0||e.indexOf("edge")>0},t.isEdge=function(){return navigator.userAgent.toLowerCase().indexOf("edge")>0},t.isMac=function(){return navigator.platform.toLowerCase().indexOf("mac")>=0},t.isDesktopClient=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("electron")>0&&(e.indexOf("mubu")>0||e.indexOf("幕布")>0)},t.isApp=function(){return navigator.userAgent.toLowerCase().indexOf("mubuapp/")>0},t.getPlatform=function(){var e="web",t=navigator.userAgent.toLowerCase();return this.isApp()?e=t.indexOf("android")>0?"app_android":"app_ios":this.isDesktopClient()?e=t.indexOf("macintosh")>0?"client_mac":"client_windows":this.isWeixin()?e="web_weixin":this.isMobile()&&(e="web_mobile"),e},t.isLark=function(){return navigator.userAgent.toLowerCase().indexOf("lark/")>0}}.call(t,n,t,e))||(e.exports=i)},41:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t-1){var a=i.split(".");r=a[0],i=a[1]}"os_version"===i&&(o=""+o),r?"user"===r||"header"===r?t.envInfo[r][i]=o:"headers"===r?t.envInfo.header.headers[i]=o:t.envInfo.header.headers.custom[i]=o:t.envInfo.user.hasOwnProperty(i)?["user_type","device_id","ip_addr_id"].indexOf(i)>-1?t.envInfo.user[i]=Number(o):["user_id","web_id","user_unique_id","ssid"].indexOf(i)>-1?t.envInfo.user[i]=String(o):["user_is_auth","user_is_login"].indexOf(i)>-1&&(t.envInfo.user[i]=Boolean(o)):t.envInfo.header.hasOwnProperty(i)?t.envInfo.header[i]=o:t.envInfo.header.headers.hasOwnProperty(i)?t.envInfo.header.headers[i]=o:t.envInfo.header.headers.custom[i]=o},this.get=function(){var e={user:{},header:{headers:{custom:{}}}},n=t.envInfo,r=n.user,a=Object.keys(r),s=Array.isArray(a),d=0;for(a=s?a:a[Symbol.iterator]();;){var l;if(s){if(d>=a.length)break;l=a[d++]}else{if((d=a.next()).done)break;l=d.value}var c=l;r[c]!==o&&(e.user[c]=r[c])}var u=n.header,f=Object.keys(u),h=Array.isArray(f),p=0;for(f=h?f:f[Symbol.iterator]();;){var g;if(h){if(p>=f.length)break;g=f[p++]}else{if((p=f.next()).done)break;g=p.value}var v=g;u[v]!==o&&"headers"!==v&&(e.header[v]=u[v])}var m=n.header.headers,y=Object.keys(m),w=Array.isArray(y),_=0;for(y=w?y:y[Symbol.iterator]();;){var b;if(w){if(_>=y.length)break;b=y[_++]}else{if((_=y.next()).done)break;b=_.value}var C=b;"custom"!==C&&m[C]!==o&&(e.header.headers[C]=m[C])}var x=n.header.headers.custom,T=Object.keys(x);if(T.length){var k=T,M=Array.isArray(k),S=0;for(k=M?k:k[Symbol.iterator]();;){var $;if(M){if(S>=k.length)break;$=k[S++]}else{if((S=k.next()).done)break;$=S.value}var N=$;e.header.headers.custom[N]=x[N]}}return{user:e.user,header:i({},e.header,{headers:e.header.headers})}},this.envInfo={user:{user_unique_id:o,user_type:o,user_id:o,user_is_auth:o,user_is_login:o,device_id:o,web_id:o,ip_addr_id:o,ssid:o},header:{app_id:o,app_name:o,app_install_id:o,app_package:o,app_channel:o,app_version:o,os_name:o,os_version:o,device_model:o,ab_client:o,ab_version:o,traffic_type:o,utm_source:o,utm_medium:o,utm_campaign:o,client_ip:o,device_brand:o,os_api:o,access:o,language:o,region:o,app_language:o,app_region:o,creative_id:o,ad_id:o,campaign_id:o,log_type:o,rnd:o,platform:o,sdk_version:o,province:o,city:o,timezone:o,tz_offset:o,tz_name:o,sim_region:o,carrier:o,resolution:o,browser:o,browser_version:o,referrer:o,referrer_host:o,headers:{utm_term:o,utm_content:o,custom:{}}}}},a=function(e){var t=document.createElement("a");return t.href=e,t},s=screen.width||0,d=screen.height||0,l=s+" x "+d,c=navigator.appVersion,u=navigator.userAgent,f=navigator.language,h=document.referrer,p=a(h).hostname,g=function(e){var t=a(e).search,n={};return(t=t.slice(1)).split("&").forEach(function(e){var t=e.split("="),i=t[0],o=t[1];n[i]=decodeURIComponent(void 0===o?"":o)}),n}(location.href),v="",m="",y="",w=""+parseFloat(c),_=void 0,b=void 0;-1!==(_=u.indexOf("Opera"))&&(y="Opera",w=u.substring(_+6),-1!==(_=u.indexOf("Version"))&&(w=u.substring(_+8))),-1!==(_=u.indexOf("Edge"))?(y="Microsoft Edge",w=u.substring(_+5)):-1!==(_=u.indexOf("MSIE"))?(y="Microsoft Internet Explorer",w=u.substring(_+5)):-1!==(_=u.indexOf("Chrome"))?(y="Chrome",w=u.substring(_+7)):-1!==(_=u.indexOf("Safari"))?(y="Safari",w=u.substring(_+7),-1!==(_=u.indexOf("Version"))&&(w=u.substring(_+8))):-1!==(_=u.indexOf("Firefox"))&&(y="Firefox",w=u.substring(_+8)),-1!==(b=w.indexOf(";"))&&(w=w.substring(0,b)),-1!==(b=w.indexOf(" "))&&(w=w.substring(0,b)),-1!==(b=w.indexOf(")"))&&(w=w.substring(0,b));for(var C=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(c)?"wap":"web",x=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],T=0;T0&&void 0!==arguments[0]?arguments[0]:"";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.init=function(e){t.isLog=e},this.info=function(e){for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o1?n-1:0),o=1;o1?n-1:0),o=1;o>e/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,q)}var Z=function(){return q().replace(/-/g,"").slice(0,19)},J=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};if(n.blackUuid.some(function(t){return t===e.user_unique_id})){var t={};return n.setUserTokens(t),n.logger.warn('检测到无效的用户标识,已重置用户状态。{user_unique_id: "%s"}',e.user_unique_id),t}return e},n.getUserTokens=function(){return $.get(n.tokensCacheKey)||{}},n.setUserTokens=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return $.set(n.tokensCacheKey,e)},n.checkUserToken=function(e){var t=N+"tokens_"+e;n.tokensCacheKey=t,n.transferFromCookie();var i=n.purifyBlackUuid(n.getUserTokens());i.user_unique_id&&i.web_id?(n.envInfo.user.user_unique_id=i.user_unique_id,n.envInfo.user.web_id=i.web_id,n.envInfo.user.ssid=i.ssid||"",n.logger.info("初始化已经检测到了 webid user_unique_id,一般情况下不需要再次验证 id 了"),n.unlock()):n.requestWebId(e)},n.saveTokenToStorage=function(e){var t=e.web_id,i=e.ssid,o=e.user_unique_id;n.setUserTokens({web_id:t,ssid:i,user_unique_id:o})},n.requestWebId=function(){n.isRequestWebId=!0;var e=function(e){var t=n.envInfo.user.web_id||e.web_id,i=e.ssid;n.isRequestWebId=!1,n.envInfo.user.ssid=i,n.envInfo.user.web_id=t,n.envInfo.user.user_unique_id=t,n.saveTokenToStorage({web_id:t,ssid:i,user_unique_id:t}),n.waitForVerifyTokens?(n.lock(),n.verifyTokens(n.realUuid)):(n.unlock(),n.callback&&n.callback())};n.isWebidDisabled?e({web_id:Z(),ssid:""}):function(){var t=n.userTokensPrefix+"/v1/user/webid";B(t,{app_id:n.app_id,url:location.href,user_agent:S.userAgent,referer:S.referrer,user_unique_id:""},function(t){0!==t.e?n.logger.error("请求 webid 失败。请联系管理员。"):e(t)},function(){n.isRequestWebId=!1,n.logger.error("获取 webid 失败,数据将不会被上报")})}()},n.verifyTokens=function(e){var t=n.tokensCacheKey;if(n.waitForVerifyTokens=!1,n.realUuid=""+e,n.isRequestWebId)return n.waitForVerifyTokens=!0,n.logger.info("正在请求 webid,requestSsid 将会在前者请求完毕之后被调用"),!1;var i=n.getUserTokens();if(i.user_unique_id===n.realUuid&&i.ssid&&i.web_id)n.logger.info("传入的 user_id/user_unique_id 与 缓存中的完全一致,无需再次请求"),n.unlock();else{n.lock(),n.envInfo.user.user_unique_id=n.realUuid;var o=J({},n.getUserTokens(),{user_unique_id:n.realUuid});if($.set(t,JSON.stringify(o)),H.isLowIE())return n.unlock(),!1;n.isSsidDisabled?(n.unlock(),n.callback&&n.callback()):n.requestSsid()}},n.requestSsid=function(){var e=n.getUserTokens(),t=n.userTokensPrefix+"/v1/user/ssid";B(t,{app_id:n.app_id,web_id:e.web_id,user_unique_id:""+e.user_unique_id},function(t){if(n.unlock(),0!==t.e)n.logger.error("请求 ssid 失败~");else{n.envInfo.user.ssid=t.ssid;var i=J({},e,{ssid:t.ssid});n.setUserTokens(i),n.logger.info("根据 user_unique_id 更新 ssid 成功!注意:在这之前不应该有数据被发出去"),n.callback&&n.callback()}},function(){n.unlock(),n.logger.error("根据 user_unique_id 获取新 ssid 失败")})},n.setEvtParams=function(e){var t=J({},e);Object.keys(t).forEach(function(e){n.evtParams[e]=t[e]})},n.mergeEnvToEvents=function(e){var t=n.mergeEnv(),i=[],o=0,r=void 0;return e.forEach(function(e){var t=!!e.params.__disable_storage__;void 0===r?r=t:(t!==r||i[o].length>=5)&&(o+=1,r=!r),i[o]=i[o]||[],i[o].push(e)}),i.map(function(e){return{events:e.map(function(e){var t=J({},n.evtParams,e.params);return delete t.__disable_storage__,J({},e,{params:JSON.stringify(t)})}),user:t.user,header:t.header,verbose:n.debugMode?1:void 0,__disable_storage__:e[0].params.__disable_storage__}})},n.mergeEnv=function(){var e=n.get(),t=W.get(),i=J({},e.user),o=J({},t.header.headers.custom,e.header.headers.custom),r=J({},t.header.headers,e.header.headers,{custom:o}),a=J({},t.header,e.header);return{user:i,header:J({},a,{headers:JSON.stringify(r)})}},n.evtParams={},n.reportUrl="",n.userTokensPrefix="",n.isSsidDisabled=!1,n.isWebidDisabled=!1,n.isSdkMonitorDisabled=!1,n.debugMode=!1,n.blackUuid=["null","undefined","0","","None"],n.logger=function(){},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.lock=function(){this.isUserTokensReady=!1},t.prototype.unlock=function(){this.isUserTokensReady=!0},t.prototype.enableDebugMode=function(e){this.debugMode=e},t}(r);var X=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.set=function(e,n){t.cache[e]=n},this.get=function(e){return t.cache[e]},this.clean=function(e){t.cache[e]=void 0},this.cache={}},ee=new X;var te=function(){function e(t){var n=t.disable_storage,i=void 0!==n&&n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._isPersistent=!i,this._storage=this._isPersistent?$:new X,this._storageKey="",this._data=void 0}return e.prototype.setStorageKey=function(e){this._storageKey=e},e.prototype.getAllEvents=function(){var e=this.getData();Object.keys(e).reduce(function(t,n){return t.concat(e[n]||[])},[])},e.prototype.getData=function(){return this._checkIsDataInit(),this._data},e.prototype.add=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._checkIsDataInit(),0!==t.length&&(this._data[e]=t,this._save())},e.prototype.delete=function(e){this._checkIsDataInit(),this._data[e]&&(delete this._data[e],this._save())},e.prototype._checkIsDataInit=function(){if(void 0===this._data)try{var e,t=this._getDataFromStorage();if(H.isArray(t))this._data=((e={})[Z()]=t,e),this._save();else this._data=t}catch(e){this._data={}}},e.prototype._checkStorageKey=function(){if(!this._storageKey)throw new Error("must call setStorageKey('xxx') first")},e.prototype._getDataFromStorage=function(){return this._checkStorageKey(),this._storage.get(this._storageKey)||{}},e.prototype._save=function(){this._checkStorageKey(),this._storage.set(this._storageKey,this._data)},e}(),ne=function(e,t){try{var n=e.split("v1")[0];t.forEach(function(e){var t=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+="&"+n+"="+encodeURIComponent(JSON.stringify(e[n])));return t="&"===t[0]?t.slice(1):t}(e),i=new Image(1,1);i.onload=function(){i=null},i.onerror=function(){i=null},i.src=n+"/v1/gif?"+t})}catch(e){}},ie=function(e,t){if(window.XDomainRequest)return ne(e,t);var n=new XMLHttpRequest;n.open("POST",e+"?rdn="+Math.random(),!0),n.onload=function(){},n.onerror=function(){n.abort()},n.send(JSON.stringify(t))},oe=function(e,t,n,i){try{var o=e.split("v1")[0];if(!o)return void i(e,t,I);t.forEach(function(r){var a=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+="&"+n+"="+encodeURIComponent(JSON.stringify(e[n])));return t="&"===t[0]?t.slice(1):t}(r),s=new Image(1,1);s.onload=function(){s=null,n()},s.onerror=function(){s=null,i(e,t,E)},s.src=o+"/v1/gif?"+a})}catch(n){i(e,t,D,n.message)}};var re=function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.send=function(e){var t=e.url,i=e.data,o=e.success,r=e.fail,a=e.eventError;if(function(e){var t=e.url,n=e.data,i=e.success,o=e.fail,r=e.notSure,a=e.isUnload,s=n;if(window.XDomainRequest)oe(t,s,i,o);else{if(a)return window.navigator&&window.navigator.sendBeacon?(r(),void(window.navigator.sendBeacon(t,JSON.stringify(s))?i():o(t,n,O))):void oe(t,s,i,o);var d=new XMLHttpRequest;d.open("POST",t+"?rdn="+Math.random(),!0),d.onload=function(){i(t,s,d.responseText)},d.onerror=function(){d.abort(),o(t,s,A)},d.send(JSON.stringify(s))}}({url:t,data:i,success:function(e,t,i){o();try{var r=JSON.parse(i).e;if(0!==r){var s="未知错误";-2===r&&(s="事件格式错误!请检查字段类型是否正确。"),n.logger.error("数据上报失败!","错误码:"+r+"。错误信息:"+s),a(t,r),se(e,t,r)}}catch(n){se(e,t,P)}},fail:function(e,t,i){n.logger.error("数据上报失败!","错误码:"+i),r(t,i),se(e,t,i)},notSure:e.notSure,isUnload:e.isUnload}),!n.isSdkMonitorDisabled&&!n.isSdkOnLoadEventReady){n.isSdkOnLoadEventReady=!0;try{var s=i[0].header,d=i[0].user;ae(t,{app_id:s.app_id,app_name:s.app_name,sdk_version:s.sdk_version,web_id:d.web_id})}catch(e){}}},this.logger=t.logger||Y,this.isSdkOnLoadEventReady=!1,this.isSdkMonitorDisabled=!1},ae=function(e,t){try{var n={events:[{event:"onload",params:JSON.stringify({app_id:t.app_id,app_name:t.app_name||"",sdk_version:t.sdk_version}),local_time_ms:Date.now()}],user:{user_unique_id:t.web_id},header:{app_id:1338}};setTimeout(function(){ie(e,[n])},16)}catch(e){}},se=function(e,t,n){try{var i=t[0].user,o=t[0].header,r=[];t.forEach(function(e){e.events.forEach(function(e){r.push(e)})});var a={events:r.map(function(e){return{event:"on_error",params:JSON.stringify({error_code:n,app_id:o.app_id,app_name:o.app_name||"",error_event:e.event,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(o),user:JSON.stringify(i)}),local_time_ms:Date.now()}}),user:{user_unique_id:i.user_unique_id},header:{app_id:1338}};setTimeout(function(){ie(e,[a])},16)}catch(e){}};var de=function(e){function t(n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this));i.addListener=function(){window.addEventListener("unload",function(){i.report(!0)},!1),window.addEventListener("beforeunload",function(){i.report(!0)},!1),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&i.report(!0)},!1)},i.setReady=function(e){i.isReady=e,i.eventSender.isSdkMonitorDisabled=i.isSdkMonitorDisabled,i.checkAndSendCachedStorageEvents(),i.report()},i.eventReportTimer=null,i.event=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ee.get(i.evtDataCacheKey)||[],o=t?[].concat(e,n):[].concat(n,e);ee.set(i.evtDataCacheKey,o),o.length>=5?i.report():(i.eventReportTimer&&clearTimeout(i.eventReportTimer),i.eventReportTimer=setTimeout(function(){i.report(),i.eventReportTimer=null},i.waitForBatchTime))},i.report=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!i.isUserTokensReady)return!1;if(!i.isReady)return!1;var t=ee.get(i.evtDataCacheKey)||[];ee.clean(i.evtDataCacheKey);var n=i.mergeEnvToEvents(t);i.sendData(n,e)},i.sendData=function(e,t){var n=[],o=0,r=void 0;e.forEach(function(e){var t=!!e.__disable_storage__;void 0===r?r=t:(t!==r||n[o].length>=5)&&(o+=1,r=!r),n[o]=n[o]||[],n[o].push(e)}),n.forEach(function(e){var n=Z();e[0].__disable_storage__||i.eventStorage.add(n,e),i._sendData(n,e,t)})},i.checkAndSendCachedStorageEvents=function(){var e=i.eventStorage.getData(),t=Object.keys(e);t.length>0&&t.forEach(function(t){i._sendData(t,e[t])})},i._sendData=function(e,t,n){i.isReporting=!0;var o=function(){i.isReporting=!1};i.eventSender.send({url:i.reportUrl,data:t,success:function(){o(),i.sendDataSuccess(e)},fail:function(e,t){o(),i.reportErrorCallback(e,t),setTimeout(function(){i.report()},3e3)},eventError:function(e,t){i.reportErrorCallback(e,t)},notSure:o,isUnload:n})},i.sendDataSuccess=function(e){i.eventStorage.delete(e),i.report()};var o=n.log,r=n.disable_storage,a=n.max_batch_num,s=void 0===a?5:a,d=n.batch_time,l=void 0===d?30:d;return i.init(n),i.maxBatchNum=s,i.waitForBatchTime=l,i.isReady=!1,i.addListener(),i.enableDebugMode(!!o),i.eventStorage=new te({disable_storage:r}),i.eventStorage.setStorageKey(i.evtDataCacheKey),i.eventSender=new re({logger:i.logger}),i.reportErrorCallback=function(){},i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(Q),le=Object.assign||function(e){for(var t=1;t=i.length)break;a=i[r++]}else{if((r=i.next()).done)break;a=r.value}var s=a,d=e[s];switch(s){case"evtParams":n.channel.setEvtParams(d);break;case"disable_ssid":n.logger.deprecated("(disable_ssid)请通过init函数来设置。"),d&&(n.logger.info("ssid已禁用,设置user_unique_id不会请求ssid接口。"),n.channel.isSsidDisabled=d);break;case"disable_auto_pv":d&&(n.logger.info("已禁止默认上报predefine_pageview事件,需手动上报。"),n._autoSendPV=!1);break;case"_staging_flag":""+d=="1"&&n.logger.info("根据_staging_flag设置,数据将会上报到stag 表。"),n.channel.setEvtParams({_staging_flag:Number(d)});break;case"reportErrorCallback":"function"==typeof d&&(n.channel.reportErrorCallback=d);break;default:n.channel.setEnv(s,d)}}},this.send=function(){n.start()},this.start=function(){if(n.channel.isUserTokensReady){if(n._isSendFuncCalled)return;n._isSendFuncCalled=!0,n.logger.info("看到本提示,意味着用户信息已完全就绪,上报通道打开。用户标识如下:"),n.logger.logJSON(n.channel.get().user),n._autoSendPV&&n.predefinePageView(),n.channel.setReady(!0)}else n.callbackSend=!0},this.predefinePageView=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={title:document.title||location.pathname,url:location.href,url_path:location.pathname},i=le({},t,e);n.event("predefine_pageview",i,!0)},this.event=function(){for(var e=arguments.length,t=Array(e),i=0;i-1?(o=n.colloctor)[a].apply(o,t.slice(1)):(r=n.colloctor).event.apply(r,t)},this.name=t||"Collector"+ +new Date,this.cmdQueue=[],this.colloctor=new ue(this.name),this._isQueueProcessed=!1,this._processCmdQueue(),this._exportCollect.init=this._exportCollect.bind(this,"init"),this._exportCollect.config=this._exportCollect.bind(this,"config"),this._exportCollect.send=this._exportCollect.bind(this,"send"),this._exportCollect.start=this._exportCollect.bind(this,"start"),this._exportCollect.predefinePageView=this._exportCollect.bind(this,"predefinePageView"),this._exportCollect},he={},pe={},ge=function(e){return pe[e]||(pe[e]=[]),pe[e]},ve=function(e){var t=e[0],n=e[1],i=t.split(".");if(1===i.length)ge("default").push([t,n]);else if(2===i.length)"event"===i[0]?ge("default").push([t,n]):ge(i[0]).push([i[1],n]);else if(3===i.length){var o=i[0],r=[i[1],i[2]].join(".");ge(o).push([r,n])}},me=function(e,t){t.forEach(function(t){(function(e){return he[e]||(he[e]=new fe(e)),he[e]})(e).apply(void 0,t)})},ye=function(){we.q.forEach(function(e){var t=[].slice.call(e);H.isArray(t[0])?t.forEach(function(e){ve(e)}):ve(t)}),Object.keys(pe).forEach(function(e){me(e,pe[e]),pe[e]=[]}),we.q=[]},we=function e(){for(var t=arguments.length,n=Array(t),i=0;i0&&(t.images=[],$.each(e.images,function(e,n){t.images.push($.extend({},n))})):t[n]=e[n]);return t},p={mapping:{},getNodeById:function(e){return h(p.mapping[e].node)},getMappingById:function(e){return r.copy(p.mapping[e])}};t.setNodes=function(e){e&&0!=e.length&&(p.mapping={},r.recursive(e,function(e,t,n){p.mapping[e.id]={node:h(e),parentId:t?t.id:null,index:n}}))},t.setEngine=function(e){i=e},t.trigger=function(e,t,n){var i=c[e];i&&i(t,n)},t.on=function(e,t){c[e]=t};var g=function(){var e=$("#node-wrapper"),t=e.find(".node:not(.root-node)");$("#add-node").remove(),e.off("click.firstNode"),0!==t.length||l.readonly||(e.append(''),e.on("click.firstNode",function(e){var t=$(e.target);t.hasClass("content")||t.hasClass("note")||(t=t.parent()).hasClass("content")||t.hasClass("note")||i.createRootNext()})),null==f&&(f=$("#node-count-text")),f.length>0&&f.text(Object.keys(p.mapping).length)},v=function(){var e=o.define.nodes;u.setNodes(e)},m=function(){v()},y=function(e){var t={name:"update",updated:[]};return $.each(e,function(e,n){t.updated.push({updated:h(n),original:p.getNodeById(n.id)})}),t};this.on("opened",function(){g()}),this.on("created",function(e){var t=[];if(e.updated){var n=y(e.updated);t.push(n)}m(),g();var i=e.created,o=[];$.each(i,function(e,t){var n=p.getMappingById(t.id);o.push(n)});var r={name:"create",created:o};e.cursor&&(r.cursor=e.cursor),t.push(r),a.add(t),d.onPopChangeEvent&&d.onPopChangeEvent(t)}),this.on("deleted",function(e){var t=[],n=function(e){var t={name:"delete",deleted:[]};return r.recursive(e,function(e){t.deleted.push(p.getMappingById(e.id))}),t}(e.deleted);if(s.getSelectIds().length>0&&(n.selected=s.getSelectIds()),t.push(n),e.updated){var i=y(e.updated);t.push(i)}a.add(t),m(),g(),d.onPopChangeEvent&&d.onPopChangeEvent(t)}),this.on("updated",function(e,t){var n=y(e.updated);if(s.getSelectIds().length>0&&(n.selected=s.getSelectIds()),a.add(n),m(),d.onPopChangeEvent){var i={name:"update",updated:[]};$.each(e.updated,function(e,n){var o=$.extend(!0,{},t);o.id=n.id,i.updated.push({updated:o})}),d.onPopChangeEvent([i])}}),this.on("updateText",function(e,t){var n=[];if($.each(e.updated,function(e,i){var o=p.mapping[i.id].node;o.text=i.text,o.note=i.note;var r={id:i.id};"note"==t.type?r.note=i.note:r.text=i.text,n.push({updated:r})}),m(),d.onPopChangeEvent){var i={name:"update",updated:n};d.onPopChangeEvent([i])}}),this.on("structureChanged",function(e){var t=e.changed,n=[];$.each(t,function(e,t){var i=o.getParent(t.id);n.push({changed:{parentId:i?i.id:null,index:o.getNodeIndex(t.id),node:h(t)},original:p.getMappingById(t.id)})});var i=[];if(e.updated){var r=y(e.updated);i.push(r)}var l={name:"structureChanged",changed:n};e.cursor&&(l.cursor=e.cursor),s.getSelectIds().length>0&&(l.selected=s.getSelectIds()),i.push(l),a.add(i),m(),d.onPopChangeEvent&&d.onPopChangeEvent(i)}),this.on("drilled",function(e){g();var t={name:"drill",from:e.from,to:e.to};a.add(t),d.onDrillEvent&&d.onDrillEvent(t),d.onNodeDrilled&&d.onNodeDrilled()}),this.on("redid",function(e){if(m(),g(),d.onPopChangeEvent){var t=[];$.each(e,function(e,n){if("create"==(n=$.extend(!0,{},n)).name||"delete"==n.name||"update"==n.name||"structureChanged"==n.name)t.push(n);else if("input"==n.name){var i={id:n.id};"note"==n.type?i.note=n.endContent:i.text=n.endContent;var o=[];o.push({updated:i}),t.push({name:"update",updated:o})}}),d.onPopChangeEvent(t)}}),this.on("undid",function(e){if(m(),g(),d.onPopChangeEvent){var t=[];$.each(e,function(e,n){if("create"==(n=$.extend(!0,{},n)).name)t.push({name:"delete",deleted:n.created});else if("delete"==n.name)t.push({name:"create",created:n.deleted});else if("update"==n.name){var i=[];$.each(n.updated,function(e,t){i.push({updated:t.original})}),t.push({name:n.name,updated:i})}else if("structureChanged"==n.name){var o=[];$.each(n.changed,function(e,t){o.push({changed:t.original,original:t.changed})}),t.push({name:n.name,changed:o})}else if("input"==n.name){var r={id:n.id};"note"==n.type?r.note=n.startContent:r.text=n.startContent;var a=[];a.push({updated:r}),t.push({name:"update",updated:a})}}),d.onPopChangeEvent(t)}}),this.on("messageQueueChanged",function(e){e.undo>0?$(".action-undo").addClass("active"):$(".action-undo").removeClass("active"),e.redo>0?$(".action-redo").addClass("active"):$(".action-redo").removeClass("active")}),this.on("settingChanged",function(e){if(m(),d.onPopChangeEvent){var t={name:"settingChanged",changed:e};d.onPopChangeEvent([t])}}),this.on("nameChanged",function(e){d.onPopChangeEvent([e])}),this.on("messageExecuted",function(){v(),g()}),this.on("editorStateChanged",function(){g()})}.call(t,n,t,e))||(e.exports=i)},5:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(30);t.log=function(e,t){i.collectEvent(e,t)},t.logOperate=function(e){this.log("toggle_attribute",{action:e})}}.call(t,n,t,e))||(e.exports=i)},54:function(e,t,n){"use strict";var i=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(44)),o=[],r=[],a={add:function(e){$.isArray(e)||(e=[e]),"input"===e[0].name&&null==e[0].id||(o.push(e),o.length>100&&o.splice(0,1),r=[],this.changed())},popUndoMessage:function(){if(0!==o.length){var e=o.length-1,t=o[e];return o.splice(e,1),r.push(t),this.changed(),t}},popRedoMessage:function(){if(0!==r.length){var e=r.length-1,t=r[e];return r.splice(e,1),o.push(t),this.changed(),t}},changed:function(){i.default.trigger("messageQueueChanged",{undo:o.length,redo:r.length})}};e.exports=a},60:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(12),o=n(23),r=n(11),a=n(7),s=n(61),d=n(13);t.render=function(e,t,n){var r=o.escape(e.id);if(r.length>40)throw $.toast("文档打开失败,可能您的文档已经损坏"),"error node";var a=$('
    ');e.finish&&a.addClass("finished"),e.collapsed&&!n&&a.addClass("collapsed");var s=$('
    ').appendTo(a);s.append('
    ');var l=$('
    ');s.append(l),i.isMobile&&l.children(".bullet").append('
    ');var c=$.parseHTML('
    '+e.text+"
    ");if(c=$(c),o.makeContentSafe(c),s.append(c),!0!==t&&!0!==d.readonly&&c.attr("contenteditable",!0),e.heading&&s.addClass("heading"+parseInt(e.heading)),e.color&&"#333333"!=e.color&&7===e.color.length?(c.css("color",e.color),s.attr("color",e.color)):c.css("color",""),this.renderNodeImages(e,a,t),e.note){var u=$.parseHTML('
    '+e.note+"
    ");u=$(u),o.makeContentSafe(u),a.append(u),!0!==t&&!0!==d.readonly&&u.attr("contenteditable",!0)}return a},t.renderNodeImages=function(e,t,n){var i=e.images||[],d=s.getByNodeId(e.id);if((i=i.concat(d)).length>0){var l=t.children(".attach-image-list");if(0==l.length){var c=t.children(".content-wrapper");l=$('
    '),c.after(l)}else{var u=[];$.each(i,function(e,t){var n=t.id||t.uri;u.push(n)}),l.children(".attach-image-item").each(function(){var e=$(this),t=e.attr("fid");u.indexOf(t)<0&&e.remove()})}var f=o.escape(e.id);$.each(i,function(e,t){var i=t.id||t.uri;(i=o.escape(i)).length>80&&(alert("文档处理失败,可能您的文档已经损坏"),location.href="/");var s=l.children('div[fid="'+i+'"]');if(s.length)return t.uploading||(s.removeClass("uploading").find(".uploading-spinner").remove(),s.attr("def",encodeURIComponent(r.stringify(t)))),t.w&&s.find("img").css("width",t.w),!0;s=$('
    ');var d=$('
    ').appendTo(s),c=$('');(t.w&&c.css("width",parseInt(t.w)),d.append(c),1!=n?d.append('
    '):c.addClass("readonly"),0==e)?l.prepend(s):l.children(".attach-image-item:eq("+(e-1)+")").after(s);if(t.uploading)return c.on("load",function(){var e=$('
    正在上传...
    ');d.append(e)}),s.addClass("uploading"),void c.removeClass("loading").attr("src","data:image/jpg;base64,"+t.base64Data);s.attr("def",encodeURIComponent(r.stringify(t)));var u=$('
    '),h=t.w||t.ow;u.css("width",h),d.append(u),setTimeout(function(){if(u.css({height:t.oh/t.ow*u.width()}).append('
    图片加载中...
    '),c.on("load",function(){$(this).removeClass("loading"),u.remove()}),a.getImageURL){var e=a.getImageURL(t.uri);"string"==typeof e?c.attr("src",e):e.then(function(e){c.attr("src",e)})}},0)})}}}.call(t,n,t,e))||(e.exports=i)},61:function(e,t,n){var i;void 0===(i=function(e,t){var n={};t.add=function(e,t){var i=n[e];i||(i=[]),i.push(t),n[e]=i},t.getByNodeId=function(e){return n[e]||[]},t.remove=function(e){var t=Object.keys(n),i=null,o=!1;return $.each(t,function(t,r){var a=n[r];if(a&&($.each(a,function(t,n){if(n.id==e)return a.splice(t,1),o=!0,i=r,!1}),o))return!1}),i}}.call(t,n,t,e))||(e.exports=i)},62:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(3);t.toggleExpandAll=function(e,t){var n=[],o=!0;return i.recursive(e,function(e){if(e.children&&e.children.length>0&&e.collapsed&&(o=!1),!o)return!1}),i.recursive(e,function(e){e.children&&e.children.length>0&&e.collapsed!=o&&(t(e.id,o),n.push(e))}),{updated:n,collapsed:o}},t.toggleExpandSelfAndSibling=function(e,t,n){t=t.filter(function(e){return e.children&&e.children.length>0});var i=!0;if(e.children&&e.children.length>0)i=!e.collapsed;else{var o=0;t.forEach(function(e){e.collapsed&&o++}),i=t.length-o>o}return t.forEach(function(e){n(e.id,i)}),{updated:t,collapsed:i}},t.toggleExpandToLevel=function(e,t,n){var o=[],r=!1;return i.recursive(e,function(e,n,i,o,a){return a<=t&&e.collapsed&&e.children&&e.children.length>0&&(r=!0),!r&&(a!==t&&void 0)}),i.recursive(e,function(e,i,a,s,d){if(d0&&(r&&e.collapsed&&(n(e.id,!1),o.push(e)),r||e.collapsed||(n(e.id,!0),o.push(e))),!1}),{updated:o,collapsed:!r}}}.call(t,n,t,e))||(e.exports=i)},66:function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var i,o=1,r={},a=!1,s=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?i=function(e){t.nextTick(function(){c(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&c(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),i=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){c(e.data)},i=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;i=function(t){var n=s.createElement("script");n.onreadystatechange=function(){c(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():i=function(e){setTimeout(c,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n0?o.text().toLowerCase():"",u=!0,f=!1;($.each(c,function(e,t){t=t.toLowerCase();var n=d.indexOf(t)>=0;if(n&&(f=!0),s.indexOf(t)<0&&!n)return u=!1,!1}),u)&&(function e(t){if(r.isRootSubNode(t))return;var n=r.getParent(t);if(n){var i=l[n.id];i.match=!0,i.childrenMatch.indexOf(t)<0&&i.childrenMatch.push(t),e(n.id)}}(e.id),n.addClass("search-editor-highlight"),m(i.createContentText(n)),f&&(o.addClass("search-note-match search-editor-highlight"),m(i.createContentText(o))));l[e.id]={match:u,childrenMatch:[]}}function m(e){var t=e.plainText.toLowerCase();$.each(c,function(n,i){for(var o=(i=i.toLowerCase()).length,r=t.indexOf(i);r>-1;){for(var a=r;a=0)return;n=o.val()+" "+e}else n=e;var r=$(".search-animation");0==r.length&&(r=$('
    ').appendTo("body")),r.text(e);var a=t.offset();r.css({left:a.left,top:a.top}).show(),i.show(!1);var s=o.offset();r.animate({left:s.left+50,top:s.top},300,function(){o.val(n),i.search(),r.hide()})}},t.show=function(e){void 0===e&&(e=!0),g.show(),e&&p.input.focus(),p.entrance.addClass("active")},t.cancel=function(){d&&(w(),p.input&&p.input.val("")),g&&g.hide(),p.entrance&&p.entrance.removeClass("active")},t.isSearching=function(){return d},t.toggleExpand=function(e){var t=a.getNodeContainer(e);t.hasClass(h)||t.hasClass(u)?(t.removeClass(u),t.addClass(f),t.children(".children").children(".search-un-match:not(."+u+",."+f+")").each(function(){var e=$(this);e.find(".node").length&&e.addClass(u)})):(t.removeClass(f),t.addClass(u));t.removeClass(h)}}.call(t,n,t,e))||(e.exports=i)},7:function(e,t,n){"use strict";var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},r=i(n(20)),a=o(n(13)),s=r.default.getInstance(),d={freeTopicCount:200,saveDelayMills:1500,overQueueSaveDelayMills:500,features:{exportPng:!0},scrollContainer:$("#scroll-content"),getAboutProLink:function(){return"/about/pro"},initUpgradeBtn:function(e){e.attr({href:"/upgrade",target:"_blank"})},onOpenMind:null,onCloseMind:null,delayRelocateMindMap:!1,openLink:function(e){var t=e.attr("href");window.open(t,"_blank").focus()},onPopChangeEvent:function(e){a.default.readonly||s.trigger(r.IOEvent.CHANGE_CLIENT,e)},onDrillEvent:function(e){s.trigger(r.IOEvent.DRILL,e)},getImageURL:function(e){return window.cdn_origin+e},enableWatermark:!0};e.exports=d},81:function(e,t,n){var i;void 0===(i=function(e,t){var i=n(0),o=n(4),r=n(3),a=n(15);t.download=function(e,t){return i.post(e,t).then(function(e){var t=e.data;t&&t.url&&function(e){var t=$("#download-container");0==t.length&&((t=$('').appendTo("body")).append(''),t.append('
    '));var n=t.find("form");n.attr("action",a.serverHost+"/download/"+e),n.empty(),n.submit()}(t.url)})},t.downloadBlob=function(e,t){if(window.navigator.msSaveOrOpenBlob)navigator.msSaveBlob(e,t);else if(o.isChrome()){var n=document.createElement("a");n.href=window.URL.createObjectURL(e),n.download=t,n.target="_blank",n.click(),URL.revokeObjectURL(n.href)}else{$("#dlg-mind-dl").remove();var i,r=$('
    图片已生成
    您的图片已经生成,如需要保存图片,您可以在图片上右键,在菜单中选择「存储图像为...」
    ').appendTo("body"),a=r.find(".body"),s="";o.isSafari()?(s="如需保存图片,请在以上图片右键,在菜单中选择「存储图像为...」",i=$('关闭').appendTo(a)):((i=$('下载图片').appendTo(a)).attr("href",window.URL.createObjectURL(e)),i.attr("download",t));var d=$(''),l=r.find(".preview").removeClass("align-start");d.on("load",function(){$(this).height()>r.find(".preview").height()&&l.addClass("scroll")}),l.append(d),a.find(".download-desc").text(s),i.on("click",function(){$("#dlg-mind-dl").dlg("close")}),r.dlg()}},t.downloadCanvas=function(e,t){var n=e.toDataURL("image/png"),i=r.dataURItoBlob(n);this.downloadBlob(i,t)}}.call(t,n,t,e))||(e.exports=i)},82:function(e,t,n){var i;void 0===(i=function(e,t){var i,o=n(14),r=n(7);t.draw=function(e,t,n,a){if(r.enableWatermark)try{e.textBaseline="middle",e.font='14px SourceSansPro,-apple-system,BlinkMacSystemFont,"PingFang SC",Helvetica,Arial,"Microsoft YaHei",微软雅黑,黑体,Heiti,sans-serif,SimSun,宋体,serif';var s=o.get().name,d=t/2-(e.measureText("by "+s+" 由 幕布 发布").width+12)/2,l=n-24;e.fillStyle="#a0a0a0";var c="by ",u=e.measureText(c).width;e.fillText(c,d,l),d+=u,e.fillStyle="#eab17e";var f=e.measureText(s).width;e.fillText(s,d,l),d+=f,e.fillStyle="#a0a0a0",c=" 由 ",u=e.measureText(c).width,e.fillText(c,d,l),d+=u,e.drawImage(i,d,l-6-.5,12,12),d+=12,e.fillStyle="#eab17e",c=" 幕布 ",u=e.measureText(c).width,e.fillText(c,d,l),d+=u,e.fillStyle="#a0a0a0",e.fillText("发布",d,l)}catch(e){}},r.enableWatermark&&setTimeout(function(){(i=new Image).src='data:image/svg+xml;utf-8,'},200)}.call(t,n,t,e))||(e.exports=i)},87:function(e,t,n){(function(i,o){var r;void 0===(r=function(e,t){var r,a,s,d,l,c,u=n(3),f=n(12),h=n(4),p=n(23),g=n(122),v=n(5),m=n(7),y=!1,w={},_=1,b=Math.max(Math.max(screen.width,screen.height)/2,800),C=!1,x=$(document.createElement("div"));t.eventEmitter=x;var T,k,M,S,N,I={default:{lineColor:"#d9d9d9",bgColor:"#393c41"},classic:{lineColor:"#ced6da",bgColor:"#e6eef2"},blueprint:{lineColor:"#ccf0fb",bgColor:"#00b5ed",bgImage:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAABuUlEQVQ4y0VUi27EIAzL//9MS0vLtbft9pL2MaXc3b5giZ0wCSEaArEdU5Gvp9weNn885Nps/XKXd0R+fuXtLq8YusXFJzJviNj3pcnWJFdZThkPyaekasF0yN4sMleby2kJw2FDc6YqdndGqn5vmPfmkfX0PJ7U3SniI64wDCuuzLh+R4YOBi1+WuUZxzRhRU09qVtGUkN6q3LQkALW9YxtjSdU0OyMMYACOeowzpqRY5vHFGQBFjsGkAsKzsgpgGOwVdghrp+rz6k61B0oSGoJCRh3ztSgk9nATYMLRCKKDdnr6aQSMg02mbCa7lEYKt+ZLyEbjxGgfD/9MAmz/gpWOeDoASrH+kNchz4DWKpehMxz9X4Swhxqs1t0jnGmn6bYJlt2khXGw+WgbFtzLYwzNegG6Cb1AyESR4kcq6wmSWGGApJcE3AJM9NtXTPq4n2+tv8mX0IVykM/ExrJp7jCnh7F7L5hhZ7n3QrYpL1AYHu9dIgbqMajQ88Z5C7nElrMrDxEhyhvd/J4eEv6U+PbHCLHWkWe5fTsHCYnBVbmn6D7n2uTqvtGM/hXoau46L+O3mc64tL+ACwpi9fme+GxAAAAAElFTkSuQmCC"},f1:{lineColor:"#595959",bgColor:"#dfdfdf",bgImage:"iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTdEMUQwM0NGQzM1MTFFODg2QTNERjMyNjc4NUQ3QUEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTdEMUQwM0RGQzM1MTFFODg2QTNERjMyNjc4NUQ3QUEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5N0QxRDAzQUZDMzUxMUU4ODZBM0RGMzI2Nzg1RDdBQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5N0QxRDAzQkZDMzUxMUU4ODZBM0RGMzI2Nzg1RDdBQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ps9LsPsAAABdSURBVHjaxNGxDcAwCARADOy/IKsAiZWI7yLZLshXLrB0D8PM6ImqUuWqiEhEjAoGmI5y+E2/bJk5Ve8bA+7+C3LLhkbNyHnNdRsaNSO3bNh2M5KZ121o1Iu8BRgA6GJo2uYS8pIAAAAASUVORK5CYII="},fresh:{lineColor:"#dfcef2",bgColor:"#fff"},fruit:{lineColor:"#ced1d1",bgColor:"#fff"},nature:{lineColor:"#c8ae9f",bgColor:"#e4cfc4"},vanilla:{lineColor:"#dcce9f",bgColor:"#f6f0c1",bgImage:"iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTM4IDc5LjE1OTgyNCwgMjAxNi8wOS8xNC0wMTowOTowMSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTcgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OTdEMUQwNDBGQzM1MTFFODg2QTNERjMyNjc4NUQ3QUEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OTk1MUVGNDhGQzM3MTFFODg2QTNERjMyNjc4NUQ3QUEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5N0QxRDAzRUZDMzUxMUU4ODZBM0RGMzI2Nzg1RDdBQSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5N0QxRDAzRkZDMzUxMUU4ODZBM0RGMzI2Nzg1RDdBQSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pg4ePsIAAAK6SURBVHjaLJTrbtNAEIXnsnbShLQgQEL85Pl5MKSKS0mbJvbuDN+4RNbGsedy5pwz0fPjd7N9iqhN0c/qdxLDp4cY17E+WdvzRm1WnUR486JiEQvB7sfm7UH9lHET203tY4yL+pwaon0+fBvj2fydZET/Sw+f3pHfpk+iHusfG/1v5lCdM14pQRPJzo23D5GcDzKuhHo7pcr2/JDjVXJ4uzdr96oN0OZHqogYbekW4yxJzCVyyXEGaqFTzbRqILyUtkE6izWt/AM41XY5rpwRrwRQPWuWnekx+ovkDQhCIXL49ulz5krzGK9eoeBsKWEGliXW3wZmOgtD7QS2xMWZLqDu2tdHaJC3buMCvJTBOyglzufP+n+oEHrUJwtsipnd+fTR/ETn6g95NVJm9rH83M5H0kb/436KuBUFgG0fMm+taKAPTIwlq8XxLZ/f6lPEi0/EdUD12482f0o1AjZqJtukvxRsbdSWN0rjWr3RLEehjY5J2v4r0GJ9qonUmKhhqRJzEykqZ5HRtR00ta8/fXof+EQ386GouLUj3SBfxq1hHbWD6i4TYSi3V07BYmvbfYEhSIE/93uYV2mRK9Mq+cWXHymJvTCZqnPCCsLWYOuviE0egNYTJdN0RjnzBykP2IGRGExRkn65bKxutXxXOseFe5iRWhEf9dPKKhTq6y+ems01MKvDeLmwA6WklpC1RuOZUBQCgdt+s1AXm8uVIUSf3FmpZ9BmDbz4dD/607ahizqkOPzTQMsjaLkv2CUXZLBSSFK47kxwf3DVeuTNDDjbqmX38tkC55uduhWGIOJQxHA/GHKt1Q+cmMUI21qIOsyXHYRaXoO290TjCojpG5jdJrhsgveadv296Vf/JKCq9aCQsfxL1Pay8cDrUDIILbdWfkI1CXiTi/6VI8ZQ6kf6O1bJ/k+AAQCpkxE+Hwcm2QAAAABJRU5ErkJggg=="},pro:{lineColor:"#828c96",bgColor:"#b4bcc3"},rose:{lineColor:"#c28c9f",bgColor:"#f9c8d9"}};function E(){if(M&&!M())return;C?$.alert({title:"请等待",content:"您的思维导图仍在绘制中,请等待绘制完成后再进行导出。"}):g.exportMindImage(_,r.theme)}function D(e){O(),a.find(".mind-menu").find("li[panel="+e+"]").addClass("active"),a.children(".mind-panel").hide();var t=a.children("."+e+"-panel").show();if($(document).on("mousedown.mind-panel",function(){O()}),$(".download-freemind").text("FreeMind"),$("#mind-download-image").text("图片"),"style"==e&&f.isMobile){var n=$(window).height()-110;n>565?t.height("auto"):t.height(n-20)}}function O(){a.children(".mind-panel").hide(),$(document).off("mousedown.mind-panel"),a.children(".mind-menu").find(".active").removeClass("active")}function A(){d.css({width:d.width()+20,top:b,left:b}),s.css({width:d.width()*_+b,height:d.height()*_+b,"padding-top":b,"padding-left":b})}function P(e){void 0===e&&(e=!0),s.attr("class","mind-canvas theme-"+r.theme),$("#mind-bg-holder").remove();var t=$('
    ').appendTo(a);t.data("color",T.bgColor);var n=T.bgImage;n?($("").appendTo(t).attr("src","data:image/png;base64,"+n),s.css({"background-image":"url(data:image/png;base64,"+n+")","background-repeat":"repeat"})):s.css({"background-image":"none"});s.css({width:2e4,height:2e4,"background-color":T.bgColor}),d.css("width","auto"),d.empty(),r.structure&&"org"==r.structure?d.addClass("struct-org"):d.removeClass("struct-org"),d.css("transform","scale("+_+")");var i,h=$('
    ').appendTo(d),g=$('
    '),v=g.find(".topic"),m=$.parseHTML('
    ');if(m=m[0],null==l)i=r.nodes,m.innerText=c;else{var y=w[l].node;i=y.children,m.innerHTML=y.text,m=$(m),p.makeContentSafe(m),v.data("topic",l)}v.append(m),g.appendTo(h);var b=r.structure;if("default"==b){var x=0;u.recursive(i,function(){x++});var k="",M=!1,S=0;u.recursive(i,function(e,t){S++,M||null!=t&&t.id!=l||S>Math.ceil(x/2)&&(k=e.id,M=!0)});var I=$('
    ').appendTo(d),E="right";u.recursive(i,function(e,t){return e.id==k&&(I=$('
    ').prependTo(d),E="left"),L(e,I,E)})}else if("org"==b){h.addClass("org-root");I=$('
    ').appendTo(d),E=b;u.recursive(i,function(e){return L(e,I,E)})}else{I="right"==b?$('
    ').appendTo(d):$('
    ').prependTo(d);E=b;u.recursive(i,function(e){return L(e,I,E)})}A(),B(),e&&j(),function(e){if(U(),!e||0==e.length)return;var t=$(".topic.central").offset(),n=[],i=e.length-1;for(;i>=0;){var r=e[i],a=d.find("#tp-"+r.id),s=a.offset();r.distance=Math.sqrt(Math.pow(s.left-t.left,2)+Math.pow(s.top-t.top,2)),n.push(r),i--}n.sort(function(e,t){return e.distance-t.distance});var l=0;C=!0,function e(){if(null==d)return!1;var t=l+10;for(var i=l;i
    ');o.addClass(n);var a,s=w[e.id].parent;if(null==s||l&&l==s.id)i=t,a="sub",o.addClass("main-container").data("topic",e.id);else{var c=d.find("#tp-"+s.id);a="child",0==(i=c.children(".tp-children")).length&&(i=$('
    ').appendTo(c))}var u=o.find(".topic");u.data("topic",e.id);var f=$.parseHTML('
    '+e.text+"
    ");if((f=$(f)).addClass("theme-"+r.theme),p.makeContentSafe(f),u.append(f),e.note){var h=$('
    ');h.data("topic",e.id),h.appendTo(f)}if(e.images&&e.images.length>0){var g=$('
    ');f.append(g),$.each(e.images,function(e,t){var n=$('
    '),i=$('
    ').appendTo(n),o=$(''),r=t.w||t.ow;r>500&&(r=500);var a=Math.round(r/t.ow*t.oh);o.css({width:r,height:a}),i.append(o),g.append(n);var s=$('
    图片加载中...
    ');if(s.css({width:r,height:a}),i.append(s),o.on("load",function(){$(this).removeClass("loading"),s.remove()}),m.getImageURL){var d=m.getImageURL(t.uri);"string"==typeof d?o.attr("src",d):d.then(function(e){o.attr("src",e)})}})}return i.append(o),!e.collapsed&&!e.autoCollapsed||(o.addClass("collapsed"),!1)}function R(e){var t=_+e,n={x:$(window).width()/2,y:$(window).height()/2};Y(t,{x:(a.scrollLeft()+n.x-b)/_,y:(a.scrollTop()+n.y-b)/_},n)}function Y(e,t,n){if(e>5&&(e=5),e<.3&&(e=.3),s.css({width:2e4,height:2e4}),d.css("width","auto"),_=e,!h.isMobile()){var i=$("#mind-zoom-tip");0==i.length&&(i=$('
    ').appendTo(".mind-menu")),i.text(Math.round(100*_)+"%"),i.show(),clearTimeout(S),S=setTimeout(function(){i.fadeOut(150)},1e3)}d.css("transform","scale("+_+")"),A(),a.scrollLeft(t.x*_+b-n.x),a.scrollTop(t.y*_+b-n.y)}function B(){var e;($(".main-linker").remove(),null==l)?e=r.nodes:e=w[l].node.children;if(e&&0!=e.length){var t=$(".topic.central"),n=t.position(),i={x:n.left/_+t.outerWidth()/2};"org"==r.structure?i.y=n.top/_+t.outerHeight():i.y=n.top/_+t.outerHeight()/2,$.each(e,function(e,t){!function(e){var t=$("#tp-"+e.id);if(0==t.length)return!0;var n=$('
    '),o=t.children(".tp-box"),a=o.position();if("org"==r.structure){var s,l,c={y:0,h:(g={x:a.left/_+o.width()/2-i.x,y:a.top/_-i.y}).y};g.x>0?(c.x=0,c.w=g.x,s=0,l=c.w):(c.x=g.x,c.w=Math.abs(g.x),s=c.w,l=0);var u=c.w>2?c.w:2,f=c.h>2?c.h:2;n.css({left:i.x+c.x+1,top:i.y+c.y,width:u,height:f}),n.appendTo(d);var h="M"+s+",0 L"+s+","+c.h/2+" L"+l+","+c.h/2+" L"+l+","+c.h,p='';n.append(p).attr("path-d",h)}else{var g;c={},(g={x:a.left/_-i.x,y:a.top/_-i.y+o.outerHeight()/2}).x>0?(c.x=0,c.w=g.x):(c.x=g.x+o.width(),c.w=Math.abs(g.x+o.width())),c.h=Math.abs(g.y);var v={};g.y>0?(c.y=0,g.x>0?(v.y1=0,v.y2=c.h):(v.y1=c.h,v.y2=0)):(c.y=g.y,g.x>0?(v.y1=c.h,v.y2=0):(v.y1=0,v.y2=c.h)),u=c.w>2?c.w:2,f=c.h>2?c.h:2,n.css({left:i.x+c.x,top:i.y+c.y-1,width:u,height:f}),n.appendTo(d),h="M0,"+v.y1,g.x>0?h+=" C0,"+c.h/2+" "+c.w/2+","+v.y2+" "+c.w+","+v.y2:h+=" C"+c.w/2+","+v.y1+" "+c.w+","+c.h/2+" "+c.w+","+v.y2,p='',n.append(p).attr("path-d",h)}}(t)})}}function U(){f.isMobile?clearTimeout(N):i(N)}function z(e){if(e.children&&0!=e.children.length){var t=$("#tp-"+e.id),n=t.children(".tp-box"),i=n.children(".topic"),o=t.children(".tp-children");o.children(".linker-container").remove(),i.children(".tp-expand-box").remove();var c,f=$('
    ').appendTo(i),h=w[e.id].parent;if(null==h||l&&l==h.id?(c=o.height()/2,"org"==r.structure?f.css({top:n.height()+6,left:12}):f.css("top",n.height()/2-1)):(c=o.height()/2+n.height()/2-4,f.css("top",n.height()-5)),f.css("background",T.lineColor),f.children().on("click",function(){!function(e){s.css({width:2e4,height:2e4}),d.css("width","auto");var t=e.parents(".main-container").data("topic"),n=w[t].node,i=e.data("topic"),o=w[i].node,r=o.collapsed||o.autoCollapsed;o.collapsed=!r,delete o.autoCollapsed;var l=$("#tp-"+i),c=l.children(".tp-box"),f=c.offset();if(0==l.children(".tp-children").length){var h="org";l.hasClass("left")?h="left":l.hasClass("right")&&(h="right"),u.recursive(o.children,function(e){return L(e,null,h)})}l.toggleClass("collapsed"),A(),B(),z(n);var p=c.offset(),g={left:p.left+a.scrollLeft(),top:p.top+a.scrollTop()};a.scrollLeft(g.left-f.left),a.scrollTop(g.top-f.top)}($(this))}),!e.collapsed&&!e.autoCollapsed){"org"==r.structure&&(c=0);for(var p=0;p').appendTo(o),y=v.position().top/_+v.height()-4,b=Math.abs(y-c);b=b>2?b:2;var C=v.width()+8;C=C>2?C:2;var x=Math.min(c,y);m.css("top",x);var k=c-x,M=y-x,S=0,N=C;t.hasClass("left")&&(S=C,N=0);var I="M"+S+","+k;if(Math.abs(y-c)>=8)I+=" L"+S+","+(yk&&0,I+=" Q"+S+","+M+" "+(N';m.append(E).attr("path-d",I),z(g)}}}}function j(){var e=$(window),t=$(".topic.central"),n=t.position(),i=d.width()*_,o=d.height()*_;if(ia&&(l(2),y=!0),d>a&&l(1),d>a&&l(0),d>s&&(o="drill"==t?"所选分支主题下内容太多,无法浏览思维导图,":"此文档主题条目太多,无法浏览思维导图,",$.alert({title:"无法查看思维导图",content:'
    '+o+'您可以:
    1. 折叠不重要的主题
    2. 点击某一子主题,进入主题后,导出相应的主题
    思维导图最多能显示'+s+"条主题。
    "}),!0)}function F(){var e=a.find(".mind-dir");if(0==e.length&&(e=$('
    ').appendTo(a)),l){var t=[],n=l;if(n){for(;;){var i=w[n].parent;if(null==i)break;t.push(i),n=i.id}t.reverse()}if(e.empty().show(),f.isMobile){e.css("top",20+(window.statusBarSpacing||0));var o=null;if(t.length>0){var r=t[t.length-1];o=r.id}$('
    上一级
    ').appendTo(e).on("click",function(){W(o)})}else{$('
    ').appendTo(e).find(".dir-text").text(c);for(var s=0;s
    '+u.htmlToText(d.text)+"
    ").appendTo(e).data("node-id",d.id)}e.off().on("click",".item",function(){W($(this).data("node-id"))})}e.off(f.downEvent).on(f.downEvent,function(e){e.stopPropagation()})}else e.hide()}t.init=function(e){e.onSettingChanged&&(k=e.onSettingChanged),e.onExport&&(M=e.onExport)},t.close=function(){$(".mind-exit-btn").trigger("click")},t.open=function(e,t,n){if("Microsoft Internet Explorer"==navigator.appName&&navigator.appVersion.toLowerCase().indexOf("msie 9.0")>=0)$.alert({title:"请升级您的浏览器",content:'您正在使用低版本的IE浏览器,无法查看思维导图。
    请升级您的浏览器,或查看当前处于否是兼容模式或低版本仿真模式。
    查看推荐浏览器'});else{var i=document.URL.indexOf("/doc/")>=0?"reading-enter":"enter";v.log("click_mindmap_mode",{action:i});if(r=$.extend(!0,{structure:"default",theme:"default"},e),w={},r.nodes&&r.nodes.length>0&&u.recursive(r.nodes,function(e,t){w[e.id]={node:e,parent:t||null}}),!H(n)){c=t,l=n,m.onOpenMind&&m.onOpenMind(),_=f.isMobile?.7:1,T=I[r.theme],$("#mind-screen").remove(),a=$('
    ').appendTo("body"),s=$('
    ').appendTo(a),f.isMobile&&a.addClass("mobile-style"),d=$('
    ').appendTo(s);var o=function(){var e=$('
    ').appendTo("body"),t=$('');e.append(t);var n=$('
  • ');t.append(n),n.on("click",function(){var e=.2;_<1&&(e=.15),R(e),O(),v.log("change_mindmap_view",{action:"zoom-in"})});var i=$('
  • ');t.append(i),i.on("click",function(){var e=.2;_<=1&&(e=.15),R(-e),O(),v.log("change_mindmap_view",{action:"zoom-out"})});var o=$('
  • ');t.append(o),o.on("click",function(){$(this).hasClass("active")?O():D("style"),v.log("change_mindmap_view",{action:"structure_and_style"})}),f.isMobile&&e.addClass("mobile-style");if(!f.isMobile||"app"===m.env){var s=$('
  • ');t.append(s),s.on("click",function(){window.isApp?E():D("export"),v.log("click_download_btn",{file_type:"mindmap"})})}var c=$('
  • 退出
  • ');return t.append(c),c.on("click",function(){a.css("opacity",0),e.remove(),m.onCloseMind&&m.onCloseMind(),d=null,U(),setTimeout(function(){a.remove(),x.triggerHandler("exit")},400),$(document).off("keydown.mind")}),e.on("mousedown",function(e){e.stopPropagation()}),function(){var e=$('
    ').appendTo(a);e.append('
    结构
    ');var t=$('
      ').appendTo(e);t.append('
    • '),t.append('
    • '),t.append('
    • '),t.append('
    • '),e.append('
      风格
      ');var n=$('
        ').appendTo(e);for(var i in I)n.append('
      • ');t.find("."+r.structure).addClass("active"),n.find("."+r.theme).addClass("active"),t.find("li").on("click",function(){var e=$(this).data("st");if(k){var n=k("structure",e);if(!n)return}t.find(".active").removeClass("active"),$(this).addClass("active"),function(e){r.structure=e,P()}(e),v.log("change_mindmap_view",{action:"structure-"+e})}),n.find("li").on("click",function(){var e=$(this).data("th");if(k){var t=k("theme",e);if(!t)return}n.find(".active").removeClass("active"),$(this).addClass("active"),function(e){r.theme=e,T=I[r.theme],P(!1)}(e),v.log("change_mindmap_view",{action:"theme-"+e})}),e.append('
        '),e.on("mousedown",function(e){e.stopPropagation()});var o=$('
        ').appendTo(a);o.append('
        FreeMind
        图片
        '),o.on("mousedown",function(e){e.stopPropagation()}),o.find(".image").on("click",function(){E(),v.log("download_file",{file_type:"mindmap_image"})}),o.find(".freemind").on("click",function(){if(M){var e=M();if(!e)return}var t;if(v.log("download_file",{file_type:"freemind"}),null==l)t=r.nodes;else{var n=w[l].node;t=n.children}g.exportFreeMind(t,r.structure)}),o.find(".freemind").tooltip()}(),$(document).on("keydown.mind",function(e){27==e.keyCode?c.trigger("click"):219==e.keyCode&&e.preventDefault()}),e}();m.delayRelocateMindMap&&o.hide(),P(),F(),a.on("mousedown",function(e){var t=e;e.originalEvent.touches&&(t=e.originalEvent.touches[0]),$(".topic-note-menu").remove();var n=a.scrollLeft(),i=a.scrollTop();$(this).on("mousemove",function(e){var o=e;e.originalEvent.touches&&(o=e.originalEvent.touches[0]);var r={left:o.pageX-t.pageX,top:o.pageY-t.pageY};a.scrollLeft(n-r.left),a.scrollTop(i-r.top)}),$(this).on("mouseup",function(){$(this).off("mouseup").off("mousemove")})}),a.on("click",function(e){$(".topic-note-menu").remove()}),a.on(f.downEvent,".topic-text",function(e){var t=e;e.originalEvent.touches&&(t=e.originalEvent.touches[0]);var n=$(this);n.off().on(f.upEvent,function(e){var n=e;if(e.originalEvent.changedTouches&&(n=e.originalEvent.changedTouches[0]),!(Math.abs(n.pageX-t.pageX)>10||Math.abs(n.pageY-t.pageY)>10)){var i=$(this).parent().data("topic");W(i)}}),a.on(f.upEvent,function(){n.off(f.upEvent)})}),a.on(f.downEvent,".topic-note",function(e){e.stopPropagation()}),a.on("click",".topic-note",function(e){e.stopPropagation();var t=$(this),n=t.data("topic"),i=w[n].node;$(".topic-note-menu").remove();var o=$('
        ').appendTo(d),r=($('
        ').appendTo(o),$.parseHTML('
        '+i.note+"
        "));r=$(r),p.makeContentSafe(r),o.append(r),o.css({left:t.offset().left/_-d.offset().left/_-o.outerWidth()/2+9,top:t.offset().top/_-d.offset().top/_+30}),o.on(f.downEvent,function(e){e.stopPropagation()})}),a.on(f.downEvent,".content-link",function(e){e.stopPropagation()}),a.on("click",".content-link",function(e){e.stopPropagation(),e.preventDefault();var t=$(this);m.openLink&&m.openLink(t,e)}),a.on("touchstart",function(e){var t=e.originalEvent.touches;if(2===t.length){e.preventDefault();var n=_,i={x:t[0].pageX,y:t[0].pageY},o={x:t[1].pageX,y:t[1].pageY},r=G(i,o),s={x:(i.x+o.x)/2,y:(i.y+o.y)/2},d={x:(a.scrollLeft()+s.x-b)/n,y:(a.scrollTop()+s.y-b)/n};a.on("touchmove.scale",function(e){var t=e.originalEvent.touches,i={x:t[0].pageX,y:t[0].pageY},o={x:t[1].pageX,y:t[1].pageY},a=G(i,o),s=a/r*n,l={x:(i.x+o.x)/2,y:(i.y+o.y)/2};Y(s,d,l)}),a.on("touchend.scale",function(){a.off("touchmove.scale").off("touchend.scale")})}}),a.css("opacity",1),function(){f.isMobile||localStorage&&localStorage.mindTip||(localStorage&&(localStorage.mindTip=!0),setTimeout(function(){$(".mind-tip").remove();var e=$('
        ');a.append(e),e.append('
        小提示
        '),e.append('
        点击某一个主题,可以进入此主题,让您更专注!
        '),e.append(''),e.find(".close").on("click",function(){e.fadeOut()}),e.fadeIn(),setTimeout(function(){e.fadeOut()},15e3)},1500));y&&setTimeout(function(){var e=$('
        文档内容过多,已自动为您收缩部分子主题
        ').appendTo("body");e.fadeIn(),setTimeout(function(){e.fadeOut(function(){e.remove()})},4e3)},1500)}(),a.on("keydown",function(e){e.stopPropagation()}),m.delayRelocateMindMap?setTimeout(function(){j(),o.fadeIn(200),d.css("opacity",1)},400):d.css("opacity",1)}}}}.call(t,n,t,e))||(e.exports=r)}).call(this,n(38).clearImmediate,n(38).setImmediate)},94:function(e,t,n){"use strict";function i(e,t){if(e===t)return null;for(var n=0,i=0;e[n]===t[i];)n+=1,i+=1;for(var o=e.length,r=t.length;e[o]===t[r]&&o!==n&&r!==i;)o-=1,r-=1;return n===o&&e.lengtht.length?{offset:n,remove:e.substring(n,o),insert:""}:{offset:n,remove:e.substring(n,o+1),insert:t.substring(i,r+1)}}Object.defineProperty(t,"__esModule",{value:!0}),t.diff=i,t.diffCursor=function(e,t,n){var o=i(e,t);if(null===o)return n;var r,a=n[0],s=void 0===a?0:a,d=n[1],l=void 0===d?0:d;return o.offset<=s&&((r=o.insert.length-o.remove.length)>0?s+=r:s-=Math.min(s-o.offset,Math.abs(r))),o.offset<=l&&((r=o.insert.length-o.remove.length)>0?l+=r:l-=Math.min(l-o.offset,Math.abs(r))),[s,l]},t.getDistance=function(e,t){for(var n=e.split(""),i=t.split(""),o=Array(n.length+1).fill(Array(i.length+1)),r=0,a=n.length+1;r