Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (window.webpackJsonp=window.webpackJsonp||[]).push([[149],{11:function(e,t,n){"use strict";n.d(t,"k",function(){return h}),n.d(t,"x",function(){return m}),n.d(t,"w",function(){return O}),n.d(t,"v",function(){return E}),n.d(t,"h",function(){return b}),n.d(t,"g",function(){return v}),n.d(t,"z",function(){return g}),n.d(t,"y",function(){return _}),n.d(t,"p",function(){return y}),n.d(t,"e",function(){return C}),n.d(t,"o",function(){return j}),n.d(t,"s",function(){return S}),n.d(t,"q",function(){return N}),n.d(t,"f",function(){return A}),n.d(t,"r",function(){return k}),n.d(t,"n",function(){return L}),n.d(t,"t",function(){return x}),n.d(t,"d",function(){return D}),n.d(t,"b",function(){return W}),n.d(t,"i",function(){return H}),n.d(t,"c",function(){return V}),n.d(t,"m",function(){return G}),n.d(t,"a",function(){return U}),n.d(t,"j",function(){return F}),n.d(t,"l",function(){return B}),n.d(t,"u",function(){return z}),n.d(t,"A",function(){return q});var r=n(0),i=n(8),o=n(27),a=n(4),c=n(54),s=n(42),u=n(70),l=n(55),d=n(60),f=n(48),p=n(44),h=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",n,"shippingLabel",t],null)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.loaded},O=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.isFetching},E=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.error},b=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.loaded?r.labels:[]},v=function(e,t,n,r){return b(e,t,n).find(function(e){return e.label_id===r})},g=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.fulfillOrder},_=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.emailDetails},y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.refreshedLabelStatus},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),r=h(e,t,n);return r&&r.form},j=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),o=C(e,t,n);if(!o)return null;var c=o.rates,s=c.values,u=c.available,l=[],d=0,f=0,p=function(e){if(!(e in u))return"continue";var t=s[e],n=t.serviceId,o=t.signatureRequired,a=u[e].default.rates,c=null,p=null;o in u[e]&&(c=u[e][o].rates,p=Object(r.find)(c,function(e){return n===e.service_id})||null);var h=Object(r.find)(a,function(e){return n===e.service_id});if(h){var m=h.retail_rate-h.rate,O=h.rate,E={title:h.title,retailRate:h.retail_rate,rateWithDiscount:O,addons:[],carrierId:h.carrier_id,carrierTitle:h.title.split("-")[0].trim()};null!==p&&(E.addons=[{title:Object(i.translate)("Signature Required"),rate:p.rate-h.rate}],O=p.rate),l.push(E),d+=Object(r.round)(m,2),f+=O}};for(var h in s)p(h);return l.length?{prices:l,discount:d,total:f}:null},S=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(Object(r.isEmpty)(i))return!1;var o=Object(l.a)(i.origin);if("US"===o.country&&Object(r.includes)(d.d,o.state))return!0;var c=Object(l.a)(i.destination);return!("US"!==c.country||!Object(r.includes)(d.d,c.state))||o.country!==c.country},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[C(e,t,n)]}),I=function(e,t,n,o){var a=t.values,c=Object(l.a)(t),s=c.name,u=c.company,p=c.phone,h=c.postcode,m=c.state,O=c.country,E={};["address","city","postcode","country"].forEach(function(e){a[e]||(E[e]=Object(i.translate)("This field is required"))}),s||u||(E.name=Object(i.translate)("Either Name or Company field is required"),E.company=Object(i.translate)("Either Name or Company field is required")),Object(r.includes)(d.a,O)&&!/^\d{5}(?:-\d{4})?$/.test(h)&&(E.postcode=Object(i.translate)("Invalid ZIP/Postal code format")),!m&&Object(f.k)(e,O,n)&&(E.state=Object(i.translate)("This field is required"));var b=o.originPhone,v=o.destinationPhone;return!0===b&&(p?10!==p.split(/\D+/g).join("").replace(/^1/,"").length&&(E.phone=Object(i.translate)("Customs forms require a 10-digit phone number. Please edit your phone number so it has at most 10 digits.")):E.phone=Object(i.translate)("An origin address phone number is required for this shipment.")),!0!==v||p||(E.phone=Object(i.translate)("A destination address phone number is required for this shipment.")),E},R=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.isNormalized,a=e.isUnverifiable,c=e.normalized,s=e.ignoreValidation,u=e.fieldErrors;if((o||a)&&!c&&u)return u;if(o&&!c)return{address:Object(i.translate)("This address is not recognized. Please try another.")};var l=I(t,e,n,r);return s&&Object.keys(l).forEach(function(e){s[e]&&delete l[e]}),l},T=function(e,t,n,o,c){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Object(a.a)(c),u=Object(r.uniq)(Object(r.flatten)(Object(r.map)(e,function(e){return Object(r.map)(e.items,"product_id")}))),l=Object(r.zipObject)(u,Object(r.fill)(Array(u.length),0));Object(r.forEach)(e,function(e){Object(r.forEach)(e.items,function(e){var n=e.quantity,r=e.product_id;return l[r]+=n*t.items[r].value})});var f={};return Object(r.forEach)(Object(r.pick)(t.items,u),function(e,t){e.tariffNumber&&6===e.tariffNumber.length&&(f[e.tariffNumber]||(f[e.tariffNumber]=0),f[e.tariffNumber]+=l[t])}),{packages:Object(r.mapValues)(e,function(e){var a={};"other"!==e.contentsType||e.contentsExplanation||(a.contentsExplanation=Object(i.translate)("Please describe what kind of goods this package contains")),"other"!==e.restrictionType||e.restrictionComments||(a.restrictionComments=Object(i.translate)("Please describe what kind of restrictions this package must have"));var c=new Set;return Object(r.forEach)(e.items,function(e){var n=e.product_id,r=t.items[n].tariffNumber;25000||(a.weight=Object(i.translate)("Weight must be greater than zero"))),t.ignoreValueValidation[o]||(Object(r.isNil)(e.value)||""===e.value?a.value=Object(i.translate)("This field is required"):parseFloat(e.value)>0||(a.value=Object(i.translate)("Declared value must be greater than zero"))),e.tariffNumber&&6!==e.tariffNumber.length?a.tariffNumber=Object(i.translate)("The tariff number must be 6 digits long"):!e.tariffNumber&&P(c,n,s)&&(a.tariffNumber=Object(i.translate)("The tariff number is required for EU countries destination")),a})}},N=function(e){var t=e.values,n=e.available,i=Object(r.map)(n,function(e,n){return t[n]});return!Object(r.isEmpty)(i)&&Object(r.every)(i)},M=function(e){var t=e.values,n=e.available;return Object(r.mapValues)(n,function(e,n){if(!Object(r.isEmpty)(e.default.errors)){var o=e.default.errors.map(function(e){return e.userMessage||e.message}).filter(Boolean);return o.length?o:["We couldn't get a rate for this package, please try again."]}return t[n]&&t[n].serviceId?[]:Object(r.isEmpty)(e.default.rates)?[Object(i.translate)("No rates available, please double check dimensions and weight or try using different packaging.")]:[Object(i.translate)("Please choose a rate")]})},w=function(e){var t={};return e||(t.paperSize=Object(i.translate)("This field is required")),t},A=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!m(e,t,n))return{};var o=h(e,t,n),c=o.form,s=o.paperSize;if(Object(r.isEmpty)(c))return{};var u,l=c.destination.values.country,d=Object(f.g)(e,l,n),p=S(e,t,n),O=p;return{origin:R(c.origin,e,n,{originPhone:p}),destination:R(c.destination,e,n,{destinationPhone:O}),packages:(u=c.packages.selected,Object(r.mapValues)(u,function(e){var t={};"not_selected"===e.box_id&&(t.box_id=Object(i.translate)("Please select a package"));var n=function(e){return!Object(r.isFinite)(e)||0>=e};return n(e.weight)&&(t.weight=Object(i.translate)("Invalid weight")),Object(r.some)([e.length,e.width,e.height],n)&&(t.dimensions=Object(i.translate)("Package dimensions must be greater than zero")),t})),customs:T(c.packages.selected,c.customs,l,d,e,n),rates:M(c.rates),sidebar:w(s)}},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[h(e,t,n)]}),k=Object(o.a)(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e),i=h(e,t,r).form,o="origin"===n&&S(e,t,r),c=o?{originPhone:o}:{},s=I(e,i[n],r,c);return 0===Object.keys(s).length},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(a.a)(e);return[h(e,t,r).form[n]]}),P=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=Object(f.h)(e,n);return Object(r.includes)(i,t)},L=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return P(e,t,n)?"":Object(i.translate)("Optional")},x=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(!i)return!1;var o=Object(r.uniq)(Object(r.flatten)(Object(r.map)(i.packages.selected,function(e){return Object(r.map)(e.items,"product_id")})));return!Object(r.some)(o.map(function(e){return Object(r.isNil)(i.customs.items[e].tariffNumber)||i.customs.ignoreWeightValidation[e]||i.customs.ignoreValueValidation[e]}))},D=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);if(!i)return null;var o=A(e,t,n);return i.origin.isNormalized&&Object(r.isEqual)(i.origin.values,i.origin.normalized)&&!Object(c.a)(o.origin)?i.destination.isNormalized&&Object(r.isEqual)(i.destination.values,i.destination.normalized)&&!Object(c.a)(o.destination)?Object(c.a)(o.packages)?"packages":!S(e,t,n)||!Object(c.a)(o.customs)&&x(e,t,n)?Object(c.a)(o.rates)?"rates":null:"customs":"destination":"origin"},W=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e),i=C(e,t,n);return!Object(r.isEmpty)(i)&&!D(e,t,n)&&!i.origin.normalizationInProgress&&!i.destination.normalizationInProgress&&!i.rates.retrievalInProgress&&!Object(r.isEmpty)(i.rates.available)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return[C(e,t,n),D(e,t,n)]}),H=Object(o.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=Object(f.d)(e,t);return Object(p.b)(e,t)?Object(r.pick)(n,d.a):Object(r.pick)(n,d.b)},[f.d,p.b]),V=Object(o.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e),n=Object(f.d)(e,t);return Object(p.b)(e,t)?n:Object(r.pick)(n,d.b)},[f.d,p.b]),G=Object(o.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);if(!Object(f.k)(e,t,n))return null;var i=Object(f.j)(e,t,n),o={};return i.forEach(function(e){var t=e.code,n=e.name;return o[t]=n}),"US"!==t||Object(p.b)(e,n)?o:Object(r.omit)(o,d.d)},[f.j,p.b]),U=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(a.a)(e);return m(e,t,n)&&Object(s.d)(e,n)&&Object(u.i)(e,n)&&Object(f.b)(e,n)},F=function(e,t){var n=t.siteId,i=t.orderId,o=h(e,i,n);return Object(r.get)(o,["form","packages","selected",o.openedPackageId,"hazmatType"],"")},B=function(e,t){var n=h(e,t,Object(a.a)(e));return Object(r.get)(n,["form","packages","selected",n.openedPackageId],"")},z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings","meta"],null).is_eligible_to_migrate},q=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(a.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings","meta"],null).wcshipping_migration_state}},111:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(6);function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();return{type:r.j,siteId:e,originalAction:t,data:n,time:i}}},113:function(e,t,n){"use strict";n.d(t,"c",function(){return u}),n.d(t,"a",function(){return l}),n.d(t,"b",function(){return d});var r=n(0),i=n(4),o=n(181),a=n(39),c=n(44),s=n(114),u=function(e,t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneMethods"])}(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e));return Object(r.isObject)(n)?n[t]:null},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),a=Object(o.b)(e,n);if(!Object(r.isArray)(a))return!1;var l=Object(r.find)(a,{id:t});if(!l||!Object(r.isArray)(l.methodIds))return!1;if(!Object(c.a)(e,n))return!0;var d=l.methodIds.map(function(t){var i=u(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.every)(d,function(t){var r=t.id;return Object(s.a)(e,r,n)})},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),l=Object(o.b)(e,n);if(!Object(r.isArray)(l))return!1;var d=Object(r.find)(l,{id:t});if(!d)return!1;if(a.b===d.methodIds)return!0;if(!Object(c.a)(e,n)||!Object(r.isArray)(d.methodIds))return!1;var f=d.methodIds.map(function(t){var i=u(e,t,n);return i&&Object(r.startsWith)(i.methodType,"wc_services")?i:null}).filter(Boolean);return Object(r.some)(f,function(t){var r=t.id;return Object(s.b)(e,r,n)})}},114:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n.d(t,"b",function(){return s});var r=n(0),i=n(4),o=n(39),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingZoneMethodSettings"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return!0===a(e,n)[t]},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o.b===a(e,n)[t]}},128:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"c",function(){return o});var r=function(){return{}},i=function(){return""},o=function(){return!0}},13:function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return y}),n.d(t,"d",function(){return C}),n.d(t,"b",function(){return j}),n.d(t,"a",function(){return S});var r={};n.r(r),n.d(r,"accountSettings",function(){return o}),n.d(r,"packages",function(){return a}),n.d(r,"orderLabels",function(){return c}),n.d(r,"getLabelRates",function(){return s}),n.d(r,"labelsStatus",function(){return u}),n.d(r,"labelRefund",function(){return l}),n.d(r,"labelsPrint",function(){return d}),n.d(r,"labelTestPrint",function(){return f}),n.d(r,"addressNormalization",function(){return p}),n.d(r,"serviceSettings",function(){return h}),n.d(r,"shippingCarrier",function(){return m}),n.d(r,"shippingCarriers",function(){return O}),n.d(r,"subscriptions",function(){return E}),n.d(r,"subscriptionActivate",function(){return b}),n.d(r,"shippingCarrierDelete",function(){return v}),n.d(r,"shippingCarrierTypes",function(){return g});var i=n(94),o="connect/account/settings",a=window.wcConnectData&&"1"===window.wcConnectData.is_wcshipping_active?"connect/wcservices/packages":"connect/packages",c=function(e){return"connect/label/".concat(e)},s=function(e){return"connect/label/".concat(e,"/rates")},u=function(e,t){return"connect/label/".concat(e,"/").concat(t.join())},l=function(e,t){return"connect/label/".concat(e,"/").concat(t,"/refund")},d=function(){return"connect/label/print"},f=function(){return"connect/label/preview"},p=function(){return"connect/normalize-address"},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"connect/services/".concat(e,"/").concat(t)},m=function(){return"connect/shipping/carrier"},O=function(){return"connect/shipping/carriers"},E=function(){return"connect/subscriptions"},b=function(e){return"connect/subscription/".concat(e,"/activate")},v=function(e){return"connect/shipping/carrier/".concat(e)},g=function(){return"connect/shipping/carrier-types"},_=function(e){if(e&&e.message)throw e.message;if(e&&e.data&&e.data.message)throw e.data.message;throw e},y=function(e,t,n){return Object(i.a)(e).post(t,n,"wc/v1").catch(_)},C=function(e,t,n){return Object(i.a)(e).put(t,n,"wc/v1").catch(_)},j=function(e,t){return Object(i.a)(e).get(t,"wc/v1").catch(_)},S=function(e,t){return Object(i.a)(e).del(t,"wc/v1").catch(_)}},131:function(e,t,n){"use strict";n.d(t,"a",function(){return r});n(1),n(0);function r(e){if(!e.data)throw new Error("Failure at remote site.",e);return e}},152:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(0),i=function(e,t){return Object(r.isArray)(e)?e.concat(t):void 0},o=function(){for(var e=arguments.length,t=new Array(e),n=0;n1?r.mergeWith.apply(void 0,[Object.create(null)].concat(t,[i])):t[0]}},181:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return s});var r=n(0),i=n(4),o=(n(39),n(113)),a=n(183),c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZones"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return Object(r.isArray)(n)&&Object(r.every)(n,function(n){return Object(o.a)(e,n.id,t)})&&Object(r.every)(n,function(n){return Object(a.a)(e,n.id,t)})}},182:function(e,t,n){"use strict";n.d(t,"b",function(){return A}),n.d(t,"a",function(){return M});var r=n(62),i=n.n(r),o=n(52),a=n.n(o),c=n(78),s=n.n(c),u=n(91),l=n.n(u),d=n(85),f=n.n(d),p=n(93),h=n.n(p),m=n(92),O=n.n(m),E=n(5),b=n.n(E),v=n(2),g=n.n(v),_=n(61),y=n(68),C=n.n(y),j=n(41),S=n.n(j),I=n(0),R=n(27),T=Object(R.a)(function(e){return Object(I.get)(e,"ui.language.localeSlug",null)},function(e){return e.ui.language}),N=S()("calypso:localized-moment"),M=g.a.createContext(C.a),w=function(e){function t(){var e,n;a()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"shippingZoneLocations"])},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e),o=a(e,n);return o&&Object(r.isObject)(o[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return a(e,n)&&o.b===a(e,n)[t]}},24:function(e,t,n){"use strict";n.d(t,"c",function(){return s}),n.d(t,"d",function(){return l}),n.d(t,"a",function(){return d}),n.d(t,"b",function(){return f});var r=n(69),i=n.n(r),o=n(0),a={debounce:o.debounce,isPlainObject:o.isPlainObject,uniqueId:o.uniqueId},c=(n(10),a.uniqueId);function s(e){return{noticeId:e,type:"NOTICE_REMOVE"}}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.id,o=i()(n,["id"]);return{type:"NOTICE_CREATE",notice:Object.assign({showDismiss:!0},o,{noticeId:r||c(),status:e,text:t})}}var l=u.bind(null,"is-success"),d=u.bind(null,"is-error"),f=u.bind(null,"is-info");u.bind(null,"is-warning"),u.bind(null,"is-plain")},262:function(e,t,n){"use strict";n.r(t),n.d(t,"addPackage",function(){return a}),n.d(t,"removePackage",function(){return c}),n.d(t,"editPackage",function(){return s}),n.d(t,"dismissModal",function(){return u}),n.d(t,"savePackage",function(){return l}),n.d(t,"updatePackagesField",function(){return d}),n.d(t,"toggleOuterDimensions",function(){return f}),n.d(t,"toggleAll",function(){return p}),n.d(t,"togglePackage",function(){return h}),n.d(t,"savePredefinedPackages",function(){return m}),n.d(t,"removePredefinedPackage",function(){return O}),n.d(t,"setModalErrors",function(){return E}),n.d(t,"setIsSaving",function(){return b}),n.d(t,"setIsFetching",function(){return v}),n.d(t,"setIsFetchError",function(){return g}),n.d(t,"setAddMode",function(){return _}),n.d(t,"fetchSettings",function(){return y}),n.d(t,"submit",function(){return C});var r=n(13),i=n(3),o=n(70),a=function(e){return{type:i.g,siteId:e}},c=function(e,t){return{type:i.k,index:t,siteId:e}},s=function(e,t){return{type:i.i,package:t,siteId:e}},u=function(e){return{type:i.h,siteId:e}},l=function(e,t){return{type:i.m,packageData:t,siteId:e}},d=function(e,t){return{type:i.w,values:t,siteId:e}},f=function(e){return{type:i.u,siteId:e}},p=function(e,t,n,r){return{type:i.t,serviceId:t,groupId:n,checked:r,siteId:e}},h=function(e,t,n){return{type:i.v,serviceId:t,packageId:n,siteId:e}},m=function(e){return{type:i.n,siteId:e}},O=function(e,t,n){return{type:i.l,serviceId:t,packageId:n,siteId:e}},E=function(e,t){return{type:i.s,value:t,siteId:e}},b=function(e,t){return{type:i.r,isSaving:t,siteId:e}},v=function(e,t){return{type:i.p,isFetching:t,siteId:e}},g=function(e,t){return{type:i.q,isFetchError:t,siteId:e}},_=function(e,t){return{type:i.o,siteId:e,mode:t}},y=function(e){return function(t,n){var a=Object(o.e)(n(),e);a&&(a.packages||a.isFetching)||(t(v(e,!0)),r.b(e,r.e.packages).then(function(n){var r=n.formData,o=n.formSchema,a=n.storeOptions;t({type:i.j,packages:r,dimensionUnit:a.dimension_unit,weightUnit:a.weight_unit,packageSchema:o.custom.items,predefinedSchema:o.predefined,siteId:e})}).catch(function(n){console.error(n),t(g(e,!0))}).then(function(){return t(v(e,!1))}))}},C=function(e,t,n){return function(i,a){var c=Object(o.e)(a(),e);i(b(e,!0)),r.d(e,r.e.packages,c.packages).then(t).catch(n).then(function(){return i(b(e,!1))})}}},263:function(e,t,n){"use strict";n.d(t,"d",function(){return a}),n.d(t,"a",function(){return s}),n.d(t,"e",function(){return u}),n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d});var r=n(13),i=n(3),o=n(42),a=function(e,t,n){return{type:i.e,siteId:e,key:t,value:n}},c=function(e,t,n){return{type:i.f,siteId:e,key:t,value:n}},s=function(e){return function(t){t(c(e,"isFetching",!0)),r.b(e,r.e.accountSettings).then(function(n){var r=n.storeOptions,o=n.formMeta,a=n.formData,c=n.userMeta;t(function(e,t,n,r,o){return{type:i.b,siteId:e,storeOptions:t,formData:n,formMeta:r,userMeta:o}}(e,r,a,o,c))}).catch(function(n){t(c(e,"isFetchError",!0)),console.error(n)}).then(function(){return t(c(e,"isFetching",!1))})}},u=function(e,t,n){return function(i,a){i(c(e,"isSaving",!0)),i(c(e,"pristine",!0)),r.c(e,r.e.accountSettings,Object(o.g)(a())).then(t).catch(function(t){return i(c(e,"pristine",!1)),n(t)}).then(function(){i(c(e,"isSaving",!1))})}},l=function(e){return{type:i.d,siteId:e}},d=function(e){return{type:i.c,siteId:e}}},264:function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return s}),n.d(t,"c",function(){return u});var r=n(0),i=n(4),o=n(39),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"shippingMethodSchemas"],{})},c=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return Object(r.isObject)(a(e,n)[t])},s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return c(e,t,n)?a(e,n)[t]:null},u=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(i.a)(e);return o.b===a(e,n)[t]}},267:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(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 i=Object.prototype.hasOwnProperty.bind(t),o=0;o1?t-1:0),r=1;r1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:a,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,u=Object(r.memoize)(e,i);return Array.isArray(n)&&(n=s(n)),Object.assign(function(e){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e);return Object(r.get)(e,["extensions","woocommerce","woocommerceServices",t,"labelSettings"],null)},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.data},c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.meta},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=o(e,t);return n&&n.storeOptions},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.user},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isLoaded},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetching},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.isFetchError},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.enabled},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.selected_payment_method_id},m=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.pristine},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.email_receipts},E=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.use_last_service},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.use_last_package},v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_manage_payments},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.can_edit_settings},_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=a(e,t);return n&&n.paper_size},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.payment_methods},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.add_payment_method_url},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return n&&n.warnings&&n.warnings.payment_methods},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(i.a)(e),n=c(e,t);return{masterUserName:n&&n.master_user_name,masterUserLogin:n&&n.master_user_login,masterUserEmail:n&&n.master_user_email,masterUserWpcomLogin:n&&n.master_user_wpcom_login}}},423:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(2),i=new WeakMap;function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Object(r.useMemo)(function(){if(n)return n;var r=function(e){var t=i.get(e)||0;return i.set(e,t+1),t}(e);return t?"".concat(t,"-").concat(r):r},[e])}},44:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i});var r=function(){return!0},i=function(){return!0}},45:function(e,t,n){"use strict";n.d(t,"a",function(){return O});var r,i=n(1),o=n.n(i),a=n(69),c=n.n(a),s=n(418),u=n.n(s),l=n(0),d=n(10),f=n(64),p=function(e){return Object(l.get)(e,"meta.dataLayer.data",void 0)},h=function(e){return Object(l.get)(e,"meta.dataLayer.error",void 0)},m=function(e){return Object(l.get)(e,"meta.dataLayer.progress",void 0)},O=(Object(d.d)("meta.dataLayer.requestKey",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=(arguments.length>1?arguments[1]:void 0).meta,n=(t=void 0===t?{}:t).dataLayer,r=(n=void 0===n?{}:n).lastUpdated,i=n.pendingSince,a=n.status;return Object.assign(o()({},e),{status:a},r&&{lastUpdated:r},i&&{pendingSince:i})}),r=function(e){return function(t,n){if(!0!==Object(l.get)(n,"meta.dataLayer.trackRequest")||m(n))return e(t,n);var r=function(e){var t=e.meta,n=c()(e,["meta"]),r=Object(l.get)(t,"dataLayer.requestKey");return r||u()(n)}(n),i=function(e){return void 0!==h(e)?"failure":void 0!==p(e)?"success":"pending"}(n),a=Object.assign({requestKey:r,status:i},"pending"===i?{pendingSince:Date.now()}:{lastUpdated:Date.now()});e(o()({},t,{dispatch:function(e){return t.dispatch(Object(l.merge)(e,{meta:{dataLayer:a}}))}}),n)}},function(e){return e.fetch||Object(f.a)("fetch handler is not defined: no request will ever be issued"),e.onSuccess||Object(f.a)("onSuccess handler is not defined: response to the request is being ignored"),e.onError||Object(f.a)("onError handler is not defined: error during the request is being ignored"),r(function(t,n){var r=function(e,t){var n=e.fetch,r=void 0===n?l.noop:n,i=e.onSuccess,o=void 0===i?l.noop:i,a=e.onError,c=void 0===a?l.noop:a,s=e.onProgress,u=void 0===s?l.noop:s,d=e.fromApi,f=void 0===d?l.identity:d,O=h(t);if(O)return c(t,O);var E=p(t);if(E)try{return o(t,f(E))}catch(v){return c(t,v)}var b=m(t);return b?u(t,b):r(t)}(e,n);if(r)return Array.isArray(r)?r.map(t.dispatch):t.dispatch(r)})})},469:function(e,t,n){var r={"./af":[269,3],"./af.js":[269,3],"./ar":[276,4],"./ar-dz":[270,5],"./ar-dz.js":[270,5],"./ar-kw":[271,6],"./ar-kw.js":[271,6],"./ar-ly":[272,7],"./ar-ly.js":[272,7],"./ar-ma":[273,8],"./ar-ma.js":[273,8],"./ar-sa":[274,9],"./ar-sa.js":[274,9],"./ar-tn":[275,10],"./ar-tn.js":[275,10],"./ar.js":[276,4],"./az":[277,11],"./az.js":[277,11],"./be":[278,12],"./be.js":[278,12],"./bg":[279,13],"./bg.js":[279,13],"./bm":[280,14],"./bm.js":[280,14],"./bn":[282,15],"./bn-bd":[281,16],"./bn-bd.js":[281,16],"./bn.js":[282,15],"./bo":[283,17],"./bo.js":[283,17],"./br":[284,18],"./br.js":[284,18],"./bs":[285,19],"./bs.js":[285,19],"./ca":[286,20],"./ca.js":[286,20],"./cs":[287,21],"./cs.js":[287,21],"./cv":[288,22],"./cv.js":[288,22],"./cy":[289,23],"./cy.js":[289,23],"./da":[290,24],"./da.js":[290,24],"./de":[293,25],"./de-at":[291,26],"./de-at.js":[291,26],"./de-ch":[292,27],"./de-ch.js":[292,27],"./de.js":[293,25],"./dv":[294,28],"./dv.js":[294,28],"./el":[295,29],"./el.js":[295,29],"./en-au":[296,30],"./en-au.js":[296,30],"./en-ca":[297,31],"./en-ca.js":[297,31],"./en-gb":[298,32],"./en-gb.js":[298,32],"./en-ie":[299,33],"./en-ie.js":[299,33],"./en-il":[300,34],"./en-il.js":[300,34],"./en-in":[301,35],"./en-in.js":[301,35],"./en-nz":[302,36],"./en-nz.js":[302,36],"./en-sg":[303,37],"./en-sg.js":[303,37],"./eo":[304,38],"./eo.js":[304,38],"./es":[308,39],"./es-do":[305,40],"./es-do.js":[305,40],"./es-mx":[306,41],"./es-mx.js":[306,41],"./es-us":[307,42],"./es-us.js":[307,42],"./es.js":[308,39],"./et":[309,43],"./et.js":[309,43],"./eu":[310,44],"./eu.js":[310,44],"./fa":[311,45],"./fa.js":[311,45],"./fi":[312,46],"./fi.js":[312,46],"./fil":[313,47],"./fil.js":[313,47],"./fo":[314,48],"./fo.js":[314,48],"./fr":[317,49],"./fr-ca":[315,50],"./fr-ca.js":[315,50],"./fr-ch":[316,51],"./fr-ch.js":[316,51],"./fr.js":[317,49],"./fy":[318,52],"./fy.js":[318,52],"./ga":[319,53],"./ga.js":[319,53],"./gd":[320,54],"./gd.js":[320,54],"./gl":[321,55],"./gl.js":[321,55],"./gom-deva":[322,56],"./gom-deva.js":[322,56],"./gom-latn":[323,57],"./gom-latn.js":[323,57],"./gu":[324,58],"./gu.js":[324,58],"./he":[325,59],"./he.js":[325,59],"./hi":[326,60],"./hi.js":[326,60],"./hr":[327,61],"./hr.js":[327,61],"./hu":[328,62],"./hu.js":[328,62],"./hy-am":[329,63],"./hy-am.js":[329,63],"./id":[330,64],"./id.js":[330,64],"./is":[331,65],"./is.js":[331,65],"./it":[333,66],"./it-ch":[332,67],"./it-ch.js":[332,67],"./it.js":[333,66],"./ja":[334,68],"./ja.js":[334,68],"./jv":[335,69],"./jv.js":[335,69],"./ka":[336,70],"./ka.js":[336,70],"./kk":[337,71],"./kk.js":[337,71],"./km":[338,72],"./km.js":[338,72],"./kn":[339,73],"./kn.js":[339,73],"./ko":[340,74],"./ko.js":[340,74],"./ku":[341,75],"./ku.js":[341,75],"./ky":[342,76],"./ky.js":[342,76],"./lb":[343,77],"./lb.js":[343,77],"./lo":[344,78],"./lo.js":[344,78],"./lt":[345,79],"./lt.js":[345,79],"./lv":[346,80],"./lv.js":[346,80],"./me":[347,81],"./me.js":[347,81],"./mi":[348,82],"./mi.js":[348,82],"./mk":[349,83],"./mk.js":[349,83],"./ml":[350,84],"./ml.js":[350,84],"./mn":[351,85],"./mn.js":[351,85],"./mr":[352,86],"./mr.js":[352,86],"./ms":[354,87],"./ms-my":[353,88],"./ms-my.js":[353,88],"./ms.js":[354,87],"./mt":[355,89],"./mt.js":[355,89],"./my":[356,90],"./my.js":[356,90],"./nb":[357,91],"./nb.js":[357,91],"./ne":[358,92],"./ne.js":[358,92],"./nl":[360,93],"./nl-be":[359,94],"./nl-be.js":[359,94],"./nl.js":[360,93],"./nn":[361,95],"./nn.js":[361,95],"./oc-lnc":[362,96],"./oc-lnc.js":[362,96],"./pa-in":[363,97],"./pa-in.js":[363,97],"./pl":[364,98],"./pl.js":[364,98],"./pt":[366,99],"./pt-br":[365,100],"./pt-br.js":[365,100],"./pt.js":[366,99],"./ro":[367,101],"./ro.js":[367,101],"./ru":[368,102],"./ru.js":[368,102],"./sd":[369,103],"./sd.js":[369,103],"./se":[370,104],"./se.js":[370,104],"./si":[371,105],"./si.js":[371,105],"./sk":[372,106],"./sk.js":[372,106],"./sl":[373,107],"./sl.js":[373,107],"./sq":[374,108],"./sq.js":[374,108],"./sr":[376,109],"./sr-cyrl":[375,110],"./sr-cyrl.js":[375,110],"./sr.js":[376,109],"./ss":[377,111],"./ss.js":[377,111],"./sv":[378,112],"./sv.js":[378,112],"./sw":[379,113],"./sw.js":[379,113],"./ta":[380,114],"./ta.js":[380,114],"./te":[381,115],"./te.js":[381,115],"./tet":[382,116],"./tet.js":[382,116],"./tg":[383,117],"./tg.js":[383,117],"./th":[384,118],"./th.js":[384,118],"./tk":[385,119],"./tk.js":[385,119],"./tl-ph":[386,120],"./tl-ph.js":[386,120],"./tlh":[387,121],"./tlh.js":[387,121],"./tr":[388,122],"./tr.js":[388,122],"./tzl":[389,123],"./tzl.js":[389,123],"./tzm":[391,124],"./tzm-latn":[390,125],"./tzm-latn.js":[390,125],"./tzm.js":[391,124],"./ug-cn":[392,126],"./ug-cn.js":[392,126],"./uk":[393,127],"./uk.js":[393,127],"./ur":[394,128],"./ur.js":[394,128],"./uz":[396,129],"./uz-latn":[395,130],"./uz-latn.js":[395,130],"./uz.js":[396,129],"./vi":[397,131],"./vi.js":[397,131],"./x-pseudo":[398,132],"./x-pseudo.js":[398,132],"./yo":[399,133],"./yo.js":[399,133],"./zh-cn":[400,134],"./zh-cn.js":[400,134],"./zh-hk":[401,135],"./zh-hk.js":[401,135],"./zh-mo":[402,136],"./zh-mo.js":[402,136],"./zh-tw":[403,137],"./zh-tw.js":[403,137]};function i(e){if(!n.o(r,e))return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=r[e],i=t[0];return n.e(t[1]).then(function(){return n.t(i,7)})}i.keys=function(){return Object.keys(r)},i.id=469,e.exports=i},470:function(e,t,n){t.parse=n(471),t.stringify=n(472)},471:function(e,t){var n,r,i,o,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},c=function(e){throw{name:"SyntaxError",message:e,at:n,text:i}},s=function(e){return e&&e!==r&&c("Expected '"+e+"' instead of '"+r+"'"),r=i.charAt(n),n+=1,r},u=function(){var e,t="";for("-"===r&&(t="-",s("-"));r>="0"&&r<="9";)t+=r,s();if("."===r)for(t+=".";s()&&r>="0"&&r<="9";)t+=r;if("e"===r||"E"===r)for(t+=r,s(),"-"!==r&&"+"!==r||(t+=r,s());r>="0"&&r<="9";)t+=r,s();if(e=+t,isFinite(e))return e;c("Bad number")},l=function(){var e,t,n,i="";if('"'===r)for(;s();){if('"'===r)return s(),i;if("\\"===r)if(s(),"u"===r){for(n=0,t=0;t<4&&(e=parseInt(s(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!==typeof a[r])break;i+=a[r]}else i+=r}c("Bad string")},d=function(){for(;r&&r<=" ";)s()};o=function(){switch(d(),r){case"{":return function(){var e,t={};if("{"===r){if(s("{"),d(),"}"===r)return s("}"),t;for(;r;){if(e=l(),d(),s(":"),Object.hasOwnProperty.call(t,e)&&c('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===r)return s("}"),t;s(","),d()}}c("Bad object")}();case"[":return function(){var e=[];if("["===r){if(s("["),d(),"]"===r)return s("]"),e;for(;r;){if(e.push(o()),d(),"]"===r)return s("]"),e;s(","),d()}}c("Bad array")}();case'"':return l();case"-":return u();default:return r>="0"&&r<="9"?u():function(){switch(r){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}c("Unexpected '"+r+"'")}()}},e.exports=function(e,t){var a;return i=e,n=0,r=" ",a=o(),d(),r&&c("Syntax error"),"function"===typeof t?function e(n,r){var i,o,a=n[r];if(a&&"object"===typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(n,r,a)}({"":a},""):a}},472:function(e,t){var n,r,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function c(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,function(e){var t=a[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}e.exports=function(e,t,o){var a;if(n="",r="","number"===typeof o)for(a=0;a1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","locations"])},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return Object(r.isArray)(c(e,t))},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return a.b===c(e,t)},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return a.a===c(e,t)},d=function(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);if(!s(e,t))return[];var n=c(e,t).map(function(e){return Object(r.omit)(e,"countries")});return Object(r.sortBy)(n,"name")},d(0)),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);if(!s(e,t))return[];var n=Object(r.flatMap)(c(e,t),"countries");return Object(r.sortBy)(n,"name")},h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e);return Object(r.get)(e,["extensions","woocommerce","sites",t,"data","euCountries"])},m=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return[];var i=Object(r.find)(c(e,n),{code:t});if(!i)return[];var a=i.countries.map(function(e){return Object(r.omit)(e,"states")});return Object(r.sortBy)(a,"name")},d(1)),O=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return t;var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?i.name:t},d(1)),E=Object(i.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);if(!s(e,n))return[];var i=Object(r.find)(Object(r.flatMap)(c(e,n),"countries"),{code:t});return i?Object(r.sortBy)(i.states,"name"):[]},d(1)),b=Object(i.a)(function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(o.a)(e);if(!s(e,i))return n;var a=Object(r.find)(Object(r.flatMap)(c(e,i),"countries"),{code:t});if(!a)return n;var u=Object(r.find)(a.states,{code:n});return u?u.name:n},d(2)),v=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(o.a)(e);return!Object(r.isEmpty)(E(e,t,n))},g=Object(i.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(o.a)(e),n=p(e,t),r={};return n.forEach(function(e){var t=e.code,n=e.name;return r[t]=n}),r},d(0))},49:function(e,t,n){"use strict";n.d(t,"d",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"e",function(){return c}),n.d(t,"c",function(){return s});var r=n(6);function i(e){return{type:r.d,actionList:e}}function o(){return{type:r.b}}function a(e){return{type:r.a,actionList:e}}function c(e){return{type:r.e,actionList:e}}function s(e,t){return{type:r.c,actionList:e,error:t}}},54:function(e,t,n){"use strict";n.d(t,"a",function(){return i});var r=n(0),i=function e(t){return!!t&&(Object(r.isArray)(t)?Object(r.some)(t,e):!Object(r.isPlainObject)(t)||Object(r.some)(Object(r.values)(t),e))}},55:function(e,t,n){"use strict";var r=n(0);t.a=function(e){return Object(r.isPlainObject)(e)&&(e.isNormalized&&e.selectNormalized&&e.normalized?e.normalized:e.values)||{}}},6:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"e",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return s}),n.d(t,"h",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"j",function(){return d}),n.d(t,"i",function(){return f}),n.d(t,"k",function(){return p}),n.d(t,"l",function(){return h}),n.d(t,"p",function(){return m}),n.d(t,"q",function(){return O}),n.d(t,"r",function(){return E}),n.d(t,"s",function(){return b}),n.d(t,"t",function(){return v}),n.d(t,"u",function(){return g}),n.d(t,"y",function(){return _}),n.d(t,"z",function(){return y}),n.d(t,"A",function(){return C}),n.d(t,"v",function(){return j}),n.d(t,"w",function(){return S}),n.d(t,"x",function(){return I}),n.d(t,"C",function(){return R}),n.d(t,"E",function(){return T}),n.d(t,"D",function(){return N}),n.d(t,"B",function(){return M}),n.d(t,"F",function(){return w}),n.d(t,"G",function(){return A}),n.d(t,"H",function(){return k}),n.d(t,"I",function(){return P}),n.d(t,"J",function(){return L}),n.d(t,"K",function(){return x}),n.d(t,"m",function(){return D}),n.d(t,"n",function(){return W}),n.d(t,"o",function(){return H}),n.d(t,"L",function(){return V}),n.d(t,"M",function(){return G}),n.d(t,"N",function(){return U}),n.d(t,"O",function(){return F}),n.d(t,"P",function(){return B}),n.d(t,"Q",function(){return z}),n.d(t,"R",function(){return q}),n.d(t,"W",function(){return K}),n.d(t,"X",function(){return Z}),n.d(t,"Y",function(){return Q}),n.d(t,"Z",function(){return Y}),n.d(t,"ab",function(){return $}),n.d(t,"bb",function(){return J}),n.d(t,"cb",function(){return X}),n.d(t,"db",function(){return ee}),n.d(t,"eb",function(){return te}),n.d(t,"fb",function(){return ne}),n.d(t,"gb",function(){return re}),n.d(t,"hb",function(){return ie}),n.d(t,"ib",function(){return oe}),n.d(t,"jb",function(){return ae}),n.d(t,"kb",function(){return ce}),n.d(t,"lb",function(){return se}),n.d(t,"mb",function(){return ue}),n.d(t,"nb",function(){return le}),n.d(t,"ob",function(){return de}),n.d(t,"pb",function(){return fe}),n.d(t,"rb",function(){return pe}),n.d(t,"qb",function(){return he}),n.d(t,"sb",function(){return me}),n.d(t,"tb",function(){return Oe}),n.d(t,"ub",function(){return Ee}),n.d(t,"vb",function(){return be}),n.d(t,"wb",function(){return ve}),n.d(t,"xb",function(){return ge}),n.d(t,"yb",function(){return _e}),n.d(t,"zb",function(){return ye}),n.d(t,"Ab",function(){return Ce}),n.d(t,"Bb",function(){return je}),n.d(t,"Cb",function(){return Se}),n.d(t,"Db",function(){return Ie}),n.d(t,"Eb",function(){return Re}),n.d(t,"Fb",function(){return Te}),n.d(t,"Gb",function(){return Ne}),n.d(t,"Hb",function(){return Me}),n.d(t,"Ib",function(){return we}),n.d(t,"U",function(){return Ae}),n.d(t,"V",function(){return ke}),n.d(t,"S",function(){return Pe}),n.d(t,"T",function(){return Le});var r="WOOCOMMERCE_ACTION_LIST_ANNOTATE",i="WOOCOMMERCE_ACTION_LIST_CLEAR",o="WOOCOMMERCE_ACTION_LIST_STEP_NEXT",a="WOOCOMMERCE_ACTION_LIST_STEP_SUCCESS",c="WOOCOMMERCE_ACTION_LIST_STEP_FAILURE",s="WOOCOMMERCE_COUNT_REQUEST",u="WOOCOMMERCE_COUNT_REQUEST_SUCCESS",l="WOOCOMMERCE_COUNT_REQUEST_FAILURE",d="WOOCOMMERCE_ERROR_SET",f="WOOCOMMERCE_ERROR_CLEAR",p="WOOCOMMERCE_LOCATIONS_REQUEST",h="WOOCOMMERCE_LOCATIONS_REQUEST_SUCCESS",m="WOOCOMMERCE_ORDER_DELETE",O="WOOCOMMERCE_ORDER_DELETE_FAILURE",E="WOOCOMMERCE_ORDER_DELETE_SUCCESS",b="WOOCOMMERCE_ORDER_INVOICE_SEND",v="WOOCOMMERCE_ORDER_INVOICE_SEND_FAILURE",g="WOOCOMMERCE_ORDER_INVOICE_SEND_SUCCESS",_="WOOCOMMERCE_ORDER_NOTE_CREATE",y="WOOCOMMERCE_ORDER_NOTE_CREATE_FAILURE",C="WOOCOMMERCE_ORDER_NOTE_CREATE_SUCCESS",j="WOOCOMMERCE_ORDER_NOTES_REQUEST",S="WOOCOMMERCE_ORDER_NOTES_REQUEST_FAILURE",I="WOOCOMMERCE_ORDER_NOTES_REQUEST_SUCCESS",R="WOOCOMMERCE_ORDER_REFUND_CREATE",T="WOOCOMMERCE_ORDER_REFUND_CREATE_SUCCESS",N="WOOCOMMERCE_ORDER_REFUND_CREATE_FAILURE",M="WOOCOMMERCE_ORDER_REFUNDS_REQUEST_SUCCESS",w="WOOCOMMERCE_ORDER_REQUEST",A="WOOCOMMERCE_ORDER_REQUEST_FAILURE",k="WOOCOMMERCE_ORDER_REQUEST_SUCCESS",P="WOOCOMMERCE_ORDER_UPDATE",L="WOOCOMMERCE_ORDER_UPDATE_FAILURE",x="WOOCOMMERCE_ORDER_UPDATE_SUCCESS",D="WOOCOMMERCE_ORDERS_REQUEST",W="WOOCOMMERCE_ORDERS_REQUEST_FAILURE",H="WOOCOMMERCE_ORDERS_REQUEST_SUCCESS",V="WOOCOMMERCE_SERVICES_SHIPPING_ACTION_LIST_CREATE",G="WOOCOMMERCE_SETTINGS_PRODUCTS_CHANGE_SETTING",U="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST",F="WOOCOMMERCE_SETTINGS_PRODUCTS_REQUEST_SUCCESS",B="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST",z="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_FAILURE",q="WOOCOMMERCE_SETTINGS_PRODUCTS_UPDATE_REQUEST_SUCCESS",K="WOOCOMMERCE_SHIPPING_ZONE_ADD",Z="WOOCOMMERCE_SHIPPING_ZONE_CANCEL",Q="WOOCOMMERCE_SHIPPING_ZONE_CLOSE",Y="WOOCOMMERCE_SHIPPING_ZONE_DELETED",$="WOOCOMMERCE_SHIPPING_ZONE_EDIT_NAME",J="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CANCEL",X="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_CLOSE",ee="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT",te="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_EDIT_POSTCODE",ne="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_POSTCODE",re="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_STATE",ie="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_FILTER_BY_WHOLE_COUNTRY",oe="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_CONTINENT",ae="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_COUNTRY",ce="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_SELECT_STATE",se="WOOCOMMERCE_SHIPPING_ZONE_LOCATIONS_UPDATED",ue="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST",le="WOOCOMMERCE_SHIPPING_ZONE_METHODS_REQUEST_SUCCESS",de="WOOCOMMERCE_SHIPPING_ZONE_METHOD_ADD",fe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CANCEL",pe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CLOSE",he="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CHANGE_TYPE",me="WOOCOMMERCE_SHIPPING_ZONE_METHOD_CREATE",Oe="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETE",Ee="WOOCOMMERCE_SHIPPING_ZONE_METHOD_DELETED",be="WOOCOMMERCE_SHIPPING_ZONE_METHOD_EDIT_TITLE",ve="WOOCOMMERCE_SHIPPING_ZONE_METHOD_OPEN",ge="WOOCOMMERCE_SHIPPING_ZONE_METHOD_REMOVE",_e="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_CONDITION",ye="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_COST",Ce="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_MIN_COST",je="WOOCOMMERCE_SHIPPING_ZONE_METHOD_SET_TAXABLE",Se="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_ENABLED",Ie="WOOCOMMERCE_SHIPPING_ZONE_METHOD_TOGGLE_OPENED_ENABLED",Re="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATE",Te="WOOCOMMERCE_SHIPPING_ZONE_METHOD_UPDATED",Ne="WOOCOMMERCE_SHIPPING_ZONE_OPEN",Me="WOOCOMMERCE_SHIPPING_ZONE_REMOVE",we="WOOCOMMERCE_SHIPPING_ZONE_UPDATED",Ae="WOOCOMMERCE_SHIPPING_ZONES_REQUEST",ke="WOOCOMMERCE_SHIPPING_ZONES_REQUEST_SUCCESS",Pe="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST",Le="WOOCOMMERCE_SHIPPING_CLASSES_REQUEST_SUCCESS"},60:function(e,t,n){"use strict";n.d(t,"a",function(){return r}),n.d(t,"b",function(){return i}),n.d(t,"d",function(){return o}),n.d(t,"c",function(){return a});var r=["US","PR","VI","GU","AS","UM","MH","FM","MP"],i=["US","PR","VI"],o=["AA","AE","AP"],a=["IR","SY","KP","CU","SD"]},65:function(e,t,n){"use strict";var r=n(69),i=n.n(r),o=n(35),a=n(10),c=function(e,t,n,r,c,s){var u=Object(o.b)();return s&&!s.endsWith("/")&&(s+="/"),s&&s.startsWith("/")&&(s=s.substr(1)),-1!==u.indexOf("?")&&(t=t.replace("?","&")),Object(a.c)(function(e){var t=e.url,n=e.method,r=e.headers,o=e.queryParams,a=e.body,c=e.withCredentials,s=e.onSuccess,u=e.onFailure,l=i()(e,["url","method","headers","queryParams","body","withCredentials","onSuccess","onFailure"]),d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{type:"HTTP_REQUEST",url:t,method:n,headers:r,queryParams:o,body:a,withCredentials:c,onSuccess:s||d,onFailure:u||d,options:l}}({url:u+s+t,method:e,headers:[["X-WP-Nonce",Object(o.c)()],["Content-Type","application/json"]],body:r&&JSON.stringify(r),withCredentials:!0},c),{meta:{localApiRequest:!0}})};t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"wc/v1";return{get:function(e){return c("GET",e,0,null,t,n)},getWithHeaders:function(e){return function(e,t,n,r,i,o){return c(e,t+"&_envelope",0,r,i,o)}("GET",e,0,null,t,n)},post:function(e,r){return c("POST",e,0,r||{},t,n)},put:function(e,r){return c("PUT",e,0,r||{},t,n)},del:function(e){return c("DELETE",e,0,null,t,n)}}}},674:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(32),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("fieldset",i()({},r,{className:l()(t,"form-fieldset")}),n)}},675:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(19),l=n.n(u),d=n(32),f=n.n(d),p=n(8),h=function(e){var t=e.children,n=e.required,r=e.optional,o=e.translate,c=e.className,u=(e.moment,e.numberFormat,e.dangerouslySetInnerHTML),l=a()(e,["children","required","optional","translate","className","moment","numberFormat","dangerouslySetInnerHTML"]),d=u?null:s.a.createElement(s.a.Fragment,null,t,n&&s.a.createElement("small",{className:"form-label__required"},o("Required")),r&&s.a.createElement("small",{className:"form-label__optional"},o("Optional")));return s.a.createElement("label",i()({},l,{dangerouslySetInnerHTML:u,className:f()(c,"form-label")}),d)};h.propTypes={required:l.a.bool,optional:l.a.bool,children:l.a.node},t.a=Object(p.localize)(h)},676:function(e,t,n){"use strict";var r=n(2),i=n.n(r),o=n(19),a=n.n(o),c=n(32),s=n.n(c),u=n(261),l=n.n(u),d=function(e){var t=e.text,n=e.type,r=void 0===n?"input-validation":n;return i.a.createElement("div",{className:s()("field-error","field-error__".concat(r))},i.a.createElement(l.a,{size:24,icon:"notice-outline"})," ",i.a.createElement("span",null,t))};d.propTypes={text:a.a.string.isRequired,type:a.a.string},t.a=d},677:function(e,t,n){"use strict";n.d(t,"a",function(){return j});var r=n(260),i=n.n(r),o=n(52),a=n.n(o),c=n(78),s=n.n(c),u=n(91),l=n.n(u),d=n(85),f=n.n(d),p=n(92),h=n.n(p),m=n(5),O=n.n(m),E=n(2),b=n.n(E),v=n(19),g=n.n(v),_=n(32),y=n.n(_),C=n(0),j=function(e){function t(){return a()(this,t),l()(this,f()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=y()(this.props.className,"form-setting-explanation",{"no-validate":this.props.noValidate,"is-indented":this.props.isIndented});return b.a.createElement("p",i()({},Object(C.omit)(this.props,"className","noValidate","isIndented"),{className:e}),this.props.children)}}]),t}(b.a.Component);O()(j,"displayName","FormSettingExplanation"),O()(j,"propTypes",{noValidate:g.a.bool,isIndented:g.a.bool,className:g.a.string}),O()(j,"defaultProps",{noValidate:!1,isIndented:!1})},678:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(32),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("legend",i()({},r,{className:l()(t,"form-legend")}),n)}},679:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(32),l=n.n(u);t.a=function(e){var t=e.className,n=e.children,r=a()(e,["className","children"]);return s.a.createElement("h3",i()({},r,{className:l()(t,"form-section-heading")}),n)}},680:function(e,t,n){"use strict";var r=n(52),i=n.n(r),o=n(78),a=n.n(o),c=n(91),s=n.n(c),u=n(85),l=n.n(u),d=n(93),f=n.n(d),p=n(92),h=n.n(p),m=n(5),O=n.n(m),E=n(19),b=n.n(E),v=n(2),g=n.n(v),_=n(32),y=n.n(_),C=n(0),j=n(8),S=n(261),I=n.n(S);n(684);function R(e){var t=e.children;return g.a.createElement("span",{className:"screen-reader-text"},t)}var T=function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"componentWillUnmount",value:function(){this.dismissTimeout&&clearTimeout(this.dismissTimeout)}},{key:"componentDidUpdate",value:function(){clearTimeout(this.dismissTimeout),this.props.duration>0&&(this.dismissTimeout=setTimeout(this.props.onDismissClick,this.props.duration))}},{key:"getIcon",value:function(){var e;switch(this.props.status){case"is-info":e="info";break;case"is-success":e="checkmark";break;case"is-error":case"is-warning":e="notice";break;default:e="info"}return e}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.icon,i=e.isCompact,o=e.isLoading,a=e.onDismissClick,c=e.showDismiss,s=void 0===c?!i:c,u=e.status,l=e.text,d=e.translate,f=y()("notice",u,n,{"is-compact":i,"is-loading":o,"is-dismissable":s});return g.a.createElement("div",{className:f},g.a.createElement("span",{className:"notice__icon-wrapper"},g.a.createElement(I.a,{className:"notice__icon",icon:r||this.getIcon(),size:24})),g.a.createElement("span",{className:"notice__content"},g.a.createElement("span",{className:"notice__text"},l||t)),l?t:null,s&&g.a.createElement("span",{tabIndex:"0",className:"notice__dismiss",onClick:a,onKeyDown:a,role:"button","aria-label":d("Dismiss")},g.a.createElement(I.a,{icon:"cross",size:24}),g.a.createElement(R,null,d("Dismiss"))))}}]),t}(v.Component);O()(T,"defaultProps",{className:"",duration:0,icon:null,isCompact:!1,isLoading:!1,onDismissClick:C.noop,status:null,text:null}),O()(T,"propTypes",{className:b.a.string,duration:b.a.number,icon:b.a.string,isCompact:b.a.bool,isLoading:b.a.bool,onDismissClick:b.a.func,showDismiss:b.a.bool,status:b.a.oneOf(["is-error","is-info","is-success","is-warning","is-plain"]),text:b.a.oneOfType([b.a.arrayOf(b.a.oneOfType([b.a.string,b.a.node])),b.a.oneOfType([b.a.string,b.a.node])]),translate:b.a.func.isRequired});t.a=Object(j.localize)(T)},681:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(32),l=n.n(u);n(688);t.a=function(e){var t=e.inputRef,n=e.className,r=e.isError,o=a()(e,["inputRef","className","isError"]);return s.a.createElement("select",i()({},o,{ref:t,className:l()(n,"form-select",{"is-error":r})}))}},682:function(e,t,n){"use strict";var r=n(41),i=n.n(r),o=n(0),a=n(129),c=i()("calypso:notices");c("initializing notices");var s,u={containerNames:{}};s=u,Object(o.assign)(s,a.EventEmitter.prototype),s.emitChange=function(){this.emit("change")},s.off=s.removeListener;var l=[],d={new:function(e,t,n){var r=t.overlay?"overlay-notices":"notices";u.containerNames[r]=r,c("creating notice",e,t,n),u[r]=[];var i={type:t.type||"message",status:n,text:e,duration:t.duration,container:r,button:t.button,href:t.href,onClick:function(e){if("function"===typeof t.onClick){var n=d.removeNotice.bind(d,i);return t.onClick(e,n)}},onRemoveCallback:t.onRemoveCallback||function(){},arrow:t.arrow,isCompact:t.isCompact,showDismiss:t.showDismiss,persistent:t.persistent};return t.displayOnNextPage?l.push(i):u[r].push(i),u.emit("change"),i},success:function(e,t){return t=t||{},this.new(e,t,"is-success")},error:function(e,t){return t=t||{},this.new(e,t,"is-error")},info:function(e,t){return t=t||{},this.new(e,t,"is-info")},warning:function(e,t){return t=t||{},this.new(e,t,"is-warning")},list:u,removeNotice:function(e){if(e.container){var t=u[e.container],n=t.indexOf(e);-1!==n&&(t.splice(n,1),u.emit("change"))}},clearNoticesOnNavigation:function(e,t){c("clearNoticesOnNavigation");var n=!1,r=function(e){return e.persistent};for(var i in u.containerNames){var o=u[i].length;u[i]=u[i].filter(r),o!==u[i].length&&(n=!0)}l.length&&(l.forEach(function(e){u[e.container]=[],u[e.container].push(e)}),l=[]),n&&u.emit("change"),t()},clearNotices:function(e){u[e]=[],u.emit("change")},getStatusHelper:function(e){return e.error?"is-error":e.warning?"is-warning":e.info?"is-info":e.success?"is-success":void 0}};t.a=d},684:function(e,t,n){},686:function(e,t,n){"use strict";var r=n(2),i=n.n(r),o=n(19),a=n.n(o),c=n(32),s=n.n(c),u=n(761),l=n(674),d=n(676),f=n(677),p=function(e){var t=e.id,n=e.title,o=e.description,a=e.value,c=e.placeholder,p=e.updateValue,h=e.error,m=e.className,O=e.defaultValue,E=Object(r.useCallback)(function(e){return p(e,t)},[p]),b=s()("form-text-input",{"is-error":Boolean(h)});return i.a.createElement(l.a,{className:m},i.a.createElement(u.a,{label:n,name:t,placeholder:c,value:a,onChange:E,className:b,defaultValue:O}),h&&"string"===typeof h&&i.a.createElement(d.a,{text:h}),!h&&o&&i.a.createElement(f.a,null,o))};p.propTypes={id:a.a.string.isRequired,title:a.a.node,description:a.a.string,value:a.a.string,defaultValue:a.a.string,updateValue:a.a.func,error:a.a.oneOfType([a.a.string,a.a.bool]),className:a.a.string},t.a=p},688:function(e,t,n){},689:function(e,t,n){"use strict";n.d(t,"a",function(){return _});var r=n(52),i=n.n(r),o=n(78),a=n.n(o),c=n(91),s=n.n(c),u=n(85),l=n.n(u),d=n(92),f=n.n(d),p=n(5),h=n.n(p),m=n(19),O=n.n(m),E=n(2),b=n.n(E),v=n(261),g=n.n(v),_=function(e){function t(){return i()(this,t),s()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"render",value:function(){var e={className:"notice__action",href:this.props.href,onClick:this.props.onClick};return this.props.external&&(e.target="_blank",e.rel="noopener noreferrer"),b.a.createElement("a",e,b.a.createElement("span",null,this.props.children),this.props.icon&&b.a.createElement(g.a,{icon:this.props.icon,size:24}),this.props.external&&b.a.createElement(g.a,{icon:"external",size:24}))}}]),t}(b.a.Component);h()(_,"displayName","NoticeAction"),h()(_,"propTypes",{href:O.a.string,onClick:O.a.func,external:O.a.bool,icon:O.a.string}),h()(_,"defaultProps",{external:!1})},691:function(e,t,n){"use strict";n.d(t,"a",function(){return S});var r=n(52),i=n.n(r),o=n(78),a=n.n(o),c=n(91),s=n.n(c),u=n(85),l=n.n(u),d=n(93),f=n.n(d),p=n(92),h=n.n(p),m=n(5),O=n.n(m),E=n(112),b=n.n(E),v=n(19),g=n.n(v),_=n(2),y=n.n(_),C=n(61),j=n(182),S=function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a1||!n.props.children)?y.a.createElement("div",n.props,n.props.children):n.props.children,n.context.store&&(e=y.a.createElement(C.a,{store:n.context.store},y.a.createElement(j.b,null,e))),b.a.render(e,n.container)}),n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.container=document.createElement("div"),document.body.appendChild(this.container),this.renderChildren()}},{key:"componentDidUpdate",value:function(){this.renderChildren()}},{key:"componentWillUnmount",value:function(){this.container&&(b.a.unmountComponentAtNode(this.container),document.body.removeChild(this.container),delete this.container)}},{key:"render",value:function(){return null}}]),t}(y.a.Component);O()(S,"contextTypes",{store:g.a.object})},692:function(e,t,n){"use strict";var r=n(52),i=n.n(r),o=n(78),a=n.n(o),c=n(91),s=n.n(c),u=n(85),l=n.n(u),d=n(93),f=n.n(d),p=n(92),h=n.n(p),m=n(5),O=n.n(m),E=n(19),b=n.n(E),v=n(2),g=n.n(v),_=n(32),y=n.n(_),C=n(8),j=n(0),S=n(705),I=n(849),R=n(261),T=n.n(R),N=(n(703),function(e){function t(){var e,n;i()(this,t);for(var r=arguments.length,o=new Array(r),a=0;a1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e);return Object(c.get)(e,["extensions","woocommerce","woocommerceServices",t,"packages"],null)},m=function(e){return e&&e.predefinedSchema?Object.keys(e.predefinedSchema):[]},O=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r=[];Object(c.forEach)(n.predefinedSchema,function(e,t){var i=(n.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){Object(c.includes)(i,e.id)&&r.push(a()({},e,{serviceId:t}))})})});var i=(n.packages.custom||[]).map(function(e,t){return a()({},e,{index:t})});return Object(c.orderBy)(r.concat(i),"name")},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.packages)return[];var r=m(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),E=Object(u.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=h(e,n);if(!r||!r.predefinedSchema||!r.packages)return null;var i=Object(p.e)(e,t,n),o=Object(f.a)(i.origin).country,a=Object(f.a)(i.destination).country,u=d.a.includes(o)&&!d.a.includes(a),m={custom:{title:Object(s.translate)("Custom Packages"),definitions:r.packages.custom}};return Object(c.forEach)(r.predefinedSchema,function(e,t){var n=(r.packages.predefined||{})[t]||[];Object(c.forEach)(e,function(e,t){var r=e.definitions,i={title:e.title,definitions:[]};Object(c.forEach)(r,function(e){u&&!1===e.can_ship_international||Object(c.includes)(n,e.id)&&i.definitions.push(e)}),i.definitions.length&&(m[t]=i)})}),m},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(l.a)(e),r=h(e,n);if(!r||!r.packages)return[];var o=m(r),a=Object(p.e)(e,t,n),c=Object(f.a)(a.origin).country,s=Object(f.a)(a.destination).country;return[].concat(i()(r.packages.custom||[]),i()(o.map(function(e){return(r.packages.predefined||{})[e]})),[c,s])}),b=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.predefinedSchema||!n.packages)return null;var r={};return Object(c.forEach)(n.packages.custom,function(e){r[e.name]=e}),Object(c.forEach)(n.predefinedSchema,function(e,t){Object(c.forEach)(e,function(e){var n=e.definitions;Object(c.forEach)(n,function(e){r[e.id]=a()({},e,{serviceId:t})})})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.packages)return[];var r=m(n);return[].concat(i()(n.packages.custom||[]),i()(r.map(function(e){return(n.packages.predefined||{})[e]})))}),v=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return null;var r={},i=n.predefinedSchema,o=n.currentlyEditingPredefinedPackages;return Object(c.forEach)(i,function(e,t){var n=o[t]||[];Object(c.forEach)(e,function(e,i){var o={groupId:i,serviceId:t,title:e.title,packages:[],total:e.definitions.length,selected:0};Object(c.forEach)(e.definitions,function(e){var r=Object(c.includes)(n,e.id);r&&o.selected++,o.packages.push(a()({},e,{selected:r,serviceId:t}))}),r["".concat(t,"-").concat(i)]=o})}),r},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=m(n);return i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]}))}),g=Object(u.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=0,r=0,i=h(e,t);if(!i||!i.currentlyEditingPredefinedPackages)return{added:n,removed:r};var o=i.packages&&i.packages.predefined?i.packages.predefined:{},a=i.currentlyEditingPredefinedPackages;return Object.keys(a).forEach(function(e){var t=o[e],r=a[e];t?r.forEach(function(e){Object(c.includes)(t,e)||n++}):n+=r.length}),Object.keys(o).forEach(function(e){var t=o[e],n=a[e];n?t.forEach(function(e){Object(c.includes)(n,e)||r++}):r+=t.length}),{added:n,removed:r}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);if(!n||!n.currentlyEditingPredefinedPackages)return[];var r=m(n);return[].concat(i()(r.map(function(e){return n.packages&&n.packages.predefined&&n.packages.predefined[e]})),i()(r.map(function(e){return n.currentlyEditingPredefinedPackages[e]})))}),_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isLoaded},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isFetching},C=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(l.a)(e),n=h(e,t);return n&&n.isFetchError}},702:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(2),a=n.n(o),c=n(19),s=n.n(c),u=n(32),l=n.n(u),d=n(261),f=n.n(d),p=n(0),h=function(e){var t=e.className,n=e.disabled,r=e.checked,o=e.partialChecked,c=Object(p.omit)(e,["className","partialChecked"]);return a.a.createElement("span",{className:l()(t,"form-checkbox",{"is-disabled":n})},a.a.createElement("input",i()({},c,{type:"checkbox"})),r&&a.a.createElement(f.a,{icon:"checkmark",size:14}),!r&&o&&a.a.createElement(f.a,{icon:"minus-small",size:16}))};h.propTypes={checked:s.a.bool.isRequired,partialChecked:s.a.bool,onChange:s.a.func.isRequired,className:s.a.string},t.a=h},703:function(e,t,n){},704:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(185),s=n.n(c),u=n(19),l=n.n(u),d=n(2),f=n.n(d),p=n(680),h=n(689),m=n(32),O=n.n(m);n(696);function E(e){var t=e.id,n=e.className,r=e.children;return f.a.createElement("div",{id:t,className:O()("global-notices",n)},r)}var b=n(682),v=n(41),g=n.n(v)()("calypso:data-observe"),_=n(61),y=n(0),C=n(27),j=Object(C.a)(function(e){return Object(y.values)(e.notices.items)},function(e){return e.notices.items}),S=(Object(C.a)(function(e,t){return e.notices.lastTimeShown[t]||0},function(e){return e.notices.lastTimeShown}),n(24)),I=s()({displayName:"GlobalNotices",mixins:[function(){for(var e=arguments.length,t=new Array(e),n=0;n/gm,x=!1,D=!1,W=!1,H=!1,V=!1,G=!0,U=!0,F=_({},["audio","head","math","script","style","template","svg","video"]),B=_({},["audio","video","img","source","image"]),z=_({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),q=null,K=r.createElement("form"),Z=function(e){n.removed.push({element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=""}},Q=function(e,t){n.removed.push({attribute:t.getAttributeNode(e),from:t}),t.removeAttribute(e)},Y=function(e){var t,n;if(D&&(e=""+e),p)try{t=(new f).parseFromString(e,"text/html")}catch(r){}return t&&t.documentElement||((n=(t=m.createHTMLDocument("")).body).parentNode.removeChild(n.parentNode.firstElementChild),n.outerHTML=e),E.call(t,x?"html":"body")[0]};n.isSupported&&Y('

').querySelector("svg img")&&(p=!0);var $=function(e){return O.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,function(){return s.FILTER_ACCEPT},!1)},J=function(e){return"object"===typeof c?e instanceof c:e&&"object"===typeof e&&"number"===typeof e.nodeType&&"string"===typeof e.nodeName},X=function(e){var t,r,i;if(ce("beforeSanitizeElements",e,null),!((i=e)instanceof l||i instanceof d)&&!("string"===typeof i.nodeName&&"string"===typeof i.textContent&&"function"===typeof i.removeChild&&i.attributes instanceof u&&"function"===typeof i.removeAttribute&&"function"===typeof i.setAttribute))return Z(e),!0;if(t=e.nodeName.toLowerCase(),ce("uponSanitizeElement",e,{tagName:t,allowedTags:C}),!C[t]||R[t]){if(U&&!F[t]&&"function"===typeof e.insertAdjacentHTML)try{e.insertAdjacentHTML("AfterEnd",e.innerHTML)}catch(o){}return Z(e),!0}return!A||e.firstElementChild||e.content&&e.content.firstElementChild||!/d&&e.setAttribute("id",s.value);else{if("INPUT"===e.nodeName&&"type"===c&&"file"===a&&(S[c]||!T[c]))continue;"id"===o&&e.setAttribute(o,""),Q(o,e)}if(l.keepAttr&&(!G||"id"!==c&&"name"!==c||!(a in t||a in r||a in K))){if(k&&(a=(a=a.replace(P," ")).replace(L," ")),M&&ee.test(c));else if(N&&te.test(c));else{if(!S[c]||T[c])continue;if(z[c]);else if(ne.test(a.replace(ie,"")));else if("src"!==c&&"xlink:href"!==c||0!==a.indexOf("data:")||!B[e.nodeName.toLowerCase()]){if(w&&!re.test(a.replace(ie,"")));else if(a)continue}else;}try{e.setAttribute(o,a),n.removed.pop()}catch(f){}}}ce("afterSanitizeAttributes",e,null)}},ae=function(e){var t,n=$(e);for(ce("beforeSanitizeShadowDOM",e,null);t=n.nextNode();)ce("uponSanitizeShadowNode",t,null),X(t)||(t.content instanceof o&&ae(t.content),oe(t));ce("afterSanitizeShadowDOM",e,null)},ce=function(e,t,r){g[e]&&g[e].forEach(function(e){e.call(n,t,r,q)})};return n.sanitize=function(e,r){var a,s,u,l,d,f;if(e||(e="\x3c!--\x3e"),"string"!==typeof e&&!J(e)){if("function"!==typeof e.toString)throw new TypeError("toString is not a function");e=e.toString()}if(!n.isSupported){if("object"===typeof t.toStaticHTML||"function"===typeof t.toStaticHTML){if("string"===typeof e)return t.toStaticHTML(e);if(J(e))return t.toStaticHTML(e.outerHTML)}return e}if(function(e){"object"!==typeof e&&(e={}),C="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS):j,S="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR):I,R="FORBID_TAGS"in e?_({},e.FORBID_TAGS):{},T="FORBID_ATTR"in e?_({},e.FORBID_ATTR):{},N=!1!==e.ALLOW_ARIA_ATTR,M=!1!==e.ALLOW_DATA_ATTR,w=e.ALLOW_UNKNOWN_PROTOCOLS||!1,A=e.SAFE_FOR_JQUERY||!1,k=e.SAFE_FOR_TEMPLATES||!1,x=e.WHOLE_DOCUMENT||!1,W=e.RETURN_DOM||!1,H=e.RETURN_DOM_FRAGMENT||!1,V=e.RETURN_DOM_IMPORT||!1,D=e.FORCE_BODY||!1,G=!1!==e.SANITIZE_DOM,U=!1!==e.KEEP_CONTENT,k&&(M=!1),H&&(W=!0),e.ADD_TAGS&&(C===j&&(C=y(C)),_(C,e.ADD_TAGS)),e.ADD_ATTR&&(S===I&&(S=y(S)),_(S,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&_(z,e.ADD_URI_SAFE_ATTR),U&&(C["#text"]=!0),Object&&"freeze"in Object&&Object.freeze(e),q=e}(r),n.removed=[],e instanceof c)1===(s=(a=Y("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===s.nodeName?a=s:a.appendChild(s);else{if(!W&&!x&&-1===e.indexOf("<"))return e;if(!(a=Y(e)))return W?null:""}for(D&&Z(a.firstChild),d=$(a);u=d.nextNode();)3===u.nodeType&&u===l||X(u)||(u.content instanceof o&&ae(u.content),oe(u),l=u);if(W){if(H)for(f=b.call(a.ownerDocument);a.firstChild;)f.appendChild(a.firstChild);else f=a;return V&&(f=v.call(i,f,!0)),f}return x?a.outerHTML:a.innerHTML},n.addHook=function(e,t){"function"===typeof t&&(g[e]=g[e]||[],g[e].push(t))},n.removeHook=function(e){g[e]&&g[e].pop()},n.removeHooks=function(e){g[e]&&(g[e]=[])},n.removeAllHooks=function(){g={}},n})},716:function(e,t,n){"use strict";var r=n(260),i=n.n(r),o=n(69),a=n.n(o),c=n(2),s=n.n(c),u=n(32),l=n.n(u);t.a=function(e){var t=e.className,n=a()(e,["className"]);return s.a.createElement("input",i()({},n,{type:"radio",className:l()(t,"form-radio")}))}},731:function(e,t,n){"use strict";n.d(t,"a",function(){return w});n(260);var r=n(52),i=n.n(r),o=n(78),a=n.n(o),c=n(91),s=n.n(c),u=n(85),l=n.n(u),d=(n(93),n(92)),f=n.n(d),p=n(5),h=n.n(p),m=n(19),O=n.n(m),E=n(2),b=n(41),v=n.n(b),g=(n(732),n(8)),_=n.n(g),y=n(0),C=v()("calypso:protect-form"),j=[],S=0;function I(e){if(j.length){C("unsaved form changes detected");var t=_.a.translate("You have unsaved changes.");return(e||window.event).returnValue=t,t}}function R(){0===S&&window.addEventListener("beforeunload",I),S++}function T(){0===--S&&window.removeEventListener("beforeunload",I)}function N(e){Object(y.includes)(j,e)||j.push(e)}function M(e){j=Object(y.without)(j,e)}var w=function(e){function t(){return i()(this,t),s()(this,l()(t).apply(this,arguments))}return f()(t,e),a()(t,[{key:"componentDidMount",value:function(){R(),this.props.isChanged&&N(this)}},{key:"componentWillUnmount",value:function(){T(),M(this)}},{key:"componentWillReceiveProps",value:function(e){e.isChanged!==this.props.isChanged&&(e.isChanged?N(this):M(this))}},{key:"render",value:function(){return null}}]),t}(E.Component);h()(w,"propTypes",{isChanged:O.a.bool.isRequired})},732:function(e,t,n){(function(t){e.exports=function(){"use strict";var e=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},n=m,r=s,i=function(e){return u(s(e))},o=u,a=h,c=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function s(e){for(var t,n=[],r=0,i=0,o="";null!=(t=c.exec(e));){var a=t[0],s=t[1],u=t.index;if(o+=e.slice(i,u),i=u+a.length,s)o+=s[1];else{o&&(n.push(o),o="");var l=t[2],f=t[3],p=t[4],h=t[5],m=t[6],O=t[7],E="+"===m||"*"===m,b="?"===m||"*"===m,v=l||"/",g=p||h||(O?".*":"[^"+v+"]+?");n.push({name:f||r++,prefix:l||"",delimiter:v,optional:b,repeat:E,pattern:d(g)})}}return i0){var r=this._window;E&&r.history.back(),this.len--}else e?setTimeout(function(){n.show(e,t)}):setTimeout(function(){n.show(n._getBase(),t)})},_.prototype.redirect=function(e,t){var n=this;"string"===typeof e&&"string"===typeof t&&y.call(this,e,function(e){setTimeout(function(){n.replace(t)},0)}),"string"===typeof e&&"undefined"===typeof t&&setTimeout(function(){n.replace(e)},0)},_.prototype.replace=function(e,t,n,r){var i=new C(e,t,this),o=this.prevContext;return this.prevContext=i,this.current=i.path,i.init=n,i.save(),!1!==r&&this.dispatch(i,o),i},_.prototype.dispatch=function(e,t){var n=0,r=0,i=this;function o(){var t=i.callbacks[n++];if(e.path===i.current)return t?void t(e,o):function(e){if(!e.handled){var t=this._window;(this._hashbang?g&&this._getBase()+t.location.hash.replace("#!",""):g&&t.location.pathname+t.location.search)!==e.canonicalPath&&(this.stop(),e.handled=!1,g&&(t.location.href=e.canonicalPath))}}.call(i,e);e.handled=!1}t?function e(){var n=i.exits[r++];if(!n)return o();n(t,e)}():o()},_.prototype.exit=function(e,t){if("function"===typeof e)return this.exit("*",e);for(var n=new j(e,null,this),r=1;r-1)&&(i?!t.target.baseVal:!t.target)&&(i||this.sameOrigin(t.href))){var a=i?t.href.baseVal:t.pathname+t.search+(t.hash||"");a="/"!==a[0]?"/"+a:a,b&&a.match(/^\/[a-zA-Z]:\//)&&(a=a.replace(/^\/[a-zA-Z]:\//,"/"));var c=a,s=this._getBase();0===a.indexOf(s)&&(a=a.substr(s.length)),this._hashbang&&(a=a.replace("#!","")),(!s||c!==a||g&&"file:"===this._window.location.protocol)&&(e.preventDefault(),this.show(c))}}}}},_.prototype._onpopstate=function(){var e=!1;return O&&"complete"===document.readyState?e=!0:window.addEventListener("load",function(){setTimeout(function(){e=!0},0)}),function(t){if(e)if(t.state){var n=t.state.path;this.replace(n,t.state)}else if(g){var r=this._window.location;this.show(r.pathname+r.search+r.hash,void 0,void 0,!1)}}}(),_.prototype._which=function(e){return null==(e=e||this._window.event).which?e.button:e.which},_.prototype._toURL=function(e){var t=this._window;if("function"===typeof URL&&g)return new URL(e,t.location.toString());if(O){var n=t.document.createElement("a");return n.href=e,n}},_.prototype.sameOrigin=function(e){if(!e||!g)return!1;var t=this._toURL(e),n=this._window,r=n.location;return r.protocol===t.protocol&&r.hostname===t.hostname&&r.port===t.port},_.prototype._samePath=function(e){if(!g)return!1;var t=this._window,n=t.location;return e.pathname===n.pathname&&e.search===n.search},_.prototype._decodeURLEncodedURIComponent=function(e){return"string"!==typeof e?e:this._decodeURLComponents?decodeURIComponent(e.replace(/\+/g," ")):e},C.prototype.pushState=function(){var e=this.page,t=e._window,n=e._hashbang;e.len++,E&&t.history.pushState(this.state,this.title,n&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},C.prototype.save=function(){var e=this.page;E&&e._window.history.replaceState(this.state,this.title,e._hashbang&&"/"!==this.path?"#!"+this.path:this.canonicalPath)},j.prototype.middleware=function(e){var t=this;return function(n,r){if(t.match(n.path,n.params))return e(n,r);r()}},j.prototype.match=function(e,t){var n=this.keys,r=e.indexOf("?"),i=~r?e.slice(0,r):e,o=this.regexp.exec(decodeURIComponent(i));if(!o)return!1;for(var a=1,c=o.length;a0)return c;s>i&&(i=s,n=e)}return n}(s,a);return u!==l&&u!==W[l]||(u=null),function(e,t,n,r,i,o){for(var a,c="top"===e||"bottom"===e,s=t?[c?"".concat(e," ").concat(t):"".concat(t," ").concat(e),e,c?"".concat(e," ").concat(W[t]):"".concat(W[t]," ").concat(e)]:[e,c?"".concat(e," ").concat(H[e]):"".concat(H[e]," ").concat(e),c?"".concat(e," ").concat(W[H[e]]):"".concat(W[H[e]]," ").concat(e)],u=0,l=i*o,d=0,f=s.length;du&&(u=v,a=p)}return a}(l,u,t,n,o,i)||e};function q(e,t,n,r){var i=L()(t);if(!i)throw new Error("could not get bounding client rect of Tip element");var o=i.width,a=i.height,c=L()(n);if(!c)throw new Error("could not get bounding client rect of `target`");var s=c.width,u=c.height,l=function(e,t){var n=t.body||t.getElementsByTagName("body")[0],r=t.documentElement||n.parentNode,i=r.clientTop||n.clientTop||0,o=r.clientLeft||n.clientLeft||0,a=window.pageYOffset||r.scrollTop,c=window.pageXOffset||r.scrollLeft;return{top:e.top+a-i,left:e.left+c-o}}(c,document);if(!l)throw new Error("could not determine page offset of `target`");var d={};switch(e){case"top":d={top:l.top-a,left:r&&r.left?l.left+r.left:l.left+s/2-o/2};break;case"bottom":d={top:l.top+u,left:r&&r.left?l.left+r.left:l.left+s/2-o/2};break;case"right":d={top:l.top+u/2-a/2,left:l.left+s};break;case"left":d={top:l.top+u/2-a/2,left:l.left-o};break;case"top left":d={top:l.top-a,left:l.left+s/2-o+15};break;case"top right":d={top:l.top-a,left:l.left+s/2-15};break;case"bottom left":d={top:l.top+u,left:l.left+s/2-o+15};break;case"bottom right":d={top:l.top+u,left:l.left+s/2-15};break;case"left top":d={top:l.top+u/2-a,left:l.left-o};break;case"left bottom":d={top:l.top+u/2,left:l.left-o};break;case"right top":d={top:l.top+u/2-a,left:l.left+s};break;case"right bottom":d={top:l.top+u/2,left:l.left+s};break;default:throw new Error('invalid position "'.concat(e,'"'))}return d}var K=function(){},Z=S()("calypso:popover"),Q=new Set,Y=function(e){function t(e){var n;return i()(this,t),n=s()(this,l()(t).call(this,e)),O()(f()(n),"isUpdatingPosition",!1),n.setPopoverId(e.id),n.setDOMBehavior=n.setDOMBehavior.bind(f()(n)),n.setPosition=n.setPosition.bind(f()(n)),n.onClickout=n.onClickout.bind(f()(n)),n.onKeydown=n.onKeydown.bind(f()(n)),n.onWindowChange=n.onWindowChange.bind(f()(n)),n.state={show:e.isVisible,left:-99999,top:-99999,positionClass:n.getPositionClass(e.position)},n}return h()(t,e),a()(t,[{key:"componentDidMount",value:function(){this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F())}},{key:"componentWillReceiveProps",value:function(e){if(this.domContext=y.a.findDOMNode(e.context),!e.isVisible)return null;this.setPosition()}},{key:"componentDidUpdate",value:function(e,t){var n=this,r=this.props.isVisible;return!t.show&&this.state.show&&(this.bindEscKeyListener(),this.bindDebouncedReposition(),F()),r!==e.isVisible&&(r?this.show():this.hide()),this.domContainer&&this.domContext&&r?void(this.isUpdatingPosition||(this.debug("requesting to update position after render completes"),requestAnimationFrame(function(){Q.has(n.id)&&n.domContainer&&n.domContext&&r?(n.setPosition(),n.isUpdatingPosition=!1):n.isUpdatingPosition=!1}),this.isUpdatingPosition=!0)):null}},{key:"componentWillUnmount",value:function(){this.debug("unmounting .... "),this.unbindClickoutHandler(),this.unbindDebouncedReposition(),this.unbindEscKeyListener(),B(),Q.delete(this.id),Z("current popover instances: ",Q.size)}},{key:"bindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("adding escKey listener ..."),document.addEventListener("keydown",this.onKeydown,!0)}},{key:"unbindEscKeyListener",value:function(){if(!this.props.closeOnEsc)return null;this.debug("unbinding `escKey` listener ..."),document.removeEventListener("keydown",this.onKeydown,!0)}},{key:"onKeydown",value:function(e){if(27!==e.keyCode)return null;this.close(!0)}},{key:"bindClickoutHandler",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.domContainer;return e?this._clickoutHandlerReference?(this.debug("clickout event already bound"),null):(this.debug("binding `clickout` event"),void(this._clickoutHandlerReference=N()(e,this.onClickout))):(this.debug("no element to bind clickout "),null)}},{key:"unbindClickoutHandler",value:function(){this._clickoutHandlerReference&&(this.debug("unbinding `clickout` listener ..."),this._clickoutHandlerReference(),this._clickoutHandlerReference=null)}},{key:"onClickout",value:function(e){var t=this.domContext&&this.domContext.contains&&!this.domContext.contains(e.target);if(this.props.ignoreContext&&t){var n=y.a.findDOMNode(this.props.ignoreContext);t=t&&n&&n.contains&&!n.contains(e.target)}t&&this.close()}},{key:"bindDebouncedReposition",value:function(){window.addEventListener("scroll",this.onWindowChange,!0),window.addEventListener("resize",this.onWindowChange,!0)}},{key:"unbindDebouncedReposition",value:function(){this.willReposition&&(window.cancelAnimationFrame(this.willReposition),this.willReposition=null),window.removeEventListener("scroll",this.onWindowChange,!0),window.removeEventListener("resize",this.onWindowChange,!0),this.debug("unbinding `debounce reposition` ...")}},{key:"onWindowChange",value:function(){this.willReposition=window.requestAnimationFrame(this.setPosition)}},{key:"setDOMBehavior",value:function(e){if(!e)return this.unbindClickoutHandler(),null;this.debug("setting DOM behavior"),this.bindClickoutHandler(e),this.domContainer=e,this.domContext=y.a.findDOMNode(this.props.context),this.setPosition()}},{key:"getPositionClass",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.position;return"is-".concat(e.replace(/\s+/g,"-"))}},{key:"adjustRtlPosition",value:function(e){if(this.props.isRtl)switch(e){case"top right":case"right top":return"top left";case"right":return"left";case"bottom right":case"right bottom":return"bottom left";case"bottom left":case"left bottom":return"bottom right";case"left":return"right";case"top left":case"left top":return"top right"}return e}},{key:"computePosition",value:function(){if(!this.props.isVisible)return null;var e=this.domContainer,t=this.domContext,n=this.props,r=n.position,i=n.relativePosition;if(!e||!t)return this.debug("[WARN] no DOM elements to work"),null;var o=r;this.debug("position: %o",o),this.props.autoRtl&&(o=this.adjustRtlPosition(o),this.debug("RTL adjusted position: %o",o)),this.props.autoPosition&&(o=z(o,e,t),this.debug("suggested position: %o",o));var a=Object.assign({},function(e,t){var n=L()(t).width;return e.left=Math.max(0,Math.min(e.left,V.width-n)),e}(q(o,e,t,i),e),{positionClass:this.getPositionClass(o)});return this.debug("updating reposition: ",a),a}},{key:"debug",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&void 0!==arguments[0]&&arguments[0];if(!this.props.isVisible)return this.debug("popover should be already closed"),null;this.props.onClose(e)}},{key:"render",value:function(){if(!this.state.show)return this.debug("is hidden. return no render"),null;if(!this.props.context)return this.debug("No `context` to tie. return no render"),null;var e=R()("popover",this.props.className,this.state.positionClass);return this.debug("rendering ..."),g.a.createElement(w.a,{className:this.props.rootClassName},g.a.createElement("div",{style:this.getStylePosition(),className:e},g.a.createElement("div",{className:"popover__arrow"}),g.a.createElement("div",{ref:this.setDOMBehavior,className:"popover__inner"},this.props.children)))}}]),t}(v.Component);O()(Y,"propTypes",{autoPosition:b.a.bool,autoRtl:b.a.bool,className:b.a.string,closeOnEsc:b.a.bool,id:b.a.string,ignoreContext:b.a.shape({getDOMNode:b.a.function}),isRtl:b.a.bool,isVisible:b.a.bool,position:b.a.oneOf(["top","top right","right","bottom right","bottom","bottom left","left","top left"]),rootClassName:b.a.string,showDelay:b.a.number,onClose:b.a.func,onShow:b.a.func,relativePosition:b.a.shape({left:b.a.number}),customPosition:b.a.shape({top:b.a.number,left:b.a.number,positionClass:b.a.oneOf(["top","right","bottom","left"])})}),O()(Y,"defaultProps",{autoPosition:!0,autoRtl:!0,className:"",closeOnEsc:!0,isRtl:!1,isVisible:!1,position:"top",showDelay:0,onClose:K,onShow:K});t.a=Object(C.b)(function(e){return{isRtl:document.body.classList.contains("rtl")}})(Y)},760:function(e,t,n){},761:function(e,t,n){"use strict";n.d(t,"a",function(){return s});var r=n(12),i=n(23),o=n(2),a=n(423),c=n(714);function s(e){var t=e.label,n=e.hideLabelFromVision,u=e.value,l=e.help,d=e.className,f=e.onChange,p=e.type,h=void 0===p?"text":p,m=Object(i.a)(e,["label","hideLabelFromVision","value","help","className","onChange","type"]),O=Object(a.a)(s),E="inspector-text-control-".concat(O);return Object(o.createElement)(c.a,{label:t,hideLabelFromVision:n,id:E,help:l,className:d},Object(o.createElement)("input",Object(r.a)({className:"components-text-control__input",type:h,id:E,value:u,onChange:function(e){return f(e.target.value)},"aria-describedby":l?E+"__help":void 0},m)))}},763:function(e,t,n){"use strict";e.exports=n(764)},764:function(e,t,n){"use strict";var r=n(765);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=r.getWindow(t));var i=n.allowHorizontalScroll,o=n.onlyScrollIfNeeded,a=n.alignWithTop,c=n.alignWithLeft,s=n.offsetTop||0,u=n.offsetLeft||0,l=n.offsetBottom||0,d=n.offsetRight||0;i=void 0===i||i;var f=r.isWindow(t),p=r.offset(e),h=r.outerHeight(e),m=r.outerWidth(e),O=void 0,E=void 0,b=void 0,v=void 0,g=void 0,_=void 0,y=void 0,C=void 0,j=void 0,S=void 0;f?(y=t,S=r.height(y),j=r.width(y),C={left:r.scrollLeft(y),top:r.scrollTop(y)},g={left:p.left-C.left-u,top:p.top-C.top-s},_={left:p.left+m-(C.left+j)+d,top:p.top+h-(C.top+S)+l},v=C):(O=r.offset(t),E=t.clientHeight,b=t.clientWidth,v={left:t.scrollLeft,top:t.scrollTop},g={left:p.left-(O.left+(parseFloat(r.css(t,"borderLeftWidth"))||0))-u,top:p.top-(O.top+(parseFloat(r.css(t,"borderTopWidth"))||0))-s},_={left:p.left+m-(O.left+b+(parseFloat(r.css(t,"borderRightWidth"))||0))+d,top:p.top+h-(O.top+E+(parseFloat(r.css(t,"borderBottomWidth"))||0))+l}),g.top<0||_.top>0?!0===a?r.scrollTop(t,v.top+g.top):!1===a?r.scrollTop(t,v.top+_.top):g.top<0?r.scrollTop(t,v.top+g.top):r.scrollTop(t,v.top+_.top):o||((a=void 0===a||!!a)?r.scrollTop(t,v.top+g.top):r.scrollTop(t,v.top+_.top)),i&&(g.left<0||_.left>0?!0===c?r.scrollLeft(t,v.left+g.left):!1===c?r.scrollLeft(t,v.left+_.left):g.left<0?r.scrollLeft(t,v.left+g.left):r.scrollLeft(t,v.left+_.left):o||((c=void 0===c||!!c)?r.scrollLeft(t,v.left+g.left):r.scrollLeft(t,v.left+_.left)))}},765:function(e,t,n){"use strict";var r=Object.assign||function(e){for(var t=1;ta&&(c.push(e.slice(a,r)),a=r),'"'!==(i=e.slice(r+1,r+2))&&"'"!==i)-1===(o=e.indexOf("]",r))&&(o=e.length),c.push(e.slice(a+1,o)),a="."===e.slice(o+1,o+2)?o+2:o+1;else{for(-1===(o=e.indexOf(i+"]",r))&&(o=e.length);"\\"===e.slice(o-1,o)&&r1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=Object(C.get)(e,["extensions","woocommerce","sites",t,"shippingMethods"]);return Object(C.isArray)(n)?(Object(k.a)(e,t)?n:Object(C.filter)(n,function(e){var t=e.id;return!Object(C.startsWith)(t,"wc_services")})).map(function(e){return i()({},e,{title:x[e.id]||e.title})}):n},W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!Object(C.isArray)(D(e,t)))return!1;var n=Object(C.filter)(D(e,t),function(e){var t=e.id;return Object(C.startsWith)(t,"wc_services")});return Object(C.every)(n,function(n){var r=n.id;return Object(L.b)(e,r,t)})},H=(Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!W(e,t))return function(e){return e};var n=D(e,t).reduce(function(e,t){var n=t.id,r=t.title;return e[n]=r,e},{});return function(e){return n[e]||e}},[W,D]),n(113)),V=n(69),G=n.n(V),U=n(53),F=n.n(U),B=n(183),z=n(48),q=n(10),K=n(6),Z=function(e,t){if(!t||t.pristine)return e;var n=e.journal,r=e.states,i=t.journal,o=t.states,a=t.postcode,c=null;return null!==o&&(null===r?c=o:(c={add:o.removeAll?[]:N()(r.add),remove:o.removeAll?[]:N()(r.remove),removeAll:r.removeAll||o.removeAll},Object(C.pullAll)(c.add,o.remove),Object(C.pullAll)(c.remove,o.add),c.add=Object(C.union)(c.add,o.add),c.remove=Object(C.union)(c.remove,o.remove))),{journal:[].concat(N()(n),N()(i)),states:c,postcode:a,pristine:t.pristine&&e.pristine}},Q="ADD_CONTINENT",Y="REMOVE_CONTINENT",$="ADD_COUNTRY",J="REMOVE_COUNTRY",X={journal:[],states:null,postcode:null,pristine:!0},ee={};ee[K.db]=function(e){return i()({},e,{temporaryChanges:i()({},X)})},ee[K.cb]=function(e){var t=e.temporaryChanges,n=G()(e,["temporaryChanges"]);return Z(n,t)},ee[K.bb]=function(e){return i()({},e,{temporaryChanges:null})},ee[K.ib]=function(e,t){var n=t.continentCode,r=t.selected;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:null,postcode:null,journal:[].concat(N()(e.temporaryChanges.journal),[{action:r?Q:Y,code:n}])})})},ee[K.jb]=function(e,t){var n=t.countryCode,r=t.selected;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:null,postcode:null,journal:[].concat(N()(e.temporaryChanges.journal),[{action:r?$:J,code:n}])})})},ee[K.kb]=function(e,t){var n=t.stateCode,r=t.selected,o=e.temporaryChanges.states||{add:[],remove:[],removeAll:!1},a=N()(o.add),c=N()(o.remove),s=o.removeAll;return r?(Object(C.find)(a,n)||a.push(n),Object(C.pull)(c,n)):(Object(C.find)(c,n)||c.push(n),Object(C.pull)(a,n)),i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{states:{add:a,remove:c,removeAll:s}})})},ee[K.eb]=function(e,t){var n=t.postcode;return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:n})})},ee[K.hb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:null,states:null})})},ee[K.gb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:null,states:{add:[],remove:[],removeAll:!0}})})},ee[K.fb]=function(e){return i()({},e,{temporaryChanges:i()({},e.temporaryChanges,{postcode:"",states:null})})};var te=Object(q.b)(X,ee),ne=Object(M.a)(function(e,t){var n={},r=Oe(e,t);return Object(C.forIn)(Object(B.c)(e,t),function(e,t){var i=e.continent;if(r.id!==Number(t)){var o=!0,a=!1,c=void 0;try{for(var s,u=i[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value;n[l]=Number(t)}}catch(d){a=!0,c=d}finally{try{o||null==u.return||u.return()}finally{if(a)throw c}}}}),n},function(e,t){return[Oe(e,t),Object(B.c)(e,t)]}),re=Object(M.a)(function(e,t){var n={},r=Oe(e,t);return Object(C.forIn)(Object(B.c)(e,t),function(e,t){var i=e.country,o=e.postcode;if(r.id!==Number(t)&&Object(C.isEmpty)(o)){var a=!0,c=!1,s=void 0;try{for(var u,l=i[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var d=u.value;n[d]=Number(t)}}catch(f){c=!0,s=f}finally{try{a||null==l.return||l.return()}finally{if(c)throw s}}}}),n},function(e,t){return[Oe(e,t),Object(B.c)(e,t)]}),ie=Object(M.a)(function(e,t,n){var r={},i=Oe(e,t);return Object(C.forIn)(Object(B.c)(e,t),function(e,t){if(i.id!==Number(t)){var o=!0,a=!1,c=void 0;try{for(var s,u=e.state[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){var l=s.value.split(":"),d=F()(l,2),f=d[0],p=d[1];f===n&&(r[p]=Number(t))}}catch(h){a=!0,c=h}finally{try{o||null==u.return||u.return()}finally{if(a)throw c}}}}),r},function(e,t){return[Oe(e,t),Object(B.c)(e,t)]},function(e,t,n){return[t,n].join()}),oe=Object(M.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e);if(!Object(A.a)(e,n))return null;var r=Object(B.c)(e,n)[t]||{continent:[],country:[],state:[],postcode:[]},o=new Set(r.country),a=new Set;return r.state.forEach(function(e){var t=e.split(":"),n=F()(t,2),r=n[0],i=n[1];o.add(r),a.add(i)}),i()({},r,{country:Array.from(o),state:Array.from(a)})},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e),r=Object(A.a)(e,n);return[r,r&&Object(B.c)(e,n)]},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e),r=Object(C.isObject)(t)?"i".concat(t.index):t;return"".concat(r).concat(n)}),ae=Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!Object(A.a)(e,t))return null;var r=Oe(e,t);if(!r)return null;var i=oe(e,r.id,t),o=new Set(i.continent),a=new Set(i.country),c=new Set(i.state),s=pe(e,t).currentlyEditingChanges.locations,u=s.temporaryChanges,l=G()(s,["temporaryChanges"]),d=n?Z(l,u):l;if(d.pristine)return{continent:Array.from(o),country:Array.from(a),state:Array.from(c),postcode:i.postcode};var f=new Set(Object.keys(re(e,t)));return d.journal.forEach(function(n){var r=n.action,i=n.code;switch(r){case Q:Object(z.f)(e,i,t).forEach(function(e){return a.delete(e.code)}),a.size?Object(z.f)(e,i,t).forEach(function(e){f.has(e.code)||a.add(e.code)}):o.add(i);break;case Y:o.delete(i),Object(z.f)(e,i,t).forEach(function(e){return a.delete(e.code)});break;case $:f.forEach(function(e){a.delete(e)}),a.add(i),o.forEach(function(n){Object(z.f)(e,n,t).forEach(function(e){f.has(e.code)||a.add(e.code)})}),o.clear();break;case J:var c=!1,s=!0,u=!1,l=void 0;try{for(var d,p=o[Symbol.iterator]();!(s=(d=p.next()).done);s=!0){var h=d.value;if(c)break;var m=!0,O=!1,E=void 0;try{for(var b,v=Object(z.f)(e,h,t)[Symbol.iterator]();!(m=(b=v.next()).done);m=!0){if(b.value.code===i){c=!0;break}}}catch(g){O=!0,E=g}finally{try{m||null==v.return||v.return()}finally{if(O)throw E}}}}catch(g){u=!0,l=g}finally{try{s||null==p.return||p.return()}finally{if(u)throw l}}c&&(o.forEach(function(n){Object(z.f)(e,n,t).forEach(function(e){f.has(e.code)||a.add(e.code)})}),o.clear()),a.delete(i)}}),d.states&&!d.states.removeAll&&Object(C.isEmpty)(d.journal)||c.clear(),d.states&&(d.states.add.forEach(function(e){return c.add(e)}),d.states.remove.forEach(function(e){return c.delete(e)})),{continent:Array.from(o),country:Array.from(a),state:Array.from(c),postcode:null===d.postcode?[]:[d.postcode]}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=Object(A.a)(e,t),r=n&&Oe(e,t);return[n,r,r&&oe(e,r.id,t),r&&pe(e,t),r&&re(e,t)]},function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),!(arguments.length>2&&void 0!==arguments[2])||arguments[2]].join()}),ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return!(!Object(A.a)(e,t)||!Oe(e,t))&&Boolean(pe(e,t).currentlyEditingChanges.locations.temporaryChanges)}(e,t))return!1;var n=ae(e,t);return n&&Object(C.isEmpty)(n.continent)&&1===n.country.length},se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!ce(e,t))return null;var n=ae(e,t);return re(e,t)[n.country[0]]},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!ce(e,t))return!1;var n=ae(e,t);return n&&Object(z.k)(e,n.country[0],t)},le=Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!ce(e,t))return!1;var n=Oe(e,t),r=Object(B.c)(e,t)[n.id],i=pe(e,t).currentlyEditingChanges.locations,o=i.temporaryChanges,a=G()(i,["temporaryChanges"]),c=Z(a,o);return c.pristine?!Object(C.isEmpty)(r.postcode):null!==c.postcode||!ue(e,t)&&Boolean(se(e,t))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=ce(e,t);return[n,n&&Oe(e,t),n&&Object(B.c)(e,t),n&&pe(e,t),n&&ue(e,t),n&&se(e,t)]}),de=Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!ce(e,t)||!ue(e,t))return!1;var n=Oe(e,t),r=Object(B.c)(e,t)[n.id],i=pe(e,t).currentlyEditingChanges.locations,o=i.temporaryChanges,a=G()(i,["temporaryChanges"]),c=Z(a,o);return c.pristine?!Object(C.isEmpty)(r.state):null!==c.states||!le(e,t)&&Boolean(se(e,t))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=ce(e,t);return[n,n&&ue(e,t),n&&Oe(e,t),n&&Object(B.c)(e,t),n&&pe(e,t),n&&le(e,t),n&&se(e,t)]}),fe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(w.a)(e);if(!t)return[];var i=new Set(t.continent);if(i.size)return Object(z.e)(e,r).filter(function(e){var t=e.code;return i.has(t)}).map(function(e){return{type:"continent",code:e.code,name:e.name}});var o=new Set(t.state);if(o.size){var a=t.country[0],c=Object(z.g)(e,a,r);return Object(z.j)(e,a,r).filter(function(e){var t=e.code;return o.has(t)}).map(function(e){return{type:"state",code:e.code,name:e.name,countryName:c,countryCode:a}})}if(t.postcode[0])return t.country.map(function(n){return{type:"country",code:n,name:Object(z.g)(e,n,r),postcodeFilter:t.postcode[0]}});var s=new Set(t.country);if(!s.size)return[];var u=[];return Object(z.e)(e,r).forEach(function(t){var i=t.code,o=t.name,a=Object(z.f)(e,i,r),c=a.filter(function(e){var t=e.code;return s.has(t)}).map(function(e){return{type:"country",code:e.code,name:e.name,postcodeFilter:void 0}});c.length2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(w.a)(e),i=oe(e,t,r);return fe(e,i,n,r)},function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(w.a)(e);return[oe(e,t,r)]},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:999,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Object(w.a)(e),i=Object(C.isObject)(t)?"i".concat(t.index):t;return"".concat(i).concat(n).concat(r)}),Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:999,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e),r=ae(e,n,!1);return fe(e,r,t,n)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e);return[ae(e,n,!1)]},function(e){return[arguments.length>1&&void 0!==arguments[1]?arguments[1]:999,arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e)].join()}),Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=ae(e,t);if(!n)return[];var r=new Set(n.continent),i=new Set(n.country),o=ne(e,t),a=re(e,t),c=[],s=0===r.size&&0===i.size;return Object(z.e)(e,t).forEach(function(n){var u=n.code,l=n.name,d=r.has(u),f=Object(z.f)(e,u,t),p=0,h=c.push({code:u,name:l,selected:d,disabled:Boolean(o[u]),ownerZoneId:o[u],type:"continent",countryCount:f.length});f.forEach(function(e){var t=e.code,n=e.name,r=d||i.has(t);r&&p++,c.push({code:t,name:n,selected:r,disabled:!s&&Boolean(a[t]),ownerZoneId:a[t],type:"country"})}),c[h-1].selectedCountryCount=p}),c},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return[ae(e,t),ne(e,t),re(e,t)]}),Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!de(e,t))return[];var n=ae(e,t);if(!n)return[];var r=n.country[0],i=new Set(n.state),o=ie(e,t,r);return Object(z.j)(e,r,t).map(function(e){var t=e.code;return{code:t,name:e.name,selected:i.has(t),disabled:Boolean(o[t]),ownerZoneId:o[t]}})},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return[de(e,t),ae(e,t),ie(e,t)]}),function(e,t){return Object(C.get)(e,["extensions","woocommerce","ui","shipping",t,"zones"])}),he=function(e){return N()(e).sort(function(e,t){return Object(C.isNumber)(e.id)||Object(C.isNumber)(t.id)?Object(C.isNumber)(e.id)?Object(C.isNumber)(t.id)?0===e.id?1:0===t.id?-1:e.order===t.order?e.id-t.id:e.order-t.order:1:-1:e.id.index-t.id.index})},me=Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!Object(A.a)(e,t))return[];var n=N()(Object(A.b)(e,t)),r=pe(e,t);if(!r)return he(n);var o=r.creates,a=r.updates;return r.deletes.forEach(function(e){var t=e.id;return Object(C.remove)(n,{id:t})}),a.forEach(function(e){var t=Object(C.findIndex)(n,{id:e.id});-1!==t&&(n[t]=i()({},n[t],e))}),he([].concat(N()(n),N()(o)))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=Object(A.a)(e,t);return[t,n,n&&Object(A.b)(e,t),n&&pe(e,t)]}),Oe=Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=pe(e,t);if(!n)return null;if(null===n.currentlyEditingId)return null;var r=Object(C.find)(me(e,t),{id:n.currentlyEditingId});return r?i()({},r,n.currentlyEditingChanges):i()({id:n.currentlyEditingId},n.currentlyEditingChanges)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=pe(e,t);return[t,n,n&&null!==n.currentlyEditingId&&me(e,t)]});function Ee(e){return e&&!Object(C.isObject)(e.id)?"updates":"creates"}var be={};be[K.Bb]=function(e,t){var n=t.isTaxable;return i()({},e,{tax_status:n?"taxable":"none"})},be[K.zb]=function(e,t){var n=t.cost;return i()({},e,{cost:n})};var ve=Object(q.b)({tax_status:"none",cost:5},be),ge={};ge[K.yb]=function(e,t){var n=t.condition;return i()({},e,{requires:n})},ge[K.Ab]=function(e,t){var n=t.cost;return i()({},e,{min_amount:n})};var _e=Object(q.b)({requires:"",min_amount:0},ge),ye={};ye[K.Bb]=function(e,t){var n=t.isTaxable;return i()({},e,{tax_status:n?"taxable":"none"})},ye[K.zb]=function(e,t){var n=t.cost;return i()({},e,{cost:n})};var Ce=Object(q.b)({tax_status:"none",cost:0},ye),je=n(3),Se={};Se[je.x]=function(e,t){return Object(C.setWith)(Object(C.clone)(e),t.path,t.value,C.clone)};var Ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"function"===typeof Se[t.type]?Se[t.type](e,t):e},Re={flat_rate:ve,free_shipping:_e,local_pickup:Ce,wc_services_usps:Ie,wc_services_canada_post:Ie,wc_services_fedex:Ie,wc_services_ups:Ie,wc_services_dhlexpress:Ie},Te={creates:[],updates:[],deletes:[],currentlyEditingId:null,currentlyEditingNew:!1,currentlyEditingChangedType:!1},Ne={},Me=function(e){return{index:Object(C.isEmpty)(e.creates)?0:e.creates[e.creates.length-1].id.index+1}};Ne[K.ob]=function(e,t){var n=t.methodType,r=t.title,o=Me(e),a={id:o,methodType:n};return Re[n]&&(a=i()({},a,{title:r},Re[n](void 0,t))),i()({},e,{currentlyEditingId:o,currentlyEditingNew:!0,currentlyEditingChangedType:!1,currentlyEditingChanges:a})},Ne[K.wb]=function(e,t){return i()({},e,{currentlyEditingId:t.methodId,currentlyEditingChanges:{},currentlyEditingChangedType:!1,currentlyEditingNew:!1})},Ne[K.pb]=function(e){return i()({},e,{currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1})},Ne[K.rb]=function(e){var t=e,n=t.currentlyEditingId,r=t.currentlyEditingChanges,o=t.currentlyEditingNew,c=t.currentlyEditingChangedType;if(null===n)return e;if(Object(C.isEmpty)(r))return i()({},e,{currentlyEditingChangedType:!1,currentlyEditingNew:!1,currentlyEditingId:null});var s=Ee({id:n});if(o)return i()({},e,{creates:[].concat(N()(e.creates),[r]),currentlyEditingId:null,currentlyEditingNew:!1,currentlyEditingChangedType:!1,currentlyEditingChanges:{}});if(c){var u=Object(C.find)(e[s],{id:n}),l=n;return u&&!Object(C.isNil)(u._originalId)&&(l=u._originalId),e=Ne[K.xb](e,{methodId:n}),i()({},e,{currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1,creates:[].concat(N()(e.creates),[i()({},r,{enabled:Object(C.isNil)(r.enabled)?u&&u.enabled:r.enabled,id:Me(e),_originalId:l})])})}var d=!1,f=e[s].map(function(e){return Object(C.isEqual)(n,e.id)?(d=!0,i()({},e,r)):e});return d||f.push(i()({id:n},r)),i()({},e,a()({currentlyEditingId:null,currentlyEditingChangedType:!1,currentlyEditingNew:!1},s,f))},Ne[K.xb]=function(e,t){var n=t.methodId,r=i()({},e,{currentlyEditingId:null}),o=Ee({id:n});return"updates"===o&&(r.deletes=[].concat(N()(e.deletes),[{id:n}])),r[o]=Object(C.reject)(e[o],{id:n}),r},Ne[K.qb]=function(e,t){var n=t.methodType,r=t.title;if(!Re[n])return e;var o=i()({},Re[n](void 0,t),{id:e.currentlyEditingId,title:r,methodType:n,enabled:e.currentlyEditingChanges&&e.currentlyEditingChanges.enabled});return i()({},e,{currentlyEditingChangedType:!0,currentlyEditingChanges:o})},Ne[K.vb]=function(e,t){var n=t.title;return i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{title:n})})},Ne[K.Db]=function(e,t){var n=t.enabled;return i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{enabled:n})})},Ne[K.Cb]=function(e,t){var n=t.methodId,r=t.enabled,o=Ee({id:n}),c=Object(C.findIndex)(e[o],{id:n});if(-1===c)return i()({},e,a()({},o,[].concat(N()(e[o]),[{id:n,enabled:r}])));var s=i()({},e[o][c],{enabled:r});return i()({},e,a()({},o,[].concat(N()(e[o].slice(0,c)),[s],N()(e[o].slice(c+1)))))},Ne[K.Fb]=function(e,t){var n=t.data,r=t.originatingAction,o=r.methodId,a=r.method,c=Ee({id:o}),s=i()({},e,{currentlyEditingId:null});if("creates"===c){var u=Object(C.find)(e.creates,{id:o});u&&(s.updates=[].concat(N()(e.updates),[i()({},u,{id:n.id})])),s.creates=Object(C.reject)(e[c],{id:o})}else{var l=Object(C.find)(e.updates,{id:o}),d=Object(C.omit)(l,Object.keys(a));if(Object(C.isEmpty)(Object(C.omit)(d,["id","methodType"])))s.updates=Object(C.reject)(e.updates,{id:o});else{var f=Object(C.findIndex)(e.updates,{id:o});s.updates=[].concat(N()(e[c].slice(0,f)),[d],N()(e[c].slice(f+1)))}}return s},Ne[K.ub]=function(e,t){var n=t.originatingAction.methodId;return i()({},e,{creates:Object(C.reject)(e.creates,{id:n}),updates:Object(C.reject)(e.updates,{id:n}),deletes:Object(C.reject)(e.deletes,{id:n}),currentlyEditingId:null})};var we=Object(q.b)(Te,Ne),Ae=function(e,t){if(!t)return e;var n=e.creates,r=e.updates,i=e.deletes,o=t.creates,a=t.updates,c=t.deletes,s=t.currentlyEditingId,u=t.currentlyEditingNew,l=t.currentlyEditingChangedType,d={creates:N()(n),updates:N()(r),deletes:N()(i),currentlyEditingId:s,currentlyEditingNew:u,currentlyEditingChangedType:l};return c.forEach(function(e){var t=e.id,n=Ee({id:t});"updates"===n&&d.deletes.push({id:t}),Object(C.remove)(d[n],{id:t})}),o.forEach(function(e){var t=Object(C.findIndex)(n,{id:e.id});-1===t?d.creates.push(e):d.creates[t]=Object(C.merge)({},d.creates[t],e)}),a.forEach(function(e){var t=Object(C.findIndex)(r,{id:e.id});-1===t?d.updates.push(e):d.updates[t]=Object(C.merge)({},d.updates[t],e)}),d};function ke(e){switch(e.type){case"boolean":return e.default||!1;case"number":return e.default||0;case"string":case"textarea":return e.default||"";case"array":return e.default||[];case"object":return Object(C.mapValues)(Object(C.get)(e,"properties",{}),ke);default:return null}}var Pe=function(e){return Object(C.mapValues)(e.properties,ke)},Le=Object(M.a)(function(e,t,n){return Object(A.a)(e,n)?null===t?Oe(e,n):Object(C.find)(Object(A.b)(e,n),{id:t}):null},function(e,t,n){var r=Object(A.a)(e,n);return[r,r&&Oe(e,n),r&&Object(A.b)(e,n)]},function(e,t,n){return Object(C.isNumber)(t)?"".concat(t).concat(n):"i".concat(t.index).concat(n)}),xe=function(e,t,n,r){var o=N()(t.methodIds||[]),a=function(e,t,n){var r=pe(e,n);if(r){var i=Object(C.find)(r[Ee({id:t})],{id:t});if(i&&!Object(C.isEmpty)(i.methods))return i.methods}return{creates:[],updates:[],deletes:[],currentlyEditingId:null}}(e,t.id,n),c=Ae(a,r),s=c.creates,u=c.updates,l=c.deletes;Object(C.pullAll)(o,Object(C.map)(l,"id"));var d=o.map(function(t){return Object(H.c)(e,t,n)});u.forEach(function(e){var t=o.indexOf(e.id);-1!==t&&(d[t]=i()({},d[t],e))});var f=[].concat(N()(d),N()(s)).map(function(t){var r=t.enabled;Object(C.isNil)(r)&&"number"===typeof t._originalId&&(r=Object(H.c)(e,t._originalId,n).enabled);var i=Object(C.startsWith)(t.methodType,"wc_services")?Pe(Object(L.a)(e,t.methodType,n).formSchema):{};return Object(C.merge)({},i,t,{enabled:!1!==r})});return function(e,t,n){return n.sort(function(n,r){var i=Object(C.isNil)(n._originalId)?n.id:n._originalId,o=Object(C.isNil)(r._originalId)?r.id:r._originalId;return Object(C.isNumber)(i)?Object(C.isNumber)(o)?Object(H.c)(e,i,t).order-Object(H.c)(e,o,t).order:-1:Object(C.isNumber)(o)?1:i.index-o.index})}(e,n,f)},De=(Object(M.a)(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e);if(!Object(A.a)(e,n))return[];var r=Le(e,t,n)||{id:t,methodIds:[]};return xe(e,r,n)},function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Object(w.a)(e),r=Object(A.a)(e,n);return[r,r&&Le(e,n),r&&pe(e,n)]},function(e,t,n){return Object(C.isNumber)(t)?"".concat(t).concat(n):"i".concat(t.index).concat(n)}),Object(M.a)(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!Object(A.a)(e,t))return[];var n=Oe(e,t);if(!n)return[];var r=pe(e,t).currentlyEditingChanges.methods;return xe(e,n,t,r)},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=Object(A.a)(e,t),r=n&&Oe(e,t);return[n,r,r&&pe(e,t)]})),We=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);if(!Object(A.a)(e,t))return null;var n=Oe(e,t);if(!n||!n.methods||!n.methods.currentlyEditingId)return null;var r=n.methods.currentlyEditingChanges.methodType,i=Object(C.startsWith)(r,"wc_services")?Pe(Object(L.a)(e,r,t).formSchema):{};if(n.methods.currentlyEditingNew)return Object(C.merge)({},i,n.methods.currentlyEditingChanges,{enabled:!1!==n.methods.currentlyEditingChanges.enabled});var o=De(e),a=Object(C.find)(o,{id:n.methods.currentlyEditingId});if(!a)return null;var c=Object(C.isNil)(n.methods.currentlyEditingChanges.enabled)?!1!==a.enabled:!1!==n.methods.currentlyEditingChanges.enabled;return Object(C.mergeWith)({},i,a,n.methods.currentlyEditingChanges,{enabled:c},function(e,t){if(Object(C.isArray)(e))return t})},He=n(704),Ve=n(682),Ge=n(260),Ue=n.n(Ge),Fe=n(19),Be=n.n(Fe),ze=n(36),qe=n(674),Ke=n(675),Ze=n(761),Qe=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o-1&&this.props.scrollIntoView&&(this._scrollingIntoView=!0,t=this.refs.list,ft()(t.children[this.props.selectedIndex],t,{onlyScrollIfNeeded:!0}),setTimeout(function(){this._scrollingIntoView=!1}.bind(this),100))}},{key:"render",value:function(){var e=R()("token-field__suggestions-list",{"is-expanded":this.props.isExpanded&&this.props.suggestions.length>0});return s.a.createElement("ul",{ref:"list",className:e,tabIndex:"-1"},this._renderSuggestions())}}]),t}(s.a.PureComponent);a()(pt,"propTypes",{isExpanded:Be.a.bool,match:Be.a.string,displayTransform:Be.a.func.isRequired,onSelect:Be.a.func,suggestions:Be.a.array,selectedIndex:Be.a.number}),a()(pt,"defaultProps",{isExpanded:!1,match:"",onHover:function(){},onSelect:function(){},suggestions:Object.freeze([])});var ht=pt,mt=n(261),Ot=n.n(mt),Et=n(739),bt=n(180),vt=769,gt="<480px",_t=">960px",yt=!window.matchMedia,Ct=function(){return null};function jt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.min,n=e.max;return void 0!==t&&void 0!==n?yt?{matches:vt>t&&vt<=n}:window.matchMedia("(min-width: ".concat(t+1,"px) and (max-width: ").concat(n,"px)")):void 0!==t?yt?{matches:vt>t}:window.matchMedia("(min-width: ".concat(t+1,"px)")):void 0!==n&&(yt?{matches:vt<=n}:window.matchMedia("(max-width: ".concat(n,"px)")))}var St={"<480px":jt({max:480}),"<660px":jt({max:660}),"<800px":jt({max:800}),"<960px":jt({max:960}),"<1040px":jt({max:1040}),"<1280px":jt({max:1280}),"<1400px":jt({max:1400}),">480px":jt({min:480}),">660px":jt({min:660}),">800px":jt({min:800}),">960px":jt({min:960}),">1040px":jt({min:1040}),">1280px":jt({min:1280}),">1400px":jt({min:1400}),"480px-660px":jt({min:480,max:660}),"660px-960px":jt({min:660,max:960}),"480px-960px":jt({min:480,max:960})};function It(e){if(St.hasOwnProperty(e))return St[e];try{console.warn("Undefined breakpoint used in `mobile-first-breakpoint`",e)}catch(t){}}function Rt(e){var t=It(e);return t?t.matches:void 0}function Tt(e,t){if(!t)return Ct;var n=It(e);if(n&&!yt){var r=function(e){return t(e.matches)};return n.addListener(r),function(){return n.removeListener(r)}}return Ct}function Nt(e){var t=Object(c.useState)(function(){return{isActive:Rt(e),breakpoint:e}}),n=F()(t,2),r=n[0],i=n[1];return Object(c.useEffect)(function(){return Tt(e,function(t){i(function(n){return n.isActive===t&&n.breakpoint===e?n:{isActive:t,breakpoint:e}})})},[e]),e===r.breakpoint?r.isActive:Rt(e)}Object(bt.a)(function(e){return Object(c.forwardRef)(function(t,n){var r=Nt(gt);return s.a.createElement(e,Ue()({},t,{isBreakpointActive:r,ref:n}))})},"WithMobileBreakpoint"),Object(bt.a)(function(e){return Object(c.forwardRef)(function(t,n){var r=Nt(_t);return s.a.createElement(e,Ue()({},t,{isBreakpointActive:r,ref:n}))})},"WithDesktopBreakpoint");function Mt(e){var t=Nt(gt);if(!e.showOnMobile&&t)return null;var n=R()("popover","tooltip","is-".concat(e.status),"is-".concat(e.position),e.className);return s.a.createElement(Et.a,{autoPosition:e.autoPosition,className:n,rootClassName:e.rootClassName,context:e.context,id:e.id,isVisible:e.isVisible,position:e.position,showDelay:e.showDelay},e.children)}Mt.propTypes={autoPosition:Be.a.bool,className:Be.a.string,id:Be.a.string,isVisible:Be.a.bool,position:Be.a.string,rootClassName:Be.a.string,status:Be.a.string,showDelay:Be.a.number,showOnMobile:Be.a.bool},Mt.defaultProps={showDelay:100,position:"top",showOnMobile:!1};var wt=Mt,At=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o=c||(f=i()({},f,{onChange:n._onInputChange})),s.a.createElement(Pt,f)}),a()(b()(n),"setTokensAndInput",function(e){n.tokensAndInput=e}),a()(b()(n),"_onFocus",function(e){n.setState({isActive:!0,tokenInputHasFocus:!0}),"function"===typeof n.props.onFocus&&n.props.onFocus(e)}),a()(b()(n),"_onBlur",function(){n._inputHasValidValue()?(Lt("_onBlur adding current token"),n.setState({isActive:!1},n._addCurrentToken)):(Lt("_onBlur not adding current token"),n.setState(n.constructor.initialState))}),a()(b()(n),"_onTokenClickRemove",function(e){n._deleteToken(e.value)}),a()(b()(n),"_onSuggestionHovered",function(e){var t=n._getMatchingSuggestions().indexOf(e);t>=0&&n.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}),a()(b()(n),"_onSuggestionSelected",function(e){Lt("_onSuggestionSelected",e),n._addNewToken(e)}),a()(b()(n),"_onInputChange",function(e){var t=e.value,r=n.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,i=t.split(r);i.length>1&&n._addNewTokens(i.slice(0,-1)),n.setState({incompleteTokenValue:Object(C.last)(i)||"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1})}),a()(b()(n),"_onContainerTouched",function(e){e.target===n.tokensAndInput&&n.state.isActive&&e.preventDefault()}),a()(b()(n),"_onKeyDown",function(e){var t=!1;switch(e.keyCode){case 8:t=n._handleDeleteKey(n._deleteTokenBeforeInput);break;case 9:case 13:t=n._addCurrentToken();break;case 37:t=n._handleLeftArrowKey();break;case 38:t=n._handleUpArrowKey();break;case 39:t=n._handleRightArrowKey();break;case 40:t=n._handleDownArrowKey();break;case 46:t=n._handleDeleteKey(n._deleteTokenAfterInput);break;case 32:n.props.tokenizeOnSpace&&(t=n._addCurrentToken())}t&&e.preventDefault()}),a()(b()(n),"_onKeyPress",function(e){var t=!1;switch(e.charCode){case 44:t=n._handleCommaKey()}t&&e.preventDefault()}),a()(b()(n),"_handleDeleteKey",function(e){var t=!1;return n.state.tokenInputHasFocus&&n._isInputEmpty()&&(e(),t=!0),t}),a()(b()(n),"_getMatchingSuggestions",function(){var e=n.props.suggestions,t=n.props.saveTransform(n.state.incompleteTokenValue),r=[],i=[];return 0===t.length?e=Object(C.difference)(e,n.props.value):(t=t.toLocaleLowerCase(),Object(C.each)(e,function(e){var n=e.toLocaleLowerCase().indexOf(t);-1===this.props.value.indexOf(e)&&(0===n?r.push(e):n>0&&i.push(e))}.bind(b()(n))),e=r.concat(i)),Object(C.take)(e,n.props.maxSuggestions)}),a()(b()(n),"_getSelectedSuggestion",function(){if(-1!==n.state.selectedSuggestionIndex)return n._getMatchingSuggestions()[n.state.selectedSuggestionIndex]}),a()(b()(n),"_addCurrentToken",function(){var e=!1,t=n._getSelectedSuggestion();return t?(n._addNewToken(t),e=!0):n._inputHasValidValue()&&(n._addNewToken(n.state.incompleteTokenValue),e=!0),e}),a()(b()(n),"_handleLeftArrowKey",function(){var e=!1;return n._isInputEmpty()&&(n._moveInputBeforePreviousToken(),e=!0),e}),a()(b()(n),"_handleRightArrowKey",function(){var e=!1;return n._isInputEmpty()&&(n._moveInputAfterNextToken(),e=!0),e}),a()(b()(n),"_handleUpArrowKey",function(){return n.setState({selectedSuggestionIndex:Math.max((n.state.selectedSuggestionIndex||0)-1,0),selectedSuggestionScroll:!0}),!0}),a()(b()(n),"_handleDownArrowKey",function(){return n.setState({selectedSuggestionIndex:Math.min(n.state.selectedSuggestionIndex+1||0,n._getMatchingSuggestions().length-1),selectedSuggestionScroll:!0}),!0}),a()(b()(n),"_handleCommaKey",function(){return n._inputHasValidValue()&&n._addNewToken(n.state.incompleteTokenValue),!0}),a()(b()(n),"_isInputEmpty",function(){return 0===n.state.incompleteTokenValue.length}),a()(b()(n),"_inputHasValidValue",function(){return n.props.saveTransform(n.state.incompleteTokenValue).length>0}),a()(b()(n),"_deleteTokenBeforeInput",function(){var e=n._getIndexOfInput()-1;e>-1&&n._deleteToken(n.props.value[e])}),a()(b()(n),"_deleteTokenAfterInput",function(){var e=n._getIndexOfInput();e0){var r=Object(C.clone)(n.props.value);r.splice.apply(r,[n._getIndexOfInput(),0].concat(t)),Lt("_addNewTokens: onChange",r),n.props.onChange(r)}}),a()(b()(n),"_addNewToken",function(e){n._addNewTokens([e]),n.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),n.state.isActive&&(Lt("_addNewToken focusing input"),n.setState({tokenInputHasFocus:!0}))}),a()(b()(n),"_valueContainsToken",function(e){return Object(C.some)(n.props.value,function(t){return n._getTokenValue(e)===n._getTokenValue(t)})}),a()(b()(n),"_getTokenValue",function(e){return"object"===typeof e?e.value:e}),a()(b()(n),"_getIndexOfInput",function(){return n.props.value.length-n.state.inputOffsetFromEnd}),n}return g()(t,e),f()(t,[{key:"componentWillReceiveProps",value:function(e){e.disabled&&this.state.isActive&&this.setState({isActive:!1,incompleteTokenValue:""})}},{key:"render",value:function(){var e={ref:"main",className:R()("token-field",{"is-active":this.state.isActive,"is-disabled":this.props.disabled}),tabIndex:"-1"};return this.props.disabled||(e=Object.assign({},e,{onKeyDown:this._onKeyDown,onKeyPress:this._onKeyPress,onFocus:this._onFocus})),s.a.createElement("div",e,s.a.createElement("div",{ref:this.setTokensAndInput,className:"token-field__input-container",tabIndex:"-1",onMouseDown:this._onContainerTouched,onTouchStart:this._onContainerTouched},this._renderTokensAndInput()),s.a.createElement(ht,{match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:this._getMatchingSuggestions(),selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,isExpanded:this.props.isExpanded||this.state.isActive,onHover:this._onSuggestionHovered,onSelect:this._onSuggestionSelected}))}}]),t}(c.PureComponent);a()(xt,"propTypes",{suggestions:Be.a.array,maxSuggestions:Be.a.number,displayTransform:Be.a.func,saveTransform:Be.a.func,onChange:Be.a.func,isBorderless:Be.a.bool,maxLength:Be.a.number,onFocus:Be.a.func,disabled:Be.a.bool,tokenizeOnSpace:Be.a.bool,placeholder:Be.a.string,id:Be.a.string,isExpanded:Be.a.bool,value:function(e){var t=e.value;if(!Array.isArray(t))return new Error("Value prop is expected to be an array.");Object(C.forEach)(t,function(e){if("object"===typeof e&&!("value"in e))return new Error("When using object for value prop, each object is expected to have a 'value' property.")})}}),a()(xt,"defaultProps",{suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),placeholder:"",displayTransform:C.identity,saveTransform:function(e){return e.trim()},onChange:function(){},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,isExpanded:!1}),a()(xt,"initialState",{incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,tokenInputHasFocus:!1});var Dt=xt,Wt=n(677),Ht=function(e){function t(){var e,n;l()(this,t);for(var r=arguments.length,i=new Array(r),o=0;o1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=Oe(e,t);if(!n||!n.methods||!n.methods.currentlyEditingId)return{};var r=We(e,t),i=Object(L.a)(e,r.methodType,t).formSchema,o=Object(C.omit)(n.methods.currentlyEditingChanges,["id","methodType","enabled"]),a=Object(C.mapValues)(o,function(){return!0});return function(e){if(!Object(C.isObject)(e))return{};var t={};return Object.keys(e).forEach(function(n){var r=cn.a.parse(n),i=r;"data"===r[0]&&(i=r.slice(1));var o=t;i.forEach(function(e){o[e]||(o[e]={}),o=o[e]}),o[""]=e[n]}),t}(ln(i,r,a))},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return[t,Oe(e,t)]}),fn=n(128),pn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return Object(C.get)(e,["extensions","woocommerce","sites",t,"shippingClasses"],!1)},hn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return Object(C.isArray)(pn(e,t))},mn=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e),n=pn(e,t);return Object(C.isArray)(n)?n:[]},On=function(e){return s.a.createElement("div",null,e.layout.map(function(t,n){return r=n,s.a.createElement(en,Ue()({},e,{group:e.layout[r],key:r}));var r}))};On.propTypes={siteId:Be.a.number.isRequired,method:Be.a.object.isRequired};var En,bn=Object(_.b)(function(e,t){var n=Object(L.a)(e,t.method.methodType,t.siteId),r=n.storeOptions,i=n.formSchema,o=n.formLayout;return{formData:We(e,t.siteId),shippingClasses:mn(e,t.siteId),errors:dn(e,t.siteId),storeOptions:r,schema:i,layout:o,site:Object(fn.a)(e,t.siteId)}},function(e,t){return{noticeActions:Object(ze.b)({successNotice:tn.d,errorNotice:tn.a},e),formValueActions:{updateField:function(n,r){return e(nn(t.siteId,t.method.id,n,r))}}}})(On),vn=n(731),gn=function(e,t){return{type:K.wb,siteId:e,methodId:t}},_n=n(54),yn=function(e){function t(e){var n;return l()(this,t),n=h()(this,O()(t).call(this,e)),a()(b()(n),"onSave",function(){var e=n.props.translate;n.setState({isSaving:!0}),n.props.saveChanges(function(t){n.setState({isSaving:!1}),t(Object(tn.d)(e("Your changes have been saved."),{duration:4e3}))},function(t,r,i){var o=i.error;n.setState({isSaving:!1}),o&&t(Object(tn.a)(Object(C.isString)(o)?o:e("There was a problem with one or more entries. Please fix the errors below and try saving again.")))})}),a()(b()(n),"renderPlaceholder",function(){return s.a.createElement("div",{className:"settings__placeholder"},s.a.createElement(Jt.a,{heading:" "},s.a.createElement(it.a,{id:"placeholder1",title:"Lorem",value:""}),s.a.createElement(it.a,{id:"placeholder1",title:"Ipsum",value:""})))}),n.state={isSaving:!1},n}return g()(t,e),f()(t,[{key:"render",value:function(){var e=this.props,t=e.siteId,n=e.method,r=e.translate,i=e.hasEdits,o=e.anyErrors,a=e.isLoaded;return s.a.createElement("div",null,s.a.createElement(He.a,{id:"notices",notices:Ve.a.list}),n?s.a.createElement(bn,{method:n,siteId:t}):this.renderPlaceholder(),s.a.createElement(j.a,{className:R()("settings__button-row","card","is-compact")},s.a.createElement(S.a,{isPrimary:!0,className:R()("button"),onClick:this.onSave,isBusy:this.state.isSaving,disabled:this.state.isSaving||!a||o},r("Save changes"))),s.a.createElement(vn.a,{isChanged:i}))}}]),t}(c.Component),Cn=function(e){var t=Oe(e).methods;return!Object(C.isEmpty)(t.currentlyEditingChanges)||!(Object(C.isEmpty)(t.updates)||Object(C.isEmpty)(t.updates[0]))},jn=function(e,t){return function(n,r){if(Cn(r())){var i=Object(w.a)(r()),o=We(r());n(function(e){return function(t,n){var r=We(n(),e);if(Object(C.startsWith)(r.methodType,"wc_services")){var i=Object(C.omit)(r,["id","enabled","methodType"]);if(Object(C.forEach)(i,function(n,i){return t(nn(e,r.id,i,n))}),!Object(C.isEmpty)(dn(n(),e)))return t(Object(tn.a)(Object(y.translate)("There was a problem with one or more entries. Please fix the errors below and try saving again."),{duration:5e3}))}t({type:K.rb,siteId:e})}}(i)),We(r())?n(t):(n(gn(i,o.id)),n(function(e,t,n,r,i,o){return{type:je.Ub,siteId:e,methodId:t,methodType:n,method:r,successAction:i,failureAction:o}}(i,o.id,o.methodType,Object(C.omit)(o,["id","methodType","enabled"]),e,t)))}else n(e)}},Sn=Object(_.b)(function(e){var t=Object(w.a)(e),n=W(e,t)&&hn(e,t);return{siteId:t,isLoaded:n,method:n&&We(e),hasEdits:n&&Cn(e),anyErrors:n&&Object(_n.a)(dn(e))}},function(e){return{saveChanges:function(){return e(jn.apply(void 0,arguments))}}})(Object(y.localize)(yn)),In=(n(13),n(111),function(e,t,n){return{type:je.Qb,siteId:e,methodId:t,data:n}}),Rn=(En={},a()(En,je.Tb,function(e,t){var n=e.siteId,r=e.data;t(In(n,r.methodId,r))}),a()(En,K.Fb,function(e,t){var n=e.siteId,r=e.originatingAction.methodId;t(gn(n,r))}),En),Tn=function(e){var t=e.dispatch;return function(e){return function(n){e(n);var r=Rn[n.type];r&&r(n,t)}}},Nn={};Nn[K.nb]=function(e,t){var n=t.data,r=i()({},e);return n.forEach(function(e){r[e.id]=i()({id:e.id,order:e.order,enabled:e.enabled,methodType:e.method_id},Object(C.mapValues)(e.settings,"value"))}),r},Nn[K.Fb]=function(e,t){var n=t.data,r=t.originatingAction;return n.id?Nn[K.nb](e,{data:[n]}):i()({},e,a()({},r.methodId,i()({},e[r.methodId],{id:r.methodId,methodType:r.methodType},r.method)))},Nn[je.Tb]=function(e,t){var n=t.instanceId,r=t.data;return i()({},e,a()({},n,i()({},e[n],r.formData)))};var Mn,wn=Object(q.b)({},Nn),An=function(e){return 0!==e.id?e:i()({},e,{name:Object(y.translate)("Locations not covered by your other zones")})},kn=Object(q.b)(null,(Mn={},a()(Mn,K.mb,function(e,t){var n=t.zoneId;if(!Object(C.isArray)(e))return e;var r=Object(C.findIndex)(e,{id:n});if(-1===r)return e;var o=i()({},e[r],{methodIds:P.b});return[].concat(N()(e.slice(0,r)),[o],N()(e.slice(r+1)))}),a()(Mn,K.nb,function(e,t){var n=t.zoneId,r=t.data;if(!Object(C.isArray)(e))return e;var o=Object(C.findIndex)(e,{id:n});if(-1===o)return e;var a=i()({},e[o],{methodIds:r.map(function(e){return e.id})});return[].concat(N()(e.slice(0,o)),[a],N()(e.slice(o+1)))}),a()(Mn,K.Ib,function(e,t){var n=t.data,r=t.originatingAction.zone;if(n=An(n),!Object(C.isArray)(e))return e;if("number"!==typeof r.id)return[].concat(N()(e),[i()({},n,{methodIds:[]})]);var o=Object(C.findIndex)(e,{id:r.id});return-1===o?e:[].concat(N()(e.slice(0,o)),[i()({},n,{methodIds:e[o].methodIds})],N()(e.slice(o+1)))}),a()(Mn,K.Z,function(e,t){var n=t.originatingAction.zone;if(!Object(C.isArray)(e))return e;var r=Object(C.findIndex)(e,{id:n.id});return-1===r?e:[].concat(N()(e.slice(0,r)),N()(e.slice(r+1)))}),a()(Mn,K.Fb,function(e,t){var n=t.data,r=t.originatingAction.zoneId;if(!Object(C.isArray)(e))return e;var o=Object(C.findIndex)(e,{id:r});return-1===o?e:-1!==e[o].methodIds.indexOf(n.id)?e:[].concat(N()(e.slice(0,o)),[i()({},e[o],{methodIds:[].concat(N()(e[o].methodIds),[n.id])})],N()(e.slice(o+1)))}),a()(Mn,K.ub,function(e,t){var n=t.originatingAction,r=n.zoneId,o=n.methodId;if(!Object(C.isArray)(e))return e;var a=Object(C.findIndex)(e,{id:r});if(-1===a)return e;var c=e[a].methodIds.indexOf(o);return-1===c?e:[].concat(N()(e.slice(0,a)),[i()({},e[a],{methodIds:[].concat(N()(e[a].methodIds.slice(0,c)),N()(e[a].methodIds.slice(c+1)))})],N()(e.slice(a+1)))}),a()(Mn,K.U,function(){return P.b}),a()(Mn,K.V,function(e,t){return t.data.map(An)}),Mn)),Pn={};Pn[je.Sb]=function(e,t){var n=t.instanceId;return i()({},e,a()({},n,P.b))},Pn[je.Tb]=function(e,t){var n=t.instanceId;return i()({},e,a()({},n,!0))},Pn[K.Fb]=function(e,t){var n=t.data;return Pn[je.Tb](e,{instanceId:n.id})};var Ln=Object(q.b)({},Pn),xn={creates:[],updates:[],deletes:[],currentlyEditingId:null},Dn={};Dn[K.W]=function(e){var t={index:(e.creates||[]).length};return Dn[K.Gb](e,{id:t})},Dn[K.X]=function(e){return Dn[K.Y](i()({},e,{currentlyEditingChanges:{}}))},Dn[K.Y]=function(e){var t=e.currentlyEditingChanges,n=e.currentlyEditingId;if(null===n)return e;if(Object(C.isEmpty)(Object(C.omit)(t,"methods","locations"))&&Object(C.every)(t.methods,C.isEmpty)&&(!t.locations||t.locations.pristine))return i()({},e,{currentlyEditingId:null});var r=Ee({id:n}),o=!1,c=e[r].map(function(e){return Object(C.isEqual)(n,e.id)?(o=!0,i()({},e,t,{methods:Ae(e.methods,t.methods)})):e});return o||c.push(i()({id:n},t)),i()({},e,a()({currentlyEditingId:null},r,c))},Dn[K.ab]=function(e,t){var n=t.name;return null===e.currentlyEditingId?e:i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{name:n})})},Dn[K.Gb]=function(e,t){var n=t.id;return i()({},e,{currentlyEditingId:n,currentlyEditingChanges:{methods:Te,locations:X}})},Dn[K.Hb]=function(e,t){var n=t.id,r=i()({},e,{currentlyEditingId:null}),o=Ee({id:n});return"updates"===o&&(r.deletes=[].concat(N()(e.deletes),[{id:n}])),r[o]=Object(C.reject)(e[o],{id:n}),r},Dn[K.Ib]=function(e,t){var n=t.data;return t.originatingAction.zone.id!==e.currentlyEditingId?e:i()({},e,{currentlyEditingId:n.id,currentlyEditingChanges:Object(C.pick)(e.currentlyEditingChanges,"locations","methods")})},Dn[K.Z]=function(e,t){return t.originatingAction.zone.id!==e.currentlyEditingId?e:i()({},e,{currentlyEditingId:null})},Dn[K.lb]=function(e,t){return t.originatingAction.zoneId!==e.currentlyEditingId?e:i()({},e,{currentlyEditingChanges:i()({},e.currentlyEditingChanges,{locations:X})})};var Wn,Hn=Object(q.b)(xn,Dn),Vn=function(e,t){var n=Hn(e,t);if(null!==n.currentlyEditingId){var r=function(e,t){if(Ne[t.type])return we(e,t);var n=t.methodId,r=t.methodType;if(n&&r&&Re[r]){var o=e.currentlyEditingChanges,a=Re[r](o,t);if(a!==o)return i()({},e,{currentlyEditingChanges:a})}return e}(n.currentlyEditingChanges.methods,t),o=function(e,t){var n=te(e,t);return e.temporaryChanges&&n.temporaryChanges&&e.temporaryChanges!==n.temporaryChanges&&(n.temporaryChanges.pristine=!1),n}(n.currentlyEditingChanges.locations,t);return i()({},n,{currentlyEditingChanges:i()({},n.currentlyEditingChanges,{methods:r,locations:o})})}return n},Gn=n(268),Un=n(404),Fn=function(e){return function(t,n){if(!hn(n(),e)&&!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object(w.a)(e);return P.b===pn(e,t)}(n(),e))return t({type:K.S,siteId:e})}},Bn=Object(q.b)(null,(Wn={},a()(Wn,je.Pb,function(){return P.b}),a()(Wn,je.Qb,function(e,t){return t.data}),Wn)),zn=Object(q.d)("methodId",Bn),qn=n(407),Kn=n(134),Zn={};Zn[K.S]=function(){return P.b},Zn[K.T]=function(e,t){return t.data};var Qn=Object(q.b)({},Zn),Yn=n(45),$n=n(65),Jn=n(131),Xn=a()({},K.S,[Object(Yn.a)({fetch:function(e){var t=e.siteId;return Object($n.a)(t,e).get("products/shipping_classes")},onSuccess:function(e,t){var n=e.siteId,r=t.data;return function(e){e(function(e,t){return{type:K.T,siteId:e,data:t}}(n,r))}},onError:function(e,t){return function(t){t(function(e,t,n){var r=e.siteId,i="query-shipping-classes-retry";return Object(tn.a)(Object(y.translate)("Could not retrieve the shipping classes."),{id:i,button:Object(y.translate)("Try again"),onClick:function(e){e.preventDefault(),n({type:K.S,siteId:r}),n(Object(tn.c)(i))}})}(e,0,t))}},fromApi:Jn.a})]),er=n(152);t.default=function(e){var t=e.methodId,n=e.instanceId;return{getReducer:function(){return Object(q.a)({extensions:Object(q.a)({woocommerce:Object(q.a)({sites:Object(q.a)({1:Object(q.a)({shippingZoneMethods:wn,shippingZones:kn,shippingZoneLocations:function(e){return e||null},shippingMethods:function(e){return e||null},shippingClasses:Qn})}),ui:Object(q.a)({shipping:Object(q.a)({1:Object(q.a)({zones:Vn})})}),woocommerceServices:Object(q.a)({1:Object(q.a)({shippingZoneMethodSettings:Ln,shippingMethodSchemas:zn})})})}),ui:function(e){return e||null},notices:Gn.a})},getInitialState:function(){return{extensions:{woocommerce:{sites:{1:{shippingMethods:[{id:t}],shippingZones:[{id:0,order:0,methodIds:[n]}],shippingZoneLocations:{0:{continent:[],country:[],state:[],postcode:[]}},shippingZoneMethods:a()({},n,{id:n,methodType:t})}},ui:{shipping:{1:{zones:i()({},xn,{currentlyEditingId:0,currentlyEditingChanges:{methods:i()({},Te,{currentlyEditingId:n,currentlyEditingChanges:{}}),locations:X}})}}}}},ui:{selectedSiteId:1}}},getStateForPersisting:function(e){return delete e.notices,e},getInitialActions:function(){return[Object(Un.a)(0,t,n),Fn(0)]},getMiddlewares:function(){return[Tn,Object(Kn.b)(Object(er.a)(qn.a,Xn))]},getStateKey:function(){return"wcs-settings-".concat(t,"-").concat(n)},View:function(){return s.a.createElement(Sn,null)}}}},94:function(e,t,n){"use strict";var r=n(35);t.a=r.a}}]);