// source --> https://pannonpilgrim.hu/wp-content/plugins/form-maker/booster/assets/js/global.js?ver=1.0.0 
jQuery(function () {
  /* Change the CTA for pages with PG in it.*/
  if (jQuery(".bwg-container").length) {
    var html = '<div class="twb_admin_bar_menu_header">';
    html += '<img class="twb_menu_logo" src="' + twb.plugin_url + '/assets/images/logo_white.svg" />';
    html += '<div class="twb_menu_logo">Optimize Images</div>';
    html += '</div>';
    jQuery(".twb_admin_bar_menu").html(html).on("click", function () {
      window.open(twb.href, '_blank');
    });
    jQuery(".twb_admin_bar_menu_main").remove();
  }

  /* Is score check in progress.*/
  twb_inprogress = false;

  /* Check if any score check is in progress.*/
  jQuery(".twb-notoptimized").each(function () {
    if (jQuery(this).data("status") == 'inprogress') {
      /* Disable score check button.*/
      twb_disable_check();
    }
  });

  /* Add check score action to the button in page/posts list,
    if there is no inprogress action.*/
  jQuery(".twb-notoptimized .twb_check_score_button").on("click", function () {
    if (!twb_inprogress) {
      twb_check_score(this);
    }
  });

  /* Add a hover action to show dismiss tooltip.*/
  jQuery("th[id^='twb-speed-']").hover(function () {
      jQuery(this).find(".twb-dismiss-container").removeClass("twb-hidden");
    },
    function () {
      jQuery(this).find(".twb-dismiss-container").addClass("twb-hidden");
    });

  /* Add a hover action to show page score.*/
  jQuery(".twb-see-score").hover(function () {
      jQuery(this).parent().parent().find(".twb-score-container").removeClass("twb-hidden");
    },
    function () {
      jQuery(this).parent().parent().find(".twb-score-container").addClass("twb-hidden");
    });
  jQuery(".twb-score-container:not(.twb_admin_bar_menu_content .twb-score-container), .twb-score-disabled-container").hover(function () {
      jQuery(this).removeClass("twb-hidden");
    },
    function () {
      jQuery(this).addClass("twb-hidden");
    });

  /* Draw circle on given scores.*/
  jQuery(".twb-score-circle").each(function () {
    twb_draw_score_circle(this);
  });

  /* Show/hide Image optimizer menu content container */
  jQuery("#wp-admin-bar-twb_adminbar_info").mouseenter(function(){
    jQuery(".twb_admin_bar_menu_main .twb-score-container").removeClass("twb-hidden");
    jQuery(".twb_admin_bar_menu_main").removeClass("twb-hidden");
  }).mouseleave(function() {
    jQuery(".twb_admin_bar_menu_main").addClass("twb-hidden");
  });


  /* Draw circle on given scores.*/
  jQuery('.twb-score-circle').each(function () {
    twb_draw_score_circle(this);
  });

  if( jQuery(".twb_admin_bar_menu.twb_backend span").hasClass("twb_backend_optimizing_logo") ) {
    /* Run ajax every 30 seconds to check if score counted */
    twb_run_notif_check = setInterval( twb_run_notif_check, 30000 );
  }
});

/* Run ajax to check score counting status and show notification */
function twb_run_notif_check() {
  jQuery.ajax({
    type: "POST",
    url: twb.ajax_url,
    data: {
      action: "twb_notif_check",
      twb_nonce: twb.nonce,
    }
  }).success(function (results) {
    var result = jQuery.parseJSON(results);
    if (result.html != "") {
      /* Show notification popup and change menu icon and text from loading to Not optimised */
      if ( result.changeLogo == 1 ) {
        jQuery(".twb_admin_bar_menu_header span").addClass("twb_counted");
      }
      jQuery("#wp-admin-bar-twb_adminbar_info").append(result.html);
      jQuery(".twb_admin_bar_menu_content .twb-score-container").removeClass("twb-hidden");
      jQuery(".twb_admin_bar_menu_content .twb-score-container .twb-score-circle").each(function () {
        twb_draw_score_circle(this);
      });
      clearInterval(twb_run_notif_check);
    }
  }).error(function () {
      clearInterval(twb_run_notif_check);
  });

}

function twb_disable_check() {
  twb_inprogress = true;
  /* Add a hover action to show disabled notification.*/
  jQuery(".twb-notoptimized").hover(function () {
      jQuery(this).parent().find(".twb-score-disabled-container").removeClass("twb-hidden");
    },
    function () {
      jQuery(this).parent().find(".twb-score-disabled-container").addClass("twb-hidden");
    });
}
/**
 * Optimize the page.
 * @param that
 */
function twb_check_score(that) {
  var post_id = jQuery(that).data("post_id");
  var parent = jQuery(that).parent().parent().parent();
  //var parent = jQuery(that).closest(".twb-score-container").parent();
  /* Class add loading near admin bar menu */
  jQuery(".twb_admin_bar_menu.twb_frontend").addClass("twb_score_inprogress");

  /* If the action is not called with reload button.*/
  if (parent.find(".twb-optimized").hasClass("twb-hidden")) {
    /* Do not show loading in list.*/
    parent.find(".twb-optimizing").removeClass("twb-hidden");
  }
  else {
    /* Show loading on reload buttons.*/
    parent.find(".twb-score-overlay").removeClass("twb-hidden");
    parent.find(".twb-score-overlay div").removeClass("twb-reload").addClass("twb-loader");
  }

  parent.find(".twb-notoptimized").addClass("twb-hidden");

  /* In case of Elementor */
  if( parent.hasClass("twb_elementor_settings_content") ) {
    jQuery(".twb_elementor_control_title").text(twb.checking).removeClass("twb_not_optimized").prepend("<span class='twb_inprogress'></span>");
  }

  /* Disable score check button.*/
  twb_disable_check();

  jQuery.ajax({
    url: twb.ajax_url,
    type: "POST",
    dataType: 'json',
    data: {
      action: "twb_check_score",
      post_id: post_id,
      twb_nonce: twb.nonce
    },
    success: function (data) {
      if (data.error) {
        /* Show reload buttons on failure.*/
        parent.find(".twb-score-overlay").removeClass("twb-hidden");
        parent.find(".twb-score-overlay div").removeClass("twb-loader").addClass("twb-reload");
      }
      else {
        parent.find(".twb-score-overlay").addClass("twb-hidden");
        var desktop = parent.find(".twb-score-desktop").find(".twb-score-circle");
        desktop.data(
          {
            "score": data.desktop_score,
            "tti": data.desktop_tti,
          });
        twb_draw_score_circle(desktop);
        var mobile = parent.find(".twb-score-mobile").find(".twb-score-circle");
        mobile.data(
          {
            "score": data.mobile_score,
            "tti": data.mobile_tti,
          });
        twb_draw_score_circle(mobile);
      }
    },
    error: function (xhr, textStatus, errorThrown) {
      /* Show reload buttons on failure.*/
      parent.find(".twb-score-overlay").removeClass("twb-hidden");
      parent.find(".twb-score-overlay div").removeClass("twb-loader").addClass("twb-reload");
    },
    complete: function (xhr, textStatus) {
      /* Hide optimizing container, show See score container.*/
      parent.find(".twb-optimizing").addClass("twb-hidden");
      parent.find(".twb-optimized").removeClass("twb-hidden");

      jQuery("#wpadminbar .twb-optimized .twb-score-container").removeClass("twb-hidden");
      jQuery("#wpadminbar .twb_admin_bar_menu").removeClass("twb_score_inprogress");
      jQuery("#wpadminbar .twb_menu_logo").remove();
      jQuery("#wpadminbar .twb_not_optimized_logo").removeClass("twb-hidden");
      jQuery("#wpadminbar .twb_admin_bar_menu_header").addClass("twb_not_optimized");

      /* Remove disabled action.*/
      twb_inprogress = false;
      jQuery(".twb-notoptimized").hover(function () {
        jQuery(this).parent().find(".twb-score-disabled-container").addClass("twb-hidden");
      });

      /* In case of Elementor */
      if( parent.hasClass("twb_elementor_settings_content") ) {
        jQuery(".twb_elementor_control_title").text(twb.notoptimized).remove("span.twb_inprogress").addClass("twb_not_optimized");
      }
    }
  });
}

/**
 * Draw circle on given score.
 * @param that
 */
function twb_draw_score_circle(that) {
  var score = parseInt(jQuery(that).data('score'));
  var size = parseInt(jQuery(that).data('size'));
  var thickness = parseInt(jQuery(that).data('thickness'));
  var color = score <= 49 ? "rgb(253, 60, 49)" : (score >= 90 ? "rgb(12, 206, 107)" : "rgb(255, 164, 0)");
  jQuery(that).parent().find('.twb-load-time').html(jQuery(that).data('tti'));
  var _this = that;
  jQuery(_this).circleProgress({
    value: score / 100,
    size: size,
    startAngle: -Math.PI / 4 * 2,
    lineCap: 'round',
    emptyFill: "rgba(255, 255, 255, 0)",
    thickness: thickness,
    fill: {
      color: color
    }
  }).on('circle-animation-progress', function (event, progress) {
    var content = '<span class="twb-score0"></span>';
    if (score != 0) {
      content = Math.round(score * progress);
    }
    jQuery(that).find('.twb-score-circle-animated').html(content).css({"color": color});
    jQuery(that).find('canvas').html(Math.round(score * progress));
  });
}

/* Adding button in Elementor edit panel navigation view */
function twb_add_elementor_button() {
  window.elementor.modules.layouts.panel.pages.menu.Menu.addItem({
    name: twb.title,
    icon: "twb-element-menu-icon",
    title: twb.title,
    type: "page",
    callback: () => {
      try {
        window.$e.route("panel/page-settings/twb_optimize")
      } catch (e) {
        window.$e.route("panel/page-settings/settings"), window.$e.route("panel/page-settings/twb_optimize")
      }
    }
  }, "more")
}

jQuery(window).on("elementor:init", () => {
  window.elementor.on("panel:init", () => {
    setTimeout(twb_add_elementor_button)
  })
});
// source --> https://pannonpilgrim.hu/wp-includes/js/dist/redux-routine.min.js?ver=64f9f5001aabc046c605 
"use strict";var wp;(wp||={}).reduxRoutine=(()=>{var fr=Object.create;var S=Object.defineProperty;var cr=Object.getOwnPropertyDescriptor;var sr=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,pr=Object.prototype.hasOwnProperty;var g=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),dr=(e,r)=>{for(var t in r)S(e,t,{get:r[t],enumerable:!0})},F=(e,r,t,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of sr(r))!pr.call(e,n)&&n!==t&&S(e,n,{get:()=>r[n],enumerable:!(u=cr(r,n))||u.enumerable});return e};var yr=(e,r,t)=>(t=e!=null?fr(lr(e)):{},F(r||!e||!e.__esModule?S(t,"default",{value:e,enumerable:!0}):t,e)),mr=e=>F(S({},"__esModule",{value:!0}),e);var C=g(w=>{"use strict";Object.defineProperty(w,"__esModule",{value:!0});var br={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};w.default=br});var E=g(c=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});c.createChannel=c.subscribe=c.cps=c.apply=c.call=c.invoke=c.delay=c.race=c.join=c.fork=c.error=c.all=void 0;var vr=C(),h=hr(vr);function hr(e){return e&&e.__esModule?e:{default:e}}var oe=c.all=function(r){return{type:h.default.all,value:r}},ie=c.error=function(r){return{type:h.default.error,error:r}},fe=c.fork=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.fork,iterator:r,args:u}},ce=c.join=function(r){return{type:h.default.join,task:r}},se=c.race=function(r){return{type:h.default.race,competitors:r}},le=c.delay=function(r){return new Promise(function(t){setTimeout(function(){return t(!0)},r)})},pe=c.invoke=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.call,func:r,context:null,args:u}},de=c.call=function(r,t){for(var u=arguments.length,n=Array(u>2?u-2:0),a=2;a<u;a++)n[a-2]=arguments[a];return{type:h.default.call,func:r,context:t,args:n}},ye=c.apply=function(r,t,u){return{type:h.default.call,func:r,context:t,args:u}},me=c.cps=function(r){for(var t=arguments.length,u=Array(t>1?t-1:0),n=1;n<t;n++)u[n-1]=arguments[n];return{type:h.default.cps,func:r,args:u}},be=c.subscribe=function(r){return{type:h.default.subscribe,channel:r}},ve=c.createChannel=function(r){var t=[],u=function(o){return t.push(o),function(){return t.splice(t.indexOf(o),1)}},n=function(o){return t.forEach(function(f){return f(o)})};return r(n),{subscribe:u}}});var q=g(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});var gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol?"symbol":typeof e},_r=C(),j=jr(_r);function jr(e){return e&&e.__esModule?e:{default:e}}var m={obj:function(r){return(typeof r>"u"?"undefined":gr(r))==="object"&&!!r},all:function(r){return m.obj(r)&&r.type===j.default.all},error:function(r){return m.obj(r)&&r.type===j.default.error},array:Array.isArray,func:function(r){return typeof r=="function"},promise:function(r){return r&&m.func(r.then)},iterator:function(r){return r&&m.func(r.next)&&m.func(r.throw)},fork:function(r){return m.obj(r)&&r.type===j.default.fork},join:function(r){return m.obj(r)&&r.type===j.default.join},race:function(r){return m.obj(r)&&r.type===j.default.race},call:function(r){return m.obj(r)&&r.type===j.default.call},cps:function(r){return m.obj(r)&&r.type===j.default.cps},subscribe:function(r){return m.obj(r)&&r.type===j.default.subscribe},channel:function(r){return m.obj(r)&&m.func(r.subscribe)}};D.default=m});var I=g(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.iterator=b.array=b.object=b.error=b.any=void 0;var xr=q(),A=Or(xr);function Or(e){return e&&e.__esModule?e:{default:e}}var kr=b.any=function(r,t,u,n){return n(r),!0},Ar=b.error=function(r,t,u,n,a){return A.default.error(r)?(a(r.error),!0):!1},qr=b.object=function(r,t,u,n,a){if(!A.default.all(r)||!A.default.obj(r.value))return!1;var o={},f=Object.keys(r.value),l=0,y=!1,s=function(d,k){y||(o[d]=k,l++,l===f.length&&n(o))},p=function(d,k){y||(y=!0,a(k))};return f.map(function(i){u(r.value[i],function(d){return s(i,d)},function(d){return p(i,d)})}),!0},Rr=b.array=function(r,t,u,n,a){if(!A.default.all(r)||!A.default.array(r.value))return!1;var o=[],f=0,l=!1,y=function(i,d){l||(o[i]=d,f++,f===r.value.length&&n(o))},s=function(i,d){l||(l=!0,a(d))};return r.value.map(function(p,i){u(p,function(d){return y(i,d)},function(d){return s(i,d)})}),!0},Sr=b.iterator=function(r,t,u,n,a){return A.default.iterator(r)?(u(r,t,a),!0):!1};b.default=[Ar,Sr,Rr,qr,kr]});var L=g(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});var Mr=I(),Pr=K(Mr),wr=q(),Cr=K(wr);function K(e){return e&&e.__esModule?e:{default:e}}function J(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else return Array.from(e)}var Er=function(){var r=arguments.length<=0||arguments[0]===void 0?[]:arguments[0],t=[].concat(J(r),J(Pr.default)),u=function n(a){var o=arguments.length<=1||arguments[1]===void 0?function(){}:arguments[1],f=arguments.length<=2||arguments[2]===void 0?function(){}:arguments[2],l=function(p){var i=function(P){return function(R){try{var z=P?p.throw(R):p.next(R),B=z.value,or=z.done;if(or)return o(B);d(B)}catch(ir){return f(ir)}}},d=function k(P){t.some(function(R){return R(P,k,n,i(!1),i(!0))})};i(!1)()},y=Cr.default.iterator(a)?a:regeneratorRuntime.mark(function s(){return regeneratorRuntime.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,a;case 2:return i.abrupt("return",i.sent);case 3:case"end":return i.stop()}},s,this)})();l(y,o,f)};return u};N.default=Er});var Q=g(T=>{"use strict";Object.defineProperty(T,"__esModule",{value:!0});var Dr=function(){var r=[];return{subscribe:function(u){return r.push(u),function(){r=r.filter(function(n){return n!==u})}},dispatch:function(u){r.slice().forEach(function(n){return n(u)})}}};T.default=Dr});var W=g(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.race=v.join=v.fork=v.promise=void 0;var Nr=q(),x=U(Nr),Tr=E(),Gr=Q(),Vr=U(Gr);function U(e){return e&&e.__esModule?e:{default:e}}var $r=v.promise=function(r,t,u,n,a){return x.default.promise(r)?(r.then(t,a),!0):!1},G=new Map,zr=v.fork=function(r,t,u){if(!x.default.fork(r))return!1;var n=Symbol("fork"),a=(0,Vr.default)();G.set(n,a),u(r.iterator.apply(null,r.args),function(f){return a.dispatch(f)},function(f){return a.dispatch((0,Tr.error)(f))});var o=a.subscribe(function(){o(),G.delete(n)});return t(n),!0},Br=v.join=function(r,t,u,n,a){if(!x.default.join(r))return!1;var o=G.get(r.task);return o?(function(){var f=o.subscribe(function(l){f(),t(l)})})():a("join error : task not found"),!0},Fr=v.race=function(r,t,u,n,a){if(!x.default.race(r))return!1;var o=!1,f=function(s,p,i){o||(o=!0,s[p]=i,t(s))},l=function(s){o||a(s)};return x.default.array(r.competitors)?(function(){var y=r.competitors.map(function(){return!1});r.competitors.forEach(function(s,p){u(s,function(i){return f(y,p,i)},l)})})():(function(){var y=Object.keys(r.competitors).reduce(function(s,p){return s[p]=!1,s},{});Object.keys(r.competitors).forEach(function(s){u(r.competitors[s],function(p){return f(y,s,p)},l)})})(),!0},Hr=function(r,t){if(!x.default.subscribe(r))return!1;if(!x.default.channel(r.channel))throw new Error('the first argument of "subscribe" must be a valid channel');var u=r.channel.subscribe(function(n){u&&u(),t(n)});return!0};v.default=[$r,zr,Br,Fr,Hr]});var Y=g(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.cps=O.call=void 0;var Ir=q(),X=Jr(Ir);function Jr(e){return e&&e.__esModule?e:{default:e}}function Kr(e){if(Array.isArray(e)){for(var r=0,t=Array(e.length);r<e.length;r++)t[r]=e[r];return t}else return Array.from(e)}var Lr=O.call=function(r,t,u,n,a){if(!X.default.call(r))return!1;try{t(r.func.apply(r.context,r.args))}catch(o){a(o)}return!0},Qr=O.cps=function(r,t,u,n,a){var o;return X.default.cps(r)?((o=r.func).call.apply(o,[null].concat(Kr(r.args),[function(f,l){f?a(f):t(l)}])),!0):!1};O.default=[Lr,Qr]});var rr=g(_=>{"use strict";Object.defineProperty(_,"__esModule",{value:!0});_.wrapControls=_.asyncControls=_.create=void 0;var Z=E();Object.keys(Z).forEach(function(e){e!=="default"&&Object.defineProperty(_,e,{enumerable:!0,get:function(){return Z[e]}})});var Ur=L(),Wr=V(Ur),Xr=W(),Yr=V(Xr),Zr=Y(),re=V(Zr);function V(e){return e&&e.__esModule?e:{default:e}}_.create=Wr.default;_.asyncControls=Yr.default;_.wrapControls=re.default});var te={};dr(te,{default:()=>ee});function H(e){return!!e&&typeof e[Symbol.iterator]=="function"&&typeof e.next=="function"}var ur=yr(rr(),1);function $(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function er(e){return Object.prototype.toString.call(e)==="[object Object]"}function tr(e){var r,t;return er(e)===!1?!1:(r=e.constructor,r===void 0?!0:(t=r.prototype,!(er(t)===!1||t.hasOwnProperty("isPrototypeOf")===!1)))}function M(e){return tr(e)&&typeof e.type=="string"}function nr(e,r){return M(e)&&e.type===r}function ar(e={},r){let t=Object.entries(e).map(([a,o])=>(f,l,y,s,p)=>{if(!nr(f,a))return!1;let i=o(f);return $(i)?i.then(s,p):s(i),!0}),u=(a,o)=>M(a)?(r(a),o(),!0):!1;t.push(u);let n=(0,ur.create)(t);return a=>new Promise((o,f)=>n(a,l=>{M(l)&&r(l),o(l)},f))}function ee(e={}){return r=>{let t=ar(e,r.dispatch);return u=>n=>H(n)?t(n):u(n)}}return mr(te);})();
/*! Bundled license information:

is-plain-object/dist/is-plain-object.mjs:
  (*!
   * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)
*/
if (typeof wp.reduxRoutine === 'object' && wp.reduxRoutine.default) { wp.reduxRoutine = wp.reduxRoutine.default; };
// source --> https://pannonpilgrim.hu/wp-content/plugins/wp-travel-engine/assets/lib/redux.min.js?ver=4.0.5 
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).Redux={})}(this,function(e){"use strict";var t=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")()),r=function(){return Math.random().toString(36).substring(7).split("").join(".")},n={INIT:"@@redux/INIT"+r(),REPLACE:"@@redux/REPLACE"+r(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+r()}};function o(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+r+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function i(e,t){return function(){return t(e.apply(this,arguments))}}function u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r}function a(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(r,!0).forEach(function(t){u(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function f(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}e.__DO_NOT_USE__ActionTypes=n,e.applyMiddleware=function(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=t.map(function(e){return e(o)});return a({},r,{dispatch:n=f.apply(void 0,i)(r.dispatch)})}}},e.bindActionCreators=function(e,t){if("function"==typeof e)return i(e,t);if("object"!=typeof e||null===e)throw Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var r={};for(var n in e){var o=e[n];"function"==typeof o&&(r[n]=i(o,t))}return r},e.combineReducers=function(e){for(var t=Object.keys(e),r={},i=0;t.length>i;i++){var u=t[i];"function"==typeof e[u]&&(r[u]=e[u])}var c,a=Object.keys(r);try{!function(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:n.PROBE_UNKNOWN_ACTION()}))throw Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+n.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}(r)}catch(e){c=e}return function(e,t){if(void 0===e&&(e={}),c)throw c;for(var n=!1,i={},u=0;a.length>u;u++){var f=a[u],s=e[f],d=(0,r[f])(s,t);if(void 0===d){var l=o(f,t);throw Error(l)}i[f]=d,n=n||d!==s}return(n=n||a.length!==Object.keys(e).length)?i:e}},e.compose=f,e.createStore=function e(r,o,i){var u;if("function"==typeof o&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof o&&void 0===i&&(i=o,o=void 0),void 0!==i){if("function"!=typeof i)throw Error("Expected the enhancer to be a function.");return i(e)(r,o)}if("function"!=typeof r)throw Error("Expected the reducer to be a function.");var c=r,a=o,f=[],s=f,d=!1;function l(){s===f&&(s=f.slice())}function p(){if(d)throw Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function h(e){if("function"!=typeof e)throw Error("Expected the listener to be a function.");if(d)throw Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return l(),s.push(e),function(){if(t){if(d)throw Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,l();var r=s.indexOf(e);s.splice(r,1),f=null}}}function y(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(d)throw Error("Reducers may not dispatch actions.");try{d=!0,a=c(a,e)}finally{d=!1}for(var t=f=s,r=0;t.length>r;r++)(0,t[r])();return e}return y({type:n.INIT}),(u={dispatch:y,subscribe:h,getState:p,replaceReducer:function(e){if("function"!=typeof e)throw Error("Expected the nextReducer to be a function.");c=e,y({type:n.REPLACE})}})[t]=function(){var e,r=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(p())}return t(),{unsubscribe:r(t)}}})[t]=function(){return this},e},u},Object.defineProperty(e,"__esModule",{value:!0})});