Files
im_webapp/umd/803.prod.js
T
2026-07-04 15:19:29 +03:00

2 lines
4.0 KiB
JavaScript

"use strict";(self.webpackChunktinode_webapp=self.webpackChunktinode_webapp||[]).push([[803],{4803:function(e,s,n){n.r(s),n.d(s,{default:function(){return m}});var a=n(1594),t=n.n(a),r=n(8181),i=n(8892),o=n(5372),l=n(5247),d=n(4532),c=n(7981),h=n(4848);const p=(0,r.defineMessages)({unknown_name:{id:"unknown_name",defaultMessage:"Unknown",description:"Name to show when the name is missing"}});class m extends t().PureComponent{constructor(e){super(e),this.state={content:e.content.object},e.content.object||(0,c.QJ)(e.content.file).then(e=>{this.setState({content:e})}),this.handleSendCard=this.handleSendCard.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this)}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}handleKeyDown(e){e.preventDefault(),"Escape"===e.key&&this.props.onClose()}handleSendCard(){this.props.onClose(),this.props.onSendMessage(this.props.content)}render(){const e=this.state.content,s=d.TheCard.getFn(e),n=d.TheCard.getPhotoUrl(e)||null,a=e?.note,t=d.TheCard.getOrg(e),c=d.TheCard.getComm(e,"email")||[],m=d.TheCard.getComm(e,"tel")||[],u=d.TheCard.getComm(e,"tinode")||[],j=d.TheCard.getComm(e,"http")||[],x=[];return c.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";x.push((0,h.jsxs)("div",{className:"group quoted",children:[(0,h.jsx)("tt",{children:e.value}),(0,h.jsxs)("span",{className:"small gray",children:[" ",n?`(${n})`:""]})]},`email-${s}`))}),m.forEach((e,s)=>{let n=e.value;try{const s=(0,i.L)(e.value);n=s?s.formatInternational():e.value}catch(e){}const a=Array.isArray(e.des)?e.des.join(", "):"";x.push((0,h.jsxs)("div",{className:"group quoted",children:[(0,h.jsx)("tt",{children:n}),(0,h.jsxs)("span",{className:"small gray",children:[" ",a?`(${a})`:""]})]},`tel-${s}`))}),u.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";x.push((0,h.jsxs)("div",{className:"group quoted",children:[(0,h.jsx)("tt",{children:e.value}),(0,h.jsxs)("span",{className:"small gray",children:[" ",n?`(${n})`:""]})]},`tinode-${s}`))}),j.forEach((e,s)=>{const n=Array.isArray(e.des)?e.des.join(", "):"";x.push((0,h.jsxs)("div",{className:"group quoted",children:[(0,h.jsx)("tt",{children:e.value}),(0,h.jsxs)("span",{className:"small gray",children:[" ",n?`(${n})`:""]})]},`url-${s}`))}),(0,h.jsxs)("div",{id:"image-preview",children:[(0,h.jsxs)("div",{id:"preview-caption-panel",children:[(0,h.jsx)("span",{children:(0,h.jsx)(r.FormattedMessage,{id:"label_contact_card",defaultMessage:"Contact Card",description:"Label for contact card preview"})}),(0,h.jsx)("a",{href:"#",onClick:e=>{e.preventDefault(),this.props.onClose()},children:(0,h.jsx)("i",{className:"material-icons gray",children:"close"})})]}),(0,h.jsx)("div",{id:"image-preview-container",children:(0,h.jsx)("div",{className:"doc-card",children:(0,h.jsxs)("div",{className:"panel-form-column",children:[(0,h.jsx)("center",{children:(0,h.jsx)("div",{className:"avatar-box",children:(0,h.jsx)(l.A,{authorizeURL:this.props.tinode.authorizeURL,avatar:n||!0,topic:"usrXXX123",title:s})})}),(0,h.jsx)("div",{className:"group",children:(0,h.jsx)("div",{className:"large ellipsized",children:s||(0,h.jsx)(r.FormattedMessage,{...p.unknown_name})})}),t?(0,h.jsx)("div",{className:"group",children:(0,h.jsx)("div",{children:t})}):null,a?(0,h.jsxs)("div",{className:"group",children:[(0,h.jsx)("label",{className:"small",children:(0,h.jsx)(r.FormattedMessage,{id:"label_description",defaultMessage:"Description",description:"Label for description of user or topic"})}),(0,h.jsx)("div",{className:"quoted",children:a})]}):null,x.length>0?(0,h.jsxs)("div",{className:"group",children:[(0,h.jsx)("label",{className:"small",children:(0,h.jsx)(r.FormattedMessage,{id:"label_contacts",defaultMessage:"Contacts",description:"Label for contact information"})}),x]}):null]})})}),(0,h.jsx)(o.A,{noInput:!0,tinode:this.props.tinode,reply:this.props.reply,onCancelReply:this.props.onCancelReply,onSendMessage:this.handleSendCard,onError:this.props.onError})]})}}}}]);
//# sourceMappingURL=803.prod.js.map