_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[43],{YRLc:function(e,a,n){"use strict";n.d(a,"b",(function(){return w}));var t=n("KQm4"),r=n("rePB"),l=n("wx14"),o=n("Ff2n"),i=n("eHHv"),c=n("DI+Y"),u=n("q1tI"),s=n.n(u),g=n("ikXu"),d=n("QetY"),f=n("D1pA"),b=n("RotF"),p=n.n(b),h=n("YFqc"),O=n.n(h),m=s.a.createElement;function j(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function v(e){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?j(Object(n),!0).forEach((function(a){Object(r.a)(e,a,n[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))}))}return e}var w=function(e){var a=e.query,n=e.queryName,l=e.itemsPerPage,u=void 0===l?5:l;return Object(i.a)(Object(c.graphql)(a,{options:function(e){var a=e.queryOptions,n=Object(o.a)(e,["queryOptions"]);return v({variables:v({offset:0,limit:u},n)},a)},props:function(e){var a=e.data,l=a.loading,i=a.fetchMore,c=a.stopPolling,u=Object(o.a)(a,["loading","fetchMore","stopPolling"]);return{loading:l,items:u[n],loadMoreEntries:function(){return c(),i({variables:{offset:u[n].length},updateQuery:function(e,a){var l=a.fetchMoreResult;return l?v(v({},e),{},Object(r.a)({},n,[].concat(Object(t.a)(e[n]),Object(t.a)(l[n])))):e}})}}}}))};a.a=function(e){var a=e.items,n=e.cols,t=void 0===n?4:n,r=e.rowRenderer,i=e.createPath,c=e.searchComponent,u=(e.data,e.children),s=e.loadMoreEntries,b=(e.loading,e.limit),h=Object(o.a)(e,["items","cols","rowRenderer","createPath","searchComponent","data","children","loadMoreEntries","loading","limit"]);return m(g.a,Object(l.a)({celled:!0},h),m(g.a.Header,null,m(g.a.Row,null,m(g.a.HeaderCell,{colSpan:t},c&&c,i&&m(O.a,{href:i},m(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},m(f.a,{name:"plus"}),"Add")))),u),a&&m(p.a,{pageStart:0,element:"tbody",loadMore:s,hasMore:null===b||void 0===b||b},a.map(r)),m(g.a.Footer,{fullWidth:!0},m(g.a.Row,null,m(g.a.HeaderCell,{colSpan:t},i&&m(O.a,{href:i},m(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},m(f.a,{name:"plus"})," Add"))))))}},hkxl:function(e,a,n){"use strict";n.r(a);var t=n("wx14"),r=n("q1tI"),l=n.n(r),o=n("yE/o"),i=n("gaPq"),c=n("h4VS"),u=n("Ff2n"),s=n("eHHv"),g=n("lTCR"),d=n.n(g),f=n("DI+Y"),b=n("ikXu"),p=n("D1pA"),h=n("QetY"),O=n("YFqc"),m=n.n(O),j=n("YRLc"),v=l.a.createElement;function w(){var e=Object(c.a)(["\n      mutation changeBaseLanguage($languageId: ID!) {\n        setBaseLanguage(languageId: $languageId) {\n          _id\n          isBase\n        }\n      }\n    "]);return w=function(){return e},e}function y(){var e=Object(c.a)(["\n      query languages($offset: Int, $limit: Int) {\n        languages(offset: $offset, limit: $limit, includeInactive: true) {\n          _id\n          isoCode\n          isActive\n          isBase\n          name\n        }\n      }\n    "]);return y=function(){return e},e}var P=Object(s.a)(Object(j.b)({queryName:"languages",query:d()(y())}),Object(f.graphql)(d()(w()),{options:{refetchQueries:["languages"]}}),Object(s.f)({changeBaseLanguage:function(e){var a=e.mutate;return function(e,n){return a({variables:{languageId:n.name}})}}}),s.e)((function(e){var a=e.changeBaseLanguage,n=Object(u.a)(e,["changeBaseLanguage"]);return v(j.a,Object(t.a)({},n,{cols:3,createPath:"/languages/new",rowRenderer:function(e){return v(b.a.Row,{key:e._id},v(b.a.Cell,null,v(m.a,{href:"/languages/edit?_id=".concat(e._id)},v("a",{href:"/languages/edit?_id=".concat(e._id)},e.isoCode))),v(b.a.Cell,null,e.isActive&&v(p.a,{color:"green",name:"checkmark",size:"large"})),v(b.a.Cell,null,e.isBase?v("b",null,"Base language"):v(h.a,{basic:!0,name:e._id,onClick:a},"Set as base language")))}}),v(b.a.Row,null,v(b.a.HeaderCell,null,"Name"),v(b.a.HeaderCell,null,"Activated?"),v(b.a.HeaderCell,null)))})),_=n("PZVx"),q=l.a.createElement;a.default=Object(_.a)((function(e){var a=Object(t.a)({},e);return q(i.a,a,q(o.a,null,q("h2",null,"Languages"),q(P,null)))}))},nB9K:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/languages",function(){return n("hkxl")}])}},[["nB9K",0,2,3,1,4,5,8]]]);