text: /**
   * These are Bolt’s COMPILED JS files!
   * Do not edit this file, because all changes will be lost. You can edit the 
   * `*.js` files in `assets/js/` and then run `yarn grunt updateBolt` to generate 
   * this file. You will need to use the "Clone the Git Repository" installation method, to 
   * get these files. See: https://docs.bolt.cm/core-development/install-git-clone, 
   * as well as the `README.md` file in the `assets/` folder.
   */
  String.prototype.subst=function(e){"use strict";return this.replace(/%[A-Z][A-Z0-9_]+%/g,function(t){return t in e?e[t]:t})};var init={depublishTracking:function(){"use strict";var e=$("#datedepublish").data("notice");$("#datedepublish, #statusselect").on("change",function(){var t=$("#statusselect").val(),i=$("#datedepublish").val();$(".dateDepublishNotice").remove(),""!==i&&"published"===t&&moment(i+Bolt.conf("timezone.offset"))<moment()&&$('<div class="dateDepublishNotice alert alert-warning alert-dismissible"><button type="button" class="close" data-dismiss="alert">×</button>'+e+"</div>").hide().insertAfter(".depublish-group").slideDown("fast")}),$("#datedepublish").trigger("change")},bindEditFile:function(e){"use strict";var t;if("undefined"!=typeof CodeMirror){t=CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,foldGutter:{rangeFinder:CodeMirror.fold.indent},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor(),{rangeFinder:CodeMirror.fold.indent,minFoldSize:3})},Tab:function(e){e.somethingSelected()?e.indentSelection("add"):e.replaceSelection(e.getOption("indentWithTabs")?"\t":Array(e.getOption("indentUnit")+1).join(" "),"end","+input")},"Ctrl-S":function(){$("#file_edit_save").click()},"Ctrl-H":"replaceAll"},tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly});var i=$(window).height()-312;i<200&&(i=200),t.setSize(null,i)}$("#file_edit_save").on("click",function(e){Bolt.events.fire("Bolt.File.Save.Start"),e.preventDefault(),t&&t.save();$("#file_edit_save").addClass("disabled"),$("#file_edit_save i").addClass("fa-spin fa-spinner"),$("p.lastsaved").text(Bolt.data("editcontent.msg.saving"));var i=$(e.target),n=$('form[name="file_edit"]').serialize()+"&"+encodeURI(i.attr("name"))+"="+encodeURI(i.attr("value"));$.post("?returnto=ajax",n).done(function(e){e.ok?Bolt.events.fire("Bolt.File.Save.Done",e):(alert(e.msg),Bolt.events.fire("Bolt.File.Save.Fail",e)),$("p.lastsaved").html(e.msg)}).fail(function(){Bolt.events.fire("Bolt.File.Save.Fail"),alert("Not saved")}).always(function(){Bolt.events.fire("Bolt.File.Save.Always"),window.setTimeout(function(){$("#file_edit_save").removeClass("disabled").blur(),$("#file_edit_save i").removeClass("fa-spin fa-spinner")},300)})})},bindEditLocale:function(e){"use strict";CodeMirror.fromTextArea(document.getElementById("file_edit_contents"),{lineNumbers:!0,autofocus:!0,tabSize:4,indentUnit:4,indentWithTabs:!1,readOnly:e.readonly}).setSize(null,$(window).height()-276)},bindFileBrowser:function(){"use strict";$("#myTab a").click(function(e){e.preventDefault(),$(this).tab("show")});var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()}),$("a.filebrowserCloseLink").bind("click",function(){window.close()})},bindCkFileSelect:function(){"use strict";var e=function(e){var t=new RegExp("(?:[?&]|&)"+e+"=([^&]+)","i"),i=window.location.search.match(t);return i&&i.length>1?i[1]:null}("CKEditorFuncNum");$("a.filebrowserCallbackLink").bind("click",function(t){t.preventDefault();var i=$(this).attr("href");window.opener.CKEDITOR.tools.callFunction(e,i),window.close()})},bindPrefill:function(){"use strict";var e=$("#form_contenttypes").find(":checkbox");$("#prefill_check_all").on("click",function(){e.removeAttr("checked").trigger("click")}),$("#prefill_uncheck_all").on("click",function(){e.removeAttr("checked")})},confirmationDialogs:function(){"use strict";$(".confirm").on("click",function(){return confirm($(this).data("confirm"))})},dropDowns:function(){"use strict";$('[data-toggle="dropdown"]').each(function(e,t){var i;"undefined"==typeof event?$(t).parent().click(function(e){i=e}):i=event,$(t).parent().on("show.bs.dropdown",function(){if(void 0!==i&&null!==i){var e=$(this).find('[data-toggle="dropdown"]').next(".dropdown-menu"),t=i.pageY+20,n=e.height(),a=$(window).height()-t+n;t-n>20&&a<37&&e.css({top:"auto",bottom:"100%"})}})})},dropZone:function(){"use strict";$(document).bind("dragover",function(e){var t=$(".elm-dropzone"),i=window.dropZoneTimeout;i?clearTimeout(i):t.addClass("in"),e.target===t[0]?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover")},100)})},magnificPopup:function(){"use strict";$(".magnific, .fancybox").magnificPopup({type:"image",gallery:{enabled:!0},disableOn:400,closeBtnInside:!0,enableEscapeKey:!0,mainClass:"mfp-with-zoom",zoom:{enabled:!0,duration:300,easing:"ease-in-out",opener:function(e){return e.parent().parent().find("img")}}})},focusStatusSelect:function(){"use strict";$("#lastsavedstatus").click(function(e){e.preventDefault(),$('a[href="#tab-meta"]').click(),$("#statusselect").focus()})},passwordInput:function(){"use strict";$(".togglepass").on("click",function(){$(this).hasClass("show-password")?($('input[name="user_login[password]"]').attr("type","text"),$(".togglepass.show-password").hide(),$(".togglepass.hide-password").show()):($('input[name="user_login[password]"]').attr("type","password"),$(".togglepass.show-password").show(),$(".togglepass.hide-password").hide())}),$(".login-forgot").bind("click",function(){$(".login-group, .password-group").hide(),$("#user_login_password").attr("required",!1),$(".reset-group").show()}),$(".login-remembered").bind("click",function(){$(".login-group, .password-group").show(),$("#user_login_password").attr("required",!0),$(".reset-group").hide()})},popOvers:function(){"use strict";$(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})},sortables:function(){"use strict";$("tbody.sortable").sortable({items:"tr",opacity:"0.5",axis:"y",handle:".sorthandle",update:function(){var e=$(this).sortable("serialize");$.ajax({url:$("#baseurl").attr("value")+"content/sortcontent/"+$(this).parent("table").data("contenttype"),type:"POST",data:e,success:function(){}})}})}},Bolt={};!function(bolt,$){"use strict";var actions={};actions.init=function(){$("button, input[type=button], a").off("click.action"),$("[data-action]").on("click.action",function(e){var action=$(this).attr("data-action");void 0!==action&&""!==action&&(e.preventDefault(),eval(action),e.stopPropagation())}).on("click.popover",".popover",function(e){e.stopPropagation()}),$(".clickspinner").on("click.spinner",function(){$(this).addClass("disabled").blur(),$(this).find("i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,this)}),$(".submitspinner").on("submit.spinner",function(){$(this).find("button[type=submit]").addClass("disabled").blur(),$(this).find("button[type=submit] i").addClass("fa-spin fa-spinner"),window.setTimeout(function(e){$(e).removeClass("disabled"),$(e).find("i").removeClass("fa-spin fa-spinner")},1e4,$(this).find("button[type=submit]"))})},actions.submit=function(e,t){$('<input type="hidden" />').attr("name",t.name).val(1).appendTo(e),e.submit()},bolt.actions=actions}(Bolt||{},jQuery),function(e,t,i,n){"use strict";function a(){n.confirmationDialogs(),n.magnificPopup(),n.dropZone(),n.popOvers(),n.dropDowns(),n.passwordInput(),n.sortables(),n.focusStatusSelect(),n.depublishTracking(),t("[data-bind]").each(function(){var i=t(this).data("bind");switch(i.bind){case"editcontent":e.editcontent.init(i);break;case"editfile":n.bindEditFile(i);break;case"editlocale":n.bindEditLocale(i);break;case"filebrowser":n.bindFileBrowser();break;case"ckfileselect":n.bindCkFileSelect();break;case"prefill":n.bindPrefill()}})}function o(){e.events.on("Bolt.GoogleMapsAPI.Load.Request",function(){if(void 0===l){l=!1;var i="https://maps.google.com/maps/api/js?sensor=false&callback=Bolt.app.gMapsApiReady";Bolt.conf.get("google_api_key")&&(i=i+"&key="+Bolt.conf.get("google_api_key")),t.getScript(i).fail(function(){l=void 0,e.events.fire("Bolt.GoogleMapsAPI.Load.Fail")})}else!0===l&&e.events.fire("Bolt.GoogleMapsAPI.Load.Done")})}function s(){var n=e.conf("locale.long");t.fn.select2.defaults.set("language",n.replace("_","-")),i.locale(n),t.datepicker.setDefaults(t.datepicker.regional[n])}var l,r={},d=1e4;r.gMapsApiReady=function(){l=!0,e.events.fire("Bolt.GoogleMapsAPI.Load.Done")},r.run=function(){e.conf.init(),e.data.init(),d=e.conf("buid").match(/(\d+)$/)[1],s(),o(),e.actions.init(),e.secmenu.init(),e.stack.init(),e.omnisearch.init(),e.extend.init(),e.filemanager.init(),e.ckeditor.init(),e.datetime.init(),a(),e.app.initWidgets()},r.buid=function(){return"buid-"+d++},r.initWidgets=function(e){void 0===e&&(e=t(document.documentElement)),t("[data-bolt-widget]",e).each(function(){var e=t(this),i=e.data("bolt-widget"),n={};"string"==typeof i?n[i]={}:n=i,t.each(n,function(t,i){e[t](i).removeAttr("data-bolt-widget").removeData("bolt-widget")})})},t(document).ready(r.run),e.app=r}(Bolt||{},jQuery,moment,init),function(e,t,i){"use strict";function n(){var e=[];for(var t in arguments)if(1===arguments[t].length||arguments[t][0]){var i=arguments[t][arguments[t].length-1];"string"==typeof i&&"|"===i.substr(0,1)&&(i=i.substr(1),e=e.concat("-")),e=e.concat(i)}return e}var a={};a.init=function(){i&&(i=a.initcke(i))},a.update=function(){if(i)for(var e in i.instances)i.instances.hasOwnProperty(e)&&i.instances[e].updateElement()},a.add=function(e){i&&i.replace(e)},a.initcke=function(i){return i.editorConfig=function(i){var a,o=t(this.element.$).data("param")||{},s=e.conf("ckeditor");i.language=e.conf("ckeditor.lang"),i.skin="boltcke",i.resize_enabled=!0,i.entities=!1,i.fillEmptyBlocks=!1,i.extraPlugins+=(i.extraPlugins?",":"")+"codemirror",i.baseFloatZIndex=100015,i.toolbar=n([{name:"styles",items:n(["Format"],[s.styles,"Styles"])}],[{name:"basicstyles",items:n(["Bold"],["Italic"],[s.underline,"Underline"],[s.strike,"Strike"])}],[{name:"paragraph",items:n(["NumberedList"],["BulletedList"],["Indent"],["Outdent"],[s.blockquote,"|Blockquote"])}],[{name:"links",items:n(["Link"],["Unlink"],[s.anchor,"|Anchor"])}],[s.subsuper,{name:"subsuper",items:n(["Subscript"],["Superscript"])}],[s.images,{name:"image",items:n(["Image"])}],[s.embed,{name:"embed",items:n(["oembed"])}],[s.tables,{name:"table",items:n(["Table"])}],[s.ruler,{name:"ruler",items:n(["HorizontalRule"])}],[s.align,{name:"align",items:n(["JustifyLeft"],["JustifyCenter"],["JustifyRight"],["JustifyBlock"])}],[s.fontcolor,{name:"colors",items:n(["TextColor"],["BGColor"])}],[s.codesnippet,{name:"code",items:n(["|CodeSnippet"])}],[{name:"tools",items:n(["RemoveFormat"],["Maximize"],["|Source"],[s.specialchar,"|SpecialChar"])}]),s.embed&&(i.extraPlugins+=",oembed,widget",i.oembed_maxWidth="853",i.oembed_maxHeight="480"),i.height=250,i.autoGrow_onStartup=!0,i.autoGrow_minHeight=150,i.autoGrow_maxHeight=400,i.autoGrow_bottomSpace=24,i.removePlugins="elementspath",i.resize_dir="vertical",s.filebrowser?(s.filebrowser.browseUrl&&(i.filebrowserBrowseUrl=s.filebrowser.browseUrl),s.filebrowser.imageBrowseUrl&&(i.filebrowserImageBrowseUrl=s.filebrowser.imageBrowseUrl),s.filebrowser.uploadUrl&&(i.filebrowserUploadUrl=s.filebrowser.uploadUrl),s.filebrowser.imageUploadUrl&&(i.filebrowserImageUploadUrl=s.filebrowser.imageUploadUrl)):(i.filebrowserBrowseUrl="",i.filebrowserImageBrowseUrl="",i.filebrowserUploadUrl="",i.filebrowserImageUploadUrl=""),i.codemirror={theme:"default",lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseTags:!0,autoCloseBrackets:!0,enableSearchTools:!0,enableCodeFolding:!0,enableCodeFormatting:!0,autoFormatOnStart:!1,autoFormatOnUncomment:!1,autoFormatOnModeChange:!1,highlightActiveLine:!0,highlightMatches:!0,showFormatButton:!1,showCommentButton:!1,showUncommentButton:!1};for(a in s.ck)s.ck.hasOwnProperty(a)&&(i[a]=s.ck[a]);o.height&&(i.height=parseInt(o.height),i.autoGrow_minHeight=Math.max(i.autoGrow_minHeight,i.height),i.autoGrow_maxHeight=Math.max(i.autoGrow_maxHeight,i.height));for(a in o.ckeditor)o.ckeditor.hasOwnProperty(a)&&(i[a]=o.ckeditor[a])},e.conf("ckeditor").ck.allowNbsp&&i.on("instanceReady",function(e){e.editor.on("paste",function(e){e.data.dataValue=e.data.dataValue.replace(/&nbsp;/g," "),e.data.dataValue=e.data.dataValue.replace(/<p> <\/p>/g,"")},null,null,9)}),i},e.ckeditor=a}(Bolt||{},jQuery,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={},a=function(e){var t,i=e.split("."),a=n;for(t=0;t<i.length;t++){if(void 0===a[i[t]])return;a=a[i[t]]}return a};a.get=a,a.init=function(){n=t("script[data-config]").first().data("config")},e.conf=a}(Bolt||{},jQuery),function(e,t,i){"use strict";var n={},a=function(e,t){var i,a=e.split("."),o=n;for(i=0;i<a.length;i++){if(void 0===o[a[i]])return;o=o[a[i]]}return t&&"string"==typeof o?o.subst(t):o};a.get=a,a.init=function(){n=t("script[data-jsdata]").first().data("jsdata")||{}},e.data=a}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){var t=e.closest(".datetime-container"),i={};return i.data=e,i.date=t.find("input.datepicker"),i.time=t.find("input.timepicker"),i.show=t.find("button.btn-tertiary"),i.clear=t.find("button.btn-default"),i.time.exists=i.time.length>0,i}function a(e){var i,n,a,o,s="",r="";"datedepublish"===e.data.attr("id")&&"1900-01-01 00:00:00"===e.data.val()&&e.data.val(""),(n=e.data.val().match(/^(\d{4}-\d{2}-\d{2})(?: (\d{2}:\d{2}:\d{2}))?$/))&&(s=n[1],r=n[2]||""),a=""===s||"0000-00-00"===s?"":t.datepicker.parseDate("yy-mm-dd",s),e.date.datepicker("setDate",a),e.time.exists&&"0000-00-00"!==s&&(""===r?r=""!==s?"00:00":"":l?r=e.data.val().slice(11,16):(o=(i=parseInt(r.slice(0,2)))<12?" AM":" PM",r=(i%12||12)+r.slice(2,5)+o),e.time.val(r)),e.data.trigger("change")}function o(e){var t,n,a,o=i(e.date.datepicker("getDate")),s=i([2001,11,24]),l=!1;if(e.time.exists){var r=new RegExp("^(?:(?:([01]?[0-9]|2[0-3]))[:,.]([0-5]?[0-9])|(1[012]|0?[1-9])[:,.]([0-5]?[0-9])(?:\\s*([AP])[. ]?M\\.?))$");(a=e.time.val().trim().toUpperCase().match(r))&&(t=parseInt(a[1]?a[1]:a[3]),n=parseInt(a[2]?a[2]:a[4]),"P"===a[5]&&12!==t?t+=12:"A"===a[5]&&12===t&&(t-=12),s=i([2001,11,24,t,n]),l=!0)}if(o.isValid()){var d=e.time.exists?" "+s.format("HH:mm:00"):"";e.data.val(o.format("YYYY-MM-DD")+d)}else l?e.data.val(i().format("YYYY-MM-DD")+" "+s.format("HH:mm:00")):e.data.val("")}function s(e){var t=e.date.data("field-options"),i={showOn:"none"};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);e.date.datepicker(i),e.show.click(function(){e.date.datepicker("show")}),e.clear.click(function(){e.data.val(""),a(e)})}var l,r={},d=[];r.update=function(){for(var e in d)d.hasOwnProperty(e)&&a(d[e])},r.init=function(){l=!i.localeData()._longDateFormat.LT.replace(/\[.+?\]/gi,"").match(/A/),t("input.datetime").each(function(){var e=n(t(this));d.push(e),s(e),a(e),e.date.change(function(){o(e),a(e)}),e.time.change(function(){o(e),a(e)})})},e.datetime=r}(Bolt||{},jQuery,moment),function(e,t,i,n,a,o){"use strict";function s(e){var i;return e.name&&(i=t(e).val(),"select-multiple"===e.type&&(i=JSON.stringify(i))),i}function l(){var e=0;return t('form[name="content_edit"]').find("input, textarea, select").each(function(){if("content_edit[save]"!==t(this).attr("name"))if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&e++;else{var i=s(this);void 0!==i&&t(this).data("watch")!==i&&e++}}),e>0}function r(){t('form[name="content_edit"]').find("input, textarea, select").each(function(){if("textarea"===this.type&&t(this).hasClass("ckeditor"))o.instances[this.id].checkDirty()&&(o.instances[this.id].updateElement(),o.instances[this.id].resetDirty());else{var e=s(this);void 0!==e&&t(this).data("watch",e)}}),i.onbeforeunload=function(){if(l()||e.liveEditor.active)return e.data("editcontent.msg.change_quit")}}function d(){i.onbeforeunload=null}function c(){t("#sidebar_save, #content_edit_save, #live_editor_save").addClass("disabled"),t("#sidebar_save i, #content_edit_save i").addClass("fa-spin fa-spinner"),t("p.lastsaved").text(e.data("editcontent.msg.saving"))}function u(){var i=t('form[name="content_edit"]');i.attr("novalidate","novalidate").on("submit",function(i){var n=e.validation.run(this);if(t(this).data("valid",n),!n)return i.preventDefault(),!1}),i.on("boltvalidate",function(){var i=e.validation.run(this);return t(this).data("valid",i),i})}function f(){var e=i.location.hash,n=t("#filtertabs");e&&n.find('a[href="#tab-'+e.replace(/^#/,"")+'"]').tab("show"),n.find("a").click(function(){var e;t(this).tab("show"),e=t("body").scrollTop(),i.location.hash=this.hash.replace(/^#tab-/,""),t("html,body").scrollTop(e)})}function p(){var e=t('form[name="content_edit"]');e.find("#sidebar_preview").attr("disabled",!1),e.find("#content_edit_preview").attr("disabled",!1),t("#sidebar_preview").bind("click",function(){t("#content_edit_preview").trigger("click")}),t("#content_edit_preview").bind("click",function(i){var n=t(i.target).data("url");i.preventDefault(),e.attr("action",n).attr("target","_blank").submit(),e.attr("action","").attr("target","_self")})}function h(){}function m(){t("#sidebar_delete").bind("click",function(){t("#content_edit_delete").trigger("click")}),t("#content_edit_delete").bind("click",function(n){n.preventDefault();var o=this;a.confirm(e.data("editcontent.delete"),function(n){if(t(".alert").alert(),!0===n){var a=t('form[name="content_edit"]');i.onbeforeunload=null,e.actions.submit(a,o)}})})}function v(){t("#sidebar_save_return").bind("click",function(){t("#content_edit_save_return").trigger("click")}),t("#content_edit_save_return").bind("click",function(){c(),d()})}function g(){t("#sidebar_save_create").bind("click",function(){t("#content_edit_save_create").trigger("click")}),t("#content_edit_save_create").bind("click",function(){c(),d(),e.actions.submit(t('form[name="content_edit"]'),this)})}function b(a){t("#sidebar_save").bind("click",function(){t("#content_edit_save").trigger("click")}),t("#content_edit_save").bind("click",function(s){s.preventDefault();var l=t('form[name="content_edit"]');if(l.trigger("boltvalidate"),!l.data("valid"))return!1;var d=a.newRecord,u=a.savedon,f=a.msgNotSaved;if(c(),d)r(),e.liveEditor.active&&e.liveEditor.stop(),a.duplicate&&(i.onbeforeunload=null),e.actions.submit(l,this);else{r(),e.events.fire("Bolt.Content.Save.Start");var p=t(s.target),h=l.serialize()+"&"+encodeURI(p.attr("name"))+"="+encodeURI(p.attr("value"));t.post("",h).done(function(a){e.events.fire("Bolt.Content.Save.Done",{form:a}),i.onbeforeunload=null,t("p.lastsaved").removeClass("alert alert-danger").html(u).find("strong").text(n(a.datechanged).format("MMM D, HH:mm")).end().find(".buic-moment").buicMoment().buicMoment("set",a.datechanged);var s=t("#statusselect").find("option:selected");t("a#lastsavedstatus strong").html('<i class="fa fa-circle status-'+s.val()+'"></i> '+s.text()),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner fa-exclamation-triangle").addClass("fa-check"),"object"===t.type(a)&&t.each(a,function(e,i){if("object"===t.type(i))t.each(i,function(i,n){t(':input[name="'+e+"["+i+']"]').val(n)});else if("array"===t.type(i));else{var n=t(l.name).find("[name="+e+"]");"checkbox"===n.attr("type")?n.prop("checked","1"===i):n.val(i),o&&o.instances[e]&&o.instances[e].setData(i,{callback:function(){this.resetDirty()}})}}),e.datetime.update(),r()}).fail(function(i){e.events.fire("Bolt.Content.Save.Fail");var n=t.parseJSON(i.responseText),a="<b>"+f+"</b><br><small>"+n.error.message+"</small>";t("p.lastsaved").html(a).addClass("alert alert-danger"),t("#sidebar_save i, #content_edit_save i").removeClass("fa-flag fa-spin fa-spinner").addClass("fa-exclamation-triangle")}).always(function(){e.events.fire("Bolt.Content.Save.Always"),i.setTimeout(function(){t("#sidebar_save, #content_edit_save, #live_editor_save").removeClass("disabled").blur()},1e3),i.setTimeout(function(){t("#sidebar_save i, #content_edit_save i").addClass("fa-flag")},5e3)})}})}function _(){t("#content_edit_save").is("*")&&(t("body, input").bind("keydown.ctrl_s keydown.meta_s",function(e){e.preventDefault(),r(),t("#content_edit_save").trigger("click")}),i.setTimeout(function(){r()},1e3))}var k={};k.init=function(t){u(),b(t),v(),g(),p(),h(),m(),f(),e.liveEditor.init(t),i.setTimeout(function(){_()},1e3)},e.editcontent=k}(Bolt||{},jQuery,window,moment,bootbox,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";function i(e){return t(".extend-bolt-container").find(e)}function n(e){var i=t(e);return(i.find("h1, h2, h3, p").text()||i.text()).trim().replace(/ +/g," ").replace(/\s+\n/g,"\n")}function a(i){var a="",o="",s="";try{a=t.parseJSON(i.responseText)}catch(e){}void 0===a.error?(s="This was the received response:\n\n<textarea>"+n(i.responseText)+"</textarea>\n\nInspect the console output in the browser's Debug Inspector for more details.",o=e.data("extend.packages.error",{"%ERROR_TYPE%":"Unknown Error","%ERROR_MESSAGE%":s,"%ERROR_LOCATION%":""}),console.error(i)):"Bolt\\Exception\\PackageManagerException"===a.error.type?(s=a.error.message.replace(/(<http)/g,'<a href="http').replace(/(\w+>)/g,'">this link</a>'),o=e.data("extend.packages.error",{"%ERROR_TYPE%":"Composer Error","%ERROR_MESSAGE%":s,"%ERROR_LOCATION%":""})):"Bolt\\Exception\\ExtensionsInfoServiceException"===a.error.type?(s=a.error.message,o=e.data("extend.packages.error",{"%ERROR_TYPE%":"Extension Site Error","%ERROR_MESSAGE%":s,"%ERROR_LOCATION%":""})):o=e.data("extend.packages.error",{"%ERROR_TYPE%":"PHP Error","%ERROR_MESSAGE%":a.error.message,"%ERROR_LOCATION%":"File: "+a.error.file+"::"+a.error.line}),t(".modal").modal("hide"),bootbox.alert(o)}function o(t){var i="";for(var n in t)if(t.hasOwnProperty(n)){var a=t[n],o=e.data("extend.packages"),s=[],l=[],r=0;if(a.authors&&a.authors.length>0)for(r=0;r<a.authors.length;r++)s.push(o.author.subst({"%AUTHOR%":a.authors[r].name}));if(s=s.length?o.authors.subst({"%AUTHORS%":s.join(", ")}):"",a.keywords&&a.keywords.length>0)for(r=0;r<a.keywords.length;r++)l.push(o.keyword.subst({"%KEYWORD%":a.keywords[r]}));l=l.length?o.keywords.subst({"%KEYWORDS%":l.join(" ")}):"","wikimedia/composer-merge-plugin"===a.name&&(a.title="Local Extension Helper");var d="",c={"%NAME%":a.name,"%VERSION%":a.version,"%BASEURL%":e.data("extend.baseurl"),"%MARKETPLACE_URL%":"https://market.bolt.cm/view/"+a.name,"%REPOSITORY_URL%":a.repositoryLink};d="installed"===a.status&&"composer-plugin"!==a.type?o.manage_dropdown_installed.subst(c):o.manage_dropdown_uninstalled.subst(c);var u=o.left_buttons.subst({"%README%":null!==a.readmeLink?o.readme_button.subst({"%README%":a.readmeLink}):"","%CONFIG%":null!==a.configLink?o.config_button.subst({"%CONFIG%":a.configLink}):"","%THEME%":"bolt-theme"===a.type?o.theme_button.subst({"%NAME%":a.name}):""});i+=o.item.subst({"%TITLE%":a.title?a.title:a.name,"%NAME%":a.name,"%VERSION%":a.version,"%AUTHORS%":s,"%TYPE%":a.type,"%MANAGE%":d,"%DETAILS%":u,"%BASEURL%":e.data("extend.baseurl"),"%DESCRIPTION%":a.description?o.description.subst({"%DESCRIPTION%":a.description}):"","%KEYWORDS%":l,"%STATUS%":!1===a.valid?" — [INVALID] ":"","%ENABLED%":!1===a.enabled?" — [DISABLED] ":"","%CONSTRAINT%":null!==a.constraint?'<i class="fa fa-cog fa-fw"></i> Requires Bolt '+a.constraint:""})}return i}function s(){i(".installed-container").each(function(){var n=t(this).find(".installed-list");D=i(".installed-container .console"),t.get(e.data("extend.baseurl")+"installed",function(t){var a="";if("object"==typeof t){n.show(),n.find(".installed-list-items").html(""),i(".installed-container .console").hide();var s=!0;"object"==typeof t&&(a+=o(t),s=!1),s&&(a=e.data("extend.packages.empty"),D.hide()),n.find(".installed-list-items").append(a)}else D.html(e.data("extend.text.bad-json"))}).fail(function(e){a(e)})})}function l(){t("#installModal").on("hide.bs.modal",function(){i(".latest-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".stable-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+e.data("extend.text.no-stable")+"</strong></td></tr>"),i(".dev-version-container .installed-version-item").html('<tr><td colspan="3"><strong>'+e.data("extend.text.no-test")+"</strong></td></tr>"),i(".install-response-container .console").html(e.data("extend.text.installing")),i(".theme-postinstall").hide(),i(".theme-generate-response").hide(),i(".extension-postinstall").hide(),i(".install-response-container").hide(),i(".install-latest-container").hide(),i(".install-version-container").hide(),i(".postinstall-footer").hide(),i("#installModal .loader").show()})}function r(){var n,o;i(".update-container").show(),o=i(".update-output-console").html(),i(".update-output-notice").html(o),i(".update-output-notice").find(".update-output-element").removeClass("update-output-element").addClass("update-output").show(),i(".update-list").hide(),(n=i(".update-list-items")).html(""),(D=i(".update-output")).html(e.data("extend.text.updating")),t.get(e.data("extend.baseurl")+"check",function(t){if(t.updates.length>0||t.installs.length>0){var a,o;for(a in t.installs)t.installs.hasOwnProperty(a)&&(o=t.installs[a],n.append(e.data("extend.packages.install_new",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));for(a in t.updates)t.updates.hasOwnProperty(a)&&(o=t.updates[a],n.append(e.data("extend.packages.install_update",{"%PACKAGE%":o.name,"%VERSION%":o.version,"%PRETTYVERSION%":o.prettyversion})));D.hide(),i(".update-list").show()}else D.html(e.data("extend.text.updated"))}).fail(function(e){a(e)})}function d(e,t,n){var a=i(".update-container");e&&a.find(".update-output-title").html(e),t&&(a.find(".update-output-console").find(".console").html(t),a.find(".update-output-console").show()),n&&a.find(".update-output-notice").html(n).show(),a.show()}function c(e,t){var n=i(".update-container");e&&n.find(".update-output-console").find(".console").html(e).show(),t&&n.find(".update-output-notice").html(t).show()}function u(){d(e.data("extend.text.running-update-all"),e.data("extend.text.running-update"),!1),t.get(e.data("extend.baseurl")+"update",function(e){setTimeout(function(){i(".update-container").hide()},7e3),c(e),s()}).fail(function(e){a(e)})}function f(n){var o=i(".update-output").html(e.data("extend.text.updating")),l=t(n.target).data("package");o.show(),D=o,t.get(e.data("extend.baseurl")+"update?package="+l).success(function(e){i(".update-output").html(e),i('.update-list-items tr[data-package="'+l+'"]').remove(),B(function(){D.hide()},4e3),i(".update-list-items tbody tr").length<1&&i(".update-container").hide(),s()}).fail(function(e){a(e)}),n.preventDefault()}function p(n){d(e.data("extend.text.install-running"),e.data("extend.text.install-all"),!1),t.get(e.data("extend.baseurl")+"installAll",function(e){B(function(){i(".update-container").hide()},7e3),c(e),s()}).fail(function(e){a(e)}),n.stopPropagation(),n.preventDefault()}function h(n){d(e.data("extend.text.autoloader-update"),e.data("extend.text.autoloader-start")+" …",!1),t.get(e.data("extend.baseurl")+"dumpAutoload",function(e){B(function(){i(".update-container").hide()},7e3),c(e)}).fail(function(e){a(e)}),n.stopPropagation(),n.preventDefault()}function m(t){var i,n,a="";for(var o in t)t.hasOwnProperty(o)&&void 0!==(i=t[o])&&(n="approved"===i.buildStatus?" label-success":"",a+=e.data("extend.packages.versions",{"%NAME%":i.name,"%VERSION%":i.version,"%CLASS%%":n,"%BUILDSTATUS%":i.buildStatus}));return a}function v(n){D=i(".update-output"),t.get(e.data("extend.baseurl")+"installInfo?package="+n,function(e){var t=e.dev,n=e.beta,a=e.RC,o=e.stable;i(".dev-version-container .installed-version-item").html(""),o.length>0?(i(".stable-version-container .installed-version-item").html(""),i(".stable-version-container .installed-version-item").append(m(o)),i(".latest-version-container .installed-version-item").html(""),i(".latest-version-container .installed-version-item").append(m([e.stable[0]])),i(".install-latest-container").show()):i(".install-version-container").show(),a.length>0&&i(".dev-version-container .installed-version-item").append(m(a)),n.length>0&&i(".dev-version-container .installed-version-item").append(m(n)),t.length>0&&i(".dev-version-container .installed-version-item").append(m(t)),i("#installModal .loader").hide()}).fail(function(e){a(e)})}function g(e){var t=i('input[name="check-package"]').val(),n=i('input[name="check-package"]').data("packagename");n&&(t=n),v(t),e.preventDefault()}function b(){i(".install-latest-container").hide(),i(".install-version-container").show()}function _(e){i(".extension-postinstall").show(),i(".extension-postinstall .modal-success").show(),i(".postinstall-footer .ext-link").attr("href",e.source),i(".postinstall-footer").show()}function k(e){var t=e.name.split(/\/+/).pop();i(".install-response-container").hide(),i(".theme-postinstall").show(),i(".theme-generation-container").show(),i(".theme-postinstall .theme-generator").data("theme",e.name),i(".theme-postinstall #theme-name").val(t),i(".postinstall-footer").show()}function w(i,n){t.get(e.data("extend.baseurl")+"packageInfo",{package:i,version:n}).done(function(e){"bolt-extension"===e.type&&_(e),"bolt-theme"===e.type&&k(e)}).fail(function(e){a(e)})}function y(n){var o=t(n.target).data("package"),l=t(n.target).data("version");i(".install-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(D=i(".install-response-container .console")).html(e.data("extend.text.installing")),i("#installModal .loader .message").html(e.data("extend.text.installing")),t.get(e.data("extend.baseurl")+"install",{package:o,version:l}).done(function(){w(o,l),i(".install-response-container").hide(),i(".check-package").show(),i('input[name="check-package"]').val(""),s()}).fail(function(e){a(e)}),n.preventDefault()}function x(n){var o=t(n.target).data("theme"),s=i("#theme-name").val();t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){i(".theme-generate-response").html("<p>"+e+"</p>").show(),i(".theme-generation-container").hide()}).fail(function(e){a(e)}),n.preventDefault()}function C(n){var o=t(n.target).data("theme"),s=i("#theme-name").val();if(confirm(e.data("extend.text.overwrite"))){var l=i(".installed-container .console").html(e.data("extend.text.copying"));l.show(),D=l,t.get(e.data("extend.baseurl")+"generateTheme",{theme:o,name:s}).done(function(e){D.html(e),B(function(){l.hide()},5e3)}).fail(function(e){a(e)})}n.preventDefault()}function E(e){t.get(t(e.target).data("readme")).done(function(e){bootbox.dialog({message:e||"Readme is empty."})}).fail(function(e){a(e)}),e.preventDefault()}function T(n){var o=t(n.target).data("needle"),s=t(n.target).data("constraint");i(".dependency-response-container").show(),i(".install-latest-container").hide(),i(".install-version-container").hide(),(D=i(".dependency-response-container .console")).html(""),t.get(e.data("extend.baseurl")+"depends",{needle:o,constraint:s}).done(function(e){i(".loader").hide(),i(".dependency-response-container").hide(),i(".check-package").show(),i('input[name="check-package"]').val("");var t=i("#installModal .extension-dependencies-list");t.html(""),e.forEach(function(e){t.append("<li>"+e.link+"</li>")}),t.show(),i(".extension-dependencies").show(),i(".postinstall-footer").show()}).fail(function(e){a(e)}),n.preventDefault()}function S(e){v(t(e.target).data("available"))}function I(n){var o=i(".installed-container .console").html(e.data("extend.text.removing"));if(!1===confirm(e.data("extend.text.confirm-remove")))return n.stopPropagation(),n.preventDefault(),!1;o.show(),D=o,t.get(t(n.target).attr("href")).done(function(e){i(".installed-container .console").html(e),s(),B(function(){D.hide()},2e3)}).fail(function(e){a(e)}),n.preventDefault()}function R(){var n=i('input[name="check-package"]');n.on("keyup",function(){var i=t(this).val();i.length<3||B(function(){t.ajax({url:e.data("extend.siteurl")+"list.json",dataType:"jsonp",data:{name:i,bolt:e.data("extend.sitever")}}).success(function(e){if(e.packages.length){var t=n.parent().find(".auto-search");t.html("").show();for(var i in e.packages)if(e.packages.hasOwnProperty(i)){var a=e.packages[i],o='data-request="prefill-package" data-packagename="'+a.name+'"';t.append('<a class="btn btn-block btn-default prefill-package" '+o+'style="text-align: left;">'+a.title+" <small "+o+">("+a.authors+" - "+a.name+")</small></a>")}n.on("blur",function(){t.fadeOut()})}})},500)})}function A(e){var n=t(e.target);i('input[name="check-package"]').val(n.closest("a").text()),i('input[name="check-package"]').data("packagename",n.data("packagename")),i(".auto-search").hide()}var D,O,$={},B=function(){var e=0;return function(t,i){clearTimeout(e),e=setTimeout(t,i)}}(),M={click:function(e){switch(t(e.target).data("request")){case"update-check":r();break;case"update-run":u();break;case"update-package":f(e.originalEvent);break;case"check-package":g(e.originalEvent);break;case"uninstall-package":I(e.originalEvent);break;case"install-package":y(e.originalEvent);break;case"prefill-package":A(e.originalEvent);break;case"install-run":p(e.originalEvent);break;case"autoload-dump":h(e.originalEvent);break;case"generate-theme":x(e.originalEvent);break;case"package-available":S(e.originalEvent);break;case"package-copy":C(e.originalEvent);break;case"package-readme":E(e.originalEvent);break;case"package-depends":T(e.originalEvent);break;case"show-all":b(e.originalEvent)}}};$.init=function(){var e=t(".extend-bolt-container");e.length&&(e.on("click",M.click),t(document).ajaxStart(function(){O=setInterval(function(){D&&D.append(".")},1e3)}).ajaxSuccess(function(){clearInterval(O)}).ajaxError(function(){clearInterval(O)}),s(),R(),l())},e.extend=$}(Bolt||{},jQuery),function(e,t){"use strict";var i={},n={},a=/^([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?(?:\.([a-zA-Z0-9_-]+))?$/;i.fire=function(e,t){var i=a.exec(e);if(i&&void 0!==i[4])for(;e;)n[e]&&n[e].fire({namespace:i[1],domain:i[2],event:i[3],status:i[4]},t),e=e.replace(/\.?[a-zA-Z0-9_-]+$/,"")},i.on=function(e,i){a.exec(e)&&(n[e]||(n[e]=t.Callbacks("unique")),n[e].add(i))},i.off=function(e,t){a.exec(e)&&n[e]&&n[e].remove(t)},e.events=i}(Bolt||{},jQuery),function(e,t){"use strict";function i(e,i,n,a){var o={url:e,type:"POST",data:i,success:function(){document.location.reload()},error:function(e){alert(e.responseText),console.error(n)}};a&&(o.success=a),t.ajax(o)}var n={};n.createFile=function(t,n){var a=window.prompt(e.data("files.msg.create_file"));a.length&&i(e.data("url.file.create"),{filename:a,parentPath:n,namespace:t},"Something went wrong creating this file!")},n.renameFile=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_file"),a);o.length&&o!==a&&i(e.data("url.file.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this file!")},n.deleteFile=function(n,a,o){confirm(e.data("files.msg.delete_file",{"%FILENAME%":a}))&&i(e.data("url.file.delete"),{namespace:n,filename:a},"Failed to delete the file from the server",function(){null!==o&&t(o).closest("tr").slideUp()})},n.duplicateFile=function(t,n){i(e.data("url.file.duplicate"),{namespace:t,filename:n},"Something went wrong duplicating this file!")},n.createFolder=function(t,n){var a=window.prompt(e.data("files.msg.create_folder"));a.length&&i(e.data("url.folder.create"),{parent:n,foldername:a,namespace:t},"Something went wrong renaming this folder!")},n.renameFolder=function(t,n,a){var o=window.prompt(e.data("files.msg.rename_folder"),a);o.length&&o!==a&&i(e.data("url.folder.rename"),{namespace:t,parent:n,oldname:a,newname:o},"Something went wrong renaming this folder!")},n.deleteFolder=function(t,n,a){window.confirm(e.data("files.msg.delete_folder",{"%FOLDERNAME%":a}))&&i(e.data("url.folder.delete"),{namespace:t,parent:n,foldername:a},"Something went wrong renaming this folder!")},e.files=n}(Bolt||{},jQuery),function(e,t,i){"use strict";function n(e){return e.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function a(e,t){var i="<mark>"+t+"</mark>";return e.replace(new RegExp(n(t),"g"),i)}function o(){var e=t(this).val();t(".dashboardlisting").find("[data-bolt-browse-name]").each(function(){var i=t(this).data("bolt-browse-name"),n=i.search(e)<0;t(this).toggleClass("hidden",n),n||t(this).find(".name").each(function(){t(this).html(a(i,e)),0===e.length&&t(this).html(i)})})}function s(){for(var e=document.querySelectorAll("img[data-src]"),t=0;t<e.length;t++)e[t].getAttribute("data-src")&&(e[t].setAttribute("src",e[t].getAttribute("data-src")),e[t].removeAttribute("data-src"))}function l(){document.getElementById("file-manager-search").addEventListener("keyup",o),t("#file_upload_select").addClass("btn-secondary").bootstrapFileInput(),document.getElementById("file_upload_select").addEventListener("change",function(){document.getElementById("file_upload_upload").removeAttribute("disabled")}),window.addEventListener("load",s)}function r(e){var i=t("body"),n=0;i.bind({dragenter:function(e){e.preventDefault(),n++,t(this).addClass("dropzone-active")},dragleave:function(){0===--n&&t(this).removeClass("dropzone-active")}}),e.on("drop",function(){i.removeClass("dropzone-active")})}function d(){var n=t('form[name="file_upload"]').find("#file_upload__token").val(),a=new i(document.body,{url:e.conf("uploadConfig.url"),previewsContainer:"#dropzone-preview",acceptedFiles:"."+e.conf("uploadConfig.acceptFilesTypes").join(",."),uploadMultiple:"true",enqueueForUpload:"true",hiddenInputContainer:".form-horizontal",paramName:"file_upload[select]",clickable:!1,autoProcessQueue:!0,params:{"file_upload[_token]":n},init:function(){r(this)}});a.on("sending",function(){t(".panel-uploadprogress").removeClass("hidden")}),a.on("complete",function(e){a.removeFile(e)}),a.on("totaluploadprogress",function(e){100===e&&window.setTimeout(function(){location.reload()},200)})}var c={};c.init=function(){i.autoDiscover=!1,null!==document.querySelector("div.file-manager")&&(d(),l())},e.filemanager=c}(Bolt||{},jQuery,Dropzone),function(e,t,i,n){"use strict";var a={},o=["text","html","textarea"],s=null;a.init=function(e){a.previewUrl=e.previewUrl,Modernizr.contenteditable?(t("#sidebar_live_edit, #content_edit_live_edit").bind("click",a.start),t(".close-live-editor").bind("click",a.stop),t(".save-live-editor").bind("click",a.save)):t(".live-editor, #sidebar_live_editor, #content_edit_live_edit").remove()},a.start=function(){var i=t('form[name="content_edit"]');if(e.validation.run(i[0])){var n=i.find("*[name=_live-editor-preview]"),l=t("#navpage-primary").find(".navbar-header a"),r=t("#live-editor-iframe"),d=function(e){e.preventDefault()},c=function(){var n=r[0],s=n.contentWindow||n,l=s.document,c=t(l);c.on("click","a",d);var u=e.ckeditor.initcke(s.CKEDITOR),f=u.editorConfig;u.editorConfig=function(e){f.bind(this)(e);for(var t in e.toolbar)if("tools"===e.toolbar[t].name){var i=e.toolbar[t].items.indexOf("Source");i>-1&&delete e.toolbar[t].items[i]}},u.disableAutoInline=!1,c.find("[data-bolt-field]").each(function(){var n=i.find("*[name="+a.escapejQuery(t(this).data("bolt-field"))+"]").closest("[data-bolt-fieldset]").data("bolt-fieldset");if(t(this).addClass("bolt-editable"),!t(this).data("no-edit")&&-1!==o.indexOf(n))if(t(this).attr("contenteditable",!0),"html"===n){var r=u.inline(this,{allowedContent:""}),d=e.utils.debounce(function(){r.element.data("src",r.getData())},500);r.on("instanceReady",d),r.on("change",d)}else t(this).on("paste",function(e){var t;e.preventDefault(),e.originalEvent.clipboardData?(t=e.originalEvent.clipboardData.getData("text/plain"),l.execCommand("insertText",!1,t)):s.clipboardData&&(t=s.clipboardData.getData("Text"),s.getSelection&&s.getSelection().getRangeAt(0).insertNode(l.createTextNode(t)))}),"textarea"===n?t(this).on("keypress",function(e){13===e.which&&(e.preventDefault(),l.execCommand("insertHTML",!1,"<br><br>"))}):t(this).on("keypress",function(e){return 13!==e.which}).on("focus blur",function(){t(this).html(t(this).text())})})};r.on("load",c),e.liveEditor.active=!0,t("body").addClass("live-editor-active"),l.on("click",d),n.val("yes"),i.attr("action",a.previewUrl).attr("target","live-editor-iframe").submit(),i.attr("action","").attr("target","_self"),n.val(""),s=function(){r.off("load",c),l.off("click",d)}}},a.save=function(){a.extractText(),t("#content_edit_save").trigger("click")},a.stop=function(){var i=t("#live-editor-iframe")[0];a.extractText(),t(i).attr("src",""),e.liveEditor.active=!1,t("body").removeClass("live-editor-active"),s()},a.extractText=function(){var e=t("#live-editor-iframe")[0],i=(e.contentWindow||e).document;t(i).find("[data-bolt-field]").each(function(){var e=t('form[name="content_edit"]'),i=t(this).data("bolt-field"),o=e.find("[name="+a.escapejQuery(i)+"]"),s=o.closest("[data-bolt-fieldset]").data("bolt-fieldset");if("html"===s){var l=o.attr("id");n.instances.hasOwnProperty(l)&&n.instances[l].setData(t(this).data("src"))}else o.val(a.cleanText(t(this),s))})},a.cleanText=function(e,t){return"textarea"===t&&e.html(e.html().replace(/&nbsp;/g," ").replace(/\s?<br.*?>\s?/g,"\n")),e.text()},a.escapejQuery=function(e){return e.replace(/[:\.\[\],]/g,"\\$1")},a.active=!1,a.previewUrl=null,e.liveEditor=a}(Bolt||{},jQuery,window,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t,i){"use strict";var n={};n.init=function(){var n=t(".omnisearch select");n.select2({width:"100%",placeholder:e.data("omnisearch.placeholder"),minimumInputLength:3,multiple:!0,ajax:{delay:600,url:n.data("omnisearchUrl"),dataType:"json",data:function(e){return{q:e.term}},processResults:function(e){var i=[];return t.each(e,function(e,t){i.push({id:t.path,path:t.path,text:t.label})}),{results:i}}},templateResult:function(e){var t=e.path?"<small>"+e.path+"</small>":"";return"<div>"+(e.loading?'<i class="fa fa-spinner fa-spin"></i> ':"")+e.text+"</div>"+t},templateSelection:function(e){return i.location.href=e.path,null},escapeMarkup:function(e){return e}})},e.omnisearch=n}(Bolt||{},jQuery,window),function(e,t,i){"use strict";function n(){t(".navbar-toggle").on("click",function(){var e=t("#navpage-wrapper");e.hasClass("nav-secondary-opened")?e.removeClass("nav-secondary-opened nav-secondary-collapsed"):e.removeClass("nav-secondary-collapsed").addClass("nav-secondary-opened")})}function a(){t(".nav-secondary-collapse a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-opened").addClass("nav-secondary-collapsed"),setTimeout(function(){t("#navpage-wrapper").addClass("nav-secondary-collapsed-hoverable")},300),t.cookie("sidebar","collapsed",{expires:21,path:"/"}),t("#bolt-footer").addClass("bolt-footer-hidden"),!1})}function o(){t(".nav-secondary-expand a").on("click",function(){return t("#navpage-wrapper").removeClass("nav-secondary-collapsed nav-secondary-opened nav-secondary-collapsed-hoverable"),t.removeCookie("sidebar",{path:"/"}),t("#bolt-footer").removeClass("bolt-footer-hidden"),!1})}function s(){var e=t("#navpage-content").outerHeight(),n=t("#navpage-secondary"),a=n.outerHeight(),o=t(document).height()-n.position().top,l=Math.max(e,o),r=5e3;a!==l&&(n.outerHeight(l),r=500),i.setTimeout(s,r)}function l(){t("#navpage-secondary").find("a.menu-pop").each(function(){var e=t(this),n="";e.nextAll(".submenu").children().each(function(){t(this).hasClass("subdivider")&&(n+="<hr>"),n+=t(this).html().trim().replace(/[ \n]+/g," ").replace(/(>) | (<)/g,"$1$2")}),e.popover({trigger:"manual",content:n,html:!0}),e.on("mouseover focus click dblclick",function(e){var n=this,a=300;"click"!==e.type||t(n).next().hasClass("popover")||(e.preventDefault(),a=0),i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").not(n).popover("hide"),t(n).popover("show")},a)})}).end().on("mouseenter focus",".popover",function(){i.clearTimeout(c)}).on("mouseleave blur","a.menu-pop, .popover",function(){i.clearTimeout(c),c=i.setTimeout(function(){t("#navpage-secondary a.menu-pop").popover("hide")},300)})}function r(){t("#navpage-secondary a.menu-pop").on("click",function(e){var i=t(this).nextAll(".submenu");e.preventDefault(),i.hasClass("show")?i.removeClass("show"):(t("#navpage-secondary .submenu").removeClass("show"),i.addClass("show"))})}var d={},c=0;d.init=function(){var e=!t(".navbar-toggle").is(":visible");n(),a(),o(),t("#navpage-secondary").length&&s(),e?l():r()},e.secmenu=d}(Bolt||{},jQuery,window),function(e,t){"use strict";var i={};i.init=function(){t("a[data-bolt-addtostack]").each(function(){t(this).on("click",function(e){var n=t(e.currentTarget),a=n.data("bolt-addtostack");e.preventDefault(),i.addToStack(a,n)})})},i.addToStack=function(i,n){t.post(e.conf("stackAddUrl"),{filename:i}).done(function(e){n&&t(n).addClass("disabled"),t(":bolt-buicStack").buicStack("prepend",e.panel,e.removed),e.removed&&t(".select-from-stack [data-file]").each(function(){t(this).data("file").fullPath===e.removed&&t(this).remove()}),t(".select-from-stack").each(function(){var i=t(this).data("type");i&&e.type!==i||t(this).prepend(e.list)})}).fail(function(){console.error("Failed to add file to stack")})},e.stack=i}(Bolt||{},jQuery),function(e){"use strict";var t={};t.humanBytes=function(t){for(var i=-1;++i<8&&Math.abs(t)>=1e3;)t/=1e3;return(t="object"==typeof Intl&&Intl&&"function"==typeof Intl.NumberFormat?t.toLocaleString(e.conf("locale.long").replace(/_/g,"-"),{maximumSignificantDigits:3}):t.toFixed(2))+" "+" kMGTPEZY"[i].trim()+"B"},t.filterInt=function(e,t){return/^(\-|\+)?([0-9]+|Infinity)$/.test(e)?Number(e):t||NaN},t.debounce=function(e,t,i){var n;return function(){var a=this,o=arguments,s=i&&!n;clearTimeout(n),n=setTimeout(function(){n=null,i||e.apply(a,o)},t),s&&e.apply(a,o)}},e.utils=t}(Bolt||{}),function(e){"use strict";jQuery.widget("bolt.baseField",{_create:function(){}})}(),function(e){"use strict";var t={};e.widget("bolt.baseInterval",{options:{delay:1e4},_create:function(){var i=this,n=this.widgetName;if(!t[n]){var a=e.Callbacks(),o=setInterval(a.fire,this.options.delay);t[n]={id:o,delay:this.options.delay,callbacks:a}}this._fncUpdate=function(){i._update()},t[n].callbacks.add(this._fncUpdate)},_destroy:function(){var e=this.widgetName;t[e].callbacks.remove(this._fncUpdate),t[e].callbacks.has()||(clearInterval(t[e].id),delete t[e])}})}(jQuery),function(e){"use strict";e.widget("bolt.buicBrowser",{options:{url:"",multiselect:!1},_create:function(){this._url=this.options.url,this._on({click:function(){this._browse()}})},_browse:function(){var t=this,i={multiselect:this.options.multiselect},n=[],a=!1;e("body").buicModal({size:"large",remote:{url:t._url,data:i},loaded:function(i,o){var s=o.footer.find("[data-fbrowser-add-checked]");o.header.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}),o.body.on("click.bolt","[data-fbrowser-chdir]",function(i){i.preventDefault(),t._url=e(this).data("fbrowser-chdir"),t._browse()}).on("click.bolt","[data-file] a",function(i){i.preventDefault();var n=e(this).closest("[data-file]").data("file");t._trigger("selected",null,n),o.close()}).on("click.bolt","[aria-pressed]",function(t){var i="false"===e(this).attr("aria-pressed"),n=this.className.replace("toogle-","");e(this).attr("aria-pressed",i?"true":"false"),o.body.find("tbody."+n).toggleClass("hidden",!i),t.clientX>0&&this.blur()}).on("change",'select[name="ext"]',function(){t._filter(o)}).keyup('input[name="filter"]',function(){t._filter(o)}).on("change","[data-fbrowser-check]",function(){var t=e(this).closest("[data-file]").data("file"),i=n.indexOf(t.fullPath);i>-1?(n.splice(i,1),a=!1,0===n.length&&s.addClass("disabled")):(n.push(t.fullPath),s.removeClass("disabled"))}),o.footer.on("click.bolt",".toggle-all",function(t){t.preventDefault(),a?(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!1)}),n.length=0,a=!1,s.addClass("disabled")):(o.body.find("[data-fbrowser-check]").each(function(){e(this).prop("checked",!0);var t=e(this).closest("[data-file]").data("file");n.push(t.fullPath)}),a=!0,s.removeClass("disabled"))}).on("click.bolt","[data-fbrowser-add-checked]:not(.disabled)",function(i){i.preventDefault(),o.body.find("[data-fbrowser-check]").each(function(){if(e(this).prop("checked")){var i=e(this).closest("[data-file]").data("file");t._trigger("selected",null,i)}}),o.close()})}})},_filter:function(t){var i,n,a=t.body.find('input[name="filter"]').val(),o=t.body.find('select[name="ext"]').val();t.body.find("[data-file],[data-folder]").each(function(){i=e(this).data("file")||e(this).data("folder"),n=""!==o&&i.extension!==o||""!==a&&i.filename.search(a)<0,e(this).toggleClass("hidden",n),n||e(this).find("a, span").each(function(){e(this).html(i.filename.replace(a,"<mark>"+a+"</mark>"))})})}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicCheckbox",{_create:function(){var e=this.element.find("button"),t=this.element.find("input");this._on(e,{click:function(){t.prop("checked",!t.prop("checked"))}})}})}(),function(e,t){"use strict";e.widget("bolt.buicListing",{_create:function(){this.csrfToken=this.element.data("bolt_csrf_token"),this.contentType=this.element.data("contenttype"),this.contentTypeName=this.element.data("contenttype-name"),this.element.find("table.listing tbody").buicListingPart()},modifyRecords:function(i,n,a){var o,s=this,l={},r={delete:{safe:!1,name:t.data("recordlisting.action.delete",{"%CTNAME%":this.contentTypeName}),cmd:{delete:null}},publish:{safe:!0,name:t.data("recordlisting.action.publish",{"%CTNAME%":this.contentTypeName}),cmd:{modify:{status:"published"}}},depublish:{safe:!0,name:t.data("recordlisting.action.depublish"),cmd:{modify:{status:"held"}}},draft:{safe:!0,name:t.data("recordlisting.action.draft"),cmd:{modify:{status:"draft"}}}};l[s.contentType]={},e(n).each(function(){l[s.contentType][this]=r[i].cmd}),o=(o=1===n.length?t.data("recordlisting.confirm.one"):t.data("recordlisting.confirm.multi",{"%NUMBER%":"<b>"+n.length+"</b>"}))+"<br><br><b>"+t.data("recordlisting.confirm.no-undo")+"</b>",r[i].safe?s._sendModifyRecordsQuery(l):bootbox.dialog({message:o,title:r[i].name,buttons:{cancel:{label:t.data("recordlisting.action.cancel"),className:"btn-default"},ok:{label:a,className:"btn-danger",callback:function(){s._sendModifyRecordsQuery(l)}}}})},_sendModifyRecordsQuery:function(i){var n=this;e.ajax({url:t.conf("contentActionUrl"),type:"POST",data:{bolt_csrf_token:n.csrfToken,contenttype:n.contentType,actions:i},success:function(e){n.element.html(e),n.element.find("table.listing tbody").buicListingPart()},error:function(e,t,i){console.error(e.status+" ("+i+"):"),console.error(JSON.parse(e.responseText))},dataType:"html"})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.buicListingPart",{_create:function(){var t=this;this.listing=this.element.closest(":bolt-buicListing"),this.toolbar=this.element.find("tr.selectiontoolbar"),this.toolbarCount=this.toolbar.find("div.count"),this.menu=this.element.find("tr.header th.menu"),this.menuOnlyOnSelection=this.menu.find("li:not(.select-all)"),this.menuSelectionCount=this.menu.find("li.dropdown-header"),this.menuSelectionCountTemplate=this.menuSelectionCount.text(),this.selectedIds=[],this.menu.find("li.select-all, li.select-none").on("click",function(){var i=e(this).hasClass("select-all");t.element.find('td input:checkbox[name="checkRow"]').each(function(){this.checked=i,t._update(this)})}),this.element.find('td input:checkbox[name="checkRow"]').on("click",function(){t._update(this)}),this.toolbar.find('button[data-stb-cmd^="record:"]').on("click",function(){t._modifyRecords(e(this).data("stb-cmd"),t.selectedIds,e(this).html())}),this.element.find('a[data-listing-cmd^="record:"]').on("click",function(){t._modifyRecords(e(this).data("listing-cmd"),[e(this).parents("tr").attr("id").substr(5)],e(this).html())})},_modifyRecords:function(e,t,i){t.length>0&&this.listing.buicListing("modifyRecords",e.replace(/^record:/,""),t,i)},_update:function(t){var i,n=e(t).closest("tr"),a=n.attr("id").substr(5);t.checked?(-1===this.selectedIds.indexOf(a)&&this.selectedIds.push(a),n.addClass("row-selected")):(this.selectedIds.splice(this.selectedIds.indexOf(a),1),n.removeClass("row-selected")),(i=this.selectedIds.length)?(this.toolbar.removeClass("hidden"),this.menuOnlyOnSelection.removeClass("hidden")):(this.toolbar.addClass("hidden"),this.menuOnlyOnSelection.addClass("hidden")),this.toolbarCount.text(i),this.menuSelectionCount.text(this.menuSelectionCountTemplate.replace("(#)","("+i+")"))}})}(jQuery),function(e){"use strict";e.widget("bolt.buicModal",{options:{size:void 0,closer:!1,classname:void 0,headline:void 0,header:void 0,body:void 0,footer:void 0,remote:void 0,loaded:void 0},_create:function(){var t=this,i=e('<div class="modal-header hidden"/>'),n=e("<div class=modal-body/>"),a=e('<div class="modal-footer hidden"/>'),o=e("<div class=modal-content/>").append(i,n,a),s=e("<div class=modal-dialog role=document/>").append(o),l=e('<div tabindex=-1 role=dialog class="modal fade buic-modal"/>').append(s);this._ui={header:i,body:n,footer:a,content:o,dialog:s,modal:l},this._on(this.element,{"click .modal-retry":function(){t._load()}}),t.element.prepend(t._ui.modal),t._ui.modal.on("show.bs.modal",function(){t._fire("show")}).on("shown.bs.modal",function(){t._fire("shown")}).on("hide.bs.modal",function(){t._fire("hide")}).on("hidden.bs.modal",function(){t._fire("hidden"),t.destroy()}).modal("show")},_destroy:function(){this._ui.modal.data("modal",null).remove()},_fire:function(e){var t=this;t._trigger(e,null,{close:function(){t._ui.modal.modal("hide")},header:t._ui.header,body:t._ui.body,footer:t._ui.footer})},_init:function(){this._ui.dialog.toggleClass("modal-sm","small"===this.options.size).toggleClass("modal-lg","large"===this.options.size),this.options.remote?this._load():this._update()},_load:function(){var t=this;t._ui.content.addClass("modal-loading"),e.get(t.options.remote.url,t.options.remote.data||{}).done(function(i){t.options.classname=e(i)[0].className,e.each(["header","body","footer"],function(n,a){var o=e(i).children(a.replace("body","main"))[0];t.options[a]=o?o.innerHTML:void 0}),t._update(),t._fire("loaded")}).fail(function(){t.options.header=void 0,t.options.body='<button type=button class="btn btn-default modal-retry"><i class="fa fa-refresh"></i></button>',t.options.footer=void 0,t._update()}).always(function(){t._ui.content.removeClass("modal-loading")})},_update:function(){var t,i=this;void 0!==this.options.headline&&(this.options.header=e(),this.options.closer&&(this.options.header=this.options.header.add('<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>')),this.options.header=this.options.header.add(e('<h4 class="modal-title"/>').append(this.options.headline))),this._ui.content.attr("class","modal-content").addClass(this.options.classname),e.each(["header","body","footer"],function(n,a){t=e("<div>").append(i.options[a]).html()||"",i._ui[a].off().toggleClass("hidden",!t.length).html(t)}),this._ui.modal.modal("handleUpdate")}})}(jQuery),function(e,t){"use strict";e.widget("bolt.buicMoment",e.bolt.baseInterval,{options:{delay:15e3,titleFormat:"YYYY-MM-DD HH:mm:ss ZZ"},_create:function(){this.set(),this._super()},_update:function(){this.element.html(t(this.element.attr("datetime")).fromNow())},set:function(e){e?this.element.attr("datetime",t(e).format()):e=this.element.attr("datetime"),this.element.attr("title",t(e).format(this.options.titleFormat)),this._update()}})}(jQuery,moment),function(e){"use strict";e.widget("bolt.buicProgress",{_create:function(){this.bars={},this.element.addClass("buic-progress")},_set:function(e,t){t=parseFloat(t),t=isNaN(t)?0:Math.min(100,Math.max(0,Math.round(100*t))),this.bars[e]&&this.bars[e].find(".progress-bar").attr("aria-valuenow",t).css("width",t+"%")},add:function(t,i,n){this.bars[t]||(this.bars[t]=e('<div class="progress"><div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div></div>'),this.bars[t].attr("data-label",n||t).find(".progress-bar").text(n||t),this._set(t,i),this.element.append(this.bars[t]).show(),this.bars[t].show(300))},remove:function(e){if(this.bars[e]){var t=this,i=this.bars[e];delete this.bars[e],i.hide(300,function(){i.remove(),0===Object.keys(t.bars).length&&t.element.hide()})}},set:function(e,t){this._set(e,t)}})}(jQuery),function(e){"use strict";jQuery.widget("bolt.buicSelect",{_create:function(){this.select=this.element.find("select"),this.buttonAll=this.element.find(".select-all"),this.buttonNone=this.element.find(".select-none"),this.buttonAll.prop("title",this.buttonAll.text().trim()),this._on(this.buttonAll,{click:function(){this.all()}}),this.buttonNone.prop("title",this.buttonNone.text().trim()),this._on(this.buttonNone,{click:function(){this.none()}}),this._update(),this._on(this.select,{change:function(){this._update()}})},_update:function(){var e=this.select.find("option"),t=e.length,i=e.filter(":selected").length,n=this.select.prop("multiple")?0===i:""===this.select.val();this.buttonAll.prop("disabled",i===t),this.buttonNone.prop("disabled",n)},all:function(){this.select.find("option").prop("selected",!0).trigger("change")},none:function(){this.select.val(null).trigger("change")}})}(),function(e,t){"use strict";e.widget("bolt.buicStack",{_addPath:function(e,i){t.stack.addToStack(i.path)},_create:function(){var e=this,i=this.element;this._ui={holder:i.find(".stackholder")},e._on({buicbrowserselected:e._addPath,buicuploaduploaded:e._addPath}),i.on("inserted.bs.popover",".stackitem",function(){t.app.initWidgets()}),i.buicUpload()},prepend:function(t,i){i&&this._ui.holder.find("[data-file]").each(function(){e(this).data("file").fullPath===i&&e(this).remove()}),this._ui.holder.find(".empty").remove(),this._ui.holder.prepend(t),this._ui.holder.find(".info-pop").popover({trigger:"hover",delay:{show:500,hide:200}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.buicUpload",{_create:function(){var i=this.element,n=e("input[type=file]",i),a=e(".elm-dropzone",i),o=e(n).attr("accept"),s=o?o.replace(/^\./,"").split(/,\./):[],l=new RegExp("(\\.|\\/)("+s.join("|")+")$","i");if(null===this.options.maxSize){var r=Math.floor(t.conf("uploadConfig.maxSize"));this.options.maxSize=t.utils.filterInt(r,2e6)}this._ui={progress:null},n.fileupload({dataType:"json",dropZone:a,pasteZone:null,maxFileSize:this.options.maxSize>0?this.options.maxSize:void 0,minFileSize:void 0,acceptFileTypes:o?l:void 0,maxNumberOfFiles:void 0,messages:{maxFileSize:">:"+t.utils.humanBytes(this.options.maxSize),minFileSize:"<",acceptFileTypes:"T:."+s.join(", ."),maxNumberOfFiles:"#"}}),this._on({fileuploadprocessfail:this._onProcessFail,fileuploadsubmit:this._onUploadSubmit,fileuploadprogress:this._onUploadProgress,fileuploadalways:this._onUploadAlways,fileuploaddone:this._onUploadDone})},_onProcessFail:function(e,i){var n,a=i.files[i.index],o=a.error.substr(0,1),s={"%FILENAME%":a.name,"%FILESIZE%":t.utils.humanBytes(a.size),"%FILETYPE%":a.type,"%ALLOWED%":a.error.substr(2)};switch(o){case">":n=t.data("field.uploads.template.large-file",s);break;case"T":n=t.data("field.uploads.template.wrong-type",s);break;default:n="<p>"+a.error+"</p>"}bootbox.alert(n)},_onUploadSubmit:function(e,t){this._progress("add",t.files)},_onUploadProgress:function(e,t){this._progress("set",t.files,t.loaded/t.total)},_onUploadAlways:function(e,t){this._progress("remove",t.files)},_onUploadDone:function(i,n){var a=this;e.each(n.result,function(e,n){n.error?bootbox.alert(t.data("field.uploads.template.error",{"%ERROR%":n.error})):a._trigger("uploaded",i,n)})},_progress:function(t,i,n){var a=this;null===a._ui.progress&&(a._ui.progress=e(":bolt-buicProgress",a.element)),e.each(i,function(){a._ui.progress.buicProgress(t,this.name,n)})},options:{maxSize:null}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldBlock",e.bolt.baseField,{options:{name:""},_create:function(){var t=this;this._ui={add:t.element.find(".block-add .add-button"),slot:t.element.find(".block-slot")},this._templates=t.element.find('script[type="text/template"]'),t._ui.add.on("click",function(e){t._append(e)}),t.element.on("click",".delete-button",function(){e(this).closest(".block-group").remove(),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".block-group");i.insertBefore(i.prev(".block-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".block-group");i.insertAfter(i.next(".block-group")),t._renumber(),t._resetEditors(i)})},_append:function(i){var n,a=this,o=e(i.target).data("block-type");e.each(a._templates,function(t,i){e(i).data("block-type")===o&&(n=e(i).html())});var s=this._clone(n);s.data("block-type",o),this._ui.slot.append(s),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find('[for="'+i+'"]').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=new RegExp("^([^\\[]+\\[)([#|\\d]+)(\\].*)$","gi");this._ui.slot.find("div.block-group").each(function(i,n){e(n).find("[name]").each(function(){this.name=this.name.replace(t,"$1"+i+"$3")}),e(n).is(":first-of-type")?e(n).find(".move-up").addClass("disabled"):e(n).find(".move-up").removeClass("disabled"),e(n).is(":last-of-type")?e(n).find(".move-down").addClass("disabled"):e(n).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldCategories",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.categories.text.placeholder")}})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldEmbed",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=0;this._ui={url:i.find("input.url"),width:i.find("input.width"),height:i.find("input.height"),html:i.find("input.html"),ratio:i.find("input.ratio"),authorName:i.find("input.author_name"),authorUrl:i.find("input.author_url"),provider_name:i.find("input.provider_name"),thumbnailUrl:i.find("input.thumbnail_url"),preview:i.find("img"),play:i.find("button.preview"),refresh:i.find("button.refresh"),spinner:i.find("button.refresh i")},t._ui.url.on("propertychange input",function(){clearTimeout(n),n=setTimeout(function(){t._update()},1e3)}),t._ui.width.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.height.val(Math.round(t._ui.width.val()/t._ui.ratio.val()))}),t._ui.height.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.width.val(Math.round(t._ui.height.val()*t._ui.ratio.val()))}),t._ui.refresh.on("click",function(){t._update()}),t._ui.play.on("click",function(){e("body").buicModal({size:"large",closer:!0,headline:t._ui.provider_name.val(),body:t._ui.html.val()})})},_update:function(){var i=this,n=t.data("endpoint.embed"),a=e("#id").closest("form").find('input[name="content_edit[_token]"]').val(),o={format:"json",url:i._ui.url.val(),_token:a,provider:"oembed"};o.url.length<2?i._set({}):(this._ui.refresh.prop("disabled",!0),i._ui.spinner.addClass("fa-spin"),e.post(n,o).done(function(e){i._set(e)}).fail(function(){i._set({})}).always(function(){i._ui.spinner.removeClass("fa-spin")}))},_set:function(e){this._ui.html.val(e.html||""),this._ui.width.val(e.width||""),this._ui.height.val(e.height||""),this._ui.authorName.val(e.author_name||""),this._ui.authorUrl.val(e.author_url||""),this._ui.provider_name.val(e.provider_name||""),this._ui.thumbnailUrl.val(e.thumbnail_url||this._ui.preview.data("defaultUrl")),this._ui.refresh.prop("disabled",this._ui.url.val().length<=2||this._ui.html.val().length>0)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFile",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=e("input.path",i);n.data("selected",{path:n.val()}),n.autocomplete({source:i.find("[data-autocomplete-url]").data("autocompleteUrl"),minLength:2,focus:function(e,i){return t._onPreview(e,i.item),!1},select:function(e,i){return t._onSelect(e,i.item),!1},close:function(){t._onClose()}}).autocomplete("instance")._renderItem=function(t,i){return e("<li>").append(i.path).appendTo(t)},n.on("change",function(){e(this).data("changeWithoutSelection",!0)}),n.on("blur",function(){e(this).data("changeWithoutSelection")&&(""===e(this).val()?t._onClear():t._onClose())}),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onSelect,buicuploaduploaded:t._onSelect}),i.buicUpload()},_onPreview:function(t,i){e("input.path",this.element).val(i.path)},_onSelectFromStack:function(t){var i=e(t.target),n=i.parent("[data-file]");i.closest(".btn-group").removeClass("open"),this._onSelect(t,n.data("file")),t.preventDefault()},_onSelect:function(i,n){e("input.path",this.element).data("changeWithoutSelection",!1).data("selected",n).val(n.path).trigger("change"),"click"!==i.type&&t.stack.addToStack(n.path)},_onClose:function(){var t=e("input.path",this.element);t.val(t.data("selected").path)},_onClear:function(){var t=e("input.path",this.element);t.val(""),t.data("selected",{})}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldFilelist",e.bolt.baseField,{_create:function(){var t=this,i=this.element;this._ui={data:i.find("textarea"),list:i.find(".list")},this._lastClickIndex=0,t.options.isImage=this.options.isImage||!1,t._ui.list.sortable({helper:function(t,i){return i.addClass("selected"),e("<div/>")},start:function(t,n){var a=e(".selected",i).not(".ui-sortable-placeholder"),o=a.length,s=n.placeholder,l=s.outerHeight(!0),r=s.height(),d=parseInt(s.css("margin-top"))+parseInt(s.css("margin-bottom"));a.hide(),s.height(r+(o-1)*l-d),n.item.data("items",a)},beforeStop:function(e,t){t.item.before(t.item.data("items"))},stop:function(){e(".selected",i).show(),t._serialize()},axis:"y",delay:100,distance:5}),t._on(t._ui.list,{"click.item":t._onSelect,"click.remove":t._onRemove,"change input":t._serialize}),e("input.title",t._ui.list).on("keyup",t._updateTitle),t._on({"click.select-from-stack a":t._onSelectFromStack,buicbrowserselected:t._onAddPath,buicuploaduploaded:t._onAddPath}),i.buicUpload()},_onAddPath:function(t,i){e(">p",this._ui.list).remove(),this._ui.list.append(e(Bolt.data(this.options.isImage?"field.imagelist.template.item":"field.filelist.template.item",{"%TITLE_A%":i.path.replace(/\.[a-z0-9]+$/,""),"%FILEPATH_E%":e("<div>").text(i.path).html(),"%FILEPATH_A%":i.path,"%EXT_E%":i.extension.toUpperCase(),"%PREVIEW_A%":i.previewListUrl,"%URL_A%":i.url}))),this._serialize()},_onRemove:function(i){var n=e(i.target).closest(".item"),a=n.hasClass("selected")?e(".selected",this._ui.list):n,o=this.options.isImage?"field.imagelist.message.remove":"field.filelist.message.remove",s=this.options.isImage?"field.imagelist.message.removeMulti":"field.filelist.message.removeMulti";a.addClass("zombie"),confirm(t.data(a.length>1?s:o))?(e(i.target).closest(".item").remove(),this._serialize()):a.removeClass("zombie"),i.preventDefault(),i.stopPropagation()},_onSelect:function(t){var i=e(t.target);if(i.hasClass("item"))if(t.shiftKey){var n=Math.min(this._lastClickIndex,i.index()),a=Math.max(this._lastClickIndex,i.index());this._ui.list.children().each(function(t,i){e(i).toggleClass("selected",t>=n&&t<=a)})}else if(t.ctrlKey||t.metaKey)i.toggleClass("selected"),this._lastClickIndex=i.index();else{var o=this._ui.list.children(".selected").not(i);o.removeClass("selected"),i.toggleClass("selected",o.length>0||null),this._lastClickIndex=i.index()}},_onSelectFromStack:function(t){var i=e(t.target),n=i.closest("[data-file]");i.closest(".btn-group").removeClass("open"),this._onAddPath(t,n.data("file")),t.preventDefault()},_serialize:function(){var i=this.options.isImage?"field.imagelist.template.empty":"field.filelist.template.empty",n=[];e(".item",this._ui.list).each(function(){n.push({filename:e("input.filename",this).val(),title:e("input.title",this).val()})}),this._ui.data.val(JSON.stringify(n)),0===n.length&&this._ui.list.html(t.data(i))},_updateTitle:function(t){var i=e(t.target).closest(".item");e("a",i).attr("title",e(".title",i).val())}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldGeolocation",e.bolt.baseField,{options:{latitude:"",longitude:""},_create:function(){var e=this,i=e.element;this._ui={address:i.find(".address"),matched:i.find(".matched"),mapholder:i.find(".mapholder"),spinner:i.find(".mapholder i"),latitude:i.find(".latitude"),longitude:i.find(".longitude"),snap:i.find(".snap")},this._map=null,this._marker=null,this._timeout=0,e._on({"click.expand":e._onExpand,"click.compress":e._onExpand});var n=function(){t.events.off("Bolt.GoogleMapsAPI.Load.Done",n),e._initGoogleMap(e.options.latitude,e.options.longitude)};t.events.on("Bolt.GoogleMapsAPI.Load.Done",n),t.events.on("Bolt.GoogleMapsAPI.Load.Fail",function(){e._ui.spinner.removeClass("fa-spinner fa-spin").addClass("fa-refresh").one("click",function(){e._ui.spinner.removeClass("fa-refresh").addClass("fa-spinner fa-spin"),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")})}),t.events.fire("Bolt.GoogleMapsAPI.Load.Request")},_geoCode:function(e){var t=this;e&&(new google.maps.Geocoder).geocode(e,function(i,n){if(n===google.maps.GeocoderStatus.OK){var a;a=e.latLng&&!t._ui.snap.is(":checked")?e.latLng:i[0].geometry.location,t._display(i[0].formatted_address,a.lat(),a.lng()),t._marker.setPosition(a),t._map.setCenter(a)}}),t._display()},_display:function(e,t,i){this._ui.matched.val(e||""),this._ui.latitude.val(t||""),this._ui.longitude.val(i||"")},_initGoogleMap:function(i,n){var a=this,o={zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,center:new google.maps.LatLng(i,n),streetViewControl:!1};a._map=new google.maps.Map(a._ui.mapholder[0],o),a._marker=new google.maps.Marker({map:a._map,position:o.center,title:t.data("field.geolocation.marker"),draggable:!0,animation:google.maps.Animation.DROP,icon:a.element.data("pin-icon")}),google.maps.event.addListener(a._marker,"mouseup",function(){a._geoCode({latLng:a._marker.getPosition()})}),a._ui.address.on("propertychange input",function(){clearTimeout(a._timeout),a._timeout=setTimeout(function(){var e=a._ui.address.val();a._geoCode(e.length>2?{address:e}:void 0)},800)}),e('a[data-toggle="tab"]').on("shown.bs.tab",function(){a._ui.mapholder.closest("div.tab-pane").hasClass("active")&&google.maps.event.trigger(a._map,"resize")})},_onExpand:function(){var e=this._marker.getPosition();this._ui.mapholder.parent().toggleClass("expanded"),google.maps.event.trigger(this._map,"resize"),this._map.setCenter(e)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.fieldHtml",e.bolt.baseField,{_create:function(){t.ckeditor.add(this.element.find(".ckeditor")[0])}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldImage",e.bolt.fieldFile,{_create:function(){this._super(),e("input.path",this.element).data("selected").previewUrl=this.element.find("img").attr("src")},_onPreview:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onSelect:function(e,t){this._super(e,t),this.element.find("img").attr("src",t.previewUrl)},_onClose:function(){this._super();var t=e("input.path",this.element);this.element.find("img").attr("src",t.data("selected").previewUrl)},_onClear:function(){this._super();var e=this.element.find("img");e.attr("src",e.data("defaultUrl"))}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldImagelist",e.bolt.fieldFilelist,{_create:function(){this.options.isImage=!0,this._super()}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldMarkdown",e.bolt.baseField,{_create:function(){t.$("textarea[data-uk-htmleditor]",this.element).each(function(){var e=t.$(this);e.data("htmleditor")||t.htmleditor(e,t.Utils.options(e.attr("data-uk-htmleditor")))})}})}(jQuery,"undefined"!=typeof UIkit?UIkit:void 0),function(e){"use strict";e.widget("bolt.fieldMeta",e.bolt.baseField,{_create:function(){var e=this.element.find("#statusselect"),t=this.element.find("#ownerid");e.select2({width:"50%",minimumResultsForSearch:1/0}),t.select2({width:"50%",minimumResultsForSearch:1/0})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldRelationship",e.bolt.baseField,{_create:function(){this.element.find("select").select2({width:"100%",placeholder:{id:"",text:t.data("field.relationship.text.placeholder")},allowClear:!0,templateSelection:function(t){var i=e(t.element).parent().attr("label");return(i?i+": ":"")+t.text}})}})}(jQuery,Bolt),function(e,t,i){"use strict";e.widget("bolt.fieldRepeater",e.bolt.baseField,{options:{minimum:1,maximum:1,name:""},_create:function(){var t=this;for(this._ui={add:t.element.find(".add-button"),slot:t.element.find(".repeater-slot")},this._template=e(t.element.find('script[type="text/template"]').html()),this._count=t._ui.slot.find("div.repeater-group").length,0===t.options.maximum&&(t.options.maximum=1/0),t._setCount(),t._ui.add.on("click",function(){t._append()}),t.element.on("click",".duplicate-button",function(){var i=e(this).closest(".repeater-group"),n=t._clone(t._template);e(i).find(":input").each(function(t){var i=e(this),a=i.attr("id"),o=i.val();i.hasClass("ckeditor")&&void 0!==CKEDITOR.instances[a]?e(n).find(":input").eq(t).val(CKEDITOR.instances[a].getData()):o&&e(n).find(":input").eq(t).val(o)}),i.after(n),t._setCount(1),t._renumber()}),t.element.on("click",".delete-button",function(){e(this).closest(".repeater-group").remove(),t._setCount(-1),t._renumber()}),t.element.on("click",".move-up",function(){var i=e(this).closest(".repeater-group");i.insertBefore(i.prev(".repeater-group")),t._renumber(),t._resetEditors(i)}),t.element.on("click",".move-down",function(){var i=e(this).closest(".repeater-group");i.insertAfter(i.next(".repeater-group")),t._renumber(),t._resetEditors(i)});t._count<t.options.minimum;)t._append()},_append:function(){var e=this._clone(this._template);this._ui.slot.append(e),this._setCount(1),this._renumber(),t.datetime.init(),t.ckeditor.init(),init.popOvers()},_clone:function(i){var n=e(i).clone();return n.find("[id]").each(function(){var i=e(this).attr("id"),a=t.app.buid();e(this).attr("id",a),n.find('[for="'+i+'"]').each(function(){e(this).attr("for",a)})}),t.app.initWidgets(n),n},_renumber:function(){var t=this.options.name,i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp("^"+i+"\\[(#|\\d+)\\]");this._ui.slot.find("div.repeater-group").each(function(i,a){e(a).find("[name]").each(function(){this.name=this.name.replace(n,t+"["+i+"]")}),e(a).is(":first-of-type")?e(a).find(".move-up").addClass("disabled"):e(a).find(".move-up").removeClass("disabled"),e(a).is(":last-of-type")?e(a).find(".move-down").addClass("disabled"):e(a).find(".move-down").removeClass("disabled")})},_resetEditors:function(e){e.find(".ckeditor").each(function(e,t){i.instances[t.id]&&i.instances[t.id].destroy(),i.replace(t.id)})},_setCount:function(e){this._count+=e||0,this._count>=this.options.maximum?(this._ui.add.addClass("disabled"),this._ui.add.prop("disabled","disabled"),this.element.find(".duplicate-button").addClass("disabled"),this.element.find(".duplicate-button").prop("disabled","disabled")):(this._ui.add.removeClass("disabled"),this._ui.add.prop("disabled",!1),this.element.find(".duplicate-button").removeClass("disabled"),this.element.find(".duplicate-button").prop("disabled",!1)),this._count<=this.options.minimum?(this.element.find(".delete-button").addClass("disabled"),this.element.find(".delete-button").prop("disabled","disabled")):(this.element.find(".delete-button").removeClass("disabled"),this.element.find(".delete-button").prop("disabled",!1))}})}(jQuery,Bolt,"undefined"!=typeof CKEDITOR?CKEDITOR:void 0),function(e,t){"use strict";e.widget("bolt.fieldSelect",e.bolt.baseField,{options:{autocomplete:!1},_create:function(){var e=this.element.find("select"),i={width:"100%",placeholder:{id:"",text:t.data("field.select.text.placeholder")},allowClear:!0,minimumResultsForSearch:this.options.autocomplete?0:1/0};this.options.sortable?e.select2Sortable(i):e.select2(i)}})}(jQuery,Bolt),function(e){"use strict";var t={lock:1,link:2,edit:3};e.widget("bolt.fieldSlug",e.bolt.baseField,{options:{contentId:null,key:"",slug:"",uses:[]},_create:function(){var i=this,n=this.element;this._ui={form:this.element.closest("form"),group:n.find(".input-group"),data:n.find("input"),uses:e()},e("[name]",i._ui.form).each(function(){i.options.uses.indexOf(this.name.replace(/\[\]$/,""))>=0&&(i._ui.uses=i._ui.uses.add(e(this)))}),this._timeout=0,this._mode=t.lock,this._ui.group.hasClass("linked")?this._setMode(t.link):this._ui.group.hasClass("editable")&&(this._mode=t.edit),this._on({"click li.lock":function(e){e.preventDefault(),this._setMode(t.lock)},"click li.link":function(e){e.preventDefault(),this._setMode(t.link)},"click li.edit":function(e){e.preventDefault(),this._setMode(t.edit),this.element.find("input").focus()},"focusout input":function(){this._mode===t.edit&&this._setMode(t.lock)}})},_destroy:function(){clearTimeout(this._timeout)},_setMode:function(i){var n=i===t.lock,a=i===t.link,o=i===t.edit;e("li.lock",this.element).toggleClass("disabled",n),e("li.link",this.element).toggleClass("disabled",a),e("li.edit",this.element).toggleClass("disabled",o),this._ui.group.toggleClass("locked",n).toggleClass("linked",a).toggleClass("edititable",o),e(".warning",this.element).toggleClass("hidden",!o),this._ui.data.prop("readonly",!o),a?(this._buildSlug(),this._on(this._ui.uses,{change:function(){this._buildSlug()},input:function(){this._buildSlug()}})):this._timeout>0&&(clearTimeout(this._timeout),this._timeout=0,this._off(this._ui.uses,"change"),this._off(this._ui.uses,"input")),this._mode=i},_buildSlug:function(){var t,i=this,n="";e.each(i.options.uses,function(i,a){(t=e("#"+a).val())&&(n+=("object"==typeof t?t.join(" "):t)+" ")}),clearTimeout(i._timeout),i._timeout=setTimeout(function(){i._getUri(n.trim())},200)},_getUri:function(i){var n=this,a={title:i,contenttypeslug:n.options.slug,id:n.options.contentId,slugfield:n.options.key,fulluri:!1};n._ui.group.addClass("loading"),e.get(n._ui.data.data("createSlugUrl"),a).done(function(e){n._mode===t.link&&n._ui.data.val(e)}).fail(function(){console.error("Failed to get URI for "+n.options.slug+"/"+n.options.contentId)}).always(function(){n._ui.group.removeClass("loading")})}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTags",e.bolt.baseField,{options:{allowSpaces:!1},_create:function(){var t=this.element.find("select"),i=this.element.find(".tagcloud"),n=[","],a={};this.options.allowSpaces||n.push(" "),t.select2({width:"100%",tags:a,minimumInputLength:1,tokenSeparators:n}),e.ajax({url:this.element.data("tagsUrl"),dataType:"json",success:function(i){for(var n=t.val()||[],a=i.length,o="",s=0;s<a;s++)n.indexOf(i[s].name)<0&&(n.push(i[s].name),o+='<option value="'+i[s].name+'">'+i[s].name+"</option>");t.append(e(o)).trigger("change")}}),i&&e.ajax({url:this.element.data("popularTagsUrl"),dataType:"json",data:{limit:40},success:function(n){n.length>0&&(e.each(n,function(t,n){i.append(e("<button/>",{type:"button",text:n.name,rel:n.count})).append("")}),i.find("button").on("click",function(){var i=e(this).text(),n=t.find('option[value="'+i+'"]');n.length>0?n=n.not(":selected").attr("selected",!0).trigger("change"):t.append(e("<option/>",{value:i,text:i,selected:!0})).trigger("change")}),e.fn.tagcloud.defaults={size:{start:10,end:20,unit:"px"},color:{start:"#888",end:"#194770"}},i.find("button").tagcloud(),i.css("display","block"))}})}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldTemplateselect",e.bolt.baseField,{options:{currentHas:!1,current:"",fieldTemplates:[]},_create:function(){var i=this,n=i.element.find("select"),a=i.element.find("p"),o=a.parent();n.select2({width:"100%",allowClear:!0,placeholder:{id:"",text:t.data("field.templateselect.text.default")},minimumResultsForSearch:1/0}),n.on("change",function(){if(o.addClass("hidden"),a.html("").removeClass("text-danger"),n.val()!==i.options.current)if(i.options.currentHas){a.html(t.data("field.templateselect.template.warning",{"%STATUS%":t.data("field.templateselect.message.status"),"%MESSAGE%":t.data("field.templateselect.message.warning")}));var s=!0;e('[name^="templatefields"]').each(function(){"checkbox"!==e(this).attr("type")&&"SELECT"!==e(this).prop("tagName")&&""!==e(this).val()&&(s=!1),"checkbox"===e(this).attr("type")&&e(this).prop("checked")&&(s=!1)}),s?e("#tabindicator-tab-template").hide():(a.addClass("text-danger"),o.removeClass("hidden"))}else i.options.fieldTemplates.indexOf(n.val())>-1&&(a.html(t.data("field.templateselect.message.change")),o.removeClass("hidden"),e("#tabindicator-tab-template").show())})}})}(jQuery,Bolt),function(e){"use strict";e.widget("bolt.fieldText",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e){"use strict";e.widget("bolt.fieldTextarea",e.bolt.baseField,{_create:function(){}})}(jQuery),function(e,t){"use strict";e.widget("bolt.fieldVideo",e.bolt.baseField,{_create:function(){var t=this,i=this.element,n=0;this._ui={url:i.find("input.url"),width:i.find("input.width"),height:i.find("input.height"),html:i.find("input.html"),ratio:i.find("input.ratio"),authorName:i.find("input.authorname"),authorUrl:i.find("input.authorurl"),title:i.find("input.title"),thumbnailUrl:i.find("input.thumbnailurl"),preview:i.find("img"),play:i.find(".imageholder button"),refresh:i.find("button.refresh"),spinner:i.find("button.refresh i")},t._ui.url.on("propertychange input",function(){clearTimeout(n),n=setTimeout(function(){t._update()},1e3)}),t._ui.width.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.height.val(Math.round(t._ui.width.val()/t._ui.ratio.val()))}),t._ui.height.on("propertychange input",function(){t._ui.ratio.val()>0&&t._ui.width.val(Math.round(t._ui.height.val()*t._ui.ratio.val()))}),t._ui.refresh.on("click",function(){t._update()}),t._ui.play.on("click",function(){e("body").buicModal({size:"large",closer:!0,headline:t._ui.title.val(),body:t._ui.html.val()})})},_update:function(){var i=this,n=t.data("endpoint.embed"),a=e("#id").closest("form").find('input[name="content_edit[_token]"]').val(),o={format:"json",url:i._ui.url.val(),_token:a,provider:"oembed"};o.url.length<2?i._set({}):(this._ui.refresh.prop("disabled",!0),i._ui.spinner.addClass("fa-spin"),e.post(n,o).done(function(e){i._set(e)}).fail(function(){i._set({})}).always(function(){i._ui.spinner.removeClass("fa-spin")}))},_set:function(e){var t=e.thumbnail_url||this._ui.preview.data("defaultUrl");this._ui.html.val(e.html||""),this._ui.width.val(e.width||""),this._ui.height.val(e.height||""),this._ui.ratio.val(e.width&&e.height?e.width/e.height:""),this._ui.authorName.val(e.author_name||""),this._ui.authorUrl.val(e.author_url||""),this._ui.title.val(e.title||""),this._ui.thumbnailUrl.val(e.thumbnail_url||""),this._ui.preview.attr("src",t),e.html?this._ui.play.removeClass("hidden"):this._ui.play.addClass("hidden"),this._ui.refresh.prop("disabled",this._ui.url.val().length<=2||this._ui.html.val().length>0)}})}(jQuery,Bolt),function(e,t){"use strict";e.widget("bolt.panelActivity",e.bolt.baseInterval,{options:{delay:3e4},_create:function(){this._super()},_update:function(){var i=this;e.get(i.element.data("url")).done(function(n){var a=e(n);t.app.initWidgets(a),i.element.html(a)})}})}(jQuery,Bolt),Bolt.validation=function(){"use strict";function e(e){var t=!0,i=e.value,n=e.getAttribute("type"),a="checkbox"===n||"radio"===n,o=e.getAttribute("required"),s=e.getAttribute("minlength"),l=e.getAttribute("maxlength"),r=e.getAttribute("pattern");return e.disabled?t:(t=t&&(!o||a&&e.checked||!a&&""!==i),(t=t&&(a||(!s||i.length>=s)&&(!l||i.length<=l)))&&r&&(t=(r=new RegExp("^(?:"+r+")$")).test(i)),t)}function t(e,t){$(e).addClass("error"),t&&$("#cke_"+e.id).addClass("cke_error")}function i(e,t){$(e).removeClass("error"),t&&$("#cke_"+e.id).removeClass("cke_error")}function n(e,t,i){var n,a=$('label[for="'+t.id+'"]').contents().first().text().trim()||t.name;a=a.replace(/(.*):+$/g,"$1"),n=Bolt.data("validation.alertbox",{"%NOTICE_ID%":e,"%FIELD_ID%":t.id,"%FIELD_NAME%":a,"%MESSAGE%":i||$(t).data("errortext")||Bolt.data("validation.generic_msg")}),$(n).hide().insertAfter(".page-header").slideDown("fast")}function a(e){return""===e||e.match(/^[-+]?[0-9]*[,.]?[0-9]+([eE][-+]?[0-9]+)?$/)?"":Bolt.data("validation.float")}function o(e,t){return!0===t&&""===e?Bolt.data("validation.required"):""}function s(e,t){return""!==e&&Number(e.replace(",","."))<t?Bolt.data("validation.min",{"%MINVAL%":t}):""}function l(e,t){return""!==e&&Number(e.replace(",","."))>t?Bolt.data("validation.max",{"%MAXVAL%":t}):""}function r(e,t){void 0!==e.willValidate?e.setCustomValidity(t):e.validity.valid=""===t}function d(d){var c,u,f,p=void 0!==d.willValidate,h=d.value,m="",v=$(d).data("validate");if(v){for(u in v)if(v.hasOwnProperty(u)){switch(f=v[u],u){case"float":m=a(h);break;case"required":m=o(h,f);break;case"min":m=s(h,f);break;case"max":m=l(h,f);break;default:console.error("UNKNOWN VALIDATION"+u+" -> "+f)}if(m)break}r(d,m)}else if(p?("INPUT"===d.nodeName&&d.type!==d.getAttribute("type")&&d.setCustomValidity(e(d)?"":"error"),d.checkValidity()):(d.validity=d.validity||{},d.validity.valid=e(d)),c="TEXTAREA"===d.nodeName&&$(d).hasClass("ckeditor")){var g=CKEDITOR.instances[d.id];g&&r(d,!0===g._.required&&""===g.getData().trim()?"Required":"")}var b="notice--"+d.id;return $("#"+b).remove(),d.validity.valid?(i(d,c),!0):(t(d,c),n(b,d,m),!1)}return{run:function(e){var t,i,n=e.elements.length,a=!0;for(t=0;t<n;t++)"INPUT"!==(i=e.elements[t]).nodeName&&"TEXTAREA"!==i.nodeName&&"SELECT"!==i.nodeName||("INPUT"===i.nodeName&&(i.value=i.value.trim()),!1===d(i)&&(a=!1));return a}}}();