_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[60],{"5+ye":function(e,t,n){"use strict";n.r(t);var r=n("wx14"),a=n("q1tI"),l=n.n(a),o=n("yE/o"),i=n("gaPq"),s=n("h4VS"),u=n("Ff2n"),c=n("lTCR"),d=n.n(c),p=n("ikXu"),b=n("YFqc"),f=n.n(b),m=n("YRLc"),h=l.a.createElement;function O(){var e=Object(s.a)(["\n    query subscriptions($offset: Int, $limit: Int) {\n      subscriptions(offset: $offset, limit: $limit) {\n        _id\n        status\n        expires\n        subscriptionNumber\n        user {\n          _id\n          name\n        }\n        status\n      }\n    }\n  "]);return O=function(){return e},e}var w=Object(m.b)({queryName:"subscriptions",query:d()(O())})((function(e){e.isShowCarts,e.toggleShowCarts,e.loading,e.updateHasMore,e.setShowCarts;var t=Object(u.a)(e,["isShowCarts","toggleShowCarts","loading","updateHasMore","setShowCarts"]);return h(m.a,Object(r.a)({},t,{cols:5,createPath:null,rowRenderer:function(e){return h(p.a.Row,{key:e._id},h(p.a.Cell,null,h(f.a,{href:"/subscriptions/view?_id=".concat(e._id)},h("a",{href:"/subscriptions/view?_id=".concat(e._id)},e.subscriptionNumber?h(l.a.Fragment,null,h("b",null,e.subscriptionNumber),h("small",null,"\xa0(",e._id,")")):h(l.a.Fragment,null,h("b",null,"Subscription"),h("small",null,"\xa0(",e._id,")"))))),h(p.a.Cell,null,e.user&&(e.user.name||e.user._id)),h(p.a.Cell,null,e.expires&&new Date(e.expires).toLocaleDateString()),h(p.a.Cell,null,e.status))}}),h(p.a.Row,null,h(p.a.HeaderCell,null,"Subscription #"),h(p.a.HeaderCell,null,"User"),h(p.a.HeaderCell,null,"Expires"),h(p.a.HeaderCell,null,"Status")))})),g=n("PZVx"),j=l.a.createElement;t.default=Object(g.a)((function(e){var t=Object(r.a)({},e);return j(i.a,t,j(o.a,null,j("h2",null,"Subscriptions"),j(w,null)))}))},P7N4:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/subscriptions",function(){return n("5+ye")}])},YRLc:function(e,t,n){"use strict";n.d(t,"b",(function(){return y}));var r=n("KQm4"),a=n("rePB"),l=n("wx14"),o=n("Ff2n"),i=n("eHHv"),s=n("DI+Y"),u=n("q1tI"),c=n.n(u),d=n("ikXu"),p=n("QetY"),b=n("D1pA"),f=n("RotF"),m=n.n(f),h=n("YFqc"),O=n.n(h),w=c.a.createElement;function g(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 j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){Object(a.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var y=function(e){var t=e.query,n=e.queryName,l=e.itemsPerPage,u=void 0===l?5:l;return Object(i.a)(Object(s.graphql)(t,{options:function(e){var t=e.queryOptions,n=Object(o.a)(e,["queryOptions"]);return j({variables:j({offset:0,limit:u},n)},t)},props:function(e){var t=e.data,l=t.loading,i=t.fetchMore,s=t.stopPolling,u=Object(o.a)(t,["loading","fetchMore","stopPolling"]);return{loading:l,items:u[n],loadMoreEntries:function(){return s(),i({variables:{offset:u[n].length},updateQuery:function(e,t){var l=t.fetchMoreResult;return l?j(j({},e),{},Object(a.a)({},n,[].concat(Object(r.a)(e[n]),Object(r.a)(l[n])))):e}})}}}}))};t.a=function(e){var t=e.items,n=e.cols,r=void 0===n?4:n,a=e.rowRenderer,i=e.createPath,s=e.searchComponent,u=(e.data,e.children),c=e.loadMoreEntries,f=(e.loading,e.limit),h=Object(o.a)(e,["items","cols","rowRenderer","createPath","searchComponent","data","children","loadMoreEntries","loading","limit"]);return w(d.a,Object(l.a)({celled:!0},h),w(d.a.Header,null,w(d.a.Row,null,w(d.a.HeaderCell,{colSpan:r},s&&s,i&&w(O.a,{href:i},w(p.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},w(b.a,{name:"plus"}),"Add")))),u),t&&w(m.a,{pageStart:0,element:"tbody",loadMore:c,hasMore:null===f||void 0===f||f},t.map(a)),w(d.a.Footer,{fullWidth:!0},w(d.a.Row,null,w(d.a.HeaderCell,{colSpan:r},i&&w(O.a,{href:i},w(p.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},w(b.a,{name:"plus"})," Add"))))))}}},[["P7N4",0,2,3,1,4,5,8]]]);