"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var PcFundraisers=function(){function e(){_classCallCheck(this,e)}return _createClass(e,[{key:"init",value:function(){this.selector={button:{clearFilter:".pc-fr-clear-filter"},presentation:{container:".pc-single-fundraiser-presentation-container",containerLoader:".pc-single-fundraiser-presentation-container-loader",containerShortcode:".pc-single-fundraiser-presentation-container-shortcode",closeButton:".pc-single-fundraiser-presentation-container-shortcode-close-button"}},this.initEventHandlers(),this.initPresentationContainer()}},{key:"initEventHandlers",value:function(){jQuery(document).on("click",this.selector.button.clearFilter,this.handleClearFilter)}},{key:"handleClearFilter",value:function(e){e.preventDefault();var t=window.location.href.split("?")[0];window.location=t}},{key:"initPresentationContainer",value:function(){var e=new URL(window.location.href),t=e.searchParams.get("fundraiser");if(void 0!==t&&t){var n=e.searchParams.get("campaign");if(void 0!==n&&n){var r=document.querySelector("".concat(window.PcFundraisers.selector.presentation.container,'[data-fundraiser-slug="').concat(t,'"][data-campaign-id="').concat(n,'"]'));void 0!==r&&r&&(r.querySelector(window.PcFundraisers.selector.presentation.containerLoader).style.display="none",r.querySelector(window.PcFundraisers.selector.presentation.containerShortcode).classList.add("active"),r.querySelector(window.PcFundraisers.selector.presentation.closeButton).addEventListener("click",(function(e){e.preventDefault(),r.remove()})))}}}}]),e}();window.PcFundraisers=new PcFundraisers;