­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ /*! Redirection v3.3.1 */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=56)}([function(e,t,n){"use strict";e.exports=n(54)},function(e,t,n){var r=n(45),o=new r;e.exports={numberFormat:o.numberFormat.bind(o),translate:o.translate.bind(o),configure:o.configure.bind(o),setLocale:o.setLocale.bind(o),getLocale:o.getLocale.bind(o),getLocaleSlug:o.getLocaleSlug.bind(o),addTranslations:o.addTranslations.bind(o),reRenderTranslations:o.reRenderTranslations.bind(o),registerComponentUpdateHook:o.registerComponentUpdateHook.bind(o),registerTranslateHook:o.registerTranslateHook.bind(o),state:o.state,stateObserver:o.stateObserver,on:o.stateObserver.on.bind(o.stateObserver),off:o.stateObserver.removeListener.bind(o.stateObserver),emit:o.stateObserver.emit.bind(o.stateObserver),$this:o,I18N:r}},function(e,t,n){e.exports=n(36)()},function(e,t,n){var r; /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ !function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(l)throw l;for(var r=!1,o={},a=0;a",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(u),p=["%","/","?",";","#"].concat(c),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=n(5);function v(e,t,n){if(e&&o.isObject(e)&&e instanceof a)return e;var r=new a;return r.parse(e,t,n),r}a.prototype.parse=function(e,t,n){if(!o.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),l=-1!==a&&a127?D+="x":D+=R[A];if(!D.match(d)){var L=T.slice(0,C),U=T.slice(C+1),F=R.match(h);F&&(L.push(F[1]),U.unshift(F[2])),U.length&&(v="/"+U.join(".")+v),this.hostname=L.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var M=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+M,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[_])for(C=0,N=c.length;C0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift());return n.search=e.search,n.query=e.query,o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!O.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=O.slice(-1)[0],S=(n.host||e.host||O.length>1)&&("."===k||".."===k)||""===k,C=0,j=O.length;j>=0;j--)"."===(k=O[j])?O.splice(j,1):".."===k?(O.splice(j,1),C++):C&&(O.splice(j,1),C--);if(!w&&!_)for(;C--;C)O.unshift("..");!w||""===O[0]||O[0]&&"/"===O[0].charAt(0)||O.unshift(""),S&&"/"!==O.join("/").substr(-1)&&O.push("");var P,T=""===O[0]||O[0]&&"/"===O[0].charAt(0);x&&(n.hostname=n.host=T?"":O.length?O.shift():"",(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.host=n.hostname=P.shift()));return(w=w||n.host&&O.length)&&!T&&O.unshift(""),O.length?n.pathname=O.join("/"):(n.pathname=null,n.path=null),o.isNull(n.pathname)&&o.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},a.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,a,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,l],c=0;(s=new Error(t.replace(/%s/g,function(){return u[c++]}))).name="Invariant Violation"}throw s.framesToPop=1,s}}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e,r){var o,a=n(18);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var i=Object(a.a)(o);t.a=i}).call(this,n(10),n(34)(e))},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,l,s,u;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(a(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),n.apply(this,l)}else if(o(n))for(l=Array.prototype.slice.call(arguments,1),i=(u=n.slice()).length,s=0;s0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function o(){this.removeListener(e,o),n||(n=!0,t.apply(this,arguments))}return o.listener=t,this.on(e,o),this},n.prototype.removeListener=function(e,t){var n,a,i,l;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,a=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(l=i;l-- >0;)if(n[l]===t||n[l].listener&&n[l].listener===t){a=l;break}if(a<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(a,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some(function(e){var t=e.trim();return"."===t.charAt(0)?r.toLowerCase().endsWith(t.toLowerCase()):/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t})}return!0},n(14),n(34)},function(e,t,n){n(15),e.exports=n(2).Array.some},function(e,t,n){"use strict";var r=n(7),o=n(25)(3);r(r.P+r.F*!n(33)([].some,!0),"Array",{some:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(17),o=n(18),a=n(20),i=Object.defineProperty;t.f=n(3)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),o)try{return i(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var r=n(1);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){e.exports=!n(3)&&!n(4)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(1),o=n(0).document,a=r(o)&&r(o.createElement);e.exports=function(e){return a?o.createElement(e):{}}},function(e,t,n){var r=n(1);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(0),o=n(8),a=n(23),i=n(9)("src"),l=Function.toString,s=(""+l).split("toString");n(2).inspectSource=function(e){return l.call(e)},(e.exports=function(e,t,n,l){var u="function"==typeof n;u&&(a(n,"name")||o(n,"name",t)),e[t]!==n&&(u&&(a(n,i)||o(n,i,e[t]?""+e[t]:s.join(String(t)))),e===r?e[t]=n:l?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[i]||l.call(this)})},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(10),o=n(26),a=n(27),i=n(12),l=n(29);e.exports=function(e,t){var n=1==e,s=2==e,u=3==e,c=4==e,p=6==e,f=5==e||p,d=t||l;return function(t,l,h){for(var m,g,b=a(t),y=o(b),v=r(l,h,3),E=i(y.length),w=0,_=n?d(t,E):s?d(t,0):void 0;E>w;w++)if((f||w in y)&&(g=v(m=y[w],w,b),e))if(n)_[w]=g;else if(g)switch(e){case 3:return!0;case 5:return m;case 6:return w;case 2:_.push(m)}else if(c)return!1;return p?-1:u||c?c:_}}},function(e,t,n){var r=n(5);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(11);e.exports=function(e){return Object(r(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(30);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(1),o=n(31),a=n(6)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){var r=n(5);e.exports=Array.isArray||function(e){return"Array"==r(e)}},function(e,t,n){var r=n(0),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return o[e]||(o[e]={})}},function(e,t,n){"use strict";var r=n(4);e.exports=function(e,t){return!!e&&r(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){n(35),e.exports=n(2).String.endsWith},function(e,t,n){"use strict";var r=n(7),o=n(12),a=n(36),i="".endsWith;r(r.P+r.F*n(38)("endsWith"),"String",{endsWith:function(e){var t=a(this,e,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(t.length),l=void 0===n?r:Math.min(o(n),r),s=String(e);return i?i.call(t,s,l):t.slice(l-s.length,l)===s}})},function(e,t,n){var r=n(37),o=n(11);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){var r=n(1),o=n(5),a=n(6)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[a])?!!t:"RegExp"==o(e))}},function(e,t,n){var r=n(6)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,!"/./"[e](t)}catch(e){}}return!0}}])},function(e,t,n){"use strict";var r=n(4).compose;t.__esModule=!0,t.composeWithDevTools=function(){if(0!==arguments.length)return"object"==typeof arguments[0]?r:r.apply(null,arguments)},t.devToolsEnhancer=function(){return function(e){return e}}},function(e,t,n){"use strict";(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.a=n}).call(this,n(10))},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",function(){return r})},function(e,t,n){"use strict";var r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a=Object.defineProperty,i=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,s=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,c=u&&u(Object);e.exports=function e(t,n,p){if("string"!=typeof n){if(c){var f=u(n);f&&f!==c&&e(t,f,p)}var d=i(n);l&&(d=d.concat(l(n)));for(var h=0;h>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],o=0;o0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1]||t+"Subscription",r=function(e){function r(n,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var a=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,o));return a[t]=n.store,a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,e),r.prototype.getChildContext=function(){var e;return(e={})[t]=this[t],e[n]=null,e},r.prototype.render=function(){return a.Children.only(this.props.children)},r}(a.Component);return r.propTypes={store:m.isRequired,children:d.a.element.isRequired},r.childContextTypes=((e={})[t]=m.isRequired,e[n]=h,e),r}(),b=n(19),y=n.n(b),v=n(9),E=n.n(v);var w=null,_={notify:function(){}};var O=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.store=t,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=_}return e.prototype.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},e.prototype.notifyNestedSubs=function(){this.listeners.notify()},e.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},e.prototype.trySubscribe=function(){var e,t;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(e=[],t=[],{clear:function(){t=w,e=w},notify:function(){for(var n=e=t,r=0;r1&&void 0!==arguments[1]?arguments[1]:{},o=r.getDisplayName,i=void 0===o?function(e){return"ConnectAdvanced("+e+")"}:o,l=r.methodName,s=void 0===l?"connectAdvanced":l,u=r.renderCountProp,c=void 0===u?void 0:u,p=r.shouldHandleStateChanges,f=void 0===p||p,d=r.storeKey,g=void 0===d?"store":d,b=r.withRef,v=void 0!==b&&b,w=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),_=g+"Subscription",j=k++,P=((t={})[g]=m,t[_]=h,t),T=((n={})[_]=h,n);return function(t){E()("function"==typeof t,"You must pass a component to the function returned by "+s+". Instead received "+JSON.stringify(t));var n=t.displayName||t.name||"Component",r=i(n),o=x({},w,{getDisplayName:i,methodName:s,renderCountProp:c,shouldHandleStateChanges:f,storeKey:g,withRef:v,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=function(n){function i(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e,t));return o.version=j,o.state={},o.renderCount=0,o.store=e[g]||t[g],o.propsMode=Boolean(e[g]),o.setWrappedInstance=o.setWrappedInstance.bind(o),E()(o.store,'Could not find "'+g+'" in either the context or props of "'+r+'". Either wrap the root component in a , or explicitly pass "'+g+'" as a prop to "'+r+'".'),o.initSelector(),o.initSubscription(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,n),i.prototype.getChildContext=function(){var e,t=this.propsMode?null:this.subscription;return(e={})[_]=t||this.context[_],e},i.prototype.componentDidMount=function(){f&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},i.prototype.componentWillReceiveProps=function(e){this.selector.run(e)},i.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},i.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=C,this.store=null,this.selector.run=C,this.selector.shouldComponentUpdate=!1},i.prototype.getWrappedInstance=function(){return E()(v,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+s+"() call."),this.wrappedInstance},i.prototype.setWrappedInstance=function(e){this.wrappedInstance=e},i.prototype.initSelector=function(){var t=e(this.store.dispatch,o);this.selector=function(e,t){var n={run:function(r){try{var o=e(t.getState(),r);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(e){n.shouldComponentUpdate=!0,n.error=e}}};return n}(t,this.store),this.selector.run(this.props)},i.prototype.initSubscription=function(){if(f){var e=(this.propsMode?this.props:this.context)[_];this.subscription=new O(this.store,e,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},i.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(S)):this.notifyNestedSubs()},i.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},i.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},i.prototype.addExtraProps=function(e){if(!(v||c||this.propsMode&&this.subscription))return e;var t=x({},e);return v&&(t.ref=this.setWrappedInstance),c&&(t[c]=this.renderCount++),this.propsMode&&this.subscription&&(t[_]=this.subscription),t},i.prototype.render=function(){var e=this.selector;if(e.shouldComponentUpdate=!1,e.error)throw e.error;return Object(a.createElement)(t,this.addExtraProps(e.props))},i}(a.Component);return l.WrappedComponent=t,l.displayName=r,l.childContextTypes=T,l.contextTypes=P,l.propTypes=P,y()(l,t)}}var P=Object.prototype.hasOwnProperty;function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function N(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),l=r(e,a),s=o(e,a);return(a.pure?Q:K)(i,l,s,e,a)}var J=Object.assign||function(e){for(var t=1;t=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Z(e,t){return e===t}var ee=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.connectHOC,n=void 0===t?j:t,r=e.mapStateToPropsFactories,o=void 0===r?H:r,a=e.mapDispatchToPropsFactories,i=void 0===a?W:a,l=e.mergePropsFactories,s=void 0===l?$:l,u=e.selectorFactory,c=void 0===u?Y:u;return function(e,t,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=a.pure,u=void 0===l||l,p=a.areStatesEqual,f=void 0===p?Z:p,d=a.areOwnPropsEqual,h=void 0===d?N:d,m=a.areStatePropsEqual,g=void 0===m?N:m,b=a.areMergedPropsEqual,y=void 0===b?N:b,v=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=X(e,o,"mapStateToProps"),w=X(t,i,"mapDispatchToProps"),_=X(r,s,"mergeProps");return n(c,J({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:w,initMergeProps:_,pure:u,areStatesEqual:f,areOwnPropsEqual:h,areStatePropsEqual:g,areMergedPropsEqual:y},v))}}(),te=n(16);function ne(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var re=ne();re.withExtraArgument=ne;var oe=re,ae="SETTING_LOAD_START",ie="SETTING_LOAD_SUCCESS",le="SETTING_LOAD_FAILED",se="SETTING_LOAD_STATUS",ue="SETTING_SAVING",ce="SETTING_SAVED",pe="SETTING_SAVE_FAILED",fe="STATUS_IN_PROGRESS",de="STATUS_FAILED",he="STATUS_COMPLETE",me=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Pe(),a={orderby:n,direction:"desc",page:0,per_page:parseInt(Redirectioni10n.per_page,10),selected:[],filterBy:"",filter:""},i=void 0===o.sub?"":o.sub;return-1===r.indexOf(i)?a:Ne({},a,{orderby:o.orderby&&-1!==e.indexOf(o.orderby)?o.orderby:a.orderby,direction:o.direction&&"asc"===o.direction?"asc":a.direction,page:o.offset&&parseInt(o.offset,10)>0?parseInt(o.offset,10):a.page,per_page:Redirectioni10n.per_page?parseInt(Redirectioni10n.per_page,10):a.per_page,filterBy:o.filterby&&-1!==t.indexOf(o.filterby)?o.filterby:a.filterBy,filter:o.filter?o.filter:a.filter})},Ie=function(e,t){for(var n=Object.assign({},e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=Redirectioni10n.WP_API_root+"redirection/v1/"+e+"/";if(n._wpnonce=Redirectioni10n.WP_API_nonce,n&&Object.keys(n).length>0&&(t=n,n=Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{}),Object.keys(n).length>0)){var o=r+(-1===Redirectioni10n.WP_API_root.indexOf("?")?"?":"&")+Se.a.stringify(n);return-1!==Redirectioni10n.WP_API_root.indexOf("page=redirection.php")?o.replace(/page=(\d+)/,"ppage=$1"):o}return r},Ge=function(e){return{url:e,headers:function(e){return-1!==e.indexOf("rest_route")||-1!==e.indexOf("/wp-json/")?new Headers({"Content-Type":"application/json; charset=utf-8"}):new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"})}(e),credentials:"same-origin"}},We=function(e,t){return Be({},Ge(ze(e,t)),{method:"post"})},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Be({},Ge(ze(e,t)),{method:"get"})},Ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Be({},Ge(ze(e,n)),{method:"post",params:t});return Object.keys(t).length>0&&(r.body=JSON.stringify(t)),r},qe={get:function(){return He("setting")},update:function(e){return Ve("setting",e)}},$e={list:function(e){return He("redirect",e)},update:function(e,t){return Ve("redirect/"+e,t)},create:function(e){return Ve("redirect",e)}},Ke={list:function(e){return He("group",e)},update:function(e,t){return Ve("group/"+e,t)},create:function(e){return Ve("group",e)}},Qe={list:function(e){return He("log",e)},deleteAll:function(e){return We("log",e)}},Ye={list:function(e){return He("404",e)},deleteAll:function(e){return We("404",e)}},Je={get:function(){return He("import")},upload:function(e,t){return function(e,t){var n=Be({},Ge(ze(e)),{method:"post"});return n.headers.delete("Content-Type"),n.body=new FormData,n.body.append("file",t),n}("import/file/"+e,t)},pluginList:function(){return He("import/plugin")},pluginImport:function(e){return Ve("import/plugin/"+e)}},Xe={file:function(e,t){return He("export/"+e+"/"+t)}},Ze={status:function(){return He("plugin")},fix:function(){return Ve("plugin")},delete:function(){return We("plugin/delete")}},et={redirect:function(e,t,n){return Ve("bulk/redirect/"+e,t,n)},group:function(e,t,n){return Ve("bulk/group/"+e,t,n)},log:function(e,t,n){return Ve("bulk/log/"+e,t,n)},error:function(e,t,n){return Ve("bulk/404/"+e,t,n)}},tt=function(e){return"https://api.redirect.li/v1/"+e+(-1===e.indexOf("?")?"?":"&")+"ref=redirection"},nt={getGeo:function(e){return{url:tt("ip/"+e+"?locale="+Redirectioni10n.localeSlug.substr(0,2)),method:"get"}}},rt={get:function(e){return{url:tt("useragent/"+encodeURIComponent(e)),method:"get"}}},ot=function(e){return e.action=function(e){return e.url.replace(Redirectioni10n.WP_API_root,"").replace(/[\?&]_wpnonce=[a-f0-9]*/,"")+" "+e.method.toUpperCase()}(e),fetch(e.url,e).then(function(t){if(!t||!t.status)throw{message:"No data or status object returned in request",code:0};return t.status&&void 0!==t.statusText&&(e.status=t.status,e.statusText=t.statusText),t.headers.get("x-wp-nonce")&&(Redirectioni10n.WP_API_nonce=t.headers.get("x-wp-nonce")),t.text()}).then(function(t){e.raw=t;try{var n=JSON.parse(t.replace(/\ufeff/,""));if(e.status&&200!==e.status)throw{message:function(e){return 0===e?"Admin AJAX returned 0":e.message?e.message:"Unknown error "+e}(n),code:function(e){return e.error_code?e.error_code:e.data&&e.data.error_code?e.data.error_code:0===e?"admin-ajax":e.code?e.code:"unknown"}(n),request:e,data:n.data?n.data:null};if(0===n)throw{message:"Failed to get data",code:"json-zero"};return n}catch(t){throw t.request=e,t}})},at=Object.assign||function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:{};return function(a,i){var l=i()[r.store],s=l.table,u=l.total,p={items:n?[n]:s.selected,bulk:t};if("delete"===t&&s.page>0&&s.per_page*s.page==u-1&&(s.page-=1),"delete"!==t||confirm(Object(c.translate)("Are you sure you want to delete this item?","Are you sure you want to delete these items?",{count:p.items.length}))){var f=Ie(s,p),d=at({items:p.items.join(",")},o);return ot(e(t,d,Le(s,r.order))).then(function(e){a(at({type:r.saved},e,{saving:p.items}))}).catch(function(e){a({type:r.failed,error:e,saving:p.items})}),a({type:r.saving,table:f,saving:p.items})}}},st=function(e,t,n,r,o){return ot(e).then(function(e){o({type:r.saved,item:e.item,items:e.items,total:e.total,saving:[n.id]})}).catch(function(e){o({type:r.failed,error:e,item:n,saving:[n.id]})}),o({type:r.saving,table:t,item:n,saving:[n.id]})},ut=function(e,t,n){return function(r,o){var a=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(o()[n.store],[]);return a.page=0,a.orderby="id",a.direction="desc",st(e(t),a,t,n,r)}},ct=function(e,t,n,r){return function(o,a){var i=a()[r.store].table;return st(e(t,n),i,n,r,o)}},pt=function(e,t){for(var n in e)if(e[n]!==t[n])return!1;return!0},ft=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){return e},i=o.table,l=void 0===i?{}:i,s=o.rows,u=a(Ie(l,r)),c=Le(at({},l,r),n.order);if(!(pt(u,l)&&s.length>0&&pt(r,{})))return ot(e(c)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})}),t(at({table:u,type:n.saving},function(e,t){var n={};for(var r in t)void 0===e[r]&&(n[r]=t[r]);return n}(u,r)))},dt=function(e,t,n,r,o){var a=o.table,i=Le(at({},a,r),n.order);ot(e(i)).then(function(e){t(at({type:n.saved},e))}).catch(function(e){t({type:n.failed,error:e})})},ht=function(e,t,n){for(var r=e.slice(0),o=0;o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case ae:return me({},e,{loadStatus:fe});case ie:return me({},e,{loadStatus:he,values:t.values,groups:t.groups,postTypes:t.postTypes,installed:t.installed,canDelete:t.canDelete});case le:return me({},e,{loadStatus:de,error:t.error});case ue:return me({},e,{saveStatus:fe});case ce:return me({},e,{saveStatus:he,values:t.values,groups:t.groups,installed:t.installed});case pe:return me({},e,{saveStatus:de,error:t.error});case se:return me({},e,{pluginStatus:t.pluginStatus})}return e},log:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ee:return _t({},e,{table:Me(e.table,e.rows,t.onoff)});case ve:return _t({},e,{table:Fe(e.table,t.items)});case we:return _t({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case _e:return _t({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case ge:return _t({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case ye:return _t({},e,{status:de,saving:[]});case be:return _t({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Oe:return _t({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},error:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Ct:return Nt({},e,{table:Me(e.table,e.rows,t.onoff)});case St:return Nt({},e,{table:Fe(e.table,t.items)});case jt:return Nt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Pt:return Nt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Ot:return Nt({},e,{table:yt(e,t),status:fe,saving:[],logType:t.logType,requestCount:e.requestCount+1});case kt:return Nt({},e,{status:de,saving:[]});case xt:return Nt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case Tt:return Nt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},io:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Dt:return Bt({},e,{exportStatus:fe});case Rt:return Bt({},e,{exportStatus:he,exportData:t.data});case Ft:return Bt({},e,{file:t.file});case Ut:return Bt({},e,{file:!1,lastImport:!1,exportData:!1});case Lt:return Bt({},e,{importingStatus:de,exportStatus:de,lastImport:!1,file:!1,exportData:!1});case At:return Bt({},e,{importingStatus:fe,lastImport:!1,file:!!t.file&&t.file});case It:return Bt({},e,{lastImport:t.total,importingStatus:he,file:!1});case Mt:return Bt({},e,{importers:t.importers})}return e},group:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case zt:return Qt({},e,{table:yt(e,t),status:fe,saving:[]});case Gt:return Qt({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case qt:return Qt({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case Kt:return Qt({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case Vt:return Qt({},e,{table:Me(e.table,e.rows,t.onoff)});case Ht:return Qt({},e,{table:Fe(e.table,t.items)});case Wt:return Qt({},e,{status:de,saving:[]});case $t:return Qt({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},redirect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case on:return an({},e,{addTop:t.onoff});case Yt:return an({},e,{table:yt(e,t),status:fe,saving:[]});case Jt:return an({},e,{rows:bt(e,t),status:he,total:vt(e,t),table:Ue(e.table)});case tn:return an({},e,{table:Ue(yt(e,t)),saving:Et(e,t),rows:mt(e,t)});case rn:return an({},e,{rows:bt(e,t),total:vt(e,t),saving:wt(e,t)});case en:return an({},e,{table:Me(e.table,e.rows,t.onoff)});case Zt:return an({},e,{table:Fe(e.table,t.items)});case Xt:return an({},e,{status:de,saving:[]});case nn:return an({},e,{saving:wt(e,t),rows:gt(e,t)})}return e},message:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case Lt:case Wt:case nn:case $t:case ye:case Oe:case le:case pe:case Tt:case kt:case Xt:var n=cn(e.errors,t.error);return console.error(t.error.message),un({},e,{errors:n,inProgress:fn(e)});case we:case tn:case ue:case jt:case qt:return un({},e,{inProgress:e.inProgress+1});case _e:case rn:case ce:case Kt:case Pt:return un({},e,{notices:pn(e.notices,dn[t.type]),inProgress:fn(e)});case sn:return un({},e,{notices:[]});case ln:return un({},e,{errors:[]})}return e},info:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];switch(t.type){case hn:return yn({},e,{status:fe});case mn:return yn({},e,{status:he,maps:vn(e.maps,t.map,"ip")});case gn:return yn({},e,{status:he,agents:vn(e.agents,t.agent,"agent")});case bn:return yn({},e,{status:de,error:t.error})}return e}}),wn=Object(te.composeWithDevTools)({name:"Redirection"}),_n=[oe,function(){return function(e){return function(t){switch(t.type){case tn:case qt:case Yt:case zt:case ge:case Ot:!function(e,t){var n=Te(),r={redirect:[[Yt,tn],"id"],groups:[[zt,qt],"name"],log:[[ge],"date"],"404s":[[Ot],"date"]};r[n]&&e===r[n][0].find(function(t){return t===e})&&je({orderby:t.orderby,direction:t.direction,offset:t.page,per_page:t.per_page,filter:t.filter,filterBy:t.filterBy},{orderby:r[n][1],direction:"desc",offset:0,filter:"",filterBy:"",per_page:parseInt(Redirectioni10n.per_page,10)})}(t.type,t.table?t.table:t)}return e(t)}}}];function On(){var e=Redirectioni10n&&Redirectioni10n.preload&&Redirectioni10n.preload.pluginStatus?Redirectioni10n.preload.pluginStatus:[];return{loadStatus:fe,saveStatus:!1,error:!1,installed:"",settings:{},postTypes:[],pluginStatus:e,canDelete:!1}}function xn(){return{settings:On(),log:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["log"]),requestCount:0},error:{rows:[],saving:[],logType:xe,total:0,status:fe,table:Ae(["ip","url"],["ip"],"date",["404s"]),requestCount:0},io:{status:fe,file:!1,lastImport:!1,exportData:!1,importingStatus:!1,exportStatus:!1,importers:[]},group:{rows:[],saving:[],total:0,status:fe,table:Ae(["name"],["name","module"],"name",["groups"])},redirect:{rows:[],saving:[],total:0,addTop:!1,status:fe,table:Ae(["url","position","last_count","id","last_access"],["group"],"id",[""])},message:{errors:[],notices:[],inProgress:0,saving:[]},info:{status:fe,maps:{},agents:{},error:""}}}n(31);var kn=function(){return function(e,t){return t().settings.loadStatus===he?null:(ot(qe.get()).then(function(t){e({type:ie,values:t.settings,groups:t.groups,postTypes:t.post_types,installed:t.installed,canDelete:t.canDelete})}).catch(function(t){e({type:le,error:t})}),e({type:ae}))}},Sn=function(e){return function(t){return ot(qe.update(e)).then(function(e){t({type:ce,values:e.settings,groups:e.groups,installed:e.installed})}).catch(function(e){t({type:pe,error:e})}),t({type:ue})}},Cn=function(){return function(e){return ot(Ze.delete()).then(function(e){document.location.href=e.location}).catch(function(t){e({type:pe,error:t})}),e({type:ue})}},jn=function(){return function(e){return ot(Ze.status()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Pn=function(){return function(e){return ot(Ze.fix()).then(function(t){e({type:se,pluginStatus:t})}).catch(function(t){e({type:le,error:t})}),e({type:ae})}},Tn=function(e){var t=e.title,n=e.url,r=void 0!==n&&n;return i.a.createElement("tr",null,i.a.createElement("th",null,!r&&t,r&&i.a.createElement("a",{href:r,target:"_blank"},t)),i.a.createElement("td",null,e.children))},Nn=function(e){return i.a.createElement("table",{className:"form-table"},i.a.createElement("tbody",null,e.children))},Rn="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},Dn=function e(t){var n=t.value,r=t.text;return"object"===(void 0===n?"undefined":Rn(n))?i.a.createElement("optgroup",{label:r},n.map(function(t,n){return i.a.createElement(e,{text:t.text,value:t.value,key:n})})):i.a.createElement("option",{value:n},r)},An=function(e){var t=e.items,n=e.value,r=e.name,o=e.onChange,a=e.isEnabled,l=void 0===a||a;return i.a.createElement("select",{name:r,value:n,onChange:o,disabled:!l},t.map(function(e,t){return i.a.createElement(Dn,{value:e.value,text:e.text,key:t})}))},In=function(){function e(e,t){for(var n=0;n0?o:0,associated_redirect:i.length>0?a:""})};var r=e.values.modules;return n.state=e.values,n.state.location=r[2]?r[2].location:"",n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),In(t,[{key:"UNSAFE_componentWillUpdate",value:function(e){e.values.token!==this.props.values.token&&this.setState({token:e.values.token}),e.values.auto_target!==this.props.values.auto_target&&this.setState({auto_target:e.values.auto_target})}},{key:"renderMonitor",value:function(e){return i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor Changes")+":",url:this.supportLink("options","monitor")},i.a.createElement(An,{items:e,name:"monitor_post",value:parseInt(this.state.monitor_post,10),onChange:this.onChange})," ",Object(c.translate)("Save changes to this group"),i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"associated_redirect",onChange:this.onChange,placeholder:Object(c.translate)('For example "/amp"'),value:this.state.associated_redirect})," ",Object(c.translate)("Create associated redirect (added to end of URL)")))}},{key:"renderPostTypes",value:function(){var e=this,t=this.props.postTypes,n=this.state.monitor_types,r=[],o=function(o){var a=t[o],l=!!n.find(function(e){return e===o});r.push(i.a.createElement("p",{key:o},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",name:"monitor_type_"+o,onChange:e.onMonitor,checked:l}),Object(c.translate)("Monitor changes to %(type)s",{args:{type:a.toLowerCase()}}))))};for(var a in t)o(a);return r}},{key:"supportLink",value:function(e,t){return"https://redirection.me/support/"+e+"/?utm_source=redirection&utm_medium=plugin&utm_campaign=support"+(t?"&utm_term="+t+"#"+t:"")}},{key:"render",value:function(){var e=this.props,t=e.groups,n=e.saveStatus,r=e.installed,o=this.state.monitor_types.length>0;return i.a.createElement("form",{onSubmit:this.onSubmit},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:""},i.a.createElement("label",null,i.a.createElement("input",{type:"checkbox",checked:this.state.support,name:"support",onChange:this.onChange}),i.a.createElement("span",{className:"sub"},Object(c.translate)("I'm a nice person and I have helped support the author of this plugin")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Logs")+":",url:this.supportLink("logs")},i.a.createElement(An,{items:Ln,name:"expire_redirect",value:parseInt(this.state.expire_redirect,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("404 Logs")+":",url:this.supportLink("tracking-404-errors")},i.a.createElement(An,{items:Ln,name:"expire_404",value:parseInt(this.state.expire_404,10),onChange:this.onChange})," ",Object(c.translate)("(time to keep logs for)")),i.a.createElement(Tn,{title:Object(c.translate)("IP Logging")+":",url:this.supportLink("options","iplogging")},i.a.createElement(An,{items:Fn,name:"ip_logging",value:parseInt(this.state.ip_logging,10),onChange:this.onChange})," ",Object(c.translate)("(select IP logging level)")," - ",i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:this.supportLink("privacy-gdpr")},Object(c.translate)("GDPR / Privacy information"))),i.a.createElement(Tn,{title:Object(c.translate)("URL Monitor")+":",url:this.supportLink("options","monitor")},this.renderPostTypes()),o&&this.renderMonitor(t),i.a.createElement(Tn,{title:Object(c.translate)("RSS Token")+":",url:this.supportLink("options","rsstoken")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.token,name:"token",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("A unique token allowing feed readers access to Redirection log RSS (leave blank to auto-generate)"))),i.a.createElement(Tn,{title:Object(c.translate)("Auto-generate URL")+":",url:this.supportLink("options","autogenerate")},i.a.createElement("input",{className:"regular-text",type:"text",value:this.state.auto_target,name:"auto_target",onChange:this.onChange}),i.a.createElement("br",null),i.a.createElement("span",{className:"sub"},Object(c.translate)("Used to auto-generate a URL if no URL is given. Use the special tags {{code}}$dec${{/code}} or {{code}}$hex${{/code}} to insert a unique ID instead",{components:{code:i.a.createElement("code",null)}}))),i.a.createElement(Tn,{title:Object(c.translate)("Apache Module"),url:this.supportLink("options","apache")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"text",className:"regular-text",name:"location",value:this.state.location,onChange:this.onChange,placeholder:r})),i.a.createElement("p",{className:"sub"},Object(c.translate)("Enter the full path and filename if you want Redirection to automatically update your {{code}}.htaccess{{/code}}.",{components:{code:i.a.createElement("code",null)}})))),i.a.createElement(Tn,{title:Object(c.translate)("Force HTTPS"),url:this.supportLink("options","force-https")},i.a.createElement("label",null,i.a.createElement("p",null,i.a.createElement("input",{type:"checkbox",name:"https",onChange:this.onChange,checked:this.state.https}),Object(c.translate)("Force a redirect from HTTP to HTTPS. Please ensure your HTTPS is working before enabling"),"  ",Object(c.translate)("(beta)")))),i.a.createElement(Tn,{title:Object(c.translate)("Redirect Cache"),url:this.supportLink("options","cache")},i.a.createElement(An,{items:Un,name:"redirect_cache",value:parseInt(this.state.redirect_cache,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)('How long to cache redirected 301 URLs (via "Expires" HTTP header)'))),i.a.createElement(Tn,{title:Object(c.translate)("REST API"),url:this.supportLink("options","restapi")},i.a.createElement(An,{items:Mn,name:"rest_api",value:parseInt(this.state.rest_api,10),onChange:this.onChange}),"  ",i.a.createElement("span",{className:"sub"},Object(c.translate)("How Redirection uses the REST API - don't change unless necessary")))),i.a.createElement("input",{className:"button-primary",type:"submit",name:"update",value:Object(c.translate)("Update"),disabled:n===fe}))}}]),t}();var zn=ee(function(e){var t=e.settings;return{groups:t.groups,values:t.values,saveStatus:t.saveStatus,installed:t.installed,postTypes:t.postTypes}},function(e){return{onSaveSettings:function(t){e(Sn(t))}}})(Bn),Gn=n(3),Wn=n.n(Gn),Hn=function(){function e(e,t){for(var n=0;n=t[n][0])return t[n][1];return t[t.length-1][1]}},{key:"renderSupported",value:function(){return i.a.createElement("div",null,Object(c.translate)("You've supported this plugin - thank you!"),"  ",i.a.createElement("a",{href:"#",onClick:this.onDonate},Object(c.translate)("I'd like to support some more.")))}},{key:"renderUnsupported",value:function(){for(var e,t,n,r=(n="",(t=16)in(e={})?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e),o=20;o<=100;o+=20)r[o]="";return i.a.createElement("div",null,i.a.createElement("label",null,i.a.createElement("p",null,Object(c.translate)("Redirection is free to use - life is wonderful and lovely! It has required a great deal of time and effort to develop and you can help support this development by {{strong}}making a small donation{{/strong}}.",{components:{strong:i.a.createElement("strong",null)}})," ",Object(c.translate)("You get useful software and I get to carry on making it better."))),i.a.createElement("input",{type:"hidden",name:"cmd",value:"_xclick"}),i.a.createElement("input",{type:"hidden",name:"business",value:"admin@urbangiraffe.com"}),i.a.createElement("input",{type:"hidden",name:"item_name",value:"Redirection"}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_promo_code",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_product_category",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_shipping_method",value:""}),i.a.createElement("input",{type:"hidden",name:"buyer_credit_user_address_change",value:""}),i.a.createElement("input",{type:"hidden",name:"no_shipping",value:"1"}),i.a.createElement("input",{type:"hidden",name:"return",value:this.getReturnUrl()}),i.a.createElement("input",{type:"hidden",name:"no_note",value:"1"}),i.a.createElement("input",{type:"hidden",name:"currency_code",value:"USD"}),i.a.createElement("input",{type:"hidden",name:"tax",value:"0"}),i.a.createElement("input",{type:"hidden",name:"lc",value:"US"}),i.a.createElement("input",{type:"hidden",name:"bn",value:"PP-DonationsBF"}),i.a.createElement("div",{className:"donation-amount"},"$",i.a.createElement("input",{type:"number",name:"amount",min:16,value:this.state.amount,onChange:this.onInput,onBlur:this.onBlur}),i.a.createElement("span",null,this.getAmountoji(this.state.amount)),i.a.createElement("input",{type:"submit",className:"button-primary",value:Object(c.translate)("Support 💰")})))}},{key:"render",value:function(){var e=this.state.support;return i.a.createElement("form",{action:"https://www.paypal.com/cgi-bin/webscr",method:"post",className:"donation"},i.a.createElement(Nn,null,i.a.createElement(Tn,{title:Object(c.translate)("Plugin Support")+":"},e?this.renderSupported():this.renderUnsupported())))}}]),t}(),Xn=function(){function e(e,t){for(var n=0;n0&&i.a.createElement(or,null))},lr=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.props.onLoadStatus(),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),rr(t,[{key:"render",value:function(){var e=this.props.pluginStatus;return i.a.createElement("div",null,i.a.createElement("h2",null,Object(c.translate)("Plugin Status")),e.length>0&&i.a.createElement(ir,{status:e}),0===e.length&&i.a.createElement("div",{className:"placeholder-inline"},i.a.createElement("div",{className:"placeholder-loading"})))}}]),t}();var sr=ee(function(e){return{pluginStatus:e.settings.pluginStatus}},function(e){return{onLoadStatus:function(){e(jn())},onFix:function(){e(Pn())}}})(lr),ur=function(){function e(e,t){for(var n=0;n0&&(f=i.a.createElement(gr,{rows:r,status:l,selected:a.selected,row:n})),i.a.createElement("table",{className:"wp-list-table widefat fixed striped items"},i.a.createElement("thead",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})),f,i.a.createElement("tfoot",null,i.a.createElement(mr,{table:a,isDisabled:c,isSelected:p,headers:t,rows:r,total:o,onSetOrderBy:u,onSetAllSelected:s})))},_r=function(){function e(e,t){for(var n=0;n0,onClick:this.onFirst})," ",i.a.createElement(Sr,{title:Object(c.translate)("Prev page"),button:"‹",className:"prev-page",enabled:e>0,onClick:this.onPrev}),i.a.createElement("span",{className:"paging-input"},i.a.createElement("label",{htmlFor:"current-page-selector",className:"screen-reader-text"},Object(c.translate)("Current Page"))," ",i.a.createElement("input",{className:"current-page",type:"number",min:"1",max:t,name:"paged",value:this.state.currentPage+1,size:"2","aria-describedby":"table-paging",onBlur:this.onSetPage,onChange:this.onChange}),i.a.createElement("span",{className:"tablenav-paging-text"},Object(c.translate)("of %(page)s",{components:{total:i.a.createElement("span",{className:"total-pages"})},args:{page:Object(c.numberFormat)(t)}})))," ",i.a.createElement(Sr,{title:Object(c.translate)("Next page"),button:"›",className:"next-page",enabled:e0&&i.a.createElement(jr,{per_page:n.per_page,page:n.page,total:t,onChangePage:this.props.onChangePage,inProgress:o===fe}))}}]),t}(),Nr=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Wr(e)},Vr=function(e,t){return Wr({orderby:e,direction:t})},qr=function(e){return Wr({page:e})},$r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Wr({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},Kr=function(e,t){return Wr({filterBy:e,filter:t,orderby:"",page:0})},Qr=function(e){return{type:ve,items:e.map(parseInt)}},Yr=function(e){return{type:Ee,onoff:e}},Jr=function(e){var t=e.size,n=void 0===t?"":t,r="spinner-container"+(n?" spinner-"+n:"");return i.a.createElement("div",{className:r},i.a.createElement("span",{className:"css-spinner"}))},Xr=function(e){return function(t,n){if(!n().info.maps[e])return ot(nt.getGeo(e)).then(function(e){t({type:mn,map:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},Zr=function(e){return function(t,n){if(!n().info.agents[e])return ot(rt.get(e)).then(function(e){t({type:gn,agent:e})}).catch(function(e){t({type:bn,error:e})}),t({type:hn})}},eo=function(){function e(e,t){for(var n=0;n0},i.a.createElement(Ir,{logType:xe}),i.a.createElement("button",{className:"button-secondary",onClick:this.handleRSS},"RSS"),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var go=ee(function(e){return{log:e.log}},function(e){return{onLoad:function(t){e(Hr(t))},onDeleteAll:function(t,n){e(zr(t,n))},onSearch:function(t,n){e($r(t,n))},onChangePage:function(t){e(qr(t))},onTableAction:function(t){e(Gr(t))},onSetAllSelected:function(t){e(Yr(t))},onSetOrderBy:function(t,n){e(Vr(t,n))}}})(mo),bo=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{filter:"",filterBy:"",page:0,orderby:""};return Oo(e)},ko=function(e,t){return Oo({orderby:e,direction:t})},So=function(e){return Oo({page:e})},Co=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Oo({filter:e,filterBy:""===e?"":t,page:0,orderby:""})},jo=function(e,t){return Oo({filterBy:e,filter:t,orderby:"",page:0})},Po=function(e){return{type:St,items:e.map(parseInt)}},To=function(e){return{type:Ct,onoff:e}},No=function(e){var t=e.url;if(t){var n=Lr.parse(t).hostname;return i.a.createElement("a",{href:t,rel:"noreferrer noopener",target:"_blank"},n)}return null},Ro=function(){function e(e,t){for(var n=0;n0){if("group"===n.filterBy&&parseInt(n.filter,10)>0)return parseInt(n.filter,10);var r=t.find(function(e){return e.default});return r?r.id:t[0].id}return 0}},{key:"reset",value:function(){this.setState(ya({url:"",regex:!1,match_type:"url",action_type:"url",action_data:"",title:"",action_code:301,position:0},this.resetActionData()))}},{key:"resetActionData",value:function(){return{login:{logged_in:"",logged_out:""},target:{url:""},agent:{url_from:"",agent:"",regex:!1,url_notfrom:""},referrer:{referrer:"",regex:!1,url_from:"",url_notfrom:""},cookie:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},header:{name:"",value:"",regex:!1,url_from:"",url_notfrom:""},custom:{filter:"",url_from:"",url_notfrom:""},role:{role:"",url_from:"",url_notfrom:""},server:{server:"",url_from:"",url_notfrom:""}}}},{key:"canShowAdvanced",value:function(){var e=this.state,t=e.match_type,n=e.action_type;return"url"===t&&"url"===n}},{key:"getAgentState",value:function(e){var t=e||{},n=t.agent,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{agent:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getReferrerState",value:function(e){var t=e||{},n=t.referrer,r=void 0===n?"":n,o=t.regex,a=void 0!==o&&o,i=t.url_from,l=void 0===i?"":i,s=t.url_notfrom;return{referrer:r,regex:a,url_from:l,url_notfrom:void 0===s?"":s}}},{key:"getRoleState",value:function(e){var t=e||{},n=t.role,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{role:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getServerState",value:function(e){var t=e||{},n=t.server,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{server:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getHeaderState",value:function(e){var t=e||{},n=t.name,r=void 0===n?"":n,o=t.value,a=void 0===o?"":o,i=t.regex,l=void 0!==i&&i,s=t.url_from,u=void 0===s?"":s,c=t.url_notfrom;return{name:r,value:a,regex:l,url_from:u,url_notfrom:void 0===c?"":c}}},{key:"getCustomState",value:function(e){var t=e||{},n=t.filter,r=void 0===n?"":n,o=t.url_from,a=void 0===o?"":o,i=t.url_notfrom;return{filter:r,url_from:a,url_notfrom:void 0===i?"":i}}},{key:"getCode",value:function(){return"error"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},xa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):"url"===this.state.action_type||"random"===this.state.action_type?i.a.createElement("select",{name:"action_code",value:this.state.action_code,onChange:this.onChange},Oa.map(function(e){return i.a.createElement("option",{key:e.value,value:e.value},e.name)})):null}},{key:"getMatchExtra",value:function(){switch(this.state.match_type){case"agent":return i.a.createElement(Do,{agent:this.state.agent.agent,regex:this.state.agent.regex,onChange:this.onSetData,onCustomAgent:this.onCustomAgent});case"referrer":return i.a.createElement(Io,{referrer:this.state.referrer.referrer,regex:this.state.referrer.regex,onChange:this.onSetData});case"cookie":return i.a.createElement(Go,{name:this.state.cookie.name,value:this.state.cookie.value,regex:this.state.cookie.regex,onChange:this.onSetData});case"header":return i.a.createElement(Uo,{name:this.state.header.name,value:this.state.header.value,regex:this.state.header.regex,onChange:this.onSetData});case"custom":return i.a.createElement(Bo,{filter:this.state.custom.filter,onChange:this.onSetData});case"role":return i.a.createElement(Vo,{role:this.state.role.role,onChange:this.onSetData});case"server":return i.a.createElement(Ko,{server:this.state.server.server,onChange:this.onSetData})}return null}},{key:"getTarget",value:function(){var e=this.state,t=e.match_type,n=e.action_type,r=e.agent,o=e.referrer,a=e.login,l=e.cookie,s=e.target,u=e.header,c=e.custom,p=e.role,f=e.server;if(!ga(n))return null;switch(t){case"agent":return i.a.createElement(ta,{url_from:r.url_from,url_notfrom:r.url_notfrom,target:"agent",onChange:this.onSetData});case"referrer":return i.a.createElement(ta,{url_from:o.url_from,url_notfrom:o.url_notfrom,target:"referrer",onChange:this.onSetData});case"login":return i.a.createElement(Jo,{logged_in:a.logged_in,logged_out:a.logged_out,onChange:this.onSetData});case"url":return i.a.createElement(Xo,{target:s,onChange:this.onSetData});case"cookie":return i.a.createElement(ta,{url_from:l.url_from,url_notfrom:l.url_notfrom,target:"cookie",onChange:this.onSetData});case"header":return i.a.createElement(ta,{url_from:u.url_from,url_notfrom:u.url_notfrom,target:"header",onChange:this.onSetData});case"custom":return i.a.createElement(ta,{url_from:c.url_from,url_notfrom:c.url_notfrom,target:"custom",onChange:this.onSetData});case"role":return i.a.createElement(ta,{url_from:p.url_from,url_notfrom:p.url_notfrom,target:"role",onChange:this.onSetData});case"server":return i.a.createElement(ta,{url_from:f.url_from,url_notfrom:f.url_notfrom,target:"server",onChange:this.onSetData})}return null}},{key:"getTitle",value:function(){var e=this.state.title;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Title")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"title",value:e,onChange:this.onChange,placeholder:Object(c.translate)("Optional description - describe the purpose of this redirect")})))}},{key:"getMatch",value:function(){var e=this.state.match_type;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Match")),i.a.createElement("td",null,i.a.createElement("select",{name:"match_type",value:e,onChange:this.onChange},wa.map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)}))))}},{key:"getTargetCode",value:function(){var e=this.state,t=e.action_type,n=e.match_type,r=this.getCode();return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("When matched")),i.a.createElement("td",null,i.a.createElement("select",{name:"action_type",value:t,onChange:this.onChange},_a.filter(function(e){return!("login"===n&&!ga(e.value))}).map(function(e){return i.a.createElement("option",{value:e.value,key:e.value},e.name)})),r&&i.a.createElement(i.a.Fragment,null,i.a.createElement("strong",{className:"small-flex"},Object(c.translate)("with HTTP code"))," ",i.a.createElement("span",null,r))))}},{key:"getGroup",value:function(){var e=this.props.group.rows,t=this.state.group_id,n=parseInt(this.state.position,10),r=this.state.advanced;return i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Group")),i.a.createElement("td",null,i.a.createElement(An,{name:"group",value:t,items:na(e),onChange:this.onGroup}),r&&i.a.createElement("span",{className:"edit-redirection-position"},i.a.createElement("strong",null,Object(c.translate)("Position")),i.a.createElement("input",{type:"number",value:n,name:"position",min:"0",size:"3",onChange:this.onChange}))))}},{key:"canSave",value:function(){var e=this.state,t=e.url,n=e.match_type,r=e.target,o=e.action_type,a=e.referrer,i=e.login,l=e.agent,s=e.header,u=e.cookie,c=e.role,p=e.server;if(""===Redirectioni10n.autoGenerate&&""===t)return!1;if(ga(o)){if("url"===n&&""===r)return!1;if("referrer"===n&&""===a.url_from&&""===a.url_notfrom)return!1;if("login"===n&&""===i.logged_in&&""===i.logged_out)return!1;if("agent"===n&&""===l.url_from&&""===l.url_notfrom)return!1;if("cookie"===n&&""===u.url_from&&""===u.url_notfrom)return!1;if("header"===n&&""===s.url_from&&""===s.url_notfrom)return!1;if("role"===n&&""===c.url_from&&""===c.url_notfrom)return!1;if("server"===n&&""===p.url_from&&""===p.url_notfrom)return!1}return!0}},{key:"render",value:function(){var e=this.state,t=e.url,n=e.regex,r=e.advanced,o=this.props,a=o.saveButton,l=void 0===a?Object(c.translate)("Save"):a,s=o.onCancel,u=o.autoFocus,p=void 0!==u&&u,f=o.addTop,d=o.onClose;return i.a.createElement("form",{onSubmit:this.onSave},i.a.createElement("table",{className:"edit edit-redirection"},i.a.createElement("tbody",null,i.a.createElement("tr",null,i.a.createElement("th",null,Object(c.translate)("Source URL")),i.a.createElement("td",null,i.a.createElement("input",{type:"text",name:"url",value:t,onChange:this.onChange,autoFocus:p,placeholder:Object(c.translate)("The relative URL you want to redirect from")}),i.a.createElement("label",{className:"edit-redirection-regex"},Object(c.translate)("Regex")," ",i.a.createElement("sup",null,i.a.createElement("a",{tabIndex:"-1",target:"_blank",rel:"noopener noreferrer",href:"https://redirection.me/support/redirect-regular-expressions/"},"?"))," ",i.a.createElement("input",{type:"checkbox",name:"regex",checked:n,onChange:this.onChange})))),r&&this.getTitle(),r&&this.getMatch(),r&&this.getMatchExtra(),r&&this.getTargetCode(),this.getTarget(),this.getGroup(),this.props.children&&this.props.children,i.a.createElement("tr",null,i.a.createElement("th",null),i.a.createElement("td",null,i.a.createElement("div",{className:"table-actions"},i.a.createElement("input",{className:"button-primary",type:"submit",name:"save",value:l,disabled:!this.canSave()}),"  ",s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Cancel"),onClick:s}),f&&!s&&i.a.createElement("input",{className:"button-secondary",type:"submit",name:"cancel",value:Object(c.translate)("Close"),onClick:d})," ",this.canShowAdvanced()&&!1!==this.props.advanced&&i.a.createElement("a",{href:"#",onClick:this.onAdvanced,className:"advanced",title:Object(c.translate)("Show advanced options")},"⚙")))))))}}]),t}(),Sa=function(){var e=this;this.onSetData=function(t,n,r){void 0!==r?e.setState(Ea({},t,ya({},e.state[t],Ea({},n,r)))):e.setState(Ea({},t,n))},this.onCustomAgent=function(t){var n=e.state.agent;n.agent=t,n.regex=!0,e.setState({agent:n})},this.onSave=function(t){t.preventDefault();var n=e.state,r=n.url,o=n.title,a=n.regex,i=n.match_type,l=n.action_type,s=n.group_id,u=n.action_code,c=n.position,p=e.props.group.rows,f={id:parseInt(e.props.item.id,10),url:r,title:o,regex:a,match_type:i,action_type:l,position:c,group_id:s>0?s:p[0].id,action_code:e.getCode()?parseInt(u,10):0,action_data:function(e){var t=e.agent,n=e.referrer,r=e.login,o=e.match_type,a=e.target,i=e.action_type,l=e.header,s=e.cookie,u=e.custom,c=e.role,p=e.server;return"cookie"===o?{name:s.name,value:s.value,regex:s.regex,url_from:ga(i)?s.url_from:"",url_notfrom:ga(i)?s.url_notfrom:""}:"header"===o?{name:l.name,value:l.value,regex:l.regex,url_from:ga(i)?l.url_from:"",url_notfrom:ga(i)?l.url_notfrom:""}:"custom"===o?{filter:u.filter,url_from:ga(i)?u.url_from:"",url_notfrom:ga(i)?u.url_notfrom:""}:"agent"===o?{agent:t.agent,regex:t.regex,url_from:ga(i)?t.url_from:"",url_notfrom:ga(i)?t.url_notfrom:""}:"referrer"===o?{referrer:n.referrer,regex:n.regex,url_from:ga(i)?n.url_from:"",url_notfrom:ga(i)?n.url_notfrom:""}:"role"===o?{role:c.role,url_from:ga(i)?c.url_from:"",url_notfrom:ga(i)?c.url_notfrom:""}:"server"===o?{server:p.server,url_from:ga(i)?p.url_from:"",url_notfrom:ga(i)?p.url_notfrom:""}:"login"===o&&ga(i)?{logged_in:r.logged_in,logged_out:r.logged_out}:"url"===o&&ga(i)?{url:a.url}:""}(e.state)};f.id?e.props.onSave(f.id,f):e.props.onCreate(f),e.props.onCancel?e.props.onCancel(t):e.reset(),e.props.childSave&&e.props.childSave()},this.onAdvanced=function(t){t.preventDefault(),e.setState({advanced:!e.state.advanced})},this.onGroup=function(t){e.setState({group_id:parseInt(t.target.value,10)})},this.onChange=function(t){var n=t.target,r="checkbox"===n.type?n.checked:n.value;if(e.setState(Ea({},n.name,r)),"action_type"===n.name&&"url"===n.value&&e.setState({action_code:301}),"action_type"===n.name&&"error"===n.value&&e.setState({action_code:404}),"match_type"===n.name){var o=ya({},e.resetActionData());"login"===n.value?e.setState(ya({},o,{action_type:"url"})):e.setState(o)}}};var Ca=ee(function(e){var t=e.group,n=e.redirect;return{group:t,addTop:n.addTop,table:n.table}},function(e){return{onSave:function(t,n){e(ia(t,n))},onCreate:function(t){e(aa(t))},onClose:function(t){t.preventDefault(),e(ma(!1))}}})(ka),ja=function(){function e(e,t){for(var n=0;n0},i.a.createElement(Ir,{logType:"404"}),i.a.createElement(Ar,{onDelete:this.props.onDeleteAll,table:r}))))}}]),t}();var $a=ee(function(e){return{error:e.error}},function(e){return{onLoad:function(t){e(xo(t))},onLoadGroups:function(){e(La())},onDeleteAll:function(t,n){e(wo(t,n))},onSearch:function(t,n){e(Co(t,n))},onChangePage:function(t){e(So(t))},onTableAction:function(t){e(_o(t,null))},onSetAllSelected:function(t){e(To(t))},onSetOrderBy:function(t,n){e(ko(t,n))}}})(qa),Ka=n(15),Qa=n.n(Ka),Ya="undefined"==typeof document||!document||!document.createElement||"multiple"in document.createElement("input");function Ja(e){var t=[];if(e.dataTransfer){var n=e.dataTransfer;n.files&&n.files.length?t=n.files:n.items&&n.items.length&&(t=n.items)}else e.target&&e.target.files&&(t=e.target.files);return Array.prototype.slice.call(t)}function Xa(e,t){return"application/x-moz-file"===e.type||Qa()(e,t)}function Za(e){e.preventDefault()}var ei={borderStyle:"solid",borderColor:"#c66",backgroundColor:"#eee"},ti={opacity:.5},ni={borderStyle:"solid",borderColor:"#6c6",backgroundColor:"#eee"},ri={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},oi=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var li=function(e){function t(e,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r.renderChildren=function(e,t,n,o){return"function"==typeof e?e(oi({},r.state,{isDragActive:t,isDragAccept:n,isDragReject:o})):e},r.composeHandlers=r.composeHandlers.bind(r),r.onClick=r.onClick.bind(r),r.onDocumentDrop=r.onDocumentDrop.bind(r),r.onDragEnter=r.onDragEnter.bind(r),r.onDragLeave=r.onDragLeave.bind(r),r.onDragOver=r.onDragOver.bind(r),r.onDragStart=r.onDragStart.bind(r),r.onDrop=r.onDrop.bind(r),r.onFileDialogCancel=r.onFileDialogCancel.bind(r),r.onInputElementClick=r.onInputElementClick.bind(r),r.setRef=r.setRef.bind(r),r.setRefs=r.setRefs.bind(r),r.isFileDialogActive=!1,r.state={draggedFiles:[],acceptedFiles:[],rejectedFiles:[]},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.a.Component),ai(t,[{key:"componentDidMount",value:function(){var e=this.props.preventDropOnDocument;this.dragTargets=[],e&&(document.addEventListener("dragover",Za,!1),document.addEventListener("drop",this.onDocumentDrop,!1)),this.fileInputEl.addEventListener("click",this.onInputElementClick,!1),window.addEventListener("focus",this.onFileDialogCancel,!1)}},{key:"componentWillUnmount",value:function(){this.props.preventDropOnDocument&&(document.removeEventListener("dragover",Za),document.removeEventListener("drop",this.onDocumentDrop)),null!=this.fileInputEl&&this.fileInputEl.removeEventListener("click",this.onInputElementClick,!1),window.removeEventListener("focus",this.onFileDialogCancel,!1)}},{key:"composeHandlers",value:function(e){return this.props.disabled?null:e}},{key:"onDocumentDrop",value:function(e){this.node&&this.node.contains(e.target)||(e.preventDefault(),this.dragTargets=[])}},{key:"onDragStart",value:function(e){this.props.onDragStart&&this.props.onDragStart.call(this,e)}},{key:"onDragEnter",value:function(e){e.preventDefault(),-1===this.dragTargets.indexOf(e.target)&&this.dragTargets.push(e.target),this.setState({isDragActive:!0,draggedFiles:Ja(e)}),this.props.onDragEnter&&this.props.onDragEnter.call(this,e)}},{key:"onDragOver",value:function(e){e.preventDefault(),e.stopPropagation();try{e.dataTransfer.dropEffect=this.isFileDialogActive?"none":"copy"}catch(e){}return this.props.onDragOver&&this.props.onDragOver.call(this,e),!1}},{key:"onDragLeave",value:function(e){var t=this;e.preventDefault(),this.dragTargets=this.dragTargets.filter(function(n){return n!==e.target&&t.node.contains(n)}),this.dragTargets.length>0||(this.setState({isDragActive:!1,draggedFiles:[]}),this.props.onDragLeave&&this.props.onDragLeave.call(this,e))}},{key:"onDrop",value:function(e){var t=this,n=this.props,r=n.onDrop,o=n.onDropAccepted,a=n.onDropRejected,i=n.multiple,l=n.disablePreview,s=n.accept,u=Ja(e),c=[],p=[];e.preventDefault(),this.dragTargets=[],this.isFileDialogActive=!1,u.forEach(function(e){if(!l)try{e.preview=window.URL.createObjectURL(e)}catch(e){0}Xa(e,s)&&function(e,t,n){return e.size<=t&&e.size>=n}(e,t.props.maxSize,t.props.minSize)?c.push(e):p.push(e)}),i||p.push.apply(p,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0&&a&&a.call(this,p,e),c.length>0&&o&&o.call(this,c,e),this.draggedFiles=null,this.setState({isDragActive:!1,draggedFiles:[],acceptedFiles:c,rejectedFiles:p})}},{key:"onClick",value:function(e){var t=this.props,n=t.onClick;t.disableClick||(e.stopPropagation(),n&&n.call(this,e),!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?this.open():setTimeout(this.open.bind(this),0))}},{key:"onInputElementClick",value:function(e){e.stopPropagation(),this.props.inputProps&&this.props.inputProps.onClick&&this.props.inputProps.onClick()}},{key:"onFileDialogCancel",value:function(){var e=this,t=this.props.onFileDialogCancel;this.isFileDialogActive&&setTimeout(function(){null!=e.fileInputEl&&(e.fileInputEl.files.length||(e.isFileDialogActive=!1));"function"==typeof t&&t()},300)}},{key:"setRef",value:function(e){this.node=e}},{key:"setRefs",value:function(e){this.fileInputEl=e}},{key:"open",value:function(){this.isFileDialogActive=!0,this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this.props,t=e.accept,n=e.acceptClassName,r=e.activeClassName,o=e.children,a=e.disabled,l=e.disabledClassName,s=e.inputProps,u=e.multiple,c=e.name,p=e.rejectClassName,f=ii(e,["accept","acceptClassName","activeClassName","children","disabled","disabledClassName","inputProps","multiple","name","rejectClassName"]),d=f.acceptStyle,h=f.activeStyle,m=f.className,g=void 0===m?"":m,b=f.disabledStyle,y=f.rejectStyle,v=f.style,E=ii(f,["acceptStyle","activeStyle","className","disabledStyle","rejectStyle","style"]),w=this.state,_=w.isDragActive,O=w.draggedFiles,x=O.length,k=u||x<=1,S=x>0&&function(e,t){return e.every(function(e){return Xa(e,t)})}(O,this.props.accept),C=x>0&&(!S||!k),j=!(g||v||h||d||y||b);_&&r&&(g+=" "+r),S&&n&&(g+=" "+n),C&&p&&(g+=" "+p),a&&l&&(g+=" "+l),j&&(h=ni,d=(v=ri).active,y=ei,b=ti);var P=oi({},v);h&&_&&(P=oi({},v,h)),d&&S&&(P=oi({},P,d)),y&&C&&(P=oi({},P,y)),b&&a&&(P=oi({},v,b));var T={accept:t,disabled:a,type:"file",style:{display:"none"},multiple:Ya&&u,ref:this.setRefs,onChange:this.onDrop,autoComplete:"off"};c&&c.length&&(T.name=c);E.acceptedFiles,E.preventDropOnDocument,E.disablePreview,E.disableClick,E.onDropAccepted,E.onDropRejected,E.onFileDialogCancel,E.maxSize,E.minSize;var N=ii(E,["acceptedFiles","preventDropOnDocument","disablePreview","disableClick","onDropAccepted","onDropRejected","onFileDialogCancel","maxSize","minSize"]);return i.a.createElement("div",oi({className:g,style:P},N,{onClick:this.composeHandlers(this.onClick),onDragStart:this.composeHandlers(this.onDragStart),onDragEnter:this.composeHandlers(this.onDragEnter),onDragOver:this.composeHandlers(this.onDragOver),onDragLeave:this.composeHandlers(this.onDragLeave),onDrop:this.composeHandlers(this.onDrop),ref:this.setRef,"aria-disabled":a}),this.renderChildren(o,_,S,C),i.a.createElement("input",oi({},s,T)))}}]),t}(),si=li;li.propTypes={accept:d.a.oneOfType([d.a.string,d.a.arrayOf(d.a.string)]),children:d.a.oneOfType([d.a.node,d.a.func]),disableClick:d.a.bool,disabled:d.a.bool,disablePreview:d.a.bool,preventDropOnDocument:d.a.bool,inputProps:d.a.object,multiple:d.a.bool,name:d.a.string,maxSize:d.a.number,minSize:d.a.number,className:d.a.string,activeClassName:d.a.string,acceptClassName:d.a.string,rejectClassName:d.a.string,disabledClassName:d.a.string,style:d.a.object,activeStyle:d.a.object,acceptStyle:d.a.object,rejectStyle:d.a.object,disabledStyle:d.a.object,onClick:d.a.func,onDrop:d.a.func,onDropAccepted:d.a.func,onDropRejected:d.a.func,onDragStart:d.a.func,onDragEnter:d.a.func,onDragOver:d.a.func,onDragLeave:d.a.func,onFileDialogCancel:d.a.func},li.defaultProps={preventDropOnDocument:!0,disabled:!1,disablePreview:!1,disableClick:!1,multiple:!0,maxSize:1/0,minSize:0};var ui=function(e,t){return function(n){return ot(Xe.file(e,t)).then(function(e){n({type:Rt,data:e.data})}).catch(function(e){n({type:Lt,error:e})}),n({type:Dt})}},ci=function(e){return document.location.href=e,{type:"NOTHING"}},pi=function(e,t){return function(n){return ot(Je.upload(t,e)).then(function(e){n({type:It,total:e.imported})}).catch(function(e){n({type:Lt,error:e})}),n({type:At,file:e})}},fi=function(){return{type:Ut}},di=function(e){return{type:Ft,file:e}},hi=function(){return function(e){ot(Je.pluginList()).then(function(t){e({type:Mt,importers:t.importers})}).catch(function(t){e({type:Lt,error:t})})}},mi=function(e){return function(t){return ot(Je.pluginImport(e)).then(function(e){t({type:It,total:e.imported})}).catch(function(e){t({type:Lt,error:e})}),t({type:At})}},gi=function(e){var t=e.plugin,n=e.doImport,r=t.name,o=t.total;return i.a.createElement("div",{className:"plugin-importer"},i.a.createElement("p",null,i.a.createElement("strong",null,r)," (",Object(c.translate)("total = ")+o," )"),i.a.createElement("button",{onClick:function(){n(t)},className:"button-secondary"},Object(c.translate)("Import from %s",{args:r})))},bi=function(){function e(e,t){for(var n=0;n0&&t!==fe&&this.props.onAddFile(e[0]),this.setState({hover:!1,group:this.props.group.rows[0].id})}},{key:"onOpen",value:function(){this.dropzone.open()}},{key:"renderGroupSelect",value:function(){var e=this.props.group.rows;return i.a.createElement("div",{className:"groups"},Object(c.translate)("Import to group")," ",i.a.createElement(An,{items:na(e),name:"group",value:this.state.group,onChange:this.handleInput}))}},{key:"renderInitialDrop",value:function(){return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Import a CSV, .htaccess, or JSON file.")),i.a.createElement("p",null,Object(c.translate)("Click 'Add File' or drag and drop here.")),i.a.createElement("button",{type:"button",className:"button-secondary",onClick:this.handleOpen},Object(c.translate)("Add File")))}},{key:"renderDropBeforeUpload",value:function(){var e=this.props.io.file,t="application/json"===e.type;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("File selected")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),!t&&this.renderGroupSelect(),i.a.createElement("button",{className:"button-primary",onClick:this.handleImport},Object(c.translate)("Upload")),"  ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("Cancel")))}},{key:"renderUploading",value:function(){var e=this.props.io.file;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Importing")),i.a.createElement("p",null,i.a.createElement("code",null,e.name)),i.a.createElement("div",{className:"is-placeholder"},i.a.createElement("div",{className:"placeholder-loading"})))}},{key:"renderUploaded",value:function(){var e=this.props.io.lastImport;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Finished importing")),i.a.createElement("p",null,Object(c.translate)("Total redirects imported:")," ",e),0===e&&i.a.createElement("p",null,Object(c.translate)("Double-check the file is the correct format!")),i.a.createElement("button",{className:"button-secondary",onClick:this.handleCancel},Object(c.translate)("OK")))}},{key:"renderDropzoneContent",value:function(){var e=this.props.io,t=e.importingStatus,n=e.lastImport,r=e.file;return t===fe?this.renderUploading():t===he&&!1!==n&&!1===r?this.renderUploaded():!1===r?this.renderInitialDrop():this.renderDropBeforeUpload()}},{key:"renderExport",value:function(e){return i.a.createElement("div",null,i.a.createElement("textarea",{className:"module-export",rows:"14",readOnly:!0,value:e}),i.a.createElement("input",{className:"button-secondary",type:"submit",value:Object(c.translate)("Close"),onClick:this.handleCancel}))}},{key:"renderExporting",value:function(){return i.a.createElement("div",{className:"loader-wrapper loader-textarea"},i.a.createElement("div",{className:"placeholder-loading"}))}},{key:"renderImporters",value:function(e){var t=this;return i.a.createElement("div",null,i.a.createElement("h3",null,Object(c.translate)("Plugin Importers")),i.a.createElement("p",null,Object(c.translate)("The following redirect plugins were detected on your site and can be imported from.")),e.map(function(e,n){return i.a.createElement(gi,{plugin:e,key:n,doImport:t.doImport})}))}},{key:"render",value:function(){var e=this.state.hover,t=this.props.io,n=t.importingStatus,r=t.file,o=t.exportData,a=t.exportStatus,l=t.importers,s=Wn()({dropzone:!0,"dropzone-dropped":!1!==r,"dropzone-importing":n===fe,"dropzone-hover":e});return i.a.createElement("div",{className:"import"},i.a.createElement("h2",null,Object(c.translate)("Import")),i.a.createElement(si,{ref:this.setDropzone,onDrop:this.handleDrop,onDragLeave:this.handleLeave,onDragEnter:this.handleEnter,className:s,disableClick:!0,disablePreview:!0,multiple:!1},this.renderDropzoneContent()),i.a.createElement("p",null,Object(c.translate)("All imports will be appended to the current database.")),i.a.createElement("div",{className:"inline-notice notice-warning"},i.a.createElement("p",null,Object(c.translate)("{{strong}}CSV file format{{/strong}}: {{code}}source URL, target URL{{/code}} - and can be optionally followed with {{code}}regex, http code{{/code}} ({{code}}regex{{/code}} - 0 for no, 1 for yes).",{components:{code:i.a.createElement("code",null),strong:i.a.createElement("strong",null)}}))),i.a.createElement("h2",null,Object(c.translate)("Export")),i.a.createElement("p",null,Object(c.translate)("Export to CSV, Apache .htaccess, Nginx, or Redirection JSON (which contains all redirects and groups).")),i.a.createElement("select",{name:"module",onChange:this.handleInput,value:this.state.module},i.a.createElement("option",{value:"0"},Object(c.translate)("Everything")),i.a.createElement("option",{value:"1"},Object(c.translate)("WordPress redirects")),i.a.createElement("option",{value:"2"},Object(c.translate)("Apache redirects")),i.a.createElement("option",{value:"3"},Object(c.translate)("Nginx redirects"))),i.a.createElement("select",{name:"format",onChange:this.handleInput,value:this.state.format},i.a.createElement("option",{value:"csv"},Object(c.translate)("CSV")),i.a.createElement("option",{value:"apache"},Object(c.translate)("Apache .htaccess")),i.a.createElement("option",{value:"nginx"},Object(c.translate)("Nginx rewrite rules")),i.a.createElement("option",{value:"json"},Object(c.translate)("Redirection JSON")))," ",i.a.createElement("button",{className:"button-primary",onClick:this.handleView},Object(c.translate)("View"))," ",i.a.createElement("button",{className:"button-secondary",onClick:this.handleDownload},Object(c.translate)("Download")),a===fe&&this.renderExporting(),o&&a!==fe&&this.renderExport(o),i.a.createElement("p",null,Object(c.translate)("Log files can be exported from the log pages.")),l.length>0&&this.renderImporters(l))}}]),t}();var vi=ee(function(e){return{group:e.group,io:e.io}},function(e){return{onLoadGroups:function(){e(La())},onImport:function(t,n){e(pi(t,n))},onAddFile:function(t){e(di(t))},onClearFile:function(){e(fi())},onExport:function(t,n){e(ui(t,n))},onDownloadFile:function(t){e(ci(t))},onLoadImport:function(){e(hi())},pluginImport:function(t){e(mi(t))}}})(yi),Ei=function(){function e(e,t){for(var n=0;n0&&window.scrollTo(0,0)}},{key:"dismiss",value:function(){this.props.onClear()}},{key:"getDebug",value:function(e){for(var t=[Redirectioni10n.versions],n=0;n1?e[e.length-1]+" ("+e.length+")":e[0]}},{key:"renderNotice",value:function(e){var t="notice notice-info redirection-notice"+(this.state.shrunk?" notice-shrunk":"");return i.a.createElement("div",{className:t,onClick:this.handleClick},i.a.createElement("div",{className:"closer"},"✔"),i.a.createElement("p",null,this.state.shrunk?i.a.createElement("span",{title:Object(c.translate)("View notice")},"🔔"):this.getNotice(e)))}},{key:"render",value:function(){var e=this.props.notices;return 0===e.length?null:this.renderNotice(e)}}]),t}();var Vi=ee(function(e){return{notices:e.message.notices}},function(e){return{onClear:function(){e(Mi())}}})(Hi),qi=function(){function e(e,t){for(var n=0;n1?Object(c.translate)("Saving...")+" ("+e+")":Object(c.translate)("Saving...")}},{key:"renderProgress",value:function(e){return i.a.createElement("div",{className:"notice notice-progress redirection-notice"},i.a.createElement(Jr,null),i.a.createElement("p",null,this.getMessage(e)))}},{key:"render",value:function(){var e=this.props.inProgress;return 0===e?null:this.renderProgress(e)}}]),t}();var Ki=ee(function(e){return{inProgress:e.message.inProgress}},null)($i),Qi=function(e){var t=e.item,n=e.isCurrent,r=e.onClick,o=Redirectioni10n.pluginRoot+(""===t.value?"":"&sub="+t.value);return i.a.createElement("li",null,i.a.createElement("a",{className:n?"current":"",href:o,onClick:function(e){e.preventDefault(),r(t.value,o)}},t.name))},Yi=[{name:Object(c.translate)("Redirects"),value:""},{name:Object(c.translate)("Groups"),value:"groups"},{name:Object(c.translate)("Log"),value:"log"},{name:Object(c.translate)("404s"),value:"404s"},{name:Object(c.translate)("Import/Export"),value:"io"},{name:Object(c.translate)("Options"),value:"options"},{name:Object(c.translate)("Support"),value:"support"}],Ji=function(e){var t=e.onChangePage,n=Te();return i.a.createElement("div",{className:"subsubsub-container"},i.a.createElement("ul",{className:"subsubsub"},Yi.map(function(e,r){return i.a.createElement(Qi,{key:r,item:e,isCurrent:n===e.value||"redirect"===n&&""===e.value,onClick:t})}).reduce(function(e,t){return[e," | ",t]})))},Xi=function(){function e(e,t){for(var n=0;n0?document.location.href=t:(history.pushState({},null,t),this.setState({page:e,clicked:this.state.clicked+1}),this.props.onClear())}},{key:"getContent",value:function(e){var t=this.state.clicked;switch(e){case"support":return i.a.createElement(pr,null);case"404s":return i.a.createElement($a,{clicked:t});case"log":return i.a.createElement(go,{clicked:t});case"io":return i.a.createElement(vi,null);case"groups":return i.a.createElement(Pi,{clicked:t});case"options":return i.a.createElement(er,null)}return i.a.createElement(Ui,{clicked:t})}},{key:"renderError",value:function(){var e=[Redirectioni10n.versions,"Buster: 3.3.1 === "+Redirectioni10n.version,"",this.state.stack];return this.state.info&&this.state.info.componentStack&&e.push(this.state.info.componentStack),"3.3.1"!==Redirectioni10n.version?i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Cached Redirection detected")),i.a.createElement("p",null,Object(c.translate)("Please clear your browser cache and reload this page.")),i.a.createElement("p",null,Object(c.translate)("If you are using a caching system such as Cloudflare then please read this: "),i.a.createElement("a",{href:"https://redirection.me/support/problems/cloudflare/?utm_source=redirection&utm_medium=plugin&utm_campaign=support",target:"_blank",rel:"noreferrer noopener"},Object(c.translate)("clearing your cache."))),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+3,cols:"120",value:e.join("\n"),spellCheck:!1}))):i.a.createElement("div",{className:"notice notice-error"},i.a.createElement("h2",null,Object(c.translate)("Something went wrong 🙁")),i.a.createElement("p",null,Object(c.translate)("Redirection is not working. Try clearing your browser cache and reloading this page."),"  ",Object(c.translate)("If you are using a page caching plugin or service (CloudFlare, OVH, etc) then you can also try clearing that cache.")),i.a.createElement("p",null,Object(c.translate)("If that doesn't help, open your browser's error console and create a {{link}}new issue{{/link}} with the details.",{components:{link:i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://github.com/johngodley/redirection/issues"})}})),i.a.createElement("p",null,Object(c.translate)("Please mention {{code}}%s{{/code}}, and explain what you were doing at the time",{components:{code:i.a.createElement("code",null)},args:this.state.page})),i.a.createElement("p",null,i.a.createElement("textarea",{readOnly:!0,rows:e.length+8,cols:"120",value:e.join("\n"),spellCheck:!1})))}},{key:"render",value:function(){var e=Zi[this.state.page];return this.state.error?this.renderError():i.a.createElement("div",{className:"wrap redirection"},i.a.createElement("h1",{className:"wp-heading-inline"},e),"redirect"===this.state.page&&i.a.createElement("a",{href:"#",onClick:this.onAdd,className:"page-title-action"},Object(c.translate)("Add New")),i.a.createElement(Ji,{onChangePage:this.handlePageChange}),i.a.createElement(Gi,null),this.getContent(this.state.page),i.a.createElement(Ki,null),i.a.createElement(Vi,null))}}]),t}();var tl,nl=ee(function(e){return{errors:e.message.errors}},function(e){return{onClear:function(){e(Fi())},onAdd:function(){e(ma(!0))}}})(el),rl=function(){return i.a.createElement(g,{store:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(R.createStore)(En,e,wn(R.applyMiddleware.apply(void 0,_n)))}(xn())},i.a.createElement(nl,null))};document.querySelector("#react-ui")&&(tl="react-ui",p.a.setLocale({"":{localeSlug:Redirectioni10n.localeSlug}}),p.a.addTranslations(Redirectioni10n.locale),function(e,t){s.a.render(i.a.createElement(u.AppContainer,null,i.a.createElement(e,null)),document.getElementById(t))}(rl,tl)),window.redirection=Redirectioni10n.version},function(e,t,n){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){(function(e,r){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(a){"object"==typeof t&&t&&t.nodeType,"object"==typeof e&&e&&e.nodeType;var i="object"==typeof r&&r;i.global!==i&&i.window!==i&&i.self;var l,s=2147483647,u=36,c=1,p=26,f=38,d=700,h=72,m=128,g="-",b=/^xn--/,y=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=u-c,_=Math.floor,O=String.fromCharCode;function x(e){throw new RangeError(E[e])}function k(e,t){for(var n=e.length,r=[];n--;)r[n]=t(e[n]);return r}function S(e,t){var n=e.split("@"),r="";return n.length>1&&(r=n[0]+"@",e=n[1]),r+k((e=e.replace(v,".")).split("."),t).join(".")}function C(e){for(var t,n,r=[],o=0,a=e.length;o=55296&&t<=56319&&o65535&&(t+=O((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=O(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function T(e,t,n){var r=0;for(e=n?_(e/d):e>>1,e+=_(e/t);e>w*p>>1;r+=u)e=_(e/w);return _(r+(w+1)*e/(e+f))}function N(e){var t,n,r,o,a,i,l,f,d,b,y,v=[],E=e.length,w=0,O=m,k=h;for((n=e.lastIndexOf(g))<0&&(n=0),r=0;r=128&&x("not-basic"),v.push(e.charCodeAt(r));for(o=n>0?n+1:0;o=E&&x("invalid-input"),((f=(y=e.charCodeAt(o++))-48<10?y-22:y-65<26?y-65:y-97<26?y-97:u)>=u||f>_((s-w)/i))&&x("overflow"),w+=f*i,!(f<(d=l<=k?c:l>=k+p?p:l-k));l+=u)i>_(s/(b=u-d))&&x("overflow"),i*=b;k=T(w-a,t=v.length+1,0==a),_(w/t)>s-O&&x("overflow"),O+=_(w/t),w%=t,v.splice(w++,0,O)}return j(v)}function R(e){var t,n,r,o,a,i,l,f,d,b,y,v,E,w,k,S=[];for(v=(e=C(e)).length,t=m,n=0,a=h,i=0;i=t&&y_((s-n)/(E=r+1))&&x("overflow"),n+=(l-t)*E,t=l,i=0;is&&x("overflow"),y==t){for(f=n,d=u;!(f<(b=d<=a?c:d>=a+p?p:d-a));d+=u)k=f-b,w=u-b,S.push(O(P(b+k%w,0))),f=_(k/w);S.push(O(P(f,0))),a=T(n,E,r==o),n=0,++r}++n,++t}return S.join("")}l={version:"1.4.1",ucs2:{decode:C,encode:j},decode:N,encode:R,toASCII:function(e){return S(e,function(e){return y.test(e)?"xn--"+R(e):e})},toUnicode:function(e){return S(e,function(e){return b.test(e)?N(e.slice(4).toLowerCase()):e})}},void 0===(o=function(){return l}.call(t,n,t,e))||(e.exports=o)}()}).call(this,n(25)(e),n(10))},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?n+a:r+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(e,t,n){var r,o,a={},i=(r=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===o&&(o=r.apply(this,arguments)),o}),l=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),s=null,u=0,c=[],p=n(27);function f(e,t){for(var n=0;n=0&&c.splice(t,1)}function g(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),h(e,t),t}function b(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=u++;n=s||(s=g(t)),r=w.bind(null,n,i,!1),o=w.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=p(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=g(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=d(e,t);return f(n,t),function(e){for(var r=[],o=0;o*{justify-content:center;align-self:center;margin-left:calc(50% - 30px);margin-top:40px}@media screen and (max-width:782px){.modal .modal-content{width:80%;margin-right:10%}.modal .geo-map iframe{height:255px}.modal .geo-map .geo-full{height:400px!important}}.redirection .wp-list-table tbody>th:not(.check-column){vertical-align:top;padding:5px}.redirection .wp-list-table .column-last_count{width:80px;text-align:left}.redirection .wp-list-table .column-date{width:150px}.redirection .wp-list-table .column-last_access{width:150px;text-align:left}.redirection .wp-list-table .column-ip,.redirection .wp-list-table .column-module,.redirection .wp-list-table .column-total{width:110px}.redirection .wp-list-table .column-redirects{width:100px;text-align:left}.redirection .wp-list-table .column-position{width:80px;text-align:left}.redirection .wp-list-table .column-code{width:50px;text-align:left}.redirection .wp-list-table strike{opacity:.7}.redirection .form-table th a{color:#444}table.edit-redirection{width:100%;padding-right:15px}table.edit-redirection th{width:130px;font-weight:700;text-align:left}table.edit-redirection tbody tr td{display:flex;padding:0}table.edit-redirection tbody tr td>*{flex:1 1 auto;justify-content:flex-start;margin-right:5px}table.edit-redirection tbody tr td .edit-redirection-regex,table.edit-redirection tbody tr td>select{flex:0 0 auto}table.edit-redirection tbody tr td .edit-redirection-position input{width:60px}table.edit-redirection tbody tr td .small-flex{flex-grow:0;padding-top:5px}.edit-groups{width:100%}.edit-groups th{line-height:1.2;vertical-align:top;padding:2px;padding-top:5px!important;padding-left:0;font-size:13px;font-weight:700}.edit-groups td{padding:2px}.edit-groups input[type=text]{width:100%}.table-buttons{float:left;padding-top:2px}.table-buttons>button,.table-buttons>div.table-button-item,.table-buttons>form{margin-right:5px!important;display:inline}.table-buttons .modal-wrapper{display:inline}@media screen and (max-width:782px){input[type=checkbox]{height:20px;width:20px}.wp-list-table td.column-primary{padding-left:10px;padding-right:10px}.redirection .wp-list-table input,.redirection .wp-list-table select,.redirection .wp-list-table td,.redirection .wp-list-table th{font-size:1em!important}.redirection .wp-list-table td.column-code,.redirection .wp-list-table td.column-date,.redirection .wp-list-table td.column-referrer,.redirection .wp-list-table td.column-url .target,.redirection .wp-list-table th.column-code,.redirection .wp-list-table th.column-date{display:none!important}table.edit-redirection{padding-right:0}table.edit-redirection th{display:block;font-weight:700;padding-left:0!important}table.edit-redirection tbody tr td{flex-wrap:wrap}table.edit-redirection tbody tr td>*{flex:1 0 auto;width:100%}table.edit-redirection input[type=number],table.edit-redirection input[type=text],table.edit-redirection select{width:100%}table.edit-groups input[type=number],table.edit-groups select,table.edit-redirection input[type=number],table.edit-redirection select{height:30px!important}}.plugin-status th{text-align:left}.plugin-status span,.plugin-status td,.plugin-status th{padding:5px;vertical-align:top}.plugin-status .plugin-status-good{background-color:#46b450;color:#fff}.plugin-status .plugin-status-problem{background-color:orange;color:#fff}.plugin-status .plugin-status-error{background-color:#ff3860;color:#fff}.github{margin-top:8px}.github a{text-decoration:none}.github img{padding-right:10px;margin-bottom:-10px}.donation .donation-amount{float:left;margin-top:10px}.donation .donation-amount span{font-size:28px;margin-top:4px;vertical-align:bottom}.donation .donation-amount img{width:24px!important;margin-bottom:-5px!important}.donation .donation-amount:after{content:"";display:block;clear:both}.donation input[type=number]{width:60px;margin-left:10px}.donation td,.donation th{padding-bottom:0;margin-bottom:0}.donation input[type=submit]{margin-left:10px}.dropzone{border:3px dashed #bbb;text-align:center;padding:10px;padding-bottom:15px;margin-bottom:10px;border-radius:4px}.dropzone,.dropzone h3{color:#666}.dropzone p{font-size:14px}.dropzone .groups{margin-top:15px;margin-bottom:15px}.dropzone .is-placeholder{width:50%;height:90px;position:relative;margin:0 auto}.dropzone-hover{border-color:#86bfd4}.dropzone-importing{border-color:transparent}.redirection-notice{position:fixed;bottom:25px;right:0;font-weight:700;box-shadow:3px 3px 3px rgba(0,0,0,.2);border-top:1px solid #eee;cursor:pointer;transition:width 1s ease-in-out}.redirection-notice p{padding-right:20px}.redirection-notice .closer{position:absolute;right:5px;top:10px;font-size:16px;opacity:.8}.redirection-notice.notice-shrunk{width:20px}.redirection-notice.notice-shrunk p{font-size:16px}.redirection-notice.notice-shrunk .closer{display:none}.notice-progress{border-left:5px solid green;padding:10px;cursor:auto;bottom:80px}.notice-progress p{margin-left:50px;animation:loading-fade 1.2s ease-in-out infinite}.notice-progress .spinner-container{position:absolute;left:0;top:33px}@keyframes loading-fade{0%{opacity:.5}50%{opacity:1}to{opacity:.5}}.placeholder-container{width:100%;height:100px;position:relative}.placeholder-loading{content:"";position:absolute;top:16px;right:8px;bottom:16px;left:8px;padding-left:8px;padding-top:8px;background-color:#c8d7e1;animation:loading-fade 1.6s ease-in-out infinite}.placeholder-inline{width:100%;height:50px;position:relative}.placeholder-inline .placeholder-loading{top:0;right:0;left:0;bottom:0}.loading-small{width:25px;height:25px}input.current-page{width:60px}.loader-wrapper{position:relative}.loader-textarea{height:100px}.wp-list-table .is-placeholder td{position:relative;height:50px}.wp-list-table .item-loading{opacity:.3}.subsubsub-container:after,.subsubsub-container:before{content:"";display:table}.subsubsub-container:after{clear:both}.wp-core-ui .button-delete{color:#fff}.wp-core-ui .button-delete,.wp-core-ui .button-delete:hover{box-shadow:none;text-shadow:none;background-color:#ff3860;border-color:transparent}.inline-notice{background:#fff;border-left:4px solid #fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);margin:5px 15px 2px;padding:1px 12px;margin:5px 0 15px;border-left-color:#ffb900}.inline-notice.inline-general{border-left-color:#46b450}.addTop{margin-top:20px}@media screen and (max-width:782px){.newsletter form input[type=email]{display:block;width:100%;margin:5px 0}.import select{width:100%;margin:5px 0}.plugin-importer button{width:100%}p.search-box input[name=s]{margin-top:20px}}.notice-error{margin-top:3em}.notice-error .closer{float:right;padding-top:5px;font-size:18px;cursor:pointer;color:#333}.notice-error textarea{font-family:courier;font-size:12px;background-color:#eee;width:100%}.notice-error span code{background-color:transparent}.module-export{border:1px solid #ddd;padding:5px;font-family:courier;margin-top:15px;width:100%;background-color:#fff!important}.redirects a.advanced{text-decoration:none}',""])},function(e,t,n){var r=n(30);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(28)(r,o);r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";var r=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,n,l){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),function(i){var l=encodeURIComponent(r(i))+n;return o(e[i])?a(e[i],function(e){return l+encodeURIComponent(r(e))}).join(t):l+encodeURIComponent(r(e[i]))}).join(t):l?encodeURIComponent(r(l))+n+encodeURIComponent(r(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var n=[],r=0;r0&&u>s&&(u=s);for(var c=0;c=0?(p=m.substr(0,g),f=m.substr(g+1)):(p=m,f=""),d=decodeURIComponent(p),h=decodeURIComponent(f),r(i,d)?o(i[d])?i[d].push(h):i[d]=[i[d],h]:i[d]=h}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r=n(6),o=n(7),a=n(35);e.exports=function(){function e(e,t,n,r,i,l){l!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){e.exports= /** * Exposes number format capability through i18n mixin * * @copyright Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) and Contributors (http://phpjs.org/authors). * @license See CREDITS.md * @see https://github.com/kvz/phpjs/blob/ffe1356af23a6f2512c84c954dd4e828e92579fa/functions/strings/number_format.js */ function(e,t,n,r){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var o=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,i=void 0===r?",":r,l=void 0===n?".":n,s="";return(s=(a?function(e,t){var n=Math.pow(10,t);return""+(Math.round(e*n)/n).toFixed(t)}(o,a):""+Math.round(o)).split("."))[0].length>3&&(s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(s[1]||"").lengththis.maxAge)||(this.remove(e),this.emit("evict",{key:e,value:t.value}),!1)},a.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},a.prototype.evict=function(){if(this.tail){var e=this.tail,t=this.remove(this.tail);this.emit("evict",{key:e,value:t})}}},function(e,t,n){"use strict";function r(e){return e.match(/^\{\{\//)?{type:"componentClose",value:e.replace(/\W/g,"")}:e.match(/\/\}\}$/)?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.match(/^\{\{/)?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}e.exports=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(r)}},function(e,t,n){"use strict";var r=n(6);e.exports=r},function(e,t,n){"use strict";var r=n(0),o="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,a=n(6),i=n(7),l=n(41),s=".",u=":",c="function"==typeof Symbol&&Symbol.iterator,p="@@iterator";function f(e,t){return e&&"object"==typeof e&&null!=e.key?(n=e.key,r={"=":"=0",":":"=2"},"$"+(""+n).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var n,r}function d(e,t,n,r){var a,l=typeof e;if("undefined"!==l&&"boolean"!==l||(e=null),null===e||"string"===l||"number"===l||"object"===l&&e.$$typeof===o)return n(r,e,""===t?s+f(e,0):t),1;var h=0,m=""===t?s:t+u;if(Array.isArray(e))for(var g=0;g "+s);if("componentClose"===p.type)throw new Error("Missing opening component token: `"+p.value+"`");if("componentOpen"===p.type){n=t[p.value],l=f;break}m.push(t[p.value])}else m.push(p.value);return n&&(c=function(e,t){var n,r,o=t[e],a=0;for(r=e+1;ri.length?(this.options.missing_key_callback&&this.options.missing_key_callback(u,e),l=[n,r],!0===this.options.debug&&console.log(l[f(m)(o)]),l[f()(o)]):(l=i[s])||(l=[n,r])[f()(o)]}});var h,m,g=function(){function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function t(e,t){for(var n=[];t>0;n[--t]=e);return n.join("")}var n=function(){return n.cache.hasOwnProperty(arguments[0])||(n.cache[arguments[0]]=n.parse(arguments[0])),n.format.call(null,n.cache[arguments[0]],arguments)};return n.format=function(n,r){var o,a,i,l,s,u,c,p=1,f=n.length,d="",h=[];for(a=0;a=0?"+"+o:o,u=l[4]?"0"==l[4]?"0":l[4].charAt(1):" ",c=l[6]-String(o).length,s=l[6]?t(u,c):"",h.push(l[5]?o+s:s+o)}return h.join("")},n.cache={},n.parse=function(e){for(var t=e,n=[],r=[],o=0;t;){if(null!==(n=/^[^\x25]+/.exec(t)))r.push(n[0]);else if(null!==(n=/^\x25{2}/.exec(t)))r.push("%");else{if(null===(n=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(t)))throw"[sprintf] huh?";if(n[2]){o|=1;var a=[],i=n[2],l=[];if(null===(l=/^([a-z_][a-z_\d]*)/i.exec(i)))throw"[sprintf] huh?";for(a.push(l[1]);""!==(i=i.substring(l[0].length));)if(null!==(l=/^\.([a-z_][a-z_\d]*)/i.exec(i)))a.push(l[1]);else{if(null===(l=/^\[(\d+)\]/.exec(i)))throw"[sprintf] huh?";a.push(l[1])}n[2]=a}else o|=2;if(3===o)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";r.push(n)}t=t.substring(n[0].length)}return r},n}();p.parse_plural=function(e,t){return e=e.replace(/n/g,t),p.parse_expression(e)},p.sprintf=function(e,t){return"[object Array]"=={}.toString.call(t)?function(e,t){return t.unshift(e),g.apply(null,t)}(e,[].slice.call(t)):g.apply(this,[].slice.call(arguments))},p.prototype.sprintf=function(){return p.sprintf.apply(this,arguments)},p.PF={},p.PF.parse=function(e){var t=p.PF.extractPluralExpr(e);return p.PF.parser.parse.call(p.PF.parser,t)},p.PF.compile=function(e){var t=p.PF.parse(e);return function(e){return!0===(n=p.PF.interpreter(t)(e))?1:n||0;var n}},p.PF.interpreter=function(e){return function(t){switch(e.type){case"GROUP":return p.PF.interpreter(e.expr)(t);case"TERNARY":return p.PF.interpreter(e.expr)(t)?p.PF.interpreter(e.truthy)(t):p.PF.interpreter(e.falsey)(t);case"OR":return p.PF.interpreter(e.left)(t)||p.PF.interpreter(e.right)(t);case"AND":return p.PF.interpreter(e.left)(t)&&p.PF.interpreter(e.right)(t);case"LT":return p.PF.interpreter(e.left)(t)p.PF.interpreter(e.right)(t);case"LTE":return p.PF.interpreter(e.left)(t)<=p.PF.interpreter(e.right)(t);case"GTE":return p.PF.interpreter(e.left)(t)>=p.PF.interpreter(e.right)(t);case"EQ":return p.PF.interpreter(e.left)(t)==p.PF.interpreter(e.right)(t);case"NEQ":return p.PF.interpreter(e.left)(t)!=p.PF.interpreter(e.right)(t);case"MOD":return p.PF.interpreter(e.left)(t)%p.PF.interpreter(e.right)(t);case"VAR":return t;case"NUM":return e.val;default:throw new Error("Invalid Token found.")}}},p.PF.extractPluralExpr=function(e){e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),/;\s*$/.test(e)||(e=e.concat(";"));var t,n=/nplurals\=(\d+);/,r=e.match(n);if(!(r.length>1))throw new Error("nplurals not found in plural_forms string: "+e);if(r[1],!((t=(e=e.replace(n,"")).match(/plural\=(.*);/))&&t.length>1))throw new Error("`plural` expression not found: "+e);return t[1]},p.PF.parser=(h={trace:function(){},yy:{},symbols_:{error:2,expressions:3,e:4,EOF:5,"?":6,":":7,"||":8,"&&":9,"<":10,"<=":11,">":12,">=":13,"!=":14,"==":15,"%":16,"(":17,")":18,n:19,NUMBER:20,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",6:"?",7:":",8:"||",9:"&&",10:"<",11:"<=",12:">",13:">=",14:"!=",15:"==",16:"%",17:"(",18:")",19:"n",20:"NUMBER"},productions_:[0,[3,2],[4,5],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,3],[4,1],[4,1]],performAction:function(e,t,n,r,o,a,i){var l=a.length-1;switch(o){case 1:return{type:"GROUP",expr:a[l-1]};case 2:this.$={type:"TERNARY",expr:a[l-4],truthy:a[l-2],falsey:a[l]};break;case 3:this.$={type:"OR",left:a[l-2],right:a[l]};break;case 4:this.$={type:"AND",left:a[l-2],right:a[l]};break;case 5:this.$={type:"LT",left:a[l-2],right:a[l]};break;case 6:this.$={type:"LTE",left:a[l-2],right:a[l]};break;case 7:this.$={type:"GT",left:a[l-2],right:a[l]};break;case 8:this.$={type:"GTE",left:a[l-2],right:a[l]};break;case 9:this.$={type:"NEQ",left:a[l-2],right:a[l]};break;case 10:this.$={type:"EQ",left:a[l-2],right:a[l]};break;case 11:this.$={type:"MOD",left:a[l-2],right:a[l]};break;case 12:this.$={type:"GROUP",expr:a[l-1]};break;case 13:this.$={type:"VAR"};break;case 14:this.$={type:"NUM",val:Number(e)}}},table:[{3:1,4:2,17:[1,3],19:[1,4],20:[1,5]},{1:[3]},{5:[1,6],6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{4:17,17:[1,3],19:[1,4],20:[1,5]},{5:[2,13],6:[2,13],7:[2,13],8:[2,13],9:[2,13],10:[2,13],11:[2,13],12:[2,13],13:[2,13],14:[2,13],15:[2,13],16:[2,13],18:[2,13]},{5:[2,14],6:[2,14],7:[2,14],8:[2,14],9:[2,14],10:[2,14],11:[2,14],12:[2,14],13:[2,14],14:[2,14],15:[2,14],16:[2,14],18:[2,14]},{1:[2,1]},{4:18,17:[1,3],19:[1,4],20:[1,5]},{4:19,17:[1,3],19:[1,4],20:[1,5]},{4:20,17:[1,3],19:[1,4],20:[1,5]},{4:21,17:[1,3],19:[1,4],20:[1,5]},{4:22,17:[1,3],19:[1,4],20:[1,5]},{4:23,17:[1,3],19:[1,4],20:[1,5]},{4:24,17:[1,3],19:[1,4],20:[1,5]},{4:25,17:[1,3],19:[1,4],20:[1,5]},{4:26,17:[1,3],19:[1,4],20:[1,5]},{4:27,17:[1,3],19:[1,4],20:[1,5]},{6:[1,7],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[1,28]},{6:[1,7],7:[1,29],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16]},{5:[2,3],6:[2,3],7:[2,3],8:[2,3],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,3]},{5:[2,4],6:[2,4],7:[2,4],8:[2,4],9:[2,4],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,4]},{5:[2,5],6:[2,5],7:[2,5],8:[2,5],9:[2,5],10:[2,5],11:[2,5],12:[2,5],13:[2,5],14:[2,5],15:[2,5],16:[1,16],18:[2,5]},{5:[2,6],6:[2,6],7:[2,6],8:[2,6],9:[2,6],10:[2,6],11:[2,6],12:[2,6],13:[2,6],14:[2,6],15:[2,6],16:[1,16],18:[2,6]},{5:[2,7],6:[2,7],7:[2,7],8:[2,7],9:[2,7],10:[2,7],11:[2,7],12:[2,7],13:[2,7],14:[2,7],15:[2,7],16:[1,16],18:[2,7]},{5:[2,8],6:[2,8],7:[2,8],8:[2,8],9:[2,8],10:[2,8],11:[2,8],12:[2,8],13:[2,8],14:[2,8],15:[2,8],16:[1,16],18:[2,8]},{5:[2,9],6:[2,9],7:[2,9],8:[2,9],9:[2,9],10:[2,9],11:[2,9],12:[2,9],13:[2,9],14:[2,9],15:[2,9],16:[1,16],18:[2,9]},{5:[2,10],6:[2,10],7:[2,10],8:[2,10],9:[2,10],10:[2,10],11:[2,10],12:[2,10],13:[2,10],14:[2,10],15:[2,10],16:[1,16],18:[2,10]},{5:[2,11],6:[2,11],7:[2,11],8:[2,11],9:[2,11],10:[2,11],11:[2,11],12:[2,11],13:[2,11],14:[2,11],15:[2,11],16:[2,11],18:[2,11]},{5:[2,12],6:[2,12],7:[2,12],8:[2,12],9:[2,12],10:[2,12],11:[2,12],12:[2,12],13:[2,12],14:[2,12],15:[2,12],16:[2,12],18:[2,12]},{4:30,17:[1,3],19:[1,4],20:[1,5]},{5:[2,2],6:[1,7],7:[2,2],8:[1,8],9:[1,9],10:[1,10],11:[1,11],12:[1,12],13:[1,13],14:[1,14],15:[1,15],16:[1,16],18:[2,2]}],defaultActions:{6:[2,1]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,n=[0],r=[null],o=[],a=this.table,i="",l=0,s=0,u=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;function p(){var e;return"number"!=typeof(e=t.lexer.lex()||1)&&(e=t.symbols_[e]||e),e}o.push(c),"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var f,d,h,m,g,b,y,v,E,w,_={};;){if(h=n[n.length-1],this.defaultActions[h]?m=this.defaultActions[h]:(null==f&&(f=p()),m=a[h]&&a[h][f]),void 0===m||!m.length||!m[0]){if(!u){for(b in E=[],a[h])this.terminals_[b]&&b>2&&E.push("'"+this.terminals_[b]+"'");var O="";O=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+E.join(", ")+", got '"+this.terminals_[f]+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==f?"end of input":"'"+(this.terminals_[f]||f)+"'"),this.parseError(O,{text:this.lexer.match,token:this.terminals_[f]||f,line:this.lexer.yylineno,loc:c,expected:E})}if(3==u){if(1==f)throw new Error(O||"Parsing halted.");s=this.lexer.yyleng,i=this.lexer.yytext,l=this.lexer.yylineno,c=this.lexer.yylloc,f=p()}for(;!(2..toString()in a[h]);){if(0==h)throw new Error(O||"Parsing halted.");w=1,n.length=n.length-2*w,r.length=r.length-w,o.length=o.length-w,h=n[n.length-1]}d=f,f=2,m=a[h=n[n.length-1]]&&a[h][2],u=3}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+h+", token: "+f);switch(m[0]){case 1:n.push(f),r.push(this.lexer.yytext),o.push(this.lexer.yylloc),n.push(m[1]),f=null,d?(f=d,d=null):(s=this.lexer.yyleng,i=this.lexer.yytext,l=this.lexer.yylineno,c=this.lexer.yylloc,u>0&&u--);break;case 2:if(y=this.productions_[m[1]][1],_.$=r[r.length-y],_._$={first_line:o[o.length-(y||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(y||1)].first_column,last_column:o[o.length-1].last_column},void 0!==(g=this.performAction.call(_,i,s,l,this.yy,m[1],r,o)))return g;y&&(n=n.slice(0,-1*y*2),r=r.slice(0,-1*y),o=o.slice(0,-1*y)),n.push(this.productions_[m[1]][0]),r.push(_.$),o.push(_._$),v=a[n[n.length-2]][n[n.length-1]],n.push(v);break;case 3:return!0}}return!0}},m=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parseError)throw new Error(e);this.yy.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e,e.match(/\n/)&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r=/,/^/,/^!=/,/^==/,/^%/,/^\(/,/^\)/,/^$/,/^./],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return e}(),h.lexer=m,h),void 0!==e&&e.exports&&(t=e.exports=p),t.Jed=p}()},function(e,t,n){var r="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};Jed=n(44),EventEmitter=n(12).EventEmitter,interpolateComponents=n(43).default,LRU=n(39);var o=n(37);function a(){u.throwErrors&&"undefined"!=typeof window&&window.console&&window.console.warn&&window.console.warn.apply(window.console,arguments)}function i(e){return Array.prototype.slice.call(e)}function l(e){var t,n=e[0],o={};for(("string"!=typeof n||e.length>3||e.length>2&&"object"===r(e[1])&&"object"===r(e[2]))&&a("Deprecated Invocation: `translate()` accepts ( string, [string], [object] ). These arguments passed:",i(e),". See https://github.com/Automattic/i18n-calypso#translate-method"),2===e.length&&"string"==typeof n&&"string"==typeof e[1]&&a("Invalid Invocation: `translate()` requires an options object for plural translations, but passed:",i(e)),t=0;tthis.eventPool.length&&this.eventPool.push(e)}function Oe(e){e.eventPool=[],e.getPooled=we,e.release=_e}i(Ee.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=l.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=l.thatReturnsTrue)},persist:function(){this.isPersistent=l.thatReturnsTrue},isPersistent:l.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t=je),Ne=String.fromCharCode(32),Re={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},De=!1;function Ae(e,t){switch(e){case"keyup":return-1!==Se.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ie(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Le=!1;var Ue={eventTypes:Re,extractEvents:function(e,t,n,r){var o=void 0,a=void 0;if(Ce)e:{switch(e){case"compositionstart":o=Re.compositionStart;break e;case"compositionend":o=Re.compositionEnd;break e;case"compositionupdate":o=Re.compositionUpdate;break e}o=void 0}else Le?Ae(e,n)&&(o=Re.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=Re.compositionStart);return o?(Te&&(Le||o!==Re.compositionStart?o===Re.compositionEnd&&Le&&(a=ge()):(me._root=r,me._startText=be(),Le=!0)),o=xe.getPooled(o,t,n,r),a?o.data=a:null!==(a=Ie(n))&&(o.data=a),ee(o),a=o):a=null,(e=Pe?function(e,t){switch(e){case"compositionend":return Ie(t);case"keypress":return 32!==t.which?null:(De=!0,Ne);case"textInput":return(e=t.data)===Ne&&De?null:e;default:return null}}(e,n):function(e,t){if(Le)return"compositionend"===e||!Ce&&Ae(e,t)?(e=ge(),me._root=null,me._startText=null,me._fallbackText=null,Le=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1