import{a as _}from"./chunk-RGUZPXDM.mjs";import{a as I}from"./chunk-VNXPU33K.mjs";import{a as j}from"./chunk-XONIRZR4.mjs";import{a as p}from"./chunk-YEHDKQVK.mjs";import{a as S,b as g}from"./chunk-EG4Q3NXG.mjs";import{a as P}from"./chunk-Q4QPMMXW.mjs";import{c as O}from"./chunk-CGUOB3SO.mjs";import{Suspense as q,useMemo as G}from"react";import{LoadingScreen as H}from"@baseapp-frontend/design-system/components/native/displays";import{Text as x}from"@baseapp-frontend/design-system/components/native/typographies";import{InfiniteScrollerView as J,View as s}from"@baseapp-frontend/design-system/components/native/views";import{useTheme as E}from"@baseapp-frontend/design-system/providers/native";import{useLazyLoadQuery as W,usePaginationFragment as Y}from"react-relay";import{jsx as r,jsxs as y}from"react/jsx-runtime";function u(e){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(m){return Object.getOwnPropertyDescriptor(e,m).enumerable})),i.push.apply(i,o)}return i}function w(e){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?L(Object(i),!0).forEach(function(o){U(e,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(i,o))})}return e}function U(e,t,i){return(t=V(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function V(e){var t=X(e,"string");return u(t)=="symbol"?t:t+""}function X(e,t){if(u(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var o=i.call(e,t||"default");if(u(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Z=function(t){var i,o=t.EmptyState,m=o===void 0?j:o,v=t.NotificationItem,C=v===void 0?I:v,b=t.NotificationItemProps,D=b===void 0?{}:b,T=E(),d=p(T),h={count:10},k=W(S,h,{fetchPolicy:"store-and-network"}),l=k.me,f=Y(g,l),a=f.data,F=f.loadNext,R=f.isLoadingNext,$=f.hasNext,A=f.refetch;P(l?.id);var N=G(function(){var c;return(a==null||(c=a.notifications)===null||c===void 0?void 0:c.edges.filter(function(n){return n?.node}).map(function(n){return n?.node}))||[]},[a==null||(i=a.notifications)===null||i===void 0?void 0:i.edges]),z=function(){A(h,{fetchPolicy:"network-only"})},M=function(n){return n?r(C,w({notification:n},D),"notification-".concat(n.id)):null},Q=function(){return N.length===0?r(m,{}):r(s,{style:d.listContainer,children:r(J,{data:N,renderItem:function(B){var K=B.item;return M(K)},estimatedItemSize:134,onEndReached:function(){$&&F(O)},isLoading:R})})};return y(s,{style:d.container,children:[y(s,{style:d.headerContainer,children:[r(x,{variant:"h6",children:"Notifications"}),r(_,{refetch:z,disabled:!(a!=null&&a.notificationsUnreadCount)})]}),Q()]})},tt=function(t){var i=E(),o=p(i);return r(q,{fallback:y(s,{style:o.container,children:[r(s,{style:o.headerContainer,children:r(x,{variant:"h6",children:"Notifications"})}),r(H,{})]}),children:r(Z,w({},t))})},pt=tt;export{pt as a};
//# sourceMappingURL=chunk-TEK4GQLS.mjs.map