(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{B5hm:function(e,t,n){"use strict";n.r(t);var r=n("Ff2n"),a=n("q1tI"),o=n.n(a),c=n("nOHt"),i=n("eHHv"),u=n("yE/o"),l=n("gaPq"),s=n("rePB"),f=n("wx14"),p=n("KQm4"),b=n("h4VS"),O=n("lTCR"),m=n.n(O),y=n("0dmp"),j=n("hePV"),v=n.n(j),d=n("gmoh"),w=n.n(d),h=n("fjVX"),S=n.n(h),g=n("oB+O"),P=n.n(g),_=n("7zkD"),E=n("PaXs"),T=o.a.createElement;function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function A(){var e=Object(b.a)(["\n    mutation create($filter: CreateFilterInput!) {\n      createFilter(filter: $filter) {\n        _id\n      }\n    }\n  "]);return A=function(){return e},e}function F(){var e=Object(b.a)(['\n    query getFilterTypes {\n      uniforms: __type(name: "FilterType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n    }\n  ']);return F=function(){return e},e}var D=Object(i.a)(Object(y.a)(m()(F())),Object(y.a)(m()(A())),Object(_.a)((function(e){var t=e.data,n=(t=void 0===t?{}:t).uniforms,r=void 0===n?{options:[]}:n;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(p.a)(r.options))}}}})),Object(i.f)({onSubmitSuccess:function(e){var t=e.onSuccess;return function(e){var n=e.data.createFilter;t(n._id)}},onSubmit:function(e){var t=e.mutate,n=e.schema;return function(e){var r=Object(f.a)({},e);return t({variables:{filter:n.clean(r)}})}}}),E.a,Object(i.d)((function(e){e.onSuccess,e.mutate;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){Object(s.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},Object(r.a)(e,["onSuccess","mutate"]))})),i.e)((function(e){return T(P.a,e,T(v.a,{name:"title"}),T(v.a,{name:"key"}),T(v.a,{name:"type"}),T(S.a,null),T(w.a,{value:"Add filter",className:"primary"}))})),N=n("PZVx"),V=o.a.createElement;t.default=Object(N.a)(Object(i.a)(c.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,n=Object(r.a)(e,["onSuccess"]);return V(l.a,n,V(u.a,null,V("p",null,"New filter"),V(D,{onSuccess:t})))})))},KQm4:function(e,t,n){"use strict";function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];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(t,"a",(function(){return r}))},hUop:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters/new",function(){return n("B5hm")}])}},[["hUop",0,2,5,1,3,4,6]]]);