!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("jquery"),require("bootstrap")):"function"==typeof define&&define.amd?define(["jquery","bootstrap"],t):t(n.jQuery)}(this,function(n){"use strict";function h(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function c(n){for(var i,r,t=1;t<arguments.length;t++)i=null!=arguments[t]?arguments[t]:{},r=Object.keys(i),"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(i).filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable}))),r.forEach(function(t){var r,u,f;r=n;f=i[u=t];u in r?Object.defineProperty(r,u,{value:f,enumerable:!0,configurable:!0,writable:!0}):r[u]=f});return n}if("undefined"==typeof(n=n&&n.hasOwnProperty("default")?n.default:n).fn.popover||"4"!==n.fn.popover.Constructor.VERSION.split(".").shift())throw new Error("Bootstrap Confirmation 4 requires Bootstrap Popover 4");var f,e=n.fn.popover.Constructor,r="confirmation",u="bs."+r,t="."+u,v=n.fn[r],o="btn btn-sm h-100 d-flex align-items-center",y=c({},e.DefaultType,{singleton:"boolean",popout:"boolean",copyAttributes:"(string|array)",onConfirm:"function",onCancel:"function",btnOkClass:"string",btnOkLabel:"string",btnOkIconClass:"string",btnOkIconContent:"string",btnCancelClass:"string",btnCancelLabel:"string",btnCancelIconClass:"string",btnCancelIconContent:"string",buttons:"array"}),p=c({},e.Default,{_attributes:{},_selector:null,placement:"top",title:"Are you sure?",trigger:"click",confirmationEvent:void 0,content:"",singleton:!1,popout:!1,copyAttributes:"href target",onConfirm:n.noop,onCancel:n.noop,btnOkClass:"btn-primary",btnOkLabel:"Yes",btnOkIconClass:"",btnOkIconContent:"",btnCancelClass:"btn-secondary",btnCancelLabel:"No",btnCancelIconClass:"",btnCancelIconContent:"",buttons:[],template:'\n<div class="popover confirmation">\n  <div class="arrow"><\/div>\n  <h3 class="popover-header"><\/h3>\n  <div class="popover-body">\n    <p class="confirmation-content"><\/p>\n    <div class="confirmation-buttons text-center">\n      <div class="btn-group">\n        <a href="#" class="'+o+'" data-apply="confirmation"><\/a>\n        <a href="#" class="'+o+'" data-dismiss="confirmation"><\/a>\n      <\/div>\n    <\/div>\n  <\/div>\n<\/div>'}),w="fade",b="show",k=".popover-header",l=".confirmation-content",a=".confirmation-buttons .btn-group",d="[data-apply=confirmation]",g="[data-dismiss=confirmation]",nt={13:"Enter",27:"Escape",39:"ArrowRight",40:"ArrowDown"},i={HIDE:"hide"+t,HIDDEN:"hidden"+t,SHOW:"show"+t,SHOWN:"shown"+t,INSERTED:"inserted"+t,CLICK:"click"+t,FOCUSIN:"focusin"+t,FOCUSOUT:"focusout"+t,MOUSEENTER:"mouseenter"+t,MOUSELEAVE:"mouseleave"+t,CONFIRMED:"confirmed"+t,CANCELED:"canceled"+t,KEYUP:"keyup"+t},s=function(e){function c(n,t){var i;if(((i=e.call(this,n,t)||this).config.popout||i.config.singleton)&&!i.config.rootSelector)throw new Error("The rootSelector option is required to use popout and singleton features since jQuery 3.");return i._isDelegate=!1,t.selector?(t._selector=t.rootSelector+" "+t.selector,i.config._selector=t._selector):t._selector?(i.config._selector=t._selector,i._isDelegate=!0):i.config._selector=t.rootSelector,void 0===i.config.confirmationEvent&&(i.config.confirmationEvent=i.config.trigger),i.config.selector||i._copyAttributes(),i._setConfirmationListeners(),i}var v,tt,it,ut,rt,s;return tt=e,(v=c).prototype=Object.create(tt.prototype),(v.prototype.constructor=v).__proto__=tt,it=c,rt=[{key:"VERSION",get:function(){return"4.0.2"}},{key:"Default",get:function(){return p}},{key:"NAME",get:function(){return r}},{key:"DATA_KEY",get:function(){return u}},{key:"Event",get:function(){return i}},{key:"EVENT_KEY",get:function(){return t}},{key:"DefaultType",get:function(){return y}}],(ut=null)&&h(it.prototype,ut),rt&&h(it,rt),s=c.prototype,s.isWithContent=function(){return!0},s.setContent=function(){var t=n(this.getTipElement()),i=this._getContent();"function"==typeof i&&(i=i.call(this.element));this.setElementContent(t.find(k),this.getTitle());t.find(l).toggle(!!i);i&&this.setElementContent(t.find(l),i);0<this.config.buttons.length?this._setCustomButtons(t):this._setStandardButtons(t);t.removeClass(w+" "+b);this._setupKeyupEvent()},s.dispose=function(){this._cleanKeyupEvent();e.prototype.dispose.call(this)},s.hide=function(n){this._cleanKeyupEvent();e.prototype.hide.call(this,n)},s._copyAttributes=function(){var t=this;this.config._attributes={};this.config.copyAttributes?"string"==typeof this.config.copyAttributes&&(this.config.copyAttributes=this.config.copyAttributes.split(" ")):this.config.copyAttributes=[];this.config.copyAttributes.forEach(function(i){t.config._attributes[i]=n(t.element).attr(i)})},s._setConfirmationListeners=function(){var t=this;this.config.selector?n(this.element).on(this.config.trigger,this.config.selector,function(n,t){t||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation())}):(n(this.element).on(this.config.trigger,function(n,t){t||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation())}),n(this.element).on(i.SHOWN,function(){t.config.singleton&&n(t.config._selector).not(n(this)).filter(function(){return void 0!==n(this).data(u)}).confirmation("hide")}));this._isDelegate||(this.eventBody=!1,this.uid=this.element.id||c.getUID(r+"_group"),n(this.element).on(i.SHOWN,function(){t.config.popout&&!t.eventBody&&(t.eventBody=n("body").on(i.CLICK+"."+t.uid,function(r){n(t.config._selector).is(r.target)||(n(t.config._selector).filter(function(){return void 0!==n(this).data(u)}).confirmation("hide"),n("body").off(i.CLICK+"."+t.uid),t.eventBody=!1)}))}))},s._setStandardButtons=function(t){var r=this,f=t.find(d).addClass(this.config.btnOkClass).html(this.config.btnOkLabel).attr(this.config._attributes),u;(this.config.btnOkIconClass||this.config.btnOkIconContent)&&f.prepend(n("<i><\/i>").addClass(this.config.btnOkIconClass||"").text(this.config.btnOkIconContent||""));f.off("click").one("click",function(t){"#"===n(this).attr("href")&&t.preventDefault();r.config.onConfirm.call(r.element);n(r.element).trigger(i.CONFIRMED);n(r.element).trigger(r.config.confirmationEvent,[!0]);r.hide()});u=t.find(g).addClass(this.config.btnCancelClass).html(this.config.btnCancelLabel);(this.config.btnCancelIconClass||this.config.btnCancelIconContent)&&u.prepend(n("<i><\/i>").addClass(this.config.btnCancelIconClass||"").text(this.config.btnCancelIconContent||""));u.off("click").one("click",function(t){t.preventDefault();r.config.onCancel.call(r.element);n(r.element).trigger(i.CANCELED);r.hide()})},s._setCustomButtons=function(t){var r=this,u=t.find(a).empty();this.config.buttons.forEach(function(t){var f=n('<a href="#"><\/a>').addClass(o).addClass(t.class||"btn btn-secondary").html(t.label||"").attr(t.attr||{});(t.iconClass||t.iconContent)&&f.prepend(n("<i><\/i>").addClass(t.iconClass||"").text(t.iconContent||""));f.one("click",function(u){"#"===n(this).attr("href")&&u.preventDefault();t.onClick&&t.onClick.call(n(r.element));t.cancel?(r.config.onCancel.call(r.element,t.value),n(r.element).trigger(i.CANCELED,[t.value])):(r.config.onConfirm.call(r.element,t.value),n(r.element).trigger(i.CONFIRMED,[t.value]));r.hide()});u.append(f)})},s._setupKeyupEvent=function(){f=this;n(window).off(i.KEYUP).on(i.KEYUP,this._onKeyup.bind(this))},s._cleanKeyupEvent=function(){f===this&&(f=void 0,n(window).off(i.KEYUP))},s._onKeyup=function(t){if(this.tip){var r,f=n(this.getTipElement()),e=t.key||nt[t.keyCode||t.which],u=f.find(a),i=u.find(".active");switch(e){case"Escape":this.hide();break;case"ArrowRight":r=i.length&&i.next().length?i.next():u.children().first();i.removeClass("active");r.addClass("active").focus();break;case"ArrowLeft":r=i.length&&i.prev().length?i.prev():u.children().last();i.removeClass("active");r.addClass("active").focus()}}else this._cleanKeyupEvent()},c.getUID=function(n){for(var t=n;t+=~~(1e6*Math.random()),document.getElementById(t););return t},c._jQueryInterface=function(t){return this.each(function(){var i=n(this).data(u),r="object"==typeof t?t:{};if(r.rootSelector=n(this).selector||r.rootSelector,(i||!/destroy|hide/.test(t))&&(i||(i=new c(this,r),n(this).data(u,i)),"string"==typeof t)){if("undefined"==typeof i[t])throw new TypeError('No method named "'+t+'"');i[t]()}})},c}(e);n.fn[r]=s._jQueryInterface;n.fn[r].Constructor=s;n.fn[r].noConflict=function(){return n.fn[r]=v,s._jQueryInterface}})