"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBGH43QACjs = require('./chunk-BGH43QAC.js');var _chunk3IRWUOJOjs = require('./chunk-3IRWUOJO.js');var _chunkRMWWJOSAjs = require('./chunk-RMWWJOSA.js');var _chunk6H7YCGHOjs = require('./chunk-6H7YCGHO.js');var _chunkNHMTMXA3js = require('./chunk-NHMTMXA3.js');var _react = require('react');var _inputs = require('@baseapp-frontend/design-system/components/web/inputs');var _material = require('@mui/material');var _reacthookform = require('react-hook-form');var _jsxruntime = require('react/jsx-runtime');function l(e){"@babel/helpers - typeof";return l=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},l(e)}function F(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,o)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F(Object(r),!0).forEach(function(o){Q(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}function Q(e,t,r){return(t=X(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function X(e){var t=Y(e,"string");return l(t)=="symbol"?t:t+""}function Y(e,t){if(l(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(l(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j(e,t){return re(e)||te(e,t)||ee(e,t)||Z()}function Z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ee(e,t){if(e){if(typeof e=="string")return G(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?G(e,t):void 0}}function G(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function te(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,s,f,c,u=[],n=!0,m=!1;try{if(f=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;n=!1}else for(;!(n=(o=f.call(r)).done)&&(u.push(o.value),u.length!==t);n=!0);}catch(i){m=!0,s=i}finally{try{if(!n&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(m)throw s}}return u}}function re(e){if(Array.isArray(e))return e}var se=function(t){var r=t.queryRef,o=t.LogGroups,s=o===void 0?_chunkRMWWJOSAjs.a:o,f=t.LogGroupsProps,c=_react.useState.call(void 0, {createdFrom:null,createdTo:null,userName:"",count:10,cursor:null}),u=j(c,2),n=u[0],m=u[1],i=_chunkNHMTMXA3js.b.call(void 0, r),P=i.logGroups,I=i.loadNext,E=i.hasNext,k=i.isLoadingNext,W=i.refetch,q=_react.useTransition.call(void 0, ),O=j(q,2),y=O[0],h=O[1],K=_react.useState.call(void 0, ["All"]),_=j(K,2),V=_[0],$=_[1],d=_reacthookform.useForm.call(void 0, {defaultValues:{search:""}}),B=d.control,H=d.reset,M=d.watch,U=M("search"),g=function(b){var p=S(S({},n),b);m(p),h(function(){W(p,{fetchPolicy:"store-and-network"})})},z=function(){h(function(){H(),g({userName:""})})},J=function(b){var p=b.target.value||"";h(function(){g({userName:p})})},w=P.length===0;return _jsxruntime.jsx.call(void 0, _material.Box,{p:2,justifyContent:"center",minWidth:"100%",display:"flex",alignItems:"center",children:_jsxruntime.jsxs.call(void 0, _material.Box,{justifyContent:"center",maxWidth:600,width:"100%",mx:"auto",children:[_jsxruntime.jsx.call(void 0, _material.Typography,{component:"h4",variant:"h4",mb:4,children:"Activity Log"}),_jsxruntime.jsx.call(void 0, _inputs.Searchbar,{placeholder:"Search by user",name:"search",control:B,onChange:J,onClear:z,isPending:y}),_jsxruntime.jsxs.call(void 0, _material.Box,{display:"flex",mt:2,mb:2,flexDirection:"row",gap:2,children:[_jsxruntime.jsx.call(void 0, _chunk3IRWUOJOjs.a,{fetchParameters:n,executeRefetch:g}),_jsxruntime.jsx.call(void 0, _chunkBGH43QACjs.a,{options:["All","Comments","Reactions","Posts"],selectedOptions:V,onChange:$})]}),!y&&U&&w&&_jsxruntime.jsx.call(void 0, _chunk6H7YCGHOjs.a,{}),!y&&(n.createdFrom!=null||n.createdTo!=null)&&w&&_jsxruntime.jsx.call(void 0, _chunk6H7YCGHOjs.a,{message:"No results found for the selected date range."}),_jsxruntime.jsx.call(void 0, s,S({logGroups:P,loadNext:I,hasNext:E,isLoadingNext:k},f))]})})},be= exports.a =se;exports.a = be;
//# sourceMappingURL=chunk-QRE6BNWU.js.map