PageSourceSearch

https://redbarrelsgames.com/wp-content/themes/redbarrelsgames/dist…ter_index_js.f05228b7a3e606206c68.bundle.js

js redbarrelsgames.com collected 2026-10-02 05:06:19 UTC 4,271 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkredbarrelsgames=self.webpackChunkredbarrelsgames||[]).push([["src_js_modules_newsletter_index_js"],{
1"./src/js/modules/newsletter/index.js":(t,i,s)=>{s.r(i),s.d(i,{default:()=>a});var e=s("./src/js/utils/dom.js"),n=s("./src/js/utils/listener.js");function o(t,i){for(var s=0;s<i.length;s++){var e=i[s];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}var r="--filled",u="--validation-reported",h="--wp-success",l="--wp-error";const a=function(){function t(i){!function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}(this,t),this.el=i,this.form=(0,e.$)(".newsletter__form",this.el),this.input=(0,e.$)(".newsletter__form__input",this.form),this.btn=(0,e.$)(".newsletter__form__submit",this.form),this.output=(0,e.$)(".newsletter__form__output",this.form),this._waiting=!1,this._timer=null,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this),this._onSubmit=this._onSubmit.bind(this),this._onSubmitCallback=this._onSubmitCallback.bind(this),this._onSubmitError=this._onSubmitError.bind(this),this._onReset=this._onReset.bind(this),this._send=this._send.bind(this),this._removeOutputMessage=this._removeOutputMessage.bind(this)}var i,s,a;return i=t,s=[{key:"init",value:function(){this.input&&((0,n.on)(this.input,"focus",this._onFocus),(0,n.on)(this.input,"blur",this._onBlur),this.input.value.trim()&&this._onFocus()),this.form&&((0,n.on)(this.form,"submit",this._onSubmit),(0,n.on)(this.form,"reset",this._onReset))}},{key:"destroy",value:function(){this.input&&((0,n.S1)(this.input,"focus",this._onFocus),(0,n.S1)(this.input,"blur",this._onBlur)),this.form&&((0,n.S1)(this.form,"submit",this._onSubmit),(0,n.S1)(this.form,"reset",this._onReset)),this.el=null,this.form=null,this.input=null,this.btn=null,this.output=null,this._onFocus=null,this._onBlur=null,this._onSubmit=null,this._onSubmitCallback=null,this._onSubmitError=null,this._onReset=null,this._send=null,this._removeOutputMessage=null}},{key:"_onFocus",value:function(){this._timer&&clearTimeout(this._timer),this._timer=null,this.form.classList.contains(h)&&(this.form.classList.remove(h),this.output&&(this.output.innerHTML="")),this.form.classList.add(r)}},{key:"_onBlur",value:function(){this.input&&this.input.value.trim()||this.form.classList.remove(r)}},{key:"_onSubmit",value:function(t){return t&&(t.preventDefault(),t.stopImmediatePropagation()),this.form.classList.contains(h)||this.form.classList.remove(h),this.form.classList.contains(u)||this.form.classList.add(u),this.form.reportValidity&&!this.form.reportValidity()||!0===this._waiting||(this._waiting=!0,this._timer&&clearTimeout(this._timer),this._timer=null,this.btn&&this.btn.setAttribute("disabled",!0),this.output&&(this.output.classList.remove(l),this.output.innerHTML=""),window.grecaptcha&&window.reCAPTCHA_SITE_KEY?window.grecaptcha.execute(window.reCAPTCHA_SITE_KEY,{action:"newsletter"}).then(this._send):this._send()),!1}},{key:"_onSubmitCallback",value:function(t){var i=t.success,s=t.message,e=t.errors;i&&(this.form.classList.remove(u),this.form.classList.add(h),this.form.reset()),s&&this.output&&!e&&(i||this.output.classList.add(l),this.output.innerHTML=s,i&&(this._timer=setTimeout(this._removeOutputMessage,5e3))),this.btn&&this.btn.removeAttribute("disabled"),this._waiting=!1}},{key:"_onSubmitError",value:function(t){this.output&&(this.output.classList.add(l),this.output.innerHTML=t),this.form.classList.remove(u),this.btn&&this.btn.removeAttribute("disabled"),this._waiting=!1}},{key:"_onReset",value:function(){this._onBlur()}},{key:"_send",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this.form.getAttribute("action"),s=new FormData(this.form);return t&&s.append("reCAPTCHA",t),fetch(i,{method:"post",body:s}).then((function(t){return t.json()})).then(this._onSubmitCallback).catch(this._onSubmitError)}},{key:"_removeOutputMessage",value:function(){this._timer&&clearTimeout(this._timer),this._timer=null,this.form&&this.form.classList.remove(r,h),this.output&&(this.output.innerHTML="")}}],s&&o(i.prototype,s),a&&o(i,a),t}()}
1}]);
2//# sourceMappingURL=src_js_modules_newsletter_index_js.f05228b7a3e606206c68.bundle.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.