OwlCyberSecurity - MANAGER
Edit File: admin.js
(()=>{var t={298:()=>{(window.WSRInputs||function(t,e,n){const i={init(){n(i.ready)},ready(){i.initFileUploads(),i.initCheckboxMultiselectColumns()},initFileUploads(){n(".wsrw-file-upload").each((function(){const t=n(this).find("input[type=file]"),e=n(this).find("label"),i=e.html();t.on("change",(function(t){let n="";this.files&&this.files.length>1?n=(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):t.target.value&&(n=t.target.value.split("\\").pop()),n?e.find(".wsrw-file-field").html(n):e.html(i)})),t.on("focus",(function(){t.addClass("has-focus")})).on("blur",(function(){t.removeClass("has-focus")}))}))},initCheckboxMultiselectColumns(){let e=!1;n(t).on("change",".wsrw-checkbox-multiselect-columns input",(function(){var t=n(this),e=t.parent(),i=t.closest(".wsrw-checkbox-multiselect-columns"),s=e.text(),o="check-item-"+t.val(),a=i.find("#"+o);t.prop("checked")?(t.parent().addClass("checked"),a.length||i.find(".second-column ul").append('<li id="'+o+'">'+s+"</li>")):(t.parent().removeClass("checked"),i.find("#"+o).remove())})),n(t).on("click",".wsrw-checkbox-multiselect-columns .all",(function(t){t.preventDefault(),e=!e,n(this).closest(".wsrw-checkbox-multiselect-columns").find("input[type=checkbox]").prop("checked",e).trigger("change")})),n(t).on("input",".wsrw-multiselect-search input",(function(t){const e=n(this),i=e.parent().next("ul"),s=e.val().toLowerCase();i.find("li").each((function(){const t=n(this);-1===t.text().toLowerCase().indexOf(s)?t.hide():t.show()}))}))}};return i}(document,window,jQuery)).init()},399:()=>{jQuery((function(t){t(".wsrw-close-modal, .wsrw-modal-overlay").on("click",(function(){const e=t("body");e.hasClass("wsrw-no-close")||(e.removeClass("wsrw-show-modal"),t(document).trigger("wsrw-modal-closed"))}))}))},116:()=>{jQuery(document).ready((function(t){jconfirm.defaults={closeIcon:!0,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",type:"blue",animateFromElement:!1};const e={init(){e.find_elements(),e.placeholder_height(),e.init_form(),e.placeholder_click(),e.clear_click()},find_elements(){e.form=t("#wsrw-media-replace-form"),e.file_input=t("#wsrw-media-file"),e.preview=t("#wsrw-media-preview"),e.media_id=t("#wsrw-media-id"),e.placeholder=t("#wsrw-media-preview-placeholder"),e.current_image=t("#wsrw-media-current-image img"),e.replace_buton=t("#wsrw-start-replace"),e.clear_button=t("#wsrw-clear-form"),e.results=t("#wsrw-media-results")},placeholder_height(){e.placeholder.height(e.current_image.height())},placeholder_click(){e.placeholder.on("click",(function(){e.file_input.click()}))},clear_click(){e.clear_button.on("click",(function(){e.reset_form()}))},reset_form(){e.file_input.val(""),e.show_preview()},init_form(){e.form.on("submit",(function(n){n.preventDefault(),t.confirm({title:wsrwjs.are_you_sure,content:wsrwjs.replace_media_confirm,type:"blue",icon:"fa fa-exclamation-circle",animateFromElement:!1,buttons:{confirm:{text:wsrwjs.yes,btnClass:"btn-confirm",keys:["enter"]},cancel:{text:wsrwjs.no,btnClass:"btn-cancel",keys:["esc"]}},onAction:function(t){"confirm"===t&&e.start_media_replace()}})})),e.file_input.on("change",(function(t){e.show_preview()}))},start_media_replace(){const n=new FormData;n.append("_wpnonce",wsrwjs.rest_nonce),n.append("file",e.file_input[0].files[0]),n.append("media_id",e.media_id.val()),t.ajax({url:wsrwjs.upload_url,type:"POST",data:n,contentType:!1,processData:!1,beforeSend:function(){WSRSpinner.show_button_spinner(e.replace_buton)},success:function(t){WSRSpinner.hide_button_spinner(e.replace_buton),e.show_results(t)},error:function(t){WSRSpinner.show_button_spinner(e.replace_buton),e.show_results(t)}})},show_preview(){const t=e.file_input[0].files[0];if(t){const n=new FileReader,i=t.type.match("image");n.onload=function(n){i?e.image_preview(n.target.result):e.file_preview(t.name)},n.readAsDataURL(t),e.replace_buton.prop("disabled",!1),e.clear_button.prop("disabled",!1)}else e.placeholder.show(),e.replace_buton.prop("disabled",!0),e.clear_button.prop("disabled",!0),e.preview.html("")},file_preview(t){e.placeholder.hide();const n='<div class="wsrw-media-placeholder"><img src="https://find-replace.site/wp-includes/images/media/document.png" alt="stock-photo-3"><span class="wsrw-media-placeholder-text">'+t+"</span></div>";e.preview.html(n)},image_preview(n){const i=t("<img>");i.attr("src",n),e.placeholder.hide(),e.preview.html(i)},show_results(n){t.confirm({title:wsrwjs.image_replace_complete,content:n.message,animateFromElement:!1,buttons:{confirm:{text:wsrwjs.ok,btnClass:"btn-confirm",keys:["enter"]}}}),n.success&&(n.image_url&&(e.current_image.attr("src",n.image_url),e.current_image.removeAttr("srcset"),e.current_image.on("load",e.placeholder_height)),e.reset_form())}};e.init()}))},215:()=>{(window.WSRSearchReplace||function(t,e,n){jconfirm.defaults={closeIcon:!0,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",type:"blue",animateFromElement:!1};const i={pages:0,dry_run:!0,init(){i.find_elements(),i.init_form(),i.init_upsell()},find_elements(){i.form=n("#wsrw-search-replace-form"),i.results=n("#wsrw-results"),i.progress=n("#wsrw-progress-bar-replace .wsrw-progress-bar-inner"),i.$table=n("#wsrw-results-table"),i.$start_button=n("#wsrw-start-replace"),i.$do_button=n("#wsrw-perform-search-replace"),i.$text_display=n("#wsrw-progress-text-replace"),i.$modal=n("#wsrw-search-replace-progress"),i.$undo_button=n(t.getElementById("wsrw-results-undo-button"))},init_form(){i.form.on("submit",(function(t){t.preventDefault(),WSRSpinner.show_button_spinner(i.$start_button),i.start_search_replace()})),i.$do_button.on("click",(function(t){t.preventDefault(),n.confirm({title:wsrwjs.sr_confirm_title,content:wsrwjs.sr_confirm_message,type:"blue",icon:"fa fa-exclamation-circle",animateFromElement:!1,buttons:{confirm:{text:wsrwjs.yes,btnClass:"btn-confirm",keys:["enter"]},cancel:{text:wsrwjs.no,btnClass:"btn-cancel",keys:["esc"]}},onAction:function(t){"confirm"===t&&(i.$do_button.prop("disabled",!0),i.start_search_replace(!1))}})}))},start_search_replace(e=!0){i.dry_run=e;const s=n("#wsrw-search").val(),o={action:"wsrw_start_search_replace",nonce:wsrwjs.nonce,search:s,replace:n("#wsrw-replace").val()};if(""===s)return WSRSpinner.hide_button_spinner(i.$start_button),void n.alert({title:wsrwjs.no_search_term_title,content:wsrwjs.no_search_term_message,type:"blue",icon:"fa fa-exclamation-circle",animateFromElement:!1,buttons:{confirm:{text:wsrwjs.ok,btnClass:"btn-confirm",keys:["enter"]}}});n("#wsrw-case-insensitive").is(":checked")&&(o.case_insensitive=1),e||(o.dry_run=0);const a=n('input[name="tables[]"]:checked').map((function(){return n(this).val()})).get();if(0===a.length)return WSRSpinner.hide_button_spinner(i.$start_button),void n.alert({title:wsrwjs.no_table_selected_title,content:wsrwjs.no_table_selected_message,type:"blue",icon:"fa fa-exclamation-circle",animateFromElement:!1,buttons:{confirm:{text:wsrwjs.ok,btnClass:"btn-confirm",keys:["enter"]}}});o["tables[]"]=a,n(t).trigger("wsr_before_start_search_replace",[o]),i.$do_button.prop("disabled",!0),n.ajax({url:ajaxurl,type:"POST",data:o,beforeSend:function(){i.form.find("input, button").prop("disabled",!0)},success:function(t){i.$undo_button.hide(),n("body").addClass("wsrw-show-modal wsrw-no-close"),i.fit_results(),WSRSpinner.hide_button_spinner(i.$start_button),i.form.find("input, button").prop("disabled",!1),i.pages=t.data.pages,i.$table.find("tr:gt(0)").remove(),i.do_search_replace(t.data)},error:function(t){i.form.find("input, button").prop("disabled",!1),i.show_results(t)}})},do_search_replace(){const t={action:"wsrw_do_search_replace",nonce:wsrwjs.nonce};n.ajax({url:ajaxurl,type:"POST",data:t,success:function(t){i.show_results(t);const e=t.data.page/i.pages*100;i.progress.css("width",e+"%"),t.data.page<t.data.pages?i.do_search_replace():i.show_finish_message()},error:function(t){i.show_results(t)}})},show_results(t){t.data.updated_data&&t.data.updated_data.length>0&&n.each(t.data.updated_data,(function(t,e){i.$table.append(n('<tr data-table="'+e.table+'" data-row="'+e.row+'" data-column="'+e.column+'"><td><span class="wsrw-check-row-input"><input type="checkbox" data-table="'+e.table+'" data-row="'+e.row+'" data-column="'+e.column+'" class="wsrw-check-row" /></span></td><td>'+e.table+"</td><td>"+e.column+'</td><td><button class="wsrw-row-info wsrw-button wsrw-button-text" type="button">'+e.row+"</button></td><td><pre>"+e.old+"</pre></td><td><pre>"+e.new+"</pre></td></tr>"))})),t.data.message&&i.display_text(t.data.message)},show_finish_message(){1===i.$table.find("tr").length?i.display_text(wsrwjs.no_results_found):i.display_text(wsrwjs.finished),n("body").removeClass("wsrw-no-close"),i.dry_run?i.$do_button.prop("disabled",!1):i.$undo_button.show(),n(t).trigger("wsr_search_replace_finished")},display_text(t){i.$text_display.text(t)},fit_results(){const t=i.$modal.height();let e=0;i.$modal.children().each((function(){if(!n(this).is(i.results)){const t=n(this).outerHeight(!0);e+=t}})),i.results.height(t-e)},init_upsell(){n("body").hasClass("wsrw-not-licensed")&&(i.$table.on("click",".wsrw-check-row-input",(function(t){t.preventDefault(),i.show_upsell(wsrwjs.check_row_title,wsrwjs.check_row_content,wsrwjs.check_row_url)})),i.$table.on("click",".wsrw-row-info",(function(t){t.preventDefault(),t.stopPropagation(),i.show_upsell(wsrwjs.row_info_title,wsrwjs.row_info_content,wsrwjs.row_info_url)})))},show_upsell(t,i,s,o){o=o||wsrwjs.upgrade_to_pro,n.alert({title:t,content:i,type:"blue",animateFromElement:!1,backgroundDismiss:!0,boxWidth:"550px",draggable:!1,buttons:{confirm:{text:o,btnClass:"wsrw-button wsrw-button-large wsrw-button-orange",keys:["enter"],action:function(){e.open(s,"_blank")}}},onOpenBefore(){wsrwjs.upgrade_bonus&&(this.$btnc.after('<div class="wsrw-discount-note">'+wsrwjs.upgrade_bonus+"</div>"),this.$body.find(".jconfirm-content").addClass("wsrw-lite-upgrade")),this.$icon.html(wsrwjs.lock_icon)},onContentReady(){this.$icon.html(wsrwjs.lock_icon)}})}};return i}(document,window,jQuery)).init()},124:()=>{(window.WSRSpinner||function(t,e,n){const i={init(){e.WSRSpinner=i,i.spinner=n("#wsrw-admin-spinner")},show_button_spinner(t,e="right"){t.prop("disabled",!0);const s=t.offset(),o=n("#adminmenuwrap").width(),a=n("#wpadminbar").height();let r={};i.spinner.show(),r="right"===e?{left:s.left-o+t.outerWidth(),top:s.top-a+t.outerHeight()/2-i.spinner.height()/2}:{left:s.left-o-i.spinner.outerWidth()-20,top:s.top-a+t.outerHeight()/2-i.spinner.height()/2},i.spinner.css(r)},hide_button_spinner(t){t.prop("disabled",!1),i.spinner.hide()}};return i}(document,window,jQuery)).init()},357:(t,e,n)=>{var i,s,o;s=[n(567)],void 0===(o="function"==typeof(i=function(t){var e=window;t.fn.confirm=function(n,i){return void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:i||!1}),t(this).each((function(){var i=t(this);i.attr("jc-attached")?console.warn("jConfirm has already been attached to this element ",i[0]):(i.on("click",(function(s){s.preventDefault();var o=t.extend({},n);if(i.attr("data-title")&&(o.title=i.attr("data-title")),i.attr("data-content")&&(o.content=i.attr("data-content")),void 0===o.buttons&&(o.buttons={}),o.$target=i,i.attr("href")&&0===Object.keys(o.buttons).length){var a=t.extend(!0,{},e.jconfirm.pluginDefaults.defaultButtons,(e.jconfirm.defaults||{}).defaultButtons||{}),r=Object.keys(a)[0];o.buttons=a,o.buttons[r].action=function(){location.href=i.attr("href")}}o.closeIcon=!1,t.confirm(o)})),i.attr("jc-attached",!0))})),t(this)},t.confirm=function(n,i){void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:i||!1});var s=!(!1===n.buttons);if("object"!=typeof n.buttons&&(n.buttons={}),0===Object.keys(n.buttons).length&&s){var o=t.extend(!0,{},e.jconfirm.pluginDefaults.defaultButtons,(e.jconfirm.defaults||{}).defaultButtons||{});n.buttons=o}return e.jconfirm(n)},t.alert=function(n,i){void 0===n&&(n={}),"string"==typeof n&&(n={content:n,title:i||!1});var s=!(!1===n.buttons);if("object"!=typeof n.buttons&&(n.buttons={}),0===Object.keys(n.buttons).length&&s){var o=t.extend(!0,{},e.jconfirm.pluginDefaults.defaultButtons,(e.jconfirm.defaults||{}).defaultButtons||{}),a=Object.keys(o)[0];n.buttons[a]=o[a]}return e.jconfirm(n)},t.dialog=function(t,n){return void 0===t&&(t={}),"string"==typeof t&&(t={content:t,title:n||!1,closeIcon:function(){}}),t.buttons={},void 0===t.closeIcon&&(t.closeIcon=function(){}),t.confirmKeys=[13],e.jconfirm(t)},e.jconfirm=function(n){void 0===n&&(n={});var i=t.extend(!0,{},e.jconfirm.pluginDefaults);e.jconfirm.defaults&&(i=t.extend(!0,i,e.jconfirm.defaults)),i=t.extend(!0,{},i,n);var s=new e.Jconfirm(i);return e.jconfirm.instances.push(s),s},e.Jconfirm=function(e){t.extend(this,e),this._init()},e.Jconfirm.prototype={_init:function(){var n=this;e.jconfirm.instances.length||(e.jconfirm.lastFocused=t("body").find(":focus")),this._id=Math.round(99999*Math.random()),this.contentParsed=t(document.createElement("div")),this.lazyOpen||setTimeout((function(){n.open()}),0)},_buildHTML:function(){var e=this;this._parseAnimation(this.animation,"o"),this._parseAnimation(this.closeAnimation,"c"),this._parseBgDismissAnimation(this.backgroundDismissAnimation),this._parseColumnClass(this.columnClass),this._parseTheme(this.theme),this._parseType(this.type);var n=t(this.template);n.find(".jconfirm-box").addClass(this.animationParsed).addClass(this.backgroundDismissAnimationParsed).addClass(this.typeParsed),this.typeAnimated&&n.find(".jconfirm-box").addClass("jconfirm-type-animated"),this.useBootstrap?(n.find(".jc-bs3-row").addClass(this.bootstrapClasses.row),n.find(".jc-bs3-row").addClass("justify-content-md-center justify-content-sm-center justify-content-xs-center justify-content-lg-center"),n.find(".jconfirm-box-container").addClass(this.columnClassParsed),this.containerFluid?n.find(".jc-bs3-container").addClass(this.bootstrapClasses.containerFluid):n.find(".jc-bs3-container").addClass(this.bootstrapClasses.container)):n.find(".jconfirm-box").css("width",this.boxWidth),this.titleClass&&n.find(".jconfirm-title-c").addClass(this.titleClass),n.addClass(this.themeParsed);var i="jconfirm-box"+this._id;n.find(".jconfirm-box").attr("aria-labelledby",i).attr("tabindex",-1),n.find(".jconfirm-content").attr("id",i),null!==this.bgOpacity&&n.find(".jconfirm-bg").css("opacity",this.bgOpacity),this.rtl&&n.addClass("jconfirm-rtl"),this.$el=n.appendTo(this.container),this.$jconfirmBoxContainer=this.$el.find(".jconfirm-box-container"),this.$jconfirmBox=this.$body=this.$el.find(".jconfirm-box"),this.$jconfirmBg=this.$el.find(".jconfirm-bg"),this.$title=this.$el.find(".jconfirm-title"),this.$titleContainer=this.$el.find(".jconfirm-title-c"),this.$content=this.$el.find("div.jconfirm-content"),this.$contentPane=this.$el.find(".jconfirm-content-pane"),this.$icon=this.$el.find(".jconfirm-icon-c"),this.$closeIcon=this.$el.find(".jconfirm-closeIcon"),this.$holder=this.$el.find(".jconfirm-holder"),this.$btnc=this.$el.find(".jconfirm-buttons"),this.$scrollPane=this.$el.find(".jconfirm-scrollpane"),e.setStartingPoint(),this._contentReady=t.Deferred(),this._modalReady=t.Deferred(),this.$holder.css({"padding-top":this.offsetTop,"padding-bottom":this.offsetBottom}),this.setTitle(),this.setIcon(),this._setButtons(),this._parseContent(),this.initDraggable(),this.isAjax&&this.showLoading(!1),t.when(this._contentReady,this._modalReady).then((function(){e.isAjaxLoading?setTimeout((function(){e.isAjaxLoading=!1,e.setContent(),e.setTitle(),e.setIcon(),setTimeout((function(){e.hideLoading(!1),e._updateContentMaxHeight()}),100),"function"==typeof e.onContentReady&&e.onContentReady()}),50):(e._updateContentMaxHeight(),e.setTitle(),e.setIcon(),"function"==typeof e.onContentReady&&e.onContentReady()),e.autoClose&&e._startCountDown()})).then((function(){e._watchContent()})),"none"===this.animation&&(this.animationSpeed=1,this.animationBounce=1),this.$body.css(this._getCSS(this.animationSpeed,this.animationBounce)),this.$contentPane.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBg.css(this._getCSS(this.animationSpeed,1)),this.$jconfirmBoxContainer.css(this._getCSS(this.animationSpeed,1))},_typePrefix:"jconfirm-type-",typeParsed:"",_parseType:function(t){this.typeParsed=this._typePrefix+t},setType:function(t){var e=this.typeParsed;this._parseType(t),this.$jconfirmBox.removeClass(e).addClass(this.typeParsed)},themeParsed:"",_themePrefix:"jconfirm-",setTheme:function(t){var e=this.theme;this.theme=t||this.theme,this._parseTheme(this.theme),e&&this.$el.removeClass(e),this.$el.addClass(this.themeParsed),this.theme=t},_parseTheme:function(e){var n=this;e=e.split(","),t.each(e,(function(i,s){-1===s.indexOf(n._themePrefix)&&(e[i]=n._themePrefix+t.trim(s))})),this.themeParsed=e.join(" ").toLowerCase()},backgroundDismissAnimationParsed:"",_bgDismissPrefix:"jconfirm-hilight-",_parseBgDismissAnimation:function(e){var n=e.split(","),i=this;t.each(n,(function(e,s){-1===s.indexOf(i._bgDismissPrefix)&&(n[e]=i._bgDismissPrefix+t.trim(s))})),this.backgroundDismissAnimationParsed=n.join(" ").toLowerCase()},animationParsed:"",closeAnimationParsed:"",_animationPrefix:"jconfirm-animation-",setAnimation:function(t){this.animation=t||this.animation,this._parseAnimation(this.animation,"o")},_parseAnimation:function(e,n){n=n||"o";var i=e.split(","),s=this;t.each(i,(function(e,n){-1===n.indexOf(s._animationPrefix)&&(i[e]=s._animationPrefix+t.trim(n))}));var o=i.join(" ").toLowerCase();return"o"===n?this.animationParsed=o:this.closeAnimationParsed=o,o},setCloseAnimation:function(t){this.closeAnimation=t||this.closeAnimation,this._parseAnimation(this.closeAnimation,"c")},setAnimationSpeed:function(t){this.animationSpeed=t||this.animationSpeed},columnClassParsed:"",setColumnClass:function(t){this.useBootstrap?(this.columnClass=t||this.columnClass,this._parseColumnClass(this.columnClass),this.$jconfirmBoxContainer.addClass(this.columnClassParsed)):console.warn("cannot set columnClass, useBootstrap is set to false")},_updateContentMaxHeight:function(){var e=t(window).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom);this.$contentPane.css({"max-height":e+"px"})},setBoxWidth:function(t){this.useBootstrap?console.warn("cannot set boxWidth, useBootstrap is set to true"):(this.boxWidth=t,this.$jconfirmBox.css("width",t))},_parseColumnClass:function(t){var e;switch(t=t.toLowerCase()){case"xl":case"xlarge":e="col-md-12";break;case"l":case"large":e="col-md-8 col-md-offset-2";break;case"m":case"medium":e="col-md-6 col-md-offset-3";break;case"s":case"small":e="col-md-4 col-md-offset-4";break;case"xs":case"xsmall":e="col-md-2 col-md-offset-5";break;default:e=t}this.columnClassParsed=e},initDraggable:function(){var e=this,n=this.$titleContainer;this.resetDrag(),this.draggable&&(n.on("mousedown",(function(t){n.addClass("jconfirm-hand"),e.mouseX=t.clientX,e.mouseY=t.clientY,e.isDrag=!0})),t(window).on("mousemove."+this._id,(function(t){e.isDrag&&(e.movingX=t.clientX-e.mouseX+e.initialX,e.movingY=t.clientY-e.mouseY+e.initialY,e.setDrag())})),t(window).on("mouseup."+this._id,(function(){n.removeClass("jconfirm-hand"),e.isDrag&&(e.isDrag=!1,e.initialX=e.movingX,e.initialY=e.movingY)})))},resetDrag:function(){this.isDrag=!1,this.initialX=0,this.initialY=0,this.movingX=0,this.movingY=0,this.mouseX=0,this.mouseY=0,this.$jconfirmBoxContainer.css("transform","translate(0px, 0px)")},setDrag:function(){if(this.draggable){this.alignMiddle=!1;var e=this.$jconfirmBox.outerWidth(),n=this.$jconfirmBox.outerHeight(),i=t(window).width(),s=t(window).height(),o=this;if(o.movingX%1==0||o.movingY%1==0){if(o.dragWindowBorder){var a=i/2-e/2,r=s/2-n/2;r-=o.dragWindowGap,(a-=o.dragWindowGap)+o.movingX<0?o.movingX=-a:a-o.movingX<0&&(o.movingX=a),r+o.movingY<0?o.movingY=-r:r-o.movingY<0&&(o.movingY=r)}o.$jconfirmBoxContainer.css("transform","translate("+o.movingX+"px, "+o.movingY+"px)")}}},_scrollTop:function(){if("undefined"!=typeof pageYOffset)return pageYOffset;var t=document.body,e=document.documentElement;return(e=e.clientHeight?e:t).scrollTop},_watchContent:function(){var e=this;this._timer&&clearInterval(this._timer);var n=0;this._timer=setInterval((function(){if(e.smoothContent){var i=e.$content.outerHeight()||0;i!==n&&(n=i);var s=t(window).height();e.offsetTop+e.offsetBottom+e.$jconfirmBox.height()-e.$contentPane.height()+e.$content.height()<s?e.$contentPane.addClass("no-scroll"):e.$contentPane.removeClass("no-scroll")}}),this.watchInterval)},_overflowClass:"jconfirm-overflow",_hilightAnimating:!1,highlight:function(){this.hiLightModal()},hiLightModal:function(){var t=this;if(!this._hilightAnimating){t.$body.addClass("hilight");var e=parseFloat(t.$body.css("animation-duration"))||2;this._hilightAnimating=!0,setTimeout((function(){t._hilightAnimating=!1,t.$body.removeClass("hilight")}),1e3*e)}},_bindEvents:function(){var e=this;this.boxClicked=!1,this.$scrollPane.click((function(t){if(!e.boxClicked){var n,i=!1,s=!1;if("string"==typeof(n="function"==typeof e.backgroundDismiss?e.backgroundDismiss():e.backgroundDismiss)&&void 0!==e.buttons[n]?(i=n,s=!1):s=void 0===n||1==!!n,i){var o=e.buttons[i].action.apply(e);s=void 0===o||!!o}s?e.close():e.hiLightModal()}e.boxClicked=!1})),this.$jconfirmBox.click((function(t){e.boxClicked=!0}));var n=!1;t(window).on("jcKeyDown."+e._id,(function(t){n||(n=!0)})),t(window).on("keyup."+e._id,(function(t){n&&(e.reactOnKey(t),n=!1)})),t(window).on("resize."+this._id,(function(){e._updateContentMaxHeight(),setTimeout((function(){e.resetDrag()}),100)}))},_cubic_bezier:"0.36, 0.55, 0.19",_getCSS:function(t,e){return{"-webkit-transition-duration":t/1e3+"s","transition-duration":t/1e3+"s","-webkit-transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+e+")","transition-timing-function":"cubic-bezier("+this._cubic_bezier+", "+e+")"}},_setButtons:function(){var e=this,n=0;if("object"!=typeof this.buttons&&(this.buttons={}),t.each(this.buttons,(function(i,s){n+=1,"function"==typeof s&&(e.buttons[i]=s={action:s}),e.buttons[i].text=s.text||i,e.buttons[i].btnClass=s.btnClass||"btn-default",e.buttons[i].action=s.action||function(){},e.buttons[i].keys=s.keys||[],e.buttons[i].isHidden=s.isHidden||!1,e.buttons[i].isDisabled=s.isDisabled||!1,t.each(e.buttons[i].keys,(function(t,n){e.buttons[i].keys[t]=n.toLowerCase()}));var o=t('<button type="button" class="btn"></button>').html(e.buttons[i].text).addClass(e.buttons[i].btnClass).prop("disabled",e.buttons[i].isDisabled).css("display",e.buttons[i].isHidden?"none":"").click((function(t){t.preventDefault();var n=e.buttons[i].action.apply(e,[e.buttons[i]]);e.onAction.apply(e,[i,e.buttons[i]]),e._stopCountDown(),(void 0===n||n)&&e.close()}));e.buttons[i].el=o,e.buttons[i].setText=function(t){o.html(t)},e.buttons[i].addClass=function(t){o.addClass(t)},e.buttons[i].removeClass=function(t){o.removeClass(t)},e.buttons[i].disable=function(){e.buttons[i].isDisabled=!0,o.prop("disabled",!0)},e.buttons[i].enable=function(){e.buttons[i].isDisabled=!1,o.prop("disabled",!1)},e.buttons[i].show=function(){e.buttons[i].isHidden=!1,o.css("display","")},e.buttons[i].hide=function(){e.buttons[i].isHidden=!0,o.css("display","none")},e["$_"+i]=e["$$"+i]=o,e.$btnc.append(o)})),0===n&&this.$btnc.hide(),null===this.closeIcon&&0===n&&(this.closeIcon=!0),this.closeIcon){if(this.closeIconClass){var i='<i class="'+this.closeIconClass+'"></i>';this.$closeIcon.html(i)}this.$closeIcon.click((function(t){t.preventDefault();var n,i=!1,s=!1;if("string"==typeof(n="function"==typeof e.closeIcon?e.closeIcon():e.closeIcon)&&void 0!==e.buttons[n]?(i=n,s=!1):s=void 0===n||1==!!n,i){var o=e.buttons[i].action.apply(e);s=void 0===o||!!o}s&&e.close()})),this.$closeIcon.show()}else this.$closeIcon.hide()},setTitle:function(t,e){if(e=e||!1,void 0!==t)if("string"==typeof t)this.title=t;else if("function"==typeof t){"function"==typeof t.promise&&console.error("Promise was returned from title function, this is not supported.");var n=t();this.title="string"==typeof n&&n}else this.title=!1;this.isAjaxLoading&&!e||(this.$title.html(this.title||""),this.updateTitleContainer())},setIcon:function(t,e){if(e=e||!1,void 0!==t)if("string"==typeof t)this.icon=t;else if("function"==typeof t){var n=t();this.icon="string"==typeof n&&n}else this.icon=!1;this.isAjaxLoading&&!e||(this.$icon.html(this.icon?'<i class="'+this.icon+'"></i>':""),this.updateTitleContainer())},updateTitleContainer:function(){this.title||this.icon?this.$titleContainer.show():this.$titleContainer.hide()},setContentPrepend:function(t,e){t&&this.contentParsed.prepend(t)},setContentAppend:function(t){t&&this.contentParsed.append(t)},setContent:function(t,e){e=!!e;var n=this;t&&this.contentParsed.html("").append(t),this.isAjaxLoading&&!e||(this.$content.html(""),this.$content.append(this.contentParsed),setTimeout((function(){n.$body.find("input[autofocus]:visible:first").focus()}),100))},loadingSpinner:!1,showLoading:function(t){this.loadingSpinner=!0,this.$jconfirmBox.addClass("loading"),t&&this.$btnc.find("button").prop("disabled",!0)},hideLoading:function(t){this.loadingSpinner=!1,this.$jconfirmBox.removeClass("loading"),t&&this.$btnc.find("button").prop("disabled",!1)},ajaxResponse:!1,contentParsed:"",isAjax:!1,isAjaxLoading:!1,_parseContent:function(){var e=this,n=" ";if("function"==typeof this.content){var i=this.content.apply(this);"string"==typeof i?this.content=i:"object"==typeof i&&"function"==typeof i.always?(this.isAjax=!0,this.isAjaxLoading=!0,i.always((function(t,n,i){e.ajaxResponse={data:t,status:n,xhr:i},e._contentReady.resolve(t,n,i),"function"==typeof e.contentLoaded&&e.contentLoaded(t,n,i)})),this.content=n):this.content=n}if("string"==typeof this.content&&"url:"===this.content.substr(0,4).toLowerCase()){this.isAjax=!0,this.isAjaxLoading=!0;var s=this.content.substring(4,this.content.length);t.get(s).done((function(t){e.contentParsed.html(t)})).always((function(t,n,i){e.ajaxResponse={data:t,status:n,xhr:i},e._contentReady.resolve(t,n,i),"function"==typeof e.contentLoaded&&e.contentLoaded(t,n,i)}))}this.content||(this.content=n),this.isAjax||(this.contentParsed.html(this.content),this.setContent(),e._contentReady.resolve())},_stopCountDown:function(){clearInterval(this.autoCloseInterval),this.$cd&&this.$cd.remove()},_startCountDown:function(){var e=this,n=this.autoClose.split("|");if(2!==n.length)return console.error("Invalid option for autoClose. example 'close|10000'"),!1;var i=n[0],s=parseInt(n[1]);if(void 0===this.buttons[i])return console.error("Invalid button key '"+i+"' for autoClose"),!1;var o=Math.ceil(s/1e3);this.$cd=t('<span class="countdown"> ('+o+")</span>").appendTo(this["$_"+i]),this.autoCloseInterval=setInterval((function(){e.$cd.html(" ("+(o-=1)+") "),o<=0&&(e["$$"+i].trigger("click"),e._stopCountDown())}),1e3)},_getKey:function(t){switch(t){case 192:return"tilde";case 13:return"enter";case 16:return"shift";case 9:return"tab";case 20:return"capslock";case 17:return"ctrl";case 91:return"win";case 18:return"alt";case 27:return"esc";case 32:return"space"}var e=String.fromCharCode(t);return!!/^[A-z0-9]+$/.test(e)&&e.toLowerCase()},reactOnKey:function(e){var n=this,i=t(".jconfirm");if(i.eq(i.length-1)[0]!==this.$el[0])return!1;var s=e.which;if(this.$content.find(":input").is(":focus")&&/13|32/.test(s))return!1;var o,a=this._getKey(s);"esc"===a&&this.escapeKey&&(!0===this.escapeKey?this.$scrollPane.trigger("click"):"string"!=typeof this.escapeKey&&"function"!=typeof this.escapeKey||(o="function"==typeof this.escapeKey?this.escapeKey():this.escapeKey)&&(void 0===this.buttons[o]?console.warn("Invalid escapeKey, no buttons found with key "+o):this["$_"+o].trigger("click"))),t.each(this.buttons,(function(t,e){-1!==e.keys.indexOf(a)&&n["$_"+t].trigger("click")}))},setDialogCenter:function(){console.info("setDialogCenter is deprecated, dialogs are centered with CSS3 tables")},_unwatchContent:function(){clearInterval(this._timer)},close:function(n){var i=this;return"function"==typeof this.onClose&&this.onClose(n),this._unwatchContent(),t(window).unbind("resize."+this._id),t(window).unbind("keyup."+this._id),t(window).unbind("jcKeyDown."+this._id),this.draggable&&(t(window).unbind("mousemove."+this._id),t(window).unbind("mouseup."+this._id),this.$titleContainer.unbind("mousedown")),i.$el.removeClass(i.loadedClass),t("body").removeClass("jconfirm-no-scroll-"+i._id),i.$jconfirmBoxContainer.removeClass("jconfirm-no-transition"),setTimeout((function(){i.$body.addClass(i.closeAnimationParsed),i.$jconfirmBg.addClass("jconfirm-bg-h");var n="none"===i.closeAnimation?1:i.animationSpeed;setTimeout((function(){i.$el.remove(),e.jconfirm.instances;for(var n=e.jconfirm.instances.length-1;n>=0;n--)e.jconfirm.instances[n]._id===i._id&&e.jconfirm.instances.splice(n,1);if(!e.jconfirm.instances.length&&i.scrollToPreviousElement&&e.jconfirm.lastFocused&&e.jconfirm.lastFocused.length&&t.contains(document,e.jconfirm.lastFocused[0])){var s=e.jconfirm.lastFocused;if(i.scrollToPreviousElementAnimate){var o=t(window).scrollTop(),a=e.jconfirm.lastFocused.offset().top,r=t(window).height();if(a>o&&a<o+r)s.focus();else{var c=a-Math.round(r/3);t("html, body").animate({scrollTop:c},i.animationSpeed,"swing",(function(){s.focus()}))}}else s.focus();e.jconfirm.lastFocused=!1}"function"==typeof i.onDestroy&&i.onDestroy()}),.4*n)}),50),!0},open:function(){return!this.isOpen()&&(this._buildHTML(),this._bindEvents(),this._open(),!0)},setStartingPoint:function(){var n=!1;if(!0!==this.animateFromElement&&this.animateFromElement)n=this.animateFromElement,e.jconfirm.lastClicked=!1;else{if(!e.jconfirm.lastClicked||!0!==this.animateFromElement)return!1;n=e.jconfirm.lastClicked,e.jconfirm.lastClicked=!1}if(!n)return!1;var i=n.offset(),s=n.outerHeight()/2,o=n.outerWidth()/2;s-=this.$jconfirmBox.outerHeight()/2,o-=this.$jconfirmBox.outerWidth()/2;var a=i.top+s;a-=this._scrollTop();var r=i.left+o,c=t(window).height()/2,l=t(window).width()/2;if(a-=c-this.$jconfirmBox.outerHeight()/2,r-=l-this.$jconfirmBox.outerWidth()/2,Math.abs(a)>c||Math.abs(r)>l)return!1;this.$jconfirmBoxContainer.css("transform","translate("+r+"px, "+a+"px)")},_open:function(){var t=this;"function"==typeof t.onOpenBefore&&t.onOpenBefore(),this.$body.removeClass(this.animationParsed),this.$jconfirmBg.removeClass("jconfirm-bg-h"),this.$body.focus(),t.$jconfirmBoxContainer.css("transform","translate(0px, 0px)"),setTimeout((function(){t.$body.css(t._getCSS(t.animationSpeed,1)),t.$body.css({"transition-property":t.$body.css("transition-property")+", margin"}),t.$jconfirmBoxContainer.addClass("jconfirm-no-transition"),t._modalReady.resolve(),"function"==typeof t.onOpen&&t.onOpen(),t.$el.addClass(t.loadedClass)}),this.animationSpeed)},loadedClass:"jconfirm-open",isClosed:function(){return!this.$el||0===this.$el.parent().length},isOpen:function(){return!this.isClosed()},toggle:function(){this.isOpen()?this.close():this.open()}},e.jconfirm.instances=[],e.jconfirm.lastFocused=!1,e.jconfirm.pluginDefaults={template:'<div class="jconfirm"><div class="jconfirm-bg jconfirm-bg-h"></div><div class="jconfirm-scrollpane"><div class="jconfirm-row"><div class="jconfirm-cell"><div class="jconfirm-holder"><div class="jc-bs3-container"><div class="jc-bs3-row"><div class="jconfirm-box-container jconfirm-animated"><div class="jconfirm-box" role="dialog" aria-labelledby="labelled" tabindex="-1"><div class="jconfirm-closeIcon">×</div><div class="jconfirm-title-c"><span class="jconfirm-icon-c"></span><span class="jconfirm-title"></span></div><div class="jconfirm-content-pane"><div class="jconfirm-content"></div></div><div class="jconfirm-buttons"></div><div class="jconfirm-clear"></div></div></div></div></div></div></div></div></div></div>',title:"Hello",titleClass:"",type:"default",typeAnimated:!0,draggable:!0,dragWindowGap:15,dragWindowBorder:!0,animateFromElement:!0,alignMiddle:!0,smoothContent:!0,content:"Are you sure to continue?",buttons:{},defaultButtons:{ok:{action:function(){}},close:{action:function(){}}},contentLoaded:function(){},icon:"",lazyOpen:!1,bgOpacity:null,theme:"light",animation:"scale",closeAnimation:"scale",animationSpeed:400,animationBounce:1,escapeKey:!0,rtl:!1,container:"body",containerFluid:!1,backgroundDismiss:!1,backgroundDismissAnimation:"shake",autoClose:!1,closeIcon:null,closeIconClass:!1,watchInterval:100,columnClass:"col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1",boxWidth:"50%",scrollToPreviousElement:!0,scrollToPreviousElementAnimate:!0,useBootstrap:!0,offsetTop:40,offsetBottom:40,bootstrapClasses:{container:"container",containerFluid:"container-fluid",row:"row"},onContentReady:function(){},onOpenBefore:function(){},onOpen:function(){},onClose:function(){},onDestroy:function(){},onAction:function(){}};var n=!1;t(window).on("keydown",(function(e){if(!n){var i=!1;t(e.target).closest(".jconfirm-box").length&&(i=!0),i&&t(window).trigger("jcKeyDown"),n=!0}})),t(window).on("keyup",(function(){n=!1})),e.jconfirm.lastClicked=!1,t(document).on("mousedown","button, a, [jc-source]",(function(){e.jconfirm.lastClicked=t(this)}))})?i.apply(e,s):i)||(t.exports=o)},567:t=>{"use strict";t.exports=window.jQuery}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}(()=>{"use strict";n(357),n(298),n(215),n(116),n(399),n(124)})()})();