Website : rimsha.abasa.com
backdoor
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
mattermost
/
client
/
Filename :
6222.116d11a85d0f1278ec9a.js
back
Copy
"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[6222],{62114:(e,t,n)=>{n.d(t,{A:()=>m});var a=n(62688),s=n.n(a),i=(n(17046),n(36418)),o=n.n(i),l=n(14778),r=n(37270),c=n(14696),d=n(30596),p=n(40057),h=n(21650);const u=e=>{let{pulsatingDotPlacement:t="left",pulsatingDotTranslate:n}=e;const a=(0,r.useDispatch)(),s=(0,r.useSelector)(h.F9),u=o().createElement(l.FormattedMessage,{id:"newChannelWithBoard.tutorialTip.title",defaultMessage:"Access linked boards from the App Bar"}),m=o().createElement(l.FormattedMessage,{id:"newChannelWithBoard.tutorialTip.description",defaultMessage:"The board you just created can be quickly accessed by clicking on the Boards icon in the App bar. You can view the boards that are linked to this channel in the right-hand sidebar and open one in full view."}),[g,E]=(0,i.useState)(s),b=(0,i.useCallback)((e=>{e.stopPropagation(),E(!1),a((0,d.z)({[p.pm.NEW_CHANNEL_WITH_BOARD_TOUR_SHOWED]:!0}))}),[]),f=(0,i.useCallback)((e=>{e.stopPropagation(),e.preventDefault(),g?(a((0,d.z)({[p.pm.NEW_CHANNEL_WITH_BOARD_TOUR_SHOWED]:!0})),E(!1)):E(!0)}),[]),C=(0,c.LX)(["app-bar-icon-focalboard"],[],{y:-2,height:4,x:0,width:0});return s?o().createElement(c.Yd,{show:!0,screen:m,title:u,overlayPunchOut:C,placement:"right-start",pulsatingDotPlacement:t,step:1,singleTip:!0,showOptOut:!1,interactivePunchOut:!0,handleDismiss:b,handleOpen:f,handlePrevious:b,offset:[-30,5],pulsatingDotTranslate:n}):null};u.propTypes={pulsatingDotTranslate:s().shape({x:s().number.isRequired,y:s().number.isRequired})};const m=u},96121:(e,t,n)=>{n.d(t,{A:()=>p});var a=n(62688),s=n.n(a),i=n(36418),o=n.n(i),l=n(62114),r=n(87131),c=n(78451);const d=e=>{const{ariaLabelOverride:t,buttonClass:n,buttonId:a,children:s,onClick:i,tooltip:d,tooltipShortcut:p,isRhsOpen:h,pluginId:u}=e,m=u===c.g_.focalboard,g=null!=t?t:d;return o().createElement(o().Fragment,null,o().createElement(r.A,{title:h?"":d,shortcut:p},o().createElement("button",{id:a,"aria-label":g,className:n||"channel-header__icon",onClick:i},s)),m&&o().createElement(l.A,{pulsatingDotPlacement:"start",pulsatingDotTranslate:{x:0,y:-22}}))};d.propTypes={ariaLabelOverride:s().string,buttonClass:s().string,buttonId:s().string.isRequired,children:s().node.isRequired,onClick:s().func.isRequired,tooltip:s().string.isRequired,isRhsOpen:s().bool,pluginId:s().string};const p=d},86222:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Be});var a=n(37270),s=n(32446),i=n(30413),o=n(29370),l=n(56707),r=n(40057),c=n(65952),d=n(26614),p=n(73996),h=n(14776),u=n(7430),m=n(16230),g=n(2386),E=n(75270),b=n(64890),f=n(68124),C=(n(4290),n(71633)),_=n.n(C),v=n(36418),N=n.n(v),M=n(14778),A=n(67277),y=n(2866),w=n(77828),P=n(87131),H=(n(17046),n(35134)),T=n.n(H),O=n(34545),x=n.n(O),R=n(17983),I=n(99068),S=n(78451);const L=(0,a.connect)((function(e){return{currentChannel:(0,c.Lw)(e),pluginCallComponents:e.plugins.components.CallButton,channelMember:(0,c.tW)(e),sidebarOpen:e.views.rhs.isSidebarOpen}}))((function(e){let{pluginCallComponents:t,currentChannel:n,channelMember:a,sidebarOpen:s}=e;const[i,o]=(0,v.useState)(!1),[l,r]=(0,v.useState)(!0),c=(0,v.useRef)(s),{formatMessage:d}=(0,M.useIntl)();if((0,v.useEffect)((()=>{c.current&&!s&&(r(!1),setTimeout((()=>{r(!0)}),S.YM.CHANNEL_HEADER_BUTTON_DISABLE_TIMEOUT)),c.current=s}),[s]),0===t.length)return null;const p={container:{marginTop:16,height:32}};if(1===t.length){const e=t[0],s=()=>{var t;return null===(t=e.action)||void 0===t?void 0:t.call(e,n,a)};return N().createElement("div",{style:p.container,className:"flex-child",onClick:l?s:void 0,onTouchEnd:l?s:void 0},e.button)}const h=t.map((e=>N().createElement("li",{className:"MenuItem",key:e.id,onClick:t=>{var s;t.preventDefault(),null===(s=e.action)||void 0===s||s.call(e,n,a)}},e.dropdownButton)));return N().createElement("div",{style:p.container,className:"flex-child"},N().createElement(I.A,{onToggle:e=>o(e)},N().createElement("button",{className:_()("style--none call-button dropdown",{active:i})},N().createElement(x(),{color:"inherit","aria-label":d({id:"generic_icons.call",defaultMessage:"Call icon"}).toLowerCase()}),N().createElement("span",{className:"call-button-label"},"Call"),N().createElement(T(),{color:"inherit","aria-label":d({id:"generic_icons.dropdown",defaultMessage:"Dropdown Icon"}).toLowerCase()})),N().createElement(R.A,{id:"callOptions",ariaLabel:d({id:"call_button.menuAriaLabel",defaultMessage:"Call type selector"}),customStyles:{top:"auto",left:"auto",right:0}},h)))}));var k=n(43595),F=n(77440),B=n(31423),D=n(21650),j=n(62688),U=n.n(j),G=(n(43813),n(89735)),W=n(6098),q=n(17651),Y=n(96121);function z(e){const{formatMessage:t}=(0,M.useIntl)();return N().createElement("span",e,N().createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 18 18",version:"1.1",role:"img","aria-label":t({id:"generic_icons.plugins",defaultMessage:"Plugins"})},N().createElement("path",{d:"M14.58 9.14399L17.136 6.60599C17.304 6.42599 17.388 6.20999 17.388 5.95799C17.388 5.70599 17.298 5.49599 17.118 5.32799C16.95 5.14799 16.74 5.05799 16.488 5.05799C16.236 5.05799 16.026 5.14799 15.858 5.32799L13.302 7.86599L10.134 4.69799L12.672 2.14199C12.852 1.97399 12.942 1.76399 12.942 1.51199C12.942 1.25999 12.852 1.04999 12.672 0.881987C12.504 0.701987 12.294 0.611987 12.042 0.611987C11.79 0.611987 11.574 0.695987 11.394 0.863987L8.856 3.41999L6.318 0.863987C6.138 0.695987 5.922 0.611987 5.67 0.611987C5.418 0.611987 5.208 0.695987 5.04 0.863987V0.881987C4.86 1.04999 4.77 1.25999 4.77 1.51199C4.77 1.76399 4.86 1.97399 5.04 2.14199L5.67 2.78999L2.808 5.65199C2.016 6.44399 1.458 7.36799 1.134 8.42399C0.81 9.45599 0.744 10.512 0.936 11.592C1.128 12.66 1.56 13.632 2.232 14.508L0.27 16.47C0.09 16.638 0 16.848 0 17.1C0 17.352 0.09 17.562 0.27 17.73C0.45 17.898 0.66 17.982 0.9 17.982C1.152 17.994 1.362 17.91 1.53 17.73L3.492 15.768C4.368 16.44 5.34 16.872 6.408 17.064C7.488 17.256 8.544 17.19 9.576 16.866C10.632 16.542 11.556 15.984 12.348 15.192L15.21 12.33L15.858 12.96C16.026 13.14 16.236 13.23 16.488 13.23C16.74 13.23 16.95 13.14 17.118 12.96H17.136C17.304 12.792 17.388 12.582 17.388 12.33C17.388 12.078 17.304 11.862 17.136 11.682L14.58 9.14399ZM11.088 13.914C10.452 14.55 9.702 14.976 8.838 15.192C8.01 15.408 7.176 15.408 6.336 15.192C5.472 14.976 4.722 14.55 4.086 13.914C3.45 13.278 3.024 12.528 2.808 11.664C2.592 10.824 2.592 9.98999 2.808 9.16199C3.024 8.29799 3.45 7.54799 4.086 6.91199L6.948 4.04999L13.95 11.052L11.088 13.914Z"})))}var V=n(27840);function Q(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class X extends N().PureComponent{constructor(){super(...arguments),Q(this,"handleRootClose",(()=>{this.props.onClose()}))}render(){const{open:e,rootCloseEvent:t,children:n}=this.props;return N().createElement(W.YE,{disabled:!e,onRootClose:this.handleRootClose,event:t},N().createElement("ul",{role:"menu",className:"dropdown-menu channel-header_plugin-dropdown"},n))}}Q(X,"propTypes",{open:U().bool,children:U().node,onClose:U().func.isRequired,rootCloseEvent:U().oneOf(["click","mousedown"]),bsRole:U().string.isRequired});class K extends N().PureComponent{constructor(){super(...arguments),Q(this,"handleClick",(e=>{this.props.onClick&&this.props.onClick(e)}))}render(){const{children:e}=this.props;let t="";return this.props.dropdownOpen&&(t=" channel-header__icon--active"),N().createElement("button",{id:"pluginChannelHeaderButtonDropdown",className:"channel-header__icon channel-header__icon--wide "+t,type:"button",onClick:this.handleClick},e)}}Q(K,"propTypes",{children:U().node,dropdownOpen:U().bool,onClick:U().func,bsRole:U().string.isRequired});class J extends N().PureComponent{constructor(e){super(e),Q(this,"disableButtonsClosingRHS",!1),Q(this,"toggleDropdown",(e=>{this.setState({dropdownOpen:e})})),Q(this,"onClose",(()=>{this.toggleDropdown(!1)})),Q(this,"fireAction",(e=>{this.disableButtonsClosingRHS||e(this.props.channel,this.props.channelMember)})),Q(this,"fireActionAndClose",(e=>{e(this.props.channel,this.props.channelMember),this.onClose()})),Q(this,"createComponentButton",(e=>{var t,n;function a(e,t){return"string"==typeof t?t:t&&"object"==typeof t&&"type"in t&&t.type===M.FormattedMessage?e.formatMessage({id:t.props.id,defaultMessage:t.props.defaultMessage},t.props.value):""}let s;e.tooltipText?s=a(this.props.intl,e.tooltipText):e.dropdownText&&(s=a(this.props.intl,e.dropdownText));const i=null!==(t=null!==(n=e.tooltipText)&&void 0!==n?n:e.dropdownText)&&void 0!==t?t:"";return N().createElement(Y.A,{key:"channelHeaderButton"+e.id,buttonClass:"channel-header__icon",onClick:()=>this.fireAction(e.action),buttonId:e.id+"ChannelHeaderButton",tooltip:i,ariaLabelOverride:s,pluginId:e.pluginId},e.icon)})),Q(this,"onBindingClick",(async e=>{if(this.disableButtonsClosingRHS)return;const{channel:t,intl:n}=this.props,a=(0,V.aC)(e.app_id,e.location,this.props.channel.id,this.props.channel.team_id),s=await this.props.actions.handleBindingClick(e,a,n);if(s.error){const e=s.error,a=e.text||n.formatMessage({id:"apps.error.unknown",defaultMessage:"Unknown error occurred."});return void this.props.actions.postEphemeralCallResponseForChannel(e,a,t.id)}const i=s.data;switch(i.type){case q.G4.OK:i.text&&this.props.actions.postEphemeralCallResponseForChannel(i,i.text,t.id);break;case q.G4.NAVIGATE:break;case q.G4.FORM:i.form&&this.props.actions.openAppsModal(i.form,a);break;default:{const e=this.props.intl.formatMessage({id:"apps.error.responses.unknown_type",defaultMessage:"App response type not supported. Response type: {type}."},{type:i.type});this.props.actions.postEphemeralCallResponseForChannel(i,e,t.id)}}})),Q(this,"createAppBindingButton",(e=>N().createElement(Y.A,{key:"channelHeaderButton_".concat(e.app_id,"_").concat(e.location),buttonClass:"channel-header__icon style--none",onClick:()=>this.onBindingClick(e),buttonId:"".concat(e.app_id,"_").concat(e.location),tooltip:e.label},N().createElement("img",{src:e.icon,width:"24",height:"24"})))),Q(this,"createDropdown",((e,t)=>{const n=e.filter((e=>e.action)).map((e=>N().createElement("li",{key:"channelHeaderPlug"+e.id},N().createElement("a",{href:"#",className:"d-flex align-items-center",onClick:()=>this.fireActionAndClose(e.action)},N().createElement("span",{className:"d-flex align-items-center overflow--ellipsis"},e.icon),N().createElement("span",null,e.dropdownText)))));let a=n;return this.props.appsEnabled&&(a=n.concat(t.map((e=>N().createElement("li",{key:"channelHeaderPlug"+e.app_id+e.location},N().createElement("a",{href:"#",className:"d-flex align-items-center",onClick:()=>this.fireActionAndClose((()=>this.onBindingClick(e)))},N().createElement("span",{className:"d-flex align-items-center overflow--ellipsis icon"},N().createElement("img",{src:e.icon})),N().createElement("span",null,e.label))))))),N().createElement("div",{className:"flex-child"},N().createElement(G.Dropdown,{id:"channelHeaderPlugDropdown",onToggle:this.toggleDropdown,open:this.state.dropdownOpen},N().createElement(K,{bsRole:"toggle",dropdownOpen:this.state.dropdownOpen},N().createElement(P.A,{title:N().createElement(M.FormattedMessage,{id:"generic_icons.plugins",defaultMessage:"Plugins"})},N().createElement(N().Fragment,null,N().createElement(z,{id:"pluginChannelHeaderIcon",className:"icon icon--standard icon__pluginChannelHeader","aria-hidden":"true"}),N().createElement("span",{id:"pluginCount",className:"icon__text"},a.length)))),N().createElement(X,{bsRole:"menu",open:this.state.dropdownOpen,onClose:this.onClose},a)))})),this.state={dropdownOpen:!1}}componentDidUpdate(e){e.sidebarOpen&&!this.props.sidebarOpen&&(this.disableButtonsClosingRHS=!0,setTimeout((()=>{this.disableButtonsClosingRHS=!1}),S.YM.CHANNEL_HEADER_BUTTON_DISABLE_TIMEOUT))}render(){const e=this.props.components||[],t=this.props.appsEnabled&&this.props.appBindings||[];if(this.props.shouldShowAppBar||0===e.length&&0===t.length)return null;if(e.length+t.length<=15){let n=e.filter((e=>e.icon&&e.action)).map(this.createComponentButton);return this.props.appsEnabled&&(n=n.concat(t.map(this.createAppBindingButton))),n}return this.createDropdown(e,t)}}Q(J,"propTypes",{components:U().array,appBindings:U().array,appsEnabled:U().bool.isRequired,sidebarOpen:U().bool.isRequired,shouldShowAppBar:U().bool.isRequired,actions:U().shape({}).isRequired}),Q(J,"defaultProps",{components:[],appBindings:[]});const Z=(0,M.injectIntl)(J),$=(0,a.connect)((function(e){const t=(0,k.cO)(e);return{components:(0,D.IH)(e),appBindings:(0,k.eK)(e),appsEnabled:t,appBarEnabled:(0,k.SN)(e),theme:(0,F.O4)(e),sidebarOpen:e.views.rhs.isSidebarOpen,shouldShowAppBar:(0,D.hN)(e)}}),(function(e){return{actions:(0,s.zH)({handleBindingClick:B.I$,postEphemeralCallResponseForChannel:B.hV,openAppsModal:B.el},e)}}))(Z);var ee=n(85873),te=(n(76685),n(79751)),ne=n(64182),ae=n(57486),se=n(62975),ie=(n(29206),n(3188),n(6552),n(17638)),oe=n(38889),le=n(94621),re=n(18515);function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function de(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach((function(t){pe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function pe(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const he={singleline:!0},ue={singleline:!1},me={mentionHighlight:!1,atMentions:!0},ge={hideUtilities:!0},Ee={duration:{open:S.pl.FADE_IN_DURATION,close:S.pl.FADE_OUT_DURATION},initial:S.mj.START};function be(e){const t=(0,a.useSelector)(h._p),n=(0,v.useRef)(null),s=(w=null==n?void 0:n.current,P=e.text,!!w&&(!!P.match(/\n{2,}/g)||(w.scrollWidth!==w.clientWidth||w.scrollHeight!==w.clientHeight)&&(w.scrollWidth>w.clientWidth||w.scrollHeight>w.clientHeight))),i=(0,v.useMemo)((()=>({inHeader:de(de(de({},he),me),{},{channelNamesMap:e.channelMentionsNameMap}),inPopover:de(de(de({},ue),me),{},{channelNamesMap:e.channelMentionsNameMap})})),[e.channelMentionsNameMap]),[o,l]=(0,v.useState)(!1),{refs:{setReference:r,setFloating:c},floatingStyles:d,context:p}=(0,ie.we)({open:!!s&&o,onOpenChange:l,whileElementsMounted:oe.ll,middleware:[(0,le.cY)(-28)]}),{isMounted:u,styles:m}=(0,ie.DL)(p,Ee),g=(0,ie.Mk)(p,{enabled:s,handleClose:(0,ie.iB)({requireIntent:!1,blockPointerEvents:!0})}),E=(0,ie.iQ)(p),b=(0,ie.s9)(p),f=(0,ie.kp)(p),C=(0,ie.It)(p,{role:"tooltip"}),{getReferenceProps:_,getFloatingProps:M}=(0,ie.bv)([g,E,f,b,C]),A=(0,ie.SV)([n,r]),y=function(e){return e?e.clientWidth+18:"inherit"}(null==n?void 0:n.current);var w,P;function H(e){(0,ee.oO)(e,t)}return N().createElement(N().Fragment,null,N().createElement("div",Object.assign({ref:A,className:"header-description__text"},_(),{onClick:H}),N().createElement(re.A,{message:e.text,options:i.inHeader,imageProps:ge})),u&&N().createElement(ie.XF,{id:S.Bj},N().createElement(ie.zR,{className:"channel-header-text-popover-floating-overlay",lockScroll:!0},N().createElement("div",Object.assign({ref:c,className:"channel-header-text-popover",style:de(de({maxWidth:y},d),m),onClick:H},M()),N().createElement(re.A,{message:e.text,options:i.inPopover,imageProps:ge})))))}function fe(e){var t,n,a,s,i,o;const l=0!==e.channel.delete_at,c=e.channel.type===S.YM.DM_CHANNEL,d=e.channel.type===S.YM.GM_CHANNEL,p=c&&null!==(t=null===(n=e.dmUser)||void 0===n?void 0:n.is_bot)&&void 0!==t&&t,h=e.channel.type===S.YM.PRIVATE_CHANNEL,u=p?null!==(a=null===(s=e.dmUser)||void 0===s?void 0:s.bot_description)&&void 0!==a?a:"":null!==(i=null===(o=e.channel)||void 0===o?void 0:o.header)&&void 0!==i?i:"";var m,g;return u.trim().length>0?N().createElement(be,{text:u,channelMentionsNameMap:(0,se.QE)(null===(m=e.channel)||void 0===m||null===(g=m.props)||void 0===g?void 0:g.channel_mentions)?e.channel.props.channel_mentions:void 0}):l||p?null:c||d?N().createElement(Ce,{channel:e.channel}):N().createElement(ae.A,{channelId:e.channel.id,teamId:e.teamId,permissions:[h?r.xB.MANAGE_PRIVATE_CHANNEL_PROPERTIES:r.xB.MANAGE_PUBLIC_CHANNEL_PROPERTIES]},N().createElement(Ce,{channel:e.channel}))}function Ce(e){let{channel:t}=e;const n=(0,a.useDispatch)();return N().createElement("button",{className:"header-placeholder style--none",onClick:function(){n((0,te.q)({modalId:S.IQ.EDIT_CHANNEL_HEADER,dialogType:ne.A,dialogProps:{channel:t}}))}},N().createElement(M.FormattedMessage,{id:"channel_header.headerText.addNewButton",defaultMessage:"Add a channel header"}),N().createElement("i",{className:"icon icon-pencil-outline edit-icon","aria-hidden":!0}))}var _e=n(40693),ve=n(61767),Ne=n(59050),Me=n(17862),Ae=n(19542),ye=n(42945);const we=()=>{var e;const t=(0,M.useIntl)(),n=(0,a.useDispatch)(),s=(0,a.useSelector)(c.TJ),o=(0,a.useSelector)(c.Lw),l=(null!==(e=null==o?void 0:o.delete_at)&&void 0!==e?e:0)>0,r=(0,v.useRef)(null),d=(0,v.useCallback)((e=>{e.stopPropagation(),o&&(n(s?(0,i.XJ)(o.id):(0,i.yc)(o.id)),requestAnimationFrame((()=>{r.current&&document.dispatchEvent(new CustomEvent(S.pn.FOCUS,{detail:{target:r.current,keyboardOnly:!1}}))})))}),[s,o,n]);if(!o||l)return null;let p=t.formatMessage({id:"channelHeader.addToFavorites",defaultMessage:"Add to Favorites"});s&&(p=t.formatMessage({id:"channelHeader.removeFromFavorites",defaultMessage:"Remove from Favorites"})),p=p.toLowerCase();const h=N().createElement(N().Fragment,null,!s&&N().createElement(M.FormattedMessage,{id:"channelHeader.addToFavorites",defaultMessage:"Add to Favorites"}),s&&N().createElement(M.FormattedMessage,{id:"channelHeader.removeFromFavorites",defaultMessage:"Remove from Favorites"}));return N().createElement(P.A,{title:h},N().createElement("button",{id:"toggleFavorite",onClick:d,className:_()("channel-header__favorites btn btn-icon btn-xs",{active:s,inactive:!s}),"aria-label":p,ref:r},N().createElement("i",{className:_()("icon",{"icon-star":s,"icon-star-outline":!s})})))},Pe=(0,v.memo)(we);var He=n(6281),Te=n(96182);const Oe=e=>{let{dmUser:t,gmMembers:n,remoteNames:s}=e;const i=(0,a.useSelector)(c.Lw);if(!i)return null;const o=i.type===S.YM.DM_CHANNEL,l=i.type===S.YM.GM_CHANNEL;let r,d;0!==i.delete_at&&(r=N().createElement(Me.A,{className:"icon icon__archive icon channel-header-archived-icon svg-text-color"})),i.shared&&(d=N().createElement(Ne.A,{className:"shared-channel-icon",withTooltip:!0,remoteNames:s}));let p=i.display_name;return o?p=N().createElement(ye.A,{dmUser:t}):l&&(p=N().createElement(He.A,{gmMembers:n})),o&&null!=t&&t.is_bot?N().createElement("div",{id:"channelHeaderDropdownButton",className:"channel-header__bot"},N().createElement(Pe,null),N().createElement(ve.A,{src:_e.mT.getProfilePictureUrl(t.id,t.last_picture_update),size:"sm"}),N().createElement("strong",{id:"channelHeaderTitle",className:"heading"},N().createElement("span",null,r,p)),N().createElement(Ae.A,null)):N().createElement("div",{className:"channel-header__top"},N().createElement(Pe,null),o&&t&&N().createElement(ve.A,{src:_e.mT.getProfilePictureUrl(t.id,t.last_picture_update),size:"sm",status:i.status}),N().createElement(Te.A,{dmUser:t,gmMembers:n,sharedIcon:d,archivedIcon:r}))};Oe.propTypes={gmMembers:U().array,remoteNames:U().arrayOf(U().string)};const xe=(0,v.memo)(Oe);var Re=n(44785);const Ie=n.n(Re)().i.withConfig({displayName:"Icon"})(["font-size:18px;line-height:18px;display:inline-flex;align-items:center;justify-content:center;"]),Se=e=>{let{channel:t}=e;const n=(0,a.useDispatch)(),s=(0,M.useIntl)(),i=(0,a.useSelector)(E.bM),o=(0,a.useSelector)(E.A),l=i===S._n.CHANNEL_INFO||i===S._n.CHANNEL_MEMBERS||i===S._n.CHANNEL_FILES||i===S._n.PIN,r=o&&l,c=(0,v.useCallback)((()=>{if(r){const e=l?(0,g.bP)():(0,g.Vl)(t.id);n(e)}else n((0,g.Vl)(t.id))}),[r,t.id,l,n]);let d;d=r?s.formatMessage({id:"channel_header.closeChannelInfo",defaultMessage:"Close info"}):s.formatMessage({id:"channel_header.openChannelInfo",defaultMessage:"View Info"});let p="channel-header__icon";return r&&(p+=" channel-header__icon--active-inverted"),N().createElement(Y.A,{buttonClass:p,buttonId:"channel-info-btn",onClick:c,tooltip:d},N().createElement(Ie,{className:"icon-information-outline"}))};function Le(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ke extends N().PureComponent{constructor(e){super(e),Le(this,"unmute",(()=>{const{actions:e,channel:t,channelMember:n,currentUser:a}=this.props;if(!n||!a||!t)return;const s={mark_unread:S.DB.ALL};e.updateChannelNotifyProps(a.id,t.id,s)})),Le(this,"showPinnedPosts",(e=>{e.preventDefault(),this.props.rhsState===S._n.PIN?this.props.actions.closeRightHandSide():this.props.actions.showPinnedPosts()})),Le(this,"showChannelFiles",(()=>{this.props.rhsState===S._n.CHANNEL_FILES?this.props.actions.closeRightHandSide():this.props.channel&&this.props.actions.showChannelFiles(this.props.channel.id)})),Le(this,"toggleChannelMembersRHS",(()=>{this.props.rhsState===S._n.CHANNEL_MEMBERS?this.props.actions.closeRightHandSide():this.props.channel&&this.props.actions.showChannelMembers(this.props.channel.id)})),Le(this,"renderCustomStatus",(()=>{var e;const{customStatus:t,isCustomStatusEnabled:n,isCustomStatusExpired:a}=this.props,s=!a&&((null==t?void 0:t.text)||(null==t?void 0:t.emoji));return n&&s?N().createElement("div",{className:"custom-emoji__wrapper"},N().createElement(A.A,{userID:null===(e=this.props.dmUser)||void 0===e?void 0:e.id,showTooltip:!0,emojiStyle:{verticalAlign:"top",margin:"0 4px 1px"}}),N().createElement(y.A,{text:null==t?void 0:t.text,className:"custom-emoji__text"})):null})),this.toggleFavoriteRef=N().createRef()}componentDidMount(){var e;this.props.actions.getCustomEmojisInText(this.props.channel?this.props.channel.header:""),null!==(e=this.props.channel)&&void 0!==e&&e.shared&&this.props.actions.fetchChannelRemotes(this.props.channel.id)}componentDidUpdate(e){var t;const n=this.props.channel?this.props.channel.header:"";var a,s;n!==(e.channel?e.channel.header:"")&&this.props.actions.getCustomEmojisInText(n),null!==(t=this.props.channel)&&void 0!==t&&t.shared&&(this.props.channel.id!==(null===(a=e.channel)||void 0===a?void 0:a.id)?this.props.actions.fetchChannelRemotes(this.props.channel.id):this.props.channel.shared!==(null===(s=e.channel)||void 0===s?void 0:s.shared)&&this.props.actions.fetchChannelRemotes(this.props.channel.id,!0))}render(){const{teamId:e,currentUser:t,gmMembers:n,channel:a,channelMember:s,isChannelMuted:i,dmUser:o,rhsState:l,hasGuests:r,hideGuestTags:c}=this.props;if(!a)return null;const d=this.props.intl.formatMessage({id:"accessibility.sections.channelHeader",defaultMessage:"channel header region"});let p="";if(r&&!c&&(p=N().createElement("span",{className:"has-guest-header"},N().createElement("span",{tabIndex:0},N().createElement(M.FormattedMessage,{id:"channel_header.channelHasGuests",defaultMessage:"Channel has guests"})))),(0,ee.RI)(a)||(0,ee.RI)(s)||(0,ee.RI)(t)||!o&&a.type===S.YM.DM_CHANNEL)return N().createElement("div",{className:"channel-header"});const h=a.type===S.YM.DM_CHANNEL;let u;a.type===S.YM.GM_CHANNEL&&r&&!c&&(p=N().createElement("span",{className:"has-guest-header"},N().createElement(M.FormattedMessage,{id:"channel_header.groupMessageHasGuests",defaultMessage:"This group message has guests"}))),!h||null!=o&&o.delete_at||null!=o&&o.is_bot||(u=N().createElement("span",{className:"header-status__text"},this.renderCustomStatus()),this.props.isLastActiveEnabled&&this.props.lastActivityTimestamp&&this.props.timestampUnits&&(u=N().createElement("span",{className:"header-status__text"},N().createElement("span",{className:"last-active__text"},N().createElement(M.FormattedMessage,{id:"channel_header.lastActive",defaultMessage:"Active {timestamp}",values:{timestamp:N().createElement(w.Ay,{value:this.props.lastActivityTimestamp,units:this.props.timestampUnits,useTime:!1,style:"short"})}})),this.renderCustomStatus())));const m=_()("channel-header__icon channel-header__icon--left btn btn-icon btn-xs ",{"channel-header__icon--active":l===S._n.CHANNEL_FILES}),g=N().createElement("i",{className:"icon icon-file-text-outline"}),E=_()("channel-header__icon channel-header__icon--wide channel-header__icon--left btn btn-icon btn-xs",{"channel-header__icon--active":l===S._n.PIN}),b=this.props.pinnedPostsCount?N().createElement(N().Fragment,null,N().createElement("i",{"aria-hidden":"true",className:"icon icon-pin-outline channel-header__pin"}),N().createElement("span",{id:"channelPinnedPostCountText",className:"icon__text"},this.props.pinnedPostsCount)):N().createElement("i",{"aria-hidden":"true",className:"icon icon-pin-outline channel-header__pin"}),f=this.props.pinnedPostsCount?N().createElement(Y.A,{buttonClass:E,buttonId:"channelHeaderPinButton",onClick:this.showPinnedPosts,tooltip:this.props.intl.formatMessage({id:"channel_header.pinnedPosts",defaultMessage:"Pinned messages"})},b):null;let C,v=null;if(!h){const e=_()("member-rhs__trigger channel-header__icon channel-header__icon--wide channel-header__icon--left btn btn-icon btn-xs",{"channel-header__icon--active":l===S._n.CHANNEL_MEMBERS}),t=this.props.memberCount?N().createElement(N().Fragment,null,N().createElement("i",{"aria-hidden":"true",className:"icon icon-account-outline channel-header__members"}),N().createElement("span",{id:"channelMemberCountText",className:"icon__text"},this.props.memberCount)):N().createElement(N().Fragment,null,N().createElement("i",{"aria-hidden":"true",className:"icon icon-account-outline channel-header__members"}),N().createElement("span",{id:"channelMemberCountText",className:"icon__text"},"-"));v=N().createElement(Y.A,{tooltip:this.props.intl.formatMessage({id:"channel_header.channelMembers",defaultMessage:"Members"}),buttonClass:e,buttonId:"member_rhs",onClick:this.toggleChannelMembersRHS},t)}return i&&(C=N().createElement(P.A,{title:N().createElement(M.FormattedMessage,{id:"channelHeader.unmute",defaultMessage:"Unmute"})},N().createElement("button",{id:"toggleMute",onClick:this.unmute,className:"channel-header__mute inactive btn btn-icon btn-xs","aria-label":this.props.intl.formatMessage({id:"channelHeader.unmute",defaultMessage:"Unmute"})},N().createElement("i",{className:"icon icon-bell-off-outline","aria-hidden":!0})))),N().createElement("div",{id:"channel-header","aria-label":d,role:"banner",tabIndex:-1,"data-channelid":"".concat(a.id),className:"channel-header alt a11y__region","data-a11y-sort-order":"8"},N().createElement("div",{className:"flex-parent"},N().createElement("div",{className:"flex-child"},N().createElement("div",{id:"channelHeaderInfo",className:"channel-header__info"},N().createElement("div",{className:"channel-header__title dropdown"},N().createElement(xe,{dmUser:o,gmMembers:n,remoteNames:this.props.remoteNames}),N().createElement("div",{className:"channel-header__icons"},C,v,f,this.props.isFileAttachmentsEnabled&&N().createElement(Y.A,{buttonClass:m,buttonId:"channelHeaderFilesButton",onClick:this.showChannelFiles,tooltip:this.props.intl.formatMessage({id:"channel_header.channelFiles",defaultMessage:"Channel files"})},g)),N().createElement("div",{id:"channelHeaderDescription",className:"channel-header__description"},u,p,N().createElement(fe,{teamId:e,channel:a,dmUser:o}))))),(!a.shared||this.props.sharedChannelsPluginsEnabled)&&N().createElement(N().Fragment,null,N().createElement($,{channel:a,channelMember:s}),N().createElement(L,null)),N().createElement(Se,{channel:a})))}}const Fe=(0,M.injectIntl)(ke),Be=(0,a.connect)((function(){const e=(0,u.dH)(),t=(0,b.Oc)();let n=[];return function(a){const s=(0,c.Lw)(a),i=(0,u.HW)(a),o=(0,d.zj)(a),l="true"===(0,d.Y6)(a,"EnableSharedChannelsPlugins");let g,C,_,v,N=[];if(s&&s.type===r.Bz.DM_CHANNEL){const e=(0,m.r4)(i.id,s.name);g=(0,u.wz)(a,e),_=g&&t(a,g.id),v=g&&(0,u.v4)(a,g.id)}else s&&s.type===r.Bz.GM_CHANNEL&&(C=e(a,s.id));null!=s&&s.shared&&(N=(0,p.lk)(a,s.id));const M=(0,c.Wh)(a);let A=!1;return g&&(A=(0,u.FF)(a,g.id),n=(0,u.tP)(a,g.id)),{teamId:(0,h.Sy)(a),channel:s,channelMember:(0,c.tW)(a),memberCount:(null==M?void 0:M.member_count)||0,currentUser:i,dmUser:g,gmMembers:C,remoteNames:N,rhsState:(0,E.bM)(a),isChannelMuted:(0,c.cP)(a),hasGuests:!!M&&M.guest_count>0,pinnedPostsCount:(null==M?void 0:M.pinnedpost_count)||0,customStatus:_,isCustomStatusEnabled:(0,b.xI)(a),isCustomStatusExpired:(0,b.TX)(a,_),lastActivityTimestamp:v,isFileAttachmentsEnabled:(0,f._G)(o),isLastActiveEnabled:A,timestampUnits:n,hideGuestTags:"true"===o.HideGuestTags,sharedChannelsPluginsEnabled:l}}}),(e=>({actions:(0,s.zH)({showPinnedPosts:g.H3,showChannelFiles:g.QK,closeRightHandSide:g.bP,getCustomEmojisInText:o.rg,updateChannelNotifyProps:i.cz,showChannelMembers:g.sQ,fetchChannelRemotes:l.No},e)})))(Fe)}}]); //# sourceMappingURL=6222.116d11a85d0f1278ec9a.js.map