(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{Gy1X:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),a=n.n(r),o=n("yE/o"),i=n("gaPq"),c=n("h4VS"),l=n("wx14"),u=n("Ff2n"),s=n("eHHv"),d=n("lTCR"),f=n.n(d),p=n("0dmp"),h=n("ikXu"),b=n("D1pA"),O=n("QetY"),m=n("YFqc"),y=n.n(m),v=n("YRLc"),j=a.a.createElement;function g(){var e=Object(c.a)(["\n      mutation changeBaseCountry($countryId: ID!) {\n        setBaseCountry(countryId: $countryId) {\n          _id\n          isBase\n        }\n      }\n    "]);return g=function(){return e},e}function w(){var e=Object(c.a)(["\n      query countries($limit: Int, $offset: Int) {\n        countries(limit: $limit, offset: $offset, includeInactive: true) {\n          _id\n          isoCode\n          isActive\n          isBase\n          name\n        }\n      }\n    "]);return w=function(){return e},e}var M=Object(s.a)(Object(v.b)({queryName:"countries",query:f()(w())}),Object(p.a)(f()(g()),{options:{refetchQueries:["countries"]}}),Object(s.f)({changeBaseCountry:function(e){var t=e.mutate;return function(e,n){return t({variables:{countryId:n.name}})}}}),s.e)((function(e){var t=e.changeBaseCountry,n=Object(u.a)(e,["changeBaseCountry"]);return j(v.a,Object(l.a)({},n,{cols:3,createPath:"/countries/new",rowRenderer:function(e){return j(h.a.Row,{key:e._id},j(h.a.Cell,null,j(y.a,{href:"/countries/edit?_id=".concat(e._id)},j("a",{href:"/countries/edit?_id=".concat(e._id)},e.isoCode))),j(h.a.Cell,null,e.isActive&&j(b.a,{color:"green",name:"checkmark",size:"large"})),j(h.a.Cell,null,e.isBase?j("b",null,"Basisland"):j(O.a,{basic:!0,name:e._id,onClick:t},"Als Basisland festlegen")))}}),j(h.a.Row,null,j(h.a.HeaderCell,null,"Name"),j(h.a.HeaderCell,null,"Active?"),j(h.a.HeaderCell,null,"Basisland")))})),P=n("PZVx"),C=a.a.createElement;t.default=Object(P.a)((function(e){return C(i.a,e,C(o.a,null,C("h2",null,"Countries"),C(M,null)))}))},YRLc:function(e,t,n){"use strict";n.d(t,"b",(function(){return w}));var r=n("KQm4"),a=n("rePB"),o=n("wx14"),i=n("Ff2n"),c=n("eHHv"),l=n("0dmp"),u=n("q1tI"),s=n.n(u),d=n("ikXu"),f=n("QetY"),p=n("D1pA"),h=n("NrgV"),b=n("RotF"),O=n.n(b),m=n("YFqc"),y=n.n(m),v=s.a.createElement;function j(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 g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.items,n=e.cols,r=void 0===n?4:n,a=e.rowRenderer,c=e.createPath,l=(e.data,e.children),u=e.loadMoreEntries,s=(e.updateHasMore,e.hasMore),b=(e.loading,Object(i.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","updateHasMore","hasMore","loading"]));return v(d.a,Object(o.a)({celled:!0},b),v(d.a.Header,null,v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:r},c&&v(y.a,{href:c},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},v(p.a,{name:"plus"}),"Add")))),l),t&&v(O.a,{pageStart:0,element:"tbody",loadMore:u,hasMore:s,loader:v(d.a.Row,null,v(d.a.Cell,{colSpan:r},v(h.a,{active:!0,inline:"centered"})))},t.map(a)),v(d.a.Footer,{fullWidth:!0},v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:r},c&&v(y.a,{href:c},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:c},v(p.a,{name:"plus"})," Add"))))))},Array.prototype.diff=function(e){return this.filter((function(t){return-1!==e.indexOf(t)}))};var w=function(e){var t=e.query,n=e.queryName,a=e.queryOptions,o=e.itemsPerPage,u=void 0===o?5:o;return Object(c.a)(Object(c.h)("hasMore","updateHasMore",!0),Object(l.a)(t,{options:function(e){e.hasMore,e.updateHasMore;var t=Object(i.a)(e,["hasMore","updateHasMore"]);return g({variables:g({offset:0,limit:u},t)},a)},props:function(e){var t=e.data,a=t.loading,o=t.fetchMore,c=Object(i.a)(t,["loading","fetchMore"]),l=e.ownProps,s=l.updateHasMore,d=l.hasMore;return{loading:a,hasMore:!(c[n]&&u>c[n].length)&&d,items:c[n],loadMoreEntries:function(){return o({variables:{offset:Math.floor(c[n].length/u)*u,limit:u},updateQuery:function(e,t){var a=t.fetchMoreResult;if(!a||0===a[n].length)return s(!1),e;var o=e[n].map((function(e){return e._id})),i=a[n].filter((function(e){return-1===o.indexOf(e._id)}));if(0===i.length)return s(!1),e;var c={};return c[n]=[].concat(Object(r.a)(e[n]),Object(r.a)(i)),g({},e,{},c)}})}}}}))}},cVFh:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/countries",function(){return n("Gy1X")}])}},[["cVFh",0,2,5,1,3,4,7]]]);