PageSourceSearch

https://www.vingallery.com/_next/static/chunks/34377-0ac4c888acf17c04.js

js vingallery.com collected 2026-10-04 15:21:37 UTC 50,159 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[34377,71721],{455375:function(e,t,a){a.d(t,{J:function(){return r}});var n=a(785893),s=a(741664),l=a.n(s);const r=e=>{const{children:t,isClickable:a=!0,target:s="_self",className:r,artworkId:i}=e;return a&&i?(0,n.jsx)(l(),{passHref:!0,href:"/artworks/".concat(i),target:s,className:r,children:t}):(0,n.jsx)("div",{className:r,children:t})}},171721:function(e,t,a){var n=a(785893),s=a(693967),l=a.n(s),r=a(340096);t.Z=e=>{const{className:t,src:a,alt:s,zIndex:i,sizes:o="256px",quality:c=80,onClick:d,customFallbackImageUrl:u}=e,m=a||u||"/icons/default-ava.svg";return(0,n.jsx)("span",{className:l()("relative box-content inline-block overflow-hidden rounded-full",t),children:(0,n.jsx)(r.Z,{...e,src:m,blurDataURL:"/icons/default-ava-2.svg",placeholder:"blur",alt:s||"user avatar",fill:!0,className:l()("rounded-full object-cover object-center",a&&"outline outline-1 outline-black/10"),style:{zIndex:i},fallbackSrc:"/images/default.png",sizes:o,quality:c,onClick:d})})}},548547:function(e,t,a){var n=a(785893),s=a(505152),l=a.n(s),r=a(490512),i=a(827606);const o=l()((()=>Promise.all([a.e(11627),a.e(43950)]).then(a.bind(a,243950))),{loadableGenerated:{webpack:()=>[243950]},ssr:!1});t.Z=e=>{const{user:t,containerClassName:a,className:s,maxNameLength:l=12,shouldShowNoTierBadgeUser:c}=e;var d;const u=(0,i.L)(null!==(d=null==t?void 0:t.fullName)&&void 0!==d?d:"",l);return(0,n.jsxs)("div",{className:(0,r.Z)("flex w-full items-center gap-2",a),children:[(0,n.jsx)("p",{className:s,children:u}),(0,n.jsx)(o,{iconClassName:"size-[1em]",user:t,shouldShowNoTierBadgeUser:c})]})}},286810:function(e,t,a){var n=a(785893),s=a(957292),l=a(452913),r=a(111358),i=a.n(r),o=a(693967),c=a.n(o),d=a(1852);t.Z=e=>{const{totalPage:t,onPageChange:a,pageIndex:r,className:o}=e,u=(0,d.useMediaQuery)({query:"(max-width: 738px)"});return(0,n.jsx)(i(),{breakLabel:"...",nextLabel:(0,n.jsx)(s.Z,{className:"size-5"}),onPageChange:e=>{let{selected:t}=e;return a(t+1)},forcePage:r-1,pageRangeDisplayed:u?1:3,marginPagesDisplayed:u?1:2,pageCount:t,previousLabel:(0,n.jsx)(l.Z,{className:"size-5"}),renderOnZeroPageCount:null,className:c()("paginate inline-flex w-full select-none items-center gap-1 md:gap-2 3xl:text-xl",o),previousClassName:"paginate-item",pageClassName:"paginate-item",nextClassName:"paginate-item",breakClassName:"paginate-item",previousLinkClassName:"paginate-item-link",breakLinkClassName:"paginate-item-link",pageLinkClassName:"paginate-item-link",nextLinkClassName:"paginate-item-link",activeClassName:"paginate-item__active"})}},705464:function(e,t,a){a.d(t,{Q:function(){return m}});var n=a(785893),s=a(983464),l=a(884310),r=a(667294),i=a(245842),o=a(679661),c=a(455375),d=a(932361),u=a(838490);const m=(e,t)=>{const a=Number(e||0);return{originalPrice:a,finalPrice:a-(t?.01*Number(t)*a:0)}};t.Z=e=>{let{orderItems:t,isInvoicePurchase:a}=e;const{value:l,toggle:c}=(0,o.kt)(t.length>2),d=(0,r.useCallback)(((e,t)=>!(!t||!e)&&!["Canceled","Returned"].includes(e)),[]),p=(0,r.useCallback)(((e,t,n)=>()=>{n&&((0,s.Rw)(n),e&&t&&(0,i.u6)("digital_certificate_clicked",{artwork_id:e,creator_user_id:t,type:a?"invoice":"artwork_purchase"}))}),[a]);return(0,n.jsxs)("div",{className:"w-full space-y-2",children:[t.slice(0,l?2:t.length).map((e=>{var t,a,s,l,r,i,o,c,h,g,v;const f=null!==(v="custom_item"===e.type?null===(t=e.customItem)||void 0===t?void 0:t.currency:null===(a=e.artwork)||void 0===a?void 0:a.currency)&&void 0!==v?v:"USD",j="custom_item"===e.type?e.customItemPrice:e.artworkPrice,N="custom_item"===e.type?e.customItemDiscountPercent:e.artworkDiscountPercent,b="custom_item"===e.type?null:null===(s=e.artwork)||void 0===s?void 0:s.imageSmall,w="custom_item"===e.type?null===(l=e.customItem)||void 0===l?void 0:l.title:null===(r=e.artwork)||void 0===r?void 0:r.title,{originalPrice:C,finalPrice:y}=m(j||0,N||0);return(0,n.jsx)("div",{className:"rounded-[8px] border border-black/10 px-4 py-3 lg:p-5",children:(0,n.jsx)(x,{artworkId:"artwork"===e.type?null===(i=e.artwork)||void 0===i?void 0:i.id:void 0,itemImage:b,itemName:w,purchaseSourceLabel:null===(o=(0,u.v8)(e.purchaseSource))||void 0===o?void 0:o.label,finalPrice
1:y,originalPrice:C,currency:f,handleViewDigitalCertificate:"artwork"===e.type?p(null===(c=e.artwork)||void 0===c?void 0:c.id,null===(g=e.artwork)||void 0===g||null===(h=g.creator)||void 0===h?void 0:h.id,e.digitalCertificate||void 0):void 0,showViewDigitalCertificateButton:"artwork"===e.type&&d(e.orderStatus,e.digitalCertificate||void 0)})},e.id)})),t.length>2&&(0,n.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,n.jsx)("button",{className:"text-xs text-primary transition-opacity hover:opacity-80 lg:text-sm",onClick:c,children:l?"+".concat(t.length-2," more items"):"See less"})})]})};const x=e=>{const{artworkId:t,itemImage:a,itemName:s,purchaseSourceLabel:r,originalPrice:i,finalPrice:o,currency:u,handleViewDigitalCertificate:m,showViewDigitalCertificateButton:x}=e;return(0,n.jsxs)("div",{className:"grid grid-cols-[40px_1fr_100px] gap-4 overflow-hidden",children:[(0,n.jsx)(c.J,{artworkId:t,children:(0,n.jsx)(l.Z,{src:a})}),(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsx)(c.J,{artworkId:t,children:(0,n.jsx)("p",{className:"line-clamp-1 text-sm font-semibold leading-[100%] lg:text-lg",children:s||"Untitled"})}),r&&(0,n.jsxs)("p",{className:"text-[10px] text-[#767676] lg:text-xs",children:['from "',r,'"']}),(0,n.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-[#767676] lg:text-xs",children:[!!i&&i!==o&&(0,n.jsxs)("p",{className:"line-through ",children:[u," ",(0,d.J5)(i||0,{currency:u})]}),(0,n.jsxs)("p",{children:[u," ",(0,d.J5)(o||0,{currency:u})]})]})]}),x&&(0,n.jsx)("button",{className:"text-[10px] text-xs font-semibold text-primary transition-opacity hover:opacity-80",onClick:m,children:"View certificate"})]})}},884310:function(e,t,a){var n=a(785893),s=a(667294),l=a(340096);const r=(0,s.memo)((e=>{const{src:t}=e;return(0,n.jsx)("div",{className:"relative flex size-10 items-center justify-center overflow-hidden  rounded-[4px] border border-black/10 bg-[#F5F5F5] lg:size-[45px]",children:(0,n.jsx)(l.Z,{src:t,placeholder:"blur",blurDataURL:"/images/placeholder.webp",fallbackSrc:"/images/invoice-icon.webp",height:t?45:28,width:t?45:28,className:"object-contain object-center",sizes:"(max-width: 768px) 20vw, (max-width: 1200px) 13.33vw, (max-width: 1920px) 10vw",alt:"invoice thumbnail"})})}));r.displayName="OrderThumbnail",t.Z=r},549660:function(e,t,a){var n=a(498029),s=a(885345),l=a(450841);const r=async e=>{let{groupId:t,contactIds:a}=e;try{await l.Z.addContactsToGroup({groupId:t,contactIds:a}),(0,s.t5)("Contact added to Group!")}catch(e){throw(0,s.cB)("Failed to add Contact to Group."),e}};t.Z=e=>{const t=(0,n.D)({mutationFn:r,...e});return{addContactsToGroup:async e=>{let{groupId:a,contactIds:n}=e;await t.mutateAsync({groupId:a,contactIds:n})},...t}}},719603:function(e,t,a){var n=a(498029),s=a(885345),l=a(450841),r=a(733182);const i=async e=>{let{groupIds:t}=e;try{await l.Z.deleteGroup({groupIds:t}),(0,s.t5)("Group deleted!")}catch(e){(0,s.cB)("Failed to delete Group.")}};t.Z=e=>{const t=(0,r.t)(),a=(0,n.D)({mutationFn:i,...e});return{deleteGroup:e=>{let{groupIds:n}=e;t({title:"DELETE GROUP?",description:"Are you sure you want to delete this group? Contacts who are assigned with this group will not be deleted.",confirmBtnText:"Delete",confirmButtonVariant:"warning",cancelBtnText:"Cancel"},{onConfirm:async()=>await a.mutateAsync({groupIds:n})})},...a}}},36910:function(e,t,a){var n=a(496486),s=a.n(n),l=a(452767),r=a(450841),i=a(557752);t.ZP=(0,l.pL)({queryKey:["useGetContacts"],queryFn:e=>r.Z.getContacts(e),setStateCallback:(e,t,a)=>{var n;s().forEach(null===(n=a.data)||void 0===n?void 0:n.list,(a=>(0,i.hB)(e,t,{contact:a})))}})},154203:function(e,t,a){var n=a(498029),s=a(885345),l=a(450841);const r=async e=>{let{groupId:t,contactIds:a}=e;try{await l.Z.removeContactsFromGroup({groupId:t,contactIds:a}),(0,s.t5)("Contact removed from group!")}catch(e){(0,s.cB)("Failed to remove Contact from Group.")}};t.Z=e=>{const t=(0,n.D)({mutationFn:r,...e});return{removeContactsFromGroup:async e=>{let{groupId:a,contactIds:n}=e;await t.mutateAsync({groupId:a,contactIds:n})},...t}}},772517:function(e,t,a){a.d(t,{Z:function(){return g}});var n=a(785893),s=a(732853),l=a(287536),r=a(31415),i=a(357492),o=a(498029),c=a(885345),d=a(450841);const u=async e=>{let{groupId:t,group:a}=e;try{await d.Z.updateGroup({groupId:t,group:a}),(0,c.t5)("Group updated!")}catch(e){var n;throw(0,c.cB)(null!==(n=e.message)&&void 0!==n?n:"Failed to update Group."),e}};var m=e=>{const t=(0,o.D)({mutationFn:u,...e});return{updateGroup:async e=>{let{groupId:a,group:n}=e;await t.mutateAsync({groupId:a,group:n})},...t}},x=a(719603),p=a(609852),h=a(136233);var g=e=>{const{group:t,shouldShowDeleteBtn:a=!0,onUpdate:o,onClose:c}=e,d=(0,l.cI)({defaultValues:t,resolver:(0,i.X)(h.k)}),{updateGroup:u}=m(),g=d.handleSubmit((async e=>{try{const{name:a}=e;await u({groupId:t.id,group:{name:a}}),null==o||o()}catch(e){}})),{deleteGroup:v}=(0,x.Z)({onSuccess:()=>o()});return(0,n.jsx)(s.default,{blurBackdrop:!0,open:!0,onClose:c,children:(0,n.jsxs)("div",{className:"flex w-[95vw] flex-col rounded-[32px] bg-white p-6 px-7 text-[#191414] md:w-[600px] lg:px-12",children:[(0,n.jsx)("div",{className:"flex w-full items-center justify-end",children:(0,n.jsx)("button",{onClick:c,children:(0,n.jsx)(r.Z,{className:"size-6 lg:size-[36px]"})})}),(0,n.jsx)("h2",{className:"w-full text-center text-2xl font-medium",children:"Edit group name"}),(0,n.jsx)(l.RV,{...d,children:(0,n.jsx)(h.Z,{onSubmit:g,className:"mt-[24px]"})}),(0,n.jsxs)("div",{className:"mt-[40px] flex flex-col items-center justify-center",children:[a&&(0,n.jsx)(p.z,{variant:"ghost",className:"w-[118px] !text-error",onClick:()=>v({groupIds:[t.id]}),children:"Delete"}),(0,n.jsx)(p.z,{className:"mt-1 w-[118px]",type:"submit",onClick:g,children:"Save"})]})]})})}},834377:function(e,t,a){a.d(t,{Z:function(){return Xe}});var n=a(785893),s=a(667294),l=a(693967),r=a.n(l),i=a(174094),o=a(727060),c=a(496486),d=a.n(c),u=a(601900),m=a(924697),x=a(36910),p=a(451179),h=a(671391),g=a(591214),v=a(859160),f=a(670281),j=a(4205),N=a(741664),b=a.n(N),w=a(505152),C=a.n(w),y=a(33889),I=a(402085),k=a(525466),S=a(803911),P=a(884310),E=a(705464),Z=a(932361),A=a(866119),D=a(774778);const F=C()((()=>Promise.all([a.e(98536),a.e(63783)]).then(a.bind(a,620018))),{loadableGenerated:{webpack:()=>[620018]}}),R=/(invoice|order) #([A-Za-z0-9-]+)/gi,_=e=>"https://".concat(I.hk,"/artist/invoices/checkout/").concat(e);var O=e=>{let{note:t="",truncate:a=!1}=e;
1const[l,r]=(0,s.useState)(null),{segments:i,referenceCount:o}=(0,s.useMemo)((()=>{const e=[];let a,s=0,l=0;for(R.lastIndex=0;null!==(a=R.exec(t));){const i=a[1].toLowerCase(),o=a[2],c=a.index+a[0].indexOf("#");e.push(t.slice(s,c)),e.push((0,n.jsx)(T,{type:i,code:o,onOpenOrder:r},c)),s=R.lastIndex,l+=1}return e.push(t.slice(s)),{segments:e,referenceCount:l}}),[t]);return 0===o&&a&&t.length>50?(0,n.jsx)("p",{children:t.slice(0,50)+"..."}):(0,n.jsxs)(S.pn,{children:[(0,n.jsx)("p",{children:i.map(((e,t)=>(0,n.jsx)(s.Fragment,{children:e},t)))}),null!==l&&(0,n.jsx)(F,{isOpen:!0,orderId:l,onClose:()=>r(null)})]})};const T=e=>{let{type:t,code:a,onOpenOrder:s}=e;const l="#".concat(a),r="align-baseline text-primary hover:underline",i="invoice"===t?(0,n.jsx)("a",{href:_(a),target:"_blank",rel:"noopener noreferrer",className:r,children:l}):(0,n.jsx)("button",{type:"button",className:r,onClick:()=>s(Number(a)),children:l});return(0,n.jsxs)(S.u,{children:[(0,n.jsx)(S.aJ,{asChild:!0,children:i}),(0,n.jsx)(S._v,{className:"w-72 bg-white p-3 text-left",children:"invoice"===t?(0,n.jsx)(L,{invoiceCode:a}):(0,n.jsx)(M,{orderId:Number(a),onOpenOrder:s})})]})},z=e=>{var t,a,n,s,l,r;const i="custom_item"===(null==e?void 0:e.type),o=i?null==e?void 0:e.customItemPrice:null==e?void 0:e.artworkPrice,c=i?null==e?void 0:e.customItemDiscountPercent:null==e?void 0:e.artworkDiscountPercent,{originalPrice:d,finalPrice:u}=(0,E.Q)(o,c);var m,x;return{name:i?null==e||null===(t=e.customItem)||void 0===t?void 0:t.title:null==e||null===(a=e.artwork)||void 0===a?void 0:a.title,creator:i?void 0:(0,Z.v2)(null==e||null===(n=e.artwork)||void 0===n?void 0:n.creator)||void 0,image:i?null:null!==(m=null==e||null===(s=e.artwork)||void 0===s?void 0:s.imageSmall)&&void 0!==m?m:null,currency:null!==(x=i?null==e||null===(l=e.customItem)||void 0===l?void 0:l.currency:null==e||null===(r=e.artwork)||void 0===r?void 0:r.currency)&&void 0!==x?x:"USD",originalPrice:d,finalPrice:u}},G=e=>{const t=Number((null==e?void 0:e.amount)||0);var a;return{name:null==e?void 0:e.title,creator:(0,Z.v2)(null==e?void 0:e.createdBy)||void 0,image:(null==e?void 0:e.artworkImage)||null,currency:null!==(a=null==e?void 0:e.currency)&&void 0!==a?a:"USD",originalPrice:t,finalPrice:t}},L=e=>{let{invoiceCode:t}=e;var a,s;const{data:l,isLoading:r}=y.Z.getInvoice.useQuery({queryParams:{invoiceCode:t},queryKey:["getInvoice",t]}),i=null==l||null===(a=l.data)||void 0===a?void 0:a.invoiceData,o=null==l||null===(s=l.data)||void 0===s?void 0:s.paymentData;return r||!i?(0,n.jsx)(V,{title:"Invoice #".concat(t),isLoading:r}):(0,n.jsx)(B,{title:"Invoice #".concat(i.invoiceCode),total:(0,Z.xG)(null==o?void 0:o.totalGrossAmount,{currency:i.currency}),date:i.createdAt,items:(null!==(c=i.items)&&void 0!==c?c:[]).map(G),seeMoreHref:_(i.invoiceCode)});var c},M=e=>{let{orderId:t,onOpenOrder:a}=e;var s;const{data:l,isLoading:r}=(0,D.Z)(t);return r||!l?(0,n.jsx)(V,{title:"Order #".concat(t),isLoading:r}):(0,n.jsx)(B,{title:"Order #".concat(l.code||l.id),total:(0,Z.xG)(null===(s=l.transaction)||void 0===s?void 0:s.totalAmount),date:l.createdAt,items:(null!==(i=l.orderItems)&&void 0!==i?i:[]).map(z),onSeeMore:()=>a(t)});var i},V=e=>{let{title:t,isLoading:a}=e;return(0,n.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,n.jsx)("p",{className:"text-sm font-semibold text-[#191414]",children:t}),(0,n.jsx)("div",{className:"h-px bg-black/10"}),(0,n.jsx)("p",{className:"text-xs text-[#808080]",children:a?"Loading…":"Details unavailable"})]})},B=e=>{let{title:t,total:a,date:s,items:l,onSeeMore:r,seeMoreHref:i}=e;const o=l.slice(0,3),c=l.length-o.length;return(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-sm font-semibold text-[#191414]",children:t}),(0,n.jsx)("div",{className:"h-px bg-black/10"}),(0,n.jsx)(q,{label:"Total",value:a}),(0,n.jsx)(q,{label:"Date",value:s?(0,A.vc)(s,k.um):void 0}),l.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"h-px bg-black/10"}),(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[o.map(((e,t)=>(0,n.jsx)(J,{item:e},t))),c>0&&(0,n.jsx)(U,{count:c,href:i,onClick:r})]})]})]})},U=e=>{let{count:t,href:a,onClick:s}=e;const l="+".concat(t," more item").concat(t>1?"s":""),r="w-fit text-[10px] font-medium text-primary hover:underline";return a?(0,n.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:r,children:l}):(0,n.jsx)("button",{type:"button",className:r,onClick:s,children:l})},q=e=>{let{label:t,value:a}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4 text-xs",children:[(0,n.jsx)("span",{className:"text-[#808080]",children:t}),(0,n.jsx)("span",{className:"font-medium text-[#191414]",children:a||"—"})]})},J=e=>{let{item:t}=e;const a=t.originalPrice>0&&t.originalPrice!==t.finalPrice;return(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(P.Z,{src:t.image}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("p",{className:"line-clamp-1 text-xs font-medium text-[#191414]",children:t.name||"Untitled"}),t.creator&&(0,n.jsxs)("p",{className:"line-clamp-1 text-[10px] text-[#767676]",children:["by ",t.creator]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 text-[10px] text-[#767676]",children:[a&&(0,n.jsxs)("span",{className:"line-through",children:[t.currency," ",(0,Z.J5)(t.originalPrice,{currency:t.currency})]}),(0,n.jsxs)("span",{children:[t.currency," ",(0,Z.J5)(t.finalPrice,{currency:t.currency})]})]})]})]})};var K=a(171721),H=a(548547),X=a(696441),Q=a(195554),W=a(837312),$=a(666812),Y=a(91902),ee=a(576249),te=a(920355),ae=a(498029),ne=a(885345),se=a(450841);const le=async e=>{let{contactIds:t}=e;try{await se.Z.deleteContact({contactIds:t}),(0,ne.t5)("Contact deleted!")}catch(e){(0,ne.cB)("Failed to delete Contact.")}};var re=e=>{const t=(0,ae.D)({mutationFn:le,...e});return{deleteContact:async e=>{let{contactIds:a}=e;await t.mutateAsync({contactIds:a})},...t}},ie=a(287536),oe=a(31415),ce=a(357492);const de=async e=>{let{contactId:t,dataToUpdate:a,groupIds:n}=e;try{await se.Z.updateContact({contactId:t,dataToUpdate:a,groupIds:n}),(0,ne.t5)("Contact updated!")}catch(e){throw(0,ne.cB)("Failed to update Contact."),e}};var ue=e=>{const t=(0,ae.D)({mutationFn:de,...e});return{updateContact:async e=>{let{contactId:a,dataToUpdate:n,groupIds:s}=e;await t.mutateAsync({contactId:a,dataToUpdate:n,groupIds:s})},...t}},me=a(72309),xe=a(732853);var pe=e=>{var t;const{onEdit:a,onClose:s,contact:l}=e,r=(0,ie.cI)({defaultValues:{...l,phone:{phoneNumber:l.phoneNumber},groupIds:null==l||null===(t=l.linkGroupContacts)||void 0===t?void 0:t.map((e=>e.groupId))},resolver:(0,ce.X)(me.k)}),{updateContact:i}=ue(),o=r.handleSubmit((async e=>{try{const{firstName:n,lastName:r,email:o,phone:c,note:d,groupIds:u}=e;var t;await i({contactId:null==l?void 0:l.id,dataToUpdate:{firstName:n,lastName:r,email:o,phoneNumber:null!==(t=c.phoneNumber)&&void 0!==t?t:"",note:d},groupIds:u}),null==a||a(),s()}catch(e){}}));return(0,n.jsx)(xe.default,{blurBackdrop:!0,open:!0,onClose:s,children:(0,n.jsxs)("div",{className:"flex w-[95vw] flex-col rounded-[32px] bg-white p-6 px-7 text-[#191414] md:w-[600px]  ",children:[(0,n.jsx)("div",{className:"flex w-full items-center justify-end",children:(0,n.jsx)("button",{onClick:s,children:(0,n.jsx)(oe.Z,{className:"size-6 lg:size-[36px]"})})}),(0,n.jsx)("h2",{className:"w-full text-center text-2xl font-medium",children:"Edit Contact"}),(0,n.jsx)(ie.RV,{...r,children:(0,n.jsx)(me.Z,{className:"mt-8",isEditing:!0,onSubmit:o})})]})})},he=a(609852),ge=a(856665);var ve=e=>{const{contact:t,onClose:a,onEdit:s}=e,l=d().map(d().get(t,"linkGroupContacts",[]),"group.name"),r=d().map(d().get(t,"statistic.campaigns",[]),"mailSubject");return(0,n.jsx)(xe.default,{blurBackdrop:!0,open:!0,onClose:a,children:(0,n.jsxs)("div",{className:"flex w-[95vw] flex-col rounded-[32px] bg-white p-6 px-7 text-[#191414] md:w-[500px] lg:px-12",children:[(0,n.jsx)("div",{className:"flex w-full items-center justify-end",children:(0,n.jsx)("button",{onClick:a,children:(0,n.jsx)(oe.Z,{className:"size-6 lg:size-[36px]"})})}),(0,n.jsx)("h2",{className:"w-full text-center text-2xl font-medium",children:"Contact Details"}),(0,n.jsxs)(ge.mQ,{defaultValue:"basic",className:" mx-auto my-[30px] w-full",children:[(0,n.jsxs)(ge.dr,{className:"mx-auto mb-[30px] flex w-[200px] space-x-[24px] !bg-white",children:[(0,n.jsx)(ge.SP,{className:"h-[16px] rounded-[0px] border-0 bg-white p-0 text-[12px] font-light decoration-[#0F6BFF] decoration-[2px] underline-offset-8 hover:bg-white data-[state=active]:border-0 data-[state=active]:font-semibold data-[state=active]:text-black data-[state=active]:un
1derline ",value:"basic",children:"BASIC INFO"}),(0,n.jsx)(ge.SP,{className:"h-[16px] rounded-[0px] border-0 bg-white p-0 text-[12px] font-light decoration-[#0F6BFF] decoration-[2px] underline-offset-8 hover:bg-white data-[state=active]:border-0 data-[state=active]:font-semibold data-[state=active]:text-black data-[state=active]:underline ",value:"subscription",children:"SUBSCRIPTION"})]}),(0,n.jsx)(ge.nU,{value:"basic",children:(0,n.jsxs)("div",{className:"grid min-h-[210px] grid-cols-2 gap-x-2 gap-y-8",children:[(0,n.jsx)(fe,{label:"Name",value:null==t?void 0:t.fullName}),(0,n.jsx)(fe,{label:"Email",value:null==t?void 0:t.email}),(0,n.jsx)(fe,{label:"Phone Number",value:null==t?void 0:t.phoneNumber}),(0,n.jsx)(fe,{label:"Notes",value:(0,n.jsx)(O,{note:null==t?void 0:t.note})}),(0,n.jsx)(fe,{label:"Group",value:l.join(", ")})]})}),(0,n.jsx)(ge.nU,{value:"subscription",children:(0,n.jsx)("div",{className:"flex min-h-[210px] flex-col justify-between",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-x-2 gap-y-8",children:[(0,n.jsx)(fe,{label:"Status",value:(null==t?void 0:t.statistic.campaigns.length)>0?"Subscribed":"Unsubscribed"}),(0,n.jsx)(fe,{label:"Email types",value:r.join(", ")})]})})})]}),(0,n.jsx)(he.z,{variant:"outline",className:"mx-auto w-[120px] border-primary px-4 py-3 !text-primary hover:bg-primary/10",onClick:s,children:"Edit contact"})]})})};const fe=e=>{let{label:t,value:a}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"px-[5px] text-xs font-semibold uppercase text-[#808080]",children:t}),a&&"string"!=typeof a?a:(0,n.jsx)("span",{className:"px-[5px] text-sm font-medium leading-[125%]",children:a||"-"})]})};var je=a(951835),Ne=a(733182),be=a(316815),we=a(574257);var Ce=e=>{const{contact:t,onChange:a}=e,l=(0,Ne.t)(),{deleteContact:r}=re({onSuccess:()=>a()}),[i,o]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!1),[u,m]=(0,s.useState)(!1);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(be.h_,{open:u,onOpenChange:m,children:[(0,n.jsx)(be.$F,{asChild:!0,children:(0,n.jsx)(he.z,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,n.jsx)($.Z,{className:"!size-[24px]"})})}),(0,n.jsxs)(be.AW,{align:"end",className:"[&>*]:cursor-pointer",children:[(0,n.jsxs)(be.Xi,{className:"font-semibold",onClick:e=>{e.stopPropagation(),d(!0)},children:[(0,n.jsx)(Y.Z,{className:"-mt-1 mr-2 size-[18px]"}),"View Detail"]}),(0,n.jsxs)(be.Xi,{className:"font-semibold",onClick:e=>{e.stopPropagation(),o(!0)},children:[(0,n.jsx)(te.Z,{className:"-mt-1 mr-2 size-[18px]",stroke:1.5})," Edit"]}),(0,n.jsx)(be.Xi,{asChild:!0,children:(0,n.jsxs)(we.Z,{variant:"ghost",className:"h-auto w-full justify-start bg-transparent px-2 py-1.5 text-xs font-semibold text-destructive",perm:je.Gd.ContactManagement.DELETE,onShowSubscribePlanModal:()=>m(!1),onClick:e=>{e.stopPropagation(),m(!1),l({title:"DELETE CONTACT?",description:"Deleting this contact will remove them from all associated groups and campaigns. This action cannot be undone.",confirmBtnText:"Delete Contact",confirmButtonVariant:"warning",cancelBtnText:"Cancel"},{onConfirm:()=>r({contactIds:[null==t?void 0:t.id]})})},children:[(0,n.jsx)(ee.Z,{className:"size-[18px]"})," Delete"]})})]})]}),i&&(0,n.jsx)(pe,{contact:t,onClose:()=>o(!1),onEdit:()=>a()}),c&&(0,n.jsx)(ve,{contact:t,onClose:()=>d(!1),onEdit:()=>o(!0)})]})};var ye=a(421809),Ie=a(678680),ke=a(312440),Se=a(679661),Pe=a(74810),Ee=a(549660),Ze=a(154203),Ae=a(111349),De=a(772517),Fe=a(12191),Re=a(923450),_e=a.n(Re);var Oe=e=>{let{className:t,table:a,shouldShowDeleteBtn:l=!0,onChange:r}=e;var i;const o=a.getFilteredSelectedRowModel().rows,[c,u]=(0,s.useState)(""),{data:m,refetch:x,isFetching:h,isError:g}=(0,Pe.ZP)({queryParams:{query:{name:c}}});var v;const f=null!==(v=null==m||null===(i=m.data)||void 0===i?void 0:i.list)&&void 0!==v?v:[],N=(0,s.useCallback)(d().debounce((async()=>{await x({cancelRefetch:!0})}),400),[]),[b,w]=(0,s.useState)(!1),{addContactsToGroup:C}=(0,Ee.Z)({onSuccess:()=>{x(),null==r||r()}}),{removeContactsFromGroup:y}=(0,Ze.Z)({onSuccess:()=>{x(),null==r||r()}}
1),[I,k]=(0,s.useState)(),[P,E]=(0,s.useState)(!1),[Z,A]=(0,s.useState)(!1),D=(0,Ne.t)(),{deleteContact:F}=re({onSuccess:()=>{a.setRowSelection({}),null==r||r()}}),R=e=>{let{group:t}=e;var a;const l=(0,s.useRef)(),r=(0,Se.XI)(l),i=o.map((e=>e.original.id)),c=null===(a=t.linkGroupContacts)||void 0===a?void 0:a.map((e=>e.contactId)),u=d().every(i,(e=>c.includes(e)));return(0,n.jsxs)(s.Fragment,{children:[(0,n.jsxs)("div",{className:"flex cursor-pointer items-center gap-[10px] p-[12px] hover:bg-muted/50",ref:l,children:[(0,n.jsx)(X.X,{id:"group-".concat(t.id),defaultChecked:u,onCheckedChange:e=>{e?C({groupId:t.id,contactIds:i}):y({groupId:t.id,contactIds:i})},"aria-label":"Select row"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-[6px]",children:[(0,n.jsx)(S.pn,{children:(0,n.jsxs)(S.u,{children:[(0,n.jsx)(S.aJ,{asChild:!0,children:(0,n.jsx)("label",{htmlFor:"group-".concat(t.id),className:"flex-1 cursor-pointer truncate",children:t.name})}),(0,n.jsx)(S._v,{children:t.name})]})}),r&&(0,n.jsx)("div",{className:"cursor-pointer",onClick:e=>{e.preventDefault(),e.stopPropagation(),k(t),A(!1),E(!0)},children:(0,n.jsx)(te.Z,{className:"size-[18px]",stroke:1.5})})]})]}),(0,n.jsx)("hr",{})]},t.id)};return(0,n.jsxs)("div",{className:t,children:[l&&(0,n.jsxs)(he.z,{variant:"ghost",className:"!rounded-sm px-2",onClick:()=>{const e=o.length,t=1===e?"DELETE CONTACT?":"DELETE ".concat(e," ").concat(_e()("CONTACT",e),"?"),a=1===e?"Deleting this contact will remove them from all associated groups and campaigns. This action cannot be undone.":"Deleted contacts will be removed from all groups and active campaigns. Are you sure you want to proceed?",n="Delete ".concat(_e()("Contact",e));D({title:t,description:a,confirmBtnText:n,confirmButtonVariant:"warning",cancelBtnText:"Cancel"},{onConfirm:()=>F({contactIds:o.map((e=>e.original.id))})})},children:[(0,n.jsx)(ee.Z,{className:"size-[18px]"})," Delete"]}),(0,n.jsxs)(Fe.J2,{open:Z,onOpenChange:e=>{A(e),e&&x()},children:[(0,n.jsx)(Fe.xo,{children:(0,n.jsxs)(he.z,{variant:"ghost",className:"!rounded-sm px-2",children:[(0,n.jsx)(ye.Z,{className:"size-[18px]"})," Add/Remove from Group"]})}),(0,n.jsxs)(Fe.yk,{className:"flex flex-col justify-between !p-0",align:"start",children:[(0,n.jsxs)("div",{className:"relative w-full",children:[(0,n.jsx)(p.I,{className:"border-none !pl-[48px] text-xs text-[#767676] !ring-transparent",placeholder:"Search...",type:"search",value:c,onChange:e=>{u(e.target.value),N()}}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center pl-[16px]",children:(0,n.jsx)(j.Z,{className:"h-6 w-6 text-black/70"})})]}),g&&(0,n.jsxs)("div",{className:"flex items-center justify-center py-4 text-center text-sm",children:["Failed to load. Please ",(0,n.jsx)("button",{className:"underline",onClick:()=>x(),children:"try again"})]}),!g&&(0,n.jsxs)(n.Fragment,{children:[h&&(0,n.jsx)("div",{className:"py-4 text-center text-sm",children:"Loading..."}),!h&&(0,n.jsx)(n.Fragment,{children:f.length>0?(0,n.jsx)(ke.Z,{className:"max-h-[400px] px-[8px] py-0",children:f.map((e=>(0,n.jsx)(R,{group:e},e.id)))}):(0,n.jsx)("div",{className:"py-4 text-center text-sm",children:"No groups found"})})]}),(0,n.jsxs)(he.z,{className:"w-full !rounded-none",variant:"ghost",onClick:()=>{w(!0),A(!1)},children:[(0,n.jsx)(Ie.Z,{className:"size-[18px]"})," Create new group"]})]})]}),b&&(0,n.jsx)(Ae.Z,{onClose:()=>w(!1),onCreate:()=>{null==r||r(),w(!1)}}),P&&(0,n.jsx)(De.Z,{group:I,onClose:()=>E(!1),onUpdate:()=>{null==r||r(),E(!1)}})]})},Te=a(811163),ze=a(882187),Ge=a(723028),Le=a(748874);var Me=()=>{const e=(0,Te.useRouter)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(be.h_,{children:[(0,n.jsx)(be.$F,{asChild:!0,children:(0,n.jsx)(he.z,{variant:"ghost",className:"h-8 w-8 p-0",children:(0,n.jsx)(ze.Z,{className:"!size-[24px]"})})}),(0,n.jsx)(be.AW,{align:"end",children:(0,n.jsx)(be.Xi,{onClick:()=>e.push((0,Le.Gn)(Ge.Z6.USER_DASHBOARD.CRM.GROUP.LIST)),children:"Manage groups"})})]})})},Ve=a(490512),Be=a(616310),Ue=a(251721),qe=a(818542);const Je=Be.Ry({groupIds:Be.IX().of(Be.Rx().required()).optional()}),Ke=e=>{var t;let a=0;return(null===(t=e.groupIds)||void 0===t?void 0:t.length)&&(a+=1),a};var He=e=>{let{className:t,value:a={},onChange:l}=e;
1const[r,i]=(0,s.useState)(!1),o=(0,ie.cI)({resolver:(0,ce.X)(Je),defaultValues:a}),{watch:c,reset:d,handleSubmit:u}=o,m=c(),x=(0,s.useMemo)((()=>Ke(a)),[a]),p=(0,s.useMemo)((()=>Ke(m)),[m]),h=u((e=>{var t;l({...e,groupIds:null!==(t=e.groupIds)&&void 0!==t?t:[]}),i(!1)}));return(0,n.jsxs)(Fe.J2,{open:r,onOpenChange:e=>{e&&d(a),i(e)},children:[(0,n.jsx)(Fe.xo,{asChild:!0,children:(0,n.jsxs)(he.z,{variant:"secondary",className:(0,Ve.Z)("!rounded-[8px] px-2 py-[6xp]",t),children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)(Ue.Z,{className:"inline !size-4"}),x>0&&(0,n.jsx)("div",{className:"absolute right-0 top-0 size-2 rounded-full bg-primary"})]}),(0,n.jsx)("span",{children:"Filter"}),x>0&&(0,n.jsx)("span",{className:"text-muted-foreground/70 inline-flex h-5 max-h-full items-center rounded border border-border bg-background px-1 font-[inherit] text-[0.625rem] font-medium",children:x})]})}),(0,n.jsxs)(Fe.yk,{align:"end",className:"mt-2 w-[360px] space-y-3 rounded-2xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:"Filters"}),p>0&&(0,n.jsx)(he.z,{variant:"link",size:"xs",className:"h-auto",onClick:()=>{d({groupIds:[]})},children:"Clear"})]}),(0,n.jsx)(ie.RV,{...o,children:(0,n.jsx)("div",{className:"space-y-3",children:(0,n.jsx)(qe.Z,{name:"groupIds",selectProps:{className:"rounded-xl",placeholder:"Groups",variant:"inverted",animation:2,maxCount:3}})})}),(0,n.jsxs)("div",{className:"flex-center mt-4 gap-4",children:[(0,n.jsx)(he.z,{variant:"outline",className:"h-10 rounded-full",onClick:()=>{i(!1)},children:"Cancel"}),(0,n.jsx)(he.z,{className:"h-10 rounded-full",onClick:()=>h(),children:"Apply"})]})]})]})};var Xe=e=>{let{tableId:t,extendQuery:a={},columnVisibility:l={},shouldShowSettingsMenu:c=!0,ContextMenu:N,BulkActions:w,onChange:C,onSelectContacts:y}=e;const[I,P]=(0,s.useState)([{id:"createdAt",desc:!0}]),[E,D]=(0,s.useState)([]),[F,R]=(0,s.useState)({}),[_,T]=(0,u.v1)("search",u.Oi.withDefault("").withOptions({clearOnDefault:!0})),[z,G]=(0,u.XI)({groupIds:(0,u.S$)(u.U).withDefault([])},{clearOnDefault:!0}),L=(0,s.useMemo)((()=>d().map(I,(e=>{let{id:t,desc:a}=e;return[t,a?"DESC":"ASC"]}))),[I]),M=(0,s.useMemo)((()=>({query:{name:_,...z,...a},sorts:L})),[_,z,a,L]),[V]=(0,m.Nr)(M,400),B=(0,s.useMemo)((()=>[t,V]),[t,V]),{data:U,page:q,pageSize:J,total:$=0,fetchPage:Y,fetchPageSize:ee,refetch:te,isFetching:ae}=(0,x.ZP)({queryKey:B,queryParams:M}),ne=(0,s.useMemo)((()=>{var e,t;return null!==(t=null==U||null===(e=U.data)||void 0===e?void 0:e.list)&&void 0!==t?t:[]}),[U]),se=function(){let{ContextMenu:e,onChange:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,s.useMemo)((()=>[{id:"select",header:e=>{let{table:t}=e;var a;return(0,n.jsx)(X.X,{className:r()("",{hidden:!(null===(a=t.getRowModel().rows)||void 0===a?void 0:a.length)}),checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:e=>t.toggleAllPageRowsSelected(!!e),"aria-label":"Select all"})},cell:e=>{let{row:t}=e;return(0,n.jsx)("div",{children:(0,n.jsx)(X.X,{checked:t.getIsSelected(),onCheckedChange:e=>t.toggleSelected(!!e),"aria-label":"Select row"})})},enableSorting:!1,enableHiding:!1},{accessorKey:"fullName",sortDescFirst:!1,header:e=>{let{column:t}=e;return(0,n.jsx)(W.Z,{column:t,children:"Name"})},cell:e=>{let{row:t}=e;var a;const s=null===(a=t.original)||void 0===a?void 0:a.email,l=(0,Z.v2)(t.original,"-");return s?(0,n.jsx)(S.pn,{children:(0,n.jsxs)(S.u,{children:[(0,n.jsx)(S.aJ,{asChild:!0,children:(0,n.jsx)(b(),{passHref:!0,href:"/artist/sales?search=".concat(encodeURIComponent(s)),className:"underline underline-offset-2",children:l})}),(0,n.jsx)(S._v,{children:(0,n.jsx)(Q.x,{className:"text-[10px] font-normal text-[#191414]",children:"View this contact's purchases"})})]})}):(0,n.jsx)("div",{children:l})}},{accessorKey:"email",sortDescFirst:!1,header:e=>{let{column:t}=e;return(0,n.jsx)(W.Z,{column:t,children:"Email"})},cell:e=>{let{row:t}=e;var a;return(0,n.jsx)("div",{className:"lowercase",children:null===(a=t.original)||void 0===a?void 0:a.email})}},{accessorKey:"phoneNumber",header:()=>(0,n.jsx)("div",{children:"Phone number"}),cell:e=>{let{row:t}=e;var a;return(0,n.jsx)("div",{className:"font-medium",children:null===(a=t.original)||void 0===a?void 0:a.phoneNumber})}},{accessorKey:"subscriber",header:()=>(0,n.jsx)("div",{children:"Cohart account"}),cell:e=>{let{row:t}=e;const{subscriber:a}=t.original;return a?(0,n.jsxs)("div",{className:"flex items-center whitespace-nowrap",children:[(0,n.jsx)(b(),{passHref:!0,href:"/".concat(a.username,"/profile"),children:(0,n.jsx)(K.Z,{className:"h-[35px] w-[35px] ",src:a.coverImage})}),(0,n.jsxs)("div",{className:"ml-4",children:[(0,n.jsx)("div",{className:"w-fit",children:(0,n.jsx)(H.Z,{user:a,className:"!text-[14px] font-semibold text-kokushoku-black",maxNameLength:-1})}),(0,n.jsxs)("p",{className:"text-[10px] font-medium text-kokushoku-black/50",children:["@",a.username]})]})]}):null}},{accessorKey:"createdAt",sortDescFirst:!0,header:e=>{let{column:t}=e;return(0,n.jsx)(W.Z,{column:t,children:"Date Added"})},cell:e=>{let{row:t}=e;var a;return(0,n.jsx)("div",{className:"font-medium",children:(0,A.vc)(null===(a=t.original)||void 0===a?void 0:a.createdAt,k.um)})}},{accessorKey:"subscription",header:()=>"Subscription",cell:e=>{let{row:t}=e;var a,s,l;const r=null!==(l=null===(s=t.original)||void 0===s||null===(a=s.statistic)||void 0===a?void 0:a.campaigns)&&void 0!==l?l:[];return(0,n.jsx)(S.pn,{children:(0,n.jsxs)(S.u,{children:[(0,n.jsx)(S.aJ,{asChild:!0,children:(0,n.jsx)(Q.x,{className:"line-clamp-1",children:d().map(r,"name").join(", ")})}),(0,n.jsx)(S._v,{children:(0,n.jsx)(Q.x,{className:"text-[10px] font-normal text-[#191414]",children:d().map(r,"name").join(", ")})})]})})}},{accessorKey:"group",header:()=>"Group",cell:e=>{let{row:t}=e;var a;const s=d().map(null===(a=t.original)||void 0===a?void 0:a.linkGroupContacts,"group");return(0,n.jsx)("div",{children:d().map(s,"name").join(", ")})}},{accessorKey:"note",header:()=>"Note",cell:e=>{let{row:t}=e;var a,s;return(0,n.jsx)(O,{note:null!==(s=null===(a=t.original)||void 0===a?void 0:a.note)&&void 0!==s?s:"",truncate:!0})}}
1,{id:"actions",enableHiding:!1,meta:{cellClassName:"w-0 text-right"},cell:a=>{let{row:s}=a;var l;const r=null===(l=s.getAllCells()[0])||void 0===l?void 0:l.getContext().table.getState();return e?(0,n.jsx)(e,{contact:s.original,onChange:()=>{null==r||r.refetch(),null==t||t()}}):(0,n.jsx)(Ce,{contact:s.original,onChange:()=>{null==r||r.refetch(),null==t||t()}})}}]),[])}({ContextMenu:N,onChange:C}),le=se.length,re=(0,i.b7)({data:ne,columns:se,onSortingChange:P,onColumnFiltersChange:D,getCoreRowModel:(0,o.sC)(),getSortedRowModel:(0,o.tj)(),getFilteredRowModel:(0,o.vL)(),onRowSelectionChange:R,manualSorting:!0,enableSortingRemoval:!0,initialState:{columnVisibility:l},state:{sorting:I,columnFilters:E,rowSelection:F,refetch:te}}),ie=re.getRowModel().rows||[],oe=re.getFilteredSelectedRowModel().rows;return(0,s.useEffect)((()=>{y&&y(d().map(oe,"original"))}),[oe]),(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,n.jsx)("div",{className:"flex items-center",children:(null==oe?void 0:oe.length)>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{className:"ml-[16px]",children:[oe.length," selected"]}),(0,n.jsx)("div",{className:"ml-4 mr-2 h-[20px] w-[2px] bg-[rgba(0,_0,_0,_0.10)]"}),w?(0,n.jsx)(w,{table:re,onChange:()=>{te(),null==C||C()}}):(0,n.jsx)(Oe,{table:re,onChange:()=>{te(),null==C||C()}})]})}),(0,n.jsxs)("div",{className:"flex w-full flex-1 items-center justify-end gap-[10px]",children:[(0,n.jsxs)("div",{className:"relative w-[400px]",children:[(0,n.jsx)(p.I,{className:"peer w-full rounded-3xl !pl-[48px]",placeholder:"Search by name, email, phone number, or note",type:"search",value:_,onChange:e=>{T(e.target.value)}}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-y-0 start-0 flex items-center justify-center pl-[16px]",children:(0,n.jsx)(j.Z,{className:"h-6 w-6 text-black/70"})})]}),(0,n.jsx)(He,{value:z,onChange:e=>G(e)}),c&&(0,n.jsx)(Me,{})]})]}),(0,n.jsx)("div",{className:"rounded-md border",children:(0,n.jsx)(h.x,{orientation:"horizontal",children:(0,n.jsxs)(g.iA,{children:[(0,n.jsx)(g.xD,{children:re.getHeaderGroups().map((e=>(0,n.jsx)(g.SC,{children:e.headers.map((e=>(0,n.jsx)(g.ss,{children:e.isPlaceholder?null:(0,i.ie)(e.column.columnDef.header,e.getContext())},e.id)))},e.id)))}),(0,n.jsxs)(g.RM,{children:[ae&&(0,n.jsx)(f.Z,{table:re,rowCount:J||10}),!ae&&!ie.length&&(0,n.jsx)(g.SC,{children:(0,n.jsx)(g.pj,{colSpan:le,className:"h-24 text-center",children:"No results."})}),!ae&&ie.length>0&&d().map(ie,(e=>(0,n.jsx)(g.SC,{"data-state":e.getIsSelected()&&"selected",children:e.getVisibleCells().map((e=>{var t;return(0,n.jsx)(g.pj,{className:r()("text-left",null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.cellClassName),children:(0,i.ie)(e.column.columnDef.cell,e.getContext())},e.id)}))},e.id)))]})]})})}),(0,n.jsx)(v.Z,{page:q,pageSize:J,total:$,onPageChange:Y,onPageSizeChange:ee})]})}},696441:function(e,t,a){a.d(t,{X:function(){return o}});var n=a(785893),s=a(667294),l=a(377739),r=a(313742),i=a(406763);const o=s.forwardRef(((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(l.fC,{ref:t,className:(0,i.cn)("peer flex h-4 w-4 shrink-0 justify-center rounded-sm border border-[#808080] ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),onClick:e=>e.stopPropagation(),...s,children:(0,n.jsx)(l.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,n.jsx)(r.Z,{className:"h-4 w-4"})})})}));o.displayName=l.fC.displayName},157270:function(e,t,a){a.d(t,{Bw:function(){return g},DI:function(){return u},Ph:function(){return d},Ql:function(){return f},i4:function(){return x},ki:function(){return m},n5:function(){return v}});var n=a(785893),s=a(667294),l=a(105771),r=a(808971),i=a(884979),o=a(313742),c=a(406763);const d=l.fC,u=l.ZA,m=l.B4,x=s.forwardRef(((e,t)=>{let{className:a,children:s,...i}=e;
1return(0,n.jsxs)(l.xz,{ref:t,className:(0,c.cn)("flex h-[44px] w-full items-center justify-between gap-1 rounded-[8px] border border-input bg-background px-3 py-2 text-sm outline-none ring-offset-background focus:border-2 focus:border-[#0F6BFF] disabled:cursor-not-allowed disabled:opacity-50 data-[placeholder]:text-black/[.3] [&>span]:line-clamp-1",a),...i,children:[s,(0,n.jsx)(l.JO,{asChild:!0,children:(0,n.jsx)(r.Z,{className:"h-4 w-4 opacity-50"})})]})}));x.displayName=l.xz.displayName;const p=s.forwardRef(((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(l.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})}));p.displayName=l.u_.displayName;const h=s.forwardRef(((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(l.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",a),...s,children:(0,n.jsx)(r.Z,{className:"h-4 w-4"})})}));h.displayName=l.$G.displayName;const g=s.forwardRef(((e,t)=>{let{className:a,children:s,position:r="popper",...i}=e;return(0,n.jsx)(l.h_,{children:(0,n.jsxs)(l.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:r,...i,children:[(0,n.jsx)(p,{}),(0,n.jsx)(l.l_,{className:(0,c.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,n.jsx)(h,{})]})})}));g.displayName=l.VY.displayName;const v=s.forwardRef(((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(l.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...s})}));v.displayName=l.__.displayName;const f=s.forwardRef(((e,t)=>{let{className:a,children:s,...r}=e;return(0,n.jsxs)(l.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...r,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(l.wU,{children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(l.eT,{children:s})]})}));f.displayName=l.ck.displayName;s.forwardRef(((e,t)=>{let{className:a,...s}=e;return(0,n.jsx)(l.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",a),...s})})).displayName=l.Z0.displayName},856665:function(e,t,a){a.d(t,{SP:function(){return d},dr:function(){return c},mQ:function(){return o},nU:function(){return u}});var n=a(785893),s=a(360434),l=a(667294),r=a(406763),i=a(609852);const o=s.fC,c=l.forwardRef(((e,t)=>{let{className:a,...l}=e;return(0,n.jsx)(s.aV,{ref:t,className:(0,r.cn)("text-muted-foreground/70 inline-flex w-full items-center justify-center gap-2 rounded-lg bg-muted p-0.5",a),...l})}));c.displayName=s.aV.displayName;const d=l.forwardRef(((e,t)=>{let{className:a,children:l,...o}=e;return(0,n.jsx)(s.xz,{ref:t,className:(0,r.cn)("inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium outline-offset-2 transition-all hover:text-muted-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:border-[#0F6BFF] data-[state=active]:text-[#0F6BFF]",a),asChild:!0,...o,children:(0,n.jsx)(i.z,{variant:"outline",children:l})})}));d.displayName=s.xz.displayName;const u=l.forwardRef(((e,t)=>{let{className:a,...l}=e;return(0,n.jsx)(s.VY,{ref:t,className:(0,r.cn)("mt-2 outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70",a),...l})}));u.displayName=s.VY.displayName},838490:function(e,t,a){a.d(t,{OV:function(){return l.OV},jm:function(){return d},nC:function(){return o},v8:function(){return r}});var n=a(496486),s=a.n(n),l=a(342716);const r=e=>{switch(e){case l.Xp:return{label:"Discover"};case l.Hi:return{label:"Top Picks"};case l.yi:return{label:"Discover Artists"};case l.SE:return{label:"Discover Galleries"};case l.dH:return{label:"Get Inspired"};case l.gP:return{label:"Editorial"};case l.fd:return{label:"AI Curator"};case l.FC:return{label:"Artwork Details"};case l.tA:return{label:"Private View"};case l.NI:return{label:"Direct Sale Link"};case l.qS:return{label:"QR Code"};case l.Jt:return{label:"Profile Page"};case l.XH:return{label:"Portfolio Page"};case l.Mg:return{label:"Event Page"};case l.i9:return{label:"Event Storefront"};case l.OV:return{label:"Invoice Checkout"};case l.ES:return{label:"Tap to Pay"};case l.KA:return{label:"Business App Card"};case l.J5:return{label:"Custom Website"};case l.Ex:return{label:"Campaign Email"};case l.EW:return{label:"Platform Marketing Email"};case l.vq:return{label:"Facebook Ad"};case l.vc:return{label:"Social Share"};case l._r:return{label:"Marketplace"};default:return{label:e}}},i={DISCOVER:l.Xp,TOP_PICKS:l.Hi,DISCOVER_ARTISTS:l.yi,DISCOVER_GALLERIES:l.SE,GET_INSPIRED:l.dH,EDITORIAL:l.gP,AI_CURATOR:l.fd,ARTWORK_DETAILS:l.FC,PRIVATE_VIEW:l.tA,DIRECT_SALE_LINK:l.NI,QR_CODE:l.qS,PROFILE_PAGE:l.Jt,PORTFOLIO_PAGE:l.XH,EVENT_PAGE:l.Mg,EVENT_LANDING_PAGE:l.i9,INVOICE_CHECKOUT:l.OV,TAP_TO_PAY:l.ES,BUSINESS_APP_CARD:l.KA,CUSTOM_WEBSITE:l.J5,CRM_CAMPAIGN:l.Ex,PLATFORM_MARKETING_EMAIL:l.EW,FACEBOOK:l.vq,SOCIAL_SHARING:l.vc,MARKETPLACE:l._r},o=s().without(s().values(i),l.FC,l.tA,l.NI,l.qS,l.OV,l.ES,l.KA,l.J5,l.Ex),c=[{heading:"Discovery",sources:[l.Xp,l.Hi,l.yi,l.SE,l.dH,l.gP]},{heading:"Coco AI",sources:[l.fd]},{heading:"Artwork details",sources:[l.FC,l.tA]},{heading:"Direct sale",sources:[l.NI,l.qS]},{heading:"Profiles",sources:[l.Jt,l.XH]},{heading:"Event page",sources:[l.Mg,l.i9]},{heading:"Invoice",sources:[l.OV]},{heading:"In-person sale channels",sources:[l.ES,l.KA]},{heading:"Custom website",sources:[l.J5]},{heading:"Mailing",sources:[l.Ex,l.EW]},{heading:"Acquisition channels",sources:[l.vc]},{heading:"Fallback",sources:[l._r]}],d=s().flatMap(c,(e=>{let{heading:t,sources:a}=e;return s().map(a,(e=>({value:e,label:r(e).label,group:t})))}))},818542:function(e,t,a){var n=a(785893),s=a(667294),l=a(3793),r=a(287536),i=a(248583),o=a(496486),c=a.n(o),d=a(74810),u=a(674674),m=a(604811);const x=e=>{let{name:t,selectProps:a={},extendQuery:o={},extendRequestPayload:x={},customOption:p,mutateOptions:h={},...g}=e;const{onChange:v}=a,{control:f}=(0,r.Gc)(),{field:j}=(0,r.bc)({name:t,control:f}),N=(0,s.useMemo)((()=>
1{if(j.value)return Array.isArray(j.value)?j.value:[j.value]}),[j.value]),[b,w]=(0,s.useState)(Array.isArray(j.value)?j.value.length>0:!!j.value),[C,y]=(0,s.useState)(""),{data:I,isFetching:k,isLoading:S,refetch:P}=(0,d.ZP)({queryParams:{page:1,pageSize:b?Math.max((null==N?void 0:N.length)||0,10):10,query:{name:C,groupIds:b?N:void 0,excludeGroupIds:b?void 0:N,...o},...x},queryOptions:{enabled:!1,...h}});var E;const{list:Z=[]}=null!==(E=null==I?void 0:I.data)&&void 0!==E?E:{},A=(0,i.Dv)((0,m.qY)(N)),D=(0,s.useMemo)((()=>c().map(c().uniqBy(c().filter([...A,...Z],(e=>!!e)),"id"),((e,t)=>p?p({group:e,index:t}):{value:e.id,label:e.name}))),[Z,A,p]),F=(0,l.S)((()=>P({cancelRefetch:!0})),300);return(0,s.useLayoutEffect)((()=>{b&&(P({cancelRefetch:!0}),w(!1))}),[P,b]),(0,n.jsx)(u.Z,{...g,name:t,options:D,selectProps:{...a,manualFilter:!0,searchValue:C,isLoading:k,isFirstTimeLoading:S,onSearchValueChange:e=>{y(e),F()},onChange:(e,t,a)=>{"remove"===a&&F(),v&&v(e,t)},onPopoverOpen:()=>F()}})};t.Z=(0,s.memo)(x)},674674:function(e,t,a){var n=a(785893),s=a(667294),l=a(45697),r=a.n(l),i=a(693967),o=a.n(i),c=a(287536),d=a(496486),u=a.n(d),m=a(481835),x=a(441115);const p=e=>{let{name:t,label:a,options:l,labelProps:r={},selectProps:i={}}=e;const{className:d,...p}=r,{onChange:h}=i,{control:g}=(0,c.Gc)(),v=i.options||l,f=(0,s.useMemo)((()=>u().keyBy(v,"value")),[v]);return(0,n.jsx)(m.Wi,{control:g,name:t,render:e=>{let{field:{onChange:t,value:s,ref:l}}=e;return(0,n.jsxs)(m.xJ,{children:[a&&(0,n.jsx)(m.lX,{className:o()("text-xs font-bold tracking-[0.6px] text-black/[.5]",d),...p,children:a}),(0,n.jsx)(m.NI,{children:(0,n.jsx)(x.N,{options:v,onValueChange:(e,a)=>{t(e);const n=u().map(e,(e=>f[e]));null==h||h(e,n,a)},defaultValue:s,ref:l,...i},JSON.stringify(s))}),(0,n.jsx)(m.zG,{})]})}})};p.propTypes={name:r().string.isRequired,label:r().string,options:r().array.isRequired,labelProps:r().object,selectProps:r().object},t.Z=p},557752:function(e,t,a){a.d(t,{$_:function(){return c},hB:function(){return d}});var n=a(164751),s=a(295495),l=a(496486),r=a.n(l),i=a(260564);const o=(0,s.xu)((e=>{let{id:t}=e;return(0,n.cn)(null)}),i.W),c=(0,s.xu)((e=>(0,n.cn)((t=>r().map(e||[],(e=>t(o({id:e})))))))),d=(e,t,a)=>{let{contact:n}=a;n&&t(o({id:n.id}),(function(){return{...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},...n}}))}},837312:function(e,t,a){var n=a(785893),s=a(306785),l=a(110761),r=a(928554),i=a(609852);t.Z=e=>{let{children:t,column:a}=e;return(0,n.jsxs)(i.z,{variant:"ghost",className:"!bg-transparent p-0",onClick:a.getToggleSortingHandler(),children:[t,!a.getIsSorted()&&(0,n.jsx)(s.Z,{className:"text-muted-foreground",stroke:2}),"asc"===a.getIsSorted()&&(0,n.jsx)(l.Z,{className:"text-foreground",stroke:2}),"desc"===a.getIsSorted()&&(0,n.jsx)(r.Z,{className:"text-foreground",stroke:2})]})}},859160:function(e,t,a){var n=a(785893),s=a(693967),l=a.n(s),r=a(787559),i=a(157270),o=a(286810),c=a(932361);const d=[5,10,25,50,100];t.Z=e=>{let{className:t,page:a,pageSize:s,total:u,rowsPerPage:m=d,scrollTargetRef:x,onPageChange:p,onPageSizeChange:h}=e;const g=(a-1)*s+1,v=Math.min(Math.max((a-1)*s+s,0),u);return u?(0,n.jsxs)("div",{className:l()("flex flex-col-reverse items-center justify-between gap-4 space-x-2 py-4 lg:flex-row",t),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(r._,{className:"min-w-max",children:"Items per page"}),(0,n.jsxs)(i.Ph,{value:s,onValueChange:h,children:[(0,n.jsx)(i.i4,{children:(0,n.jsx)(i.ki,{placeholder:"Select number of results"})}),(0,n.jsx)(i.Bw,{children:m.map((e=>(0,n.jsx)(i.Ql,{value:e,children:e},e)))})]})]}),(0,n.jsxs)("div",{className:"flex flex-col items-center gap-4 lg:flex-row",children:[(0,n.jsxs)("p",{className:"space-x-1 whitespace-nowrap text-sm text-muted-foreground","aria-live":"polite",children:[(0,n.jsxs)("span",{className:"text-foreground",children:[(0,c.uf)(g),"-",(0,c.uf)(v)]}),(0,n.jsx)("span",{children:"of"}),(0,n.jsx)("span",{className:"text-foreground",children:(0,c.uf)(u)})]}),(0,n.jsx)(o.Z,{pageIndex:a,totalPage:Math.ceil(u/s),onPageChange:e=>{p(e),(null==x?void 0:x.current)?x.current.scrollIntoView({behavior:"smooth",block:"start"}):window.scrollTo({top:0,behavior:"smooth"})}})]})]}):null}},670281:function(e,t,a){var n=a(785893),s=a(591214),l=a(162049);t.Z=e=>{let{table:t,columnCount:a,rowCount:r=10,cellClassName:i}=e;const o=t?t.getVisibleLeafColumns():Array.from({length:null!=a?a:1});return(0,n.jsx)(n.Fragment,{children:Array.from({length:r}).map(((e,t)=>(0,n.jsx)(s.SC,{className:"hover:bg-transparent",children:o.map(((e,t)=>{var a;return(0,n.jsx)(s.pj,{className:i,children:(0,n.jsx)(l.O,{className:"h-4 w-full"})},null!==(a=null==e?void 0:e.id)&&void 0!==a?a:"skeleton-cell-".concat(t))}))},"skeleton-row-".concat(t))))})}},774778:function(e,t,a){var n=a(667294),s=a(979617),l=a(905068),r=a(983464),i=a(970004);t.Z=e=>{const t=(0,n.useMemo)((()=>(0,s.G5)(e)),[e]),a=(0,n.useCallback)((async e=>{const t=await(0,r.Dt)(i.x.get)(e),{data:a}=t.data;return a}),[]),o=(0,l.ZP)(t,a,{revalidateOnFocus:!1}),{data:c,isLoading:d}=o;return{data:c,isLoading:d}}}}]);

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.