(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{KQm4:function(e,r,n){"use strict";function t(e){return function(e){if(Array.isArray(e)){for(var r=0,n=new Array(e.length);r<e.length;r++)n[r]=e[r];return n}}(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")}()}n.d(r,"a",(function(){return t}))},P7gH:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/warehousing-providers/new",function(){return n("g5SU")}])},g5SU:function(e,r,n){"use strict";n.r(r);var t=n("q1tI"),o=n.n(t),a=n("yE/o"),i=n("gaPq"),u=n("rePB"),c=n("wx14"),p=n("KQm4"),s=n("h4VS"),d=n("Ff2n"),l=n("eHHv"),v=n("lTCR"),f=n.n(v),b=n("nOHt"),y=n("0dmp"),g=n("hePV"),h=n.n(g),P=n("gmoh"),O=n.n(P),w=n("fjVX"),j=n.n(w),m=n("oB+O"),T=n.n(m),S=n("7zkD"),_=n("PaXs"),W=o.a.createElement;function A(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),n.push.apply(n,t)}return n}function E(){var e=Object(s.a)(["\n      mutation create($warehousingProvider: CreateProviderInput!) {\n        createWarehousingProvider(warehousingProvider: $warehousingProvider) {\n          _id\n        }\n      }\n    "]);return E=function(){return e},e}function C(){var e=Object(s.a)(['\n    query getWarehousingProviderType($providerType: WarehousingProviderType!) {\n      warehousingProviderType: __type(name: "WarehousingProviderType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n      warehousingInterfaces(type: $providerType) {\n        _id\n        value: _id\n        label\n      }\n    }\n  ']);return C=function(){return e},e}var H=Object(l.a)(b.withRouter,Object(l.h)("providerType","updateProviderType","PHYSICAL"),Object(y.a)(f()(C())),Object(y.a)(f()(E()),{name:"createWarehousingProvider",options:{refetchQueries:["warehousingProviders"]}}),Object(S.a)((function(e){var r=e.providerType,n=e.data,t=(n=void 0===n?{}:n).warehousingProviderType,o=void 0===t?{options:[]}:t,a=n.warehousingInterfaces,i=void 0===a?[]:a;return{type:{type:String,optional:!1,label:"Type",defaultValue:r,uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(p.a)(o.options))}},adapterKey:{type:String,optional:!1,label:"Adapter",uniforms:{options:[{label:"Choose Adapter",value:null}].concat(Object(p.a)(i))}}}})),Object(l.f)({onSubmitSuccess:function(e){var r=e.router;return function(e){var n=e.data.createWarehousingProvider;r.replace({pathname:"/warehousing-providers/edit",query:{_id:n._id}})}},onSubmit:function(e){var r=e.createWarehousingProvider,n=e.schema;return function(e){var t=Object(c.a)({},e);return r({variables:{warehousingProvider:n.clean(t)}})}}}),_.a,Object(l.d)((function(e){e.createWarehousingProvider;return function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?A(Object(n),!0).forEach((function(r){Object(u.a)(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}({},Object(d.a)(e,["createWarehousingProvider"]))})))((function(e){var r=e.providerType,n=e.updateProviderType,t=Object(d.a)(e,["providerType","updateProviderType"]);return W(T.a,t,W(h.a,{name:"type",onChange:n}),r&&W(h.a,{name:"adapterKey"}),W(j.a,null),W(O.a,{value:"Add warehousing provider",className:"primary"}))})),I=n("PZVx"),V=o.a.createElement;r.default=Object(I.a)((function(e){return V(i.a,e,V(a.a,null,V("p",null,"New Warehousing"),V(H,null)))}))}},[["P7gH",0,2,5,1,3,4,6]]]);