_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[36],{BsWD:function(e,r,t){"use strict";t.d(r,"a",(function(){return i}));var n=t("a3WO");function i(e,r){if(e){if("string"===typeof e)return Object(n.a)(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Object(n.a)(e,r):void 0}}},F0Rd:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/delivery-providers/new",function(){return t("XfjD")}])},KQm4:function(e,r,t){"use strict";t.d(r,"a",(function(){return o}));var n=t("a3WO");var i=t("BsWD");function o(e){return function(e){if(Array.isArray(e))return Object(n.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(i.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},XfjD:function(e,r,t){"use strict";t.r(r);var n=t("q1tI"),i=t.n(n),o=t("yE/o"),a=t("gaPq"),c=t("rePB"),u=t("wx14"),l=t("KQm4"),p=t("h4VS"),d=t("Ff2n"),v=t("eHHv"),y=t("lTCR"),f=t.n(y),s=t("nOHt"),b=t("DI+Y"),O=t("hePV"),j=t.n(O),P=t("gmoh"),m=t.n(P),h=t("fjVX"),w=t.n(h),D=t("oB+O"),g=t.n(D),T=t("7zkD"),_=t("PaXs"),S=i.a.createElement;function E(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(){var e=Object(p.a)(["\n      mutation create($deliveryProvider: CreateProviderInput!) {\n        createDeliveryProvider(deliveryProvider: $deliveryProvider) {\n          _id\n        }\n      }\n    "]);return A=function(){return e},e}function I(){var e=Object(p.a)(['\n    query getDeliveryProviderType($providerType: DeliveryProviderType!) {\n      deliveryProviderType: __type(name: "DeliveryProviderType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n      deliveryInterfaces(type: $providerType) {\n        _id\n        value: _id\n        label\n      }\n    }\n  ']);return I=function(){return e},e}var N=Object(v.a)(s.withRouter,Object(v.h)("providerType","updateProviderType","SHIPPING"),Object(b.graphql)(f()(I())),Object(b.graphql)(f()(A()),{name:"createDeliveryProvider",options:{refetchQueries:["deliveryProviders"]}}),Object(T.a)((function(e){var r=e.providerType,t=e.data,n=(t=void 0===t?{}:t).deliveryProviderType,i=void 0===n?{options:[]}:n,o=t.deliveryInterfaces,a=void 0===o?[]:o;return{type:{type:String,optional:!1,label:"Type",defaultValue:r,uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(l.a)(i.options))}},adapterKey:{type:String,optional:!1,label:"Adapter",uniforms:{options:[{label:"Choose Adapter",value:null}].concat(Object(l.a)(a))}}}})),Object(v.f)({onSubmitSuccess:function(e){var r=e.router;return function(e){var t=e.data.createDeliveryProvider;r.replace({pathname:"/delivery-providers/edit",query:{_id:t._id}})}},onSubmit:function(e){var r=e.createDeliveryProvider,t=e.schema;return function(e){var n=Object(u.a)({},e);return r({variables:{deliveryProvider:t.clean(n)}})}}}),_.a,Object(v.d)((function(e){e.createDeliveryProvider;return function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?E(Object(t),!0).forEach((function(r){Object(c.a)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):E(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({},Object(d.a)(e,["createDeliveryProvider"]))})))((function(e){var r=e.providerType,t=e.updateProviderType,n=Object(d.a)(e,["providerType","updateProviderType"]);return S(g.a,n,S(j.a,{name:"type",onChange:t}),r&&S(j.a,{name:"adapterKey"}),S(w.a,null),S(m.a,{value:"Add Delivery provider",className:"primary"}))})),q=t("PZVx"),C=i.a.createElement;r.default=Object(q.a)((function(e){return C(a.a,e,C(o.a,null,C("p",null,"New Delivery"),C(N,null)))}))},a3WO:function(e,r,t){"use strict";function n(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}t.d(r,"a",(function(){return n}))}},[["F0Rd",0,2,3,1,4,5,6,7]]]);