_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[40],{B5hm:function(e,t,r){"use strict";r.r(t);var n=r("rePB"),c=r("nKUr"),o=r("Ff2n"),a=(r("q1tI"),r("20a2")),i=r("eHHv"),u=r("yE/o"),s=r("gaPq"),b=r("wx14"),f=r("KQm4"),l=r("h4VS"),p=r("lTCR"),O=r.n(p),j=r("DI+Y"),y=r("hePV"),m=r.n(y),d=r("gmoh"),v=r.n(d),h=r("fjVX"),w=r.n(h),g=r("oB+O"),P=r.n(g),S=r("7zkD"),_=r("PaXs");function x(){var e=Object(l.a)(["\n    mutation create($filter: CreateFilterInput!) {\n      createFilter(filter: $filter) {\n        _id\n      }\n    }\n  "]);return x=function(){return e},e}function D(){var e=Object(l.a)(['\n    query getFilterTypes {\n      uniforms: __type(name: "FilterType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n    }\n  ']);return D=function(){return e},e}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var N=Object(i.a)(Object(j.graphql)(O()(D())),Object(j.graphql)(O()(x())),Object(S.a)((function(e){var t=e.data,r=(t=void 0===t?{}:t).uniforms,n=void 0===r?{options:[]}:r;return{title:{type:String,optional:!1,label:"Name"},key:{type:String,optional:!1,label:"Key"},type:{type:String,optional:!1,label:"Type",uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(f.a)(n.options))}}}})),Object(i.f)({onSubmitSuccess:function(e){var t=e.onSuccess;return function(e){var r=e.data.createFilter;t(r._id)}},onSubmit:function(e){var t=e.mutate,r=e.schema;return function(e){var n=Object(b.a)({},e);return t({variables:{filter:r.clean(n)}})}}}),_.a,Object(i.d)((function(e){e.onSuccess,e.mutate;return A({},Object(o.a)(e,["onSuccess","mutate"]))})),i.e)((function(e){return Object(c.jsxs)(P.a,A(A({},e),{},{children:[Object(c.jsx)(m.a,{name:"title"}),Object(c.jsx)(m.a,{name:"key"}),Object(c.jsx)(m.a,{name:"type"}),Object(c.jsx)(w.a,{}),Object(c.jsx)(v.a,{value:"Add filter",className:"primary"})]}))})),T=r("PZVx");function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){Object(n.a)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t.default=Object(T.a)(Object(i.a)(a.withRouter,Object(i.f)({onSuccess:function(e){var t=e.router;return function(e){t.push({pathname:"/filters/edit",query:{_id:e}})}}}))((function(e){var t=e.onSuccess,r=Object(o.a)(e,["onSuccess"]);return Object(c.jsx)(s.a,q(q({},r),{},{children:Object(c.jsxs)(u.a,{children:[Object(c.jsx)("p",{children:"New filter"}),Object(c.jsx)(N,{onSuccess:t})]})}))})))},BsWD:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r("a3WO");function c(e,t){if(e){if("string"===typeof e)return Object(n.a)(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Object(n.a)(e,t):void 0}}},KQm4:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r("a3WO");var c=r("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(c.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.")}()}},a3WO:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}r.d(t,"a",(function(){return n}))},hUop:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters/new",function(){return r("B5hm")}])}},[["hUop",0,2,3,1,4,5,6,7]]]);