PageSourceSearch

https://placement-international.com/assets/application-720a7b6c0df…97d5b7b8e30ec86b1e1272d31db774733b342837.js

js placement-international.com collected 2026-09-30 05:40:18 UTC 316,985 bytes, 39 lines download raw bytes

1function BestInPlaceEditor(e){"use strict";this.element=e,this.initOptions(),this.bindForm(),this.initPlaceHolder(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function detectWebGLContext(){var e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t&&t instanceof WebGLRenderingContext}function isPreviewSupported(e){if(!e)return!1;const t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp)$/.test(t)}function uploadServer(){return"s3"}function appRoot(){return"/crm"}function singleFileImageUpload(e){var t=e.parentNode,i=t.parentNode.parentNode,a=i.querySelector(".col-attachment-upload"),n=i.querySelector(".col-attachment-preview"),o=i.querySelector(".col-attachment-actions"),s=n.querySelector(".attachment-preview"),r=n.querySelector(".attachment-filename"),l=(i.querySelector(".attachment-progress"),n.querySelector(".file-upload-preview"));t.removeChild(e);var d=fileUpload(e,1);d.use(Uppy.DragDrop,{target:t,width:"100%",height:"100%"}).use(Uppy.Informer,{target:t}).use(Uppy.ThumbnailGenerator,{thumbnailWidth:600}).use(Uppy.ProgressBar,{target:l.parentNode,hideAfterFinish:!0}),d.on("upload",()=>{l.style.display="none",r.textContent="",o.querySelectorAll(".preview, .download").forEach(e=>e.style.display="none"),t.style.display="none"}),d.on("upload-success",function(t,l){var d=window.uploadedFileData(t,l,e);i.querySelector("input[type=hidden][id="+e.id+"]").value=d,a.style.display="none",[n,o].forEach(e=>e.style.display="block"),isPreviewSupported(t.meta.type)?(s.style.display="block",r.style.display="none"):(s.style.display="none",r.style.display="block"),r.textContent=t.meta.name,i.querySelector("[id$=_destroy]").value="0"}),d.on("thumbnail:generated",function(e,t){l.src=t,l.style.display="block"})}function singleFileUpload(e){var t=e.parentNode,i=t.parentNode.parentNode,a=i.querySelector(".col-attachment-upload"),n=i.querySelector(".col-attachment-preview"),o=i.querySelector(".col-attachment-actions"),s=n.querySelector(".attachment-preview"),r=n.querySelector(".attachment-filename"),l=i.querySelector(".attachment-progress"),d=n.querySelector(".file-upload-preview");t.removeChild(e);var c=fileUpload(e,1);a.uppy=c,c.use(Uppy.DragDrop,{target:t,width:"100%",height:"100%"}).use(Uppy.Informer,{target:t}).use(Uppy.StatusBar,{target:l,hideUploadButton:!0,hideAfterFinish:!0}).use(Uppy.ThumbnailGenerator,{thumbnailWidth:600}),c.on("upload",()=>{d.style.display="none",t.style.display="none",r.textContent="",o.querySelectorAll(".preview, .download").forEach(e=>e.style.display="none")}),c.on("upload-success",function(t,l){var d=window.uploadedFileData(t,l,e);i.querySelector("input[type=hidden][id="+e.id+"]").value=d,a.style.display="none",[n,o].forEach(e=>e.style.display="block"),isPreviewSupported(t.meta.type)?(s.style.display="block",r.style.display="none"):(s.style.display="none",r.style.display="block"),r.textContent=t.meta.name,i.querySelector("[id$=_destroy]").value="0"}),c.on("thumbnail:generated",function(e,t){d.src=t,d.style.display="block"})}function multipleFileUpload(e){var t=e.parentNode,i=fileUpload(e);i.use(Uppy.Dashboard,{target:t,inline:!0,height:300,replaceTargetContent:!0,proudlyDisplayPoweredByUppy:!1}),i.on("upload-success",function(t,i){hiddenField=document.createElement("input"),hiddenField.type="hidden",hiddenField.name=e.name,hiddenField.value=window.uploadedFileData(t,i,e),document.querySelector("form").appendChild(hiddenField)})}function fileUpload(e,t){var i=Uppy.Core({id:e.id,autoProceed:!0,restrictions:{maxNumberOfFiles:t,allowedFileTypes:e.accept?e.accept.split(","):null},onBeforeFileAdded:function(e){return null==doka||"image/jpeg"!=e.type&&"image/png"!=e.type||(!!e.handledByDoka||(doka.edit(e.data).then(t=>{i.addFile({name:e.name,type:e.type,data:t.file,handledByDoka:!0})}),!1))}}),a=document.querySelector('meta[name="csrf-token"]').getAttribute("content");return"s3"==uploadServer()?i.use(Uppy.AwsS3,{companionUrl:appRoot()+"/",companionHeaders:{"x-csrf-token":a}}):"s3_multipart"==uploadServer()?i.use(Uppy.AwsS3Multipart,{companionUrl:appR
1oot()+"/",companionHeaders:{"x-csrf-token":a}}):i.use(Uppy.XHRUpload,{endpoint:appRoot()+"/upload",headers:{"x-csrf-token":a}}),i}function uploadedFileData(e,t){if("s3"==uploadServer()){var i=e.meta.key.match(/(?:^|\/)cache\/(.+)/)[1];return JSON.stringify(fileData(e,i))}if("s3_multipart"==uploadServer()){i=t.uploadURL.match(/(?:^|\/)cache\/([^\?]+)/)[1];return JSON.stringify(fileData(e,i))}return JSON.stringify(t.body)}function fileData(e,t){return{id:t,storage:"cache",metadata:{size:e.size,filename:e.name,mime_type:e.type}}}function downloadFileFromAjaxCall(e){var t=$(e),i=t.attr("action"),a=t.serialize()+"&"+t.data("submitButton")+"=",n=new XMLHttpRequest;n.open(t.attr("method"),i,!0),n.setRequestHeader("X-CSRF-Token",$('meta[name="csrf-token"]').attr("content")),n.responseType="arraybuffer",n.onload=function(){if(200===this.status){var e="",t=n.getResponseHeader("Content-Disposition");if(t){var i=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);null!=i&&i[1]&&(e=i[1].replace(/['"]/g,""))}var a=n.getResponseHeader("Content-Type"),o="function"==typeof File?new File([n.response],e,{type:a}):new Blob([n.response],{type:a});if("undefined"!=typeof window.navigator.msSaveBlob)window.navigator.msSaveBlob(o,e);else{var s=window.URL||window.webkitURL,r=s.createObjectURL(o);if(e){var l=document.createElement("a");"undefined"==typeof l.download?window.location=r:(l.href=r,l.download=e,document.body.appendChild(l),l.click())}else window.location=r;setTimeout(function(){s.revokeObjectURL(r)},100)}}},n.setRequestHeader("Content-type","application/x-www-form-urlencoded"),n.send(a)}async function updateEmailTemplate(t){$("#email_template_scope");var i={};try{i=JSON.parse(document.getElementById("email_template_scope").env.editor.getValue())}catch(e){}for(var a=null==t?$("div[id$=_preview]").map(function(){return this.id.replace("_preview","")}):[t],n=0;n<a.length;n++){t=a[n];var o=$("#"+t+"_preview"),s=window.liquidjs.Liquid,r=new s,l=null,d=[];try{l=r.parse(CKEDITOR.instances["email_template_subject_"+t].getData()),await r.render(l,i).then(function(e){d[0]="<p><u>"+e+"</u></p>"})}catch(c){d[0]=null}try{l=(r=new s).parse(CKEDITOR.instances["email_template_body_"+t].getData()),await r.render(l,i).then(function(e){d[1]=e;for(var t=o.get(0).getElementsByTagName("a"),i=0;i<t.length;i++)t[i].setAttribute("onclick","return false;")})}catch(c){d[1]=null}null!=d[0]&&null!=d[1]&&o.html(d[0]+d[1])}}function showSuccess(e,t){$("body").pgNotification({style:"flip",position:"top-center",type:"success",timeout:3e3,showClose:t,message:e}).show()}function showWarning(e,t){$("body").pgNotification({style:"flip",position:"top-center",type:"warning",timeout:3e3,showClose:t,message:e}).show()}function showError(e,t){null==t&&(t=!1),$("body").pgNotification({style:"flip",position:"top-center",type:"danger",timeout:3e3,showClose:t,message:e}).show()}function previewAttachment(e){if(!e)return!1;var t='<iframe id="docpreview" src="'+("/viewer/"+e)+'" width="100%" height="100%" style="border: none;" allowfullscreen webkitallowfullscreen></iframe>';bootbox.dialog({message:t,onEscape:function(){},closeButton:!0,className:"doc-preview",backdrop:!0}
1).on("shown.bs.modal",function(){var e=$("#docpreview");e.on("load",function(){setTimeout(function(){e.contents().find("#canvasContainer").focus()},1e3)})})}function downloadAttachment(e,t){const i=document.createElement("a");i.href=e,i.download=t,i.dispatchEvent(new MouseEvent("click"))}function removeAttachment(e){var t=e.closest(".attach-container").querySelector(".attach-file"),i=t.querySelector("[id$=_id]").value;t.querySelectorAll("input[type='hidden']");return i?t.querySelector("[id$=_destroy]").value="1":(t.querySelector("[id$=_attachment]").value="",t.querySelector("[id$=_description]").value=""),t.querySelector(".col-attachment-upload").style.display="block",t.querySelector(".col-attachment-preview").style.display="none",t.querySelector(".col-attachment-actions").style.display="none",t.querySelector(".attachment-file").style.display="block",t.querySelector(".col-attachment-upload").uppy.reset(),!1}function makeRadiosDeselectableByName(e){$("input[name='"+e+"']").click(function(){"true"==$(this).attr("previousValue")?$(this).prop("checked",!1):$("input[name='"+e+"']").attr("previousValue",!1),$(this).attr("previousValue",$(this).prop("checked"))})}function mergeDateTime(e){var t=e.attr("data-date"),i=e.attr("data-time"),a=e.attr("data-zone"),n=e.attr("data-zone-offsets"),o=null;if(t!=undefined&&(o=t,i!=undefined&&(o+=" "+i,a!=undefined))){var s=getBestTzOffset(Date.parse(o),n);null!=s&&(a=s[1]),o+=" "+a}null!=o?e.val(o):e.removeAttr("value"),e.trigger("change")}function getBestTzOffset(e,t){if(t){var i=$.map(t.split(","),function(e){var t=e.split("|");return[[1e3*parseInt(t[0]),t[1]]]}),a=$.grep(i,function(t){return e>=t[0]});return a.length,a.pop()}return null}function reorderTzSelect(e,t){if(0!=t.length){var i=!1,a=t.find("option");if(a.each(function(){var t=$(this),a=getBestTzOffset(e,t.attr("data-zone-offsets"));null!=a&&-1==t.text().indexOf(a[1])&&(t.text(t.text().replace(/[+-]\d\d:\d\d/,a[1])),i=!0)}),i){var n=t.val();a.detach().sort(function(e,t){var i=$(e).text().split(/(\(GMT[+-]\d\d:\d\d\)) (.*)/),a=$(t).text().split(/(\(GMT[+-]\d\d:\d\d\)) (.*)/);return i[1].startsWith("(GMT-")&&a[1].startsWith("(GMT+")?-1:i[1].startsWith("(GMT+")&&a[1].startsWith("(GMT-")?1:i[1]==a[1]?i[2]>a[2]:i[1].startsWith("(GMT+")?i[1]>a[1]:i[1]<a[1]}),t.html($.fn.append.apply($("<div>"),a).html()).change(),t.val(n)}}}function changeFormFormat(e,t){var i=$(e).closest("form"),a=i.attr("action");a=a.substring(0,a.lastIndexOf(".")),i.attr("action",a+"."+t)}function selectDatatableRow(e,t){t?(e.prop("checked",!0),e.closest("tr").addClass("selected")):(e.prop("checked",!1),e.closest("tr").removeClass("selected"))}function getTableSelection(e,t){var i=e.data("selections");return i=t?jQuery.map(i,function(e){return e[t]}):Object.keys(i)}function getTableActionQueryString(e,t){var i=getCheckAllState(e),a=e.data("selections_negated"),n=getTableSelection(e,t),o="";if(!0===i||a){for(var s=$("#"+e.attr("id")+"-search, #"+e.attr("id")+"-params"),r=[],l=0;l<s.length;l++)r=r.concat($(s[l]).serializeArray().filter(function(e){return $.trim(e.value)}));o=$.param(r,!0),n.length>0&&(o+="&ids="+n.join()+"&idsNeg="+a)}else n.length>0&&(o="ids="+n.join());return o}function doTableAction(e,t,i,a,n){var o=getCheckAllState(i),s=getTableActionQueryString(i,a);return!0!==o&&0==s.length?(showWarning("No selection"),!1):(s+=n!==undefined?"&"+n:"","ajax"==t?e+"?"+s:void(t?window.open(e+"?"+s):window.location=e+"?"+s))}function getCheckboxState(e){return!!e&&(!!e.is(":checked")||!(!e.is(":tristate")||!e.is(":indeterminate"))&&null)}function getCheckAllState(e){return getCheckboxState($('input[name$="select_all"]',e))}function setHiddenPhoneNumber(e){var t=e.data.hiddenId,i=$("#"+t+"_prefix").val(),a=$("#"+t+"_suffix").val(),n="";null!=i&&""!=i.trim()&&null!=a&&""!=a.trim()?n+=i+a:n="",$("#"+t).attr("value",n)}function initAppComponents(e){if($("form",e).preventDoubleSubmission(),$(".dropdown-menu a.dropdown-toggle").on("click",function(){var e=$
1(this),t=$(this).offsetParent(".dropdown-menu");return $(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show"),$(this).next(".dropdown-menu").toggleClass("show"),$(this).parent("li").toggleClass("show"),$(this).parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",function(){$(".dropdown-menu .show").removeClass("show")}),t.parent().hasClass("navbar-nav")||e.next().css({top:e[0].offsetTop,left:t.outerWidth()-4}),!1}),$("form",e).on("click keypress",'*[type="submit"]',function(e){if(13===e.which||32===e.which||"click"===e.type){var t=e.currentTarget;$(this).parents("form").first().data("submitButton",t.name)}}),$("form",e).on("ajax:beforeSend",function(e){var t=$(this);if(1==t.data("remote")&&t.data("submitButton")&&$('*[name="'+t.data("submitButton")+'"]').data("download"))return downloadFileFromAjaxCall(this),e.preventDefault(),!1}),(e instanceof jQuery?e.get(0):e).querySelectorAll("input[type=file]").forEach(function(e){e.multiple?multipleFileUpload(e):(e.classList.contains("pi-image-input"),singleFileUpload(e))}
1),$("select[id$=country]",e).each(function(){var e=$(this),t=$(this).attr("id").replace(/country$/,"state"),i=$("#"+t,e.closest("form"));i.length>0&&i.is("select")&&i[0].hasAttribute("data-subdivision-selector")&&new SubdivisionSelect(this).init()}),$(".pi-default-datepicker",e).each(function(){var e=$(this),t=e.siblings("input[type='hidden']"),i=e.children("input[type='text']");$(i).on("keydown",function(){return!1});var a=t.attr("data-dtp-format").replace("%d","dd").replace("%m","mm").replace("%Y","yyyy").replace("%H","H").replace("%M","i"),n={};$.each($(i).data(),function(e,t){0===e.indexOf("date")&&(n[e[4].toLowerCase()+e.substring(5)]=t)}),n=$.extend({},{todayBtn:"linked",clearBtn:!0,autoclose:!0,format:a,language:t.attr("data-dtp-language")},n),e.datepicker(n).on("changeDate",{input:t,text:i},function(e){var i=t;if(t.length>1)for(var a=0;a<e.data.text.length;a++)e.data.text[a].id==e.target.id&&(i=$(e.data.input[a]));(null!=e.date?i.attr("data-date",e.date.getFullYear()+"-"+(e.date.getMonth()+1)+"-"+e.date.getDate()):i.removeAttr("data-date"),mergeDateTime(i),i.attr("id").endsWith("_datetime"))&&reorderTzSelect(Date.parse(i.attr("data-date")),$("#"+i.attr("id").replace("_datetime","_timezone")))}).on("clearDate",{input:t,text:i},function(e){var i=t;if(t.length>1)for(var a=0;a<e.data.text.length;a++)e.data.text[a].id==e.target.id&&(i=$(e.data.input[a]));(i.removeAttr("data-date"),mergeDateTime(i),i.attr("id").endsWith("_datetime"))&&reorderTzSelect(Date.parse(new Date),$("#"+i.attr("id").replace("_datetime","_timezone")))})}),$(".pi-default-datepicker-readonly",e).each(function(){var e=$
1(this),t={};$.each($(e).data(),function(e,i){"date"==e?t[e]=i:0===e.indexOf("date")&&(t[e[4].toLowerCase()+e.substring(5)]=i)}),t=$.extend({},{todayBtn:"linked",minViewMode:"days",maxViewMode:"days",startDate:t.date,endDate:t.date},t),e.datepicker(t)}),$(".pi-default-datetimepicker",e).each(function(){var e=$(this),t=e.siblings("input[type='hidden']"),i=e.children("input[type='text']"),a=i.attr("data-format").replace("%d","DD").replace("%m","MM").replace("%Y","YYYY").replace("%H","HH").replace("%M","mm");e.datetimepicker({allowInputToggle:!0,debug:!0,stepping:5,format:a,icons:{clear:"fa fa-trash"},buttons:{showClear:!0}}),e.on("change.datetimepicker",{input:t,text:i},function(e){e.date?t.val(e.date.format("YYYY-MM-DD HH:mm")):t.removeAttr("value")})}),$(".pi-default-timepicker",e).each(function(){var e=$(this);e.timepicker({minuteStep:5,showInputs:!1,showMeridian:!1,defaultTime:!1}).on("show.timepicker",function(){var e=$(".bootstrap-timepicker-widget");e.find(".glyphicon-chevron-up").removeClass().addClass("pg-arrow_maximize"),e.find(".glyphicon-chevron-down").removeClass().addClass("pg-arrow_minimize")}).on("changeTime.timepicker",function(e){var t=$("[id$='"+e.target.id.replace("_tp","")+"']");t.attr("data-time",e.time.value),mergeDateTime(t)}),e.click(function(){$(this).timepicker("showWidget")})}
1),$(".pi-default-zonepicker",e).each(function(){var e=$(this);e.on("change",function(e){var t=$(e.target);$("[id^='"+e.target.id.replace("_timezone","_")+"'][id*='_datetime']").each(function(){var e=$(this);if(t.children("option:selected")){var i=t.children("option:selected"),a=i.text().replace(/.*(\D\d\d:\d\d).*/,"$1");e.attr("data-zone",a),e.attr("data-zone-offsets",i.data("zoneOffsets")||""),mergeDateTime(e)}})});var t=$("#"+e.attr("id").replace("_timezone","_datetime"));t.length>0&&t.attr("data-date")!=undefined&&reorderTzSelect(Date.parse(t.attr("data-date")),e)}),$.fn.select2&&$(".pi-default-select2",e).each(function(){$(this).attr("multiple")?select2_objects[$(this).attr("id")]=$(this).select2({allowClear:!0,minimumResultsForSearch:"true"==$(this).attr("data-disable-search")?-1:1,placeholder:$(this).attr("data-placeholder")||"",maximumTagsMultiple:$(this).attr("data-maximum-tags-multiple")||10,dropdownAdapter:$(this).attr("data-select-all")?$.fn.select2.amd.require("select2/selectAllAdapter"):null,closeOnSelect:!$(this).attr("multiple"),dropdownParent:(sdp=$(this).closest("div.form-group-default")).length>0?sdp.parent():$(this).parent(),templateSelection:function(e,t){return Number.isInteger(t)?e.length+" of "+t+" selected":e.text},templateResult:function(e,t){return e.element&&$.each(e.element.attributes,function(e,i){(i.name.startsWith("data-")||"title"==i.name)&&$(t).attr(i.name,i.value)}),$("<div>").text(e.text)}}):select2_objects[$(this).attr("id")]=$(this).select2({allowClear:$(this).attr("data-allow-clear")||!0,placeholder:$(this).attr("data-placeholder")||"",minimumResultsForSearch:"true"==$(this).attr("data-disable-search")?-1:1,closeOnSelect:!$(this).attr("multiple"),dropdownParent:(sdp=$(this).closest("div.form-group-default")).length>0?sdp.parent():$(this).parent(),templateResult:function(e,t){return e.element&&$.each(e.element.attributes,function(e,i){(i.name.startsWith("data-")||"title"==i.name)&&$(t).attr(i.name,i.value)}),e.text}}).on("select2-opening",function(){$.fn.scrollbar&&$(".select2-results__option").scrollbar({ignoreMobile:!1})}
1).on("select2:unselecting",function(){var e=$(this).data("select2");e.options.set("disabled",!0),setTimeout(function(){e.options.set("disabled",!1)},0)})}),$.fn.select2&&$(".pi-default-select2-ajax",e).each(function(){select2_objects[$(this).attr("id")]=$(this).each(function(){var e=$(this);e.select2({allowClear:e.data("allow-clear")||!0,placeholder:e.data("placeholder")||"",minimumInputLength:3,minimumResultsForSearch:"true"==$(this).attr("data-disable-search")?Infinity:10,dropdownParent:(sdp=$(this).closest("div.form-group-default")).length>0?sdp.parent():$(this).parent(),templateSelection:function(e){return $.each(e,function(t,i){t.startsWith("data-")?$(e.element).data(t.substring(5),i):"data"==t&&$.each(e.data,function(t,i){$(e.element).data(t,i)})}),e.text},ajax:{url:e.data("url"),dataType:"json",type:"GET",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e){return{results:e.results}},cache:!0}})})}),$(".pi-phone-field",e).each(function(){var e=$(this).attr("id");$("#"+e+"_suffix, #"+e+"_prefix").change({hiddenId:e},setHiddenPhoneNumber)}),"undefined"!=typeof CKEDITOR){function t(e,t){function i(e){return e.collapsed?CKEDITOR.plugins.textMatch.match(e,a):null}function a(e,t){var i=/\{{2}([A-z]|\})*$/,a=e.slice(0,t).match(i);return a?{start:a.index,end:t}:null}function n(e,t){t(o.filter(function(t){return 0==("{{"+t.name+"}}").indexOf(e.query.toLowerCase())}))}if(!e.data("autocomplete-placeholders-id"))return{};var o=JSON.parse($("#"+e.data("autocomplete-placeholders-id")).html()),s=o.filter(function(e){return-1!=e.name.indexOf("_url")}).map(function(e){return[e.title,e.name]}),r=["autocomplete","liquid","placeholder","textmatch","textwatcher"];return s.length>0&&r.push("internallink"),options={extraPlugins:r.join(","),internallinkItems:s,on:{instanceReady:function(e){t&&e.editor.on("key",function(e){var t=e.data.keyCode;
113!=t&&2228237!=t||e.cancel()}),e.editor.on("change",function(e){updateEmailTemplate(e.editor.element.getId().match(/_(..)$/)[1])});var a='<li data-id="{id}"><div><strong class="item-title">{title}</strong></div><div><i>{description}</i></div></li>',o="[[{title}]]";new CKEDITOR.plugins.autocomplete(e.editor,{textTestCallback:i,dataCallback:n,itemTemplate:a,outputTemplate:o}).getHtmlToInsert=function(e){var t=this.outputTemplate.output(e);return t=t.replace("[[","{{").replace("]]","}}")+"<span>&nbsp;</span>"}},paste:function(e){t&&(e.data.dataValue=$("<div />").html(e.data.dataValue.replace(/\n/g," ")).text())}}},options}CKEDITOR_ALLOWED_CONTENT="span(*); p{text-align}(*); strong(*); em(*); b(*); i(*); u(*); sup(*); sub(*); ul(*); ol(*); li(*); a[!href](*); br(*); hr(*); div(*); h1(*); h2(*); h3(*); h4(*); h5(*); h6(*); pre(*)",CKEDITOR.plugins.addExternal("autocomplete","/assets/ckeditor/plugins/autocomplete/","plugin.js"),CKEDITOR.plugins.addExternal("internallink","/assets/ckeditor/plugins/internallink/","plugin.js"),CKEDITOR.plugins.addExternal("liquid","/assets/ckeditor/plugins/liquid/","plugin.js"),CKEDITOR.plugins.addExternal("placeholder","/assets/ckeditor/plugins/placeholder/","plugin.js"),CKEDITOR.plugins.addExternal("textmatch","/assets/ckeditor/plugins/textmatch/","plugin.js"),CKEDITOR.plugins.addExternal("textwatcher","/assets/ckeditor/plugins/textwatcher/","plugin.js"),DEFAULT_OPTIONS={toolbarGroups:[{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi","paragraph"]},{name:"links",groups:["links"]},{name:"tools",groups:["tools"]}],toolbarLocation:"bottom",removeButtons:"Templates,Save,NewPage,Preview,Print,ShowBlocks,Anchor,Language,BidiRtl,BidiLtr,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,CreateDiv,Blockquote,Outdent,Indent,RemoveFormat",removePlugins:"contextmenu,elementspath,liststyle,tabletools,tableselection",coreStyles_strike:{element:"strikethrough",overrides:"s"},skin:"lightwire,/assets/ckeditor/skins/lightwire/",language:"en",allowedContent:CKEDITOR_ALLOWED_CONTENT,disableNativeSpellChecker:!1},$(".pi-default-wysiwig",e).each(function(e,i){var a=$(i),n=$.extend({},DEFAULT_OPTIONS);a.attr("height")&&(n=$.extend({height:a.attr("height").replace("px","").replace("em","")},n)),n=$.extend(n,t(a,!1)),a.ckeditor(n)}),$(".pi-rich-wysiwig",e).ckeditor({toolbarGroups:[{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi","paragraph"]},{name:"links",groups:["links"]},"/",{name:"styles",groups:["styles"]},{name:"colors",groups:["colors"]},{name:"tools",groups:["tools"]},{name:"document",groups:["mode","document","doctools"]}],toolbarLocation:"bottom",removeButtons:"Save,Templates,NewPage,Preview,Print,Scayt,CreateDiv,BidiLtr,BidiRtl,Language,Flash,Smiley,PageBreak,Iframe,Styles,Font",removePlugins:"contextmenu,elementspath,liststyle,tabletools,tableselection",coreStyles_strike:{element:"strikethrough",overrides:"s"},skin:"lightwire,/assets/ckeditor/skins/lightwire/",format_tags:"p;h1;h2;h3;h4;h5;h6",pasteFromWordRemoveStyles:!1,pasteFromWordPromptCleanup:!0,disableNativeSpellChecker:!1}),$(".pi-ck-singleline",e).each(function(e,i){var a=$(i),n=$.extend({},{toolbar:[],toolbarLocation:"bottom",removeButtons:"Templates,Save,NewPage,Preview,Print,ShowBlocks,Anchor,Language,BidiRtl,BidiLtr,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,CreateDiv,Blockquote,Outdent,Indent,RemoveFormat",removePlugins:"contextmenu,elementspath,liststyle,pastetext,tabletools,tableselection,resize,showborders",skin:"lightwire,/assets/ckeditor/skins/lightwire/",language:"en",resize_enabled:!1,autoParagraph:!1,forcePasteAsPlainText:!0,pasteFilter:"bold",pasteFromWordRemoveStyles:!0,pasteFromWordPromptCleanup:!0,disableNativeSpellChecker:!1,contentsCss:[CKEDITOR.getUrl("contents.css"),".cke_editable { line-height: 0em; }"],allowedContent:""});n=$.extend(n,t(a,!0)),a.ckeditor(n)}),$(".pi-ck-wysiwig",e).ckeditor({toolbar:[{name:"document",groups:["mode","document","doctools"],items:["Source"]},{name:"clipboard",groups:["clipboard","undo"],items:["Cut","Copy","Paste","PasteText","PasteFromWord","-","Undo","Redo"]},{name:"links",items:["Link","Unlink","Anchor"]},{name:"insert",items:["Image","Flash","HorizontalRule","SpecialChar"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","CreateDiv","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},"/",{name:"styles",items:["Styles","Format","Font","FontSize"]},{name:"colors",items:["TextColor","BGColor"]},{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]}],toolbar_mini:[{name:"paragraph",groups:["list","indent","blocks","align","bidi"],items:["NumberedList","BulletedList","-","Outdent","Indent","-","Blockquote","CreateDiv","-","JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"]},{name:"styles",items:["Font","FontSize"]},{name:"colors",items:["TextColor","BGColor"]},{name:"basicstyles",groups:["basicstyles","cleanup"],items:["Bold","Italic","Underline","Strike","Subscript","Superscript","-","RemoveFormat"]},{name:"insert",items:["Image","Table","HorizontalRule","SpecialChar"]}],toolbarLocation:"bottom",removePlugins:"contextmenu,elementspath,liststyle,tabletools,tableselection",coreStyles_strike:{element:"strikethrough",overrides:"s"},skin:"lightwire,/assets/ckeditor/skins/lightwire/",format_tags:"p;h1;h2;h3;h4;h5;h6",pasteFromWordRemoveStyles:!1,pasteFromWordPromptCleanup:!0,disableNativeSpellChecker:!1})}}
1function setAgreementsForPrograms(){var e=$("[id^='candidate_program']").filter(function(){return $(this).prop("checked")}).map(function(){return String($(this).data("agreement-ids")).split(",")}).get(),t=[].concat.apply([],e).filter(Boolean);$("[id^='candidate_cepa']").each(function(){var e=$(this),i=-1!=t.indexOf(e.val());e.prop("disabled",!i)})}function setLocationsForPrograms(){const e=Array.from(document.querySelectorAll('[id^="candidate_program"]:checked')).map(e=>e.value);var t=$("#candidate_preferred_locations"),i=t.select2("data").map(e=>e.id);t.empty(),e.length>0&&$.ajax({url:"/crm/programs/locations_for",dataType:"json",type:"GET",delay:250,data:{p:e},success:function(e){t.refreshDataSelect2([{id:"",text:""}].concat(e.results)),t.val(i).trigger("change")}})}function addPayment(e){for(var t=0;t<e;t++){var i=$("#payments > div").length,a=$("#payments > div:not(.disabled)").last(),n=$(a).clone(),o=new RegExp(/_[0-9]+_/),s=new RegExp(/\[[0-9]+\]/);$("input",n).val(""),$("input[id*=_payments_attributes_]",n).each(function(){var e=$
1(this).attr("id");newId=e.replace(o,"_"+i+"_"),$(this).attr("id",newId),$(this).attr("name",$(this).attr("name").replace(s,"["+i+"]")),$(this).attr("data-slot-index",i)}),$("input[id^=payment_]",n).each(function(){$(this).attr("id",$(this).attr("id").replace(o,"_"+i+"_")),$(this).attr("name",$(this).attr("name").replace(o,"_"+i+"_")),$(this).attr("data-slot-index",i)}),$("input[id$=_amount]",n).val(""),$("input[id$=_amount_received]",n).val(""),n.attr("data-slot-index",i),enablePaymentsComponents(n),$(n).insertAfter(a)}enableRemovePayment(),updatePayments()}function removePayment(e){var t=$(e).closest(".row");$("div",t).remove(),t.addClass("disabled"),$("input[id$=_destroy]",t).attr("value","1"),enableRemovePayment(),updatePayments()}function enableRemovePayment(){$("#payments > div:not(.disabled)").length>1?$("#payments .btn-remove-slot").removeClass("disabled"):$("#payments .btn-remove-slot").addClass("disabled")}function enablePaymentsComponents(e){$(".payment-datepicker",e).each(function(){var e=$(this),t=e.siblings("input[type='hidden']"),i=e.children("input[type='text']"),a=t.attr("data-dtp-format").replace("%d","dd").replace("%m","mm").replace("%Y","yyyy").replace("%H","H").replace("%M","i");i.datepicker({clearBtn:!1,autoclose:!0,format:a,language:i.attr("data-dtp-language")}).on("changeDate",{input:t,text:i},function(e){$(e.target).attr("data-slot-index");var i=t;null!=e.date?i.attr("data-date",e.date.getFullYear()+"-"+(e.date.getMonth()+1)+"-"+e.date.getDate()):i.removeAttr("data-date"),mergeDateTime(i)}).on("clearDate",{input:t,text:i},function(e){$(e.target).attr("data-slot-index");var i=t;i.removeAttr("data-date"),mergeDateTime(i)})});var t=$("[id*=_payments_attributes_][id$=_amount]",e);t.length>0&&""!=t.val()&&t.data("base-amount",getAmount(t.val()))}function updatePayments(){for(var e=getAmount($("[id$=_total_amount]").val()),t=getPaymentsSlots(),i=e,a=t.length,n=[],o=null,s=0;s<t.length;s++){var r=t[s],l=$("div[data-slot-index="+r+"]");if("true"==$("input[id$=_disabled]",l).val())a-=1,i=(i-getAmount($("#payment_"+r+'_payment_received"').val())).toFixedNumber(2);else{$("[id$=_payments_attributes_"+r+"_amount]"),$("[id$=_payments_attributes_"+r+"_amount_received]");""!=(c=$("[id$=_payments_attributes_"+r+"_payment_date]").val())&&(o=moment(c).toDate()),n.push(r)}}var d=(i/a).toFixedNumber(2);for(s=0;s<n.length;s++){r=n[s],l=$("div[data-slot-index="+r+"]");var c,u=0;if(u=s+1==n.length?i:d,$("input[id$=_amount]",l).val(u),$(this).data("base-amount",u),i=(i-u).toFixedNumber(2),""==(c=$("[id$=_payments_attributes_"+r+"_payment_date]",l)).val()&&null!=o){var p=moment(o).add(1,"M");c.val(p.toISOString().slice(0,10)),$("#payment_"+r+"_payment_date",l).data("datepicker").update(p.toDate()),o=p}}for(r=0;r<t.length;r++)updatePaymentsWithReceived(r);updateTotalAmountPaid()}function getPaymentsSlots(){for(var e=$("#payments > div:not(.disabled)"),t=[],i=0;i<e.length;i++){var a=$(e[i]);t.push(parseInt(a.attr("data-slot-index")))}return t}function updateTotalAmountPaid(){for(var e=0,t=getPaymentsSlots(),i=0;i<t.length;i++){var a=t[i];e=(e+getAmount($("[id$=_payments_attributes_"+a+"_amount_received]").val())).toFixedNumber(2)}$("#total_amount_paid").text(e.toFixed(2))}function updatePaymentsWithReceived(e){var t=getPaymentsSlots(),i=$("[id$=_payments_attributes_"+e+"_amount]"),a=$("[id$=_payments_attributes_"+e+"_amount_received]");if(""!=a.val()){var n=(getAmount(i.val())-getAmount(a.val())).toFixedNumber(2);if(0!=n){for(var o=null,s=0;s<t.length;s++)if(t[s]>e&&""==$("[id$=_payments_attributes_"+t[s]+"_amount_received]").val().trim()){o=t[s];break}if(null!=o){var r=$("[id$=_payments_attributes_"+o+"_amount]");r.val((getAmount(r.val())+n).toFixedNumber(2))}}}updateTotalAmountPaid()}function getAmount(e){return parseFloat($.isNumeric(e)?e:0).toFixedNumber(2)}function enableInvoicePreview(){var e=$("#hire_payment_plan_attributes_payment_template_id, #payment_plan_payment_template_id").val(),t=$('input[name="hire[payment_plan_attributes][installments]"]:checked, input[name="payment_plan[installments]"]:checked').val();null!=e&&""!=e&&null!=t&&""!=t?$("#hire-preview-invoice").removeClass("disabled"):$("#hire-preview-invoice").addClass("disabled")}
1function addSlot(){var e=$("#slots > div").length,t=$("#slots > div:not(.disabled)").last(),i=$(t).clone(),a=new RegExp(/_[0-9]+_/),n=new RegExp(/\[[0-9]+\]/);$("input",i).val(""),$("input[id^=interview_schedule_slots_attributes_]",i).each(function(){var t=$(this).attr("id");newId=t.replace(a,"_"+e+"_"),$(this).attr("id",newId),$(this).attr("name",$(this).attr("name").replace(n,"["+e+"]"))}),$("input[id^=slot_]",i).each(function(){$(this).attr("id",$(this).attr("id").replace(a,"_"+e+"_")),$(this).attr("data-slot-index",e)}),$("input[id$=_datetime_from]",i).attr("data-time","08:00").removeAttr("data-date"),$("input[id$=_datetime_to]",i).attr("data-time","18:00").removeAttr("data-date"),enableComponents(i),$(i).insertAfter(t),enableRemoveSlot()}function removeSlot(e){var t=$(e).closest(".row");$("div",t).remove(),t.addClass("disabled"),$("input[id$=_destroy]",t).attr("value","1"),enableRemoveSlot()}function enableRemoveSlot(){$("#slots > div:not(.disabled)").length>1?$("#slots .btn-remove-slot").removeClass("disabled"):$("#slots .btn-remove-slot").addClass("disabled")}function enableComponents(e){$(".schedule-datepicker",e).each(function(){var e=$
1(this),t=e.siblings("input[type='hidden']"),i=e.children("input[type='text']"),a=i.attr("data-dtp-format").replace("%d","dd").replace("%m","mm").replace("%Y","yyyy").replace("%H","H").replace("%M","i"),n=i.attr("data-date-start-date");i.datepicker({clearBtn:!0,autoclose:!0,startDate:n,format:a,language:i.attr("data-dtp-language")}).on("changeDate",{input:t,text:i},function(e){var t=$(e.target).attr("data-slot-index"),i=$("#interview_schedule_slots_attributes_"+t+"_datetime_from"),a=$("#interview_schedule_slots_attributes_"+t+"_datetime_to"),n=$("#slot_"+t+"_timefrom"),o=$("#slot_"+t+"_timeto");if(i.attr("data-time",n.val()),a.attr("data-time",o.val()),null!=e.date){var s=e.date.getFullYear()+"-"+(e.date.getMonth()+1)+"-"+e.date.getDate();i.attr("data-date",s),a.attr("data-date",s)}else i.removeAttr("data-date"),a.removeAttr("data-date");mergeDateTime(i),mergeDateTime(a)}).on("clearDate",{input:t,text:i},function(e){var t=$(e.target).attr("data-slot-index"),i=$("#interview_schedule_slots_attributes_"+t+"_datetime_from"),a=$("#interview_schedule_slots_attributes_"+t+"_datetime_to");i.removeAttr("data-date"),a.removeAttr("data-date"),mergeDateTime(i),mergeDateTime(a)})}
1),$(".schedule-timepicker-from",e).each(function(){var e=$(this);e.timepicker({minuteStep:5,showInputs:!1,showMeridian:!1,defaultTime:"08:00"}).on("show.timepicker",function(){
2var e=$(".bootstrap-timepicker-widget");e.find(".glyphicon-chevron-up").removeClass().addClass("pg-arrow_maximize"),e.find(".glyphicon-chevron-down").removeClass().addClass("pg-arrow_minimize")}).on("changeTime.timepicker",function(e){var t=$(e.target).attr("data-slot-index"),i=$("#interview_schedule_slots_attributes_"+t+"_datetime_from");i.attr("data-time",e.time.value),mergeDateTime(i)}),e.click(function(){$(this).timepicker("showWidget")})}),$(".schedule-timepicker-to",e).each(function(){var e=$(this);e.timepicker({minuteStep:5,showInputs:!1,showMeridian:!1,defaultTime:"18:00"}).on("show.timepicker",function(){var e=$(".bootstrap-timepicker-widget");e.find(".glyphicon-chevron-up").removeClass().addClass("pg-arrow_maximize"),e.find(".glyphicon-chevron-down").removeClass().addClass("pg-arrow_minimize")}).on("changeTime.timepicker",function(e){var t=$(e.target).attr("data-slot-index"),i=$("#interview_schedule_slots_attributes_"+t+"_datetime_to");i.attr("data-time",e.time.value),mergeDateTime(i)}),e.click(function(){$(this).timepicker("showWidget")})})}function updateSubmitConfirm(e){$("input[type=submit]").attr("data-confirm","You choose "+e+" for the interview.")}function initModalComponents(e){var t=$(e);t.find("form").children().first().nextUntil(".form-actions").addBack().wrapAll('<div class="modal-body scrollable"/>'),t.find(".form-actions").addClass("modal-footer"),$(modal_holder_selector).html(t).find(modal_selector).modal()}function changeFormLang(e,t){var i=$(e).closest("form");$("input[name='lang']",i).val(t)}function updateSchoolInternship(e){for(var t=Math.max.apply(Math,$("#school_qty_internships option").map(function(){return parseInt($(this).val())}).get()),i=parseInt(e),a=1;a<=t;a++)a<=i?($("#school_internships_"+a).show(),null==$("#school_internships_"+a+"_from").val()&&$("#school_internships_"+a+"_from").val(1),null==$("#school_internships_"+a+"_to").val()&&$("#school_internships_"+a+"_to").val(12)):($("#school_internships_"+a).hide(),$("#school_internships_"+a+"_from").val([]),$("#school_internships_"+a+"_to").val([]))}jQuery(function(){jQuery(document).on("page:fetch turbolinks:request-start",function(){NProgress.start()}),jQuery(document).on("page:receive turbolinks:request-end",function(){NProgress.set(.7)}),jQuery(document).on("page:change turbolinks:load",function(){NProgress.done()}),jQuery(document).on("page:restore turbolinks:request-end turbolinks:before-cache",function(){NProgress.remove()})}),function(e,t){function i(i,a){var o=(i=e(i)).is("body"),s=i.data("LoadingOverlayCount");if(s===t&&(s=0),0==s){var r=e("<div>",{"class":"loadingoverlay",css:{"background-color":a.color,position:"relative",display:"flex","flex-direction":"column","align-items":"center","justify-content":"center"}});if(a.zIndex!==t&&r.css("z-index",a.zIndex),a.image&&r.css({"background-image":"url("+a.image+")","background-position":a.imagePosition,"background-repeat":"no-repeat"}),a.fontawesome&&e("<div>",{"class":"loadingoverlay_fontawesome "+a.fontawesome}).appendTo(r),a.custom&&e(a.custom).appendTo(r),o?r.css({position:"fixed",top:0,left:0,width:"100%",height:"100%"}):r.css("position","fixed"==i.css("position")?"fixed":"absolute"),n(i,r,a,o),a.resizeInterval>0){var l=setInterval(function(){n(i,r,a,o)},a.resizeInterval);i.data("LoadingOverlayResizeIntervalId",l)}a.fade?!0===a.fade?a.fade=[400,200]:"string"!=typeof a.fade&&"number"!=typeof a.fade||(a.fade=[a.fade,a.fade]):a.fade=[0,0],i.data({LoadingOverlay:r,LoadingOverlayFadeOutDuration:a.fade[1]}),r.hide().appendTo("body").fadeIn(a.fade[0])}s++,i.data("LoadingOverlayCount",s)}function a(i,a){var n=(i=e(i)).data("LoadingOverlayCount");if(n!==t)if(n--,a||n<=0){var o=i.data("LoadingOverlayResizeIntervalId");o&&clearInterval(o),i.data("LoadingOverlay").fadeOut(i.data("LoadingOverlayFadeOutDuration"),function(){e(this).remove()}),i.removeData(["LoadingOverlay","LoadingOverlayCount","LoadingOverlayFadeOutDuration","Loa
2dingOverlayResizeIntervalId"])}else i.data("LoadingOverlayCount",n)}function n(t,i,a,n){if(!n){var o="fixed"==t.css("position")?t.position():t.offset();i.css({top:o.top+parseInt(t.css("border-top-width"),10),left:o.left+parseInt(t.css("border-left-width"),10),width:t.innerWidth(),height:t.innerHeight()})}var s=n?e(window):t,r="auto";a.size&&"auto"!=a.size&&(r=Math.min(s.innerWidth(),s.innerHeight())*parseFloat(a.size)/100,a.maxSize&&r>parseInt(a.maxSize,10)&&(r=parseInt(a.maxSize,10)+"px"),a.minSize&&r<parseInt(a.minSize,10)&&(r=parseInt(a.minSize,10)+"px")),i.css("background-size",r),i.children(".loadingoverlay_fontawesome").css("font-size",r)}var o={color:"rgba(255, 255, 255, 0.8)",custom:"",fade:!0,fontawesome:"",image:"",imagePosition:"center center",maxSize:"100px",minSize:"20px",resizeInterval:50,size:"50%",zIndex:9999};e.LoadingOverlaySetup=function(t){e.extend(!0,o,t)},e.LoadingOverlay=function(t,n){switch(t.toLowerCase()){case"show":i("body",e.extend(!0,{},o,n));break;case"hide":a("body",n)}},e.fn.LoadingOverlay=function(t,n){switch(t.toLowerCase()){case"show":var s=e.extend(!0,{},o,n);return this.each(function(){i(this,s)});case"hide":return this.each(function(){a(this,n)})}}}(jQuery),function(){"use strict";var t=function(t,i){var a;t.rails!==i&&t.error("jquery-ujs has already been loaded!");var n=t(document);t.rails=a={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form:not([data-turbo=true])",formInputClickSelector:"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return t("meta[name=csrf-token]").attr("content")},csrfParam:function(){return t("meta[name=csrf-param]").attr("content")},CSRFProtection:function(e){var t=a.csrfToken();t&&e.setRequestHeader("X-CSRF-Token",t)},refreshCSRFTokens:function(){t('form input[name="'+a.csrfParam()+'"]').val(a.csrfToken())},fire:function(e,i,a){var n=t.Event(i);return e.trigger(n,a),!1!==n.result},confirm:function(e){return confirm(e)},ajax:function(e){return t.ajax(e)},href:function(e){return e[0].href},isRemote:function(e){return e.data("remote")!==i&&!1!==e.data("remote")},handleRemote:function(e){var n,o,s,r,l,d;if(a.fire(e,"ajax:before")){if(r=e.data("with-credentials")||null,l=e.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType,e.is("form")){n=e.data("ujs:submit-button-formmethod")||e.attr("method"),o=e.data("ujs:submit-button-formaction")||e.attr("action"),s=t(e[0]).serializeArray();var c=e.data("ujs:submit-button");c&&(s.push(c),e.data("ujs:submit-button",null)),e.data("ujs:submit-button-formmethod",null),e.data("ujs:submit-button-formaction",null)}else e.is(a.inputChangeSelector)?(n=e.data("method"),o=e.data("url"),s=e.serialize(),e.data("params")&&(s=s+"&"+e.data("params"))):e.is(a.buttonClickSelector)?(n=e.data("method")||"get",o=e.data("url"),s=e.serialize(),e.data("params")&&(s=s+"&"+e.data("params"))):(n=e.data("method"),o=a.href(e),s=e.data("params")||null);return d={type:n||"GET",data:s,dataType:l,beforeSend:function(t,n){if(n.dataType===i&&t.setRequestHeader("accept","*/*;q=0.5, "+n.accepts.script),!a.fire(e,"ajax:beforeSend",[t,n]))return!1;e.trigger("ajax:send",t)},success:function(t,i,a){e.trigger("ajax:success",[t,i,a])},complete:function(t,i){e.trigger("ajax:complete",[t,i])},error:function(t,i,a){e.trigger("ajax:error",[t,i,a])},crossDomain:a.isCrossDomain(o)},r&&(d.xhrFields={withCredentials:r}),o&&(d.url=o),a.ajax(d)}return!1},isCrossDomain:function(t){var i=document.createElement("a");i.href=location.href;var a=document.createElement("a");try{return a.href=t,a.href=a.href,!((!a.protocol||":"===a.protocol)&&!a.host||i.protocol+"//"+i.host==a.protocol+"//"+a.host)}catch(e){return!0}},handleMethod:function(e){var n=a.href(e),o=e.data("method"),s=e.attr("target"),r=a.csrfToken(),l=a.csrfParam(),d=t('<form method="post" action="'+n+'"></form>'),c='<input name="_method" value="'+o+'" type="hidden" />';l===i||r===i||a.isCrossDomain(n)||(c+='<input name="'+l+'" value="'+r+'" type="hidden" />'),s&&d.attr("target",s),d.hide().append(c).appendTo("body"),d.submit()},formElements:function(e,i){return e.is("form")?t(e[0].elements).filter(i):e.find(i)},disableFormElements:function(e){a.formElements(e,a.disableSelector).each(function(){a.disableFormElement(t(this))})},disableFormElement:function(e){var t,a;t=e.is("button")?"html":"val",(a=e.data("disable-with"))!==i&&(e.data("ujs:enable-with",e[t]()),e[t](a)),e.prop("disabled",!0),e.data("ujs:disabled",!0)},enableFormElements:function(e){a.formElements(e,a.enableSelector).each(function(){a.enableFormElement(t(this))})},enableFormElement:function(e){var t=e.is("button")?"html":"val";e.data("ujs:enable-with")!==i&&(e[t](e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.prop("disabled",!1),e.removeData("ujs:disabled")},allowAction:function(t){var i,n=t.data("confirm"),o=!1;if(!n)return!0;
2if(a.fire(t,"confirm")){try{o=a.confirm(n)}catch(e){(console.error||console.log).call(console,e.stack||e)}i=a.fire(t,"confirm:complete",[o])}return o&&i},blankInputs:function(e,i,a){var n,o,s,r=t(),l=i||"input,textarea",d=e.find(l),c={};return d.each(function(){(n=t(this)).is("input[type=radio]")?(s=n.attr("name"),c[s]||(0===e.find('input[type=radio]:checked[name="'+s+'"]').length&&(o=e.find('input[type=radio][name="'+s+'"]'),r=r.add(o)),c[s]=s)):(n.is("input[type=checkbox],input[type=radio]")?n.is(":checked"):!!n.val())===a&&(r=r.add(n))}),!!r.length&&r},nonBlankInputs:function(e,t){return a.blankInputs(e,t,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(e){var t=e.data("disable-with");t!==i&&(e.data("ujs:enable-with",e.html()),e.html(t)),e.on("click.railsDisable",function(e){return a.stopEverything(e)}),e.data("ujs:disabled",!0)},enableElement:function(e){e.data("ujs:enable-with")!==i&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.off("click.railsDisable"),e.removeData("ujs:disabled")}},a.fire(n,"rails:attachBindings")&&(t.ajaxPrefilter(function(e,t,i){e.crossDomain||a.CSRFProtection(i)}),t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableFormElement(e)}),t(t.rails.linkDisableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableElement(e)})}),n.on("ajax:complete",a.linkDisableSelector,function(){a.enableElement(t(this))}),n.on("ajax:complete",a.buttonDisableSelector,function(){a.enableFormElement(t(this))}),n.on("click.rails",a.linkClickSelector,function(e){var i=t(this),n=i.data("method"),o=i.data("params"),s=e.metaKey||e.ctrlKey;if(!a.allowAction(i))return a.stopEverything(e);if(!s&&i.is(a.linkDisableSelector)&&a.disableElement(i),a.isRemote(i)){if(s&&(!n||"GET"===n)&&!o)return!0;var r=a.handleRemote(i);return!1===r?a.enableElement(i):r.fail(function(){a.enableElement(i)}),!1}return n?(a.handleMethod(i),!1):void 0}),n.on("click.rails",a.buttonClickSelector,function(e){var i=t(this);
2if(!a.allowAction(i)||!a.isRemote(i))return a.stopEverything(e);i.is(a.buttonDisableSelector)&&a.disableFormElement(i);var n=a.handleRemote(i);return!1===n?a.enableFormElement(i):n.fail(function(){a.enableFormElement(i)}),!1}),n.on("change.rails",a.inputChangeSelector,function(e){var i=t(this);return a.allowAction(i)&&a.isRemote(i)?(a.handleRemote(i),!1):a.stopEverything(e)}),n.on("submit.rails",a.formSubmitSelector,function(e){var n,o,s=t(this),r=a.isRemote(s);if(!a.allowAction(s))return a.stopEverything(e);if(s.attr("novalidate")===i)if(s.data("ujs:formnovalidate-button")===i){if((n=a.blankInputs(s,a.requiredInputSelector,!1))&&a.fire(s,"ajax:aborted:required",[n]))return a.stopEverything(e)}else s.data("ujs:formnovalidate-button",i);if(r){if(o=a.nonBlankInputs(s,a.fileInputSelector)){setTimeout(function(){a.disableFormElements(s)},13);var l=a.fire(s,"ajax:aborted:file",[o]);return l||setTimeout(function(){a.enableFormElements(s)},13),l}return a.handleRemote(s),!1}setTimeout(function(){a.disableFormElements(s)},13)}),n.on("click.rails",a.formInputClickSelector,function(e){var i=t(this);if(!a.allowAction(i))return a.stopEverything(e);var n=i.attr("name"),o=n?{name:n,value:i.val()}:null,s=i.closest("form");0===s.length&&(s=t("#"+i.attr("form"))),s.data("ujs:submit-button",o),s.data("ujs:formnovalidate-button",i.attr("formnovalidate")),s.data("ujs:submit-button-formaction",i.attr("formaction")),s.data("ujs:submit-button-formmethod",i.attr("formmethod"))}),n.on("ajax:send.rails",a.formSubmitSelector,function(e){this===e.target&&a.disableFormElements(t(this))}),n.on("ajax:complete.rails",a.formSubmitSelector,function(e){this===e.target&&a.enableFormElements(t(this))}),t(function(){a.refreshCSRFTokens()}))};window.jQuery?t(jQuery):"object"==typeof exports&&"object"==typeof module&&(module.exports=t)}(),function(e){"use strict";e.ajaxPrefilter(function(e){if(e.iframe)return e.originalURL=e.url,"iframe"}),e.ajaxTransport("iframe",function(t,i){function a(){n&&(r.each(function(t,i){var a=e(i);a.data("clone").replaceWith(a)}),n.remove(),n=null),o.bind("load",function(){o.remove()}),o.attr("src","javascript:false;")}var n=null,o=null,s="iframe-"+e.now(),r=e(t.files).filter(":file:enabled"),l=null;if(t.dataTypes.shift(),t.data=i.data,console.log(r),console.log(t.data),r.length)return n=e("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:t.originalURL,target:s}),"string"==typeof t.data&&t.data.length>0&&e.error("data must not be serialized"),e.each(t.data||{},function(t,i){e.isPlainObject(i)&&(t=i.name,i=i.value),console.log(t+" "+i),e("<input type='hidden' />").attr({name:t,value:i}).appendTo(n)}),e("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(n),l=t.dataTypes[0]&&t.accepts[t.dataTypes[0]]?t.accepts[t.dataTypes[0]]+("*"!==t.dataTypes[0]?", */*; q=0.01":""):t.accepts["*"],e("<input type='hidden' name='X-HTTP-Accept'>").attr("value",l).appendTo(n),r.after(function(){var t=e(this),i=t.clone().prop("disabled",!0);return t.data("clone",i),i}).next(),r.each(function(t,i){var a=e(i),o=a.closest("form"),s=o.find(":input"),r=e(s[s.index(a)-1]),l=o.find(e('input[name="'+r.attr("name")+'"]')).index(r),d=e(e('input[name="'+r.attr("name")+'"]',n)[l]);d.length>0?d.after(a):a.appendTo(n)}),{send:function(t,i){(o=e("<iframe src='about:blank' name='"+s+"' id='"+s+"' style='display:none'></iframe>")).one("load",function(){o.one("load",function(){var e=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,t=e.documentElement?e.documentElement:e.body,n=t.getElementsByTagName("textarea")[0],o=n&&n.getAttribute("data-type")||null,s=n&&n.getAttribute("data-status")||200,r=n&&n.getAttribute("data-statusText")||"OK",l={html:t.innerHTML,text:o?n.value:t?t.textContent||t.innerText:null};a(),i(s,r,l,o?"Content-Type: "+o:null)}),n[0].submit()}),e("body").append(n,o)},abort:function(){null!==o&&(o.unbind("load").attr("src","about:blank"),a())}}})}(jQuery),function(e){var t;e.remotipart=t={setup:function(i){var a=i.data("ujs:submit-button"),n=e('meta[name="csrf-param"]').attr("content"),o=e('meta[name="csrf-token"]').attr("content"),s=i.find('input[name="'+n+'"]').length;i.one("ajax:beforeSend.remotipart",function(r,l,d){return delete d.beforeSend,d.iframe=!0,d.files=e(e.rails.fileInputSelector,i),d.data=i.serializeArray(),a&&d.data.push(a),d.files.each(function(e,t){for(var i=d.data.length-1;i>=0;i--)d.data[i].name==t.name&&d.data.splice(i,1)}),d.processData=!1,d.dataType===undefined&&(d.dataType="script *"),d.data.push({name:"remotipart_submitted",value:!0}),o&&n&&!s&&d.data.push({name:n,value:o}),e.rails.fire(i,"ajax:remotipartSubmit",[l,d])&&(e.rails.ajax(d).always(function(t){e.rails.fire(i,"ajax:remotipartComplete",[t])}),setTimeout(function(){e.rails.disableFormElements(i)},20)),t.teardown(i),!1}).data("remotipartSubmitted",!0)},teardown:function(e){e.unbind("ajax:beforeSend.remotipart").removeData("remotipartSubmitted")}},e(document).on("ajax:aborted:file","form",function(){var i=e(this);return t.setup(i),e.rails.handleRemote(i),!1})}(jQuery),function(){var e;$.fn.twitter_bootstrap_confirmbox={defaults:{title:null,proceed:"OK",proceed_class:"btn proceed",cancel:"Cancel",cancel_class:"btn cancel",fade:!1,modal_class:""}},e=function(e,t,i){var a,n;switch(n="function"==typeof $().emulateTransitionEnd?$.fn.tooltip.Constructor===undefined?Tooltip.VERSION[0]:$.fn.tooltip.Constructor.VERSION[0]:2){case 2:a=$('<div class="modal hide" id="confirmation_dialog"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">\xd7</button> <h3 class="modal-title">...</h3> </div> <div class="modal-body"></div> <div class="modal-footer"></div> </div>');break;case 3:a=$('<div class="modal" id="confirmation_dialog" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">\xd7</button> <h4 class="modal-title">...</h4> </div> <div class="modal-body"></div> <div class="modal-footer"></div> </div> </div> </div>');break;default:a=$('<div class="modal" id="confirmation_dialog" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">...</h4> <button type="button" class="close" data-dismiss="modal">\xd7</button> </div> <div class="modal-body"></div> <div class="modal-footer"></div> </div> </div> </div>')}a.addClass(t.data("confirm-modal-class")||$.fn.twitter_bootstrap_confirmbox.defaults.modal_class),(t.data("confirm-fade")||$.fn.twitter_bootstrap_confirmbox.defaults.fade)&&a.addClass("fade"),a.find(".modal
2-header .modal-title").html(t.data("confirm-title")||$.fn.twitter_bootstrap_confirmbox.defaults.title||window.top.location.origin),a.find(".modal-body").html(e.toString().replace(/\n/g,"<br />"));var o=$("<a />",{href:"#","data-dismiss":"modal"});o.html(t.data("confirm-cancel")||$.fn.twitter_bootstrap_confirmbox.defaults.cancel),o.addClass($.fn.twitter_bootstrap_confirmbox.defaults.cancel_class),o.addClass(t.data("confirm-cancel-class")||(4===n?"btn-secondary":void 0)||"btn-default"),o.click(function(e){return e.preventDefault(),a.modal("hide")}),a.find(".modal-footer").append(o);var s=$("<a />",{href:"#"});s.html(t.data("confirm-proceed")||$.fn.twitter_bootstrap_confirmbox.defaults.proceed),s.addClass($.fn.twitter_bootstrap_confirmbox.defaults.proceed_class),s.addClass(t.data("confirm-proceed-class")||"btn-primary"),s.click(function(e){return e.preventDefault(),a.modal("hide"),i()}),a.find(".modal-footer").append(s),a.on("keypress",function(e){if(13===e.keyCode)return $(".modal-footer a:last").trigger("click")}).on("hidden hidden.bs.modal",function(){return $(this).remove()}),a.modal("show").appendTo(document.body)},"function"==typeof $().modal&&($.rails.allowAction=function(t){$(t).blur();var i=t.data("confirm"),a=!1;return!i||($.rails.fire(t,"confirm")&&e(i,t,function(){if($.rails.fire(t,"confirm:complete",[a])){var e=$.rails.allowAction;if($.rails.allowAction=function(){return!0},t.get(0).click)t.get(0).click();else if("undefined"!=typeof Event&&null!==Event){var i=new Event("click",{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:0,screenY:0,clientX:0,clientY:0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:document.body.parentNode});t.get(0).dispatchEvent(i)}else if($.isFunction(document.createEvent)){(i=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,document.body.parentNode),t.get(0).dispatchEvent(i)}return $.rails.allowAction=e}}),!1)})}.call(this);var SubdivisionSelect=function(){function e(t){this._countrySelect=t,this._subdivisionSelect=$(t).closest("form").find(e.subdivisionSelector)}return e.subdivisionSelector="select[data-subdivision-selector]",e.countrySelector="select[id$=country]",e.init=function(){var e=this;return $(e.countrySelector).each(function(){return new e(this).init()})},e.prototype.init=function(){var e=this;e._enabledInputsBeforeSubmit(),$(this._countrySelect).change(function(){$.ajax({url:"/crm/subdivisions",data:{country_code:$(this).val()}}).done(function(t){e._clearSubdivisionSelect(),e._updateSubdivisionSelect(t)})})},e.prototype._updateSubdivisionSelect=function(e){var t=this,i=$.isEmptyObject(e);$.each(e,function(e,i){t._subdivisionSelect.append($("<option></option>").attr("value",e).text(i))}),t._subdivisionSelect.prop("disabled",i),i&&t._subdivisionSelect.append($("<option></option>").text("none"))},e.prototype._enabledInputsBeforeSubmit=function(){$("form").bind("submit",function(){$(this).find("select").removeAttr("disabled")})},e.prototype._clearSubdivisionSelect=function(){var e=""===this._subdivisionSelect.children().first().text();this._subdivisionSelect.empty(),e&&this._subdivisionSelect.append($("<option></option>"))},e}();
3/**
4 * dialogFx.js v1.0.0
5 * http://www.codrops.com
6 *
7 * Licensed under the MIT license.
8 * http://www.opensource.org/licenses/mit-license.php
9 * 
10 * Copyright 2014, Codrops
11 * http://www.codrops.com
12 */!function(e){"use strict";function t(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function i(e,i){this.el=e,this.options=t({},this.options),t(this.options,i),this.ctrlClose=this.el.querySelector("[data-dialog-close]"),this.isOpen=!1,this._initEvents()}var a={animations:Modernizr.cssanimations},n={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd",animation:"animationend"}[Modernizr.prefixed("animation")],o=function(e,t){var i=function(e){if(a.animations){if(e.target!=this)return;this.removeEventListener(n,i)}t&&"function"==typeof t&&t.call()};a.animations?e.addEventListener(n,i):i()};i.prototype.options={onOpenDialog:function(){return!1},onCloseDialog:function(){return!1}},i.prototype._initEvents=function(){var e=this;this.ctrlClose.addEventListener("click",this.toggle.bind(this)),document.addEventListener("keydown",function(t){27===(t.keyCode||t.which)&&e.isOpen&&e.toggle(
12)}),this.el.querySelector(".dialog__overlay").addEventListener("click",this.toggle.bind(this))},i.prototype.toggle=function(){var e=this;this.isOpen?(classie.remove(this.el,"dialog--open"),classie.add(e.el,"dialog--close"),o(this.el.querySelector(".dialog__content"),function(){classie.remove(e.el,"dialog--close")}),this.options.onCloseDialog(this)):(classie.add(this.el,"dialog--open"),this.options.onOpenDialog(this)),this.isOpen=!this.isOpen},e.DialogFx=i}(window),function(e){e.fn.metrojs={capabilities:null,checkCapabilities:function(t,i){return(null==e.fn.metrojs.capabilities||void 0!==i&&1==i)&&(e.fn.metrojs.capabilities=new e.fn.metrojs.MetroModernizr(t)),e.fn.metrojs.capabilities}};var t=e.fn.metrojs,i=99e3;e.fn.liveTile=function(t){if(a[t]){for(var i=[],n=1;n<=arguments.length;n++)i[n-1]=arguments[n];return a[t].apply(this,i)}return"object"!=typeof t&&t?(e.error("Method "+t+" does not exist on jQuery.liveTile"),null):a.init.apply(this,arguments)},e.fn.liveTile.contentModules={modules:[],addContentModule:function(e,t){this.modules instanceof Array||(this.modules=[]),this.modules.push(t)},hasContentModule:function(e){if(void 0===e||!(this.modules instanceof Array))return-1;for(var t=0;t<this.modules.length;t++)if("undefined"!=typeof this.modules[t].moduleName&&this.modules[t].moduleName==e)return t;return-1}},e.fn.liveTile.defaults={mode:"slide",speed:500,initDelay:-1,delay:5e3,stops:"100%",stack:!1,direction:"vertical",animationDirection:"forward",tileSelector:">div,>li,>p,>img,>a",tileFaceSelector:">div,>li,>p,>img,>a",ignoreDataAttributes:!1,click:null,link:"",newWindow:!1,bounce:!1,bounceDirections:"all",bounceFollowsMove:!0,pauseOnHover:!1,pauseOnHoverEvent:"both",playOnHover:!1,playOnHoverEvent:"both",onHoverDelay:0,repeatCount:-1,appendBack:!0,alwaysTrigger:!1,flipListOnHover:!1,flipListOnHoverEvent:"mou
12seout",noHAflipOpacity:"1",haTransFunc:"ease",noHaTransFunc:"linear",currentIndex:0,startNow:!0,useModernizr:"undefined"!=typeof window.Modernizr,useHardwareAccel:!0,useTranslate:!0,faces:{$front:null,$back:null},animationStarting:function(){},animationComplete:function(){},triggerDelay:function(){return 3e3*Math.random()},swap:"",swapFront:"-",swapBack:"-",contentModules:[]};var a={init:function(i){var a=e.extend({},e.fn.liveTile.defaults,i);return t.checkCapabilities(a),o.getBrowserPrefix(),-1==e.fn.liveTile.contentModules.hasContentModule("image")&&e.fn.liveTile.contentModules.addContentModule("image",s.imageSwap),-1==e.fn.liveTile.contentModules.hasContentModule("html")&&e.fn.liveTile.contentModules.addContentModule("html",s.htmlSwap),e(this).each(function(t,i){var o=e(i),s=n.initTileData(o,a);s.faces=n.prepTile(o,s),s.fade=function(e){n.fade(o,e)},s.slide=function(e){n.slide(o,e)},s.carousel=function(e){n.carousel(o,e)},s.flip=function(e){n.flip(o,e)},s.flipList=function(e){n.flipList(o,e)};var r={fade:s.fade,slide:s.slide,carousel:s.carousel,flip:s.flip,"flip-list":s.flipList};s.doAction=function(e){var t=r[s.mode];"function"==typeof t&&(t(e),s.hasRun=!0),e==s.timer.repeatCount&&(s.runEvents=!1)},s.timer=new e.fn.metrojs.TileTimer(s.delay,s.doAction,s.repeatCount),o.data("LiveTile",s),"flip-list"===s.mode&&0!=s.flipListOnHover||(s.pauseOnHover?n.bindPauseOnHover(o):s.playOnHover&&n.bindPlayOnHover(o,s)),(s.link.length>0||"function"==typeof s.click)&&o.css({cursor:"pointer"}).bind("click.liveTile",function(e){var t=!0;"function"==typeof s.click&&(t=s.click(o,s)||!1),t&&s.link.length>0&&(e.preventDefault(),s.newWindow?window.open(s.link):window.location=s.link)}),n.bindBounce(o,s),s.startNow&&"none"!=s.mode&&(s.runEvents=!0,s.timer.start(s.initDelay))})},goto:function(t){var i,a=typeof t;if("undefined"===a&&(i={index:-99,delay:0,autoAniDirection:!1}),"number"!==a&&isNaN(t)){if("string"===a)if("next"==t)i={index:-99,delay:0};else{if(0!==t.indexOf("prev"))return e.error(t+' is not a recognized action for .liveTile("goto")'),e(this);i={index:-100,delay:0}}else if("object"===a){"undefined"==typeof t.delay&&(t.delay=0);var n=typeof t.index;"undefined"===n?t.index=0:"string"===n&&("next"===t.index?t.index=-99:0===t.index.indexOf("prev")&&(t.index=-100)),i=t}}else i={index:parseInt(t,10),delay:0};return e(this).each(function(t,a){var n=e(a),o=n.data("LiveTile"),s=n.data("metrojs.tile"),r=i.index;if(!0===s.animating)return e(this);if("carousel"===o.mode){var l=o.faces.$listTiles.filter(".active"),d=o.faces.$listTiles.index(l);if(-100===r?("undefined"!=typeof i.autoAniDirection&&1!=i.autoAniDirection||(o.tempValues.animationDirection="undefined"==typeof i.animationDirection?"backward":i.animationDirection),r=0===d?o.faces.$listTiles.length-1:d-1):-99===r&&("undefined"!=typeof i.autoAniDirection&&1!=i.autoAniDirection||(o.tempValues.animationDirection="undefined"==typeof i.animationDirection?"forward":i.animationDirection),r=d+1),d==r)return;"undefined"!=typeof i.direction&&(o.tempValues.direction=i.direction),"undefined"!=typeof i.animationDirection&&(o.tempValues.animationDirection=i.animationDirection),o.currentIndex=0==r?o.faces.$listTiles.length:r-1}else o.currentIndex=r;o.runEvents=!0,o.timer.start(i.delay>=0?i.delay:o.delay)})},play:function(t){var i,a=typeof t;return"undefined"===a?i={delay:-1}:"number"===a?i={delay:t}:"object"===a&&("undefined"==typeof t.delay&&(t.delay=-1),i=t),e(this).each(function(t,a){var n=e(a).data("LiveTile");n.runEvents=!0,i.delay<0&&!n.hasRun&&(i.delay=n.initDelay),n.timer.start(i.delay>=0?i.delay:n.delay)})},animate:function(){return e(this).each(function(t,i){e(i).data("LiveTile").doAction()})},stop:function(){return e(this).each(function(t,i){var a=e(i).data("LiveTile");a.hasRun=!1,a.runEvents=!1,a.timer.stop(),window.clearTimeout(a.eventTimeout),window.clearTimeout(a.flCompleteTimeout),window.clearTimeout(a.completeTimeout),"flip-list"===a.mode&&a.faces.$listTiles.each(function(t,i){var a=e(i).data("metrojs.tile");window.clearTimeout(a.eventTimeout),window.clearTimeout(a.flCompleteTimeout),window.clearTimeout(a.completeTimeout)})})},pause:function(){return e(this).each(function(t,i){var a=e(i).data("LiveTile");a.timer.pause(),a.runEvents=!1,window.clearTimeout(a.eventTimeout),window.clearTimeout(a.flCompleteTimeout),window.clearTimeout(a.completeTimeout),"flip-list"===a.mode&&a.faces.$listTiles.each(function(t,i){var a=e(i).data("metrojs.tile");window.clearTimeout(a.eventTimeout),window.clearTimeout(a.flCompleteTimeout),window.clearTimeout(a.completeTimeout)})})},restart:function(t){var i,a=typeof t;return"undefined"===a?i={delay:-1}:"number"===a?i={delay:t}:"object"===a&&("undefined"==typeof t.delay&&(t.delay=-1),i=t),e(this).each(function(t,a){var n=e(a).data("LiveTile");i.delay<0&&!n.hasRun&&(i.delay=n.initDelay),n.hasRun=!1,n.runEvents=!0,n.timer.restart(i.delay>=0?i.delay:n.delay)})},rebind:function(t){return e(this).each(function(e,i){void 0!==t?("undefined"!=typeof t.timer&&null!=t.timer&&t.timer.stop(),t.hasRun=!1,a.init.apply(i,t)):a.init.apply(i,{})})},destroy:function(t){var i,a=typeof t;return"undefined"===a?i={removeCss:!1}:"boolean"===a?i={removeCss:t}:"object"===a&&("undefined"==typeof t.removeCss&&(t.removeCss=!1),i=t),e(this).each(function(t,a){var s=e(a),r=s.data("LiveTile");if(void 0!==r){s.unbind(".liveTile");var l=o.appendStyleProperties({margin:"",cursor:""},["transform","transition"],["",""]);r.timer.stop(),window.clearTimeout(r.eventTimeout),window.clearTimeout(r.flCompleteTimeout),window.clearTimeout(r.completeTimeout),null!=r.faces.$listTiles&&r.faces.$listTiles.each(function(t,a){var o=e(a);if("flip-list"===r.mode){var s=o.data("metrojs.tile");window.clearTimeout(s.eventTimeout),window.clearTimeout(s.flCompleteTimeout),window.clearTimeout(s.completeTimeout)}else if("carousel"===r.mode){var d=r.listData[t];d.bounce&&n.unbindMsBounce(o,d)}i.removeCss?(o.removeClass("ha"),o.find(r.tileFaceSelector).unbind(".liveTile").removeClass("bounce flip-front flip-back ha slide slide-front slide-back").css(l)):o.find(r.tileFaceSelector).unbind(".liveTile"),o.removeData("metrojs.tile")}).unbind(".liveTile"),null!=r.faces.$front&&i.removeCss&&r.faces.$front.removeClass("flip-front flip-back ha slide slide-front slide-back").css(l),null!=r.faces.$back&&i.removeCss&&r.faces.$back.removeClass("flip-front flip-back ha slide slide-front slide-back").css(l),r.bounce&&n.unbindMsBounce(s,r),r.playOnHover&&n.unbindMsPlayOnHover(s,r),r.pauseOnhover&&n.unbindMsPauseOnHover(s,r),s.removeClass("ha"),s.removeData("LiveTile"),s.removeData("metrojs.tile"),r=null}})}},n={dataAtr:function(e,t,i){return void 0!==e.attr("data-"+t)?e.attr("data-"+t):i},dataMethod:function(e,t,i){return void 0!==e.data(t)?e.data(t):i},getDataOrDefault:null,initTileData:function(i,a){var o=0==a.ignoreDataAttributes,s=null;null==this.getDataOrDefault&&(this.getDataOrDefault=t.capabilities.isOldJQuery?this.dataAtr:this.dataMethod),(s=o?{speed:this.getDataOrDefault(i,"speed",a.speed),delay:this.getDataOrDefault(i,"delay",a.delay),stops:this.getDataOrDefault(i,"stops",a.stops),stack:this.getDataOrDefault(i,"stack",a.stack),mode:this.getDataOrDefault(i,"mode",a.mode),direction:this.getDataOrDefault(i,"direction",a.direction),useHardwareAccel:this.getDataOrDefault(i,"ha",a.useHardwareAccel),repeatCount:this.getDataOrDefault(i,"repeat",a.repeatCount),swap:this.getDataOrDefault(i,"swap",a.swap),appendBack:this.getDataOrDefault(i,"appendback",a.appendBack),currentIndex:this.getDataOrDefault(i,"start-index",a.currentIndex),animationDirection:this.getDataOrDefault(i,"ani-direction",a.animationDirection),startNow:this.getDataOrDefault(i,"start-now",a.startNow),tileSelector:this.getDataOrDefault(i,"tile-selector",a.tileSelector),tileFaceSelector:this.getDataOrDefault(i,"face-selector",a.tileFaceSelector),bounce:this.getDataOrDefault(i,"bounce",a.bounce),bounceDirections:this.getDataOrDefault(i,"bounce-dir",a.bounceDirections),bounceFollowsMove:this.getDataOrDefault(i,"bounce-follows",a.bounceFollowsMove),click:this.getDataOrDefault(i,"click",a.click),link:this.getDataOrDefault(i,"link",a.link),newWindow:this.getDataOrDefault(i,"new-window",a.newWindow),alwaysTrigger:this.getDataOrDefault(i,"always-trigger",a.alwaysTrigger),flipListOnHover:this.getDataOrDefault(i,"flip-onhover",a.flipListOnHover),pauseOnHover:this.getDataOrDefault(i,"pause-onhover",a.pauseOnHover),playOnHover:this.getDataOrDefault(i,"play-onhover",a.playOnHover),onHoverDelay:this.getDataOrDefault(i,"hover-delay",a.onHoverDelay),noHAflipOpacity:this.getDataOrDefault(i,"flip-opacity",a.noHAflipOpacity),useTranslate:this.getDataOrDefault(i,"use-translate",a.useTranslate),runEvents:!1,isReversed:!1,loopCount:0,contentModules:[],listData:[],height:i.height(),width:i.width(),tempValues:{}}:e.extend(!0,{runEvents:!1,isReversed:!1,loopCount:0,contentModules:[],listData:[],height:i.height(),width:i.width(),tempValues:{}},a)).useTranslate=s.useTranslate&&s.useHardwareAccel&&t.capabilities.canTransform&&t.capabilities.canTransition,s.margin="vertical"===s.direction?s.height/2:s.width/2,s.stops="object"==typeof a.stops&&a.stops instanceof Array?a.stops:(""+s.stops).split(","),1===s.stops.length&&s.stops.push("0px");var r,l=s.swap.replace(" ","").split(","),d=o?this.getDataOrDefault(i,"swap-front",a.swapFront):a.swapFront,c=o?this.getDataOrDefault(i,"swap-back",a.swapBack):a.swapBack;for(s.swapFront="-"===d?l:d.replace(" ","").split(","),s.swapBack="-"===c?l:c.replace(" ","").split(","),r=0;r<s.swapFront.length;r++)s.swapFront[r].length>0&&-1===e.inArray(s.swapFront[r],l)&&l.push(s.swapFront[r]);for(r=0;r<s.swapBack.length;r++)s.swapBack[r].length>0&&-1===e.inArray(s.swapBack[r],l)&&l.push(s.swapBack[r]);for(s.swap=l,r=0;r<l.length;r++)if(l[r].length>0){var u=e.fn.liveTile.contentModules.hasContentModule(l[r]);u>
12-1&&s.contentModules.push(e.fn.liveTile.contentModules.modules[u])}s.initDelay=o?this.getDataOrDefault(i,"initdelay",a.initDelay):a.initDelay,s.delay<-1?s.delay=a.triggerDelay(1):s.delay<0&&(s.delay=3500+4501*Math.random()),s.initDelay<0&&(s.initDelay=s.delay);var p={};for(r=0;r<s.contentModules.length;r++)e.extend(p,s.contentModules[r].data);for(e.extend(p,a,s),"flip-list"===p.mode?i.find(p.tileSelector).not(".tile-title").each(function(t,i){var a=e(i),s={direction:o?n.getDataOrDefault(a,"direction",p.direction):p.direction,newWindow:!!o&&n.getDataOrDefault(a,"new-window",!1),link:o?n.getDataOrDefault(a,"link",""):"",faces:{$front:null,$back:null},height:a.height(),width:a.width(),isReversed:!1};s.margin="vertical"===s.direction?s.height/2:s.width/2,p.listData.push(s)}):"carousel"===p.mode&&(p.stack=!0,i.find(p.tileSelector).not(".tile-title").each(function(t,i){var a=e(i),s={bounce:!!o&&n.getDataOrDefault(a,"bounce",!1),bounceDirections:o?n.getDataOrDefault(a,"bounce-dir","all"):"all",link:o?n.getDataOrDefault(a,"link",""):"",newWindow:!!o&&n.getDataOrDefault(a,"new-window",!1),animationDirection:o?n.getDataOrDefault(a,"ani-direction",""):"",direction:o?n.getDataOrDefault(a,"direction",""):""};p.listData.push(s)})),r=0;r<s.contentModules.length;r++)"function"==typeof p.contentModules[r].initData&&p.contentModules[r].initData(p,i);return s=null,p},prepTile:function(a,s){a.addClass(s.mode);var r,l,d,c,u={$tileFaces:null,$listTiles:null,$front:null,$back:null};switch(s.mode){case"fade":u.$tileFaces=a.find(s.tileFaceSelector).not(".tile-title"),u.$front=null!=s.faces.$front&&s.faces.$front.length>0?s.faces.$front.addClass("fade-front"):u.$tileFaces.filter(":first").addClass("fade-front"),null!=s.faces.$back&&s.faces.$back.length>0?u.$back=s.faces.$back.addClass("fade-back"):u.$tileFaces.length>1?u.$back=u.$tileFaces.filter(":last").addClass("fade-back"):s.appendBack?u.$back=e('<div class="fade-back"></div>').appendTo(a):u.$back=e("<div></div>");break;case"slide":var p,h;if(u.$tileFaces=a.find(s.tileFaceSelector).not(".tile-title"),u.$front=null!=s.faces.$front&&s.faces.$front.length>0?s.faces.$front.addClass("slide-front"):u.$tileFaces.filter(":first").addClass("slide-front"),null!=s.faces.$back&&s.faces.$back.length>0?u.$back=s.faces.$back.addClass("slide-back"):u.$tileFaces.length>1?u.$back=u.$tileFaces.filter(":last").addClass("slide-back"):s.appendBack?u.$back=e('<div class="slide-back"></div>').appendTo(a):u.$back=e("<div></div>"),1==s.stack)"vertical"===s.direction?(p="top",h="translate(0%, -100%) translateZ(0)"):(p="left",h="translate(-100%, 0%) translateZ(0)"),d={},s.useTranslate?o.appendStyleProperties(d,["transform"],[h]):d[p]="-100%",u.$back.css(d);a.data("metrojs.tile",{animating:!1}),t.capabilities.canTransition&&s.useHardwareAccel&&(a.addClass("ha"),u.$front.addClass("ha"),u.$back.addClass("ha"));break;case"carousel":u.$listTiles=a.find(s.tileSelector).not(".tile-title");var m=u.$listTiles.length;a.data("metrojs.tile",{animating:!1}),s.currentIndex=Math.min(s.currentIndex,m-1),u.$listTiles.each(function(i,a){var r=e(a).addClass("slide"),l=s.listData[i],d="string"==typeof l.animationDirection&&l.animationDirection.length>0?l.animationDirection:s.animationDirection,u="string"==typeof l.direction&&l.direction.length>0?l.direction:s.direction;i==s.currentIndex?r.addClass("active"):"forward"===d?"vertical"===u?(c=s.useTranslate?o.appendStyleProperties({},["transform"],["translate(0%, 100%) translateZ(0)"]):{left:"0%",top:"100%"},r.css(c)):(c=s.useTranslate?o.appendStyleProperties({},["transform"],["translate(100%, 0%) translateZ(0)"]):{left:"100%",top:"0%"},r.css(c)):"backward"===d&&("vertical"===u?(c=s.useTranslate?o.appendStyleProperties({},["transform"],["translate(0%, -100%) translateZ(0)"]):{left:"0%",top:"-100%"},r.css(c)):(c=s.useTranslate?o.appendStyleProperties({},["transform"],["translate(-100%, 0%) translateZ(0)"]):{left:"-100%",top:"0%"},r.css(c))),n.bindLink(r,l),s.useHardwareAccel&&t.capabilities.canTransition&&n.bindBounce(r,l),r=null,l=null}),t.capabilities.canFlip3d&&s.useHardwareAccel&&(a.addClass("ha"),u.$listTiles.addClass("ha"));break;case"flip-list":u.$listTiles=a.find(s.tileSelector).not(".tile-title"),u.$listTiles.each(function(a,c){var u=e(c).addClass("tile-"+(a+1)),p=u.find(s.tileFaceSelector).filter(":first").addClass("flip-front").css({margin:"0px"});1===u.find(s.tileFaceSelector).length&&1==s.appendBack&&u.append("<div></div>");var h=u.find(s.tileFaceSelector).filter(":last").addClass("flip-back").css({margin:"0px"});s.listData[a].faces.$front=p,s.listData[a].faces.$back=h,u.data("metrojs.tile",{animating:!1,count:1,completeTimeout:null,flCompleteTimeout:null,index:a});var m=u.data("metrojs.tile");t.capabilities.canFlip3d&&s.useHardwareAccel?(u.addClass("ha"),p.addClass("ha"),h.addClass("ha"),r="vertical"===s.listData[a].direction?"rotateX(180deg)":"rotateY(180deg)",d=o.appendStyleProperties({},["transform"],[r]),h.css(d)):(l="vertical"===s.listData[a].direction?{height:"100%",width:"100%",marginTop:"0px",opacity:"1"}:{height:"100%",width:"100%",marginLeft:"0px",opacity:"1"},d="vertical"===s.listData[a].direction?{height:"0px",width:"100%",marginTop:s.listData[a].margin+"px",opacity:s.noHAflipOpacity}:{height:"100%",width:"0px",marginLeft:s.listData[a].margin+"px",opacity:s.noHAflipOpacity},p.css(l),h.css(d));var f=function(){m.count++,m.count>=i&&(m.count=1)};if(s.flipListOnHover){var g=s.flipListOnHoverEvent+".liveTile";p.bind(g,function(){n.flip(u,m.count,s,f)}),h.bind(g,function(){n.flip(u,m.count,s,f)})}s.listData[a].link.length>0&&u.css({cursor:"pointer"}).bind("click.liveTile",function(){s.listData[a].newWindow?window.open(s.listData[a].link):window.location=s.listData[a].link})});break;case"flip":u.$tileFaces=a.find(s.tileFaceSelector).not(".tile-title"),u.$front=null!=s.faces.$front&&s.faces.$front.length>0?s.faces.$front.addClass("flip-front"):u.$tileFaces.filter(":first").addClass("flip-front"),null!=s.faces.$back&&s.faces.$back.length>0?u.$back=s.faces.$back.addClass("flip-back"):u.$tileFaces.length>1?u.$back=u.$tileFaces.filter(":last").addClass("flip-back"):s.appendBack?u.$back=e('<div class="flip-back"></div>').appendTo(a):u.$back=e("<div></div>"),a.data("metrojs.tile",{animating:!1}),t.capabilities.canFlip3d&&s.useHardwareAccel?(a.addClass("ha"),u.$front.addClass("ha"),u.$back.addClass("ha"),r="vertical"===s.direction?"rotateX(180deg)":"rotateY(180deg)",d=o.appendStyleProperties({},["transform"],[r]),u.$back.css(d)):(l="vertical"===s.direction?{height:"100%",width:"100%",marginTop:"0px",opacity:"1"}:{height:"100%",width:"100%",marginLeft:"0px",opacity:"1"},d="vertical"===s.direction?{height:"0%",width:"100%",marginTop:s.margin+"px",opacity:"0"}:{height:"100%",width:"0%",marginLeft:s.margin+"px",opacity:"0"},u.$front.css(l),u.$back.css(d))}return u},bindPauseOnHover:function(i){var a,n,o,s,r;
12a=i.data("LiveTile"),n=!1,o=!1,s="both"==a.pauseOnHoverEvent||"mouseover"==a.pauseOnHoverEvent||"mouseenter"==a.pauseOnHoverEvent,r="both"==a.pauseOnHoverEvent||"mouseout"==a.pauseOnHoverEvent||"mouseleave"==a.pauseOnHoverEvent,a.pOnHoverMethods={pause:function(){a.timer.pause(),"flip-list"===a.mode&&a.faces.$listTiles.each(function(t,i){window.clearTimeout(e(i).data("metrojs.tile").completeTimeout)})},over:function(){n||o||a.runEvents&&(o=!0,a.eventTimeout=window.setTimeout(function(){o=!1,r&&(n=!0),a.pOnHoverMethods.pause()},a.onHoverDelay))},out:function(){if(o)return window.clearTimeout(a.eventTimeout),void(o=!1);if(s){if(!n&&!o)return;a.runEvents&&a.timer.start(a.hasRun?a.delay:a.initDelay)}else a.pOnHoverMethods.pause();n=!1}},t.capabilities.canTouch?window.navigator.msPointerEnabled?(s&&i[0].addEventListener("MSPointerOver",a.pOnHoverMethods.over,!1),r&&i[0].addEventListener("MSPointerOut",a.pOnHoverMethods.out,!1)):(s&&i.bind("touchstart.liveTile",a.pOnHoverMethods.over),r&&i.bind("touchend.liveTile",a.pOnHoverMethods.out)):(s&&i.bind("mouseover.liveTile",a.pOnHoverMethods.over),r&&i.bind("mouseout.liveTile",a.pOnHoverMethods.out))},unbindMsPauseOnHover:function(e,t){"undefined"!=typeof t.pOnHoverMethods&&window.navigator.msPointerEnabled&&(e[0].removeEventListener("MSPointerOver",t.pOnHoverMethods.over,!1),e[0].removeEventListener("MSPointerOut",t.pOnHoverMethods.out,!1))},bindPlayOnHover:function(e,i){var n,o,s,r;n=!1,o=!1,s="both"==i.playOnHoverEvent||"mouseover"==i.playOnHoverEvent||"mouseenter"==i.playOnHoverEvent,r="both"==i.playOnHoverEvent||"mouseout"==i.playOnHoverEvent||"mouseleave"==i.playOnHoverEvent,i.onHoverMethods={over:function(){if(!(n||o||i.bounce&&"no"!=i.bounceMethods.down)){var t="flip"==i.mode||(i.startNow?!i.isReversed:i.isReversed);
12window.clearTimeout(i.eventTimeout),(i.runEvents&&t||!i.hasRun)&&(o=!0,i.eventTimeout=window.setTimeout(function(){o=!1,r&&(n=!0),a.play.apply(e[0],[0])},i.onHoverDelay))}},out:function(){if(o)return window.clearTimeout(i.eventTimeout),void(o=!1);(!s||n||o)&&(window.clearTimeout(i.eventTimeout),i.eventTimeout=window.setTimeout(function(){var t="flip"==i.mode||(i.startNow?i.isReversed:!i.isReversed);i.runEvents&&t&&a.play.apply(e[0],[0]),n=!1},i.speed+200))}},t.capabilities.canTouch?window.navigator.msPointerEnabled?(s&&e[0].addEventListener("MSPointerDown",i.onHoverMethods.over,!1),r&&e.bind("mouseleave.liveTile",i.onHoverMethods.out)):(s&&e.bind("touchstart.liveTile",i.onHoverMethods.over),r&&e.bind("touchend.liveTile",i.onHoverMethods.out)):(s&&e.bind("mouseenter.liveTile",i.onHoverMethods.over),r&&e.bind("mouseleave.liveTile",i.onHoverMethods.out))},unbindMsPlayOnHover:function(e,t){"undefined"!=typeof t.onHoverMethods&&window.navigator.msPointerEnabled&&e[0].removeEventListener("MSPointerDown",t.onHoverMethods.over,!1)},bindBounce:function(i,a){a.bounce&&(i.addClass("bounce"),i.addClass("noselect"),a.bounceMethods={down:"no",threshold:30,zeroPos:{x:0,y:0},eventPos:{x:0,y:0},inTilePos:{x:0,y:0},pointPos:{x:0,y:0},regions:{c:[0,0],tl:[-1,-1],tr:[1,-1],bl:[-1,1],br:[1,1],t:[null,-1],r:[1,null],b:[null,1],l:[-1,null]},targets:{all:["c","t","r","b","l","tl","tr","bl","br"],edges:["c","t","r","b","l"],corners:["c","tl","tr","bl","br"]},hitTest:function(i,n,o,s){var r=a.bounceMethods.regions,l=a.bounceMethods.targets[o],d=0,c=null,u=null,p={hit:[0,0],name:"c"};if(t.capabilities.isOldAndroid||!t.capabilities.canTransition)return p;void 0===l&&("string"==typeof o&&(l=o.split(",")),e.isArray(l)&&-1==e.inArray("c")&&(s=0,p=null));for(var h=i.width(),m=i.height(),f=[h*s,m*s],g=n.x-.5*h,v=n.y-.5*m,b=[g>0?Math.abs(g)<=f[0]?0:1:Math.abs(g)<=f[0]?0:-1,v>0?Math.abs(v)<=f[1]?0:1:Math.abs(v)<=f[1]?0:-1];d<l.length;d++){if(null!=c)return c;var _=l[d],y=r[_];if("*"==_)return{region:r[_=l[d+1]],name:_};b[0]==y[0]&&b[1]==y[1]?c={hit:y,name:_}:b[0]!=y[0]&&null!=y[0]||b[1]!=y[1]&&null!=y[1]||(u={hit:y,name:_})}return null!=c?c:null!=u?u:p},bounceDown:function(t){if("A"!=t.target.tagName||e(t).is(".bounce")){var n=t.originalEvent&&t.originalEvent.touches?t.originalEvent.touches[0]:t,s=i.offset();window.pageXOffset,window.pageYOffset,a.bounceMethods.pointPos={x:n.pageX,y:n.pageY},a.bounceMethods.inTilePos={x:n.pageX-s.left,y:n.pageY-s.top},a.$tileParent||(a.$tileParent=i.parent());var r=a.$tileParent.offset();a.bounceMethods.eventPos={x:s.left-r.left+i.width()/2,y:s.top-r.top+i.height()/2};var l=a.bounceMethods.hitTest(i,a.bounceMethods.inTilePos,a.bounceDirections,.25);if(null==l)a.bounceMethods.down="no";else{window.navigator.msPointerEnabled?(document.addEventListener("MSPointerUp",a.bounceMethods.bounceUp,!1),i[0].addEventListener("MSPointerUp",a.bounceMethods.bounceUp,!1),document.addEventListener("MSPointerCancel",a.bounceMethods.bounceUp,!1),a.bounceFollowsMove&&i[0].addEventListener("MSPointerMove",a.bounceMethods.bounceMove,!1)):(e(document).bind("mouseup.liveTile, touchend.liveTile, touchcancel.liveTile, dragstart.liveTile",a.bounceMethods.bounceUp),a.bounceFollowsMove&&(i.bind("touchmove.liveTile",a.bounceMethods.bounceMove),i.bind("mousemove.liveTile",a.bounceMethods.bounceMove)));var d="bounce-"+l.name;i.addClass(d),a.bounceMethods.down=d,a.bounceMethods.downPcss=o.appendStyleProperties({},["perspective-origin"],[a.bounceMethods.eventPos.x+"px "+a.bounceMethods.eventPos.y+"px"]),a.$tileParent.css(a.bounceMethods.downPcss)}}},bounceUp:function(){"no"!=a.bounceMethods.down&&(a.bounceMethods.unBounce(),window.navigator.msPointerEnabled?(document.removeEventListener("MSPointerUp",a.bounceMethods.bounceUp,!1),i[0].removeEventListener("MSPointerUp",a.bounceMethods.bounceUp,!1),document.removeEventListener("MSPointerCancel",a.bounceMethods.bounceUp,!1),a.bounceFollowsMove&&i[0].removeEventListener("MSPointerMove",a.bounceMethods.bounceMove,!1)):e(document).unbind("mouseup.liveTile, touchend.liveTile, touchcancel.liveTile, dragstart.liveTile",a.bounceMethods.bounceUp),a.bounceFollowsMove&&(i.unbind("touchmove.liveTile",a.bounceMethods.bounceMove),i.unbind("mousemove.liveTile",a.bounceMethods.bounceMove)))},bounceMove:function(e){if("no"!=a.bounceMethods.down){var t=e.originalEvent&&e.originalEvent.touches?e.originalEvent.touches[0]:e,n=Math.abs(t.pageX-a.bounceMethods.pointPos.x),o=Math.abs(t.pageY-a.bounceMethods.pointPos.y);if(n>a.bounceMethods.threshold||o>a.bounceMethods.threshold){var s=a.bounceMethods.down;a.bounceMethods.bounceDown(e),s!=a.bounceMethods.down&&i.removeClass(s)}}},unBounce:function(){if(i.removeClass(a.bounceMethods.down),"object"==typeof a.bounceMethods.downPcss){var e=["perspective-origin","perspective-origin-x","perspective-origin-y"],t=["","",""];a.bounceMethods.downPcss=o.appendStyleProperties({},e,t),window.setTimeout(function(){a.$tileParent.css(a.bounceMethods.downPcss)},200)}a.bounceMethods.down="no",a.bounceMethods.inTilePos=a.bounceMethods.zeroPos,a.bounceMethods.eventPos=a.bounceMethods.zeroPos}},window.navigator.msPointerEnabled?i[0].addEventListener("MSPointerDown",a.bounceMethods.bounceDown,!1):t.capabilities.canTouch?i.bind("touchstart.liveTile",a.bounceMethods.bounceDown):i.bind("mousedown.liveTile",a.bounceMethods.bounceDown))}
12,unbindMsBounce:function(e,t){t.bounce&&window.navigator.msPointerEnabled&&(e[0].removeEventListener("MSPointerDown",t.bounceMethods.bounceDown,!1),e[0].removeEventListener("MSPointerCancel",t.bounceMethods.bounceUp,!1),e[0].removeEventListener("MSPointerOut",t.bounceMethods.bounceUp,!1))},bindLink:function(t,i){i.link.length>0&&t.css({cursor:"pointer"}).bind("click.liveTile",function(t){("A"!=t.target.tagName||e(t).is(".live-tile,.slide,.flip"))&&(i.newWindow?window.open(i.link):window.location=i.link)})},runContenModules:function(e,t,i,a){for(var n=0;n<e.contentModules.length;n++){var o=e.contentModules[n];"function"==typeof o.action&&o.action(e,t,i,a)}},fade:function(e,t,i){var a="object"==typeof i?i:e.data("LiveTile"),o=function(){(a.timer.repeatCount>0||-1==a.timer.repeatCount)&&a.timer.count!=a.timer.repeatCount&&a.timer.start(a.delay)};if(!a.faces.$front.is(":animated")){a.timer.pause();var s=a.loopCount+1;a.isReversed=s%2==0;var r=a.animationStarting.call(e[0],a,a.faces.$front,a.faces.$back);if(void 0===r||0!=r){a.loopCount=s;var l=function(){o(),n.runContenModules(a,a.faces.$front,a.faces.$back),a.animationComplete.call(e[0],a,a.faces.$front,a.faces.$back)};a.isReversed?a.faces.$front.fadeIn(a.speed,a.noHaTransFunc,l):a.faces.$front.fadeOut(a.speed,a.noHaTransFunc,l)}else o()}},slide:function(i,a,s,r,l){var d="object"==typeof s?s:i.data("LiveTile"),c=i.data("metrojs.tile");if(1==c.animating||i.is(":animated"))return d=null,void(c=null);var u,p=function(){(d.timer.repeatCount>0||-1==d.timer.repeatCount)&&d.timer.count!=d.timer.repeatCount&&d.timer.start(d.delay)};if("carousel"!==d.mode){d.isReversed=d.currentIndex%2!=0,d.timer.pause();var h=d.animationStarting.call(i[0],d,d.faces.$front,d.faces.$back);if(void 0!==h&&0==h)return void p();d.loopCount=d.loopCount+1}else d.isReversed=!0;u="string"==typeof d.tempValues.direction&&d.tempValues.direction.length>0?d.tempValues.direction:d.direction,d.tempValues.direction=null;var m={},f={},g=void 0===r?d.currentIndex:r,v=e.trim(d.stops[Math.min(g,d.stops.length-1)]),b=v.indexOf("px"),_=0,y="vertical"===u?d.height:d.width,w="vertical"===u?"top":"left",k=1==d.stack,$=function(){void 0===l?(d.currentIndex=d.currentIndex+1,d.currentIndex>d.stops.length-1&&(d.currentIndex=0)):l(),"carousel"!=d.mode&&p(),n.runContenModules(d,d.faces.$front,d.faces.$back,d.currentIndex),d.animationComplete.call(i[0],d,d.faces.$front,d.faces.$back),d=null,c=null};if(_=b>0?parseInt(v.substring(0,b),10)-y+"px":parseInt(v.replace("%",""),10)-100+"%",t.capabilities.canTransition&&d.useHardwareAccel){if("undefined"!=typeof c.animating&&1==c.animating)return;c.animating=!0;var x=["transition-property","transition-duration","transition-timing-function"],C=[d.useTranslate?"transform":w,d.speed+"ms",d.haTransFunc];C[o.browserPrefix+"transition-property"]=o.browserPrefix+"transform",m=o.appendStyleProperties(m,x,C),f=o.appendStyleProperties(f,x,C);var T,S="vertical"===u,D=S?"top":"left";d.useTranslate?(T=S?"translate(0%, "+v+")":"translate("+v+", 0%)",m=o.appendStyleProperties(m,["transform"],[T+"translateZ(0)"]),k&&(T=S?"translate(0%, "+_+")":"translate("+_+", 0%)",f=o.appendStyleProperties(f,["transform"],[T+"translateZ(0)"]))):(m[D]=v,k&&(f[D]=_)),d.faces.$front.css(m),k&&d.faces.$back.css(f),window.clearTimeout(d.completeTimeout),d.completeTimeout=window.setTimeout(function(){c.animating=!1,$()},d.speed)}else{m[w]=v,f[w]=_,c.animating=!0;var E=d.faces.$front.stop(),I=d.faces.$back.stop();E.animate(m,d.speed,d.noHaTransFunc,function(){c.animating=!1,$()}),k&&I.animate(f,d.speed,d.noHaTransFunc,function(){})}},carousel:function(e,i){var a=e.data("LiveTile"),s=e.data("metrojs.tile");if(1==s.animating||a.faces.$listTiles.length<=1)s=null;else{var r=function(){(a.timer.repeatCount>0||-1==a.timer.repeatCount)&&a.timer.count!=a.timer.repeatCount&&a.timer.start(a.delay)};a.timer.pause();var l,d,c=a.faces.$listTiles.filter(".active"),u=a.faces.$listTiles.index(c),p=a.currentIndex,h=p!=u?p:u,m=h+1>=a.faces.$listTiles.length?0:h+1,f=a.listData[m];if(u==m)return s=null,void(c=null);l="string"==typeof a.tempValues.animationDirection&&a.tempValues.animationDirection.length>0?a.tempValues.animationDirection:"string"==typeof f.animationDirection&&f.animationDirection.length>0?f.animationDirection:a.animationDirection,a.tempValues.animationDirection=null,"string"==typeof a.tempValues.direction&&a.tempValues.direction.length>0?d=a.tempValues.direction:"string"==typeof f.direction&&f.direction.length>0?(d=f.direction,a.tempValues.direction=d):d=a.direction;var g=a.faces.$listTiles.eq(m),v=a.animationStarting.call(e[0],a,c,g);if(void 0===v||0!=v){a.loopCount=a.loopCount+1;var b,_=o.appendStyleProperties({},["transition-duration"],["0s"]),y="vertical"===d;"backward"===l?(a.useTranslate&&t.capabilities.canTransition?(b=y?"translate(0%, -100%)":"translate(-100%, 0%)",_=o.appendStyleProperties(_,["transform"],[b+" translateZ(0)"]),a.stops=["100%"]):(y?(_.top="-100%",_.left="0%"):(_.top="0%",_.left="-100%"),a.stops=["100%"]),a.faces.$front=c,a.faces.$back=g):(a.useTranslate&&t.capabilities.canTransition?(b=y?"translate(0%, 100%)":"translate(100%, 0%)",_=o.appendStyleProperties(_,["transform"],[b+" translateZ(0)"])):y?(_.top="100%",_.left="0%"):(_.top="0%",_.left="100%"),a.faces.$front=g,a.faces.$back=c,a.stops=["0%"]),g.css(_),window.setTimeout(function(){c.removeClass("active"),g.addClass("active"),n.slide(e,i,a,0,function(){a.currentIndex=m,s=null,c=null,g=null,r()})},150)}else r()}},flip:function(e,i,a,s){var r=e.data("metrojs.tile");if(1!=r.animating){var l,d,c,u,p,h,m,f="object"==typeof a?a:e.data("LiveTile"),g=void 0===s,v=0,b=function(){(f.timer.repeatCount>
120||-1==f.timer.repeatCount)&&f.timer.count!=f.timer.repeatCount&&f.timer.start(f.delay)};if(g){f.timer.pause();var _=f.loopCount+1;m=_%2==0,f.isReversed=m,l=f.faces.$front,d=f.faces.$back;var y=m?[f,d,l]:[f,l,d],w=f.animationStarting.apply(e[0],y);if(void 0!==w&&0==w)return void b();c=f.direction,height=f.height,width=f.width,margin=f.margin,f.loopCount=_}else m=i%2==0,v=r.index,l=f.listData[v].faces.$front,d=f.listData[v].faces.$back,
13f.listData[v].isReversed=m,c=f.listData[v].direction,height=f.listData[v].height,width=f.listData[v].width,margin=f.listData[v].margin;if(t.capabilities.canFlip3d&&f.useHardwareAccel){u=m?"360deg":"180deg",p="vertical"===c?"rotateX("+u+")":"rotateY("+u+")",h=o.appendStyleProperties({},["transform","transition"],[p,"all "+f.speed+"ms "+f.haTransFunc+" 0s"]);var k=m?"540deg":"360deg",$="vertical"===c?"rotateX("+k+")":"rotateY("+k+")",x=o.appendStyleProperties({},["transform","transition"],[$,"all "+f.speed+"ms "+f.haTransFunc+" 0s"]);l.css(h),d.css(x);var C=function(){var t,i;r.animating=!1,m?(t="vertical"===c?"rotateX(0deg)":"rotateY(0deg)",i=o.appendStyleProperties({},["transform","transition"],[t,"all 0s "+f.haTransFunc+" 0s"]),l.css(i),n.runContenModules(f,l,d,v),g?(b(),f.animationComplete.call(e[0],f,l,d)):s(f,l,d),l=null,d=null,f=null,r=null):(n.runContenModules(f,d,l,v),g?(b(),f.animationComplete.call(e[0],f,d,l)):s(f,d,l))};"flip-list"===f.mode?(window.clearTimeout(f.listData[v].completeTimeout),f.listData[v].completeTimeout=window.setTimeout(C,f.speed)):(window.clearTimeout(f.completeTimeout),f.completeTimeout=window.setTimeout(C,f.speed))}else{var T,S=f.speed/2,D="vertical"===c?{height:"0px",width:"100%",marginTop:margin+"px",opacity:f.noHAflipOpacity}:{height:"100%",width:"0px",marginLeft:margin+"px",opacity:f.noHAflipOpacity},E="vertical"===c?{height:"100%",width:"100%",marginTop:"0px",opacity:"1"}:{height:"100%",width:"100%",marginLeft:"0px",opacity:"1"};m?(r.animating=!0,d.stop().animate(D,{duration:S}),T=function(){r.animating=!1,l.stop().animate(E,{duration:S,complete:function(){n.runContenModules(f,l,d,v),g?(b(),f.animationComplete.call(e[0],f,l,d)):s(f,l,d),r=null,l=null,d=null}})},"flip-list"===f.mode?(window.clearTimeout(f.listData[r.index].completeTimeout),f.listData[r.index].completeTimeout=window.setTimeout(T,S)):(window.clearTimeout(f.completeTimeout),f.completeTimeout=window.setTimeout(T,S))):(r.animating=!0,l.stop().animate(D,{duration:S}),T=function(){r.animating=!1,d.stop().animate(E,{duration:S,complete:function(){n.runContenModules(f,d,l,v),g?(b(),f.animationComplete.call(e[0],f,d,l)):s(f,d,l),l=null,d=null,f=null,r=null}})},"flip-list"===f.mode?(window.clearTimeout(f.listData[r.index].completeTimeout),f.listData[r.index].completeTimeout=window.setTimeout(T,S)):(window.clearTimeout(f.completeTimeout),f.completeTimeout=window.setTimeout(T,S)))}}else r=null},flipList:function(t){var a=t.data("LiveTile"),o=a.speed,s=!1,r=function(){(a.timer.repeatCount>0||-1==a.timer.repeatCount)&&a.timer.count!=a.timer.repeatCount&&a.timer.start(a.delay)};a.timer.pause();var l=a.animationStarting.call(t[0],a,null,null);void 0===l||0!=l?(a.loopCount=a.loopCount+1,a.faces.$listTiles.each(function(t,r){var l=e(r),d=l.data("metrojs.tile"),c=a.triggerDelay(t),u=a.speed+Math.max(c,0),p=a.alwaysTrigger;p||(p=351*Math.random()>150),p&&(s=!0,o=Math.max(u+a.speed,o),window.clearTimeout(d.flCompleteTimeout),d.flCompleteTimeout=window.setTimeout(function(){n.flip(l,d.count,a,function(){d.count++,d.count>=i&&(d.count=1),l=null,d=null})},u))}),s&&(window.clearTimeout(a.flCompleteTimeout),a.flCompleteTimeout=window.setTimeout(function(){n.runContenModules(a,null,null,-1),a.animationComplete.call(t[0],a,null,null),r()},o+a.speed))):r()}},o={stylePrefixes:"Webkit Moz O ms Khtml ".split(" "),domPrefixes:"-webkit- -moz- -o- -ms- -khtml- ".split(" "),browserPrefix:null,appendStyleProperties:function(t,i,a){for(var n=0;n<=i.length-1;n++)t[e.trim(this.browserPrefix+i[n])]=a[n],t[e.trim(i[n])]=a[n];return t},applyStyleValue:function(t,i,a){return t[e.trim(this.browserPrefix+i)]=a,t[i]=a,t},getBrowserPrefix:function(){if(null==this.browserPrefix){for(var e="",t=0;t<=this.domPrefixes.length-1;t++)"undefined"!=typeof document.body.style[this.domPrefixes[t]+"transform"]&&(e=this.domPrefixes[t]);return this.browserPrefix=e}return this.browserPrefix},shuffleArray:function(e){for(var t=[];e.length;)t.push(e.splice(Math.random()*e.length,1));for(;t.length;)e.push(t.pop());return e}},s={moduleName:"custom",customSwap:{data:{customDoSwapFront:function(){return!1},customDoSwapBack:function(){return!1},customGetContent:function(){return null}},initData:function(t){var i={};i.doSwapFront=e.inArray("custom",t.swapFront)>-1&&t.customDoSwapFront(),i.doSwapBack=e.inArray("custom",t.swapBack)>-1&&t.customDoSwapBack(),"undefined"!=typeof t.customSwap?t.customSwap=e.extend(i,t.customSwap):t.customSwap=i},action:function(){}},htmlSwap:{moduleName:"html",data:{frontContent:[],frontIsRandom:!0,frontIsInGrid:!1,backContent:[],backIsRandom:!0,backIsInGrid:!1},initData:function(t,i){var a={backBag:[],backIndex:0,backStaticIndex:0,backStaticRndm:-1,prevBackIndex:-1,frontBag:[],frontIndex:0,frontStaticIndex:0,frontStaticRndm:-1,prevFrontIndex:-1};t.ignoreDataAttributes?(a.frontIsRandom=t.frontIsRandom,a.frontIsInGrid=t.frontIsInGrid,a.backIsRandom=t.backIsRandom,a.backIsInGrid=t.backIsInGrid):(a.frontIsRandom=n.getDataOrDefault(i,"front-israndom",t.frontIsRandom),a.frontIsInGrid=n.getDataOrDefault(i,"front-isingrid",t.frontIsInGrid),a.backIsRandom=n.getDataOrDefault(i,"back-israndom",t.backIsRandom),a.backIsInGrid=n.getDataOrDefault(i,"back-isingrid",t.backIsInGrid)),a.doSwapFront=e.inArray("html",t.swapFront)>-1&&t.frontContent instanceof Array&&t.frontContent.length>0,a.doSwapBack=e.inArray("html",t.swapBack)>-1&&t.backContent instanceof Array&&t.backContent.length>0,"undefined"!=typeof t.htmlSwap?t.htmlSwap=e.extend(a,t.htmlSwap):t.htmlSwap=a,t.htmlSwap.doSwapFront&&(t.htmlSwap.frontBag=this.prepBag(t.htmlSwap.frontBag,t.frontContent,t.htmlSwap.prevFrontIndex),t.htmlSwap.frontStaticRndm=t.htmlSwap.frontBag.pop()),t.htmlSwap.doSwapBack&&(t.htmlSwap.backBag=this.prepBag(t.htmlSwap.backBag,t.backContent,t.htmlSwap.prevBackIndex),t.htmlSwap.backStaticRndm=t.htmlSwap.backBag.pop())},prepBag:function(e,t,i){e=e||[];for(var a=0,n=0;n<t.length;n++)n==i&&1!==e.length||(e[a]=n,a++);return o.shuffleArray(e)},getFrontSwapIndex:function(e){var t=0;return e.htmlSwap.frontIsRandom?(0===e.htmlSwap.frontBag.length&&(e.htmlSwap.frontBag=this.prepBag(e.htmlSwap.frontBag,e.frontContent,e.htmlSwap.prevFrontIndex)),t=e.htmlSwap.frontIsInGrid?e.htmlSwap.frontStaticRndm:e.htmlSwap.frontBag.pop()):t=e.htmlSwap.frontIsInGrid?e.htmlSwap.frontStaticIndex:e.htmlSwap.frontIndex,t},getBackSwapIndex:function(e){var t=0;return e.htmlSwap.backIsRandom?(0===e.htmlSwap.backBag.length&&(e.htmlSwap.backBag=this.prepBag(e.htmlSwap.backBag,e.backContent,e.htmlSwap.prevBackIndex)),t=e.htmlSwap.backIsInGrid?e.htmlSwap.backStaticRndm:e.htmlSwap.backBag.pop()):t=e.htmlSwap.backIsInGrid?e.htmlSwap.backStaticIndex:e.htmlSwap.backIndex,t},action:function(e,t,i,a){if(e.htmlSwap.doSwapFront||e.htmlSwap.doSwapBack){var n="flip-list"===e.mode,o=0,s=n?e.listData[Math.max(a,0)].isReversed:e.isReversed;if(n&&-1==a)s?e.htmlSwap.doSwapBack&&(0===e.htmlSwap.backBag.length&&(e.htmlSwap.backBag=this.prepBag(e.htmlSwap.backBag,e.backContent,e.htmlSwap.backStaticRndm)),e.htmlSwap.backStaticRndm=e.htmlSwap.backBag.pop(),e.htmlSwap.backStaticIndex++,e.htmlSwap.backStaticIndex>=e.backContent.length&&(e.htmlSwap.backStaticIndex=0)):e.htmlSwap.doSwapFront&&(0===e.htmlSwap.frontBag.length&&(e.htmlSwap.frontBag=this.prepBag(e.htmlSwap.frontBag,e.frontContent,e.htmlSwap.frontStaticRndm)),e.htmlSwap.frontStaticRndm=e.htmlSwap.frontBag.pop(),e.htmlSwap.frontStaticIndex++,e.htmlSwap.frontStaticIndex>=e.frontContent.length&&(e.htmlSwap.frontStaticIndex=0));else if(s){if(!e.htmlSwap.doSwapBack)return;o=this.getBackSwapIndex(e),e.htmlSwap.prevBackIndex=o,i.html(e.backContent[e.htmlSwap.backIndex]),e.htmlSwap.backIndex++,e.htmlSwap.backIndex>=e.backContent.length&&(e.htmlSwap.backIndex=0),n||(e.htmlSwap.backStaticIndex++,e.htmlSwap.backStaticIndex>=e.backContent.length&&(e.htmlSwap.backStaticIndex=0))}else{if(!e.htmlSwap.doSwapFront)return;o=this.getFrontSwapIndex(e),e.htmlSwap.prevFrontIndex=o,"slide"===e.mode?e.startNow?i.html(e.frontContent[o]):t.html(e.frontContent[o]):i.html(e.frontContent[o]),e.htmlSwap.frontIndex++,e.htmlSwap.frontIndex>=e.frontContent.length&&(e.htmlSwap.frontIndex=0),n||(e.htmlSwap.frontStaticIndex++,e.htmlSwap.frontStaticIndex>=e.frontContent.length&&(e.htmlSwap.frontStaticIndex=0))}}}},imageSwap:{moduleName:"image",data:{preloadImages:!1,imageCssSelector:">img,>a>img",fadeSwap:!1,frontImages:[],frontIsRandom:!0,frontIsBackgroun
13dImage:!1,frontIsInGrid:!1,backImages:null,backIsRandom:!0,backIsBackgroundImage:!1,backIsInGrid:!1},initData:function(t,i){var a={backBag:[],backIndex:0,backStaticIndex:0,backStaticRndm:-1,frontBag:[],frontIndex:0,frontStaticIndex:0,frontStaticRndm:-1,prevBackIndex:-1,prevFrontIndex:-1};t.ignoreDataAttributes?(a.imageCssSelector=n.getDataOrDefault(i,"image-css",t.imageCssSelector),a.fadeSwap=n.getDataOrDefault(i,"fadeswap",t.fadeSwap),a.frontIsRandom=n.getDataOrDefault(i,"front-israndom",t.frontIsRandom),a.frontIsInGrid=n.getDataOrDefault(i,"front-isingrid",t.frontIsInGrid),a.frontIsBackgroundImage=n.getDataOrDefault(i,"front-isbg",t.frontIsBackgroundImage),a.backIsRandom=n.getDataOrDefault(i,"back-israndom",t.backIsRandom),a.backIsInGrid=n.getDataOrDefault(i,"back-isingrid",t.backIsInGrid),a.backIsBackgroundImage=n.getDataOrDefault(i,"back-isbg",t.backIsBackgroundImage),a.doSwapFront=e.inArray("image",t.swapFront)>-1&&t.frontImages instanceof Array&&t.frontImages.length>0,a.doSwapBack=e.inArray("image",t.swapBack)>-1&&t.backImages instanceof Array&&t.backImages.length>0,a.alwaysSwapFront=n.getDataOrDefault(i,"front-alwaysswap",t.alwaysSwapFront),a.alwaysSwapBack=n.getDataOrDefault(i,"back-alwaysswap",t.alwaysSwapBack)):(a.imageCssSelector=t.imageCssSelector,a.fadeSwap=t.fadeSwap,a.frontIsRandom=t.frontIsRandom,a.frontIsInGrid=t.frontIsInGrid,a.frontIsBackgroundImage=t.frontIsBackgroundImage,a.backIsRandom=t.backIsRandom,a.backIsInGrid=t.backIsInGrid,a.backIsBackgroundImage=t.backIsBackgroundImage,a.doSwapFront=e.inArray("image",t.swapFront)>-1&&t.frontImages instanceof Array&&t.frontImages.length>0,a.doSwapBack=e.inArray("image",t.swapBack)>-1&&t.backImages instanceof Array&&t.backImages.length>0,a.alwaysSwapFront=t.alwaysSwapFront,a.alwaysSwapBack=t.alwaysSwapBack),"undefined"!=typeof t.imgSwap?t.imgSwap=e.extend(a,t.imgSwap):t.imgSwap=a,t.imgSwap.doSwapFront&&(t.imgSwap.frontBag=this.prepBag(t.imgSwap.frontBag,t.frontImages,t.imgSwap.prevFrontIndex),t.imgSwap.frontStaticRndm=t.imgSwap.frontBag.pop(),t.preloadImages&&e(t.frontImages).metrojs.preloadImages(function(){})),t.imgSwap.doSwapBack&&(t.imgSwap.backBag=this.prepBag(t.imgSwap.backBag,t.backImages,t.imgSwap.prevBackIndex),t.imgSwap.backStaticRndm=t.imgSwap.backBag.pop(),t.preloadImages&&e(t.backImages).metrojs.preloadImages(function(){}))},prepBag:function(e,t,i){e=e||[];for(var a=0,n=0;n<t.length;n++)n==i&&1!==t.length||(e[a]=n,a++);return o.shuffleArray(e)},getFrontSwapIndex:function(e){var t=0;return e.imgSwap.frontIsRandom?(0===e.imgSwap.frontBag.length&&(e.imgSwap.frontBag=this.prepBag(e.imgSwap.frontBag,e.frontImages,e.imgSwap.prevFrontIndex)),t=e.imgSwap.frontIsInGrid?e.imgSwap.frontStaticRndm:e.imgSwap.frontBag.pop()):t=e.imgSwap.frontIsInGrid?e.imgSwap.frontStaticIndex:e.imgSwap.frontIndex,t},getBackSwapIndex:function(e){var t=0;return e.imgSwap.backIsRandom?(0===e.imgSwap.backBag.length&&(e.imgSwap.backBag=this.prepBag(e.imgSwap.backBag,e.backImages,e.imgSwap.prevBackIndex)),t=e.imgSwap.backIsInGrid?e.imgSwap.backStaticRndm:e.imgSwap.backBag.pop()):t=e.imgSwap.backIsInGrid?e.imgSwap.backStaticIndex:e.imgSwap.backIndex,t},setImageProperties:function(t,i,a){var n={},o={};"undefined"!=typeof i.src&&(a?n.backgroundImage="url('"+i.src+"')":o.src=i.src),"undefined"!=typeof i.alt&&(o.alt=i.alt),"object"==typeof i.css?t.css(e.extend(n,i.css)):t.css(n),"object"==typeof i.attr?t.attr(e.extend(o,i.attr)):t.attr(o)},action:function(e,t,i,a){if(e.imgSwap.doSwapFront||e.imgSwap.doSwapBack){var n,o,r,l,d="flip-list"===e.mode,c=(e.mode,0),u=d?e.listData[Math.max(a,0)].isReversed:e.isReversed;if(d&&-1==a)return!e.alwaysSwapFront&&u||e.imgSwap.doSwapFront&&(0===e.imgSwap.frontBag.length&&(e.imgSwap.frontBag=this.prepBag(e.imgSwap.frontBag,e.frontImages,e.imgSwap.frontStaticRndm)),e.imgSwap.frontStaticRndm=e.imgSwap.frontBag.pop(),e.imgSwap.frontStaticIndex++,e.imgSwap.frontStaticIndex>=e.frontImages.length&&(e.imgSwap.frontStaticIndex=0)),void((e.alwaysSwapBack||u)&&e.imgSwap.doSwapBack&&(0===e.imgSwap.backBag.length&&(e.imgSwap.backBag=this.prepBag(e.imgSwap.backBag,e.backImages,e.imgSwap.backStaticRndm)),e.imgSwap.backStaticRndm=e.imgSwap.backBag.pop(),e.imgSwap.backStaticIndex++,e.imgSwap.backStaticIndex>=e.backImages.length&&(e.imgSwap.backStaticIndex=0)));if(e.alwaysSwapFront||!u){if(!e.imgSwap.doSwapFront)return;c=this.getFrontSwapIndex(e),e.imgSwap.prevFrontIndex=c,n="slide"===e.mode?t:i,o=n.find(e.imgSwap.imageCssSelector),r="object"==typeof e.frontImages[c]?e.frontImages[c]:{src:e.frontImages[c]}
13,l=function(t){var i=e.imgSwap.frontIsBackgroundImage;"function"==typeof t&&(i?window.setTimeout(t,100):o[0].onload=t),s.imageSwap.setImageProperties(o,r,i)},e.fadeSwap?o.fadeOut(function(){l(function(){o.fadeIn()})}):l(),e.imgSwap.frontIndex++,e.imgSwap.frontIndex>=e.frontImages.length&&(e.imgSwap.frontIndex=0),d||(e.imgSwap.frontStaticIndex++,e.imgSwap.frontStaticIndex>=e.frontImages.length&&(e.imgSwap.frontStaticIndex=0))}if(e.alwaysSwapBack||u){if(!e.imgSwap.doSwapBack)return;c=this.getBackSwapIndex(e),e.imgSwap.prevBackIndex=c,o=(n=i).find(e.imgSwap.imageCssSelector),r="object"==typeof e.backImages[c]?e.backImages[c]:{src:e.backImages[c]},l=function(){s.imageSwap.setImageProperties(o,r,e.imgSwap.backIsBackgroundImage)},e.fadeSwap?o.fadeOut(function(){l(function(){o.fadeIn()})}):l(),e.imgSwap.backIndex++,e.imgSwap.backIndex>=e.backImages.length&&(e.imgSwap.backIndex=0),d||(e.imgSwap.backStaticIndex++,e.imgSwap.backStaticIndex>=e.backImages.length&&(e.imgSwap.backStaticIndex=0))}}}}};e.fn.metrojs.TileTimer=function(e,t,a){this.timerId=null,this.interval=e,this.action=t,this.count=0,this.repeatCount=void 0===a?0:a,this.start=function(t){window.clearTimeout(this.timerId);var i=this;this.timerId=window.setTimeout(function(){i.tick.call(i,e)},t)},this.tick=function(e){this.action(this.count+1),this.count++,this.count>=i&&(this.count=0),(this.repeatCount>0||-1==this.repeatCount)&&(this.count!=this.repeatCount?this.start(e):this.stop())},this.stop=function(){this.timerId=window.clearTimeout(this.timerId),this.reset()},this.resume=function(){(this.repeatCount>0||-1==this.repeatCount)&&this.count!=this.repeatCount&&this.start(e)},this.pause=function(){this.timerId=window.clearTimeout(this.timerId)},this.reset=function(){this.count=0},this.restart=function(e){this.stop(),this.start(e)}},jQuery.fn.metrojs.theme={loadDefaultTheme:function(e){if(void 0===e||null==e)e=jQuery.fn.metrojs.theme.defaults;else{var t=jQuery.fn.metrojs.theme.defaults;jQuery.extend(t,e),e=t}var i="undefined"!=typeof window.localStorage,a=function(e){return"undefined"!=typeof window.localStorage[e]&&null!=window.localStorage[e]};!i||a("Metro.JS.AccentColor")&&a("Metro.JS.BaseAccentColor")?i?(e.accentColor=window.localStorage["Metro.JS.AccentColor"],e.baseTheme=window.localStorage["Metro.JS.BaseAccentColor"],jQuery(e.accentCssSelector).addClass(e.accentColor).data("accent",e.accentColor),jQuery(e.baseThemeCssSelector).addClass(e.baseTheme),"function"==typeof e.loaded&&e.loaded(e.baseTheme,e.accentColor)):(jQuery(e.accentCssSelector).addClass(e.accentColor).data("accent",e.accentColor),jQuery(e.baseThemeCssSelector).addClass(e.baseTheme),"function"==typeof e.loaded&&e.loaded(e.baseTheme,e.accentColor),"undefined"!=typeof e.preloadAltBaseTheme&&e.preloadAltBaseTheme&&jQuery(["dark"==e.baseTheme?e.metroLightUrl:e.metroDarkUrl]).metrojs.preloadImages(function(){})):(window.localStorage["Metro.JS.AccentColor"]=e.accentColor,window.localStorage["Metro.JS.BaseAccentColor"]=e.baseTheme,jQuery(e.accentCssSelector).addClass(e.accentColor).data("accent",e.accentColor),jQuery(e.baseThemeCssSelector).addClass(e.baseTheme),"function"==typeof e.loaded&&e.loaded(e.baseTheme,e.accentColor),"undefined"!=typeof e.preloadAltBaseTheme&&e.preloadAltBaseTheme&&jQuery(["dark"==e.baseTheme?e.metroLightUrl:e.metroDarkUrl]).metrojs.preloadImages(function(){}))},applyTheme:function(e,t,i){if(void 0===i||null==i)i=jQuery.fn.metrojs.theme.defaults;else{var a=jQuery.fn.metrojs.theme.defaults;i=jQuery.extend({},a,i)}if(void 0!==e&&null!=e){"undefined"!=typeof window.localStorage&&(window.localStorage["Metro.JS.BaseAccentColor"]=e);var n=jQuery(i.baseThemeCssSelector);n.length>0&&("dark"==e?n.addClass("dark").removeClass("light"):"light"==e&&n.addClass("light").removeClass("dark"))}if(void 0!==t&&null!=t){"undefined"!=typeof window.localStorage&&(window.localStorage["Metro.JS.AccentColor"]=t);var o=jQuery(i.accentCssSelector);if(o.length>0){var s=!1;o.each(function(){jQuery(this).addClass(t);var e=jQuery(this).data("accent");if(e!=t){var i=jQuery(this).attr("class").replace(e,"");i=i.replace(/(\s)+/," "),jQuery(this).attr("class",i),jQuery(this).data("accent",t),s=!0}}),s&&"function"==typeof i.accentPicked&&i.accentPicked(t)}}},appendAccentColors:function(t){if(void 0===t||null==t)t=jQuery.fn.metrojs.theme.defaults;else{var i=jQuery.fn.metrojs.theme.defaults;t=jQuery.extend({},i,t)}for(var a="",n=t.accentColors,o=t.accentListTemplate,s=0;s<n.length;s++)a+=o.replace(/\{0\}/g,n[s]);e(a).appendTo(t.accentListContainer)},appendBaseThemes:function(t){if(void 0===t||null==t)t=jQuery.fn.metrojs.theme.defaults;else{var i=jQuery.fn.metrojs.theme.defaults;t=jQuery.extend({},i,t)}for(var a="",n=t.baseThemes,o=t.baseThemeListTemplate,s=0;s<n.length;s++)a+=o.replace(/\{0\}/g,n[s]);e(a).appendTo(t.baseThemeListContainer)},defaults:{baseThemeCssSelector:"body",accentCssSelector:".tiles",accentColor:"blue",baseTheme:"dark",accentColors:["amber","blue","brown","cobalt","crimson","cyan","magenta","lime","indigo","green","emerald","mango","mauve","olive","orange","pink","red","sienna","steel","teal","violet","yellow"],baseThemes:["light","dark"],accentListTemplate:"<li><a href='javascript:;' title='{0}' class='accent {0}'></a></li>",accentListContainer:"ul.theme-options,.theme-options>ul",baseThemeListTemplate:"<li><a href='javascript:;' title='{0}' class='accent {0}'></a></li>",baseThemeListContainer:"ul.base-theme-options,.base-theme-options>ul"}},jQuery.fn.applicationBar=function(t){var i="undefined"!=typeof jQuery.fn.metrojs.theme?jQuery.fn.metrojs.theme.defaults:{};if(jQuery.extend(i,jQuery.fn.applicationBar.defaults,t),"undefined"!=typeof jQuery.fn.metrojs.theme){var a=jQuery.fn.metrojs.theme;i.shouldApplyTheme&&a.loadDefaultTheme(i);var n=i.accentListContainer.replace(","," a,")+" a",o=function(){var e=jQuery(this).attr("class").replace("accent","").replace(" ","");a.applyTheme(null,e,i),"function"==typeof i.accentPicked&&i.accentPicked(e)},s=i.baseThemeListContainer.replace(","," a,")+" a",r=function(){var e=jQuery(this).attr("class").replace("accent","").replace(" ","");a.applyTheme(e,null,i),"function"==typeof i.themePicked&&i.themePicked(e)};"function"==typeof e.fn.on?(e(this).on("click.appBar",n,o),e(this).on("click.appBar",s,r)):(e(n).live("click.appBar",o),e(s).live("click.appBar",r))}return e(this).each(function(t,a){var n=e(a),o=e.extend({},i);"auto"==o.collapseHeight&&(o.collapseHeight=e(this).height()),navigator.userAgent.match(/(Android|webOS|iPhone|iPod|BlackBerry|PIE|IEMobile)/i)&&(navigator.userAgent.match(/(IEMobile\/1)/i)||navigator.userAgent.match(/(iPhone OS [56789])/i)||n.css({position:"absolute",bottom:"0px"})),o.slideOpen=function(){n.hasClass("expanded")||o.animateAppBar(!1)},o.slideClosed=function(){n.hasClass("expanded")&&o.animateAppBar(!0)},o.animateAppBar=function(e){var t=e?o.collapseHeight:o.expandHeight;e?n.removeClass("expanded"):n.hasClass("expanded")||n.addClass("expanded"),n.stop().animate({height:t},{duration:o.duration})},n.data("ApplicationBar",o),n.find(i.handleSelector).click(function(){o.animateAppBar(n.hasClass("expanded"))}),1==o.bindKeyboard&&jQuery(document.documentElement).keyup(function(e){38==e.keyCode?e.target&&null==e.target.tagName.match(/INPUT|TEXTAREA|SELECT/i)&&(n.hasClass("expanded")||o.animateAppBar(!1)):40==e.keyCode&&e.target&&null==e.target.tagName.match(/INPUT|TEXTAREA|SELECT/i)&&n.hasClass("expanded")&&o.animateAppBar(!0)})})},jQuery.fn.applicationBar.defaults={applyTheme:!0,themePicked:function(){},accentPicked:function(){},loaded:function(){},duration:300,expandHeight:"320px",collapseHeight:"auto",bindKeyboard:!0,handleSelector:"a.etc",metroLightUrl:"images/metroIcons_light.jpg",metroDarkUrl:"images/metroIcons.jpg",preloadAltBaseTheme:!1},e.fn.metrojs.preloadImages=function(t){var i=e(this).toArray(),a=e("<img style='display:none;' />").appendTo("body");e(this).each(function(){var e=this;"object"==typeof this&&(e=this.src),a.attr({src:e}).load(function(){for(var e=0;e<i.length;e++)i[e]==element&&i.splice(e,1);0==i.length&&t()})}),a.remove()},e.fn.metrojs.MetroModernizr=function(t){if(void 0===t&&(t={useHardwareAccel:!0,useModernizr:"undefined"!=typeof window.Modernizr}),this.isOldJQuery=/^1\.[0123]/.test(e.fn.jquery),this.isOldAndroid=function(){try{var t=navigator.userAgent;if(t.indexOf("Android")>=0)if(parseFloat(t.slice(t.indexOf("Android")+8))<2.3)return!0}catch(i){e.error(i)}return!1}(),this.canTransform=!1,this.canTransition=!1,this.canTransform3d=!1,this.canAnimate=!1,this.canTouch=!1,this.canFlip3d=t.useHardwareAccel,1==t.useHardwareAccel)if(0==t.useModernizr)if("undefined"!=typeof window.MetroModernizr)this.canTransform=window.MetroModernizr.canTransform,this.canTransition=window.MetroModernizr.canTransition,this.canTransform3d=window.MetroModernizr.canTransform3d,this.canAnimate=window.MetroModernizr.canAnimate,this.canTouch=window.MetroModernizr.canTouch;else{window.MetroModernizr={};var i="metromodernizr",a=document.documentElement,n=document.head||document.getElementsByTagName("head")[0],o=document.createElement(i),s=o.style,r=" -webkit- -moz- -o- -ms- ".split(" "),l="Webkit Moz O ms Khtml".split(" "),d=function(e,t){for(var i in e)if(s[e[i]]!==undefined&&(!t||t(e[i],o)))return!0},c=function(e,t){var i=e.charAt(0).toUpperCase()+e.substr(1),a=(e+" "+l.join(i+" ")+i).split(" ");return!!d(a,t)},u=function(){var e=!!d(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);return e&&"webkitPerspective"in a.style&&(e=p(["@media (",r.join("transform-3d),("),i,")","{#metromodernizr{left:9px;position:absolute;height:3px;}}"].join(""),function(e){return 3===e.offsetHeight&&9===e.offsetLeft})),e},p=function(e,t){var o,s=document.createElement("style"),r=document.createElement("div");return s.textContent=e,n.appendChild(s),r.id=i,a.appendChild(r),o=t(r),s.parentNode.removeChild(s),r.parentNode.removeChild(r),!!o},h=function(){return canTouch="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch||"undefined"!=typeof window.navigator.msMaxTouchPoints&&window.navigator.msMaxTouchPoints>0||p(["@media (",r.join("touch-enabled),("),i,")","{#metromodernizr{top:9px;position:absolute}}"].join(""),function(e){return 9===e.offsetTop})};this.canTransform=!!d(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"]),this.canTransition=c("transitionProperty"),this.canTransform3d=u(),this.canAnimate=c("animationName"),this.canTouch=h(),window.MetroModernizr.canTransform=this.canTransform,window.MetroModernizr.canTransition=this.canTransition,window.MetroModernizr.canTransform3d=this.canTransform3d,window.MetroModernizr.canAnimate=this.canAnimate,window.MetroModernizr.canTouch=this.canTouch,a=null,n=null,o=null,s=null}else this.canTransform=e("html").hasClass("csstransforms"),this.canTransition=e("html").hasClass("csstransitions"),this.canTransform3d=e("html").hasClass("csstransforms3d"),this.canAnimate=e("html").hasClass("cssanimations"),this.canTouch=e("html").hasClass("touch")||"undefined"!=typeof window.navigator.msMaxTouchPoints&&window.navigator.msMaxTouchPoints>0;this.canFlip3d=this.canFlip3d&&this.canAnimate&&this.canTransform&&this.canTransform3d}}(jQuery);const DateTimePicker=((e,t)=>{const i="datetimepicker",a=`${i}`,n=`.${a}`,o=".data-api",s={DATA_TOGGLE:`[data-toggle="${a}"]`},r={INPUT:`${i}-input`},l={CHANGE:`change${n}`,BLUR:`blur${n}`,KEYUP:`keyup${n}`,KEYDOWN:`keydown${n}`,FOCUS:`focus${n}`,CLICK_DATA_API:`click${n}${o}`,UPDATE:`update${n}`,ERROR:`error${n}`,HIDE:`hide${n}`,SHOW:`show${n}`},d=[{CLASS_NAME:"days",NAV_FUNCTION:"M",NAV_STEP:1},{CLASS_NAME:"months",NAV_FUNCTION:"y",NAV_STEP:1},{CLASS_NAME:"years",NAV_FUNCTION:"y",NAV_STEP:10},{CLASS_NAME:"decades",NAV_FUNCTION:"y",NAV_STEP:100}],c={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t","delete":46,46:"delete"},u=["times","days","months","years","decades"],p={},h={};let m={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,
13collapse:!0,locale:t.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"fa fa-clock-o",date:"fa fa-calendar",up:"fa fa-arrow-up",down:"fa fa-arrow-down",previous:"fa fa-chevron-left",next:"fa fa-chevron-right",today:"fa fa-calendar-check-o",clear:"fa fa-delete",close:"fa fa-times"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time",selectDate:"Select Date"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",buttons:{showToday:!1,showClear:!1,showClose:!1},widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,keyBinds:{up:function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().subtract(7,"d")):this.date(e.clone().add(this.stepping(),"m")),!0},down:function(){if(!this.widget)return this.show(),!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().add(7,"d")):this.date(e.clone().subtract(this.stepping(),"m")),!0},"control up":function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().subtract(1,"y")):this.date(e.clone().add(1,"h")),!0},"control down":function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")?this.date(e.clone().add(1,"y")):this.date(e.clone().subtract(1,"h")),!0},left:function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"d")),!0},right:function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"d")),!0},pageUp:function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().subtract(1,"M")),!0},pageDown:function(){if(!this.widget)return!1;const e=this._dates[0]||this.getMoment();return this.widget.find(".datepicker").is(":visible")&&this.date(e.clone().add(1,"M")),!0},enter:function(){return!!this.widget&&(this.hide(),!0)},escape:function(){return!!this.widget&&(this.hide(),!0)},"control space":function(){return!!this.widget&&(this.widget.find(".timepicker").is(":visible")&&this.widget.find('.btn[data-action="togglePeriod"]').click(),!0)},t:function(){return!!this.widget&&(this.date(this.getMoment()),!0)},"delete":function(){return!!this.widget&&(this.clear(),!0)}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1,allowMultidate:!1,multidateSeparator:","};class f{constructor(e,t){this._options=this._getOptions(t),this._element=e,this._dates=[],this._datesFormatted=[],this._viewDate=null,this.unset=!0,this.component=!1,this.widget=!1,this.use24Hours=null,this.actualFormat=null,this.parseFormats=null,this.currentViewMode=null,this.MinViewModeNumber=0,this._int()}static get NAME(){return i}static get DATA_KEY(){return a}static get EVENT_KEY(){return n}static get DATA_API_KEY(){return o}static get DatePickerModes(){return d}static get ViewModes(){return u}static get Event(){return l}static get Selector(){return s}static get Default(){return m}static set Default(e){m=e}static get ClassName(){return r}_int(){const t=this._element.data("target-input");this._element.is("input")?this.input=this._element:t!==undefined&&(this.input="nearest"===t?this._element.find("input"):e(t)),this._dates=[],this._dates[0]=this.getMoment(),this._viewDate=this.getMoment().clone(),e.extend(!0,this._options,this._dataToOptions()),this.options(this._options),this._initFormatting(),this.input!==undefined&&this.input.is("input")&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this._options.defaultDate&&this.input!==undefined&&this.input.attr("placeholder")===undefined&&this._setValue(this._options.defaultDate,0),this._options.inline&&this.show()}
13_update(){this.widget&&(this._fillDate(),this._fillTime())}_setValue(e,t){const i=this.unset?null:this._dates[t];let a="";if(!e)return this._options.allowMultidate&&1!==this._dates.length?(a=(a=`${this._element.data("date")},`).replace(`${i.format(this.actualFormat)},`,"").replace(",,","").replace(/,\s*$/,""),this._dates.splice(t,1),this._datesFormatted.splice(t,1)):(this.unset=!0,this._dates=[],this._dates[0]=this.getMoment(),this._viewDate=this.getMoment().locale(this._options.locale).clone(),this._datesFormatted=[]),this.input!==undefined&&(this.input.val(a),this.input.trigger("input")),this._element.data("date",a),this._notifyEvent({type:f.Event.CHANGE,date:!1,oldDate:i}),void this._update();if(e=e.clone().locale(this._options.locale),this._hasTimeZone()&&e.tz(this._options.timeZone),1!==this._options.stepping&&e.minutes(Math.round(e.minutes()/this._options.stepping)*this._options.stepping).seconds(0),this._isValid(e)){if(this._dates[t]=e,this._datesFormatted[t]=e.format("YYYY-MM-DD"),this._viewDate=e.clone(),this._options.allowMultidate&&this._dates.length>1){for(let e=0;e<this._dates.length;e++)a+=`${this._dates[e].format(this.actualFormat)}${this._options.multidateSeparator}`;a=a.replace(/,\s*$/,"")}else a=this._dates[t].format(this.actualFormat);this.input!==undefined&&(this.input.val(a),this.input.trigger("input")),this._element.data("date",a),this.unset=!1,this._update(),this._notifyEvent({type:f.Event.CHANGE,date:this._dates[t].clone(),oldDate:i})}else this._options.keepInvalid?this._notifyEvent({type:f.Event.CHANGE,date:e,oldDate:i}):this.input!==undefined&&(this.input.val(`${this.unset?"":this._dates[t].format(this.actualFormat)}`),this.input.trigger("input")),this._notifyEvent({type:f.Event.ERROR,date:e,oldDate:i})}_change(t){const i=e(t.target).val().trim(),a=i?this._parseInputDate(i):null;return this._setValue(a),t.stopImmediatePropagation(),!1}_getOptions(t){return t=e.extend(!0,{},m,t)}_hasTimeZone(){return t.tz!==undefined&&this._options.timeZone!==undefined&&null!==this._options.timeZone&&""!==this._options.timeZone}_isEnabled(e){if("string"!=typeof e||e.length>1)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==this.actualFormat.indexOf("Y");case"M":return-1!==this.actualFormat.indexOf("M");case"d":return-1!==this.actualFormat.toLowerCase().indexOf("d");case"h":case"H":return-1!==this.actualFormat.toLowerCase().indexOf("h");case"m":return-1!==this.actualFormat.indexOf("m");case"s":return-1!==this.actualFormat.indexOf("s");case"a":case"A":return-1!==this.actualFormat.toLowerCase().indexOf("a");default:return!1}}_hasTime(){return this._isEnabled("h")||this._isEnabled("m")||this._isEnabled("s")}
13_hasDate(){
14return this._isEnabled("y")||this._isEnabled("M")||this._isEnabled("d")}_dataToOptions(){const t=this._element.is("input")||this._options.inline?this._element.data():this._element.find("input").data();let i={};return t.dateOptions&&t.dateOptions instanceof Object&&(i=e.extend(!0,i,t.dateOptions)),e.each(this._options,function(e){const a=`date${e.charAt(0).toUpperCase()}${e.slice(1)}`;t[a]!==undefined?i[e]=t[a]:delete i[e]}),i}_notifyEvent(e){e.type===f.Event.CHANGE&&e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate||this._element.trigger(e)}_viewUpdate(e){"y"===e&&(e="YYYY"),this._notifyEvent({type:f.Event.UPDATE,change:e,viewDate:this._viewDate.clone()})}_showMode(e){this.widget&&(e&&(this.currentViewMode=Math.max(this.MinViewModeNumber,Math.min(3,this.currentViewMode+e))),this.widget.find(".datepicker > div").hide().filter(`.datepicker-${d[this.currentViewMode].CLASS_NAME}`).show())}_isInDisabledDates(e){return!0===this._options.disabledDates[e.format("YYYY-MM-DD")]}_isInEnabledDates(e){return!0===this._options.enabledDates[e.format("YYYY-MM-DD")]}_isInDisabledHours(e){return!0===this._options.disabledHours[e.format("H")]}_isInEnabledHours(e){return!0===this._options.enabledHours[e.format("H")]}_isValid(t,i){if(!t.isValid())return!1;if(this._options.disabledDates&&"d"===i&&this._isInDisabledDates(t))return!1;if(this._options.enabledDates&&"d"===i&&!this._isInEnabledDates(t))return!1;if(this._options.minDate&&t.isBefore(this._options.minDate,i))return!1;if(this._options.maxDate&&t.isAfter(this._options.maxDate,i))return!1;if(this._options.daysOfWeekDisabled&&"d"===i&&-1!==this._options.daysOfWeekDisabled.indexOf(t.day()))return!1;if(this._options.disabledHours&&("h"===i||"m"===i||"s"===i)&&this._isInDisabledHours(t))return!1;if(this._options.enabledHours&&("h"===i||"m"===i||"s"===i)&&!this._isInEnabledHours(t))return!1;if(this._options.disabledTimeIntervals&&("h"===i||"m"===i||"s"===i)){let i=!1;if(e.each(this._options.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return i=!0,!1}),i)return!1}return!0}_parseInputDate(e){return this._options.parseInputDate===undefined?t.isMoment(e)||(e=this.getMoment(e)):e=this._options.parseInputDate(e),e}_keydown(e){let t,i,a,n,o=null;const s=[],r={},l=e.which,d="p";for(t in p[l]=d,p)p.hasOwnProperty(t)&&p[t]===d&&(s.push(t),parseInt(t,10)!==l&&(r[t]=!0));for(t in this._options.keyBinds)if(this._options.keyBinds.hasOwnProperty(t)&&"function"==typeof this._options.keyBinds[t]&&(a=t.split(" ")).length===s.length&&c[l]===a[a.length-1]){for(n=!0,i=a.length-2;i>=0;i--)if(!(c[a[i]]in r)){n=!1;break}if(n){o=this._options.keyBinds[t];break}}o&&o.call(this)&&(e.stopPropagation(),e.preventDefault())}_keyup(e){p[e.which]="r",h[e.which]&&(h[e.which]=!1,e.stopPropagation(),e.preventDefault())}_indexGivenDates(t){const i={},a=this;return e.each(t,function(){const e=a._parseInputDate(this);e.isValid()&&(i[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(i).length&&i}_indexGivenHours(t){const i={};return e.each(t,function(){i[this]=!0}),!!Object.keys(i).length&&i}_initFormatting(){const e=this._options.format||"L LT",t=this;this.actualFormat=e.replace(/(\[[^\[]*])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return t._dates[0].localeData().longDateFormat(e)||e}),this.parseFormats=this._options.extraFormats?this._options.extraFormats.slice():[],this.parseFormats.indexOf(e)<0&&this.parseFormats.indexOf(this.actualFormat)<0&&this.parseFormats.push(this.actualFormat),this.use24Hours=this.actualFormat.toLowerCase().indexOf("a")<1&&this.actualFormat.replace(/\[.*?]/g,"").indexOf("h")<1,this._isEnabled("y")&&(this.MinViewModeNumber=2),this._isEnabled("M")&&(this.MinViewModeNumber=1),this._isEnabled("d")&&(this.MinViewModeNumber=0),this.currentViewMode=Math.max(this.MinViewModeNumber,this.currentViewMode),this.unset||this._setValue(this._dates[0],0)}_getLastPickedDate(){return this._dates[this._getLastPickedDateIndex()]}_getLastPickedDateIndex(){return this._dates.length-1}getMoment(e){let i;return i=e===undefined||null===e?t():this._hasTimeZone()?t.tz(e,this.parseFormats,this._options.locale,this._options.useStrict,this._options.timeZone):t(e,this.parseFormats,this._options.locale,this._options.useStrict),this._hasTimeZone()&&i.tz(this._options.timeZone),i}toggle(){return this.widget?this.hide():this.show()}ignoreReadonly(e){if(0===arguments.length)return this._options.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");this._options.ignoreReadonly=e}options(t){if(0===arguments.length)return e.extend(!0,{},this._options);if(!(t instanceof Object))throw new TypeError("options() this.options parameter should be an object");e.extend(!0,this._options,t);const i=this;e.each(this._options,function(e,t){i[e]!==undefined&&i[e](t)})}date(e,i){if(i=i||0,0===arguments.length)return this.unset?null:this._options.allowMultidate?this._dates.join(this._options.multidateSeparator):this._dates[i].clone();if(!(null===e||"string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");this._setValue(null===e?null:this._parseInputDate(e),i)}format(e){if(0===arguments.length)return this._options.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError(`format() expects a string or boolean:false parameter ${e}`);this._options.format=e,this.actualFormat&&this._initFormatting()}timeZone(e){if(0===arguments.length)return this._options.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");this._options.timeZone=e}dayViewHeaderFormat(e){if(0===arguments.length)return this._options.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");this._options.dayViewHeaderFormat=e}extraFormats(e){if(0===arguments.length)return this._options.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");this._options.extraFormats=e,this.parseFormats&&this._initFormatting()}disabledDates(t){if(0===arguments.length)return this._options.disabledDates?e.extend({},this._options.disabledDates):this._options.disabledDates;if(!t)return this._options.disabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");this._options.disabledDates=this._indexGivenDates(t),this._options.enabledDates=!1,this._update()}enabledDates(t){if(0===arguments.length)return this._options.enabledDates?e.extend({},this._options.enabledDates):this._options.enabledDates;if(!t)return this._options.enabledDates=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");this._options.enabledDates=this._indexGivenDates(t),this._options.disabledDates=!1,this._update()}daysOfWeekDisabled(e){if(0===arguments.length)return this._options.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return this._options.daysOfWeekDisabled=!1,this._update(),!0;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(this._options.daysOfWeekDisabled=e.reduce(function(e,t){return(t=parseInt(t,10))>6||t<0||isNaN(t)?e:(-1===e.indexOf(t)&&e.push(t),e)},[]).sort(),this._options.useCurrent&&!this._options.keepInvalid)for(let e=0;e<this._dates.length;e++){let t=0;for(;!this._isValid(this._dates[e],"d");){if(this._dates[e].add(1,"d"),31===t)throw"Tried 31 times to find a valid date";t++}this._setValue(this._dates[e],e)}this._update()}maxDate(e){if(0===arguments.length)return this._options.maxDate?this._options.maxDate.clone():this._options.maxDate;if("boolean"==typeof e&&!1===e)return this._options.maxDate=!1,this._update(),!0;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=this.getMoment()));const t=this._parseInputDate(e);if(!t.isValid())throw new TypeError(`maxDate() Could not parse date parameter: ${e}`);if(this._options.minDate&&t.isBefore(this._options.minDate))throw new TypeError(`maxDate() date parameter is before this.options.minDate: ${t.format(this.actualFormat)}`);this._options.maxDate=t;for(let t=0;t<this._dates.length;t++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[t].isAfter(e)&&this._setValue(this._options.maxDate,t);this._viewDate.isAfter(t)&&(this._viewDate=t.clone().subtract(this._options.stepping,"m")),this._update()}minDate(e){if(0===arguments.length)return this._options.minDate?this._options.minDate.clone():this._options.minDate;if("boolean"==typeof e&&!1===e)return this._options.minDate=!1,this._update(),!0;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=this.getMoment()));const t=this._parseInputDate(e);
14if(!t.isValid())throw new TypeError(`minDate() Could not parse date parameter: ${e}`);if(this._options.maxDate&&t.isAfter(this._options.maxDate))throw new TypeError(`minDate() date parameter is after this.options.maxDate: ${t.format(this.actualFormat)}`);this._options.minDate=t;for(let t=0;t<this._dates.length;t++)this._options.useCurrent&&!this._options.keepInvalid&&this._dates[t].isBefore(e)&&this._setValue(this._options.minDate,t);this._viewDate.isBefore(t)&&(this._viewDate=t.clone().add(this._options.stepping,"m")),this._update()}defaultDate(e){if(0===arguments.length)return this._options.defaultDate?this._options.defaultDate.clone():this._options.defaultDate;if(!e)return this._options.defaultDate=!1,!0;"string"==typeof e&&(e="now"===e||"moment"===e?this.getMoment():this.getMoment(e));const t=this._parseInputDate(e);if(!t.isValid())throw new TypeError(`defaultDate() Could not parse date parameter: ${e}`);if(!this._isValid(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");this._options.defaultDate=t,(this._options.defaultDate&&this._options.inline||this.input!==undefined&&""===this.input.val().trim())&&this._setValue(this._options.defaultDate,0)}locale(e){if(0===arguments.length)return this._options.locale;if(!t.localeData(e))throw new TypeError(`locale() locale ${e} is not loaded from moment locales!`);this._options.locale=e;for(let e=0;e<this._dates.length;e++)this._dates[e].locale(this._options.locale);this._viewDate.locale(this._options.locale),this.actualFormat&&this._initFormatting(),this.widget&&(this.hide(),this.show())}stepping(e){if(0===arguments.length)return this._options.stepping;e=parseInt(e,10),(isNaN(e)||e<1)&&(e=1),this._options.stepping=e}useCurrent(e){const t=["year","month","day","hour","minute"];if(0===arguments.length)return this._options.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError(`useCurrent() expects a string parameter of ${t.join(", ")}`);this._options.useCurrent=e}collapse(e){if(0===arguments.length)return this._options.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");if(this._options.collapse===e)return!0;this._options.collapse=e,this.widget&&(this.hide(),this.show())}icons(t){if(0===arguments.length)return e.extend({},this._options.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");e.extend(this._options.icons,t),this.widget&&(this.hide(),this.show())}tooltips(t){if(0===arguments.length)return e.extend({},this._options.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");e.extend(this._options.tooltips,t),this.widget&&(this.hide(),this.show())}useStrict(e){if(0===arguments.length)return this._options.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");this._options.useStrict=e}sideBySide(e){if(0===arguments.length)return this._options.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");this._options.sideBySide=e,this.widget&&(this.hide(),this.show())}viewMode(e){if(0===arguments.length)return this._options.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===f.ViewModes.indexOf(e))throw new TypeError(`viewMode() parameter must be one of (${f.ViewModes.join(", ")}) value`);this._options.viewMode=e,this.currentViewMode=Math.max(f.ViewModes.indexOf(e)-1,this.MinViewModeNumber),this._showMode()}calendarWeeks(e){if(0===arguments.length)return this._options.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");this._options.calendarWeeks=e,this._update()}buttons(t){if(0===arguments.length)return e.extend({},this._options.buttons);if(!(t instanceof Object))throw new TypeError("buttons() expects parameter to be an Object");if(e.extend(this._options.buttons,t),"boolean"!=typeof this._options.buttons.showToday)throw new TypeError("buttons.showToday expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClear)throw new TypeError("buttons.showClear expects a boolean parameter");if("boolean"!=typeof this._options.buttons.showClose)throw new TypeError("buttons.showClose expects a boolean parameter");this.widget&&(this.hide(),this.show())}keepOpen(e){if(0===arguments.length)return this._options.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");this._options.keepOpen=e}focusOnShow(e){if(0===arguments.length)return this._options.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");this._options.focusOnShow=e}inline(e){if(0===arguments.length)return this._options.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");this._options.inline=e}clear(){this._setValue(null,this._getLastPickedDateIndex())}keyBinds(e){if(0===arguments.length)return this._options.keyBinds;this._options.keyBinds=e}debug(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");this._options.debug=e}allowInputToggle(e){if(0===arguments.length)return this._options.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");this._options.allowInputToggle=e}keepInvalid(e){if(0===arguments.length)return this._options.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");this._options.keepInvalid=e}datepickerInput(e){if(0===arguments.length)return this._options.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");this._options.datepickerInput=e}parseInputDate(e){if(0===arguments.length)return this._options.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() should be as function");this._options.parseInputDate=e}disabledTimeIntervals(t){if(0===arguments.length)return this._options.disabledTimeIntervals?e.extend({},this._options.disabledTimeIntervals):this._options.disabledTimeIntervals;if(!t)return this._options.disabledTimeIntervals=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");this._options.disabledTimeIntervals=t,this._update()}disabledHours(t){if(0===arguments.length)return this._options.disabledHours?e.extend({},this._options.disabledHours):this._options.disabledHours;if(!t)return this._options.disabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(this._options.disabledHours=this._indexGivenHours(t),this._options.enabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(let e=0;e<this._dates.length;e++){let t=0;for(;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===t)throw"Tried 24 times to find a valid date";t++}this._setValue(this._dates[e],e)}this._update()}enabledHours(t){if(0===arguments.length)return this._options.enabledHours?e.extend({},this._options.enabledHours):this._options.enabledHours;if(!t)return this._options.enabledHours=!1,this._update(),!0;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(this._options.enabledHours=this._indexGivenHours(t),this._options.disabledHours=!1,this._options.useCurrent&&!this._options.keepInvalid)for(let e=0;e<this._dates.length;e++){let t=0;for(;!this._isValid(this._dates[e],"h");){if(this._dates[e].add(1,"h"),24===t)throw"Tried 24 times to find a valid date";t++}this._setValue(this._dates[e],e)}this._update()}viewDate(e){if(0===arguments.length)return this._viewDate.clone();if(!e)return this._viewDate=(this._dates[0]||this.getMoment()).clone(),!0;if(!("string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");this._viewDate=this._parseInputDate(e),this._viewUpdate()}allowMultidate(e){if("boolean"!=typeof e)throw new TypeError("allowMultidate() expects a boolean parameter");this._options.allowMultidate=e}multidateSeparator(e){if(0===arguments.length)return this._options.multidateSeparator;if("string"!=typeof e||e.length>1)throw new TypeError("multidateSeparator expects a single character string parameter");this._options.multidateSeparator=e}}return f})(jQuery,moment),TempusDominusBootstrap4=(e=>{const t=e.fn[DateTimePicker.NAME],i=["top","bottom","auto"],a=["left","right","auto"],n=["default","to
14p","bottom"],o=function(t){let i,a=t.data("target");return a||(a=t.attr("href")||"",a=/^#[a-z]/i.test(a)?a:null),0===(i=e(a)).length?i:(i.data(DateTimePicker.DATA_KEY)||e.extend({},i.data(),e(this).data()),i)};class s extends DateTimePicker{constructor(e,t){super(e,t),this._init()}_init(){if(this._element.hasClass("input-group")){const e=this._element.find(".datepickerbutton");0===e.length?this.component=this._element.find('[data-toggle="datetimepicker"]'):this.component=e}}_getDatePickerTemplate(){const t=e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action","previous").append(e("<span>").addClass(this._options.icons.previous))).append(e("<th>").addClass("datepicker-switch").attr("data-action","pickerSwitch").attr("colspan",`${this._options.calendarWeeks?"6":"5"}`)).append(e("<th>").addClass("next").attr("data-action","next").append(e("<span>").addClass(this._options.icons.next)))),i=e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan",`${this._options.calendarWeeks?"8":"7"}`))),a=e("");return[e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>")).append(a.clone())),e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(i.clone()).append(a.clone())),e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(i.clone()).append(a.clone())),e("<div>").addClass("datepicker-decades").append(e("<table>").addClass("table-condensed").append(t.clone()).append(i.clone()).append(a.clone()))]}_getTimePickerMainTemplate(){const t=e("<tr>"),i=e("<tr>"),a=e("<tr>");return this._isEnabled("h")&&(t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(e("<span>").addClass(this._options.icons.up)))),i.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:this._options.tooltips.pickHour}).attr("data-action","showHours"))),a.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(e("<span>").addClass(this._options.icons.down))))),this._isEnabled("m")&&(this._isEnabled("h")&&(t.append(e("<td>").addClass("separator")),i.append(e("<td>").addClass("separator").html(":")),a.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(e("<span>").addClass(this._options.icons.up)))),i.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:this._options.tooltips.pickMinute}).attr("data-action","showMinutes"))),a.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(e("<span>").addClass(this._options.icons.down))))),this._isEnabled("s")&&(this._isEnabled("m")&&(t.append(e("<td>").addClass("separator")),i.append(e("<td>").addClass("separator").html(":")),a.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(e("<span>").addClass(this._options.icons.up)))),i.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:this._options.tooltips.pickSecond}).attr("data-action","showSeconds"))),a.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:this._options.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(e("<span>").addClass(this._options.icons.down))))),this.use24Hours||(t.append(e("<td>").addClass("separator")),i.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:this._options.tooltips.togglePeriod}))),a.append(e("<td>").addClass("separator"))),e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t,i,a]))}_getTimePickerTemplate(){const t=e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")),i=e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")),a=e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")),n=[this._getTimePickerMainTemplate()];return this._isEnabled("h")&&n.push(t),this._isEnabled("m")&&n.push(i),this._isEnabled("s")&&n.push(a),n}_getToolbar(){const t=[];if(this._options.buttons.showToday&&t.push(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1","data-action":"today",title:this._options.tooltips.today}).append(e("<span>").addClass(this._options.icons.today)))),!this._options.sideBySide&&this._hasDate(
14)&&this._hasTime()){let i,a;"times"===this._options.viewMode?(i=this._options.tooltips.selectDate,a=this._options.icons.date):(i=this._options.tooltips.selectTime,a=this._options.icons.time),t.push(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1","data-action":"togglePicker",title:i}).append(e("<span>").addClass(a))))}return this._options.buttons.showClear&&t.push(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1","data-action":"clear",title:this._options.tooltips.clear}).append(e("<span>").addClass(this._options.icons.clear)))),this._options.buttons.showClose&&t.push(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1","data-action":"close",title:this._options.tooltips.close}).append(e("<span>").addClass(this._options.icons.close)))),0===t.length?"":e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t)))}_getTemplate(){const t=e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),i=e("<div>").addClass("datepicker").append(this._getDatePickerTemplate()),a=e("<div>").addClass("timepicker").append(this._getTimePickerTemplate()),n=e("<ul>").addClass("list-unstyled"),o=e("<li>").addClass(`datepicker-switch${this._options.collapse?" accordion-toggle":""}`).append(this._getToolbar());return this._options.inline&&t.removeClass("dropdown-menu"),this.use24Hours&&t.addClass("usetwentyfour"),this._isEnabled("s")&&!this.use24Hours&&t.addClass("wider"),this._options.sideBySide&&this._hasDate()&&this._hasTime()?(t.addClass("timepicker-sbs"),"top"===this._options.toolbarPlacement&&t.append(o),t.append(e("<div>").addClass("row").append(i.addClass("col-md-6")).append(a.addClass("col-md-6"))),"bottom"!==this._options.toolbarPlacement&&"default"!==this._options.toolbarPlacement||t.append(o),t):("top"===this._options.toolbarPlacement&&n.append(o),this._hasDate()&&n.append(e("<li>").addClass(this._options.collapse&&this._hasTime()?"collapse":"").addClass(this._options.collapse&&this._hasTime()&&"times"===this._options.viewMode?"":"show").append(i)),"default"===this._options.toolbarPlacement&&n.append(o),this._hasTime()&&n.append(e("<li>").addClass(this._options.collapse&&this._hasDate()?"collapse":"").addClass(this._options.collapse&&this._hasDate()&&"times"===this._options.viewMode?"show":"").append(a)),"bottom"===this._options.toolbarPlacement&&n.append(o),t.append(n))}_place(t){let i,a=t&&t.data&&t.data.picker||this,n=a._options.widgetPositioning.vertical,o=a._options.widgetPositioning.horizontal;const s=(a.component&&a.component.length?a.component:a._element).position(),r=(a.component&&a.component.length?a.component:a._element).offset();if(a._options.widgetParent)i=a._options.widgetParent.append(a.widget);else if(a._element.is("input"))i=a._element.after(a.widget).parent();else{if(a._options.inline)return void(i=a._element.append(a.widget));i=a._element,a._element.children().first().after(a.widget)}if("auto"===n&&(n=r.top+1.5*a.widget.height()>=e(window).height()+e(window).scrollTop()&&a.widget.height()+a._element.outerHeight()<r.top?"top":"bottom"),"auto"===o&&(o=i.width()<r.left+a.widget.outerWidth()/2&&r.left+a.widget.outerWidth()>e(window).width()?"right":"left"),"top"===n?a.widget.addClass("top").removeClass("bottom"):a.widget.addClass("bottom").removeClass("top"),"right"===o?a.widget.addClass("float-right"):a.widget.removeClass("float-right"),"relative"!==i.css("position")&&(i=i.parents().filter(function(){return"relative"===e(this).css("position")}).first()),0===i.length)throw new Error("datetimepicker component should be placed within a relative positioned container");a.widget.css({top:"top"===n?"auto":s.top+a._element.outerHeight()+"px",bottom:"top"===n?i.outerHeight()-(i===a._element?0:s.top)+"px":"auto",left:"left"===o?(i===a._element?0:s.left)+"px":"auto",right:"left"===o?"auto":i.outerWidth()-a._element.outerWidth()-(i===a._element?0:s.left)+"px"})}_fillDow(){const t=e("<tr>"),i=this._viewDate.clone().startOf("w").startOf("d");for(!0===this._options.calendarWeeks&&t.append(e("<th>").addClass("cw").text("#"));i.isBefore(this._viewDate.clone().endOf("w"));)t.append(e("<th>").addClass("dow").text(i.format("dd"))),i.add(1,"d");this.widget.find(".datepicker-days thead").append(t)}_fillMonths(){const t=[],i=this._viewDate.clone().startOf("y").startOf("d");for(;i.isSame(this._viewDate,"y");)t.push(e("<span>").attr("data-action","selectMonth").addClass("month").text(i.format("MMM"))),i.add(1,"M");this.widget.find(".datepicker-months td").empty().append(t)}_updateMonths(){const t=this.widget.find(".datepicker-months"),i=t.find("th"),a=t.find("tbody").find("span"),n=this;i.eq(0).find("span").attr("title",this._options.tooltips.prevYear),i.eq(1).attr("title",this._options.tooltips.selectYear),i.eq(2).find("span").attr("title",this._options.tooltips.nextYear),t.find(".disabled").removeClass("disabled"),this._isValid(this._viewDate.clone().subtract(1,"y"),"y")||i.eq(0).addClass("disabled"),i.eq(1).text(this._viewDate.year()),this._isValid(this._viewDate.clone().add(1,"y"),"y")||i.eq(2).addClass("disabled"),a.removeClass("active"),this._getLastPickedDate().isSame(this._viewDate,"y")&&!this.unset&&a.eq(this._getLastPickedDate().month()).addClass("active"),a.each(function(t){n._isValid(n._viewDate.clone().month(t),"M")||e(this).addClass("disabled")})}_getStartEndYear(e,t){const i=e/10,a=Math.floor(t/e)*e;return[a,a+9*i,Math.floor(t/i)*i]}_updateYears(){const e=this.widget.find(".datepicker-years"),t=e.find("th"),i=this._getStartEndYear(10,this._viewDate.year()),a=this._viewDate.clone().year
14(i[0]),n=this._viewDate.clone().year(i[1]);let o="";for(t.eq(0).find("span").attr("title",this._options.tooltips.prevDecade),t.eq(1).attr("title",this._options.tooltips.selectDecade),t.eq(2).find("span").attr("title",this._options.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),this._options.minDate&&this._options.minDate.isAfter(a,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(`${a.year()}-${n.year()}`),this._options.maxDate&&this._options.maxDate.isBefore(n,"y")&&t.eq(2).addClass("disabled"),o+=`<span data-action="selectYear" class="year old${this._isValid(a,"y")?"":" disabled"}">${a.year()-1}</span>`;!a.isAfter(n,"y");)o+=`<span data-action="selectYear" class="year${a.isSame(this._getLastPickedDate(),"y")&&!this.unset?" active":""}${this._isValid(a,"y")?"":" disabled"}">${a.year()}</span>`,a.add(1,"y");o+=`<span data-action="selectYear" class="year old${this._isValid(a,"y")?"":" disabled"}">${a.year()}</span>`,e.find("td").html(o)}_updateDecades(){const e=this.widget.find(".datepicker-decades"),t=e.find("th"),i=this._getStartEndYear(100,this._viewDate.year()),a=this._viewDate.clone().year(i[0]),n=this._viewDate.clone().year(i[1]);let o,s=!1,r=!1,l="";for(t.eq(0).find("span").attr("title",this._options.tooltips.prevCentury),t.eq(2).find("span").attr("title",this._options.tooltips.nextCentury),e.find(".disabled").removeClass("disabled"),(0===a.year()||this._options.minDate&&this._options.minDate.isAfter(a,"y"))&&t.eq(0).addClass("disabled"),t.eq(1).text(`${a.year()}-${n.year()}`),this._options.maxDate&&this._options.maxDate.isBefore(n,"y")&&t.eq(2).addClass("disabled"),a.year()-10<0?l+="<span>&nbsp;</span>":l+=`<span data-action="selectDecade" class="decade old" data-selection="${a.year()+6}">${a.year()-10}</span>`;!a.isAfter(n,"y");)o=a.year()+11,s=this._options.minDate&&this._options.minDate.isAfter(a,"y")&&this._options.minDate.year()<=o,r=this._options.maxDate&&this._options.maxDate.isAfter(a,"y")&&this._options.maxDate.year()<=o,l+=`<span data-action="selectDecade" class="decade${this._getLastPickedDate().isAfter(a)&&this._getLastPickedDate().year()<=o?" active":""}${this._isValid(a,"y")||s||r?"":" disabled"}" data-selection="${a.year()+6}">${a.year()}</span>`,a.add(10,"y");l+=`<span data-action="selectDecade" class="decade old" data-selection="${a.year()+6}">${a.year()}</span>`,e.find("td").html(l)}_fillDate(){const t=this.widget.find(".datepicker-days"),i=t.find("th"),a=[];let n,o,s,r;if(this._hasDate()){for(i.eq(0).find("span").attr("title",this._options.tooltips.prevMonth),i.eq(1).attr("title",this._options.tooltips.selectMonth),i.eq(2).find("span").attr("title",this._options.tooltips.nextMonth),t.find(".disabled").removeClass("disabled"),i.eq(1).text(this._viewDate.format(this._options.dayViewHeaderFormat)),this._isValid(this._viewDate.clone().subtract(1,"M"),"M")||i.eq(0).addClass("disabled"),this._isValid(this._viewDate.clone().add(1,"M"),"M")||i.eq(2).addClass("disabled"),n=this._viewDate.clone().startOf("M").startOf("w").startOf("d"),r=0;r<42;r++){if(0===n.weekday()&&(o=e("<tr>"),this._options.calendarWeeks&&o.append(`<td class="cw">${n.week()}</td>`),a.push(o)),s="",n.isBefore(this._viewDate,"M")&&(s+=" old"),n.isAfter(this._viewDate,"M")&&(s+=" new"),this._options.allowMultidate){var l=this._datesFormatted.indexOf(n.format("YYYY-MM-DD"));-1!==l&&n.isSame(this._datesFormatted[l],"d")&&!this.unset&&(s+=" active")}else n.isSame(this._getLastPickedDate(),"d")&&!this.unset&&(s+=" active");this._isValid(n,"d")||(s+=" disabled"),n.isSame(this.getMoment(),"d")&&(s+=" today"),0!==n.day()&&6!==n.day()||(s+=" weekend"),o.append(`<td data-action="selectDay" data-day="${n.format("L")}" class="day${s}">${n.date()}</td>`),n.add(1,"d")}t.find("tbody").empty().append(a),this._updateMonths(),this._updateYears(),this._updateDecades()}}_fillHours(){const t=this.widget.find(".timepicker-hours table"),i=this._viewDate.clone().startOf("d"),a=[];let n=e("<tr>");for(this._viewDate.hour()>11&&!this.use24Hours&&i.hour(12);i.isSame(this._viewDate,"d")&&(this.use24Hours||this._viewDate.hour()<12&&i.hour()<12||this._viewDate.hour()>11);)i.hour()%4==0&&(n=e("<tr>"),a.push(n)),n.append(`<td data-action="selectHour" class="hour${this._isValid(i,"h")?"":" disabled"}">${i.format(this.use24Hours?"HH":"hh")}</td>`),i.add(1,"h");t.empty().append(a)}_fillMinutes(){const t=this.widget.find(".timepicker-minutes table"),i=this._viewDate.clone().startOf("h"),a=[],n=1===this._options.stepping?5:this._options.stepping;let o=e("<tr>");for(;this._viewDate.isSame(i,"h");)i.minute()%(4*n)==0&&(o=e("<tr>"),a.push(o)),o.append(`<td data-action="selectMinute" class="minute${this._isValid(i,"m")?"":" disabled"}">${i.format("mm")}</td>`),i.add(n,"m");t.empty().append(a)}_fillSeconds(){
15const t=this.widget.find(".timepicker-seconds table"),i=this._viewDate.clone().startOf("m"),a=[];let n=e("<tr>");for(;this._viewDate.isSame(i,"m");)i.second()%20==0&&(n=e("<tr>"),a.push(n)),n.append(`<td data-action="selectSecond" class="second${this._isValid(i,"s")?"":" disabled"}">${i.format("ss")}</td>`),i.add(5,"s");t.empty().append(a)}_fillTime(){let e,t;const i=this.widget.find(".timepicker span[data-time-component]");this.use24Hours||(e=this.widget.find(".timepicker [data-action=togglePeriod]"),t=this._getLastPickedDate().clone().add(this._getLastPickedDate().hours()>=12?-12:12,"h"),e.text(this._getLastPickedDate().format("A")),this._isValid(t,"h")?e.removeClass("disabled"):e.addClass("disabled")),i.filter("[data-time-component=hours]").text(this._getLastPickedDate().format(`${this.use24Hours?"HH":"hh"}`)),i.filter("[data-time-component=minutes]").text(this._getLastPickedDate().format("mm")),i.filter("[data-time-component=seconds]").text(this._getLastPickedDate().format("ss")),this._fillHours(),this._fillMinutes(),this._fillSeconds()}_doAction(t,i){let a=this._getLastPickedDate();if(e(t.currentTarget).is(".disabled"))return!1;switch(i=i||e(t.currentTarget).data("action")){case"next":{const e=DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.add(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP,e),this._fillDate(),this._viewUpdate(e);break}case"previous":{const e=DateTimePicker.DatePickerModes[this.currentViewMode].NAV_FUNCTION;this._viewDate.subtract(DateTimePicker.DatePickerModes[this.currentViewMode].NAV_STEP,e),this._fillDate(),this._viewUpdate(e);break}case"pickerSwitch":this._showMode(1);break;case"selectMonth":{const i=e(t.target).closest("tbody").find("span").index(e(t.target));this._viewDate.month(i),this.currentViewMode===this.MinViewModeNumber?(this._setValue(a.clone().year
15(this._viewDate.year()).month(this._viewDate.month()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("M");break}case"selectYear":{const i=parseInt(e(t.target).text(),10)||0;this._viewDate.year(i),this.currentViewMode===this.MinViewModeNumber?(this._setValue(a.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break}case"selectDecade":{const i=parseInt(e(t.target).data("selection"),10)||0;this._viewDate.year(i),this.currentViewMode===this.MinViewModeNumber?(this._setValue(a.clone().year(this._viewDate.year()),this._getLastPickedDateIndex()),this._options.inline||this.hide()):(this._showMode(-1),this._fillDate()),this._viewUpdate("YYYY");break}case"selectDay":{const i=this._viewDate.clone();e(t.target).is(".old")&&i.subtract(1,"M"),e(t.target).is(".new")&&i.add(1,"M");var n=i.date(parseInt(e(t.target).text(),10)),o=0;this._options.allowMultidate?-1!==(o=this._datesFormatted.indexOf(n.format("YYYY-MM-DD")))?this._setValue(null,o):this._setValue(n,this._getLastPickedDateIndex()+1):this._setValue(n,this._getLastPickedDateIndex()),this._hasTime()||this._options.keepOpen||this._options.inline||this._options.allowMultidate||this.hide(),this._hasTime()&&this.widget.find('[data-action="togglePicker"]').trigger("click");break}case"incrementHours":{const e=a.clone().add(1,"h");this._isValid(e,"h")&&this._setValue(e,this._getLastPickedDateIndex());break}case"incrementMinutes":{const e=a.clone().add(this._options.stepping,"m");this._isValid(e,"m")&&this._setValue(e,this._getLastPickedDateIndex());break}case"incrementSeconds":{const e=a.clone().add(1,"s");this._isValid(e,"s")&&this._setValue(e,this._getLastPickedDateIndex());break}case"decrementHours":{const e=a.clone().subtract(1,"h");this._isValid(e,"h")&&this._setValue(e,this._getLastPickedDateIndex());break}case"decrementMinutes":{const e=a.clone().subtract(this._options.stepping,"m");this._isValid(e,"m")&&this._setValue(e,this._getLastPickedDateIndex());break}case"decrementSeconds":{const e=a.clone().subtract(1,"s");this._isValid(e,"s")&&this._setValue(e,this._getLastPickedDateIndex());break}case"togglePeriod":this._setValue(a.clone().add(a.hours()>=12?-12:12,"h"),this._getLastPickedDateIndex());break;case"togglePicker":{const i=e(t.target),a=i.closest("a"),n=i.closest("ul"),o=n.find(".show"),s=n.find(".collapse:not(.show)"),r=i.is("span")?i:i.find("span");let l;if(o&&o.length){if((l=o.data("collapse"))&&l.transitioning)return!0;o.collapse?(o.collapse("hide"),s.collapse("show")):(o.removeClass("show"),s.addClass("show")),r.toggleClass(this._options.icons.time+" "+this._options.icons.date),r.hasClass(this._options.icons.date)?a.attr("title",this._options.tooltips.selectDate):a.attr("title",this._options.tooltips.selectTime)}}break;case"showPicker":this.widget.find(".timepicker > div:not(.timepicker-picker)").hide(),this.widget.find(".timepicker .timepicker-picker").show();break;case"showHours":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-hours").show();break;case"showMinutes":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-minutes").show();break;case"showSeconds":this.widget.find(".timepicker .timepicker-picker").hide(),this.widget.find(".timepicker .timepicker-seconds").show();break;case"selectHour":{let i=parseInt(e(t.target).text(),10);this.use24Hours||(a.hours()>=12?12!==i&&(i+=12):12===i&&(i=0)),this._setValue(a.clone().hours(i),this._getLastPickedDateIndex()),this._isEnabled("a")||this._isEnabled("m")||this._options.keepOpen||this._options.inline?this._doAction(t,"showPicker"):this.hide();break}case"selectMinute":this._setValue(a.clone().minutes(parseInt(e(t.target).text(),10)),this._getLastPickedDateIndex()),this._isEnabled("a")||this._isEnabled("s")||this._options.keepOpen||this._options.inline?this._doAction(t,"showPicker"):this.hide();break;case"selectSecond":this._setValue(a.clone().seconds(parseInt(e(t.target).text(),10)),this._getLastPickedDateIndex()),this._isEnabled("a")||this._options.keepOpen||this._options.inline?this._doAction(t,"showPicker"):this.hide();break;case"clear":this.clear();break;
15case"close":this.hide();break;case"today":{const e=this.getMoment();this._isValid(e,"d")&&this._setValue(e,this._getLastPickedDateIndex());break}}return!1}hide(){let t=!1;this.widget&&(this.widget.find(".collapse").each(function(){const i=e(this).data("collapse");return!i||!i.transitioning||(t=!0,!1)}),t||(this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this.widget.hide(),e(window).off("resize",this._place()),this.widget.off("click","[data-action]"),this.widget.off("mousedown",!1),this.widget.remove(),this.widget=!1,this._notifyEvent({type:DateTimePicker.Event.HIDE,date:this._getLastPickedDate().clone()}),this.input!==undefined&&this.input.blur(),this._viewDate=this._getLastPickedDate().clone()))}show(){let t;const i={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}};if(this.input!==undefined){if(this.input.prop("disabled")||!this._options.ignoreReadonly&&this.input.prop("readonly")||this.widget)return;this.input.val()!==undefined&&0!==this.input.val().trim().length?this._setValue(this._parseInputDate(this.input.val().trim()),0):this.unset&&this._options.useCurrent&&(t=this.getMoment(),"string"==typeof this._options.useCurrent&&(t=i[this._options.useCurrent](t)),this._setValue(t,0))}else this.unset&&this._options.useCurrent&&(t=this.getMoment(),"string"==typeof this._options.useCurrent&&(t=i[this._options.useCurrent](t)),this._setValue(t,0));this.widget=this._getTemplate(),this._fillDow(),this._fillMonths(),this.widget.find(".timepicker-hours").hide(),this.widget.find(".timepicker-minutes").hide(),this.widget.find(".timepicker-seconds").hide(),this._update(),this._showMode(),e(window).on("resize",{picker:this},this._place),this.widget.on("click","[data-action]",e.proxy(this._doAction,this)),this.widget.on("mousedown",!1),this.component&&this.component.hasClass("btn")&&this.component.toggleClass("active"),this._place(),this.widget.show(),this.input!==undefined&&this._options.focusOnShow&&!this.input.is(":focus")&&this.input.focus(),this._notifyEvent({type:DateTimePicker.Event.SHOW})}destroy(){this.hide(),this._element.removeData(DateTimePicker.DATA_KEY),this._element.removeData("date")}disable(){this.hide(),this.component&&this.component.hasClass("btn")&&this.component.addClass("disabled"),this.input!==undefined&&this.input.prop("disabled",!0)}enable(){this.component&&this.component.hasClass("btn")&&this.component.removeClass("disabled"),this.input!==undefined&&this.input.prop("disabled",!1)}toolbarPlacement(e){if(0===arguments.length)return this._options.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===n.indexOf(e))throw new TypeError(`toolbarPlacement() parameter must be one of (${n.join(", ")}) value`);this._options.toolbarPlacement=e,this.widget&&(this.hide(),this.show())}widgetPositioning(t){if(0===arguments.length)return e.extend({},this._options.widgetPositioning);if("[object Object]"!=={}.toString.call(t))throw new TypeError("widgetPositioning() expects an object variable");if(t.horizontal){if("string"!=typeof t.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(t.horizontal=t.horizontal.toLowerCase(),-1===a.indexOf(t.horizontal))throw new TypeError(`widgetPositioning() expects horizontal parameter to be one of (${a.join(", ")})`);this._options.widgetPositioning.horizontal=t.horizontal}if(t.vertical){if("string"!=typeof t.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(t.vertical=t.vertical.toLowerCase(),-1===i.indexOf(t.vertical))throw new TypeError(`widgetPositioning() expects vertical parameter to be one of (${i.join(", ")})`);this._options.widgetPositioning.vertical=t.vertical}this._update()}widgetParent(t){if(0===arguments.length)return this._options.widgetParent;if("string"==typeof t&&(t=e(t)),null!==t&&"string"!=typeof t&&!(t instanceof e))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");this._options.widgetParent=t,this.widget&&(this.hide(),this.show())}static _jQueryHandleThis(t,i,a){let n=e(t).data(DateTimePicker.DATA_KEY);if("object"==typeof i&&e.extend({},DateTimePicker.Default,i),n||(n=new s(e(t),i),e(t).data(DateTimePicker.DATA_KEY,n)),"string"==typeof i){if(n[i]===undefined)throw new Error(`No method n
15amed "${i}"`);return a===undefined?n[i]():n[i](a)}}static _jQueryInterface(e,t){return 1===this.length?s._jQueryHandleThis(this[0],e,t):this.each(function(){s._jQueryHandleThis(this,e,t)})}}return e(document).on(DateTimePicker.Event.CLICK_DATA_API,DateTimePicker.Selector.DATA_TOGGLE,function(){const t=o(e(this));0!==t.length&&s._jQueryInterface.call(t,"toggle")}).on(DateTimePicker.Event.CHANGE,`.${DateTimePicker.ClassName.INPUT}`,function(t){const i=o(e(this));0!==i.length&&s._jQueryInterface.call(i,"_change",t)}).on(DateTimePicker.Event.BLUR,`.${DateTimePicker.ClassName.INPUT}`,function(t){const i=o(e(this)),a=i.data(DateTimePicker.DATA_KEY);0!==i.length&&(a._options.debug||window.debug||s._jQueryInterface.call(i,"hide",t))}).on(DateTimePicker.Event.KEYDOWN,`.${DateTimePicker.ClassName.INPUT}`,function(t){const i=o(e(this));0!==i.length&&s._jQueryInterface.call(i,"_keydown",t)}).on(DateTimePicker.Event.KEYUP,`.${DateTimePicker.ClassName.INPUT}`,function(t){const i=o(e(this));0!==i.length&&s._jQueryInterface.call(i,"_keyup",t)}).on(DateTimePicker.Event.FOCUS,`.${DateTimePicker.ClassName.INPUT}`,function(t){const i=o(e(this)),a=i.data(DateTimePicker.DATA_KEY);0!==i.length&&a._options.allowInputToggle&&s._jQueryInterface.call(i,"show",t)}),e.fn[DateTimePicker.NAME]=s._jQueryInterface,e.fn[DateTimePicker.NAME].Constructor=s,e.fn[DateTimePicker.NAME].noConflict=function(){return e.fn[DateTimePicker.NAME]=t,s._jQueryInterface},s})(jQuery);
16/*!
17 * Bootstrap YouTube Popup Player Plugin
18 * http://lab.abhinayrathore.com/bootstrap-youtube/
19 * https://github.com/abhinayrathore/Bootstrap-Youtube-Popup-Player-Plugin
20 */
21!function(e){function t(t){p.html(e.trim(t))}function i(e){h.html(e)}function a(){t(""),i("")}function n(e){u.css({width:e+2*m})}function o(e,t){return["//www.youtube.com/embed/",e,"?rel=0&showsearch=0&autohide=",t.autohide,"&autoplay=",t.autoplay,"&controls=",t.controls,"&fs=",t.fs,"&loop=",t.loop,"&showinfo=",t.showinfo,"&color=",t.color,"&theme=",t.theme,"&wmode=transparent"].join("")}function s(e,t,i){return['<iframe title="YouTube video player" width="',t,'" height="',i,'" ','style="margin:0; padding:0; box-sizing:border-box; border:0; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; margin:',m-1,'px;" ','src="',e,'" frameborder="0" allowfullscreen seamless></iframe>'].join("")}function r(i){e.ajax({url:window.location.protocol+"//query.yahooapis.com/v1/public/yql",data:{q:"select * from json where url ='http://www.youtube.com/oembed?url=http://www.youtube.com/watch?v="+i+"&format=json'",format:"json"},dataType:"jsonp",success:function(e){e&&e.query&&e.query.results&&e.query.results.json&&t(e.query.results.json.title)}})}function l(e){var t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/,i=e.match(t);return!(!i||11!=i[2].length)&&i[2]}var d,c=null,u=null,p=null,h=null,m=5;d={init:function(d){if(d=e.extend({},e.fn.YouTubeModal.defaults,d),null==c){var m='<div class="modal-dialog" id="YouTubeModalDialog"><div class="modal-content-wrapper" id="YouTubeModalContent"><div class="modal-header" id="YouTubeModalHeader"><button type="button" class="close" data-dismiss="modal">&times;</button><h4 class="modal-title" id="YouTubeModalTitle"></h4></div><div class="modal-body" id="YouTubeModalBody" style="padding:0;"></div></div></div>';(c=e('<div class="modal fade '+d.cssClass+'" id="YouTubeModal" role="dialog" aria-hidden="true">')).html(m).hide().appendTo("body"),u=e("#YouTubeModalDialog"),$YouTubeModalHeader=e("#YouTubeModalHeader"),p=e("#YouTubeModalTitle"),h=e("#YouTubeModalBody"),c.modal({show:!1}).on("hide.bs.modal",a)}return this.each(function(){var a=e(this);a.data("YouTube")||(a.data("YouTube",{target:a}),e(a).bind("click.YouTubeModal",function(u){var p=d.youtubeId;""==e.trim(p)&&a.is("a")&&(p=l(a.attr("href"))),""!=e.trim(p)&&!1!==p||(p=a.attr(d.idAttribute));var h=e.trim(d.title);""==h&&(d.useYouTubeTitle?r(p):h=a.attr("title")),h?(t(h),$YouTubeModalHeader.show()):$YouTubeModalHeader.hide(),n(d.width),i(s(o(p,d),d.width,d.height)),c.modal("show"),u.preventDefault()}))})},destroy:function(){return this.each(function(){e(this).unbind(".YouTubeModal").removeData("YouTube")})}},e.fn.YouTubeModal=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1
21)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist on Bootstrap.YouTubeModal"):d.init.apply(this,arguments)},e.fn.YouTubeModal.defaults={youtubeId:"",title:"",useYouTubeTitle:!0,idAttribute:"rel",cssClass:"YouTubeModal",width:640,height:480,autohide:2,autoplay:1,color:"red",controls:1,fs:1,loop:0,showinfo:0,theme:"light"}}(jQuery),"undefined"!=typeof CKEDITOR&&(CKEDITOR.skin.name="lightwire",CKEDITOR.skin.ua_editor="ie,iequirks,ie7,ie8,gecko",CKEDITOR.skin.ua_dialog="ie,iequirks,ie7,ie8,opera",CKEDITOR.skin.chameleon=function(){var e,t=function(e,t){for(var i=e.match(/[^#]./g),a=0;3>a;a++){var n,o=i,s=a;n=parseInt(i[a],16),n=("0"+(0>t?0|n*(1+t):0|n+(255-n)*t).toString(16)).slice(-2),o[s]=n}return"#"+i.join("")},i=(e=new CKEDITOR.template("background:#{to};background-image:-webkit-gradient(linear,lefttop,leftbottom,from({from}),to({to}));background-image:-moz-linear-gradient(top,{from},{to});background-image:-webkit-linear-gradient(top,{from},{to});background-image:-o-linear-gradient(top,{from},{to});background-image:-ms-linear-gradient(top,{from},{to});background-image:linear-gradient(top,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');"),function(t,i){return e.output({from:t,to:i})}),a={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")};return function(e,n){var o=e.uiColor;o={id:"."+e.id,defaultBorder:t(o,-.1),defaultGradient:i(t(o,.9),o),lightGradient:i(t(o,1),t(o,.7)),mediumGradient:i(t(o,.8),t(o,.5)),ckeButtonOn:i(t(o,.6),t(o,.7)),ckeResizer:t(o,-.4),ckeToolbarSeparator:t(o,.5),ckeColorauto:t(o,.8),dialogBody:t(o,.7),dialogTabSelected:i("#FFFFFF","#FFFFFF"),dialogTabSelectedBorder:"#FFF",elementsPathColor:t(o,-.6),elementsPathBg:o,menubuttonIcon:t(o,.5),menubuttonIconHover:t(o,.3)};return a[n].output(o).replace(/\[/g,"{").replace(/\]/g,"}")}}(),$(document).on("click",".InputfieldCKEditorInline",function(){var e=$
21("#cke_"+$(this).attr("id"));e.length&&$(this).parent().after(e)})),"undefined"!=typeof CKEDITOR&&(CKEDITOR.config.customConfig="/assets/ckeditor/ckeditor_config-77a2a606da34c20eeb5bf363fd0e7e16ef112b089c7f787e0b1e134977276709.js"),$.fn.dataTable&&(jQuery.fn.dataTableExt.oApi.fnFilterOnReturn=function(){var e=this;return this.each(function(t){$.fn.dataTableExt.iApiIndex=t;var i=$("input",e.fnSettings().aanFeatures.f);return i.unbind("keyup search input").bind("keypress",function(a){13==a.which&&($.fn.dataTableExt.iApiIndex=t,e.fnFilter(i.val()))}),this}),this}),"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),function(e,t,i,a){e.fn.socialfeed=function(t){function i(){d.forEach(function(e){r[e]&&(r[e].accounts?c+=r[e].limit*r[e].accounts.length:r[e].urls?c+=r[e].limit*r[e].urls.length:c+=r[e].limit)})}function n(){!0&&r.callback&&r.callback()}function o(e,t){this.content=t,this.content.social_network=e,this.content.attachment=this.content.attachment===a?"":this.content.attachment,this.content.time_ago=t.dt_create.locale(r.date_locale).fromNow(),this.content.date=t.dt_create.locale(r.date_locale).format(r.date_format),this.content.dt_create=this.content.dt_create.valueOf(),this.content.text=p.wrapLinks(p.shorten(t.message+" "+t.description),t.social_network),this.content.moderation_passed=!r.moderation||r.moderation(this.content),h[e].posts.push(this)}var s={plugin_folder:"",template:"template.html",show_media:!1,media_min_width:300,length:500,date_format:"ll",date_locale:"en"},r=e.extend(s,t),l=e(this),d=["facebook","instagram","vk","google","blogspot","twitter","pinterest","rss"],c=0,u=0;i();var p={request:function(t,i){e.ajax({url:t,dataType:"jsonp",success:i})},get_request:function(t,i){e.get(t,i,"json")},wrapLinks:function(e,t){var i=/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi;return e="google-plus"===t?e.replace(/(@|#)([a-z0-9_]+['])/gi,p.wrapGoogleplusTagTemplate):e.replace(i,p.wrapLinkTemplate)},wrapLinkTemplate:function(e){return'<a target="_blank" href="'+e+'">'+e+"</a>"},wrapGoogleplusTagTemplate:function(e){return'<a target="_blank" href="https://plus.google.com/s/'+e+'" >'+e+"</a>"},shorten:function(t){return(t=e.trim(t)).length>r.length?jQuery.trim(t).substring(0,r.length).split(" ").slice(0,-1).join(" ")+"...":t},stripHTML:function(e){return null==e?"":e.replace(/(<([^>]+)>)|nbsp;|\s{2,}|/gi,"")}};o.prototype={render:function(){var t=h.template(this.content),i=this.content;if(0!==e(l).children("[social-feed-id="+i.id+"]").length)return!1;if(0===e(l).children().length)e(l).append(t);else{var a=0,o=-1;if(e.each(e(l).children(),function(){if(e(this).attr("dt-create")<i.dt_create)return o=a,!1;a++}),e(l).append(t),o>=0){o++;var s=e(l).children("div:nth-child("+o+")"),d=e(l).children("div:last-child");e(d).insertBefore(s)}}if(r.media_min_width){var p="[social-feed-id="+i.id+"] img.attachment",m=e(p),f=new Image,g=m.attr("src");e(f).on("load",function(){f.width<r.media_min_width&&m.hide(),delete f}).on("error",function(){m.hide()}).attr({src:g})}++u==c&&n()}};var h={template:!1,init:function(){h.getTemplate(function(){d.forEach(function(e){r[e]&&(r[e].accounts?r[e].accounts.forEach(function(t){h[e].getData(t)}):r[e].urls?r[e].urls.forEach(function(t){h[e].getData(t)}):h[e].getData())})})},getTemplate:function(t){return h.template?t():r.template_html?(h.template=doT.template(r.template_html),t()):void e.get(r.template,function(e){return h.template=doT.template(e),t()})},twitter:{posts:[],loaded:!1,api:"http://api.tweecool.com/",getData:function(e){var t=new Codebird;switch(t.setConsumerKey(r.twitter.consumer_key,r.twitter.consumer_secret),r.twitter.proxy!==a&&t.setProxy(r.twitter.proxy),e[0]){case"@":var i=e.substr(1);t.__call("statuses_userTimeline","id="+i+"&count="+r.twitter.limit,h.twitter.utility.getPosts,!0);break;case"#":var n=e.substr(1);t.__call("search_tweets","q="+n+"&count="+r.twitter.limit,function(e){h.twitter.utility.getPosts(e.statuses)},!0)}},utility:{getPosts:function(t){t&&e.each(t,function(){var e=this;new o("twitter",h.twitter.utility.unifyPostData(e)).render()})},unifyPostData:function(e){var t={};if(e.id&&(t.id=e.id_str,t.dt_create=moment(e.created_at,"dd MMM DD HH:mm:ss ZZ YYYY"),t.author_link="http://twitter.com/"+e.user.screen_name,t.author_picture=e.user.profile_image_url_https,t.post_url=t.author_link+"/status/"+e.id_str,t.author_name=e.user.name,t.message=e.text,t.description="",t.link="http://twitter.com/"+e.user.screen_name+"/status/"+e.id_str,!0===r.show_media&&e.entities.media&&e.entities.media.length>0)){var i=e.entities.media[0].media_url_https;
21i&&(t.attachment='<img class="attachment" src="'+i+'" />')}return t}}},facebook:{posts:[],graph:"https://graph.facebook.com/",loaded:!1,getData:function(e){var t=function(e){p.request(e,h.facebook.utility.getPosts)},i="?fields=id,from,name,message,created_time,story,description,link";i+=!0===r.show_media?",picture,object_id":"";var a,n="&limit="+r.facebook.limit,o="&access_token="+r.facebook.access_token;switch(e[0]){case"@":var s=e.substr(1);h.facebook.utility.getUserId(s,function(e){""!==e.id&&(a=h.facebook.graph+"v2.4/"+e.id+"/posts"+i+n+o,t(a))});break;case"!":var l=e.substr(1);a=h.facebook.graph+"v2.4/"+l+"/feed"+i+n+o,t(a);break;default:t(a)}},utility:{getUserId:function(t,i){var a="https://graph.facebook.com/"+t+"?"+("&access_token="+r.facebook.access_token);e.get(a,i,"json")},prepareAttachment:function(e){var t=e.picture;return-1!==t.indexOf("_b.")||(-1!==t.indexOf("safe_image.php")?t=h.facebook.utility.getExternalImageURL(t,"url"):-1!==t.indexOf("app_full_proxy.php")?t=h.facebook.utility.getExternalImageURL(t,"src"):e.object_id&&(t=h.facebook.graph+e.object_id+"/picture/?type=normal")),'<img class="attachment" src="'+t+'" />'},getExternalImageURL:function(e,t){return-1===(e=decodeURIComponent(e).split(t+"=")[1]).indexOf("fbcdn-sphotos")?(-1!==(e=e.split("&")[0]).indexOf("fbstaging")&&(e="https://external.xx.fbcdn.net/safe_image.php?url="+encodeURIComponent(e)),e):e},getPosts:function(e){e.data&&e.data.forEach(function(e){new o("facebook",h.facebook.utility.unifyPostData(e)).render()})},unifyPostData:function(e){var t={},i=e.message?e.message:e.story;if(t.id=e.id,t.dt_create=moment(e.created_time),t.author_link="http://facebook.com/"+e.from.id,t.author_picture=h.facebook.graph+e.from.id+"/picture",t.author_name=e.from.name,t.name=e.name||"",t.message=i||"",t.description=e.description?e.description:"",t.link=e.link?e.link:"http://facebook.com/"+e.from.id,!0===r.show_media&&e.picture){var a=h.facebook.utility.prepareAttachment(e);a&&(t.attachment=a)}return t}}},google:{posts:[],loaded:!1,api:"https://www.googleapis.com/plus/v1/",getData:function(e){var t;switch(e[0]){case"#":var i=e.substr(1);t=h.google.api+"activities?query="+i+"&key="+r.google.access_token+"&maxResults="+r.google.limit,p.get_request(t,h.google.utility.getPosts);break;case"@":var a=e.substr(1);t=h.google.api+"people/"+a+"/activities/public?key="+r.google.access_token+"&maxResults="+r.google.limit,p.get_request(t,h.google.utility.getPosts)}},utility:{getPosts:function(t){t.items&&e.each(t.items,function(e){new o("google",h.google.utility.unifyPostData(t.items[e])).render()})},unifyPostData:function(t){var i={};return i.id=t.id,i.attachment="",i.description="",i.dt_create=moment(t.published),i.author_link=t.actor.url,i.author_picture=t.actor.image.url,i.author_name=t.actor.displayName,!0===r.show_media&&t.object.attachments&&e.each(t.object.attachments,function(){var e="";this.fullImage?e=this.fullImage.url:"album"===this.objectType&&this.thumbnails&&this.thumbnails.length>0&&this.thumbnails[0].image&&(e=this.thumbnails[0].image.url),i.attachment='<img class="attachment" src="'+e+'"/>'}),i.message=t.title,i.link=t.url,i}}},instagram:{posts:[],api:"https://api.instagram.com/v1/",loaded:!1,accessType:function(){return"undefined"==typeof r.instagram.access_token&&"undefined"==typeof r.instagram.client_id?(console.log("You need to define a client_id or access_token to authenticate with Instagram's API."),a):(r.instagram.access_token&&(r.instagram.client_id=a),r.instagram.access_type="undefined"==typeof r.instagram.client_id?"access_token":"client_id",r.instagram.access_type)},getData:function(e){var t;if("undefined"!==this.accessType())var i=r.instagram.access_type+"="+r.instagram[r.instagram.access_type];switch(e[0]){case"@":var a=e.substr(1);t=h.instagram.api+"users/search/?q="+a+"&"+i+"&count=1&callback=?",p.request(t,h.instagram.utility.getUsers);break;case"#":var n=e.substr(1);t=h.instagram.api+"tags/"+n+"/media/recent/?"+i+"&count="+r.instagram.limit+"&callback=?",p.request(t,h.instagram.utility.getImages);break;case"&":var o=e.substr(1);t=h.instagram.api+"users/"+o+"/?"+i+"&count="+r.instagram.limit+"&callback=?",p.request(t,h.instagram.utility.getUsers)}},utility:{getImages:function(e){e.data&&e.data.forEach(function(e){new o("instagram",h.instagram.utility.unifyPostData(e)).render()})},getUsers:function(e){if("undefined"!==r.instagram.access_type)var t=r.instagram.access_type+"="+r.instagram[r.instagram.access_type];jQuery.isArray(e.data)||(e.data=[e.data]),e.data.forEach(function(e){var i=h.instagram.api+"users/"+e.id+"/media/recent/?"+t+"&count="+r.instagram.limit+"&callback=?";p.request(i,h.instagram.utility.getImages)})},unifyPostData:function(e){var t={};return t.id=e.id,t.dt_create=moment(1e3*e.created_time),t.author_link="http://instagram.com/"+e.user.username,t.author_picture=e.user.profile_picture,t.author_name=e.user.full_name||e.user.username,t.message=e.caption&&e.caption?e.caption.text:"",t.description="",t.link=e.link,r.show_media&&(t.attachment='<img class="attachment" src="'+e.images.standard_resolution.url+'" />'),t}}},vk:{posts:[],loaded:!1,base:"http://vk.com/",api:"https://api.vk.com/method/",user_json_template:"https://api.vk.com/method/users.get?fields=first_name,%20last_name,%20screen_name,%20photo&uid=",group_json_template:"https://api.vk.com/method/groups.getById?fields=first_name,%20last_name,%20screen_name,%20photo&gi
21d=",getData:function(e){var t;switch(e[0]){case"@":var i=e.substr(1);t=h.vk.api+"wall.get?owner_id="+i+"&filter="+r.vk.source+"&count="+r.vk.limit+"&callback=?",p.get_request(t,h.vk.utility.getPosts);break;case"#":var a=e.substr(1);t=h.vk.api+"newsfeed.search?q="+a+"&count="+r.vk.limit+"&callback=?",p.get_request(t,h.vk.utility.getPosts)}},utility:{getPosts:function(t){t.response&&e.each(t.response,function(){if(this!=parseInt(this)&&"post"===this.post_type){var e=this.owner_id?this.owner_id:this.from_id,i=e>0?h.vk.user_json_template+e+"&callback=?":h.vk.group_json_template+-1*e+"&callback=?",a=this;p.get_request(i,function(e){h.vk.utility.unifyPostData(e,a,t)})}})},unifyPostData:function(e,t,i){var a={};if(a.id=t.id,a.dt_create=moment.unix(t.date),a.description=" ",a.message=p.stripHTML(t.text),r.show_media&&t.attachment&&("link"===t.attachment.type&&(a.attachment='<img class="attachment" src="'+t.attachment.link.image_src+'" />'),"video"===t.attachment.type&&(a.attachment='<img class="attachment" src="'+t.attachment.video.image_big+'" />'),"photo"===t.attachment.type&&(a.attachment='<img class="attachment" src="'+t.attachment.photo.src_big+'" />')),t.from_id>0){var n=h.vk.user_json_template+t.from_id+"&callback=?";p.get_request(n,function(e){new o("vk",h.vk.utility.getUser(e,a,t,i)).render()})}else{var s=h.vk.group_json_template+-1*t.from_id+"&callback=?";p.get_request(s,function(e){new o("vk",h.vk.utility.getGroup(e,a,t,i)).render()})}},getUser:function(e,t,i){return t.author_name=e.response[0].first_name+" "+e.response[0].last_name,t.author_picture=e.response[0].photo,t.author_link=h.vk.base+e.response[0].screen_name,t.link=h.vk.base+e.response[0].screen_name+"?w=wall"+i.from_id+"_"+i.id,t},getGroup:function(e,t,i){return t.author_name=e.response[0].name,t.author_picture=e.response[0].photo,t.author_link=h.vk.base+e.response[0].screen_name,t.link=h.vk.base+e.response[0].screen_name+"?w=wall-"+e.response[0].gid+"_"+i.id,t}}},blogspot:{loaded:!1,getData:function(e){switch(e[0]){case"@":var t=e.substr(1);request("http://"+t+".blogspot.com/feeds/posts/default?alt=json-in-script&callback=?",getPosts)}},utility:{getPosts:function(t){e.each(t.feed.entry,function(){var e={},t=this;e.id=t.id.$t.replace(/[^a-z0-9]/gi,""),e.dt_create=moment(t.published.$t),e.author_link=t.author[0].uri.$t,e.author_picture="http:"+t.author[0].gd$image.src,e.author_name=t.author[0].name.$t,e.message=t.title.$t+"</br></br>"+stripHTML(t.content.$t),e.description="",e.link=t.link.pop().href,r.show_media&&t.media$thumbnail&&(e.attachment='<img class="attachment" src="'+t.media$thumbnail.url+'" />'),e.render()})}}},pinterest:{posts:[],loaded:!1,apiv1:"https://api.pinterest.com/v1/",getData:function(e){var t,i="limit="+r.pinterest.limit,a="fields=id,created_at,link,note,creator(url,first_name,last_name,image),image"+"&access_token="+r.pinterest.access_token+"&"+i+"&callback=?";switch(e[0]){case"@":var n=e.substr(1);t="me"===n?h.pinterest.apiv1+"me/pins/?"+a:h.pinterest.apiv1+"boards/"+n+"/pins?"+a}p.request(t,h.pinterest.utility.getPosts)},utility:{getPosts:function(e){e.data.forEach(function(e){new o("pinterest",h.pinterest.utility.unifyPostData(e)).render()})},unifyPostData:function(e){var t={};return t.id=e.id,t.dt_create=moment(e.created_at),t.author_link=e.creator.url,t.author_picture=e.creator.image["60x60"].url,t.author_name=e.creator.first_name+e.creator.last_name,t.message=e.note,t.description="",t.social_network="pinterest",t.link=e.link?e.link:"https://www.pinterest.com/pin/"+e.id,r.show_media&&(t.attachment='<img class="attachment" src="'+e.image.original.url+'" />'),t}}},rss:{posts:[],loaded:!1,api:"https://query.yahooapis.com/v1/public/yql?q=",datatype:"json",getData:function(e){var t=r.rss.limit,i=encodeURIComponent("select entry FROM feednormalizer where url='"+e+"' AND output='atom_1.0' | truncate(count="+t+")"),a=h.rss.api+i+"&format=json&callback=?";p.request(a,h.rss.utility.getPosts,h.rss.datatype)},utility:{getPosts:function(t){t.query.count>0&&e.each(t.query.results.feed,function(e,t){new o("rss",h.rss.utility.unifyPostData(e,t)).render()})},unifyPostData:function(e,t){var i=t;t.entry!==a&&(i=t.entry);var n={};return n.id='"'+i.id+'"',n.dt_create=moment(i.published,"YYYY-MM-DDTHH:mm:ssZ","en"),n.author_link="",n.author_picture="",n.author_name="",i.creator!==a&&(n.author_name=i.creator),n.message=i.title,n.description="",i.summary!==a&&(n.description=p.stripHTML(i.summary.content)),n.social_network="rss",n.link=i.link.href,r.show_media&&i.thumbnail!==a&&(n.attachment='<img class="attachment" src="'+i.thumbnail.url+'" />'),n}}}};return this.each(function(){h.init(),r.update_period&&setInterval(function(){return h.init()},r.update_period)})}}(jQuery),
22/**
23 * jQuery Detect Timezone plugin (from https://github.com/scottwater/detect_timezone_rails)
24 * 
25 * Copyright (c) 2011 Scott Watermasysk ([email protected])
26 * Provided under the Do Whatever You Want With This Code License. (same as detect_timezone).
27 *
28 */
29function(e){e.fn.set_timezone=function(e){return this.val(this.get_timezone(e)),this},e.fn.get_timezone=function(t){var i={format:"olson",debug:!1,"default":"America/Ne
29w_York"};t&&e.extend(i,t);var a=jstz.determine_timezone().timezone,n=i["default"];switch("undefined"!=a?(a.ambiguity_check(),n=a.olson_tz):i.debug&&alert("no timezone to be found. using default."),i.format){case"city":return n.split("/")[1];default:return n}}}(jQuery),function(e,t){"use strict";function i(t,i){e(t).is(":checkbox")&&(this.element=e(t),this.settings=e.extend({},n,i),this._create())}var a="tristate",n={change:t,checked:t,indeterminate:t,init:t,state:t,unchecked:t,value:t},o=e.fn.val;e.extend(i.prototype,{_create:function(){var t,i=this;return window.navigator.userAgent.indexOf("Trident")>=0&&this.element.click(function(){!this.indeterminate&&e(this).attr("indeterminate")&&e(this).trigger("change")}),this.element.change(function(e){switch(!e.isTrigger&&e.hasOwnProperty("which")||e.preventDefault(),i.settings.state){case!0:i.settings.state=null;break;case!1:i.settings.state=!0;break;default:i.settings.state=!1}i._refresh(i.settings.change)}),this.settings.checked=this.element.attr("checkedvalue")||this.settings.checked,this.settings.unchecked=this.element.attr("uncheckedvalue")||this.settings.unchecked,this.settings.indeterminate=this.element.attr("indeterminatevalue")||this.settings.indeterminate,"undefined"==typeof this.settings.state&&(this.settings.state=void 0!==this.element.attr("indeterminate")?null:this.element.is(":checked")),"undefined"!=typeof this.settings.value&&void 0!==(t=this._parseValue(this.settings.value))&&(this.settings.state=t),this._refresh(this.settings.init),this},_refresh:function(t){var i=this.value();this.element.data("vanderlee."+a,i),this.element[null===this.settings.state?"attr":"removeAttr"]("indeterminate","indeterminate"),this.element.prop("indeterminate",null===this.settings.state),this.element.get(0).indeterminate=null===this.settings.state,this.element[this.settings.state?"attr":"removeAttr"]("checked",!0),this.element.prop("checked",!0===this.settings.state),e.isFunction(t)&&t.call(this.element,this.settings.state,this.value())},state:function(e){return void 0===e?this.settings.state:(!0!==e&&!1!==e&&null!==e||(this.settings.state=e,this._refresh(this.settings.change)),this)},_parseValue:function(e){return e===this.settings.checked||e!==this.settings.unchecked&&(e===this.settings.indeterminate?null:void 0)},value:function(e){if(void 0===e){switch(this.settings.state){case!0:e=this.settings.checked;break;case!1:e=this.settings.unchecked;break;case null:e=this.settings.indeterminate}return void 0===e?this.element.attr("value"):e}var t=this._parseValue(e);void 0!==t&&(this.settings.state=t,this._refresh(this.settings.change))}}),e.fn[a]=function(t,n){var o=this;return this.each(function(){if(e.data(this,"plugin.vanderlee."+a)){if("string"==typeof t){if(void 0===n)return o=e(this).data("plugin.vanderlee."+a)[t](),!1;e(this).data("plugin.vanderlee."+a)[t](n)}}else e.data(this,"plugin.vanderlee."+a,new i(this,t))}),o},e.fn.val=function(e){var t=this.data("vanderlee."+a);return void 0===t?void 0===e?o.call(this):o.call(this,e):void 0===e?t:(this.data("vanderlee."+a,e),this)},e.expr.filters.indeterminate=function(t){var i=e(t);return void 0!==i.data("vanderlee."+a)&&i.prop("indeterminate")},e.expr.filters.determinate=function(t){return!e.expr.filters.indeterminate(t)},e.expr.filters.tristate=function(t){return void 0!==e(t).data("vanderlee."+a)}}(jQuery),function(e){"use strict";var t=function(){this.VERSION="4.1.0",this.AUTHOR="Revox",this.SUPPORT="[email protected]",this.pageScrollElement="html, body",this.$body=e("body"),this.setUserOS(),this.setUserAgent()};t.prototype.setUserOS=function(){var e="";-1!=navigator.appVersion.indexOf("Win")&&(e="windows"),-1!=navigator.appVersion.indexOf("Mac")&&(e="mac"),-1!=navigator.appVersion.indexOf("X11")&&(e="unix"),-1!=navigator.appVersion.indexOf("Linux")&&(e="linux"),this.$body.addClass(e)},t.prototype.setUserAgent=function(){navigator.userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i)?this.$body.addClass("mobile"):(this.$body.addClass("desktop"),navigator.userAgent.match(/MSIE 9.0/)&&this.$body.addClass("ie9"))},t.prototype.isVisibleXs=function(){return!e("#pg-visible-xs").length&&this.$body.append('<div id="pg-visible-xs" class="visible-xs" />'),e("#pg-visible-xs").is(":visible")},t.prototype.isVisibleSm=function(){return!e("#pg-visible-sm").length&&this.$body.append('<div id="pg-visible-sm" class="visible-sm" />'),e("#pg-visible-sm").is(":visible")},t.prototype.isVisibleMd=function(){return!e("#pg-visible-md").length&&this.$body.append('<div id="pg-visible-md" class="visible-md" />'),e("#pg-visible-md").is(":visible")},t.prototype.isVisibleLg=function(){return!e("#pg-visible-lg").length&&this.$body.append('<div id="pg-visible-lg" class="visible-lg" />'),e("#pg-visible-lg").is(":visible")},t.prototype.getUserAgent=function(){return e("body").hasClass("mobile")?"mobile":"desktop"},t.prototype.setFullScreen=function(e){var t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullscreen;if(t)t.call(e);else if("undefined"!=typeof window.ActiveXObject){var i=new ActiveXObject("WScript.Shell");null!==i&&i.SendKeys("{F11}")}},t.prototype.getColor=function(t,i){i=parseFloat(i)||1;var a=e(".pg-colors").length?e(".pg-colors"):e('<div class="pg-colors"></div>').appendTo("body"),n=(t=(a.find('[data-color="'+t+'"]').length?a.find('[data-color="'+t+'"]'):e('<div class="bg-'+t+'" data-color="'+t+'"></div>').appendTo(a)).css("background-color")).match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);return"rgba("+n[1]+", "+n[2]+", "+n[3]+", "+i+")"},t.prototype.initSidebar=function(t){e('[data-pages="sidebar"]',t).each(function(){var t=e(this);t.sidebar(t.data())})},t.prototype.initDropDown=function(t){e(".dropdown-default",t).each(function(){var t=e(this).find(".dropdown-menu").siblings(".dropdown-toggle"),i=0,a=e(this).find(".dropdown-menu").actual("outerWidth");t.actual("outerWidth")<a?(t.width(a-i),e(this).find(".dropdown-menu").width(t.actual("outerWidth"))):e(this).find(".dropdown-menu").width(t.actual("outerWidth"))})},t.prototype.initFormGroupDefault=function(t){e(".form-group.form-group-default",t).click(function(){e(this).find("input").focus()}),this.initFormGroupDefaultRun||(e("body").on("focus",".form-group.form-group-default :input",function(){e(".form-group.form-group-default").removeClass("focused"),e(this).parents(".form-group").addClass("focused")}),e("body").on("blur",".form-group.form-group-default :input",function(){e(this).parents(".form-group").removeClass("focused"),e(this).val()?e(this).closest(".form-group").find("label").addClass("fade"):e(this).closest(".form-group").find("label").removeClass("fade")}),this.initFormGroupDefaultRun=!0),e(".form-group.form-group-default .checkbox, .form-group.form-group-default .radio",t).hover(function(){e(this).parents(".form-group").addClass("focused")},function(){e(this).parents(".form-group").removeClass("focused")})},t.prototype.initSlidingTabs=function(t){e('a[data-toggle="tab"]',t).on("show.bs.tab",function(t){var i=(t=e(t.target).parent().find("a[data-toggle=tab]")).data("target");
29i===undefined&&(i=t.attr("href")),e(i).is(".slide-left, .slide-right")&&(e(i).addClass("sliding"),setTimeout(function(){e(i).removeClass("sliding")},100))})},t.prototype.reponsiveTabs=function(){e('[data-init-reponsive-tabs="dropdownfx"]').each(function(){var t=e(this);t.addClass("d-none d-md-flex d-lg-flex d-xl-flex");for(var i='<select class="cs-select cs-skin-slide full-width" data-init-plugin="cs-select">',a=1;a<=t.children("li").length;a++){var n=t.children("li:nth-child("+a+")"),o="";n.children("a").hasClass("active")&&(o="selected");var s=n.children("a").attr("href");"#"==s&&(s=n.children("a").attr("data-target")),i+='<option value="'+s+'" '+o+">",i+=n.children("a").text(),i+="</option>"}i+="</select>",t.after(i);var r=t.next()[0];e(r).on("change",function(){e("option:selected",this);var i=this.value,a=t.find('a[data-target="'+i+'"]');0==a.length&&(a=t.find('a[data-target="'+i+'"]')),a.tab("show")}),e(r).wrap('<div class="nav-tab-dropdown cs-wrapper full-width d-lg-none d-xl-none d-md-none"></div>'),new SelectFx(r)})},t.prototype.initNotificationCenter=function(){e("body").on("click",".notification-list .dropdown-menu",function(e){e.stopPropagation()}),e("body").on("click",".toggle-more-details",function(){var t=e(this).closest(".heading");t.closest(".heading").children(".more-details").stop().slideToggle("fast",function(){t.toggleClass("open")})})},t.prototype.initProgressBars=function(){e(window).on("load",function(){e(".progress-bar-indeterminate, .progress-circle-indeterminate, .mapplic-pin").hide().show(0)})},t.prototype.initInputFile=function(){e(document).on("change",".btn-file :file",function(){var t=e(this),i=t.get(0).files?t.get(0).files.length:1,a=t.val().replace(/\\/g,"/").replace(/.*\//,"");t.trigger("fileselect",[i,a])}),e(".btn-file :file").on("fileselect",function(t,i,a){var n=e(this).parents(".input-group").find(":text"),o=i>1?i+" files selected":a;n.length?n.val(o):e(this).parent().html(o)})},t.prototype.initHorizontalMenu=function(){function t(){var t=e("[data-pages-init='horizontal-menu']"),a=parseInt(t.data("hideExtraLi"))||0;if(0!=t.length){var n=t[0].getBoundingClientRect(),o=0,s=0;if(t.children("ul").children("li.more").remove(),t.children("ul").children("li").each(function(){e(this).removeAttr("style"),o+=e(this).outerWidth(!0),s++}),!(e(window).width()<992)){var r=parseInt(n.width/(o/s))-1;if(s>(r-=a))for(var l=i(t),d=r;d<s;d++){var c=t.children("ul").children("li").eq(d),u=c.clone();u.children("ul").addClass("sub-menu"),l.children("ul").append(u),c.hide()}}}}function i(e){e.children("ul").append("<li class='more'><a href='javascript:;'><span class='title'><i class='pg pg-more'></i></span></a><ul></ul></li>");return e.children("ul").children("li.more")}function a(t){var i=e(t.children("ul")[0]),a=e("<div class='ghost-nav-dropdown'></div>");if(0!=i.length){var n=i[0].getBoundingClientRect();a.css({width:n.width+"px",height:n.height+"px","z-index":"auto"}),t.append(a);var s=i.children("li").css("transition-duration");s=parseInt(1e3*parseFloat(s)),t.addClass("closing"),window.clearTimeout(o),o=window.setTimeout(function(){a.height(0),t.removeClass("open opening closing")},s-80)}}function n(t){var i=e(t.children("ul")[0]),a=e("<div class='ghost-nav-dropdown'></div>");if(t.children(".ghost-nav-dropdown").remove(),t.addClass("open").siblings().removeClass("open opening"),0!=i.length){var n=i[0].getBoundingClientRect();a.css({width:n.width+"px",height:"0px"}),t.append(a),a.height(n.height);var s=a.css("transition-duration");s=parseInt(1e3*parseFloat(s)),window.clearTimeout(o),o=window.setTimeout(function(){t.addClass("opening"),a.remove()},s)}}var o,s;e("[data-pages-init='horizontal-menu']");t(),e(document).on("click",".menu-bar > ul > li",function(){if(0!=e(this).children("ul").length)if(e(window).width()<992){var t=e(".menu-bar"),i=e(this),o=(t.find("li"),e(this).children("ul"));i.hasClass("open active")?(i.find(".arrow").removeClass("open active"),o.slideUp(200,function(){i.removeClass("open active")})):(t.find("li.open").find("ul").slideUp(200),t.find("li.open").find("a").find(".arrow").removeClass("open active"),t.find("li.open").removeClass("open active"),i.find(".arrow").addClass("open active"),o.slideDown(200,function(){i.addClass("open active")}))}else e(this).hasClass("opening")?a(e(this)):n(e(this))}),e(window).on("resize",function(){clearTimeout(s),s=setTimeout(function(){t()},250)}),e(".content").on("click",function(){e(".horizontal-menu .bar-inner > ul > li").removeClass("open"),e(".menu-bar > ul > li").removeClass("open opening").children("ul").removeAttr("style"),e("body").find(".ghost-nav-dropdown").remove()}),e('[data-toggle="horizontal-menu"]').on("click touchstart",function(t){t.preventDefault(),e("body").toggleClass("horizontal-menu
29-open"),e(".horizontal-menu-backdrop").length?e(".horizontal-menu-backdrop").fadeToggle("fast",function(){e(this).remove()}):(e(".header").append('<div class="horizontal-menu-backdrop"/>'),e(".horizontal-menu-backdrop").fadeToggle("fast")),e(".menu-bar").toggleClass("open")})},t.prototype.initTooltipPlugin=function(t){e.fn.tooltip&&e('[data-toggle="tooltip"]',t).tooltip()},t.prototype.initSelect2Plugin=function(t){e.fn.select2&&e('[data-init-plugin="select2"]',t).each(function(){e(this).select2({minimumResultsForSearch:"true"==e(this).attr("data-disable-search")?-1:1}).on("select2:open",function(){e.fn.scrollbar&&e(".select2-results__options").scrollbar({ignoreMobile:!1})})})},t.prototype.initScrollBarPlugin=function(t){e.fn.scrollbar&&e(".scrollable",t).scrollbar({ignoreOverlay:!1})},t.prototype.initListView=function(t){e.fn.ioslist&&e('[data-init-list-view="ioslist"]',t).ioslist(),e.fn.scrollbar&&e(".list-view-wrapper",t).scrollbar({ignoreOverlay:!1})},t.prototype.initSwitcheryPlugin=function(t){window.Switchery&&e('[data-init-plugin="switchery"]',t).each(function(){var t=e(this);new Switchery(t.get(0),{color:null!=t.data("color")?e.Pages.getColor(t.data("color")):e.Pages.getColor("success"),size:null!=t.data("size")?t.data("size"):"default"})})},t.prototype.initSelectFxPlugin=function(t){window.SelectFx&&e('select[data-init-plugin="cs-select"]',t).each(function(){var t=e(this).get(0);e(t).wrap('<div class="cs-wrapper"></div>'),new SelectFx(t)})},t.prototype.initUnveilPlugin=function(t){e.fn.unveil&&e("img",t).unveil()},t.prototype.initValidatorPlugin=function(){e.validator&&e.validator.setDefaults({ignore:"",showErrors:function(t,i){var a=this;return e.each(this.successList,function(t,i){if(e(this).closest(".form-group-attached").length)return e(i).popover("hide")}),e.each(i,function(t,i){var n;if(!(n=e(i.element).closest(".form-group-attached")).length)return a.defaultShowErrors();e(i.element).popover({trigger:"manual",placement:"top",html:!0,container:n.closest("form"),content:i.message}),(n=e(i.element).closest(".form-group")).addClass("has-error"),e(i.element).popover("show")})},onfocusout:function(t){var i=e(t).closest(".form-group");e(t).valid()&&(i.removeClass("has-error"),i.next(".error").remove())},onkeyup:function(t){var i=e(t).closest(".form-group");e(t).valid()?(e(t).removeClass("error"),i.removeClass("has-error"),i.next("label.error").remove(),i.find("label.error").remove()):i.addClass("has-error")},errorPlacement:function(t,i){var a=e(i).closest(".form-group");a.hasClass("form-group-default")?(a.addClass("has-error"),t.insertAfter(a)):i.parent().hasClass("checkbox")?t.insertAfter(i.parent()):t.insertAfter(i)}})},t.prototype.setBackgroundImage=function(){e("[data-pages-bg-image]").each(function(){var t=e(this),i={pagesBgImage:"",lazyLoad:"true",progressType:"",progressColor:"",bgOverlay:"",bgOverlayClass:"",overlayOpacity:0},a=t.data();e.extend(i,a);var n=i.pagesBgImage,o=i.bgOverlay,s=i.overlayOpacity,r=e('<div class="bg-overlay"></div>');r.addClass(i.bgOverlayClass),r.css({"background-color":o,opacity:1}),t.append(r);var l=new Image;l.src=n,l.onload=function(){t.css({"background-image":"url("+n+")"}),t.children(".bg-overlay").css({opacity:s})}})},t.prototype.secondarySidebar=function(){e('[data-init="secondary-sidebar"]').each(function(){e(this).on("click",".main-menu li a",function(){if(!1!==e(this).parent().children(".sub-menu")){var t=e(this),i=e(this).parent().parent(),a=e(this).parent(),n=e(this).parent().children(".sub-menu");a.hasClass("open active")?(t.children(".arrow").removeClass("open active"),n.slideUp(200,function(){a.removeClass("open active")})):(i.children("li.open").children(".sub-menu").slideUp(200),i.children("li.open").children("a").children(".arrow").removeClass("open active"),i.children("li.open").removeClass("open active"),t.children(".arrow").addClass("open active"),n.slideDown(200,function(){a.addClass("open active")}))}})}),e('[data-init="secondary-sidebar-toggle"]').each(function(){e(this).on("click",function(){var t=e(this).get(0).getBoundingClientRect(),i=e('[data-init="secondary-sidebar"]');if(i.hasClass("open"))i.removeClass("open"),i.removeAttr("style");else{i.addClass("open");var a=i.get(0).getBoundingClientRect();i.css({top:t.bottom,"max-height":e(window).height()-t.bottom,left:e(window).width()/2-a.width/2,visibility:"visible"})}})})},t.prototype.init=function(){this.initSidebar(),this.initDropDown(),this.initFormGroupDefault(),this.initSlidingTabs(),this.initProgressBars(),this.initTooltipPlugin(),this.initScrollBarPlugin(),this.initUnveilPlugin(),this.initValidatorPlugin(),this.initListView(),this.reponsiveTabs()},e.Pages=new t,e.Pages.Constructor=t}(window.jQuery),function(e){"use strict";function t(e,t){if(!e)return!1;for(var i=e.target||e.srcElement||e||!1;i&&i!=t;)i=i.parentNode||!1;return!1!==i}function i(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function a(e,t){this.el=e,this.options=i({},this.options),i(this.options,t),this._init()}function n(e,t){for(var i=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector;e;){if(i.bind(e)(t))return e;e=e.parentElement}return!1}function o(t){return{left:t.getBoundingClientRect().left+e.pageXOffset-t.ownerDocument.documentElement.clientLeft,top:t.getBoundingClientRect().top+e.pageYOffset-t.ownerDocument.documentElement.clientTop}}function s(e,t){t.parentNode.insertBefore(e,t.nextSibling)}a.prototype.options={newTab:!0,stickyPlaceholder:!0,container:"body",onChange:function(e){var t=document.createEvent("HTMLEvents");t.initEvent("change",!0,!1),e.dispatchEvent(t)}},a.prototype._init=function(){var e=document.querySelector("option[selected]");this.hasDefaultPlaceholder=e&&e.disabled,this.selectedOpt=e||this.el.querySelector("option"),this._createSelectEl(),this.selOpts=[].slice.call(this.selEl.querySelectorAll("li[data-option]")),this.selOptsCount=this.selOpts.length,this.current=this.selOpts.indexOf(this.selEl.querySelector("li.cs-selected"))||-1,this.selPlaceholder=this.selEl.querySelector("span.cs-placeholder"),this._initEvents(),this.el.onchange=function(){var e=this.selectedIndex;this.children[e].innerHTML.trim()}},a.prototype._createSelectEl=function(){var e="",t=function(e){var t="",i="",a="";return!e.selectedOpt||this.foundSelected||this.hasDefaultPlaceholder||(i+="cs-selected ",this.foundSelected=!0),e.getAttribute("data-class")&&(i+=e.getAttribute("data-class")),e.getAttribute("data-link")&&(a="data-link="+e.getAttribute("data-link")),""!==i&&(t='class="'+i+'" '),"<li "+t+a+' data-option data-value="'+e.value+'"><span>'+e.textContent+"</span></li>"};
29[].slice.call(this.el.children).forEach(function(i){if(!i.disabled){var a=i.tagName.toLowerCase();"option"===a?e+=t(i):"optgroup"===a&&(e+='<li class="cs-optgroup"><span>'+i.label+"</span><ul>",[].slice.call(i.children).forEach(function(i){e+=t(i)}),e+="</ul></li>")}});var i='<div class="cs-options"><ul>'+e+"</ul></div>";this.selEl=document.createElement("div"),this.selEl.className=this.el.className,this.selEl.tabIndex=this.el.tabIndex,this.selEl.innerHTML='<span class="cs-placeholder">'+this.selectedOpt.textContent+"</span>"+i,this.el.parentNode.appendChild(this.selEl),this.selEl.appendChild(this.el);var a=document.createElement("div");a.className="cs-backdrop",this.selEl.appendChild(a)},a.prototype._initEvents=function(){var e=this;this.selPlaceholder.addEventListener("click",function(){e._toggleSelect()}),this.selOpts.forEach(function(t,i){t.addEventListener("click",function(){e.current=i,e._changeOption(),e._toggleSelect()})}),document.addEventListener("click",function(i){var a=i.target;e._isOpen()&&a!==e.selEl&&!t(a,e.selEl)&&e._toggleSelect()}),this.selEl.addEventListener("keydown",function(t){switch(t.keyCode||t.which){case 38:t.preventDefault(),e._navigateOpts("prev");break;case 40:t.preventDefault(),e._navigateOpts("next");break;case 32:t.preventDefault(),e._isOpen()&&"undefined"!=typeof e.preSelCurrent&&-1!==e.preSelCurrent&&e._changeOption(),e._toggleSelect();break;case 13:t.preventDefault(),e._isOpen()&&"undefined"!=typeof e.preSelCurrent&&-1!==e.preSelCurrent&&(e._changeOption(),e._toggleSelect());break;case 27:t.preventDefault(),e._isOpen()&&e._toggleSelect()}})},a.prototype._navigateOpts=function(e){this._isOpen()||this._toggleSelect();var t="undefined"!=typeof this.preSelCurrent&&-1!==this.preSelCurrent?this.preSelCurrent:this.current;("prev"===e&&t>0||"next"===e&&t<this.selOptsCount-1)&&(this.preSelCurrent="next"===e?t+1:t-1,this._removeFocus(),classie.add(this.selOpts[this.preSelCurrent],"cs-focus"))},a.prototype._toggleSelect=function(){var e=this.selEl.querySelector(".cs-backdrop"),t=document.querySelector(this.options.container),i=t.querySelector(".dropdown-mask"),a=this.selEl.querySelector(".cs-options"),r=this.selEl.querySelector(".cs-placeholder"),l=r.offsetWidth,d=r.offsetHeight,c=a.scrollWidth;if(this._isOpen()){-1!==this.current&&(this.selPlaceholder.textContent=this.selOpts[this.current].textContent);var u=(h=this.selEl.data).parentNode;s(this.selEl,h),this.selEl.removeAttribute("style"),u.removeChild(h);this.selEl.clientHeight;e.style.transform=e.style.webkitTransform=e.style.MozTransform=e.style.msTransform=e.style.OTransform="scale3d(1,1,1)",classie.remove(this.selEl,"cs-active"),i.style.display="none",a.style.overflowY="hidden",a.style.width="auto";var p=n(this.selEl,".form-group");p&&classie.removeClass(p,"focused")}else{var h;this.hasDefaultPlaceholder&&this.options.stickyPlaceholder&&(this.selPlaceholder.textContent=this.selectedOpt.textContent),this.selEl.parentNode.querySelector(".dropdown-placeholder")?h=this.selEl.parentNode.querySelector(".dropdown-placeholder"):(h=document.createElement("div"),classie.add(h,"dropdown-placeholder"),s(h,this.selEl)),h.style.height=d+"px",h.style.width=this.selEl.offsetWidth+"px",this.selEl.data=h,this.selEl.style.position="absolute";var m=o(this.selEl);this.selEl.style.left=m.left+"px",this.selEl.style.top=m.top+"px",t.appendChild(this.selEl);var f=a.offsetHeight,g=r.offsetHeight,v=(a.offsetWidth,r.offsetWidth,f/g);e.style.transform=e.style.webkitTransform=e.style.MozTransform=e.style.msTransform=e.style.OTransform="scale3d(1, "+v+", 1)",i||(i=document.createElement("div"),classie.add(i,"dropdown-mask"),t.appendChild(i)),i.style.display="block",classie.add(this.selEl,"cs-active");var b=l<c?c:l;this.selEl.style.width=b+"px",this.selEl.style.height=g+"px",a.style.width="100%",setTimeout(function(){a.style.overflowY="auto"},300)}},a.prototype._changeOption=function(){"undefined"!=typeof this.preSelCurrent&&-1!==this.preSelCurrent&&(this.current=this.preSelCurrent,this.preSelCurrent=-1);var t=this.selOpts[this.current];this.selPlaceholder.textContent=t.textContent,this.el.value=t.getAttribute("data-value");var i=this.selEl.querySelector("li.cs-selected");i&&classie.remove(i,"cs-selected"),classie.add(t,"cs-selected"),t.getAttribute("data-link")&&(this.options.newTab?e.open(t.getAttribute("data-link"),"_blank"):e.location=t.getAttribute("data-link")),this.options.onChange(this.el)},a.prototype._isOpen=function(){return classie.has(this.selEl,"cs-active")},a.prototype._removeFocus=function(){var e=this.selEl.querySelector("li.cs-focus");e&&classie.remove(e,"cs-focus")},e.SelectFx=a}(window),function(e){"use strict";e("[data-chat-input]").on("keypress",function(t){if(13==t.which){var i=e(this).attr("data-chat-conversation");e(i).append('<div class="message clearfix"><div class="chat-bubble from-me">'+e(this).val()+"</div></div>"),e(this).val("")}})}(window.jQuery),function(e){"use strict";function t(t){return this.filter(":input").each(function(){var i=e(this),n=i.data("pg.circularProgress"),o="object"==typeof t&&t;n||i.data("pg.circularProgress",n=new a(this,o)),"string"==typeof t?n[t]():o.hasOwnProperty("value")&&n.value(o.value)})}function i(e){return parseInt(e/100*360)}var a=function(t,a){this.$element=e(t),this.options=e.extend(!0,{},e.fn.circularProgress.defaults,a),this.$container=e('<div class="progress-circle"></div>'),this.$element.attr("data-color")&&this.$container.addClass("progress-circle-"+this.$element.attr("data-color")),this.$element.attr("data-thick")&&this.$container.addClass("progress-circle-thick"),this.$pie=e('<div class="pie"></div>'),this.$pie.$left=e('<div class="left-side half-circle"></div>'),this.$pie.$right=e('<div class="right-side half-circle"></div>'),this.$pie.append(this.$pie.$left).append(this.$pie.$right),this.$container.append(this.$pie).append('<div class="shadow"></div>'),this.$element.after(this.$container),this.val=this.$element.val();var n=i(this.val);this.val<=50?this.$pie.$right.css("transform","rotate("+n+"deg)"):(this.$pie.css("clip","rect(auto, auto, auto, auto)"),this.$pie.$right.css("transform","rotate(180deg)"),this.$pie.$left.css("transform","rotate("+n+"deg)"))};a.VERSION="1.0.0",a.prototype.value=function(e){if(void 0!==e){var t=i(e);this.$pie.removeAttr("style"),this.$pie.$right.removeAttr("style"),this.$pie.$left.removeAttr("style"),e<=50?this.$pie.$right.css("transform","rotate("+t+"deg)"):(this.$pie.css("clip","rect(auto, auto, auto, auto)"),this.$pie.$right.css("transform","rotate(180deg)"),this.$pie.$left.css("transform","rotate("+t+"deg)"))}};var n=e.fn.circularProgress;
29e.fn.circularProgress=t,e.fn.circularProgress.Constructor=a,e.fn.circularProgress.defaults={value:0},e.fn.circularProgress.noConflict=function(){return e.fn.circularProgress=n,this},e(window).on("load",function(){e('[data-pages-progress="circle"]').each(function(){var t=e(this);t.circularProgress(t.data())})})}(window.jQuery),function(e){"use strict";var t=function(t,i){function a(){if(l.notification.addClass("pgn-simple"),l.alert.append(l.options.message),l.options.showClose){var t=e('<button type="button" class="close" data-dismiss="alert"></button>').append('<span aria-hidden="true">&times;</span>').append('<span class="sr-only">Close</span>');l.alert.prepend(t)}}function n(){l.notification.addClass("pgn-bar"),l.alert.addClass("alert-"+l.options.type);var t="";if(l.options.showClose&&(t=e('<button type="button" class="close" data-dismiss="alert"></button>').append('<span aria-hidden="true">&times;</span>').append('<span class="sr-only">Close</span>')),e("body").hasClass("horizontal-app-menu")){var i=e('<div class="container"/>');i.append("<span>"+l.options.message+"</span>"),i.append(t),l.alert.append(i)}else l.alert.append(l.options.message),l.alert.prepend(t)}function o(){l.notification.addClass("pgn-circle");var e="<div>";l.options.thumbnail&&(e+='<div class="pgn-thumbnail"><div>'+l.options.thumbnail+"</div></div>"),e+='<div class="pgn-message"><div>',l.options.title&&(e+='<p class="bold">'+l.options.title+"</p>"),e+="<p>"+l.options.message+"</p></div></div>",e+="</div>",l.options.showClose&&(e+='<button type="button" class="close" data-dismiss="alert">',e+='<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>',e+="</button>"),l.alert.append(e),l.alert.after('<div class="clearfix"></div>')}function s(){if(l.notification.addClass("pgn-flip"),l.alert.append("<span>"+l.options.message+"</span>"),l.options.showClose){var t=e('<button type="button" class="close" data-dismiss="alert"></button>').append('<span aria-hidden="true">&times;</span>').append('<span class="sr-only">Close</span>');l.alert.prepend(t)}}function r(){var t=e(".header").get(0),i=e(t).height();/top/.test(l.options.position)&&l.wrapper.css("top",i)}var l=this;return l.container=e(t),l.notification=e('<div class="pgn push-on-sidebar-open"></div>'),l.options=e.extend(!0,{},e.fn.pgNotification.defaults,i),l.container.find(".pgn-wrapper[data-position="+this.options.position+"]").length?l.wrapper=e(".pgn-wrapper[data-position="+this.options.position+"]"):(l.wrapper=e('<div class="pgn-wrapper" data-position="'+this.options.position+'"></div>'),l.container.append(l.wrapper)),l.alert=e('<div class="alert"></div>'),l.alert.addClass("alert-"+l.options.type),"bar"==l.options.style?new n:"flip"==l.options.style?new s:"circle"==l.options.style?new o:(l.options.style,new a),l.notification.append(l.alert),r(),e(window).on("resize",r),l.alert.on("closed.bs.alert",function(){l.notification.remove(),l.options.onClosed()}),this};t.VERSION="1.0.0",t.prototype.show=function(){if(this.wrapper.prepend(this.notification),this.options.onShown(),0!=this.options.timeout){var t=this;setTimeout(function(){this.notification.fadeOut("slow",function(){e(this).remove(),t.options.onClosed()})}.bind(this),this.options.timeout)}},e.fn.pgNotification=function(e){return new t(this,e)},e.fn.pgNotification.defaults={style:"simple",message:null,position:"top-right",type:"info",showClose:!0,timeout:4e3,onShown:function(){},onClosed:function(){}}}(window.jQuery),function(e){"use strict";function t(t){return this.each(function(){var a=e(this),n=a.data("pg.card"),o="object"==typeof t&&t;n||a.data("pg.card",n=new i(this,o)),"string"==typeof t?n[t]():o.hasOwnProperty("refresh")?n.refresh(o.refresh):o.hasOwnProperty("error")&&n.error(o.error)})}var i=function(t,i){this.$element=e(t),this.options=e.extend(!0,{},e.fn.card.defaults,i),this.$loader=null,this.$body=this.$element.find(".card-body")};i.VERSION="1.0.0",i.prototype.collapse=function(){var t=this.$element.find(this.options.collapseButton+" > i");this.$element.find(".card-header");if(this.$body.stop().slideToggle("fast"),this.$element.hasClass("card-collapsed"))return this.$element.removeClass("card-collapsed"),t.removeClass().addClass("pg-arrow_maximize"),void(e.isFunction(this.options.onExpand)&&this.options.onExpand(this));this.$element.addClass("card-collapsed"),t.removeClass().addClass("pg-arrow_minimize"),e.isFunction(this.options.onCollapse)&&this.options.onCollapse(this)},i.prototype.close=function(){this.$element.remove(),e.isFunction(this.options.onClose)&&this.options.onClose(this)},i.prototype.maximize=function(){var t=this.$element.find(this.options.maximizeButton+" > i");if(this.$element.hasClass("card-maximized"))this.$element.removeClass("card-maximized"),this.$element.attr("style",""),t.removeClass("pg-fullscreen_restore").addClass("pg-fullscreen"),e.isFunction(this.options.onRestore)&&this.options.onRestore(this);else{var i=e(".page-content-wrapper > .content"),a=e(".header"),n=0;if(i){n=i[0].getBoundingClientRect().left;var o=window.getComputedStyle(i[0]);n+=parseFloat(o.marginLeft)+parseFloat(o.paddingLeft)}var s=a.height();this.$element.addClass("card-maximized"),this.$element.css("left",n),this.$element.css("top",s),t.removeClass("pg-fullscreen").addClass("pg-fullscreen_restore"),e.isFunction(this.options.onMaximize)&&this.options.onMaximize(this)}},i.prototype.refresh=function(t){var i=this.$element.find(this.options.refreshButton);if(t){if(this.$loader&&this.$loader.is(":visible"))return;if(!e.isFunction(this.options.onRefresh))return;this.$loader=e('<div class="card-progress"></div>'),this.$loader.css({"background-color":"rgba("+this.options.overlayColor+","+this.options.overlayOpacity+")"});var a="";if("circle"==this.options.progress)a+='<div class="progress-circle-indeterminate progress-circle-'+this.options.progressColor+'"></div>';else if("bar"==this.options.progress)a+='<div class="progress progress-small">',a+='    <div class="progress-bar-indeterminate progress-bar-'+this.options.progressColor+'"></div>',a+="</div>";else if("circle-lg"==this.options.progress){i.addClass("refreshing");var n,o=i.find("> i").first();i.find('[class$="-animated"]').length?n=i.find('[class$="-animated"]'):((n=e("<i/>
29")).css({position:"absolute",top:o.position().top,left:o.position().left}),n.addClass("card-icon-refresh-lg-"+this.options.progressColor+"-animated"),i.append(n)),o.addClass("fade"),n.addClass("active")}else a+='<div class="progress progress-small">',a+='    <div class="progress-bar-indeterminate progress-bar-'+this.options.progressColor+'"></div>',a+="</div>";this.$loader.append(a),this.$element.append(this.$loader);var s=this.$loader;setTimeout(function(){this.$loader.remove(),this.$element.append(s)}.bind(this),300),this.$loader.fadeIn(),e.isFunction(this.options.onRefresh)&&this.options.onRefresh(this)}else{var r=this;this.$loader.fadeOut(function(){if(e(this).remove(),"circle-lg"==r.options.progress){var t=i.find(".active"),a=i.find(".fade");t.removeClass("active"),a.removeClass("fade"),i.removeClass("refreshing")}r.options.refresh=!1})}},i.prototype.error=function(e){if(e){var t=this;this.$element.pgNotification({style:"bar",message:e,position:"top",timeout:0,type:"danger",onShown:function(){t.$loader.find("> div").fadeOut()},onClosed:function(){t.refresh(!1)}}).show()}};var a=e.fn.card;e.fn.card=t,e.fn.card.Constructor=i,e.fn.card.defaults={progress:"circle",progressColor:"master",refresh:!1,error:null,
30overlayColor:"255,255,255",overlayOpacity:.8,refreshButton:'[data-toggle="refresh"]',maximizeButton:'[data-toggle="maximize"]',collapseButton:'[data-toggle="collapse"]',closeButton:'[data-toggle="close"]'},e.fn.card.noConflict=function(){return e.fn.card=a,this},e(document).on("click.pg.card.data-api",'[data-toggle="collapse"]',function(t){var i=e(this),a=i.closest(".card");i.is("a")&&t.preventDefault(),a.data("pg.card")&&a.card("collapse")}),e(document).on("click.pg.card.data-api",'[data-toggle="close"]',function(t){var i=e(this),a=i.closest(".card");i.is("a")&&t.preventDefault(),a.data("pg.card")&&a.card("close")}),e(document).on("click.pg.card.data-api",'[data-toggle="refresh"]',function(t){var i=e(this),a=i.closest(".card");i.is("a")&&t.preventDefault(),a.data("pg.card")&&a.card({refresh:!0})}),e(document).on("click.pg.card.data-api",'[data-toggle="maximize"]',function(t){var i=e(this),a=i.closest(".card");i.is("a")&&t.preventDefault(),a.data("pg.card")&&a.card("maximize")}),e(window).on("load",function(){e('[data-pages="card"]').each(function(){var t=e(this);t.card(t.data())})})}(window.jQuery),function(e){"use strict";var t=function(t,i){var a=this;return a.options=e.extend(!0,{},e.fn.pgMobileViews.defaults,i),a.element=e(t),a.element.on("click",function(t){t.preventDefault();var i=a.element.data(),n=e(i.viewPort),o=i.toggleView;return null!=i.toggleView?(n.children().last().children(".view").hide(),e(i.toggleView).show()):o=n.last(),n.toggleClass(i.viewAnimation),a.options.onNavigate(o,i.viewAnimation),!1}),this};e.fn.pgMobileViews=function(e){return new t(this,e)},e.fn.pgMobileViews.defaults={onNavigate:function(){}},e(window).on("load",function(){e('[data-navigate="view"]').each(function(){e(this).pgMobileViews()})})}(window.jQuery),function(e){"use strict";function t(t){return this.each(function(){var a=e(this),n=a.data("pg.quickview"),o="object"==typeof t&&t;n||a.data("pg.quickview",n=new i(this,o)),"string"==typeof t&&n[t]()})}var i=function(t,i){this.$element=e(t),this.options=e.extend(!0,{},e.fn.quickview.defaults,i),this.bezierEasing=[.05,.74,.27,.99];var a=this;e(this.options.notes).on("click",".list > ul > li",function(){var t=e(this).find(".note-preview");t=e(this).find(".note-preview");e(a.options.noteEditor).html(t.html()),e(a.options.notes).toggleClass("push")}),e(this.options.notes).on("click",".list > ul > li .checkbox",function(e){e.stopPropagation()}),e(this.options.notes).on("click",a.options.backButton,function(){e(a.options.notes).find(".toolbar > li > a").removeClass("active"),e(a.options.notes).toggleClass("push")}),e(this.options.deleteNoteButton).click(function(t){t.preventDefault(),e(this).toggleClass("selected"),e(a.options.notes).find(".list > ul > li .checkbox").fadeToggle("fast"),e(a.options.deleteNoteConfirmButton).fadeToggle("fast").removeClass("hide")}),e(this.options.newNoteButton).click(function(t){t.preventDefault(),e(a.options.noteEditor).html("")}),e(this.options.deleteNoteConfirmButton).click(function(){e(a.options.notes).find("input[type=checkbox]:checked").each(function(){e(this).parents("li").remove()})}),e(this.options.notes).on("click",".toolbar > li > a",function(){var t=e(this).attr("data-action");document.execCommand(t,!1,null),e(this).toggleClass("active")})};i.VERSION="1.0.0";var a=e.fn.quickview;e.fn.quickview=t,e.fn.quickview.Constructor=i,e.fn.quickview.defaults={notes:"#note-views",alerts:"#alerts",chat:"#chat",notesList:".list",noteEditor:".quick-note-editor",deleteNoteButton:".delete-note-link",deleteNoteConfirmButton:".btn-remove-notes",newNoteButton:".new-note-link",backButton:".close-note-link"},e.fn.quickview.noConflict=function(){return e.fn.quickview=a,this},e(window).on("load",function(){e('[data-pages="quickview"]').each(function(){var t=e(this);t.quickview(t.data())})}),e(document).on("click.pg.quickview.data-api",'[data-toggle="quickview"]',function(t){var i=e(this).attr("data-toggle-element");e(i).toggleClass("open"),t.preventDefault()})}(window.jQuery),function(e){"use strict";function t(t){return this.each(function(){var a=e(this),n=a.data("pg.parallax"),o=e.extend(!0,{},"object"==typeof t?t:{},a.data());n||a.data("pg.parallax",n=new i(this,o)),"string"==typeof t&&n[t]()})}var i=function(t,i){if(this.$element=e(t),this.options=e.extend(!0,{},e.fn.parallax.defaults,i),this.$coverPhoto=this.$element.find(".cover-photo"),this.$content=this.$element.find(".
30inner"),this.$coverPhoto.find("> img").length){var a=this.$coverPhoto.find("> img");this.$coverPhoto.css("background-image","url("+a.attr("src")+")"),a.remove()}this.options.scrollElement!==window&&e(this.options.scrollElement).on("scroll",function(){e(t).parallax("animate")})};i.VERSION="1.0.0",i.prototype.animate=function(){var t,i=50*this.$element.height()/100,a="translateX";t=e(this.options.scrollElement).scrollTop(),a="translateY",this.$coverPhoto.css({transform:a+"("+t*this.options.speed.coverPhoto+"px)"}),this.$content.css({transform:a+"("+t*this.options.speed.content+"px)"}),t>i?this.$content.css({opacity:1-t/1200}):this.$content.css({opacity:1})};var a=e.fn.parallax;e.fn.parallax=t,e.fn.parallax.Constructor=i,e.fn.parallax.defaults={speed:{coverPhoto:.3,content:.17},scrollElement:window},e.fn.parallax.noConflict=function(){return e.fn.parallax=a,this},e(window).on("load",function(){e('[data-pages="parallax"]').each(function(){var t=e(this);t.parallax(t.data())})}),e(window).on("scroll",function(){Modernizr.touch||e('[data-pages="parallax"]').parallax("animate")})}(window.jQuery),function(e){"use strict";function t(t){return this.each(function(){var a=e(this),n=a.data("pg.sidebar"),o="object"==typeof t&&t;n||a.data("pg.sidebar",n=new i(this,o)),"string"==typeof t&&n[t]()})}var i=function(t,i){function a(){var t=s.$body.hasClass("rtl")?-s.sideBarWidthCondensed:s.sideBarWidthCondensed,i=1==this.css3d?"translate3d("+t+"px, 0,0)":"translate("+t+"px, 0)";if(e.Pages.isVisibleSm()||e.Pages.isVisibleXs())return!1;e(".close-sidebar").data("clicked")||s.$body.hasClass("menu-pin")||(s.$element.css({transform:i}),s.$body.addClass("sidebar-visible"))}function n(t){var i=1==s.css3d?"translate3d(0, 0,0)":"translate(0, 0)";if(e.Pages.isVisibleSm()||e.Pages.isVisibleXs())return!1;if(void 0!==t&&e(t.target).parent(".page-sidebar").length)return;s.$body.hasClass("menu-pin")||(e(".sidebar-overlay-slide").hasClass("show")&&(e(".sidebar-overlay-slide").removeClass("show"),e("[data-pages-toggle']").removeClass("active")),s.$element.css({transform:i}),s.$body.removeClass("sidebar-visible"))}function o(){e(window).width()<1200?e("body").hasClass("menu-pin")&&(e("body").removeClass("menu-pin"),e("body").addClass("menu-unpinned")):e("body").hasClass("menu-unpinned")&&e("body").addClass("menu-pin")}if(this.$element=e(t),this.$body=e("body"),this.options=e.extend(!0,{},e.fn.sidebar.defaults,i),this.bezierEasing=[.05,.74,.27,.99],this.cssAnimation=!0,this.css3d=!0,this.sideBarWidth=280,this.sideBarWidthCondensed=210,this.$sidebarMenu=this.$element.find(".sidebar-menu > ul"),this.$pageContainer=e(this.options.pageContainer),this.$sidebarMenu.length){"desktop"==e.Pages.getUserAgent()&&this.$sidebarMenu.scrollbar({ignoreOverlay:!1,disableBodyScroll:1==this.$element.data("disableBodyScroll")}),Modernizr.csstransitions||(this.cssAnimation=!1),Modernizr.csstransforms3d||(this.css3d=!1),"undefined"==typeof angular&&e(document).on("click",".sidebar-menu a",function(){if(!1!==e(this).parent().children(".sub-menu")){var t=e(this),i=e(this).parent().parent(),a=e(this).parent(),n=e(this).parent().children(".sub-menu");a.hasClass("open active")?(t.children(".arrow").removeClass("open active"),n.slideUp(200,function(){a.removeClass("open active")})):(i.children("li.open").children(".sub-menu").slideUp(200),i.children("li.open").children("a").children(".arrow").removeClass("open active"),i.children("li.open").removeClass("open active"),t.children(".arrow").addClass("open active"),n.slideDown(200,function(){a.addClass("open active")}))}}),e(".sidebar-slide-toggle").on("click touchend",function(t){t.preventDefault(),e(this).toggleClass("active");var i=e(this).attr("data-pages-toggle");null!=i&&e(i).toggleClass("show")});var s=this;this.$element.bind("mouseenter mouseleave",a),this.$pageContainer.bind("mouseover",n),o(),e(document).bind("ready",o),e(window).bind("resize",o)}};i.prototype.toggleSidebar=function(){var t,i=e("body").css("background-color");e(".page-container").css("background-color",i),this.$body.hasClass("sidebar-open")?(this.$body.removeClass("sidebar-open"),t=setTimeout(function(){this.$element.removeClass("visible")}.bind(this),400)):(clearTimeout(t),this.$element.addClass("visible"),setTimeout(function(){this.$body.addClass("sidebar-open")}.bind(this),10),setTimeout(function(){e(".page-container").css({"background-color":""})},1e3))},i.prototype.togglePinSidebar=function(e){"hide"==e?this.$body.removeClass("menu-pin"):"show"==e?this.$body.addClass("menu-pin"):this.$body.toggleClass("menu-pin")};var a=e.fn.sidebar;e.fn.sidebar=t,e.fn.sidebar.Constructor=i,e.fn.sidebar.defaults={pageContainer:".page-container"},e.fn.sidebar.noConflict=function(){return e.fn.sidebar=a,this},e(document).on("click.pg.sidebar.data-api",'[data-toggle-pin="sidebar"]',function(){e(this);return e('[data-pages="sidebar"]').data("pg.sidebar").togglePinSidebar(),!1}),e(document).on("click.pg.sidebar.data-api",'[data-toggle="sidebar"]',function(){console.log("menu open");e(this);return e('[data-pages="sidebar"]').data("pg.sidebar").toggleSidebar(),!1})}(window.jQuery),function(e){"use strict";function t(t){return this.each(function(){var a=e(this),n=a.data("pg.search"),o="object"==typeof t&&t;n||a.data("pg.search",n=new i(this,o)),"string"==typeof t&&n[t]()})}var i=function(t,i){this.$element=e(t),this.options=e.extend(!0,{},e.fn.search.defaults,i),this.init()};i.VERSION="1.0.0",i.prototype.init=function(){var t=this;this.pressedKeys=[],this.ignoredKeys=[],this.$searchField=this.$element.find(this.options.searchField),this.$closeButton=this.$element.find(this.options.closeButton),this.$suggestions=this.$element.find(this.options.suggestions),this.$brand=this.$element.find(this.options.brand),this.$searchField.on("keyup",function(){t.$suggestions&&t.$suggestions.html(e(this).val())}),this.$searchField.on("keyup",function(i){if(t.options.onKeyEnter&&t.options.onKeyEnter(t.$searchField.val()),13==i.keyCode&&(i.preventDefault(),t.options.onSearchSubmit&&t.options.onSearchSubmit(t.$searchField.val())),e("body").hasClass("overlay-disabled"))return 0}),this.$closeButton.on("click",function(){t.toggleOverlay("hide")}),this.$element.on("click",function(i){"search"==e(i.target).data("pages")&&t.toggleOverlay("hide")}
30),e(document).on("keypress.pg.search",function(e){t.keypress(e)}),e(document).on("keyup",function(e){t.$element.is(":visible")&&27==e.keyCode&&t.toggleOverlay("hide")})},i.prototype.keypress=function(t){var i=(t=t||event).target.nodeName;e("body").hasClass("overlay-disabled")||e(t.target).hasClass("js-input")||"INPUT"==i||"TEXTAREA"==i||0===t.which||0===t.charCode||t.ctrlKey||t.metaKey||t.altKey||27==t.keyCode||this.toggleOverlay("show",String.fromCharCode(t.keyCode|t.charCode))},i.prototype.toggleOverlay=function(t,i){var a=this;"show"==t?(this.$element.removeClass("hide"),this.$element.fadeIn("fast"),this.$searchField.is(":focus")||(this.$searchField.val(i),setTimeout(function(){this.$searchField.focus();var e=this.$searchField.val();this.$searchField.val(""),this.$searchField.val(e)}.bind(this),10)),this.$element.removeClass("closed"),this.$brand.toggleClass("invisible"),e(document).off("keypress.pg.search")):(this.$element.fadeOut("fast").addClass("closed"),this.$searchField.val("").blur(),setTimeout(function(){this.$element.is(":visible")&&this.$brand.toggleClass("invisible"),e(document).on("keypress.pg.search",function(e){a.keypress(e)})}.bind(this),10))};var a=e.fn.search;e.fn.search=t,e.fn.search.Constructor=i,e.fn.search.defaults={searchField:'[data-search="searchField"]',closeButton:'[data-search="closeButton"]',suggestions:'[data-search="suggestions"]',brand:'[data-search="brand"]'},e.fn.search.noConflict=function(){return e.fn.search=a,this},e(document).on("click.pg.search.data-api",'[data-toggle="search"]',function(t){var i=e(this),a=e('[data-pages="search"]');i.is("a")&&t.preventDefault(),a.data("pg.search").toggleOverlay("show")})}(window.jQuery),function(e){"use strict";"undefined"==typeof angular&&e.Pages.init()}(window.jQuery),
31/*!
32	Autosize v1.18.9 - 2014-05-27
33	Automatically adjust textarea height based on user input.
34	(c) 2014 Jack Moore - http://www.jacklmoore.com/autosize
35	license: http://www.opensource.org/licenses/mit-license.php
36*/
37function(e){"use strict";var t,i={className:"autosizejs",id:"autosizejs",append:"\n",callback:!1,resizeDelay:10,placeholder:!0},a=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],n=e('<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>').data("autosize",!0)[0];n.style.lineHeight="99px","99px"===e(n).css("lineHeight")&&a.push("lineHeight"),n.style.lineHeight="",e.fn.autosize=function(o){return this.length?(o=e.extend({},i,o||{}),n.parentNode!==document.body&&e(document.body).append(n),this.each(function(){function i(){var t,i=!!window.getComputedStyle&&window.getComputedStyle(p,null);i?(0!==(t=p.getBoundingClientRect().width)&&"number"==typeof t||(t=parseInt(i.width,10)),e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,a){t-=parseInt(i[a],10)})):t=h.width(),n.style.width=Math.max(t,0)+"px"}function s(){var s={};if(t=p,n.className=o.className,n.id=o.id,d=parseInt(h.css("maxHeight"),10),e.each(a,function(e,t){s[t]=h.css(t)}),e(n).css(s).attr("wrap",h.attr("wrap")),i(),window.chrome){var r=p.style.width;p.style.width="0px";p.offsetWidth;p.style.width=r}}function r(){var e,a;t!==p?s():i(),!p.value&&o.placeholder?n.value=(h.attr("placeholder")||"")+o.append:n.value=p.value+o.append,n.style.overflowY=p.style.overflowY,a=parseInt(p.style.height,10),n.scrollTop=0,n.scrollTop=9e4,e=n.scrollTop,d&&e>d?(p.style.overflowY="scroll",e=d):(p.style.overflowY="hidden",e<c&&(e=c)),a!==(e+=m)&&(p.style.height=e+"px",f&&o.callback.call(p,p))}function l(){clearTimeout(u),u=setTimeout(function(){var e=h.width();e!==v&&(v=e,r())},parseInt(o.resizeDelay,10))}var d,c,u,p=this,h=e(p),m=0,f=e.isFunction(o.callback),g={height:p.style.height,overflow:p.style.overflow,overflowY:p.style.overflowY,wordWrap:p.style.wordWrap,resize:p.style.resize},v=h.width(),b=h.css("resize");h.data("autosize")||(h.data("autosize",!0),"border-box"!==h.css("box-sizing")&&"border-box"!==h.css("-moz-box-sizing")&&"border-box"!==h.css("-webkit-box-sizing")||(m=h.outerHeight()-h.height()),c=Math.max(parseInt(h.css("minHeight"),10)-m||0,h.height()),h.css({overflow:"hidden",overflowY:"hidden",
37wordWrap:"break-word"}),"vertical"===b?h.css("resize","none"):"both"===b&&h.css("resize","horizontal"),"onpropertychange"in p?"oninput"in p?h.on("input.autosize keyup.autosize",r):h.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):h.on("input.autosize",r),!1!==o.resizeDelay&&e(window).on("resize.autosize",l),h.on("autosize.resize",r),h.on("autosize.resizeIncludeStyle",function(){t=null,r()}),h.on("autosize.destroy",function(){t=null,clearTimeout(u),e(window).off("resize",l),h.off("autosize").off(".autosize").css(g).removeData("autosize")}),r())})):this}}(window.jQuery||window.$),BestInPlaceEditor.prototype={activate:function(){"use strict";var e;if(this.isPlaceHolder())e="";else if(this.original_content)e=this.original_content;else switch(this.formType){case"input":case"textarea":if(this.display_raw)e=this.element.html().replace(/&amp;/gi,"&");else{var t=this.element.data("bipValue");e=void 0===t?"":"string"==typeof t?this.element.data("bipValue").replace(/&amp;/gi,"&"):this.element.data("bipValue")}break;case"select":e=this.element.html()}this.oldValue=this.isPlaceHolder()?"":this.element.html(),this.display_value=e,jQuery(this.activator).unbind("click",this.clickHandler),this.activateForm(),this.element.trigger(jQuery.Event("best_in_place:activate"))},abort:function(){"use strict";this.activateText(this.oldValue),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:abort")),this.element.trigger(jQuery.Event("best_in_place:deactivate"))},abortIfConfirm:function(){"use strict";this.useConfirm?confirm(BestInPlaceEditor.defaults.locales[""].confirmMessage)&&this.abort():this.abort()},update:function(){"use strict";this.element.trigger(jQuery.Event("best_in_place:before-update"));var e=this,t=this.getValue();if(this.formType in{input:1,textarea:1,date:1}&&t===this.oldValue)return this.abort(),!0;switch(e.ajax({type:this.requestMethod(),dataType:BestInPlaceEditor.defaults.ajaxDataType,data:e.requestData(),success:function(t,i,a){e.loadSuccessCallback(t,i,a)},error:function(t,i){e.loadErrorCallback(t,i)}}),this.formType){case"select":this.previousCollectionValue=t,$.each(this.values,function(i,a){String(a[0])===String(t)&&e.element.html(a[1])});break;case"checkbox":$.each(this.values,function(i,a){String(a[0])===String(t)&&e.element.html(a[1])});break;default:""!==t?this.display_raw?e.element.html(t):e.element.text(t):e.element.html(this.placeHolder)}e.element.data("bipValue",t),e.element.attr("data-bip-value",t),e.element.trigger(jQuery.Event("best_in_place:update"))},activateForm:function(){"use strict";alert(BestInPlaceEditor.defaults.locales[""].uninitializedForm)},activateText:function(e){"use strict";this.element.html(e),this.isPlaceHolder()&&this.element.html(this.placeHolder)},initOptions:function(){"use strict";var e=this;e.element.parents().each(function(){var t=jQuery(this);e.url=e.url||t.data("bipUrl"),e.activator=e.activator||t.data("bipActivator"),e.okButton=e.okButton||t.data("bipOkButton"),e.okButtonClass=e.okButtonClass||t.data("bipOkButtonClass"),e.cancelButton=e.cancelButton||t.data("bipCancelButton"),e.cancelButtonClass=e.cancelButtonClass||t.data("bipCancelButtonClass"),e.skipBlur=e.skipBlur||t.data("bipSkipBlur")}),e.url=e.element.data("bipUrl")||e.url||document.location.pathname,e.collection=e.element.data("bipCollection")||e.collection,e.formType=e.element.data("bipType")||"input",e.objectName=e.element.data("bipObject")||e.objectName,e.attributeName=e.element.data("bipAttribute")||e.attributeName,e.activator=e.element.data("bipActivator")||e.element,e.okButton=e.element.data("bipOkButton")||e.okButton,e.okButtonClass=e.element.data("bipOkButtonClass")||e.okButtonClass||BestInPlaceEditor.defaults.okButtonClass,e.cancelButton=e.element.data("bipCancelButton")||e.cancelButton,e.cancelButtonClass=e.element.data("bipCancelButtonClass")||e.cancelButtonClass||BestInPlaceEditor.defaults.cancelButtonClass,e.skipBlur=e.element.data("bipSkipBlur")||e.skipBlur||BestInPlaceEditor.defaults.skipBlur,e.isNewObject=e.element.data("bipNewObject"),e.dataExtraPayload=e.element.data("bipExtraPayload"),null==e.element.data("bipPlaceholder")?e.placeHolder=BestInPlaceEditor.defaults.locales[""].placeHolder:e.placeHolder=e.element.data("bipPlaceholder"),e.inner_class=e.element.data("bipInnerClass"),e.html_attrs=e.element.data("bipHtmlAttrs"),e.original_content=e.element.data("bipOriginalContent")||e.original_content,e.display_raw=e.element.data("bip-raw"),e.useConfirm=e.element.data("bip-confirm"),"select"!==e.formType&&"checkbox"!==e.formType||(e.values=e.collection,e.collectionValue=e.element.data("bipValue")||e.collectionValue)},bindForm:function(){"use strict";this.activateForm=BestInPlaceEditor.forms[this.formType].activateForm,this.getValue=BestInPlaceEditor.forms[this.formType].getValue},initPlaceHolder:function(){"use strict";""===this.element.html()&&(this.element.addClass("bip-placeholder"),this.element.html(this.placeHolder))},isPlaceHolder:function(){"use strict";return""===this.element.html()||this.element.html()===this.placeHolder},getValue:function(){"use strict";alert(BestInPlaceEditor.defaults.locales[""].uninitializedForm)}
37,sanitizeValue:function(e){"use strict";return jQuery.trim(e)},requestMethod:function(){"use strict";return this.isNewObject?"post":BestInPlaceEditor.defaults.ajaxMethod},requestData:function(){"use strict";var e=jQuery("meta[name=csrf-token]").attr("content"),t=jQuery("meta[name=csrf-param]").attr("content"),i={};return i._method=this.requestMethod(),i[this.objectName]=this.dataExtraPayload||{},i[this.objectName][this.attributeName]=this.getValue(),t!==undefined&&e!==undefined&&(i[t]=e),jQuery.param(i)},ajax:function(e){"use strict";return e.url=this.url,e.beforeSend=function(e){e.setRequestHeader("Accept","application/json")},jQuery.ajax(e)},loadSuccessCallback:function(e,t,i){"use strict";if(e=jQuery.trim(e),this.display_raw?this.original_content=this.element.html():this.original_content=this.element.text(),e&&""!==e){var a=jQuery.parseJSON(e);null!==a&&a.hasOwnProperty("display_as")&&(this.element.data("bip-original-content",this.element.text()),this.element.html(a.display_as)),this.isNewObject&&a&&a[this.objectName]&&a[this.objectName].id&&(this.isNewObject=!1,this.url+="/"+a[this.objectName].id)}this.element.toggleClass("bip-placeholder",this.isPlaceHolder()),this.element.trigger(jQuery.Event("best_in_place:success"),[e,t,i]),this.element.trigger(jQuery.Event("ajax:success"),[e,t,i]),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate")),null!==this.collectionValue&&"select"===this.formType&&(this.collectionValue=this.previousCollectionValue,this.previousCollectionValue=null)},loadErrorCallback:function(e,t){"use strict";this.activateText(this.oldValue),this.element.trigger(jQuery.Event("best_in_place:error"),[e,t]),this.element.trigger(jQuery.Event("ajax:error"),e,t),jQuery(this.activator).bind("click",{editor:this},this.clickHandler),this.element.trigger(jQuery.Event("best_in_place:deactivate"))},clickHandler:function(e){"use strict";e.preventDefault(),e.data.editor.activate()},setHtmlAttributes:function(){"use strict";var e=this.element.find(this.formType);if(this.html_attrs){var t=this.html_attrs;$.each(t,function(t,i){e.attr(t,i)})}},placeButtons:function(e,t){"use strict";t.okButton&&e.append(jQuery(document.createElement("input")).attr("type","submit").attr("class",t.okButtonClass).attr("value",t.okButton)),t.cancelButton&&e.append(jQuery(document.createElement("input")).attr("type","button").attr("class",t.cancelButtonClass).attr("value",t.cancelButton))}},BestInPlaceEditor.forms={input:{activateForm:function(){"use strict";var e=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),t=jQuery(document.createElement("input")).attr("type","text").attr("name",this.attributeName).val(this.display_value);this.inner_class&&t.addClass(this.inner_class),e.append(t),this.placeButtons(e,this),this.element.html(e),this.setHtmlAttributes(),this.element.find("input[type='text']")[0].select(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.input.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.input.cancelButtonHandler),this.okButton||this.element.find("input[type='text']").bind("blur",{editor:this},BestInPlaceEditor.forms.input.inputBlurHandler),this.element.find("input[type='text']").bind("keyup",{editor:this},BestInPlaceEditor.forms.input.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){"use strict";return this.sanitizeValue(this.element.find("input").val())},inputBlurHandler:function(e){"use strict";e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abort()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.update()},500):e.data.editor.update()},submitHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.update()},cancelButtonHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.abort(),e.stopPropagation()},keyupHandler:function(e){"use strict";
3727===e.keyCode&&(e.data.editor.abort(),e.stopImmediatePropagation())}},select:{activateForm:function(){"use strict";var e,t,i=jQuery(document.createElement("form")).attr("action","javascript:void(0)").attr("style","display:inline"),a=jQuery(document.createElement("select")).attr("class",null!==this.inner_class?this.inner_class:""),n=this.collectionValue,o=this.values;$.each(o,function(i,o){e=o[0],t=o[1];var s=jQuery(document.createElement("option")).val(e).html(t);n&&String(e)===String(n)&&s.attr("selected","selected"),a.append(s)}),i.append(a),this.element.html(i),this.setHtmlAttributes(),this.element.find("select").bind("change",{editor:this},BestInPlaceEditor.forms.select.blurHandler),this.element.find("select").bind("blur",{editor:this},BestInPlaceEditor.forms.select.blurHandler),this.element.find("select").bind("keyup",{editor:this},BestInPlaceEditor.forms.select.keyupHandler),this.element.find("select")[0].focus();try{var s=document.createEvent("MouseEvents");s.initMouseEvent("mousedown",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.element.find("select")[0].dispatchEvent(s)}catch(s){}},getValue:function(){"use strict";return this.sanitizeValue(this.element.find("select").val())},blurHandler:function(e){"use strict";e.data.editor.update()},keyupHandler:function(e){"use strict";27===e.keyCode&&e.data.editor.abort()}},checkbox:{activateForm:function(){"use strict";this.collectionValue=!this.getValue(),this.setHtmlAttributes(),this.update()},getValue:function(){"use strict";return this.collectionValue}},textarea:{activateForm:function(){"use strict";var e=this.element.css("width"),t=this.element.css("height"),i=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),a=jQuery(document.createElement("textarea")).attr("name",this.attributeName).val(this.sanitizeValue(this.display_value));null!==this.inner_class&&a.addClass(this.inner_class),i.append(a),this.placeButtons(i,this),this.element.html(i),this.setHtmlAttributes(),jQuery(this.element.find("textarea")[0]).css({"min-width":e,"min-height":t}),jQuery(this.element.find("textarea")[0]).autosize(),this.element.find("textarea")[0].focus(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.textarea.submitHandler),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.textarea.cancelButtonHandler),this.skipBlur||this.element.find("textarea").bind("blur",{editor:this},BestInPlaceEditor.forms.textarea.blurHandler),this.element.find("textarea").bind("keyup",{editor:this},BestInPlaceEditor.forms.textarea.keyupHandler),this.blurTimer=null,this.userClicked=!1},getValue:function(){"use strict";return this.sanitizeValue(this.element.find("textarea").val())},blurHandler:function(e){"use strict";e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abortIfConfirm()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.update()},500):e.data.editor.update()},submitHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.update()},cancelButtonHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.abortIfConfirm(),e.stopPropagation()},keyupHandler:function(e){"use strict";27===e.keyCode&&e.data.editor.abortIfConfirm()}}},BestInPlaceEditor.defaults={locales:{},ajaxMethod:"put",ajaxDataType:"text",okButtonClass:"",cancelButtonClass:"",skipBlur:!1},BestInPlaceEditor.defaults.locales[""]={confirmMessage:"Are you sure you want to discard your changes?",uninitializedForm:"The form was not properly initialized. getValue is unbound",placeHolder:"-"},jQuery.fn.best_in_place=function(){"use strict";function e(e){if(!e.data("bestInPlaceEditor"))return e.data("bestInPlaceEditor",new BestInPlaceEditor(e)),!0}return jQuery(this.context).delegate(this.selector,"click",function(){var t=jQuery(this);e(t)&&t.click()}),this.each(function(){e(jQuery(this))}),this},BestInPlaceEditor.forms.date={activateForm:function(){"use strict";var e=this,t=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),i=jQuery(document.createElement("div")).attr("class","input-group date pi-default-datepicker"),a=jQuery(document.createElement("input")).attr("type","hidden").attr("name",this.attributeName).attr("value",this.original_content),n=jQuery(document.createElement("input")).attr("type","text").attr("name",this.attributeName+"_dtp").attr("value",this.sanitizeV
37alue(this.oldValue));if(null!==this.inner_class&&n.addClass(this.inner_class),i.append(n),i.append('<span class="input-group-addon"><i class="fa fa-calendar"></i></span>'),t.append(i),t.append(a),this.placeButtons(t,this),this.element.html(t),this.html_attrs){var o=this.html_attrs;$.each(o,function(e,t){"data"==e&&t instanceof Object?n.data(t):n.attr(e,t)})}this.element.find("input")[0].select(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.input.submitHandler),this.element.find("input").bind("keyup",{editor:this},BestInPlaceEditor.forms.input.keyupHandler),this.element.find(".pi-default-datepicker").each(function(){var e=$(this),t=e.siblings("input[type='hidden']"),i=e.children("input[type='text']");$(i).on("keydown",function(){return!1});var a=$(i).data("dtp-format").replace("%d","dd").replace("%m","mm").replace("%Y","yyyy").replace("%H","H").replace("%M","i"),n={};$.each($(i).data(),function(e,t){0===e.indexOf("date")&&(n[e[4].toLowerCase()+e.substring(5)]=t)}),n=$.extend({},{clearBtn:!0,autoclose:!0,format:a},n),e.datepicker(n).on("changeDate",{input:t,text:i},function(e){var i=t;if(t.length>1)for(var a=0;a<e.data.text.length;a++)e.data.text[a].id==e.target.id&&(i=$(e.data.input[a]));null!=e.date?i.attr("data-date",e.date.getFullYear()+"-"+(e.date.getMonth()+1)+"-"+e.date.getDate()):i.removeAttr("data-date"),mergeDateTime(i)}).on("clearDate",{input:t,text:i},function(e){var i=t;if(t.length>1)for(var a=0;a<e.data.text.length;a++)e.data.text[a].id==e.target.id&&(i=$(e.data.input[a]));i.removeAttr("data-date"),mergeDateTime(i)})}),this.element.find(".pi-default-datepicker").each(function(){$(this).datepicker().on("hide",function(){e.update()}).datepicker("show")})},getValue:function(){"use strict";var e=/(\w+)@|at (\w+) \(/g,t=(new Error).stack,i=e.exec(t),a="requestData"==((i=e.exec(t))[1]||i[2])?this.element.find("input[type='hidden']"):this.element.find("input[type='text']");return this.sanitizeValue(a.val())},submitHandler:function(e){"use strict";e.data.editor.update()},keyupHandler:function(e){"use strict";27===e.keyCode&&e.data.editor.abort()}},BestInPlaceEditor.forms.textarea={activateForm:function(){"use strict";var e=this.element.css("width"),t=this.element.css("height"),i=jQuery(document.createElement("form")).addClass("form_in_place").attr("action","javascript:void(0);").attr("style","display:inline"),a=jQuery(document.createElement("div")).attr("class","wysiwyg5-wrapper"),n=jQuery(document.createElement("textarea")).attr("name",this.attributeName).val(this.sanitizeValue(this.display_value));if(null!==this.inner_class&&n.addClass(this.inner_class),a.append(n),i.append(a),this.placeButtons(i,this),this.element.html(i),this.html_attrs){var o=this.html_attrs;$.each(o,function(e,t){"data"==e&&t instanceof Object?input_elt.data(t):input_elt.attr(e,t)})}jQuery(this.element.find("textarea")[0]).css({"min-width":e,"min-height":t}),jQuery(this.element.find("textarea")[0]).autosize(),this.element.find("textarea")[0].focus(),this.element.find("form").bind("submit",{editor:this},BestInPlaceEditor.forms.textarea.submitHandler),this.element.bind("best_in_place:before-update",function(){var e=$
37(this).data("ckeditor");null!=e&&($(this).removeData("ckeditor"),e.destroy())}),this.cancelButton&&this.element.find("input[type='button']").bind("click",{editor:this},BestInPlaceEditor.forms.textarea.cancelButtonHandler),this.skipBlur||this.element.find("textarea").bind("blur",{editor:this},BestInPlaceEditor.forms.textarea.blurHandler),this.element.find("textarea").bind("keyup",{editor:this},BestInPlaceEditor.forms.textarea.keyupHandler),this.blurTimer=null,this.userClicked=!1;var s=this.element.find(".pi-default-wysiwig").ckeditor({toolbarGroups:[{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi","paragraph"]},{name:"links",groups:["links"]},{name:"tools",groups:["tools"]}],toolbarLocation:"bottom",removeButtons:"Templates,Save,NewPage,Preview,Print,ShowBlocks,Anchor,Language,BidiRtl,BidiLtr,JustifyLeft,JustifyCenter,JustifyRight,JustifyBlock,CreateDiv,Blockquote,Outdent,Indent,RemoveFormat",removePlugins:"elementspath",coreStyles_strike:{element:"strikethrough",overrides:"s"},skin:"lightwire,/assets/ckeditor/skins/lightwire/"});this.element.data("ckeditor",s.editor)},getValue:function(){"use strict";return this.sanitizeValue(this.element.find("textarea").val())},blurHandler:function(e){"use strict";e.data.editor.okButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.abortIfConfirm()},500):e.data.editor.cancelButton?e.data.editor.blurTimer=setTimeout(function(){e.data.editor.userClicked||e.data.editor.update()},500):e.data.editor.update()},submitHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.update()},cancelButtonHandler:function(e){"use strict";e.data.editor.userClicked=!0,clearTimeout(e.data.editor.blurTimer),e.data.editor.abortIfConfirm(),e.stopPropagation()},keyupHandler:function(e){"use strict";27===e.keyCode&&e.data.editor.abortIfConfirm()}},window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(var i=0;i<this.length;i++)e.call(t,this[i],i,this)}),window.WebGLEnabled=detectWebGLContext();var doka=null;Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t,i=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&i.push(t);return i});var oldAllowAction=$.rails.allowAction;if($.rails.allowAction=function(e){var t=$(e);return t.data("confirm")&&t.data("confirm","<p>"+t.data("confirm")+"</p>"),oldAllowAction(e)},jQuery.ready2=function(e){$(document).ready(e),$(document).on("show.bs.modal",".modal:not(.doc-preview)",function(t){"bs.modal"===t.namespace&&e()})},$.fn.highlight=function(){this.addClass("highlight-change",{duration:500,effect:"linear"}).delay(2e3).queue(function(){$(this).removeClass("highlight-change",{duration:1e3,effect:"linear"}),$(this).dequeue()})},jQuery.fn.preventDoubleSubmission=function(){var e,t;jQuery(this).bind("submit",function(i){return e&&(t=jQuery.now()-e),e=jQuery.now(),t<15e3&&i.preventDefault(),!0})},jQuery.fn.invisible=function(){return this.css("visibility","hidden")},jQuery.fn.visible=function(){return this.css("visibility","visible")},Number.prototype.toFixedNumber=function(e,t){var i=Math.pow(t||10,e);return+Math.round(this*i)/i},Number.isValidNumber=function(e){return e.toString().trim().length>0&&!isNaN(e)&&e.toString().match(/^-?\d*(\.\d+)?$/)},"undefined"!=typeof NProgress&&(NProgress.configure({speed:1e3}),$(document).on("ajaxStart",function(){$.LoadingOverlay("show",{color:"rgba(0, 0, 0, 0.0)",image:""}),NProgress.start()}),$(document).on("ajaxStop",function(){NProgress.done(),$.LoadingOverlay("hide",!0)})),$(document).on("ajaxSuccess",function(){$.fn.tooltip&&$('[data-toggle="tooltip"]').tooltip()}),$.fn.dataTable&&($.fn.dataTable.util.throttle=function(e,t){var i=t!==undefined?t:200,a=0;return function(){var t=this,n=arguments;clearTimeout(a),a=setTimeout(function(){e.apply(t,n)},i)}},function(e,t,i){i(t).on("init.dt",function(e,t){if("dt"===e.namespace){var a=t.oInit.conditionalPaging||i.fn.dataTable.defaults.conditionalPaging;if(i.isPlainObject(a)||!0===a){var n=i.isPlainObject(a)?a:{},o=new i.fn.dataTable.Api(t),s="slow",r=function(e){var t=i(o.table().container()).find("div.dataTables_paginate"),a=o.page.info().pages;e instanceof i.Event?a<=1?"fade"===n.style?t.stop().fadeTo(s,0):t.css("visibility","hidden"):"fade"===n.style?t.stop().fadeTo(s,1):t.css("visibility",""):a<=1&&("fade"===n.style?t.css("opacity",0):t.css("visibility","hidden"))};
37n.speed!==undefined&&(s=n.speed),r(),o.on("draw.dt",r)}}})}(window,document,jQuery),$.extend(!0,$.fn.dataTable.defaults,{dom:"<'row upper_paging_bootstrap'<p <i l>>><'row't><'row bottom_paging_bootstrap'<p i>>",paginationType:"bootstrap",destroy:!0,scrollCollapse:!0,conditionalPaging:!0,columnDefs:[{bSortable:!1,aTargets:[-1]}],language:{lengthMenu:"&nbsp;-&nbsp _MENU_ &nbsp;x page",info:"Showing <b>_START_ to _END_</b> of _TOTAL_ entries",emptyTable:"No data available"},order:[],pageLength:50,lengthMenu:[[10,25,50],[10,25,50]]}),$.extend($.fn.dataTableExt.oStdClasses,{sWrapper:"dataTables_wrapper form-inline",sLengthSelect:"custom-select custom-select-sm form-control form-control-sm"}),$.fn.dataTableExt.oApi.fnPagingInfo=function(e){return{iStart:e._iDisplayStart,iEnd:e.fnDisplayEnd(),iLength:e._iDisplayLength,iTotal:e.fnRecordsTotal(),iFilteredTotal:e.fnRecordsDisplay(),iPage:-1===e._iDisplayLength?0:Math.ceil(e._iDisplayStart/e._iDisplayLength),iTotalPages:-1===e._iDisplayLength?0:Math.ceil(e.fnRecordsDisplay()/e._iDisplayLength)}},$.extend($.fn.dataTableExt.oPagination,{bootstrap:{fnInit:function(e,t,i){e.oLanguage.oPaginate;var a=function(t){t.preventDefault(),e.oApi._fnPageChange(e,t.data.action)&&i(e)};$(t).addClass("pagination").append('<ul><li class="prev disabled"><a href="#"><i class="pg-arrow_left"></i></a></li><li class="next disabled"><a href="#"><i class="pg-arrow_right"></i></a></li></ul>');var n=$("a",t);$(n[0]).bind("click.DT",{action:"previous"},a),$(n[1]).bind("click.DT",{action:"next"},a)},fnUpdate:function(e,t){var i,a,n,o,s,r,l=5,d=e.oInstance.fnPagingInfo(),c=e.aanFeatures.p,u=Math.floor(l/2);for(d.iTotalPages<l?(s=1,r=d.iTotalPages):d.iPage<=u?(s=1,r=l):d.iPage>=d.iTotalPages-u?(s=d.iTotalPages-l+1,r=d.iTotalPages):r=(s=d.iPage-u+1)+l-1,i=0,a=c.length;i<a;i++){for($("li:gt(0)",c[i]).filter(":not(:last)").remove(),n=s;n<=r;n++)o=n==d.iPage+1?'class="active"':"",$("<li "+o+'><a href="#">'+n+"</a></li>").insertBefore($("li:last",c[i])[0]).bind("click",function(i){i.preventDefault(),e._iDisplayStart=(parseInt($("a",this).text(),10)-1)*d.iLength,t(e)});0===d.iPage?$("li:first",c[i]).addClass("disabled"):$("li:first",c[i]).removeClass("disabled"),d.iPage===d.iTotalPages-1||0===d.iTotalPages?$("li:last",c[i]).addClass("disabled"):$("li:last",c[i]).removeClass("disabled")}}}})),$.fn.select2){!function(e){e.fn.refreshDataSelect2=function(t){this.select2("data",t);var i=e(this[0]),a=t.map(function(t){var i="";return e.each(t,function(e,t){e.startsWith("data-")&&(i+=" "+e+'="'+t+'"')}),'<option value="'+t.id+'"'+i+">"+t.text+"</option>"});i.html(a.join("")).change()}}(jQuery),$.fn.select2.amd.require("select2/results").prototype.highlightFirstItem=function(){if(!this.options.get("multiple")||this.options.get("closeOnSelect")){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()}},$.fn.select2.amd.require("select2/selection/single").prototype.display=function(){var e=this.options.get("templateSelection");return this.options.get("escapeMarkup")(e.apply(this,arguments))};var Select2Utils=$.fn.select2.amd.require("select2/utils"),MultipleSelection=$.fn.select2.amd.require("select2/selection/multiple");MultipleSelection.prototype.display=function(){var e=this.options.get("templateSelection");return this.options.get("escapeMarkup")(e.apply(this,arguments))},MultipleSelection.prototype.selectionContainer=function(e){return e?$('<li class="select2-selection__choice"></li>'):$('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},MultipleSelection.prototype.update=function(e){if(this.clear(),0!==e.length){var t=[];if(e.length>this.options.get("maximumTagsMultiple")&&-1!=this.options.get("maximumTagsMultiple")){var i=this.selectionContainer(!0),a=$('option:not([value=""])',this.$element).length,n=this.display(e,a);i.append(n),t.push(i)}else for(var o=0;o<e.length;o++){var s=e[o];i=this.selectionContainer(),n=this.display(s,i);i.append(n),i.prop("title",s.title||s.text),i.data("data",s),t.push(i)}
37var r=this.$selection.find(".select2-selection__rendered");Select2Utils.appendMany(r,t)}},$.fn.select2.amd.require("select2/selection/allowClear").prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){t.stopPropagation();var a=i.data("data");if(this.$element.prop("multiple")&&a.length>this.options.get("maximumTagsMultiple"))$('option:not([value=""])',this.$element).removeAttr("selected"),this.$element.trigger("change"),this.$element.data("select2").trigger("open");else for(var n=0;n<a.length;n++){var o={data:a[n]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},$.fn.select2.amd.define("select2/selectAllAdapter",["select2/utils","select2/dropdown","select2/dropdown/attachBody"],function(e,t,i){function a(){}return a.prototype.render=function(e){var t=this,i=e.call(this),a=$('<button class="btn btn-xs btn-default" type="button" style="margin-left:6px;"><i class="fa fa-check-square-o"></i> Select All</button>'),n=$('<button class="btn btn-xs btn-default" type="button" style="margin-left:6px;"><i class="fa fa-square-o"></i> Unselect All</button>'),o=$('<div style="margin-top:3px;">').append(a).append(n);return this.$element.prop("multiple")?(i.find(".select2-dropdown").prepend(o),a.on("click",function(){$('option:not([value=""])',t.$element).prop("selected","selected"),t.$element.trigger("change"),t.$element.data("select2").trigger("open")}),n.on("click",function(){$('option:not([value=""])',t.$element).removeAttr("selected"),t.$element.trigger("change"),t.$element.data("select2").trigger("open")}),i):i},e.Decorate(e.Decorate(t,i),a)})}$.fn.twitter_bootstrap_confirmbox.defaults={fade:!0,title:"Are you sure?",cancel:"Cancel",cancel_class:"btn cancel",proceed:"Confirm",proceed_class:"btn proceed btn-danger"};var hasFlash=!1;try{var fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");fo&&(hasFlash=!0)}catch(e){navigator.mimeTypes&&navigator.mimeTypes["application/x-shockwave-flash"]!=undefined&&navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin&&(hasFlash=!0)}var select2_objects={};jQuery.fn.extend({serializeHash:function(){var e={},t=this.serializeArray();return $.each(t,function(t,i){i.value.trim().length>0&&(i.name in e?e[i.name]=[].concat(e[i.name]).concat(i.value):i.name.endsWith("[]")?e[i.name]=[i.value]:e[i.name]=i.value)}),e}}),$(document).ajaxComplete(function(e,t){var i=t.getResponseHeader("Location");i&&(window.location=i)}),$(document).ajaxError(function(e,t){"500"==t.status&&showError("We're sorry, but something went wrong, please contact admin")}),$(document).on("dragover drop",function(e){$(e.target).is("input[type='file']")||e.preventDefault()}),$(document).on("page:load",function(){$.Pages.init()}),$(document).ready(function(){function e(e,t){$(e).tooltip("hide").attr("data-original-title",t).tooltip("show")}function t(e){setTimeout(function(){$(e).tooltip("hide")},2e3)}if(hasFlash||$("a[id*=copy-minicvs]").each(function(){$(this).hide()}),initAppComponents(document),$(".btn-group .dropdown-togle").hover(function(){$(this).find(".dropdown-menu").first().stop(!0,!0).delay(250).slideDown()},function(){$(this).find(".dropdown-menu").first().stop(!0,!0).delay(100).slideUp()}),$("#wizard").bootstrapWizard({onInit:function(){$("#wizard ul").removeClass("nav-pills"),$(".nav-tabs a").on("shown.bs.tab",function(e){window.location.hash=$(e.target).attr("href").substr(1),scrollTo(0,0)})}}),window.location.hash){var i=$('a[href="'+window.location.hash+'"]');i&&i.tab("show")}if($.fn.dataTable){var a=$(".pi-datatable"),n=$(".pi-searchtable"),o=$(".pi-searchtable-check");$.each(a,function(e,t){var i=$(t),a=function(e){e=e||{};var t=$("#"+i.attr("id")+"-search"),a=[];$.each(e,function(e,i){e.startsWith("filters[")||(e="filters["+e+"]"+(Array.isArray(i)?"[]":""));var n=t.find('*[name="'+e+'"]')
38;n.length>0&&(2==n.length&&("INPUT"==n[0].tagName&&"hidden"==n[0].getAttribute("type")&&"SELECT"==n[1].tagName||"SELECT"==n[0].tagName&&"INPUT"==n[1].tagName&&"hidden"==n[1].getAttribute("type"))&&(n="SELECT"==n[0].tagName?$(n[0]):$(n[1])),n.val(i).trigger("change"),a.push("<mark>"+t.find('*[name="'+e+'"]').closest('div[class~="form-group"]').find("label:first-child").text()+"</mark>"))}),t.closest('div[class~="card-search"]').find('div[class~="search-markers"]:first-child').html(a.sort().join(" - "))};if(i.attr("data-source")){"/crm/datatable_states/:datatable_id:".replace(":datatable_id:",i.attr("id"));i.dataTable({processing:!0,serverSide:!0,stateDuration:0,initComplete:function(){var e=this;$("#"+e.attr("id")+"-search").submit(function(t){t.preventDefault(),e.DataTable().search("").page("first").draw()})},stateLoadParams:function(e,t){t.search&&(t.search.search="")},stateLoaded:function(e,t){a(t.filters)},fnCreatedRow:function(e){var t=$(this),i=t.data("selections"),a=getCheckAllState(t),n=t.data("selections_negated"),o=$(e),s=$('input[type=checkbox][id^="selected_"]',o),r=Object.keys(i).indexOf(s.val());selectDatatableRow(s,!0===a||!1===n&&-1!=r||!0===n&&-1==r)}
38,ajax:function(t,n){var s=$("#"+i.attr("id")+"-search").serializeHash();$.each(s,function(e,i){"utf8"!=e&&"authenticity_token"!=e?t[e]=i:delete s[e]});var r=o.get(e);r&&(t.filtersoff=$(r).prop("checked")),-1==t.length&&(t.length=10),t.table=i.attr("id"),$.ajax({url:i.data("source"),type:"GET",data:t,success:function(e){n(e),e.page-1!=i.DataTable().page()&&i.DataTable().page(e.page-1),e.perPage!=i.DataTable().page.len()&&i.DataTable().page.len(e.perPage),a(t.filters||e.filters||s);var o=$("a[href='#"+i.attr("id")+"-collapse']");o&&"true"==o.attr("aria-expanded")&&o.click()},complete:function(){var e=$("input[type='submit']",$("#"+i.attr("id")+"-search"));$.rails.enableFormElement(e)}})}})}else i.dataTable();i.data("selections",{}),i.data("selections_negated",!1)}),a.on("click",'input[type=checkbox][id^="selected_"]',function(){var e=$(this),t=e.val(),i=e.closest(".pi-datatable"),a=i.data("selections"),n=$('input[name$="select_all"]',i).first();n.data("bypassChangeEvent",!0),e.is(":checked")?!0===i.data("selections_negated")?(delete a[t],0==Object.keys(a).length&&(n.tristate("state",!0),i.data("selections_negated",!1))):(a[t]=e.data(),n.tristate("state",null),selectDatatableRow(e,!0)):(n.is(":checked")||!0===i.data("selections_negated")?(i.data("selections_negated",!0),a[t]=e.data(),n.tristate("state",null)):(delete a[t],n.tristate("state",Object.keys(a).length>0&&null)),selectDatatableRow(e,!1)),n.data("bypassChangeEvent",!1)});var s=$.fn.dataTable.util.throttle(function(e){var t=n.index(e),i=e.val();$(a.get(t)).DataTable().search(i).draw()},500);n.keydown(function(e){var t=$(this);(String.fromCharCode(e.which).match(/\w/)||8===e.keyCode||46===e.keyCode||13===e.keyCode)&&s(t)}
38),o.change(function(){var e=$(this),t=$(e.parent().siblings("input[type=text]"));s(t)}),$('input[name$="select_all"]',a).tristate({change:function(e){var t=$(this);if(!t.data("bypassChangeEvent")){var i=t.closest(".pi-datatable"),a=(i.data("selections"),i.DataTable().rows().nodes()),n=$('input[type="checkbox"][id^="selected_"]',a);!0===e?(i.data("selections_negated",!1),i.data("selections",{}),selectDatatableRow(n,!0)):null===e?t.tristate("state",!1):(i.data("selections",{}),i.data("selections_negated",!1),selectDatatableRow(n,!1))}}})}$(".sidebar-menu .menu-items .icon-thumbnail").click(function(){$(this).prev("a")[0].click()}),$(".nav .disabled>a").on("click",function(e){return e.preventDefault(),!1}),"#comments"==window.location.hash&&$("#comments").addClass("open"),$("#attachments").on("change",'input[type="file"]',function(){var e=$(this),t=(e.closest("form"),!1);if($("input[type='text']","#attachments").each(function(){t=t||0==$(this).val().length}),!t){var i=$("#attachments"),a=e.clone().removeAttr("style").val("");i.append("<br><br>").append(a),singleFileUpload(a)}}),$("#help-video").lightGallery({download:!1,counter:!1,autoplayControls:!1,fullScreen:!1,zoom:!1}
38),$(".youtube a").each(function(){var e=$(this),t="//img.youtube.com/vi/"+$.url("?v",e.attr("href"))+"/hqdefault.jpg";e.attr("data-sub-html",e.text()),e.attr("data-thumb",t),e.attr("data-poster",t),e.html("<img class='img-responsive' src='"+t+"'/>")}),$(".youtube").lightGallery({loadYoutubeThumbnail:!0,youtubeThumbSize:"default"}),$(".image-cropper").each(function(){var e=$(this),t=e.find(".image-zoom-slider"),i=noUiSlider.create(t[0],{start:0,connect:"lower",range:{min:0,max:1}});i.on("slide",function(){var t=i.get();e.cropit("zoom",t)}),e.cropit({imageBackground:!0,imageBackgroundBorderWidth:20,width:160,height:160,minZoom:"fit",maxZoom:1,smallImage:"stretch",imageState:{src:e.find("input[id$=image_url]").val()},onImageLoaded:function(){e.cropit("isZoomable")?t.removeAttr("disabled"):t.attr("disabled","disabled"),i.updateOptions({start:e.cropit("zoom"),range:{min:e.cropit("zoom"),max:e.cropit("maxZoom")}}),i.set(e.cropit("zoom"))}}),e.closest("form").submit(function(){return e.find("input[id$=attachments_attributes__attach_url]").val(e.cropit("export",{type:"image/jpeg",quality:1})),!0})}),$(".sidebar-details").textillate({"in":{effect:"fadeInUp"},out:{effect:"noneOut",sync:!0},loop:!0});var r=new ClipboardJS(".btn-clip");if(r.on("success",function(i){e(i.trigger,"Copied!"),t(i.trigger)}),r.on("error",function(i){e(i.trigger,"Failed!"),t(i.trigger)}),$("[data-pages-countdown-date]").length>0){var l=$("[data-pages-countdown-date]").attr("data-pages-countdown-date");$(".years").countdown(l,function(e){$(this).text(e.strftime("%Y"))}),$(".months").countdown(l,function(e){$(this).text(e.strftime("%m"))}),$(".days").countdown(l,function(e){$(this).text(e.strftime("%D"))}),$(".hours").countdown(l,function(e){$(this).text(e.strftime("%H"))}),$(".minutes").countdown(l,function(e){$(this).text(e.strftime("%M"))}),$(".seconds").countdown(l,function(e){$(this).text(e.strftime("%S"))})}$(".best_in_place").best_in_place(),$(".best_in_place").bind("best_in_place:success",function(){$(this).closest("div, td").highlight()}),$(".best_in_place").bind("best_in_place:error",function(e,t){"use strict";jQuery.each(jQuery.parseJSON(t.responseText),function(e,t){"object"==typeof t&&(t=e+" "+t.toString()),showError(t)})}),$("#notification-dropdown").on("hide.bs.dropdown",function(){return 1!=$(this).data("keepOpenOnClick")}),$("#notification-dropdown").each(function(){$(this).data("keepOpenOnClick")&&$("#notification-center").click()})}),$(document).ready(function(){$("#ambassadors-export-to-xls").click(function(){doTableAction("/crm/ambassadors/export_to_xls",!0,$(".pi-datatable"))}),$.ready2(function(){var e=select2_objects.ambassador_school_id;
38null!=e&&(e.on("change",function(){var e=$(this).find(":selected"),t=e.val();if(null==t||""==t)$("#ambassador_school_name").val("").prop("disabled",!1),$("#ambassador_school_city").val("").prop("disabled",!1),$("#ambassador_school_state").val("").prop("disabled",!1),$("#ambassador_school_country").prop("disabled",!1).val("").trigger("change");else{var i=e.text(),a=e.data("location");$("#ambassador_school_name").val(i).prop("disabled",!0),$("#ambassador_school_city").val(a[0]).prop("disabled",!0),$("#ambassador_school_state").val(a[1]).prop("disabled",!0),$("#ambassador_school_country").prop("disabled",!0).val(a[2]).trigger("change")}}),""!=e.val()&&e.trigger("change"))});new Swiper("#partners_slider",{pagination:".swiper-pagination",paginationClickable:!0,effect:"fade",loop:!0,fade:{crossFade:!0},speed:700,autoplay:2e3})}),$(document).ready(function(){function t(e){function t(t){var i=e.replace(/<\/td><td>/g,": </td><td>").replace(/<br>/g," // ").replace(/<\/?[^>]+>/gi,"").replace(/^[ \t]*/gim,"").replace(/&nbsp;/g,"\n").replace(/\n{2,}$/g,"\n\n").replace(/^\n*/g,"").replace(/\n*$/g,"");i=$("<textarea />").html(i).text(),t.clipboardData.setData("text/plain",i),t.clipboardData.setData("text/html",e),t.preventDefault()}var i=$("<div class='hidden'>");$("body").append(i),i.attr("contenteditable",!0).html(e).select().on("focus",function(){document.execCommand("selectAll",!1,null)}).focus(),document.addEventListener("copy",t),document.execCommand("copy"),document.removeEventListener("copy",t),i.remove()}$.ready2(function(){let e=document.getElementById("candidate_team_id"),t=document.getElementById("candidate_employee_id");if(e&&t){var i=$("#candidate_employee_id");e.addEventListener("change",function(){i.empty(),""!=this.value&&$.ajax({url:this.dataset.url,dataType:"json",type:"GET",delay:250,data:{q:this.value},success:function(e){i.refreshDataSelect2([{id:"",text:""}].concat(e.results))}})})}let a=document.getElementById("work_experience_relevant_training_areas_0");a&&(a.addEventListener("change",function(){let e=this.checked;document.querySelectorAll('[id^="work_experience_relevant_training_areas_"]').forEach(t=>t.disabled=e&&t.value!=a.value)}),a.dispatchEvent(new Event("change"))),$("input[type='hidden'][name='candidate[accepted_fees]']").removeAttr("disabled"),$("input[type='hidden'][name='candidate[accepted_cepa]']").removeAttr("disabled"),$("div[id^=candidate_accepted_cepa_terms]").scroll(function(){var e=$
38("div[id^=candidate_accepted_cepa_terms]").length;$("div[id^=candidate_accepted_cepa_terms]").each(function(){$(this).scrollTop()+$(this).innerHeight()+2>=$(this)[0].scrollHeight&&(e-=1)}),0==e&&($("#candidate_accepted_fees").removeAttr("disabled"),$("#candidate_accepted_cepa").removeAttr("disabled"))}),$("#candidate_citizenship").on("change",function(e){var t=e.val,i=$("#phone_suffix").val();if(null==i||""==i.trim()){for(var a=$("select[id=phone_prefix]").select2()[0],n=null,o=0;o<a.length;o++)0===a[o].value.indexOf(t)&&(n=a[o].value);null!=n&&$("#phone_prefix").val(n).trigger("change")}}),setAgreementsForPrograms(),$("[id^='candidate_program']").on("change",setAgreementsForPrograms),$("[id^='candidate_program']").on("change",setLocationsForPrograms),$("#candidate_availability_date").change(function(){$(this).val()&&$("#availability_asap").prop("checked",!1)}),$("#availability_asap").change(function(){this.checked&&$("#candidate_availability_date_dtp").parent().data("datepicker").clearDates()}),$("#intro_call_true").change(function(){this.checked&&$("#intro_call_data").fadeIn(250)}),$("#intro_call_false").change(function(){$("#intro_call_data").fadeOut(250),$("#datetime_dtp").parent().data("datepicker").clearDates(),$("#datetime_tp").val(""),$("[id*=candidate_ic_comment]").val(""),$("[id*=candidate_ic_employee]").val("").trigger("change")}),$('input[name="intro_call"]:checked').trigger("change"),$("#candidate_offers_locked_true, #candidate_offers_locked_false, #candidate_standby_true, #candidate_standby_false, #candidate_active_true, #candidate_active_false").change(function(){var e=$
38(this).attr("id").replace("_false","").replace("_true","");$("#"+e+"_comment").prop("disabled",!1),$("#"+e+"_comment_box").show()}),$("#candidate_standby_true").change(function(){$("#candidate_standby_reason_box").show()}),$("#candidate_standby_false").change(function(){$("#candidate_standby_reason_box").hide()})}),$('input[name*="[training_area_ids][]"]').on("click",function(){var e=$(this),t=$(this).attr("name");if(null==e.data("parent-id"))e.is(":checked")||$('input[name="'+t+'"][data-parent-id='+e.val()+"]").prop("checked",e.is(":checked"));else{var i=$('input[name="'+t+'"][value='+e.data("parent-id")+"]");i.data("check-on-child")&&i.prop("checked",$('input[name="'+t+'"][data-parent-id='+e.data("parent-id")+"]:checked").length>0)}}),$("#copy-minicvs").on("click",function(e){var i="/crm/candidates/minicvs",a=getTableActionQueryString($(".pi-datatable"));a.length>0?($.ajax({type:"GET",url:i,data:a,async:!1,success:function(e){console.log(e),t(e),showSuccess("MiniCV's copied to clipboard")},error:function(e,t,i){showError(i,!0)}}),e.preventDefault()):showWarning("No selection")}),$(".minicv-to-popup").click(function(e){var t="/crm/candidates/minicvs?modal=true",i=""+$(this).data("id");i.length>0&&($.ajax({type:"GET",url:t,data:"ids="+i,async:!1,success:function(e){$(e).modal("show")},error:function(e,t,i){showError(i,!0)}}),e.preventDefault())}),$("#minicvs-to-popup").click(function(e){var t="/crm/candidates/minicvs?modal=true",i=$(this).data("attribute"),a=getTableActionQueryString($(".pi-datatable"),i);a.length>0?($.ajax({type:"GET",url:t,data:a,async:!1,success:function(e){$(e).modal("show")},error:function(e,t,i){showError(i,!0)}}),e.preventDefault()):showWarning("No selection")}),$("#export-minicvs-to-xls").click(function(){var e="/crm/candidates/export_minicvs_to_xls",t=$(this).data("attribute");doTableAction(e,!0,$(".pi-datatable"),t)}),$("#candidates-export-to-xls").click(function(){var e="/crm/candidates/export_to_xls",t=$(this).data("attribute");doTableAction(e,!0,$(".pi-datatable"),t)}),$("#send-mail").click(function(){doTableAction("/crm/candidates/new_mail",!1,$(".pi-datatable"))}),$("#send-offers").click(function(){doTableAction("/crm/candidates/new_offer",!1,$(".pi-datatable"))}),$(".set-relevant-area").click(function(){$("#workexperiences-areas-update");var t=getTableSelection($("#workstable")).join();0==t.length?(showWarning("No selection"),e.preventDefault()):($("input[name='we_ids']","#workexperiences-areas-update").val(t),$("input[name='ta_ids']","#workexperiences-areas-update").val($(this).data("id")),$("input[name='mode']","#workexperiences-areas-update").val($(this).closest("ul").data("mode")),document.getElementById("workexperiences-areas-update").submit())}),$(".set-isced-level").click(function(){$("#studies-areas-update");var t=getTableSelection($("#studiestable")).join();0==t.length?(showWarning("No selection"),e.preventDefault()):($("input[name='st_ids']","#studies-areas-update").val(t),$("input[name='le_ids']","#studies-areas-update").val($(this).data("id")),document.getElementById("studies-areas-update").submit())}),$("#new_offer_form").submit(function(e){var t=getTableSelection($(".pi-datatable")).join();0==t.length?e.preventDefault():$(this).append('<input type="hidden" name="offer_form[offers_ids]" value="'+t+'" />')}),$("#download-pi-cvs").click(function(){var e="/crm/candidates/download_pi_cvs",t=$(this).data("attribute");doTableAction(e,!0,$(".pi-datatable"),t)}),$("#candidates-dashboard span").click(function(e){var t=$(this);$("#filters_status").val(t.data("status")).trigger("change"),null!=t.data("locked")?$("#filters_offers_locked_true").prop("checked","checked"):$("#filters_offers_locked_true").removeAttr("checked"),null!=t.data("standby")?$("#filters_standby_true").prop("checked","checked"):$("#filters_standby_true").removeAttr("checked"),null!=t.data("active")?$("#filters_active_true").prop("checked","checked"):$("#filters_active_true").removeAttr("checked"),null!=t.data("starred")?$("#filters_starred_true").prop("checked","checked"):$("#filters_starred_true").removeAttr("checked"),e.stopPropagation(),$("#candidates-table-search").submit()}),$(".pi-advice .video-gallery").each(function(){$(this).wrap("<div class='row'><div class='col-sm-6'></div></div>")}
38),$(".video-gallery li").each(function(){var e=$(this),t="https://img.youtube.com/vi/"+$.url("?v",e.data("src"))+"/mqdefault.jpg";e.attr("data-sub-html",e.text()),e.attr("data-thumb",t),e.attr("data-poster",t),e.html("<img src='"+t+"'/>")}),$(".video-gallery").lightSlider({gallery:!0,item:1,loop:!0,thumbItem:9,slideMargin:0,enableDrag:!1,currentPagerPosition:"left",onSliderLoad:function(e){e.lightGallery({selector:".video-gallery .lslide"})}}),$(".social-feed-container").socialfeed({facebook:{accounts:["@Placement.Inter"],limit:4,access_token:"1425672067465824|1aba6dc314352e67f3a3f994c52c638f"},length:400,show_media:!0,media_min_width:50,template:"/social_feed_template.html",date_format:"ll",moderation:function(e){return!e.text||-1==e.text.indexOf("fuck")},callback:function(){$(".social-feed-container img[data-src]").each(function(){var e=$(this).data("src");$(this).prop("src",e)})}});new Swiper("#partners-candidate-home",{autoplay:1e3,parallax:!0,speed:1e3});var i=new Swiper("#testimonials_slider",{pagination:".swiper-pagination",paginationClickable:!0,nextButton:".swiper-button-next",prevButton:".swiper-button-prev",speed:2e3,autoplay:2e3});$("#testimonials_slider").mouseenter(function(){i.stopAutoplay()}),$("#testimonials_slider").mouseleave(function(){i.startAutoplay()}),$("#testimonials_slider .swiper-slide div").on("mousedown touchstart pointerdown",function(e){e.stopPropagation()});new Swiper("#places-candidate-home",{effect:"fade",calculateHeight:!0,loop:!0,fade:{crossFade:!0},speed:2e3,autoplay:2e3})}),$(document).ready(function(){$.ready2(function(){if($("#email_template_scope").length>0){var e=ace.edit("email_template_scope");e.setTheme("ace/theme/textmate"),e.session.setMode("ace/mode/json"),e.session.on("change",function(){updateEmailTemplate(null)})}})}),$(document).ready(function(){$.ready2(function(){$("#hire-preview-invoice").click(function(){var e="/crm/hires/preview_invoice";e=e+"?"+(-1!=$(this).closest("form").attr("id").indexOf("hire")?$(this).closest("form").find(":input").filter(function(){return"hire[candidate_id]"==this.name||"hire[from_date]"==this.name||this.name.startsWith("hire[payment_plan_attributes]")&&"hire[payment_plan_attributes][id]"!=this.name}).serialize():$(this).closest("form").find(":input").filter(function(){return"payment_plan[hire][candidate_id]"==this.name||"payment_plan[hire][from_date]"==this.name||this.name.startsWith("payment_plan[")&&!this.name.startsWith("payment_plan[payments_attributes]")&&"payment_plan[id]"!=this.name}).serialize().replace(new RegExp("payment_plan%5Bhire%5D","g"),"hire").replace(new RegExp("payment_plan%5B","g"),"hire%5Bpayment_plan_attributes%5D")),previewAttachment("?zoom=1.5&title=Preview Invoice&downloadUrl="+encodeURIComponent(e)+"#"+e)}),$('input[id^="hire_hire_type_"]').change(function(){"P"==$(this).val()?($("#course-information").addClass("hide"),$("#program-information").removeClass("hide"),$("#candidate-information").removeClass("hide")):"C"==$(this).val()?($("#course-information").removeClass("hide"),$("#program-information").addClass("hide"),$("#candidate-information").addClass("hide")):($("#course-information").removeClass("hide"),$("#program-information").removeClass("hide"),$("#candidate-information").removeClass("hide"))}),$('input[id^="hire_payment_plan_attributes"], input[id^="payment_plan_"]:not([id^="payment_plan_payments_attributes"])').change(function(){enableInvoicePreview(),$("#payments-information").replaceWith("")}),$("#hire_visa_approved_, #hire_visa_approved_true, #hire_visa_approved_false").click(function(){$("#hire_embassy_on_2").val(""),$("#embassy_on_2").val(""),$("#hire_visa_approved_2_").click(),$("#hire_embassy_on_3").val(""),$("#embassy_on_3").val(""),$("#hire_visa_approved_3_").click()}),$("#hire_visa_approved_2_, #hire_visa_approved_2_true, #hire_visa_approved_2_false").click(function(){$("#hire_embassy_on_3").val(""),$("#embassy_on_3").val(""),$("#hire_visa_approved_3_").click()}),$("#hire_visa_approved_").click(function(){$("div.hire_embassy_on_2, #visa_2_group_v").addClass("hide"),$("div.hire_embassy_on_3, #visa_3_group_v").addClass("hide")}),$("#hire_visa_approved_true").click(function(){$("div.hire_embassy_on_2, #visa_2_group_v").addClass("hide"),$("div.hire_embassy_on_3, #visa_3_group_v").addClass("hide")}),$("#hire_visa_approved_false").click(function(){$("div.hire_embassy_on_2, #visa_2_group_v").removeClass("hide")}),$("#hire_visa_approved_2_").click(function(){$("div.hire_embassy_on_3, #visa_3_group_v").addClass("hide")}),$("#hire_visa_approved_2_true").click(function(){$("div.hire_embassy_on_3, #visa_3_group_v").addClass("hide")}),$("#hire_visa_approved_2_false").click(function(){$("div.hire_embassy_on_3, #visa_3_group_v").removeClass("hide")}),$("#hire_embassy_on_2").change(function(){}),$("#hire_embassy_on_3").change(function(){}),$("#hire_visa_approved_2_").click(function(){}),$("#hire_visa_approved_2_true").click(function(){}),$("#hire_visa_approved_2_false").click(function(){}),$("#hire_visa_approved_3_").click(function(){}),$("#hire_visa_approved_3_true").click(function(){}),$("#hire_visa_approved_3_false").click(function(){}),$("#hire_subject_to_refund_true").click(function(){$(".hire_bank_info_for_refund, .hire_amount_to_refund, .hire_refunded_on").removeClass("hide")}),$("#hire_subject_to_refund_false").click(function(){$(".hire_bank_info_for_refund, .hire_amount_to_refund, .hire_refunded_on").addClass("hide"),$("#hire_bank_info_for_refund, #hire_amount_to_refund").val(""),$("#hire_refunded_on_dtp").parent().data("datepicker").clearDates()}),$('input[name="hire[subject_to_refund]"]:checked').click(),$("#hire_arrival_type_g").click(function(){$("#arrival_type_air_group").addClass("hide")}),$("#hire_arrival_type_a").click(function(){$("#arrival_type_air_group").removeClass("hide")}),$("#hires-export-to-xls").click(function(){doTableAction("/crm/hires/export_to_xls",!0,$(".pi-datatable"))}),$("#hires-export-surveys-to-xls").click(function(){doTableAction("/crm/hires/export_surveys_to_xls",!0,$(".pi-datatable"))}),$("#payments_quantity").change(function(){}),$("[id$=_total_amount]").change(function(){updatePayments()}),$("#payments").on("change","[id*=_payments_attributes_][id$=_amount]",function(){updatePayments()}),$("#payments").on("change","[id*=_payments_attributes_][id$=_amount_received]",function(){updatePaymentsWithReceived($(this).data("slot-index"))}),$('#hire_candidate_id, input[id^="hire_hire_type_"]').change(function(){$("#hire_candidate_id").find(":selected");
38var e=$("#hire_candidate_id").val(),t=$("#hire_payment_plan_attributes_payment_template_id"),i=$('input[name="hire[hire_type]"]:checked').val();i="D"==i||"C"==i?"H":"P",t.empty(),""!=e&&$.ajax({url:"/crm/hires/payment_templates_list",dataType:"json",type:"GET",delay:250,data:{q:e,s:i},success:function(e){t.refreshDataSelect2([{id:"",text:""}].concat(e.results))}})}),$("#hire_payment_plan_attributes_payment_template_id, #payment_plan_payment_template_id").change(function(){var e=$(this).find(":selected"),t=$("[id*=_installments_]:checked"),i=$("[id*=_installments_]");if(i.prop("checked",!1),i.attr("disabled",!0),e.length>0&&e.data("installments")){for(var a=e.data("installments"),n=0;n<a.length;n++)$("[id*=_installments_"+a[n]+"_], [id$=_installments_"+a[n]+"]").attr("disabled",!1);t.length>0&&!t.attr("disabled")?t.prop("checked",!0):$("[id*=_installments_]:enabled:first").prop("checked",!0)}if(e.length>0&&e.data("administrative-fee")>0){$("[id*=_administrative_fee_separated_true").attr("disabled",!1);var o=$("[id*=_administrative_fee_separated_]:checked");0==o.length&&(o=$("[id*=_administrative_fee_separated_"+e.data("administrative-fee-separated")+"]")).prop("checked",!0),o.trigger("change")}else $("[id*=_administrative_fee_separated_false]").prop("checked",!0),$("[id*=_administrative_fee_separated_true]").attr("disabled",!0),$("[id*=_administrative_fee_separated_false]").trigger("change")}).trigger("change"),$("#hire_offer_id").change(function(){console.log(this);$("#hire_offer_id").find(":selected");var e=$("#hire_offer_id").val(),t=$("#hire_visa_type_id");t.empty(),""!=e&&$.ajax({url:"/crm/offers/visa_types_list",dataType:"json",type:"GET",delay:250,data:{q:e},success:function(e){t.refreshDataSelect2([{id:"",text:""}].concat(e.results))}})}),$("[id*=_administrative_fee_separated_true]:not([id^=payment_template])").change(function(){$("[id*=_payment_date_2]").attr("disabled",!1);var e=$("[id*=_payment_date_2_dtp]").parent().data("datepicker");if(null!=e&&null==e.getDate()){var t=null;null==t&&(t=new Date),e.setDate(moment(t).add(7,"d").add(1,"M").toDate())}$("#payment_date_2").visible()}),$("[id*=_administrative_fee_separated_false]:not([id^=payment_template])").change(function(){$("[id*=_payment_date_2]").length>0&&($("[id*=_payment_date_2]").attr("disabled",!0),$("[id*=_payment_date_2_dtp]").parent().data("datepicker").clearDates(),$("#payment_date_2").invisible())});var e=$("[id*=_administrative_fee_separated_]:not([id^=payment_template]):checked").val();$("[id*=_administrative_fee_separated_"+e+"]").trigger("change"),enableInvoicePreview()}),enableRemovePayment(),enablePaymentsComponents(document),updatePayments()}),$(document).ready(function(){$.ready2(function(){enableRemoveSlot(),enableComponents(document),$("#interview_schedule_offer_id").length>0&&$("body").on("hide.bs.modal",".modal",function(){if($(document.activeElement).hasClass("proceed")){var e=$('input[name="send_pending"]:hidden');e.val("true"),e.closest("form").submit()}})})}
38),$(document).ready(function(){$.ready2(function(){var e=$("select#interview_candidate_id");e.select2({ajax:{url:e.data("url"),dataType:"json",type:"GET",delay:250,data:function(e){return{q:e.term,page:e.page}},processResults:function(e){return{results:e.results}},cache:!0},placeholder:e.data("placeholder"),minimumInputLength:3})}),$("#interviews-export-to-xls").click(function(){doTableAction("/crm/interviews/export_to_xls",!0,$(".pi-datatable"))}),$("#interviews-minicvs-to-popup").click(function(e){var t="/crm/candidates/minicvs?modal=true",i=getTableActionQueryString($(".pi-datatable"),"candidateId");i.length>0?($.ajax({type:"GET",url:t,data:i,async:!1,success:function(e){$(e).modal("show")},error:function(e,t,i){showError(i,!0)}}),e.preventDefault()):showWarning("No selection")}),$("#interviews-export-minicvs-to-xls").click(function(){doTableAction("/crm/candidates/export_minicvs_to_xls",!0,$(".pi-datatable"),"candidateId")}),$("#interviews-download-pi-cvs").click(function(){doTableAction("/crm/candidates/download_pi_cvs",!0,$(".pi-datatable"),"candidateId")})});var modal_holder_selector="#modal-holder",modal_selector=".modal",modal_selector2=".modal-content";$(document).on("show.bs.modal",modal_selector,function(e){"bs.modal"===e.namespace&&initAppComponents($(this))}
38),$(document).on("click","a[data-modal]",function(){var e=$(this).attr("href");return $.get(e,function(e){initModalComponents(e)}),!1}),$(modal_holder_selector).on("keydown",modal_selector,function(e){var t=$(this),i=$(".modal-body",t),a=50,n=i.innerHeight(),o=0;switch(e.keyCode){case 38:o=-a;break;case 40:o=a;break;case 33:o=.9*-n;break;case 34:o=.9*n;break;default:return!0}i.scrollTop(i.scrollTop()+o),e.preventDefault()}),$(document).on("ajax:success","form[data-modal]",function(e,t,i,a){var n=a.getResponseHeader("Location");return n?window.location=n:null!=$(this).data("submitButton")&&$(modal_selector).modal("hide"),!1}),$(document).on("ajax:error","form[data-modal]",function(e,t){$(".modal-backdrop").remove(),initModalComponents(t.responseText)}),$(document).ready(function(){$.ready2(function(){$("#news_send_to_a").click(function(){$("div.news_teams").fadeOut(500),$("#news_teams").val("").trigger("change"),$("div.news_employees").fadeOut(500),$("#news_employees").val("").trigger("change")}),$("#news_send_to_h").click(function(){$("div.news_employees").fadeOut(500),$("#news_employees").val("").trigger("change"),$("div.news_teams").fadeIn(500)}),$("#news_send_to_e").click(function(){$("div.news_teams").fadeOut(500),$("#news_teams").val("").trigger("change"),$("div.news_employees").fadeIn(500)}),$('input[name="news[send_to]"]:checked').trigger("click")})}),$(document).ready(function(){function e(){let e=Array.from(document.querySelectorAll('[id^="offer_experience_required_"]')),t=e.filter(e=>e.checked).map(t=>e.indexOf(t));e.forEach(i=>{let a=e.indexOf(i);i.disabled=!(0==t.length||-1!=t.indexOf(a)||t.length<2&&(-1!=t.indexOf(a+1)||-1!=t.indexOf(a-1)))})}function t(e){$("#school_contact_person[value]").remove(),$.ajax({type:"GET",url:"/crm/schools/:school_id:/contacts".replace(":school_id:",e),dataType:"json",data:{}}).done(function(e){var t=e.results.map(function(e){return'<option value="'+e.id+'">'+e.text+"</option>"});$("#school_contact_person").html(t.join("")).val("").change()})}var i=$("#contact-tabs a");i.length>0&&(i.on("shown.bs.tab",function(e){var t=$(e.target).attr("href").substr(1);$("#offer_contact_type").val(t)}),$("#offer_contact_type").val($(".tab-pane.active").attr("id"))),$.ready2(function(){$("#offer_from_date").change(function(){$(this).val()&&$("#offer_asap_false").prop("checked",!0)}),$("#offer_asap_true").change(function(){this.checked&&$("#offer_from_date_dtp").parent().data("datepicker").clearDates()})}),document.querySelector('[id^="offer_experience_required_"]')&&(document.querySelectorAll('[id^="offer_experience_required_"]').forEach(t=>t.addEventListener("change",e)),document.querySelector('[id^="offer_experience_required_"]').dispatchEvent(new Event("change"))),$("#send-to-candidates").click(function(){doTableAction("/crm/offers/:offer_id:/send_to_candidate".replace(":offer_id:",$("#offer_id").val()),!1,$(".pi-datatable"))}),$("#candidates-to-property").click(function(){doTableAction("/crm/offers/:offer_id:/send_to_property".replace(":offer_id:",$("#offer_id").val()),!1,$(".pi-datatable"))}),$("#offer-accept-candidates").click(function(){doTableAction("/crm/offers/:offer_id:/property_accept".replace(":offer_id:",$("#offer_id").val()),!1,$(".pi-datatable"))}),$("#offer-reject-candidates").click(function(){doTableAction("/crm/offers/:offer_id:/property_reject".replace(":offer_id:",$("#offer_id").val()),!1,$(".pi-datatable"))}),$("#offer-waiting-candidates").click(function(){var e="/crm/offers/:offer_id:/waiting_candidates";if(!(e=doTableAction(e.replace(":offer_id:",$("#offer_id").val()),"ajax",$(".pi-datatable"))))return!1;$(this).attr("href",e)}),$("#offers-to-candidates").click(function(){doTableAction("/crm/offers/new_candidate",!1,$(".pi-datatable"))}),$("#candidate-accept-offers").click(function(){doTableAction($(this).data("url"),!1,$(".pi-datatable"))}),$("#candidate-reject-offers").click(function(){doTableAction($(this).data("url"),!1,$(".pi-datatable"))}),$("#new_candidate_form").submit(function(e){var t=getTableSelection($(".pi-datatable")).join();0==t.length?e.preventDefault():$(this).append('<input type="hidden" name="offer_form[candidates_ids]" value="'+t+'" />')}),$("#offers-export-to-xls").click(function(){doTableAction("/crm/offers/export_to_xls",!0,$(".pi-datatable"))}),$("#offers-brochures-to-zip").click(function(){doTableAction("/crm/offers/create_brochures",!1,$(".pi-datatable"))}),$(".applying-candidates-as-xls").click(function(){console.log($(this).data("id")),doTableAction("/crm/offers/applying_candidates_to_xls",!1,$(".pi-datatable"),null,"last_days="+$(this).data("id"))}),$(".live-tile,.flip-list").liveTile(),$("#offer_property_id").change(function(){console.log(this);$("#offer_property_id").find(":selected");
38var e=$("#offer_property_id").val(),t=$("#offer_visa_type_ids");t.empty(),""!=e&&$.ajax({url:"/crm/offers/visa_types_list",dataType:"json",type:"GET",delay:250,data:{p:e,c:!0},success:function(e){t.refreshDataSelect2([{id:"",text:""}].concat(e.results))}})});var a=select2_objects.school_contact;if(null!=a){a.on("change",function(){t($(this).data("select2").val())});var n=a.val();""!=n&&t(n)}}),$(document).ready(function(){$.ready2(function(){function e(e){e.target.parentElement.parentElement.querySelectorAll('[id^="role_permission_ids_"]').forEach(t=>{e.target.value!=t.value&&(t.disabled=e.target.checked)})}function t(e){let t="S"==e.target.value;document.querySelectorAll('[id^="team_agreement_ids_"]').forEach(e=>{e.disabled=!t})}$("#working_hours_from, #working_hours_to").change(function(){var e=$("#working_hours_from").val(),t=$("#working_hours_to").val(),i=$.trim(e).length>0&&$.trim(e).length>0?e+" - "+t:"";$('input[id$="_working_hours"]').attr("value",i)}),document.querySelector('[id^="role_permission_ids_"]')&&document.querySelectorAll('[id^="role_permission_ids_"]').forEach(t=>{"manage"==t.nextSibling.innerHTML&&(t.addEventListener("change",e),t.dispatchEvent(new Event("change")))}),document.querySelector('[id^="team_team_type_"]')&&(document.querySelectorAll('[id^="team_team_type_"]').forEach(e=>e.addEventListener("change",t)),document.querySelector('[id^="team_team_type_"]').dispatchEvent(new Event("change")))})}),$(document).ready(function(){$("#payment-plans-export-to-xls").click(function(){doTableAction("/crm/payment_plans/export_to_xls",!0,$(".pi-datatable"))}),$("#payments-export-to-xls").click(function(){doTableAction("/crm/payments/export_to_xls",!0,$(".pi-datatable"))}),$('input[id^="payment_plan_payment_plan_type_"]').change(function(){"H"==$(this).val()?($("#payment_plan_candidate_id").val(null).trigger("change"),$("#hire-information").removeClass("hide"),$("#candidate-information").addClass("hide"),$("#payment_plan_candidate_id").val(null).trigger("change")):($("#payment_plan_hire_id").val(null).trigger("change"),$("#hire-information").addClass("hide"),
39$("#candidate-information").removeClass("hide"))}),$("#payment-plans-dashboard span").click(function(e){var t=$(this);$("#filters_status").val(t.data("status")).trigger("change"),e.stopPropagation(),$("#payment_plans-table-search").submit()})}),$(document).ready(function(){$.ready2(function(){let e=document.getElementById("payment_template_agreement_id");e&&(e.addEventListener("change",function(){let e=$(this).find(":selected");if(console.log($(e).data("teams")),e&&$(e).data("teams")){let t=$(e).data("teams").toString().split(",").filter(function(e){return e});$("input[id*=payment_template_team_ids_").each(function(){this.disabled=!(0==t.length||t.includes(this.value))})}}),e.dispatchEvent(new Event("change"))),$("a[data-installments]").click(function(){var e=parseFloat($(this).attr("data-installments"));return $('input[id$="_amount"][data-t="'+e+'"]').each(function(){$(this).val("")}
39),$('input[id$="_checkout_link"][data-t="'+e+'"]').each(function(){$(this).val("")}),!1}),$('input[id^="payment_template_installments_attributes_"][id$="_amount"]').change(function(){$(this).attr("id");var e=$(this).attr("data-t"),t=($(this).attr("data-i"),parseFloat("0"));$('input[id$="_amount"][data-t="'+e+'"]').each(function(){var e=$(this).val();console.log(e),Number.isValidNumber(e)&&(t+=Number.parseFloat(e))}),$("#total-inst-"+e).text(t.toFixed(2))}),$('input[id$="_dd_as"]').change(function(){var e=$(this);e.attr("id"),parseInt(e.data("t")),parseInt(e.data("i"))})})}),$(document).ready(function(){$("#properties-export-to-xls").click(function(){doTableAction("/crm/properties/export_to_xls",!0,$(".pi-datatable"))}),$("#properties-export-with-contacts-to-xls").click(function(){doTableAction("/crm/properties/export_with_contacts_to_xls",!0,$(".pi-datatable"))}),$("#properties-send-cvs").click(function(){doTableAction("properties/select_candidates",!1,$(".pi-datatable"))}),$("#properties-send-mail").click(function(){doTableAction("/crm/properties/new_mail",!1,$(".pi-datatable"))}),$("#property-candidates-dashboard span").click(function(e){var t=$(this);$("#filters_status").val(t.data("status")).trigger("change"),e.stopPropagation(),$("#property-candidates-table-search").submit()})}),$(document).ready(function(){$.ready2(function(){var e=select2_objects.recruiting_event_school_id;
39null!=e&&(e.on("change",function(){var e=$(this).find(":selected"),t=e.val();if(null==t||""==t)$("#recruiting_event_place").val("").prop("disabled",!1),$("#recruiting_event_city").val("").prop("disabled",!1),$("#recruiting_event_state").val("").prop("disabled",!1),$("#recruiting_event_country").prop("disabled",!1).val("").trigger("change");else{var i=e.text(),a=e.data("location");$("#recruiting_event_place").val(i).prop("disabled",!0),$("#recruiting_event_city").val(a[0]).prop("disabled",!0),$("#recruiting_event_state").val(a[1]).prop("disabled",!0),$("#recruiting_event_country").prop("disabled",!0).val(a[2]).trigger("change")}}),""!=e.val()&&e.trigger("change"))})}),$(document).ready(function(){$("#school-candidates-dashboard span").click(function(e){var t=$(this);$("#filters_status").val(t.data("status")).trigger("change"),e.stopPropagation(),$("#schools-candidates-table-search").submit()}),$("#schools-export-to-xls").click(function(){doTableAction("/crm/schools/export_to_xls",!0,$(".pi-datatable"))}),$("#schools-export-with-contacts-to-xls").click(function(){doTableAction("/crm/schools/export_with_contacts_to_xls",!0,$(".pi-datatable"))}),$("#schools-export-for-emailing-to-xls").click(function(){doTableAction("/crm/schools/export_for_emailing_to_xls",!0,$(".pi-datatable"))}),$("#schools-send-mail").click(function(){doTableAction("/crm/schools/new_mail",!1,$(".pi-datatable"))}),$("#school-candidates-dashboard span").click(function(e){var t=$(this);$("#filters_status").val(t.data("status")).trigger("change"),e.stopPropagation(),$("#school-candidates-table-search").submit()}
39),$.ready2(function(){var e=$("#school_qty_internships").val();""!=e&&updateSchoolInternship(e),$("#school_qty_internships").on("change",function(){updateSchoolInternship($(this).val())})})}),$(document).ready(function(){$.ready2(function(){$("select[id*=study_school_id], select[id*=studies_attributes_][id*=_school_id]").each(function(){var e=$(this);null!=e&&(e.on("change",function(){var e=$(this).find(":selected"),t=e.val();if(null==t||""==t)$("input[id*=study_school_name], input[id*=studies_attributes_][id*=_school_name]").val("").prop("disabled",!1),$("input[id*=study_city], input[id*=studies_attributes_][id*=_city]").val("").prop("disabled",!1),$("input[id*=study_state], input[id*=studies_attributes_][id*=_state]").val("").prop("disabled",!1),$("select[id*=study_country], select[id*=studies_attributes_][id*=_country]").prop("disabled",!1).val("").trigger("change"),$("input[id*=study_coordinator], input[id*=studies_attributes_][id*=_coordinator]").each(function(){$(this).closest(".form-group").show()});else{var i=e.text(),a=e.data("location");$("input[id*=study_school_name], input[id*=studies_attributes_][id*=_school_name]").val(i).prop("disabled",!0),$("input[id*=study_city], input[id*=studies_attributes_][id*=_city]").val(a[0]).prop("disabled",!0),$("input[id*=study_state], input[id*=studies_attributes_][id*=_state]").val(a[1]).prop("disabled",!0),$("select[id*=study_country], select[id*=studies_attributes_][id*=_country]").prop("disabled",!0).val(a[2]).trigger("change"),$("input[id*=study_coordinator], input[id*=studies_attributes_][id*=_coordinator]").each(function(){var e=$
39(this);e.val(""),e.closest(".form-group").hide()})}}),""!=e.val()&&e.trigger("change"))})})}),$(document).ready(function(){$("#user_email_confirmation, #user_password_confirmation").on("paste drop",function(){return!1});var e=$("#new_user");e.length>0&&($("div.alert").removeClass("hide"),$("input[type=submit]",e).on("mouseenter focus",function(){$("#user_username").val("")}),e.on("submit",function(){$("#user_username").val("")}),$("input[type=submit]",e).prop("disabled",!1))}),$(document).ready(function(){}),function(){var e,t,i,a,n,o,s,r,l,d,c,u,p,h,m,f,g,v,b,_,y,w,k,$,x,C,T,S,D,E,I,P,M,O,j,A,B,F,H,L,R,N,z,V,q,Q,Y,U,W,G,K,X,J,Z,ee,te=[].indexOf||function(e){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===e)return t;return-1},ie=function(e,t){function i(){this.constructor=e}for(var a in t)ae.call(t,a)&&(e[a]=t[a]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},ae={}.hasOwnProperty,ne=[].slice,oe=function(e,t){return function(){return e.apply(t,arguments)}};M={},u=10,K=!1,F=null,v=null,I=null,R=null,ee=null,a={BEFORE_CHANGE:"page:before-change",FETCH:"page:fetch",RECEIVE:"page:receive",CHANGE:"page:change",UPDATE:"page:update",LOAD:"page:load",RESTORE:"page:restore",BEFORE_UNLOAD:"page:before-unload",EXPIRE:"page:expire"},k=function(e){var t;return e=new i(e),Q(),c(),null!=F&&F.start(),K&&(t=X(e.absolute))?($(t),x(e,null,!1)):x(e,W)},X=function(e){var t;if((t=M[e])&&!t.transitionCacheDisabled)return t},_=function(e){return null==e&&(e=!0),K=e},b=function(e){if(null==e&&(e=!0),l)return e?null!=F?F:F=new o("html"):(null!=F&&F.uninstall(),F=null)},x=function(e,t,i){return null==i&&(i=!0),J(a.FETCH,{url:e.absolute}),null!=ee&&ee.abort(),(ee=new XMLHttpRequest).open("GET",e.withoutHashForIE10compatibility(),!0),ee.setRequestHeader("Accept","text/html, application/xhtml+xml, application/xml"),ee.setRequestHeader("X-XHR-Referer",R),ee.onload=function(){var i;return J(a.RECEIVE,{url:e.absolute}),(i=B())?(N(e),z(),p.apply(null,w(i)),P(),"function"==typeof t&&t(),J(a.LOAD)):document.location.href=g()||e.absolute},F&&i&&(ee.onprogress=function(e){var t;return t=e.lengthComputable?e.loaded/e.total*100:F.value+(100-F.value)/10,F.advanceTo(t)}),ee.onloadend=function(){return ee=null},ee.onerror=function(){return document.location.href=e.absolute},ee.send()},$=function(e){return null!=ee&&ee.abort(),p(e.title,e.body),H(e),J(a.RESTORE)},c=function(){var e;return e=new i(v.url),M[e.absolute]={url:e.relative,body:document.body,title:document.title,positionY:window.pageYOffset,positionX:window.pageXOffset,cachedAt:(new Date).getTime(),transitionCacheDisabled:null!=document.querySelector("[data-no-transition-cache]")},m(u)},j=function(e){if(null==e&&(e=u),/^[\d]+$/.test(e))return u=parseInt(e)},m=function(e){var t,i,n,o,s,r;for(t=(s=Object.keys(M)).map(function(e){return M[e].cachedAt}).sort(function(e,t){return t-e}),r=[],i=0,o=s.length;i<o;i++)n=s[i],M[n].cachedAt<=t[e]&&(J(a.EXPIRE,M[n]),r.push(delete M[n]));return r},p=function(t,i,n,o){return J(a.BEFORE_UNLOAD),document.title=t,document.documentElement.replaceChild(i,document.body),null!=n&&e.update(n),G(),o&&y(),v=window.history.state,null!=F&&F.done(),J(a.CHANGE),J(a.UPDATE)},y=function(){var e,t,i,a,n,o,s,r,l,d,c,u;for(i=0,n=(u=Array.prototype.slice.call(document.body.querySelectorAll('script:not([data-turbolinks-eval="false"])'))).length;i<n;i++)if(""===(l=(c=u[i]).type)||"text/javascript"===l){for(t=document.createElement("script"),a=0,o=(d=c.attributes).length;a<o;a++)e=d[a],t.setAttribute(e.name,e.value);c.hasAttribute("async")||(t.async=!1),t.appendChild(document.createTextNode(c.innerHTML)),r=c.parentNode,s=c.nextSibling,r.removeChild(c),r.insertBefore(t,s)}},Y=function(e){return e.innerHTML=e.innerHTML.replace(/<noscript[\S\s]*?<\/noscript>/gi,""),e},G=function(){var e,t;if((e=(t=document.querySelectorAll("input[autofocus], textarea[autofocus]"))[t.length-1])&&document.activeElement!==e)return e.focus()},N=function(e){if((e=new i(e)).absolute!==R)return window.history.pushState({turbolinks:!0,url:e.absolute},"",e.absolute)},z=function(){var e,t;if(e=ee.getResponseHeader("X-XHR-Redirected-To"))return t=(e=new i(e)).hasNoHash()?document.location.hash:"",window.history.replaceState(window.history.state,"",e.href+t)},g=function(){var e;if(null!=(e=ee.getResponseHeader("Location"))&&new i(e).crossOrigin())return e},Q=function(){return R=document.location.href},q=function(){return window.history.replaceState({turbolinks:!0,url:document.location.href},"",document.location.href)},V=function(){return v=window.history.state},P=function(){var e;if(navigator.userAgent.match(/Firefox/)&&!(e=new i).hasNoHash())return window.history.replaceState(v,"",e.withoutHash()),document.location.hash=e.hash},H=function(e){return window.scrollTo(e.positionX,e.positionY)},W=function(){return document.location.hash?document.location.href=document.location.href:window.scrollTo(0,0)},h=function(e){var t,i,a;if(null==e||"object"!=typeof e)return e;for(i in t=new e.constructor,e)a=e[i],t[i]=h(a);return t},A=function(e){var t,i;return i=(null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1].toUpperCase():void 0)||"",document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/",i},J=function(e,t){var i;return"undefined"!=typeof Prototype&&Event.fire(document,e,t,!0),i=document.createEvent("Events"),t&&(i.data=t),i.initEvent(e,!0,!0),document.dispatchEvent(i)},O=function(e){return!J(a.BEFORE_CHANGE,{url:e})},B=function(){var e,t,i,a,n;if(n=function(){var e;return null!=(e=ee.getResponseHeader("Content-Type"))&&e.match(/^(?:text\/html|application\/xhtml\+xml|application\/xml)(?:;|$)/)},i=function(e){var t,i,a,n,o;for(o=[],t=0,i=(n=e.querySelector("head").childNodes).length;t<i;t++)null!=("function"==typeof(a=n[t]).getAttribute?a.getAttribute("data-turbolinks-track"):void 0)&&o.push(a.getAttribute("src")||a.getAttribute("href"));return o},e=function(e){var t;return I||(I=i(document)),(t=i(e)).length!==I.length||a(t,I).length!==I.length},a=function(e,t){var i,a,n,o,s;for(e.length>t.length&&(e=(n=[t,e])[0],t=n[1]),o=[],i=0,a=e.length;i<a;i++)s=e[i],te.call(t,s)>=0&&o.push(s);return o},!function(){var e;return 400<=(e=ee.status)&&e<600}()&&n()&&(t=f(ee.responseText))&&!e(t))return t},w=function(t){var i;return[null!=(i=t.querySelector("title"))?i.textContent:void 0,Y(t.querySelector("body")),e.get(t).token,"runScripts"]},e={get:function(e){var t;return null==e&&(e=document),{node:t=e.querySelector('meta[name="csrf-token"]'),token:null!=t&&"function"==typeof t.getAttribute?t.getAttribute("content"):void 0}},update:function(e){var t;if(null!=(t=this.get()).token&&null!=e&&t.token!==e)return t.node.setAttribute("content",e)}},f=function(e){var t;return(t=document.documentElement.cloneNode()).innerHTML=e,t.head=t.querySelector("head"),t.body=t.querySelector("body"),t},i=function(){function e(t){if(this.original=null!=t?t:document.location.href,this.original.constructor===e)return this.original;this._parse()}return e.prototype.withoutHash=function(){return this.href.replace(this.hash,"").replace("#","")},e.prototype.withoutHashForIE10compatibility=function(){return this.withoutHash()},e.prototype.hasNoHash=function(){return 0===this.hash.length},e.prototype.crossOrigin=function(){return this.origin!==(new e).origin},e.prototype._parse=function(){var e;return(null!=this.link?this.link:this.link=document.createElement("a")).href=this.original,e=this.link,this.href=e.href,this.protocol=e.protocol,this.host=e.host,this.hostname=e.hostname,this.port=e.port,this.pathname=e.pathname,this.search=e.search,this.hash=e.hash,this.origin=[this.protocol,"//",this.hostname].join(""),0!==this.port.length&&(this.origin+=":"+this.port),this.relative=[this.pathname,this.search,this.hash].join(""),this.absolute=this.href},e}(),n=function(){function e(t){if(this.link=t,this.link.constructor===e)return this.link;this.original=this.link.href,this.originalElement=this.link,this.link=this.link.cloneNode(!1),e.__super__.constructor.apply(this,arguments)}
39return ie(e,i),e.HTML_EXTENSIONS=["html"],e.allowExtensions=function(){var t,i,a,n;for(a=0,n=(i=1<=arguments.length?ne.call(arguments,0):[]).length;a<n;a++)t=i[a],e.HTML_EXTENSIONS.push(t);return e.HTML_EXTENSIONS},e.prototype.shouldIgnore=function(){return this.crossOrigin()||this._anchored()||this._nonHtml()||this._optOut()||this._target()},e.prototype._anchored=function(){return(this.hash.length>0||"#"===this.href.charAt(this.href.length-1))&&this.withoutHash()===(new i).withoutHash()},e.prototype._nonHtml=function(){return this.pathname.match(/\.[a-z]+$/g)&&!this.pathname.match(new RegExp("\\.(?:"+e.HTML_EXTENSIONS.join("|")+")?$","g"))},e.prototype._optOut=function(){var e,t;for(t=this.originalElement;!e&&t!==document;)e=null!=t.getAttribute("data-no-turbolink"),t=t.parentNode;return e},e.prototype._target=function(){return 0!==this.link.target.length},e}(),t=function(){function e(e){this.event=e,this.event.defaultPrevented||(this._extractLink(),this._validForTurbolinks()&&(O(this.link.absolute)||Z(this.link.href),this.event.preventDefault()))}return e.installHandlerLast=function(t){if(!t.defaultPrevented)return document.removeEventListener("click",e.handle,!1),document.addEventListener("click",e.handle,!1)},e.handle=function(t){return new e(t)},e.prototype._extractLink=function(){var e;for(e=this.event.target;e.parentNode&&"A"!==e.nodeName;)e=e.parentNode;if("A"===e.nodeName&&0!==e.href.length)return this.link=new n(e)},e.prototype._validForTurbolinks=function(){return null!=this.link&&!(this.link.shouldIgnore()||this._nonStandardClick())},e.prototype._nonStandardClick=function(){return this.event.which>1||this.event.metaKey||this.event.ctrlKey||this.event.shiftKey||this.event.altKey},e}(),o=function(){function e(e){this.elementSelector=e,this._trickle=oe(this._trickle,this),this.value=0,this.content="",this.speed=300,this.opacity=.99,this.install()}var t;return t="turbolinks-progress-bar",e.prototype.install=function(){return this.element=document.querySelector(this.elementSelector),this.element.classList.add(t),this.styleElement=document.createElement("style"),document.head.appendChild(this.styleElement),this._updateStyle()},e.prototype.uninstall=function(){return this.element.classList.remove(t),document.head.removeChild(this.styleElement)},e.prototype.start=function(){return this.advanceTo(5)},e.prototype.advanceTo=function(e){var t;if(e>(t=this.value)&&t<=100){if(this.value=e,this._updateStyle(),100===this.value)return this._stopTrickle();if(this.value>0)return this._startTrickle()}},e.prototype.done=function(){if(this.value>0)return this.advanceTo(100),this._reset()},e.prototype._reset=function(){var e,t;return e=this.opacity,setTimeout((t=this,function(){return t.opacity=0,t._updateStyle()}),this.speed/2),setTimeout(function(t){return function(){return t.value=0,t.opacity=e,t._withSpeed(0,function(){return t._updateStyle(!0)})}}(this),this.speed)},e.prototype._startTrickle=function(){if(!this.trickling)return this.trickling=!0,setTimeout(this._trickle,this.speed)},e.prototype._stopTrickle=function(){return delete this.trickling},e.prototype._trickle=function(){if(this.trickling)return this.advanceTo(this.value+Math.random()/2),setTimeout(this._trickle,this.speed)},e.prototype._withSpeed=function(e,t){var i,a;return i=this.speed,this.speed=e,a=t(),this.speed=i,a},e.prototype._updateStyle=function(e){return null==e&&(e=!1),e&&this._changeContentToForceRepaint(),this.styleElement.textContent=this._createCSSRule()},e.prototype._changeContentToForceRepaint=function(){return this.content=""===this.content?" ":""},e.prototype._createCSSRule=function(){return this.elementSelector+"."+t+"::before {\n  content: '"+this.content+"';\n  position: fixed;\n  top: 0;\n  left: 0;\n  z-index: 2000;\n  background-color: #0076ff;\n  height: 3px;\n  opacity: "+this.opacity+";\n  width: "+this.value+"%;\n  transition: width "+this.speed+"ms ease-out, opacity "+this.speed/2+"ms ease-in;\n  transform: translate3d(0,0,0);\n}"},e}(),d=function(e){return setTimeout(e,500)},S=function(){return document.addEventListener("DOMContentLoaded",function(){return J(a.CHANGE),J(a.UPDATE)},!0)},E=function(){if("undefined"!=typeof jQuery)return jQuery(document).on("ajaxSuccess",function(e,t){if(jQuery.trim(t.responseText))return J(a.UPDATE)})},D=function(e){var t,a;if(null!=(a=e.state)?a.turbolinks:void 0)return(t=M[new i(e.state.url).absolute])?(c(),$(t)):Z(e.target.location.href)},T=function(){return q(),V(),document.addEventListener("click",t.installHandlerLast,!0),window.addEventListener("hashchange",function(){return q(),V()},!1),d(function(){return window.addEventListener("popstate",D,!1)})},C=void 0!==window.history.state||navigator.userAgent.match(/Firefox\/2[6|7]/),r=window.history&&window.history.pushState&&window.history.replaceState&&C,s=!navigator.userAgent.match(/CriOS\//),U="GET"===(L=A("request_method"))||""===L,l=r&&s&&U,document.addEventListener&&document.createEvent&&(S(),E()),l?(Z=k,T()):Z=function(e){return document.location.href=e},this.Turbolinks={visit:Z,pagesCached:j,enableTransitionCache:_,enableProgressBar:b,allowLinkExtensions:n.allowExtensions,supported:l,EVENTS:h(a)}}.call(this);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.