PageSourceSearch

https://www.binaryfortress.com/MediaCommon/Generated/bfs.common.min.js?rev=2026-09-24-17-01-20260924140427

js binaryfortress.com collected 2026-09-24 18:05:01 UTC 146,082 bytes, 28 lines download raw bytes

1function frameDragStart(n,t){t==2?$(".csFrame, .csFramePlaceholder, .csFrameDisabled, .csFrameOverlay").css("pointer-events","none"):($(".draggableSideForFrames, .draggableSideForWidgets").css("pointer-events","none"),$(".csFrame, .csFramePlaceholder, .csFrameDisabled, .csFrameOverlay").filter(":not(#"+$(n).attr("id")+")").css("pointer-events","none"));$(".bfRadialMenuButton").css("pointer-events","none");bfs.tooltip.hideAllToolTips();$(n).hasClass("csWidgetFrameWidget")||($(n).addClass("DisableTransition"),$(n).addClass("csFrameDragging"));console.log("FrameDragStart [Mode:"+t+"]: "+$(n).attr("id"))}function frameDragDone(n,t){$(".csFrame, .csFramePlaceholder, .csFrameDisabled, .csFrameOverlay, .bfRadialMenuButton, .draggableSideForFrames, .draggableSideForWidgets").css("pointer-events","auto");$(n).removeClass("DisableTransition");$(n).removeClass("csFrameDragging");t==1&&$(n).attr("id")&&setTimeout(function(){bfs.tooltip.showElementToolTip($(n))},50);console.log("FrameDragDone [Mode:"+t+"]: "+$(n).attr("id"))}function frameDragSuccess(n,t){var e,i,r,u,f,p,w;if($(n).hasClass("csWidgetFrameWidget")){console.log("Widget Dragged: [Mode:"+t+"]: "+$(n).attr("id"));e=$(n).parent();i=Math.round($(n).width()/$(e).width()*100);i<5&&(i=5);i>100&&(i=100);$("#"+$(n).attr("data-sizex")).val(i);r=Math.round($(n).height()/$(e).height()*100);r<5&&(r=5);r>100&&(r=100);$("#"+$(n).attr("data-sizey")).val(r);u=Math.round(($(n).position().left+1)/$(e).width()*100);u<0&&(u=0);u>95&&(u=95);$("#"+$(n).attr("data-locationx")).val(u);f=Math.round(($(n).position().top+1)/$(e).height()*100);f<0&&(f=0);f>95&&(f=95);$("#"+$(n).attr("data-locationy")).val(f);$(n).attr("helpbuttondata","<div><b>"+$(n).attr("data-name")+"<\/b><\/div><div><b>Width:<\/b> "+i+"%<\/div><div><b>Height:<\/b> "+r+"%<\/div><div><b>Top:<\/b> "+f+"%<\/div><div><b>Left:<\/b> "+u+'%<\/div><div style="padding-top:4px; margin-top:4px; border-top:solid 1px #ddd;">Click and drag to move and resize this widget.<br/>Hold the shift key to bypass snapping while dragging or resizing.<br/>Click the widget icon to edit the widget settings.<\/div>');return}if((p=$(n).attr("data-drag-orgid"),p.length!=0)&&(w=$(n).attr("data-drag-frameid"),w.length!=0)){var b=parseFloat($(n).attr("data-drag-scale")),k=parseInt($(n).attr("data-drag-shiftx")),d=parseInt($(n).attr("data-drag-shifty")),l=parseInt($(n).attr("data-drag-x")),a=parseInt($(n).attr("data-drag-y")),v=parseInt($(n).attr("data-drag-width")),y=parseInt($(n).attr("data-drag-height")),o=parseInt($(n).position().left),s=parseInt($(n).position().top),h=parseInt($(n).outerWidth()),c=parseInt($(n).outerHeight());(l!=o||a!=s||v!=h||y!=c)&&(o==l&&(o=EmptyIntValue),s==a&&(s=EmptyIntValue),h==v&&(h=EmptyIntValue),c==y&&(c=EmptyIntValue),console.log("Dragged Pos [Mode:"+t+"]: "+l+"x"+a+" -> "+o+"x"+s),console.log("Dragged Size [Mode:"+t+"]: "+v+"x"+y+" -> "+h+"x"+c),bfs.loading.show(),$.ajax({type:"GET",url:"/Ajax/UpdateFrame/?FrameID="+w+"&OrgID="+p+"&Mode="+t+"&Scale="+b+"&ShiftX="+k+"&ShiftY="+d+"&OldX="+l+"&OldY="+a+"&OldWidth="+v+"&OldHeight="+y+"&NewX="+o+"&NewY="+s+"&NewWidth="+h+"&NewHeight="+c,cache:!1,success:function(n){if(bfs.loading.hide(),n==null||n.length==0){bfs.dialog.showError("An error has occurred while updating your apps, please try again.");return}n=$.parseJSON(n);$(".csDialogAjax").remove();$("#csLayoutPreview").html(n.html);$("#bfDialogsAjax").html(n.dialogs);$("#jsCommon").replaceWith(n.jsCommon);bfs.tooltip.bindAllToolTips();return},error:function(){bfs.loading.hide();bfs.dialog.showError("An error has occurred while updating your apps, please try again.");return}}))}}function scrollToYBF(n,t=0,i=document.scrollingElement){function e(o){if(u!==null){if(r+=Math.PI*(o-u)/t,r>=Math.PI)return i.scrollTop=n;i.scrollTop=f+n+f*Math.cos(r)}u=o;window.requestAnimationFrame(e)}if(n<0&&(n=0),i.scrollTop!==n){var f=(i.scrollTop-n)/2,r=0,u=null;window.requestAnimationFrame(e)}}function scrollToTopBF(n=0,t=document.scrollingElement){scrollToYBF(0,n,t)}function scrollToIdBF(n,t=0,i=document.scrollingElement){const r=Math.round(document.getElementById(n).getBoundingClientRect().top);scrollToYBF(i.scrollTop+r,t,i)}function scrollToElementBF(n,t=0,i=document.scrollingElement){const r=Math.round(n.getBoundingClientRect().top);scrollToYBF(i.scrollTop+r,t,i)}function scrollIntoViewBF(n,t){scrollToElementBF(n,1e3,t)}var constAnimationTimeMS=150,EmptyIntValue=1235897,toggleBoxContentWorker,cc;Math.trunc||(Math.trunc=function(n){return n=+n,n-n%1||(!isFinite(n)||n===0?n:n<0?-0:0)});$.fn.riseUp=function(){console.log(this);$(this).show("slide",{direction:"down"},constAnimationTimeMS)};$.fn.riseDown=function(){$(this).hide("slide",{direction:"down"},constAnimationTimeMS)};jQuery.expr[":"].containsIgnoreCase=jQuery.expr.createPseudo(function(n){return function(t){return jQuery(t).text().replace(/\s/g,"").toUpperCase().indexOf(n.replace(/\s/g,"").toUpperCase())>=0}});var isDebugMode=!1,dialogCounter=0,bfs={},bfTemplates={},bfPagers={},bfShowDialogJS={};bfs.emptyGuid="00000000-0000-0000-0000-000000000000";bfs.vue={};
1bfs.vueData={};bfs.langKeys={};bfs.lang=function(n,t){return bfs.langKeys?bfs.langKeys[n]||t||"":t||""};var debugLog=function(n){isDebugMode&&console.log(n)},notDefined=function(n){return n===undefined?!0:n===null?!0:!1},cloneObject=function(n){return notDefined(n)?n:JSON.parse(JSON.stringify(n))};jQuery.fn.extend({getMaxZ:function(){var n=0,t=null;return $(this).each(function(){var i=parseInt($(this).css("zIndex"),10);i>n&&(n=i,t=$(this))}),t}});bfs.statusEnum={success:0,warning:1,failure:2,paused:3,resumed:4};bfs.util=function(n){var c=function(){return"This will discard any unsaved changes. Continue?"},l=function(n,t=1e3){let i;return(...r)=>{clearTimeout(i),i=setTimeout(()=>{n.apply(this,r)},t)}},r=function(t){n(window).on("beforeunload",t);return function(){n(window).off("beforeunload",t)}},a=function(t){n("#"+t).on("submit",r(c))},v=function(n){u("#"+n)},u=function(t){var i=[],r=n(t+" option:not([disabled])");r.each(function(){i.push(n(this).val())});n(t).val(i).trigger("change").trigger("select2:select").focus()},y=function(n){f("#"+n)},f=function(t){n(t).val(null).trigger("change").trigger("select2:select").focus()},p=function(i){return i.find("img").each(function(){t(document.body.dataset.theme,n(this))}),i},w=function(i){n("img:not([data-color])").each(function(){t(i,n(this))});n("wa-icon:not([data-color])").each(function(){t(i,n(this))})},t=function(n,t){try{let i=t.attr("src");n==="dark"&&(i.endsWith(".light.svg")||i.endsWith(".light.png"))?t.attr("src",i.replace(/\.light(\.svg|\.png)$/,".dark$1")):n==="light"&&(i.endsWith(".dark.svg")||i.endsWith(".dark.png"))&&t.attr("src",i.replace(/\.dark(\.svg|\.png)$/,".light$1"))}catch(i){}},b=function(n,t){var i=t?/[^\w-]/g:/[\W]/g;return n&&n.val()?n.val().toLowerCase().replace(i,""):""},k=function(t,i,r){var u=n(t),e=u.closest("td").find(".DropdownControl"),f;i?(u.attr("disabled",!0),e.attr("disabled",!0)):(u.removeAttr("disabled"),e.removeAttr("disabled"));r&&(f=u.closest("tr"),f.length?f.toggle(!i):u.closest(".row").toggle(!i),u.trigger("change"))},d=function(n){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(n).replace(/[&<>"'`=\/]/g,function(n){return t[n]})},e=function(n,t,i){var u,r,f,e;return notDefined(n)?"-":isFinite(n)?(n=parseFloat(n),isNaN(n))?"-":(u=parseInt(t,10),isNaN(u)&&(u=2),r=n.toFixed(u),r==0)?i?"0":"-":(f=bfs.formatDecimalSeparator||".",e=bfs.formatGroupSeparator||",",r=r.replace(".","~"),r=r.replace(/\B(?<!\~\d*)(?=(\d{3})+(?!\d))/g,e),r=r.replace("~",f),bfs.formatDebugValue&&(r=bfs.formatDebugValue+r+bfs.formatDebugValue),r):"-"},g=function(n,t){return e(n,0,t)},nt=function(n){for(var i,u=window.location.search.substring(1),r=u.split("&"),t=0;t<r.length;t++)if(i=r[t].split("="),i[0]==n)return i[1];return!1},tt=function(t){var i,r,u;return t.length===0?!1:(i=n(window),r=t.offset().top-i.scrollTop(),r<0)?!0:(u=i.height(),r>u)},it=function(n,t){n.split(/\r?\n/).forEach(t)},rt=function(t,i){var r="dlgViewAuditLogHistory",u=n("#"+r),e=u.data("lastAuditId"),f;i!=e&&(bfs.loading.show(),u.find(".DialogContent").html(""),u.data("lastAuditId",i),f={ItemType:t,ItemID:i},n.ajax({type:"GET",url:"/AjaxCommon/AuditLogView/",data:f,cache:!1,success:function(n){if(bfs.loading.hide(),n==null||n.length==0){bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(r);return}u.find(".DialogContent").html(n);bfs.dialog.repositionDialog(r);bfs.tooltip.bindAllToolTips();return},error:function(n,t,i){bfs.loading.hide();console.log(t+", "+i);bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(r);return}}))},ut=function(t,i,r,u){var f="dlgViewAuditLogAuditType",e=n("#"+f),o;bfs.loading.show();bfs.dialog.setTitle(f,u||"Audit History");e.find(".DialogContent").html("");o={ItemType:t,AuditType:i,SecondaryItemID:r};n.ajax({type:"GET",url:"/AjaxCommon/AuditLogViewOrg/",data:o,cache:!1,success:function(n){if(bfs.loading.hide(),n==null||n.length==0){bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(f);return}e.find(".DialogContent").html(n);bfs.dialog.repositionDialog(f);bfs.tooltip.bindAllToolTips();return},error:function(n,t,i){bfs.loading.hide();console.log(t+", "+i);bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(f);return}})}
1,ft=function(t,i){bfs.loading.show();var r="dlgViewAuditLogItem";n.ajax({type:"GET",url:"/AjaxCommon/AuditLogViewItem/?AuditItemType="+t+"&AuditLogID="+i,cache:!1,success:function(n){if(bfs.loading.hide(),n==null||n.length==0){bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(r);return}ace.edit(r+"ContentJs").setValue(n,-1);bfs.dialog.showDialog(r);bfs.dialog.repositionDialog(r);bfs.tooltip.bindAllToolTips();return},error:function(n,t,i){bfs.loading.hide();console.log(t+", "+i);bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(r);return}})},et=function(){return/\b(Android|Windows Phone|iPad|iPod|BlackBerry|webOS|iPhone|IEMobile)\b/i.test(navigator.userAgent)},ot=function(n){return ace.edit(n).selectAll(),ace.edit(n).focus(),!1},st=function(n){return ace.edit(n).resize(),!1},ht=function(n){i(n,!0,!1)},ct=function(n){i(n,!1,!0)},i=function(t,i=false,r=false){var u,e,o,f;(event&&event.stopPropagation(),u=n(t).closest(".SubHeaderCollapse"),e=u.closest("tbody"),e.length<1&&(e=u.closest(".TableBody")),e.length<1)||(o=u.nextUntil(".RowSubHeader"),f=!o.is(":visible"),i&&(f=!0),r&&(f=!1),o.toggle(f),u.toggleClass("IsCollapsed",!f),u.find(".SubHeaderIconHide").toggle(f),u.find(".SubHeaderIconShow").toggle(!f),bfs.dialog.repositionWrappingDialog(u))},o=function(n,t=10,i=50,r=1){setTimeout(()=>{try{const t=n()}catch(u){r<t&&o(n,t,i,r+1)}},i)},lt=function(n){const t=document.getElementById(n);if(!t){console.log("[focus] element not found, skipping: "+n);return}s(t)},s=function(n){if(!n){console.log("[focus] element is null, skipping");return}if(h(n)&&(n=n[0],!n)){console.log("[focus] element from jQuery is null, skipping");return}bfs.util.retryOperation(()=>{console.log("[focus] "+n.id+", type: "+n.tagName),n.focus()})},h=function(n){return n instanceof jQuery},at=function(n,t){return!(n instanceof Date)||isNaN(n.getTime())?(console.error("formatDate needs a valid Date object."),""):t==="yyyy-MM-dd"?n.getFullYear()+"-"+String(n.getMonth()+1).padStart(2,"0")+"-"+String(n.getDate()).padStart(2,"0"):(console.error("Unknown formatDate format: "+t),"")};return{subHeaderCollapseToggle:i,subHeaderCollapseHide:ct,subHeaderCollapseShow:ht,codeEditorRefresh:st,codeEditorSelectAll:ot,debounce:l,navigateHook:r,select2SelectAllItems:v,select2SelectNoItems:y,select2SelectAllItemsSelector:u,select2SelectNoItemsSelector:f,select2ThemeImages:p,updateImageThemes:w,updateImage:t,getValueStripped:b,disableMultiSelect:k,encodeHTML:d,formatNumber:e,formatInt:g,formatDate:at,getQueryStringValue:nt,isOffScreen:tt,setupNavigateWarning:a,splitLines:it,showAuditLogItemDialog:ft,showAuditLogHistoryDialog:rt,showAuditLogAuditTypeDialog:ut,isMobileDevice:et,retryOperation:o,focusById:lt,focusByElement:s,isJQueryElement:h}}(jQuery);$(document).ready(function(){function n(){return $(".navbar-toggler").is(":visible")}function t(t,i){if(!n()){var u=i?"":"dropdown",f=i?"show":"hide",e=t.parents(".dropdown-menu").length===0,r=t.find(".dropdown-toggle");i&&(r=r.first());e&&(r.parents(".dropdown").last().toggleClass("dropdown-shadow",i),i||r.blur());r.attr("data-bs-toggle",u).dropdown(f)}}function i(){var n=$(".dropdown-toggle");n.length>0&&(n.attr("data-bs-toggle","dropdown").dropdown("hide"),n.parents(".dropdown").last().toggleClass("dropdown-shadow",!1),n.blur(),$(".dropdown-menu").css("display",""))}$("header").hoverIntent({selector:".dropdown",over:function(){t($(this),!0)},out:function(){t($(this),!1)},timeout:250});$("header").on("show.bs.dropdown",".dropdown",function(t){n()&&($(this).find(".dropdown-menu").first().slideDown(150),t.stopPropagation())});$("header").on("hide.bs.dropdown",".dropdown",function(t){n()&&($(this).find(".dropdown-menu").first().slideUp(150),t.stopPropagation())});$(".dropdown-toggle").on("click",function(n){n.preventDefault()});$(window).on("resize",function(){n()||i()});$&&$.fn&&$.fn.button&&$.fn.button.noConflict&&($.fn.bootstrapBtn=$.fn.button.noConflict())});bfs.stickySidebar=function(n){var i=0,t=null,r=function(){!t||t.length===0}
1,u=function(u){t=n(u);var f=n("#PageTitle");f.length>0&&(i=f.offset().top+f.height(),t.length>0&&(i+=parseInt(t.css("margin-top"),10)));n(window).scroll(r);r.apply(window)};return{setup:u}}(jQuery);bfs.tooltip=function(n){return hideAllToolTips=function(){n("#HelpButtonToolTip").fadeOut(constAnimationTimeMS)},getXY=function(t,i,r,u){if(!t)return{x:r,y:u};var e=n(t),f=e.offset(),s=parseInt(e.css("padding-left")),o=n("#HelpButtonToolTip").outerWidth();return i==="BelowLeft"?{x:f.left+s,y:f.top+e.outerHeight()+2}:i==="BelowMiddle"?{x:f.left+e.outerWidth()/2-o/2,y:f.top+e.outerHeight()+2}:i==="BelowMiddleMouseCursor"?{x:window.mouseXPos-o/2,y:window.mouseYPos+12}:i==="AboveMiddleMouseCursor"?{x:window.mouseXPos-o/2,y:window.mouseYPos-n("#HelpButtonToolTip").outerHeight()-8}:i==="AboveLeft"?{x:f.left+s,y:f.top-n("#HelpButtonToolTip").outerHeight()-6}:i==="AboveMiddle"?{x:f.left+e.outerWidth()/2-o/2,y:f.top-n("#HelpButtonToolTip").outerHeight()-6}:(console.log("Unknown Alignment: "+i),{x:0,y:0})},showToolTipWorker=function(t,i,r,u,f,e){var h;if(window.mouseButtonPressed){bfs.tooltip.hideAllToolTips();return}if(h=n("#HelpButtonToolTip"),h.is(":visible")&&h.hide(),i&&!(i.length<1)){h.html(i);e?h.addClass("skiptranslate"):h.removeClass("skiptranslate");var o=getXY(t,f,r,u),a=h.outerWidth(),p=h.outerHeight(),c=o.y,s=o.x,l=document.body.scrollLeft||document.documentElement.scrollLeft,v=document.body.scrollTop||document.documentElement.scrollTop,y=document.documentElement.clientWidth,w=document.documentElement.clientHeight;c+p>v+w-5&&(f==="BelowLeft"?(o=getXY(t,"AboveLeft",r,u),c=o.y,s=o.x):f==="BelowMiddle"?(o=getXY(t,"AboveMiddle",r,u),c=o.y,s=o.x):f==="BelowMiddleMouseCursor"&&(o=getXY(t,"AboveMiddleMouseCursor",r,u),c=o.y,s=o.x));c<v+5&&(f==="AboveLeft"?(o=getXY(t,"BelowLeft",r,u),c=o.y,s=o.x):f==="AboveMiddle"?(o=getXY(t,"BelowMiddle",r,u),c=o.y,s=o.x):f==="AboveMiddleMouseCursor"&&(o=getXY(t,"BelowMiddleMouseCursor",r,u),c=o.y,s=o.x));s+a>l+y-5&&(s=l+y-5-a);s<l+5&&(s=l+5);h.css({top:c,left:s});h.fadeIn(constAnimationTimeMS)}},showElementToolTip=function(t){var i=n(t);if(i.attr("HelpButtonDataIgnore")==="1"){n("#HelpButtonToolTip").hide();return}i.find(".preventToolTipHover:hover").length>0||i.find("*[HelpButtonData]:hover").length>0||showToolTipWorker(t,i.attr("HelpButtonData"),0,0,i.attr("HelpButtonDataAlign")||"BelowMiddle",i.hasClass("skiptranslate"))},showToolTip=function(n,t,i){showToolTipWorker(null,n,t,i,"")},bindAllToolTips=function(){if(bfs.util.isMobileDevice()){console.log("Mobile device detected, not binding tooltips.");return}console.log("Binding tooltips...");n(document).hoverIntent({selector:"*[HelpButtonData]",over:function(){showElementToolTip(this)},out:function(){hideAllToolTips()},timeout:25})},{bindAllToolTips:bindAllToolTips,hideAllToolTips:hideAllToolTips,showElementToolTip:showElementToolTip,showToolTip:showToolTip}}(jQuery);bfs.toast=function(n){function t(n,t){if(t){const r=document.getElementById("wa-toast-main");if(!r){console.log("Failed to find wa-toast-main.");return}var i=document.getElementById(n).cloneNode(!0);i.id="";i.style.setProperty("display","block");i.getElementsByTagName("div")[0].innerHTML=t;i.getElementsByTagName("div")[0].id="";r.prepend(i)}}function i(n){t("toastGeneral",n)}function r(n){t("toastSuccess",n)}function u(n){t("toastWarning",n)}function f(n){t("toastError",n)}function e(n,t){t=="success"?r(n):t=="warning"?u(n):t=="error"?f(n):i(n)}function o(){n("#toastGeneral").fadeOut(constAnimationTimeMS);n("#toastSuccess").fadeOut(constAnimationTimeMS);n("#toastWarning").fadeOut(constAnimationTimeMS);n("#toastError").fadeOut(constAnimationTimeMS)}return{hide:o,show:i,showSuccess:r,showWarning:u,showError:f,showType:e}}(jQuery);bfs.dialog=function(n){var r={},f=function(t,i){var r=n("#"+t+" .TableTitleDialog .TableTitleText");r.length>0&&r.html(i)},c=function(t,i,r){var u=n("#"+t+" .bfDialogInnerText");u&&u.html(i);r||s(t,"setContent")},l=function(t,i){var r=n("#"+t+" .bfDialogInnerLoading"),f,u;r.length?r.show():(f=n("#"+t+" .bfDialogInnerText"),f.html('<div class="bfDialogInnerLoading"><img src="/MediaCommon/SVGs/Animated/LoadingSpinner.svg" width="150" height="150" /><\/div>'));r=n("#"+t+" .bfDialogInnerLoading");u=r.find(".loadingMessage");u.length?u.html(i):i&&r.append('<div class="loadingMessage">'+i+"<\/div>")},a=function(){n("#"+id+" .bfDialogInnerLoading").hide()},e=function(t=""){++dialogCounter;isDebugMode&&console.log("Show Fade ["+t+"]: "+dialogCounter);var i=parseInt(n("#bfFadeContents").css("z-index"));return isDebugMode&&console.log("showFade: "+i),n("#bfFadeContents").css("z-index",i+200),n("#bfFadeContents").fadeIn(constAnimationTimeMS),!1},o=function(t=""){--dialogCounter;isDebugMode&&console.log("Hide Fade ["+t+"]: "+dialogCounter);var i=parseInt(n("#bfFadeContents").css("z-index"));return(isDebugMode&&console.log("hideFade: "+i),n("#bfFadeContents").css("z-index",i-200),dialogCounter>0)?!1:(n("#bfFadeContents").fadeOut(constAnimationTimeMS),!1)},v=function(t,i,r,u){var o,s;if(n("#"+t).length===0){if(t==="bfDialogMessage"){alert("Dialog not found, please try again: "+t);return}bfs.dialog.showError("Dialog not found, please try again: "+t);return}return i&&f(t,i),o=n("#"+t),r&&o.find(".bfDialogInnerText").html(r),console.log("[showDialog:"+t+"] showing"),bfs.dialog.repositionDialog(t,"showDialog"),e(t),o.fadeIn(constAnimationTimeMS),s=parseInt(n("#bfFadeContents").css("z-index")),isDebugMode&&console.log("showDialog: "+s),o.css("z-index",s+100+dialogCounter),bfs.util.focusByElement(n("#"+t+" sl-input, #"+t+" input
1:text, #"+t+" textarea, #"+t+" select").first()),u&&u(o),!1},y=function(t,i,r){if(notDefined(t))return!1;var u="#"+t+"Content";n(u).html().length>0&&!i||(bfs.loading.show(),n.ajax({type:"GET",url:r,cache:!1,success:function(i){if(bfs.loading.hide(),i==null||i.length==0){bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(t);return}n(u).html(i);bfs.dialog.repositionDialog(t);bfs.tooltip.bindAllToolTips();return},error:function(n,i,r){bfs.loading.hide();console.log(i+", "+r);bfs.dialog.showError("An error has occurred while loading this content, please try again.");bfs.dialog.closeDialog(t);return}}))},u=function(t){if(!t)return!1;isDebugMode&&console.log("Close Dialog ["+t+"]");n("#"+t).fadeOut(constAnimationTimeMS);o(t);var i=r[t];return i&&typeof i=="function"&&i(),!1},p=function(){return n(".bfDialogJS").each(function(){n(this).is(":visible")&&u(n(this).attr("id"))}),!1},t=function(t){return n(t).closest(".bfDialogJS").attr("id")},w=function(n,i){var f=t(n);return f&&(i&&(r[f]=i),u(f)),!1},i=function(t,i){var r,f;if(!t)return!1;if(r=n("#"+t+" .bfDialogInnerJS"),r){var e=r.outerHeight(),o=n(window).height(),u=o-150;e>u?(r.css("max-height",u+"px"),isDebugMode&&console.log("RepositionDialog [SetMaxHeight:"+i+"]: "+t)):e<725&&(725>u?r.css("max-height",u+"px"):r.css("max-height","725px"))}return f=n("#"+t),f.css({top:"",left:""}),cc.viewMessage.fixMessageHeight(),isDebugMode&&console.log("RepositionDialog ["+i+"]: "+t+", Height: "+r.outerHeight()+", DialogOuterHeight: "+f.outerHeight()),!1},s=function(n,t){return i(n,t,2)},b=function(n,t){return i(n,t,1)},h=function(n,r){return i(t(n),"repositionWrappingDialog:"+r,2)},k=function(){n(".bfDialogJS").drags({cancelClasses:".TableTitleFrame, .bfDialogInnerJS, .TableTitleButton, .bfDialogCloseJS"})},d=function(n,t){r[n]=t},g=function(i,r){var u=t(i);return n("#"+u).width(r+"px"),h(i),!1},nt=function(t){return n("#bfDialogMessage").is(":visible")?!1:notDefined(t)?!1:(bfs.dialog.setTitle("bfDialogMessage",bfs.lang("Error")||"Error"),n("#bfDialogMessage .bfDialogInnerText").removeClass("bfDialogTextFrame").addClass("bfDialogTextFrameError"),n("#bfDialogMessage .bfDialogInnerText").html(t.replace(/\n/g,"<br/>").replace(/\r/g,"")),bfs.dialog.repositionDialog("bfDialogMessage","showError"),bfs.dialog.showDialog("bfDialogMessage"),n("#bfDialogMessage #btnMessageOK").focus(),!1)},tt=function(t,i){return n("#bfDialogMessage").is(":visible")?!1:(i?bfs.dialog.setTitle("bfDialogMessage",i):bfs.dialog.setTitle("bfDialogMessage",bfs.lang("Message")||"Message"),n("#bfDialogMessage .bfDialogInnerText").removeClass("bfDialogTextFrameError").addClass("bfDialogTextFrame"),n("#bfDialogMessage .bfDialogInnerText").html(t.replace(/\n/g,"<br/>").replace(/\r/g,"")),bfs.dialog.repositionDialog("bfDialogMessage","showMessage"),bfs.dialog.showDialog("bfDialogMessage"),n("#bfDialogMessage #btnMessageOK").focus(),!1)},it=function(t,i){return bfs.dialog.confirm(i,function(i){var r=n(t).closest("form");r&&r.length>0?(i||bfs.loading.show(),r.submit()):bfs.dialog.showError("Failed to find form to submit.")}),!1},rt=function(t,i){return bfs.dialog.confirmDelete(i,function(){var i=n(t).closest("form");i&&i.length>0?(bfs.loading.show(),i.submit()):bfs.dialog.showError("Failed to find form to submit.")}),!1},ut=function(n,t,i,r){return confirmWorker("bfDialogMessageConfirm","#btnConfirmYes","#btnConfirmNo",n,t,i,r)},ft=function(n,t,i,r){return confirmWorker("bfDialogMessageConfirmWarning","#btnConfirmWarningYes","#btnConfirmWarningNo",n,t,i,r)},et=function(n,t,i,r){return confirmWorker("bfDialogMessageConfirmDelete","#btnConfirmDeleteYes","#btnConfirmDeleteNo",n,t,i,r)},ot=function(t,i,r){var f="bfDialogMessageConfirmDeleteWithCheckbox",u=n("#"+f);if(typeof r=="string"&&u.find("form").attr("action",r),u.find(".ConfirmPromptMessage").html(t),u.find(".BFCheckBoxText").html(i),typeof r=="function")u.find("form").one("submit",function(n){n.preventDefault();var t=u.find("input:checkbox, wa-checkbox, sl-input").prop("checked");bfs.dialog.closeDialog(f);r(t)});return bfs.dialog.repositionDialog(f,"Confirm"),bfs.dialog.showDialog(f,"Confirm"),!1},st=function(n,t,i,r){return confirmWithRadiosWorker("bfDialogMessageConfirmWarningWithRadios",n,t,i,r)},ht=function(n,t,i,r){return confirmWithRadiosWorker("bfDialogMessageConfirmDeleteWithRadios",n,t,i,r)};return confirmWithRadiosWorker=function(t,i,r,u,f){var e=n("#"+t);if(typeof f=="string"&&e.find("form").attr("action",f),e.find(".ConfirmPromptMessage").html(i),e.find(".DeleteRadioA .BFRadioButtonText").html(r),e.find(".DeleteRadioB .BFRadioButtonText").html(u),e.find("input:radio:first").prop("checked",!0),typeof f=="function")e.find("form").one("submit",function(n){n.preventDefault();var i=e.find("input:radio:checked").val();bfs.dialog.closeDialog(t);f(i)});return bfs.dialog.repositionDialog(t,"Confirm"),bfs.dialog.showDialog(t,"Confirm"),!1},confirmWorker=function(t,i,r,u,f,e,o){var y="#"+t,s,c,h,w,b,v,k,a,l,p,d;if(n(y).is(":visible"))return!1;if(!f||!n(y))return window.confirm(u);if(s="",c=y+" "+i,n(c).off(),f){if(!s&&typeof f=="string"){s="string";n(c).on("click",function(){bfs.dialog.closeDialog(t);eval(f)}
1)}if(!s&&typeof f=="function"){s="function";n(c).on("click",function(){bfs.dialog.closeDialog(t);f()})}if(!s&&typeof f=="object"&&(h=n(f),h&&h.length>0)){if(w=h.attr("href"),w){s="href";n(c).on("click",function(){bfs.loading.show();window.location.href=w})}if(!s&&(b=h.attr("type"),b==="submit"&&(v=h.closest("form"),v))){if(k=n(h).prop("id"),a=n(h).prop("name"),k&&a&&a.indexOf("$")>0){s="submit:dotnet";n(c).on("click",function(){bfs.loading.show();n(v).append('<input type="hidden" id="'+a+'" name="'+a+'" value="'+n(h).val()+'">');v.submit()})}if(!s){s="submit:classic";n(c).on("click",function(){bfs.loading.show();n(v).append('<input type="hidden" id="'+a+'" name="'+a+'" value="'+n(h).val()+'">');v.submit()})}}}}if(s||(s="default",n(c).click(function(){alert("Sorry, no handler was given for "+typeof f+"!");bfs.dialog.closeDialog(t)})),l="",p=y+" "+r,n(p).off(),e){if(!l&&typeof e=="string"){l="string";n(p).on("click",function(){bfs.dialog.closeDialog(t);eval(e)})}if(!l&&typeof e=="function"){l="function";n(p).on("click",function(){bfs.dialog.closeDialog(t);e()})}}if(!l){l="default";n(p).on("click",function(){bfs.dialog.closeDialog(t)})}return d=o||bfs.lang("Confirm")||"Confirm",bfs.dialog.repositionDialog(t,"Confirm"),bfs.dialog.showDialog(t,d,u.replace(/\n/g,"<br/>").replace(/\r/g,""),""),n(y+" "+i).focus(),isDebugMode&&console.log("ConfirmDialog: "+s+", No: "+l),!1},{setTitle:f,showDialog:v,loadAjaxDialog:y,closeDialog:u,closeAllDialogs:p,showFade:e,hideFade:o,getWrappingDialogID:t,closeWrappingDialog:w,repositionDialogWorker:i,repositionDialog:s,repositionDialogHigh:b,repositionWrappingDialog:h,setWrappingDialogWidth:g,showError:nt,showMessage:tt,confirmAndSubmitForm:it,confirmDeleteAndSubmitForm:rt,confirm:ut,confirmWarning:ft,confirmDelete:et,confirmDeleteWithCheckbox:ot,confirmDeleteWithRadios:ht,confirmWarningWithRadios:st,showLoading:l,hideLoading:a,setContent:c,setupDrags:k,setOnCloseJs:d}}(jQuery);bfs.loading=function(n){function i(i=""){if(!t)return t=!0,n("#bfLoadingSpinner").css({marginLeft:-100,marginTop:-100}),n("#bfLoadingSpinner").fadeIn(constAnimationTimeMS),bfs.dialog.showFade("LoadingShow:"+i),!1}function r(i=true,r=""){return t=!1,n("#bfLoadingSpinner").fadeOut(constAnimationTimeMS),i&&bfs.dialog.hideFade("LoadingHide:"+r),!1}var t=!1;return{show:i,hide:r}}(jQuery);var showFilterBox=function(n){var t,i,r;n.preventDefault();t=$(this);i=t.closest(".TableTitle");i.length===0&&(i=t.closest(".TableTitleContent"));r=i.find(".FilterBox");r.length>0&&(t.hide(),r.show().focus())},hideFilterBox=function(n){var t,i;n.keyCode==27&&(n.preventDefault(),n.stopPropagation(),t=$(this),t.val(""),t.hide(),i=t.closest(".TitleButtons"),i.length===0&&(i=t.closest(".TableTitleContent")),i.find(".ShowFilter").show())},filterItems=function(n){var u=n.val().toLowerCase(),i=n.closest(".TableTitleRoot"),r=i.nextUntil(".TableTitleRoot","[data-filter]"),t;i.length===0&&(r=n.closest(".bfDialogJS").find(".ItemPicker").find("[data-filter], .NoItemsMessage"));t=0;r.each(function(n,i){var r=$(i),f;r.hasClass("NoItemsMessage")?(r.toggle(t===0),t=0):(f=r.attr("data-filter").toLowerCase().indexOf(u)>-1,r.toggle(f),f&&t++)})},filterTable=function(n,t){var i,t,r,u,f;if(n.length!=0){if(i=n.val(),t=$("#"+n.attr("tableId")),t.length==0){console.error("[filterTable] Failed to find filter table: "+tableId);return}if(r=t.find('tr:not(".RowSubHeader")').filter(function(){return $(this).find("td").length>0}),u=t.find(".RowSubHeader"),!i||i.length==0){r.show();u.show();t.find("tbody .FilterListEmpty").remove();return}r.hide();f=r.filter(function(){return $(this).attr("data-filter")&&$(this).attr("data-filter").toLowerCase().indexOf(i.toLowerCase())>=0?!0:$(this).find(':containsIgnoreCase("'+i+'")').length>0?!0:!1}).show();u.show();$.each(u,function(n,t){var t=$(t);t.nextUntil(".RowSubHeader").is(":visible")||t.hide()});f.length<1?t.find("tbody").append('<tr class="FilterListEmpty"><td align="center" colspan="99"><i>no matching results...<\/i><\/td><\/tr>'):t.find("tbody .FilterListEmpty").remove()}},activeFilters={},updateFilter=function(){var t=$(this),n=t.attr("tableId");if(notDefined(n)){console.error("[updateFilter] tableId not defined: "+n);return}activeFilters[n]&&clearTimeout(activeFilters[n]);activeFilters[n]=setTimeout(function(){$data=$("#"+n);$data.length>0&&$data.prop("tagName").toLowerCase()=="table"?filterTable(t,$data):filterItems(t)},200)};$(document).ready(function(){$(".FilterBox").on("sl-input sl-clear",updateFilter);$(".FilterBox").on("keyup",hideFilterBox)});bfs.jsDialogs=function(n){var u="[[BF~HTML~END~TAG]]",t=window.bfFormSchemas||{},i=window.bfFormState||{},o=function(n,i){t||(t={});t[n]=i},s=function(n,t){i||(i={});i[n]=t},h=function(t){var f=n(this),r=this.id,u=f.find("#"+r+"UseAjax").val(),e;u&&u.length>0&&(t.preventDefault(),e=f.find("#"+r+"StateID").val(),cc.ajax.run(u,new FormData(this),"Something went wrong, please try again.",function(t){t.state?i[r][e]=n.parseJSON(t.state):t.success&&(bfs.loading.hide(),bfs.dialog.closeAllDialogs())}))},c=function(n,t){if(!n||!t)return{};var r=i[n];return r?r[t]||{}:{}},l=function(t,i){f(t,i);n("#"+t+"StateID").val("")},f=function(i,u){var s=t[i],l,f;if(!s)throw"Missing Form Schema: "+i;var h=e(i,u),c="dlg"+i,a=h.title||s._title||"",o=h.titleButtons||[];if(o.length>0)for(l=n("#"+c),$buttons=l.find(".TitleButtons"),$buttons.html(null),f=0;f<o.length;f++)$buttons.append(r(o[f]));return bfs.dialog.showDialog(c,a,null,bfShowDialogJS[i])},a=function(n){e(n,"")},r=function(n){if(typeof n=="string"){if(n.replaceAll)return n.replaceAll(u,"<\/");if(n.replace){var t=new RegExp(u,"g");return n.replace(t,"<\/")}}return n},e=function(i,u){var l=t[i],h,v,o,p,a,e,w,b,k,g,nt,d,tt,it;if(!l)throw"Missing Form Schema: "+i;h=c(i,u);for(v in l)if(l.hasOwnProperty(v)&&(o=l[v],o)){var y=v.split("___"),s=y[0],f="";if(h.hasOwnProperty(s)){if(f=h[s],y.length>1)for(p=1;p<y.length;p++)s=y[p],f.hasOwnProperty(s)&&(f=f[s])}else o.hasOwnProperty("defaultValue")&&(f=o.defaultValue);
1if(f=r(f),a=o.selector,o.updateTreeView!==!0&&a&&typeof a=="string"){if(e=n(a),e.length===0)continue;o.hideEmpty===!0&&e.closest(".row").toggle(f.length>0);e.is(":checkbox")||e.is(":radio")?(w=f==="true"||f==="True"||f===!0||f==="1"||f===1,e.prop("checked",w).change(),o.radioSelector&&n(o.radioSelector).prop("checked",!w).change()):e.is("a")?e.attr("href",f):e.is("input")||e.is("textarea")||e.is("sl-input")||e.is("sl-textarea")?e.is(".DatePickerTextBox")&&e.datepicker&&f?e.datepicker("setDate",new Date(f)):e.closest("td").find(".ace_editor").length>0?(b=ace.edit(field.closest("td").find(".ace_editor")[0].id),b&&b.setValue(f)):e.attr("type")==="hidden"&&typeof f=="object"?e.val(r(JSON.stringify(f))):e.val(f):e.is("select")?(k=l[s+"-options"],g=f[0],o.addValuesAsOptions||typeof g!="object"||(f=f.map(function(n){return n.id})),k?(e.find("option").remove(),nt=n(a+"Options").find(":checkbox"),nt.each(function(t){var i=k[t],r=f.indexOf(i.value)>-1;this.checked=r;r&&e.append(n("<option>",i))})):o.addValuesAsOptions==!0?(e.find("option").remove(),d=f,o.addValuesAsOptionsId&&(d=h[o.addValuesAsOptionsId]),n.each(d,function(t,i){i=r(i);var u={value:i,text:i};typeof i=="object"&&(o.item2valuesSeparator?(u.text=i.value1+" / "+i.value2,u.value=i.value1+o.item2valuesSeparator+i.value2):u=i);e.append(n("<option>",u))}),o.addValuesAsOptionsId&&e.val(f)):(o.hasOwnProperty("prefixes")&&o.prefixes.indexOf(f)>-1&&(f=f+"::"+h[s+"ID"]),e.is("[multiple]")||e.find("option:first").prop("selected",!0),(f===!1||f===!0)&&(f=f.toString()),e.val(f),e.trigger("select2:select"))):e.is(".BFTimePicker")?(tt=e.find('select[id$="Hours"]'),it=e.find('select[id$="Minutes"]'),tt.val(Math.floor(f/60)),it.val(f%60)):e.html(f);e.change()}}return n("#"+i+' .RowSubHeader:not(".SubHeaderCollapse")').each(function(){$subHeader=n(this);var t=$subHeader.nextUntil(".RowSubHeader"),i=t.filter(function(){return n(this).css("display")!=="none"}).length>0;$subHeader.toggle(i)}),h||{}};n(document).on("submit","form",h);return{addSchema:o,addFormState:s,resetForm:a,showForm:f,showCopyForm:l,_bfSchemas:t,_bfFormState:i}}(jQuery);bfs.groupCollapse=function(n){var t={},e=function(){if(!t||!t.collapsedGroups)return n();var i=n(),r=n(".TableGroupCollapse tbody"),u=r.find("tr.SubHeaderCollapse");return u.each(function(){if(t.collapsedGroups.indexOf(this.id)>-1){var r=n(this);i=i.add(r.nextUntil("tr.SubHeaderCollapse"))}}),i},i=function(){if(t&&t.collapsedGroups){var r=n(".TableGroupCollapse tbody"),i=r.find("tr.SubHeaderCollapse");i.each(function(){var u=this.id,f=t.collapsedGroups.indexOf(u)>-1,i=n(this),r=i.nextUntil("tr.SubHeaderCollapse");f?(r.hide(),i.find(".RowCollapseHide").hide(),i.find(".RowCollapseShow").show()):(r.show(),i.find(".RowCollapseHide").show(),i.find(".RowCollapseShow").hide())});i.length===t.collapsedGroups.length?(n(".ToggleCollapseGroupsHide").closest(".TableTitleButton").hide(),n(".ToggleCollapseGroupsShow").closest(".TableTitleButton").show()):(n(".ToggleCollapseGroupsHide").closest(".TableTitleButton").show(),n(".ToggleCollapseGroupsShow").closest(".TableTitleButton").hide())}n(document).trigger("bfs:groupToggle")},r=function(r){var f=function(){window.cc.autoRefreshDashboard.resumeRefreshTimer()};r.preventDefault();r.stopImmediatePropagation();window.cc.autoRefreshDashboard.pauseRefreshTimer();var s=n(this),h=s.closest("tr"),u=h.get(0).id,e=t.collapsedGroups.indexOf(u),o=e===-1,c="GroupID="+u+"&Collapse="+(o?1:0)+"&OrganizationID="+cc.organizationID;cc.ajax.run("Groups/SetCollapseState",c,"",f,f);o?t.collapsedGroups.push(u):t.collapsedGroups.splice(e,1);i()},u=function(r){var u=function(){window.cc.autoRefreshDashboard.resumeRefreshTimer()};r.preventDefault();window.cc.autoRefreshDashboard.pauseRefreshTimer();var f=n(".TableGroupCollapse .SubHeaderCollapse"),e=f.length!==t.collapsedGroups.length,o=f.map(function(n,t){return t.id}).get(),s="GroupID="+o.join()+"&Collapse="+(e?1:0)+"&OrganizationID="+cc.organizationID;cc.ajax.run("Groups/SetCollapseState",s,"",u,u);t.collapsedGroups=e?o:[];i()},f=function(n){t.collapsedGroups=n||[];i()},o=function(){n(document).on("click",".TableGroupCollapse .SubHeaderCollapse",r);n(".ToggleCollapseGroups").on("click",u);window.bfsDashboardStateInitial?f(window.bfsDashboardStateInitial.collapsedGroups):t.collapsedGroups=[];i();n(document).on("bfs:autoRefresh",i)};return{_state:t,getCollapsedRows:e,toggleCollapse:r,setup:o,toggleAll:u,updateGroups:f,updateUI:i}}(jQuery);
2/*!
3 * hoverIntent v1.10.2 // 2020.04.28 // jQuery v1.7.0+
4 * http://briancherne.github.io/jquery-hoverIntent/
5 *
6 * You may use hoverIntent under the terms of the MIT license. Basically that
7 * means you are free to use hoverIntent as long as this header is left intact.
8 * Copyright 2007-2019 Brian Cherne
9 */
10(function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):typeof module=="object"&&module.exports?module.exports=n(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&n(jQuery)})(function(n){"use strict";var e={interval:100,sensitivity:6,timeout:0},o=0,t,i,r=function(n){t=n.pageX;i=n.pageY},u=function(n,f,e,o){if(Math.sqrt((e.pX-t)*(e.pX-t)+(e.pY-i)*(e.pY-i))<o.sensitivity)return f.off(e.event,r),delete e.timeoutId,e.isActive=!0,n.pageX=t,n.pageY=i,delete e.pX,delete e.pY,o.over.apply(f[0],[n]);e.pX=t;e.pY=i;e.timeoutId=setTimeout(function(){u(n,f,e,o)},o.interval)},s=function(n,t,i,r){var u=t.data("hoverIntent");return u&&delete u[i.id],r.apply(t[0],[n])},f=function(n){return typeof n=="function"};n.fn.hoverIntent=function(t,i,h){var l=o++,c=n.extend({},e),a;n.isPlainObject(t)?(c=n.extend(c,t),f(c.out)||(c.out=c.over)):c=f(i)?n.extend(c,{over:t,out:i,selector:h}):n.extend(c,{over:t,out:t,selector:i});a=function(t){var e=n.extend({},t),f=n(this),o=f.data("hoverIntent"),i,h;if(o||f.data("hoverIntent",o={}),i=o[l],i||(o[l]=i={id:l}),i.timeoutId&&(i.timeoutId=clearTimeout(i.timeoutId)),h=i.event="mou
10semove.hoverIntent.hoverIntent"+l,t.type==="mouseenter"){if(i.isActive)return;i.pX=e.pageX;i.pY=e.pageY;f.off(h,r).on(h,r);i.timeoutId=setTimeout(function(){u(e,f,i,c)},c.interval)}else{if(!i.isActive)return;f.off(h,r);i.timeoutId=setTimeout(function(){s(e,f,i,c.out)},c.timeout)}};return this.on({"mouseenter.hoverIntent":a,"mouseleave.hoverIntent":a},c.selector)}});bfs.draggable=function(n){return makeObjectDraggableFixed=function(t){n(t).css("cursor","move").css("position","fixed").css("left",n(t).css("left")).css("top",n(t).css("top")).css("right","auto").css("bottom","auto");n(t).mousedown(function(i){function r(i){var u=my_dragging.offset0.left+(i.pageX-my_dragging.pageX0),r;u<6+n(window).scrollLeft()&&(u=6+n(window).scrollLeft());u+n(t).outerWidth()+6>n(window).width()+n(window).scrollLeft()&&(u=n(window).width()-n(t).outerWidth()-6+n(window).scrollLeft());r=my_dragging.offset0.top+(i.pageY-my_dragging.pageY0);r<6+n(window).scrollTop()&&(r=6+n(window).scrollTop());r+n(t).outerHeight()+6>n(window).height()+n(window).scrollTop()&&(r=n(window).height()-n(t).outerHeight()-6+n(window).scrollTop());n(my_dragging.elem).offset({top:r,left:u})}function u(){n("body").off("mousemove",r).off("mouseup",u)}window.my_dragging={};my_dragging.pageX0=i.pageX;my_dragging.pageY0=i.pageY;my_dragging.elem=this;my_dragging.offset0=n(this).offset();n("body").on("mouseup",u).on("mousemove",r)})},{makeObjectDraggableFixed:makeObjectDraggableFixed}}(jQuery);bfs.vueMixins=bfs.vueMixins||{};bfs.vueMixins.dragDrop={data:{draggedItem:undefined,draggedOnItem:undefined,isDragable:!1},methods:{onDragStart:function(n){this.draggedItem=n},onDragEnter:function(n){this.draggedOnItem=n},onDragLeave:function(){},onDragOver:function(){},onDrop:function(n,t){(this.draggedOnItem=undefined,this.draggedItem!==n)&&(t!==undefined&&t(this.draggedItem,n),this.draggedItem=undefined)},enableDrag:function(){this.isDragable=!0},disableDrag:function(){this.isDragable=!1}}};bfs.vueMixins.filterBox={data:{showFilterBox:!1},methods:{toggleFilter:function(){if(this.showFilterBox=!this.showFilterBox,this.showFilterBox){var n=this.$el;this.$nextTick(function(){var t=n.querySelector('sl-input[type="search"]');t.updateComplete.then(function(){t.focus()})})}else this.filter&&(this.filter=""),this.groupFilter&&(this.groupFilter=""),this.resetStatusFilters&&this.resetStatusFilters(!0)}}};bfs.vueMixins.parentPaging={data:{endpoint:"",dataKey:"",isLoading:!1,pageSize:100,currentIndex:0,valueCap:0,preloaded:!1,id:"",pageNumberCount:9,sortKey:"",sortAsc:!0},computed:{filteredValues:function(){if(!this.isFiltered||!this.filterProp)return this.rawValues;var n=this.filter,t=this.getFilterValue;return this.rawValues.filter(function(i){var r=t(i);return r.toLowerCase().indexOf(n.toLowerCase())!==-1})},valuesDisplay:function(){return this.filteredValues.slice(this.currentIndex,this.currentIndex+this.pageSize)},currentPage:function(){return Math.floor(this.currentIndex/this.pageSize)},isFiltered:function(){return this.filter&&this.filter.length>0},pageThreshold:function(){return Math.floor(this.pageNumberCount/2)},showFirstJump:function(){return this.maxPages<=this.pageNumberCount?!1:this.currentPage>this.pageThreshold},showLastJump:function(){return this.maxPages<=this.pageNumberCount?!1:this.currentPage<this.maxPages-1-this.pageThreshold},pages:function(){var i=this.pageNumberCount,n=Math.max(0,this.currentPage-this.pageThreshold),r=Math.min(this.maxPages,n+i),u,t;for(r-n<i&&(n=Math.max(0,r-i)),u=[],t=n;t<r;t++)u.push(t);return u},maxPages:function(){var n=Math.ceil(this.filteredValues.length/this.pageSize);return this.isFiltered||this.valueCap<0?n:this.valueCap>0?Math.ceil(this.valueCap/this.pageSize):n+1}},methods:{countValues:function(n){return notDefined(n)?0:this.formatNumber(n.length||0,0)},getFilterValue:function(n){return this.filterProp.reduce(function(t,i){var r=n[i]||"";return t&&t.length&&r&&r.length&&(t+="|"),t+r},"")},formatInt:function(n){return this.formatNumber(n,0)},formatNumber:function(n,t){return bfs.util.formatNumber(n,t)},sortValues:function(n,t){this.sortKey==n&&(this.sortAsc=!this.sortAsc);t&&(this.sortAsc=!0);this.sortKey=n;var i=-1;this.sortAsc&&(i=1);this.rawValues.sort(function(t,r){var u=t[n],f=r[n];return notDefined(u)?-i:notDefined(f)?i:(typeof u=="string"&&(u=u.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),u<f)?-i:u>f?i:0})},subsections:function(n){return n.children.reduce(function(n,t){return notDefined(n[t.label])&&(n[t.label]=[]),n[t.label].push(t),n},{})},hasData:function(n){return this.preloaded&&this.filteredValues.length==0?!0:!notDefined(this.filteredValues[n])},nextPage:function(){this.loadPage(this.currentPage+1)},prevPage:function(){this.loadPage(this.currentPage-1)},getTargetIndex:function(n){return n*this.pageSize},loadAllData:function(n){if(!this.isLoading&&(!(this.rawValues.length>0)||this.valueCap!=this.rawValues.length)){this.isLoading=!0;var t=this,r={OrganizationID:cc.organizationID,start:0,timestamp:0,id:this.id,c
10ount:-1},i=$.ajax({type:"POST",dataType:"json",url:"/Ajax/"+this.endpoint,data:r,xhrFields:{withCredentials:!0}});i.always(function(){t.isLoading=!1});i.fail(function(n,t){console.error(t)});i.done(function(i){if(i.error){console.error(i.error);return}var r=i[t.dataKey];if(r){if(!Array.isArray(r)){console.error("invalid data");return}t.rawValues=r;t.valueCap=r.length;n&&(t.pageSize=t.valueCap)}})}},loadPage:function(n){var t,r;if(!this.isLoading){if(n<0&&(n=0),n>=this.maxPages&&(n=this.maxPages-1),t=this.getTargetIndex(n),$thisel=$(this.$el),r=$thisel.find(".VueScrollTo").first(),r.length===0&&(r=$thisel.find(".TableTitle").first()),bfs.util.isOffScreen(r)&&r.get(0).scrollIntoView(),this.hasData(t)){this.currentIndex=t;return}var f=this.rawValues[this.rawValues.length-1],e=f.timestamp||"",o=f.tiebreak||0;this.isLoading=!0;var i=this,s={OrganizationID:cc.organizationID,start:t,timestamp:e,tiebreak:o,id:this.id,count:this.pageSize},u=$.ajax({type:"POST",dataType:"json",url:"/Ajax/"+this.endpoint,data:s,xhrFields:{withCredentials:!0}});u.fail(function(n,t){console.error(t)});u.done(function(n){var r,f,u;if(n.error){console.error(n.error);return}if(r=n[i.dataKey],r){if(!Array.isArray(r)){console.error("invalid data");return}for(f=t+r.length,i.rawValues.length<f&&(i.rawValues.length=f),u=0;u<r.length;u++)i.rawValues.splice(t+u,1,r[u]);r.length<i.pageSize&&(i.valueCap=t+r.length);r.length>0&&(i.currentIndex=t)}});u.always(function(){i.isLoading=!1})}}},watch:{filter:function(n,t){t!==n&&(t.length===0||n.length===0)&&(this.currentIndex=0)},pageSize:function(n,t){this.loadPage(Math.floor(this.currentIndex/t))}}};bfs.vueMixins.itemSorting={data:{sortState:"",sortItem:null,sortItemIndex:-1,sortItemHoverIndex:-1},created:function(){window.addEventListener("keydown",this.keydown)},computed:{reorderLabel:function(){return this.isSelecting||this.isSorting?bfs.lang("cancel","Cancel"):bfs.lang("reorder","Reorder")},isSelecting:function(){return this.sortState==="picking"},isSorting:function(){return this.sortState==="sorting"},valuesDisplaySorting:function(){if(!this.isSorting||!this.sortItem||this.sortItemHoverIndex<0)return this.valuesDisplay;var n=this.valuesDisplay.slice();return n.splice(this.sortItemHoverIndex,0,this.sortItem),n}},methods:{keydown:function(n){n.key==="Escape"&&this.reset()},rowHover:function(n){this.isSorting&&(this.sortItemHoverIndex=n)},indexPaged:function(n){if(this.filter)return this.rawValues.indexOf(this.valuesDisplay[n]);var t=this.currentPage*this.pageSize;return t+(n||0)},reset:function(){this.sortItem&&this.rawValues.splice(this.sortItemIndex,0,this.sortItem);this.sortState="";this.sortItem=null;this.sortItemIndex=-1;this.sortItemHoverIndex=-1},toggleSelecting:function(){this.sortState?this.reset():this.sortState="picking"},updateItem:function(n,t){var i=this.indexPaged(t),r;if(this.isSelecting){this.sortItem=this.rawValues.splice(i,1)[0];this.sortItem&&(this.filter="",this.sortState="sorting",this.sortItemIndex=i,this.rowHover(t),n.preventDefault());return}if(!this.sortItem){this.reset();return}n.preventDefault();r=cc.buildAjaxData(!0);r.set(this.sortPrefix+"ID",this.sortItem.id);r.set("Index",i+1);cc.ajax.run(this.sortEndpoint,r,"Failed to update, please try again.");this.sortItemIndex=i;this.reset()}}};bfs.vueMixins.simpleGroups={computed:{maxPages:function(){return this.pagedGroups.length},currentPage:function(){return this.currentIndex},valuesDisplay:function(){return[]},pagedGroups:function(){function e(){n.length&&i&&t.push({name:i,items:n,count:n.length});n=[]}for(var r,h=this.pageSize,s=this.filteredValues||[],i="",n=[],u=0,f=[],t=[],o=0;o<s.length;o++)r=s[o],r.group!==i&&(e(),i=r.group),u>=h&&(e(),f.push(t),t=[],u=0),n.push(r),u++;return e(),t.length&&f.push(t),f},groupsDisplay:function(){return this.pagedGroups[this.currentPage]}},methods:{getTargetIndex:function(n){return n}}};bfs.vueMixins.simpleLabels={computed:{maxPages:function(){return this.pagedLabels.length},currentPage:function(){return this.currentIndex},valuesDisplay:function(){return[]},pagedLabels:function(){for(var f,e,n,o,v=this.pageSize,l=this.filteredValues||[],r={},t="",u=[],s=0;s<l.length;s++)f=l[s],f.label!==t&&(t&&(r[t]=u),t=f.label,u=[]),u.push(f);r[t]=u;var h=[],i=[],c=0,y=this.showEmptyLabels&&!(this.filterProp&&this.filter),a=Object.keys(r).sort();for(e=0;e<a.length;e++)(n=a[e],n)&&(o=r[n]||[],(y||o.length>0)&&(n.items=o,n.count=o.length,i.push(n),c+=n.count),c>=v&&(h.push(i),i=[],c=0));return i.length>0&&h.push(i),h},labelsDisplay:function(){return this.pagedLabels[this.currentIndex]}}};bfs.vueMixins.checkboxes={computed:{checkedIds:function(){return this.valuesDisplay.reduce(function(n,t){return t.isChecked&&n.push(t.id),n},[])},isChecked:function(){if(!this.valuesDisplay||this.valuesDisplay.length===0)return!1;var n=this.valuesDisplay.filter(function(n){return n.isChecked});return this.valuesDisplay.length===n.length}},methods:{setCheckedAll:function(n){this.valuesDisplay.forEach(function(t){t.isChecked=n})},checkboxChanged:function(n,t,i){this.valuesDisplay.forEach(function(r){t&&r.label!==t||i&&r.id!==i||(r.isChecked=n)})},toggleCheckedAllDisplayed:function(){var n=!this.isChecked;this.valuesDisplay.forEach(function(t){t.isChecked=n})}}};bfs.vueMixins.forms={computed:{testing:function(){return this.currentItem}},methods:{reset:function(){this.currentItem=this.defaultItem},submit:function(n,t){var r=this,i,f,u;if(notDefined(n)){r.reset();return}if((i=this.currentItem,!notDefined(i))&&(f=document.getElementById(t),!f||!f.reportValidity||f.reportValidity())){if(bfs.loading.show(),i.id&&i.id!==bfs.emptyGuid){for(u=0;
10u<r.items.length;u++)if(r.items[u].id===i.id){Vue.set(r.items,u,i);break}}else r.items.push(i);cc.ajax.postJSON(n,i,"Failed to save",function(){bfs.dialog.closeAllDialogs();bfs.loading.hide();r.reset()})}},loadItem:function(n){if(n===bfs.emptyGuid){this.currentItem=cloneObject(this.defaultItem);return}for(var t=0;t<this.items.length;t++)if(this.items[t]._id===n){this.currentItem=cloneObject(this.items[t]);return}this.reset()},remove:function(n,t){var i=this[n];notDefined(i)||i[t]&&i.splice(t,1)}}};bfs.vueMixins.currentIssuePaging={data:{statusFilter:"all",pageSize:100,currentIndex:0,valueCap:0,pageNumberCount:9,groupMode:!1,sortAsc:!1,selectAllIssues:!1},created:function(){this.updateSettingsFromQuery()},watch:{filter:function(){this.updateQueryString();this.currentIndex=0},groupMode:function(n){n?(this.sortAsc=!1,this.sortKey="name"):(this.sortAsc=!1,this.sortKey="date");this.updateQueryString();this.sortKey==="date"&&this.rawValues.sort((n,t)=>this.sortAsc?n[this.sortKey]-t[this.sortKey]:t[this.sortKey]-n[this.sortKey]);this.sortKey==="name"&&(n?this.rawValues.sort((n,t)=>{let r=(n.label??"").toLowerCase(),u=(t.label??"").toLowerCase(),i=r.localeCompare(u,undefined,{sensitivity:"base"});return i===0?this.strCmpLogicalW(n[this.sortKey],t[this.sortKey]):i}):this.rawValues.sort((n,t)=>this.sortAsc?this.strCmpLogicalW(t[this.sortKey],n[this.sortKey]):this.strCmpLogicalW(n[this.sortKey],t[this.sortKey])))}},methods:{updateSettingsFromQuery:function(){const t=new URL(window.location.href),n=new URLSearchParams(t.search),i=n.get("GroupMode")??"0";this.groupMode=i==="1";const r=n.get("SortAsc")??"0";this.sortAsc=r==="1";this.groupMode&&(this.sortAsc=!1);this.sortKey=n.get("SortKey")??this.sortKey??"date";this.groupMode&&(this.sortKey="name");this.sortKey==="date"&&this.rawValues.sort((n,t)=>this.sortAsc?n[this.sortKey]-t[this.sortKey]:t[this.sortKey]-n[this.sortKey]);this.sortKey==="name"&&(this.groupMode?this.rawValues.sort((n,t)=>{let r=(n.label??"").toLowerCase(),u=(t.label??"").toLowerCase(),i=r.localeCompare(u,undefined,{sensitivity:"base"});return i===0?this.strCmpLogicalW(n[this.sortKey],t[this.sortKey]):i}):this.rawValues.sort((n,t)=>this.sortAsc?this.strCmpLogicalW(t[this.sortKey],n[this.sortKey]):this.strCmpLogicalW(n[this.sortKey],t[this.sortKey])));this.filter=n.get("Search")??"";this.showFilterBox=this.filter.length>0;this.statusFilter=n.get("StatusFilter")??"all";this.updateQueryString()},updateQueryString:function(){cc.updateQueryStringParam("GroupMode",this.groupMode?"1":"0");cc.updateQueryStringParam("SortAsc",this.sortAsc?"1":"0");cc.updateQueryStringParam("SortKey",encodeURIComponent(this.sortKey));cc.updateQueryStringParam("Search",encodeURIComponent(this.filter));cc.updateQueryStringParam("StatusFilter",encodeURIComponent(this.statusFilter));const n=document.querySelector("#PageTitle h1.DashboardText div.TableTitleButton a"),t=window.location.href;n&&n.setAttribute("onclick","bfs.loading.show(); window.location.href='"+t+"'; return false;")},formatInt:function(n){return this.formatNumber(n,0)},formatNumber:function(n,t){return bfs.util.formatNumber(n,t)},applyBulkAction:function(){function e(n,i,u){if(!f.hasEditableIds){bfs.dialog.showError(`Checks created by direct integrations cannot be manually ${u}.<br/>Please edit the appropriate direct integration's configuration to update these checks.`);return}var o=r.find("option:selected").first(),e=$("#"+n).find("form");e.on("submit",function(n){var r,u;if(n.preventDefault(),i){r=new FormData(e[0]);for(u of t.entries())r.append(u[0],u[1]);cc.ajax.run(i,r,bfs.lang("errorMessage"),function(){window.location.reload()})}});bfs.dialog.showDialog(n)}var f=this.checkedIds(),n=f.ids,r,u,t,i;if(!n||n.length===0){bfs.dialog.showError(bfs.lang("noItems"));return}if(r=$(this.$el).find("select[id^=cboBulkActions]"),u=r.val(),!u){bfs.dialog.showError(bfs.lang("noActions"));return}for(t=cc.buildAjaxData(!0),t.set("SetChecked","1"),t.set("ChildCount",n.length),i=0;i<n.length;i++)t.set("ChildID"+i,n[i]);switch(u.toLowerCase()){case"pause":cc.checkStatusOverride.setPausedBulk(t,n,!0);break;case"resume":cc.checkStatusOverride.setPausedBulk(t,n,!1);break;case"status":cc.checkStatusOverride.setStatus(t);break;case"label":e("dlgfrmSetCheckLabel","Checks/SetLabel","assigned labels");break;case"delete":this.deleteChecks(n);break;case"move":e("dlgAssignToGroup","CheckGroups/SetParent","moved to other groups");break;case"edit":this.bulkEditChecks(n);break;case"ignore":this.ignoreChecks(n);break;default:bfs.dialog.showError(bfs.lang("noActions"))}},deleteChecks:function(n){typeof n=="string"&&(n=[n]);var t=this;bfs.dialog.confirmDeleteWithRadios("Are you sure you want to delete these checks? ("+n.length+" selected)","Unmatch activities matched to each check","Delete activities matched to each check",function(i){for(var f,u,e=0,r=0;r<t.rawValues.length;r++)if(f=t.rawValues[r],n.indexOf(f.id)>-1&&(Vue.set(f.loadingStates,"delete",!0),e++===n.length))break;for(u=cc.buildAjaxData(!0),u.set("SendConfirm","1"),u.set("ChildCount",n.length),u.set("DeleteActivities",i=="OptionB"),r=0;r<n.length;r++)u.set("ChildID"+r,n[r]);cc.ajax.run("Checks/Delete",u,bfs.lang("failedDelete"),function(){t.rawValues=t.rawValues.filter(function(t){return n.indexOf(t.id)<0});bfs.loading.hide()},function(){bfs.dialog.showError(bfs.lang("failedDelete"))})})},bulkEditChecks:function(n){var i,t;for(typeof n=="string"&&(n=[n]),i=cc.buildAjaxData(!0),i.set("Count",n.length),t=0;t<n.length;t++)i.set("ID"+t,n[t]);cc.ajax.run("Checks/EncodeIds",i,"Failed to open bulk check editor.")},ignoreChecks:function(n){typeof n=="string"&&(n=[n]);var t=`Ignore the integration data that created these checks?`;bfs.dialog.confirmWarningWithRadios(t,"Disconnect and pause checks","Delete checks and remove any activity data",function(){var t=cc.buildAjaxData(!0);t.set("ChecksPageIgnore",!0);t.set("Count",n.length);t.set("CheckIDs",n.join());cc.ajax.run("Integrations/IgnoreJob",t,"Failed to ignore, please try again.",function(){window.location.reload()})})},sortValues:function(n,t){this.sortKey===n&&(this.sortAsc=!this.sortAsc);t&&(this.sortAsc=!0);this.sortKey=n;n==="date"&&this.rawValues.sort((t,i)=>this.sortAsc?t[n]-i[n]:i[n]-t[n]);n==="name"&&(this.groupMode?this.rawValues.sort((t,i)=>{let u=(t.label??"").toLowerCase(),f=(i.label??"").toLowerCase(),r=u.localeCompare(f,undefined,{sensitivity:"base"});return r===0?this.strCmpLogicalW(t[n],i[n]):r}):this.rawValues.sort((t,i)=>this.sortAsc?this.strCmpLogicalW(i[n],t[n]):this.strCmpLogicalW(t[n],i[n])));this.updateQueryString()},strCmpLogicalW:function(n,t){const u=/(\d+|\D+)/g,i=n.match(u)??[],r=t.match(u)??[],f=Math.min(i.length,r.length);for(let n=0;n<f;n++){const t=i[n],u=r[n];if(isNaN(t)||isNaN(u)){const i=t.toLowerCase(),r=u.toLowerCase(),n=i.localeCompare(r,undefined,{sensitivity:"base"});if(n!==0)return n}else{const n=parseInt(t,10),i=parseInt(u,10);if(n!==i)return n-i;if(t.length!==u.length)return t.length-u.length}}return i.length-r.length},updateData:function(n){n&&n.rawValues&&(this.rawValues=n.rawValues)},updateStatusFilter:function(n){n&&(this.statusFilter=$(n.currentTarget).val()??"all",this.updateQueryString())},getTargetIndex:function(n){return n},nextPage:function(){this.loadPage(this.currentPage+1)},prevPage:function(){this.loadPage(this.currentPage-1)},loadPage:function(n){n<0&&(n=0);n>=this.maxPages&&(n=this.maxPages-1);$thisel=$(this.$el);var t=$thisel.find(".VueScrollTo").first();t.length===0&&(t=$thisel.find(".TableTitle").first());bfs.util.isOffScreen(t)&&t.get(0).scrollIntoView();this.currentIndex=n}},computed:{showFirstJump:function(){return this.pages.length===0?!1:!this.pages.includes(0)},showLastJump:function(){return this.pages.length===0?!1:!this.pages.includes(this.maxPages-1)},maxPages:function(){return this.groupMode?this.pagedGroups.length:this.pagedIssues.length},pageThreshold:function(){return Math.floor(this.pageNumberCount/2)},currentPage:function(){return this.currentIndex},refilteredIssues:function(){if(this.statusFilter==="all")return this.filteredIssues;var n=this.statusFilter;return notDefined(n)||n.length===0?this.filteredIssues:this.filteredIssues.filter(function(t){return t.status===n})},valuesDisplay:function(){return[]},filteredIssues:function(){if(!this.filter||this.filter.length===0)return this.rawValues;var n=this.filter,t=this.filterProp;return this.rawValues.filter(i=>{var r="";return t.forEach(n=>{r+=i[n]||""}),r.toLowerCase().indexOf(n.toLowerCase())!==-1})},pagedIssues:function(){var n=this.pageSize,t=this.refilteredIssues||[],i=[];for(let r=0;r<t.length;r+=n)i.push(t.slice(r,r+n));return i},issuesNotPaged:function(){return this.pagedIssues.flat()},issuesDisplay:function(){return this.issuesToDisplay=this.pagedIssues[this.currentIndex]||[],this.issuesToDisplay},pages:function(){var i=this.pageNumberCount,n=Math.max(0,this.currentPage-this.pageThreshold),r=Math.min(this.maxPages,n+i),u,t;for(r-n<i&&(n=Math.max(0,r-i)),u=[],t=n;t<r;t++)u.push(t);return u},pagedGroups:function(){const f=this.pageSize,i=this.groupsData;if(!i||i.length===0)return[];const e=this.refilteredIssues,t={};e.forEach(n=>{t[n.groupId]||(t[n.groupId]=[]),t[n.groupId].push(n)});const r=[];let n=[],u=0;
10return i.forEach(i=>{if(i){const e=t[i.id]||[],o=e.length;o>0&&(i.items=e,n.push(i),u+=o);u>=f&&(r.push(n),n=[],u=0)}}),n.length>0&&r.push(n),r},groupsNotPaged:function(){return this.pagedGroups.flat()},groupsDisplay:function(){return this.pagedGroups[this.currentIndex]||[]}}};bfs.vueMixins.bulkPaging={data:{showEmptyGroups:!1,groupFilter:"",groupFilterProp:"",statusFilter:"all",templateFilter:"all"},methods:{onDragUpdate:function(n){var i,r,t;n&&(i=n.item.id.replace("parentid-",""),i)&&(r=n.newIndex||0,t=cc.buildAjaxData(!0),t.set("ParentID",i),t.set("Index",r+1),cc.ajax.run("CheckGroups/SetSortOrder",t,bfs.lang("failedGroupReorder")))},updateData:function(n){n&&(n.rawValues&&(this.rawValues=n.rawValues),n.partialValues&&(this.rawValues=this.rawValues.map(function(t){return n.partialValues[t.id]||t})),n.groupsData&&(this.groupsData=n.groupsData),n.miniFilters&&(this.miniFilters=n.miniFilters))},updateStatusFilter:function(n){this.statusFilter=$(n.currentTarget).val()??"all"},updateTemplateFilter:function(n){this.templateFilter=$(n.currentTarget).val()??"all"},getTargetIndex:function(n){return n}},computed:{maxPages:function(){return this.pagedGroups.length},currentPage:function(){return this.currentIndex},refilteredValues:function(){var n=this.filteredValues,t;if(this.templateFilter!=="all"){var i=this.templateFilter.split(":::"),r=i[0],u=i[1];n=n.filter(function(n){return n.templates[r].template_id===u})}return this.statusFilter==="all"?n:(t=this.statusFilter,notDefined(t)||t.length===0)?n:n.filter(function(n){return n.status===t})},valuesDisplay:function(){return[]},filteredGroups:function(){if(!this.groupFilterProp||!this.groupFilter)return this.groupsData;var n=this.groupFilter,t=this.groupFilterProp;return this.groupsData.filter(function(i){var r=i[t]||"";return r.toLowerCase().indexOf(n.toLowerCase())!==-1})},pagedGroups:function(){var v=this.pageSize,r=this.filteredGroups,f,e,o,n,s;if(!r||r.length===0)return[];var a=this.refilteredValues||[],h={},t="",u=[];for(f=0;f<a.length;f++)e=a[f],e.groupId!==t&&(t&&(h[t]=u),t=e.groupId,u=[]),u.push(e);h[t]=u;var c=[],i=[],l=0,y=this.showEmptyGroups&&!(this.filterProp&&this.filter)&&this.statusFilter==="all"&&this.templateFilter==="all";for(o=0;o<r.length;o++)(n=r[o],n)&&(s=h[n.id]||[],(y||s.length>0)&&(n.items=s,n.count=s.length,i.push(n),l+=n.count),l>=v&&(c.push(i),i=[],l=0));return i.length>0&&c.push(i),c},groupsNotPaged:function(){return this.pagedGroups.flat()},groupsDisplay:function(){return this.pagedGroups[this.currentIndex]||[]}}};bfs.vueMixins.dashboard={data:{IsFilterLoading:!1,miniFilters:[],statusFilters:Object.keys(bfs.statusEnum),selectedMiniFilter:undefined},filters:{plural:function(n){return bfs.util.formatInt(n)}},methods:{resetStatusFilters:function(n){this.statusFilters=n?Object.keys(bfs.statusEnum):[]},clearMiniFilters:function(){this.selectedMiniFilter=undefined},setMiniFilter:function(n,t){this.selectedMiniFilter=this.selectedMiniFilter===undefined||this.isUnselectedMiniFilter(n,t)?{title:n,status:t}:undefined;this.resetStatusFilters(!0);this.showFilterBox=!0},hasMiniFilterSet:function(){return this.selectedMiniFilter!==undefined},isUnselectedMiniFilter:function(n,t){let i=this.selectedMiniFilter;return i===undefined?!1:i.title===n&&(i.status===t||i.status==="all")?!1:!0},isCurrentMiniFilter:function(n){let t=this.selectedMiniFilter;return t===undefined?!1:t.title===n},isUnselected:function(n){return this.selectedMiniFilter!==undefined||this.statusFilters.indexOf(n)<0},setStatusFilter:function(n){this.selectedMiniFilter=undefined;this.statusFilters.length===1&&this.statusFilters[0]===n?this.resetStatusFilters(!0):(this.statusFilters=[n],this.showFilterBox=!0);this.filter=""},toggleStatusFilter:function(n){var t=this.statusFilters.indexOf(n);t<0?this.statusFilters.push(n):this.statusFilters.splice(t,1)},toggleCollapseAll:function(){var n=!this.allCollapsed;this.toggleAll(n)},toggleAll:function(n){var i=this.groupsDisplay.map(function(t){return t.isCollapsed=n,t.id}).join(),t=cc.buildAjaxData(!0);t.set("GroupID",i);t.set("Collapse",n);cc.ajax.run("Groups/SetCollapseState",t)},updateActivityNotes:function(n){var t=-1,i=this.rawValues.findIndex(function(i){return t=i.statusHistory.findIndex(function(t){return t.id==n.activityId}),t>-1});i>-1&&t>-1&&(this.rawValues[i].statusHistory[t].tooltip=n.activityTooltip,this.rawValues[i].statusHistory[t].hasNote=!!n.activityTooltip)},updateHighlight:function(){var t="none",n=$(".PageBorderHighlight");n.length==0&&(n=$('<div class="PageBorderHighlight"><\/div>'),$("body").append(n));$("#PageWrap").css("padding",(this.highlightBorderWidth||0)+"px");this.highlightBorderWidth?(t=`solid ${this.highlightBorderWidth}px var(--checkcentral-statuscolour-`,t+=this.statusCounts.failure?"failure)":this.statusCounts.warning?"warning)":"success)",n.css("border",t)):n.remove()},deleteMiniFilter:function(n,t){let i=this;return bfs.dialog.confirmDelete("Are you sure you want to delete filtered overview '"+n+"'?",function(){i.miniFilters.splice(t,1);i.selectedMiniFilter=undefined;var r=cc.buildAjaxData(!0);r.set("DashboardID",window.cc.currentDashboardID);
10r.set("Filter",n);i.IsFilterLoading=!0;cc.ajax.run("Dashboards/DeleteFilter",r,bfs.lang("failedDelete"),function(n){n.success=="true"?i.updateData(n):bfs.toast.showError(bfs.lang("failedDelete"));i.IsFilterLoading=!1})})},editFilter:function(n,t){let i=this.miniFilters.find(t=>t.title==n),r=t();return $("#hidfrmMinifilterWizardIndex").val(this.miniFilters.indexOf(i)),$("#txtfrmMinifilterWizardname").val(i.title),$("#ddlfrmMinifilterWizardcheckGroups").val(i.groups).trigger("change"),$("#ddlfrmMinifilterWizardlabels").val(i.labels).trigger("change"),r},reorderMiniFilter:function(n,t){let i=this;const u=i.miniFilters.splice(n,1)[0];i.miniFilters.splice(t,0,u);var r=cc.buildAjaxData();return r.set("DashboardID",window.cc.currentDashboardID),r.set("FromIndex",n),r.set("ToIndex",t),i.IsFilterLoading=!0,cc.ajax.run("Dashboards/ReorderFilter",r,"Failed to reorder filters. Please try again.",function(n){n.success=="true"&&i.updateData(n);i.IsFilterLoading=!1})}},computed:{success:function(){return bfs.util.formatInt(this.statusCounts.success)},warning:function(){return bfs.util.formatInt(this.statusCounts.warning)},failure:function(){return bfs.util.formatInt(this.statusCounts.failure)},paused:function(){return bfs.util.formatInt(this.statusCounts.paused)},statusCounts:function(){var n=Object.keys(bfs.statusEnum).reduce(function(n,t){return n[t]=0,n},{});return this.rawValues.reduce(function(n,t){return t.status==="resumed"&&n.success++,n[t.status]++,n},n)},miniFilterCounts:function(){var t=Object.keys(bfs.statusEnum).reduce(function(n,t){return n[t]=0,n},{});const n=this.miniFilters.reduce((n,i)=>(n[i.title]={...t},n),{});return this.rawValues.forEach(t=>{this.miniFilters.forEach(i=>{const r=i.groups.length===0||i.groups.includes(t.groupId),u=i.labels.length===0||i.labels.includes(t.label);r&&u&&(t.status==="resumed"&&n[i.title].success++,n[i.title][t.status]++)})}),n},refilteredValues:function(){var i=this.statusFilters||[];let t=this.selectedMiniFilter,n=undefined;return(t!==undefined&&(n=this.miniFilters.find(n=>n.title==t.title)),i.length===0&&n===undefined)?[]:this.filteredValues.filter(function(r){return n===undefined?i.indexOf(r.status)>=0:(n.groups.length===0||n.groups.includes(r.groupId))&&(n.labels.length===0||n.labels.includes(r.label))&&(t.status===r.status||t.status==="all")})},allCollapsed:function(){var t=this.groupsDisplay,n;if(!t)return!1;for(n=0;n<t.length;n++)if(!t[n].isCollapsed)return!1;return!0}},watch:{refilteredValues:function(n,t){t.length!==n.length&&(this.currentIndex=0,cc.updateFilters(this.statusFilters))},statusCounts:function(){this.updateHighlight()},filter:function(n){cc.updateQueryStringParam("Search",n)}},mounted:function(){this.$root.$on("toggle-all",this.toggleAll);this.updateHighlight()},destroyed:function(){this.$root.$off("toggle-all",this.toggleAll)}};bfs.treeviews={};bfs.vueMixins.treeview={data:function(){return{isOpen:!1,search:"",lastSearchId:null}},computed:{isChecked:function(){return this.rawValues.every(function(n){return n.isChecked})},isIndeterminate:function(){return this.isChecked?!1:this.rawValues.some(function(n){return n.isChecked})}},methods:{checkedValues:function(){var n={global:!1,groups:[],checks:[]},t,i,r;if(this.isChecked)n.global=!0;else for(t=0;t<this.groupsDisplay.length;t++)i=this.groupsDisplay[t],r=i.items.reduce(function(n,t){return t.isChecked&&n.push(t.id),n},[]),r.length>0&&(r.length===i.items.length?n.groups.push(i.id):n.checks=n.checks.concat(r));return n},getLabelId:function(n,t){return n+"label"+t.replace(" ","_")},searchForward:function(){this.searchValue(this.search,!1)},searchBackward:function(){this.searchValue(this.search,!0)},searchValue:function(n,t){var r,e,s,i,h,f,o,u,c,l,a;for(n=n.toLowerCase(),r=[],e={},s=0;s<this.groupsDisplay.length;s++)if(i=this.groupsDisplay[s],i.items.length!==0)for(i.name.toLowerCase().indexOf(n)>-1&&(i.isOpen=!0,r.push(i.id),e[i.id]={groupId:i.id,itemId:i.id}),h=0;h<i.items.length;h++)f=i.items[h],f.label.toLowerCase().indexOf(n)>-1&&(o=f.label.id,r.indexOf(o)<0&&(r.push(o),e[o]={groupId:i.id,itemId:o})),f.name.toLowerCase().indexOf(n)>-1&&(r.push(f.id),e[f.id]={groupId:i.id,itemId:f.id});if(r.length===0){this.lastSearchId=null;return}u=r.indexOf(this.lastSearchId);t?(u--,u<0&&(u=r.length-1)):(u++,u>=r.length&&(u=0));c=e[r[u]];l=c.groupId;
10l!=this.lastSearchId&&this.$children.forEach(function(n){n.id==l&&(n.isOpen=!0)});this.lastSearchId=c.itemId;a=$(this.$el);Vue.nextTick(function(){var n=a.find(".highlightText");n.get(0).scrollIntoView();bfs.dialog.repositionWrappingDialog(n,"TreeviewSearch")})},setCheckboxes:function(n,t){var i,r,u;for(this.isLoaded=!0,this.isOpen=!1,i=0;i<this.rawValues.length;i++)r=this.rawValues[i],u=t||n.indexOf(r.id)>-1,u||(u=n.indexOf(r.groupId)>-1),r.isChecked=u},toggleOpen:function(){this.isOpen=!this.isOpen},onCheckChanged:function(){for(var t=!this.isChecked,n=0;n<this.rawValues.length;n++)this.rawValues[n].isChecked=t}},watch:{search:function(n){(notDefined(n)||n.length===0)&&(this.lastSearchId="")}}};bfs.paging={};bfs.paging.create=function(n,t,i){i||(i=[]);i.splice(0,0,bfs.vueMixins.filterBox);i.splice(0,0,bfs.vueMixins.parentPaging);var r=new Vue({el:n,mixins:i,data:t});return r.rawValues.length===0&&r.loadPage(0),r};bfs.setupVueComponents=function(){Vue&&Vue.component("select2",{props:["value","options","items"],template:"<select><slot><\/slot><\/select>",mounted:function(){var n=this;this.updateSelect2Options(this.options,this.items).val(this.value).trigger("change").on("change",function(){n.options.multiple?n.$emit("input",[].concat($(this).val())):n.$emit("input",this.value)})},watch:{value:function(n){this.options.multiple?[...n].sort().join(",")!==[].concat($(this.$el).val()).sort().join(",")&&$(this.$el).val(n).trigger("change"):$(this.$el).val(n).trigger("change")},items:function(n){const t=this.options.multiple?[]:"";this.updateSelect2Options(this.options,n);var i=this.value;this.$emit("input",t);this.$nextTick(function(){this.$emit("input",i)})}},destroyed:function(){$(this.$el).off().select2("destroy")},methods:{updateSelect2Options:function(n,t){var i=$(this.$el),r=n||{};return t&&(r.data=t,i.empty()),i.select2(r)}}})};$(document).on("click",".NeedsConfirm",function(n){var t,u,f;n&&n.preventDefault();var i=$(this),e=i.attr("data-bf-msg")||"Are you sure?",r=bfs.dialog.confirm;if(i.hasClass("IsDelete")?r=bfs.dialog.confirmDelete:i.hasClass("IsWarning")&&(r=bfs.dialog.confirmWarning),t=i.attr("data-bf-ajax-callback"),t){function n(n,t){return n?n[t]:{}}t=t.split(".").reduce(n,window)}return(u=i.attr("data-bf-ajax-url"),u)?(f="OrganizationID="+cc.organizationID+"&"+i.attr("data-bf-ajax-data"),r(e,function(){bfs.loading.show();cc.ajax.run(u,f,bfs.lang("error"),function(n){bfs.loading.hide();t&&typeof t=="function"&&t(n,f)})})):r(e,this)});toggleBoxContentWorker=function(n,t){var i=n.closest(".TableTitle").parent();i.toggleClass("collapsed",t)};$(document).ready(function(){bfs.tooltip.bindAllToolTips();bfs.groupCollapse.setup();$(document).on("click",".SubHeaderCollapse",function(n){n&&n.preventDefault();bfs.util.subHeaderCollapseToggle(this)});$(document).on("click",".ToggleBoxContent",function(n){n&&n.preventDefault();toggleBoxContentWorker($(this))});$(document).on("click",".ShowFilter",showFilterBox);$("form").on("keydown paste focus mousedown",".ControlDisabled",function(n){n.keyCode!=9&&n.preventDefault()});var n=null;$(window).on("scroll",function(){clearTimeout(n);n=setTimeout(function(){$(document).scrollTop()>200?$("#ScrollToTop").addClass("shown"):$("#ScrollToTop").removeClass("shown")},150)});$(document).mousemove(function(n){window.mouseXPos=n.pageX;window.mouseYPos=n.pageY});$(document).mousedown(function(){window.mouseButtonPressed=!0;bfs.tooltip.hideAllToolTips()});$(document).mouseup(function(){window.mouseButtonPressed=!1});$(document).keyup(function(n){var t,i;if(n.keyCode===27){if(t=$(".bfDialogJS:visible").getMaxZ(),t&&(i=$(t).prop("id"),i)){isDebugMode&&console.log("keyup: Escape detected...");bfs.dialog.closeDialog(i);return}bfs.dialog.closeAllDialogs()}});$(document).keydown(function(n){var t,i;if(n.keyCode===32&&(t=$(":focus"),t&&(i=$(t).prop("id"),i==="btnConfirmYes"||i==="btnConfirmNo"||i==="btnMessageOK"))){isDebugMode&&console.log("keyup: Space detected, overriding...");n.preventDefault();$(t).trigger("click");return}});$(document).bind("ajaxSend",function(n,t,i){isDebugMode&&console.log("Ajax: Start: ["+i.url+"]");$("#masterAjaxLoading").fadeIn(constAnimationTimeMS)});$(document).bind("ajaxComplete",function(n,t,i){isDebugMode&&console.log("Ajax: Complete: ["+i.url+"]");$("#masterAjaxLoading").fadeOut(constAnimationTimeMS)});$(document).bind("ajaxSuccess",function(n,t,i){isDebugMode&&console.log("Ajax: Success: ["+i.url+"]")});$(document).bind("ajaxError",function(n,t,i,r){isDebugMode&&console.log("Ajax: Error: "+r+" ["+i.url+"]")});$(window).on("resize",function(){$(".bfDialogJS").each(function(){$(this).is(":visible")&&bfs.dialog.repositionDialog($(this).attr("id"),"WindowResize")})});$(".LetterInputOnly").keydown(function(n){if(n.altKey){n.preventDefault();return}if(n.keyCode>=48&&n.keyCode<=57){n.preventDefault();return}if(n.keyCode>90){n.preventDefault();return}})});window.bfs=window.bfs||{};bfs.webawesome=function(n){function t(t,i){try{(n.onError||console.warn)("[bfs.webawesome] "+t,i)}catch(r){}}function r(n){try{if(!n||n.multiple)return;const t=n.querySelector(':scope > wa-icon[slot="start"], :scope > img[slot="start"]');if(!t)return;let i="";const r=n.value;if(r!=null&&r!==""){const t=n.querySelector(`wa-option[value="${CSS.escape(r)}"]`);i=t?.querySelector(u)?.getAttribute("src")??""}i?(t.getAttribute("src")!==i&&t.setAttribute("src",i),t.style.visibility="visible"):(t.removeAttribute("src"),t.style.visibility="hidden")}catch(i){t("syncStartIcon failed",i)}}function e(n){const t=n.target?.closest?.("wa-select, wa-combobox");t&&r(t)}function i(n){return String(n).replace(/[&<>\x22\x27]/g,function(n){return o[n]})}function h(n){const t=n.shadowRoot;if(t&&!t.__bfsTagCss){const i=new CSSStyleSheet;i.replaceSync(s);t.adoptedStyleSheets=[...t.adoptedStyleSheets,i];t.__bfsTagCss=!0}}function c(n){try{if(!n||!n.multiple)return;if(n.getTag&&n.__bfsTag)return;h(n);n.getTag=t=>{const r=t.querySelector(u)?.getAttribute("src")??"",f=t.label??t.textContent.trim(),e=r?`<wa-icon src="${i(r)}" class="bfs-tag-icon"></wa-icon>`:"";return`<wa-tag part="tag" exportparts="base:tag__base,content:tag__content,remove-button:tag__remove-button,remove-button__base:tag__remove-button__base" size="${i(n.size)}" ${n.pill?"pill":""} with-remove data-value="${i(t.value)}">${e}${i(f)}</wa-tag>`};n.__bfsTag=!0}catch(r){t("setTagRenderer failed",r)}}function f(n){return[...n.querySelectorAll("wa-option")].filter(n=>!n.disabled).map(n=>n.value)}function l(n){try{if(!n||!n.multiple)return;if(!n.hasAttribute("data-select-all"))return;if(n.__bfsSelectAll)return;const e=n.getAttribute("data-select-all-label")||"Select all",o=n.getAttribute("data-select-all-icon")||"/MediaCommon/SVGs/FontAwesome/check-double.solid.light.svg",t=document.createElement("div");t.className="bfs-select-all";t.setAttribute("role","button");t.setAttribute("tabindex","0");const i=document.createElement("wa-icon");i.className="bfs-select-all-icon";i.setAttribute("src",o);i.setAttribute("aria-hidden","true");const r=document.createElement("span");r.textContent=e;t.append(i,r);const u=t=>{t.preventDefault(),t.stopPropagation(),n.value=f(n)};t.addEventListener("click",u);t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&u(n)});t.addEventListener("mousedown",n=>n.preventDefault());n.insertBefore(t,n.firstChild);n.__bfsSelectAll=!0}catch(i){t("addSelectAll failed",i)}}async function a(i){try{i=i||{};const f=i.root&&i.root.querySelectorAll?i.root:document;if(typeof customElements=="undefined"||!customElements.whenDefined)return t("customElements unavailable",null),0;await Promise.allSettled([customElements.whenDefined("wa-select"),customElements.whenDefined("wa-combobox"),]);n.__listenerAttached||(document.addEventListener("change",e),n.__listenerAttached=!0);const u=[...f.querySelectorAll("wa-select, wa-combobox")];return await Promise.allSettled(u.map(async n=>{try{await n.updateComplete}catch(t){}r(n);c(n);l(n)})),u.length}catch(u){return t("setupSelects failed",u),0}}const u='wa-icon[slot="start"], img[slot="start"]';var o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const s=`
11	  .bfs-tag-icon::part(svg) { width: 1em; height: 1em; }
12	  .bfs-tag-icon { margin-inline-end: 0.2em; }
13	  [part="tags"] {
14	    --tag-max-size: none;
15	    min-width: 0;
16	  }
17	  [part="tags"] wa-tag {
18	    max-width: 100%;
19	    height: auto;
20	    min-height: calc(var(--wa-form-control-height) * 0.8);
21	    line-height: var(--wa-line-height-normal, 1.2);
22	  }
23	  [part="tags"] wa-tag::part(content) {
24	    white-space: normal;
25	    overflow-wrap: anywhere;
26	  }
27	`;return n.setupSelects=a,n.syncSelect=r,n.selectAll=n=>{n?.multiple&&(n.value=f(n))},n}(bfs.webawesome||{});cc=window.cc||{};cc.buildAjaxData=function(n){var i=$("#ajaxOrganizationID").val(),r=$("#ajaxBuildManage").val()||0,t=new FormData;return t.set("OrganizationID",i),t.set("BuildManage",r),n&&t.set("Vue","1"),t};cc.changeQueryStringParam=function(n,t,i){var e=typeof i=="undefined"||i===null||i==="",u=t+"="+i,r="",f,o;return n?(f=new RegExp("([?&])"+t+"[^&]*"),o=new RegExp("([?&])"+t+"=[^&;]+[&;]?"),e?(r=n.replace(o,"$1"),r=r.replace(/[&;]$/,"")):r=n.match(f)!==null?n.replace(f,"$1"+u):n+"&"+u):e||(r="?"+u),r};cc.updateQueryStringParam=function(n,t){var r=[location.protocol,"//",location.host,location.pathname].join(""),u=document.location.search,f=document.location.hash||"",i=cc.changeQueryStringParam(u,n,t);i&&window.history.replaceState({},"",r+i+f)};cc.updateFilters=function(n){var t,i;window.history&&window.history.replaceState&&(t=[],$.each(bfs.statusEnum,function(i,r){n.indexOf(i)===-1&&t.push(r)}),i="",t.length>0&&(i=t.join(",")),cc.updateQueryStringParam("Filter",i))};$(document).ready(function(){for(var n in cc)cc.hasOwnProperty(n)&&cc[n].hasOwnProperty("init")&&cc[n].init();cc.organizationID=$("#ajaxOrganizationID").val();$(document).on("click",".ShowInfoDialog",function(n){n.preventDefault();var t=$(this);bfs.dialog.showMessage(t.attr("data-bf-msg"))});if(window.vueDash)$(document).on("bfs:autoRefresh",function(n,t){window.vueDash.updateData(t);window.vueDash.updateHighlight()})});cc.vueMixins=cc.vueMixins||{};cc.vueMixins.checkboxRoot={methods:{checkedIds:function(){var n=[],t=!1;return this.groupsDisplay.forEach(function(i){i.items.filter(function(n){return n.isChecked&&n.isEditable&&(t=!0),n.isChecked}).forEach(function(t){n.push(t.id)})}),{ids:n,hasEditableIds:t}},setCheckedAll:function(n){this.groupsDisplay.forEach(function(t){t.items.forEach(function(t){t.isChecked=n||!1})})},checkChanged:function(n,t,i,r){for(var u,f=0;f<this.rawValues.length;f++)(u=this.rawValues[f],u)&&u.groupId===t&&(i&&u.label!==i||r&&u.id!==r||(u.isChecked=n))}}};cc.vueMixins.checkboxCurrentIssuesPage={methods:{checkedIds:function(){var n=[],t=!1;return this.groupMode?this.groupsDisplay.forEach(i=>{i.items.filter(function(n){return n.isChecked&&n.isEditable&&(t=!0),n.isChecked}).forEach(function(t){n.push(t.id)})}):this.issuesToDisplay.filter(function(n){return n.isChecked&&n.isEditable&&(t=!0),n.isChecked}).forEach(function(t){n.push(t.id)}),{ids:n,hasEditableIds:t}},setCheckedAll:function(n){if(!n){this.rawValues.forEach(n=>{n.isChecked=!1});return}this.groupMode?this.groupsDisplay.forEach(function(t){t.items.forEach(function(t){t.isChecked=n||!1})}):this.issuesToDisplay.forEach(function(t){t.isChecked=n||!1})},checkChanged:function(n,t,i,r){for(var u,f=0;f<this.rawValues.length;f++)(u=this.rawValues[f],u)&&u.groupId===t&&(i&&u.label!==i||r&&u.id!==r||(u.isChecked=n))}}};cc.vueMixins.checksPage={computed:{},methods:{applyBulkAction:function(){function e(n,i,u){if(!f.hasEditableIds){bfs.dialog.showError(`Checks created by direct integrations cannot be manually ${u}.<br/>Please edit the appropriate direct integration's configuration to update these checks.`);return}var o=r.find("option:selected").first(),e=$("#"+n).find("form");e.one("submit",function(n){var r,u;if(n.preventDefault(),n.stopPropagation(),i){r=new FormData(e[0]);for(u of t.entries())r.append(u[0],u[1]);cc.ajax.run(i,r,bfs.lang("errorMessage"),function(){window.location.reload()})}});bfs.dialog.showDialog(n)}var f=this.checkedIds(),n=f.ids,r,u,t,i;if(!n||n.length===0){bfs.dialog.showError(bfs.lang("noItems"));return}if(r=$(this.$el).find("select[id^=cboBulkActions]"),u=r.val(),!u){bfs.dialog.showError(bfs.lang("noActions"));return}for(t=cc.buildAjaxData(!0),t.set("SetChecked","1"),t.set("ChildCount",n.length),i=0;i<n.length;i++)t.set("ChildID"+i,n[i]);switch(u.toLowerCase()){case"pause":cc.checkStatusOverride.setPausedBulk(t,n,!0);break;case"resume":cc.checkStatusOverride.setPausedBulk(t,n,!1);break;case"status":cc.checkStatusOverride.setStatus(t);break;case"label":e("dlgfrmSetCheckLabel","Checks/SetLabel","assigned labels",!0);break;case"delete":this.deleteChecks(n);break;case"move":e("dlgAssignToGroup","CheckGroups/SetParent","moved to other groups");break;case"edit":this.bulkEditChecks(n);break;case"ignore":this.ignoreChecks(n);break;case"reprocess":this.reprocessChecks(n);break;default:bfs.dialog.showError(bfs.lang("noActions"))}},checkboxChanged:function(n,t,i,r){for(var u,f=0;f<this.rawValues.length;f++)(u=this.rawValues[f],u)&&u.groupId===t&&(i&&u.label!==i||r&&u.id!==r||(u.isChecked=n))}
27,setLoading:function(){},deleteChecks:function(n){typeof n=="string"&&(n=[n]);var t=this;bfs.dialog.confirmDeleteWithRadios("Are you sure you want to delete these checks? ("+n.length+" selected)","Unmatch activities matched to each check","Delete activities matched to each check",function(i){for(var f,u,e=0,r=0;r<t.rawValues.length;r++)if(f=t.rawValues[r],n.indexOf(f.id)>-1&&(Vue.set(f.loadingStates,"delete",!0),e++===n.length))break;for(u=cc.buildAjaxData(!0),u.set("SendConfirm","1"),u.set("ChildCount",n.length),u.set("DeleteActivities",i=="OptionB"),r=0;r<n.length;r++)u.set("ChildID"+r,n[r]);cc.ajax.run("Checks/Delete",u,bfs.lang("failedDelete"),function(){t.rawValues=t.rawValues.filter(function(t){return n.indexOf(t.id)<0});bfs.loading.hide()},function(){bfs.dialog.showError(bfs.lang("failedDelete"))})})},bulkEditChecks:function(n){var i,t;for(typeof n=="string"&&(n=[n]),i=cc.buildAjaxData(!0),i.set("Count",n.length),t=0;t<n.length;t++)i.set("ID"+t,n[t]);cc.ajax.run("Checks/EncodeIds",i,"Failed to open bulk check editor.")},ignoreChecks:function(n){typeof n=="string"&&(n=[n]);var t=`Ignore the integration data that created these checks?`;bfs.dialog.confirmWarningWithRadios(t,"Disconnect and pause checks","Delete checks and remove any activity data",function(){var t=cc.buildAjaxData(!0);t.set("ChecksPageIgnore",!0);t.set("Count",n.length);t.set("CheckIDs",n.join());cc.ajax.run("Integrations/IgnoreJob",t,"Failed to ignore, please try again.",function(){window.location.reload()})})},reprocessChecks:function(n){typeof n=="string"&&(n=[n]);var t=`Reprocess recent activities matched to these checks? This will update the status of any activities matched to these checks using the current status rules for each check.`;bfs.dialog.confirmWarning(t,function(){var t=cc.buildAjaxData(!0);t.set("ChecksPageReprocess",!0);t.set("CheckCount",n.length);t.set("CheckIDs",n.join());cc.ajax.run("Checks/ReprocessActivities",t,"Failed to reprocess activities, please try again.",function(){window.location.reload()})})},deleteGroup:function(n){if(!notDefined(n)){var t=this;bfs.dialog.confirmDelete(bfs.lang("deleteGroupPromptStart")+" '"+n.name+"'?",function(){bfs.loading.show();var i=cc.buildAjaxData(!0);i.set("GroupID",n.id);cc.ajax.run("CheckGroups/Delete",i,bfs.lang("errorMessage"),function(i){i.success=="true"&&(t.groupsData=t.groupsData.filter(function(t){return t.id!==n.id}));bfs.loading.hide()})})}}}};cc.vueMixins.ignoreRules={methods:{deleteActivity:function(n){this.rawValues=this.rawValues.filter(function(t){return t.id!=n})},deleteRule:function(n){for(var r=this,i=-1,t=0;t<this.items.length;t++)if(this.items[t]._id===n){i=t;break}return i<0?(bfs.dialog.showError(bfs.lang("invalidItem")),!1):bfs.dialog.confirmDelete("Delete this ignore rule?",function(){data={ruleID:n};bfs.loading.show();cc.ajax.postJSON("IgnoreRules/Delete",data,bfs.lang("failedDelete"),function(){window.location.reload()})})},testRules:function(n){bfs.loading.show();var t={};return t.rules=n?[this.currentItem]:this.items,cc.ajax.postJSON("IgnoreRules/Test",t,bfs.lang("errorMessage"),function(n){bfs.dialog.showDialog("dialogTestRules","",n.data);bfs.loading.hide()}),!1}}};cc.vueMixins.reports={data:{showReportTimezone:!0},methods:{toggleTimezoneDisplay:function(n){notDefined(n)&&(n=!this.showReportTimezone);this.showReportTimezone=n},findReportIndices:function(n,t,i,r){var f=[],u,e;for(typeof n=="string"&&(n=[n]),u=0;u<this.rawValues.length;u++)if(n.indexOf(this.rawValues[u].id)>-1&&(e=this.rawValues[u],(r||e.loadingStates[t]!==!0)&&f.push(u),i&&Vue.set(e.loadingStates,t,i)),f.length===n.length)break;return f},applyBulkAction:function(){var n=this.checkedIds,r,t,u,i;if(!n||n.length===0){bfs.dialog.showError(bfs.lang("noItems"));return}if(r=$(this.$el).find("select[id^=cboBulkActions]"),t=r.val(),!t){bfs.dialog.showError(bfs.lang("noActions"));return}u=t+" "+n.length+" "+(n.length>1?bfs.lang("reports"):bfs.lang("report"))+"?";i=this;bfs.dialog.confirm(u,function(){var u,f;for(t=t.toLowerCase(),u=cc.buildAjaxData(!0),u.set("ReportCount",n.length),f=0;f<n.length;f++)u.set("ReportID"+f,n[f]);var r="",e=t,o=!1,s=!0;switch(t){case"download":i.download(n);return;case"delete":r="Reports/Delete";o=!0;s=!1;break;case"pause":r="Reports/Pause";u.set("SetPaused",1);break;case"resume":r="Reports/Pause";u.set("SetPaused",0);e="pause";break;case"send":r="Reports/Send";break;default:bfs.dialog.showError(bfs.lang("noActions"))}r&&r.length>0&&i.doReportAction(n,e,!0,function(t,i){cc.ajax.run(r,u,bfs.lang("failedUpdate"),function(r){if(s){if(notDefined(r.reports))return;
27r.reports.forEach(function(r){var f=n.indexOf(r.id),u=i[f];notDefined(u)||Vue.set(t.rawValues,u,r)})}else o&&(t.rawValues=t.rawValues.filter(function(n,t){return i.indexOf(t)<0}))})})})},deleteReport:function(n){this.doReportAction(n,"delete",!1,function(t,i,r){bfs.dialog.confirmDelete(bfs.lang("Delete")+" '"+i.name+"'?",function(){Vue.set(i.loadingStates,"delete",!0);var u={OrganizationID:cc.organizationID,ReportID:n};cc.ajax.run("Reports/Delete",u,bfs.lang("failedDelete"),function(n){n.success=="true"?(t.rawValues.splice(r,1),bfs.toast.showSuccess(bfs.lang("itemDeleted"))):bfs.toast.showError(bfs.lang("failedDelete"))})})})},download:function(n){if(notDefined(n)){bfs.dialog.showError(bfs.lang("invalidItem"));return}var t=$("#frmReportDownload");t.find("#ReportIDs").val(n);t.submit()},pause:function(n,t){this.doReportAction(n,"pause",!1,function(i,r,u){var f=t?bfs.lang("Pause"):bfs.lang("Resume");bfs.dialog.confirm(f+" "+bfs.lang("autoDelivery"),function(){Vue.set(r.loadingStates,"pause",!0);var f={OrganizationID:cc.organizationID,ReportID:n,SetPaused:t};cc.ajax.run("Reports/Pause",f,bfs.lang("failedUpdateReport"),function(n){n.reports&&n.reports.length>0&&Vue.set(i.rawValues,u,n.reports[0])})})})},send:function(n){this.doReportAction(n,"send",!1,function(t,i,r){cc.reports.send(n,i.targetCount,function(n){n.reports&&n.reports.length>0&&Vue.set(t.rawValues,r,n.reports[0]);n.success=="true"&&bfs.toast.showSuccess(bfs.lang("reportSent"))},function(){Vue.set(i.loadingStates,"send",!0)})})},doReportAction:function(n,t,i,r){var u=this.findReportIndices(n,t,i),f,e;u.length<1?bfs.dialog.showError(bfs.lang("noItems")):typeof n=="string"?(f=u[0],e=this.rawValues[f],r(this,e,f)):r(this,u)}}};cc.vueMixins.checkRow={methods:{toggleChecked:function(){this.check&&this.$root.checkChanged(!this.check.isChecked,this.check.groupId,this.check.label,this.check.id)}}};cc.vueMixins.groupSimple={computed:{},methods:{toggleCollapse:function(n){n.isCollapsed=!n.isCollapsed},show:function(n){this.setChecks(n);bfs.dialog.showDialog("dlgViewCheckListVue")},setChecks:function(n){var i=this.checks.reduce(function(t,i){return notDefined(t[i.groupId])&&(t[i.groupId]=[]),n&&n(i)&&t[i.groupId].push(i),t},{}),t=[];this.groupsData.forEach(function(n){var r=i[n.id];r&&r.length&&t.push(Object.assign({},n,{checks:r,isCollapsed:!1}))});this.groups=t}}};cc.vueMixins.groupSection={computed:{}};cc.vueMixins.labelSection={computed:{isChecked:function(){return!this.items||this.items.length===0?!1:this.items.every(function(n){return n.isChecked})},isIndeterminate:function(){return!this.items||this.items.length===0?!1:this.isChecked?!1:this.items.some(function(n){return n.isChecked})}},methods:{toggleChecked:function(){this.label&&this.$root.checkChanged(!this.isChecked,this.label.parentId,this.label.name)}}};cc.vueMixins.groupTable={computed:{labels:function(){function f(n){u.push({name:t,parentId:e,items:i});t=n;i=[]}for(var n,u=[],e=this.group.id,t="",i=[],r=0;r<this.items.length;r++)n=this.items[r],n.label!==t&&f(n.label),i.push(n);return f(""),u},isChecked:function(){return!this.items||this.items.length===0?!1:this.items.every(function(n){return n.isChecked})},isIndeterminate:function(){return!this.items||this.items.length===0?!1:this.isChecked?!1:this.items.some(function(n){return n.isChecked})}},methods:{deleteGroup:function(){this.group&&this.$root.deleteGroup(this.group)},toggleChecked:function(){this.group&&this.$root.checkChanged(!this.isChecked,this.group.id)},toggleCollapse:function(n){n.isCollapsed=!n.isCollapsed;var t=cc.buildAjaxData(!0);t.set("GroupID",n.id);t.set("Collapse",n.isCollapsed);cc.ajax.run("Groups/SetCollapseState",t)},toggleAll:function(n){setCollapse=!n.isCollapsed;this.$root.$emit("toggle-all",setCollapse)}}};cc.vueMixins.integrationActions={data:{},computed:{integration:function(){return this.rawValues.length>0?this.rawValues[0]:null}},methods:{findIntegration:function(n){for(var t=0;t<this.rawValues.length;t++)if(this.rawValues[t].id===n)return this.rawValues[t];return null},removeIntegration:function(n){this.rawValues=this.rawValues.filter(function(t){return t.id!==n})},updateIntegration:function(n){var t=n.integration,i=n.rowUpdates;this.rawValues=this.rawValues.map(function(n){return n.id===t.id?t:n});
27i&&i.forEach(function(n){$(n.selector).replaceWith(n.value)});n.loadPreview&&loadPreview(t.id)},deleteIntegration:function(n,t){var i=this.findIntegration(t);notDefined(i)||(i.type==="push"?bfs.dialog.confirmDeleteWithCheckbox(bfs.lang("deletePrompt"),"Remove CheckCentral data from External Provider",n):i.type==="brightgauge"?bfs.dialog.confirmDelete(bfs.lang("deletePrompt"),function(){bfs.loading.show();window.location.href=n},function(){},""):bfs.dialog.confirmDeleteWithRadios(bfs.lang("deletePrompt"),"Pause any checks created by this direct integration","Delete any checks created by this direct integration",n))},pauseIntegration:function(n,t,i){var r=this.findIntegration(t),u,f;notDefined(r)||(u="resumePrompt",n&&(u="pausePrompt"),f=this,bfs.dialog.confirm(bfs.lang(u),function(){var u={IntegrationID:t,SetPaused:n,SendUpdates:i};Vue.set(r.loadingStates,"pause",!0);cc.ajax.run("Integrations/Update",u,bfs.lang("error"),function(n){f.updateIntegration(n)},function(){Vue.set(r.loadingStates,"pause",!1)})}))},deleteCheck:function(n){var t=this;bfs.dialog.confirmDelete(bfs.lang("confirmDeleteCheck"),function(){var i={CheckID:n,SendConfirm:1};bfs.loading.show();cc.ajax.run("Checks/Delete",i,bfs.lang("failedDelete"),function(i){bfs.loading.hide();i.success&&(t.rawValues=t.rawValues.filter(function(t){return t.id!==n}),bfs.toast.showSuccess(bfs.lang("checkDeleted")))})})},refreshValues:function(n){var t=this.findIntegration(n),i,r;notDefined(t)||(i=this,r={IntegrationID:n,RequestUpdate:!1,SendUpdates:!0},Vue.set(t.loadingStates,"update",!0),cc.ajax.run("Integrations/Update",r,bfs.lang("error"),function(n){i.updateIntegration(n)},function(){Vue.set(t.loadingStates,"update",!1)}))},requestUpdate:function(n,t){var i=this.findIntegration(n),r;notDefined(i)||(r=this,bfs.dialog.confirm(bfs.lang("updatePrompt"),function(){var u={IntegrationID:n,RequestUpdate:1,SendUpdates:t};Vue.set(i.loadingStates,"update",!0);cc.ajax.run("Integrations/Update",u,bfs.lang("error"),function(n){r.updateIntegration(n);n.success=="true"&&bfs.toast.showSuccess(bfs.lang("updateQueued"))},function(){Vue.set(i.loadingStates,"update",!1)})}))}}};cc.vueMixins.integrationJobs={data:{isBulkSelecting:!1,matchedCount:null},computed:{isIgnoreTable:function(){return this.dataKey==="ignoredJobs"},hasChecked:function(){return this.checkedIds.length>0},actionLabel:function(){return this.isBulkSelecting?"Cancel Selection":this.isIgnoreTable?"Unignore Multiple":"Ignore Multiple"},actionTooltip:function(){return this.isBulkSelecting?"Click to disable multi-selection.":"Click to enable multi-selection."}},methods:{toggleBulkSelecting:function(){this.isBulkSelecting=!this.isBulkSelecting},toggleChecked:function(n){this.checkboxChanged(!n.isChecked,null,n.id)},loadMatching:function(n,t,i){var r=this;this.isLoading=!0;cc.ajax.run("Integrations/PreviewMatching",n,t,function(n){r.updateData(n.jobs,n.matchedCount);i&&typeof i=="function"&&i(n)},function(n){r.errorMessage=n.error});bfs.DirectIntegrationManagement&&bfs.DirectIntegrationManagement.refreshValues(n.IntegrationID)},updateData:function(n,t){this.isLoading=!1;this.rawValues=n||[];this.valueCap=this.rawValues.length;this.matchedCount=t||0;this.sortValues("status",!0)},findJob:function(n){for(var t=0;t<this.rawValues.length;t++)if(this.rawValues[t].id===n)return this.rawValues[t];return null},buildStopIgnoringPrompt:function(n){return`Unignore ${n}?<br/>CheckCentral will attempt to reconnect any previously disconnected checks for ${n} and will create new checks as needed based on your check definitions.`},ignoreJob:function(n){var t=this.findJob(n);notDefined(t)||this.ignoreWorker(t.integrationId,t.hasCheck,[t],!t.isIgnored)},ignoreSelected:function(n){if(this.hasChecked){var i=this.checkedIds,r=!this.isIgnoreTable,t=this.valuesDisplay.filter(function(n){return i.indexOf(n.id)>-1}),u=!this.isIgnoreTable&&t.some(function(n){return n.hasCheck});this.ignoreWorker(n,u,t,r)}},ignoreWorker:function(n,t,i,r){var h=i.length>1,u="",f="";h?(u=bfs.lang("jobNamePlural")||"items",f="these "+u):(u=bfs.lang("jobName")||"item",f="this "+u);var e=`Ignore ${f}?<br/>This will prevent the selected ${u} from being matched by any check definitions.`,s=this,o=function(){s.ignoreCallback(n,t,i,r)};r?t?(e+=`<br/><br/>CheckCentral has already created checks for ${f}:`,bfs.dialog.confirmWarningWithRadios(e,"Disconnect and pause any connected checks","Delete any connected checks and remove any activity data",o)):bfs.dialog.confirmWarning(e,o):bfs.dialog.confirmWarning(s.buildStopIgnoringPrompt(f),o)},ignoreCallback:function(n,t,i,r){var f=this.isBulkSelecting;bfs.loading.hide();
27var e=$("input[name=radfrmbfDialogMessageConfirmWarningWithRadiosOptionRadio]:checked").val(),o=i.map(function(n){return n.jobId}),s={IntegrationID:n,SetIgnored:r,JobIDs:JSON.stringify(o),HasCheck:t,DeleteCheck:e==="OptionB"},u=this;i.forEach(function(n){n.isLoading=!0});this.isBulkSelecting=!1;cc.ajax.run("Integrations/IgnoreJob",s,"Failed to update. Please try again.",function(){var n=i.map(function(n){return n.id});u.rawValues=u.rawValues.filter(function(t){return n.indexOf(t.id)<0});i.forEach(function(n){n.isIgnored=r;n.isLoading=!1});u.valueCap--;u.isBulkSelecting=f;r?bfPagers.ignoredJobs&&(bfPagers.ignoredJobs.rawValues=bfPagers.ignoredJobs.rawValues.concat(i),bfPagers.ignoredJobs.valueCap++):bfPagers.jobs&&(bfPagers.jobs.rawValues=bfPagers.jobs.rawValues.concat(i),bfPagers.jobs.valueCap++)},function(n){i.forEach(function(n){n.isLoading=!1});u.isBulkSelecting=f;n.error&&bfs.dialog.showError(n.error)})}}};cc.vueMixins.channelIcons={computed:{hasIconsForGroup:function(){return!0}},methods:{iconsForGroup:function(n,t){var i=cc[t+"_icons"];if(!notDefined(i))return i.filter(function(i){return n[t].indexOf(i.id)>-1})}}};cc.vueMixins.usersPage={methods:{deleteUser:function(n){if(!notDefined(n)){var t=cc.buildAjaxData(!0);t.set("UserID",n.id);cc.ajax.run("Users/GetDeleteUserConfirm",t,bfs.lang("errorMessage"),function(t){var i=t.content||'<span class="Warning">Error loading user information.<\/span>';bfs.dialog.confirmDelete(i,{href:"?DeleteUserID="+n.id})})}},updateBillingEmails:function(n){var t=cc.buildAjaxData(!0),i;t.set("UserID",n.id);t.set("IsBillingContact",!n.sendBillingEmails);i="Enable delivery of billing notifications and invoices to this user?";n.sendBillingEmails&&(i="Disable delivery of billing notifications and invoices to this user?");bfs.dialog.confirm(i,function(){n.updatingBillingEmails=!0;cc.ajax.run("Users/UpdateBillingContact",t,bfs.lang("errorMessage"),function(){n.sendBillingEmails=!n.sendBillingEmails;n.updatingBillingEmails=!1},function(){n.updatingBillingEmails=!1})})}}};cc.vueMixins.definitionSummaryTable={data:{isLoading:!0,title:""},computed:{usesLabel:function(){return this.rawValues.filter(function(n){return n.label.length>0}).length>0}},methods:{updateData:function(n){this.title=n.title;this.rawValues=n.checks;this.valueCap=n.checks.length}}};cc.vueMixins.definitionSummary={data:{isLoading:!0,needsSubUpdate:!1,oldSubUnits:0,newSubUnits:0,warning:""},computed:{createdChecks:function(){return this.countWorker("createdChecks")},updatedChecks:function(){return this.countWorker("updatedChecks")},unchangedChecks:function(){return this.countWorker("unchangedChecks")},disconnectedChecks:function(){return this.countWorker("disconnectedChecks")},reconnectedChecks:function(){return this.countWorker("reconnectedChecks")}},methods:{countWorker:function(n){return window.bfPagers[n]?window.bfPagers[n].rawValues.length:0},loadSummary:function(n){this.isLoading=!0;cc.checkForm.appendFormRowNumbers(n,"#hidSaveCheckRowCount");cc.integrationForm!==undefined&&cc.integrationForm.processFormSubmit();var i=new FormData(n[0]),t=this;cc.ajax.run("Integrations/DefinitionSummary",i,"Failed to load definition summary. Please try again.",function(n){var r,i;if(t.isLoading=!1,t.warning=n.warning,t.needsSubUpdate=n.needsSubUpdate||!1,t.oldSubUnits=n.oldSubUnits||t.oldSubUnits,t.newSubUnits=n.newSubUnits||t.newSubUnits,n.results)for(r of n.results)i=bfPagers[r.key],i&&i.updateData&&i.updateData(r)})}}};cc.vueMixins.templateTable={methods:{showChecksListDialog:function(n,t){bfs.checkList.show(t)},showApplyChecksDialog:function(n){cc.checkTemplates.getTemplateCheckDialog(n,!1)}}};cc.vueMixins.integrationHistory={methods:{loadDetail:function(n,t,i){var r={IntegrationID:t,LogID:i};bfs.loading.show();cc.ajax.run("Integrations/ViewDataHistory",r,"Failed to load history entry.",function(t){bfs.loading.hide();var i=$("#"+n);bfs.dialog.showDialog(n);ace.edit(i.find(".ace_editor").attr("id")).setValue(t.data)})}}};window.Vue&&(Vue.component("group-section",{props:["group","items","level","columnCount"],template:"#group-section-template",mixins:[cc.vueMixins.groupSection]}),Vue.component("group-section-simple",{props:["group"],template:"#group-section-simple-template",mixins:[cc.vueMixins.groupSimple]}),Vue.component("check-row-simple",{props:["check"],template:"#check-row-simple-template"}),Vue.component("label-section",{props:["label","items","level","columnCount"],template:"#label-section-template",mixins:[cc.vueMixins.labelSection]}),Vue.component("check-row",{props:["check","level"],template:"#check-row-template",mixins:[cc.vueMixins.checkRow],methods:{deleteCheck:function(){this.$root.deleteChecks(this.check.id)},setStatus:function(n){var t=cc.buildAjaxData(!0);t.set("CheckID",n);cc.checkStatusOverride.setStatus(t,null,this.$root.updateData)},togglePaused:function(n){if(n&&!n.isLoading){n.isLoading=!0;var t=n.status!=="paused",i=this.$root.updateData;cc.checkStatusOverride.setPaused(n.id,t,i,!0)}}}}),Vue.component("check-row-simple",{props:["check"],template:"#check-row-simple-template",methods:{}}),Vue.component("issue-row",{props:["check","level"],template:"#issue-row-template",mixins:[cc.vueMixins.checkRow],methods:{deleteCheck:function(){this.$root.deleteChecks(this.check.id)},setStatus:function(n){var t=cc.buildAjaxData(!0);t.set("CheckID",n);cc.checkStatusOverride.setStatus(t,null,this.$root.updateData)},togglePaused:function(n){if(n&&!n.isLoading){n.isLoading=!0;var t=n.status!=="paused",i=this.$root.updateData;cc.checkStatusOverride.setPaused(n.id,t,i,!0)}}}}),Vue.component("status-dot",{props:["activity","check","preventView","listId"],template:"#status-dot-template",computed:{act:function(){return this.activity?.hasOwnProperty("id")?this.activity:!this.activity&&this.check?{id:this.check.actId,icon:this.check.icon,status:this.check.status,tooltip:this.check.tooltip}:{id:bfs.emptyGuid,icon:"",status:"empty",tooltip:"no activity"}},tooltip:function(){return this.act.tooltip},iconStyle:function(){return this.act.icon?{backgroundImage:"url("+bfs.urls.iconOverlayBaseUrl+this.act.icon+")"}:{}},iconClass:function(){var n=this.act.status.toLowerCase();return this.act.hasNote&&(n+=" WithNote"),this.act.hasActivityExtractedData&&(n+=" WithActivityExtractedData"),n},url:function(){return notDefined(this.act.id)||this.act.id==bfs.emptyGuid?this.check?bfs.urls.actBaseUrlEmpty+this.check.id:null:bfs.urls.actBaseUrl+this.act.id},activityId:function(){return this.act.id}},methods:{viewMessage:function(){if(!this.preventView){var n=this.act.id,i=this.listId,t=this.check?.id,r=this.check?.name;(t||n!=bfs.emptyGuid)&&cc.viewMessage.view(n,i,!1,t,r)}}}}),Vue.component("group-table",{props:["group","items"],template:"#group-table-template",mixins:[cc.vueMixins.groupTable],computed:{generatedActivity:function(){for(var t,n="Success",i=0;i<this.items.length;i++)if(t=this.items[i],!notDefined(t)){if(t.status=="failure"){n="Failure";break}t.status=="warning"&&(n="Warning")}return{id:null,tooltip:bfs.lang(n),icon:"",status:n.toLowerCase()}}}}),Vue.component("condition-row",{props:["value","index"],template:"#condition-row-template",computed:{isAttachment:function(){return notDefined(this.value)?!1:this.value.message_field.toLowerCase().indexOf("attach")>=0},usesValue:function(){for(var t,n=0;n<this.matchOptions.length;n++)if(t=this.matchOptions[n],t.text===this.value.matches)return t.usesValue;return!0},textQuery:function(){return this.value.matches.toLowerCase().indexOf("complex")>=0},regex:function(){return this.value.matches.toLowerCase().indexOf("regex")>=0},matchOptions:function(){return this.isAttachment?cc.attachmentMatches:cc.regularMatches}},methods:{remove:function(){this.$emit("remove",this.index)}},watch:{condition:function(){this.$emit("input",this.value)}}}));cc.wizard=function(n){var r="",i=!1,t=0,e=null,u=null,o=null,s=null,h="input, select, textarea, sl-input, sl-textarea",c=null,v=[],nt=function(u,f,e,o){t=n(window.location.hash).index(".WizardStep");e&&(t=e);ot();r=u||"";c=o;r&&!r.startsWith("#")&&(r="#"+r);var s=n(r);s.get(0).addEventListener("invalid",tt,!0);s.on("focus",h,l);s.on("select2:opening",l);s.on("select2:focus",l);s.on("submit",function(){bfs.loading.show()});s.on("keydown",function(t){if(t.keyCode==13){var i=n(t.target);i.is("textarea")||i.is("sl-textarea")||i.hasClass("ControlButton")||t.preventDefault()}});n(".WizardReadMore").on("focus, click","[data-bf-helptext]",it);i=!(f||!1);w();n("#ScrollToTop").css("bottom",n(".WizardNavButtons").height()+18)},y=function(){var f=n(".WizardStep"),e,s,h;if(f.length!==0){for(t<0?t=0:t>
27=f.length&&(t=f.length-1),e=f.eq(t);e.hasClass("skip");){if(t++,t>=f.length)break;e=f.eq(t)}s=u.eq(t);h=o.eq(t);o.addClass("hide");u.removeClass("active");s.addClass("active");p(s);var c=!i&&t>0,l=!i&&t<f.length-1,a=i||t===f.length-1;n(".WizardPrevButton").toggle(c);n(".WizardNextButton").toggle(l);n(".WizardSubmit").toggle(a);n(".WizardExtraButton").each(function(r,u){var f=n(u),e=f.data("bf-step-show");f.toggle(i&&e>0||e==t)});i?(f.removeClass("hide"),n(".ToggleAdvancedMode").text(bfs.lang("switchWizard","Switch to Wizard")),n(r).addClass("WizardAdvanced")):(n(r).removeClass("WizardAdvanced"),f.addClass("hide"),e.removeClass("hide"),h.removeClass("hide"),n(".ToggleAdvancedMode").text(bfs.lang("switchAdvanced","Switch to Advanced Mode")),e.find("input:not([type=radio]):visible, input[type=radio]:checked:visible, select:visible").change(),n.each(v,function(n,i){i&&typeof i=="function"&&i(t,f.length)}))}},tt=function(t){var i=n(t.target).closest(".WizardStep").data("bf-wizard-step-index");a(parseInt(i,10))},l=function(t){n(r).find(".selectedHelpText").removeClass("selectedHelpText");var i=n(t.target).closest(".row");i.length===0&&(i=n(t.target).closest('[class^="BFHelp-"]'));n.each(i.prop("classList"),function(t,i){i.startsWith("BFHelp")&&($helpText=n("."+i+"-HelpText").addClass("selectedHelpText"))})},it=function(t){var u=n(t.target).closest("[data-bf-helptext]"),f,i;n(r).find(".selectedHelpText").removeClass("selectedHelpText");u.addClass("selectedHelpText");f=u.data("bf-helptext");i=n("."+f).find(h).first();i.length>0&&(i.hasClass("select2-hidden-accessible")?i.select2("focus"):i.focus())},p=function(t){if(t.length>0){var i=t.index()+1,r=t.siblings().length+1,u=100*i/r;n("#WizardProgress").css("width",u+"%")}},a=function(i){var r;t=i&&i.preventDefault?n(this).data("bf-wizard-step-index")||0:i||0;y();var f=n("#PageTitle"),e=n(".WizardStep:visible"),o=n(".WizardNavContainer"),u=e.offset();u&&u.top&&(r=f.offset().top+o.outerHeight(),n(window).scrollTop()>r&&window.scroll(0,r))},w=function(r){var h,c,e;r&&r.preventDefault();i=!i;var l=n(".WizardNavContainer").outerHeight()||0,o=n(".WizardStep:visible"),s=o.first();if(t>0&&t<o.length&&(s=o.eq(t)),h=0,cc.updateQueryStringParam("Advanced",i?1:null),c=n(".HasMore"),c.has(".SnippetAdvanced").find(".collapse").toggleClass("show",!i),c.has(".SnippetWizard").find(".collapse").toggleClass("show",!1),n(".StartExpand").addClass("show"),i){u&&u.off("click",f);n(window).on("activate.bs.scrollspy",ut)}else{if(u)u.on("click",f);bootstrap&&bootstrap.ScrollSpy&&(e=bootstrap.ScrollSpy.getInstance(document.body),e&&e.dispose&&e.dispose());n(window).off("activate.bs.scrollspy")}y();i&&(bootstrap&&bootstrap.ScrollSpy&&(e=bootstrap.ScrollSpy.getOrCreateInstance(document.body,{target:".WizardNav",offset:l+40})),s.offset()&&(h=s.offset().top-l));window.scroll(0,h)},rt=function(n){var t=n.params.args.data.id,r=function(){bfs.loading.show();var n="Copy="+t+"&Advanced="+(i?1:0);window.location.search=n};t.length>0?(n.preventDefault(),s.select2("close"),bfs.dialog.confirm("This will reset any modifications you have made. Continue?",r)):r()},ut=function(){var i=n(".nav .nav-link.active"),t,r;p(i);t=i.attr("href")||"";window.history.replaceState?(r=window.location.href,window.history.replaceState({},"",r.replace(window.location.hash,"")+t)):window.location.hash=t},f=function(n){n.preventDefault()},b=function(){var i=n(r),u=i.find(h).filter(":visible"),t=!0;return u.each(function(n,i){if(!i.reportValidity())return t=!1,!1}),t&&c&&(t=c()),t},k=function(r){return(r&&r.preventDefault&&r.preventDefault(),i)?!1:(b()&&g(function(){t=Math.min(n(".WizardStep").length-1,t+1)}),!1)},d=function(n){return(n&&n.preventDefault&&n.preventDefault(),i)?!1:(g(function(){t=Math.max(0,t-1)}),!1)},g=function(n){do n();while(u.eq(t).hasClass("skip"));u.get(t).click()},ft=function(n){v.push(n)},et=function(){return n(r)},ot=function(){n("body").css("position","relative");o=n(".WizardHelp");e=n(".WizardNav");e.on("click","a",a);u=e.find(".nav-link");n(".WizardPrevButton").on("click",d);n(".WizardNextButton").on("click",k);n(".ToggleAdvancedMode").on("click",w);s=n("#ddlSaveCheckCheckCopyID");s.on("select2:selecting",rt);if(i)u.off("click",f);else u.on("click",f)};return{init:function(){},addStepChangeCallback:ft,isValid:b,next:k,prev:d,jump:a,configure:nt,getForm:et}}(jQuery);cc.ajax=function(n){var i=function(t){return t.length===0?{error:bfs.lang("errorMessage")}:typeof t=="object"?t:n.parseJSON(t)||t},t=function(t,r,u,f,e,o,s,h){o||(r instanceof FormData?r.append("OrganizationID",cc.organizationID):typeof r=="string"?r.indexOf("OrganizationID")<0&&(r+="&OrganizationID="+cc.organizationID):typeof r=="object"&&notDefined(r.OrganizationID)&&(r.OrganizationID=cc.organizationID));s=s?"?"+new URLSearchParams(s).toString():"";let c=!1;bfs.util.navigateHook(function(){c=!0});var l={type:"POST",url:"/Ajax/"+t+"/"+s,data:r,cache:!1,success:function(r,u){var o,s;
27try{console.log("Ajax response ["+t+"]: "+r.length.toLocaleString()+" bytes, status: "+u)}catch(c){console.error(c)}if(o=i(r),o.error){e?e(o):bfs.dialog.showError(o.error);h||(bfs.loading.hide(),n(".DialogLoading").hide());return}if(o.redirect){bfs.loading.show();window.location.replace(o.redirect);return}if(o.reload){bfs.loading.show();o.clearSearch==="true"&&window.location.search?window.location.search="":window.location.reload();return}o.onResponse&&(s=window[o.onResponse],typeof s=="function"&&s(o));o.toast&&bfs.toast.showType(o.toast,o.toastType);f&&f(o)},error:function(){h||bfs.loading.hide();e?e({error:u,cancelled:c}):c||bfs.dialog.showError(u)}};return r instanceof FormData&&(l.processData=!1,l.contentType=!1),l},r=function(i,r,u,f,e,o,s){return n.ajax(t(i,r,u,f,e,!1,o,s))},u=function(i,r,u,f,e,o){var s=t(i,JSON.stringify(r),u,f,e,!0,o);s.contentType="application/json";s.headers={"X-CC-OrgID":cc.organizationID};n.ajax(s)};return{run:r,postJSON:u}}(jQuery);cc.checkStatusOverride=function(n){var i=function(){window.location.reload()},t=null,r=function(r,u,f){var e=n("#frmSetCheckStatus");t=f||i;e.data("bf-submitdata",new URLSearchParams(r).toString());u&&e.find("select").val(u);bfs.dialog.showDialog("dlgSetCheckStatus")},u=function(n,t,i,r){var f=t?"1":"0",u=cc.buildAjaxData(r);u.set("CheckID",n);u.set("SetPaused",f);cc.ajax.run("Checks/Pause",u,bfs.lang("failedUpdateStatus"),i)},f=function(n,t,i){var u=i?"1":"0",r;n.set("SetPaused",u);r=bfs.lang("setSelected")+"&nbsp;";r+=i?bfs.lang("paused"):bfs.lang("resumed");r+="?";bfs.dialog.confirm(r,function(){vueGroups.groupsDisplay.forEach(function(n){n.items.forEach(function(n){t.indexOf(n.id)>-1&&(n.isLoading=!0)})});cc.ajax.run("Checks/Pause",n,bfs.lang("failedUpdateStatus"),function(n){window.vueGroups.updateData(n)})},function(){},"Set Status")},e=function(t){t.preventDefault();var i=cc.buildAjaxData(!1);i.set("CheckID",n(this).data("bf-checkid"));r(i)},o=function(r){var f,o;r.preventDefault();var u=n(this),e=new FormData(u[0]),s=new URLSearchParams(u.data("bf-submitdata"));for(f of s)e.set(f[0],f[1]);o=t||i;cc.ajax.run("Checks/SetStatus",e,bfs.lang("errorMessage"),function(n){o(n);bfs.loading.hide();u.find("textarea, sl-textarea").val("");u.find("select").val(0).change().trigger("select2:select")});bfs.dialog.closeWrappingDialog(u);t=null},s=function(){n(document).on("click","a.SetCheckStatus",e);n("#frmSetCheckStatus").on("submit",o)};return{init:s,setStatus:r,setPaused:u,setPausedBulk:f}}(jQuery);cc.viewMessage=function(n){var t="dialogViewMessageContainer",l=function(t){if(t.ctrlKey!==!0){t.preventDefault();var i=n(this),u=i.data("bf-activityid"),f=i.data("bf-activitylistid"),e=i.data("bf-checkid")||"",o=i.data("bf-checkname")||"",s=i.data("bf-isignored"),h=i.data("bf-orgid");r(u,f,s,e,o,h)}},i=function(){bfs.dialog.showLoading(t);var i=n("#dialogViewMessageContainer h2.TableTitle").first();i.find(".TitleButtons").html("")},r=function(r,f,e,s,c,l){var a,d,v,y,p,g;if(!notDefined(r)){notDefined(l)&&(l=cc.organizationID);var w=o(f),b=w.indexOf(r),k=b<w.length-1,nt=b>0;if(cc.filterLoading&&cc.filterLoading.hasMore()&&(k=!0),r===bfs.emptyGuid&&(notDefined(s)||s==bfs.emptyGuid)){bfs.dialog.showMessage("No Activity Found","No Activity");return}a={ActivityID:r,ActivityListID:f,CheckID:s,CheckName:c,OrganizationID:l};a.DarkMode=n(document.body).data("theme")==="dark";d=a.DarkMode?1:0;e&&(a.IsIgnored=1);k&&(a.HasOlderID=1);nt&&(a.HasNewerID=1);window.innerHeight<1200&&(a.CollapseHeaders=1);v=n("#dialogViewMessageContainer");y=v.find("#ViewMessageHeaders");y.length===0&&(y=n('<div id="ViewMessageHeaders"><\/div>'));p=v.find("#ViewMessageBody");p.length===0&&(p=n('<div id="ViewMessageBody"><\/div>'));v.is(":visible")?i():bfs.dialog.showDialog(t,bfs.lang("ViewMessage"),bfs.lang("Loading"),i);g={DarkMode:d};cc.ajax.run("Messages/View",a,bfs.lang("errorMessage"),function(i){var o=n("#MessageForwardActivityID"),f,e;o.val(r);y.html(i.headers);p.html(i.message);h(i.parsedText,i.complexTestUrl);f=n(document.createElement("div")).append(y).append(p);e=v.find("h2.TableTitle").first();$buttons=e.find(".TitleButtons");$buttons.length===0&&($buttons=n('<div class="TitleButtons"><\/div>'),$buttons.insertBefore(".bfDialogCloseJS"));$buttons.html(i.titleButtons);bfs.dialog.setTitle(t,i.title);bfs.dialog.setContent(t,f.html(),!0);u()},function(){bfs.dialog.showFade();bfs.dialog.closeDialog(t);bfs.dialog.showError(bfs.lang("errorMessage"))},g)}},u=function(){var t=n("#dialogViewMessageContainer"),i,r;t&&(i=t.find(".TableTitleDialog"),i)&&(r=t.find("#ViewMessageHeaders"),r)&&t.find(".bfDialogInnerJS").css("max-height","80vh")},a=function(t){t.preventDefault();var i=this,r=n(this),u=new FormData(i);cc.ajax.run("Messages/Forward",new FormData(i),bfs.lang("errorMessage"),function(t){t.failed?bfs.toast.showError(t.message):bfs.toast.showSuccess(t.message);i.reset();bfs.dialog.closeWrappingDialog(n("#MessageForwardActivityID"));bfs.loading.hide()})},v=function(t){var r;t.preventDefault();var i=this,u=new FormData(i),f=new URLSearchParams(n(i).data("bf-submitdata"));for(r of f)u.set(r[0],r[1]);bfs.loading.show();
27cc.ajax.run("Messages/AddNote",u,bfs.lang("errorMessage"),function(t){var u,f,e,r;if(t.activityId&&(u=n('[data-bf-activityid="'+t.activityId+'"].StatusIcon, [data-bf-activityid="'+t.activityId+'"] .StatusIcon'),u.addClass("WithNote"),t.activityTooltip&&(f=n("<div/>").html(u.attr("helpbuttondata")),e=f.find(".NoteTooltip"),e.length==0&&(e=n('<div class="NoteTooltip"><\/div>').appendTo(f)),window.vueDash?window.vueDash.updateActivityNotes(t):(e.html(t.activityTooltip),u.attr("helpbuttondata",f.html())))),t.tableHtml!==undefined)if(r=n(".ActivityNotesSubHeader"),r.removeClass("d-none"),r.hasClass("IsCollapsed")&&r.click(),t.noteId){let i=n('[name=activity-note-entry][data-bf-noteid="'+t.noteId+'"]').closest(".row");n(t.tableHtml).find(".row").insertAfter(i);i.remove()}else n(t.tableHtml).find(".row").insertAfter(r);i.reset();bfs.dialog.closeDialog("dlgAddActivityNote");bfs.loading.hide();t.noteId?bfs.toast.showSuccess("Note edited!"):bfs.toast.showSuccess("Note added!")})},y=function(t){if(t.noteId&&n('[name=activity-note-entry][data-bf-noteid="'+t.
27noteId+'"]').closest(".row").remove(),t.activityId){var i=n('[data-bf-activityid="'+t.activityId+'"].StatusIcon, [data-bf-activityid="'+t.activityId+'"] .StatusIcon'),r=n("<div/>").html(i.attr("helpbuttondata")),u=r.find(".NoteTooltip");window.vueDash?window.vueDash.updateActivityNotes(t):t.activityTooltip?u.html(t.activityTooltip):(u.remove(),i.removeClass("WithNote"),n(".ActivityNotesSubHeader").addClass("d-none"));i.attr("helpbuttondata",r.html())}},p=function(t){t.preventDefault();let r=n(this),f=r.data("bf-activityid"),i=r.data("bf-noteid");n("#frmAddActivityNote").data("bf-submitdata",new URLSearchParams({ActivityID:f,NoteID:i}).toString());let u=n("#txtfrmAddActivityNoteSetActivityNote");if(i!==undefined){let t=n('[name=activity-note-entry][data-bf-noteid="'+i+'"] > span').text();u.val(t)}bfs.dialog.showDialog("dlgAddActivityNote");u.focus()},w=function(n,t,i,r,u){var f=e(n,t,!1,i,r,u);return s(f,t,i,r,u),!1},f=function(n,t,i,r,u){var f=e(n,t,!0,i,r,u);return s(f,t,i,r,u),!1},e=function(n,t,r,u,e,s){var h=o(t),c=h.indexOf(n),l=c<1,a=c>=h.length-1;return l&&!r?null:a&&r?(cc.filterLoading&&cc.filterLoading.hasMore()&&(i(),cc.filterLoading.loadMore(function(){f(n,t,u,e,s)})),null):r?h[c+1]:h[c-1]},o=function(n){return window.ccActivityLists?window.ccActivityLists[n]||[]:[]},s=function(n,t,i,u,f){if(!notDefined(n))return r(n,t,i,u,f),!1},b=function(i,r){var u,f;bfs.dialog.closeDialog(t);u=new URLSearchParams(r);u&&(f=u.get("MessageID0"),u.get("IsIgnored")==1?bfPagers.ignoreRules.deleteActivity(f):n("#"+f).remove().length<1&&(bfs.loading.show(),window.location.reload()))},h=function(t,i){cc.viewMessage.parsedText=t;var r=n("#dlgViewParsedMessageContent");ace.edit(r.find(".ace_editor").attr("id")).setValue(t||"",-1);r.find(".ComplexLink").prop("href",i)},c=function(t,i){cc.viewMessage.attachmentContent=t;var r=n("#dlgViewAttachmentContent");ace.edit(r.find(".ace_editor").attr("id")).setValue(t||"",-1);r.find(".ComplexLink").prop("href",i)},k=function(t,i){var r=n("#"+t+" .ace_editor"),o,e,u,f;if(r.length==0){r=n("#"+t);o=r.data("bf-whitespace-condensed");o?(r.val(o),r.data("bf-whitespace-condensed",null)):(u=r.val(),r.val(u.replace(i," ")),r.data("bf-whitespace-condensed",u));f=r.closest(".Box");f.find(".Condense").toggle();f.find(".Uncondense").toggle();return}if(e=ace.edit(r.attr("id")),r.data("bf-whitespace-condensed")){if(u="",t.indexOf("ParsedMessageContent")>-1)u=cc.viewMessage.parsedText;else if(t.indexOf("AttachmentContent")>-1)u=cc.viewMessage.attachmentContent;else throw new Error("Unhandled editorId value: "+t);e.setValue(u,-1);r.data("bf-whitespace-condensed",!1)}else e.setValue(e.getValue().replace(i," "),-1),r.data("bf-whitespace-condensed",!0);f=r.closest(".bfDialogJS");f.find(".Condense").toggle();f.find(".Uncondense").toggle()},d=function(t,i){var t,r;return(notDefined(i)&&(i=cc.organizationID),t=n("#MessageForwardActivityID").val(),notDefined(t))?!1:(r={ActivityID:t,OrganizationID:i},bfs.loading.show(),cc.ajax.run("Messages/LoadAttachments",r,bfs.lang("errorMessage"),function(t){bfs.loading.hide();c(t.attachmentContent,t.complexTestUrl);bfs.dialog.showDialog("dlgViewAttachmentContent");$dialog=n("#dlgViewAttachmentContent");ace.edit($dialog.find(".ace_editor").attr("id")).resize();$dialog.find(".Condense a").trigger("click")}),!1)},g=function(){n(document.body).on("click","a.ViewMessage",l);n(document.body).on("submit","#frmMessageForward",a);n(document).on("click","a.AddNote",p);n(document).on("submit","#frmAddActivityNote",v)};return{init:g,onMessageUnmatch:b,view:r,fixMessageHeight:u,fixMessageHeight:u,showOlder:f,showNewer:w,setMessageContent:h,setAttachmentContent:c,loadAttachmentContent:d,toggleCondenseWhitespace:k,noteDeleted:y}}(jQuery);cc.reports=function(){var n=function(n,t,i,r,u){var f=bfs.lang("sendReportPrompt");return t>0&&(f+=" "+t+" "+bfs.lang("users")),i>0&&(t>0&&(f+=" and"),f+=" "+i+" "+bfs.lang("channels")),bfs.dialog.confirm(f+"?",function(){u&&u();var t={OrganizationID:cc.organizationID,ReportID:n};cc.ajax.run("Reports/Send",t,bfs.lang("errorMessage"),r)}),!1};return{send:n}}(jQuery);cc.channels=function(n){var t={},i=null,r=null,s=function(t,i,r,u,f,e){var o=n(this).closest(".ToggleNotification"),s,h;if(!o.data("isLoading"))return bfs.loading.show(),o.data("isLoading",!0),s={headers:[]},n("#"+f+"frmChannelConfigcustomwebhook option").each(function(n,t){var r=t.value.split("...***:::***..."),i={};i.key=r[0];i.value=r[1];s.headers[n]=i}),h="WebhookUrl="+n("#"+t).val()+"&Source="+encodeURI(ace.edit(i+"Js").getValue())+"&NotificationType="+e+"&EscapeMode="+n("#"+r).val()+"&HttpMethod="+n("#"+u).val()+"&CustomHeaders="+btoa(JSON.stringify(s))+"&OrganizationID="+n("#ajaxOrganizationID").val(),cc.ajax.run("Notifications/CustomWebhookTest",h,"Custom Webhook Test",function(n){n.reload==="true"&&window.location.reload();bfs.loading.hide();o.data("isLoading",!1);bfs.toast.showSuccess("Test Sent")},function(n){o.data("isLoading",!1);bfs.toast.showError(n.error)}),!1},f=function(n,t){return n+""+t},h=function(i,r){var u=f(i,r),e=t[u];e&&(delete t[u],n("#"+e).remove())},c=function(i,r,u,e){var o=f(i,u),s=t[o],h;
27return s?(bfs.dialog.showDialog(s,null,null,e),!1):(bfs.loading.show(),h={OrganizationID:r,ChannelType:i,ChannelID:u},cc.ajax.run("Notifications/GetServiceEditForm",h,bfs.lang("errorMessage"),function(i){n("#DialogWrapper").append(i.dialogContent);n(document.body).append(i.scriptContent);bfs.dialog.setupDrags();cc.treeview.init();t[o]=i.dialogId;bfs.dialog.setOnCloseJs(i.dialogOnCloseId,function(){cc.treeview.resetSelection.apply(null,i.dialogParams)});bfs.loading.hide();bfs.dialog.showDialog(i.dialogId,null,null,e)}),!1)},l=function(t,i,r){var u="Url="+encodeURI(t)+"&ApiToken="+encodeURI(i)+"&OrganizationID="+encodeURI(n("#ajaxOrganizationID").val());cc.ajax.run("Notifications/GetItemList",u,bfs.lang("errorMessage"),function(n){n.reload==="true"&&window.location.reload();r(n.APIResponse)})},a=function(t,i,r,u,f){var e="Url="+encodeURI(t)+"&Username="+encodeURI(n("#"+i).val())+"&Secret="+encodeURI(n("#"+r).val())+"&APIIntegrationcodeId="+encodeURI(n("#"+u).val())+"&OrganizationID="+encodeURI(n("#ajaxOrganizationID").val());cc.ajax.run("Notifications/AutotaskApiGetItemList",e,bfs.lang("errorMessage"),function(n){n.reload==="true"&&window.location.reload();f(n.APIResponse)})},v=function(t,i,r,u,f){var e="Url="+encodeURI(t)+"&PublicKey="+encodeURI(n("#"+i).val())+"&PrivateKey="+encodeURI(n("#"+r).val())+"&CompanyId="+encodeURI(n("#"+u).val())+"&OrganizationID="+encodeURI(n("#ajaxOrganizationID").val());cc.ajax.run("Notifications/ConnectWiseApiCall",e,bfs.lang("errorMessage"),function(n){n.reload==="true"&&window.location.reload();f(n.APIResponse)})},y=function(t,i,r,u){var f=n(this).closest(".ToggleNotification"),e;if(!f.data("isLoading"))return bfs.loading.show(),f.data("isLoading",!0),e="Source="+encodeURI(ace.edit(t+"Js").getValue())+"&NotificationType="+u+"&EscapeMode="+n("#"+r).val()+"&OrganizationID="+n("#ajaxOrganizationID").val(),cc.ajax.run("Notifications/CustomWebhookRenderTemplateTest",e,"Custom Webhook Test",function(n){n.reload==="true"&&window.location.reload();bfs.loading.hide();f.data("isLoading",!1);ace.edit(i+"Js").setValue(n.template);bfs.dialog.showDialog("popupCodeEditorDialog","Rendered Template","","")},function(n){f.data("isLoading",!1);bfs.toast.showError(n.error)}),!1},p=function(t,u,f){var o=n(t).closest(".ItemPickerItemBox"),h,e,s,c;if(!o.data("isLoading"))return o.data("isLoading",!0),h=n("#ajaxOrganizationID").val(),e="OrganizationID="+h,e+="&NotificationType="+u,i&&(e+="&ChannelID="+i),r&&(e+="&ServiceType="+r),f&&(e+="&SendSuccess=1"),s=o.find("img"),c=s.attr("src"),s.attr("src","/MediaCommon/SVGs/Animated/LoadingSpinner.svg"),cc.ajax.run("Notifications/SendTestMessage",e,"Test Notification",function(n){n.reload==="true"&&window.location.reload();o.data("isLoading",!1);s.attr("src",c);n.message&&(n.success=="1"?bfs.toast.showSuccess(n.message):bfs.toast.showError(n.message));n.messages&&n.messages.forEach(function(n){bfs.toast.showSuccess(n)});n.errors&&n.errors.forEach(function(n){bfs.toast.showError(n)})},function(n){o.data("isLoading",!1);bfs.toast.showError(n.error)}),!1},w=function(t){t.preventDefault();var i=n(this).closest(".ToggleNotification");i.data("isLoading")||b(i)},b=function(t){var u,o,f;t.data("isLoading",!0);var c=t.data("bf-service-type"),l=n("#ajaxOrganizationID").val(),r="OrganizationID="+l;r+="&Notification="+t.data("bf-notification");r+="&Enable="+t.data("bf-enable");r+=c?"&ServiceType="+t.data("bf-service-type"):"&ChannelID="+t.data("bf-channel-id");u=window.location.pathname.split("/").filter(Boolean);u.length>=4&&u[0].toLowerCase()==="dashboard"&&u[2].toLowerCase()==="users"&&u[3].toLowerCase()==="view"&&(o=new URLSearchParams(window.location.search),f=o.get("ID"),f&&(r+="&UserToSetID="+encodeURIComponent(f)));var i=t.find("img"),s=i.attr("src"),a=t.closest(".TableBody");i.attr("src","/MediaCommon/SVGs/Animated/LoadingSpinner.svg");cc.ajax.run("Notifications/SetNotification",r,bfs.lang("errorMessage"),function(n){n.reload==="true"&&window.location.reload();h(t.data("bf-channel-type"),t.data("bf-channel-id"));e(a,n);t.data("isLoading",!1);i.attr("src",s);n.icon&&(i.closest("tr").find(".DisabledWarning").toggle(n.showWarning=="1"),i.closest("a").replaceWith(n.icon))},function(n){t.data("isLoading",!1);i.attr("src",s);bfs.toast.showError(n.error)})},e=function(t,i){n.each(i.rows,function(t,i){n("#"+i.id).replaceWith(i.html)});n.each(i.warnings,function(n,i){var r=t.find("."+i.id);i.html&&i.html.length>0?r.length>0?r.replaceWith(i.html):t.prepend(i.html):r.length>0&&r.remove()});t.find(".warning-row").length>0?t.closest(".Box").addClass("TableWarningBorder"):t.closest(".Box").removeClass("TableWarningBorder")},k=function(t){return n(".ToggleBoxContent").each(function(i,r){toggleBoxContentWorker(n(r),t)}),!1},d=function(t,i,r){var u=n(t),s=u.closest(".TableBody"),f=s.find(".ToggleLoading"),o=cc.buildAjaxData(!1);o.set("ChannelID",i);o.set("SetEnabled",r);u.hide();f.show();cc.ajax.run("Notifications/SetChannelEnabled",o,bfs.lang("errorMessage"),function(n){e(s,n);u.show();f.hide()},function(){u.show();f.hide()})},g=function(n,t,u){i=n||null;r=null;o(t,u)},nt=function(n,t,u){r=n||null;i=null;o(t,u)},o=function(t,i){var u=n("#dialogItemPickerdlgTestMessage"),r;u.find(".TitleServiceName").html(t||"");r=u.find(".TitleServiceIcon");r.attr("src",i||"");bfs.util.updateImage(document.body.dataset.theme,r)},tt=function(n,t,i,r){return u("RemoveGroupFromChannel",n,t,i,r)},it=function(n,t,i,r){return u("IncludeGroupForChannel",n,t,i,r)},rt=function(n,t,i,r){return u("RemoveGroupChecksFromChannel",n,t,i,r)},u=function(t,i,r,u,f){var e=n("#frm"+t);return e.find("input[name$=ChannelID]").val(i),e.find("input[name$=GroupID]").val(r),e.find(".ChannelName").text("'"+decodeURIComponent(u)+"'"),e.find(".GroupName").text("'"+decodeURIComponent(f)+"'"),bfs.dialog.showDialog("dlg"+t),!1},ut=function(){n(document).on("click",".ToggleNotification",w)};return{init:ut,toggleAll:k,sendTestMessage:p,customWebhookRenderTemplateTest:y,customWebhookTest:s,setChannelId:g,setServiceType:nt,showRemoveGroupForm:tt,showIncludeGroupForm:it,showRemoveGroupChecksForm:rt,getServiceE
27ditForm:c,getItemList:l,getAutotaskItemList:a,getConnectWiseItem:v,setChannelEnabled:d}}(jQuery);cc.importCustomerDialog=function(){var t=function(t,i){t.preventDefault();const o=n();if(o){const h=r();if(h){let f=null,u=null,s=null,e=h.value;if(e&&(e=e.toLowerCase(),u=o.querySelectorAll(`[data-bf-filter*="${e}"]`),f=o.querySelector(".highlightText"),f&&(s=f.querySelector(`[data-bf-filter*="${e}"]`))),f&&f.classList.remove("highlightText"),u.length){let n=-1;s&&(n=Array.prototype.indexOf.call(u,s));i?(n--,n<0&&(n=u.length-1)):(n++,n>=u.length&&(n=0));const r=u[n],e=r.closest(".BFCheckBox"),f=r.closest(".row");let t=null;f&&(t=f.previousElementSibling);let o=1;while(t){if(!t.classList.contains("SubHeaderCollapse")){t=t.previousElementSibling;o++;continue}break}t&&t.classList.contains("IsCollapsed")&&t.click();e?e.classList.add("highlightText"):f&&r.classList.add("highlightText");let h="start";o>1&&(h="center");r.scrollIntoView({block:h})}}}},u=function(){const t=n();if(t){for(const n of t.querySelectorAll(".SubHeaderCollapse.IsCollapsed"))n.click();for(const n of t.querySelectorAll('[data-bf-filter$="(inactive)"]'))n.checked=!1}},i=function(n){t(n,!1)},f=function(n){t(n,!0)},e=function(n){n.key=="Enter"?i(n):n.key=="Escape"&&(n.preventDefault(),n.stopPropagation(),bfs.dialog.closeWrappingDialog(n.target))},n=function(){return document.querySelector("#ImportCustomers .TableBody")},r=function(){return document.querySelector("#ImportCustomersAsCheckGroupsSearch")},o=function(){const t=n();if(!t){console.log("importCustomerDialog:setup: table is NULL.");return}const i=r();if(!i){console.log("importCustomerDialog:setup: search is NULL.");return}i.onkeydown=e;t.classList.add("configured")};return{searchForward:i,searchBackward:f,uncheckInactive:u,init:o}}(jQuery);cc.treeview=function(n){var f=function(t){var i,r,u;t.stopPropagation();i=n(t.target).closest("sl-switch");i.hasClass("toggleChildren")&&(r=i[0].checked,u=i.closest("sl-tree-item"),n.each(u[0].getChildrenItems(),function(n,t){t.querySelector("sl-switch").checked=r}))},i=function(t,i){var r,e,o,s;t.preventDefault();var h=n(t.target).closest(".bfDialogJS"),c=h.find(".BFTreeView"),l=c.find("[data-bf-filter]"),v=c.find(".highlightText"),a=-1,u=[],f=h.find(".FilterBox").val();f&&(f=f.toLowerCase(),l.each(function(t,i){var r=n(i);r.hasClass("highlightText")&&(a=t);r.attr("data-bf-filter").indexOf(f)>-1&&u.push(t)}));v.removeClass("highlightText");u.length&&(r=u.indexOf(a),i?(r--,r<0&&(r=u.length-1)):(r++,r>=u.length&&(r=0)),e=l.eq(u[r]),e.addClass("highlightText"),o="start",s=e.parents("sl-tree-item"),s.length>0&&(s.attr("expanded",!0),o="center"),e.get(0).scrollIntoView({block:o}))},r=function(n){i(n,!1)},e=function(n){i(n,!0)},o=function(n){n.key=="Enter"&&r(n)},u=async function(i,r,u,f){var o=n(i),s=n("#"+o.data("bf-form-id")),h=[],c=[],e,l;$inputIncludes=s.find(r);$inputDefaults=s.find(u);e=JSON.parse($inputIncludes.val());l=JSON.parse($inputDefaults.val());o.find("sl-tree-item").each(async function(i,r){var u=n(r),o=u.data("bf-id"),a=u.data("set-default"),v,y,s,p;f?(v=e.indexOf(o)>-1,u.prop("selected",v),v||(y=0,s=0,n.each(r.getChildrenItems(),function(t,i){y++;var r=n(i).data("bf-id");e.indexOf(r)>-1&&s++}),p=s>0&&s<y,u.prop("indeterminate",p)),a=l.indexOf(o)>-1):u.prop("selected")&&h.push(o);t(u,a,!1);a&&c.push(o)});f||($inputIncludes.val(JSON.stringify(h)),$inputDefaults.val(JSON.stringify(c)))},s=function(n,t,i){u(n,t,i,!0)},h=function(i,r,u){i.stopPropagation();var f=n(i.target).closest("sl-tree-item");return t(f,r,u),!1},t=function(i,r,u){u&&n.each(i[0].getChildrenItems(),function(i,u){var f=n(u);t(f,r,!1)});i.find(".LeftButtonOn").toggle(r);i.find(".LeftButtonOff").toggle(!r);i.attr("data-set-default",r)},c=function(){var t=n(".BFTreeView:not(.configured)");t.closest(".bfDialogJS").on("keydown","[type=search]",o);t.find("sl-switch").on("click",f);t.addClass("configured")};return{resetSelection:s,saveSelection:u,searchForward:r,searchBackward:e,handleToggleDefault:h,init:c}}(jQuery);cc.definitionForm=function(n){var t=null,e=function(t){var r=n('<option value="'+t.i
27d+'">'+t.name+"<\/option>"),i=n("#ddlSaveCheckcheckgroup_id");i.append(r);i.find("option").tsort();i.val(t.id);bfs.dialog.closeWrappingDialog(n("#frmEditCheckGroup"));bfs.loading.hide()},i=function(){var t=n("[name=radSaveCheckMatchType]:checked"),i=t.val()=="MatchRules1",r=t.closest(".WizardStep").find(".ConditionRow:not(.Template)");r.toggle(i);r.find("select").change();n(".MatchTypeRow").toggle(i)},r=function(){var i=n("[name=radSaveCheckmulti_check]:checked"),t=i.val()=="1",r=i.closest(".WizardStep");r.find(".CheckIdIndividual").toggle(!t);r.find(".CheckIdCombined").toggle(t);t},u=function(){var t=n("[name=radSaveCheckcheckgroup_id_override]:checked"),i=t.val()=="UseGroupIdOverride",r=t.closest(".WizardStep");r.find(".GroupOverride").toggle(i)},f=function(t){var r,i,u;return t&&t.preventDefault(),bfPagers.jobs&&(r=n(".PreviewMatchingBox"),i=r.closest("form"),cc.checkForm.appendFormRowNumbers(i,"#hidSaveCheckRowCount"),u=new FormData(i[0]),bfPagers.jobs.loadMatching(u,"Failed to load matching preview. Please try again.")),!1},o=function(){var r=n("#SaveCheck"),i=new FormData(r[0]),u=new URLSearchParams(i).toString()!==new URLSearchParams(t).toString();t=i;u&&f()},s=function(t){return t&&t.preventDefault(),bfs.vueDefinitionSummary&&bfs.vueDefinitionSummary.loadSummary(n("#SaveCheck, #frmEditIntegration")),!1},h=function(n,t){n==t-1&&s()},c=function(t){t.preventDefault();var u=n(this),i=ace.edit(u.closest(".row").find(".ace_editor")[0].id),r=i.getCursorPosition().column||0;r<0&&(r=0);var f=i.getValue(),o=f.substring(0,r),s=f.substring(r),e=u.data("bf-field-key");i.setValue(o+e+s,1);i.moveCursorTo(0,r+e.length);i.focus()},l=function(){cc.checkForm.setup();i();r();u();n(".MatchingRulesFormSection").on("change, input",bfs.util.debounce(o));n("#SaveCheck").on("click",".InsertPlaceholder",c);cc.wizard.addStepChangeCallback(h)};return{setup:l,newGroup:e,refreshMatching:f,setMatch:i,setMulti:r,setGroupOverride:u}}(jQuery);cc.integrationForm=function(n){var e=function(t){var u=!bfs.vueGroupMapping.editingGroup,r,i;bfs.vueGroupMapping.onAddGroup(t);r=n('<option value="'+t.id+'">'+t.name+"<\/option>");i=n("#ddlfrmEditIntegrationdefaultGroupId");i.append(r);i.find("option").tsort();u&&i.val(t.id);bfs.dialog.closeWrappingDialog(n("#frmEditCheckGroup"));bfs.loading.hide();bfs.vueGroupMapping.onChangeDefault(!0)},o=function(t){t.preventDefault();var u=n(this),i=ace.edit(u.closest(".row").find(".ace_editor")[0].id),r=i.getCursorPosition().column||0;r<0&&(r=0);var f=i.getValue(),o=f.substring(0,r),s=f.substring(r),e=u.data("bf-field-key");i.setValue(o+e+s,1);i.moveCursorTo(0,r+e.length);i.focus()},t=function(){r();var u=n("[name=radfrmEditIntegrationdefaultGroupMappingValue]:checked"),t=u.val()=="UseDefaultId",i=u.closest(".WizardStep");i.find(".DefaultGroupTemplateRow").toggleClass("disabled",t);i.find(".DefaultGroupTemplateRow select").prop("disabled",t);i.find(".DefaultGroupIdRow").toggleClass("disabled",!t);i.find(".DefaultGroupIdRow select").prop("disabled",!t);bfs.vueGroupMapping?.onChangeDefault(t)},s=function(){r();var t=n("#ddlfrmEditIntegrationselectedField").val();bfs.vueGroupMapping?.onChangeField(t)},u=function(){bfs.vueGroupMapping&&(n("#GroupMappingSelectedField").val(bfs.vueGroupMapping.selectedField),n("#GroupMappingFieldData").val(JSON.stringify(bfs.vueGroupMapping.filteredJobs)))},h=function(){var t="#"+this.id.replace("chk","hid")+"Check",i=n(t).val();i=="false"&&(n(this).closest(".row").find(".FormNote span").slideDown(),n(this).prop("checked",!1))},i=function(n){return n==2||n==3||n==4},c=function(){var r=n("[id$=ShowDifferentAlertDropdowns]").prop("checked"),t,i;r?(t=n("#ddlEditIntegrationRepeatedFailure"),i=n("#ddlEditIntegrationRepeatedAlert"),t.val(i.val()),t.trigger("change"),n("#NotifyRepeatedFailuresLimit input").val(n("#NotifyRepeatedAlertsLimit input").val())):(t=n("#ddlEditIntegrationRepeatedAlert"),i=n("#ddlEditIntegrationRepeatedFailure"),t.val(i.val()),t.trigger("change"),n("#NotifyRepeatedAlertsLimit input").val(n("#NotifyRepeatedFailuresLimit input").val()))},l=function(){var t=n(this),r=t.val();n("#NotifyRepeatedWarningsLimit").toggle(i(r))},a=function(){var r=n(this),t=r.val();n("#NotifyRepeatedFailuresLimit").toggle(i(t));n("#NotifyRepeatedAlertsLimit input").val(n("#NotifyRepeatedAlertsLimit input").val());n("#ddlfrmEditIntegrationRepeatedAlert").val(t)},v=function(){var r=n(this),t=r.val();n("#NotifyRepeatedAlertsLimit").toggle(i(t));n("#NotifyRepeatedFailuresLimit input").val(n("#NotifyRepeatedAlertsLimit input").val());n("#ddlfrmEditIntegrationRepeatedFailure").val(t)},y=function(){r();bfs.vueGroupMapping.loadGroupMapping()},r=function(){var t=n("#ddlfrmEditIntegrationselectedField").select2("data"),i;t&&t.length&&(i=t[0]["bf-template-value"],f(function(t){var r=t.getValue();n(".TemplateWarning").toggle(r.indexOf(i)<0)}))},p=function(t){t==1&&bfs.vueGroupMapping.loadGroupMapping(!1,n("#EditableJobs").val()=="0")},f=function(t){var r=n(".DefaultGroupTemplateRow .ace_editor"),i,u;r.length>0&&(i=r[0].id,i&&(u=ace.edit(i),t(u)))},w=function(){var t=n("#txtfrmEditIntegrationname"),i=t.val().toLowerCase(),r=JSON.parse(n("#ExistingIntegrationNames").val());if(r.indexOf(i)>-1){t[0].setCustomValidity("This integration name is already in use");t[0].reportValidity();t.one("change, sl-change, input",function(){t[0].setCustomValidity("")});return!1}return t[0].setCustomValidity(""),!0},b=function(){var i=n("#frmEditIntegration");n("#tblNotifications").on("change","input",h);i.on("change","select#ddlfrmEditIntegrationRepeatedAlert",v);i.on("change","select#ddlfrmEditIntegrationRepeatedFailure",a);i.on("change","select#ddlfrmEditIntegrationRepeatedWarning",l);i.find("#ddlfrmEditIntegrationRepeatedAlert").change();i.find("#ddlfrmEditIntegrationRepeatedFailure").change();i.find("#ddlfrmEditIntegrationRepeatedWarning").change();i.on("change","[id$=ShowDifferentAlertDropdowns]",c);i.on("click",".InsertPlaceholder",o);n("#ddlfrmEditIntegrationdefaultGroupId").on("change",t);n("#ddlfrmEditIntegrationselectedField").on("change",s);f(function(n){n.on("change",bfs.util.debounce(y))});i.on("submit",u);t();
27cc.wizard.addStepChangeCallback(p)};return{setup:b,checkNameValidity:w,newGroup:e,setDefaultGroup:t,processFormSubmit:u}}(jQuery);cc.checkForm=function(n){var r={},t={},s=!0,i=function(t,i,r){var u=t.find(".DynamicRows .ConditionRow:not(.Template)");return r&&(u=u.filter(r)),t.find(i).val(u.length),u.each(function(t){n(this).find("input, select").attr("name",function(n,i){return i.replace(/[0-9]+$/,"")+""+t})}),u},v=function(){var r=n(t.email),i;s&&(i=bfs.util.getValueStripped(n(t.name),!0),r.val(i),n("#CheckEmail").text(i));r.trigger("input")},y=function(t){n(".EmailPlusChar").toggle(t)},u=function(){var i,r;t.email!==undefined&&(i=n(t.email),i.length!==0)&&(r="",i[0].disabled||(i.val(bfs.util.getValueStripped(i,!0)),r=i.val()),n("#EmailPlusAlias").text(r),y(r.length>0),s=r==bfs.util.getValueStripped(n(t.name),!0),et())},p=function(){n(t.email).prop("disabled",!this.checked);n(t.email).toggle(this.checked);u()},w=function(n){n.preventDefault();var t,i,r=document.getElementById("EmailAddressDisplay");document.body.createTextRange?(t=document.body.createTextRange(),t.moveToElementText(r),t.select()):window.getSelection&&(i=window.getSelection(),t=document.createRange(),t.selectNodeContents(r),i.removeAllRanges(),i.addRange(t));try{document.execCommand("copy")}catch(u){console.error(u)}},b=function(){var r=n('div[id^="StatusRules"]').closest(".BoxWrap"),t,u,i;r.show();t=n(this);u=n("#StatusRules"+t.val()).closest(".BoxWrap");u.hide();n("div[id^=BlankStatusRules]").closest(".BoxWrap").hide();n("#BlankStatusRules"+t.val()).closest(".BoxWrap").show();i=t.find("option:selected").text();n(".CheckDescDefaultStatus").html(i);r.find(".HelpButton").each(function(){var t=n(this);t.attr("helpbuttondata",t.attr("helpbuttondata").replace(/<span class="CheckDescDefaultStatus">\\w+<\/span> /,'<span class="CheckDescDefaultStatus">'+i+"<\/span> "))})},h=function(n){n.show();return},e=function(n){n.hide();return},k=function(){n(this).val()==5?(e(n(".CheckFrequencySimple")),e(n(".CheckFrequencyAdvanced")),h(n(".CheckFrequencyUnscheduled"))):(e(n(".CheckFrequencyUnscheduled")),h(n(".CheckFrequencySimple")),n("#chkSaveCheckUseCustomSchedule").change())},d=function(i){var u=n('<option value="'+i.id+'">'+i.name+"<\/option>"),r=n(t.groupList);r.append(u);r.find("option").tsort();r.val(i.id);l(i);bfs.dialog.closeWrappingDialog(n("#frmEditCheckGroup"));bfs.loading.hide()},g=function(t){t.preventDefault();var i=n(this).closest(".BoxWrap"),r=i.find(".ConditionRow.Template").first(),u=r.clone();u.removeClass("Template");r.before(u.slideDown());i.find(".EmptyMessage").hide()},nt=function(t){t.preventDefault();var i=n(this).closest(".ConditionRow"),r=i.clone();i.find("select").each(function(){r.find('[name="'+this.name+'"]').val(n(this).val())});i.before(r)},tt=function(t){t.preventDefault();var i=n(this).closest(".DynamicRows");n(this).closest(".ConditionRow").remove();setTimeout(function(){i.find(".ConditionRow:not(.Template)").length==0&&i.find(".EmptyMessage").show()},25)},it=function(){i(n(this),t.rowCount,function(){return n(this).closest("table").parent().attr("id")!="CheckFrequencyCustom"})},rt=function(){var t=n(this),r=t.find("option:selected"),i=r.attr("data-cc-disablevaluefield")=="true";t.closest(".ConditionRow").find('input[type="text"]:not(.ReadonlyConditionValue)').prop("disabled",i).toggle(!i);c(t)},ut=function(){var t=n(this),i=t.find("option:selected").attr("data-cc-fieldtypeclass"),r;i&&(r=t.closest(".ConditionRow").find('select[name^="cboConditionFieldMatch"]').hide(),r.filter('select[name^="cboConditionFieldMatch'+i+'"]').change().show());c(t)},f=function(){var u=n("#SaveCheck"),r=i(u,t.rowCount),f=new FormData(u[0]);window.cc.ajax.run("Checks/Validate",f,"Something went wrong! Please try again.",function(t){if(t.results.length!=r.length)throw new Error("Invalid response count: "+t.results.length+"/"+r.length);r.each(function(i,r){var u=t.results[i],f=n(r),e=f.find(".ValidationError");e.length===0?f.append(u):e.replaceWith(u)})},function(){})},ft=function(r,u){var e,f,o;r.preventDefault();e=n("#SaveCheck");cc.wizard.isValid()&&(i(e,t.rowCount),f="dialogTestCheck",o=null,e.find("[data-cc-attachmentparsezip=true]:selected").closest("select").is(":visible")&&(o="Loading message attachment content, this may take some time..."),bfs.dialog.showLoading(f,o),bfs.dialog.showDialog(f,bfs.lang("testCheck","Test Check"),"",function(){var n=new FormData(e[0]);n.set("FormType",u);window.cc.ajax.run("Checks/Test",n,"Something went wrong! Please try again.",function(n){bfs.dialog.setContent(f,n.data);bfs.dialog.setTitle(f,n.title);window.ccActivityLists=JSON.parse(n.lists)},function(n){bfs.dialog.showFade();bfs.dialog.closeDialog(f);bfs.dialog.showError(n.error||"Something went wrong! Please try again.")})}))},et=function(){var t=n("#EmailAddressDisplay").text(),i=n("#EmailPlusAlias").text();i.length==0&&(i=n(".EmailPlusChar:first").text()+i,t=t.replace(i,""));n("#EmailAddressDisplay").attr("HelpButtonData",t).attr("href","mailto:"+t)},ot=function(){var t="#"+this.id.replace("chk","hid")+"Check",i=n(t).val();i=="false"&&(n(this).closest(".row").find(".FormNote span").slideDown(),n(this).prop("checked",!1))},st=function(){var r=n("[id$=ShowDifferentAlertDropdowns]").prop("checked"),t,i;r?(t=n("#ddlSaveCheckRepeatedFailure"),i=n("#ddlSaveCheckRepeatedAlert"),t.val(i.val()),n("#NotifyRepeatedFailuresLimit input").val(n("#NotifyRepeatedAlertsLimit input").val()),t.trigger("change")):(t=n("#ddlSaveCheckRepeatedAlert"),i=n("#ddlSaveCheckRepeatedFailure"),t.val(i.val()),n("#NotifyRepeatedAlertsLimit input").val(n("#NotifyRepeatedFailuresLimit input").val()),t.trigger("change"))},o=function(n){return n==2||n==3||n==4},ht=function(){var i=n(this),t=i.val();n("#NotifyRepeatedAlertsLimit").toggle(o(t));n("#NotifyRepeatedFailuresLimit input").val(n("#NotifyRepeatedAlertsLimit input").val());n("#ddlfrmSaveCheckRepeatedFailure").val(t)},ct=function(){var i=n(this),t=i.val();n("#NotifyRepeatedFailuresLimit").toggle(o(t));n("#NotifyRepeatedAlertsLimit input").val(n("#NotifyRepeatedAlertsLimit input").val());n("#ddlfrmSaveCheckRepeatedAlert").val(t)},lt=function(){var t=n(this),i=t.val();n("#NotifyRepeatedWarningsLimit").toggle(o(i))},c=function(t){var i=t.closest(".WizardStep"),f=i.find('select[name^="cboConditionFieldMatch"]:visible'),r=!1,u=!1;f.each(function(t,i){var f=n(i).find("option:selected");f.attr("data-cc-textqueryfaq")=="true"&&(r=!0);f.attr("data-cc-regexfaq")=="true"&&(u=!0)});i.find(".ComplexMatchFaq").toggle(r);i.find(".RegexMatchFaq").toggle(u)},at=function(){var t=n(this).closest(".BoxWrap"),r=t.find('select[name="cboConditionFieldMatchAttachment"]'),i=!1;r.each(function(t,r){var u=n(r).find("option:selected");if(u.attr("data-cc-attachmentparsezip")=="true")return i=!0,!1});t.find(".ZipParseNotice").toggle(i)},vt=function(r){r.preventDefault();var u=n("#SaveCheck");cc.wizard.isValid()&&(bfs.loading.show(),i(u,t.rowCount),window.cc.ajax.run("Checks/GetStructure",new FormData(u[0]),"Something went wrong! Please try again.",function(t){var i=n("#dlgShowCheckJSON"),r;i.find("div.DialogMessage").remove();t.message&&i.find(".bfDialogInnerText").prepend('<div class="DialogMessage">'+t.message+"<\/div>");r=ace.edit(i.find(".ace_editor")[0].id);r.setValue(t.data);bfs.dialog.showDialog("dlgShowCheckJSON","","",function(){bfs.loading.hide()})}))},yt=function(t){l(t.params.data.id);n(".GroupNameDisplay").text(t.params.data.text)},l=function(t){var i=[];t&&cc&&cc.groupIncludeValues&&(i=cc.groupIncludeValues[t]||[]);
27n("#ddlSaveCheckGroupIncludeValuesOrganizationNotification").val(i).change();n("#ddlSaveCheckGroupIncludeValuesExternalTicketingSystem").val(i).change()},pt=function(){var e=n(this),i=e.val(),h=e.closest(".WizardStep").data("bf-templatetype"),u=i+h,t=e.closest(".Box"),o,f,s;t.find(".TableTitleContent").toggleClass("d-none",i!==bfs.emptyGuid);o=n(e.data("extraselectors"));o.toggleClass("d-none",i!==bfs.emptyGuid);i===bfs.emptyGuid?r[u]="":(f=t.find(".CheckTemplateContent"),f.length===0&&(f=n('<div class="CheckTemplateContent"><\/div>').appendTo(t)),$loading=n(".PlainLoadingSpinner:first"),f.html($loading.html()),f.removeClass("d-none"));notDefined(r[u])?(s=new FormData,s.set("TemplateID",i),s.set("TemplateType",h),cc.ajax.run("Checks/GetTemplateData",s,"",function(n){r[u]=n.template;a(t,i,u,o)})):a(t,i,u,o);t.prop("bf-updated")===!0?t.closest(".WizardStep").find('sl-switch[name^="bulk"]').prop("checked",!0).trigger("sl-change"):(t.prop("bf-updated",!0),t.prop("bf-originaltemplateid",i))},a=function(t,i,u){var e=r[u],f,o;if(notDefined(e))throw new Error("Template data not found: "+u);$inner=t.find(".TableTitleContent");f=t.find(".CheckTemplateContent");f.length===0&&(f=n('<div class="CheckTemplateContent"><\/div>').appendTo($inner.parent()));$inner.toggleClass("d-none",i!==bfs.emptyGuid);f.toggleClass("d-none",i===bfs.emptyGuid);f.html(e);o=t.prop("bf-originaltemplateid")||bfs.emptyGuid;t.find(".TemplateWarning").toggleClass("d-none",i!==bfs.emptyGuid||o===bfs.emptyGuid)},wt=function(){var t=n("#ToggleScheduleOverride"),i=t.prop("checked"),r=t.closest(".Box");r.find(".TableBody").toggle(i);r.find(".TableFoot").toggle(!i)},bt=function(){var r,i;window.loadFormIDs&&(t=window.loadFormIDs());n('input[type=radio][id*="FrequencyType"]').on("change",k);n('input[type=radio][id*="FrequencyType"]:checked').change();n(".TemplateDropdown select").on("change",pt).change();n(t.useCustomEmail).change(p).change();n(t.defaultStatus).on("change",b);r=function(){n(t.defaultStatus).hasClass("select2-hidden-accessible")?n(t.defaultStatus).change():setTimeout(r,50)};r();n("#EmailAddressCopy").on("click",w);n(t.email).on("input",u);n(t.email).on("sl-change",u);n(".AddCondition").click(g);n(".DynamicRows").on("change",bfs.util.debounce(f,250));n("input[id*=GroupWhitespace]").on("change",bfs.util.debounce(f,250));n(".DynamicRows").on("input","input",bfs.util.debounce(f,250));i=n("#SaveCheck");i.on("change",'select[name="cboConditionFieldMatchAttachment"]',at);i.find('select[name="cboConditionFieldMatchAttachment"]').change();i.on("change",'select[name^="cboConditionFieldMatch"]',rt);i.find('select[name^="cboConditionFieldMatch"]').change();i.on("change",'select[name^="cboConditionFieldType"]',ut);i.find('select[name^="cboConditionFieldType"]').change();i.on("select2:select","select#ddlSaveCheckGroup",yt);i.find(".TableBody").on("click","a.DeleteRow",tt);i.find(".TableBody").on("click","a.CloneRow",nt);i.on("submit",it);n("#tblNotifications").on("change","input",ot);i.on("change","select#ddlSaveCheckRepeatedAlert",ht);i.on("change","select#ddlSaveCheckRepeatedFailure",ct);i.on("change","select#ddlSaveCheckRepeatedWarning",lt);i.find("#ddlSaveCheckRepeatedAlert").change();i.find("#ddlSaveCheckRepeatedFailure").change();i.find("#ddlSaveCheckRepeatedWarning").change();i.on("change","[id$=ShowDifferentAlertDropdowns]",st);n("#ToggleScheduleOverride").on("sl-change",wt);if(n("#ToggleScheduleOverride").trigger("sl-change"),n(t.isNewCheck).val()==1&&window.allowEmailChanges)n(t.name).on("input",v);u()};return{setup:bt,newGroup:d,testCheck:ft,showCheckJSON:vt,appendFormRowNumbers:i,testConditions:f}}(jQuery);cc.checkTemplates=function(n){var t={},i=function(i,r){var u=i,f=t[u],e;return f?(bfs.dialog.showDialog(f),!1):(bfs.loading.show(),e={OrganizationID:cc.organizationID,TemplateID:i,ViewPage:r},cc.ajax.run("Checks/GetTemplateCheckList",e,bfs.lang("errorMessage"),function(i){n("#DialogWrapper").append(i.dialogContent);n(document.body).append(i.scriptContent);bfs.dialog.setupDrags();cc.treeview.init();t[u]=i.treeDialogId;bfs.dialog.setOnCloseJs(i.treeDialogId,function(){cc.treeview.resetSelection.apply(null,i.dialogParams)});bfs.loading.hide();bfs.dialog.showDialog(i.treeDialogId)}),!1)},r=function(i,r,u){var f=n("#"+i),s=t[r],h=n("#"+s+' sl-tree-item[data-bf-id-type="check"]'),e=f.find(".RemovedChecks").html(""),o=f.find(".AddedChecks").html("");h.each(function(t,i){var r=n(i);r.data("start-selected")&&!r.prop("selected")?e.append(u(r)):r.prop("selected")&&!r.data("start-selected")&&o.append(u(r))});e.children().length===0&&e.append("No Checks Removed");o.children().length===0&&o.append("No Checks Added");f.find(".TemplateOptionRow").toggle(e.children().length>0);f.is(":visible")||(f.find("select").select2(),bfs.dialog.showDialog(i))},u=function(){};return{init:u,getTemplateCheckDialog:i,showConfirmDialog:r}}(jQuery);
28//# sourceMappingURL=bfs.common.min.js.map

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.