1"use strict";(self.webpackChunkreact_app=self.webpackChunkreact_app||[]).push([[12500],{482(e,s,t){t.d(s,{Dc:()=>o,Jg:()=>i,K1:()=>c,Ln:()=>r,R6:()=>n,Se:()=>a,e7:()=>l});const a={PRODUCT_INDIVIDUAL:"product-individual",SERVICE_INDIVIDUAL:"service-individual",BUSINESS:"business"},l=[{id:a.PRODUCT_INDIVIDUAL,label:"Product Individual Profile",shortLabel:"Product Individual",theme:"product",icon:"product"},{id:a.SERVICE_INDIVIDUAL,label:"Service Individual Profile",shortLabel:"Service Individual",theme:"service",icon:"service"},{id:a.BUSINESS,label:"Business Profile",shortLabel:"Business",theme:"business",icon:"building"}];function r(e){const s=null===e||void 0===e?void 0:e.businessTypeUser;if(null==s||""===s)return 0;const t=Number(s);return Number.isNaN(t)?0:t}function i(){let{userData:e,hasServiceProfile:s=!1,serviceMeta:t=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const l=r(e),i=0!==l,n=Boolean(null===e||void 0===e?void 0:e.UserDetailsModel),o=i&&Boolean(null===e||void 0===e?void 0:e.BusinessUserDetails),c=i&&Boolean(null===t||void 0===t?void 0:t.businessProfileDetail),d=Boolean(s&&(null===t||void 0===t?void 0:t.profileDetail)),u=i,h=[];return n&&h.push(a.PRODUCT_INDIVIDUAL),d&&h.push(a.SERVICE_INDIVIDUAL),u&&h.push(a.BUSINESS),{tabs:h,flags:{hasProductIndividual:n,hasProductBusiness:o,hasServiceIndividual:d,hasServiceBusiness:c,hasBusinessProfile:u,hasBusinessAccount:i,businessTypeUser:l}}}function n(){let{userData:e,adminRole:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 1===Number(s)&&0===r(e)}function o(e){return null!==e&&void 0!==e&&e.length?e[0]:null}function c(e){const s=l.find(s=>s.id===e);return(null===s||void 0===s?void 0:s.label)||e}},91243(e,s,t){t.d(s,{_K:()=>i,gT:()=>m,qW:()=>_,w4:()=>h,IJ:()=>u});var a=t(89379),l=t(482);function r(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{hasProductBusiness:t,hasServiceBusiness:a,hasSubscription:r,hasBusinessOrderDetails:i}=s,n=r?[{id:"ths-section-subscription",label:"Subscription",tab:e}]:[];if(e===l.Se.PRODUCT_INDIVIDUAL)return[{id:"ths-section-user-info",label:"User Info",tab:e},{id:"ths-section-personal-media",label:"Media",tab:e},{id:"ths-section-product-stats",label:"Statistics",tab:e},...n,{id:"ths-section-activity",label:"Activity",tab:e}];if(e===l.Se.SERVICE_INDIVIDUAL)return[{id:"ths-section-service-info",label:"Service Info",tab:e},{id:"ths-section-services",label:"Services",tab:e},{id:"ths-section-documents",label:"Documents",tab:e},...n,{id:"ths-section-activity",label:"Activity",tab:e}];if(e===l.Se.BUSINESS){const s=[{id:"ths-section-unified-media",label:"Media",tab:e}];return t&&(s.push({id:"ths-section-product-business",label:"Product Business",tab:e}),i&&s.push({id:"ths-section-product-stats",label:"Product Stats",tab:e})),a&&s.push({id:"ths-section-business-cards",label:"Businesses",tab:e},{id:"ths-section-service-business-profile",label:"Service Business",tab:e},{id:"ths-section-service-listings",label:"Service Listings",tab:e},{id:"ths-section-service-addresses",label:"Addresses",tab:e},{id:"ths-section-realestate",label:"Agent & Broker",tab:e},{id:"ths-section-documents",label:"Documents",tab:e}),s.push(...n,{id:"ths-section-activity",label:"Login History",tab:e}),s}return[]}function i(){let{flags:e={},details:s=null,subscription:t=null,usage:a=null,serviceBusinessData:l=null,hasServiceProfile:r=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=Number(null===s||void 0===s?void 0:s.totalProducts)||0,n=Number(null===s||void 0===s?void 0:s.AutoProductsCount)||0,o=Number(null===s||void 0===s?void 0:s.TotalServiceCategories)||0,c=Number(null===s||void 0===s?void 0:s.totalProperties)||0,d=Number(null===s||void 0===s?void 0:s.totalTeamMembers)||0,u=Number(null===s||void 0===s?void 0:s.totalBuyerOrders)||0,h=Number(null===s||void 0===s?void 0:s.totalSellerOrders)||0,_=Number(null===s||void 0===s?void 0:s.totalServiceOrdersBuyer)||0,m=Number(null===s||void 0===s?void 0:s.totalServiceOrdersProvider)||0,v=Number(null===s||void 0===s?void 0:s.totalEventBuyerOrders)||0,p=Number(null===s||void 0===s?void 0:s.totalEventSellerOrders)||0,b=Number(null===s||void 0===s?void 0:s.totalInvoices)||0,f=Number(null===s||void 0===s?void 0:s.totalTickets)||0,{hasProductBusiness:x=!1,hasServiceBusiness:N=!1}=e,g=Boolean(null===s||void 0===s?void 0:s.hasAgentProfile),j=Boolean(null===s||void 0===s?void 0:s.hasBrokerProfile),S=Boolean((null===s||void 0===s?void 0:s.hasRealEstateProfile)||g||j),y=i>0,P=n>0,w=o>0,A=c>0,k=y||P||u>0||h>0,B=Boolean(N||l||w||S||_>0||m>0),D=Boolean(r&&(w||_>0||m>0));return{flags:e,details:s,hasProductBusiness:x,hasServiceBusiness:N,hasServiceProfile:r,hasServiceBusinessData:Boolean(l),hasSubscription:Boolean(t&&a),hasAgentProfile:g,hasBrokerProfile:j,hasRealEstateProfile:S,counts:{productListingCount:i,autoListingCount:n,serviceListingCount:o,propertyCount:c,teamMemberCount:d,productBuyerOrders:u,productSellerOrders:h,serviceOrdersBuyer:_,serviceOrdersProvider:m,eventBuyerOrders:v,eventSellerOrders:p,invoiceCount:b,ticketCount:f},hasProductListings:y,hasAutoListings:P,hasServiceListings:w,hasProperties:A,hasProductBusinessActivity:k,hasServiceBusinessActivity:B,hasServiceIndiv
1idualActivity:D,hasRealEstateData:S||A,hasProductStatsData:x&&k}}const n={"ths-section-product-stats":"product-stats","ths-section-services":"services-individual","ths-section-realestate":"real-estate","ths-section-service-listings":"service-listings","ths-section-service-business-profile":"service-business","ths-section-service-addresses":"service-addresses","ths-section-product-business":"product-business","ths-section-subscription":"subscription"},o=new Set(["service-business","service-addresses","service-listings","documents"]);function c(e,s){switch(e){case"product-business":case"product-stats":return s.hasProductBusiness;case"product-stats-individual":default:return!0;case"service-business":case"service-addresses":case"service-listings":return s.hasServiceBusiness;case"real-estate":return s.hasRealEstateProfile;case"documents":case"services-individual":return s.hasServiceProfile}}function d(e,s){if("real-estate"===e)return s.hasRealEstateProfile;if(o.has(e))return s.hasServiceBusiness&&s.hasServiceBusinessActivity;switch(e){case"product-business":case"product-stats":case"product-stats-individual":return s.hasProductBusinessActivity;case"services-individual":return s.hasServiceProfile;case"subscription":return s.hasSubscription;default:return!0}}function u(e,s){const t=[],a=[];return e.forEach(e=>{const l=function(e){return e.visibilityKey?e.visibilityKey:n[e.id]?n[e.id]:String(e.id||"").replace("ths-section-","")}(e);c(l,s)&&(d(l,s)?t.push(e):a.push(e))}),{visible:t,hidden:a}}function h(e,s){const t=[],a=[];return(e||[]).forEach(e=>{!function(e,s){const t=null===e||void 0===e?void 0:e.label;if(!t)return!0;if("Chat Logs"===t||"Subscription"===t)return!0;switch(t){case"Buyer Orders":return s.counts.productBuyerOrders>0;case"Seller Orders":return s.counts.productSellerOrders>0;case"Business Products":case"Product Listings":return s.hasProductListings;case"Auto Listings":return s.hasAutoListings;case"Service Listings":return s.hasServiceBusiness&&(s.hasServiceListings||s.hasServiceBusinessData||s.counts.serviceListingCount>0);case"Service Orders":return s.counts.serviceOrdersBuyer>0;case"Service Jobs":return s.counts.serviceOrdersProvider>0;case"Event Orders":return s.counts.eventBuyerOrders>0;case"Event Hosting":return s.counts.eventSellerOrders>0;case"Invoices":return s.counts.invoiceCount>0;case"Properties":return s.hasProperties||s.hasRealEstateProfile;case"Team Members":return s.counts.teamMemberCount>0;case"Support Tickets":return s.counts.ticketCount>0;default:return!0}}(e,s)?a.push(e):t.push(e)}),{visible:t,hidden:a}}function _(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const{hasSubscription:i,hasBusinessOrderDetails:n}=s,o=r(e,(0,a.A)((0,a.A)({},s),{},{hasSubscription:i,hasBusinessOrderDetails:n}));return t?o.filter(s=>{const a="ths-section-product-stats"===s.id&&e!==l.Se.BUSINESS?"product-stats-individual":"ths-section-services"===s.id?"services-individual":"ths-section-realestate"===s.id?"real-estate":"ths-section-service-listings"===s.id?"service-listings":"ths-section-service-business-profile"===s.id?"service-business":"ths-section-product-business"===s.id?"product-business":"ths-section-documents"===s.id?"documents":s.id.replace("ths-section-","");return!!c(a,t)&&d(a,t)}):o}function m(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e.length)return"";const t=s.filter(s=>e.includes(s.value)).map(e=>e.label);return t.length?t.length<=2?t.join(" & "):"".concat(t.length," profile types"):""}},96036(e,s,t){t.d(s,{A:()=>c});var a=t(89379),l=t(9950),r=t(30639),i=t(17575),n=t(44414);const o=e=>{let{tableData:s,columnsData:t,handlePageChange:o,totalRows:c,perPage:d,HandleLimit:u,OnSearch:h,Title:_,RowClick:m,currentpage:v,tableClassName:p="",responsive:b=!0,sortServer:f=!1,onSort:x,defaultSortFieldId:N,defaultSortAsc:g=!1,paginationResetDefaultPage:j=!1,disableResponsive:S=!1}=e;const[y,P]=(0,l.useState)(""),[w,A]=(0,l.useState)([]),k=(0,l.useContext)(i.A),B=(0,l.useRef)(null),[D,C]=(0,l.useState)([]);(0,l.useEffect)(()=>{Array.isArray(s)?C(s.map(e=>{var s,t;return(0,a.A)((0,a.A)({},e),{},{id:null!==(s=null!==(t=e.p_id)&&void 0!==t?t:e.uid)&&void 0!==s?s:e.id})})):C([])},[s]),(0,l.useEffect)(()=>{const e=B.current;if(!e||!m)return;const s=s=>{if(s.target.closest('[data-row-click="ignore"]')||s.target.closest('button, a, input, select, textarea, label, [role="button"]'))return;const t=s.target.closest('.rdt_TableBody .rdt_TableRow[role="row"]');if(!t)return;let a=null;if(t.id){const e=t.id.replace(/^row-/,"");a=D.find(s=>String(s.id)===String(e))}if(!a){const s=Array.from(e.querySelectorAll('.rdt_TableBody .rdt_TableRow[role="row"]')).indexOf(t);s>=0&&(a=D[s])}a&&m(a,s)};
1return e.addEventListener("click",s),()=>e.removeEventListener("click",s)},[m,D]);const I={headRow:{style:{backgroundColor:k.Darktheme?"#2d3035":"#f8fafc",borderBottom:k.Darktheme?"1px solid #3d4249":"1px solid #e5e7eb",minHeight:"48px"}},headCells:{style:{fontSize:"0.75rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.04em",color:k.Darktheme?"#e5e7eb":"#374151",paddingLeft:"16px",paddingRight:"16px"}},rows:{style:{minHeight:"72px",borderBottom:k.Darktheme?"1px solid #3d4249":"1px solid #f1f5f9",backgroundColor:k.Darktheme?"#1e2124":"#fff",cursor:m?"pointer":"default"},highlightOnHoverStyle:{backgroundColor:k.Darktheme?"#2d3035":"#f8fafc",borderBottomColor:k.Darktheme?"#3d4249":"#e5e7eb",outline:"none"}},cells:{style:{padding:"12px 16px",fontSize:"0.875rem",color:k.Darktheme?"#f3f4f6":"#1f2937"}},noData:{style:{color:k.Darktheme?"#fff":"#000",backgroundColor:k.Darktheme?"#010114":"#fff"}},table:{style:{overflow:"visible"}},tableWrapper:{style:{overflowX:"auto",borderRadius:"12px"}},responsiveWrapper:{style:{overflow:"visible"}},pagination:{style:{borderTop:k.Darktheme?"1px solid #3d4249":"1px solid #e5e7eb",minHeight:"52px",fontSize:"0.875rem"}}},R=Boolean(m);return(0,n.jsx)("div",{ref:B,className:"datatable-container ".concat(p," ").concat(k.Darktheme?"DarkTheme-Active":"").concat(R?" datatable-container--row-clickable":""),children:(0,n.jsx)(r.Ay,{title:_,columns:t,data:D,keyField:"id",pagination:!0,paginationServer:!0,paginationTotalRows:c,onChangePage:o,highlightOnHover:R,pointerOnHover:R,paginationPerPage:d,onChangeRowsPerPage:u,paginationRowsPerPageOptions:[25,50,75,100,200],responsive:!S&&b,customStyles:I,paginationDefaultPage:v||1,paginationResetDefaultPage:j,overflowY:!1,overflowYOffset:0,dense:!1,sortServer:f,onSort:x,defaultSortFieldId:N,defaultSortAsc:g})})},c=(0,l.memo)(o)},90564(e,s,t){t.d(s,{A:()=>r});t(9950);var a=t(95252),l=t(44414);const r=function(e){let{Loading:s}=e;return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{className:"mdaal",style:s?{display:"block"}:{display:"none"},children:(0,l.jsx)("div",{className:"d-flex align-items-center justify-content-center",style:{height:"100%"},children:(0,l.jsx)(a.A,{animation:"border",role:"status",variant:"light",children:(0,l.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})})})}},12500(e,s,t){t.r(s),t.d(s,{default:()=>P});var a=t(9950),l=t(4359),r=t(17575),i=t(3919),n=t(27232),o=t(47973),c=t(96036),d=t(90564),u=t(40777),h=(t(39961),t(32910),t(482));const _={PP:{code:"PP",label:"Product Personal",filterKey:"product-personal",tab:h.Se.PRODUCT_INDIVIDUAL,tone:"product"},PB:{code:"PB",label:"Product Business",filterKey:"product-business",tab:h.Se.BUSINESS,section:"ths-section-product-business",tone:"product-business"},SP:{code:"SP",label:"Service Personal",filterKey:"service-personal",tab:h.Se.SERVICE_INDIVIDUAL,tone:"service"},SB:{code:"SB",label:"Service Business",filterKey:"service-business",tab:h.Se.BUSINESS,section:"ths-section-service-business-profile",tone:"service-business"},AP:{code:"AP",label:"Agent Profile",filterKey:"agent-profile",tab:h.Se.BUSINESS,section:"ths-section-realestate",tone:"agent"},BR:{code:"BR",label:"Broker Profile",filterKey:"broker-profile",tab:h.Se.BUSINESS,section:"ths-section-realestate",tone:"broker"}},m=["PP","PB","SP","SB","AP","BR"],v=[{value:"all",label:"All Profiles"},{value:"product-personal",label:"Product Personal"},{value:"product-business",label:"Product Business"},{value:"service-personal",label:"Service Personal"},{value:"service-business",label:"Service Business"},{value:"agent-profile",label:"Agent Profile"},{value:"broker-profile",label:"Broker Profile"}].filter(e=>"all"!==e.value),p=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e)return s;const t=String(e).trim();if(!t||"null"===t||"undefined"===t)return s;if(/^(https?:)?\/\//i.test(t)||/^(data|blob):/i.test(t))return t;if(t.startsWith("/")){return"".concat("https://thehomeshowlive.s3-accelerate.amazonaws.com/".replace(/\/$/,"")).concat(t)}const a="https://thehomeshowlive.s3-accelerate.amazonaws.com/",l=t.replace(/^\/+/,"");return l.includes("uploads/profile/")||l.includes("storage/")?"".concat(a).concat(l):"".concat(a,"uploads/profile/thumbn
1ail/").concat(l)};var b=t(44414);function f(e){let{userId:s,badges:t=[],className:a=""}=e;const l=(e=>{const s=new Set(Array.isArray(e)?e:[]);return m.filter(e=>s.has(e))})(t);return l.length?(0,b.jsx)("span",{className:"admin-profile-badges ".concat(a).trim(),onClick:e=>e.stopPropagation(),children:l.map(e=>{const t=_[e];return t?(0,b.jsx)("button",{type:"button",className:"admin-profile-badge admin-profile-badge--".concat(t.tone),title:t.label,"aria-label":"Open ".concat(t.label," profile"),onClick:t=>{t.stopPropagation(),window.open(((e,s)=>{if(!e)return"/admin-ths/userDetail/0";const t=_[s];if(!t)return"/admin-ths/userDetail/".concat(e);const a=new URLSearchParams;t.tab&&a.set("tab",t.tab),t.section&&a.set("section",t.section);const l=a.toString();return"/admin-ths/userDetail/".concat(e).concat(l?"?".concat(l):"")})(s,e),"_blank","noopener,noreferrer")},children:t.code},e):null})}):null}var x=t(91243),N=t(16339);function g(e){let{id:s="users-stats-profile-filter",value:t=[],onChange:l,options:r=v,placeholder:i="All profile types",ariaLabel:n="Profile type",ariaDescribedBy:o,darkMode:c=!1,variant:d="compact"}=e;const[u,h]=(0,a.useState)(!1),_=(0,a.useRef)(null),m=Array.isArray(t)?t:[],p="compact"===d;(0,a.useEffect)(()=>{const e=e=>{var s;null!==(s=_.current)&&void 0!==s&&s.contains(e.target)||h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const f=(0,a.useMemo)(()=>r.filter(e=>m.includes(e.value)),[r,m]),x=e=>{const s=m.includes(e)?m.filter(s=>s!==e):[...m,e];null===l||void 0===l||l(s)},g=e=>{var s;null===e||void 0===e||null===(s=e.stopPropagation)||void 0===s||s.call(e),null===l||void 0===l||l([])},j=function(e,s){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!e.length)return s;if(t){const s=e.length;return"".concat(s," selected")}return 1===e.length?e[0].label:2===e.length?"".concat(e[0].label," & ").concat(e[1].label):"".concat(e.length," profile types")}(f,i,p);return(0,b.jsxs)("div",{ref:_,className:["profile-type-multi-select",u?"profile-type-multi-select--open":"",c?"profile-type-multi-select--dark":"",p?"profile-type-multi-select--compact":"",m.length>0?"profile-type-multi-select--has-value":""].filter(Boolean).join(" "),children:[(0,b.jsx)("div",{className:"profile-type-multi-select__trigger-row",children:(0,b.jsxs)("button",{id:s,type:"button",className:"profile-type-multi-select__trigger",onClick:()=>h(e=>!e),"aria-haspopup":"listbox","aria-expanded":u,"aria-label":n,"aria-describedby":o,children:[(0,b.jsx)("span",{className:"profile-type-multi-select__value ".concat(0===f.length?"profile-type-multi-select__value--placeholder":""),children:j}),(0,b.jsx)("span",{className:"profile-type-multi-select__chevron","aria-hidden":"true",children:(0,b.jsx)(N.fK4,{})})]})}),u&&(0,b.jsxs)("div",{className:"profile-type-multi-select__menu",role:"listbox","aria-labelledby":s,"aria-multiselectable":"true",children:[(0,b.jsxs)("div",{className:"profile-type-multi-select__menu-head",children:[(0,b.jsx)("span",{className:"profile-type-multi-select__menu-title",children:"Profile types"}),m.length>0&&(0,b.jsx)("button",{type:"button",className:"profile-type-multi-select__clear",onClick:g,children:"Clear all"})]}),r.map(e=>{const s=m.includes(e.value);return(0,b.jsxs)("label",{className:"profile-type-multi-select__option ".concat(s?"profile-type-multi-select__option--selected":""),children:[(0,b.jsx)("input",{type:"checkbox",className:"profile-type-multi-select__checkbox",checked:s,onChange:()=>x(e.value)}),(0,b.jsx)("span",{className:"profile-type-multi-select__option-label",children:e.label})]},e.value)})]}),!p&&f.length>0&&(0,b.jsxs)("div",{className:"profile-type-multi-select__chips","aria-live":"polite",children:[f.map(e=>(0,b.jsxs)("button",{type:"button",className:"profile-type-multi-select__chip",onClick:()=>x(e.value),title:"Remove ".concat(e.label),children:[(0,b.jsx)("span",{children:e.label}),(0,b.jsx)("span",{className:"profile-type-multi-select__chip-remove","aria-hidden":"true",children:"\xd7"})]},e.value)),(0,b.jsx)("button",{type:"button",className:"profile-type-multi-select__chip profile-type-multi-select__chip--clear",onClick:g,children:"Clear all"})]})]})}var j=t(75245);t(62996);const S=[{value:"new",label:"Newest"},{value:"old",label:"Oldest"},{value:"name",label:"Name A\u2013Z"}],y="https://thehomeshowlive.s3-accelerate.amazonaws.com/Assets/Product/Portrait.png";const P=function(){const[e,s]=(0,a.useState)(1),[t,h]=(0,a.useState)(""),[_,m]=(0,a.useState)(null),[P,w]=(0,a.useState)(null),[A,k]=(0,a.useState)(null),[B,D]=(0,a.useState)(null),[C,I]=(0,a.useState)(0),[R,L]=(0,a.useState)([]),[E,U]=(0,a.useState)(!1),[O,T]=(0,a.useState)(!1),[M,V]=(0,a.useState)(!1),[H,F]=(0,a.useState)(!1),[K,z]=(0,a.useState)(!1),[W,q]=(0,a.useState)(!1),[J,Y]=(0,a.useState)(null),Z=(0,a.useContext)(r.A),$=Boolean(null===Z||void 0===Z?void 0:Z.Darktheme),X=$?"darksecondry":"",G=$?"textwhite":"",[Q,ee]=(0,a.useState)(!1),[se,te]=(0,a.useState)("new"),ae=(0,a.useRef)(null),[le,re]=(0,a.useState)(25),[ie,ne]=(0,a.useState)(""),oe=(0,a.useRef)(null),[ce,de]=(0,a.useState)(null),[ue,he]=(0,a.useState)(!1),[_e,me]=(0,a.useState)(null),[ve,pe]=(0,a.useState)([]),[be,fe]=(0,a.useState)(!1),[xe,Ne]=(0,a.useState)([]);let ge=["Active","Suspend","Pause"];const je=()=>
1{ee(!0),l.A.getWithParams("admin/Count-users",{page:e,q:ie,limit:le,sort:se,listUser:_e,profileFilter:ve.length?ve.join(","):""}).then(async e=>{"success"==e.status&&(k(e.DailyActive),L(e.data),Ne(e.filteredTotalCount||0),D(e.TotalUsers),w(e.WeeklyActive),m(e.MonthlyActive),fe(Boolean(e.statsScoped)),ee(!1)),ee(!1)}).catch(e=>{ee(!1)})};(0,a.useEffect)(()=>{var e;const s=JSON.parse(localStorage.getItem("userProfile"));let t=(null===(e=s.user)||void 0===e?void 0:e.isMainAdmin)||"";s&&h(t)},[]),(0,a.useEffect)(()=>{const e=()=>de(null);return document.addEventListener("click",e),()=>document.removeEventListener("click",e)},[]),(0,a.useEffect)(()=>{je()},[e,le,ie,se,_e,ve]);const Se=(e,t)=>{if("string"===typeof e)te(e),s(1);else if(e&&"object"===typeof e&&e.sortField){let a="new";const l=e.sortField;"username"===l?a="asc"===t?"username_asc":"username_desc":"homeShowId"===l?a="asc"===t?"homeShowId_asc":"homeShowId_desc":"email"===l?a="asc"===t?"email_asc":"email_desc":"phoneNumber"===l?a="asc"===t?"phoneNumber_asc":"phoneNumber_desc":"createdAt"===l?a="asc"===t?"createdAt_asc":"createdAt_desc":"Status"===l&&(a="asc"===t?"Status_asc":"Status_desc"),te(a),s(1)}},ye=async(e,s)=>{if(null!==e){if(1==s){if(!C)return n.oR.error("Please enter days first!"),!1;if(parseInt(C)<=0)return n.oR.error("Days should greater than 0!"),!1}1==s?U(!0):ee(!0),await l.A.httpPost("admin/updateuserstatusnew",{id:e,type:s,daysSuspend:parseInt(C)}).then(e=>{e.resobj.id?(n.oR.success(e.msg),I(0),U(!1),ee(!1),F(!1),Y(null),z(!1),q(!1),setTimeout(()=>{je()},500)):(n.oR.error(e.msg),Y(null),I(0),F(!1),z(!1),q(!1),U(!1),ee(!1))}).catch(e=>{n.oR.error("There is a server issue, Please try again later!"),Y(null),F(!1),I(0),z(!1),q(!1),U(!1),ee(!1)})}},Pe=e=>{window.open("/admin-ths/userDetail/".concat(e.UserDetailsModel.userId),"_blank")},we=e=>{pe(e),s(1)},Ae=(0,a.useCallback)(function(e){let s;return function(){for(var t=arguments.length,a=new Array(t),l=0;l<t;l++)a[l]=arguments[l];const r=this;s&&clearTimeout(s),s=setTimeout(()=>{e.apply(r,a)},1e3)}}(e=>{const{value:t}=e.target;s(1),ne(""==t?"":t)}),[]),ke=[{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Profile"}),cell:e=>{var s,t;return(0,b.jsx)("div",{className:"user_stats_092_profile_cell",children:(0,b.jsxs)("div",{className:"user_stats_092_profile_wrapper",children:[(0,b.jsx)("img",{src:p(e.listProfileImage||(null===(s=e.UserDetailsModel)||void 0===s?void 0:s.profileImage),y),className:"user_stats_092_profile_img",alt:"Profile",onError:e=>{e.target.src=y}}),(0,b.jsx)("div",{className:"user_stats_092_profile_info",children:(0,b.jsxs)("div",{className:"user_stats_092_profile_name_row",children:[(0,b.jsx)("div",{className:"user_stats_092_profile_name",children:e.username||"N/A"}),(0,b.jsx)("span",{"data-row-click":"ignore",children:(0,b.jsx)(f,{userId:(null===(t=e.UserDetailsModel)||void 0===t?void 0:t.userId)||e.id,badges:e.profileBadges})})]})})]})})},width:"320px",sortable:!0,sortField:"username"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"HS-ID"}),cell:e=>(0,b.jsx)("div",{className:"user_stats_092_spend_cell",children:e.homeShowId||"N/A"}),width:"180px",sortable:!0,sortField:"homeShowId"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Email"}),cell:e=>(0,b.jsx)("div",{className:"user_stats_092_spend_cell",children:e.email||"N/A"}),width:"250px",sortable:!0,sortField:"email"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Phone"}),cell:e=>{const s=null!==e&&void 0!==e&&e.phoneNumber?(0,o.lq)(e.phoneNumber):null;return(0,b.jsx)("div",{className:"user_stats_092_spend_cell",children:s?"+".concat(s.countryCallingCode," ").concat(s.formatNational()):(null===e||void 0===e?void 0:e.phoneNumber)||"N/A"})},width:"180px",sortable:!0,sortField:"phoneNumber"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Member Since"}),cell:e=>(0,b.jsx)("div",{className:"user_stats_092_spend_cell",children:e.createdAt?new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e.createdAt)):"N/A"}),width:"165px",sortable:!0,sortField:"createdAt"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Status"}),cell:e=>{var s;let a=e.Status;const l=ce===(null===(s=e.UserDetailsModel)||void 0===s?void 0:s.userId);1==e.isSoftDeleted&&(a="Deleted");return(0,b.jsxs)("div",{className:"user_stats_092_status_cell","data-row-click":"ignore",children:[(0,b.jsxs)("div",{className:"user_stats_092_status_dropdown ".concat(a.toLowerCase()),onClick:s=>{s.stopPropagation(),1==t&&de(l?null:e.UserDetailsModel.userId)},children:[(0,b.jsx)("span",{children:a}),1==t&&(0,b.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",children:(0,b.jsx)("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),l&&(0,b.jsx)("div",{className:"user_stats_092_status_menu ".concat(X),children:ge.filter(e=>"Deleted"!=a||"Suspend"!==e&&"Pause"!==e&&"Delete"!==e).map(s=>(0,b.jsx)("div",{className:"user_stats_092_status_option",onClick:t=>{t.stopPropagation(),(s=>{var t,a,l;Y(null===(t=e.UserDetailsModel)||void 0===t?void 0:t.userId),de(null),"Pause"===s&&ye(null===(a=e.UserDetailsModel)||void 0===a?void 0:a.userId,2),"Suspend"===s&&F(!0),"Active"===s&&ye(null===(l=e.
1UserDetailsModel)||void 0===l?void 0:l.userId,3)})(s)},children:s},s))})]})},width:"140px",className:"customclss-fix-dttble",sortable:!0,sortField:"Status"},{name:(0,b.jsx)("div",{className:"user_stats_092_header",children:"Actions"}),cell:e=>(0,b.jsx)("div",{className:"user_stats_092_actions_cell","data-row-click":"ignore",children:(0,b.jsxs)("button",{type:"button",className:"ths-users-action",onClick:()=>Pe(e),title:"View Details","aria-label":"View ".concat(e.username||"user"," details"),children:[(0,b.jsx)(N.Vap,{"aria-hidden":"true"})," View"]})}),width:"120px"}],Be=(0,x.gT)(ve,v),De=be?ve.length?Be:"Search results":"";return(0,b.jsxs)("div",{className:"maindivdashboard ".concat(X," user_stats_092_container ths-users-shell").concat($?" is-dark":""),children:[(0,b.jsx)(u.p8,{show:Q,label:"Loading users\u2026"}),(0,b.jsx)("div",{className:"w-100 mobileheightcls",children:(0,b.jsx)("div",{className:"Admin-Container-wrapper gx-0 Order-sales",children:(0,b.jsx)("div",{className:"list_new gap-25 d-lg-flex d-sm-block",children:(0,b.jsxs)("div",{className:"Main-section-Adminpanel ths-users-page",ref:ae,children:[(0,b.jsxs)("header",{className:"ths-users-heading",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{children:"User directory"}),(0,b.jsx)("h1",{children:"THS Users"}),(0,b.jsx)("p",{children:"Manage homeowner accounts, profiles, activity, and access from one place."})]}),(0,b.jsxs)("button",{type:"button",className:"ths-users-refresh",onClick:je,disabled:Q,children:[(0,b.jsx)(N.jTZ,{className:Q?"is-spinning":"","aria-hidden":"true"}),"Refresh"]})]}),(0,b.jsx)("div",{className:"user_stats_092_stats_section",children:(0,b.jsxs)("div",{className:"row",children:[(0,b.jsx)("div",{className:"col-md-3",children:(0,b.jsxs)("button",{type:"button",className:"user_stats_092_stat_card ".concat(X," ").concat(""===_e||null===_e?"user_stats_092_stat_card_active":""),onClick:()=>{me(""),s(1)},children:[(0,b.jsxs)("div",{className:"user_stats_092_stat_content",children:[(0,b.jsx)("h5",{className:"user_stats_092_stat_title ".concat(G),children:"Total Users"}),be?(0,b.jsx)("span",{className:"user_stats_092_stat_hint",children:De}):null,(0,b.jsx)("div",{className:"user_stats_092_stat_value_wrapper",children:(0,b.jsx)("h5",{className:"user_stats_092_stat_value ".concat(G),children:B||0})})]}),(0,b.jsx)("div",{className:"user_stats_092_stat_icon is-indigo",children:(0,b.jsx)(N.cfS,{"aria-hidden":"true"})})]})}),(0,b.jsx)("div",{className:"col-md-3",children:(0,b.jsxs)("button",{type:"button",className:"user_stats_092_stat_card ".concat(X," ").concat("daily"===_e?"user_stats_092_stat_card_active":""),onClick:()=>{me("daily"),s(1)},children:[(0,b.jsxs)("div",{className:"user_stats_092_stat_content",children:[(0,b.jsx)("h5",{className:"user_stats_092_stat_title ".concat(G),children:"Active Today"}),(0,b.jsx)("div",{className:"user_stats_092_stat_value_wrapper",children:(0,b.jsx)("h5",{className:"user_stats_092_stat_value ".concat(G),children:A||0})})]}),(0,b.jsx)("div",{className:"user_stats_092_stat_icon is-emerald",children:(0,b.jsx)(N.z1n,{"aria-hidden":"true"})})]})}),(0,b.jsx)("div",{className:"col-md-3",children:(0,b.jsxs)("button",{type:"button",className:"user_stats_092_stat_card ".concat(X," ").concat("monthly"===_e?"user_stats_092_stat_card_active":""),onClick:()=>{me("monthly"),s(1)},children:[(0,b.jsxs)("div",{className:"user_stats_092_stat_content",children:[(0,b.jsx)("h5",{className:"user_stats_092_stat_title ".concat(G),children:"Active Monthly"}),(0,b.jsx)("div",{className:"user_stats_092_stat_value_wrapper",children:(0,b.jsx)("h5",{className:"user_stats_092_stat_value ".concat(G),children:_||0})})]}),(0,b.jsx)("div",{className:"user_stats_092_stat_icon is-violet",children:(0,b.jsx)(N.wIk,{"aria-hidden":"true"})})]})}),(0,b.jsx)("div",{className:"col-md-3",children:(0,b.jsxs)("button",{type:"button",className:"user_stats_092_stat_card ".concat(X," ").concat("weekly"===_e?"user_stats_092_stat_card_active":""),onClick:()=>{me("weekly"),s(1)},children:[(0,b.jsxs)("div",{className:"user_stats_092_stat_content",children:[(0,b.jsx)("h5",{className:"user_stats_092_stat_title ".concat(G),children:"Active Weekly"}),(0,b.jsx)("div",{className:"user_stats_092_stat_value_wrapper",children:(0,b.jsx)("h5",{className:"user_stats_092_stat_value ".concat(G),children:P||0})})]}),(0,b.jsx)("div",{className:"user_stats_092_stat_icon is-amber",children:(0,b.jsx)(N.ARf,{"aria-hidden":"true"})})]})})]})}),(0,b.jsxs)("div",{className:"users-stats-toolbar ".concat(X?"users-stats-toolbar--dark":""),children:[(0,b.jsxs)("div",{className:"users-stats-toolbar__main",children:[(0,b.jsxs)("div",{className:"users-stats-toolbar__control users-stats-toolbar__control--search",children:[(0,b.jsx)("label",{className:"users-stats-toolbar__label",htmlFor:"users-stats-search",children:"Search"}),(0,b.jsxs)("div",{className:"users-stats-toolbar__search",children:[(0,b.jsx)("span",{className:"users-stats-toolbar__search-icon","aria-hidden":"true",children:(0,b.jsx)(N.CKj,{})}),(0,b.jsx)("input",{id:"users-stats-search",className:"users-stats-toolbar__search-input",onChange:Ae,type:"text",name:"search",placeholder:"Username, email, or name",ref:oe})]})]}),(0,b.jsxs)("div",{className:"users-stats-toolbar__control users-stats-toolbar__control--profile",children:[(0,b.jsx)("label",{className:"users-stats-toolbar__label",id:"users-stats-profile-filter-label",children:"Profile type"}),(0,b.jsxs)("div",{className:"users-stats-toolbar__select-wrap users-stats-toolbar__select-wrap--multi",children:[(0,b.jsx)("span",{className:"users-stats-toolbar__select-icon","aria-hidden":"true",children:(0,b.jsx)(N.K7R,{})}),(0,b.jsx)(g,{id:"users-stats-profile-filter",value:ve,onChange:we,options:v,ariaLabel:"Profile type",ariaDescribedBy:"users-stats-profile-filter-label",darkMode:B
1oolean(X),variant:"compact"})]})]}),(0,b.jsxs)("div",{className:"users-stats-toolbar__control users-stats-toolbar__control--sort",children:[(0,b.jsx)("label",{className:"users-stats-toolbar__label",id:"users-stats-sort-label",children:"Sort by"}),(0,b.jsxs)("div",{className:"users-stats-toolbar__select-wrap",children:[(0,b.jsx)("span",{className:"users-stats-toolbar__select-icon","aria-hidden":"true",children:(0,b.jsx)(N.LPr,{})}),(0,b.jsx)(j.A,{id:"users-stats-sort",className:"users-stats-toolbar__custom-select",triggerClassName:"users-stats-toolbar__custom-select-trigger",useFormSelectClass:!1,options:S,value:se,onChange:Se,"aria-label":"Sort by","aria-describedby":"users-stats-sort-label",darkbg:X,textwhite:G})]})]}),(0,b.jsx)("div",{className:"users-stats-toolbar__meta",children:(0,b.jsxs)("span",{className:"users-stats-toolbar__count",children:[xe||0," users shown"]})})]}),ve.length>0&&(0,b.jsxs)("div",{className:"users-stats-toolbar__active-filters",children:[(0,b.jsx)("span",{className:"users-stats-toolbar__active-filters-label",children:"Active filters"}),v.filter(e=>ve.includes(e.value)).map(e=>(0,b.jsxs)("button",{type:"button",className:"users-stats-toolbar__filter-chip",onClick:()=>we(ve.filter(s=>s!==e.value)),title:"Remove ".concat(e.label),children:[(0,b.jsx)("span",{children:e.label}),(0,b.jsx)("span",{className:"users-stats-toolbar__filter-chip-remove","aria-hidden":"true",children:"\xd7"})]},e.value)),(0,b.jsx)("button",{type:"button",className:"users-stats-toolbar__filter-clear",onClick:()=>we([]),children:"Clear all"})]})]}),(0,b.jsxs)("section",{className:"ths-users-table-card","aria-labelledby":"ths-users-table-title",children:[(0,b.jsxs)("div",{className:"users-stats-table-head ".concat(X?"users-stats-table-head--dark":""),children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{id:"ths-users-table-title",className:"users-stats-table-head__title",children:"daily"===_e?"Active Today":"weekly"===_e?"Active Weekly":"monthly"===_e?"Active Monthly":"All Users"}),(0,b.jsxs)("p",{children:[xe||0," matching user",1===xe?"":"s"]})]}),De?(0,b.jsx)("span",{className:"users-stats-table-head__hint",children:De}):null]}),(0,b.jsx)("div",{className:"user_stats_092_table_section ".concat(X),children:(0,b.jsx)(c.A,{perPage:le,totalRows:xe,HandleLimit:e=>{re(e),s(1)},columnsData:ke,tableData:R,handlePageChange:e=>{e&&(s(e),ae.current&&ae.current.scrollIntoView({behaviour:"smooth"}))},RowClick:Pe,currentpage:e,tableClassName:"user_stats_092_datatable",sortServer:!0,onSort:Se})})]})]})})})}),(0,b.jsxs)(i.A,{className:"user_stats_092_modal",show:H,onHide:()=>{Y(null),F(!1)},size:"sm",centered:!0,children:[(0,b.jsx)(d.A,{Loading:E}),(0,b.jsx)(i.A.Body,{className:"".concat(X),children:(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"w-100 text-center",children:[(0,b.jsx)("h6",{className:"fs-5 ".concat(G),children:"Are you sure?"}),(0,b.jsx)("h6",{className:"".concat(G," mb-3"),children:"Do you really want to suspend this user?"}),(0,b.jsxs)("div",{className:"mb-3",children:[(0,b.jsx)("label",{className:"".concat(G," mb-2 d-block"),children:"How many days for suspend?"}),(0,b.jsx)("input",{type:"text",className:"user_stats_092_days_input",min:"0",maxLength:6,value:C,onChange:e=>{const{value:s}=e.target;/^\d*$/.test(s)&&I(s)},pattern:"[0-9]",placeholder:"Enter days"})]})]}),(0,b.jsxs)("div",{className:"w-100 d-flex pt-3 justify-content-between",children:[(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_close",onClick:()=>{Y(null),F(!1)},children:"Close"}),(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_suspend",onClick:()=>{ye(J,1)},children:"Suspend"})]})]})})]}),(0,b.jsxs)(i.A,{show:K,onHide:()=>{Y(null),z(!1)},size:"sm",centered:!0,children:[(0,b.jsx)(d.A,{Loading:O}),(0,b.jsx)(i.A.Body,{className:"".concat(X),children:(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"w-100 text-center",children:[(0,b.jsx)("h6",{className:"fs-5 ".concat(G),children:"Are you sure?"}),(0,b.jsx)("h6",{className:"".concat(G),children:"Do you really want to pause this user?"})]}),(0,b.jsxs)("div",{className:"w-100 d-flex pt-3 justify-content-between",children:[(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_close",onClick:()=>{Y(null),z(!1)},children:"Close"}),(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_pause",onClick:()=>{ye(J,2)},children:"Pause"})]})]})})]}),(0,b.jsxs)(i.A,{show:W,onHide:()=>{Y(null),q(!1)},size:"sm",centered:!0,children:[(0,b.jsx)(d.A,{Loading:M}),(0,b.jsx)(i.A.Body,{className:"".concat(X),children:(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"w-100 text-center",children:[(0,b.jsx)("h6",{className:"fs-5 ".concat(G),children:"Are you sure?"}),(0,b.jsx)("h6",{className:"".concat(G),children:"Do you really want to activate this user again?"})]}),(0,b.jsxs)("div",{className:"w-100 d-flex pt-3 justify-content-between",children:[(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_close",onClick:()=>{Y(null),q(!1)},children:"Close"}),(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_activate",onClick:()=>{ye(J,3)},children:"Activate"})]})]})})]}),(0,b.jsxs)(i.A,{show:ue,onHide:()=>{Y(null),he(!1)},size:"md",centered:!0,children:[(0,b.jsx)(d.A,{Loading:M}),(0,b.jsx)(i.A.Body,{className:"".concat(X),children:(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"w-100 text-center",children:[(0,b.jsx)("h6",{className:"fs-5 ".concat(G),children:"Are you sure?"}),(0,b.jsx)("h6",{className:"".concat(G),children:"Do you really want to delete this user"})]}),(0,b.jsxs)("div",{className:"w-100 d-flex pt-3 justify-content-between",children:[(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_close",onClick:()=>{Y(null),he(!1)},children:"Close"}),(0,b.jsx)("button",{className:"user_stats_092_modal_btn user_stats_092_modal_suspend",onClick:()=>{(async e=>{try{ee(!0),await l.A.httpPost("admin/deleteuser",{id:e}).then(e=>{e.resobj.id?(n.oR.success(e.msg),he(!1),Y(null),ee(!1),setTimeout(()=>{je()},500)):(n.oR.error(e.msg),he(!1),Y(null),ee(!1))}).catch(e=>{n.oR.error("There is a server issue, Please try again later!"),he(!1),Y(null),ee(!1)})}catch(s){n.oR.error("There is a server issue, Please try again later!"),he(!1),Y(null),ee(!1)}})(J)},children:"Delete"})]})]})})]})]})}},39961(){}}]);
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.