(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{P7gH:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/warehousing-providers/new",function(){var e=n("g5SU");return{page:e.default||e}}])},g5SU:function(e,r,n){"use strict";n.r(r);var a=n("q1tI"),t=n.n(a),o=n("yE/o"),i=n("gaPq"),u=n("zrwo"),c=n("kOwS"),d=n("dfwq"),p=n("rt45"),s=n("qNsG"),l=n("eHHv"),v=n("lTCR"),h=n.n(v),g=n("nOHt"),P=n("4KRT"),f=n("hePV"),w=n.n(f),y=n("gmoh"),b=n.n(y),m=n("fjVX"),T=n.n(m),O=n("oB+O"),j=n.n(O),_=n("7zkD"),E=n("PaXs");function W(){var e=Object(p.a)(["\n      mutation create($warehousingProvider: CreateProviderInput!) {\n        createWarehousingProvider(warehousingProvider: $warehousingProvider) {\n          _id\n        }\n      }\n    "]);return W=function(){return e},e}function S(){var e=Object(p.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 S=function(){return e},e}var q=Object(l.a)(g.withRouter,Object(l.h)("providerType","updateProviderType","PHYSICAL"),Object(P.c)(h()(S())),Object(P.c)(h()(W()),{name:"createWarehousingProvider",options:{refetchQueries:["warehousingProviders"]}}),Object(_.a)(function(e){var r=e.providerType,n=e.data,a=(n=void 0===n?{}:n).warehousingProviderType,t=void 0===a?{options:[]}:a,o=n.warehousingInterfaces,i=void 0===o?[]:o;return{type:{type:String,optional:!1,label:"Type",defaultValue:r,uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(d.default)(t.options))}},adapterKey:{type:String,optional:!1,label:"Adapter",uniforms:{options:[{label:"Choose Adapter",value:null}].concat(Object(d.default)(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 a=Object(c.a)({},e);return r({variables:{warehousingProvider:n.clean(a)}})}}}),E.a,Object(l.d)(function(e){e.createWarehousingProvider;var r=Object(s.a)(e,["createWarehousingProvider"]);return Object(u.a)({},r)}))(function(e){var r=e.providerType,n=e.updateProviderType,a=Object(s.a)(e,["providerType","updateProviderType"]);return t.a.createElement(j.a,a,t.a.createElement(w.a,{name:"type",onChange:n}),r&&t.a.createElement(w.a,{name:"adapterKey"}),t.a.createElement(T.a,null),t.a.createElement(b.a,{value:"Add warehousing provider",className:"primary"}))}),C=n("PZVx");r.default=Object(C.a)(function(e){return t.a.createElement(i.a,e,t.a.createElement(o.a,null,t.a.createElement("p",null,"New Warehousing"),t.a.createElement(q,null)))})}},[["P7gH",1,0]]]);