1(self.webpackChunkfront=self.webpackChunkfront||[]).push([["2776"],{90165(e,t,s){"use strict";let a=s(27074);e.exports=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw TypeError("Expected `concurrency` to be a number from 1 and up");let t=new a,s=0,l=async(e,a,...l)=>{s++;let i=(async()=>e(...l))();a(i);try{await i}catch{}s--,t.size>0&&t.dequeue()()},i=(a,...i)=>new Promise(r=>{((a,i,...r)=>{t.enqueue(l.bind(null,a,i,...r)),(async()=>{await Promise.resolve(),s<e&&t.size>0&&t.dequeue()()})()})(a,r,...i)});return Object.defineProperties(i,{activeCount:{get:()=>s},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),i}},27074(e){class t{constructor(e){this.value=e,this.next=void 0}}class s{constructor(){this.clear()}enqueue(e){let s=new t(e);this._head?this._tail.next=s:this._head=s,this._tail=s,this._size++}dequeue(){let e=this._head;if(e)return this._head=this._head.next,this._size--,e.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let e=this._head;for(;e;)yield e.value,e=e.next}}e.exports=s},59901(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>tu});var a=s(74848),l=s(96540),i=s(6442),r=s(56347),o=s(50805),n=s(16785),d=s(69508),c=s(53623),m=s(28073),u=s(64565),p=s(74917),g=s(85539),x=s(88312),h=s(9421),f=s(26374),_=s(10617),b=s(67967),y=s.n(b),v=s(75186),j=s(46128),A=s(2543),C=s(55378),I=s.n(C),w=s(55373),S=s.n(w),k=s(33437),E=s(95392),M=s(96049),N=s(98473),D=s(7175),T=s(74325),R=s(59701),F=s(96298),L=s(84638),$=s(71458),O=s(4141),U=s(65297),z=s(74049),H=s(69507),B=s(33898),V=s(85966),q=s(42634),K=s(34802),G=s(46781),Y=s(14708),P=s(58065),W=s(63064),X=s(22192),J=s(54510),Z=s(52741),Q=s(50400),ee=s(95093),et=s.n(ee),es=s(7208),ea=s(19633),el=s(29027),ei=s(93015);let er=e=>{let{title:t,style:s,showIcon:i,changeShowState:r}=e,[o,n]=(0,l.useState)(!1);return(0,a.jsxs)("div",{className:"src-pages-customer-customerEdit-component-index-module__card-title--Ssnu5",style:{...s},onClick:()=>{null==r||r(!o),n(!o)},children:[(0,a.jsx)("h5",{className:"src-pages-customer-customerEdit-component-index-module__title--r_I85",children:t}),i&&(0,a.jsx)(T.A,{className:"src-pages-customer-customerEdit-component-index-module__list-more--gn_KP",type:o?"icon-ic_up":"icon-ic_down-2"})]})},eo=/^\+[0-9-+]{2,30}$/i,en=e=>{var t,s;let{id:r,getLoading:n,customerInfo:d,titleStyle:c,onContactDelete:m}=e,u=(0,i.A)(),[p]=X.A.useForm(),[g]=X.A.useForm(),[x]=X.A.useForm(),h=(null==(t=(0,V.G)(B.mB))?void 0:t.storeId)||Number(localStorage.getItem("quick-storeId")),[_,b]=(0,l.useState)([]),y=(0,W.jE)(),{data:v}=(0,$.Ay)(void 0,"1"),{hasSensitivePermission:j}=(0,es.A)(void 0,"1"),A=(0,l.useMemo)(()=>{let e=new Map;return _.flat().forEach(t=>{(null==t?void 0:t.fieldName)&&(null==t?void 0:t.fieldDesc)&&e.set(t.fieldName,t.fieldDesc)}),e},[_]),C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/[,ï¼]/).map(e=>e.trim()).filter(Boolean).map(e=>A.get(e)||e).join("ã")},I=(0,l.useMemo)(()=>j?[]:_.flat().filter(e=>{var t,s,a,l;return(null==e?void 0:e.fieldName)&&e.sensitiveEnabled&&(Array.isArray((t=e.fieldName,l=null!=(s=null==d||null==(a=d.properties)?void 0:a[t])?s:null==d?void 0:d[t]))?l.length>0:null!=l&&""!==String(l).trim())}).map(e=>e.fieldName),[d,_,j]);(0,l.useEffect)(()=>{if(v){let{basic:e,media:t,other:s,system:a}=v;b([null==e?void 0:e.settings.filter(e=>"subscribeState"!==e.fieldName&&"phoneSubscribeState"!==e.fieldName&&"lineSubscribeState"!==e.fieldName&&"10"!==e.fieldType),null==t?void 0:t.settings,null==s?void 0:s.settings,null==a?void 0:a.settings])}},[v]);let w=(0,l.useRef)([]),S=(0,l.useRef)("");(0,l.useEffect)(()=>{if(d&&_[0]){var e;let t=JSON.parse(JSON.stringify(d));t.country=t.country?[t.country,t.province]:[],t.phoneSubscribeState=null!=(e=t.phoneSubscribeState)?e:1,p.setFieldsValue({...t,...t.properties}),g.setFieldsValue({...t,...t.properties}),x.setFieldsValue({...t,...t.properties}),_.forEach(e=>{w.current=[...w.current,...e.map(e=>{if(2===e.createSource)return e.fieldName})]}),w.current=[...new Set(w.current)]}},[d,p,x,g,_]);let{mutate:k,isLoading:E}=(0,f.n)(e=>(0,M.Gk)(e,!0),{onSuccess:()=>{y.invalidateQueries([N.XN]),y.invalidateQueries([N.Dp])},onError:e=>{if(5001===e.code){let t=C(e.message);J.Ay.error($i18n("msOLEeG",{field:t}))}else J.Ay.error(e.message)}}),D=(e,t)=>{e.validateFields().then(e=>{let s={...e},a={...s.properties||{}};
1if(I.forEach(e=>{delete s[e],delete a[e]}),Object.keys(s).forEach(e=>{w.current.includes(e)&&(a[e]=s[e],delete s[e])}),s.properties=a,s.country){let[e,t]=s.country;s.country=e,s.province=t}if(s.userUUID=r,s.ak=h,S.current=t,s.whatsapp){let e=(0,ea.nc)(s.whatsapp);if(!eo.test(e))return void J.Ay.error(`WhatsApp${u.messages.formatError}`,5);s.whatsapp=e}k(s)}).catch(()=>{})},[T,R]=(0,l.useState)(!1),[F,L]=(0,l.useState)(!1),[O,U]=(0,l.useState)(!1),z=(e,t)=>{let s={basic:p,media:g,other:x}[t];return(0,a.jsxs)(X.A,{className:"src-pages-customer-customerEdit-component-index-module__basic-form--vbAa_",colon:!1,form:s,initialValues:{phoneSubscribeState:1,subscribeState:0},labelAlign:"left",labelCol:{span:9},validateMessages:ei.Z5,wrapperCol:{span:15},onValuesChange:(e,t)=>{e.birthday&&s.setFieldsValue({...t,age:et()().diff(et()(e.birthday,"YYYY-MM-DD"),"year")})},children:[(0,a.jsx)(ei.eI,{contactDeleteAk:h,contactDeleteUserUUID:r,container:document.getElementById("customer-edit"),customerInfo:d,disabledFieldNames:I,form:s,formType:t,handleSubmit:D,line:null==d?void 0:d.line,lineAccounts:null==d?void 0:d.lineAccounts,list:e,orderEmailSubscribe:null==d?void 0:d.orderEmailSubscribe,showContactDelete:"basic"===t,showOrderEmailSubscribe:null==d?void 0:d.showOrderEmailSubscribe,type:"baseInfo",onContactDelete:m}),"media"===t&&(null==d?void 0:d.amazon)&&(0,a.jsxs)("div",{className:"flex gap-x-[69px]",children:[(0,a.jsx)("span",{children:"Amazon"}),(0,a.jsx)("span",{className:"text-ellipsis break-all flex-1 w-full",children:null==d?void 0:d.amazon})]}),(null==e?void 0:e.length)>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Z.A,{style:{marginTop:16}}),(0,a.jsx)(Q.A,{loading:t===S.current&&E,style:{float:"right",marginTop:-8,marginBottom:16},type:"primary",onClick:()=>D(s,t),children:(0,a.jsx)(P.A,{id:"save"})})]})]})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{active:!0,loading:n,children:z(_[0],"basic")}),(0,a.jsx)(er,{showIcon:!0,changeShowState:R,style:c,title:u.formatMessage({id:"cus.draggable.media"})}),T&&z(_[1],"media"),(0,a.jsx)(er,{showIcon:!0,changeShowState:L,style:c,title:u.formatMessage({id:"cus.draggable.other"})}),F&&z(_[2],"other"),(0,a.jsx)(er,{showIcon:!0,changeShowState:U,style:c,title:u.formatMessage({id:"cus.draggable.system"})}),O&&(0,a.jsx)("div",{className:"src-pages-customer-customerEdit-component-index-module__basic-extra--FAFLf",children:(null==(s=_[3])?void 0:s.length)&&_[3].filter(e=>["deviceId","os","browser","ip","searchSource","searchSourceKey","refererUrl","chatRefererUrl","chatCurrentUrl"].includes(e.fieldName)).map(e=>{let{fieldDesc:t,fieldName:s}=e;return(0,a.jsx)("p",{children:"ip"===s?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{title:u.formatMessage({id:"cus.other.ip"}),children:(0,a.jsx)(P.A,{id:"cus.other.ip"})}),(0,a.jsxs)("span",{children:[d.ip,"/",d.country?`${d.country}${d.province?`, ${d.province}`:""}`:u.formatMessage({id:"cus.info.none"}),(0,a.jsx)("img",{alt:"",src:`https://purecatamphetamine.github.io/country-flag-icons/3x2/${el.V[d.country]}.svg`,style:{width:15,marginLeft:4,marginTop:-2}})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{title:t,children:t}),(0,a.jsx)("span",{title:d[s],children:d[s]||("searchSource"===s?u.formatMessage({id:"cus.info.unknown"}):u.formatMessage({id:"cus.info.none"}))})]})},s)})})]})};var ed=s(57256),ec=s(26933),em=s(89156),eu=s(17884),ep=s(6824),eg=s(41477),ex=s(91750),eh=s(95943),ef=s(2064),e_=s(99038),eb=s(7937),ey=s(85972),ev=s(93210),ej=s(56115),eA=s(46388),eC=s(21399),eI=s(43357),ew=s(34724);let eS={font12:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__font12--_m7bT",font14:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__font14--Fw6MT",font16:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__font16--PBVus",font20:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__font20--zM9qy",warn:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__warn--iQr5W",success:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__success--nuvpt",error:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__error--mdq5d",ellipsis:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__ellipsis--YgPxP","ellipsis-2":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__ellipsis-2--ppn67",pointer:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__pointer--bW7eV","guide-modal":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__guide
1-modal--ds4z4","guide-special":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__guide-special--unyIO","scroll-hidden":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__scroll-hidden--PlFis",flexCenter:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__flexCenter--VBAzY","table-content":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__table-content--PnIRw","filter-header":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__filter-header--o_rt2","table-title":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__table-title--Bzxar",selector:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__selector--WF0YR",icon:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__icon--iIuWL",dropdown:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__dropdown--brXuz",filters:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__filters--qbfbi",player_opt_wrapper:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__player_opt_wrapper--ntYB1",player_opt:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__player_opt--jl8PP",player_download:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__player_download--eUIK7",audio_comp:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__audio_comp--T_eNf",pagination:"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__pagination--TUQ4A","table-status":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__table-status--q64Lb","status-new":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-new--RJMGh","status-open":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-open--SWMT7","status-waitReply":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-waitReply--hO8Xq","status-waitReturn":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-waitReturn--x095d","status-resolved":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-resolved--cqlGa","status-closed":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-closed--JWmCe","status-draft":"src-pages-customer-customerEdit-component-CommunicateRecordDetail-tsx-index-module__status-draft--wFHKx"},ek={page_number:1,page_size:10,total:0},eE="YYYY-MM-DD HH:mm:ss",eM=(0,l.memo)(e=>{let{visitorId:t}=e,[s]=X.A.useForm(),i=(0,e_.A)(),[r,o]=(0,l.useState)(""),[n,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(null),[u,p]=(0,l.useState)(ek),[g,x]=(0,l.useState)({start_time:et()(ej.wn["0"]).format("yyyy-MM-DD HH:mm:ss"),end_time:et()(ej.wn["1"]).format("yyyy-MM-DD HH:mm:ss")}),f=(0,l.useMemo)(()=>{let{total:e,...t}=u;return{...t,...g}},[u,g]),{data:b,isInitialLoading:y}=(0,h.I)(["getCallRecordsList",f],()=>(0,_.Zh)({...f,visitorId:t,store_id:i}),{select:e=>({list:e.data.records,raw:e.data}),onSuccess:e=>{p(t=>({...t,page_number:e.raw.currentPage,total:e.raw.total}))}}),v=(0,l.useCallback)(e=>{let{call_sheet_id:t}=e;r===t?o(""):o(t)},[r]),j=(0,l.useMemo)(()=>[{title:ew.A.formatMessage({id:"apiData.phone.table.columns.callNo",defaultMessage:"主å«å·ç "}),fixed:"left",width:180,dataIndex:"call_no"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.calledNo",defaultMessage:"被å«å·ç "}),fixed:"left",width:180,dataIndex:"called_no"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.callSheetID",defaultMessage:"å¤çå·¥å·"}),width:200,dataIndex:"agent_no"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.agentName",defaultMessage:"å¤ç座å¸"}),width:250,dataIndex:"agent_name"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.connectType",defaultMessage:"å¼å«ç±»å"}),width:150,dataIndex:"connect_type",render:e=>{var t;return null===ey.Y1||void 0===ey.Y1||null==(t=ey.Y1[`${e}`])?void 0:t.label}},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.status",defaultMessage:"éè¯ç¶æ"}),width:200,dataIndex:"status",render:e=>{var t;return null===ey.c_||void 0===ey.c_||null==(t=ey.c_[`${e}`])?void 0:t.label}},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.offeringTime",defaultMessage:"å¼å«åèµ·æ¶é´"}),width:220,dataIndex:"offering_time",render:e=>{if(e)return et()(e).format(eE)}},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.beginTime",defaultMessage:"éè¯æ¥éæ¶é´"}),width:240,dataIndex:"begin_time",render:e=>{if(e)return et()(e).format(eE)}},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.timer.all",defaultMessage:"éè¯æ¶é¿"}),width:160,dataIndex:"call_duration",render:e=>e||"--"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.recordFileUrl",defaultMessage:"éè¯å½é³"}),width:200,dataIndex:"record_file_url",render:(e,t)=>e?(0,a.jsxs)("div",{className:eS.player_opt_wrapper,children:[(0,a.jsx)("span",{onClick:()=>v(t),children:r!==(null==t?void 0:t.call_sheet_id)?(0,a.jsx)(ex.A,{className:eS.player_opt}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eh.A,{className:eS.player_opt}),(0,a.jsx)(eA.s,{url:null==t?void 0:t.record_file_url})]})}),(0,a.jsx)("span",{onClick:()=>{var e;return e=null==t?void 0:t.record_file_url,void(0,eI.lK)(e,e)},children:(0,a.jsx)(ef.A,{className:eS.player_download})})]}):"--"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.name",defaultMessage:"客æ·åç§°"}),width:140,dataIndex:"customer_name",render:e=>e||"--"},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.endTimer",defaultMessage:"ç»ææ¶é´"}),width:200,dataIndex:"end_time",render:e=>{if(e)return et()(e).format(eE)}},{title:ew.A.formatMessage({id:"apiData.phone.table.columns.opt",defaultMessage:"æä½"}),width:120,dataIndex:"opt",fixed:"right",render:(e,t)=>(0,a.jsx)("div",{children:(0,a.jsx)(Q.A,{type:"link",onClick:()=>{d(!0),m(t)},children:ew.A.formatMessage({id:"apiData.phone.table.columns.detail.btn",defaultMessage:"详æ
"})})})}],[r,v]);return(0,a.jsxs)("div",{children:[(0,a.jsxs)(X.A,{className:"mb-20px",form:s,initialValues:{startEndTime:ej.wn},layout:"inline",onValuesChange:(e,t)=>
1{p(e=>({...e,page_number:1}));let{startEndTime:s,...a}=t,l={...g,...a};(null==s?void 0:s.length)&&(l.start_time=et()(s[0]).format("yyyy-MM-DD HH:mm:ss"),l.end_time=et()(s[1]).format("yyyy-MM-DD HH:mm:ss")),x(l)},children:[(0,a.jsx)(X.A.Item,{label:$i18n("165vMydK"),name:"startEndTime",children:(0,a.jsx)(eC.A,{allowClear:!1,format:"YYYY/MM/DD HH:mm",ranges:ej.lC})}),(0,a.jsx)(X.A.Item,{name:"connect_type",children:(0,a.jsx)(ep.A,{allowClear:!0,mode:"multiple",options:Object.values(ey.Y1),placeholder:$i18n("165vMydL"),style:{width:"200px"}})}),(0,a.jsx)(X.A.Item,{name:"call_status",children:(0,a.jsx)(ep.A,{allowClear:!0,mode:"multiple",options:Object.values(ey.c_),placeholder:$i18n("165vMydM"),style:{width:"200px"}})})]}),(0,a.jsx)(eb.A,{children:(0,a.jsx)(eg.A,{columns:j,dataSource:null==b?void 0:b.list,loading:y,rowKey:"call_sheet_id",scroll:{x:1620},pagination:{...u,current:u.page_number,pageSize:u.page_size,size:"small"},onChange:e=>{p({page_size:e.pageSize,page_number:e.current,total:e.total})}})}),(0,a.jsx)(ev.A,{cancelHandle:()=>{d(!1),m(null)},content:c||{},visible:n})]})});var eN=s(9215),eD=s(56071),eT=s(52323),eR=s(89649),eF=s(34808),eL=s(18620),e$=s(93063);let eO={current:1,pageSize:10,total:0},eU=(0,l.memo)(e=>{var t;let{visitorId:s}=e,[i]=X.A.useForm(),[r,o]=(0,l.useState)(eO),[n,d]=(0,l.useState)({startTimeMin:et()(ej.wn["0"]).format("yyyy-MM-DD HH:mm:ss"),startTimeMax:et()(ej.wn["1"]).format("yyyy-MM-DD HH:mm:ss")}),{ref:c,showModal:m}=(0,eL.A)(),{sourceData:u}=(0,em.VR)(),p=(0,em.VK)(),g=(0,l.useMemo)(()=>{let{total:e,current:t,...s}=r;return{...s,...n,pageNum:t}},[r,n]),{data:x,isInitialLoading:f}=(0,h.I)(["getChatRecordsList",g],()=>(0,_.Dx)({...g,visitorId:s}),{select:e=>({list:e.data.list,raw:e.data}),onSuccess:e=>{o({current:e.raw.pageNum,pageSize:e.raw.pageSize,total:Number(e.raw.total||0)}),p({params:{...g,visitorId:s}})}});return(0,a.jsxs)("div",{children:[(0,a.jsxs)(X.A,{className:"mb-20px",form:i,initialValues:{startEndTime:ej.wn},layout:"inline",onValuesChange:(e,t)=>
1{let{startEndTime:a,channels:l,tagIds:i}=t;o(e=>({...e,current:1}));let r={...n,tagIds:i};l&&(r.channels=(0,eF.A)(l)),(null==a?void 0:a.length)&&(r.startTimeMin=et()(a[0]).format("yyyy-MM-DD HH:mm:ss"),r.startTimeMax=et()(a[1]).format("yyyy-MM-DD HH:mm:ss")),d(r),p({params:{...r,pageNum:"1",pageSize:"10",visitorId:s}})},children:[(0,a.jsx)(X.A.Item,{label:$i18n("17L4sbXw"),name:"startEndTime",children:(0,a.jsx)(eC.A,{allowClear:!1,format:"YYYY/MM/DD HH:mm",ranges:ej.lC})}),(0,a.jsx)(X.A.Item,{name:"channels",children:(0,a.jsx)(eN.is,{hideCall:!0,notShowAll:!0,hideSms:!1,maxTagCount:"responsive",placeHolder:$i18n("17L4sbXx"),style:{width:230},valueFormate:e$.UP})}),(0,a.jsx)(X.A.Item,{name:"tagIds",children:(0,a.jsx)(eD.A,{labelInValue:!0,minWidth:200,placeholder:$i18n("17L4sbXy")})})]}),(0,a.jsx)(eb.A,{children:(0,a.jsx)(eg.A,{columns:u.filter(e=>e.active).concat([{name:"operation",active:!0}]).map(e=>(0,eR.R)(e,m)),dataSource:null==x?void 0:x.list,loading:f,rowKey:"chatSubSessionId",scroll:{x:"100%"},pagination:{...r,size:"small"},onChange:e=>{o({pageSize:e.pageSize,current:e.current,total:e.total})}})}),(0,a.jsx)("div",{style:{marginTop:(null==x||null==(t=x.list)?void 0:t.length)?"-40px":"16px"},children:$i18n("17L4rk6C")}),(0,a.jsx)(eT.A,{ref:c})]})});var ez=s(9660),eH=s(92994);let eB=y().bind(eS),eV={pageNumber:1,pageSize:10,total:0},eq=(0,l.memo)(e=>{let{visitorId:t}=e,[s]=X.A.useForm(),i=(0,l.useRef)(!1),[r,o]=(0,l.useState)(eV),[n,d]=(0,l.useState)([]),{goto:c}=(0,x.EV)(),[m,u]=(0,l.useState)([{field:"create_time",operator:"between",values:ej.wn.map(e=>et()(e).format("yyyy-MM-DD HH:mm:ss"))}]),p=(0,l.useMemo)(()=>{let{total:e,...t}=r;return{...t,filterConditions:m}},[r,m]),{isInitialLoading:g}=(0,h.I)(["getTicketRecordsList",p],()=>(0,_.jE)({...p,visitorId:t}),{select:e=>e.data,onSuccess:e=>{d(e.records),o({pageNumber:e.pageNumber,pageSize:e.pageSize,total:Number(e.total||0)})}});(0,l.useEffect)(()=>{let e=sessionStorage.getItem("ticket_management_data");if(e&&s){let t=JSON.parse(e),a=t.formData;d((null==t?void 0:t.list)||[]),Array.isArray(a.create_time)&&(a.create_time=a.create_time.map(e=>et()(e))),requestAnimationFrame(()=>{s.setFieldsValue(a)})}return()=>{i.current||sessionStorage.removeItem("ticket_management_data")}},[s]);let f=[{title:$i18n("o2PqH1j"),dataIndex:"topic",key:"topic"},{title:$i18n("version.213.menu.status"),dataIndex:"status",key:"status",render:e=>(0,a.jsx)("span",{className:eB(`status-${e}`,"table-status"),children:eH.E3[e]})},{title:$i18n("o2PqH1k"),dataIndex:"priority",key:"priority",render:e=>(0,a.jsx)("span",{children:e||"-"})},{title:$i18n("createTime"),dataIndex:"createTime",key:"createTime",render:e=>(0,a.jsx)("span",{children:e||"-"})},{title:$i18n("rdk9G3F"),dataIndex:"channel",key:"channel"},{title:$i18n("o2PqH1n"),dataIndex:"handler",key:"handler",render:e=>(0,a.jsx)("div",{children:null==e?void 0:e.map(e=>(0,a.jsx)("div",{children:e.text},e.text))})},{title:$i18n("version.213.menu.operations"),dataIndex:"operation",key:"operation",render:(e,t)=>(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(Q.A,{type:"link",onClick:()=>{let{chatSubSessionId:e,ticketId:a}=t;e&&a&&(sessionStorage.setItem("ticket_management_data",JSON.stringify({formData:s.getFieldsValue(),list:n})),i.current=!0,c(e,a))},children:$i18n("1d41HjpA")})})}];return(0,a.jsxs)("div",{children:[(0,a.jsxs)(X.A,{className:"mb-20px",form:s,initialValues:{create_time:ej.wn},layout:"inline",onValuesChange:(e,t)=>
1{o(e=>({...e,pageNumber:1})),u(Object.keys(t).filter(e=>!!t[e]).map(e=>({field:e,operator:"create_time"===e?"between":"equals_any",values:"create_time"===e?t.create_time.map(e=>et()(e).format("yyyy-MM-DD HH:mm:ss")):t[e]})))},children:[(0,a.jsx)(X.A.Item,{label:$i18n("1d41HpAu"),name:"create_time",children:(0,a.jsx)(eC.A,{allowClear:!1,format:"YYYY/MM/DD HH:mm",ranges:ej.lC})}),(0,a.jsx)(X.A.Item,{name:"status",children:(0,a.jsx)(ep.A,{allowClear:!0,mode:"multiple",options:ez.yP,placeholder:$i18n("1d41HpAF"),style:{width:"200px"}})}),(0,a.jsx)(X.A.Item,{name:"priority",children:(0,a.jsx)(ep.A,{allowClear:!0,mode:"multiple",placeholder:$i18n("1d41HpAG"),style:{width:"200px"},options:[{label:$i18n("1d41HpAH"),value:"high"},{label:$i18n("1d41HpAI"),value:"middle"},{label:$i18n("1d41HpAJ"),value:"low"}]})}),(0,a.jsx)(X.A.Item,{name:"channel",children:(0,a.jsx)(eN.is,{hideCall:!0,notShowAll:!0,hideSms:!1,maxTagCount:"responsive",placeHolder:$i18n("1d41HpAK"),style:{width:230},valueFormate:e$.UP})})]}),(0,a.jsx)(eb.A,{children:(0,a.jsx)(eg.A,{columns:f,dataSource:n,loading:g,rowKey:"ticketId",pagination:{...r,current:r.pageNumber,size:"small"},onChange:e=>{o({pageSize:e.pageSize,pageNumber:e.current,total:e.total})}})})]})}),eK=(0,l.memo)(e=>{let{visitorId:t}=e,[s,i]=(0,l.useState)("1"),[r,o]=(0,l.useState)({1:!0}),n=[{label:$i18n("ZEbSXvu"),key:"1",component:eU},{label:$i18n("ZEbSXvv"),key:"2",component:eM},{label:$i18n("ZEbSXvw"),key:"3",component:eq}];return(0,l.useEffect)(()=>{sessionStorage.getItem("ticket_management_data")&&(i("3"),o(e=>({...e,3:!0})))},[]),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)(ed.A,{activeKey:s,items:n,style:{width:"60%"},onChange:e=>{i(e),o(t=>({...t,[e]:!0}))}}),"1"===s&&(0,a.jsx)("div",{children:(0,a.jsx)(ec.A,{})})]}),n.map(e=>{let l=e.component;return r[e.key]?(0,a.jsx)("div",{style:{display:s===e.key?"block":"none",minHeight:"70vh"},children:(0,a.jsx)(l,{visitorId:t})},e.key):null})]})}),eG=(0,eu.A)(em.SC,{value:{params:em.kv}})((0,eu.A)(em.Ay)(eK));var eY=s(26961),eP=s(18019);let{Option:eW}=ep.A,eX=e=>{let{useDefinitions:t,removeTag:s,tagId:l,name:i,style:r}=e;return(0,a.jsx)(d.A,{className:"src-pages-customer-customerEdit-component-index-module__customer-tag--Zk2s_",closable:!t,style:{...r},onClose:()=>{s(l)},children:i})},eJ=e=>{var t,s,n,d,c,m,u;let{id:p}=e,g=(0,i.A)(),x=(0,r.W6)(),_=null==(s=(0,V.G)(B.mB))||null==(t=s.staffInfo)?void 0:t.id,b=(null==(n=(0,V.G)(B.mB))?void 0:n.storeId)||Number(localStorage.getItem("quick-storeId")),{isInitialLoading:y,refetch:v,data:j}=(0,h.I)([N.L,{userUUID:p,ak:b}],M.RS),[A,C]=(0,l.useState)(!1);(0,l.useEffect)(()=>{A&&D("-1")},[A]);let[I]=X.A.useForm(),[w,S]=(0,l.useState)(""),{data:k}=(0,h.I)([N.KE,b,"1",_],eP.dQ),[E,D]=(0,l.useState)(""),{data:R}=(0,h.I)([N.rT,E],async()=>(0,eP.Tn)({storeId:b,type:"1",category:E}),{enabled:!!b}),[F,L]=(0,l.useState)(""),{data:$}=(0,h.I)([N.Ln,F],async()=>(0,eP.nP)(F,"1"),{enabled:!!F}),O=e=>{z({userUUID:p,ak:b,tagValue:"",tagId:e})},U=async e=>w||!$?(e.tagId=$?w:e.tagId,(0,M.qw)(e)):(0,M.Ut)(e),{mutate:z,isLoading:H}=(0,f.n)(e=>U(e),{onSuccess:()=>{v(),I.resetFields(),q()}}),q=()=>{C(!1),S(""),I.resetFields()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eY.A,{confirmLoading:H,maskClosable:!1,maskStyle:{backgroundColor:"rgba(0,0,0,0.1)"},title:g.formatMessage({id:"cus.edit.tag.create"}),visible:A,onCancel:q,onOk:()=>void I.validateFields().then(e=>{e.userUUID=p,e.ak=b,z(e)}).catch(()=>{}),children:(0,a.jsxs)(X.A,{form:I,initialValues:{tagCategoryId:"-1"},layout:"vertical",children:[(0,a.jsx)(X.A.Item,{label:g.formatMessage({id:"cus.edit.tag.type"}),name:"tagCategoryId",children:(0,a.jsx)(ep.A,{disabled:!!w,onChange:e=>{D(e),I.setFieldsValue({tagId:"",tagValue:""})},children:null==k?void 0:k.data.filter(e=>null!==e.id&&"-2"!==e.id).map(e=>{let{id:t,name:s}=e;return(0,a.jsx)(eW,{value:t,children:s},t)})})}),(0,a.jsx)(X.A.Item,{label:g.formatMessage({id:"cus.edit.tag.select"}),name:"tagId",rules:[{required:!0,message:g.formatMessage({id:"noEmpty"})}],children:(0,a.jsx)(ep.A,{disabled:!!w,onChange:e=>{L(e),I.setFieldsValue({tagValue:""})},children:(null==R||null==(d=R.data)?void 0:d.length)&&(null==R?void 0:R.data.filter(e=>!e.useDefinitions).map(e=>{let{id:t,name:s}=e;return(0,a.jsx)(eW,{value:t,children:s},t)}))})}),(0,a.jsx)(X.A.Item,{label:g.formatMessage({id:"cus.edit.tag.value"}),name:"tagValue",rules:[{required:!0,message:g.formatMessage({id:"noEmpty"})}
1],children:(0,a.jsx)(ep.A,{children:(null==$||null==(m=$.data)||null==(c=m.labels)?void 0:c.length)&&(null==$||null==(u=$.data)?void 0:u.labels.map(e=>{let{id:t,name:s}=e;return(0,a.jsx)(eW,{value:t,children:s},t)}))})}),(0,a.jsxs)("a",{onClick:()=>{x.push({pathname:"/tags",state:{createNew:!0}})},children:["+\xa0",(0,a.jsx)(P.A,{id:"cus.edit.tag.add"})]})]})}),(0,a.jsx)(o.A,{active:!0,loading:y,children:(0,a.jsxs)(X.A,{className:"src-pages-customer-customerEdit-component-index-module__customer-form--BZluv",children:[null==j?void 0:j.data.map(e=>{let{tagId:t,tagName:s,tagCategoryId:l,tagValue:i,useDefinitions:r}=e;return(0,a.jsxs)(X.A.Item,{label:(0,a.jsx)("div",{className:"src-pages-customer-customerEdit-component-index-module__form-label--_RpjH",title:s,children:s}),children:[(0,a.jsx)(eX,{name:i,removeTag:O,tagId:t,useDefinitions:r}),!r&&(0,a.jsx)(T.A,{type:"icon-edit",onClick:()=>{L(t),S(t),C(!0),I.setFieldsValue({tagCategoryId:l,tagId:s,tagValue:i})}})]},t)}),(0,a.jsx)(X.A.Item,{children:(0,a.jsxs)(Q.A,{className:"src-pages-customer-customerEdit-component-index-module__customer-add--MnmwG",type:"primary",onClick:()=>C(!0),children:["+\xa0",(0,a.jsx)(P.A,{id:"cus.edit.tag.create"})]})})]})})]})};var eZ=s(94824),eQ=s(34337),e0=s(7259),e1=s(64800),e4=s(95876);let e2=(e,t)=>({add:t.filter(t=>!e.includes(t)),remove:e.filter(e=>!t.includes(e))}),e6=e=>{let{oneid:t,onChanged:s}=e,i=(0,K.kK)(),[r,n]=(0,l.useState)(null),[d,m]=(0,l.useState)([]),[u,p]=(0,l.useState)([]),[g,x]=(0,l.useState)({staff:[],group:[]}),h=(0,eQ.A)(),f=(0,l.useMemo)(()=>h||[],[h]),{data:_=[]}=(0,e0.A)(async()=>{var e;let t=await (0,e4.iNJ)({});return null!=(e=null==t?void 0:t.data)?e:[]},{cacheKey:"data-isolation/staffList"}),{loading:b}=(0,e0.A)(async()=>{var e;if(!t)return null;let s=await (0,e1.MD)(t);return null!=(e=null==s?void 0:s.data)?e:null},{refreshDeps:[t],ready:!!t,onSuccess:e=>{let t=(null==e?void 0:e.ownerStaffIds)||[],s=(null==e?void 0:e.ownerSkillGroupIds)||[];x({staff:t,group:s}),m(t),p(s)}}),y=(0,l.useMemo)(()=>{let e=new Map;return _.forEach(t=>e.set(String(t.id),t.name)),e},[_]),v=(0,l.useMemo)(()=>{let e=new Map;return f.forEach(t=>e.set(String(t.id),t.name)),e},[f]),{loading:j,run:A}=(0,e0.A)(e=>(0,e1.qH)(t,e),{manual:!0,onSuccess:e=>{if((null==e?void 0:e.code)===200&&(null==e?void 0:e.success)){let{data:t}=e,a=(null==t?void 0:t.ownerStaffIds)||[],l=(null==t?void 0:t.ownerSkillGroupIds)||[];x({staff:a,group:l}),m(a),p(l),n(null),null==s||s()}}}),C=(e,s,l,o,x,h)=>{let f=l.map(e=>o.get(e)||e),_=f.slice(0,3),b=f.length-_.length;return(0,a.jsxs)("div",{className:"flex items-baseline gap-x-14px gap-y-4px w-full",children:[(0,a.jsx)("span",{className:"flex-none w-84px text-[rgba(0,0,0,0.85)] text-14px leading-22px",children:s}),r===e?(0,a.jsx)(ep.A,{autoFocus:!0,defaultOpen:!0,showSearch:!0,className:"flex-1 min-w-0",disabled:j,maxTagCount:"responsive",mode:"multiple",options:x.map(e=>({label:e.name,value:String(e.id)})),placeholder:$i18n("onlineChat.formItem.collect.placeholder"),value:l,filterOption:(e,t)=>{var s;return String(null!=(s=null==t?void 0:t.label)?s:"").toLowerCase().includes(e.toLowerCase())},onBlur:()=>{let t;!(t="staff"===e?e2(g.staff,d):e2(g.group,u)).add.length&&!t.remove.length?n(null):A({staffIds:d,skillGroupIds:u})},onChange:h,onInputKeyDown:t=>{"Escape"===t.key&&("staff"===e?m(g.staff):p(g.group),n(null))}}):(0,a.jsxs)("div",{className:`group flex flex-1 items-center min-w-0 min-h-32px ${i?"cursor-pointer":""}`,onClick:()=>i&&t&&n(e),onKeyDown:s=>{"Enter"===s.key&&i&&t&&n(e)},children:[f.length?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.A,{title:f.join(", "),children:(0,a.jsxs)("span",{className:"overflow-hidden text-[rgba(0,0,0,0.85)] text-14px leading-22px whitespace-nowrap text-ellipsis min-w-0",children:[_.join(", "),b>0?",":""]})}),b>0&&(0,a.jsx)(c.A,{title:f.slice(3).join(", "),children:(0,a.jsx)("span",{className:"flex-none ml-4px border-b-1px border-b-dashed border-b-[rgba(0,0,0,0.45)] whitespace-nowrap cursor-pointer",children:`+${b}`})})]}):(0,a.jsx)("span",{className:"flex-none text-[rgba(0,0,0,0.25)] text-14px",children:$i18n("SgKGFmx")}),i&&(0,a.jsx)(eZ.A,{className:"flex-none ml-auto text-[rgba(0,0,0,0.45)] text-12px opacity-0 transition-opacity duration-200 group-hover:opacity-100"})]})]})};return(0,a.jsx)(o.A,{active:!0,loading:b,paragraph:{rows:2},children:(0,a.jsxs)("div",{className:"flex flex-col gap-8px",children:[C("staff",$i18n("NcFtCXG"),d,y,_,m),C("group",$i18n("NcFtCXH"),u,v,f,p)]})})};var e8=s(18168);let{Column:e5}=eg.A,e3=e=>{var t;let{id:s,oneid:r}=e,o=(0,i.A)(),n=(null==(t=(0,V.G)(B.mB))?void 0:t.storeId)||Number(localStorage.getItem("quick-storeId")),{data:d,isInitialLoading:c}=(0,h.I)([N.TK,{ak:n,userUUID:s,oneid:r}],M.hM),m=["FULLMODE_START_TIME","CTA_CLICKS","ADD_SHOPPING"],u=(0,l.useMemo)(()=>{var e;
1return(0,e8.uG)()?null==d||null==(e=d.data)?void 0:e.filter(e=>!m.includes(e.indexCode)):null==d?void 0:d.data},[null==d?void 0:d.data]);return(0,a.jsxs)(eg.A,{dataSource:u,loading:c,pagination:!1,rowKey:"indexName",size:"middle",style:{marginTop:"16px"},children:[(0,a.jsx)(e5,{dataIndex:"indexName",title:o.formatMessage({id:"cus.edit.dataIndex"})},"indexName"),(0,a.jsx)(e5,{dataIndex:"lastThirtyData",title:o.formatMessage({id:"cus.edit.dataIndex.column"})},"lastThirtyData"),(0,a.jsx)(e5,{dataIndex:"totalData",title:o.formatMessage({id:"cus.edit.dataIndex.columnAll"})},"totalData")]})};var e7=s(93481),e9=s(70321),te=s(428),tt=s(59008),ts=s(37360);let ta={font12:"src-pages-customer-customerEdit-component-operatorLog-index-module__font12--lmBUK",font14:"src-pages-customer-customerEdit-component-operatorLog-index-module__font14--DNcI8",font16:"src-pages-customer-customerEdit-component-operatorLog-index-module__font16--I5AwI",font20:"src-pages-customer-customerEdit-component-operatorLog-index-module__font20--e_Z5V",warn:"src-pages-customer-customerEdit-component-operatorLog-index-module__warn--UDoIM",success:"src-pages-customer-customerEdit-component-operatorLog-index-module__success--TNXcK",error:"src-pages-customer-customerEdit-component-operatorLog-index-module__error--c5r0J",ellipsis:"src-pages-customer-customerEdit-component-operatorLog-index-module__ellipsis--oZHxX","ellipsis-2":"src-pages-customer-customerEdit-component-operatorLog-index-module__ellipsis-2--RNx0s",pointer:"src-pages-customer-customerEdit-component-operatorLog-index-module__pointer--whXQx","guide-modal":"src-pages-customer-customerEdit-component-operatorLog-index-module__guide-modal--LlC32","guide-special":"src-pages-customer-customerEdit-component-operatorLog-index-module__guide-special--bnAUv","scroll-hidden":"src-pages-customer-customerEdit-component-operatorLog-index-module__scroll-hidden--mDWoX",flexCenter:"src-pages-customer-customerEdit-component-operatorLog-index-module__flexCenter--sgqfE",logs:"src-pages-customer-customerEdit-component-operatorLog-index-module__logs--pm0s0",log__item:"src-pages-customer-customerEdit-component-operatorLog-index-module__log__item--mKZS9","log-time-line-item":"src-pages-customer-customerEdit-component-operatorLog-index-module__log-time-line-item--JsTGD",log__title:"src-pages-customer-customerEdit-component-operatorLog-index-module__log__title--NN2uV","log-type":"src-pages-customer-customerEdit-component-operatorLog-index-module__log-type--d884H","log-content":"src-pages-customer-customerEdit-component-operatorLog-index-module__log-content--mg_GR","tracks__url-detail":"src-pages-customer-customerEdit-component-operatorLog-index-module__tracks__url-detail--z35E_"},tl=y().bind(ta);T.A,tt.A,T.A,T.A,T.A,T.A;let ti={1:"cus.operation.delete",2:"cus.operation.recovery",3:"cus.operation.merge",4:"cus.operation.newJoinBlackList",5:"cus.operation.removeBlackList",6:"cus.operation.delete",7:"cus.operation.delete",8:"cus.operation.editbelonging"},tr=e=>{var t;let{visit:s}=e,{createTime:l,operationType:i,email:r,createUser:o,displayText:n}=s,d=(null==(t=(0,ts.Cd)()[o])?void 0:t.name)||r;return(0,a.jsxs)(e9.A.Item,{className:tl("log__item"),children:[(0,a.jsx)("div",{className:ta.log__title,children:l}),(0,a.jsx)("div",{className:ta["log-time-line-item"],children:(0,a.jsxs)("div",{className:`${ta["log-content"]} py-12px`,children:[(0,a.jsx)("span",{children:d}),(0,a.jsx)("span",{children:n||(0,a.jsx)(P.A,{id:ti[i],values:{count:1}})})]})})]})},to=e=>{let{visitorId:t,shouldUpdata:s}=e,r=(0,i.A)(),{isInitialLoading:o,data:n,refetch:d}=(0,h.I)([N.uv,{userUUID:t}],M.Yx,{select:e=>null==e?void 0:e.data}),[c,m]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{s&&d()},[s]),(0,a.jsx)(te.A,{spinning:o,children:(0,a.jsxs)(e9.A,{className:tl("logs"),children:[(null==n?void 0:n.length)?n.slice(0,3).map((e,t)=>(0,a.jsx)(tr,{visit:e},t)):(0,a.jsx)(p.A,{description:r.formatMessage({id:"cus.edit.operation.active"}),image:p.A.PRESENTED_IMAGE_SIMPLE,style:{marginTop:166}}),(null==n?void 0:n.length)>3&&c&&n.slice(3).map((e,t)=>(0,a.jsx)(tr,{visit:e},t)),(null==n?void 0:n.length)>3&&(0,a.jsx)(e9.A.Item,{children:(0,a.jsx)("a",{onClick:()=>m(e=>!e),children:c?r.formatMessage({id:"cus.edit.history.less"}):r.formatMessage({id:"cus.edit.history.more"})})})]})})},tn={font12:"src-pages-customer-customerEdit-index-module__font12--bAKYh",font14:"src-pages-customer-customerEdit-index-module__font14--zWi0O",font16:"src-pages-customer-customerEdit-index-module__font16--hebKb",font20:"src-pages-customer-customerEdit-index-module__font20--B8fre",warn:"src-pages-customer-customerEdit-index-module__warn--lZdAr",success:"src-pages-customer-customerEdit-index-module__success--h0IOz",error:"src-pages-customer-customerEdit-index-module__error--JOPR0",ellipsis:"src-pages-customer-customerEdit-index-module__ellipsis--rfQHs","ellipsis-2":"src-pages-customer-customerEdit-index-module__ellipsis-2--eiJ0F",pointer:"src-pages-customer-customerEdit-index-module__pointer--aZiAE","guide-modal":"src-pages-customer-customerEdit-index-module__guide
1-modal--FX__S","guide-special":"src-pages-customer-customerEdit-index-module__guide-special--LCNLD","scroll-hidden":"src-pages-customer-customerEdit-index-module__scroll-hidden--E_iJQ",flexCenter:"src-pages-customer-customerEdit-index-module__flexCenter--N7ihc","customer-edit":"src-pages-customer-customerEdit-index-module__customer-edit--TpEbY",card:"src-pages-customer-customerEdit-index-module__card--oWMrA",right:"src-pages-customer-customerEdit-index-module__right--FHYki","left-main":"src-pages-customer-customerEdit-index-module__left-main--YXe6G",left:"src-pages-customer-customerEdit-index-module__left--p7Lun",avatar:"src-pages-customer-customerEdit-index-module__avatar--bMYr4",icon:"src-pages-customer-customerEdit-index-module__icon--FdV1t",channel:"src-pages-customer-customerEdit-index-module__channel--di6BD",tag:"src-pages-customer-customerEdit-index-module__tag--llXaU","ins-v":"src-pages-customer-customerEdit-index-module__ins-v--ZlfSG",title:"src-pages-customer-customerEdit-index-module__title--UnKSX",description:"src-pages-customer-customerEdit-index-module__description--roIa8","customer-marks":"src-pages-customer-customerEdit-index-module__customer-marks--adF20","customer-tracks":"src-pages-customer-customerEdit-index-module__customer-tracks--L4doP","filed-info":"src-pages-customer-customerEdit-index-module__filed-info--XrNMJ",content:"src-pages-customer-customerEdit-index-module__content--LLQYk","create-btns":"src-pages-customer-customerEdit-index-module__create-btns--lADJd","create-btns__item":"src-pages-customer-customerEdit-index-module__create-btns__item--CocYD",disabled:"src-pages-customer-customerEdit-index-module__disabled--bgbCg","btn-item":"src-pages-customer-customerEdit-index-module__btn-item--Pivq2",country__popover:"src-pages-customer-customerEdit-index-module__country__popover--Jlf4q","combine-customer-icon":"src-pages-customer-customerEdit-index-module__combine-customer-icon--XfmOz","customer-tracks-body":"src-pages-customer-customerEdit-index-module__customer-tracks-body--llYvY"},td=y().bind(tn),tc={instagram:"ic_socialaccount_instagram",messenger:"Vector",facebook:"ic_socialaccount_facebook",google:"ic_socialaccount_google",linkedin:"ic_socialaccount_linkedin",youtube:"ic_socialaccount_youtube",whatsapp:"ic_socialaccount_whatsapp",tiktok:"ic_socialaccount_tiktok"},tm={width:"115%",background:"#FAFAFA"},tu=()=>{var e,t,s;let b=(0,i.A)();(0,r.W6)(),(0,V.j)();let{goto:y}=(0,x.c2)(),{id:C}=(0,r.g)(),{search:w}=(0,r.zy)(),P=new URLSearchParams(w).get("id"),W=(null==(e=(0,V.G)(B.mB))?void 0:e.storeId)||Number(localStorage.getItem("quick-storeId")),[X,J]=(0,l.useState)({}),[Z,Q]=(0,l.useState)(),[ee,et]=(0,l.useState)([]),[es,ea]=(0,l.useState)({}),[el,ei]=(0,l.useState)(!1),[eo,ed]=(0,l.useState)(!1),[ec,em]=(0,l.useState)(0),[eu,ep]=(0,l.useState)(),eg=(0,$.ik)(),{data:ex,error:eh,isInitialLoading:ef,isFetching:e_}=(0,h.I)(["customer/detail/permission",W,C],()=>(0,_.PP)({storeId:W,userUUID:C}),{enabled:!!C,retry:!1,retryOnMount:!1,select:e=>(null==e?void 0:e.data)===!0,onError:e=>{2111405===Number(null==e?void 0:e.code)&&ep(C)}}),{applicationId:eb}=(0,V.G)(B.T$),{data:ey}=(0,h.I)([N.G9,{storeId:W,visitorId:C,oneid:P}],M.Ur,{enabled:!!C&&!0===ex}),ev=(0,V.G)(B.KY),ej=(0,V.G)(B.b_),{isInitialLoading:eA,data:eC,isFetching:eI,refetch:eS}=(0,h.I)([N.XN,C],async()=>(0,M.rC)(W,C),{enabled:!!C&&!0===ex,retry:!1,retryOnMount:!1,select:e=>null==e?void 0:e.data,onError:e=>{2111405===Number(null==e?void 0:e.code)&&ep(C)},onSuccess:e=>{if(e){let{dataType:t,avatarColor:s,avatarUrl:a}=e,l={...X,...e};J(l);let i=(0,O.qc)(l);null==Q||Q({url:a,avatarColor:s,name:i,dataType:t});let r=[];Object.keys(tc).forEach(t=>{e[t]&&(r=[...new Set([...ee,...r,tc[t]])])}),ei(!e.email&&!e.instagram&&e.facebook),et(r),ea(e.mergeInfo)}}}),{data:ek,isInitialLoading:eE,isFetching:eM}=(0,h.I)([N.$m,null==X?void 0:X.userUUID],E.Ca$,{enabled:!!(null==X?void 0:X.userUUID),select:e=>"boolean"!=typeof e&&(null==e?void 0:e.data)}),{mutate:eN}=(0,f.n)(e=>(0,E.xF$)(e),{onSuccess:(e,t)=>{let{channel:s}=t,{chatSubSessionId:a}=(null==e?void 0:e.data)||{};if(a)y(a,{tab:"assigned"});else{let{userUUID:e}=X;(0,E.ZiB)({visitorId:e,channel:s}).then(e=>{let{id:t}=(null==e?void 0:e.data)||{};y(t,{tab:"assigned"})})}}}),eD=(0,O.qc)(X),eT=X.insfollowerCount||0,[eR,eF]=(0,l.useState)(!1),[eL,e$]=(0,l.useState)(!1),{openModal:eO,closeModal:eU}=(0,L.h)(),[ez,eH]=(0,l.useState)(!1),eB=async e=>
1{if(!ez&&("email"!==e||X.email)&&("sms"!==e||X.phone)&&("whatsapp"!==e||X.whatsapp))if(eU(j.A),(null==ek?void 0:ek.chatSubSessionId)&&(null==ek?void 0:ek.lastMsgId)!=="0")y(null==ek?void 0:ek.chatSubSessionId);else{if("email"===e){let{email:t,userUUID:s}=X,a=await (0,E.Jmk)({visitorId:null==X?void 0:X.userUUID});if(null==a?void 0:a.data){let a=await (0,E.xF$)({email:t,visitorId:s,channel:e}),{chatSubSessionId:l}=(null==a?void 0:a.data)||{};l?y(l,{tab:"assigned"}):eO(j.A).then(t=>{t&&(eH(!0),(0,E.ZiB)({visitorId:s,channel:e,selectedEmail:null==t?void 0:t.email,targetStoreId:null==t?void 0:t.storeId}).then(e=>{let{id:t}=(null==e?void 0:e.data)||{};y(t,{tab:"assigned"})}).finally(()=>{eH(!1)}))});return}}(e=>{let{email:t,userUUID:s}=X;eN({email:t,visitorId:s,channel:e})})(e)}},[eV,eq]=(0,l.useState)(!1),[eK,eY]=(0,l.useState)(1),[eP,eW]=(0,l.useState)(!1),eX=async e=>{J(t=>({...t,[e]:"",["email"===e?"subscribeState":"phoneSubscribeState"]:void 0})),await eS(),eq(!0),setTimeout(()=>eq(!1),500)},eZ=(0,l.useMemo)(()=>(0,q.P)(F.uE.USERMERGE)||(0,q.P)(F.HY.BLACK_SESSION_LIST),[F.uE]),eQ=G.Ay.MOPOWER_MICRO,e0=Y.A.getItem("qs_lang")||"zh-CN",{data:e1,isInitialLoading:e4}=(0,h.I)(["/cdp/getTicketOptions",C],()=>(0,_.z4)({ak:W,userUUID:C}),{enabled:!!C&&!0===ex,select:e=>{var t;let s=(null==e||null==(t=e.data)?void 0:t.ticketOptions)||[],a=[];return s.forEach(e=>{let t=(e.viewComponents||[]).map(t=>({...t,viewId:t.id,worksheetId:e.worksheetId}));a.push(...t)}),{filterData:s.map(t=>{var s;return{businessId:t.customerId,fieldType:"text",filterType:3,filterValue:null==(s=e.data)?void 0:s.customerId,logicalType:1,worksheetId:t.worksheetId}}),ticketOptions:a}}}),e2=(0,l.useMemo)(()=>`${eQ}/customerOutForm.html?${S().stringify({logincompanyid:null==ev?void 0:ev.companyId,loginuserid:null==ev?void 0:ev.id,lang:e0,applicationId:eb})}`,[e1]),e8=(0,l.useMemo)(()=>(function(e){let t={domain:eQ,tabs:(null==e1?void 0:e1.ticketOptions)||[],filterData:null==e1?void 0:e1.filterData},s=[],a=e.slice(e.indexOf("?")+1).split("&");for(let e=0;e<a.length;e++)t[(s=a[e].split("="))[0]]=decodeURIComponent(s[1]);return t})(e2),[e2,e1]);(0,l.useEffect)(()=>{sessionStorage.getItem("ticket_management_data")&&eY(1)},[]);let e5=P||((null==eC?void 0:eC.oneid)!=null?String(eC.oneid):void 0),e9=!1===ex||2111405===Number(null==eh?void 0:eh.code);return eu===C||e9||!eA&&!eI&&(0,K.Li)(eC)?(0,a.jsx)(R.A,{description:$i18n("l41NtNA")}):(ef||e_||eA||eI)&&!eC?(0,a.jsx)("div",{className:"flex items-center justify-center w-full h-full",children:(0,a.jsx)(v.A,{})}):(0,a.jsxs)("div",{className:tn["customer-edit"],id:"customer-edit",children:[(0,a.jsx)("div",{className:tn["left-main"],children:(0,a.jsxs)("div",{className:tn.left,children:[(0,a.jsx)("div",{className:`${tn.card} ${tn.avatar}`,children:(0,a.jsxs)(o.A,{active:!0,avatar:!0,loading:eA||eE||eM||eI,paragraph:{rows:3},children:[X.isBlackList&&(0,a.jsx)(n.A,{icon:(0,a.jsx)(T.A,{style:{color:"#FF4D4F"},type:"icon-prohibit"}),size:64,style:{backgroundColor:"rgba(89, 89, 89, 0.85)",position:"absolute",zIndex:"9"}}),(0,a.jsx)(n.A,{size:64,src:X.avatarUrl,style:{fontSize:36,color:"#fff",backgroundColor:X.avatarColor||"#1e63f5"},children:X.avatarUrl||1===X.dataType?"#"===eD[0]?eD[1]:Array.from(eD)[0]:"TEST"}),(0,a.jsxs)("div",{style:{marginLeft:16,width:"calc(100% - 110px)"},children:[(0,a.jsxs)("div",{className:tn.icon,children:[eT>=1e6&&(0,a.jsx)(T.A,{className:td("ins-v"),type:"icon-Subtract"}),(0,a.jsx)("h4",{className:tn.title,title:eD,children:eD}),ee.map((e,t)=>(0,a.jsx)(T.A,{className:tn.channel,type:`icon-${e}`},t))]}),eT>0&&(0,a.jsx)(e7.A,{num:eT}),(0,a.jsx)("span",{className:tn.description,children:X.country?`${X.country} ${X.province?`,${X.province}`:""}`:""}),(0,a.jsx)("div",{className:tn.tag,children:(null==ey?void 0:ey.data)&&ey.data.map(e=>(0,a.jsx)(d.A,{style:{color:"#69E4A4",background:"#F0FFF5",borderColor:"#C5FCDC",marginBottom:8,maxWidth:"80%",overflow:"hidden",textOverflow:"ellipsis"},children:e},e))}),(0,a.jsxs)("div",{className:td("create-btns"),children:[(0,a.jsx)("div",{className:td("create-btns__item",!X.email&&"disabled"),onClick:()=>{eB("email")},children:(0,a.jsx)(c.A,{placement:"top",title:b.formatMessage({id:"cus.customer.btn.toolTipEmail"}),children:(0,a.jsx)(T.A,{className:td("btn-item",!X.email&&"disabled"),type:"icon-mail"})})}),(0,a.jsx)("div",{className:td("create-btns__item",!X.whatsapp&&"disabled"),onClick:()=>{eB("whatsapp")},children:(0,a.jsx)(c.A,{placement:"top",title:b.formatMessage({id:"cus.customer.btn.toolTipWhatsapp"}),children:(0,a.jsx)(T.A,{className:td("btn-item",!X.whatsapp&&"disabled"),type:"icon-whatsapp"})})}),(0,a.jsx)("div",{className:td("create-btns__item",!X.phone&&"disabled"),onClick:()=>{eB("sms")},children:(0,a.jsx)(c.A,{placement:"top",title:b.formatMessage({id:"cus.customer.btn.toolTipSMS"}),children:(0,a.jsx)(T.A,{className:td("btn-item",!X.phone&&"disabled"),type:"icon-sms"})})})]})]}),eZ&&(0,a.jsx)(m.A,{open:eo,overlayClassName:td("country__popover"),placement:"bottom",content:(0,a.jsx)(z.A,{combineSuccess:e=>{eS(),eq(!0),setTimeout(()=>eq(!1),500)},customerInfo:eC,setOpen:ed}),onOpenChange:e=>ed(e),children:(0,a.jsx)(g.A,{className:td("combine-customer-icon"),onClick:()=>ed(!0)})})]})}),(0,a.jsx)("div",{className:`${tn.card}`,children:(0,a.jsx)(D.A,{children:(0,a.jsx)(e6,{oneid:e5,onChanged:()=>em(e=>e+1)})})}),(0,a.jsxs)("div",{className:`${tn.card}`,children:[(0,a.jsx)(er,{style:tm,title:b.formatMessage({id:"cus.draggable.basic"})}),(0,a.jsx)(D.A,{children:(0,a.jsx)(en,{customerInfo:eC,getLoading:eA,
1id:C,titleStyle:tm,onContactDelete:eX})})]}),(0,a.jsxs)("div",{className:`${tn.card}`,children:[(0,a.jsx)(er,{style:tm,title:b.formatMessage({id:"cus.edit.tag"})}),(0,a.jsx)(D.A,{children:(0,a.jsx)(eJ,{id:C})})]}),(0,a.jsxs)("div",{className:`${tn.card}`,children:[(0,a.jsx)(er,{showIcon:!0,changeShowState:eF,style:tm,title:b.formatMessage({id:"cus.edit.mark"})}),eR&&(0,a.jsx)(D.A,{children:(0,a.jsx)(U.A,{className:tn["customer-marks"],storeId:W,visitorId:C})})]}),(0,a.jsxs)("div",{className:`${tn.card}`,children:[(0,a.jsx)(er,{showIcon:!0,changeShowState:e$,style:tm,title:b.formatMessage({id:"cus.edit.merge"})}),(0,a.jsx)(D.A,{children:(0,a.jsx)("div",{className:tn["basic-extra"],children:eL&&I()(es,(e,t)=>{var s;if((0,A.isEmpty)(e))return null;let l=null==(s=eg[t])?void 0:s.fieldDesc,i="phone"===t?(e||[]).map(e=>{let{phone:t,subscribeState:s}=e;return(0,a.jsxs)("span",{style:{display:"block",marginRight:8},children:[t,"[",ew.A.formatMessage({id:`definition.tag.${1===s?"subscribe2":"subscribe1"}`}),"]"]})}):(e||[]).map(e=>(0,a.jsx)("span",{style:{marginRight:8},children:e}));return(0,a.jsxs)("p",{className:td("filed-info"),children:[(0,a.jsx)("span",{className:td("title"),title:l,children:l}),(0,a.jsx)("span",{className:td("content"),children:i||b.formatMessage({id:"cus.info.none"})})]},t)})})})]})]})}),(0,a.jsxs)("div",{className:tn.right,children:[(0,a.jsx)(u.A,{className:" [&_label.ant-segmented-item]:color-[rgba(0,0,0,0.45)] [&_label.ant-segmented-item.ant-segmented-item-selected]:color-q-primary mb-16px",value:eK,options:[{label:$i18n("l41NOVB"),value:1},{label:b.formatMessage({id:"cus.edit.dataIndex"}),value:2},{label:b.formatMessage({id:"cus.edit.history"}),value:3},{label:b.formatMessage({id:"cus.edit.operaotr.log"}),value:4},{label:$i18n("l41R2tG"),value:5}],onChange:e=>{eY(e),2!==e||eP||eW(!0)}}),(0,a.jsx)("div",{className:"bg-#fff px-24px py-16px",style:{display:1===eK?"block":"none",background:"#fff",borderRadius:4},children:(0,a.jsx)(eG,{visitorId:C})}),(0,a.jsx)("div",{style:{display:2===eK?"block":"none"},children:(0,a.jsxs)("div",{className:`${tn.card} ${tn.metric}`,children:[(0,a.jsx)(er,{title:b.formatMessage({id:"cus.edit.dataIndex"})}),eP&&(0,a.jsx)(e3,{id:C,oneid:P})]})}),(0,a.jsx)("div",{className:"bg-#fff h-100%",style:{display:3===eK?"block":"none",background:"#fff",borderRadius:4},children:(0,a.jsxs)("div",{className:`${tn.card} ${tn["customer-tracks"]}`,children:[(0,a.jsx)(er,{title:b.formatMessage({id:"cus.edit.history"})}),(0,a.jsx)(D.A,{children:(0,a.jsx)(H.A,{isCustomer:!0,bodyClassName:tn["customer-tracks-body"],oneid:P,storeId:W,visitorId:C})})]})}),(0,a.jsx)("div",{className:"bg-#fff h-100%",style:{display:4===eK?"block":"none",background:"#fff",borderRadius:4},children:(0,a.jsxs)("div",{className:`${tn.card} ${tn["customer-tracks"]}`,children:[(0,a.jsx)(er,{title:b.formatMessage({id:"cus.edit.operaotr.log"})}),(0,a.jsx)(D.A,{children:(0,a.jsx)("div",{className:"h-full overflow-y-hidden hover:overflow-y-auto",style:{scrollbarGutter:"stable"},children:(0,a.jsx)(to,{shouldUpdata:eV,visitorId:C})})})]})}),(0,a.jsx)("div",{className:"bg-#fff h-100%",style:{display:5===eK?"block":"none",background:"#fff",borderRadius:4},children:ej&&(0,a.jsxs)("div",{className:`${tn.card} ${tn["customer-tracks"]}`,children:[(0,a.jsx)(er,{title:$i18n("l41R2tG")}),!!(null==e1||null==(t=e1.ticketOptions)?void 0:t.length)&&!e4&&(0,a.jsx)(D.A,{children:(0,a.jsx)(k.MicroApp,{className:td("ticket-form-micro"),data:e8,host:e2,loading:(0,a.jsx)(v.A,{}),name:"customer-outform"})}),!(null==e1||null==(s=e1.ticketOptions)?void 0:s.length)&&(0,a.jsx)(p.A,{description:$i18n("l41NstO"),image:p.A.PRESENTED_IMAGE_SIMPLE,style:{marginTop:166}})]})})]})]})}},1585(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>w});var a=s(74848),l=s(96540),i=s(6442),r=s(58065),o=s(9421),n=s(63064),d=s(56347),c=s(54510),m=s(26961),u=s(57136),p=s(23224),g=s.n(p),x=s(96049),h=s(7937),f=s(32457),_=s(71458),b=s(33898),y=s(85966),v=s(1592),j=s(15096),A=s(82648),C=s(9812),I=s(87175);let w=(0,l.memo)(()=>{let[e,t]=(0,l.useState)([]),[s,p]=(0,l.useState)(""),[w,S]=(0,l.useState)([]),[k,E]=(0,l.useState)(!1),[M,N]=(0,l.useState)(0),[D,T]=(0,l.useState)([]),R=(0,l.useRef)([]),F=(0,y.G)(b.mB),L=(0,i.A)(),{id:$}=(0,d.g)(),O=(0,l.useRef)(null),U=(0,d.W6)(),z=(0,y.j)(),H=(null==F?void 0:F.storeId)||Number(localStorage.getItem("quick-storeId")),[B,V]=(0,l.useState)("");(0,l.useEffect)(()=>{var e;null==O||null==(e=O.current)||e.setPageInfo({current:1,pageSize:10})},[B]);let q=(0,l.useMemo)(()=>w.length===e.length,[e]),K=(0,l.useMemo)(()=>s===v.p.all?M:e.length,[e,s]),{data:G={}}=(0,_.Ay)(),Y=(0,l.useCallback)(()=>{E(!0)},[]),P=(0,l.useCallback)(async()=>{E(!1);let t=c.Ay.loading(L.formatMessage({id:"cus.recovery.status"}),0),a=await (0,x.Qi)({userUUIDList:e,recycleId:$,isRollbackAll:"all"===s,storeId:H,userId:null==F?void 0:F.userId});t(),200===a.code&&a.success&&S([]),null==O||O.current.reload()},[e]),W=e=>{e?t(w):t([])},X=(0,l.useCallback)(e=>{p(e),t(w)},[w]),J=(e,t)=>
1{let s=[L.formatMessage({id:"customer"})];z((0,b.Wd)(s)),U.push(`/customer-edit/${e}`)},{isInitialLoading:Z}=(0,o.I)(["customer/table/header"],()=>(0,x.oK)(H),{onSuccess:e=>{var t;let s=null==(t=e.data)?void 0:t.sort((e,t)=>e.headerOrderKey-t.headerOrderKey),a=(0,A.Ay)(s,J);R.current=s,T(a)}}),Q=(0,n.jE)();return(0,l.useEffect)(()=>(g().subscribe("resize-header",(e,t)=>{let{width:s,title:a}=t,l=R.current.find(e=>e.fieldDesc===a)||{};l.headerWidth!==s&&(l.headerWidth=s,(0,x.Mx)(l).then(()=>{Q.invalidateQueries(["customer/table/header"])}))}),()=>{g().unsubscribe("resize-header")}),[]),(0,a.jsx)("div",{className:"px-26px w-full",children:(0,a.jsxs)("div",{className:"customer-table src-pages-customer-customerRecovery-index-module__recovery-table--uIexx",children:[(0,a.jsx)("div",{children:(0,a.jsx)(f.A,{placeholder:L.formatMessage({id:"cus.table.header.search"}),setValue:V,style:{width:288},value:B})}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(h.A,{children:(0,a.jsx)(u.A,{actionRef:O,columns:D,debounceTime:500,pagination:{pageSize:10},params:{name:B},rowKey:"userUUID",scroll:{x:!0},showSorterTooltip:!1,className:e.length<=0?"quick-table-hide-footer":"quick-table-hide-pagination",footer:()=>(0,a.jsx)(j.A,{checkBoxIsChecked:q,chengeCheckbox:W,handleClickOperator:Y,selectNumber:K,selectType:s,setSelectType:X,type:"recovery"}),request:async(s,a)=>{e.length&&t([]);let l={};Object.keys(a).forEach(e=>{var t;l={orderKey:e,orderType:null==(t=a[e])?void 0:t.replace("end","")}});let{name:i,current:r,pageSize:o}=s,{data:n,success:d}=await (0,x.J1)({ak:H,searchKey:i,systemCondition:"",pageNum:r,pageSize:o,recycleId:$,deleted:1,...l}),{total:c,list:m}=n;return N(c),m.length&&S(m.map(e=>{let t=Number(e.orderAmountLastThirtyDays);return e.orderAmountLastThirtyDays=isNaN(t)?"":t.toFixed(2),e.userUUID})),{data:(0,I.o)(n.list,G),success:d,total:c}},rowSelection:{type:"checkbox",selectedRowKeys:e,onChange:e=>{e.length!==w.length&&p(""),t(e)}}})})}),(0,a.jsx)(m.A,{cancelText:(0,a.jsx)(r.A,{id:"cancel"}),okText:(0,a.jsx)(r.A,{id:"sure"}),visible:k,width:380,onOk:P,onCancel:()=>{E(!1)},children:(0,a.jsx)(C.A,{contentText:"cus.recovery.content",count:K,tipText:"cus.recovery.tip"})})]})})})},33004(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>k});var a=s(74848),l=s(96540),i=s(58065),r=s(56347),o=s(26961),n=s(67967),d=s.n(n),c=s(57136),m=s(96049),u=s(7937),p=s(33898),g=s(85966),x=s(34724),h=s(77447);let f=(0,l.memo)(e=>{let{id:t,storeId:s}=e,o=(0,g.j)(),n=(0,r.W6)(),d=(0,l.useMemo)(()=>[{title:x.A.formatMessage({id:"cus.table.number"}),width:80,ellipsis:!0,dataIndex:"userUUID",render:(e,t,s)=>s+1},{title:x.A.formatMessage({id:"cus.table.colEmail"}),width:120,ellipsis:!0,dataIndex:"email",render:e=>(null!=e?e:"")===""?"-":e},{title:x.A.formatMessage({id:"cus.table.colPhone"}),width:120,ellipsis:!0,dataIndex:"phone",render:e=>(null!=e?e:"")===""?"-":e},{title:"WhatsApp",width:120,ellipsis:!0,dataIndex:"whatsapp",render:e=>(null!=e?e:"")===""?"-":e},{title:x.A.formatMessage({id:"cus.table.recovery.time"}),width:120,ellipsis:!0,dataIndex:"rollbackTime"},{title:x.A.formatMessage({id:"cus.table.operator"}),width:120,ellipsis:!0,dataIndex:"operationEmail"},{title:x.A.formatMessage({id:"whatsapp.columns.title.sixth"}),width:100,ellipsis:!0,render:(e,t)=>(0,a.jsx)("a",{onClick:()=>c(t.userUUID),children:(0,a.jsx)(i.A,{id:"cus.recycle.detail"})})}],[]),c=e=>{let t=[x.A.formatMessage({id:"customer"})];o((0,p.Wd)(t)),n.push(`/customer-edit/${e}`)};return(0,a.jsx)(u.A,{children:(0,a.jsx)(h.A,{columns:d,debounceTime:500,params:{recycleId:t},rowKey:"id",showSorterTooltip:!1,pagination:{pageSize:10,hideOnSinglePage:!0},request:async e=>{let{current:t,pageSize:a,recycleId:l}=e,{data:i,success:r}=await (0,m.Ed)({recycleId:l,pageNum:t,pageSize:a,storeId:s}),{total:o,list:n}=i;return{data:n,success:r,total:o}}})})});var _=s(57831),b=s(6824),y=s(69508),v=s(37360);let{RangePicker:j}=_.A,{Option:A}=b.A,C=e=>{let{label:t,closable:s,onClose:l}=e;return(0,a.jsx)(y.A,{closable:s,style:{marginRight:3},onClose:l,onMouseDown:e=>{e.preventDefault(),e.stopPropagation()},children:Array.isArray(t)?`${t[0]}${t[1]}`:t})},I=(0,l.memo)(e=>{let{searchData:t,setSearchData:s}=e,{data:i=[]}=(0,v.Ay)(),r=(0,l.useCallback)((e,t)=>{try{if(t.children.join("").includes(e))return!0;return!1}catch{return!1}},[]);return(0,a.jsxs)("div",{className:"src-pages-customer-customerRecycleBin-Search-index-module__header-search-box--m7g53",children:[(0,a.jsx)(j,{allowClear:!0,format:"YYYY-MM-DD HH:mm",showTime:{format:"HH:mm"},onChange:(e,a)=>{let[l,i]=a;s({...t,startTime:l,endTime:i})}}),(0,a.jsx)(b.A,{allowClear:!0,showArrow:!0,filterOption:r,mode:"multiple",placeholder:x.A.formatMessage({id:"cus.recycle.header.select"}
1),style:{minWidth:"260px",marginLeft:"16px"},tagRender:C,onChange:e=>{s({...t,deleteOperationEmailList:e})},children:i.map(e=>(0,a.jsxs)(A,{value:e.email,children:[e.firstName,e.lastName,"-",e.email]},e.id))})]})}),w={font12:"src-pages-customer-customerRecycleBin-index-module__font12--NtN4b",font14:"src-pages-customer-customerRecycleBin-index-module__font14--jvi4C",font16:"src-pages-customer-customerRecycleBin-index-module__font16--VosPZ",font20:"src-pages-customer-customerRecycleBin-index-module__font20--Bpx4P",warn:"src-pages-customer-customerRecycleBin-index-module__warn--_Hig6",success:"src-pages-customer-customerRecycleBin-index-module__success--tgepZ",error:"src-pages-customer-customerRecycleBin-index-module__error--UyuiD",ellipsis:"src-pages-customer-customerRecycleBin-index-module__ellipsis--OmcZ2","ellipsis-2":"src-pages-customer-customerRecycleBin-index-module__ellipsis-2--wK3Fk",pointer:"src-pages-customer-customerRecycleBin-index-module__pointer--W_Fhm","guide-modal":"src-pages-customer-customerRecycleBin-index-module__guide-modal--zWGFH","guide-special":"src-pages-customer-customerRecycleBin-index-module__guide-special--Z2KZC","scroll-hidden":"src-pages-customer-customerRecycleBin-index-module__scroll-hidden--kp0Lv",flexCenter:"src-pages-customer-customerRecycleBin-index-module__flexCenter--xDTG3","router-box":"src-pages-customer-customerRecycleBin-index-module__router-box--zwFyy","empty-box":"src-pages-customer-customerRecycleBin-index-module__empty-box--bkG_w","customer-recycle-bin-main":"src-pages-customer-customerRecycleBin-index-module__customer-recycle-bin-main--L7McW"},S=d().bind(w),k=(0,l.memo)(()=>{let[e,t]=(0,l.useState)(!1),[s,n]=(0,l.useState)({createTime:""}),[d,h]=(0,l.useState)({startTime:"",endTime:"",deleteOperationEmailList:[]}),_=(0,l.useRef)(null),b=(0,r.W6)(),y=(0,g.G)(p.mB),v=(0,g.j)(),j=(null==y?void 0:y.storeId)||Number(localStorage.getItem("quick-storeId")),A=(0,l.useMemo)(()=>[{title:x.A.formatMessage({id:"cus.recycle.table.fileName"}),width:120,ellipsis:!0,dataIndex:"createTime",render:(e,t)=>t.isRollbackAll?`File_${e}`:(0,a.jsxs)("a",{onClick:()=>C(t.id),children:["File_",e]})},{title:x.A.formatMessage({id:"cus.recycle.table.operator"}),width:120,ellipsis:!0,dataIndex:"userName",render:e=>(null!=e?e:"")===""?"-":e},{title:x.A.formatMessage({id:"cus.recycle.table.operatorMail"}),width:120,ellipsis:!0,dataIndex:"email",render:e=>(null!=e?e:"")===""?"-":e},{title:x.A.formatMessage({id:"cus.recycle.table.data"}),width:120,ellipsis:!0,dataIndex:"deleteNum",render:e=>(null!=e?e:"")===""?"-":e},{title:x.A.formatMessage({id:"whatsapp.columns.title.sixth"}),width:100,ellipsis:!0,render:(e,t)=>t.isRollback?(0,a.jsx)("a",{onClick:()=>k(!0,t),children:(0,a.jsx)(i.A,{id:"cus.recycle.recovery.record"})}):(0,a.jsx)(i.A,{id:"cus.recycle.recovery.record"})}],[]),C=(0,l.useCallback)(e=>{let t=[x.A.formatMessage({id:"customer"}),x.A.formatMessage({id:"customer.recycle.bin"})];v((0,p.Wd)(t)),b.push(`/customer-recovery/${e}`)},[]),k=(0,l.useCallback)(async(e,s)=>{t(e),n({createTime:s.createTime,id:s.id})},[]);return(0,a.jsxs)("div",{className:S(w["router-box"]),children:[(0,a.jsx)(I,{searchData:d,setSearchData:h}),(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(u.A,{children:(0,a.jsx)(c.A,{actionRef:_,columns:A,debounceTime:500,pagination:{pageSize:10},params:d,rowKey:"id",showSorterTooltip:!1,request:async e=>{let{startTime:t,endTime:s,deleteOperationEmailList:a,current:l,pageSize:i}=e,{data:r,success:o}=await (0,m.p8)({storeId:j,startTime:t,endTime:s,deleteOperationEmailList:a,pageNum:l,pageSize:i}),{total:n,list:d}=r;return{data:d,success:o,total:n}}})})}),(0,a.jsx)(o.A,{centered:!0,footer:!1,title:s.createTime,visible:e,width:840,bodyStyle:{maxHeight:"640px",overflowY:"auto"},onCancel:()=>{t(!1)},children:(0,a.jsx)(f,{id:s.id,storeId:j})})]})})},29742(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>F});var a=s(74848),l=s(96540),i=s(6442),r=s(9421),o=s(56347),n=s(57256),d=s(6105),c=s(3167),m=s(96049),u=s(98473),p=s(74325),g=s(33898),x=s(85966),h=s(55371),f=s(63064),_=s(26374),b=s(22192),y=s(54510),v=s(26961),j=s(428),A=s(790),C=s(2543),I=s(29843),w=s(78549);let S=e=>{var t;let{editId:s,modalVisible:o,setModalVisible:n,setTabType:d,refTable:c,onClose:p}=e,h=(0,f.jE)(),S=(0,i.A)(),k=(null==(t=(0,x.G)(g.mB))?void 0:t.storeId)||Number(localStorage.getItem("quick-storeId")),[E]=b.A.useForm(),{isInitialLoading:M}=(0,r.I)([u.EN,s],m.Hy,{enabled:!!s,select:e=>null==e?void 0:e.data,onSuccess:e=>{let{name:t,definitions:s}=e;
1null==s||s.forEach(e=>{e.key=e.id,e.filters.forEach(e=>{var t;if(e.key=e.id,(null==(t=e.valueCondition)?void 0:t.valueLogic)===w.nl.social_media_account_equals)try{let t=JSON.parse(e.valueCondition.value);e.channel=t.socialMediaType,e.channelAccount=t.socialMediaOaId}catch(e){}})}),R(s),E.setFieldsValue({name:t})}}),N=()=>{s||(E.resetFields(),R(D)),n(!1),null==p||p()},D=[(0,C.cloneDeep)(I.h0)],[T,R]=(0,l.useState)(D),{mutate:F,isLoading:L}=(0,_.n)(e=>$(e),{onSuccess:e=>{var t;E.resetFields(),N(),s&&d(null==e||null==(t=e.data)?void 0:t.id),h.invalidateQueries([u.uA]),h.invalidateQueries([u.EN]),c.current.reload()}});(0,l.useEffect)(()=>{s||(E.resetFields(),R(D),h.invalidateQueries([u.EN]))},[s]);let $=async e=>s?(0,m.oX)(e):(0,m.iQ)(e);return(0,a.jsx)(v.A,{destroyOnClose:!0,confirmLoading:L,maskClosable:!1,maskStyle:{backgroundColor:"rgba(0,0,0,0.1)"},visible:o,width:1060,title:s?S.formatMessage({id:"cus.tab.edit"}):S.formatMessage({id:"cus.tab.add"}),onCancel:N,onOk:()=>{E.validateFields().then(e=>{let t;(0,I.B0)(T)?y.Ay.error(S.formatMessage({id:"definition.message.error"})):(e.id=s,e.storeId=k,(t=(0,C.cloneDeep)(T)).forEach(e=>{e.filters.forEach(e=>{e.settings&&(e.type="3",e.attributeVariableValue=JSON.stringify(e.attributeVariableValue),delete e.settings,delete e.attributeVariableValueOrigin,delete e.specialEventConditionType),e.fieldType===I.kr&&(delete e.ticketOptions,delete e.specialEventConditionType),e.type===w.i$.ticket&&(e.type=I.cA,delete e.specialEventConditionType),e.channel&&e.channelAccount&&(e.valueCondition.value=JSON.stringify({socialMediaType:e.channel,socialMediaOaId:e.channelAccount}),e.valueCondition.valueLogic=w.nl.social_media_account_equals,delete e.channel,delete e.channelAccount),(e.fieldName===w.Dj.ZALO||e.fieldName===w.Dj.LINE)&&e.attributeVariableValue&&(e.attributeVariableType="4")})}),e.definitions=t,F(e))}).catch(()=>{})},children:(0,a.jsx)(j.A,{spinning:M,children:(0,a.jsxs)(b.A,{form:E,layout:"vertical",children:[(0,a.jsx)(b.A.Item,{label:S.formatMessage({id:"cus.tab.page.name"}),validateTrigger:"onBlur",name:"name",rules:[{required:!0},{pattern:/^((?!\\|\/|:|\*|\?|<|>|\||'|%).){1,10}$/,message:S.formatMessage({id:"cus.tab.page.name.rule"})}],children:(0,a.jsx)(A.A,{showCount:!0,maxLength:10})}),(0,a.jsx)(b.A.Item,{className:"form-item-condition",label:S.formatMessage({id:"cus.tab.page.condition"}),children:(0,a.jsx)(I.Ay,{drawerBody:"root",filterList:T,setFilterList:R})})]})})})};var k=s(90538),E=s(60680),M=s(11721);let N=["-1","-2"],D=e=>{let{title:t,currentId:s,tabType:l,setTabType:r,setEditId:o,setModalVisible:n}=e,d=(0,i.A)(),c=(0,f.jE)(),g=e=>{let{key:t,domEvent:a}=e;a.stopPropagation(),"edit"===t?(n(!0),o(s)):h()},{mutate:x}=(0,_.n)(e=>(0,m.yB)(e),{onSuccess:()=>{c.invalidateQueries([u.uA]),l===s&&r("-1")}}),h=()=>{v.A.confirm({width:520,title:d.formatMessage({id:"cus.tab.delete"}),content:d.formatMessage({id:"cus.tab.delete.tooltip"}),onOk:()=>{x({id:s})}})};return(0,a.jsxs)("div",{children:[t,!N.includes(s)&&(0,a.jsx)(M.A,{overlay:()=>(0,a.jsxs)(E.A,{onClick:g,children:[(0,a.jsx)(E.A.Item,{icon:(0,a.jsx)(p.A,{type:"icon-edit"}),children:d.formatMessage({id:"edit"})},"edit"),(0,a.jsx)(E.A.Item,{icon:(0,a.jsx)(p.A,{type:"icon-Deleat"}),children:d.formatMessage({id:"delete"})},"delete")]}),placement:"bottomCenter",trigger:["click"],children:(0,a.jsx)(p.A,{style:{marginLeft:8,marginRight:0},type:"icon-ic_Ellipsis",onClick:e=>e.stopPropagation()})})]})},{TabPane:T}=n.A,R=[{id:"-1",name:$i18n("cus.tab.name1")},{id:"-2",name:$i18n("cus.tab.name2")}],F=e=>{var t;let{segmentId:s,breadName:n}=e,f=(0,x.G)(h.AS),[_,b]=(0,c.useUrlSearchParams)({tab:"-1"});(0,o.W6)();let y=(null==(t=(0,x.G)(g.mB))?void 0:t.storeId)||Number(localStorage.getItem("quick-storeId")),v=(0,l.useRef)([]),{data:j}=(0,r.I)([u.uA,y],m.XK,{select:e=>[...R,...null==e?void 0:e.data],onSuccess:e=>{var t;let s=null==e?void 0:e.length,a=null==v||null==(t=v.current)?void 0:t.length;a>0&&a<s&&b({tab:e[s-1].id}),v.current=e}}),[A,C]=(0,l.useState)(!1),[I,w]=(0,l.useState)(void 0),E=(0,l.useRef)(null);(0,x.j)(),(0,i.A)();let M=(0,l.useMemo)(()=>(null==j?void 0:j.length)?j:R,[j]),N=(0,l.useMemo)(()=>{let e=M.map(e=>{let{id:t,name:l}=e;return{value:t,label:(0,a.jsx)(D,{currentId:t,setEditId:w,setModalVisible:C,setTabType:e=>b({tab:e}),tabType:t,title:l},t),children:(0,a.jsx)("div",{className:"bg-white p-24px mt-16px rounded-8px h-full",children:(0,a.jsx)(k.A,{breadName:n,segmentId:s,tabId:t,tabName:l,tabType:t},t)})}});return f&&(null==M?void 0:M.length)&&(null==M?void 0:M.length)<7&&e.push({value:"add",disabledSelect:!0,label:(0,a.jsx)(p.A,{className:"color-white",type:"icon-ic_Addto",onClick:()=>{C(!0)}}),children:(0,a.jsx)(a.Fragment,{})}),e},[M,f]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"src-pages-customer-index-module__customer-body--whnLg customer-table !px-24px h-full",children:(0,a.jsx)(d.A,{full:!0,options:N,value:_.tab,onChange:e=>b({tab:e})})}),(0,a.jsx)(S,{editId:I,modalVisible:A,refTable:E,setModalVisible:C,setTabType:e=>b({tab:e}),onClose:()=>{w(void 0)}})]})}},56681(e,t,s){"use strict";s.r(t),s.d(t,{default:()=>$});var a=s(74848),l=s(36962),i=s(67967),r=s.n(i),o=s(96540),n=s(58065),d=s(99038),c=s(85966),m=s(2174),u=s(87175),p=s(6442),g=s(63064),x=s(26374),h=s(56347),f=s(54510),_=s(57136),b=s(96049),y=s(7937),v=s(9421),j=s(92411),A=s(71458),C=s(4141);s(33898);let I={font12:"src-pages-customer-mergeCustomer-components-index-module__font12--nJ3M7",font14:"src-pages-customer-mergeCustomer-components-index-module__font14--Rvxzq",font16:"src-pages-customer-mergeCustomer-components-index-module__font16--rQgqz",font20:"src-pages-customer-mergeCustomer-components-index-module__font20--KNGtd",warn:"src-pages-customer-mergeCustomer-components-index-module__warn--hMUmw",success:"src-pages-customer-mergeCustomer-components-index-module__success--KsERl",error:"src-pages-customer-mergeCustomer-components-index-module__error--uRD4w",ellipsis:"src-pages-customer-mergeCustomer-components-index-module__ellipsis--Fi8A9","ellipsis-2":"src-pages-customer-mergeCustomer-components-index-module__ellipsis-2--ScsGF",pointer:"src-pages-customer-mergeCustomer-components-index-module__pointer--kq0DG","guide-modal":"src-pages-customer-mergeCustomer-components-index-module__guide
1-modal--Ok0rx","guide-special":"src-pages-customer-mergeCustomer-components-index-module__guide-special--wwRn7","scroll-hidden":"src-pages-customer-mergeCustomer-components-index-module__scroll-hidden--kp9ze",flexCenter:"src-pages-customer-mergeCustomer-components-index-module__flexCenter--tG6Xu",modal:"src-pages-customer-mergeCustomer-components-index-module__modal--UVpIu","merge-table":"src-pages-customer-mergeCustomer-components-index-module__merge-table--t4Yfd","row-disabled":"src-pages-customer-mergeCustomer-components-index-module__row-disabled--D0Moe","modal-table":"src-pages-customer-mergeCustomer-components-index-module__modal-table--JCG0Q","header-title":"src-pages-customer-mergeCustomer-components-index-module__header-title--H6pjZ","header-title__date":"src-pages-customer-mergeCustomer-components-index-module__header-title__date--dsIKv","header-title--checked":"src-pages-customer-mergeCustomer-components-index-module__header-title--checked--zW7ma","body-checkbox":"src-pages-customer-mergeCustomer-components-index-module__body-checkbox--lrCxW"},w=r().bind(I),S=e=>{var t;let s,{getSmilarData:l}=e,i=(0,p.A)();(0,c.j)(),(0,h.W6)();let{data:r}=(0,A.Ay)(),d=(0,o.useMemo)(()=>r?[{title:i.formatMessage({id:"cus.table.colName"}),width:160,render:(e,t)=>{let s=(0,C.qc)(t);return(0,a.jsx)("a",{className:w(t.ignore&&"row-disabled"),onClick:()=>l(t.almostData,r),children:s})}},{title:i.formatMessage({id:"cus.table.colEmail"}),width:160,dataIndex:"email",render:(e,t)=>(0,a.jsx)("span",{className:w(t.ignore&&"row-disabled"),children:e})},{title:i.formatMessage({id:"cus.table.colPhone"}),width:160,ellipsis:!0,dataIndex:"phone",render:(e,t)=>(0,a.jsx)("span",{className:w(t.ignore&&"row-disabled"),children:e})},{title:i.formatMessage({id:"cus.table.colCreate"}),width:160,ellipsis:!0,dataIndex:"createTime",render:(e,t)=>(0,a.jsx)("span",{className:w(t.ignore&&"row-disabled"),children:e})},{title:i.formatMessage({id:"cus.table.colUpdate"}),width:160,ellipsis:!0,dataIndex:"updateTime",render:(e,t)=>(0,a.jsx)("span",{className:w(t.ignore&&"row-disabled"),children:e})},{title:i.formatMessage({id:"cus.table.colSimilar"}),width:160,ellipsis:!0,dataIndex:"similar",align:"right",render:(e,t)=>{var s;return(0,a.jsx)("a",{className:w(t.ignore&&"row-disabled"),onClick:()=>l(t.almostData,r),children:null==(s=t.almostData)?void 0:s.length})}},{title:i.formatMessage({id:"operation"}),width:180,fixed:"right",key:"operation",dataIndex:"operation",render:(e,t)=>(0,a.jsx)("a",{className:w(t.ignore&&"row-disabled"),onClick:()=>I(t),children:(0,a.jsx)(n.A,{id:"cus.table.operate.ignore"})})}]:[],[r]),{data:m,isLoading:u}=(s=(null==(t=j.M_.getState().app.user)?void 0:t.storeId)||Number(localStorage.getItem("quick-storeId")),(0,v.I)(["/customer/merge/list"],()=>(0,b.XA)(s),{select:e=>e.data,cacheTime:1/0,staleTime:1/0})),I=e=>{let t=[];e.almostData.forEach(e=>{t.push({id:e.id,ignoreStatus:1})}),k(t)},S=(0,g.jE)(),{mutate:k,isLoading:E}=(0,x.n)(e=>(0,b.Xe)(e),{onSuccess:()=>{f.Ay.success(i.formatMessage({id:"cus.table.operate.ignoreTooltip"})),S.invalidateQueries(["/customer/merge/list"])}});return(0,a.jsx)(y.A,{children:(0,a.jsx)(_.A,{className:w("merge-table"),columns:d,dataSource:m,loading:u,rowKey:"id",showSorterTooltip:!1})})};var k=s(16785),E=s(31262),M=s(26961),N=s(50400),D=s(41477),T=s(77447);let R=r().bind(I),F=e=>{let{modalVisible:t,setModalVisible:s,mergeData:l,tableLoading:i}=e,r=(0,p.A)(),d=[{title:r.formatMessage({id:"cus.table.colMerge"}),width:240,ellipsis:!0,fixed:"left",dataIndex:"fieldDesc",render:(e,t)=>{var s;return`${e}${null!=(s=t.selectedField)?s:""}`}}],[c,m]=(0,o.useState)(d),[h,f]=(0,o.useState)([]),{data:_={}}=(0,A.Ay)(),y=(0,o.useMemo)(()=>null==l?void 0:l.length,[l]);(0,o.useEffect)(()=>{if(_.basic&&y){let{basic:e,media:t}=_,s=[];[...null==e?void 0:e.settings,...null==t?void 0:t.settings].filter(e=>"name"!==e.fieldName).sort((e,t)=>e.orderKey-t.orderKey).forEach(e=>{s.push({fieldName:e.fieldName,fieldDesc:`${e.fieldDesc}: `,isCustomField:2===e.createSource,isCheckbox:["5"].includes(e.fieldType),isSelectedField:["4","5"].includes(e.fieldType)||["phoneSubscribeState","subscribeState","t
1imeZone","gender"].includes(e.fieldName),selectedField:""})}),v(s,!0),f(s)}},[_,y]);let v=(e,t)=>{var s;let i=l.slice(1).filter(e=>e.allChecked)||[];i.forEach((e,t)=>e.isNewer=0===t),m([...d,...null==l?void 0:l.map((s,r)=>{let o=t&&0===r;o&&(s.allChecked=!0);let{allChecked:d,isNewer:c,avatarColor:m,avatarUrl:u,dataType:p}=s;Object.keys(s).forEach(t=>{var a;let l=e.find(e=>e.fieldName===t),i=null!=(a=s[t])?a:"";l&&(l[r]=i,o&&(l.selectedField=i),l[`${r}Checked`]=!!o||l[`${r}Checked`])});let g=(0,C.qc)(s);return{title:()=>{var t;return(0,a.jsx)("div",{className:R("header-title"),children:(0,a.jsxs)("div",{children:[(0,a.jsx)(k.A,{size:40,src:u,style:{fontSize:20,color:"#fff",backgroundColor:m||"rgb(30, 99, 245, 0.6)"},children:u||1===p?"#"===g[0]?g[1]:Array.from(g)[0]:"TEST"}),(0,a.jsx)("input",{className:R("header-title--checked"),defaultChecked:d,type:"checkbox",onChange:()=>w(s,r,e)}),0===r&&(0,a.jsx)("section",{className:R("header-title__date"),children:(0,a.jsx)(n.A,{id:"cus.merge.header.date"})}),i.length>1&&c&&d&&!(null==(t=l[0])?void 0:t.allChecked)&&(0,a.jsx)("section",{className:R("header-title__date"),children:(0,a.jsx)(n.A,{id:"cus.merge.header.date1"})})]})})},width:160,dataIndex:`${r}`,render:(t,s)=>{let l,i=[];for(let e=0;e<y;e++)i.push(s[`${e}Checked`]);let o=i.filter(Boolean).length;return 0===o?l=!d:o>0&&(l=!(d&&s[`${r}Checked`]&&j(s,r))),(0,a.jsx)(E.A,{checked:s[`${r}Checked`],className:R("body-checkbox"),disabled:l,onChange:()=>F(s,r,e),children:t})}}})]),null==(s=I.current)||s.refresh()},j=(e,t)=>{let s=e[t];if(s===e.selectedField)return!0;let a=[];for(let l=0;l<y&&l!==t;l++)s!==e[l]&&a.push(e[`${l}Checked`]);return 0===a.filter(Boolean).length},I=(0,o.useRef)(),w=(e,t,s)=>{e.allChecked=!e.allChecked;let a=s.map(s=>(s[`${t}Checked`]=e.allChecked,s));v(a),f(S(a))},S=e=>{let t=[...e];return t.forEach((e,s)=>{for(let t=0;t<y&&(e.selectedField=e[`${t}Checked`]?e[t]:null,null===e.selectedField);t++);t.splice(s,1,{...e})}),t},F=(e,t,s)=>{let a=e[`${t}Checked`],l=[...s];for(let s=0;s<y;s++){let l=e[t];e[`${s}Checked`]=e[s]===l&&!a}e.selectedField=a?"":e[t];let i=l.findIndex(t=>t.fieldName===e.fieldName);l.splice(i,1,{...e}),v(l),f(l)},L=(0,g.jE)(),{mutate:$,isLoading:O}=(0,x.n)(e=>(0,b.h1)(e),{onSuccess:()=>{s(!1),L.invalidateQueries(["/customer/merge/list"])}}),U=(0,o.useMemo)(()=>(null==l?void 0:l.every(e=>!e.allChecked))||h.every(e=>!e.selectedField),[l,h]);return(0,a.jsx)(M.A,{destroyOnClose:!0,bodyStyle:{padding:0},closable:!1,confirmLoading:O,maskClosable:!1,maskStyle:{backgroundColor:"rgba(0,0,0,0.1)"},visible:t,wrapClassName:R("modal"),footer:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{onClick:()=>s(!1),children:(0,a.jsx)(n.A,{id:"cancel"})}),(0,a.jsx)(N.A,{disabled:U,style:{marginLeft:8},type:"primary",onClick:()=>{M.A.confirm({width:380,centered:!0,closable:!0,title:r.formatMessage({id:"cus.merge.modal.title"}),content:r.formatMessage({id:"cus.merge.modal.tooltip"}),okText:r.formatMessage({id:"cus.merge.modal.button"}),cancelText:r.formatMessage({id:"cancel"}),onOk(){let e={properties:{}},t=l.find(e=>e.allChecked);h.forEach(t=>{let{fieldName:s,selectedField:a,isCustomField:l,isSelectedField:i,isCheckbox:r}=t;l?e.properties[s]=i?(0,u.x)(r,s,a,_):a:e[s]=i?(0,u.x)(r,s,a,_):a}),$({...t,...e})}})},children:(0,a.jsx)(n.A,{id:"cus.merge.merge"})})]}),onCancel:()=>s(!1),children:(0,a.jsx)(T.A,{bordered:!0,actionRef:I,className:R("modal-table"),columns:c,dataSource:h,loading:i,pagination:!1,rowKey:"id",scroll:{y:500,x:400},showSorterTooltip:!1,summary:()=>(0,a.jsx)(D.A.Summary,{fixed:!0,children:(0,a.jsx)(D.A.Summary.Row,{children:(0,a.jsx)(n.A,{id:"cus.merge.footer"})})})})})},L=r().bind({font12:"src-pages-customer-mergeCustomer-index-module__font12--1bdId",font14:"src-pages-customer-mergeCustomer-index-module__font14--nDJtJ",font16:"src-pages-customer-mergeCustomer-index-module__font16--a88za",font20:"src-pages-customer-mergeCustomer-index-module__font20--rm5Ip",warn:"src-pages-customer-mergeCustomer-index-module__warn--caSdj",success:"src-pages-customer-mergeCustomer-index-module__success--xD8w4",error:"src-pages-customer-mergeCustomer-index-module__error--mTpmw",ellipsis:"src-pages-customer-mergeCustomer-index-module__ellipsis--SjMut","ellipsis-2":"src-pages-customer-mergeCustomer-index-module__ellipsis-2--meyxc",pointer:"src-pages-customer-mergeCustomer-index-module__pointer--r7KzF","guide-modal":"src-pages-customer-mergeCustomer-index-module__guide
1-modal--DwSau","guide-special":"src-pages-customer-mergeCustomer-index-module__guide-special--fTPe4","scroll-hidden":"src-pages-customer-mergeCustomer-index-module__scroll-hidden--fvtNp",flexCenter:"src-pages-customer-mergeCustomer-index-module__flexCenter--jjRXT","merge-customer":"src-pages-customer-mergeCustomer-index-module__merge-customer--g47Iy","merge-customer-scan":"src-pages-customer-mergeCustomer-index-module__merge-customer-scan--pbTXj","merge-customer-scan--loading":"src-pages-customer-mergeCustomer-index-module__merge-customer-scan--loading--rV6DB"}),$=()=>{let[e,t]=(0,o.useState)([]),[s,i]=(0,o.useState)(!1),r=(0,c.G)(m.D8);(0,o.useEffect)(()=>{s||t([])},[s]);let p=(0,d.A)(),[g,x]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{p===r.storeId&&x(!!r.status)},[r,p]),(0,a.jsx)("div",{className:L("merge-customer",g?"merge-customer-scan":""),children:g?(0,a.jsxs)("div",{className:L("merge-customer-scan--loading"),children:[(0,a.jsx)(l.A,{}),(0,a.jsx)(n.A,{id:"cus.merge.loading"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S,{getSmilarData:(e,s)=>{var a;i(!0);let l=null==(a=JSON.parse(JSON.stringify(e)))?void 0:a.sort((e,t)=>e.updateTime-t.updateTime).map(e=>({...e,...e.properties}));t((0,u.o)(l,s))}}),s?(0,a.jsx)(F,{mergeData:e,modalVisible:s,setModalVisible:i,tableLoading:!1}):(0,a.jsx)(a.Fragment,{})]})})}}}]);
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.