(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{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";function n(e){return function(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t.d(r,"a",(function(){return n}))},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"),v=t("Ff2n"),d=t("eHHv"),y=t("lTCR"),f=t.n(y),s=t("nOHt"),b=t("0dmp"),O=t("hePV"),P=t.n(O),j=t("gmoh"),m=t.n(j),w=t("fjVX"),h=t.n(w),T=t("oB+O"),D=t.n(T),g=t("7zkD"),_=t("PaXs"),S=i.a.createElement;function A(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 E(){var e=Object(p.a)(["\n      mutation create($deliveryProvider: CreateProviderInput!) {\n        createDeliveryProvider(deliveryProvider: $deliveryProvider) {\n          _id\n        }\n      }\n    "]);return E=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 V=Object(d.a)(s.withRouter,Object(d.h)("providerType","updateProviderType","SHIPPING"),Object(b.a)(f()(I())),Object(b.a)(f()(E()),{name:"createDeliveryProvider",options:{refetchQueries:["deliveryProviders"]}}),Object(g.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(d.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(d.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?A(Object(t),!0).forEach((function(r){Object(c.a)(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):A(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}({},Object(v.a)(e,["createDeliveryProvider"]))})))((function(e){var r=e.providerType,t=e.updateProviderType,n=Object(v.a)(e,["providerType","updateProviderType"]);return S(D.a,n,S(P.a,{name:"type",onChange:t}),r&&S(P.a,{name:"adapterKey"}),S(h.a,null),S(m.a,{value:"Add Delivery provider",className:"primary"}))})),X=t("PZVx"),C=i.a.createElement;r.default=Object(X.a)((function(e){return C(a.a,e,C(o.a,null,C("p",null,"New Delivery"),C(V,null)))}))}},[["F0Rd",0,2,5,1,3,4,6]]]);