PageSourceSearch

https://smartypro.ai/crm/js/586.1d6b559267d97cb996ad.js

js smartypro.ai collected 2026-10-05 13:43:38 UTC 10,795 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksmarty_crm_frontend=self.webpackChunksmarty_crm_frontend||[]).push([[586],{87(e,t,s){s.d(t,{A:()=>v});var i,n=s(20053),a=s(96540);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)({}).hasOwnProperty.call(s,i)&&(e[i]=s[i])}return e},d.apply(null,arguments)}const o=e=>a.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",width:22,height:18,viewBox:"0 0 22 18"},e),i||(i=a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("g",{fill:"#0F7DD9",fillRule:"nonzero"},a.createElement("path",{d:"M6.36 8.88c-2.4 0-4.44-2.04-4.44-4.44S3.96 0 6.36 0s4.44 2.04 4.44 4.44-2.04 4.44-4.44 4.44m0-7.2c-1.56 0-2.76 1.2-2.76 2.76S4.8 7.2 6.36 7.2 9.12 6 9.12 4.44s-1.2-2.76-2.76-2.76M9.72 17.04H2.76c-1.44 0-2.64-1.2-2.64-2.64 0-.72.24-1.44.6-1.8 1.44-1.68 3.36-2.64 5.52-2.64s4.2.96 5.52 2.64c.24.36.6 1.08.6 1.8 0 1.44-1.2 2.64-2.64 2.64m-3.48-5.4c-1.68 0-3.24.72-4.32 2.04 0 0-.12.36-.12.72 0 .6.48.96.96.96h6.96c.6 0 .96-.48.96-.96 0-.24-.12-.6-.24-.72-1.08-1.32-2.64-2.04-4.2-2.04"})),a.createElement("path",{stroke:"#0F7DD9",strokeLinecap:"round",strokeWidth:1.5,d:"M14.5 9.5h6M17.5 6.5v6"}))));s.p;var l=s(3157),r=s(19118);const c="addNewInviteButton--b627b791cef8d61b6bfa",h="addNewInviteTitle--f470b5d10c4a2834666c";var m=s(74848);const v=e=>{let{className:t="",onAddNewItem:s}=e;const{formatMessage:i}=(0,r.tz)();return(0,m.jsx)(l.A,{icon:o,className:(0,n.A)(c,t),onClick:s,"data-name":"addNewInviteBtn",children:(0,m.jsx)("span",{className:h,children:i({id:"addParticipant"})})})}},34124(e,t,s){s.d(t,{A:()=>l});var i=s(20053),n=s(44426);const a="itemsLoader--fa16ce792625d0773588",d="expanded--f1e713593dd774dfed49";var o=s(74848);const l=e=>{let{className:t="",isExpanded:s=!1}=e;return(0,o.jsx)(n.A,{className:(0,i.A)("box-col nowrap",a,{[d]:s},t)})}},46412(e,t,s){s.d(t,{A:()=>m});var i=s(20053),n=s(25292),a=s(46376),d=s(19118);const o="noResults--e2d52a0f075b059215a3",l="expanded--ace03659efc6f3a798a0",r="noResultsTitle--c9e4e028cf81f8f3fbf7",c="noResultsIcon--d0c28354e634cc84416e";var h=s(74848);const m=e=>{let{className:t="",isExpanded:s=!1,onAddNewItem:m}=e;const{formatMessage:v}=(0,d.tz)();return(0,h.jsxs)("div",{className:(0,i.A)("box-col nowrap align-middle",o,{[l]:s},t),children:[(0,h.jsx)("div",{className:(0,i.A)("box-row align-middle",c),children:(0,h.jsx)(n.h,{})}),(0,h.jsx)("b",{className:(0,i.A)(r),children:v({id:"noSearchResults"})}),(0,h.jsx)(a.A,{onClick:m,children:v({id:"addParticipant"})})]})}},66801(e,t,s){s.d(t,{A:()=>l});var i=s(20053),n=s(37702),a=s(19118);const d="switchersBlock--a1c66dc850aa4a8f493c";var o=s(74848);const l=e=>{let{className:t="",isFullHistory:s,onToggleSwitch:l}=e;const{formatMessage:r}=(0,a.tz)();return(0,o.jsx)(n.A,{"aria-label":r({id:"showFullMessagesHistory"}),className:(0,i.A)(d,t),isSelected:s,onChange:l})}},76507(e,t,s){s.d(t,{A:()=>n});var i=s(74047);const n=(e,t,s)=>(0,i.A)(e.concat(t),s)},90265(e,t,s){s.r(t),s.d(t,{default:()=>L});var i=s(64467),n=s(96540),a=s(69733),d=s(54446),o=s(98491),l=s(39064),r=s(44e3),c=s(55936),h=s(30267),m=s(65231),v=s(72587),p=s(35891),u=s(76507),A=s(70528),I=s(44784),f=s(86695),g=s(38418),w=s(20053),y=s(68263),x=s(46376),E=s(19118),b=s(41217),N=s(46412),j=s(87),S=s(98132),k=s(66801),O=s(28377),M=s(34124),C=s(4128),D=s(74848);class T extends n.PureComponent{constructor(e){super(e),(0,i.A)(this,"handleAddNewItem",e=>{const{onAddNewItem:t,onSearchValueChange:s}=this.props;t(e).then(()=>{s(""),this.list&&this.list.setActiveItemIndex(-1)})}),(0,i.A)(this,"handleToggleHistory",()=>{this.setState({isFullHistory:!this.state.isFullHistory})}),(0,i.A)(this,"handleAdd",()=>{const{onAdd:e}=this.props,{isFullHistory:t}=this.state;e({isFullHistory:t})}),(0,i.A)(this,"handleKeysDown",e=>{this.props.isLastModal&&(0,y.A)(e,"enter")&&(e.preventDefault(),this.handleAdd())}),this.state={isFullHistory:!0}}componentDidMount(){window.addEventListener("keydown",this.handleKeysDown)}componentDidUpdate(e){const{addedItems:t,itemsToAdd:s,onSearchValueChange:i}=this.props;t.length===e.addedItems.length&&s.length===e.itemsToAdd.length||(t.length!==e.addedItems.length&&i(""),this.list&&this.list.setActiveItemIndex(-1))}componentWillUnmount(){window.removeEventListener("keydown",this.handleKeysDown)}render(){const{intl:{formatMessage:e},isLoaded:t,searchValue:s,addedItems:i,itemsToAdd:a,isHistoryOptionShowed:d,isExpanded:o,getInviteError:l,onSearchValueChange:r,onAddItem:c,onDeleteItem:h,onExpandClick:m}=this.props;return(0,D.jsxs)(b.A,{className:(0,w.A)("box-col nowrap",C.A.addDialogModal),title:e({id:"inviteExter
1nalParticipant"}),showExpandButton:!0,isExpanded:o,onExpandClick:m,children:[(0,D.jsxs)("div",{className:(0,w.A)("box-col nowrap",C.A.content),"data-name":"addInvitesModal",children:[(0,D.jsx)("span",{className:(0,w.A)(C.A.info),children:e({id:"chattersFromOtherWS"})}),(0,D.jsx)(S.A,{searchValue:s,addedItems:i,onSearchValueChange:r,onDeleteItem:h}),(!!a.length||!s)&&t&&(0,D.jsxs)(n.Fragment,{children:[(0,D.jsx)(j.A,{onAddNewItem:this.handleAddNewItem}),(0,D.jsx)(O.A,{componentRef:e=>{this.list=e},addedItems:i,itemsToAdd:a,isExternalSection:!0,isExpanded:o,getInviteError:l,onAddItem:c})]}),!a.length&&!t&&(0,D.jsx)(M.A,{isExpanded:o}),!a.length&&s&&t&&(0,D.jsx)(N.A,{onAddNewItem:this.handleAddNewItem,isExpanded:o})]}),d&&(0,D.jsx)(k.A,{isFullHistory:this.state.isFullHistory,onToggleSwitch:this.handleToggleHistory}),(0,D.jsx)("div",{className:(0,w.A)("box-row nowrap space-between no-overflow"),children:(0,D.jsx)("div",{className:(0,w.A)("box-row nowrap align-right"),children:(0,D.jsx)(x.A,{onClick:this.handleAdd,children:e({id:"common_invite"})})})})]})}}const F=(0,E.j4)(T);function V(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,i)}return s}function P(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?V(Object(s),!0).forEach(function(t){(0,i.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):V(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const _=e=>Object.keys(e).map(t=>e[t]);class H extends n.PureComponent{constructor(e){super(e),(0,i.A)(this,"fetchInvites",()=>{const{dialogId:e,fetchMyInvites:t,fetchUsersInvites:s,fetchDialogInvites:i}=this.props,{addedInvites:n,invitesToAdd:a}=this.state;Promise.all([t(),s({withoutScheme:!0}),i(e)]).then(e=>{let[t,s]=e;const i=t.payload.result||{},d=(s.payload.result||[]).map(e=>P(P({},e),{},{collectionName:"users",defaultAvatar:!e.imageSrc,fullName:e.fullName||e.email,_id:e._id||(0,A.A)("no-invite-id-")})),o=[];
1Object.keys(i).forEach(e=>i[e].forEach(t=>{o.push(P(P({},t),{},{collectionName:"users"===e?"users":"employees",defaultAvatar:"invites"===e||t.defaultAvatar,fullName:t.fullName||t.email,_id:t._id||(0,A.A)("no-invite-id-")}))})),this.setState({isLoaded:!0,invitesToAdd:(0,u.A)(a,d.concat(o).filter(e=>!n[e._id]),"email"),myInvitesEmails:new Set(o.map(e=>e.email))})}).catch(e=>{console.error(e),this.setState({isLoaded:!0,invitesToAdd:[],myInvitesEmails:new Set})})}),(0,i.A)(this,"handleSearchValueChange",e=>this.setState({searchValue:e})),(0,i.A)(this,"handleAddInvite",e=>{const{addedInvites:t,invitesToAdd:s}=this.state;this.setState({addedInvites:P(P({},t),{},{[e._id]:e}),invitesToAdd:(0,I.A)(s,e)})}),(0,i.A)(this,"handleDeleteInvite",e=>{const{addedInvites:t,invitesToAdd:s}=this.state;this.setState({addedInvites:(0,p.A)(t,e._id),invitesToAdd:[e].concat(s)})}),(0,i.A)(this,"handleAddNewInvite",()=>{const{pushModalWindow:e}=this.props;return e("ADD_INVITE",{checkEmail:this.getInviteEmailError,checkComment:this.getInviteCommentError}).then(e=>
1{if(e&&e.type===m.bv6.CONFIRM){const{email:t,fullName:s,comment:i}=e.value;this.handleAddInvite((0,v.XX)(t,s,i))}})}),(0,i.A)(this,"getInviteEmailError",e=>{if(_(this.state.addedInvites).some(t=>t.email===e))return"userWithThisEmailAlreadyAdded";const t=this.props.dialogInvites.find(t=>t.email===e);if(!t)return"";const s=t.inviteStatus||t.status;return["invite_blocked","blocked","block"].includes(s)?"inviteStatusUserBlockedInvites":"userWithThisEmailAlreadyInvited"}),(0,i.A)(this,"getInviteCommentError",(e,t)=>t||this.state.myInvitesEmails.has(e)?"":"optEmptyField"),(0,i.A)(this,"handleAdd",async e=>{let{isFullHistory:t=!0}=e;const{dialogId:s,addDialogInvites:i,checkRecaptcha:n,chooseWsForExternalParticipant:a,pushModalWindow:d,popModalWindow:o}=this.props,{addedInvites:l}=this.state;if(!this.isInvitesAdding&&Object.keys(l).length){this.isInvitesAdding=!0;try{var r,c;const e=await n();if(!e.type||e.type!==m.bv6.OK)return void(this.isInvitesAdding=!1);const h=await i(s,_(l).map(e=>({email:e.email||"",fullName:e.fullName||"",comment:e.comment||""})),t?"full":"base",{captcha:e.value}),v=(null===(r=h.payload)||void 0===r||null===(c=r.result)||void 0===c?void 0:c.needToChooseWs)||{};if(Object.keys(v).length)for(const e in v){const t=await d("SELECT_WS",{email:e,workspaces:v[e]});t.type===m.bv6.SAVE&&await a(s,t.wsId,e)}return await o({type:m.bv6.CONFIRM,value:h}),h}catch(e){if((0,f.k)(e,403,"inviteIsAlreadySent"))return void this.props.pushModalWindow("UNIVERSAL_INFO",{titleKey:"limitation",infoKey:"resendingMessage"});console.error(e)}}}),(0,i.A)(this,"filterItem",e=>(0,d.A)(e.title||"",this.state.searchValue)||(0,d.A)(e.fullName||"",this.state.searchValue)||(0,d.A)(e.email||"",this.state.searchValue));const{addedInvites:t,invites:s}=e,n=((e,t)=>{const s={};return e.forEach(e=>{s[e[t]]=e}),s})(t,"_id");this.state={searchValue:"",addedInvites:n,invitesToAdd:s.filter(e=>!n[e._id]),isLoaded:!1,myInvitesEmails:new Set},this.isInvitesAdding=!1}componentDidMount(){this.fetchInvites()}render(){const{searchValue:e,addedInvites:t,invitesToAdd:s,isLoaded:i}=this.state,{isLastModal:n,isHistoryOptionShowed:a,isExpanded:d,rights:o,onExpandClick:l}=this.props;return(0,D.jsx)(F,{isLastModal:n,isLoaded:i,rights:o,searchValue:e,addedItems:_(t),itemsToAdd:s.filter(this.filterItem),isHistoryOptionShowed:a,isExpanded:d,getInviteError:this.getInviteEmailError,onSearchValueChange:this.handleSearchValueChange,onAddItem:this.handleAddInvite,onDeleteItem:this.handleDeleteInvite,onAddNewItem:this.handleAddNewInvite,onAdd:this.handleAdd,onExpandClick:l})}}(0,i.A)(H,"defaultProps",{isLastModal:!0,addedInvites:[]});const L=(0,a.Ng)(l.oC,{fetchDialogInvites:c.Pm,fetchMyInvites:h.v,fetchUsersInvites:h.f,addDialogInvites:c.SJ,checkRecaptcha:r.aU,popModalWindow:o.Vc,pushModalWindow:o.mt,chooseWsForExternalParticipant:g.JX})(H)}}]);
2//# sourceMappingURL=586.1d6b559267d97cb996ad.js.map

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.