/*! Summernote v0.6.9 | (c) 2013-2015 Alan Hong and other contributors | MIT license */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(window.jQuery)}(function(a){Array.prototype.reduce||(Array.prototype.reduce=function(a){var b,c=Object(this),d=c.length>>>0,e=0;if(2===arguments.length)b=arguments[1];else{for(;d>e&&!(e in c);)e++;if(e>=d)throw new TypeError("Reduce of empty array with no initial value");b=c[e++]}for(;d>e;e++)e in c&&(b=a(b,c[e],e,c));return b}),"function"!=typeof Array.prototype.filter&&(Array.prototype.filter=function(a){for(var b=Object(this),c=b.length>>>0,d=[],e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d});var b,c="function"==typeof define&&define.amd,d=function(b){var c="Comic Sans MS"===b?"Courier New":"Comic Sans MS",d=a("
").css({position:"absolute",left:"-9999px",top:"-9999px",fontSize:"200px"}).text("mmmmmmmmmwwwwwww").appendTo(document.body),e=d.css("fontFamily",c).width(),f=d.css("fontFamily",b+","+c).width();return d.remove(),e!==f},e=navigator.userAgent,f={isMac:navigator.appVersion.indexOf("Mac")>-1,isMSIE:/MSIE|Trident/i.test(e),isFF:/firefox/i.test(e),isWebkit:/webkit/i.test(e),isSafari:/safari/i.test(e),jqueryVersion:parseFloat(a.fn.jquery),isSupportAmd:c,hasCodeMirror:c?require.specified("CodeMirror"):!!window.CodeMirror,isFontInstalled:d,isW3CRangeSupport:!!document.createRange},g=function(){var b=function(a){return function(b){return a===b}},c=function(a,b){return a===b},d=function(a){return function(b,c){return b[a]===c[a]}},e=function(){return!0},f=function(){return!1},g=function(a){return function(){return!a.apply(a,arguments)}},h=function(a,b){return function(c){return a(c)&&b(c)}},i=function(a){return a},j=0,k=function(a){var b=++j+"";return a?a+b:b},l=function(b){var c=a(document);return{top:b.top+c.scrollTop(),left:b.left+c.scrollLeft(),width:b.right-b.left,height:b.bottom-b.top}},m=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=c);return b},n=function(a,b){return b=b||"",b+a.split(".").map(function(a){return a.substring(0,1).toUpperCase()+a.substring(1)}).join("")};return{eq:b,eq2:c,peq2:d,ok:e,fail:f,self:i,not:g,and:h,uniqueId:k,rect2bnd:l,invertObject:m,namespaceToCamel:n}}(),h=function(){var b=function(a){return a[0]},c=function(a){return a[a.length-1]},d=function(a){return a.slice(0,a.length-1)},e=function(a){return a.slice(1)},f=function(a,b){for(var c=0,d=a.length;d>c;c++){var e=a[c];if(b(e))return e}},h=function(a,b){for(var c=0,d=a.length;d>c;c++)if(!b(a[c]))return!1;return!0},i=function(b,c){return-1!==a.inArray(c,b)},j=function(a,b){return b=b||g.self,a.reduce(function(a,c){return a+b(c)},0)},k=function(a){for(var b=[],c=-1,d=a.length;++cc;c++)a[c]&&b.push(a[c]);return b},n=function(a){for(var b=[],c=0,d=a.length;d>c;c++)i(b,a[c])||b.push(a[c]);return b},o=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c+1]},p=function(a,b){var c=a.indexOf(b);return-1===c?null:a[c-1]};return{head:b,last:c,initial:d,tail:e,prev:p,next:o,find:f,contains:i,all:h,sum:j,from:k,clusterBy:l,compact:m,unique:n}}(),i=String.fromCharCode(160),j="\ufeff",k=function(){var b=function(b){return b&&a(b).hasClass("note-editable")},c=function(b){return b&&a(b).hasClass("note-control-sizing")},d=function(b){var c;if(b.hasClass("note-air-editor")){var d=h.last(b.attr("id").split("-"));return c=function(b){return function(){return a(b+d)}},{editor:function(){return b},holder:function(){return b.data("holder")},editable:function(){return b},popover:c("#note-popover-"),handle:c("#note-handle-"),dialog:c("#note-dialog-")}}return c=function(a){return function(){return b.find(a)}},{editor:function(){return b},holder:function(){return b.data("holder")},dropzone:c(".note-dropzone"),toolbar:c(".note-toolbar"),editable:c(".note-editable"),codable:c(".note-codable"),statusbar:c(".note-statusbar"),popover:c(".note-popover"),handle:c(".note-handle"),dialog:c(".note-dialog")}},e=function(b){var c=a(b).closest(".note-editor, .note-air-editor, .note-air-layout");if(!c.length)return null;var e;return e=c.is(".note-editor, .note-air-editor")?c:a("#note-editor-"+h.last(c.attr("id").split("-"))),d(e)},l=function(a){return a=a.toUpperCase(),function(b){return b&&b.nodeName.toUpperCase()===a}},m=function(a){return a&&3===a.nodeType},n=function(a){return a&&/^BR|^IMG|^HR/.test(a.nodeName.toUpperCase())},o=function(a){return b(a)?!1:a&&/^DIV|^P|^LI|^H[1-7]/.test(a.nodeName.toUpperCase())},p=l("LI"),q=function(a){return o(a)&&!p(a)},r=l("TABLE"),s=function(a){return!(w(a)||t(a)||o(a)||r(a)||v(a))},t=function(a){return a&&/^UL|^OL/.test(a.nodeName.toUpperCase())},u=function(a){return a&&/^TD|^TH/.test(a.nodeName.toUpperCase())},v=l("BLOCKQUOTE"),w=function(a){return u(a)||v(a)||b(a)},x=l("A"),y=function(a){return s(a)&&!!H(a,o)},z=function(a){return s(a)&&!H(a,o)},A=l("BODY"),B=function(a,b){return a.nextSibling===b||a.previousSibling===b},C=function(a,b){b=b||g.ok;var c=[];return a.previousSibling&&b(a.previousSibling)&&c.push(a.previousSibling),c.push(a),a.nextSibling&&b(a.nextSibling)&&c.push(a.nextSibling),c},D=f.isMSIE?" ":"
",E=function(a){return m(a)?a.nodeValue.length:a.childNodes.length},F=function(a){var b=E(a);return 0===b?!0:m(a)||1!==b||a.innerHTML!==D?h.all(a.childNodes,m)&&""===a.innerHTML?!0:!1:!0},G=function(a){n(a)||E(a)||(a.innerHTML=D)},H=function(a,c){for(;a;){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},I=function(a,c){for(a=a.parentNode;a&&1===E(a);){if(c(a))return a;if(b(a))break;a=a.parentNode}return null},J=function(a,c){c=c||g.fail;var d=[];return H(a,function(a){return b(a)||d.push(a),c(a)}),d},K=function(a,b){var c=J(a);return h.last(c.filter(b))},L=function(b,c){for(var d=J(b),e=c;e;e=e.parentNode)if(a.inArray(e,d)>-1)return e;return null},M=function(a,b){b=b||g.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.previousSibling;return c},N=function(a,b){b=b||g.fail;for(var c=[];a&&!b(a);)c.push(a),a=a.nextSibling;return c},O=function(a,b){var c=[];return b=b||g.ok,function d(e){a!==e&&b(e)&&c.push(e);for(var f=0,g=e.childNodes.length;g>f;f++)d(e.childNodes[f])}(a),c},P=function(b,c){var d=b.parentNode,e=a("<"+c+">")[0];return d.insertBefore(e,b),e.appendChild(b),e},Q=function(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a},R=function(b,c){return a.each(c,function(a,c){b.appendChild(c)}),b},S=function(a){return 0===a.offset},T=function(a){return a.offset===E(a.node)},U=function(a){return S(a)||T(a)},V=function(a,b){for(;a&&a!==b;){if(0!==X(a))return!1;a=a.parentNode}return!0},W=function(a,b){for(;a&&a!==b;){if(X(a)!==E(a.parentNode)-1)return!1;a=a.parentNode}return!0},X=function(a){for(var b=0;a=a.previousSibling;)b+=1;return b},Y=function(a){return!!(a&&a.childNodes&&a.childNodes.length)},Z=function(a,c){var d,e;if(0===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=X(a.node)}else Y(a.node)?(d=a.node.childNodes[a.offset-1],e=E(d)):(d=a.node,e=c?0:a.offset-1);return{node:d,offset:e}},$=function(a,c){var d,e;if(E(a.node)===a.offset){if(b(a.node))return null;d=a.node.parentNode,e=X(a.node)+1}else Y(a.node)?(d=a.node.childNodes[a.offset],e=0):(d=a.node,e=c?E(a.node):a.offset+1);return{node:d,offset:e}},_=function(a,b){return a.node===b.node&&a.offset===b.offset},aa=function(a){if(m(a.node)||!Y(a.node)||F(a.node))return!0;var b=a.node.childNodes[a.offset-1],c=a.node.childNodes[a.offset];return b&&!n(b)||c&&!n(c)?!1:!0},ba=function(a,b){for(;a;){if(b(a))return a;a=Z(a)}return null},ca=function(a,b){for(;a;){if(b(a))return a;a=$(a)}return null},da=function(a){if(!m(a.node))return!1;var b=a.node.nodeValue.charAt(a.offset-1);return b&&" "!==b&&b!==i},ea=function(a,b,c,d){for(var e=a;e&&(c(e),!_(e,b));){var f=d&&a.node!==e.node&&b.node!==e.node;e=$(e,f)}},fa=function(b,c){var d=J(c,g.eq(b));return a.map(d,X).reverse()},ga=function(a,b){for(var c=a,d=0,e=b.length;e>d;d++)c=c.childNodes.length<=b[d]?c.childNodes[c.childNodes.length-1]:c.childNodes[b[d]];return c},ha=function(a,b){var c=b&&b.isSkipPaddingBlankHTML,d=b&&b.isNotSplitEdgePoint;if(U(a)&&(m(a.node)||d)){if(S(a))return a.node;if(T(a))return a.node.nextSibling}if(m(a.node))return a.node.splitText(a.offset);var e=a.node.childNodes[a.offset],f=Q(a.node.cloneNode(!1),a.node);return R(f,N(e)),c||(G(a.node),G(f)),f},ia=function(a,b,c){var d=J(b.node,g.eq(a));return d.length?1===d.length?ha(b,c):d.reduce(function(a,d){return a===b.node&&(a=ha(b,c)),ha({node:d,offset:a?k.position(a):E(d)},c)}):null},ja=function(a,b){var c,d,e=b?o:w,f=J(a.node,e),g=h.last(f)||a.node;e(g)?(c=f[f.length-2],d=g):(c=g,d=c.parentNode);var i=c&&ia(c,a,{isSkipPaddingBlankHTML:b,isNotSplitEdgePoint:b});return i||d!==a.node||(i=a.node.childNodes[a.offset]),{rightNode:i,container:d}},ka=function(a){return document.createElement(a)},la=function(a){return document.createTextNode(a)},ma=function(a,b){if(a&&a.parentNode){if(a.removeNode)return a.removeNode(b);var c=a.parentNode;if(!b){var d,e,f=[];for(d=0,e=a.childNodes.length;e>d;d++)f.push(a.childNodes[d]);for(d=0,e=f.length;e>d;d++)c.insertBefore(f[d],a)}c.removeChild(a)}},na=function(a,c){for(;a&&!b(a)&&c(a);){var d=a.parentNode;ma(a),a=d}},oa=function(a,b){if(a.nodeName.toUpperCase()===b.toUpperCase())return a;var c=ka(b);return a.style.cssText&&(c.style.cssText=a.style.cssText),R(c,h.from(a.childNodes)),Q(c,a),ma(a),c},pa=l("TEXTAREA"),qa=function(a,b){var c=pa(a[0])?a.val():a.html();return b?c.replace(/[\n\r]/g,""):c},ra=function(b,c){var d=qa(b);if(c){var e=/<(\/?)(\b(?!!)[^>\s]*)(.*?)(\s*\/?>)/g;d=d.replace(e,function(a,b,c){c=c.toUpperCase();var d=/^DIV|^TD|^TH|^P|^LI|^H[1-7]/.test(c)&&!!b,e=/^BLOCKQUOTE|^TABLE|^TBODY|^TR|^HR|^UL|^OL/.test(c);return a+(d||e?"\n":"")}),d=a.trim(d)}return d};return{NBSP_CHAR:i,ZERO_WIDTH_NBSP_CHAR:j,blank:D,emptyPara:"

"+D+"

",makePredByNodeName:l,isEditable:b,isControlSizing:c,buildLayoutInfo:d,makeLayoutInfo:e,isText:m,isVoid:n,isPara:o,isPurePara:q,isInline:s,isBlock:g.not(s),isBodyInline:z,isBody:A,isParaInline:y,isList:t,isTable:r,isCell:u,isBlockquote:v,isBodyContainer:w,isAnchor:x,isDiv:l("DIV"),isLi:p,isBR:l("BR"),isSpan:l("SPAN"),isB:l("B"),isU:l("U"),isS:l("S"),isI:l("I"),isImg:l("IMG"),isTextarea:pa,isEmpty:F,isEmptyAnchor:g.and(x,F),isClosestSibling:B,withClosestSiblings:C,nodeLength:E,isLeftEdgePoint:S,isRightEdgePoint:T,isEdgePoint:U,isLeftEdgeOf:V,isRightEdgeOf:W,prevPoint:Z,nextPoint:$,isSamePoint:_,isVisiblePoint:aa,prevPointUntil:ba,nextPointUntil:ca,isCharPoint:da,walkPoint:ea,ancestor:H,singleChildAncestor:I,listAncestor:J,lastAncestor:K,listNext:N,listPrev:M,listDescendant:O,commonAncestor:L,wrap:P,insertAfter:Q,appendChildNodes:R,position:X,hasChildren:Y,makeOffsetPath:fa,fromOffsetPath:ga,splitTree:ia,splitPoint:ja,create:ka,createText:la,remove:ma,removeWhile:na,replace:oa,html:ra,value:qa}}(),l=function(){var b=function(a,b){var c,d,e=a.parentElement(),f=document.body.createTextRange(),g=h.from(e.childNodes);for(c=0;c=0)break;d=g[c]}if(0!==c&&k.isText(g[c-1])){var i=document.body.createTextRange(),j=null;i.moveToElementText(d||e),i.collapse(!d),j=d?d.nextSibling:e.firstChild;var l=a.duplicate();l.setEndPoint("StartToStart",i);for(var m=l.text.replace(/[\r\n]/g,"").length;m>j.nodeValue.length&&j.nextSibling;)m-=j.nodeValue.length,j=j.nextSibling;j.nodeValue;b&&j.nextSibling&&k.isText(j.nextSibling)&&m===j.nodeValue.length&&(m-=j.nodeValue.length,j=j.nextSibling),e=j,c=m}return{cont:e,offset:c}},c=function(a){var b=function(a,c){var d,e;if(k.isText(a)){var f=k.listPrev(a,g.not(k.isText)),i=h.last(f).previousSibling;d=i||a.parentNode,c+=h.sum(h.tail(f),k.nodeLength),e=!i}else{if(d=a.childNodes[c]||a,k.isText(d))return b(d,0);c=0,e=!1}return{node:d,collapseToStart:e,offset:c}},c=document.body.createTextRange(),d=b(a.node,a.offset);return c.moveToElementText(d.node),c.collapse(d.collapseToStart),c.moveStart("character",d.offset),c},d=function(b,e,i,j){this.sc=b,this.so=e,this.ec=i,this.eo=j;var l=function(){if(f.isW3CRangeSupport){var a=document.createRange();return a.setStart(b,e),a.setEnd(i,j),a}var d=c({node:b,offset:e});return d.setEndPoint("EndToEnd",c({node:i,offset:j})),d};this.getPoints=function(){return{sc:b,so:e,ec:i,eo:j}},this.getStartPoint=function(){return{node:b,offset:e}},this.getEndPoint=function(){return{node:i,offset:j}},this.select=function(){var a=l();if(f.isW3CRangeSupport){var b=document.getSelection();b.rangeCount>0&&b.removeAllRanges(),b.addRange(a)}else a.select();return this},this.normalize=function(){var a=function(a){return k.isVisiblePoint(a)||(a=k.isLeftEdgePoint(a)?k.nextPointUntil(a,k.isVisiblePoint):k.prevPointUntil(a,k.isVisiblePoint)),a},b=a(this.getStartPoint()),c=a(this.getEndPoint());return new d(b.node,b.offset,c.node,c.offset)},this.nodes=function(a,b){a=a||g.ok;var c=b&&b.includeAncestor,d=b&&b.fullyContains,e=this.getStartPoint(),f=this.getEndPoint(),i=[],j=[];return k.walkPoint(e,f,function(b){if(!k.isEditable(b.node)){var e;d?(k.isLeftEdgePoint(b)&&j.push(b.node),k.isRightEdgePoint(b)&&h.contains(j,b.node)&&(e=b.node)):e=c?k.ancestor(b.node,a):b.node,e&&a(e)&&i.push(e)}},!0),h.unique(i)},this.commonAncestor=function(){return k.commonAncestor(b,i)},this.expand=function(a){var c=k.ancestor(b,a),f=k.ancestor(i,a);if(!c&&!f)return new d(b,e,i,j);var g=this.getPoints();return c&&(g.sc=c,g.so=0),f&&(g.ec=f,g.eo=k.nodeLength(f)),new d(g.sc,g.so,g.ec,g.eo)},this.collapse=function(a){return a?new d(b,e,b,e):new d(i,j,i,j)},this.splitText=function(){var a=b===i,c=this.getPoints();return k.isText(i)&&!k.isEdgePoint(this.getEndPoint())&&i.splitText(j),k.isText(b)&&!k.isEdgePoint(this.getStartPoint())&&(c.sc=b.splitText(e),c.so=0,a&&(c.ec=c.sc,c.eo=j-e)),new d(c.sc,c.so,c.ec,c.eo)},this.deleteContents=function(){if(this.isCollapsed())return this;var b=this.splitText(),c=b.nodes(null,{fullyContains:!0}),e=k.prevPointUntil(b.getStartPoint(),function(a){return!h.contains(c,a.node)}),f=[];return a.each(c,function(a,b){var c=b.parentNode;e.node!==c&&1===k.nodeLength(c)&&f.push(c),k.remove(b,!1)}),a.each(f,function(a,b){k.remove(b,!1)}),new d(e.node,e.offset,e.node,e.offset).normalize()};var m=function(a){return function(){var c=k.ancestor(b,a);return!!c&&c===k.ancestor(i,a)}};this.isOnEditable=m(k.isEditable),this.isOnList=m(k.isList),this.isOnAnchor=m(k.isAnchor),this.isOnCell=m(k.isCell),this.isLeftEdgeOf=function(a){if(!k.isLeftEdgePoint(this.getStartPoint()))return!1;var b=k.ancestor(this.sc,a);return b&&k.isLeftEdgeOf(this.sc,b)},this.isCollapsed=function(){return b===i&&e===j},this.wrapBodyInlineWithPara=function(){if(k.isBodyContainer(b)&&k.isEmpty(b))return b.innerHTML=k.emptyPara,new d(b.firstChild,0,b.firstChild,0);if(k.isParaInline(b)||k.isPara(b))return this.normalize();var a;if(k.isInline(b)){var c=k.listAncestor(b,g.not(k.isInline));a=h.last(c),k.isInline(a)||(a=c[c.length-2]||b.childNodes[e])}else a=b.childNodes[e>0?e-1:0];var f=k.listPrev(a,k.isParaInline).reverse();if(f=f.concat(k.listNext(a.nextSibling,k.isParaInline)),f.length){var i=k.wrap(h.head(f),"p");k.appendChildNodes(i,h.tail(f))}return this.normalize()},this.insertNode=function(a){var b=this.wrapBodyInlineWithPara().deleteContents(),c=k.splitPoint(b.getStartPoint(),k.isInline(a));return c.rightNode?c.rightNode.parentNode.insertBefore(a,c.rightNode):c.container.appendChild(a),a},this.pasteHTML=function(b){var c=this,d=a("
").html(b)[0],e=h.from(d.childNodes);return this.wrapBodyInlineWithPara().deleteContents(),a.map(e.reverse(),function(a){return c.insertNode(a)}).reverse()},this.toString=function(){var a=l();return f.isW3CRangeSupport?a.toString():a.text},this.getWordRange=function(a){var b=this.getEndPoint();if(!k.isCharPoint(b))return this;var c=k.prevPointUntil(b,function(a){return!k.isCharPoint(a)});return a&&(b=k.nextPointUntil(b,function(a){return!k.isCharPoint(a)})),new d(c.node,c.offset,b.node,b.offset)},this.bookmark=function(a){return{s:{path:k.makeOffsetPath(a,b),offset:e},e:{path:k.makeOffsetPath(a,i),offset:j}}},this.paraBookmark=function(a){return{s:{path:h.tail(k.makeOffsetPath(h.head(a),b)),offset:e},e:{path:h.tail(k.makeOffsetPath(h.last(a),i)),offset:j}}},this.getClientRects=function(){var a=l();return a.getClientRects()}};return{create:function(a,c,e,g){if(arguments.length)2===arguments.length&&(e=a,g=c);else if(f.isW3CRangeSupport){var h=document.getSelection();if(!h||0===h.rangeCount)return null;if(k.isBody(h.anchorNode))return null;var i=h.getRangeAt(0);a=i.startContainer,c=i.startOffset,e=i.endContainer,g=i.endOffset}else{var j=document.selection.createRange(),l=j.duplicate();l.collapse(!1);var m=j;m.collapse(!0);var n=b(m,!0),o=b(l,!1);k.isText(n.node)&&k.isLeftEdgePoint(n)&&k.isTextNode(o.node)&&k.isRightEdgePoint(o)&&o.node.nextSibling===n.node&&(n=o),a=n.cont,c=n.offset,e=o.cont,g=o.offset}return new d(a,c,e,g)},createFromNode:function(a){var b=a,c=0,d=a,e=k.nodeLength(d);return k.isVoid(b)&&(c=k.listPrev(b).length-1,b=b.parentNode),k.isBR(d)?(e=k.listPrev(d).length-1,d=d.parentNode):k.isVoid(d)&&(e=k.listPrev(d).length,d=d.parentNode),this.create(b,c,d,e)},createFromNodeBefore:function(a){return this.createFromNode(a).collapse(!0)},createFromNodeAfter:function(a){return this.createFromNode(a).collapse()},createFromBookmark:function(a,b){var c=k.fromOffsetPath(a,b.s.path),e=b.s.offset,f=k.fromOffsetPath(a,b.e.path),g=b.e.offset;return new d(c,e,f,g)},createFromParaBookmark:function(a,b){var c=a.s.offset,e=a.e.offset,f=k.fromOffsetPath(h.head(b),a.s.path),g=k.fromOffsetPath(h.last(b),a.e.path);return new d(f,c,g,e)}}}(),m={version:"0.6.9",options:{width:null,height:null,minHeight:null,maxHeight:null,focus:!1,tabsize:4,styleWithSpan:!0,disableLinkTarget:!1,disableDragAndDrop:!1,disableResizeEditor:!1,shortcuts:!0,placeholder:!1,prettifyHtml:!0,iconPrefix:"fa fa-",icons:{font:{bold:"bold",italic:"italic",underline:"underline",clear:"eraser",height:"text-height",strikethrough:"strikethrough",superscript:"superscript",subscript:"subscript"},image:{image:"picture-o",floatLeft:"align-left",floatRight:"align-right",floatNone:"align-justify",shapeRounded:"square",shapeCircle:"circle-o",shapeThumbnail:"picture-o",shapeNone:"times",remove:"trash-o"},link:{link:"link",unlink:"unlink",edit:"edit"},table:{table:"table"},hr:{insert:"minus"},style:{style:"magic"},lists:{unordered:"list-ul",ordered:"list-ol"},options:{help:"question",fullscreen:"arrows-alt",codeview:"code"},paragraph:{paragraph:"align-left",outdent:"outdent",indent:"indent",left:"align-left",center:"align-center",right:"align-right",justify:"align-justify"},color:{recent:"font"},history:{undo:"undo",redo:"repeat"},misc:{check:"check"}},codemirror:{mode:"text/html",htmlMode:!0,lineNumbers:!0},lang:"en-US",direction:null,toolbar:[["style",["style"]],["font",["bold","italic","underline","clear"]],["fontname",["fontname"]],["fontsize",["fontsize"]],["color",["color"]],["para",["ul","ol","paragraph"]],["height",["height"]],["table",["table"]],["insert",["link","picture","hr"]],["view",["fullscreen","codeview"]],["help",["help"]]],plugin:{},airMode:!1,airPopover:[["color",["color"]],["font",["bold","underline","clear"]],["para",["ul","paragraph"]],["table",["table"]],["insert",["link","picture"]]],styleTags:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],defaultFontName:"Helvetica Neue",fontNames:["Arial","Arial Black","Comic Sans MS","Courier New","Helvetica Neue","Helvetica","Impact","Lucida Grande","Tahoma","Times New Roman","Verdana"],fontNamesIgnoreCheck:[],fontSizes:["8","9","10","11","12","14","18","24","36"],colors:[["#000000","#424242","#636363","#9C9C94","#CEC6CE","#EFEFEF","#F7F7F7","#FFFFFF"],["#FF0000","#FF9C00","#FFFF00","#00FF00","#00FFFF","#0000FF","#9C00FF","#FF00FF"],["#F7C6CE","#FFE7CE","#FFEFC6","#D6EFD6","#CEDEE7","#CEE7F7","#D6D6E7","#E7D6DE"],["#E79C9C","#FFC69C","#FFE79C","#B5D6A5","#A5C6CE","#9CC6EF","#B5A5D6","#D6A5BD"],["#E76363","#F7AD6B","#FFD663","#94BD7B","#73A5AD","#6BADDE","#8C7BC6","#C67BA5"],["#CE0000","#E79439","#EFC631","#6BA54A","#4A7B8C","#3984C6","#634AA5","#A54A7B"],["#9C0000","#B56308","#BD9400","#397B21","#104A5A","#085294","#311873","#731842"],["#630000","#7B3900","#846300","#295218","#083139","#003163","#21104A","#4A1031"]],lineHeights:["1.0","1.2","1.4","1.5","1.6","1.8","2.0","3.0"],insertTableMaxSize:{col:10,row:10},maximumImageFileSize:null,oninit:null,onfocus:null,onblur:null,onenter:null,onkeyup:null,onkeydown:null,onImageUpload:null,onImageUploadError:null,onMediaDelete:null,onToolbarClick:null,onsubmit:null,onCreateLink:function(a){return-1!==a.indexOf("@")&&-1===a.indexOf(":")&&(a="mailto:"+a),a},keyMap:{pc:{ENTER:"insertParagraph","CTRL+Z":"undo","CTRL+Y":"redo",TAB:"tab","SHIFT+TAB":"untab","CTRL+B":"bold","CTRL+I":"italic","CTRL+U":"underline","CTRL+SHIFT+S":"strikethrough","CTRL+BACKSLASH":"removeFormat","CTRL+SHIFT+L":"justifyLeft","CTRL+SHIFT+E":"justifyCenter","CTRL+SHIFT+R":"justifyRight","CTRL+SHIFT+J":"justifyFull","CTRL+SHIFT+NUM7":"insertUnorderedList","CTRL+SHIFT+NUM8":"insertOrderedList","CTRL+LEFTBRACKET":"outdent","CTRL+RIGHTBRACKET":"indent","CTRL+NUM0":"formatPara","CTRL+NUM1":"formatH1","CTRL+NUM2":"formatH2","CTRL+NUM3":"formatH3","CTRL+NUM4":"formatH4","CTRL+NUM5":"formatH5","CTRL+NUM6":"formatH6","CTRL+ENTER":"insertHorizontalRule","CTRL+K":"showLinkDialog"},mac:{ENTER:"insertParagraph","CMD+Z":"undo","CMD+SHIFT+Z":"redo",TAB:"tab","SHIFT+TAB":"untab","CMD+B":"bold","CMD+I":"italic","CMD+U":"underline","CMD+SHIFT+S":"strikethrough","CMD+BACKSLASH":"removeFormat","CMD+SHIFT+L":"justifyLeft","CMD+SHIFT+E":"justifyCenter","CMD+SHIFT+R":"justifyRight","CMD+SHIFT+J":"justifyFull","CMD+SHIFT+NUM7":"insertUnorderedList","CMD+SHIFT+NUM8":"insertOrderedList","CMD+LEFTBRACKET":"outdent","CMD+RIGHTBRACKET":"indent","CMD+NUM0":"formatPara","CMD+NUM1":"formatH1","CMD+NUM2":"formatH2","CMD+NUM3":"formatH3","CMD+NUM4":"formatH4","CMD+NUM5":"formatH5","CMD+NUM6":"formatH6","CMD+ENTER":"insertHorizontalRule","CMD+K":"showLinkDialog"}}},lang:{"en-US":{font:{bold:"Bold",italic:"Italic",underline:"Underline",clear:"Remove Font Style",height:"Line Height",name:"Font Family",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",size:"Font Size"},image:{image:"Picture",insert:"Insert Image",resizeFull:"Resize Full",resizeHalf:"Resize Half",resizeQuarter:"Resize Quarter",floatLeft:"Float Left",floatRight:"Float Right",floatNone:"Float None",shapeRounded:"Shape: Rounded",shapeCircle:"Shape: Circle",shapeThumbnail:"Shape: Thumbnail",shapeNone:"Shape: None",dragImageHere:"Drag image or text here",dropImage:"Drop image or Text",selectFromFiles:"Select from files",maximumFileSize:"Maximum file size",maximumFileSizeError:"Maximum file size exceeded.",url:"Image URL",remove:"Remove Image"},link:{link:"Link",insert:"Insert Link",unlink:"Unlink",edit:"Edit",textToDisplay:"Text to display",url:"To what URL should this link go?",openInNewWindow:"Open in new window"},table:{table:"Table"},hr:{insert:"Insert Horizontal Rule"},style:{style:"Style",normal:"Normal",blockquote:"Quote",pre:"Code",h1:"Header 1",h2:"Header 2",h3:"Header 3",h4:"Header 4",h5:"Header 5",h6:"Header 6"},lists:{unordered:"Unordered list",ordered:"Ordered list"},options:{help:"Help",fullscreen:"Full Screen",codeview:"Code View"},paragraph:{paragraph:"Paragraph",outdent:"Outdent",indent:"Indent",left:"Align left",center:"Align center",right:"Align right",justify:"Justify full"},color:{recent:"Recent Color",more:"More Color",background:"Background Color",foreground:"Foreground Color",transparent:"Transparent",setTransparent:"Set transparent",reset:"Reset",resetToDefault:"Reset to default"},shortcut:{shortcuts:"Keyboard shortcuts",close:"Close",textFormatting:"Text formatting",action:"Action",paragraphFormatting:"Paragraph formatting",documentStyle:"Document Style",extraKeys:"Extra keys"},history:{undo:"Undo",redo:"Redo"}}}},n=function(){var b=function(b){return a.Deferred(function(c){a.extend(new FileReader,{onload:function(a){var b=a.target.result;c.resolve(b)},onerror:function(){c.reject(this)}}).readAsDataURL(b)}).promise()},c=function(b,c){return a.Deferred(function(d){var e=a("");e.one("load",function(){e.off("error abort"),d.resolve(e)}).one("error abort",function(){e.off("load").detach(),d.reject(e)}).css({display:"none"}).appendTo(document.body).attr({src:b,"data-filename":c})}).promise()};return{readFileAsDataURL:b,createImage:c}}(),o=function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SPACE:32,NUM0:48,NUM1:49,NUM2:50,NUM3:51,NUM4:52,NUM5:53,NUM6:54,NUM7:55,NUM8:56,B:66,E:69,I:73,J:74,K:75,L:76,R:82,S:83,U:85,Y:89,Z:90,SLASH:191,LEFTBRACKET:219,BACKSLASH:220,RIGHTBRACKET:221};return{isEdit:function(a){return h.contains([8,9,13,32],a)},isMove:function(a){return h.contains([37,38,39,40],a)},nameFromCode:g.invertObject(a),code:a}}(),p=function(a){var b=[],c=-1,d=a[0],e=function(){var b=l.create(),c={s:{path:[],offset:0},e:{path:[],offset:0}};return{contents:a.html(),bookmark:b?b.bookmark(d):c}},f=function(b){null!==b.contents&&a.html(b.contents),null!==b.bookmark&&l.createFromBookmark(d,b.bookmark).select()};this.undo=function(){c>0&&(c--,f(b[c]))},this.redo=function(){b.length-1>c&&(c++,f(b[c]))},this.recordUndo=function(){c++,b.length>c&&(b=b.slice(0,c)),b.push(e())},this.recordUndo()},q=function(){var b=function(b,c){if(f.jqueryVersion<1.9){var d={};return a.each(c,function(a,c){d[c]=b.css(c)}),d}return b.css.call(b,c)};this.stylePara=function(b,c){a.each(b.nodes(k.isPara,{includeAncestor:!0}),function(b,d){a(d).css(c)})},this.styleNodes=function(b,c){b=b.splitText();var d=c&&c.nodeName||"SPAN",e=!(!c||!c.expandClosestSibling),f=!(!c||!c.onlyPartialContains);if(b.isCollapsed())return[b.insertNode(k.create(d))];var i=k.makePredByNodeName(d),j=a.map(b.nodes(k.isText,{fullyContains:!0}),function(a){return k.singleChildAncestor(a,i)||k.wrap(a,d)});if(e){if(f){var l=b.nodes();i=g.and(i,function(a){return h.contains(l,a)})}return a.map(j,function(b){var c=k.withClosestSiblings(b,i),d=h.head(c),e=h.tail(c);return a.each(e,function(a,b){k.appendChildNodes(d,b.childNodes),k.remove(b)}),h.head(c)})}return j},this.current=function(c,d){var e=a(k.isText(c.sc)?c.sc.parentNode:c.sc),f=["font-family","font-size","text-align","list-style-type","line-height"],g=b(e,f)||{};if(g["font-size"]=parseInt(g["font-size"],10),g["font-bold"]=document.queryCommandState("bold")?"bold":"normal",g["font-italic"]=document.queryCommandState("italic")?"italic":"normal",g["font-underline"]=document.queryCommandState("underline")?"underline":"normal",g["font-strikethrough"]=document.queryCommandState("strikeThrough")?"strikethrough":"normal",g["font-superscript"]=document.queryCommandState("superscript")?"superscript":"normal",g["font-subscript"]=document.queryCommandState("subscript")?"subscript":"normal",c.isOnList()){var h=["circle","disc","disc-leading-zero","square"],i=a.inArray(g["list-style-type"],h)>-1;g["list-style"]=i?"unordered":"ordered"}else g["list-style"]="none";var j=k.ancestor(c.sc,k.isPara);if(j&&j.style["line-height"])g["line-height"]=j.style.lineHeight;else{var l=parseInt(g["line-height"],10)/parseInt(g["font-size"],10);g["line-height"]=l.toFixed(1)}return g.image=k.isImg(d)&&d,g.anchor=c.isOnAnchor()&&k.ancestor(c.sc,k.isAnchor),g.ancestors=k.listAncestor(c.sc,k.isEditable),g.range=c,g}},r=function(){this.insertOrderedList=function(){this.toggleList("OL")},this.insertUnorderedList=function(){this.toggleList("UL")},this.indent=function(){var b=this,c=l.create().wrapBodyInlineWithPara(),d=c.nodes(k.isPara,{includeAncestor:!0}),e=h.clusterBy(d,g.peq2("parentNode"));a.each(e,function(c,d){var e=h.head(d);k.isLi(e)?b.wrapList(d,e.parentNode.nodeName):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return(parseInt(b,10)||0)+25})})}),c.select()},this.outdent=function(){var b=this,c=l.create().wrapBodyInlineWithPara(),d=c.nodes(k.isPara,{includeAncestor:!0}),e=h.clusterBy(d,g.peq2("parentNode"));a.each(e,function(c,d){var e=h.head(d);k.isLi(e)?b.releaseList([d]):a.each(d,function(b,c){a(c).css("marginLeft",function(a,b){return b=parseInt(b,10)||0,b>25?b-25:""})})}),c.select()},this.toggleList=function(b){var c=this,d=l.create().wrapBodyInlineWithPara(),e=d.nodes(k.isPara,{includeAncestor:!0}),f=d.paraBookmark(e),i=h.clusterBy(e,g.peq2("parentNode"));if(h.find(e,k.isPurePara)){var j=[];a.each(i,function(a,d){j=j.concat(c.wrapList(d,b))}),e=j}else{var m=d.nodes(k.isList,{includeAncestor:!0}).filter(function(c){return!a.nodeName(c,b)});m.length?a.each(m,function(a,c){k.replace(c,b)}):e=this.releaseList(i,!0)}l.createFromParaBookmark(f,e).select()},this.wrapList=function(b,c){var d=h.head(b),e=h.last(b),f=k.isList(d.previousSibling)&&d.previousSibling,g=k.isList(e.nextSibling)&&e.nextSibling,i=f||k.insertAfter(k.create(c||"UL"),e);return b=a.map(b,function(a){return k.isPurePara(a)?k.replace(a,"LI"):a}),k.appendChildNodes(i,b),g&&(k.appendChildNodes(i,h.from(g.childNodes)),k.remove(g)),b},this.releaseList=function(b,c){var d=[];return a.each(b,function(b,e){var f=h.head(e),g=h.last(e),i=c?k.lastAncestor(f,k.isList):f.parentNode,j=i.childNodes.length>1?k.splitTree(i,{node:g.parentNode,offset:k.position(g)+1},{isSkipPaddingBlankHTML:!0}):null,l=k.splitTree(i,{node:f.parentNode,offset:k.position(f)},{isSkipPaddingBlankHTML:!0});e=c?k.listDescendant(l,k.isLi):h.from(l.childNodes).filter(k.isLi),(c||!k.isList(i.parentNode))&&(e=a.map(e,function(a){return k.replace(a,"P")})),a.each(h.from(e).reverse(),function(a,b){k.insertAfter(b,i)});var m=h.compact([i,l,j]);a.each(m,function(b,c){var d=[c].concat(k.listDescendant(c,k.isList));a.each(d.reverse(),function(a,b){k.nodeLength(b)||k.remove(b,!0)})}),d=d.concat(e)}),d}},s=function(){var b=new r;this.insertTab=function(a,b,c){var d=k.createText(new Array(c+1).join(k.NBSP_CHAR));b=b.deleteContents(),b.insertNode(d,!0),b=l.create(d,c),b.select()},this.insertParagraph=function(){var c=l.create();c=c.deleteContents(),c=c.wrapBodyInlineWithPara();var d,e=k.ancestor(c.sc,k.isPara);if(e){if(k.isEmpty(e)&&k.isLi(e))return void b.toggleList(e.parentNode.nodeName);d=k.splitTree(e,c.getStartPoint());var f=k.listDescendant(e,k.isEmptyAnchor);f=f.concat(k.listDescendant(d,k.isEmptyAnchor)),a.each(f,function(a,b){k.remove(b)})}else{var g=c.sc.childNodes[c.so];d=a(k.emptyPara)[0],g?c.sc.insertBefore(d,g):c.sc.appendChild(d)}l.create(d,0).normalize().select()}},t=function(){this.tab=function(a,b){var c=k.ancestor(a.commonAncestor(),k.isCell),d=k.ancestor(c,k.isTable),e=k.listDescendant(d,k.isCell),f=h[b?"prev":"next"](e,c);f&&l.create(f,0).select()},this.createTable=function(b,c){for(var d,e=[],f=0;b>f;f++)e.push(""+k.blank+"");d=e.join("");for(var g,h=[],i=0;c>i;i++)h.push(""+d+"");return g=h.join(""),a(''+g+"
")[0]}},u="bogus",v=function(b){var c=new q,d=new t,e=new s,g=new r;this.createRange=function(a){return this.focus(a),l.create()},this.saveRange=function(a,b){this.focus(a),a.data("range",l.create()),b&&l.create().collapse().select()},this.saveNode=function(a){for(var b=[],c=0,d=a[0].childNodes.length;d>c;c++)b.push(a[0].childNodes[c]);a.data("childNodes",b)},this.restoreRange=function(a){var b=a.data("range");b&&(b.select(),this.focus(a))},this.restoreNode=function(a){a.html("");for(var b=a.data("childNodes"),c=0,d=b.length;d>c;c++)a[0].appendChild(b[c])},this.currentStyle=function(a){var b=l.create();return b?b.isOnEditable()&&c.current(b,a):!1};var i=function(a){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"before.command")(a.html(),a)},j=function(a){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"change")(a.html(),a)};this.undo=function(a){i(a),a.data("NoteHistory").undo(),j(a)},this.redo=function(a){i(a),a.data("NoteHistory").redo(),j(a)};for(var m=this,o=this.beforeCommand=function(a){ i(a),m.focus(a)},p=this.afterCommand=function(a,b){a.data("NoteHistory").recordUndo(),b||j(a)},v=["bold","italic","underline","strikethrough","superscript","subscript","justifyLeft","justifyCenter","justifyRight","justifyFull","formatBlock","removeFormat","backColor","foreColor","insertHorizontalRule","fontName"],w=0,x=v.length;x>w;w++)this[v[w]]=function(a){return function(b,c){o(b),document.execCommand(a,!1,c),p(b,!0)}}(v[w]);this.tab=function(a,b){var c=this.createRange(a);c.isCollapsed()&&c.isOnCell()?d.tab(c):(o(a),e.insertTab(a,c,b.tabsize),p(a))},this.untab=function(a){var b=this.createRange(a);b.isCollapsed()&&b.isOnCell()&&d.tab(b,!0)},this.insertParagraph=function(a){o(a),e.insertParagraph(a),p(a)},this.insertOrderedList=function(a){o(a),g.insertOrderedList(a),p(a)},this.insertUnorderedList=function(a){o(a),g.insertUnorderedList(a),p(a)},this.indent=function(a){o(a),g.indent(a),p(a)},this.outdent=function(a){o(a),g.outdent(a),p(a)},this.insertImage=function(a,c,d){n.createImage(c,d).then(function(b){o(a),b.css({display:"",width:Math.min(a.width(),b.width())}),l.create().insertNode(b[0]),l.createFromNodeAfter(b[0]).select(),p(a)}).fail(function(){var c=k.makeLayoutInfo(a).holder();b.bindCustomEvent(c,a.data("callbacks"),"image.upload.error")()})},this.insertNode=function(a,b){o(a),l.create().insertNode(b),l.createFromNodeAfter(b).select(),p(a)},this.insertText=function(a,b){o(a);var c=l.create().insertNode(k.createText(b));l.create(c,k.nodeLength(c)).select(),p(a)},this.pasteHTML=function(a,b){o(a);var c=l.create().pasteHTML(b);l.createFromNodeAfter(h.last(c)).select(),p(a)},this.formatBlock=function(a,b){o(a),b=f.isMSIE?"<"+b+">":b,document.execCommand("FormatBlock",!1,b),p(a)},this.formatPara=function(a){o(a),this.formatBlock(a,"P"),p(a)};for(var w=1;6>=w;w++)this["formatH"+w]=function(a){return function(b){this.formatBlock(b,"H"+a)}}(w);this.fontSize=function(b,d){var e=l.create(),f=e.isCollapsed();if(f){var g=c.styleNodes(e),i=h.head(g);a(g).css({"font-size":d+"px"}),i&&!k.nodeLength(i)&&(i.innerHTML=k.ZERO_WIDTH_NBSP_CHAR,l.createFromNodeAfter(i.firstChild).select(),b.data(u,i))}else o(b),a(c.styleNodes(e)).css({"font-size":d+"px"}),p(b)},this.removeBogus=function(a){var b=a.data(u);if(b){var c=h.find(h.from(b.childNodes),k.isText),d=c.nodeValue.indexOf(k.ZERO_WIDTH_NBSP_CHAR);-1!==d&&c.deleteData(d,1),k.isEmpty(b)&&k.remove(b),a.removeData(u)}},this.lineHeight=function(a,b){o(a),c.stylePara(l.create(),{lineHeight:b}),p(a)},this.unlink=function(a){var b=this.createRange(a);if(b.isOnAnchor()){var c=k.ancestor(b.sc,k.isAnchor);b=l.createFromNode(c),b.select(),o(a),document.execCommand("unlink"),p(a)}},this.createLink=function(b,d,e){var f=d.url,g=d.text,i=d.newWindow,j=d.range,k=j.toString()!==g;o(b),e.onCreateLink&&(f=e.onCreateLink(f));var m=[];if(k){var n=j.insertNode(a(""+g+"")[0]);m.push(n)}else m=c.styleNodes(j,{nodeName:"A",expandClosestSibling:!0,onlyPartialContains:!0});a.each(m,function(b,c){a(c).attr("href",f),i?a(c).attr("target","_blank"):a(c).removeAttr("target")});var q=l.createFromNodeBefore(h.head(m)),r=q.getStartPoint(),s=l.createFromNodeAfter(h.last(m)),t=s.getEndPoint();l.create(r.node,r.offset,t.node,t.offset).select(),p(b)},this.getLinkInfo=function(b){this.focus(b);var c=l.create().expand(k.isAnchor),d=a(h.head(c.nodes(k.isAnchor)));return{range:c,text:c.toString(),isNewWindow:d.length?"_blank"===d.attr("target"):!1,url:d.length?d.attr("href"):""}},this.color=function(a,b){var c=JSON.parse(b),d=c.foreColor,e=c.backColor;o(a),d&&document.execCommand("foreColor",!1,d),e&&document.execCommand("backColor",!1,e),p(a)},this.insertTable=function(a,b){var c=b.split("x");o(a);var e=l.create().deleteContents();e.insertNode(d.createTable(c[0],c[1])),p(a)},this.floatMe=function(a,b,c){o(a),c.css("float",b),p(a)},this.imageShape=function(a,b,c){o(a),c.removeClass("img-rounded img-circle img-thumbnail"),b&&c.addClass(b),p(a)},this.resize=function(a,b,c){o(a),c.css({width:100*b+"%",height:""}),p(a)},this.resizeTo=function(a,b,c){var d;if(c){var e=a.y/a.x,f=b.data("ratio");d={width:f>e?a.x:a.y/f,height:f>e?a.x*f:a.y}}else d={width:a.x,height:a.y};b.css(d)},this.removeMedia=function(c,d,e){o(c),e.detach(),b.bindCustomEvent(a(),c.data("callbacks"),"media.delete")(e,c),p(c)},this.focus=function(a){a.focus(),f.isFF&&!l.create().isOnEditable()&&l.createFromNode(a[0]).normalize().collapse().select()},this.isEmpty=function(a){return k.isEmpty(a[0])||k.emptyPara===a.html()}},w=function(){this.update=function(b,c){var d=function(b,c){b.find(".dropdown-menu li a").each(function(){var b=a(this).data("value")+""==c+"";this.className=b?"checked":""})},e=function(a,c){var d=b.find(a);d.toggleClass("active",c())};if(c.image){var g=a(c.image);e('button[data-event="imageShape"][data-value="img-rounded"]',function(){return g.hasClass("img-rounded")}),e('button[data-event="imageShape"][data-value="img-circle"]',function(){return g.hasClass("img-circle")}),e('button[data-event="imageShape"][data-value="img-thumbnail"]',function(){return g.hasClass("img-thumbnail")}),e('button[data-event="imageShape"]:not([data-value])',function(){return!g.is(".img-rounded, .img-circle, .img-thumbnail")});var h=g.css("float");e('button[data-event="floatMe"][data-value="left"]',function(){return"left"===h}),e('button[data-event="floatMe"][data-value="right"]',function(){return"right"===h}),e('button[data-event="floatMe"][data-value="none"]',function(){return"left"!==h&&"right"!==h});var i=g.attr("style");return e('button[data-event="resize"][data-value="1"]',function(){return!!/(^|\s)(max-)?width\s*:\s*100%/.test(i)}),e('button[data-event="resize"][data-value="0.5"]',function(){return!!/(^|\s)(max-)?width\s*:\s*50%/.test(i)}),void e('button[data-event="resize"][data-value="0.25"]',function(){return!!/(^|\s)(max-)?width\s*:\s*25%/.test(i)})}var j=b.find(".note-fontname");if(j.length){var k=c["font-family"];if(k){for(var l=k.split(","),m=0,n=l.length;n>m&&(k=l[m].replace(/[\'\"]/g,"").replace(/\s+$/,"").replace(/^\s+/,""),!f.isFontInstalled(k));m++);j.find(".note-current-fontname").text(k),d(j,k)}}var o=b.find(".note-fontsize");o.find(".note-current-fontsize").text(c["font-size"]),d(o,parseFloat(c["font-size"]));var p=b.find(".note-height");d(p,parseFloat(c["line-height"])),e('button[data-event="bold"]',function(){return"bold"===c["font-bold"]}),e('button[data-event="italic"]',function(){return"italic"===c["font-italic"]}),e('button[data-event="underline"]',function(){return"underline"===c["font-underline"]}),e('button[data-event="strikethrough"]',function(){return"strikethrough"===c["font-strikethrough"]}),e('button[data-event="superscript"]',function(){return"superscript"===c["font-superscript"]}),e('button[data-event="subscript"]',function(){return"subscript"===c["font-subscript"]}),e('button[data-event="justifyLeft"]',function(){return"left"===c["text-align"]||"start"===c["text-align"]}),e('button[data-event="justifyCenter"]',function(){return"center"===c["text-align"]}),e('button[data-event="justifyRight"]',function(){return"right"===c["text-align"]}),e('button[data-event="justifyFull"]',function(){return"justify"===c["text-align"]}),e('button[data-event="insertUnorderedList"]',function(){return"unordered"===c["list-style"]}),e('button[data-event="insertOrderedList"]',function(){return"ordered"===c["list-style"]})},this.updateRecentColor=function(b,c,d){var e=a(b).closest(".note-color"),f=e.find(".note-recent-color"),g=JSON.parse(f.attr("data-value"));g[c]=d,f.attr("data-value",JSON.stringify(g));var h="backColor"===c?"background-color":"color";f.find("i").css(h,d)}},x=function(){var a=new w;this.update=function(b,c){a.update(b,c)},this.updateRecentColor=function(b,c,d){a.updateRecentColor(b,c,d)},this.activate=function(a){a.find("button").not('button[data-event="codeview"]').removeClass("disabled")},this.deactivate=function(a){a.find("button").not('button[data-event="codeview"]').addClass("disabled")},this.updateFullscreen=function(a,b){var c=a.find('button[data-event="fullscreen"]');c.toggleClass("active",b)},this.updateCodeview=function(a,b){var c=a.find('button[data-event="codeview"]');c.toggleClass("active",b),b?this.deactivate(a):this.activate(a)},this.get=function(a,b){var c=k.makeLayoutInfo(a).toolbar();return c.find("[data-name="+b+"]")},this.setButtonState=function(a,b,c){c=c===!1?!1:!0;var d=this.get(a,b);d.toggleClass("active",c)}},y=24,z=function(){var b=a(document);this.attach=function(a,b){b.disableResizeEditor||a.statusbar().on("mousedown",c)};var c=function(a){a.preventDefault(),a.stopPropagation();var c=k.makeLayoutInfo(a.target).editable(),d=c.offset().top-b.scrollTop(),e=k.makeLayoutInfo(a.currentTarget||a.target),f=e.editor().data("options");b.on("mousemove",function(a){var b=a.clientY-(d+y);b=f.minHeight>0?Math.max(b,f.minHeight):b,b=f.maxHeight>0?Math.min(b,f.maxHeight):b,c.height(b)}).one("mouseup",function(){b.off("mousemove")})}},A=function(){var b=new w,c=function(b,c){var d=a(b),e=c?d.offset():d.position(),f=d.outerHeight(!0);return{left:e.left,top:e.top+f}},d=function(a,b){a.css({display:"block",left:b.left,top:b.top})},e=20;this.update=function(f,i,j){b.update(f,i);var k=f.find(".note-link-popover");if(i.anchor){var l=k.find("a"),m=a(i.anchor).attr("href"),n=a(i.anchor).attr("target");l.attr("href",m).html(m),n?l.attr("target","_blank"):l.removeAttr("target"),d(k,c(i.anchor,j))}else k.hide();var o=f.find(".note-image-popover");i.image?d(o,c(i.image,j)):o.hide();var p=f.find(".note-air-popover");if(j&&!i.range.isCollapsed()){var q=h.last(i.range.getClientRects());if(q){var r=g.rect2bnd(q);d(p,{left:Math.max(r.left+r.width/2-e,0),top:r.top+r.height})}}else p.hide()},this.updateRecentColor=function(a,b,c){a.updateRecentColor(a,b,c)},this.hide=function(a){a.children().hide()}},B=function(b){var c=a(document),d=function(d){if(k.isControlSizing(d.target)){d.preventDefault(),d.stopPropagation();var e=k.makeLayoutInfo(d.target),f=e.handle(),g=e.popover(),h=e.editable(),i=e.editor(),j=f.find(".note-control-selection").data("target"),l=a(j),m=l.offset(),n=c.scrollTop(),o=i.data("options").airMode;c.on("mousemove",function(a){b.invoke("editor.resizeTo",{x:a.clientX-m.left,y:a.clientY-(m.top-n)},l,!a.shiftKey),b.invoke("handle.update",f,{image:j},o),b.invoke("popover.update",g,{image:j},o)}).one("mouseup",function(){c.off("mousemove"),b.invoke("editor.afterCommand",h)}),l.data("ratio")||l.data("ratio",l.height()/l.width())}};this.attach=function(a){a.handle().on("mousedown",d)},this.update=function(b,c,d){var e=b.find(".note-control-selection");if(c.image){var f=a(c.image),g=d?f.offset():f.position(),h={w:f.outerWidth(!0),h:f.outerHeight(!0)};e.css({display:"block",left:g.left,top:g.top,width:h.w,height:h.h}).data("target",c.image);var i=h.w+"x"+h.h;e.find(".note-control-selection-info").text(i)}else e.hide()},this.hide=function(a){a.children().hide()}},C=function(b){var c=a(window),d=a("html, body");this.toggle=function(a){var e=a.editor(),f=a.toolbar(),g=a.editable(),h=a.codable(),i=function(a){g.css("height",a.h),h.css("height",a.h),h.data("cmeditor")&&h.data("cmeditor").setsize(null,a.h)};e.toggleClass("fullscreen");var j=e.hasClass("fullscreen");j?(g.data("orgheight",g.css("height")),c.on("resize",function(){i({h:c.height()-f.outerHeight()})}).trigger("resize"),d.css("overflow","hidden")):(c.off("resize"),i({h:g.data("orgheight")}),d.css("overflow","visible")),b.invoke("toolbar.updateFullscreen",f,j)}};f.hasCodeMirror&&(f.isSupportAmd?require(["CodeMirror"],function(a){b=a}):b=window.CodeMirror);var D=function(a){this.sync=function(b){var c=a.invoke("codeview.isActivated",b);c&&f.hasCodeMirror&&b.codable().data("cmEditor").save()},this.isActivated=function(a){var b=a.editor();return b.hasClass("codeview")},this.toggle=function(a){this.isActivated(a)?this.deactivate(a):this.activate(a)},this.activate=function(c){var d=c.editor(),e=c.toolbar(),g=c.editable(),h=c.codable(),i=c.popover(),j=c.handle(),l=d.data("options");if(h.val(k.html(g,l.prettifyHtml)),h.height(g.height()),a.invoke("toolbar.updateCodeview",e,!0),a.invoke("popover.hide",i),a.invoke("handle.hide",j),d.addClass("codeview"),h.focus(),f.hasCodeMirror){var m=b.fromTextArea(h[0],l.codemirror);if(l.codemirror.tern){var n=new b.TernServer(l.codemirror.tern);m.ternServer=n,m.on("cursorActivity",function(a){n.updateArgHints(a)})}m.setSize(null,g.outerHeight()),h.data("cmEditor",m)}},this.deactivate=function(b){var c=b.holder(),d=b.editor(),e=b.toolbar(),g=b.editable(),h=b.codable(),i=d.data("options");if(f.hasCodeMirror){var j=h.data("cmEditor");h.val(j.getValue()),j.toTextArea()}var l=k.value(h,i.prettifyHtml)||k.emptyPara,m=g.html()!==l;g.html(l),g.height(i.height?h.height():"auto"),d.removeClass("codeview"),m&&a.bindCustomEvent(c,g.data("callbacks"),"change")(g.html(),g),g.focus(),a.invoke("toolbar.updateCodeview",e,!1)}},E=function(b){var c=a(document);this.attach=function(a,b){b.airMode||b.disableDragAndDrop?c.on("drop",function(a){a.preventDefault()}):this.attachDragAndDropEvent(a,b)},this.attachDragAndDropEvent=function(d,e){var f=a(),g=d.editor(),h=d.dropzone(),i=h.find(".note-dropzone-message");c.on("dragenter",function(a){var c=b.invoke("codeview.isActivated",d),j=g.width()>0&&g.height()>0;c||f.length||!j||(g.addClass("dragover"),h.width(g.width()),h.height(g.height()),i.text(e.langInfo.image.dragImageHere)),f=f.add(a.target)}).on("dragleave",function(a){f=f.not(a.target),f.length||g.removeClass("dragover")}).on("drop",function(){f=a(),g.removeClass("dragover")}),h.on("dragenter",function(){h.addClass("hover"),i.text(e.langInfo.image.dropImage)}).on("dragleave",function(){h.removeClass("hover"),i.text(e.langInfo.image.dragImageHere)}),h.on("drop",function(c){var d=c.originalEvent.dataTransfer,e=k.makeLayoutInfo(c.currentTarget||c.target);if(d&&d.files&&d.files.length)c.preventDefault(),e.editable().focus(),b.insertImages(e,d.files);else for(var f=function(){e.holder().summernote("insertNode",this)},g=0,h=d.types.length;h>g;g++){var i=d.types[g],j=d.getData(i);i.toLowerCase().indexOf("text")>-1?e.holder().summernote("pasteHTML",j):a(j).each(f)}}).on("dragover",!1)}},F=function(b){var c;this.attach=function(e){(window.clipboardData||f.isFF)&&(c=a("
").attr("contenteditable",!0).css({position:"absolute",left:-1e5,opacity:0}),e.editable().after(c),c.one("paste",d),e.editable().on("keydown",function(a){a.ctrlKey&&86===a.keyCode&&(b.invoke("saveRange",e.editable()),c&&c.focus())})),e.editable().on("paste",d)};var d=function(a){var d=a.originalEvent.clipboardData,e=k.makeLayoutInfo(a.currentTarget||a.target),f=e.editable();if(!d||!d.items||!d.items.length){var g=f.data("callbacks");if(!g.onImageUpload)return;return void setTimeout(function(){if(c){var a=c[0].firstChild;if(a){if(b.invoke("restoreRange",f),k.isImg(a)){for(var d=a.src,g=atob(d.split(",")[1]),h=new Uint8Array(g.length),i=0;i1,e=d&&h.head(c),f=d?h.last(c):h.head(c),g=this.getModule(e),i=g[f];return i&&i.apply(g,b)},this.getModule=function(a){return this.modules[a]||this.modules.editor};var c=this.bindCustomEvent=function(a,b,c){return function(){var d=b[g.namespaceToCamel(c,"on")];return d&&d.apply(a[0],arguments),a.trigger("summernote."+c,arguments)}};this.insertImages=function(d,e){var f=d.editor(),g=d.editable(),h=d.holder(),i=g.data("callbacks"),j=f.data("options");i.onImageUpload?c(h,i,"image.upload")(e):a.each(e,function(a,d){var e=d.name;j.maximumImageFileSize&&j.maximumImageFileSizel;l++)a.isFunction(a.summernote.plugins[l].init)&&a.summernote.plugins[l].init(b)},this.detach=function(a,b){a.holder().off(),a.editable().off(),a.popover().off(),a.handle().off(),a.dialog().off(),b.airMode||(a.dropzone().off(),a.toolbar().off(),a.statusbar().off())}},K=function(){var b=function(a,b){var c=b.event,d=b.value,e=b.title,f=b.className,g=b.dropdown,h=b.hide;return(g?'
':"")+'"+(g||"")+(g?"
":"")},c=function(a,c){var d='';return b(d,c)},d=function(b,c){var d=a('');return d.find(".popover-content").append(c),d},e=function(a,b,c,d){return'"},h={picture:function(a,b){return c(b.iconPrefix+b.icons.image.image,{event:"showImageDialog",title:a.image.image,hide:!0})},link:function(a,b){return c(b.iconPrefix+b.icons.link.link,{event:"showLinkDialog",title:a.link.link,hide:!0})},table:function(a,b){var d='';return c(b.iconPrefix+b.icons.table.table,{title:a.table.table,dropdown:d})},style:function(a,b){var d=b.styleTags.reduce(function(b,c){var d=a.style["p"===c?"normal":c];return b+'
  • '+("p"===c||"pre"===c?d:"<"+c+">"+d+"")+"
  • "},"");return c(b.iconPrefix+b.icons.style.style,{title:a.style.style,dropdown:'"})},fontname:function(a,c){var d=[],e=c.fontNames.reduce(function(a,b){return f.isFontInstalled(b)||-1!==c.fontNamesIgnoreCheck.indexOf(b)?(d.push(b),a+'
  • '+b+"
  • "):a},""),g=f.isFontInstalled(c.defaultFontName),h=g?c.defaultFontName:d[0],i=''+h+"";return b(i,{title:a.font.name,className:"note-fontname",dropdown:'"})},fontsize:function(a,c){var d=c.fontSizes.reduce(function(a,b){return a+'
  • '+b+"
  • "},""),e='11';return b(e,{title:a.font.size,className:"note-fontsize",dropdown:'"})},color:function(a,c){var d='',e=b(d,{className:"note-recent-color",title:a.color.recent,event:"color",value:'{"backColor":"yellow"}'}),f='',g=b("",{title:a.color.more,dropdown:f});return e+g},bold:function(a,b){return c(b.iconPrefix+b.icons.font.bold,{event:"bold",title:a.font.bold})},italic:function(a,b){return c(b.iconPrefix+b.icons.font.italic,{event:"italic",title:a.font.italic})},underline:function(a,b){return c(b.iconPrefix+b.icons.font.underline,{event:"underline",title:a.font.underline})},strikethrough:function(a,b){return c(b.iconPrefix+b.icons.font.strikethrough,{event:"strikethrough",title:a.font.strikethrough})},superscript:function(a,b){return c(b.iconPrefix+b.icons.font.superscript,{event:"superscript",title:a.font.superscript})},subscript:function(a,b){return c(b.iconPrefix+b.icons.font.subscript,{event:"subscript",title:a.font.subscript})},clear:function(a,b){return c(b.iconPrefix+b.icons.font.clear,{event:"removeFormat",title:a.font.clear})},ul:function(a,b){return c(b.iconPrefix+b.icons.lists.unordered,{event:"insertUnorderedList",title:a.lists.unordered})},ol:function(a,b){return c(b.iconPrefix+b.icons.lists.ordered,{event:"insertOrderedList",title:a.lists.ordered})},paragraph:function(a,b){var d=c(b.iconPrefix+b.icons.paragraph.left,{title:a.paragraph.left,event:"justifyLeft"}),e=c(b.iconPrefix+b.icons.paragraph.center,{title:a.paragraph.center,event:"justifyCenter"}),f=c(b.iconPrefix+b.icons.paragraph.right,{title:a.paragraph.right,event:"justifyRight"}),g=c(b.iconPrefix+b.icons.paragraph.justify,{title:a.paragraph.justify,event:"justifyFull"}),h=c(b.iconPrefix+b.icons.paragraph.outdent,{title:a.paragraph.outdent,event:"outdent"}),i=c(b.iconPrefix+b.icons.paragraph.indent,{title:a.paragraph.indent,event:"indent"}),j='";return c(b.iconPrefix+b.icons.paragraph.paragraph,{title:a.paragraph.paragraph,dropdown:j})},height:function(a,b){var d=b.lineHeights.reduce(function(a,c){return a+'
  • '+c+"
  • "},"");return c(b.iconPrefix+b.icons.font.height,{title:a.font.height,dropdown:'"})},help:function(a,b){return c(b.iconPrefix+b.icons.options.help,{event:"showHelpDialog",title:a.options.help,hide:!0})},fullscreen:function(a,b){return c(b.iconPrefix+b.icons.options.fullscreen,{event:"fullscreen",title:a.options.fullscreen})},codeview:function(a,b){return c(b.iconPrefix+b.icons.options.codeview,{event:"codeview",title:a.options.codeview})},undo:function(a,b){return c(b.iconPrefix+b.icons.history.undo,{event:"undo",title:a.history.undo})},redo:function(a,b){return c(b.iconPrefix+b.icons.history.redo,{event:"redo",title:a.history.redo})},hr:function(a,b){return c(b.iconPrefix+b.icons.hr.insert,{event:"insertHorizontalRule",title:a.hr.insert})}},i=function(e,f){var g=function(){var a=c(f.iconPrefix+f.icons.link.edit,{title:e.link.edit,event:"showLinkDialog",hide:!0}),b=c(f.iconPrefix+f.icons.link.unlink,{title:e.link.unlink,event:"unlink"}),g='www.google.com  
    '+a+b+"
    ";return d("note-link-popover",g)},i=function(){var a=b('100%',{title:e.image.resizeFull,event:"resize",value:"1"}),g=b('50%',{title:e.image.resizeHalf,event:"resize",value:"0.5"}),h=b('25%',{title:e.image.resizeQuarter,event:"resize",value:"0.25"}),i=c(f.iconPrefix+f.icons.image.floatLeft,{title:e.image.floatLeft, event:"floatMe",value:"left"}),j=c(f.iconPrefix+f.icons.image.floatRight,{title:e.image.floatRight,event:"floatMe",value:"right"}),k=c(f.iconPrefix+f.icons.image.floatNone,{title:e.image.floatNone,event:"floatMe",value:"none"}),l=c(f.iconPrefix+f.icons.image.shapeRounded,{title:e.image.shapeRounded,event:"imageShape",value:"img-rounded"}),m=c(f.iconPrefix+f.icons.image.shapeCircle,{title:e.image.shapeCircle,event:"imageShape",value:"img-circle"}),n=c(f.iconPrefix+f.icons.image.shapeThumbnail,{title:e.image.shapeThumbnail,event:"imageShape",value:"img-thumbnail"}),o=c(f.iconPrefix+f.icons.image.shapeNone,{title:e.image.shapeNone,event:"imageShape",value:""}),p=c(f.iconPrefix+f.icons.image.remove,{title:e.image.remove,event:"removeMedia",value:"none"}),q='
    '+a+g+h+'
    '+i+j+k+'
    '+l+m+n+o+'
    '+p+"
    ";return d("note-image-popover",q)},j=function(){for(var b=a("
    "),c=0,g=f.airPopover.length;g>c;c++){for(var i=f.airPopover[c],j=a('
    '),k=0,l=i[1].length;l>k;k++){var m=a(h[i[1][k]](e,f));m.attr("data-name",i[1][k]),j.append(m)}b.append(j)}return d("note-air-popover",b.children())},k=a('
    ');return k.append(g()),k.append(i()),f.airMode&&k.append(j()),k},j=function(){return'
    '},l=function(a,b){var c="note-shortcut-col col-xs-6 note-shortcut-",d=[];for(var e in b)b.hasOwnProperty(e)&&d.push('
    '+b[e].kbd+'
    '+b[e].text+"
    ");return'
    '+a+'
    '+d.join('
    ')+"
    "},m=function(a){var b=[{kbd:"⌘ + B",text:a.font.bold},{kbd:"⌘ + I",text:a.font.italic},{kbd:"⌘ + U",text:a.font.underline},{kbd:"⌘ + \\",text:a.font.clear}];return l(a.shortcut.textFormatting,b)},n=function(a){var b=[{kbd:"⌘ + Z",text:a.history.undo},{kbd:"⌘ + ⇧ + Z",text:a.history.redo},{kbd:"⌘ + ]",text:a.paragraph.indent},{kbd:"⌘ + [",text:a.paragraph.outdent},{kbd:"⌘ + ENTER",text:a.hr.insert}];return l(a.shortcut.action,b)},o=function(a){var b=[{kbd:"⌘ + ⇧ + L",text:a.paragraph.left},{kbd:"⌘ + ⇧ + E",text:a.paragraph.center},{kbd:"⌘ + ⇧ + R",text:a.paragraph.right},{kbd:"⌘ + ⇧ + J",text:a.paragraph.justify},{kbd:"⌘ + ⇧ + NUM7",text:a.lists.ordered},{kbd:"⌘ + ⇧ + NUM8",text:a.lists.unordered}];return l(a.shortcut.paragraphFormatting,b)},p=function(a){var b=[{kbd:"⌘ + NUM0",text:a.style.normal},{kbd:"⌘ + NUM1",text:a.style.h1},{kbd:"⌘ + NUM2",text:a.style.h2},{kbd:"⌘ + NUM3",text:a.style.h3},{kbd:"⌘ + NUM4",text:a.style.h4},{kbd:"⌘ + NUM5",text:a.style.h5},{kbd:"⌘ + NUM6",text:a.style.h6}];return l(a.shortcut.documentStyle,b)},q=function(a,b){var c=b.extraKeys,d=[];for(var e in c)c.hasOwnProperty(e)&&d.push({kbd:e,text:c[e]});return l(a.shortcut.extraKeys,d)},r=function(a,b){var c='class="note-shortcut note-shortcut-col col-sm-6 col-xs-12"',d=["
    "+n(a,b)+"
    "+m(a,b)+"
    ","
    "+p(a,b)+"
    "+o(a,b)+"
    "];return b.extraKeys&&d.push("
    "+q(a,b)+"
    "),'
    '+d.join('
    ')+"
    "},s=function(a){return a.replace(/⌘/g,"Ctrl").replace(/⇧/g,"Shift")},t={image:function(a,b){var c="";if(b.maximumImageFileSize){var d=Math.floor(Math.log(b.maximumImageFileSize)/Math.log(1024)),f=1*(b.maximumImageFileSize/Math.pow(1024,d)).toFixed(2)+" "+" KMGTP"[d]+"B";c=""+a.image.maximumFileSize+" : "+f+""}var g='
    '+c+'
    ',h='";return e("note-image-dialog",a.image.insert,g,h)},link:function(a,b){var c='
    '+(b.disableLinkTarget?"":'
    "),d='";return e("note-link-dialog",a.link.insert,c,d)},help:function(a,b){var c='
    '+a.shortcut.shortcuts+"
    "+(f.isMac?r(a,b):s(r(a,b)))+'

    Summernote 0.6.9 · Project · Issues

    ';return e("note-help-dialog","",c,"")}},u=function(b,c){var d="";return a.each(t,function(a,e){d+=e(b,c)}),'
    '+d+"
    "},v=function(){return'
    '},w=function(a){return f.isMac&&(a=a.replace("CMD","⌘").replace("SHIFT","⇧")),a.replace("BACKSLASH","\\").replace("SLASH","/").replace("LEFTBRACKET","[").replace("RIGHTBRACKET","]")},x=function(b,c,d){var e=g.invertObject(c),f=b.find("button");f.each(function(b,c){var d=a(c),f=e[d.data("event")];f&&d.attr("title",function(a,b){return b+" ("+w(f)+")"})}).tooltip({container:"body",trigger:"hover",placement:d||"top"}).on("click",function(){a(this).tooltip("hide")})},y=function(b,c){var d=c.colors;b.find(".note-color-palette").each(function(){for(var b=a(this),c=b.attr("data-target-event"),e=[],f=0,g=d.length;g>f;f++){for(var h=d[f],i=[],j=0,k=h.length;k>j;j++){var l=h[j];i.push([''].join(""))}e.push('
    '+i.join("")+"
    ")}b.html(e.join(""))})};this.createLayoutByAirMode=function(b,c){var d=c.langInfo,e=c.keyMap[f.isMac?"mac":"pc"],h=g.uniqueId();b.addClass("note-air-editor note-editable"),b.attr({id:"note-editor-"+h,contentEditable:!0});var k=document.body,l=a(i(d,c));l.addClass("note-air-layout"),l.attr("id","note-popover-"+h),l.appendTo(k),x(l,e),y(l,c);var m=a(j());m.addClass("note-air-layout"),m.attr("id","note-handle-"+h),m.appendTo(k);var n=a(u(d,c));n.addClass("note-air-layout"),n.attr("id","note-dialog-"+h),n.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),n.appendTo(k)},this.createLayoutByFrame=function(b,c){var d=c.langInfo,e=a('
    ');c.width&&e.width(c.width),c.height>0&&a('
    '+(c.disableResizeEditor?"":v())+"
    ").prependTo(e);var g=!b.is(":disabled"),l=a('
    ').prependTo(e);c.height&&l.height(c.height),c.direction&&l.attr("dir",c.direction);var m=b.attr("placeholder")||c.placeholder;m&&l.attr("data-placeholder",m),l.html(k.html(b)),a('').prependTo(e);for(var n=a('
    '),o=0,p=c.toolbar.length;p>o;o++){for(var q=c.toolbar[o][0],r=c.toolbar[o][1],s=a('
    '),t=0,w=r.length;w>t;t++){var z=h[r[t]];if(a.isFunction(z)){var A=a(z(d,c));A.attr("data-name",r[t]),s.append(A)}}n.append(s)}n.prependTo(e);var B=c.keyMap[f.isMac?"mac":"pc"];y(n,c),x(n,B,"bottom");var C=a(i(d,c)).prependTo(e);y(C,c),x(C,B),a(j()).prependTo(e);var D=a(u(d,c)).prependTo(e);D.find("button.close, a.modal-close").click(function(){a(this).closest(".modal").modal("hide")}),a('
    ').prependTo(e),e.insertAfter(b),b.hide()},this.hasNoteEditor=function(a){return this.noteEditorFromHolder(a).length>0},this.noteEditorFromHolder=function(b){return b.hasClass("note-air-editor")?b:b.next().hasClass("note-editor")?b.next():a()},this.createLayout=function(a,b){b.airMode?this.createLayoutByAirMode(a,b):this.createLayoutByFrame(a,b)},this.layoutInfoFromHolder=function(a){var b=this.noteEditorFromHolder(a);if(b.length)return b.data("holder",a),k.buildLayoutInfo(b)},this.removeLayout=function(a,b,c){c.airMode?(a.removeClass("note-air-editor note-editable").removeAttr("id contentEditable"),b.popover().remove(),b.handle().remove(),b.dialog().remove()):(a.html(b.editable().html()),b.editor().remove(),a.show())},this.getTemplate=function(){return{button:b,iconButton:c,dialog:e}},this.addButtonInfo=function(a,b){h[a]=b},this.addDialogInfo=function(a,b){t[a]=b}};a.summernote=a.summernote||{},a.extend(a.summernote,m);var L=new K,M=new J;a.extend(a.summernote,{renderer:L,eventHandler:M,core:{agent:f,list:h,dom:k,range:l},pluginEvents:{},plugins:[]}),a.summernote.addPlugin=function(b){a.summernote.plugins.push(b),b.buttons&&a.each(b.buttons,function(a,b){L.addButtonInfo(a,b)}),b.dialogs&&a.each(b.dialogs,function(a,b){L.addDialogInfo(a,b)}),b.events&&a.each(b.events,function(b,c){a.summernote.pluginEvents[b]=c}),b.langs&&a.each(b.langs,function(b,c){a.summernote.lang[b]&&a.extend(a.summernote.lang[b],c)}),b.options&&a.extend(a.summernote.options,b.options)},a.fn.extend({summernote:function(){var b=a.type(h.head(arguments)),c="string"===b,d="object"===b,e=d?h.head(arguments):{};if(e=a.extend({},a.summernote.options,e),e.icons=a.extend({},a.summernote.options.icons,e.icons),e.langInfo=a.extend(!0,{},a.summernote.lang["en-US"],a.summernote.lang[e.lang]),!c&&d)for(var f=0,g=a.summernote.plugins.length;g>f;f++){var i=a.summernote.plugins[f];e.plugin[i.name]&&(a.summernote.plugins[f]=a.extend(!0,i,e.plugin[i.name]))}this.each(function(b,c){var d=a(c);if(!L.hasNoteEditor(d)){L.createLayout(d,e);var f=L.layoutInfoFromHolder(d);d.data("layoutInfo",f),M.attach(f,e),M.attachCustomEvent(f,e)}});var j=this.first();if(j.length){var k=L.layoutInfoFromHolder(j);if(c){var l=h.head(h.from(arguments)),m=h.tail(h.from(arguments)),n=[l,k.editable()].concat(m);return M.invoke.apply(M,n)}e.focus&&k.editable().focus()}return this},code:function(b){if(void 0===b){var c=this.first();if(!c.length)return;var d=L.layoutInfoFromHolder(c),e=d&&d.editable();if(e&&e.length){var f=M.invoke("codeview.isActivated",d);return M.invoke("codeview.sync",d),f?d.codable().val():d.editable().html()}return k.value(c)}return this.each(function(c,d){var e=L.layoutInfoFromHolder(a(d)),f=e&&e.editable();f&&f.html(b)}),this},destroy:function(){return this.each(function(b,c){var d=a(c);if(L.hasNoteEditor(d)){var e=L.layoutInfoFromHolder(d),f=e.editor().data("options");M.detach(e,f),L.removeLayout(d,e,f)}}),this}})});