(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{BsWD:function(e,r,n){"use strict";n.d(r,"a",(function(){return o}));var t=n("a3WO");function o(e,r){if(e){if("string"===typeof e)return Object(t.a)(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(t.a)(e,r):void 0}}},KQm4:function(e,r,n){"use strict";n.d(r,"a",(function(){return a}));var t=n("a3WO");var o=n("BsWD");function a(e){return function(e){if(Array.isArray(e))return Object(t.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||Object(o.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.")}()}},P7gH:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/warehousing-providers/new",function(){return n("g5SU")}])},a3WO:function(e,r,n){"use strict";function t(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}n.d(r,"a",(function(){return t}))},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"),O=n("hePV"),g=n.n(O),h=n("gmoh"),P=n.n(h),j=n("fjVX"),m=n.n(j),w=n("oB+O"),T=n.n(w),S=n("7zkD"),W=n("PaXs"),_=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 I(){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 I=function(){return e},e}var C=Object(l.a)(b.withRouter,Object(l.h)("providerType","updateProviderType","PHYSICAL"),Object(y.a)(f()(I())),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)}})}}}),W.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 _(T.a,t,_(g.a,{name:"type",onChange:n}),r&&_(g.a,{name:"adapterKey"}),_(m.a,null),_(P.a,{value:"Add warehousing provider",className:"primary"}))})),D=n("PZVx"),H=o.a.createElement;r.default=Object(D.a)((function(e){return H(i.a,e,H(a.a,null,H("p",null,"New Warehousing"),H(C,null)))}))}},[["P7gH",0,2,5,1,3,4,6]]]);