1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[405],{6043:function(e,n,t){"use strict";const r=t(7294).createContext(void 0);n.Z=r},7579:function(e,n,t){"use strict";var r;t.d(n,{Z:function(){return u}});var o=t(7294);let c=0;const i=(r||(r=t.t(o,2))).useId;function u(e){if(void 0!==i){const n=i();return null!=e?e:n}return function(e){const[n,t]=o.useState(e),r=e||n;return o.useEffect((()=>{null==n&&(c+=1,t(`mui-${c}`))}),[n]),r}(e)}},5728:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return t(7866)}])},7866:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return k}});var r=t(7568),o=t(1799);function c(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})),e}var i=t(603),u=t(7297),s=t(655),a=t(5893),l=(t(1664),t(8100)),f=(t(8687),t(2505)),p=(t(6707),t(461)),d=t(8872),h=t(8665),b=t(4607),g=t(911),m=t(1163),x=t(7298),v=t(5675),w=t.n(v),_=t(9249),j=(t(1444),t(7294)),y=t(9189);function Z(){var e=(0,u.Z)(["\n margin: 0 auto;\n width: 100%;\n max-width: 400px;\n padding-top: 60px;\n min-height: calc(100vh - 60px);\n @media (max-width: 768px) {\n max-width: 100%;\n }\n "]);return Z=function(){return e},e}var k=function(){var e=(0,m.useRouter)(),n=(0,y.Z)(),t=(n.getMe,n.getUser),u=(0,i.Z)((0,p.Z)(["fauna_token"]),3),v=u[0],k=(u[1],u[2],(0,x.Z)()),O=k.deleteATodo,N=k.blockFeature,P=k.getPrivateData,C=k.getPublicData,E=k.toggleTodo,D=(0,l.ZP)({},(0,r.Z)((function(){var e,n;return(0,s.__generator)(this,(function(i){switch(i.label){case 0:return v.fauna_token?[4,P({token:v.fauna_token})]:[3,3];case 1:return e=i.sent(),[4,Promise.all(e.map(function(){var e=(0,r.Z)((function(e){var n,r;return(0,s.__generator)(this,(function(i){switch(i.label){case 0:return n=[(0,o.Z)({},e)],r={},[4,t(e.owner.email)];case 1:return[2,c.apply(void 0,n.concat((r.owner=i.sent(),r)))]}}))}));return function(n){return e.apply(this,arguments)}}()))];case 2:case 5:return[2,i.sent()];case 3:return[4,C({token:v.fauna_token})];case 4:return n=i.sent(),[4,Promise.all(n.map(function(){var e=(0,r.Z)((function(e){var n,r;return(0,s.__generator)(this,(function(i){switch(i.label){case 0:return n=[(0,o.Z)({},e)],r={},[4,t(e.owner.email)];case 1:return[2,c.apply(void 0,n.concat((r.owner=i.sent(),r)))]}}))}));return function(n){return e.apply(this,arguments)}}()))];case 6:return[2]}}
1))}))),T=D.data,S=D.error,L=D.mutate,R=function(){var e=(0,r.Z)((function(e){var n,t,r,o;return(0,s.__generator)(this,(function(c){switch(c.label){case 0:n=e.id,t=e.completed,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,E(n,t)];case 2:return r=c.sent(),console.log(r),L(),[3,4];case 3:return o=c.sent(),console.log(o),[3,4];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),U=function(){var e=(0,r.Z)((function(e){var n,t,r;return(0,s.__generator)(this,(function(o){switch(o.label){case 0:n=e.id,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,O(n)];case 2:return t=o.sent(),console.log(t),L(),[3,4];case 3:return r=o.sent(),console.log(r),[3,4];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}();if((0,j.useEffect)((function(){L()}),[v]),S)return(0,a.jsx)("p",{children:"something went wrong..."});if(!T)return(0,a.jsx)("p",{children:"Loading..."});return(0,a.jsx)(f.Z,{children:(0,a.jsxs)(h.Z,{component:"section",className:(0,d.cx)((0,d.iv)(Z())),children:[(0,a.jsx)(g.C,{component:"h2",className:"!text-2xl font-bold",children:"TODO"}),(0,a.jsx)("button",{type:"button",className:(0,d.cx)("px-6 py-2 bg-blue-600 text-white rounded-lg","hover:bg-blue-700","outline-none focus-visible:ring-2 focus-visible:ring-black"),onClick:function(n){N()||e.push({pathname:"/new"})},children:"New Todo"}),(0,a.jsx)(_.Z,{}),0===(null===T||void 0===T?void 0:T.length)?(0,a.jsx)("p",{children:"nothing to do"}):(0,a.jsx)(h.Z,{className:"w-full flex flex-col gap-4",children:T.map((function(n,t){return(0,a.jsxs)(h.Z,{className:"w-full border-2 p-2",children:[(0,a.jsx)(b.Z,{color:"neutral",checked:n.completed,label:n.task,onClick:function(e){N()||R({id:n._id,completed:n.completed})},size:"lg"}),(0,a.jsxs)(h.Z,{className:"flex items-center justify-between",children:[(0,a.jsx)(h.Z,{className:"flex items-center",children:(0,a.jsx)(w(),{alt:n.owner.email,src:n.owner.avatorURL,width:40,height:40,className:"hover:cursor-pointer !rounded-full !border-2",onClick:function(n){N()||e.push("/profile")}})}),(0,a.jsxs)(h.Z,{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",className:(0,d.cx)("px-6 py-2 bg-blue-600 text-white rounded-lg","hover:bg-blue-700","outline-none focus-visible:ring-2 focus-visible:ring-black"),onClick:function(t){N()||e.push({pathname:"/todo/".concat(n._id)})},children:"Edit"}),(0,a.jsx)("button",{type:"button",className:(0,d.cx)("px-6 py-2 bg-blue-600 text-white rounded-lg","hover:bg-blue-700","outline-none focus-visible:ring-2 focus-visible:ring-black"),onClick:function(e){N()||U({id:n._id})},children:"Delete"})]})]})]},n._id)}))})]})})}}},function(e){e.O(0,[790,222,607,505,162,774,888,179],(function(){return n=5728,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.