Allows toggling document with keyboard shortcuts.
\n'),e(".working-indicator").append(o);for(var l=0;3>l;l++){var c="working-indicator-bar"+l;i({name:c,alpha:.25,start:20*l,trail:50});var u=c+" 0.7s linear infinite";o.append(e('
').css({animation:u,"-webkit-animation":u}))}var d=n("style",{type:"text/css"});document.head.appendChild(d),d.innerHTML=a},a}),function(e){var t=function(){return!1===e.support.boxModel&&e.support.objectAll&&$support.leadingWhitespace}();e.jGrowl=function(t,n){0==e("#jGrowl").size()&&e('
').addClass(n&&n.position?n.position:e.jGrowl.defaults.position).appendTo("body"),e("#jGrowl").jGrowl(t,n)},e.fn.jGrowl=function(t,n){if(e.isFunction(this.each)){var i=arguments;return this.each(function(){void 0==e(this).data("jGrowl.instance")&&(e(this).data("jGrowl.instance",e.extend(new e.fn.jGrowl,{notifications:[],element:null,interval:null})),e(this).data("jGrowl.instance").startup(this)),e.isFunction(e(this).data("jGrowl.instance")[t])?e(this).data("jGrowl.instance")[t].apply(e(this).data("jGrowl.instance"),e.makeArray(i).slice(1)):e(this).data("jGrowl.instance").create(t,n)})}},e.extend(e.fn.jGrowl.prototype,{defaults:{pool:0,header:"",group:"",sticky:!1,position:"top-right",glue:"after",theme:"default",themeState:"highlight",corners:"10px",check:250,life:3e3,closeDuration:"normal",openDuration:"normal",easing:"swing",closer:!0,closeTemplate:"×",closerTemplate:"
[ close all ]
",log:function(){},beforeOpen:function(){},afterOpen:function(){},open:function(){},beforeClose:function(){},close:function(){},animateOpen:{opacity:"show"},animateClose:{opacity:"hide"}},notifications:[],element:null,interval:null,create:function(t,n){var n=e.extend({},this.defaults,n);"undefined"!=typeof n.speed&&(n.openDuration=n.speed,n.closeDuration=n.speed),this.notifications.push({message:t,options:n}),n.log.apply(this.element,[this.element,t,n])},render:function(t){var n=this,i=t.message,r=t.options;r.themeState=""==r.themeState?"":"ui-state-"+r.themeState;var t=e('
").data("jGrowl",r).addClass(r.theme).children("div.jGrowl-close").bind("click.jGrowl",function(){e(this).parent().trigger("jGrowl.beforeClose")}).parent();e(t).bind("mouseover.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!0)}).bind("mouseout.jGrowl",function(){e("div.jGrowl-notification",n.element).data("jGrowl.pause",!1)}).bind("jGrowl.beforeOpen",function(){0!=r.beforeOpen.apply(t,[t,i,r,n.element])&&e(this).trigger("jGrowl.open")}).bind("jGrowl.open",function(){0!=r.open.apply(t,[t,i,r,n.element])&&("after"==r.glue?e("div.jGrowl-notification:last",n.element).after(t):e("div.jGrowl-notification:first",n.element).before(t),e(this).animate(r.animateOpen,r.openDuration,r.easing,function(){e.support.opacity===!1&&this.style.removeAttribute("filter"),null!=e(this).data("jGrowl")&&(e(this).data("jGrowl").created=new Date),e(this).trigger("jGrowl.afterOpen")}))}).bind("jGrowl.afterOpen",function(){r.afterOpen.apply(t,[t,i,r,n.element])}).bind("jGrowl.beforeClose",function(){0!=r.beforeClose.apply(t,[t,i,r,n.element])&&e(this).trigger("jGrowl.close")}).bind("jGrowl.close",function(){e(this).data("jGrowl.pause",!0),e(this).animate(r.animateClose,r.closeDuration,r.easing,function(){e.isFunction(r.close)?r.close.apply(t,[t,i,r,n.element])!==!1&&e(this).remove():e(this).remove()})}).trigger("jGrowl.beforeOpen"),""!=r.corners&&void 0!=e.fn.corner&&e(t).corner(r.corners),e("div.jGrowl-notification:parent",n.element).size()>1&&0==e("div.jGrowl-closer",n.element).size()&&0!=this.defaults.closer&&e(this.defaults.closerTemplate).addClass("jGrowl-closer "+this.defaults.themeState+" ui-corner-all").addClass(this.defaults.theme).appendTo(n.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){e(this).siblings().trigger("jGrowl.beforeClose"),e.isFunction(n.defaults.closer)&&n.defaults.closer.apply(e(this).parent()[0],[e(this).parent()[0]])})},update:function(){e(this.element).find("div.jGrowl-notification:parent").each(function(){void 0!=e(this).data("jGrowl")&&void 0!=e(this).data("jGrowl").created&&e(this).data("jGrowl").created.getTime()+parseInt(e(this).data("jGrowl").life)<(new Date).getTime()&&1!=e(this).data("jGrowl").sticky&&(void 0==e(this).data("jGrowl.pause")||1!=e(this).data("jGrowl.pause"))&&e(this).trigger("jGrowl.beforeClose")}),this.notifications.length>0&&(0==this.defaults.pool||e(this.element).find("div.jGrowl-notification:parent").size()
'),this.interval=setInterval(function(){e(n).data("jGrowl.instance").update()},parseInt(this.defaults.check)),t&&e(this.element).addClass("ie6")},shutdown:function(){e(this.element).removeClass("jGrowl").find("div.jGrowl-notification").remove(),clearInterval(this.interval)},close:function(){e(this.element).find("div.jGrowl-notification").each(function(){e(this).trigger("jGrowl.beforeClose")})}}),e.jGrowl.defaults=e.fn.jGrowl.prototype.defaults}(jQuery),define("jgrowl",["jquery"],function(e){return function(){var t;return t||e.jQuery.jGrowl}}(this)),define("text!html/notificationsSettingsBlock.html",[],function(){return'
Shows notification messages in the bottom-right corner of the\n screen.
\n
'}),define("extensions/notifications",["jquery","underscore","utils","logger","classes/Extension","jgrowl","text!html/notificationsSettingsBlock.html"],function(e,t,n,i,r,o,a){function s(){f===!1&&(o.defaults.life=u.config.timeout,o.defaults.closer=!1,o.defaults.closeTemplate="",o.defaults.position="bottom-right",f=!0)}function l(e,n,r){if(i.info(e),s(),e){var a=e.indexOf("|");(-1===a||(e=e.substring(0,a)))&&(r=r||{},n=n||"icon-info-circled",o("
"+t.escape(e).replace(/\n/g,"
"),r))}}function c(){h!==!1&&(d.toggleClass("hide",!m),p.toggleClass("hide",m))}var u=new r("notifications","Notifications");u.settingsBlock=a,u.defaultConfig={timeout:8e3},u.onLoadSettings=function(){n.setInputValue("#input-notifications-timeout",u.config.timeout)},u.onSaveSettings=function(e,t){e.timeout=n.getInputIntValue("#input-notifications-timeout",t,1,6e4)};var d,p,f=!1,h=!1;u.onReady=function(){h=!0,d=e(".navbar .offline-status"),p=e(".navbar .extension-buttons"),c()},u.onMessage=function(e){l(e)},u.onError=function(e){i.error(e),t.isString(e)?l(e,"icon-attention"):t.isObject(e)&&l(e.message,"icon-attention")};var m=!1;return u.onOfflineChanged=function(e){m=e,c(),m===!0?l("You are offline.","icon-attention-circled msg-offline"):l("You are back online!","icon-signal")},u.onSyncImportSuccess=function(e,n){var i=t.map(e,function(e){return e.title}).join(", ");l(i+" imported successfully from "+n.providerName+".")},u.onSyncExportSuccess=function(e,t){l('"'+e.title+'" will now be synchronized on '+t.provider.providerName+".")},u.onSyncRemoved=function(e,t){l(t.provider.providerName+" synchronized location has been removed.")},u.onPublishSuccess=function(e){l('"'+e.title+'" successfully published.')},u.onNewPublishSuccess=function(e,t){l('"'+e.title+'" is now published on '+t.provider.providerName+".")},u.onPublishRemoved=function(e,t){l(t.provider.providerName+" publish location has been removed.")},u}),define("text!html/buttonToc.html",[],function(){return'
\n \n \n\n'}),define("text!html/tocSettingsBlock.html",[],function(){return'
Generates a table of contents when a [TOC] marker is found.
\n
'}),define("extensions/toc",["jquery","underscore","utils","classes/Extension","text!html/buttonToc.html","text!html/tocSettingsBlock.html"],function(e,t,n,i,r,o){function a(e,t,n){this.tagName=e,this.anchor=t,this.text=n,this.children=[]}function s(e,n){function i(){void 0!==r&&(r.children.length>0&&(r.children=s(r.children,n+1)),l.push(r))}n=n||1;var r,o="H"+n,l=[];return t.each(e,function(e){e.tagName!=o?n!==c.config.maxDepth&&(void 0===r&&(r=new a),r.children.push(e)):(i(),r=e)}),i(),l}function l(){function e(e){for(var r=e.id||n.slugify(e.textContent)||"title",o=r,a=0;t.has(i,o);)o=r+"-"+ ++a;return i[o]=!0,e.id=o,o}var i={},r=[];return t.each(u.querySelectorAll("h1, h2, h3, h4, h5, h6"),function(t){r.push(new a(t.tagName,e(t),t.textContent))}),r=s(r),'
\n"}var c=new i("toc","Table of Contents",!0);c.settingsBlock=o,c.defaultConfig={marker:"\\[(TOC|toc)\\]",maxDepth:6,button:!0},c.onLoadSettings=function(){n.setInputValue("#input-toc-marker",c.config.marker),n.setInputValue("#input-toc-maxdepth",c.config.maxDepth),n.setInputChecked("#input-toc-button",c.config.button)},c.onSaveSettings=function(e,t){e.marker=n.getInputRegExpValue("#input-toc-marker",t),e.maxDepth=n.getInputIntValue("#input-toc-maxdepth"),e.button=n.getInputChecked("#input-toc-button")},c.onCreatePreviewButton=function(){return c.config.button?r:void 0},a.prototype.childrenToString=function(){if(0===this.children.length)return"";var e="
\n";return t.each(this.children,function(t){e+=t.toString()}),e+=" \n"},a.prototype.toString=function(){var e="
";return this.anchor&&this.text&&(e+=''+this.text+" "),e+=this.childrenToString()+" \n"};var u;return c.onPagedownConfigure=function(e){u=document.getElementById("preview-contents");var n=new RegExp("^\\s*"+c.config.marker+"\\s*$");e.hooks.chain("onPreviewRefresh",function(){var e=document.querySelectorAll(".table-of-contents, .toc"),i=l();t.each(u.getElementsByTagName("p"),function(e){n.test(e.innerHTML)&&(e.innerHTML=i)}),t.each(e,function(e){e.innerHTML=i})})},c}),define("extensions/emailConverter",["classes/Extension"],function(e){var t=new e("emailConverter","Markdown Email",!0);return t.settingsBlock="
Converts email adresses in the form <email@example.com> into clickable links.
",t.onPagedownConfigure=function(e){e.getConverter().hooks.chain("postConversion",function(e){return e.replace(/<(mailto\:)?([^\s>]+@[^\s>]+\.\S+?)>/g,function(e,t,n){return'
'+n+" "})})},t}),define("text!html/scrollSyncSettingsBlock.html",[],function(){return"
Binds together editor and preview scrollbars.
\n
\n Note: The mapping between Markdown and HTML is based on the\n position of the title elements (h1, h2...) in the page. Therefore if\n your document does not contain any title, the mapping will be linear and\n consequently less accurate.\n "}),define("extensions/scrollSync",["jquery","underscore","classes/Extension","text!html/scrollSyncSettingsBlock.html"],function(e,t,n,i){var r=new n("scrollSync","Scroll Sync",!0,!0);r.settingsBlock=i,e.easing.easeOutSine=function(e){return Math.cos((1-e)*Math.PI/2)};var o;r.onSectionsCreated=function(e){o=e};var a,s,l,c,u=!0,d=[],p=[],f=t.debounce(function(){if(u){d=[];var t,n,i=a.scrollTop();a.find(".wmd-input-section").each(function(){if(void 0===t)return void(t=0);var n=e(this.firstChild),r=n.position().top+i;d.push({startOffset:t,endOffset:r,height:r-t}),t=r}),n=a.prop("scrollHeight"),d.push({startOffset:t,endOffset:n,height:n-t}),p=[];var r,o=s.scrollTop();s.find(".wmd-preview-section").each(function(){if(void 0===r)return void(r=0);var t=e(this),n=t.position().top+o;p.push({startOffset:r,endOffset:n,height:n-r}),r=n}),n=s.prop("scrollHeight"),p.push({startOffset:r,endOffset:n,height:n-r}),l=-10,c=-10,y()}},500),h=!1,m=!1,g=!1,v=!1,b=e("
"),y=t.throttle(function(){function e(e,n,i){var r,o=t.find(n,function(t,n){return r=n,e
n&&(n=0);var i,r=s.scrollTop();if(h===!0){if(Math.abs(n-l)<=9)return;if(h=!1,l=n,i=e(n,d,p),i=t.min([i,s.prop("scrollHeight")-s.outerHeight()]),Math.abs(i-r)<=9)return void(c=r);b.stop("scrollSyncFx",!0).css("value",0).animate({value:i-r},{easing:"easeOutSine",duration:200,queue:"scrollSyncFx",step:function(e){v=!0,c=r+e,s.scrollTop(c)},done:function(){setTimeout(function(){v=!1},10)}}).dequeue("scrollSyncFx")}else if(m===!0){if(Math.abs(r-c)<=9)return;if(m=!1,c=r,i=e(r,p,d),i=t.min([i,a.prop("scrollHeight")-a.outerHeight()]),Math.abs(i-n)<=9)return void(l=n);b.stop("scrollSyncFx",!0).css("value",0).animate({value:i-n},{easing:"easeOutSine",duration:200,queue:"scrollSyncFx",step:function(e){g=!0,l=n+e,a.scrollTop(l)},done:function(){setTimeout(function(){g=!1},10)}}).dequeue("scrollSyncFx")}}},100);r.onLayoutResize=function(){h=!0,f()},r.onFileClosed=function(){d=[]};var x=!1;r.onReady=function(){s=e(".preview-container"),a=e("#wmd-input"),s.scroll(function(){v===!1&&x===!1&&(m=!0,h=!1,y()),x=!1}),a.scroll(function(){g===!1&&(h=!0,m=!1,y())}),s.on("hide.layout.toggle",function(){u=!1}),s.on("shown.layout.toggle",function(){u=!0})};var w;return r.onPagedownConfigure=function(t){w=e("#preview-contents"),t.getConverter().hooks.chain("postConversion",function(e){return w.height(w.height()),e})},r.onPreviewFinished=function(){var e=w.height();w.height("auto");var t=w.height();h=!0,e>t&&(x=!0),f()},r}),define("text!html/buttonSyncSettingsBlock.html",[],function(){return'Adds a "Synchronize documents" button in the navigation bar.
\n'}),define("extensions/buttonSync",["jquery","underscore","crel","utils","classes/Extension","mousetrap","text!html/buttonSyncSettingsBlock.html"],function(e,t,n,i,r,o,a){var s=new r("buttonSync",'Button "Synchronize"',!1,!0);s.settingsBlock=a,s.defaultConfig={syncPeriod:18e4,syncShortcut:"mod+s"},s.onLoadSettings=function(){i.setInputValue("#input-sync-period",s.config.syncPeriod),i.setInputValue("#input-sync-shortcut",s.config.syncShortcut)},s.onSaveSettings=function(e,t){e.syncPeriod=i.getInputIntValue("#input-sync-period",t,0),e.syncShortcut=i.getInputTextValue("#input-sync-shortcut",t)};var l;s.onSynchronizerCreated=function(e){l=e};var c,u=!1,d=!1,p=function(){void 0!==c&&(u===!0||l.hasSync()===!1||d?c.addClass("disabled"):c.removeClass("disabled"))},f=0;return s.onPeriodicRun=function(){!s.config.syncPeriod||f+s.config.syncPeriod>i.currentTime||l.sync()&&(f=i.currentTime)},s.onCreateButton=function(){var t=n("a",{"class":"btn btn-success button-synchronize",title:"Force synchronization Ctrl/Cmd+S"},n("i",{"class":"icon-refresh"}));return c=e(t),c.click(function(){c.hasClass("disabled")||l.sync()&&(f=i.currentTime)}),t},s.onReady=p,s.onFileCreated=p,s.onFileDeleted=p,s.onSyncImportSuccess=p,s.onSyncExportSuccess=p,s.onSyncRemoved=p,s.onSyncRunning=function(e){u=e,p()},s.onOfflineChanged=function(e){d=e,p()},s.onReady=function(){o.bind(s.config.syncShortcut,function(e){l.sync()&&(f=i.currentTime),e.preventDefault()}),e(".action-force-synchronization").click(function(){l.sync()&&(f=i.currentTime)})},s}),define("extensions/buttonPublish",["jquery","underscore","crel","classes/Extension"],function(e,t,n,i){function r(){void 0!==o&&(c===!0||u===!1||d===!0?o.addClass("disabled"):o.removeClass("disabled"))}var o,a,s,l=new i("buttonPublish",'Button "Publish"'),c=!1,u=!1,d=!1;l.onPublisherCreated=function(e){s=e},l.onCreateButton=function(){var t=n("a",{"class":"btn btn-success button-publish",title:"Update document publication"},n("i",{"class":"icon-upload"}));return o=e(t).click(function(){o.hasClass("disabled")||s.publish()}),t},l.onPublishRunning=function(e){c=e,r()},l.onOfflineChanged=function(e){d=e,r()};var p=function(){u=0===t.size(a.publishLocations)?!1:!0,r()};return l.onFileSelected=function(e){a=e,p()},l.onReady=function(){e(".action-update-publication").click(s.publish)},l.onPublishRemoved=p,l.onNewPublishSuccess=p,l}),define("text!html/buttonStat.html",[],function(){return'\n \n \n\n'}),define("text!html/buttonStatSettingsBlock.html",[],function(){return'Adds a "Document statistics" button over the preview.
\n\n'}),define("extensions/buttonStat",["jquery","underscore","utils","classes/Extension","text!html/buttonStat.html","text!html/buttonStatSettingsBlock.html"],function(e,t,n,i,r,o){var a=new i("buttonStat",'Button "Statistics"',!0,!0);a.settingsBlock=o,a.defaultConfig={name1:"Characters",value1:"\\S",name2:"Words",value2:"\\S+",name3:"Paragraphs",value3:"\\S.*"},a.onLoadSettings=function(){t.each([1,2,3],function(e){n.setInputValue("#input-stat-name"+e,a.config["name"+e]),n.setInputValue("#input-stat-value"+e,a.config["value"+e])})},a.onSaveSettings=function(e,i){t.each([1,2,3],function(t){e["name"+t]=n.getInputTextValue("#input-stat-name"+t,i),e["value"+t]=n.getInputRegExpValue("#input-stat-value"+t,i)})},a.onCreatePreviewButton=function(){return t.template(r,a.config)};var s,l,c,u;return a.onReady=function(){s=document.getElementById("preview-contents"),l=document.getElementById("span-stat-value1"),c=document.getElementById("span-stat-value2"),u=document.getElementById("span-stat-value3")},a.onPreviewFinished=function(){for(var e=s.cloneNode(!0),t=e.getElementsByTagName("script"),n=t.length-1;n>=0;n--){var i=t[n];i.parentNode.removeChild(i)}var r=e.textContent;l.textContent=(r.match(new RegExp(a.config.value1,"g"))||[]).length,c.textContent=(r.match(new RegExp(a.config.value2,"g"))||[]).length,u.textContent=(r.match(new RegExp(a.config.value3,"g"))||[]).length},a}),define("text!html/buttonHtmlCode.html",[],function(){return'\n \n \n\n'}),define("text!html/buttonHtmlCodeSettingsBlock.html",[],function(){return'Adds a "HTML code" button over the preview.
\n'}),define("extensions/buttonHtmlCode",["jquery","underscore","utils","classes/Extension","text!html/buttonHtmlCode.html","text!html/buttonHtmlCodeSettingsBlock.html"],function(e,t,n,i,r,o){var a=new i("buttonHtmlCode",'Button "HTML code"',!0,!0);a.settingsBlock=o,a.defaultConfig={template:"<%= documentHTML %>"},a.onLoadSettings=function(){n.setInputValue("#textarea-html-code-template",a.config.template)},a.onSaveSettings=function(e){e.template=n.getInputValue("#textarea-html-code-template")};var s;a.onEventMgrCreated=function(e){s=e},a.onCreatePreviewButton=function(){return r};var l;a.onFileSelected=function(e){l=e};var c,u;return a.onPreviewFinished=function(e,t){c=e,u=t},a.onReady=function(){var n=document.getElementById("input-html-code");e(".action-html-code").click(function(){setTimeout(function(){e("#input-html-code").each(function(){e(this).is(":hidden")||this.select()})},10)}).parent().on("show.bs.dropdown",function(){try{var e=t.template(a.config.template,{documentTitle:l.title,documentMarkdown:l.content,strippedDocumentMarkdown:l.content.substring(l.frontMatter?l.frontMatter._frontMatter.length:0),documentHTML:u,documentHTMLWithComments:c,frontMatter:l.frontMatter,publishAttributes:void 0});n.value=e}catch(i){s.onError(i)}})},a}),define("text!html/buttonViewer.html",[],function(){return'\n \n \n'}),define("extensions/buttonViewer",["jquery","classes/Extension","text!html/buttonViewer.html"],function(e,t,n){var i=new t("buttonViewer",'Button "Viewer"',!0,!0);return i.settingsBlock='Adds a "Viewer" button over the preview.
',i.onCreatePreviewButton=function(){return n},i}),"undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]}}e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one(e.support.transition.end,function(){n=!0});var r=function(){n||e(i).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t()})}(jQuery),+function(e){var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function n(){o.trigger("closed.bs.alert").remove()}var i=e(this),r=i.attr("data-target");r||(r=i.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));var o=e(r);t&&t.preventDefault(),o.length||(o=i.hasClass("alert")?i:i.parent()),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one(e.support.transition.end,n).emulateTransitionEnd(150):n())};var i=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var i=e(this),r=i.data("bs.alert");r||i.data("bs.alert",r=new n(this)),"string"==typeof t&&r[t].call(i)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),+function(e){var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i)};t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(e){var t="disabled",n=this.$element,i=n.is("input")?"val":"html",r=n.data();e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){"loadingText"==e?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons"]'),t=!0;if(e.length){var n=this.$element.find("input");"radio"===n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var i=e(this),r=i.data("bs.button"),o="object"==typeof n&&n;r||i.data("bs.button",r=new t(this,o)),"toggle"==n?r.toggle():n&&r.setState(n)})},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle"),t.preventDefault()})}(jQuery),+function(e){var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},t.prototype.to=function(t){var n=this,i=this.getActiveIndex();return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){n.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(this.$items[t]))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){return this.sliding?void 0:this.slide("next")},t.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},t.prototype.slide=function(t,n){var i=this.$element.find(".item.active"),r=n||i[t](),o=this.interval,a="next"==t?"left":"right",s="next"==t?"first":"last",l=this;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[s]()}this.sliding=!0,o&&this.pause();var c=e.Event("slide.bs.carousel",{relatedTarget:r[0],direction:a});if(!r.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var t=e(l.$indicators.children()[l.getActiveIndex()]);t&&t.addClass("active")})),e.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(c),c.isDefaultPrevented())return;r.addClass(t),r[0].offsetWidth,i.addClass(a),r.addClass(a),i.one(e.support.transition.end,function(){r.removeClass([t,a].join(" ")).addClass("active"),i.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(c),c.isDefaultPrevented())return;i.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return o&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var i=e(this),r=i.data("bs.carousel"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n),a="string"==typeof n?n:o.slide;r||i.data("bs.carousel",r=new t(this,o)),"number"==typeof n?r.to(n):a?r[a]():o.interval&&r.pause().cycle()})},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n,i=e(this),r=e(i.attr("data-target")||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"")),o=e.extend({},r.data(),i.data()),a=i.attr("data-slide-to");a&&(o.interval=!1),r.carousel(o),(a=i.attr("data-slide-to"))&&r.data("bs.carousel").to(a),t.preventDefault()}),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);t.carousel(t.data())})})}(jQuery),+function(e){var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.transitioning=null,this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t=e.Event("show.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.$parent&&this.$parent.find("> .panel > .in");if(n&&n.length){var i=n.data("bs.collapse");if(i&&i.transitioning)return;n.collapse("hide"),i||n.data("bs.collapse",null)}var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1;var o=function(){this.$element.removeClass("collapsing").addClass("in")[r]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")
};if(!e.support.transition)return o.call(this);var a=e.camelCase(["scroll",r].join("-"));this.$element.one(e.support.transition.end,e.proxy(o,this)).emulateTransitionEnd(350)[r](this.$element[0][a])}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return e.support.transition?void this.$element[n](0).one(e.support.transition.end,e.proxy(i,this)).emulateTransitionEnd(350):i.call(this)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var i=e(this),r=i.data("bs.collapse"),o=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);r||i.data("bs.collapse",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(t){var n,i=e(this),r=i.attr("data-target")||t.preventDefault()||(n=i.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""),o=e(r),a=o.data("bs.collapse"),s=a?"toggle":i.data(),l=i.attr("data-parent"),c=l&&e(l);a&&a.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+l+'"]').not(i).addClass("collapsed"),i[o.hasClass("in")?"addClass":"removeClass"]("collapsed")),o.collapse(s)})}(jQuery),+function(e){function t(){e(i).remove(),e(r).each(function(t){var i=n(e(this));i.hasClass("open")&&(i.trigger(t=e.Event("hide.bs.dropdown")),t.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown"))})}function n(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&e(n);return i&&i.length?i:t.parent()}var i=".dropdown-backdrop",r="[data-toggle=dropdown]",o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.prototype.toggle=function(i){var r=e(this);if(!r.is(".disabled, :disabled")){var o=n(r),a=o.hasClass("open");if(t(),!a){if("ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e('
').insertAfter(e(this)).on("click",t),o.trigger(i=e.Event("show.bs.dropdown")),i.isDefaultPrevented())return;o.toggleClass("open").trigger("shown.bs.dropdown"),r.focus()}return!1}},o.prototype.keydown=function(t){if(/(38|40|27)/.test(t.keyCode)){var i=e(this);if(t.preventDefault(),t.stopPropagation(),!i.is(".disabled, :disabled")){var o=n(i),a=o.hasClass("open");if(!a||a&&27==t.keyCode)return 27==t.which&&o.find(r).focus(),i.click();var s=e("[role=menu] li:not(.divider):visible a",o);if(s.length){var l=s.index(s.filter(":focus"));38==t.keyCode&&l>0&&l--,40==t.keyCode&&l ').appendTo(document.body),this.$element.on("click.dismiss.modal",e.proxy(function(e){e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t).emulateTransitionEnd(150):t()):t&&t()};var n=e.fn.modal;e.fn.modal=function(n,i){return this.each(function(){var r=e(this),o=r.data("bs.modal"),a=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);o||r.data("bs.modal",o=new t(this,a)),"string"==typeof n?o[n](i):a.show&&o.show(i)})},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),i=n.attr("href"),r=e(n.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=r.data("modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},r.data(),n.data());t.preventDefault(),r.modal(o,this).one("hide",function(){n.is(":visible")&&n.focus()})}),e(document).on("show.bs.modal",".modal",function(){e(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){e(document.body).removeClass("modal-open")})}(jQuery),+function(e){var t=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},t.prototype.init=function(t,n,i){this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i);for(var r=this.options.trigger.split(" "),o=r.length;o--;){var a=r[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=a){var s="hover"==a?"mouseenter":"focus",l="hover"==a?"mouseleave":"blur";this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},t.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,i){n[e]!=i&&(t[e]=i)}),t},t.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void(n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show()},t.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void(n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide()},t.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(t),t.isDefaultPrevented())return;var n=this.tip();this.setContent(),this.options.animation&&n.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,n[0],this.$element[0]):this.options.placement,r=/\s?auto?\s?/i,o=r.test(i);o&&(i=i.replace(r,"")||"top"),n.detach().css({top:0,left:0,display:"block"}).addClass(i),this.options.container?n.appendTo(this.options.container):n.insertAfter(this.$element);var a=this.getPosition(),s=n[0].offsetWidth,l=n[0].offsetHeight;if(o){var c=this.$element.parent(),u=i,d=document.documentElement.scrollTop||document.body.scrollTop,p="body"==this.options.container?window.innerWidth:c.outerWidth(),f="body"==this.options.container?window.innerHeight:c.outerHeight(),h="body"==this.options.container?0:c.offset().left;i="bottom"==i&&a.top+a.height+l-d>f?"top":"top"==i&&a.top-d-l<0?"bottom":"right"==i&&a.right+s>p?"left":"left"==i&&a.left-s
'}),t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),t.prototype.constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},t.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var i=e(this),r=i.data("bs.popover"),o="object"==typeof n&&n;r||i.data("bs.popover",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(jQuery),+function(e){function t(n,i){var r,o=e.proxy(this.process,this);this.$element=e(e(n).is("body")?window:n),this.$body=e("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",o),this.options=e.extend({},t.DEFAULTS,i),this.selector=(this.options.target||(r=e(n).attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=e([]),this.targets=e([]),this.activeTarget=null,this.refresh(),this.process()}t.DEFAULTS={offset:10},t.prototype.refresh=function(){var t=this.$element[0]==window?"offset":"position";this.offsets=e([]),this.targets=e([]);{var n=this;this.$body.find(this.selector).map(function(){var i=e(this),r=i.data("target")||i.attr("href"),o=/^#\w/.test(r)&&e(r);return o&&o.length&&[[o[t]().top+(!e.isWindow(n.$scrollElement.get(0))&&n.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){n.offsets.push(this[0]),n.targets.push(this[1])})}},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,i=n-this.$scrollElement.height(),r=this.offsets,o=this.targets,a=this.activeTarget;if(t>=i)return a!=(e=o.last()[0])&&this.activate(e);for(e=r.length;e--;)a!=o[e]&&t>=r[e]&&(!r[e+1]||t<=r[e+1])&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,e(this.selector).parents(".active").removeClass("active");var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=e(n).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var i=e(this),r=i.data("bs.scrollspy"),o="object"==typeof n&&n;r||i.data("bs.scrollspy",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(jQuery),+function(e){var t=function(t){this.element=e(t)};t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=n.find(".active:last a")[0],o=e.Event("show.bs.tab",{relatedTarget:r});if(t.trigger(o),!o.isDefaultPrevented()){var a=e(i);this.activate(t.parent("li"),n),this.activate(a,a.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})})}}},t.prototype.activate=function(t,n,i){function r(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),a?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),i&&i()}var o=n.find("> .active"),a=i&&e.support.transition&&o.hasClass("fade");a?o.one(e.support.transition.end,r).emulateTransitionEnd(150):r(),o.removeClass("in")};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var i=e(this),r=i.data("bs.tab");r||i.data("bs.tab",r=new t(this)),"string"==typeof n&&r[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(jQuery),+function(e){var t=function(n,i){this.options=e.extend({},t.DEFAULTS,i),this.$window=e(window).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=this.unpin=null,this.checkPosition()};t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=e(document).height(),i=this.$window.scrollTop(),r=this.$element.offset(),o=this.options.offset,a=o.top,s=o.bottom;"object"!=typeof o&&(s=a=o),"function"==typeof a&&(a=o.top()),"function"==typeof s&&(s=o.bottom());var l=null!=this.unpin&&i+this.unpin<=r.top?!1:null!=s&&r.top+this.$element.height()>=n-s?"bottom":null!=a&&a>=i?"top":!1;this.affixed!==l&&(this.unpin&&this.$element.css("top",""),this.affixed=l,this.unpin="bottom"==l?r.top-i:null,this.$element.removeClass(t.RESET).addClass("affix"+(l?"-"+l:"")),"bottom"==l&&this.$element.offset({top:document.body.offsetHeight-s-this.$element.height()}))}};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var i=e(this),r=i.data("bs.affix"),o="object"==typeof n&&n;r||i.data("bs.affix",r=new t(this,o)),"string"==typeof n&&r[n]()})},e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(jQuery),define("bootstrap",function(){}),function(e,t){var n,i;return i=t.document,n=function(){function n(n){this._options=e.extend({name:"tour",container:"body",keyboard:!0,storage:t.localStorage,debug:!1,backdrop:!1,redirect:!0,orphan:!1,duration:!1,basePath:"",template:"
« Prev Next » Pause
End tour ",afterSetState:function(){},afterGetState:function(){},afterRemoveState:function(){},onStart:function(){},onEnd:function(){},onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNext:function(){},onPrev:function(){},onPause:function(){},onResume:function(){}},n),this._force=!1,this._inited=!1,this._steps=[],this.backdrop={overlay:null,$element:null,$background:null,backgroundShown:!1,overlayElementShown:!1}}return n.prototype.setState=function(e,t){var n,i;if(this._options.storage){i=""+this._options.name+"_"+e;try{this._options.storage.setItem(i,t)}catch(r){n=r,n.code===DOMException.QUOTA_EXCEEDED_ERR&&this.debug("LocalStorage quota exceeded. setState failed.")}return this._options.afterSetState(i,t)}return null==this._state&&(this._state={}),this._state[e]=t},n.prototype.removeState=function(e){var t;return this._options.storage?(t=""+this._options.name+"_"+e,this._options.storage.removeItem(t),this._options.afterRemoveState(t)):null!=this._state?delete this._state[e]:void 0},n.prototype.getState=function(e){var t,n;return this._options.storage?(t=""+this._options.name+"_"+e,n=this._options.storage.getItem(t)):null!=this._state&&(n=this._state[e]),(void 0===n||"null"===n)&&(n=null),this._options.afterGetState(e,n),n},n.prototype.addSteps=function(e){var t,n,i,r;for(r=[],n=0,i=e.length;i>n;n++)t=e[n],r.push(this.addStep(t));return r},n.prototype.addStep=function(e){return this._steps.push(e)},n.prototype.getStep=function(t){return null!=this._steps[t]?e.extend({id:"step-"+t,path:"",placement:"right",title:"",content:"
",next:t===this._steps.length-1?-1:t+1,prev:t-1,animation:!0,container:this._options.container,backdrop:this._options.backdrop,redirect:this._options.redirect,orphan:this._options.orphan,duration:this._options.duration,template:this._options.template,onShow:this._options.onShow,onShown:this._options.onShown,onHide:this._options.onHide,onHidden:this._options.onHidden,onNext:this._options.onNext,onPrev:this._options.onPrev,onPause:this._options.onPause,onResume:this._options.onResume},this._steps[t]):void 0},n.prototype.init=function(e){var t=this;return this._force=e,this.ended()?this._debug("Tour ended, init prevented."):(this.setCurrentStep(),this._setupMouseNavigation(),this._setupKeyboardNavigation(),this._onResize(function(){return t.showStep(t._current)}),null!==this._current&&this.showStep(this._current),this._inited=!0,this)},n.prototype.start=function(e){var t;return null==e&&(e=!1),this._inited||this.init(e),null===this._current?(t=this._makePromise(null!=this._options.onStart?this._options.onStart(this):void 0),this._callOnPromiseDone(t,this.showStep,0)):void 0},n.prototype.next=function(){var e;return this.ended()?this._debug("Tour ended, next prevented."):(e=this.hideStep(this._current),this._callOnPromiseDone(e,this._showNextStep))},n.prototype.prev=function(){var e;return this.ended()?this._debug("Tour ended, prev prevented."):(e=this.hideStep(this._current),this._callOnPromiseDone(e,this._showPrevStep))},n.prototype.goTo=function(e){var t;return this.ended()?this._debug("Tour ended, goTo prevented."):(t=this.hideStep(this._current),this._callOnPromiseDone(t,this.showStep,e))},n.prototype.end=function(){var n,r,o=this;return n=function(){return e(i).off("click.tour-"+o._options.name),e(i).off("keyup.tour-"+o._options.name),e(t).off("resize.tour-"+o._options.name),o.setState("end","yes"),o._inited=!1,o._force=!1,o._clearTimer(),null!=o._options.onEnd?o._options.onEnd(o):void 0},r=this.hideStep(this._current),this._callOnPromiseDone(r,n)},n.prototype.ended=function(){return!this.force&&!!this.getState("end")},n.prototype.restart=function(){return this.removeState("current_step"),this.removeState("end"),this.setCurrentStep(0),this.start()},n.prototype.pause=function(){var e;return e=this.getStep(this._current),e&&e.duration?(this._paused=!0,this._duration-=(new Date).getTime()-this._start,t.clearTimeout(this._timer),this._debug("Paused/Stopped step "+(this._current+1)+" timer ("+this._duration+" remaining)."),null!=e.onPause?e.onPause(this,this._duration):void 0):void 0},n.prototype.resume=function(){var e,n=this;return e=this.getStep(this._current),e&&e.duration?(this._paused=!1,this._start=(new Date).getTime(),this._duration=this._duration||e.duration,this._timer=t.setTimeout(function(){return n._isLast()?n.next():n.end()},this._duration),this._debug("Started step "+(this._current+1)+" timer with duration "+this._duration),null!=e.onResume&&this._duration!==e.duration?e.onResume(this,this._duration):void 0):void 0},n.prototype.hideStep=function(t){var n,i,r,o=this;return(r=this.getStep(t))?(this._clearTimer(),i=this._makePromise(null!=r.onHide?r.onHide(this,t):void 0),n=function(){var t;return t=e(r.element),t.data("bs.popover")||t.data("popover")||(t=e("body")),t.popover("destroy"),r.reflex&&t.css("cursor","").off("click.tour-"+o._options.name),r.backdrop&&o._hideBackdrop(),null!=r.onHidden?r.onHidden(o):void 0},this._callOnPromiseDone(i,n),i):void 0},n.prototype.showStep=function(t){var n,r,o,a,s=this;return(a=this.getStep(t))?(o=t
").parent().html(),i.popover({placement:t.placement,trigger:"manual",title:t.title,content:t.content,html:!0,animation:t.animation,container:t.container,template:t.template,selector:t.element}).popover("show"),a=i.data("bs.popover")?i.data("bs.popover").tip():i.data("popover").tip(),a.attr("id",t.id),this._reposition(a,t),s?this._center(a):void 0},n.prototype._reposition=function(t,n){var r,o,a,s,l,c,u;if(s=t[0].offsetWidth,o=t[0].offsetHeight,u=t.offset(),l=u.left,c=u.top,r=e(i).outerHeight()-u.top-t.outerHeight(),0>r&&(u.top=u.top+r),a=e("html").outerWidth()-u.left-t.outerWidth(),0>a&&(u.left=u.left+a),u.top<0&&(u.top=0),u.left<0&&(u.left=0),t.offset(u),"bottom"===n.placement||"top"===n.placement){if(l!==u.left)return this._replaceArrow(t,2*(u.left-l),s,"left")}else if(c!==u.top)return this._replaceArrow(t,2*(u.top-c),o,"top")},n.prototype._center=function(n){return n.css("top",e(t).outerHeight()/2-n.outerHeight()/2)},n.prototype._replaceArrow=function(e,t,n,i){return e.find(".arrow").css(i,t?50*(1-t/n)+"%":"")},n.prototype._scrollIntoView=function(n,i){var r,o,a,s,l,c=this;return n?(r=e(n),o=e(t),a=r.offset().top,l=o.height(),s=Math.max(0,a-l/2),this._debug("Scroll into view. ScrollTop: "+s+". Element offset: "+a+". Window height: "+l+"."),e("body").stop().animate({scrollTop:Math.ceil(s)},function(){return i(),c._debug("Scroll into view. Animation end element offset: "+r.offset().top+". Window height: "+o.height()+".")})):i()},n.prototype._onResize=function(n,i){return e(t).on("resize.tour-"+this._options.name,function(){return clearTimeout(i),i=setTimeout(n,100)})},n.prototype._setupMouseNavigation=function(){var t=this;return t=this,e(i).off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=next]:not(.disabled)").on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=next]:not(.disabled)",function(e){return e.preventDefault(),t.next()}),e(i).off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=prev]:not(.disabled)").on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=prev]:not(.disabled)",function(e){return e.preventDefault(),t.prev()}),e(i).off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=end]").on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=end]",function(e){return e.preventDefault(),t.end()}),e(i).off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=pause-resume]").on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role=pause-resume]",function(n){var i;
-return n.preventDefault(),i=e(this),i.text(i.data(t._paused?"pause-text":"resume-text")),t._paused?t.resume():t.pause()})},n.prototype._setupKeyboardNavigation=function(){var t=this;if(this._options.keyboard)return e(i).on("keyup.tour-"+this._options.name,function(e){if(e.which)switch(e.which){case 39:return e.preventDefault(),t._isLast()?t.next():t.end();case 37:if(e.preventDefault(),t._current>0)return t.prev();break;case 27:return e.preventDefault(),t.end()}})},n.prototype._makePromise=function(t){return t&&e.isFunction(t.then)?t:null},n.prototype._callOnPromiseDone=function(e,t,n){var i=this;return e?e.then(function(){return t.call(i,n)}):t.call(this,n)},n.prototype._showBackdrop=function(){return this.backdrop.backgroundShown?void 0:(this.backdrop=e("
",{"class":"tour-backdrop"}),this.backdrop.backgroundShown=!0,e("body").append(this.backdrop))},n.prototype._hideBackdrop=function(){return this._hideOverlayElement(),this._hideBackground()},n.prototype._hideBackground=function(){return this.backdrop.remove(),this.backdrop.overlay=null,this.backdrop.backgroundShown=!1},n.prototype._showOverlayElement=function(t){var n,i,r;if(!this.backdrop.overlayElementShown)return this.backdrop.overlayElementShown=!0,i=e(t),n=e("
"),r=i.offset(),r.top=r.top,r.left=r.left,n.width(i.innerWidth()).height(i.innerHeight()).addClass("tour-step-background").offset(r),i.addClass("tour-step-backdrop"),e("body").append(n),this.backdrop.$element=i,this.backdrop.$background=n},n.prototype._hideOverlayElement=function(){return this.backdrop.overlayElementShown?(this.backdrop.$element.removeClass("tour-step-backdrop"),this.backdrop.$background.remove(),this.backdrop.$element=null,this.backdrop.$background=null,this.backdrop.overlayElementShown=!1):void 0},n.prototype._clearTimer=function(){return t.clearTimeout(this._timer),this._timer=null,this._duration=null},n}(),t.Tour=n}(jQuery,window),define("bootstrap-tour",["bootstrap"],function(e){return function(){var t;return t||e.Tour}}(this)),define("extensions/welcomeTour",["underscore","jquery","storage","classes/Extension","bootstrap-tour"],function(e,t,n,i,r){var o,a=new i("welcomeTour","Welcome tour",!1,!0);return a.onEventMgrCreated=function(e){o=e},a.onReady=function(){function i(e,n,i){var r=t(e).tooltip({html:!0,placement:i,trigger:"manual",title:n}).tooltip("show").addClass("info-tooltip");r.one("click",function(){r.tooltip("hide").removeClass("info-tooltip")}),setTimeout(function(){r.tooltip("hide").removeClass("info-tooltip")},2e4)}var a=new r({keyboard:!1,storage:{getItem:function(){},setItem:function(){},removeItem:function(){}},onEnd:function(){n.welcomeTour="done",i(".menu-panel .toggle-button *","Synchronize, publish and more...","right"),i(".document-panel .toggle-button *","Create and manage documents","left"),i(".extension-preview-buttons .btn-group:first","Need help with Markdown syntax?","left"),i(".layout-toggler-preview","Toggle preview","right")},template:['','
','
','
','
',' Next ',' Got it! '," ","
"].join("")});a.addSteps([{element:".navbar-inner",title:"StackEdit 4 beta preview!",content:["What's new?
",""," New contenteditable based editor (credit to Dabblet, Editorially...) "," New layout with CSS3 transitions (lighter supposedly) "," Comments/discussions support (see the new icon in the navigation bar) "," Auto-merge and conflict detection using standard synchronization "," Dropped real time sync support :( since you can collaborate simultaneously using standard synchronization "," ",'Please provide your feedback here and declare issues on GitHub... Thanks!
',''].join(""),placement:"bottom",onShown:function(){o.onTweet()}}]),e.has(n,"welcomeTour")||a.start(),t(".action-welcome-tour").click(function(){a.restart()})},a}),define("text!extensions/shortcutsDefaultMapping.settings",[],function(){return"{\n 'mod+b': bindPagedownButton('bold'),\n 'mod+i': bindPagedownButton('italic'),\n 'mod+l': bindPagedownButton('link'),\n 'mod+q': bindPagedownButton('quote'),\n 'mod+k': bindPagedownButton('code'),\n 'mod+g': bindPagedownButton('image'),\n 'mod+o': bindPagedownButton('olist'),\n 'mod+u': bindPagedownButton('ulist'),\n 'mod+h': bindPagedownButton('heading'),\n 'mod+r': bindPagedownButton('hr'),\n 'mod+z': bindPagedownButton('undo'),\n 'mod+y': bindPagedownButton('redo'),\n 'mod+shift+z': bindPagedownButton('redo'),\n 'mod+m': function(evt) {\n $('.button-open-discussion').click();\n evt.preventDefault();\n },\n '= = > space': function() {\n expand('==> ', '⇒ ');\n },\n '< = = space': function() {\n expand('<== ', '⇐ ');\n },\n 'S t a c k E d i t': function() {\n eventMgr.onMessage(\"You are stunned!!! Aren't you?\");\n }\n}\n"}),define("text!html/shortcutsSettingsBlock.html",[],function(){return'Maps keyboard shortcuts to JavaScript functions.
\n\n'}),define("extensions/shortcuts",["jquery","underscore","utils","mousetrap","classes/Extension","text!extensions/shortcutsDefaultMapping.settings","text!html/shortcutsSettingsBlock.html"],function($,_,utils,mousetrap,Extension,shortcutsDefaultMapping,shortcutsSettingsBlockHTML){function bindPagedownButton(e){return function(t){pagedownEditor.uiManager.doClick(pagedownEditor.uiManager.buttons[e]),t.preventDefault()}}function expand(e,t){utils.defer(function(){require("editor").replacePreviousText(e,t)})}var shortcuts=new Extension("shortcuts","Shortcuts",!0,!0);shortcuts.settingsBlock=shortcutsSettingsBlockHTML,shortcuts.defaultConfig={mapping:shortcutsDefaultMapping};var eventMgr,pagedownEditor;return shortcuts.onEventMgrCreated=function(e){eventMgr=e,eventMgr.addListener("onPagedownConfigure",function(e){pagedownEditor=e})},shortcuts.onLoadSettings=function(){utils.setInputValue("#textarea-shortcuts-mapping",shortcuts.config.mapping)},shortcuts.onSaveSettings=function(newConfig,event){newConfig.code=utils.getInputValue("#textarea-shortcuts-mapping");try{eval("var test = "+newConfig.code)}catch(e){eventMgr.onError(e),utils.getInputTextValue("#textarea-shortcuts-mapping",event,/^$/)}},shortcuts.onInit=function(){try{var shortcutMap;eval("shortcutMap = "+shortcuts.config.mapping),_.each(shortcutMap,function(e,t){mousetrap.bind(t,e)})}catch(e){console.error(e)}},shortcuts}),define("text!html/userCustomSettingsBlock.html",[],function(){return'Allows users to implement their own extension.
\n\nMore info '}),define("extensions/userCustom",["jquery","underscore","utils","classes/Extension","fileSystem","settings","text!html/userCustomSettingsBlock.html"],function($,_,utils,Extension,fileSystem,settings,userCustomSettingsBlockHTML){var userCustom=new Extension("userCustom","UserCustom extension",!0);userCustom.settingsBlock=userCustomSettingsBlockHTML,userCustom.defaultConfig={code:""};var fileMgr;userCustom.onFileMgrCreated=function(e){fileMgr=e};var synchronizer;userCustom.onSynchronizerCreated=function(e){synchronizer=e};var publisher;userCustom.onPublisherCreated=function(e){publisher=e};var eventMgr;return userCustom.onEventMgrCreated=function(e){eventMgr=e},userCustom.onLoadSettings=function(){utils.setInputValue("#textarea-usercustom-code",userCustom.config.code)},userCustom.onSaveSettings=function(newConfig,event){newConfig.code=utils.getInputValue("#textarea-usercustom-code");try{eval(newConfig.code)}catch(e){eventMgr.onError(e),utils.getInputTextValue("#textarea-usercustom-code",event,/^$/)}},userCustom.onInit=function(){try{eval(userCustom.config.code)}catch(e){console.error(e)}},userCustom}),define("text!html/commentsPopoverContent.html",[],function(){return'\n \n \n
\n \n'}),define("extensions/comments",["jquery","underscore","utils","storage","crel","rangy","classes/Extension","text!html/commentsPopoverContent.html","bootstrap"],function(e,t,n,i,r,o,a,s){function l(e,t,n){t=Math.round(t);for(var i=t-21;t+22>i;)w[i]&&(t=i+22),i++;!n&&(w[t]=1);var r=-8;-1!==e.className.indexOf(" icon-split")&&(r=-12);var o=t+r;e.style.top=o+"px",e.style.right="12px"}function c(t,n){this.commentElt=t,this.$commentElt=e(t).addClass("active"),this.fileDesc=n,this.discussionIndex=t.discussionIndex}function u(e){var t=C.getPopoverElt(),n=0;t.offsetWidthi&&(t.style.top=parseInt(t.style.top)+i+"px")}function d(){C&&C.$commentElt.popover("toggle").popover("destroy")}function p(){var e=C.getDiscussion(),n=i["author.name"],r=[];return e.commentList&&(r=e.commentList.map(function(e){var i=e.author||"Anonymous";return t.template(m,{author:i,content:e.content,reply:e.author!=n})})),"conflict"==e.type&&r.unshift(t.template(m,{author:"StackEdit",content:"Multiple users have made conflicting modifications.",reply:!0})),r.join("")}var f,h=new a("comments","Comments",!1,!0),m=[""].join(""),g=['',' ',' '," "," “<%- title %>”"," "].join("");h.onEventMgrCreated=function(e){f=e};var v,b;h.onEditorCreated=function(e){v=e,b=v.selectionMgr};var y,x,w=[],S=r("a",{"class":"discussion icon-comment new"});c.prototype.getDiscussion=function(){return this.discussionIndex?this.fileDesc.discussionList[this.discussionIndex]:this.fileDesc.newDiscussion},c.prototype.getPopoverElt=function(){return document.querySelector(".comments-popover .popover:last-child")};var C,E,T,k,_,I,D={},N=[],L=!1,M=t.debounce(function(){function e(){var i;if(0===o.length)return t.filter(D,function(e,n){return!t.has(T.discussionList,n)}).forEach(function(e){x.removeChild(e),delete D[e.discussionIndex]}),C&&!C.discussionIndex&&(i=b.getCoordinates(C.getDiscussion().selectionEnd),l(S,i.y,!0),y.scrollTop+=parseInt(S.style.top)-y.scrollTop-3*y.offsetHeight/4,u(S)),N=t.sortBy(D,function(e){return e.selectionEnd}),_.toggleClass("some",0!==N.length),_.toggleClass("replied",L),void I.toggleClass("icon-chat",0!==N.length);var a=o.shift(),s=D[a.discussionIndex];s||(s=r("a"));var c="discussion",d=!a.commentList||!n||t.last(a.commentList).author!=n;d&&(L=!0),c+="conflict"==a.type?" icon-split":" icon-comment",c+=d?" replied":" added",s.className=c,s.discussionIndex=a.discussionIndex,s.selectionEnd=a.selectionEnd,i=b.getCoordinates(a.selectionEnd),l(s,i.y),x.appendChild(s),D[a.discussionIndex]=s,C&&C.getDiscussion()===a&&(y.scrollTop+=parseInt(s.style.top)-y.scrollTop-3*y.offsetHeight/4,u(s)),k=setTimeout(e,5)}if(void 0!==T){L=!1,N=[];var n=i["author.name"];w=[];var o=t.sortBy(T.discussionList,function(e){return e.selectionEnd});clearTimeout(k),k=setTimeout(e,5)}},50);return h.onLayoutResize=M,h.onFileOpen=function(e){T=e,M()},h.onContentChanged=function(e){T===e&&M()},h.onCommentsChanged=function(e){if(T===e){if(void 0!==C){var t=C;t.discussionIndex&&(t.getPopoverElt().querySelector(".discussion-comment-list").innerHTML=p());try{E.undoToRange(t.rangyRange)}catch(n){}var i=t.getDiscussion();t.selectionRange=b.createRange(i.selectionStart,i.selectionEnd),t.rangyRange=o.createRange(),t.rangyRange.setStart(t.selectionRange.startContainer,t.selectionRange.startOffset),t.rangyRange.setEnd(t.selectionRange.endContainer,t.selectionRange.endOffset),setTimeout(function(){C===t&&E.applyToRange(t.rangyRange)},50)}M()}},h.onDiscussionCreated=function(e){T===e&&M()},h.onDiscussionRemoved=function(e,t){T===e&&(void 0!==C&&C.discussionIndex==t.discussionIndex&&d(),M())},h.onReady=function(){E=o.createCssClassApplier("comment-highlight",{normalize:!1});var a="";y=document.getElementById("wmd-input"),x=document.querySelector("#wmd-input > .editor-margin"),x.appendChild(S);var h=e(r("div",{"class":"comments-popover"}));e(document.body).append(h).on("click",function(e){C&&C.$commentElt[0]!==e.target&&d()}).popover({placement:"auto top",container:".comments-popover",html:!0,title:function(){if(!C)return!0;var e=C.getDiscussion(),n=e.selectionEnd-e.selectionStart,i=v.getValue().substr(e.selectionStart,n>20?20:n);return n>20&&(i+="..."),t.template(g,{title:i})},content:function(){var e=t.template(s,{commentList:p()});return e},selector:"#wmd-input > .editor-margin > .discussion"}),e(x).on("show.bs.popover",function(e){d();var t=new c(e.target,T);C=t;var n=t.getDiscussion();if(!n){var i=Math.min(b.selectionStart,b.selectionEnd),r=Math.max(b.selectionStart,b.selectionEnd);if(i===r){var o=b.getClosestWordOffset(i);i=o.start,r=o.end}n={selectionStart:i,selectionEnd:r,commentList:[]},T.newDiscussion=n;var a=b.getCoordinates(i);l(S,a.y,!0)}t.selectionRange=b.createRange(n.selectionStart,n.selectionEnd),y.scrollTop+=parseInt(e.target.style.top)-y.scrollTop-3*y.offsetHeight/4}).on("shown.bs.popover",function(r){var s=C,l=s.getPopoverElt();s.$authorInputElt=e(l.querySelector(".input-comment-author")).val(i["author.name"]),s.$contentInputElt=e(l.querySelector(".input-comment-content")),s.hr=l.querySelector("hr"),u(s.commentElt),l.querySelector(".scrollport").scrollTop=9999999;var c=e(l.querySelector(".action-add-comment"));e().add(s.$contentInputElt).add(s.$authorInputElt).keydown(function(e){switch(e.which){case 13:return e.preventDefault(),void c.click();case 27:return e.preventDefault(),d(),v.focus(),void v.adjustCursorPosition()}}),c.click(function(e){var i=n.getInputTextValue(s.$authorInputElt),r=n.getInputTextValue(s.$contentInputElt,e);if(!e.isPropagationStopped()){var o=s.getDiscussion();s.$contentInputElt.val(""),d(),o.commentList=o.commentList||[],o.commentList.push({author:i,content:r});var a=s.fileDesc.discussionList||{};if(o.discussionIndex)s.fileDesc.discussionList=a,f.onCommentsChanged(s.fileDesc);else{var l;do l=n.randomString();while(t.has(a,l));o.discussionIndex=l,a[l]=o,s.fileDesc.discussionList=a,f.onDiscussionCreated(s.fileDesc,o)}y.focus()}});var p=e(l.querySelector(".action-remove-discussion"));r.target.discussionIndex?p.click(function(){d();var e=s.getDiscussion();delete s.fileDesc.discussionList[e.discussionIndex],s.fileDesc.discussionList=s.fileDesc.discussionList,f.onDiscussionRemoved(s.fileDesc,e),y.focus()}):p.hide(),s.rangyRange=o.createRange(),s.rangyRange.setStart(s.selectionRange.startContainer,s.selectionRange.startOffset),s.rangyRange.setEnd(s.selectionRange.endContainer,s.selectionRange.endOffset),setTimeout(function(){C===s&&E.applyToRange(s.rangyRange)},50),s.$contentInputElt.focus().val(a)}).on("hide.bs.popover",function(){C&&(C.$commentElt.removeClass("active"),a=C.$contentInputElt.val(),i["author.name"]=C.$authorInputElt.val(),E.undoToRange(C.rangyRange),C=void 0,delete T.newDiscussion)}),h.on("click",".popover",function(e){e.stopPropagation()});var m=e(S);_=e(".button-open-discussion").click(function(n){var i=m;if(C)if(C.discussionIndex){var r=-1;N.some(function(e,t){return e===C.commentElt?(r=t,!0):void 0}),i=e(N[r+1])}else i=e(t.first(N));0===i.length?(d(),v.focus(),v.adjustCursorPosition()):i.click(),n.stopPropagation()}),I=_.find("i")},h}),function(e){var t="waitForImages";e.waitForImages={hasImageProperties:["backgroundImage","listStyleImage","borderImage","borderCornerImage"]},e.expr[":"].uncached=function(t){if(!e(t).is('img[src!=""]'))return!1;var n=new Image;return n.src=t.src,!n.complete},e.fn.waitForImages=function(n,i,r){var o=0,a=0;if(e.isPlainObject(arguments[0])&&(r=arguments[0].waitForAll,i=arguments[0].each,n=arguments[0].finished),n=n||e.noop,i=i||e.noop,r=!!r,!e.isFunction(n)||!e.isFunction(i))throw new TypeError("An invalid callback was supplied.");return this.each(function(){var s=e(this),l=[],c=e.waitForImages.hasImageProperties||[],u=/url\(\s*(['"]?)(.*?)\1\s*\)/g;r?s.find("*").andSelf().each(function(){var t=e(this);t.is("img:uncached")&&l.push({src:t.attr("src"),element:t[0]}),e.each(c,function(e,n){var i,r=t.css(n);if(!r)return!0;for(;i=u.exec(r);)l.push({src:i[2],element:t[0]})})}):s.find("img:uncached").each(function(){l.push({src:this.src,element:this})}),o=l.length,a=0,0===o&&n.call(s[0]),e.each(l,function(r,l){var c=new Image;e(c).bind("load."+t+" error."+t,function(e){return a++,i.call(l.element,a,o,"load"==e.type),a==o?(n.call(s[0]),!1):void 0}),c.src=l.src})})}}(jQuery),define("jquery-waitforimages",function(){}),define("eventMgr",["jquery","underscore","crel","utils","logger","classes/Extension","settings","text!html/settingsExtensionsAccordion.html","extensions/yamlFrontMatterParser","extensions/markdownSectionParser","extensions/partialRendering","extensions/buttonMarkdownSyntax","extensions/googleAnalytics","extensions/twitter","extensions/dialogAbout","extensions/dialogManagePublication","extensions/dialogManageSynchronization","extensions/dialogManageSharing","extensions/dialogOpenHarddrive","extensions/documentTitle","extensions/documentSelector","extensions/documentPanel","extensions/documentManager","extensions/workingIndicator","extensions/notifications","extensions/markdownExtra","extensions/toc","extensions/mathJax","extensions/emailConverter","extensions/scrollSync","extensions/buttonSync","extensions/buttonPublish","extensions/buttonStat","extensions/buttonHtmlCode","extensions/buttonViewer","extensions/welcomeTour","extensions/shortcuts","extensions/userCustom","extensions/comments","bootstrap","jquery-waitforimages"],function(e,t,n,i,r,o,a,s){function l(e){return t.chain(p).map(function(t){return t.enabled&&t[e]}).compact().value()}function c(e){return h[e]=l(e),function(){r.log(e,arguments);var n=arguments;t.each(h[e],function(e){try{e.apply(null,n)}catch(i){console.error(t.isObject(i)?i.stack:i)}})}}function u(e){d[e]=c(e)}var d={},p=t.chain(arguments).map(function(e){return e instanceof o&&e}).compact().value(),f=a.extensionSettings||{};t.each(p,function(e){e.config=t.extend({},e.defaultConfig,f[e.extensionId]),e.enabled=window.viewerMode===!0&&e.disableInViewer===!0?!1:!e.isOptional||void 0===e.config.enabled||e.config.enabled===!0});var h={};d.addListener=function(e,t){try{h[e].push(t)}catch(n){console.error("No event listener called "+e)}},c("onInit")(),d.onLoadSettings=function(){r.log("onLoadSettings"),t.each(p,function(e){var t=!e.isOptional||void 0===e.config.enabled||e.config.enabled===!0;i.setInputChecked("#input-enable-extension-"+e.extensionId,t),"markdownExtra"==e.extensionId?i.setInputChecked("#input-settings-markdown-extra",t):"mathJax"==e.extensionId&&i.setInputChecked("#input-settings-mathjax",t);var n=e.onLoadSettings;n&&n()})},d.onSaveSettings=function(e,n){r.log("onSaveSettings"),t.each(p,function(r){var o=t.extend({},r.defaultConfig);o.enabled=i.getInputChecked("#input-enable-extension-"+r.extensionId);var a;"markdownExtra"==r.extensionId?(a=i.getInputChecked("#input-settings-markdown-extra"),a!=r.enabled&&(o.enabled=a)):"mathJax"==r.extensionId&&(a=i.getInputChecked("#input-settings-mathjax"),a!=r.enabled&&(o.enabled=a));var s=r.onSaveSettings;s&&s(o,n),e[r.extensionId]=o})},u("onMessage"),u("onError"),u("onOfflineChanged"),u("onUserActive"),u("onAsyncRunning"),u("onPeriodicRun"),u("onEditorCreated"),u("onFileMgrCreated"),u("onSynchronizerCreated"),u("onPublisherCreated"),u("onEventMgrCreated"),u("onFileCreated"),u("onFileDeleted"),u("onFileSelected"),u("onFileOpen"),u("onFileClosed"),u("onContentChanged"),u("onTitleChanged"),u("onFoldersChanged"),u("onSyncRunning"),u("onSyncSuccess"),u("onSyncImportSuccess"),u("onSyncExportSuccess"),u("onSyncRemoved"),u("onPublishRunning"),u("onPublishSuccess"),u("onNewPublishSuccess"),u("onPublishRemoved"),u("onLayoutCreated"),u("onLayoutResize"),u("onPagedownConfigure"),u("onSectionsCreated"),u("onCursorCoordinates"),u("onDiscussionCreated"),u("onDiscussionRemoved"),u("onCommentsChanged"),u("onTweet");var m,g,v=c("onPreviewFinished"),b=l("onAsyncPreview");d.onAsyncPreview=function(){function e(n){var r=n.length?n.shift():function(){setTimeout(function(){var e="";t.each(m.children,function(t){e+=t.innerHTML});var n=i.trim(e),r=n.replace(/ \n\n