@cometchat/chat-uikit-react 4.3.33 → 4.3.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,11 +7,11 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */"production"===process.env.NODE_ENV?a.exports=function(){if(e)return l;e=1;var n=t,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,l={},c=null,C=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(C=t.ref),t)s.call(t,r)&&!a.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:C,props:l,_owner:i.current}}return l.Fragment=r,l.jsx=c,l.jsxs=c,l}():a.exports=(c||(c=1,"production"!==process.env.NODE_ENV&&function(){var e,n=t,o=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),A=Symbol.iterator,x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];!function(e,t,n){var o=x.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var r=n.map(function(e){return String(e)});r.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,r)}("error",e,n)}function y(e){return e.displayName||"Context"}function w(e){if(null==e)return null;if("number"==typeof e.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case d:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return y(e)+".Consumer";case l:return y(e._context)+".Provider";case g:return function(e,t,n){var o=e.displayName;if(o)return o;var r=t.displayName||t.name||"";return""!==r?n+"("+r+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:w(e.type)||"Memo";case h:var n=e,o=n._payload,C=n._init;try{return w(C(o))}catch(e){return null}}return null}e=Symbol.for("react.module.reference");var f,D,E,v,S,I,F,k=Object.assign,T=0;function M(){}M.__reactDisabledLog=!0;var B,L=x.ReactCurrentDispatcher;function U(e,t,n){if(void 0===B)try{throw Error()}catch(e){var o=e.stack.trim().match(/\n( *(at )?)/);B=o&&o[1]||""}return"\n"+B+e}var R,P=!1,O="function"==typeof WeakMap?WeakMap:Map;function j(e,t){if(!e||P)return"";var n,o=R.get(e);if(void 0!==o)return o;P=!0;var r,s=Error.prepareStackTrace;Error.prepareStackTrace=void 0,r=L.current,L.current=null,function(){if(0===T){f=console.log,D=console.info,E=console.warn,v=console.error,S=console.group,I=console.groupCollapsed,F=console.groupEnd;var e={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}T++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),l=n.stack.split("\n"),c=a.length-1,C=l.length-1;c>=1&&C>=0&&a[c]!==l[C];)C--;for(;c>=1&&C>=0;c--,C--)if(a[c]!==l[C]){if(1!==c||1!==C)do{if(c--,--C<0||a[c]!==l[C]){var g="\n"+a[c].replace(" at new "," at ");return e.displayName&&g.includes("<anonymous>")&&(g=g.replace("<anonymous>",e.displayName)),"function"==typeof e&&R.set(e,g),g}}while(c>=1&&C>=0);break}}}finally{P=!1,L.current=r,function(){if(0===--T){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:f}),info:k({},e,{value:D}),warn:k({},e,{value:E}),error:k({},e,{value:v}),group:k({},e,{value:S}),groupCollapsed:k({},e,{value:I}),groupEnd:k({},e,{value:F})})}T<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=s}var d=e?e.displayName||e.name:"",u=d?U(d):"";return"function"==typeof e&&R.set(e,u),u}function V(e,t,n){if(null==e)return"";if("function"==typeof e)return j(e,!(!(o=e.prototype)||!o.isReactComponent));var o;if("string"==typeof e)return U(e);switch(e){case d:return U("Suspense");case u:return U("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case g:return j(e.render,!1);case p:return V(e.type,t,n);case h:var r=e,s=r._payload,i=r._init;try{return V(i(s),t,n)}catch(e){}}return""}R=new O;var G=Object.prototype.hasOwnProperty,H={},Q=x.ReactDebugCurrentFrame;function N(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);Q.setExtraStackFrame(n)}else Q.setExtraStackFrame(null)}var K=Array.isArray;function z(e){return K(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var _,W,Z,X=x.ReactCurrentOwner,q={key:!0,ref:!0,__self:!0,__source:!0};function $(e,t,n,r,s){var i,a={},l=null,c=null;for(i in void 0!==n&&(Y(n),l=""+n),function(e){if(G.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),l=""+t.key),function(e){if(G.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&X.current&&t&&X.current.stateNode!==t){var n=w(X.current.type);Z[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(X.current.type),e.ref),Z[n]=!0)}}(t,s)),t)G.call(t,i)&&!q.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var C=e.defaultProps;for(i in C)void 0===a[i]&&(a[i]=C[i])}if(l||c){var g="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){_||(_=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,g),c&&function(e,t){var n=function(){W||(W=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,g)}return function(e,t,n,r,s,i,a){var l={$$typeof:o,type:e,key:t,ref:n,props:a,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,c,s,r,X.current,a)}Z={};var ee,te=x.ReactCurrentOwner,ne=x.ReactDebugCurrentFrame;function oe(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);ne.setExtraStackFrame(n)}else ne.setExtraStackFrame(null)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}function se(){if(te.current){var e=w(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var ie={};function ae(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=se();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ie[n]){ie[n]=!0;var o="";e&&e._owner&&e._owner!==te.current&&(o=" It was passed a child from "+w(e._owner.type)+"."),oe(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,o),oe(null)}}}function le(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var o=e[n];re(o)&&ae(o,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var r=function(e){if(null===e||"object"!=typeof e)return null;var t=A&&e[A]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof r&&r!==e.entries)for(var s,i=r.call(e);!(s=i.next()).done;)re(s.value)&&ae(s.value,t)}}function ce(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==g&&n.$$typeof!==p)return;t=n.propTypes}if(t){var o=w(n);!function(e,t,n,o,r){var s=Function.call.bind(G);for(var i in e)if(s(e,i)){var a=void 0;try{if("function"!=typeof e[i]){var l=Error((o||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,o,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(N(r),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,i,typeof a),N(null)),a instanceof Error&&!(a.message in H)&&(H[a.message]=!0,N(r),b("Failed %s type: %s",n,a.message),N(null))}}(t,e.props,"prop",o,e)}else void 0===n.PropTypes||ee||(ee=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ce(t,n,r,C,A,x){var y=function(t){return"string"==typeof t||"function"==typeof t||t===s||t===a||t===i||t===d||t===u||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===l||t.$$typeof===c||t.$$typeof===g||t.$$typeof===e||void 0!==t.getModuleId)}(t);if(!y){var f="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D,E=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(A);f+=E||se(),null===t?D="null":z(t)?D="array":void 0!==t&&t.$$typeof===o?(D="<"+(w(t.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):D=typeof t,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,f)}var v=$(t,n,r,A,x);if(null==v)return v;if(y){var S=n.children;if(void 0!==S)if(C)if(z(S)){for(var I=0;I<S.length;I++)le(S[I],t);Object.freeze&&Object.freeze(S)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(S,t)}return t===s?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var o=t[n];if("children"!==o&&"key"!==o){oe(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),oe(null);break}}null!==e.ref&&(oe(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}(v):ce(v),v}var ge=function(e,t,n){return Ce(e,t,n,!1)},de=function(e,t,n){return Ce(e,t,n,!0)};C.Fragment=s,C.jsx=ge,C.jsxs=de}()),C);var g=a.exports;function d(e,t){return new r.ListStyle({width:"100%",height:"100%",background:"inherit",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),sectionHeaderTextFont:e?.sectionHeaderTextFont||n.fontHelper(t.typography.caption1),sectionHeaderTextColor:e?.sectionHeaderTextColor||t.palette.getAccent500()})}function u(e,t){return{boxSizing:"border-box",position:"relative",width:e?.width||"100%",height:e?.height||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||`1px solid ${t.palette.getAccent50()}`,borderRadius:e?.borderRadius||"0",overflow:"hidden"}}function p(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),hoverBackground:e?.hoverBackground||r.palette.getAccent50()})}function h(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function m(e){const n=t.useRef(e);return n.current=e,n}function A(e){const[n,o]=t.useState(e);return[n,t.useCallback(e=>{o(e)},[])]}function x(e){const n=m(e),o=t.useCallback(function e(t){if("object"==typeof t&&t)if(t instanceof s.CometChat.CometChatException){const e=n.current;if(e)return e(t)}else if(t instanceof Error)return e(new s.CometChat.CometChatException({code:"ERROR",name:t.name,message:t.message}));console.log(t)},[n]);return o}function b(e){const{name:n,labelText:o,checked:r,disabled:s,checkboxStyle:i,onChange:a}=e,l=t.useRef();return function(e){const{ref:n,onChangePropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-checkbox-changed",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:l,onChangePropRef:m(a)}),g.jsx("cometchat-checkbox",{ref:l,name:n,labelText:o,...r?{checked:r}:{},...s?{disabled:s}:{},...(c=i,C="checkboxStyle",c?{[C]:JSON.stringify(c)}:{})});var c,C}function y(e){return{boxSizing:"border-box",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",boxShadow:e?.boxShadow,display:"flex",flexDirection:"column",overflow:"hidden"}}function w(e){return{flexShrink:"0",padding:e?"0px 12px":"19px 16px",display:"flex",flexDirection:"column",boxSizing:"border-box"}}function f(e,t,o){return{textAlign:t===n.TitleAlignment.left?"left":"center",font:e?.titleTextFont||"700 22px Inter, sans-serif",color:e?.titleTextColor||"rgb(20, 20, 20)",boxSizing:"border-box"}}function D(e){return{border:e?.searchBorder||"none",borderRadius:e?.searchBorderRadius||"8px",width:"100%",height:"32px",background:e?.searchBackground||"rgb(20, 20, 20, 0.04)",searchTextFont:e?.searchTextFont||"400 15px Inter, sans-serif",searchTextColor:e?.searchTextColor||"rgb(20, 20, 20)",placeholderTextFont:e?.searchPlaceholderTextFont||"400 15px Inter, sans-serif",placeholderTextColor:e?.searchPlaceholderTextColor||"rgb(20, 20, 20, 0.46)",searchIconTint:e?.searchIconTint||"rgb(20, 20, 20, 0.46)"}}function E(e){return{iconTint:e?.loadingIconTint||"rgb(20, 20, 20, 0.58)"}}function v(e){return{font:e?.sectionHeaderTextFont||"500 12px Inter, sans-serif",color:e?.sectionHeaderTextColor||"rbg(20, 20, 20, 0.46)",textAlign:"left",padding:"8px 0"}}function S(e){return{textFont:e?.errorStateTextFont||"700 22px Inter, sans-serif",textColor:e?.errorStateTextColor||"rgb(20, 20, 20, 0.33)"}}function I(e){return{textFont:e?.emptyStateTextFont||"700 22px Inter, sans-serif",textColor:e?.emptyStateTextColor||"rgb(20, 20, 20, 0.33)"}}function F(e,t){let n;const o=t[e];if("function"==typeof o){const e=o.call(t);n=String(void 0===e&&t?.id?t?.id:e)}else n=String(o);return n}const k=(0,t.memo)(function(e){const{title:o="",titleAlignment:r=n.TitleAlignment.left,hideSearch:i=!1,searchText:a="",onSearch:l,searchPlaceholderText:c="Search",searchIconURL:C,list:d,listItem:u,showSectionHeader:p=!0,sectionHeaderKey:h,listItemKey:b,onScrolledToBottom:k,onScrolledToTop:T,state:M,loadingView:B,loadingIconURL:L,hideError:U=!1,errorStateView:R,errorStateText:P="Error",emptyStateView:O,emptyStateText:j,scrollToBottom:V=!1,onError:G,listStyle:H=null,scrolledUpCallback:Q}=e,[N,K]=A(null),z=t.useRef(null),J=t.useRef(null),Y=t.useRef(null),_=t.useRef(!1),W=t.useRef(null),Z=t.useRef([0,0]),X=t.useRef(!1),q=m(T),$=m(k),ee=m(l),te=x(G);!function(e){const{onSearchRef:n,searchInputElement:o,intersectionObserverRootRef:r,intersectionObserverBottomTargetRef:s,intersectionObserverTopTargetRef:i,onScrolledToBottomRef:a,onScrolledToTopRef:l,timeoutIdRef:c,scrollToBottom:C,didComponentScrollToBottomRef:g,scrollHeightTupleRef:d,didTopObserverCallbackRunRef:u,errorHandler:p,scrolledUpCallback:h}=e;t.useEffect(()=>{if(!o)return;function e(e){const t=e.detail.searchText;null!==c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{n.current?.(t),c.current=null},500)}const t="cc-search-changed";return o.addEventListener(t,e),()=>{o.removeEventListener(t,e)}},[o,n,c]),t.useEffect(()=>{if(!r.current||!s.current)return;let e=!1;const t=r.current,n=s.current,o=new IntersectionObserver(async function(n){const o=n[0];if(o&&h&&h(o.isIntersecting),g.current&&o.isIntersecting)g.current=!1;else if(!(!o.isIntersecting||e||t.scrollHeight<=t.clientHeight)){e=!0;try{await Promise.all([a.current?.()])}catch(e){p(e)}e=!1}},{root:t,threshold:.1});return o.observe(n),()=>{o.unobserve(n)}},[p,g,s,r,a,h]),t.useEffect(()=>{if(!r.current||!i.current)return;let e=!1;const t=r.current,n=i.current,o=new IntersectionObserver(async function(n){if(!(!n[0].isIntersecting||e||t.scrollHeight<=t.clientHeight)){e=!0;try{await Promise.all([l.current?.()])}catch(e){p(e)}e=!1,u.current=!0}},{root:t,threshold:.1});return o.observe(n),()=>{o.unobserve(n)}},[p,u,r,i,l]),t.useEffect(()=>{r.current&&(r.current.scrollHeight>r.current.clientHeight?0!==Math.round(r.current.scrollHeight-d.current[1])&&(d.current[0]=d.current[1],d.current[1]=r.current.scrollHeight,!C&&u.current&&0!==d.current[0]&&(r.current.scrollTop=Math.max(d.current[1]-d.current[0],0))):(d.current[0]=0,d.current[1]=0),u.current&&(u.current=!1))}),t.useEffect(()=>{setTimeout(()=>{const e=r.current,t=C&&(e?.scrollHeight??0)>(e?.clientHeight??0)&&null!==s.current;e&&t&&(g.current=!0,e.scrollTo({top:e.scrollHeight}))})})}({onSearchRef:ee,searchInputElement:N,intersectionObserverRootRef:z,intersectionObserverBottomTargetRef:Y,onScrolledToBottomRef:$,onScrolledToTopRef:q,intersectionObserverTopTargetRef:J,timeoutIdRef:W,scrollToBottom:V,didComponentScrollToBottomRef:_,scrollHeightTupleRef:Z,didTopObserverCallbackRunRef:X,errorHandler:te,scrolledUpCallback:Q});const ne=""===o;return g.jsxs("div",{className:"cc-list",style:y(H),children:[g.jsxs("div",{className:"cc-list__header",style:w(ne),children:[g.jsx("div",{className:"cc-list__title",style:f(H,r),children:o}),i?null:g.jsx("cometchat-search-input",{ref:K,searchText:a,placeholderText:c,searchIconURL:C,searchInputStyle:JSON.stringify(D(H)),style:{paddingTop:"16px"}})]}),g.jsxs("div",{ref:z,className:"cc-list__content",style:{overflow:"hidden auto",overflowX:"hidden",display:"flex",flexDirection:"column",width:"100%",height:"100%",boxSizing:"border-box",padding:"0 16px"},children:[g.jsx("div",{ref:J}),function(){if(M===n.States.loading&&0===d.length||M===n.States.empty||M===n.States.error)return null;let e="";return d.map((t,n)=>{let o=null;if(p){let r;void 0===h?(te(new s.CometChat.CometChatException({code:"ERROR",name:"Error",message:"'sectionHeaderKey' prop must be provided when 'showSectionHeader' prop is set to true. 'showSectionHeader' is set to be true by default"})),r=" "):r=(F(h,t)||" ")[0].toUpperCase();let i=null;0===n?(i=g.jsx("div",{className:"cc-list__section-header",style:v(H),children:r}),e=r):e!==r?(i=g.jsx("div",{className:"cc-list__section-separator",children:g.jsx("div",{className:"cc-list__section-header",style:v(H),children:r})}),e=r):i=g.jsx("div",{className:"cc-list__section-separator"}),o=g.jsx("div",{className:"cc-list__section",children:i})}return g.jsxs("div",{className:"cc-list__item",children:[o,u(t,n)]},b?F(b,t):n)})}(),function(){let e=null;switch(M){case n.States.loading:0===d.length&&(e=function(){let e;return e=B?g.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__loading-view cc-list__loading-view--custom",children:B}):g.jsx("div",{className:"cc-list__loading-view cc-list__loading-view--default",style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},children:g.jsx("cometchat-loader",{iconURL:L,loaderStyle:JSON.stringify(E(H))})}),g.jsx("div",{className:"cc-list__loading-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}());break;case n.States.error:e=function(){if(U)return null;let e;return e=R?g.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__error-view cc-list__error-view--custom",children:R}):g.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},className:"cc-list__error-view cc-list__error-view--default",children:g.jsx("cometchat-label",{text:P,labelStyle:JSON.stringify(S(H))})}),g.jsx("div",{className:"cc-list__error-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}();break;case n.States.empty:e=function(){let e;return e=!O&&j?g.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},className:"cc-list__empty-view cc-list__empty-view--default",children:g.jsx("cometchat-label",{text:j,labelStyle:JSON.stringify(I(H))})}):g.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__empty-view cc-list__empty-view--custom",children:O}),g.jsx("div",{className:"cc-list__empty-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}();case n.States.loaded:}return e}(),g.jsx("div",{ref:Y,style:{height:"1px",border:"1px solid transparent"}})]})]})});var T="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function M(e){const{id:o,avatarURL:r,avatarName:s,statusIndicatorColor:i,statusIndicatorIcon:a,title:l,isActive:c,subtitleView:C,tailView:d,menuView:u,hideSeparator:p,avatarStyle:h,statusIndicatorStyle:A,listItemStyle:x,onClick:b,subtitleViewClassName:y,tailViewClassName:w,menuViewClassName:f,loadingIconURL:D=T,userPresencePlacement:E=n.UserPresencePlacement.bottom}=e,v=t.useRef();function S(e){return void 0!==e?{className:e}:{}}function I(e,t){return e?{[t]:JSON.stringify(e)}:{}}return function(e){const{ref:n,onListItemClickPropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-listitem-clicked",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:v,onListItemClickPropRef:m(b)}),g.jsxs("cometchat-list-item",{ref:v,id:o,avatarURL:r,avatarName:s,title:l,statusIndicatorColor:i,statusIndicatorIcon:a,loadingIconURL:D,userPresencePlacement:E,...c?{isActive:c}:{},...p?{hideSeparator:p}:{},...I(h,"avatarStyle"),...I(A,"statusIndicatorStyle"),...I(x,"listItemStyle"),children:[C?g.jsx("div",{slot:"subtitleView",...S(y),children:C}):null,d?g.jsx("div",{slot:"tailView",...S(w),children:d}):null,u?g.jsx("div",{slot:"menuView",...S(f),children:u}):null]})}function B(e){const{data:n,moreIconURL:o,topMenuSize:s,menuListStyle:i,onOptionClick:a}=e,l=t.useRef(),c=m(a);return function(e){const{data:n,idToOnClickMapRef:o,ref:s,onOptionClickPropRef:i}=e;t.useEffect(()=>{const e=new Map;o.current=e;for(let t=0;t<n.length;t++){const{id:o,onClick:r}=n[t];e.set(o,r)}},[n,o]),t.useEffect(()=>{const e=s.current,t="cc-menu-clicked",n=e=>{const t=r.CometChatUIKitUtility.clone(e.detail.data);t.onClick=o.current?.get(t.id),e.detail.data=t,i.current?.(e)};return e.addEventListener(t,n),()=>{e.removeEventListener(t,n)}},[s,o,i])}({data:n,idToOnClickMapRef:t.useRef(null),ref:l,onOptionClickPropRef:c}),g.jsx("cometchat-menu-list",{ref:l,moreIconURL:o,topMenuSize:s,...(C=i,d="menuListStyle",C?{[d]:JSON.stringify(C)}:{}),data:JSON.stringify(n)});var C,d}function L(e){const{name:n,labelText:o,checked:r,disabled:s,radioButtonStyle:i,onChange:a}=e,l=t.useRef();return function(e){const{ref:n,onChangePropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-radio-button-changed",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:l,onChangePropRef:m(a)}),g.jsx("cometchat-radio-button",{ref:l,name:n,labelText:o,...r?{checked:r}:{},...s?{disabled:s}:{},...(c=i,C="radioButtonStyle",c?{[C]:JSON.stringify(c)}:{})});var c,C}const U=t.createContext({theme:new n.CometChatTheme({})});class R{constructor(e){const{searchText:t,usersRequestBuilder:n,searchRequestBuilder:o,usersSearchText:r}=e;let s=n||this.getDefaultRequestBuilder();t&&o?(s=o,s.setSearchKeyword(t)):t&&!o&&n?(s=n,s.setSearchKeyword(t)):!t&&n&&o?(s=n,s.setSearchKeyword(r.current)):t||!n||o?t||n||!o?s.setSearchKeyword(t):(s=this.getDefaultRequestBuilder(),s.setSearchKeyword(r.current)):(s=n,s.setSearchKeyword(r.current)),this.usersRequest=s.build()}getDefaultRequestBuilder(){return(new s.CometChat.UsersRequestBuilder).setLimit(R.defaultLimit)}fetchNext(){return this.usersRequest.fetchNext()}getCurrentPage(){return this.usersRequest.pagination.current_page}static atttachListeners(e){const t="UsersList_"+String(Date.now()),n=new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e});return s.CometChat.addUserListener(t,n),()=>s.CometChat.removeUserListener(t)}static attachConnestionListener(e){const t="UsersList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}}R.defaultLimit=30;var P="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",O="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const j=(e,t)=>({flex:"1 1 0",display:"flex",flexDirection:"column",borderRadius:"inherit",justifyContent:e===t.left?"flex-start":"flex-end",alignItems:e===t.left?"flex-start":"flex-end",position:"relative",width:"100%"}),V=(e,t)=>({display:"flex",justifyContent:e===t.left?"flex-start":"flex-end",alignItems:"flex-start"}),G=(e,t,n,o)=>({justifyContent:e===t.left?"flex-start":"flex-end",top:n?"-17px":"-36px",right:e===t.right?"unset":"0",left:e===t.left?"0":"unset",position:"absolute",background:o.palette.getBackground(),borderRadius:"8px",width:"fit-content",zIndex:"2"}),H=e=>({border:`1px solid ${e.palette.getAccent200()}`,borderRadius:"8px",background:e.palette.getBackground(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${e.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground(),moreIconTint:e.palette.getAccent600()}),Q=(e,t,n="bottom")=>({listStyleType:"none",display:e?"flex":"none",position:"absolute",top:"bottom"===n?"0":"auto",bottom:"top"===n?"0":"auto",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",border:"1px solid #e8e8e8",width:"100%",zIndex:"3",background:t.palette.getBackground(),marginTop:"bottom"===n?"35px":"0",marginBottom:"top"===n?"35px":"0",padding:"0",borderRadius:"8px"}),N=e=>({background:"transparent",border:"none",borderRadius:"0",buttonIconTint:e?.moreIconTint||""}),K=(e,t)=>({background:t?.backgroundColor||"transparent",border:"none",borderRadius:"0",buttonIconTint:t?.iconTint,buttonTextFont:t?.titleFont,buttonTextColor:t?.titleColor}),z={width:"300px",height:"300px"};function J(e){const{text:n,hoverText:o,iconURL:r,disabled:s,buttonStyle:i,onClick:a,childRefCallback:l}=e,c=t.useRef();return function(e){const{ref:n,onClickPropRef:o,childRefCallback:r}=e;t.useEffect(()=>{const e=n.current;r&&r(n.current);const t="cc-button-clicked",s=e=>o.current?.(e);return e.addEventListener(t,s),()=>{e.removeEventListener(t,s)}},[n,o])}({ref:c,onClickPropRef:m(a),childRefCallback:l}),g.jsx("cometchat-button",{ref:c,text:n,hoverText:o,iconURL:r,...s?{disabled:s}:{},...(C=i,d="buttonStyle",C?{[d]:JSON.stringify(C)}:{})});var C,d}const Y=e=>{const{theme:o}=t.useContext(U),[r,s]=t.useState(!1),[i,a]=t.useState("bottom"),l=t.useRef(null),c=t.useRef(null),C=t.useRef([]),{data:d,topMenuSize:u,moreIconURL:p,moreIconHoverText:h,ContextMenuStyle:m,onOptionClicked:A,placement:x,parentClassName:b}=e,y=t.useCallback(()=>{s(e=>!e)},[]),w=t.useCallback(()=>{if(!b||!r)return;const e=document.querySelector(`.${b}`),t=c.current;if(!e||!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=t.querySelector(".cc-context-menu__sub-menu");if(!s)return;const i=s.offsetHeight||200,l=n.bottom-o.bottom;a(l<i?"top":"bottom")},[b,r]);t.useEffect(()=>{r&&w()},[r,w]);const f=t.useCallback(()=>g.jsx("li",{style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item cc-context-menu__menu-item--more",children:g.jsx("cometchat-button",{ref:l,buttonStyle:JSON.stringify(N(m)),hoverText:h,iconURL:p,onClick:y})}),[m,h,p,y]),D=t.useCallback((e,o)=>e?.map((r,s)=>{let i,a=null;return i=r instanceof n.CometChatActionsView&&r?.customView?g.jsx("li",{id:r.id,style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item",children:g.jsxs("cometchat-popover",{ref:e=>{C.current[r.id]=e},popoverStyle:JSON.stringify(z),placement:x,children:[g.jsx("div",{slot:"children",children:g.jsx("cometchat-button",{buttonStyle:JSON.stringify(K(0,r)),text:o?r?.title:"",hoverText:r?.title,iconURL:r?.iconURL})}),g.jsx("div",{slot:"content",children:r?.customView(S(r.id))})]})}):g.jsx("li",{id:r.id,style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item",children:g.jsx(J,{buttonStyle:K(0,r),text:o?r?.title:"",hoverText:r?.title,iconURL:r?.iconURL,onClick:()=>{A(r)}})}),!o&&d?.length>e?.length&&s===e?.length-1&&(a=f()),g.jsxs(t.Fragment,{children:[i,a]},r.title)}),[x,d,A,f]),E=t.useCallback(()=>D(d.slice(0,u-1),!1),[D,u,d]),v=t.useCallback(()=>D(d.slice(u-1),!0),[D,u,d]),S=t.useCallback(e=>()=>{C.current[e]?.closeContentView&&C.current[e]?.closeContentView()},[]);return g.jsxs("div",{className:"cc-context-menu",style:{display:"flex",position:"relative"},ref:c,children:[g.jsx("ul",{className:"cc-context-menu__top-menu",style:{listStyleType:"none",display:"flex",flexDirection:"row",justifyContent:"flex-end",margin:"0",padding:"0",border:"1px solid #e8e8e8",zIndex:"2",borderRadius:"8px"},children:E()}),g.jsx("ul",{className:"cc-context-menu__sub-menu",style:Q(r,o,i),children:v()})]})};var _="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2016%2016%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F16%2FMore%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F16%2FMore%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C6.66666667%20C3.26666667%2C6.66666667%202.66666667%2C7.26666667%202.66666667%2C8%20C2.66666667%2C8.73333333%203.26666667%2C9.33333333%204%2C9.33333333%20C4.73333333%2C9.33333333%205.33333333%2C8.73333333%205.33333333%2C8%20C5.33333333%2C7.26666667%204.73333333%2C6.66666667%204%2C6.66666667%20Z%20M12%2C6.66666667%20C11.2666667%2C6.66666667%2010.6666667%2C7.26666667%2010.6666667%2C8%20C10.6666667%2C8.73333333%2011.2666667%2C9.33333333%2012%2C9.33333333%20C12.7333333%2C9.33333333%2013.3333333%2C8.73333333%2013.3333333%2C8%20C13.3333333%2C7.26666667%2012.7333333%2C6.66666667%2012%2C6.66666667%20Z%20M8%2C6.66666667%20C7.26666667%2C6.66666667%206.66666667%2C7.26666667%206.66666667%2C8%20C6.66666667%2C8.73333333%207.26666667%2C9.33333333%208%2C9.33333333%20C8.73333333%2C9.33333333%209.33333333%2C8.73333333%209.33333333%2C8%20C9.33333333%2C7.26666667%208.73333333%2C6.66666667%208%2C6.66666667%20Z%22%20id%3D%22Style%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const W=e=>{const{id:o,leadingView:s=null,headerView:i=null,replyView:a=null,contentView:l=null,bottomView:c=null,threadView:C=null,footerView:d=null,statusInfoView:u=null,options:p=[],alignment:h=n.MessageBubbleAlignment.right,messageBubbleStyle:m=new r.BaseStyle({width:"100%",height:"auto",background:"",borderRadius:"12px",border:"none"}),moreIconURL:A=_,topMenuSize:x=5,setRef:b}=e,y={borderRadius:"8px"},{theme:w}=t.useContext(U),f=t.useRef(null);t.useEffect(()=>{f&&f.current&&b&&b(f)},[f,b]);const[D,E]=t.useState(!1);t.useEffect(()=>()=>{v&&clearTimeout(v)},[]);let v=null;const S=e=>{p.forEach(t=>{t instanceof n.CometChatActionsIcon&&t.id===e?.id&&o&&t.onClick?.(parseInt(o))})},I=()=>F()?k():e.alignment===n.MessageBubbleAlignment.left?n.Placement.right:n.Placement.left,F=()=>window.innerWidth<=768,k=()=>{const e=f.current;if(e){const t=e.getBoundingClientRect(),o=t.top<window.innerHeight/2,r=t.bottom>window.innerHeight/2;return o?n.Placement.bottom:r?n.Placement.top:n.Placement.bottom}return n.Placement.bottom};return g.jsxs("div",{className:"cc-message-bubble__wrapper",ref:f,style:{display:"flex",position:"relative",maxWidth:"65%",width:"fit-content",gap:"4px"},onMouseEnter:()=>{v&&clearTimeout(v),E(!0)},onMouseLeave:()=>{v=setTimeout(()=>{E(!1)},150)},children:[(()=>{if(s&&h===n.MessageBubbleAlignment.left)return g.jsx("div",{className:"cc-message-bubble__avatar",style:{position:"relative",borderRadius:"inherit",display:"flex",width:"fit-content",alignSelf:"flex-start",marginTop:"5px",padding:"8px 4px"},children:s})})(),g.jsxs("div",{className:"cc-message-bubble",style:j(h,n.MessageBubbleAlignment),children:[(()=>{if(p&&p.length>0&&D)return g.jsx("div",{className:"cc-message-options",style:G(h,n.MessageBubbleAlignment,i,w),children:g.jsx(Y,{moreIconURL:A,topMenuSize:x,ContextMenuStyle:H(w),data:p,moreIconHoverText:"",onOptionClicked:S,placement:I(),parentClassName:"cc-message-list__wrapper"})})})(),(()=>{if(i)return g.jsx("div",{className:"cc-message-bubble__header",style:V(h,n.MessageBubbleAlignment),children:i})})(),g.jsxs("div",{className:"cc-message-bubble__content",style:{height:m.height,width:m.width},children:[g.jsxs("div",{style:{...m,...y},children:[a||null,l||null,u||null]}),c||null,d||null,C||null]})]})]})};class Z{messageBubbleStyle(e,t,o,r){return e.getDeletedAt()?{background:"transparent",border:`1px dashed ${t.palette.getAccent400()}`,borderRadius:"12px"}:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.text||e.getSender()&&r?.getUid()!==e.getSender().getUid()?e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.audio?e.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember?{background:"transparent",borderRadius:"12px",border:`1px solid ${t.palette.getAccent100()}`}:(e.getSender()&&(e.getSender().getUid(),r?.getUid()),{background:t.palette.getAccent100(),borderRadius:"12px"}):{borderRadius:"",background:t.palette.getAccent100()}:{background:o===n.MessageBubbleAlignment.left?t.palette.getAccent100():t.palette.getPrimary(),borderRadius:"12px"}}getContentView(e,t){let o;const r={};return r[`${t.category}_${t.type}`]=t,r[`${e?.getCategory()}_${e?.getType()}`]&&r[`${e?.getCategory()}_${e?.getType()}`]?.contentView?(o=r[`${e?.getCategory()}_${e?.getType()}`]?.contentView(e,n.MessageBubbleAlignment.right),"string"==typeof o?{html:o}:o):null}getBubbleWrapper(e,t){let n;const o={};return o[`${t.category}_${t.type}`]=t,o&&o[`${e?.getCategory()}_${e?.getType()}`]&&o[`${e?.getCategory()}_${e?.getType()}`].bubbleView?(n=o[`${e?.getCategory()}_${e?.getType()}`].bubbleView(e),n):(n=null,n)}getMessageBubble(e,t,n,o){return this.getBubbleWrapper(e,t)?this.getBubbleWrapper(e,t):g.jsx(W,{bottomView:null,headerView:null,options:[],footerView:null,leadingView:null,statusInfoView:null,contentView:this.getContentView(e,t),replyView:null,threadView:null,alignment:o,messageBubbleStyle:n,id:e?.getId()||e?.getMuid()})}getUserStatusVisible(e){let t=!1;return e&&e instanceof(s.CometChat.User||s.CometChat.GroupMember)&&(e.getBlockedByMe()||e.getHasBlockedMe()||e.getStatus()===n.CometChatUIKitConstants.userStatusType.offline)&&(t=!0),t}}function X(e,t){let o=e;const{type:r}=t;switch(r){case"setSearchText":o={...e,searchText:t.searchText};break;case"appendUsers":let r=[];t.removeOldUsers?(e.disableLoadingState||(e.userList=[]),r=t.users,e.disableLoadingState||(o={...e,userList:r})):t.usersManager&&[0].includes(t.usersManager?.getCurrentPage())&&!t.users.length?!t.users.length&&t.onEmpty&&(setTimeout(()=>{t.onEmpty()}),o={...e,fetchState:n.States.empty}):0!==t.users.length&&(o={...e,userList:1==t.usersManager?.getCurrentPage()?[...t.users]:[...e.userList,...t.users]});break;case"setUserList":o={...e,userList:t.userList};break;case"setFetchState":o={...e,fetchState:t.fetchState};break;case"updateUser":{const{userList:n}=e,{user:r}=t,s=r.getUid(),i=n.findIndex(e=>e.getUid()===s);i>-1&&(o={...e,userList:n.map((e,t)=>t===i?r:e)});break}case"setIsFirstReload":o={...e,isFirstReload:t.isFirstReload}}return o}function q(e){const{title:o=n.localize("USERS"),tileAlignment:r=n.TitleAlignment.left,hideSearch:i=!1,searchIconURL:a=P,searchPlaceholderText:l=n.localize("SEARCH"),listItemView:c=null,showSectionHeader:C=!0,sectionHeaderKey:m="getName",loadingStateView:A,loadingIconURL:y=O,hideError:w=!1,errorStateView:f,errorStateText:D=n.localize("SOMETHING_WRONG"),emptyStateView:E,emptyStateText:v=n.localize("NO_USERS_FOUND"),subtitleView:S=null,disableUsersPresence:I=!1,menus:F=null,options:T=null,hideSeparator:j=!1,selectionMode:V=n.SelectionMode.none,onSelect:G,usersRequestBuilder:H=null,searchRequestBuilder:Q=null,onItemClick:N,onError:K,statusIndicatorStyle:z=null,avatarStyle:J=null,usersStyle:Y=null,listItemStyle:_=null,activeUser:W=null,searchKeyword:q="",onEmpty:$,fetchingUsers:ee=!1,fetchTimeOut:te,userPresencePlacement:ne=n.UserPresencePlacement.bottom,disableLoadingState:oe=!1}=e,[re,se]=t.useReducer(X,{searchText:"",userList:[],fetchState:n.States.loading,isFirstReload:!1,fetchingUsers:ee,fetchTimeOut:te,disableLoadingState:oe}),ie=x(K),ae=t.useRef(null),le=t.useRef(""),{theme:ce}=t.useContext(U),Ce=t.useRef(!1),ge=t.useRef(!1),de=t.useRef("");let ue=t.useRef(!0);const pe=t.useRef({}),[he,me]=t.useState(null);re.searchText&&re.searchText!==de.current&&(de.current=re.searchText),re.isFirstReload&&(Ce.current=!0,re.isFirstReload=!1);const Ae=t.useCallback(async e=>{const t=ae.current;if(!t)return;let o=ge.current||oe&&!ue?n.States.loaded:n.States.loading;se({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(e!==le.current)return;let r=!!ge.current;se({type:"appendUsers",users:o,removeOldUsers:r,usersManager:t,onEmpty:$}),Ce.current&&(R.attachConnestionListener(()=>{const e=null===H?(new s.CometChat.UsersRequestBuilder).setLimit(30):H;ae.current=new R({searchText:de.current,usersRequestBuilder:e,searchRequestBuilder:Q,usersSearchText:de}),ge.current=!0}),Ce.current=!1),ge.current?ge.current=!1:se({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===le.current&&re.userList?.length<=0&&se({type:"setFetchState",fetchState:n.States.error}),ie(t)}ue.current=!1},[ie,se]),xe=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(de.current="",se({type:"setSearchText",searchText:e}))},[se]),be=t.useCallback(e=>{se({type:"updateUser",user:e})},[se]);const ye=e=>e.getUid()===he||!!pe.current[e.getUid()],we=(e,t)=>{let o=t?.detail?.checked;V===n.SelectionMode.single&&me(e.getUid()),G&&G(e,o),o?pe.current[e.getUid()]=e:delete pe.current[e.getUid()]};function fe(e){if(V!==n.SelectionMode.single&&V!==n.SelectionMode.multiple)return null;let t;return t=V===n.SelectionMode.single?g.jsx(L,{onChange:t=>we(e,t),checked:ye(e)}):g.jsx(b,{onChange:t=>we(e,t),checked:ye(e),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ce.palette.getPrimary(),uncheckedBackgroundColor:ce.palette.getAccent400()}}),g.jsx("div",{style:{paddingRight:"8px"},children:t})}function De(e){let t;return(t=T?.(e))?.length?g.jsx(B,{data:t,onOptionClick:e=>e.detail.data.onClick?.()}):null}function Ee(e){let t=(new Z).getUserStatusVisible(e);return I||t?null:Y?.onlineStatusColor||ce.palette.getSuccess()||null}const ve=e=>{let t=(new Z).getUserStatusVisible(e);return I||t||I||t?null:function(e){return{...null!==e?e:{},border:e?.border||"none",borderRadius:e?.borderRadius||"24px",height:e?.height||"12px",width:e?.width||"12px"}}(z)};return function(e){const{usersManagerRef:o,fetchNextAndAppendUsers:r,searchText:s,usersRequestBuilder:i,searchRequestBuilder:a,dispatch:l,updateUser:c,fetchNextIdRef:C,searchKeyword:g,disableLoadingState:d,usersSearchText:u}=e;t.useEffect(()=>(i?.searchKeyword?u.current=i?.searchKeyword:a?.searchKeyword&&(u.current=a?.searchKeyword),()=>{i?.setSearchKeyword("")}),[]),t.useEffect(()=>{l({type:"setIsFirstReload",isFirstReload:!0}),o.current=new R({searchText:s,usersRequestBuilder:i,searchRequestBuilder:a,usersSearchText:u}),d||l({type:"setUserList",userList:[]}),r(C.current="initialFetch_"+String(Date.now()))},[s,i,a,r,l,C,o]),t.useEffect(()=>R.atttachListeners(c),[c]),t.useEffect(()=>{const e=n.CometChatUserEvents.ccUserBlocked.subscribe(c),t=n.CometChatUserEvents.ccUserUnblocked.subscribe(c);return()=>{e.unsubscribe(),t.unsubscribe()}},[c]),t.useEffect(()=>{l({type:"setSearchText",searchText:g})},[g,l])}({usersManagerRef:ae,fetchNextAndAppendUsers:Ae,searchText:re.searchText,usersRequestBuilder:H,searchRequestBuilder:Q,dispatch:se,updateUser:be,fetchNextIdRef:le,searchKeyword:q,disableLoadingState:oe,usersSearchText:de}),g.jsxs("div",{className:"cc-users",style:u(Y,ce),children:[F?g.jsx("div",{className:"cc-users__menus",style:{position:"absolute",top:"12px",right:"12px"},children:F}):null,g.jsx(k,{title:o,titleAlignment:r,hideSearch:re.fetchState===n.States.error||i,searchIconURL:a,searchPlaceholderText:l,searchText:re.searchText,onSearch:xe,list:re.userList,listItem:c||function(e){return g.jsx(M,{id:e.getUid(),avatarURL:e.getAvatar(),avatarName:e.getName(),title:e.getName(),isActive:V===n.SelectionMode.none&&e.getUid()===W?.getUid(),hideSeparator:j,statusIndicatorColor:Ee(e),statusIndicatorStyle:ve(e),avatarStyle:h(J,ce),listItemStyle:p(_,Y,ce),subtitleView:S?.(e),subtitleViewClassName:"cc-users__subtitle-view",tailView:fe(e),tailViewClassName:"cc-users__tail-view",menuView:De(e),menuViewClassName:"cc-users__options-view",onClick:t=>N?.(e),userPresencePlacement:ne})},onScrolledToBottom:()=>Ae(le.current="onScrolledToBottom_"+String(Date.now())),showSectionHeader:C,sectionHeaderKey:m,listItemKey:"getUid",state:re.fetchState!==n.States.loaded||0!==re.userList.length||$?re.fetchState:n.States.empty,loadingView:A,loadingIconURL:y,hideError:w,errorStateView:f,errorStateText:D,emptyStateView:E,emptyStateText:v,listStyle:d(Y,ce)})]})}function $(e,t){return{position:"relative",overflowX:"hidden",width:e?.width||"100%",height:e?.height||"100%",boxSizing:"border-box",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),padding:e?.padding||"0",boxShadow:e?.boxShadow||"0"}}function ee(e,t){return new r.ListStyle({width:"100%",height:"100%",border:"none",borderRadius:"inherit",background:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent()})}function te(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent"}}function ne(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent"}}function oe(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function re(e){return{...null!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function se(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function ie(e,t){return new o.LabelStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle1),textColor:e?.textColor||t.palette.getAccent600(),background:"inherit"})}function ae(e,t){return new o.MenuListStyle({border:"none",borderRadius:"8px",background:"transparent",moreIconTint:t.palette.getPrimary(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${t.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e?.background||t.palette.getBackground()})}function le(e,t){return new o.ChangeScopeStyle({height:e?.height||"212px",width:e?.width||"360px",border:e?.border||`1px solid ${t.palette.getAccent200()}`,borderRadius:e?.borderRadius||"12px",background:e?.background||t.palette.getBackground(),titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),activeTextFont:e?.activeTextFont||n.fontHelper(t.typography.subtitle1),activeTextColor:e?.activeTextColor||t.palette.getAccent(),activeTextBackground:e?.activeTextBackground||t.palette.getAccent200(),arrowIconTint:e?.arrowIconTint||t.palette.getAccent900(),textFont:e?.textFont||n.fontHelper(t.typography.subtitle1),textColor:e?.textColor||t.palette.getAccent600(),optionBackground:e?.optionBackground||t.palette.getBackground(),optionBorder:e?.optionBorder||"none",optionBorderRadius:e?.optionBorderRadius||"0",hoverTextFont:e?.hoverTextFont||n.fontHelper(t.typography.subtitle1),hoverTextColor:e?.hoverTextColor||t.palette.getAccent900(),hoverTextBackground:e?.hoverTextBackground||t.palette.getAccent100(),buttonTextFont:e?.buttonTextFont||n.fontHelper(t.typography.title2),buttonTextColor:e?.buttonTextColor||t.palette.getAccent("dark"),buttonBackground:e?.buttonBackground||t.palette.getPrimary(),closeIconTint:e?.closeIconTint||t.palette.getPrimary()})}var ce="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20%5Ci-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%5Ci%20%20%5Cihttp%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%5Ci%3E%3Csvg%20enable-background%3D%22new%200%200%2032%2032%22%20%20id%3D%22%D0%A1%D0%BB%D0%BE%D0%B9_1%22%20version%3D%221.1%22%20viewBox%3D%220%200%2032%2032%22%20%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20d%3D%22M24.285%2C11.284L16%2C19.571l-8.285-8.288c-0.395-0.395-1.034-0.395-1.429%2C0%20%20c-0.394%2C0.395-0.394%2C1.035%2C0%2C1.43l8.999%2C9.002l0%2C0l0%2C0c0.394%2C0.395%2C1.034%2C0.395%2C1.428%2C0l8.999-9.002%20%20c0.394-0.395%2C0.394-1.036%2C0-1.431C25.319%2C10.889%2C24.679%2C10.889%2C24.285%2C11.284z%22%20fill%3D%22%23121313%22%20id%3D%22Expand_More%22%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3C%2Fsvg%3E";class Ce{constructor(e){const{searchText:t,groupMemberRequestBuilder:n,searchRequestBuilder:o,groupGuid:r,groupMembersSearchText:i}=e;let a=n||new s.CometChat.GroupMembersRequestBuilder(r).setLimit(30);t&&o?(a=o,a.setSearchKeyword(t)):t&&!o&&n?(a=n,a.setSearchKeyword(t)):!t&&n&&o?(a=n,a.setSearchKeyword(i.current)):t||!n||o?t||n||!o?a.setSearchKeyword(t):a.setSearchKeyword(i.current):(a=n,a.setSearchKeyword(i.current)),this.groupMembersRequest=a.build()}fetchNext(){return this.groupMembersRequest.fetchNext()}getCurrentPage(){return this.groupMembersRequest.pagination.current_page}static attachUserListener(e){const t="GroupMembers_User_"+String(Date.now());return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e})),()=>s.CometChat.removeUserListener(t)}static createParticipantGroupMember(e,t){const o=new s.CometChat.GroupMember(e.getUid(),n.CometChatUIKitConstants.groupMemberScope.participant);return o.setName(e.getName()),o.setGuid(t.getGuid()),o.setUid(e.getUid()),o}static attachGroupListener(e,t){const n="GroupMembers_Group_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(n,o,r,s,i)=>{i.getGuid()===e&&t({type:"updateGroupMemberScopeIfPresent",groupMemberUid:o.getUid(),newScope:r})},onGroupMemberKicked:(n,o,r,s)=>{s.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onGroupMemberBanned:(n,o,r,s)=>{s.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onMemberAddedToGroup:(n,o,r,s)=>{s.getGuid()===e&&t({type:"appendGroupMember",groupMember:Ce.createParticipantGroupMember(o,s)})},onGroupMemberLeft:(n,o,r)=>{r.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onGroupMemberJoined:(n,o,r)=>{r.getGuid()===e&&t({type:"appendGroupMember",groupMember:Ce.createParticipantGroupMember(o,r)})}})),()=>s.CometChat.removeGroupListener(n)}}var ge="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",de="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ue="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function pe(e,t){let o=e;const{type:r}=t;switch(r){case"appendGroupMembers":{const{groupMembers:r,groupMembersManager:s,onEmpty:i}=t;s&&[0].includes(s?.getCurrentPage())&&!r.length?!r.length&&i&&(setTimeout(()=>{i()}),o={...e,fetchState:n.States.empty}):0!==r.length&&(o={...e,groupMemberList:1==s?.getCurrentPage()?[...r]:[...e.groupMemberList,...r]});break}case"setSearchText":o={...e,searchText:t.searchText};break;case"setFetchState":o={...e,fetchState:t.fetchState};break;case"setGroupMemberList":o={...e,groupMemberList:t.groupMemberList};break;case"removeGroupMemberIfPresent":{const n=t.groupMemberUid,r=e.groupMemberList.findIndex(e=>e.getUid()===n);r>-1&&(o={...e,groupMemberList:e.groupMemberList.filter((e,t)=>t!==r)});break}case"setGroupMemberToChangeScopeOf":o={...e,groupMemberToChangeScopeOf:t.groupMember};break;case"replaceGroupMemberIfPresent":{const{updatedGroupMember:n}=t,r=n.getUid(),s=e.groupMemberList.findIndex(e=>e.getUid()===r);s>-1&&(o={...e,groupMemberList:e.groupMemberList.map((e,t)=>t!==s?e:n)});break}case"updateGroupMemberStatusIfPresent":{const{user:n}=t,{groupMemberList:r}=e,s=n.getUid(),i=r.findIndex(e=>e.getUid()===s);i>-1&&(o={...e,groupMemberList:r.map((e,t)=>(t===i&&e.setStatus(n.getStatus()),e))});break}case"updateGroupMemberScopeIfPresent":{const{groupMemberUid:n,newScope:r}=t,{groupMemberList:s}=e,i=s.findIndex(e=>e.getUid()===n);i>-1&&(o={...e,groupMemberList:s.map((e,t)=>(t===i&&e.setScope(r),e))});break}case"appendGroupMember":o={...e,groupMemberList:[...e.groupMemberList,t.groupMember]}}return o}function he(e){const{backButtonIconURL:o=de,showBackButton:i=!1,onBack:a,menus:l=null,title:c=n.localize("MEMBERS"),titleAlignment:C=n.TitleAlignment.center,searchPlaceholder:d=n.localize("SEARCH"),searchIconURL:u=ge,hideSearch:p=!1,groupMemberRequestBuilder:h=null,searchRequestBuilder:y=null,group:w,onError:f,emptyStateText:D=n.localize("NO_USERS_FOUND"),errorStateText:E=n.localize("SOMETHING_WRONG"),loadingIconURL:v=ue,loadingStateView:S,errorStateView:I,errorSateView:F,emptyStateView:T,hideError:R=!1,hideSeparator:P=!0,disableUsersPresence:O=!1,subtitleView:j=null,listItemView:V=null,options:G=null,dropDownIconURL:H=ce,tailView:Q=null,selectionMode:N=n.SelectionMode.none,onItemClick:K=null,onSelect:z=null,closeButtonIconURL:Y="",onClose:_,avatarStyle:W=null,statusIndicatorStyle:X=null,listItemStyle:q=null,groupScopeStyle:he=null,groupMembersStyle:me=null,searchKeyword:Ae="",onEmpty:xe,fetchTimeOut:be,userPresencePlacement:ye=n.UserPresencePlacement.bottom,disableLoadingState:we=!1}=e,[fe,De]=t.useReducer(pe,{groupMemberList:[],fetchState:n.States.loading,searchText:"",groupMemberToChangeScopeOf:null,fetchTimeOut:be,disableLoadingState:we}),Ee=t.useRef(null),ve=t.useRef(null),Se=t.useRef(""),[Ie,Fe]=A(null),ke=m(w),Te=x(f),{theme:Me}=t.useContext(U),Be=t.useRef(""),Le=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(Be.current="",De({type:"setSearchText",searchText:e}))},[De]),Ue=t.useCallback(async e=>{const t=Ee.current;if(t){we||De({type:"setFetchState",fetchState:n.States.loading});try{const o=await t.fetchNext();if(e!==Se.current)return;De({type:"appendGroupMembers",groupMembers:o,groupMembersManager:t,onEmpty:xe}),De({type:"setFetchState",fetchState:n.States.loaded})}catch(e){De({type:"setFetchState",fetchState:n.States.error}),Te(e)}}},[De,Te]),Re=t.useCallback((e,t,o,i)=>{const a=new s.CometChat.Action(o.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return a.setAction(t),a.setActionBy(r.CometChatUIKitUtility.clone(i)),a.setSender(r.CometChatUIKitUtility.clone(i)),a.setMessage(`${i.getUid()} ${t} ${e.getUid()}`),a.setActionFor(r.CometChatUIKitUtility.clone(o)),a.setActionOn(r.CometChatUIKitUtility.clone(e)),a.setReceiver(r.CometChatUIKitUtility.clone(o)),a.setConversationId("group_"+o.getGuid()),a.setMuid(r.CometChatUIKitUtility.ID()),a.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),a.setReceiverType(n.CometChatUIKitConstants.MessageReceiverType.group),a.setRawData({extras:{scope:{new:e.getScope()}}}),a},[]),{groupMemberToChangeScopeOf:Pe}=fe,Oe=t.useCallback(async e=>{const t=ve.current;if(Pe&&t)try{const o=e,i=ke.current;await s.CometChat.updateGroupMemberScope(i.getGuid(),Pe.getUid(),o);const a=r.CometChatUIKitUtility.clone(Pe);a.setScope(o),De({type:"replaceGroupMemberIfPresent",updatedGroupMember:a}),n.CometChatGroupEvents.ccGroupMemberScopeChanged.next({scopeChangedFrom:Pe.getScope(),scopeChangedTo:a.getScope(),message:Re(a,n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE,i,t),group:r.CometChatUIKitUtility.clone(i),updatedUser:r.CometChatUIKitUtility.clone(a)})}catch(e){Te(e)}finally{De({type:"setGroupMemberToChangeScopeOf",groupMember:null})}},[Te,De,Re,Pe,ke]);function je(e,t){return e===n.CometChatUIKitConstants.GroupMemberOptions.ban?(async e=>{const t=ve.current;if(t)try{const o=ke.current;await s.CometChat.banGroupMember(o.getGuid(),e.getUid()),De({type:"removeGroupMemberIfPresent",groupMemberUid:e.getUid()});const i=r.CometChatUIKitUtility.clone(o);i.setMembersCount(i.getMembersCount()-1),n.CometChatGroupEvents.ccGroupMemberBanned.next({kickedBy:r.CometChatUIKitUtility.clone(t),kickedFrom:i,kickedUser:r.CometChatUIKitUtility.clone(e),message:Re(e,n.CometChatUIKitConstants.groupMemberAction.BANNED,i,t)})}catch(e){Te(e)}})(t):e===n.CometChatUIKitConstants.GroupMemberOptions.kick?(async e=>{const t=ve.current;if(t)try{const o=ke.current;await s.CometChat.kickGroupMember(o.getGuid(),e.getUid()),De({type:"removeGroupMemberIfPresent",groupMemberUid:e.getUid()});const i=r.CometChatUIKitUtility.clone(o);i.setMembersCount(i.getMembersCount()-1),n.CometChatGroupEvents.ccGroupMemberKicked.next({kickedBy:r.CometChatUIKitUtility.clone(t),kickedFrom:r.CometChatUIKitUtility.clone(i),kickedUser:r.CometChatUIKitUtility.clone(e),message:Re(e,n.CometChatUIKitConstants.groupMemberAction.KICKED,i,t)})}catch(e){Te(e)}})(t):e===n.CometChatUIKitConstants.GroupMemberOptions.changeScope?De({type:"setGroupMemberToChangeScopeOf",groupMember:t}):void 0}function Ve(e){let t;return null===Q&&(t=G?.(w,e))?.length?g.jsx(B,{data:t,menuListStyle:ae(me,Me),onOptionClick:t=>{const{id:n,onClick:o}=t.detail.data;o?o():"string"==typeof n&&je(n,e)}}):null}function Ge(e){return N===n.SelectionMode.single?g.jsx(L,{onChange:t=>z?.(e,t.detail.checked)}):N===n.SelectionMode.multiple?g.jsx(b,{onChange:t=>z?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:Me.palette.getPrimary(),uncheckedBackgroundColor:Me.palette.getAccent400()}}):null}function He(e,t){return"string"==typeof e?g.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(ie(me,Me))}):g.jsx(B,{topMenuSize:0,data:e,moreIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fmoreicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FMore%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.5%2C10%20C5.88071187%2C10%207%2C11.1192881%207%2C12.5%20C7%2C13.8807119%205.88071187%2C15%204.5%2C15%20C3.11928813%2C15%202%2C13.8807119%202%2C12.5%20C2%2C11.1192881%203.11928813%2C10%204.5%2C10%20Z%20M12%2C10%20C13.3807119%2C10%2014.5%2C11.1192881%2014.5%2C12.5%20C14.5%2C13.8807119%2013.3807119%2C15%2012%2C15%20C10.6192881%2C15%209.5%2C13.8807119%209.5%2C12.5%20C9.5%2C11.1192881%2010.6192881%2C10%2012%2C10%20Z%20M19.5%2C10%20C20.8807119%2C10%2022%2C11.1192881%2022%2C12.5%20C22%2C13.8807119%2020.8807119%2C15%2019.5%2C15%20C18.1192881%2C15%2017%2C13.8807119%2017%2C12.5%20C17%2C11.1192881%2018.1192881%2C10%2019.5%2C10%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",menuListStyle:ae(me,Me),onOptionClick:e=>{const{id:n}=e.detail.data;"string"==typeof n&&je(n,t)}})}function Qe(e){return null!==Q?null:g.jsx("div",{className:"cc-group-members__tail-view-content",children:He(r.GroupMemberUtils.getViewMemberOptions(e,w,ve.current?.getUid(),Me),e)})}function Ne(e){return g.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",columnGap:"8px"},children:[Q?.(e),Ge(e),Qe(e)]})}function Ke(e){let t=(new Z).getUserStatusVisible(e);return O||t?null:me?.onlineStatusColor||Me.palette.getSuccess()||null}function ze(e){return g.jsx(M,{id:e.getUid(),title:e.getName(),avatarURL:e.getAvatar(),avatarName:e.getName(),hideSeparator:P,isActive:fe.groupMemberToChangeScopeOf?.getUid()===e.getUid(),avatarStyle:oe(W,Me),statusIndicatorColor:Ke(e),statusIndicatorStyle:re(X),listItemStyle:se(q,me,Me),subtitleViewClassName:"cc-group-members__subtitle-view",subtitleView:j?.(e),tailViewClassName:"cc-group-members__tail-view",tailView:Ne(e),menuViewClassName:"cc-group-members__options-view",menuView:Ve(e),onClick:t=>K?.(e),userPresencePlacement:ye})}return function(e){const{groupMemberRequestBuilder:o,searchRequestBuilder:r,searchText:i,groupMembersManagerRef:a,groupGuid:l,fetchNextAndAppendGroupMembers:c,fetchNextIdRef:C,dispatch:g,loggedInUserRef:d,errorHandler:u,changeScopeElement:p,updateGroupMemberScope:h,searchKeyword:m,disableLoadingState:A,groupMembersSearchText:x}=e;t.useEffect(()=>(o?.searchKeyword?x.current=o?.searchKeyword:r?.searchKeyword&&(x.current=r?.searchKeyword),()=>{o?.setSearchKeyword("")}),[]),t.useEffect(()=>{(async()=>{try{d.current=await s.CometChat.getLoggedinUser()}catch(e){u(e)}})()},[u,d]),t.useEffect(()=>{a.current=new Ce({searchText:i,groupMemberRequestBuilder:o,searchRequestBuilder:r,groupGuid:l,groupMembersSearchText:x}),A||g({type:"setGroupMemberList",groupMemberList:[]}),c(C.current="initialFetchNext_"+String(Date.now()))},[o,r,i,l,c,g,C,a]),t.useEffect(()=>{if(!p)return;const e="cc-changescope-close-clicked",t="cc-changescope-changed";function n(){g({type:"setGroupMemberToChangeScopeOf",groupMember:null})}function o(e){const t=e.detail?.value;t&&h(t)}return p.addEventListener(e,n),p.addEventListener(t,o),()=>{p.removeEventListener(e,n),p.removeEventListener(t,o)}},[p,h,g]),t.useEffect(()=>Ce.attachUserListener(e=>g({type:"updateGroupMemberStatusIfPresent",user:e})),[g]),t.useEffect(()=>Ce.attachGroupListener(l,g),[l,g]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{const{kickedUser:t}=e;g({type:"removeGroupMemberIfPresent",groupMemberUid:t.getUid()})}),t=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{const{kickedUser:t}=e;g({type:"removeGroupMemberIfPresent",groupMemberUid:t.getUid()})}),o=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{const{updatedUser:t,scopeChangedTo:n}=e;g({type:"updateGroupMemberScopeIfPresent",groupMemberUid:t.getUid(),newScope:n})}),r=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{const{usersAdded:t,userAddedIn:n}=e;let o=a.current;g({type:"appendGroupMembers",groupMembersManager:o,groupMembers:t.map(e=>Ce.createParticipantGroupMember(e,n))})});return()=>{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),r.unsubscribe()}},[g]),t.useEffect(()=>{g({type:"setSearchText",searchText:m})},[m,g])}({groupMemberRequestBuilder:h,searchRequestBuilder:y,searchText:fe.searchText,groupMembersManagerRef:Ee,groupGuid:w.getGuid(),fetchNextAndAppendGroupMembers:Ue,fetchNextIdRef:Se,dispatch:De,loggedInUserRef:ve,errorHandler:Te,changeScopeElement:Ie,updateGroupMemberScope:Oe,searchKeyword:Ae,disableLoadingState:we,groupMembersSearchText:Be}),g.jsxs("div",{className:"cc-group-members",style:$(me,Me),children:[g.jsxs("div",{className:"cc-group-members__list-wrapper",style:{position:"relative",height:"100%"},children:[null===l?null:g.jsx("div",{className:"cc-group-members__menus",style:{position:"absolute",right:"12px",top:"8px",cursor:"pointer"},children:l}),g.jsx(k,{title:c,titleAlignment:C,searchPlaceholderText:d,searchIconURL:u,searchText:fe.searchText,onSearch:Le,hideSearch:p,list:fe.groupMemberList,listItemKey:"getUid",listItem:null!==V?V:ze,showSectionHeader:!1,onScrolledToBottom:()=>Ue(Se.current="onScrolledToBottom_"+String(Date.now())),state:fe.fetchState===n.States.loaded&&0===fe.groupMemberList.length?n.States.empty:fe.fetchState,loadingIconURL:v,emptyStateText:D,errorStateText:E,loadingView:S,emptyStateView:T,errorStateView:I||F,hideError:R,listStyle:ee(me,Me)})]}),i?g.jsx("div",{className:"cc-group-members__back-btns-wrapper",style:{position:"absolute",left:"16px",top:"19px",width:"fit-content",height:"fit-content"},children:g.jsx(J,{iconURL:o,buttonStyle:te(me,Me),onClick:a})}):null,Y?g.jsx("div",{className:"cc-group-members__close-btns-wrapper",style:{position:"absolute",right:"16px",top:"19px",width:"fit-content",height:"fit-content"},children:g.jsx(J,{iconURL:Y,buttonStyle:ne(me,Me),onClick:_})}):null,function(){let e;const{groupMemberToChangeScopeOf:t}=fe;return null!==t&&(e=r.GroupMemberUtils.allowScopeChange(w,t)).length>0?g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify((n=me,{height:n?.height,width:n?.width,position:"absolute"})),children:g.jsx("cometchat-change-scope",{ref:Fe,options:JSON.stringify(e),arrowIconURL:H,changeScopeStyle:JSON.stringify(le(he,Me))})}):null;var n}()]})}function me(e){const{userMemberListType:o=n.UserMemberListType.users,onItemClick:r,listItemView:s,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,group:c,subtitleView:C,usersRequestBuilder:d,userPresencePlacement:u=n.UserPresencePlacement.bottom,loadingStateView:p,onEmpty:h,groupMemberRequestBuilder:m,loadingIconUrl:A,disableLoadingState:x=!1,hideSeparator:b=!1,onError:y,disableUsersPresence:w}=e,{theme:f}=t.useContext(U);return g.jsxs(g.Fragment,{children:[o===n.UserMemberListType.users&&g.jsx(q,{title:"",hideSearch:!0,hideSeparator:b,showSectionHeader:!1,onItemClick:r,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,listItemView:s,usersRequestBuilder:d,subtitleView:C,closeButtonIconURL:"",loadingStateView:p,onEmpty:h,loadingIconURL:A,userPresencePlacement:u,disableLoadingState:x,disableUsersPresence:w,onError:y,usersStyle:{border:"1px solid "+f.palette.getAccent300(),background:f.palette.getBackground(),minHeight:"45px",borderRadius:"12px 12px 12px 12px"}}),o===n.UserMemberListType.groupmembers&&c&&g.jsx(he,{group:c,title:"",hideSearch:!0,showBackButton:!1,hideSeparator:b,groupMemberRequestBuilder:m,onItemClick:r,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,listItemView:s,subtitleView:C,closeButtonIconURL:"",userPresencePlacement:u,onEmpty:h,loadingIconURL:A,tailView:e=>g.jsx(g.Fragment,{}),disableLoadingState:x,disableUsersPresence:w,onError:y,groupMembersStyle:{border:"1px solid "+f.palette.getAccent300(),padding:"0px",background:f.palette.getBackground(),borderRadius:"12px 12px 12px 12px"}})]})}
10
+ */"production"===process.env.NODE_ENV?a.exports=function(){if(e)return l;e=1;var n=t,o=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,l={},c=null,C=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(C=t.ref),t)s.call(t,r)&&!a.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===l[r]&&(l[r]=t[r]);return{$$typeof:o,type:e,key:c,ref:C,props:l,_owner:i.current}}return l.Fragment=r,l.jsx=c,l.jsxs=c,l}():a.exports=(c||(c=1,"production"!==process.env.NODE_ENV&&function(){var e,n=t,o=Symbol.for("react.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),A=Symbol.iterator,x=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];!function(e,t,n){var o=x.ReactDebugCurrentFrame.getStackAddendum();""!==o&&(t+="%s",n=n.concat([o]));var r=n.map(function(e){return String(e)});r.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,r)}("error",e,n)}function y(e){return e.displayName||"Context"}function w(e){if(null==e)return null;if("number"==typeof e.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case s:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case g:return"Suspense";case u:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case c:return y(e)+".Consumer";case l:return y(e._context)+".Provider";case d:return function(e,t,n){var o=e.displayName;if(o)return o;var r=t.displayName||t.name||"";return""!==r?n+"("+r+")":n}(e,e.render,"ForwardRef");case p:var t=e.displayName||null;return null!==t?t:w(e.type)||"Memo";case h:var n=e,o=n._payload,C=n._init;try{return w(C(o))}catch(e){return null}}return null}e=Symbol.for("react.module.reference");var f,D,E,v,I,S,F,k=Object.assign,T=0;function M(){}M.__reactDisabledLog=!0;var B,L=x.ReactCurrentDispatcher;function U(e,t,n){if(void 0===B)try{throw Error()}catch(e){var o=e.stack.trim().match(/\n( *(at )?)/);B=o&&o[1]||""}return"\n"+B+e}var R,P=!1,O="function"==typeof WeakMap?WeakMap:Map;function j(e,t){if(!e||P)return"";var n,o=R.get(e);if(void 0!==o)return o;P=!0;var r,s=Error.prepareStackTrace;Error.prepareStackTrace=void 0,r=L.current,L.current=null,function(){if(0===T){f=console.log,D=console.info,E=console.warn,v=console.error,I=console.group,S=console.groupCollapsed,F=console.groupEnd;var e={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}T++}();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&"string"==typeof t.stack){for(var a=t.stack.split("\n"),l=n.stack.split("\n"),c=a.length-1,C=l.length-1;c>=1&&C>=0&&a[c]!==l[C];)C--;for(;c>=1&&C>=0;c--,C--)if(a[c]!==l[C]){if(1!==c||1!==C)do{if(c--,--C<0||a[c]!==l[C]){var d="\n"+a[c].replace(" at new "," at ");return e.displayName&&d.includes("<anonymous>")&&(d=d.replace("<anonymous>",e.displayName)),"function"==typeof e&&R.set(e,d),d}}while(c>=1&&C>=0);break}}}finally{P=!1,L.current=r,function(){if(0===--T){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:f}),info:k({},e,{value:D}),warn:k({},e,{value:E}),error:k({},e,{value:v}),group:k({},e,{value:I}),groupCollapsed:k({},e,{value:S}),groupEnd:k({},e,{value:F})})}T<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=s}var g=e?e.displayName||e.name:"",u=g?U(g):"";return"function"==typeof e&&R.set(e,u),u}function V(e,t,n){if(null==e)return"";if("function"==typeof e)return j(e,!(!(o=e.prototype)||!o.isReactComponent));var o;if("string"==typeof e)return U(e);switch(e){case g:return U("Suspense");case u:return U("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case d:return j(e.render,!1);case p:return V(e.type,t,n);case h:var r=e,s=r._payload,i=r._init;try{return V(i(s),t,n)}catch(e){}}return""}R=new O;var G=Object.prototype.hasOwnProperty,H={},Q=x.ReactDebugCurrentFrame;function N(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);Q.setExtraStackFrame(n)}else Q.setExtraStackFrame(null)}var K=Array.isArray;function z(e){return K(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var _,W,Z,X=x.ReactCurrentOwner,q={key:!0,ref:!0,__self:!0,__source:!0};function $(e,t,n,r,s){var i,a={},l=null,c=null;for(i in void 0!==n&&(Y(n),l=""+n),function(e){if(G.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),l=""+t.key),function(e){if(G.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(c=t.ref,function(e,t){if("string"==typeof e.ref&&X.current&&t&&X.current.stateNode!==t){var n=w(X.current.type);Z[n]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',w(X.current.type),e.ref),Z[n]=!0)}}(t,s)),t)G.call(t,i)&&!q.hasOwnProperty(i)&&(a[i]=t[i]);if(e&&e.defaultProps){var C=e.defaultProps;for(i in C)void 0===a[i]&&(a[i]=C[i])}if(l||c){var d="function"==typeof e?e.displayName||e.name||"Unknown":e;l&&function(e,t){var n=function(){_||(_=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}(a,d),c&&function(e,t){var n=function(){W||(W=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}(a,d)}return function(e,t,n,r,s,i,a){var l={$$typeof:o,type:e,key:t,ref:n,props:a,_owner:i,_store:{}};return Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(l,"_self",{configurable:!1,enumerable:!1,writable:!1,value:r}),Object.defineProperty(l,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}(e,l,c,s,r,X.current,a)}Z={};var ee,te=x.ReactCurrentOwner,ne=x.ReactDebugCurrentFrame;function oe(e){if(e){var t=e._owner,n=V(e.type,e._source,t?t.type:null);ne.setExtraStackFrame(n)}else ne.setExtraStackFrame(null)}function re(e){return"object"==typeof e&&null!==e&&e.$$typeof===o}function se(){if(te.current){var e=w(te.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ee=!1;var ie={};function ae(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=function(e){var t=se();if(!t){var n="string"==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}(t);if(!ie[n]){ie[n]=!0;var o="";e&&e._owner&&e._owner!==te.current&&(o=" It was passed a child from "+w(e._owner.type)+"."),oe(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,o),oe(null)}}}function le(e,t){if("object"==typeof e)if(z(e))for(var n=0;n<e.length;n++){var o=e[n];re(o)&&ae(o,t)}else if(re(e))e._store&&(e._store.validated=!0);else if(e){var r=function(e){if(null===e||"object"!=typeof e)return null;var t=A&&e[A]||e["@@iterator"];return"function"==typeof t?t:null}(e);if("function"==typeof r&&r!==e.entries)for(var s,i=r.call(e);!(s=i.next()).done;)re(s.value)&&ae(s.value,t)}}function ce(e){var t,n=e.type;if(null!=n&&"string"!=typeof n){if("function"==typeof n)t=n.propTypes;else{if("object"!=typeof n||n.$$typeof!==d&&n.$$typeof!==p)return;t=n.propTypes}if(t){var o=w(n);!function(e,t,n,o,r){var s=Function.call.bind(G);for(var i in e)if(s(e,i)){var a=void 0;try{if("function"!=typeof e[i]){var l=Error((o||"React class")+": "+n+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw l.name="Invariant Violation",l}a=e[i](t,i,o,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){a=e}!a||a instanceof Error||(N(r),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",n,i,typeof a),N(null)),a instanceof Error&&!(a.message in H)&&(H[a.message]=!0,N(r),b("Failed %s type: %s",n,a.message),N(null))}}(t,e.props,"prop",o,e)}else void 0===n.PropTypes||ee||(ee=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w(n)||"Unknown"));"function"!=typeof n.getDefaultProps||n.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ce(t,n,r,C,A,x){var y=function(t){return"string"==typeof t||"function"==typeof t||t===s||t===a||t===i||t===g||t===u||t===m||"object"==typeof t&&null!==t&&(t.$$typeof===h||t.$$typeof===p||t.$$typeof===l||t.$$typeof===c||t.$$typeof===d||t.$$typeof===e||void 0!==t.getModuleId)}(t);if(!y){var f="";(void 0===t||"object"==typeof t&&null!==t&&0===Object.keys(t).length)&&(f+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D,E=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(A);f+=E||se(),null===t?D="null":z(t)?D="array":void 0!==t&&t.$$typeof===o?(D="<"+(w(t.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):D=typeof t,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",D,f)}var v=$(t,n,r,A,x);if(null==v)return v;if(y){var I=n.children;if(void 0!==I)if(C)if(z(I)){for(var S=0;S<I.length;S++)le(I[S],t);Object.freeze&&Object.freeze(I)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else le(I,t)}return t===s?function(e){for(var t=Object.keys(e.props),n=0;n<t.length;n++){var o=t[n];if("children"!==o&&"key"!==o){oe(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),oe(null);break}}null!==e.ref&&(oe(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),oe(null))}(v):ce(v),v}var de=function(e,t,n){return Ce(e,t,n,!1)},ge=function(e,t,n){return Ce(e,t,n,!0)};C.Fragment=s,C.jsx=de,C.jsxs=ge}()),C);var d=a.exports;function g(e,t){return new r.ListStyle({width:"100%",height:"100%",background:"inherit",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),sectionHeaderTextFont:e?.sectionHeaderTextFont||n.fontHelper(t.typography.caption1),sectionHeaderTextColor:e?.sectionHeaderTextColor||t.palette.getAccent500()})}function u(e,t){return{boxSizing:"border-box",position:"relative",width:e?.width||"100%",height:e?.height||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||`1px solid ${t.palette.getAccent50()}`,borderRadius:e?.borderRadius||"0",overflow:"hidden"}}function p(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),hoverBackground:e?.hoverBackground||r.palette.getAccent50()})}function h(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function m(e){const n=t.useRef(e);return n.current=e,n}function A(e){const[n,o]=t.useState(e);return[n,t.useCallback(e=>{o(e)},[])]}function x(e){const n=m(e),o=t.useCallback(function e(t){if("object"==typeof t&&t)if(t instanceof s.CometChat.CometChatException){const e=n.current;if(e)return e(t)}else if(t instanceof Error)return e(new s.CometChat.CometChatException({code:"ERROR",name:t.name,message:t.message}));console.log(t)},[n]);return o}function b(e){const{name:n,labelText:o,checked:r,disabled:s,checkboxStyle:i,onChange:a}=e,l=t.useRef();return function(e){const{ref:n,onChangePropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-checkbox-changed",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:l,onChangePropRef:m(a)}),d.jsx("cometchat-checkbox",{ref:l,name:n,labelText:o,...r?{checked:r}:{},...s?{disabled:s}:{},...(c=i,C="checkboxStyle",c?{[C]:JSON.stringify(c)}:{})});var c,C}function y(e){return{boxSizing:"border-box",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",boxShadow:e?.boxShadow,display:"flex",flexDirection:"column",overflow:"hidden"}}function w(e){return{flexShrink:"0",padding:e?"0px 12px":"19px 16px",display:"flex",flexDirection:"column",boxSizing:"border-box"}}function f(e,t,o){return{textAlign:t===n.TitleAlignment.left?"left":"center",font:e?.titleTextFont||"700 22px Inter, sans-serif",color:e?.titleTextColor||"rgb(20, 20, 20)",boxSizing:"border-box"}}function D(e){return{border:e?.searchBorder||"none",borderRadius:e?.searchBorderRadius||"8px",width:"100%",height:"32px",background:e?.searchBackground||"rgb(20, 20, 20, 0.04)",searchTextFont:e?.searchTextFont||"400 15px Inter, sans-serif",searchTextColor:e?.searchTextColor||"rgb(20, 20, 20)",placeholderTextFont:e?.searchPlaceholderTextFont||"400 15px Inter, sans-serif",placeholderTextColor:e?.searchPlaceholderTextColor||"rgb(20, 20, 20, 0.46)",searchIconTint:e?.searchIconTint||"rgb(20, 20, 20, 0.46)"}}function E(e){return{iconTint:e?.loadingIconTint||"rgb(20, 20, 20, 0.58)"}}function v(e){return{font:e?.sectionHeaderTextFont||"500 12px Inter, sans-serif",color:e?.sectionHeaderTextColor||"rbg(20, 20, 20, 0.46)",textAlign:"left",padding:"8px 0"}}function I(e){return{textFont:e?.errorStateTextFont||"700 22px Inter, sans-serif",textColor:e?.errorStateTextColor||"rgb(20, 20, 20, 0.33)"}}function S(e){return{textFont:e?.emptyStateTextFont||"700 22px Inter, sans-serif",textColor:e?.emptyStateTextColor||"rgb(20, 20, 20, 0.33)"}}function F(e,t){let n;const o=t[e];if("function"==typeof o){const e=o.call(t);n=String(void 0===e&&t?.id?t?.id:e)}else n=String(o);return n}const k=(0,t.memo)(function(e){const{title:o="",titleAlignment:r=n.TitleAlignment.left,hideSearch:i=!1,searchText:a="",onSearch:l,searchPlaceholderText:c="Search",searchIconURL:C,list:g,listItem:u,showSectionHeader:p=!0,sectionHeaderKey:h,listItemKey:b,onScrolledToBottom:k,onScrolledToTop:T,state:M,loadingView:B,loadingIconURL:L,hideError:U=!1,errorStateView:R,errorStateText:P="Error",emptyStateView:O,emptyStateText:j,scrollToBottom:V=!1,onError:G,listStyle:H=null,scrolledUpCallback:Q}=e,[N,K]=A(null),z=t.useRef(null),J=t.useRef(null),Y=t.useRef(null),_=t.useRef(!1),W=t.useRef(null),Z=t.useRef([0,0]),X=t.useRef(!1),q=m(T),$=m(k),ee=m(l),te=x(G);!function(e){const{onSearchRef:n,searchInputElement:o,intersectionObserverRootRef:r,intersectionObserverBottomTargetRef:s,intersectionObserverTopTargetRef:i,onScrolledToBottomRef:a,onScrolledToTopRef:l,timeoutIdRef:c,scrollToBottom:C,didComponentScrollToBottomRef:d,scrollHeightTupleRef:g,didTopObserverCallbackRunRef:u,errorHandler:p,scrolledUpCallback:h}=e;t.useEffect(()=>{if(!o)return;function e(e){const t=e.detail.searchText;null!==c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{n.current?.(t),c.current=null},500)}const t="cc-search-changed";return o.addEventListener(t,e),()=>{o.removeEventListener(t,e)}},[o,n,c]),t.useEffect(()=>{if(!r.current||!s.current)return;let e=!1;const t=r.current,n=s.current,o=new IntersectionObserver(async function(n){const o=n[0];if(o&&h&&h(o.isIntersecting),d.current&&o.isIntersecting)d.current=!1;else if(!(!o.isIntersecting||e||t.scrollHeight<=t.clientHeight)){e=!0;try{await Promise.all([a.current?.()])}catch(e){p(e)}e=!1}},{root:t,threshold:.1});return o.observe(n),()=>{o.unobserve(n)}},[p,d,s,r,a,h]),t.useEffect(()=>{if(!r.current||!i.current)return;let e=!1;const t=r.current,n=i.current,o=new IntersectionObserver(async function(n){if(!(!n[0].isIntersecting||e||t.scrollHeight<=t.clientHeight)){e=!0;try{await Promise.all([l.current?.()])}catch(e){p(e)}e=!1,u.current=!0}},{root:t,threshold:.1});return o.observe(n),()=>{o.unobserve(n)}},[p,u,r,i,l]),t.useEffect(()=>{r.current&&(r.current.scrollHeight>r.current.clientHeight?0!==Math.round(r.current.scrollHeight-g.current[1])&&(g.current[0]=g.current[1],g.current[1]=r.current.scrollHeight,!C&&u.current&&0!==g.current[0]&&(r.current.scrollTop=Math.max(g.current[1]-g.current[0],0))):(g.current[0]=0,g.current[1]=0),u.current&&(u.current=!1))}),t.useEffect(()=>{setTimeout(()=>{const e=r.current,t=C&&(e?.scrollHeight??0)>(e?.clientHeight??0)&&null!==s.current;e&&t&&(d.current=!0,e.scrollTo({top:e.scrollHeight}))})})}({onSearchRef:ee,searchInputElement:N,intersectionObserverRootRef:z,intersectionObserverBottomTargetRef:Y,onScrolledToBottomRef:$,onScrolledToTopRef:q,intersectionObserverTopTargetRef:J,timeoutIdRef:W,scrollToBottom:V,didComponentScrollToBottomRef:_,scrollHeightTupleRef:Z,didTopObserverCallbackRunRef:X,errorHandler:te,scrolledUpCallback:Q});const ne=""===o;return d.jsxs("div",{className:"cc-list",style:y(H),children:[d.jsxs("div",{className:"cc-list__header",style:w(ne),children:[d.jsx("div",{className:"cc-list__title",style:f(H,r),children:o}),i?null:d.jsx("cometchat-search-input",{ref:K,searchText:a,placeholderText:c,searchIconURL:C,searchInputStyle:JSON.stringify(D(H)),style:{paddingTop:"16px"}})]}),d.jsxs("div",{ref:z,className:"cc-list__content",style:{overflow:"hidden auto",overflowX:"hidden",display:"flex",flexDirection:"column",width:"100%",height:"100%",boxSizing:"border-box",padding:"0 16px"},children:[d.jsx("div",{ref:J}),function(){if(M===n.States.loading&&0===g.length||M===n.States.empty||M===n.States.error)return null;let e="";return g.map((t,n)=>{let o=null;if(p){let r;void 0===h?(te(new s.CometChat.CometChatException({code:"ERROR",name:"Error",message:"'sectionHeaderKey' prop must be provided when 'showSectionHeader' prop is set to true. 'showSectionHeader' is set to be true by default"})),r=" "):r=(F(h,t)||" ")[0].toUpperCase();let i=null;0===n?(i=d.jsx("div",{className:"cc-list__section-header",style:v(H),children:r}),e=r):e!==r?(i=d.jsx("div",{className:"cc-list__section-separator",children:d.jsx("div",{className:"cc-list__section-header",style:v(H),children:r})}),e=r):i=d.jsx("div",{className:"cc-list__section-separator"}),o=d.jsx("div",{className:"cc-list__section",children:i})}return d.jsxs("div",{className:"cc-list__item",children:[o,u(t,n)]},b?F(b,t):n)})}(),function(){let e=null;switch(M){case n.States.loading:0===g.length&&(e=function(){let e;return e=B?d.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__loading-view cc-list__loading-view--custom",children:B}):d.jsx("div",{className:"cc-list__loading-view cc-list__loading-view--default",style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},children:d.jsx("cometchat-loader",{iconURL:L,loaderStyle:JSON.stringify(E(H))})}),d.jsx("div",{className:"cc-list__loading-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}());break;case n.States.error:e=function(){if(U)return null;let e;return e=R?d.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__error-view cc-list__error-view--custom",children:R}):d.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},className:"cc-list__error-view cc-list__error-view--default",children:d.jsx("cometchat-label",{text:P,labelStyle:JSON.stringify(I(H))})}),d.jsx("div",{className:"cc-list__error-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}();break;case n.States.empty:e=function(){let e;return e=!O&&j?d.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"},className:"cc-list__empty-view cc-list__empty-view--default",children:d.jsx("cometchat-label",{text:j,labelStyle:JSON.stringify(S(H))})}):d.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},className:"cc-list__empty-view cc-list__empty-view--custom",children:O}),d.jsx("div",{className:"cc-list__empty-view-wrapper",style:{height:"calc(100% - 1px)",overflow:"auto"},children:e})}();case n.States.loaded:}return e}(),d.jsx("div",{ref:Y,style:{height:"1px",border:"1px solid transparent"}})]})]})});var T="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function M(e){const{id:o,avatarURL:r,avatarName:s,statusIndicatorColor:i,statusIndicatorIcon:a,title:l,isActive:c,subtitleView:C,tailView:g,menuView:u,hideSeparator:p,avatarStyle:h,statusIndicatorStyle:A,listItemStyle:x,onClick:b,subtitleViewClassName:y,tailViewClassName:w,menuViewClassName:f,loadingIconURL:D=T,userPresencePlacement:E=n.UserPresencePlacement.bottom}=e,v=t.useRef();function I(e){return void 0!==e?{className:e}:{}}function S(e,t){return e?{[t]:JSON.stringify(e)}:{}}return function(e){const{ref:n,onListItemClickPropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-listitem-clicked",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:v,onListItemClickPropRef:m(b)}),d.jsxs("cometchat-list-item",{ref:v,id:o,avatarURL:r,avatarName:s,title:l,statusIndicatorColor:i,statusIndicatorIcon:a,loadingIconURL:D,userPresencePlacement:E,...c?{isActive:c}:{},...p?{hideSeparator:p}:{},...S(h,"avatarStyle"),...S(A,"statusIndicatorStyle"),...S(x,"listItemStyle"),children:[C?d.jsx("div",{slot:"subtitleView",...I(y),children:C}):null,g?d.jsx("div",{slot:"tailView",...I(w),children:g}):null,u?d.jsx("div",{slot:"menuView",...I(f),children:u}):null]})}function B(e){const{data:n,moreIconURL:o,topMenuSize:s,menuListStyle:i,onOptionClick:a}=e,l=t.useRef(),c=m(a);return function(e){const{data:n,idToOnClickMapRef:o,ref:s,onOptionClickPropRef:i}=e;t.useEffect(()=>{const e=new Map;o.current=e;for(let t=0;t<n.length;t++){const{id:o,onClick:r}=n[t];e.set(o,r)}},[n,o]),t.useEffect(()=>{const e=s.current,t="cc-menu-clicked",n=e=>{const t=r.CometChatUIKitUtility.clone(e.detail.data);t.onClick=o.current?.get(t.id),e.detail.data=t,i.current?.(e)};return e.addEventListener(t,n),()=>{e.removeEventListener(t,n)}},[s,o,i])}({data:n,idToOnClickMapRef:t.useRef(null),ref:l,onOptionClickPropRef:c}),d.jsx("cometchat-menu-list",{ref:l,moreIconURL:o,topMenuSize:s,...(C=i,g="menuListStyle",C?{[g]:JSON.stringify(C)}:{}),data:JSON.stringify(n)});var C,g}function L(e){const{name:n,labelText:o,checked:r,disabled:s,radioButtonStyle:i,onChange:a}=e,l=t.useRef();return function(e){const{ref:n,onChangePropRef:o}=e;t.useEffect(()=>{const e=n.current,t="cc-radio-button-changed",r=e=>o.current?.(e);return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}},[n,o])}({ref:l,onChangePropRef:m(a)}),d.jsx("cometchat-radio-button",{ref:l,name:n,labelText:o,...r?{checked:r}:{},...s?{disabled:s}:{},...(c=i,C="radioButtonStyle",c?{[C]:JSON.stringify(c)}:{})});var c,C}const U=t.createContext({theme:new n.CometChatTheme({})});class R{constructor(e){const{searchText:t,usersRequestBuilder:n,searchRequestBuilder:o,usersSearchText:r}=e;let s=n||this.getDefaultRequestBuilder();t&&o?(s=o,s.setSearchKeyword(t)):t&&!o&&n?(s=n,s.setSearchKeyword(t)):!t&&n&&o?(s=n,s.setSearchKeyword(r.current)):t||!n||o?t||n||!o?s.setSearchKeyword(t):(s=this.getDefaultRequestBuilder(),s.setSearchKeyword(r.current)):(s=n,s.setSearchKeyword(r.current)),this.usersRequest=s.build()}getDefaultRequestBuilder(){return(new s.CometChat.UsersRequestBuilder).setLimit(R.defaultLimit)}fetchNext(){return this.usersRequest.fetchNext()}getCurrentPage(){return this.usersRequest.pagination.current_page}static atttachListeners(e){const t="UsersList_"+String(Date.now()),n=new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e});return s.CometChat.addUserListener(t,n),()=>s.CometChat.removeUserListener(t)}static attachConnestionListener(e){const t="UsersList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}}R.defaultLimit=30;var P="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",O="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const j=(e,t)=>({flex:"1 1 0",display:"flex",flexDirection:"column",borderRadius:"inherit",justifyContent:e===t.left?"flex-start":"flex-end",alignItems:e===t.left?"flex-start":"flex-end",position:"relative",width:"100%"}),V=(e,t)=>({display:"flex",justifyContent:e===t.left?"flex-start":"flex-end",alignItems:"flex-start"}),G=(e,t,n,o)=>({justifyContent:e===t.left?"flex-start":"flex-end",top:n?"-17px":"-36px",right:e===t.right?"unset":"0",left:e===t.left?"0":"unset",position:"absolute",background:o.palette.getBackground(),borderRadius:"8px",width:"fit-content",zIndex:"2"}),H=e=>({border:`1px solid ${e.palette.getAccent200()}`,borderRadius:"8px",background:e.palette.getBackground(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${e.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground(),moreIconTint:e.palette.getAccent600()}),Q=(e,t,n="bottom")=>({listStyleType:"none",display:e?"flex":"none",position:"absolute",top:"bottom"===n?"0":"auto",bottom:"top"===n?"0":"auto",flexDirection:"column",justifyContent:"flex-start",alignItems:"flex-start",border:"1px solid #e8e8e8",width:"100%",zIndex:"3",background:t.palette.getBackground(),marginTop:"bottom"===n?"35px":"0",marginBottom:"top"===n?"35px":"0",padding:"0",borderRadius:"8px"}),N=e=>({background:"transparent",border:"none",borderRadius:"0",buttonIconTint:e?.moreIconTint||""}),K=(e,t)=>({background:t?.backgroundColor||"transparent",border:"none",borderRadius:"0",buttonIconTint:t?.iconTint,buttonTextFont:t?.titleFont,buttonTextColor:t?.titleColor}),z={width:"300px",height:"300px"};function J(e){const{text:n,hoverText:o,iconURL:r,disabled:s,buttonStyle:i,onClick:a,childRefCallback:l}=e,c=t.useRef();return function(e){const{ref:n,onClickPropRef:o,childRefCallback:r}=e;t.useEffect(()=>{const e=n.current;r&&r(n.current);const t="cc-button-clicked",s=e=>o.current?.(e);return e.addEventListener(t,s),()=>{e.removeEventListener(t,s)}},[n,o])}({ref:c,onClickPropRef:m(a),childRefCallback:l}),d.jsx("cometchat-button",{ref:c,text:n,hoverText:o,iconURL:r,...s?{disabled:s}:{},...(C=i,g="buttonStyle",C?{[g]:JSON.stringify(C)}:{})});var C,g}const Y=e=>{const{theme:o}=t.useContext(U),[r,s]=t.useState(!1),[i,a]=t.useState("bottom"),l=t.useRef(null),c=t.useRef(null),C=t.useRef([]),{data:g,topMenuSize:u,moreIconURL:p,moreIconHoverText:h,ContextMenuStyle:m,onOptionClicked:A,placement:x,parentClassName:b}=e,y=t.useCallback(()=>{s(e=>!e)},[]),w=t.useCallback(()=>{if(!b||!r)return;const e=document.querySelector(`.${b}`),t=c.current;if(!e||!t)return;const n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),s=t.querySelector(".cc-context-menu__sub-menu");if(!s)return;const i=s.offsetHeight||200,l=n.bottom-o.bottom;a(l<i?"top":"bottom")},[b,r]);t.useEffect(()=>{r&&w()},[r,w]);const f=t.useCallback(()=>d.jsx("li",{style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item cc-context-menu__menu-item--more",children:d.jsx("cometchat-button",{ref:l,buttonStyle:JSON.stringify(N(m)),hoverText:h,iconURL:p,onClick:y})}),[m,h,p,y]),D=t.useCallback((e,o)=>e?.map((r,s)=>{let i,a=null;return i=r instanceof n.CometChatActionsView&&r?.customView?d.jsx("li",{id:r.id,style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item",children:d.jsxs("cometchat-popover",{ref:e=>{C.current[r.id]=e},popoverStyle:JSON.stringify(z),placement:x,children:[d.jsx("div",{slot:"children",children:d.jsx("cometchat-button",{buttonStyle:JSON.stringify(K(0,r)),text:o?r?.title:"",hoverText:r?.title,iconURL:r?.iconURL})}),d.jsx("div",{slot:"content",children:r?.customView(I(r.id))})]})}):d.jsx("li",{id:r.id,style:{background:"transparent",padding:"4px 4px"},className:"cc-context-menu__menu-item",children:d.jsx(J,{buttonStyle:K(0,r),text:o?r?.title:"",hoverText:r?.title,iconURL:r?.iconURL,onClick:()=>{A(r)}})}),!o&&g?.length>e?.length&&s===e?.length-1&&(a=f()),d.jsxs(t.Fragment,{children:[i,a]},r.title)}),[x,g,A,f]),E=t.useCallback(()=>D(g.slice(0,u-1),!1),[D,u,g]),v=t.useCallback(()=>D(g.slice(u-1),!0),[D,u,g]),I=t.useCallback(e=>()=>{C.current[e]?.closeContentView&&C.current[e]?.closeContentView()},[]);return d.jsxs("div",{className:"cc-context-menu",style:{display:"flex",position:"relative"},ref:c,children:[d.jsx("ul",{className:"cc-context-menu__top-menu",style:{listStyleType:"none",display:"flex",flexDirection:"row",justifyContent:"flex-end",margin:"0",padding:"0",border:"1px solid #e8e8e8",zIndex:"2",borderRadius:"8px"},children:E()}),d.jsx("ul",{className:"cc-context-menu__sub-menu",style:Q(r,o,i),children:v()})]})};var _="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2016%2016%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F16%2FMore%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F16%2FMore%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C6.66666667%20C3.26666667%2C6.66666667%202.66666667%2C7.26666667%202.66666667%2C8%20C2.66666667%2C8.73333333%203.26666667%2C9.33333333%204%2C9.33333333%20C4.73333333%2C9.33333333%205.33333333%2C8.73333333%205.33333333%2C8%20C5.33333333%2C7.26666667%204.73333333%2C6.66666667%204%2C6.66666667%20Z%20M12%2C6.66666667%20C11.2666667%2C6.66666667%2010.6666667%2C7.26666667%2010.6666667%2C8%20C10.6666667%2C8.73333333%2011.2666667%2C9.33333333%2012%2C9.33333333%20C12.7333333%2C9.33333333%2013.3333333%2C8.73333333%2013.3333333%2C8%20C13.3333333%2C7.26666667%2012.7333333%2C6.66666667%2012%2C6.66666667%20Z%20M8%2C6.66666667%20C7.26666667%2C6.66666667%206.66666667%2C7.26666667%206.66666667%2C8%20C6.66666667%2C8.73333333%207.26666667%2C9.33333333%208%2C9.33333333%20C8.73333333%2C9.33333333%209.33333333%2C8.73333333%209.33333333%2C8%20C9.33333333%2C7.26666667%208.73333333%2C6.66666667%208%2C6.66666667%20Z%22%20id%3D%22Style%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const W=e=>{const{id:o,leadingView:s=null,headerView:i=null,replyView:a=null,contentView:l=null,bottomView:c=null,threadView:C=null,footerView:g=null,statusInfoView:u=null,options:p=[],alignment:h=n.MessageBubbleAlignment.right,messageBubbleStyle:m=new r.BaseStyle({width:"100%",height:"auto",background:"",borderRadius:"12px",border:"none"}),moreIconURL:A=_,topMenuSize:x=5,setRef:b}=e,y={borderRadius:"8px"},{theme:w}=t.useContext(U),f=t.useRef(null);t.useEffect(()=>{f&&f.current&&b&&b(f)},[f,b]);const[D,E]=t.useState(!1);t.useEffect(()=>()=>{v&&clearTimeout(v)},[]);let v=null;const I=e=>{p.forEach(t=>{t instanceof n.CometChatActionsIcon&&t.id===e?.id&&o&&t.onClick?.(parseInt(o))})},S=()=>F()?k():e.alignment===n.MessageBubbleAlignment.left?n.Placement.right:n.Placement.left,F=()=>window.innerWidth<=768,k=()=>{const e=f.current;if(e){const t=e.getBoundingClientRect(),o=t.top<window.innerHeight/2,r=t.bottom>window.innerHeight/2;return o?n.Placement.bottom:r?n.Placement.top:n.Placement.bottom}return n.Placement.bottom};return d.jsxs("div",{className:"cc-message-bubble__wrapper",ref:f,style:{display:"flex",position:"relative",maxWidth:"65%",width:"fit-content",gap:"4px"},onMouseEnter:()=>{v&&clearTimeout(v),E(!0)},onMouseLeave:()=>{v=setTimeout(()=>{E(!1)},150)},children:[(()=>{if(s&&h===n.MessageBubbleAlignment.left)return d.jsx("div",{className:"cc-message-bubble__avatar",style:{position:"relative",borderRadius:"inherit",display:"flex",width:"fit-content",alignSelf:"flex-start",marginTop:"5px",padding:"8px 4px"},children:s})})(),d.jsxs("div",{className:"cc-message-bubble",style:j(h,n.MessageBubbleAlignment),children:[(()=>{if(p&&p.length>0&&D)return d.jsx("div",{className:"cc-message-options",style:G(h,n.MessageBubbleAlignment,i,w),children:d.jsx(Y,{moreIconURL:A,topMenuSize:x,ContextMenuStyle:H(w),data:p,moreIconHoverText:"",onOptionClicked:I,placement:S(),parentClassName:"cc-message-list__wrapper"})})})(),(()=>{if(i)return d.jsx("div",{className:"cc-message-bubble__header",style:V(h,n.MessageBubbleAlignment),children:i})})(),d.jsxs("div",{className:"cc-message-bubble__content",style:{height:m.height,width:m.width},children:[d.jsxs("div",{style:{...m,...y},children:[a||null,l||null,u||null]}),c||null,g||null,C||null]})]})]})};class Z{messageBubbleStyle(e,t,o,r){return e.getDeletedAt()?{background:"transparent",border:`1px dashed ${t.palette.getAccent400()}`,borderRadius:"12px"}:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.text||e.getSender()&&r?.getUid()!==e.getSender().getUid()?e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.audio?e.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember?{background:"transparent",borderRadius:"12px",border:`1px solid ${t.palette.getAccent100()}`}:(e.getSender()&&(e.getSender().getUid(),r?.getUid()),{background:t.palette.getAccent100(),borderRadius:"12px"}):{borderRadius:"",background:t.palette.getAccent100()}:{background:o===n.MessageBubbleAlignment.left?t.palette.getAccent100():t.palette.getPrimary(),borderRadius:"12px"}}getContentView(e,t){let o;const r={};return r[`${t.category}_${t.type}`]=t,r[`${e?.getCategory()}_${e?.getType()}`]&&r[`${e?.getCategory()}_${e?.getType()}`]?.contentView?(o=r[`${e?.getCategory()}_${e?.getType()}`]?.contentView(e,n.MessageBubbleAlignment.right),"string"==typeof o?{html:o}:o):null}getBubbleWrapper(e,t){let n;const o={};return o[`${t.category}_${t.type}`]=t,o&&o[`${e?.getCategory()}_${e?.getType()}`]&&o[`${e?.getCategory()}_${e?.getType()}`].bubbleView?(n=o[`${e?.getCategory()}_${e?.getType()}`].bubbleView(e),n):(n=null,n)}getMessageBubble(e,t,n,o){return this.getBubbleWrapper(e,t)?this.getBubbleWrapper(e,t):d.jsx(W,{bottomView:null,headerView:null,options:[],footerView:null,leadingView:null,statusInfoView:null,contentView:this.getContentView(e,t),replyView:null,threadView:null,alignment:o,messageBubbleStyle:n,id:e?.getId()||e?.getMuid()})}getUserStatusVisible(e){let t=!1;return e&&e instanceof(s.CometChat.User||s.CometChat.GroupMember)&&(e.getBlockedByMe()||e.getHasBlockedMe()||e.getStatus()===n.CometChatUIKitConstants.userStatusType.offline)&&(t=!0),t}}function X(e,t){let o=e;const{type:r}=t;switch(r){case"setSearchText":o={...e,searchText:t.searchText};break;case"appendUsers":let r=[];t.removeOldUsers?(e.disableLoadingState||(e.userList=[]),r=t.users,e.disableLoadingState||(o={...e,userList:r})):t.usersManager&&[0].includes(t.usersManager?.getCurrentPage())&&!t.users.length?!t.users.length&&t.onEmpty&&(setTimeout(()=>{t.onEmpty()}),o={...e,fetchState:n.States.empty}):0!==t.users.length&&(o={...e,userList:1==t.usersManager?.getCurrentPage()?[...t.users]:[...e.userList,...t.users]});break;case"setUserList":o={...e,userList:t.userList};break;case"setFetchState":o={...e,fetchState:t.fetchState};break;case"updateUser":{const{userList:n}=e,{user:r}=t,s=r.getUid(),i=n.findIndex(e=>e.getUid()===s);i>-1&&(o={...e,userList:n.map((e,t)=>t===i?r:e)});break}case"setIsFirstReload":o={...e,isFirstReload:t.isFirstReload}}return o}function q(e){const{title:o=n.localize("USERS"),tileAlignment:r=n.TitleAlignment.left,hideSearch:i=!1,searchIconURL:a=P,searchPlaceholderText:l=n.localize("SEARCH"),listItemView:c=null,showSectionHeader:C=!0,sectionHeaderKey:m="getName",loadingStateView:A,loadingIconURL:y=O,hideError:w=!1,errorStateView:f,errorStateText:D=n.localize("SOMETHING_WRONG"),emptyStateView:E,emptyStateText:v=n.localize("NO_USERS_FOUND"),subtitleView:I=null,disableUsersPresence:S=!1,menus:F=null,options:T=null,hideSeparator:j=!1,selectionMode:V=n.SelectionMode.none,onSelect:G,usersRequestBuilder:H=null,searchRequestBuilder:Q=null,onItemClick:N,onError:K,statusIndicatorStyle:z=null,avatarStyle:J=null,usersStyle:Y=null,listItemStyle:_=null,activeUser:W=null,searchKeyword:q="",onEmpty:$,fetchingUsers:ee=!1,fetchTimeOut:te,userPresencePlacement:ne=n.UserPresencePlacement.bottom,disableLoadingState:oe=!1}=e,[re,se]=t.useReducer(X,{searchText:"",userList:[],fetchState:n.States.loading,isFirstReload:!1,fetchingUsers:ee,fetchTimeOut:te,disableLoadingState:oe}),ie=x(K),ae=t.useRef(null),le=t.useRef(""),{theme:ce}=t.useContext(U),Ce=t.useRef(!1),de=t.useRef(!1),ge=t.useRef("");let ue=t.useRef(!0);const pe=t.useRef({}),[he,me]=t.useState(null);re.searchText&&re.searchText!==ge.current&&(ge.current=re.searchText),re.isFirstReload&&(Ce.current=!0,re.isFirstReload=!1);const Ae=t.useCallback(async e=>{const t=ae.current;if(!t)return;let o=de.current||oe&&!ue?n.States.loaded:n.States.loading;se({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(e!==le.current)return;let r=!!de.current;se({type:"appendUsers",users:o,removeOldUsers:r,usersManager:t,onEmpty:$}),Ce.current&&(R.attachConnestionListener(()=>{const e=null===H?(new s.CometChat.UsersRequestBuilder).setLimit(30):H;ae.current=new R({searchText:ge.current,usersRequestBuilder:e,searchRequestBuilder:Q,usersSearchText:ge}),de.current=!0}),Ce.current=!1),de.current?de.current=!1:se({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===le.current&&re.userList?.length<=0&&se({type:"setFetchState",fetchState:n.States.error}),ie(t)}ue.current=!1},[ie,se]),xe=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(ge.current="",se({type:"setSearchText",searchText:e}))},[se]),be=t.useCallback(e=>{se({type:"updateUser",user:e})},[se]);const ye=e=>e.getUid()===he||!!pe.current[e.getUid()],we=(e,t)=>{let o=t?.detail?.checked;V===n.SelectionMode.single&&me(e.getUid()),G&&G(e,o),o?pe.current[e.getUid()]=e:delete pe.current[e.getUid()]};function fe(e){if(V!==n.SelectionMode.single&&V!==n.SelectionMode.multiple)return null;let t;return t=V===n.SelectionMode.single?d.jsx(L,{onChange:t=>we(e,t),checked:ye(e)}):d.jsx(b,{onChange:t=>we(e,t),checked:ye(e),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ce.palette.getPrimary(),uncheckedBackgroundColor:ce.palette.getAccent400()}}),d.jsx("div",{style:{paddingRight:"8px"},children:t})}function De(e){let t;return(t=T?.(e))?.length?d.jsx(B,{data:t,onOptionClick:e=>e.detail.data.onClick?.()}):null}function Ee(e){let t=(new Z).getUserStatusVisible(e);return S||t?null:Y?.onlineStatusColor||ce.palette.getSuccess()||null}const ve=e=>{let t=(new Z).getUserStatusVisible(e);return S||t||S||t?null:function(e){return{...null!==e?e:{},border:e?.border||"none",borderRadius:e?.borderRadius||"24px",height:e?.height||"12px",width:e?.width||"12px"}}(z)};return function(e){const{usersManagerRef:o,fetchNextAndAppendUsers:r,searchText:s,usersRequestBuilder:i,searchRequestBuilder:a,dispatch:l,updateUser:c,fetchNextIdRef:C,searchKeyword:d,disableLoadingState:g,usersSearchText:u}=e;t.useEffect(()=>(i?.searchKeyword?u.current=i?.searchKeyword:a?.searchKeyword&&(u.current=a?.searchKeyword),()=>{i?.setSearchKeyword("")}),[]),t.useEffect(()=>{l({type:"setIsFirstReload",isFirstReload:!0}),o.current=new R({searchText:s,usersRequestBuilder:i,searchRequestBuilder:a,usersSearchText:u}),g||l({type:"setUserList",userList:[]}),r(C.current="initialFetch_"+String(Date.now()))},[s,i,a,r,l,C,o]),t.useEffect(()=>R.atttachListeners(c),[c]),t.useEffect(()=>{const e=n.CometChatUserEvents.ccUserBlocked.subscribe(c),t=n.CometChatUserEvents.ccUserUnblocked.subscribe(c);return()=>{e.unsubscribe(),t.unsubscribe()}},[c]),t.useEffect(()=>{l({type:"setSearchText",searchText:d})},[d,l])}({usersManagerRef:ae,fetchNextAndAppendUsers:Ae,searchText:re.searchText,usersRequestBuilder:H,searchRequestBuilder:Q,dispatch:se,updateUser:be,fetchNextIdRef:le,searchKeyword:q,disableLoadingState:oe,usersSearchText:ge}),d.jsxs("div",{className:"cc-users",style:u(Y,ce),children:[F?d.jsx("div",{className:"cc-users__menus",style:{position:"absolute",top:"12px",right:"12px"},children:F}):null,d.jsx(k,{title:o,titleAlignment:r,hideSearch:re.fetchState===n.States.error||i,searchIconURL:a,searchPlaceholderText:l,searchText:re.searchText,onSearch:xe,list:re.userList,listItem:c||function(e){return d.jsx(M,{id:e.getUid(),avatarURL:e.getAvatar(),avatarName:e.getName(),title:e.getName(),isActive:V===n.SelectionMode.none&&e.getUid()===W?.getUid(),hideSeparator:j,statusIndicatorColor:Ee(e),statusIndicatorStyle:ve(e),avatarStyle:h(J,ce),listItemStyle:p(_,Y,ce),subtitleView:I?.(e),subtitleViewClassName:"cc-users__subtitle-view",tailView:fe(e),tailViewClassName:"cc-users__tail-view",menuView:De(e),menuViewClassName:"cc-users__options-view",onClick:t=>N?.(e),userPresencePlacement:ne})},onScrolledToBottom:()=>Ae(le.current="onScrolledToBottom_"+String(Date.now())),showSectionHeader:C,sectionHeaderKey:m,listItemKey:"getUid",state:re.fetchState!==n.States.loaded||0!==re.userList.length||$?re.fetchState:n.States.empty,loadingView:A,loadingIconURL:y,hideError:w,errorStateView:f,errorStateText:D,emptyStateView:E,emptyStateText:v,listStyle:g(Y,ce)})]})}function $(e,t){return{position:"relative",overflowX:"hidden",width:e?.width||"100%",height:e?.height||"100%",boxSizing:"border-box",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),padding:e?.padding||"0",boxShadow:e?.boxShadow||"0"}}function ee(e,t){return new r.ListStyle({width:"100%",height:"100%",border:"none",borderRadius:"inherit",background:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent()})}function te(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent"}}function ne(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent"}}function oe(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function re(e){return{...null!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function se(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function ie(e,t){return new o.LabelStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle1),textColor:e?.textColor||t.palette.getAccent600(),background:"inherit"})}function ae(e,t){return new o.MenuListStyle({border:"none",borderRadius:"8px",background:"transparent",moreIconTint:t.palette.getPrimary(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${t.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e?.background||t.palette.getBackground()})}function le(e,t){return new o.ChangeScopeStyle({height:e?.height||"212px",width:e?.width||"360px",border:e?.border||`1px solid ${t.palette.getAccent200()}`,borderRadius:e?.borderRadius||"12px",background:e?.background||t.palette.getBackground(),titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),activeTextFont:e?.activeTextFont||n.fontHelper(t.typography.subtitle1),activeTextColor:e?.activeTextColor||t.palette.getAccent(),activeTextBackground:e?.activeTextBackground||t.palette.getAccent200(),arrowIconTint:e?.arrowIconTint||t.palette.getAccent900(),textFont:e?.textFont||n.fontHelper(t.typography.subtitle1),textColor:e?.textColor||t.palette.getAccent600(),optionBackground:e?.optionBackground||t.palette.getBackground(),optionBorder:e?.optionBorder||"none",optionBorderRadius:e?.optionBorderRadius||"0",hoverTextFont:e?.hoverTextFont||n.fontHelper(t.typography.subtitle1),hoverTextColor:e?.hoverTextColor||t.palette.getAccent900(),hoverTextBackground:e?.hoverTextBackground||t.palette.getAccent100(),buttonTextFont:e?.buttonTextFont||n.fontHelper(t.typography.title2),buttonTextColor:e?.buttonTextColor||t.palette.getAccent("dark"),buttonBackground:e?.buttonBackground||t.palette.getPrimary(),closeIconTint:e?.closeIconTint||t.palette.getPrimary()})}var ce="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20%3F%3E%3C!DOCTYPE%20svg%20%20PUBLIC%20%5Ci-%2F%2FW3C%2F%2FDTD%20SVG%201.1%2F%2FEN%5Ci%20%20%5Cihttp%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11.dtd%5Ci%3E%3Csvg%20enable-background%3D%22new%200%200%2032%2032%22%20%20id%3D%22%D0%A1%D0%BB%D0%BE%D0%B9_1%22%20version%3D%221.1%22%20viewBox%3D%220%200%2032%2032%22%20%20xml%3Aspace%3D%22preserve%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%3Cpath%20d%3D%22M24.285%2C11.284L16%2C19.571l-8.285-8.288c-0.395-0.395-1.034-0.395-1.429%2C0%20%20c-0.394%2C0.395-0.394%2C1.035%2C0%2C1.43l8.999%2C9.002l0%2C0l0%2C0c0.394%2C0.395%2C1.034%2C0.395%2C1.428%2C0l8.999-9.002%20%20c0.394-0.395%2C0.394-1.036%2C0-1.431C25.319%2C10.889%2C24.679%2C10.889%2C24.285%2C11.284z%22%20fill%3D%22%23121313%22%20id%3D%22Expand_More%22%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3Cg%2F%3E%3C%2Fsvg%3E";class Ce{constructor(e){const{searchText:t,groupMemberRequestBuilder:n,searchRequestBuilder:o,groupGuid:r,groupMembersSearchText:i}=e;let a=n||new s.CometChat.GroupMembersRequestBuilder(r).setLimit(30);t&&o?(a=o,a.setSearchKeyword(t)):t&&!o&&n?(a=n,a.setSearchKeyword(t)):!t&&n&&o?(a=n,a.setSearchKeyword(i.current)):t||!n||o?t||n||!o?a.setSearchKeyword(t):a.setSearchKeyword(i.current):(a=n,a.setSearchKeyword(i.current)),this.groupMembersRequest=a.build()}fetchNext(){return this.groupMembersRequest.fetchNext()}getCurrentPage(){return this.groupMembersRequest.pagination.current_page}static attachUserListener(e){const t="GroupMembers_User_"+String(Date.now());return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e})),()=>s.CometChat.removeUserListener(t)}static createParticipantGroupMember(e,t){const o=new s.CometChat.GroupMember(e.getUid(),n.CometChatUIKitConstants.groupMemberScope.participant);return o.setName(e.getName()),o.setGuid(t.getGuid()),o.setUid(e.getUid()),o}static attachGroupListener(e,t){const n="GroupMembers_Group_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(n,o,r,s,i)=>{i.getGuid()===e&&t({type:"updateGroupMemberScopeIfPresent",groupMemberUid:o.getUid(),newScope:r})},onGroupMemberKicked:(n,o,r,s)=>{s.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onGroupMemberBanned:(n,o,r,s)=>{s.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onMemberAddedToGroup:(n,o,r,s)=>{s.getGuid()===e&&t({type:"appendGroupMember",groupMember:Ce.createParticipantGroupMember(o,s)})},onGroupMemberLeft:(n,o,r)=>{r.getGuid()===e&&t({type:"removeGroupMemberIfPresent",groupMemberUid:o.getUid()})},onGroupMemberJoined:(n,o,r)=>{r.getGuid()===e&&t({type:"appendGroupMember",groupMember:Ce.createParticipantGroupMember(o,r)})}})),()=>s.CometChat.removeGroupListener(n)}}var de="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ge="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ue="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function pe(e,t){let o=e;const{type:r}=t;switch(r){case"appendGroupMembers":{const{groupMembers:r,groupMembersManager:s,onEmpty:i}=t;s&&[0].includes(s?.getCurrentPage())&&!r.length?!r.length&&i&&(setTimeout(()=>{i()}),o={...e,fetchState:n.States.empty}):0!==r.length&&(o={...e,groupMemberList:1==s?.getCurrentPage()?[...r]:[...e.groupMemberList,...r]});break}case"setSearchText":o={...e,searchText:t.searchText};break;case"setFetchState":o={...e,fetchState:t.fetchState};break;case"setGroupMemberList":o={...e,groupMemberList:t.groupMemberList};break;case"removeGroupMemberIfPresent":{const n=t.groupMemberUid,r=e.groupMemberList.findIndex(e=>e.getUid()===n);r>-1&&(o={...e,groupMemberList:e.groupMemberList.filter((e,t)=>t!==r)});break}case"setGroupMemberToChangeScopeOf":o={...e,groupMemberToChangeScopeOf:t.groupMember};break;case"replaceGroupMemberIfPresent":{const{updatedGroupMember:n}=t,r=n.getUid(),s=e.groupMemberList.findIndex(e=>e.getUid()===r);s>-1&&(o={...e,groupMemberList:e.groupMemberList.map((e,t)=>t!==s?e:n)});break}case"updateGroupMemberStatusIfPresent":{const{user:n}=t,{groupMemberList:r}=e,s=n.getUid(),i=r.findIndex(e=>e.getUid()===s);i>-1&&(o={...e,groupMemberList:r.map((e,t)=>(t===i&&e.setStatus(n.getStatus()),e))});break}case"updateGroupMemberScopeIfPresent":{const{groupMemberUid:n,newScope:r}=t,{groupMemberList:s}=e,i=s.findIndex(e=>e.getUid()===n);i>-1&&(o={...e,groupMemberList:s.map((e,t)=>(t===i&&e.setScope(r),e))});break}case"appendGroupMember":o={...e,groupMemberList:[...e.groupMemberList,t.groupMember]}}return o}function he(e){const{backButtonIconURL:o=ge,showBackButton:i=!1,onBack:a,menus:l=null,title:c=n.localize("MEMBERS"),titleAlignment:C=n.TitleAlignment.center,searchPlaceholder:g=n.localize("SEARCH"),searchIconURL:u=de,hideSearch:p=!1,groupMemberRequestBuilder:h=null,searchRequestBuilder:y=null,group:w,onError:f,emptyStateText:D=n.localize("NO_USERS_FOUND"),errorStateText:E=n.localize("SOMETHING_WRONG"),loadingIconURL:v=ue,loadingStateView:I,errorStateView:S,errorSateView:F,emptyStateView:T,hideError:R=!1,hideSeparator:P=!0,disableUsersPresence:O=!1,subtitleView:j=null,listItemView:V=null,options:G=null,dropDownIconURL:H=ce,tailView:Q=null,selectionMode:N=n.SelectionMode.none,onItemClick:K=null,onSelect:z=null,closeButtonIconURL:Y="",onClose:_,avatarStyle:W=null,statusIndicatorStyle:X=null,listItemStyle:q=null,groupScopeStyle:he=null,groupMembersStyle:me=null,searchKeyword:Ae="",onEmpty:xe,fetchTimeOut:be,userPresencePlacement:ye=n.UserPresencePlacement.bottom,disableLoadingState:we=!1}=e,[fe,De]=t.useReducer(pe,{groupMemberList:[],fetchState:n.States.loading,searchText:"",groupMemberToChangeScopeOf:null,fetchTimeOut:be,disableLoadingState:we}),Ee=t.useRef(null),ve=t.useRef(null),Ie=t.useRef(""),[Se,Fe]=A(null),ke=m(w),Te=x(f),{theme:Me}=t.useContext(U),Be=t.useRef(""),Le=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(Be.current="",De({type:"setSearchText",searchText:e}))},[De]),Ue=t.useCallback(async e=>{const t=Ee.current;if(t){we||De({type:"setFetchState",fetchState:n.States.loading});try{const o=await t.fetchNext();if(e!==Ie.current)return;De({type:"appendGroupMembers",groupMembers:o,groupMembersManager:t,onEmpty:xe}),De({type:"setFetchState",fetchState:n.States.loaded})}catch(e){De({type:"setFetchState",fetchState:n.States.error}),Te(e)}}},[De,Te]),Re=t.useCallback((e,t,o,i)=>{const a=new s.CometChat.Action(o.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return a.setAction(t),a.setActionBy(r.CometChatUIKitUtility.clone(i)),a.setSender(r.CometChatUIKitUtility.clone(i)),a.setMessage(`${i.getUid()} ${t} ${e.getUid()}`),a.setActionFor(r.CometChatUIKitUtility.clone(o)),a.setActionOn(r.CometChatUIKitUtility.clone(e)),a.setReceiver(r.CometChatUIKitUtility.clone(o)),a.setConversationId("group_"+o.getGuid()),a.setMuid(r.CometChatUIKitUtility.ID()),a.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),a.setReceiverType(n.CometChatUIKitConstants.MessageReceiverType.group),a.setRawData({extras:{scope:{new:e.getScope()}}}),a},[]),{groupMemberToChangeScopeOf:Pe}=fe,Oe=t.useCallback(async e=>{const t=ve.current;if(Pe&&t)try{const o=e,i=ke.current;await s.CometChat.updateGroupMemberScope(i.getGuid(),Pe.getUid(),o);const a=r.CometChatUIKitUtility.clone(Pe);a.setScope(o),De({type:"replaceGroupMemberIfPresent",updatedGroupMember:a}),n.CometChatGroupEvents.ccGroupMemberScopeChanged.next({scopeChangedFrom:Pe.getScope(),scopeChangedTo:a.getScope(),message:Re(a,n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE,i,t),group:r.CometChatUIKitUtility.clone(i),updatedUser:r.CometChatUIKitUtility.clone(a)})}catch(e){Te(e)}finally{De({type:"setGroupMemberToChangeScopeOf",groupMember:null})}},[Te,De,Re,Pe,ke]);function je(e,t){return e===n.CometChatUIKitConstants.GroupMemberOptions.ban?(async e=>{const t=ve.current;if(t)try{const o=ke.current;await s.CometChat.banGroupMember(o.getGuid(),e.getUid()),De({type:"removeGroupMemberIfPresent",groupMemberUid:e.getUid()});const i=r.CometChatUIKitUtility.clone(o);i.setMembersCount(i.getMembersCount()-1),n.CometChatGroupEvents.ccGroupMemberBanned.next({kickedBy:r.CometChatUIKitUtility.clone(t),kickedFrom:i,kickedUser:r.CometChatUIKitUtility.clone(e),message:Re(e,n.CometChatUIKitConstants.groupMemberAction.BANNED,i,t)})}catch(e){Te(e)}})(t):e===n.CometChatUIKitConstants.GroupMemberOptions.kick?(async e=>{const t=ve.current;if(t)try{const o=ke.current;await s.CometChat.kickGroupMember(o.getGuid(),e.getUid()),De({type:"removeGroupMemberIfPresent",groupMemberUid:e.getUid()});const i=r.CometChatUIKitUtility.clone(o);i.setMembersCount(i.getMembersCount()-1),n.CometChatGroupEvents.ccGroupMemberKicked.next({kickedBy:r.CometChatUIKitUtility.clone(t),kickedFrom:r.CometChatUIKitUtility.clone(i),kickedUser:r.CometChatUIKitUtility.clone(e),message:Re(e,n.CometChatUIKitConstants.groupMemberAction.KICKED,i,t)})}catch(e){Te(e)}})(t):e===n.CometChatUIKitConstants.GroupMemberOptions.changeScope?De({type:"setGroupMemberToChangeScopeOf",groupMember:t}):void 0}function Ve(e){let t;return null===Q&&(t=G?.(w,e))?.length?d.jsx(B,{data:t,menuListStyle:ae(me,Me),onOptionClick:t=>{const{id:n,onClick:o}=t.detail.data;o?o():"string"==typeof n&&je(n,e)}}):null}function Ge(e){return N===n.SelectionMode.single?d.jsx(L,{onChange:t=>z?.(e,t.detail.checked)}):N===n.SelectionMode.multiple?d.jsx(b,{onChange:t=>z?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:Me.palette.getPrimary(),uncheckedBackgroundColor:Me.palette.getAccent400()}}):null}function He(e,t){return"string"==typeof e?d.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(ie(me,Me))}):d.jsx(B,{topMenuSize:0,data:e,moreIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fmoreicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FMore%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.5%2C10%20C5.88071187%2C10%207%2C11.1192881%207%2C12.5%20C7%2C13.8807119%205.88071187%2C15%204.5%2C15%20C3.11928813%2C15%202%2C13.8807119%202%2C12.5%20C2%2C11.1192881%203.11928813%2C10%204.5%2C10%20Z%20M12%2C10%20C13.3807119%2C10%2014.5%2C11.1192881%2014.5%2C12.5%20C14.5%2C13.8807119%2013.3807119%2C15%2012%2C15%20C10.6192881%2C15%209.5%2C13.8807119%209.5%2C12.5%20C9.5%2C11.1192881%2010.6192881%2C10%2012%2C10%20Z%20M19.5%2C10%20C20.8807119%2C10%2022%2C11.1192881%2022%2C12.5%20C22%2C13.8807119%2020.8807119%2C15%2019.5%2C15%20C18.1192881%2C15%2017%2C13.8807119%2017%2C12.5%20C17%2C11.1192881%2018.1192881%2C10%2019.5%2C10%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",menuListStyle:ae(me,Me),onOptionClick:e=>{const{id:n}=e.detail.data;"string"==typeof n&&je(n,t)}})}function Qe(e){return null!==Q?null:d.jsx("div",{className:"cc-group-members__tail-view-content",children:He(r.GroupMemberUtils.getViewMemberOptions(e,w,ve.current?.getUid(),Me),e)})}function Ne(e){return d.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",columnGap:"8px"},children:[Q?.(e),Ge(e),Qe(e)]})}function Ke(e){let t=(new Z).getUserStatusVisible(e);return O||t?null:me?.onlineStatusColor||Me.palette.getSuccess()||null}function ze(e){return d.jsx(M,{id:e.getUid(),title:e.getName(),avatarURL:e.getAvatar(),avatarName:e.getName(),hideSeparator:P,isActive:fe.groupMemberToChangeScopeOf?.getUid()===e.getUid(),avatarStyle:oe(W,Me),statusIndicatorColor:Ke(e),statusIndicatorStyle:re(X),listItemStyle:se(q,me,Me),subtitleViewClassName:"cc-group-members__subtitle-view",subtitleView:j?.(e),tailViewClassName:"cc-group-members__tail-view",tailView:Ne(e),menuViewClassName:"cc-group-members__options-view",menuView:Ve(e),onClick:t=>K?.(e),userPresencePlacement:ye})}return function(e){const{groupMemberRequestBuilder:o,searchRequestBuilder:r,searchText:i,groupMembersManagerRef:a,groupGuid:l,fetchNextAndAppendGroupMembers:c,fetchNextIdRef:C,dispatch:d,loggedInUserRef:g,errorHandler:u,changeScopeElement:p,updateGroupMemberScope:h,searchKeyword:m,disableLoadingState:A,groupMembersSearchText:x}=e;t.useEffect(()=>(o?.searchKeyword?x.current=o?.searchKeyword:r?.searchKeyword&&(x.current=r?.searchKeyword),()=>{o?.setSearchKeyword("")}),[]),t.useEffect(()=>{(async()=>{try{g.current=await s.CometChat.getLoggedinUser()}catch(e){u(e)}})()},[u,g]),t.useEffect(()=>{a.current=new Ce({searchText:i,groupMemberRequestBuilder:o,searchRequestBuilder:r,groupGuid:l,groupMembersSearchText:x}),A||d({type:"setGroupMemberList",groupMemberList:[]}),c(C.current="initialFetchNext_"+String(Date.now()))},[o,r,i,l,c,d,C,a]),t.useEffect(()=>{if(!p)return;const e="cc-changescope-close-clicked",t="cc-changescope-changed";function n(){d({type:"setGroupMemberToChangeScopeOf",groupMember:null})}function o(e){const t=e.detail?.value;t&&h(t)}return p.addEventListener(e,n),p.addEventListener(t,o),()=>{p.removeEventListener(e,n),p.removeEventListener(t,o)}},[p,h,d]),t.useEffect(()=>Ce.attachUserListener(e=>d({type:"updateGroupMemberStatusIfPresent",user:e})),[d]),t.useEffect(()=>Ce.attachGroupListener(l,d),[l,d]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{const{kickedUser:t}=e;d({type:"removeGroupMemberIfPresent",groupMemberUid:t.getUid()})}),t=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{const{kickedUser:t}=e;d({type:"removeGroupMemberIfPresent",groupMemberUid:t.getUid()})}),o=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{const{updatedUser:t,scopeChangedTo:n}=e;d({type:"updateGroupMemberScopeIfPresent",groupMemberUid:t.getUid(),newScope:n})}),r=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{const{usersAdded:t,userAddedIn:n}=e;let o=a.current;d({type:"appendGroupMembers",groupMembersManager:o,groupMembers:t.map(e=>Ce.createParticipantGroupMember(e,n))})});return()=>{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),r.unsubscribe()}},[d]),t.useEffect(()=>{d({type:"setSearchText",searchText:m})},[m,d])}({groupMemberRequestBuilder:h,searchRequestBuilder:y,searchText:fe.searchText,groupMembersManagerRef:Ee,groupGuid:w.getGuid(),fetchNextAndAppendGroupMembers:Ue,fetchNextIdRef:Ie,dispatch:De,loggedInUserRef:ve,errorHandler:Te,changeScopeElement:Se,updateGroupMemberScope:Oe,searchKeyword:Ae,disableLoadingState:we,groupMembersSearchText:Be}),d.jsxs("div",{className:"cc-group-members",style:$(me,Me),children:[d.jsxs("div",{className:"cc-group-members__list-wrapper",style:{position:"relative",height:"100%"},children:[null===l?null:d.jsx("div",{className:"cc-group-members__menus",style:{position:"absolute",right:"12px",top:"8px",cursor:"pointer"},children:l}),d.jsx(k,{title:c,titleAlignment:C,searchPlaceholderText:g,searchIconURL:u,searchText:fe.searchText,onSearch:Le,hideSearch:p,list:fe.groupMemberList,listItemKey:"getUid",listItem:null!==V?V:ze,showSectionHeader:!1,onScrolledToBottom:()=>Ue(Ie.current="onScrolledToBottom_"+String(Date.now())),state:fe.fetchState===n.States.loaded&&0===fe.groupMemberList.length?n.States.empty:fe.fetchState,loadingIconURL:v,emptyStateText:D,errorStateText:E,loadingView:I,emptyStateView:T,errorStateView:S||F,hideError:R,listStyle:ee(me,Me)})]}),i?d.jsx("div",{className:"cc-group-members__back-btns-wrapper",style:{position:"absolute",left:"16px",top:"19px",width:"fit-content",height:"fit-content"},children:d.jsx(J,{iconURL:o,buttonStyle:te(me,Me),onClick:a})}):null,Y?d.jsx("div",{className:"cc-group-members__close-btns-wrapper",style:{position:"absolute",right:"16px",top:"19px",width:"fit-content",height:"fit-content"},children:d.jsx(J,{iconURL:Y,buttonStyle:ne(me,Me),onClick:_})}):null,function(){let e;const{groupMemberToChangeScopeOf:t}=fe;return null!==t&&(e=r.GroupMemberUtils.allowScopeChange(w,t)).length>0?d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify((n=me,{height:n?.height,width:n?.width,position:"absolute"})),children:d.jsx("cometchat-change-scope",{ref:Fe,options:JSON.stringify(e),arrowIconURL:H,changeScopeStyle:JSON.stringify(le(he,Me))})}):null;var n}()]})}function me(e){const{userMemberListType:o=n.UserMemberListType.users,onItemClick:r,listItemView:s,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,group:c,subtitleView:C,usersRequestBuilder:g,userPresencePlacement:u=n.UserPresencePlacement.bottom,loadingStateView:p,onEmpty:h,groupMemberRequestBuilder:m,loadingIconUrl:A,disableLoadingState:x=!1,hideSeparator:b=!1,onError:y,disableUsersPresence:w}=e,{theme:f}=t.useContext(U);return d.jsxs(d.Fragment,{children:[o===n.UserMemberListType.users&&d.jsx(q,{title:"",hideSearch:!0,hideSeparator:b,showSectionHeader:!1,onItemClick:r,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,listItemView:s,usersRequestBuilder:g,subtitleView:C,closeButtonIconURL:"",loadingStateView:p,onEmpty:h,loadingIconURL:A,userPresencePlacement:u,disableLoadingState:x,disableUsersPresence:w,onError:y,usersStyle:{border:"1px solid "+f.palette.getAccent300(),background:f.palette.getBackground(),minHeight:"45px",borderRadius:"12px 12px 12px 12px"}}),o===n.UserMemberListType.groupmembers&&c&&d.jsx(he,{group:c,title:"",hideSearch:!0,showBackButton:!1,hideSeparator:b,groupMemberRequestBuilder:m,onItemClick:r,avatarStyle:i,statusIndicatorStyle:a,searchKeyword:l,listItemView:s,subtitleView:C,closeButtonIconURL:"",userPresencePlacement:u,onEmpty:h,loadingIconURL:A,tailView:e=>d.jsx(d.Fragment,{}),disableLoadingState:x,disableUsersPresence:w,onError:y,groupMembersStyle:{border:"1px solid "+f.palette.getAccent300(),padding:"0px",background:f.palette.getBackground(),borderRadius:"12px 12px 12px 12px"}})]})}
11
11
  /**
12
12
  * @license
13
13
  * Copyright 2018 Google LLC
14
14
  * SPDX-License-Identifier: BSD-3-Clause
15
15
  */
16
- const Ae=new Set(["children","localName","ref","style","className"]),xe=new WeakMap,be=(e,t,n,o,r)=>{const s=null==r?void 0:r[t];void 0===s||n===o?null==n&&t in HTMLElement.prototype?e.removeAttribute(t):e[t]=n:((e,t,n)=>{let o=xe.get(e);void 0===o&&xe.set(e,o=new Map);let r=o.get(t);void 0!==n?void 0===r?(o.set(t,r={handleEvent:n}),e.addEventListener(t,r)):r.handleEvent=n:void 0!==r&&(o.delete(t),e.removeEventListener(t,r))})(e,s,n)};function ye(e=window.React,t,n,o,r){let s,i,a;if(void 0===t){const t=e;({tagName:i,elementClass:a,events:o,displayName:r}=t),s=t.react}else s=e,a=n,i=t;const l=s.Component,c=s.createElement,C=new Set(Object.keys(null!=o?o:{}));class g extends l{constructor(){super(...arguments),this.o=null}t(e){if(null!==this.o)for(const t in this.i)be(this.o,t,this.props[t],e?e[t]:void 0,o)}componentDidMount(){var e;this.t(),null===(e=this.o)||void 0===e||e.removeAttribute("defer-hydration")}componentDidUpdate(e){this.t(e)}render(){const{_$Gl:e,...t}=this.props;this.h!==e&&(this.u=t=>{null!==e&&((e,t)=>{"function"==typeof e?e(t):e.current=t})(e,t),this.o=t,this.h=e}),this.i={};const n={ref:this.u};for(const[e,o]of Object.entries(t))Ae.has(e)?n["className"===e?"class":e]=o:C.has(e)||e in a.prototype?this.i[e]=o:n[e]=o;return n.suppressHydrationWarning=!0,c(i,n)}}g.displayName=null!=r?r:a.name;const d=s.forwardRef((e,t)=>c(g,{...e,_$Gl:t},null==e?void 0:e.children));return d.displayName=g.displayName,d}const we=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t}),fe=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t,events:{ccImageClicked:"cc-image-clicked"}}),De=ye({tagName:"cometchat-audio-bubble",elementClass:o.CometChatAudioBubble,react:t}),Ee=ye({tagName:"cometchat-video-bubble",elementClass:o.CometChatVideoBubble,react:t}),ve=ye({tagName:"cometchat-file-bubble",elementClass:o.CometChatFileBubble,react:t}),Se=ye({tagName:"cometchat-form-bubble",elementClass:r.CometChatFormBubble,react:t,events:{ccSubmitClicked:"cc-submit-clicked"}}),Ie=ye({tagName:"cometchat-scheduler-bubble",elementClass:r.CometChatSchedulerBubble,react:t}),Fe=ye({tagName:"cometchat-card-bubble",elementClass:r.CometChatCardBubble,react:t}),ke=ye({tagName:"cometchat-full-screen-viewer",elementClass:o.CometChatFullScreenViewer,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),Te=new n.CometChatTheme({});class Me{constructor(){this.getSchedulerBubbleStyle=e=>{let t=new o.AvatarStyle({borderRadius:"50%",width:"48px",height:"48px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),s=new o.ListItemStyle({height:"auto",width:"100%",background:"inherit",activeBackground:"transparent",borderRadius:"0",titleFont:n.fontHelper(e.typography.text1),titleColor:e.palette.getAccent(),border:"none",separatorColor:"",hoverBackground:"transparent"}),i=new r.CalendarStyle({height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",dateTextFont:n.fontHelper(e.typography.subtitle2),dateTextColor:e.palette.getAccent(),dayTextFont:n.fontHelper(e.typography.text2),dayTextColor:e.palette.getAccent(),monthYearTextFont:n.fontHelper(e.typography.text2),monthYearTextColor:e.palette.getAccent(),defaultDateTextBackground:"transparent",disabledDateTextColor:e.palette.getAccent400(),disabledDateTextFont:n.fontHelper(e.typography.subtitle2),disabledDateTextBackground:"transparent",titleTextFont:n.fontHelper(e.typography.text1),titleTextColor:e.palette.getAccent(),timezoneTextFont:n.fontHelper(e.typography.caption2),timezoneTextColor:e.palette.getAccent(),arrowButtonTextColor:e.palette.getAccent(),arrowButtonTextFont:n.fontHelper(e.typography.title2)}),a=new r.TimeSlotStyle({background:"transparent",height:"fit-content",width:"100%",border:"none",borderRadius:"0",calendarIconTint:e.palette.getAccent(),timezoneIconTint:e.palette.getAccent(),emptySlotIconTint:e.palette.getAccent500(),emptySlotTextColor:e.palette.getAccent500(),emptySlotTextFont:n.fontHelper(e.typography.subtitle1),dateTextColor:e.palette.getAccent(),dateTextFont:n.fontHelper(e.typography.subtitle1),seperatorTint:e.palette.getAccent100(),slotBackground:e.palette.getAccent900(),slotBorder:"none",slotBorderRadius:"8px",slotTextColor:e.palette.getAccent(),slotTextFont:n.fontHelper(e.typography.caption2),timezoneTextColor:e.palette.getAccent(),timezoneTextFont:n.fontHelper(e.typography.caption2),titleTextColor:e.palette.getAccent(),titleTextFont:n.fontHelper(e.typography.text1)}),l=new o.QuickViewStyle({background:e.palette.getAccent50(),height:"fit-content",width:"100%",titleFont:n.fontHelper(e.typography.subtitle2),titleColor:e.palette.getAccent(),subtitleFont:n.fontHelper(e.typography.subtitle2),subtitleColor:e.palette.getAccent600(),leadingBarTint:e.palette.getPrimary(),leadingBarWidth:"4px",borderRadius:"8px"});return new r.SchedulerBubbleStyle({avatarStyle:t,listItemStyle:s,quickViewStyle:l,dateSelectorStyle:i,timeSlotSelectorStyle:a,backButtonIconTint:e.palette.getPrimary(),background:"transparent",height:"100%",width:"100%",border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"8px",loadingIconTint:e.palette.getAccent600(),suggestedTimeBackground:e.palette.getAccent900(),suggestedTimeBorder:`1px solid ${e.palette.getPrimary()}`,suggestedTimeBorderRadius:"8px",suggestedTimeDisabledBackground:e.palette.getAccent50(),suggestedTimeDisabledBorder:`1px solid ${e.palette.getAccent200()}`,suggestedTimeDisabledBorderRadius:"8px",suggestedTimeDisabledTextColor:e.palette.getAccent700(),suggestedTimeDisabledTextFont:n.fontHelper(e.typography.text3),suggestedTimeTextColor:e.palette.getPrimary(),suggestedTimeTextFont:n.fontHelper(e.typography.text3),moreButtonDisabledTextBackground:"transparent",moreButtonDisabledTextBorder:"none",moreButtonDisabledTextBorderRadius:"0",moreButtonDisabledTextColor:e.palette.getAccent600(),moreButtonDisabledTextFont:n.fontHelper(e.typography.caption2),moreButtonTextBackground:"transparent",moreButtonTextBorder:"none",moreButtonTextBorderRadius:"0",moreButtonTextColor:e.palette.getPrimary(),moreButtonTextFont:n.fontHelper(e.typography.caption2),goalCompletionTextColor:e.palette.getAccent(),goalCompletionTextFont:n.fontHelper(e.typography.text3),errorTextColor:e.palette.getError(),errorTextFont:n.fontHelper(e.typography.text3),scheduleButtonStyle:{iconHeight:"16px",iconWidth:"16px",buttonIconTint:e.palette.getAccent(),buttonTextFont:n.fontHelper(e.typography.name),buttonTextColor:e.palette.getAccent("dark"),border:"none",borderRadius:"8px",background:e.palette.getPrimary(),width:"100%",display:"flex",justifyContent:"center",padding:"8px"},seperatorTint:e.palette.getAccent200(),subtitleTextColor:e.palette.getAccent400(),subtitleTextFont:n.fontHelper(e.typography.name),summaryTextColor:e.palette.getAccent(),summaryTextFont:n.fontHelper(e.typography.subtitle1),timezoneTextColor:e.palette.getAccent600(),timezoneTextFont:n.fontHelper(e.typography.caption2),titleTextColor:e.palette.getAccent(),titleTextFont:n.fontHelper(e.typography.title1),timezoneIconTint:e.palette.getAccent(),calendarIconTint:e.palette.getAccent(),clockIconTint:e.palette.getAccent()})}}getEditOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.editMessage,title:n.localize("EDIT"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fediticon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FEdit%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.8666667%2C0.883555287%20C17.2934403%2C0.312679329%2016.5158214%2C-0.00540815756%2015.7068357%2C0%20C14.8978501%2C0.00554734575%2014.1246099%2C0.334135909%2013.5591667%2C0.912721954%20L1.47583333%2C12.9960553%20L0%2C18.750222%20L5.75416667%2C17.2743886%20L17.8375%2C5.19105529%20C18.416086%2C4.6256121%2018.7446746%2C3.8523719%2018.750222%2C3.04338623%20C18.7556301%2C2.23440057%2018.4375426%2C1.45678164%2017.8666667%2C0.883555287%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2213.2133333%22%20y1%3D%221.25855529%22%20x2%3D%2217.4916667%22%20y2%3D%225.53688862%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211.4683333%22%20y1%3D%223.00355529%22%20x2%3D%2215.7466667%22%20y2%3D%227.28188862%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%221.47583333%22%20y1%3D%2212.9960553%22%20x2%3D%225.75833333%22%20y2%3D%2217.270222%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getDeleteOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.deleteMessage,title:n.localize("DELETE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fdeleteicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDelete%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%223.6363627%22%20x2%3D%2220%22%20y2%3D%223.6363627%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0454545%2C0%20L7.95454545%2C0%20C7.20142989%2C0%206.59090909%2C0.610520639%206.59090909%2C1.36363601%20L6.59090909%2C3.6363627%20L13.4090909%2C3.6363627%20L13.4090909%2C1.36363601%20C13.4090909%2C0.610520639%2012.7985701%2C0%2012.0454545%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%227.95454545%22%20y1%3D%2215.2272688%22%20x2%3D%227.95454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212.0454545%22%20y1%3D%2215.2272688%22%20x2%3D%2212.0454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.2363636%2C18.7454497%20C16.1838968%2C19.4542339%2015.5925391%2C20.0019341%2014.8818182%2C20%20L5.11818182%2C20%20C4.40746088%2C20.0019341%203.81610324%2C19.4542339%203.76363636%2C18.7454497%20L2.5%2C3.6363627%20L17.5%2C3.6363627%20L16.2363636%2C18.7454497%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getReactionOption(e){return new n.CometChatActionsView({id:n.CometChatUIKitConstants.MessageOption.reactToMessage,title:n.localize("REACT"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FReactions%20Add%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FReactions-Add%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C1.25%20C13.2547515%2C1.25%2014.4810955%2C1.46534515%2015.6383943%2C1.88154366%20C16.0281686%2C2.02171794%2016.2305095%2C2.45132619%2016.0903352%2C2.84110054%20C15.9501609%2C3.2308749%2015.5205527%2C3.43321574%2015.1307783%2C3.29304146%20C14.1357379%2C2.9351958%2013.0810879%2C2.75%2012%2C2.75%20C6.89136606%2C2.75%202.75%2C6.89136606%202.75%2C12%20C2.75%2C17.1086339%206.89136606%2C21.25%2012%2C21.25%20C17.1086339%2C21.25%2021.25%2C17.1086339%2021.25%2C12%20C21.25%2C11.2729266%2021.1662576%2C10.5573695%2021.0020875%2C9.8629795%20C20.906785%2C9.45987863%2021.1563049%2C9.05584287%2021.5594058%2C8.96054036%20C21.9625066%2C8.86523784%2022.3665424%2C9.11475771%2022.4618449%2C9.51785857%20C22.6527043%2C10.3251362%2022.75%2C11.1565032%2022.75%2C12%20C22.75%2C17.9370611%2017.9370611%2C22.75%2012%2C22.75%20C6.06293894%2C22.75%201.25%2C17.9370611%201.25%2C12%20C1.25%2C6.06293894%206.06293894%2C1.25%2012%2C1.25%20Z%20M17.6586667%2C13.25%20C18.1185754%2C13.25%2018.5498402%2C13.4733153%2018.8153335%2C13.8488361%20C19.0808092%2C14.2243322%2019.1475058%2C14.7053253%2018.9944111%2C15.1383417%20C17.9483179%2C18.1044405%2015.1451634%2C20.0881971%2012%2C20.0881971%20C8.85483662%2C20.0881971%206.05168206%2C18.1044405%205.00578211%2C15.1388889%20C4.85249421%2C14.7053253%204.91919084%2C14.2243322%205.18466653%2C13.8488361%20C5.45015977%2C13.4733153%205.88142461%2C13.25%206.34133333%2C13.25%20L6.34133333%2C13.25%20Z%20M17.558%2C14.695%20L17.538%2C14.749%20L6.461%2C14.749%20L6.50827179%2C14.8734156%20C7.3732069%2C17.0322917%209.42640021%2C18.4853104%2011.750045%2C18.5829516%20L11.750045%2C18.5829516%20L12%2C18.5881971%20C14.5090629%2C18.5881971%2016.7452873%2C17.0056497%2017.5800043%2C14.6388889%20L17.558%2C14.695%20Z%20M8.11422222%2C8.58288148%20C9.2798673%2C8.58288148%2010.3188817%2C9.31776232%2010.7071667%2C10.4168361%20C10.8451443%2C10.8073935%2010.6403879%2C11.2358557%2010.2498306%2C11.3738333%20C9.89181964%2C11.5003128%209.50195808%2C11.3388005%209.33318946%2C11.0101749%20L9.29283333%2C10.9164972%20C9.11634015%2C10.4169182%208.6440609%2C10.0828815%208.11422222%2C10.0828815%20C7.62853677%2C10.0828815%207.19121722%2C10.3635651%206.98575875%2C10.7951488%20L6.93561111%2C10.9164972%20C6.79763351%2C11.3070546%206.36917126%2C11.5118109%205.97861389%2C11.3738333%20C5.58805653%2C11.2358557%205.38330017%2C10.8073935%205.52127778%2C10.4168361%20C5.90956279%2C9.31776232%206.94857714%2C8.58288148%208.11422222%2C8.58288148%20Z%20M15.8857778%2C8.58288148%20C17.0514229%2C8.58288148%2018.0904372%2C9.31776232%2018.4787222%2C10.4168361%20C18.6166998%2C10.8073935%2018.4119435%2C11.2358557%2018.0213861%2C11.3738333%20C17.6633752%2C11.5003128%2017.2735136%2C11.3388005%2017.104745%2C11.0101749%20L17.0643889%2C10.9164972%20C16.8878957%2C10.4169182%2016.4156165%2C10.0828815%2015.8857778%2C10.0828815%20C15.4000923%2C10.0828815%2014.9627728%2C10.3635651%2014.7573143%2C10.7951488%20L14.7071667%2C10.9164972%20C14.5691891%2C11.3070546%2014.1407268%2C11.5118109%2013.7501694%2C11.3738333%20C13.3596121%2C11.2358557%2013.1548557%2C10.8073935%2013.2928333%2C10.4168361%20C13.6811183%2C9.31776232%2014.7201327%2C8.58288148%2015.8857778%2C8.58288148%20Z%20M19.5%2C0.25%20C19.8796958%2C0.25%2020.193491%2C0.532153882%2020.2431534%2C0.898229443%20L20.25%2C1%20L20.25%2C4.25%20L23%2C4.25%20C23.4142136%2C4.25%2023.75%2C4.58578644%2023.75%2C5%20C23.75%2C5.37969577%2023.4678461%2C5.69349096%2023.1017706%2C5.74315338%20L23%2C5.75%20L20.25%2C5.75%20L20.25%2C9%20C20.25%2C9.41421356%2019.9142136%2C9.75%2019.5%2C9.75%20C19.1203042%2C9.75%2018.806509%2C9.46784612%2018.7568466%2C9.10177056%20L18.75%2C9%20L18.75%2C5.75%20L16%2C5.75%20C15.5857864%2C5.75%2015.25%2C5.41421356%2015.25%2C5%20C15.25%2C4.62030423%2015.5321539%2C4.30650904%2015.8982294%2C4.25684662%20L16%2C4.25%20L18.75%2C4.25%20L18.75%2C1%20C18.75%2C0.585786438%2019.0857864%2C0.25%2019.5%2C0.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",customView:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getReplyInThreadOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.replyInThread,title:n.localize("REPLY"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fthreadicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FThread%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.6578236%2C0%20C7.2733682%2C-0.00487001799%204.15271669%2C1.82840041%202.50707282%2C4.78828665%20C0.861428952%2C7.74817289%200.949909343%2C11.3686229%202.73817252%2C14.2444485%20L0%2C20%20L5.74989584%2C17.2595575%20C9.11259725%2C19.3520226%2013.4289699%2C19.0910325%2016.5155083%2C16.6086132%20C19.6020468%2C14.1261939%2020.7857069%2C9.9636565%2019.4677154%2C6.22668649%20C18.1497239%2C2.48971647%2014.6174794%2C-0.00681020874%2010.6578236%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226.65936346%22%20y1%3D%226.66667597%22%20x2%3D%2214.6527312%22%20y2%3D%226.66667597%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%225.3271355%22%20y1%3D%229.33334078%22%20x2%3D%2215.9849591%22%20y2%3D%229.33334078%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226.65936346%22%20y1%3D%2212.0000056%22%20x2%3D%2214.6527312%22%20y2%3D%2212.0000056%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getSendMessagePrivatelyOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.sendMessagePrivately,title:n.localize("MESSAGE_PRIVATELY"),iconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8%2015.0099H21V21H13.8V15.0099Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M17.4%2011.4158C16.7635%2011.4158%2016.153%2011.6682%2015.7029%2012.1176C15.2529%2012.5669%2015%2013.1764%2015%2013.8118V15.0099H19.8V13.8118C19.8%2013.1764%2019.5471%2012.5669%2019.0971%2012.1176C18.647%2011.6682%2018.0365%2011.4158%2017.4%2011.4158Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M17.3995%2017.7286C17.3402%2017.7286%2017.2823%2017.7461%2017.2331%2017.7791C17.1838%2017.812%2017.1454%2017.8587%2017.1228%2017.9135C17.1001%2017.9682%2017.0942%2018.0284%2017.1057%2018.0865C17.1173%2018.1446%2017.1458%2018.198%2017.1877%2018.2399C17.2296%2018.2818%2017.283%2018.3103%2017.3411%2018.3218C17.3992%2018.3334%2017.4594%2018.3275%2017.5141%2018.3048C17.5688%2018.2821%2017.6156%2018.2437%2017.6485%2018.1945C17.6814%2018.1452%2017.699%2018.0873%2017.699%2018.0281C17.699%2017.9486%2017.6674%2017.8725%2017.6113%2017.8163C17.5551%2017.7601%2017.4789%2017.7286%2017.3995%2017.7286%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%2010.8503C20.9168%209.57663%2020.5439%208.33868%2019.9096%207.23051C19.2753%206.12235%2018.3962%205.17314%2017.3393%204.45503C16.2824%203.73692%2015.0754%203.26882%2013.8101%203.0863C12.5448%202.90378%2011.2545%203.01164%2010.0372%203.4017C8.81989%203.79176%207.70769%204.45374%206.78512%205.33732C5.86254%206.22091%205.15388%207.30285%204.71298%208.5009C4.27209%209.69895%204.11057%2010.9816%204.24071%2012.2513C4.37084%2013.521%204.78921%2014.7444%205.464%2015.8285L3%2021L8.1768%2018.5368C9.14753%2019.1412%2010.2319%2019.5408%2011.3632%2019.7109%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getCopyOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.copyMessage,title:n.localize("COPY"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCopy%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCopy%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%284.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.6%2C6.00000118%20L15.6%2C3.60000142%20C15.6%2C2.93725978%2015.0627417%2C2.40000154%2014.4%2C2.40000154%20L11.2%2C2.40000154%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.4%2C2.40000154%20L1.2%2C2.40000154%20C0.5372583%2C2.40000154%200%2C2.93725978%200%2C3.60000142%20L0%2C16.8000001%20C0%2C17.4627418%200.5372583%2C18%201.2%2C18%20L6%2C18%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.9368%2C3.18960146%20C10.8549236%2C3.43464248%2010.625558%2C3.59990166%2010.3672%2C3.60000142%20L5.2328%2C3.60000142%20C4.97444201%2C3.59990166%204.74507642%2C3.43464248%204.6632%2C3.18960146%20L3.8632%2C0.789601696%20C3.80186075%2C0.606570139%203.8324564%2C0.405197059%203.94539051%2C0.248643741%20C4.05832463%2C0.0920904237%204.23976415%2C-0.000467229348%204.4328%2C0%20L11.1672%2C0%20C11.3602359%2C-0.000467229348%2011.5416754%2C0.0920904237%2011.6546095%2C0.248643741%20C11.7675436%2C0.405197059%2011.7981392%2C0.606570139%2011.7368%2C0.789601696%20L10.9368%2C3.18960146%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolygon%20id%3D%22Path%22%20points%3D%228.4%208.40000095%2018%208.40000095%2018%2018%208.4%2018%22%3E%3C%2Fpolygon%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2210.8000007%22%20x2%3D%2215.6%22%20y2%3D%2210.8000007%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2213.2000005%22%20x2%3D%2215.6%22%20y2%3D%2213.2000005%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2215.6000002%22%20x2%3D%2212.6%22%20y2%3D%2215.6000002%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getMessageInfoOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.messageInformation,title:n.localize("INFO"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}isSentByMe(e,t){return!t.getSender()||e.getUid()===t.getSender().getUid()}getTextMessageOptions(e,t,o,r){let s=this.isSentByMe(e,t),i=!1;r?.getScope()===n.CometChatUIKitConstants.groupMemberScope.participant&&(i=!0);let a=[];return a.push(this.getReactionOption(o)),t.getParentMessageId()||a.push(this.getReplyInThreadOption(o)),a.push(this.getCopyOption(o)),(s||!i&&r)&&a.push(this.getEditOption(o)),s&&a.push(this.getMessageInfoOption(o)),(s||!i&&r)&&a.push(this.getDeleteOption(o)),r&&!s&&a.push(this.getSendMessagePrivatelyOption(o)),a}getImageMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getVideoMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getAudioMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getFileMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getBottomView(e,t){return null}getTextMessageTemplate(e,t){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.text,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(n,o)=>{let r=n;return null!=r.getDeletedAt()?this.getDeleteMessageBubble(r,e):Be.getDataSource().getTextMessageContentView(r,o,e,t)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getAudioMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.audio,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getAudioMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getVideoMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.video,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getVideoMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getImageMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.image,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getImageMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getGroupActionTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.groupMember,category:n.CometChatUIKitConstants.MessageCategory.action,contentView:(t,n)=>this.getGroupActionBubble(t,e)})}getFileMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.file,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getFileMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getFormMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.form,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getFormMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getSchedulerMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.scheduler,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getSchedulerMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getCardMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.card,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getCardMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getAllMessageTemplates(e,t){let n=e??Te;return t||(t={disableMentions:!1}),[Be.getDataSource().getTextMessageTemplate(n,t),Be.getDataSource().getImageMessageTemplate(n),Be.getDataSource().getVideoMessageTemplate(n),Be.getDataSource().getAudioMessageTemplate(n),Be.getDataSource().getFileMessageTemplate(n),Be.getDataSource().getGroupActionTemplate(n),Be.getDataSource().getFormMessageTemplate(n),Be.getDataSource().getSchedulerMessageTemplate(n),Be.getDataSource().getCardMessageTemplate(n)]}getMessageTemplate(e,t,o,r){let s=o??Te;r||(r={disableMentions:!1});let i=null;if(t!==n.CometChatUIKitConstants.MessageCategory.call)switch(e){case n.CometChatUIKitConstants.MessageTypes.text:i=Be.getDataSource().getTextMessageTemplate(s,r);break;case n.CometChatUIKitConstants.MessageTypes.image:i=Be.getDataSource().getImageMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.video:i=Be.getDataSource().getVideoMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.groupMember:i=Be.getDataSource().getGroupActionTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.file:i=Be.getDataSource().getFileMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.audio:i=Be.getDataSource().getAudioMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.form:i=Be.getDataSource().getFormMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.scheduler:i=Be.getDataSource().getSchedulerMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.card:i=Be.getDataSource().getCardMessageTemplate(s)}return i}getMessageOptions(e,t,o,r){let s=[];if(t.getCategory()===n.CometChatUIKitConstants.MessageCategory.message)switch(t.getType()){case n.CometChatUIKitConstants.MessageTypes.text:s=Be.getDataSource().getTextMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.image:s=Be.getDataSource().getImageMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.video:s=Be.getDataSource().getVideoMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.groupMember:s=[];break;case n.CometChatUIKitConstants.MessageTypes.file:s=Be.getDataSource().getFileMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.audio:s=Be.getDataSource().getAudioMessageOptions(e,t,o,r);break;default:s=Be.getDataSource().getCommonOptions(e,t,o,r)}else t.getCategory()!=n.CometChatUIKitConstants.MessageCategory.custom&&t.getCategory()!=n.CometChatUIKitConstants.MessageCategory.interactive||(s=Be.getDataSource().getCommonOptions(e,t,o,r));return s}getCommonOptions(e,t,o,r){let s=this.isSentByMe(e,t),i=!1;r?.getScope()===n.CometChatUIKitConstants.groupMemberScope.participant&&(i=!0);let a=[];return a.push(this.getReactionOption(o)),t?.getParentMessageId()||a.push(this.getReplyInThreadOption(o)),s&&a.push(this.getMessageInfoOption(o)),(s||!i&&r)&&a.push(this.getDeleteOption(o)),r?.getGuid()&&!s&&a.push(this.getSendMessagePrivatelyOption(o)),a}getAllMessageTypes(){return[n.CometChatUIKitConstants.MessageTypes.text,n.CometChatUIKitConstants.MessageTypes.image,n.CometChatUIKitConstants.MessageTypes.audio,n.CometChatUIKitConstants.MessageTypes.video,n.CometChatUIKitConstants.MessageTypes.file,n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageTypes.form,n.CometChatUIKitConstants.MessageTypes.scheduler,n.CometChatUIKitConstants.MessageTypes.card]}addList(){return"<Message Utils>"}getAllMessageCategories(){return[n.CometChatUIKitConstants.MessageCategory.message,n.CometChatUIKitConstants.MessageCategory.action,n.CometChatUIKitConstants.MessageCategory.interactive]}getAuxiliaryOptions(e,t,n,o){return[]}getId(){return"messageUtils"}getTextMessageContentView(e,t,n,o){return Be.getDataSource().getTextMessageBubble(e.getText(),e,t,n,void 0,o)}getAudioMessageContentView(e,t,n){return Be.getDataSource().getAudioMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n,e?.getAttachments()[0]?.getName())}getFileMessageContentView(e,t,n){return Be.getDataSource().getFileMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n,e?.getAttachments()[0]?.getName())}getFormMessageContentView(e,t,n){return Be.getDataSource().getFormMessageBubble(e,n)}getSchedulerMessageContentView(e,t,n){return Be.getDataSource().getSchedulerMessageBubble(e,n)}getCardMessageContentView(e,t,n){return Be.getDataSource().getCardMessageBubble(e,n)}getImageMessageContentView(e,t,n){let o=e?.getAttachments()[0]?.getUrl()||"";return Be.getDataSource().getImageMessageBubble(o,"data:image/png;base64,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",e,n)}getVideoMessageContentView(e,t,n){return Be.getDataSource().getVideoMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n)}getActionMessage(e){let t="";if(!1===e.hasOwnProperty("actionBy")||!1===e.hasOwnProperty("actionOn"))return t;if(e.action!==n.CometChatUIKitConstants.groupMemberAction.JOINED&&e.action!==n.CometChatUIKitConstants.groupMemberAction.LEFT&&(!1===e.actionBy.hasOwnProperty("name")||!1===e.actionOn.hasOwnProperty("name")))return t;if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE){if(!e.hasOwnProperty("data")||!e.data.hasOwnProperty("extras"))return t;if(!e.data.extras.hasOwnProperty("scope"))return t;if(!1===e.data.extras.scope.hasOwnProperty("new"))return t}if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE&&!1===e.data.extras.hasOwnProperty("scope"))return t;if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE&&!1===e.data.extras.scope.hasOwnProperty("new"))return t;const o=e.actionBy,r=e.actionOn,s=o.name,i=e.action!==n.CometChatUIKitConstants.groupMemberAction.JOINED&&e.action!==n.CometChatUIKitConstants.groupMemberAction.LEFT?r.name:"";switch(e.action){case n.CometChatUIKitConstants.groupMemberAction.ADDED:t=`${s} ${n.localize("ADDED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.JOINED:t=`${s} ${n.localize("JOINED")}`;break;case n.CometChatUIKitConstants.groupMemberAction.LEFT:t=`${s} ${n.localize("LEFT")}`;break;case n.CometChatUIKitConstants.groupMemberAction.KICKED:t=`${s} ${n.localize("KICKED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.BANNED:t=`${s} ${n.localize("BANNED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.UNBANNED:t=`${s} ${n.localize("UNBANNED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE:{const o=e.data.extras.scope.new;t=`${s} ${n.localize("MADE")} ${i} ${o}`;break}}return t}getDeleteMessageBubble(e,t,o){let r=o,s=n.localize("MESSAGE_IS_DELETED");return r||(r={textFont:n.fontHelper(t.typography.text2),textColor:t.palette.getAccent400()||"",border:`1px dashed ${t.palette.getAccent400()}`,borderRadius:"12px"}),g.jsx(we,{text:s,textStyle:r})}getGroupActionBubble(e,t,o){let r=o,s=this.getActionMessage(e);return r||(r={textFont:n.fontHelper(t.typography.subtitle2),textColor:t.palette.getAccent600()||""}),g.jsx(we,{text:s,textStyle:r})}getTextMessageBubbleStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900("light")||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getFormMessageBubbleStyle(e){const t=new o.InputStyle({width:"100%",height:"30px",border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"6px",padding:"0px 0px 0px 5px",placeholderTextColor:e.palette.getAccent400(),placeholderTextFont:n.fontHelper(e.typography.subtitle2),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),background:e.palette.getBackground()}),s=new o.LabelStyle({textFont:n.fontHelper(e.typography.subtitle1),textColor:e.palette.getAccent(),background:"transparent"}),i=new o.RadioButtonStyle({height:"16px",width:"16px",border:"none",labelTextFont:n.fontHelper(e.typography.subtitle2),labelTextColor:e.palette.getAccent600(),borderRadius:"4px",background:""}),a=new o.CheckboxStyle({height:"16px",width:"16px",border:"none",borderRadius:"4px",background:"",labelTextFont:n.fontHelper(e.typography.subtitle2),labelTextColor:e.palette.getAccent()}),l=new o.DropdownStyle({height:"35px",width:"100%",background:e.palette.getBackground(),border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"6px",activeTextFont:n.fontHelper(e.typography.subtitle2),activeTextColor:e.palette.getAccent(),arrowIconTint:e.palette.getAccent700(),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),optionBackground:e.palette.getBackground(),optionBorder:`1px solid ${e.palette.getAccent100()}`,optionHoverBorder:`1px solid ${e.palette.getAccent100()}`,hoverTextFont:n.fontHelper(e.typography.subtitle2),hoverTextColor:e.palette.getAccent(),hoverTextBackground:e.palette.getAccent100()}),c={height:"40px",width:"100%",background:e.palette.getPrimary(),border:"none",borderRadius:"6px",buttonTextFont:n.fontHelper(e.typography.subtitle2),buttonTextColor:e.palette.getBackground(),justifyContent:"center"},C=new o.SingleSelectStyle({height:"100%",width:"100%",background:e.palette.getBackground(),border:"none",borderRadius:"12px",activeTextFont:n.fontHelper(e.typography.subtitle2),activeTextColor:e.palette.getAccent(),activeTextBackground:e.palette.getAccent100(),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),optionBackground:e.palette.getBackground(),optionBorder:`1px solid ${e.palette.getAccent100()}`,optionBorderRadius:"3px",hoverTextFont:n.fontHelper(e.typography.subtitle2),hoverTextColor:e.palette.getAccent(),hoverTextBackground:e.palette.getAccent100()}),g=new o.QuickViewStyle({background:"transparent",height:"fit-content",width:"100%",titleFont:n.fontHelper(e.typography.subtitle2),titleColor:e.palette.getPrimary(),subtitleFont:n.fontHelper(e.typography.subtitle2),subtitleColor:e.palette.getAccent600(),leadingBarTint:e.palette.getPrimary(),leadingBarWidth:"4px",borderRadius:"8px"});return new r.FormBubbleStyle({width:"300px",height:"fit-content",border:"none",background:"transparent",wrapperBackground:e.palette.getBackground(),borderRadius:"8px",wrapperBorderRadius:"8px",textInputStyle:t,labelStyle:s,radioButtonStyle:i,checkboxStyle:a,dropdownStyle:l,buttonStyle:c,singleSelectStyle:C,quickViewStyle:g,titleColor:e.palette.getAccent(),titleFont:n.fontHelper(e.typography.title1),goalCompletionTextColor:e.palette.getAccent(),goalCompletionTextFont:n.fontHelper(e.typography.subtitle1),wrapperPadding:"2px",datePickerBorder:`1px solid ${e.palette.getAccent100()}`,datePickerBorderRadius:"6px",datePickerFont:n.fontHelper(e.typography.subtitle2),datePickerFontColor:e.palette.getAccent()})}getCardMessageBubbleStyle(e){const t={height:"40px",width:"100%",background:"transparent",border:"none",borderRadius:"0px",buttonTextFont:n.fontHelper(e.typography.subtitle2),buttonTextColor:`${e.palette.getPrimary()}`,justifyContent:"center"};return new r.CardBubbleStyle({background:"transparent",borderRadius:"8px",height:"fit-content",width:"300px",imageHeight:"auto",imageWidth:"100%",imageRadius:"8px",imageBackgroundColor:"transparent",descriptionFontColor:e.palette.getAccent(),descriptionFont:n.fontHelper(e.typography.subtitle2),buttonStyle:t,dividerTintColor:e.palette.getAccent100(),wrapperBackground:e.palette.getBackground(),wrapperBorderRadius:"8px",wrapperPadding:"2px",disabledButtonColor:e.palette.getAccent600()})}getTextMessageBubble(e,t,n,o,s,i){let a,l={...i,textFormatters:i?.textFormatters&&i?.textFormatters.length?[...i.textFormatters]:this.getAllTextFormatters({theme:o,alignment:n,disableMentions:i.disableMentions})},c=l.textFormatters;if(l&&!l.disableMentions){let e;for(let n=0;n<c.length&&!(c[n]instanceof r.CometChatMentionsFormatter&&(e=c[n],e.setMessage(t),t.getMentionedUsers().length&&e.setCometChatUserGroupMembers(t.getMentionedUsers()),e.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),a))&&!(c[n]instanceof r.CometChatUrlsFormatter&&(a=c[n],e));n++);e||(e=Be.getDataSource().getMentionsTextFormatter({message:t,...l,alignment:n,theme:o}),c.push(e))}else for(let e=0;e<c.length;e++)if(c[e]instanceof r.CometChatUrlsFormatter){a=c[e];break}a||(a=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:n}),c.push(a));let C=s;C||(C=this.getTextMessageBubbleStyle(n,o));for(let e=0;e<c.length;e++)c[e].setMessageBubbleAlignment(n),c[e].setMessage(t);return g.jsx(we,{text:e,textStyle:C,textFormatters:c})}getAudioMessageBubble(e,t,n,o,r){return g.jsx(De,{src:e,audioStyle:r})}getFileMessageBubble(e,t,o,r,s){let i=s;return i||(i={titleFont:n.fontHelper(o.typography.subtitle1),titleColor:o.palette.getAccent(),subtitleFont:n.fontHelper(o.typography.subtitle2),subtitleColor:o.palette.getAccent600(),iconTint:o.palette.getPrimary()}),g.jsx(ve,{downloadIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDownload%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDownload%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%227.33333333%2013.2%2011%2016.8666667%2014.6666667%2013.2%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211%22%20y1%3D%225.86666667%22%20x2%3D%2211%22%20y2%3D%2216.8666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C11%20C0%2C17.0751322%204.92486775%2C22%2011%2C22%20C17.0751322%2C22%2022%2C17.0751322%2022%2C11%20C22%2C4.92486775%2017.0751322%2C0%2011%2C0%20C4.92486775%2C0%200%2C4.92486775%200%2C11%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",subtitle:n.localize("SHARED_FILE"),title:r,fileURL:e,fileStyle:i})}getFormMessageBubble(e,t,n,o){let r=n;r||(r=this.getFormMessageBubbleStyle(t));const s=!!o;return g.jsx(Se,{message:e,formBubbleStyle:r,ccSubmitClicked:e=>{o&&o(e.detail)},hasCustomCallback:s})}getSchedulerMessageBubble(e,t,n,o){let r=n;return r||(r=this.getSchedulerBubbleStyle(t)),g.jsx(Ie,{style:this.getSchedulerWrapperStyle(),schedulerMessage:e,schedulerBubbleStyle:r,onScheduleClick:o||void 0})}getSchedulerWrapperStyle(){return{height:"inherit",width:"inherit",display:"block"}}getCardMessageBubble(e,t,n){let o=n;return o||(o=this.getCardMessageBubbleStyle(t)),g.jsx(Fe,{message:e,cardBubbleStyle:o})}getImageMessageBubble(e,t,r,s,i,a){a||(a=new o.ImageBubbleStyle({height:"auto",maxHeight:"500px",maxWidth:"400px",border:"none",borderRadius:"8px",background:"transparent"}));const l=g.jsx(ke,{URL:r?.getAttachments()[0]?.getUrl()??e,closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",fullScreenViewerStyle:{closeIconTint:"blue"},ccCloseClicked:()=>{n.CometChatUIEvents.ccHideDialog.next()}});return g.jsx(fe,{src:e,placeholderImage:t,imageStyle:a,ccImageClicked:()=>{n.CometChatUIEvents.ccShowDialog.next({child:l,confirmCallback:null})}})}getVideoMessageBubble(e,t,n,r,s,i){return i||(i=new o.BaseStyle({height:"130px",width:"100%",border:"none",borderRadius:"8px 8px",background:"transparent"})),g.jsx(Ee,{src:e,poster:r,videoStyle:i})}imageAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.image,title:n.localize("ATTACH_IMAGE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FPhoto%20Library%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FPhoto-Library%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8%2C2.25%20C9.0543618%2C2.25%209.91816512%2C3.06587779%209.99451426%2C4.10073766%20L10%2C4.25%20L10%2C4.749%20L19.25%2C4.75%20C20.3043618%2C4.75%2021.1681651%2C5.56587779%2021.2445143%2C6.60073766%20L21.25%2C6.75%20L21.25%2C8.647%20L21.3090595%2C8.67075883%20C21.560776%2C8.78204037%2021.7890445%2C8.94502905%2021.9776884%2C9.15176047%20L22.0859904%2C9.28098473%20C22.4268417%2C9.7243264%2022.5648157%2C10.2875838%2022.4792305%2C10.8049438%20L20.599742%2C19.7646666%20C20.3801645%2C20.5892111%2019.6644249%2C21.1776759%2018.8253479%2C21.243794%20L18.6666667%2C21.25%20L4.41416667%2C21.25%20C4.34513107%2C21.25%204.27827401%2C21.2406726%204.21478696%2C21.2232093%20L4.198%2C21.217%20L4.13447967%2C21.2119882%20C3.12077897%2C21.0788944%202.34585208%2C20.2581085%202.25808253%2C19.244849%20L2.25%2C19.0833333%20L2.25%2C4.25%20C2.25%2C3.1956382%203.06587779%2C2.33183488%204.10073766%2C2.25548574%20L4.25%2C2.25%20L8%2C2.25%20Z%20M20.5%2C9.9999998%20L8.94041369%2C9.9999998%20C8.7494078%2C9.99989301%208.57810253%2C10.1081415%208.50251018%2C10.2403227%20L8.47304199%2C10.3080169%20L6.50183631%2C19.6519318%20L6.47%2C19.749%20L18.6669246%2C19.7500001%20C18.8652457%2C19.7500001%2019.0419017%2C19.6334019%2019.1157978%2C19.483767%20L19.1409396%2C19.4178635%20L20.9835913%2C10.6286666%20C21.0235655%2C10.4785581%2020.991501%2C10.3183966%2020.8968201%2C10.1952461%20C20.8210754%2C10.0967258%2020.71214%2C10.0308462%2020.5919295%2C10.0084626%20L20.5%2C9.9999998%20Z%20M8%2C3.75%20L4.25%2C3.75%20C4.00454011%2C3.75%203.80039163%2C3.92687516%203.75805567%2C4.16012437%20L3.7499284%2C4.25%20L3.7499284%2C19.0729701%20C3.75450399%2C19.4040804%204.00142215%2C19.6816449%204.32974627%2C19.7247522%20C4.62158992%2C19.7630698%204.89911328%2C19.6058121%205.0118617%2C19.3809093%20L5.04612468%2C19.2936497%20L7.01858631%2C9.94533345%20C7.25034003%2C9.14246197%207.95397669%2C8.57422367%208.77513888%2C8.50674095%20L8.94083333%2C8.5%20L19.75%2C8.5%20L19.75%2C6.75%20C19.75%2C6.50454011%2019.5731248%2C6.30039163%2019.3398756%2C6.25805567%20L19.25%2C6.25%20L9.25%2C6.25%20C8.87030423%2C6.25%208.55650904%2C5.96784612%208.50684662%2C5.60177056%20L8.5%2C5.5%20L8.5%2C4.25%20C8.5%2C4.00454011%208.32312484%2C3.80039163%208.08987563%2C3.75805567%20L8%2C3.75%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.5%2C11.3125%20L10.6157711%2C11.3187346%20C11.1481147%2C11.3764201%2011.5625%2C11.8273176%2011.5625%2C12.375%20C11.5625%2C12.9618025%2011.0868025%2C13.4375%2010.5%2C13.4375%20C9.91319745%2C13.4375%209.4375%2C12.9618025%209.4375%2C12.375%20C9.4375%2C11.8273176%209.85188534%2C11.3764201%2010.3842289%2C11.3187346%20L10.5%2C11.3125%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.7615505%2C13.3341733%20C15.1650281%2C13.339062%2015.5432492%2C13.5206846%2015.7989971%2C13.8261321%20L15.8889717%2C13.9463759%20L18.3148051%2C17.5838759%20C18.5446241%2C17.928486%2018.4515675%2C18.3941527%2018.1069574%2C18.6239717%20C17.7936756%2C18.8328981%2017.3803468%2C18.7749852%2017.1351188%2C18.5038182%20L17.0668616%2C18.4161241%20L14.742%2C14.93%20L13.1806552%2C17.1565514%20C12.9524338%2C17.481881%2012.5156848%2C17.5682521%2012.1842442%2C17.371143%20L12.096698%2C17.3103241%20L11.179%2C16.572%20L9.94871059%2C18.4165154%20C9.73958776%2C18.7296662%209.33567986%2C18.8347993%209.00516806%2C18.6784976%20L8.90848458%2C18.6237106%20C8.59533381%2C18.4145878%208.49020073%2C18.0106799%208.64650244%2C17.6801681%20L8.70128941%2C17.5834846%20L10.0076608%2C15.6272604%20C10.2213273%2C15.3068138%2010.5595979%2C15.0906712%2010.9401624%2C15.0314258%20C11.2731564%2C14.9795861%2011.6118179%2C15.0520295%2011.8942272%2C15.2330124%20L12.0116353%2C15.3171759%20L12.412%2C15.639%20L13.6194632%2C13.9191131%20C13.8512845%2C13.5888451%2014.2147222%2C13.3792001%2014.6114213%2C13.3405523%20L14.7615505%2C13.3341733%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}videoAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.video,title:n.localize("ATTACH_VIDEO"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}audioAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.audio,title:n.localize("ATTACH_AUDIO"),iconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0%29%22%3E%3Cpath%20d%3D%22M1%205C1%203.89543%201.89543%203%203%203H21.5C22.6046%203%2023.5%203.89543%2023.5%205V19C23.5%2020.1046%2022.6046%2021%2021.5%2021H3C1.89543%2021%201%2020.1046%201%2019V5Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%2015.5C9%2015.8978%209.15803%2016.2794%209.43934%2016.5607C9.72064%2016.842%2010.1022%2017%2010.5%2017C10.8978%2017%2011.2794%2016.842%2011.5607%2016.5607C11.842%2016.2794%2012%2015.8978%2012%2015.5C12%2015.1022%2011.842%2014.7206%2011.5607%2014.4393C11.2794%2014.158%2010.8978%2014%2010.5%2014C10.1022%2014%209.72064%2014.158%209.43934%2014.4393C9.15803%2014.7206%209%2015.1022%209%2015.5Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M12%2015V7L14.7141%209.27566C15.3657%209.82133%2015.7957%2010.5251%2015.9433%2011.2871C16.0909%2012.0491%2015.9486%2012.8307%2015.5365%2013.5211%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0%22%3E%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}fileAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.file,title:n.localize("ATTACH_FILE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FAttachment%20File%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FAttachment-File%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.33333333%2C14.6666667%20C9.33333333%2C17.6121853%2011.721148%2C20%2014.6666667%2C20%20C17.6121853%2C20%2020%2C17.6121853%2020%2C14.6666667%20C20%2C11.721148%2017.6121853%2C9.33333333%2014.6666667%2C9.33333333%20C11.721148%2C9.33333333%209.33333333%2C11.721148%209.33333333%2C14.6666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2214.6666667%22%20y1%3D%2212%22%20x2%3D%2214.6666667%22%20y2%3D%2217.3333333%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212%22%20y1%3D%2214.6666667%22%20x2%3D%2217.3333333%22%20y2%3D%2214.6666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6%2C17.3333333%20L1.33333333%2C17.3333333%20C0.596953667%2C17.3333333%200%2C16.7363797%200%2C16%20L0%2C1.33333333%20C0%2C0.596953667%200.596953667%2C0%201.33333333%2C0%20L10.7813333%2C0%20C11.1347086%2C0%2011.4736014%2C0.140428224%2011.7235556%2C0.390222222%20L14.2764444%2C2.94311111%20C14.5262384%2C3.19306523%2014.6666667%2C3.53195804%2014.6666667%2C3.88533333%20L14.6666667%2C6%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}getAttachmentOptions(e,t){return[this.imageAttachmentOption(e),this.videoAttachmentOption(e),this.audioAttachmentOption(e),this.fileAttachmentOption(e)]}getLastConversationMessage(e,t,o){let i={...o,textFormatters:o?.textFormatters&&o?.textFormatters.length?[...o.textFormatters]:[this.getMentionsTextFormatter({theme:o.theme,disableMentions:o.disableMentions})]},a=r.ConversationUtils.getLastConversationMessage(e,t,i),l=e.getLastMessage();if(l){let e=i.textFormatters;if(i&&!i.disableMentions){let t;for(let n=0;n<e.length&&(e[n]instanceof r.CometChatMentionsFormatter&&(t=e[n],t.setMessage(l),l.getMentionedUsers().length&&t.setCometChatUserGroupMembers(l.getMentionedUsers()),t.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser())),!t);n++);t||(t=Be.getDataSource().getMentionsTextFormatter({messageObject:l,...i,alignment:null,theme:o.theme}),e.push(t))}if(l&&l instanceof s.CometChat.TextMessage)for(let t=0;t<e.length;t++)a=e[t].getFormattedText(a,{mentionsTargetElement:n.MentionsTargetElement.conversation})}return a}getDefaultDetailsTemplate(e,t,n,o){return r.DetailsUtils.getDefaultDetailsTemplate(e,t,n,o)}getAuxiliaryHeaderMenu(e,t){return[]}getAIOptions(e,t,n,o,r){return[]}getMentionsFormattedText(e,t,o){const r=/<@uid:(.*?)>/g;let s=e.getText(),i=t,a=r.exec(s),l=[],c=e.getMentionedUsers();for(;null!==a;){let e;for(let t=0;t<c.length;t++)a[1]==c[t].getUid()&&(e=c[t]);e&&l.push(e),a=r.exec(s)}let C=this.getMentionsTextFormatter({theme:new n.CometChatTheme({})});return C.setClasses(["cc-mentions"]),C.setCometChatUserGroupMembers(l),i=C.getFormattedText(i,o),i}getAllTextFormatters(e){let t=[];const n=e.disableMentions?null:Be.getDataSource().getMentionsTextFormatter(e),o=Be.getDataSource().getUrlTextFormatter(e);return n&&t.push(n),o&&t.push(o),t}getMentionsTextFormatter(e){let t=new r.CometChatMentionsFormatter;return e&&e.theme&&(t.setComposerMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text2),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text2),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""})),t.setConversationMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""})),t.setRightBubbleMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getTertiary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getTertiary(),mentionTextBackground:""})),t.setLeftBubbleMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""}))),t}getUrlTextFormatter(e={}){let t=new r.CometChatUrlsFormatter([/(https?:\/\/[^\s]+)/g]);return e.alignment==n.MessageBubbleAlignment.left?t.setStyle({formattedTextColor:e.theme.palette.getPrimary(),formattedTextFont:n.fontHelper(e.theme.typography.text3)}):t.setStyle({formattedTextColor:e.theme.palette.getTertiary(),formattedTextFont:n.fontHelper(e.theme.typography.text3)}),t}}class Be{static init(e){this.dataSource=e??new Me,e||(this.names=[]),this.names.push(this.dataSource.getId())}static enable(e){let t=e(this.dataSource);this.names.find(e=>e===t.getId())||(this.dataSource=t,this.names.push(this.dataSource.getId()))}static getDataSource(){return this.dataSource}}Be.names=["message utils"];class Le{enable(){s.CometChat.isAIFeatureEnabled(this.getExtensionId()).then(e=>{e&&this.addExtension()})}}class Ue{constructor(e){this.dataSource=e}getTextMessageOptions(e,t,n,o){return(this.dataSource??new Me).getTextMessageOptions(e,t,n,o)}getImageMessageOptions(e,t,n,o){return(this.dataSource??new Me).getImageMessageOptions(e,t,n,o)}getVideoMessageOptions(e,t,n,o){return(this.dataSource??new Me).getVideoMessageOptions(e,t,n,o)}getAudioMessageOptions(e,t,n,o){return(this.dataSource??new Me).getAudioMessageOptions(e,t,n,o)}getFileMessageOptions(e,t,n,o){return(this.dataSource??new Me).getFileMessageOptions(e,t,n,o)}getBottomView(e,t){return(this.dataSource??new Me).getBottomView(e,t)}getTextMessageContentView(e,t,n,o){return(this.dataSource??new Me).getTextMessageContentView(e,t,n,o)}getImageMessageContentView(e,t,n){return(this.dataSource??new Me).getImageMessageContentView(e,t,n)}getVideoMessageContentView(e,t,n){return(this.dataSource??new Me).getVideoMessageContentView(e,t,n)}getAudioMessageContentView(e,t,n){return(this.dataSource??new Me).getAudioMessageContentView(e,t,n)}getFileMessageContentView(e,t,n){return(this.dataSource??new Me).getFileMessageContentView(e,t,n)}getFormMessageContentView(e,t,n){return(this.dataSource??new Me).getFormMessageContentView(e,t,n)}getSchedulerMessageContentView(e,t,n){return(this.dataSource??new Me).getSchedulerMessageContentView(e,t,n)}getCardMessageContentView(e,t,n){return(this.dataSource??new Me).getCardMessageContentView(e,t,n)}getTextMessageTemplate(e,t){return(this.dataSource??new Me).getTextMessageTemplate(e,t)}getImageMessageTemplate(e){return(this.dataSource??new Me).getImageMessageTemplate(e)}getVideoMessageTemplate(e){return(this.dataSource??new Me).getVideoMessageTemplate(e)}getAudioMessageTemplate(e){return(this.dataSource??new Me).getAudioMessageTemplate(e)}getFileMessageTemplate(e){return(this.dataSource??new Me).getFileMessageTemplate(e)}getGroupActionTemplate(e){return(this.dataSource??new Me).getGroupActionTemplate(e)}getFormMessageTemplate(e){return(this.dataSource??new Me).getFormMessageTemplate(e)}getSchedulerMessageTemplate(e){return(this.dataSource??new Me).getSchedulerMessageTemplate(e)}getCardMessageTemplate(e){return(this.dataSource??new Me).getCardMessageTemplate(e)}getAllMessageTemplates(e,t){return(this.dataSource??new Me).getAllMessageTemplates(e,t)}getMessageTemplate(e,t,n){return(this.dataSource??new Me).getMessageTemplate(e,t,n)}getMessageOptions(e,t,n,o){return(this.dataSource??new Me).getMessageOptions(e,t,n,o)}getCommonOptions(e,t,n,o){return(this.dataSource??new Me).getCommonOptions(e,t,n,o)}getAttachmentOptions(e,t){return(this.dataSource??new Me).getAttachmentOptions(e,t)}getAllMessageTypes(){return(this.dataSource??new Me).getAllMessageTypes()}getAllMessageCategories(){return(this.dataSource??new Me).getAllMessageCategories()}getAuxiliaryOptions(e,t,n,o){return(this.dataSource??new Me).getAuxiliaryOptions(e,t,n,o)}getId(){return(this.dataSource??new Me).getId()}getDeleteMessageBubble(e,t,n){return(this.dataSource??new Me).getDeleteMessageBubble(e,t,n)}getGroupActionBubble(e,t,n){return(this.dataSource??new Me).getGroupActionBubble(e,t,n)}getTextMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getTextMessageBubble(e,t,n,o,r,s)}getVideoMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getVideoMessageBubble(e,t,n,o,r,s)}getImageMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getImageMessageBubble(e,t,n,o,r,s)}getAudioMessageBubble(e,t,n,o,r){return(this.dataSource??new Me).getAudioMessageBubble(e,t,n,o,r)}getFileMessageBubble(e,t,n,o,r){return(this.dataSource??new Me).getFileMessageBubble(e,t,n,o,r)}getFormMessageBubble(e,t,n,o){return(this.dataSource??new Me).getFormMessageBubble(e,t,n,o)}getSchedulerMessageBubble(e,t,n,o){return(this.dataSource??new Me).getSchedulerMessageBubble(e,t,n,o)}getCardMessageBubble(e,t,n){return(this.dataSource??new Me).getCardMessageBubble(e,t,n)}getLastConversationMessage(e,t,n){return(this.dataSource??new Me).getLastConversationMessage(e,t,n)}getDefaultDetailsTemplate(e,t,n,o){return(this.dataSource??new Me).getDefaultDetailsTemplate(e,t,n,o)}getAuxiliaryHeaderMenu(e,t){return(this.dataSource??new Me).getAuxiliaryHeaderMenu(e,t)}getAIOptions(e,t,n,o,r){return(this.dataSource??new Me).getAIOptions(e,t,n,o,r)}getAllTextFormatters(e){let t=[];const n=e.disableMentions?null:(this.dataSource??new Me).getMentionsTextFormatter(e),o=(this.dataSource??new Me).getUrlTextFormatter(e);return n&&t.push(n),o&&t.push(o),t}getMentionsTextFormatter(e={}){return(this.dataSource??new Me).getMentionsTextFormatter(e)}getUrlTextFormatter(e={}){return(this.dataSource??new Me).getUrlTextFormatter(e)}getMentionsFormattedText(e,t,n){return(this.dataSource??new Me).getMentionsFormattedText(e,t,n)}}const Re=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t}),Pe=(e,t)=>e.sender.getUid()===t.getUid()?n.MessageBubbleAlignment.right:n.MessageBubbleAlignment.left,Oe=(e,t,o,r)=>{let s={};s=o===n.MessageBubbleAlignment.right?r?.senderMessageBubbleStyle||{}:r?.botMessageBubbleStyle||{};const i={textFont:s?.textFont||n.fontHelper(t.typography.text3)};return o===n.MessageBubbleAlignment.right?i.textColor=s?.textColor||t.palette.getAccent900():i.textColor=s?.textColor||t.palette.getAccent(),g.jsx(Re,{text:e.getText(),textStyle:i})},je=(e,t,o)=>{let r,s=!1;return"send"!==e.getStatus()&&"wait"!==e.getStatus()&&"error"!==e.getStatus()||("wait"===e.getStatus()?r=n.Receipts.wait:"sent"===e.getStatus()?r=n.Receipts.sent:"error"===e.getStatus()&&(r=n.Receipts.error),s=!0),g.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[g.jsx("div",{style:{display:"inline-block"},children:g.jsx("cometchat-date",{timestamp:e.getSentAt(),dateStyle:JSON.stringify(qe(o)),pattern:n.DatePatterns.time})}),s?g.jsx("div",{style:{position:"relative",height:"20px",width:"20px"},children:g.jsx("cometchat-receipt",{receipt:r,waitIcon:t?.loadingIconURL,errorIcon:t?.errorIconURL,receiptStyle:JSON.stringify($e(t?.assistBotStyle,o))})}):null]})},Ve=(e,t)=>({display:"flex",width:e?.width||"100%",height:e?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px",background:e?.background||t?.palette?.getBackground(),borderRadius:e?.borderRadius||"8px"}),Ge=(e,t)=>({display:"flex",justifyContent:"space-between",alignItems:"center",font:e?.optionTitleFont||t&&n.fontHelper(t?.typography?.text2),color:e?.optionTitleColor||t?.palette?.getAccent()}),He=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.backIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),Qe=(e,t)=>new o.ActionSheetStyle({ActionSheetSeparatorTint:t?.palette?.getAccent400(),background:e?.buttonBackground||t?.palette?.getBackground(),titleColor:e?.buttonTextColor||t?.palette?.getAccent(),titleFont:e?.buttonTextFont||t&&n.fontHelper(t?.typography?.text2),listItemBackground:"transparent",height:"100%",width:"100%",border:"none"}),Ne=e=>({display:"flex",justifyContent:"flex-end",height:"100%",width:"100%",background:e?.palette?.getAccent600()}),Ke=(e,t)=>({display:"flex",flexDirection:"column",width:"40%",minWidth:"350px",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",background:e?.background||t?.palette.getBackground()}),ze=e=>({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:"40px",padding:"10px",boxSizing:"border-box",background:e?.palette.getAccent200(),marginBottom:"10px"}),Je=(e={},t)=>({font:e.titleFont||n.fontHelper(t.typography.subtitle1),color:e.titleColor||t.palette.getAccent()}),Ye=(e={},t)=>({font:e.subtitleFont||n.fontHelper(t.typography.caption2),color:e.subtitleColor||t.palette.getAccent500()}),_e=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.closeIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),We=(e,t,n,o)=>{if(e.sender.getUid()===n.getUid()){const e=o?.senderMessageBubbleStyle||{};return{background:e.background||t.palette.getPrimary(),borderRadius:e.borderRadius||"12px",border:e.border||"none"}}{const e=o?.botMessageBubbleStyle||{};return{background:e.background||t.palette.getAccent100(),borderRadius:e.borderRadius||"12px",border:e.border||"none"}}},Ze=(e,t)=>e||new o.MessageInputStyle({height:"40px",width:"100%",maxHeight:"40px",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"12px",background:t.palette.getAccent50(),textFont:n.fontHelper(t.typography.text2),textColor:t.palette.getAccent(),dividerColor:t.palette.getAccent100(),inputBorder:"none",inputBorderRadius:"0px",inputBackground:"transparent"}),Xe=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.sendIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),qe=e=>({textColor:e?.palette?.getAccent600(),textFont:n.fontHelper(e?.typography?.caption2),padding:"0px"}),$e=(e,t)=>new o.ReceiptStyle({waitIconTint:e?.loadingIconTint||t?.palette?.getAccent700(),errorIconTint:e?.errorIconTint||t?.palette?.getError()}),et=(e,t)=>{const o=Pe(e,t);return{flex:"1 1 0",display:"flex",flexDirection:"column",borderRadius:"inherit",justifyContent:o===n.MessageBubbleAlignment.left?"flex-start":"flex-end",alignItems:o===n.MessageBubbleAlignment.left?"flex-start":"flex-end",position:"relative"}};var tt="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const nt={title:void 0,bots:void 0,closeCallback:void 0,backCallback:void 0,configuration:void 0},ot=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t,events:{onClick:"cc-actionsheet-clicked"}}),rt=e=>{const{title:n,bots:o,closeCallback:r,backCallback:s,configuration:i}={...nt,...e},{theme:a}=t.useContext(U);return g.jsx("div",{className:"slideable-container",style:Ve(i?.assistBotStyle,a),children:g.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",padding:"10px",boxSizing:"border-box"},children:[g.jsxs("div",{style:Ge(i?.assistBotStyle,a),children:[g.jsx("div",{children:g.jsx("cometchat-button",{iconURL:i?.backIconURL||tt,onClick:()=>s?s():null,buttonStyle:JSON.stringify(He(i?.assistBotStyle,a))})}),g.jsx("div",{children:n}),g.jsx("div",{style:{flex:.2}})]}),g.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",boxSizing:"border-box"},children:g.jsx(ot,{actions:o,hideLayoutMode:!0,actionSheetStyle:Qe(i?.assistBotStyle,a),onClick:e=>{const t=e?.detail?.action;t.onClick&&t.onClick(),r&&r()}})})]})})};var st="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const it={bot:void 0,sender:void 0,messageSendCallBack:void 0,closeCallback:void 0,configuration:void 0},at=ye({tagName:"cometchat-text-input",elementClass:o.CometChatTextInput,react:t,events:{ccTextInputChanged:"cc-text-input-changed",ccTextInputEntered:"cc-text-input-entered"}}),lt=e=>{let{bot:i,sender:a,messageSendCallBack:l,closeCallback:c,configuration:C}={...it,...e};const d=t.useRef(!0),u=n.localize("COMETCHAT_ASK_BOT_SUBTITLE"),p=t.useRef(n.localize("COMETCHAT_BOT_FIRST_MESSAGE")),h=t.useRef(null),m=t.useRef(""),[A,x]=t.useState([]),{theme:b}=t.useContext(U);t.useEffect(()=>{y()},[]);const y=t.useCallback(()=>{C?.botFirstMessageText&&(p.current=C.botFirstMessageText(i));const e=new s.CometChat.TextMessage(a.getUid(),p.current,n.CometChatUIKitConstants.MessageReceiverType.user);e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e.setMuid(r.CometChatUIKitUtility.ID()),e.setSender(i),x([e])},[A,x]),w=t.useCallback(e=>{m.current=e},[m]),f=t.useCallback(e=>{l&&l(m.current,i).then(t=>{const o=new s.CometChat.TextMessage(a.getUid(),t,n.CometChatUIKitConstants.MessageReceiverType.user);o.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),o.setMuid(r.CometChatUIKitUtility.ID()),o.setSender(i),o.setStatus("sent"),x(t=>{const n=t.map(t=>(t.getMuid()===e&&t.setStatus("sent"),t));return n.push(o),n})}).catch(t=>{x(t=>t.map(t=>(t.getMuid()===e&&t.setStatus("error"),t)))})},[A,x,m]),D=t.useCallback(()=>{if(!m.current)return;const e=r.CometChatUIKitUtility.ID(),t=new s.CometChat.TextMessage(i.getUid(),m.current,n.CometChatUIKitConstants.MessageReceiverType.user);t.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),t.setMuid(e),t.setSender(a),t.setStatus("wait"),x(e=>[...e,t]),h?.current?.emptyInputField(),f(e)},[A,x,f,m]),E=t.useMemo(()=>function(e,t){return g.jsx("div",{style:et(e,a),children:g.jsx(W,{id:e?.id,messageBubbleStyle:We(e,b,a,C),alignment:Pe(e,a),contentView:Oe(e,b,Pe(e,a),C),footerView:je(e,C,b),leadingView:void 0,headerView:void 0,replyView:void 0,bottomView:void 0,threadView:void 0,statusInfoView:void 0,options:[]})})},[We,Pe,Oe,je]);return g.jsx("div",{style:Ne(b),children:g.jsxs("div",{style:Ke(C?.assistBotStyle,b),children:[g.jsxs("div",{style:ze(b),children:[g.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[g.jsx("cometchat-avatar",{name:i?.getName(),avatarStyle:JSON.stringify((v=C?.avatarStyle,v||new o.AvatarStyle({borderRadius:"16px",width:"28px",height:"28px"}))),image:i?.getAvatar()}),g.jsxs("div",{children:[g.jsx("div",{style:Je(C?.assistBotStyle,b),children:i?.getName()}),g.jsx("div",{style:Ye(C?.assistBotStyle,b),children:u})]})]}),g.jsx("div",{children:g.jsx("cometchat-button",{iconURL:C?.closeIconURL||st,onClick:()=>{c&&c()},buttonStyle:JSON.stringify(_e(C?.assistBotStyle,b))})})]}),g.jsx(k,{listStyle:{height:"calc(100% - 90px)"},list:A,listItem:E,listItemKey:"getMuid",state:n.States.loaded,hideSearch:!0,showSectionHeader:!1,title:"",scrollToBottom:d?.current}),g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"40px",padding:"5px",boxSizing:"border-box"},children:[g.jsx(at,{style:{flex:.99},ref:h,textInputStyle:Ze(C?.textInputStyle,b),ccTextInputChanged:e=>w(e?.detail?.value),ccTextInputEntered:()=>D()}),g.jsx("cometchat-button",{iconURL:C?.sendIconURL||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSend%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSend%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.158865921%2C1.85985859%20C-0.108182698%2C1.38202197%20-0.0332622567%2C0.786017075%200.343741637%2C0.389140701%20C0.72074553%2C-0.00773567366%201.31211969%2C-0.113146836%201.80303259%2C0.129025252%20L17.6480326%2C8.17819192%20C17.857662%2C8.28481329%2017.9896898%2C8.50008892%2017.9896898%2C8.73527525%20C17.9896898%2C8.97046158%2017.857662%2C9.18573721%2017.6480326%2C9.29235859%20L1.80303259%2C17.3523586%20C1.31211969%2C17.5945307%200.72074553%2C17.4891195%200.343741637%2C17.0922431%20C-0.0332622567%2C16.6953668%20-0.108182698%2C16.0993619%200.158865921%2C15.6215253%20L4.37386592%2C8.73485859%20L0.158865921%2C1.85985859%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2217.9896993%22%20y1%3D%228.73485859%22%20x2%3D%224.36969925%22%20y2%3D%228.73485859%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:()=>D(),buttonStyle:JSON.stringify(Xe(C?.assistBotStyle,b))})]})]})});var v};class ct extends Ue{constructor(e,t){super(e),this.bots=[],this.theme=new n.CometChatTheme({}),this.onMessageSent=async(e,t)=>new Promise(async(o,r)=>{try{let r,i=this.user?this.user?.getUid():this.group?.getGuid(),a=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(r=await(this.configuration?.apiConfiguration(t,this.user,this.group)));return o(await s.CometChat.askBot(i,a,t.getUid(),e,r||{}))}catch(e){r(e)}}),this.closeChat=()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messages)},this.onOptionClick=e=>{n.CometChatUIEvents.ccShowPanel.next({child:g.jsx(lt,{bot:e,sender:this.loggedInUser,configuration:this.configuration,messageSendCallBack:this.onMessageSent,closeCallback:this.closeChat}),position:n.PanelAlignment.messages})},this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener(),this.getAllBots()},1e3)}getId(){return"aiassistbot"}getAIOptions(e,t,o,r,s){this.user=e,this.group=t;const i=n.localize("COMETCHAT_ASK_AI_BOT"),a=n.localize("COMETCHAT_ASK_BOT"),l=this.bots?.length,c=l>1?i:`${a} ${this.bots[0]?.getName()}`;if(r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.assistBotStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.assistBotStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.assistBotStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);if(1===l){const e=new n.CometChatMessageComposerAction({title:c,onClick:()=>{this.onOptionClick(this.bots[0])},id:"ai-assist-bot",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});a.push(e)}else if(l>1){const e=this.bots.map(e=>new n.CometChatMessageComposerAction({title:e.getName(),onClick:()=>{this.onOptionClick(e)},id:e.getUid()})),t=new n.CometChatActionsView({title:c,customView:t=>g.jsx(rt,{title:c,configuration:this.configuration,backCallback:t?.backAction,closeCallback:t?.closePopover,bots:e}),id:"ai-assist-bot",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});a.push(t)}return a}}getAllBots(){(new s.CometChat.UsersRequestBuilder).setLimit(30).setTags(["aibot"]).build().fetchNext().then(e=>{this.bots=e})}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(()=>{this.closeChat()})}}class Ct extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new ct(e,this.configuration))}getExtensionId(){return"bots"}}const gt={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"hidden"},dt=(e,t)=>({replyTextFont:t?.textFont||n.fontHelper(e.typography.caption1),replyTextColor:t?.textColor||e?.palette.getAccent(),replyBackground:t?.textBackground||"inherit",boxShadow:`0px 0px 1px ${e?.palette.getAccent600()}`,background:t?.background||"inherit",width:t?.width||"100%",height:t?.height||"100%",border:t?.textBorder||"none",borderRadius:t?.textBorderRadius||"8px",display:"flex",justifyContent:"flex-start"});var ut="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%2020010904%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FTR%2F2001%2FREC-SVG-20010904%2FDTD%2Fsvg10.dtd%22%3E%3Csvg%20version%3D%221.0%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22100.000000pt%22%20height%3D%22100.000000pt%22%20viewBox%3D%220%200%20100.000000%20100.000000%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%3E%3Cg%20transform%3D%22translate%280.000000%2C100.000000%29%20scale%280.100000%2C-0.100000%29%22fill%3D%22%23000000%22%20stroke%3D%22none%22%3E%3Cpath%20d%3D%22M375%20847%20c-221%20-73%20-326%20-269%20-254%20-472%20l22%20-62%20-25%20-74%20c-14%20-41-23%20-80%20-21%20-86%206%20-17%2042%20-15%20138%206%2077%2017%2082%2017%20138%20-1%2072%20-22%20199%20-25%20216%20-46%207%209%2021%205%2030%20-5%2013%20-21%2016%20-79%2016%20-44%200%20-98%208%20-136%2019%20-58%2018%20-67%2019%20-123%206-89%20-21%20-88%20-23%20-65%2042%20l20%2058%20-26%2056%20c-52%20116%20-25%20240%2069%20327%2077%2071%20123%2087246%2087%20123%200%20169%20-16%20245%20-86%2064%20-59%2088%20-108%2094%20-199%205%20-68%208%20-75%2028%20-78%2036-5%2048%2038%2033%20118%20-22%20125%20-94%20215%20-218%20273%20-59%2028%20-79%2032%20-167%2034%20-63%202%20-115-2%20-140%20-10z%22%2F%3E%3Cpath%20d%3D%22M687%20313%20c-16%20-15%20-4%20-42%2038%20-83%20l45%20-44%20-45%20-46%20c-47%20-48%20-56%20-74-28%20-84%2011%20-5%2031%208%2064%2040%20l48%2047%2050%20-46%20c54%20-50%2061%20-53%2079%20-35%2018%2018%2015%2025-35%2079%20l-46%2050%2048%2049%20c41%2042%2046%2051%2035%2065%20-19%2023%20-30%2019%20-80%20-30%20l-46%20-45%20-4445%20c-41%2042%20-68%2054%20-83%2038z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",pt="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%22%20height%3D%22100%22%20xml%3Aspace%3D%22preserve%22%20version%3D%221.1%22%20viewBox%3D%220%200%20100%20100%22%3E%20%20%20%20%3Cimage%20width%3D%22100%22%20height%3D%22100%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAABqxJREFUeF7tnY2x5DQMgHUdcBUAFXBUAFQAVABXAVABUAFQAVDBQQVABRwVABUAFcB8MzEsef6RbHmjl9gzO%2B%2FmNnFkfZIs%2F6zzRFYJpYEnoaRZwsgCEswIFpAFJJgGgomzPGQBCaaBYOIsD1lAgmkgmDjLQxaQYBoIJs7ykAUkmAaCifMYPeQVEXlt%2B%2FDvXPlt%2B8%2BXIvJnMJ1XxYkOBMW%2FJyJviMizBoRSQwECID4%2FiciPIgKokCUaECz%2BbRF5dwNR8oBRZQIJMN9vf5NHjdY7fH8UIED4YDKEmrK%2BE5FvRYS%2Fh5YjgWD9hCNAACRCwVM%2B38Ac0vccBeRDEflCRGaFpFG4gPlKRL4crch6%2F72B4Alfb52zVdZ0PZb7101HnauHZADYrw5CTx7zTa%2Bw1vvuBQTlYG2EJ2shMyIrStmRtQPm2WRoGAOft6wCiAhACGXWZ5sfdQ8gVq%2FAA8h%2B6GCBMCOWIxNhk2xOGzaR45MNjlnR2htmA%2FlURD5TCoMnAAFrnAGhJAZg%2BGg9B08HzJQyCwhW90KZPQECaHjDkQWvQQ4NGELo%2BzNC2AwgdKjAIG7XCvEYSzs8998JSSpOBkg7WvK%2F4w3FGwiN%2BEHRGFJKrPGeocnqfchHyL0rFE8gGhh4xfMA4UkLR9smN0%2FxAkKfgWfUwhR9BeEgslfkQNE2vOWjCkUMzQWKFxBi7scVgQlRte%2B1Fnvkda0QRkf%2F5qiAHkBaqS0DKm3qO9qe2fe3oAynxKNAiLG%2FVrRwJhipmS0ohK7uFH4UCDBK6eEZwlTJ1mpQ6CNf7%2B0rR4DUQpVLPJ0dfwbrZ6xFkpIr3aGrF0gtVLllHIMKm3072dfPlQjRFbp6gTDfVJq5ZZxxt%2Bnq2Vpv1M90C%2Bl%2BrtCPAMVUeoDUvAMQALlSITyVxihmL%2BkBUvMOOrPpawbBaBO6SG5y0%2FhmL7ECqT38it6hSYWfWjIuKxDWDViCzZUrekfSQ81QTWMxKxA6sNwOkSt7R8tLCOEYq6pYgGAFfxRqNXdeKuke10W1ZIc5LtVuSQsQBkEMhvbFZAGPS8dmaUsRhIU41ZYiC5BSdrXC1X%2FcSlMqbNoojer%2FR90ChFFpbr2DteVoy7Bm03a6oTRQZH6LbKtZLED%2BXtlVU59cQD%2BbG5OoslAtEDwDD9kXNXlVU85x0VAk0QIpuSLLslE2SkfBWeprVXN8WiClAaG6s4qirTvIUZrbUg0QR4GsDOsh4VKm5Qqk9JAzrwr2OtNdgLBjhJ0l%2B7KAHOQhpT5khaxgQFan%2FhBIKZq4ZlmltPcKmxmsfUlurV29z0CbZZVmMtfAMI8LfdG58xejJRVWraRqgQxPCVjN7KrXW4CUpgRUsfGqCra22wKkNAJdmZZV65XrLUBqU8vdWycd23KKqixAagv5awnXyRwsQHhkaYnSvP%2FISf7TVWMFUlpXRzHLSxzMwwrEdZeeg%2Fynq8IKBAXUfhtxJS8hycFAGfipBn0a6%2BkBcnUv2f8OHxhs9FDtu2pB6QHS8hL1HqSWcEG%2Fzy3Ruk0h9QKpecnZN86VZixUu0paRtYLhHpLI%2FezzwBjcJzDtS%2BHA7nqxuuQQGobi8%2BeaYUEUlrSPXv%2FQZgKCeSq4SokkCuHq5BArhyuQgK5crgKB%2BTq4SocEI9wBVQm5viJA289oPCDH%2FZ4uU3StUbEA9%2BHyrKs4Sq97SC9biLNkOb0wXwQYNie6jJRN6D02q1hgLTCFUrE6pPlo%2FzWyZ6lhtPo28OUPXWLfBygjGwcWa7eM7UJEQZI7dCABMNTcamu9K6PX27WHrQehNLTi2A4jzfnoSiYny1rz4IMM7lYClczIGjqTG%2FO2SsyeaXFOy1LBrkFOrcZCu1sb%2BsoP40CI19j%2FVnF7Uy3et%2BuRgFaIGxuSGecaA%2BvLz0fi%2F795m0H6e06GnlnXdOz%2BxI98HHNDLVAkpuiTCuQW%2BWzXYgG5MIMYNjKn1LhWcrf18urjugfQxQtkNrJabcNQdG3b0LreW1dejMbXqk5GL9HkUlGDKT7BNGeB7fu0QKhnn1nhvJT5pNeuOLqvpvwaRCZMiY8SOulKTwi3%2B1Hm1G19Of%2BvQUID09KQfHa1NNd6K3C9FqjPZxkFDOMY1Zb%2Fq3XCmS6QFd%2FwALSbwFhNsr1N%2BEcd4bcKHcO1fa1IuRGub6mnOOuMHNZ51DneCtKc3qm42BLYqxO3Q4oN0hWHSyjedQCotHSw2vS79AZA6V3L%2FbVtLtrAXFRo18lC4ifLl1qWkBc1OhXyQLip0uXmhYQFzX6VfIP%2BqZ1dOfAgekAAAAASUVORK5CYII%3D%22%2F%3E%20%20%3C%2Fsvg%3E",ht="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Icons%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20viewBox%3D%220%200%2032%2032%22%20style%3D%22enable-background%3Anew%200%200%2032%2032%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%20.st0%7Bfill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A10%3B%7D%3C%2Fstyle%3E%3Cline%20class%3D%22st0%22%20x1%3D%2216%22%20y1%3D%223%22%20x2%3D%2216%22%20y2%3D%228%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%226.8%22%20y1%3D%226.8%22%20x2%3D%2210.3%22%20y2%3D%2210.3%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%223%22%20y1%3D%2216%22%20x2%3D%228%22%20y2%3D%2216%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%226.8%22%20y1%3D%2225.2%22%20x2%3D%2210.3%22%20y2%3D%2221.7%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2216%22%20y1%3D%2229%22%20x2%3D%2216%22%20y2%3D%2224%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2225.2%22%20y1%3D%2225.2%22%20x2%3D%2221.7%22%20y2%3D%2221.7%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2229%22%20y1%3D%2216%22%20x2%3D%2224%22%20y2%3D%2216%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2225.2%22%20y1%3D%226.8%22%20x2%3D%2221.7%22%20y2%3D%2210.3%22%2F%3E%3C%2Fsvg%3E";const mt={getConversationStarterCallback:void 0,editReplyCallback:void 0,configuration:void 0},At=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}}),xt=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),bt=e=>{const{getConversationStarterCallback:o,editReplyCallback:r,configuration:s}={...mt,...e},[i,a]=t.useState(n.States.loading),[l,c]=t.useState(null),{theme:C}=t.useContext(U),d=n.localize("SOMETHING_WRONG"),u=n.localize("NO_MESSAGES_FOUND"),p=n.localize("GENERATING_ICEBREAKERS");return t.useEffect(()=>{a(n.States.loading),e&&o&&o(C).then(async t=>{t?(a(n.States.loaded),c(await async function(t){return new Promise((n,o)=>{try{let i=s?.customView;if(!i){let o=g.jsx(At,{smartReplyStyle:dt(C,s?.conversationStarterStyle),replies:t,ccReplyClicked:t=>{e&&r&&r(t?.detail?.reply)},closeIconURL:""},"conversation-starter");return n(o)}s?.customView(t).then(e=>n(e)).catch(e=>o(e))}catch(e){o(e)}})}(t))):a(n.States.empty)}).catch(e=>{a(n.States.error)})},[]),g.jsx("div",{className:"slideable-container",style:{...(h=s?.conversationStarterStyle,{display:"flex",overflow:"hidden",width:h?.width||"100%",height:h?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px"}),minHeight:"50px",width:"100%"},children:g.jsx("div",{style:gt,children:g.jsx("div",{style:{height:"100%",width:"100%",marginTop:"12px",overflow:"hidden auto"},children:i===n.States.loaded?l:function(){let e=null;switch(i){case n.States.loading:e=function(){let e=s?.loadingStateView;return g.jsx(xt,{state:n.States.loading,style:s?.conversationStarterStyle,loadingIconURL:s?.loadingIconURL||ht,loadingStateText:p,children:e?g.jsx("div",{slot:"loadingView",children:g.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=s?.errorStateView;return g.jsx(xt,{state:n.States.error,style:s?.conversationStarterStyle,errorIconURL:s?.errorIconURL||pt,errorStateText:d,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=s?.emptyStateView;return g.jsx(xt,{state:n.States.empty,style:s?.conversationStarterStyle,emptyIconURL:s?.emptyIconURL||ut,emptyStateText:u,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();case n.States.loaded:}return e}()})})});var h};class yt extends Ue{constructor(e,t){super(e),this.currentMessage=null,this.theme=new n.CometChatTheme({}),this.getConversationStarter=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getConversationStarter(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aiconversationstarter"}editReply(e){n.CometChatUIEvents.ccComposeMessage.next(e),n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)}closeIfMessageReceived(e){e?.getReceiverId()!==this.loggedInUser?.getUid()||this.currentMessage||n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)}loadConversationStarter(){n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:g.jsx(bt,{configuration:this.configuration,getConversationStarterCallback:this.getConversationStarter,editReplyCallback:this.editReply}),position:n.PanelAlignment.messageListFooter})}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.user=e.user,this.group=e.group,this.currentMessage||this.loadConversationStarter()}),n.CometChatMessageEvents.ccMessageSent.subscribe(()=>{this.currentMessage||(n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null)})}}class wt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new yt(e,this.configuration))}getExtensionId(){return"conversation-starter"}}const ft={width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"hidden"},Dt=(e,t)=>new o.PanelStyle({width:"100%",height:"fit-content",border:`1px solid ${e.palette.getPrimary()}`,borderRadius:"8px",background:e.palette.getBackground(),textColor:t?.textColor||e.palette.getAccent600(),titleColor:t?.titleTextColor||e.palette.getAccent(),textFont:t?.textFont||n.fontHelper(e.typography.text2),titleFont:t?.titleTextFont||n.fontHelper(e.typography.text1)}),Et={getConversationSummaryCallback:void 0,editReplyCallback:void 0,closeCallback:void 0,configuration:void 0};ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}});const vt=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),St=ye({tagName:"cometchat-panel",elementClass:o.CometChatPanel,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),It=e=>{const{getConversationSummaryCallback:o,editReplyCallback:r,closeCallback:s,configuration:i}={...Et,...e},[a,l]=t.useState(n.States.loading),[c,C]=t.useState(null),{theme:d}=t.useContext(U),u=n.localize("SOMETHING_WRONG"),p=n.localize("NO_MESSAGES_FOUND"),h=n.localize("GENERATING_SUMMARY"),m=n.localize("CONVERSATION_SUMMARY");return t.useEffect(()=>{l(n.States.loading),e&&o&&o(d).then(async e=>{e?(l(n.States.loaded),C(await async function(e){return new Promise((t,n)=>{try{let o=i?.customView;if(!o){let n=g.jsx(St,{panelStyle:Dt(d,i?.conversationSummaryStyle),title:m,text:e,closeIconUrl:i?.closeIconURL||st,ccCloseClicked:()=>s()});return t(n)}i?.customView(e,s).then(e=>t(e)).catch(e=>n(e))}catch(e){n(e)}})}(e))):l(n.States.empty)}).catch(e=>{l(n.States.error)})},[]),g.jsx("div",{className:"slideable-container",style:{...(A=i?.conversationSummaryStyle,{display:"flex",overflow:"hidden",width:A?.width||"100%",height:A?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px"}),minHeight:"50px",width:"100%"},children:g.jsx("div",{style:ft,children:g.jsx("div",{style:{height:"100%",width:"95%",marginTop:"12px",overflow:"hidden auto"},children:a===n.States.loaded?c:function(){let e=null;switch(a){case n.States.loading:e=function(){let e=i?.loadingStateView;return g.jsx(vt,{state:n.States.loading,style:i?.conversationSummaryStyle,loadingIconURL:i?.loadingIconURL||ht,loadingStateText:h,children:e?g.jsx("div",{slot:"loadingView",children:g.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=i?.errorStateView;return g.jsx(vt,{state:n.States.error,style:i?.conversationSummaryStyle,errorIconURL:i?.errorIconURL||pt,errorStateText:u,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=i?.emptyStateView;return g.jsx(vt,{state:n.States.empty,style:i?.conversationSummaryStyle,emptyIconURL:i?.emptyIconURL||ut,emptyStateText:p,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();case n.States.loaded:}return e}()})})});var A};class Ft extends Ue{constructor(e,t){super(e),this.currentMessage=null,this.unreadMessageCount=0,this.theme=new n.CometChatTheme({}),this.LISTENER_ID="aiconversationsummary__listener",this.closePanel=()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)},this.getConversationSummary=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getConversationSummary(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aiconversationsummary"}loadConversationSummary(){n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:g.jsx(It,{configuration:this.configuration,getConversationSummaryCallback:this.getConversationSummary,closeCallback:this.closePanel}),position:n.PanelAlignment.messageListFooter})}getAIOptions(e,t,o,r,s){if(this.user=e,this.group=t,r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.conversationSummaryStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.conversationSummaryStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.conversationSummaryStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);let l=new n.CometChatMessageComposerAction({title:n.localize("CONVERSATION_SUMMARY"),onClick:()=>{this.loadConversationSummary()},id:"ai-conversation-summary",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});return a.push(l),a}}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.user=e.user,this.group=e.group,this.unreadMessageCount=e.unreadMessageCount??0,this.unreadMessageCount>(this.configuration?.unreadMessageThreshold??30)&&this.loadConversationSummary()})}}class kt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Ft(e,this.configuration))}getExtensionId(){return"conversation-summary"}}const Tt=(e,t)=>({display:"flex",width:e?.width||"100%",height:e?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px",background:e?.background||t?.palette.getBackground(),borderRadius:e?.borderRadius||"8px"}),Mt={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"auto",height:"100%"},Bt=(e,t)=>({replyTextFont:t?.textFont||n.fontHelper(e.typography.caption1),replyTextColor:t?.textColor||e?.palette.getAccent(),replyBackground:t?.textBackground||"inherit",boxShadow:`0px 0px 1px ${e?.palette.getAccent600()}`,background:t?.background||"inherit",border:t?.textBorder||"none",borderRadius:t?.textBorderRadius||"8px",display:"flex",justifyContent:"flex-start"});function Lt(e,t){return{height:"24px",width:"24px",buttonIconTint:e?.backIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}}function Ut(e,t){return{display:"flex",justifyContent:"space-between",alignItems:"center",font:e?.titleFont||n.fontHelper(t.typography.text2),color:e?.titleColor||t?.palette.getAccent()}}const Rt={title:n.localize("SUGGEST_A_REPLY"),getSmartRepliesCallback:void 0,editReplyCallback:void 0,closeCallback:void 0,backCallback:void 0,configuration:void 0},Pt=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}}),Ot=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),jt=e=>{const{title:o,getSmartRepliesCallback:r,editReplyCallback:s,closeCallback:i,backCallback:a,configuration:l}={...Rt,...e},[c,C]=t.useState(n.States.loading),[d,u]=t.useState(null),{theme:p}=t.useContext(U),h=n.localize("SOMETHING_WRONG"),m=n.localize("NO_MESSAGES_FOUND"),A=n.localize("GENERATING_REPLIES");return t.useEffect(()=>{C(n.States.loading),e&&r&&r(p).then(async t=>{t?(C(n.States.loaded),u(await async function(t){return new Promise((n,r)=>{try{let c=l?.customView;if(!c){let r=[];Object.keys(t).forEach(e=>{t[e]&&""!==t[e]&&r.push(t[e])});let c=g.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"10px",boxSizing:"border-box"},children:[g.jsxs("div",{style:Ut(l?.smartRepliesStyle,p),children:[g.jsx("div",{children:g.jsx(J,{iconURL:tt,onClick:()=>a?a():null,buttonStyle:Lt(l?.smartRepliesStyle,p)})}),g.jsx("div",{children:o}),g.jsx("div",{style:{flex:.2}})]}),g.jsx(Pt,{smartReplyStyle:Bt(p,l?.smartRepliesStyle),replies:r,ccReplyClicked:t=>{e&&s&&s(t?.detail?.reply),e&&i&&i()},closeIconURL:""},"smart-replies")]});return n(c)}l?.customView(t,i,a).then(e=>n(e)).catch(e=>r(e))}catch(e){r(e)}})}(t))):C(n.States.empty)}).catch(e=>{C(n.States.error)})},[]),g.jsx("div",{className:"slideable-container",style:Tt(l?.smartRepliesStyle,p),children:g.jsxs("div",{style:Mt,children:[c===n.States.loaded?g.jsx("div",{style:{height:"100%"},children:d}):null,c!==n.States.loaded?function(){let e=null;switch(c){case n.States.loading:e=function(){let e=l?.loadingStateView;return g.jsx(Ot,{state:n.States.loading,style:l?.smartRepliesStyle,loadingIconURL:l?.loadingIconURL||ht,loadingStateText:A,children:e?g.jsx("div",{slot:"loadingView",children:g.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=l?.errorStateView;return g.jsx(Ot,{state:n.States.error,style:l?.smartRepliesStyle,errorIconURL:l?.errorIconURL||pt,errorStateText:h,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=l?.emptyStateView;return g.jsx(Ot,{state:n.States.empty,style:l?.smartRepliesStyle,emptyIconURL:l?.emptyIconURL||ut,emptyStateText:m,children:e?g.jsx("div",{slot:"errorView",children:g.jsx(e,{})}):null})}();case n.States.loaded:}return e}():null]})})};class Vt extends Ue{constructor(e,t){super(e),this.theme=new n.CometChatTheme({}),this.isModalClosed=!0,this.childRefCallback=e=>{this.buttonRef=e},this.getSmartReplies=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getSmartReplies(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aismartreplies"}editReply(e){n.CometChatUIEvents.ccComposeMessage.next(e)}closeIfMessageReceived(e){e?.getReceiverId()===this.loggedInUser?.getUid()&&this.closeCallback&&(this.isModalClosed||(this.closeCallback(),this.isModalClosed=!0))}getAIOptions(e,t,o,r,s){if(this.user=e,this.group=t,r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.smartRepliesStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.smartRepliesStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.smartRepliesStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);let l=new n.CometChatActionsView({title:n.localize("SUGGEST_A_REPLY"),customView:e=>(this.isModalClosed=!1,this.closeCallback=e?.closePopover,g.jsx(jt,{title:n.localize("SUGGEST_A_REPLY"),configuration:this.configuration,getSmartRepliesCallback:this.getSmartReplies,editReplyCallback:this.editReply,closeCallback:e.closePopover,backCallback:e.backAction})),id:"ai-smart-replies",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});return a.push(l),a}}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)})}}class Gt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Vt(e,this.configuration))}getExtensionId(){return"smart-replies"}}const Ht={resizeIconHoverText:n.localize("RESIZE"),sessionID:"",minimizeIconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M21%203L13.8%2010.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.2%2019.2V13.8H4.80005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.8%204.8V10.2H19.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.2%2013.8L3%2021%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",maximizeIconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.2%2013.8L3%2021%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%208.4V3H15.6%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M3%2015.6V21H8.4%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%203L13.8%2010.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",callSettingsBuilder:void 0,ongoingCallStyle:{maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"grey",minHeight:"400px",minWidth:"400px",minimizeIconTint:"white",maximizeIconTint:"white"},onError:e=>{console.log(e)},callWorkflow:n.CallWorkflow.defaultCalling},Qt=e=>{const[o,i]=t.useState(null),a=t.useRef(null),{resizeIconHoverText:l,sessionID:c,minimizeIconURL:C,maximizeIconURL:d,ongoingCallStyle:u,callSettingsBuilder:p,onError:h,callWorkflow:m}={...Ht,...e},A=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)h?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);h?.(n)}},[h]),x=t.useCallback(()=>{if(p)return p;{let e=!1;return(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e).setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{m===n.CallWorkflow.defaultCalling&&(r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null))},onCallEndButtonPressed:()=>{m===n.CallWorkflow.defaultCalling?s.CometChat.endCall(c).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e)}).catch(e=>{A(e)}):(n.CometChatCallEvents.ccCallEnded.next(null),r.CometChatUIKitCalls.endSession())},onError:e=>{A(e)}})).build()}},[p,m,A,c]),b=t.useCallback(()=>{if(o){const e=o.getAuthToken();r.CometChatUIKitCalls.generateToken(c,e).then(e=>{r.CometChatUIKitCalls.startSession(e?.token,x(),a.current)},e=>{A(e)})}else s.CometChat.getLoggedinUser().then(e=>{const t=e.getAuthToken();r.CometChatUIKitCalls.generateToken(c,t).then(e=>{r.CometChatUIKitCalls.startSession(e?.token,x(),a.current)},e=>{A(e)})})},[c,x,o,A]);return function(e,n,o){t.useEffect(()=>{Zn.getLoggedinUser().then(t=>{t&&e(t)})},[e]),t.useEffect(()=>{""!==n&&o()},[n,o])}(i,c,b),""!==c?g.jsx("cometchat-callscreen-wrapper",{callscreenStyle:JSON.stringify(u),resizeIconHoverText:l,minimizeIconURL:C,maximizeIconURL:d,sessionID:c,children:g.jsx("div",{id:"cc-callscreen_ref",style:{width:"100%",height:"100%",inset:"0"},className:"cc-callscreen__view",ref:a})}):g.jsx(g.Fragment,{})},Nt=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius,display:"flex",justifyContent:"center"}),Kt={width:"360px",height:"581px",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px"},zt={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},Jt=e=>new r.CallButtonsStyle({width:"100%",height:"100%",background:"transparent",border:"none",borderRadius:"0",voiceCallIconTint:e.palette.getPrimary(),videoCallIconTint:e.palette.getPrimary(),voiceCallIconTextFont:n.fontHelper(e.typography.caption1),videoCallIconTextFont:n.fontHelper(e.typography.caption1),voiceCallIconTextColor:e.palette.getPrimary(),videoCallIconTextColor:e.palette.getPrimary(),buttonPadding:"8px 32px",buttonBackground:e.palette.getAccent100(),buttonBorder:"0",buttonBorderRadius:"8px"}),Yt=e=>new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:e.palette.getAccent900(),maximizeIconTint:e.palette.getAccent900()});var _t="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Wt=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius}),Zt=e=>({textFont:e?.subtitleTextFont,textColor:e?.subtitleTextColor}),Xt={height:"fit-content",width:"fit-content",buttonTextFont:"400 12px Inter",buttonTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px",border:"none",buttonIconTint:"white",background:"",iconBackground:"red"},qt={height:"100%",width:"100%",border:"inherite",borderRadius:"inherite",background:"transparent",titleFont:"700 22px Inter",titleColor:"black"},$t=e=>new o.AvatarStyle({borderRadius:"50%",width:"180px",height:"180px",border:`1px solid ${e.palette.getAccent100()}`,backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),en=e=>new r.OutgoingCallStyle({width:"100%",height:"100%",background:e.palette.getBackground(),border:"none",borderRadius:"0",titleTextFont:n.fontHelper(e.typography.title1),titleTextColor:e.palette.getAccent(),subtitleTextFont:n.fontHelper(e.typography.subtitle1),subtitleTextColor:e.palette.getAccent600(),declineButtonTextFont:n.fontHelper(e.typography.caption1),declineButtonTextColor:e.palette.getAccent600(),declineButtonIconTint:e.palette.getAccent("dark"),declineButtonIconBackground:e.palette.getError()});var tn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const nn=e=>{const{call:i,disableSoundForCalls:a=!1,customSoundForCalls:l="",declineButtonText:c=n.localize("CANCEL"),declineButtonIconURL:C=tn,customView:d=null,onError:u=e=>{console.log(e)},avatarStyle:p=new o.AvatarStyle({borderRadius:"50%",width:"180px",height:"180px"}),outgoingCallStyle:h=new r.OutgoingCallStyle({width:"100%",height:"100%",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonTextFont:"400 12px Inter",declineButtonTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonIconTint:"white",declineButtonIconBackground:"red"}),onCloseClicked:m=()=>{}}=e,{theme:A}=t.useContext(U),x=n.IconButtonAlignment.top,b=t.useRef(p),y=t.useRef(h),w=t.useRef(Xt),f=t.useRef(null),D=t.useRef(null);f.current=i,b.current={...$t(A),...b?.current},y.current={...en(A),...y?.current},w.current=(e=>({height:"fit-content",width:"fit-content",buttonTextFont:e?.declineButtonTextFont,buttonTextColor:e?.declineButtonTextColor,borderRadius:"8px",border:"none",buttonIconTint:e?.declineButtonIconTint,background:"",iconBackground:e?.declineButtonIconBackground}))(y?.current),qt.titleColor=y?.current?.titleTextColor,qt.titleFont=y?.current?.titleTextFont;let E=n.localize("CALLING");const v=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)u(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);u(n)}},[u]),S=t.useCallback(()=>{try{r.CometChatSoundManager.pause(),m&&m()}catch(e){v(e)}},[m,v]),I=t.useCallback(()=>{try{a||(l?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall,l):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall))}catch(e){v(e)}},[a,l,v]);return function(e,n,o,s){t.useEffect(()=>()=>{r.CometChatSoundManager.pause()},[]),t.useEffect(()=>(r.CometChatSoundManager.audio?(r.CometChatSoundManager.pause(),e()):e(),()=>{r.CometChatSoundManager.pause()}),[n,e]),t.useEffect(()=>{const e=s.current;if(e)return e.addEventListener("cc-button-clicked",o),()=>{e.removeEventListener("cc-button-clicked",o)}},[o,s])}(I,i,S,D),g.jsx(g.Fragment,{children:g.jsx("div",{className:"cc-outgoingcall__wrapper",style:Wt(y?.current),children:d?g.jsx("div",{className:"cc-outgoingcall__custom-view",children:d}):f.current?g.jsxs("cometchat-card",{title:f.current?.getReceiver()?.getName(),cardStyle:JSON.stringify(qt),avatarName:f.current?.getReceiver()?.getName(),avatarURL:f.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?f.current?.getReceiver()?.getAvatar():f.current?.getReceiver()?.getIcon(),avatarStyle:JSON.stringify(b?.current),children:[g.jsx("cometchat-label",{slot:"subtitleView",labelStyle:JSON.stringify(Zt(y?.current)),text:E,children:" "}),g.jsx("div",{slot:"bottomView",children:g.jsx("cometchat-icon-button",{ref:D,text:c,iconURL:C,alignment:x,buttonStyle:JSON.stringify(w?.current)})})]}):null})})};var on="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const rn={voiceCallIconURL:_t,voiceCallIconText:n.localize("VOICE_CALL"),voiceCallIconHoverText:n.localize("VOICE_CALL"),videoCallIconURL:on,videoCallIconText:n.localize("VIDEO_CALL"),videoCallIconHoverText:n.localize("VIDEO_CALL"),callButtonsStyle:{width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent"},onVoiceCallClick:void 0,onVideoCallClick:void 0,onError:e=>{console.log(e)},outgoingCallConfiguration:new r.OutgoingCallConfiguration({}),ongoingCallConfiguration:new r.CallScreenConfiguration({})},sn=e=>{const{user:o,group:i,voiceCallIconURL:a,voiceCallIconText:l,voiceCallIconHoverText:c,videoCallIconURL:C,videoCallIconText:d,videoCallIconHoverText:u,callButtonsStyle:p,onVoiceCallClick:h,onVideoCallClick:A,onError:x,outgoingCallConfiguration:b,ongoingCallConfiguration:y}={...rn,...e},{theme:w}=t.useContext(U),[f,D]=t.useState(null),E=t.useRef(null);E.current={...Jt(w),...p};const v=t.useRef(null);var S;v.current=(S=E?.current,{buttonIconTint:S?.voiceCallIconTint??"RGB(51, 153, 255)",buttonTextFont:S?.voiceCallIconTextFont??"400 12px Inter",buttonTextColor:S?.voiceCallIconTextColor??"RGB(51, 153, 255)",padding:S?.buttonPadding??"8px 32px",background:S?.buttonBackground??"transparent",border:S?.border??"none",borderRadius:S?.buttonBorderRadius??"0",...zt});const I=t.useRef(null);I.current=(e=>({buttonIconTint:e?.videoCallIconTint??"RGB(51, 153, 255)",buttonTextFont:e?.videoCallIconTextFont??"400 12px Inter",buttonTextColor:e?.videoCallIconTextColor??"RGB(51, 153, 255)",padding:e?.buttonPadding??"8px 32px",background:e?.buttonBackground??"transparent",border:e?.border??"none",borderRadius:e?.buttonBorderRadius??"0",...zt}))(E?.current);const[F,k]=t.useState(o),[T,M]=t.useState(i),[B,L]=t.useState(!1),[R,P]=t.useState(!1),[O,j]=t.useState(!1),V=t.useRef(null),G=t.useRef(null),H=t.useRef(null),Q=t.useRef(""),N=m(h),K=m(A);let z="callbuttons_"+(new Date).getTime();const J=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)x?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);x?.(n)}},[x]),Y={...y?.ongoingCallStyle,...Yt(w)},_={...b?.outgoingCallStyle,...Kt},W=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallRejected.subscribe(()=>{j(!1)}),t=n.CometChatCallEvents.ccOutgoingCall.subscribe(()=>{j(!0)}),o=n.CometChatCallEvents.ccCallEnded.subscribe(()=>{j(!1),H.current=null,Q.current="",L(!1),P(!1)});return()=>{try{o?.unsubscribe(),e?.unsubscribe(),t?.unsubscribe()}catch(e){J(e)}}}catch(e){J(e)}},[J]),Z=t.useCallback(()=>{try{s.CometChat.addCallListener(z,new s.CometChat.CallListener({onIncomingCallReceived:()=>{j(!0)},onIncomingCallCancelled:()=>{j(!1)},onOutgoingCallRejected:()=>{P(!1),j(!1),H.current=null,Q.current=""},onOutgoingCallAccepted:e=>{if(e.getSender()?.getUid()===f?.getUid()||e.getSessionId()!==H.current?.getSessionId())return P(!1),j(!1),H.current=null,void(Q.current="");Q.current=e.getSessionId(),P(!1),L(!0),j(!0),H.current=e}}))}catch(e){J(e)}},[J,z]),X=t.useCallback(()=>{try{s.CometChat.removeCallListener(z)}catch(e){J(e)}},[J,z]),q=()=>{j(!1),H.current=null,Q.current="",L(!1),P(!1)};const $=t.useCallback(e=>{try{const t=F?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,o=F?F?.getUid():T?.getGuid(),r=new s.CometChat.Call(o,e,t);s.CometChat.initiateCall(r).then(e=>{H.current=e,P(!0),n.CometChatCallEvents.ccOutgoingCall.next(e)},e=>{J(e)})}catch(e){J(e)}},[F,T,J]),ee=t.useCallback(()=>{try{F&&$(n.CometChatUIKitConstants.MessageTypes.audio)}catch(e){J(e)}},[F,$,J]),te=t.useCallback(()=>{try{const e=F?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,t=F?F?.getUid():T?.getGuid(),o=Q.current,i={sessionID:o,sessionId:o,callType:n.CometChatUIKitConstants.MessageTypes.video},a=n.CometChatUIKitConstants.calls.meeting,l=`group_${o}`,c=new s.CometChat.CustomMessage(t,e,a,i);c.setMetadata({incrementUnreadCount:!0}),c.shouldUpdateConversation(!0),c.setSender(f),c.setConversationId(l),c.sentAt=r.CometChatUIKitUtility.getUnixTimestamp(),c.muid=r.CometChatUIKitUtility.ID(),n.CometChatMessageEvents.ccMessageSent.next({message:c,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(c).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},e=>{J(e)})}catch(e){J(e)}},[F,T,f,J]),ne=t.useCallback(()=>{try{F&&$(n.CometChatUIKitConstants.MessageTypes.video),T&&(Q.current=T?.getGuid(),te(),L(!0))}catch(e){J(e)}},[F,T,te,J,$]),oe=t.useCallback(()=>{const e=H.current;if(e)try{r.CometChatSoundManager.pause(),s.CometChat.rejectCall(e.getSessionId(),n.CometChatUIKitConstants.calls.cancelled).then(e=>{j(!1),P(!1),n.CometChatCallEvents.ccCallRejected.next(e),H.current=null},e=>{J(e)}),P(!1)}catch(e){J(e)}},[J]),re=t.useCallback(()=>{if(v.current)return v.current.buttonIconTint=((e,t,n)=>e?n.palette.getAccent600():t?.voiceCallIconTint)(O,E.current??void 0,w),v.current},[O,w]),se=t.useCallback(()=>{if(I.current)return I.current.buttonIconTint=((e,t,n)=>e?n.palette.getAccent600():t?.videoCallIconTint)(O,E.current??void 0,w),I.current},[O,w]);!function(e,n,o,r,i,a,l,c,C,g,d,u,p,h,m,A,x){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)},e=>{a(e)})},[n,a]),t.useEffect(()=>{let t;return e&&(t=i(),l()),()=>{t?.(),c()}},[e,l,c,i]),t.useEffect(()=>{o&&(C(o),g(null))},[o,C,g]),t.useEffect(()=>{r&&(C(null),g(r))},[r,C,g]),t.useEffect(()=>{const e=d.current,t=u.current;if(!e&&!t)return;const n=()=>{const e=A.current;e?e():p()},o=()=>{const e=x.current;e?e():h()};return m?(e?.removeEventListener("cc-button-clicked",n),t?.removeEventListener("cc-button-clicked",o)):(e?.addEventListener("cc-button-clicked",n),t?.addEventListener("cc-button-clicked",o)),()=>{e?.removeEventListener("cc-button-clicked",n),t?.removeEventListener("cc-button-clicked",o)}},[m,p,h,A,x,d,u])}(f,D,o,i,W,J,Z,X,k,M,V,G,ee,ne,O,N,K);const ie=O?{disabled:!0}:{};return g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"cc-call-buttons__wrapper",style:Nt(E.current),children:g.jsxs("div",{className:"cc-call-buttons",style:{display:"flex",gap:"16px"},children:[F?g.jsx("cometchat-button",{...ie,buttonStyle:JSON.stringify(re()),text:l,hoverText:c,iconURL:a||_t,ref:V}):null,F||T?g.jsx("cometchat-button",{...ie,buttonStyle:JSON.stringify(se()),text:d,hoverText:u,iconURL:C||on,ref:G}):null]})}),B&&null!=Q.current?g.jsx(Qt,{ongoingCallStyle:Y,sessionID:Q.current,callSettingsBuilder:function(){let e=H.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio;const t=y?.callSettingsBuilder?y.callSettingsBuilder(e,o,i):(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e),a=Q.current;return t.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{H.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&(r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null),q())},onCallEndButtonPressed:()=>{H.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?s.CometChat.endCall(a).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e),q()}).catch(e=>{J(e)}):q()},onError:e=>{J(e)}})),t.build()}(),maximizeIconURL:y?.maximizeIconURL,minimizeIconURL:y?.minimizeIconURL}):null,R&&H.current?g.jsx("cometchat-backdrop",{children:g.jsx(nn,{onCloseClicked:b?.onCloseClicked??oe,customSoundForCalls:b?.customSoundForCalls,customView:b?.customView,disableSoundForCalls:b?.disableSoundForCalls,onError:b?.onError,outgoingCallStyle:_,call:H.current})}):null]})};const an=Object.freeze({meeting:"meeting",ongoing:"ongoing",ended:"ended",initiated:"initiated",cancelled:"cancelled",rejected:"rejected",unanswered:"unanswered"}),ln=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t});class cn extends Ue{constructor(e,t){super(e),this.loggedInUser=null,this.configuration=new r.CallingConfiguration({}),this.addLoginListener(),this.getLoggedInUser(),this.configuration=t}addLoginListener(){s.CometChat.addLoginListener("login_listener",new s.CometChat.LoginListener({logoutSuccess:()=>{try{let e=s.CometChat.getActiveCall();e&&s.CometChat.endCall(e.getSessionId())}catch(e){console.log("error in endCall on logout",e)}}}))}async getLoggedInUser(){this.loggedInUser=await s.CometChat.getLoggedinUser()}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(an.meeting)||e.push(an.meeting),e.includes(n.CometChatUIKitConstants.MessageTypes.audio)||e.push(n.CometChatUIKitConstants.MessageTypes.audio),e.includes(n.CometChatUIKitConstants.MessageTypes.video)||e.push(n.CometChatUIKitConstants.MessageTypes.video),e}getId(){return"calling"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.call)||e.push(n.CometChatUIKitConstants.MessageCategory.call),e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateTypeExist(e,t){return e.some(e=>e.type===t)}checkIfTemplateCategoryExist(e,t){return e.some(e=>e.category===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(e,t);return this.checkIfTemplateTypeExist(o,an.meeting)||o.push(this.getDirectCallTemplate(this.theme)),this.checkIfTemplateCategoryExist(o,n.CometChatUIKitConstants.MessageCategory.call)||o.push(...this.getDefaultCallTemplate(this.theme)),o}getDirectCallTemplate(e){return new n.CometChatMessageTemplate({type:an.meeting,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>t.getDeletedAt()?super.getDeleteMessageBubble(t,this.theme):this.getDirectCallMessageBubble(t,n,e),options:(e,t,n,o)=>Be.getDataSource().getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getDefaultCallTemplate(e){return[new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.audio,category:n.CometChatUIKitConstants.MessageCategory.call,contentView:(t,n)=>this.getDefaultAudioCallMessageBubble(t,n,e),bottomView:(e,t)=>super.getBottomView(e,t)}),new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.video,category:n.CometChatUIKitConstants.MessageCategory.call,contentView:(t,n)=>this.getDefaultVideoCallMessageBubble(t,n,e),bottomView:(e,t)=>super.getBottomView(e,t)})]}getCallBubbleStyle(e,t){return e===n.MessageBubbleAlignment.left?{titleFont:n.fontHelper(t.typography.text2),titleColor:t.palette.getAccent(),iconTint:t.palette.getPrimary(),buttonTextFont:n.fontHelper(t.typography.text2),buttonTextColor:t.palette.getAccent("dark"),buttonBackground:t.palette.getPrimary(),width:"240px",borderRadius:"12px"}:{titleFont:n.fontHelper(t.typography.text2),titleColor:t.palette.getAccent("dark"),iconTint:t.palette.getAccent("dark"),buttonTextFont:n.fontHelper(t.typography.text2),buttonTextColor:t.palette.getPrimary(),buttonBackground:t.palette.getAccent("dark"),width:"240px",background:t.palette.getPrimary(),borderRadius:"12px"}}getSessionId(e){let t=e.getData();return t?.customData?.sessionID}getCallBubbleTitle(e){return e.getSender()&&e.getSender().getUid()!==this.loggedInUser?.getUid()?`${e.getSender().getName()} ${n.localize("INITIATED_GROUP_CALL")}`:n.localize("YOU_INITIATED_GROUP_CALL")}getDirectCallMessageBubble(e,r,s){let i=n.DocumentIconAlignment.left,a=this.getCallBubbleStyle(r,s),l=this.getSessionId(e),c=this.getCallBubbleTitle(e),C=n.localize("JOIN");const d=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});return g.jsx(d,{hideSeparator:!0,iconAlignment:i,documentStyle:a,URL:l,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",title:c,buttonText:C,ccClicked:()=>{this.startDirectCall(l,e,this.theme||s)}})}startDirectCall(e,t,s){let i;const a=t.getCustomData()?.callType===n.CometChatUIKitConstants.MessageTypes.audio;i=this.configuration?.groupCallSettingsBuilder?this.configuration.groupCallSettingsBuilder(t):(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(a),i.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEndButtonPressed:()=>{n.CometChatUIEvents.ccShowOngoingCall.next({child:null})}}));const l=i.build(),c=new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:s.palette.getAccent900(),maximizeIconTint:s.palette.getAccent900()}),C=g.jsx(Qt,{ongoingCallStyle:c,sessionID:e,callWorkflow:n.CallWorkflow.directCalling,callSettingsBuilder:l});n.CometChatUIEvents.ccShowOngoingCall.next({child:C})}callStatusStyle(e,t){return this.loggedInUser?{buttonTextFont:n.fontHelper(t.typography.subtitle2),buttonTextColor:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?t.palette.getError():t.palette.getAccent600(),borderRadius:"10px",border:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?"1px solid RGBA(255, 59, 48, 0.2)":`1px solid ${t.palette.getAccent100()}`,buttonIconTint:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?t.palette.getError():t.palette.getAccent600(),background:"transparent",iconBackground:"transparent",padding:"2px 12px 2px 0",gap:"0",height:"25px",justifyContent:"center"}:{}}getCallActionMessage(e){return r.CallingDetailsUtils.getCallStatus(e,this.loggedInUser)}getDefaultAudioCallMessageBubble(e,t,n){const o=this.callStatusStyle(e,n),r=this.getCallActionMessage(e);return g.jsx(ln,{disabled:!0,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:o,text:r})}getDefaultVideoCallMessageBubble(e,t,n){const o=this.callStatusStyle(e,n),r=this.getCallActionMessage(e);return g.jsx(ln,{disabled:!0,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:o,text:r})}getLastConversationMessage(e,t,o){let i="";if(e.getLastMessage()&&e.getLastMessage().category==n.CometChatUIKitConstants.MessageCategory.call){let n=e.getLastMessage();i=r.CallingDetailsUtils.getCallStatus(n,t)}else if(e?.getLastMessage()&&e.getLastMessage().type==n.CometChatUIKitConstants.calls.meeting){let r=e.getLastMessage();i=r.getSender()&&r?.getSender()?.getUid()!=t.getUid()?`${r.getSender().getName()} ${n.localize("INITIATED_GROUP_CALL")}`:n.localize("YOU_INITIATED_GROUP_CALL");let a=e.getLastMessage();a&&a.getMentionedUsers().length&&a instanceof s.CometChat.TextMessage&&o&&!o.disableMentions&&(i=this.getMentionsFormattedText(a,i,o))}else i=super.getLastConversationMessage(e,t,o);return i}getAuxiliaryHeaderMenu(e,t){let n=[];const o={width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent",buttonPadding:"0",buttonBackground:"transparent",buttonBorder:"0 4px",buttonBorderRadius:"8px",...this.configuration?.callButtonsConfiguration?.callButtonsStyle};let r=g.jsx(sn,{user:e,group:t,callButtonsStyle:o,voiceCallIconText:"",videoCallIconText:"",videoCallIconURL:this.configuration?.callButtonsConfiguration?.videoCallIconURL,voiceCallIconURL:this.configuration?.callButtonsConfiguration?.voiceCallIconURL,onError:this.configuration?.callButtonsConfiguration?.onError,outgoingCallConfiguration:this.configuration?.callButtonsConfiguration?.outgoingCallConfiguration,ongoingCallConfiguration:this.configuration?.callButtonsConfiguration?.ongoingCallConfiguration},"callbuttons");return n.push(r),n}}class Cn extends r.CallingExtensionDataSource{constructor(e){super(),this.configuration=e}enable(){Be.enable(e=>new cn(e,this.configuration))}addExtension(){Be.enable((e,t)=>new cn(e,t))}getExtensionId(){return"calling"}}class gn{enable(){s.CometChat.isExtensionEnabled(this.getExtensionId()).then(e=>{e&&this.addExtension()},e=>{})}}var dn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FCollaborative%20Document%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FCollaborative-Document%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.019664%2C11.0497498%20C20.2968766%2C11.0497498%2019.6037718%2C11.3372517%2019.0931699%2C11.8488579%20L11.9722287%2C18.9696649%20C11.8675218%2C19.07437%2011.7961523%2C19.207727%2011.7671152%2C19.3529288%20L11.0671938%2C22.8529288%20C10.9622469%2C23.3777219%2011.4249469%2C23.8404018%2011.9497354%2C23.7354323%20L15.4493424%2C23.0354323%20C15.5945931%2C23.0063789%2015.7279879%2C22.9349647%2015.8327036%2C22.830196%20L22.9504376%2C15.7088627%20C24.0147495%2C14.6469387%2024.0170552%2C12.9221237%2022.9548584%2C11.8566265%20L22.9136114%2C11.8181375%20C22.4355563%2C11.3372517%2021.7424514%2C11.0497498%2021.019664%2C11.0497498%20Z%20M21.019664%2C12.5497498%20C21.2977603%2C12.5497498%2021.5660731%2C12.6445675%2021.7814054%2C12.816289%20L21.9254022%2C12.9466625%20L22.00838%2C13.0404351%20C22.3677898%2C13.4966868%2022.3370963%2C14.2018865%2021.890239%2C14.6477416%20L14.931%2C21.609%20L12.758%2C22.043%20L13.193%2C19.869%20L20.1543459%2C12.9090017%20C20.3840891%2C12.6788071%2020.6952184%2C12.5497498%2021.019664%2C12.5497498%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.3982707%2C1.25%20C18.5339913%2C1.25%2019.463993%2C2.13072139%2019.5427157%2C3.24645803%20L19.5481135%2C3.4%20L19.5481135%2C9.7%20C19.5481135%2C10.1142136%2019.2123271%2C10.45%2018.7981135%2C10.45%20C18.4184177%2C10.45%2018.1046226%2C10.1678461%2018.0549601%2C9.80177056%20L18.0481135%2C9.7%20L18.0481135%2C3.4%20C18.0481135%2C3.07363278%2017.8076479%2C2.80347042%2017.4942955%2C2.75704724%20L17.3982707%2C2.75%20L3.39984279%2C2.75%20C3.07358878%2C2.75%202.80346372%2C2.99049261%202.75704639%2C3.30394351%20L2.75%2C3.4%20L2.75%2C18.8%20C2.75%2C19.1263672%202.99046561%2C19.3965296%203.30381804%2C19.4429528%20L3.39984279%2C19.45%20L8.99921396%2C19.45%20C9.41342753%2C19.45%209.74921396%2C19.7857864%209.74921396%2C20.2%20C9.74921396%2C20.5796958%209.46706008%2C20.893491%209.10098452%2C20.9431534%20L8.99921396%2C20.95%20L3.39984279%2C20.95%20C2.26412221%2C20.95%201.33412057%2C20.0692786%201.25539778%2C18.953542%20L1.25%2C18.8%20L1.25%2C3.4%20C1.25%2C2.26423244%202.13062249%2C1.33412985%203.24630755%2C1.25539838%20L3.39984279%2C1.25%20L17.3982707%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.5985851%2C5.45%20C15.0127987%2C5.45%2015.3485851%2C5.78578644%2015.3485851%2C6.2%20C15.3485851%2C6.57969577%2015.0664313%2C6.89349096%2014.7003557%2C6.94315338%20L14.5985851%2C6.95%20L8.99921396%2C6.95%20C8.5850004%2C6.95%208.24921396%2C6.61421356%208.24921396%2C6.2%20C8.24921396%2C5.82030423%208.53136785%2C5.50650904%208.89744341%2C5.45684662%20L8.99921396%2C5.45%20L14.5985851%2C5.45%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.5985851%2C9.65%20C15.0127987%2C9.65%2015.3485851%2C9.98578644%2015.3485851%2C10.4%20C15.3485851%2C10.7796958%2015.0664313%2C11.093491%2014.7003557%2C11.1431534%20L14.5985851%2C11.15%20L6.19952838%2C11.15%20C5.78531482%2C11.15%205.44952838%2C10.8142136%205.44952838%2C10.4%20C5.44952838%2C10.0203042%205.73168226%2C9.70650904%206.09775782%2C9.65684662%20L6.19952838%2C9.65%20L14.5985851%2C9.65%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.1987423%2C13.85%20C13.6129559%2C13.85%2013.9487423%2C14.1857864%2013.9487423%2C14.6%20C13.9487423%2C14.9796958%2013.6665885%2C15.293491%2013.3005129%2C15.3431534%20L13.1987423%2C15.35%20L6.19952838%2C15.35%20C5.78531482%2C15.35%205.44952838%2C15.0142136%205.44952838%2C14.6%20C5.44952838%2C14.2203042%205.73168226%2C13.906509%206.09775782%2C13.8568466%20L6.19952838%2C13.85%20L13.1987423%2C13.85%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const un=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});class pn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(r.CollaborativeDocumentConstants.extension_document)||e.push(r.CollaborativeDocumentConstants.extension_document),e}getId(){return"collaborativedocument"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.CollaborativeDocumentConstants.extension_document)||o.push(this.getDocumentTemplate(this.theme)),o}getDocumentTemplate(e){return new n.CometChatMessageTemplate({type:r.CollaborativeDocumentConstants.extension_document,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getDocumentContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getDocumentContentView(e,t){let o=n.DocumentIconAlignment.right,r=this.configuration?.getDocumentBubbleStyle(),s={titleFont:r?.titleFont||n.fontHelper(this.theme.typography.text2),titleColor:r?.titleColor||this.theme.palette.getAccent(),subtitleFont:r?.subtitleFont||n.fontHelper(this.theme.typography.subtitle2),subtitleColor:r?.subtitleColor||this.theme.palette.getAccent600(),iconTint:r?.iconTint||this.theme.palette.getAccent700(),buttonTextFont:r?.buttonTextFont||n.fontHelper(this.theme.typography.text2),buttonTextColor:r?.buttonTextColor||this.theme.palette.getPrimary(),buttonBackground:r?.buttonBackground||"transparent",separatorColor:r?.separatorColor||this.theme.palette.getAccent200()};const i=this.getDocumentURL(e),a=n.localize("COLLABORATIVE_DOCUMENT"),l=n.localize("OPEN_DOCUMENT"),c=n.localize("DRAW_DOCUMENT_TOGETHER");return g.jsx(un,{iconURL:this.configuration?.getIconURL()?this.configuration?.getIconURL():dn,title:a,URL:i,subtitle:c,buttonText:l,documentStyle:s,hideSeparator:!1,iconAlignment:o,ccClicked:this.launchCollaborativeDocument})}launchCollaborativeDocument(e){window.open(e,"","fullscreen=yes, scrollbars=auto")}getDocumentURL(e){try{if(e?.getData()){const t=e.getData();if(t?.metadata){const e=t?.metadata;if(r.CometChatUIKitUtility.checkHasOwnProperty(e,"@injected")){const t=e["@injected"];if(t?.extensions){const e=t.extensions;return e[r.CollaborativeDocumentConstants.document]?e[r.CollaborativeDocumentConstants.document].document_url:e[r.CollaborativeDocumentConstants.document].board_url}}}}}catch(e){console.log("error in fetching document url",e)}}getAttachmentOptions(e,t){if(t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle(),i=!!t?.user,a=i?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,l=i?t.user:t.group;const c=super.getAttachmentOptions(e,t);let C=new n.CometChatMessageComposerAction({id:r.CollaborativeDocumentConstants.document,title:n.localize("COLLABORATIVE_DOCUMENT"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():dn,iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(r.CollaborativeDocumentConstants.document,r.CollaborativeDocumentConstants.post,r.CollaborativeDocumentConstants.v1_create,{receiver:l,receiverType:a}).then(e=>{},e=>{})}});return c.push(C),c}}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.CollaborativeDocumentConstants.extension_document&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_DOCUMENT"):super.getLastConversationMessage(e,t,o)}}class hn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new pn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.document}}var mn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FCollaborative%20Whiteboard%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FCollaborative-Whiteboard%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C1.25%20C4.2473527%2C1.25%202.65%2C2.77128829%202.65%2C4.66666667%20C2.65%2C6.56204505%204.2473527%2C8.08333333%206.2%2C8.08333333%20C8.1526473%2C8.08333333%209.75%2C6.56204505%209.75%2C4.66666667%20C9.75%2C2.77128829%208.1526473%2C1.25%206.2%2C1.25%20Z%20M6.2%2C2.75%20C7.3401473%2C2.75%208.25%2C3.61652638%208.25%2C4.66666667%20C8.25%2C5.71680695%207.3401473%2C6.58333333%206.2%2C6.58333333%20C5.0598527%2C6.58333333%204.15%2C5.71680695%204.15%2C4.66666667%20C4.15%2C3.61652638%205.0598527%2C2.75%206.2%2C2.75%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C7.91666667%20C6.57969577%2C7.91666667%206.89349096%2C8.19882055%206.94315338%2C8.56489611%20L6.95%2C8.66666667%20L6.95%2C14%20C6.95%2C14.4142136%206.61421356%2C14.75%206.2%2C14.75%20C5.82030423%2C14.75%205.50650904%2C14.4678461%205.45684662%2C14.1017706%20L5.45%2C14%20L5.45%2C8.66666667%20C5.45%2C8.2524531%205.78578644%2C7.91666667%206.2%2C7.91666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C7.91666673%20C3.47415406%2C7.91666673%201.25%2C10.0349087%201.25%2C12.6666667%20L1.25%2C15.3333333%20L1.25684662%2C15.4351039%20C1.30650904%2C15.8011795%201.62030423%2C16.0833333%202%2C16.0833333%20L2.725%2C16.083%20L3.3541005%2C22.0783194%20C3.39418895%2C22.4601142%203.71610639%2C22.75%204.1%2C22.75%20L8.3%2C22.75%20L8.40299648%2C22.7429615%20C8.74009489%2C22.6965339%209.00945546%2C22.4254056%209.0458995%2C22.0783194%20L9.674%2C16.083%20L10.4%2C16.0833333%20C10.8142136%2C16.0833333%2011.15%2C15.7475469%2011.15%2C15.3333333%20L11.15%2C12.6666667%20C11.15%2C10.0349087%208.92584594%2C7.91666673%206.2%2C7.91666673%20Z%20M6.39003599%2C9.42150275%20C8.21408216%2C9.514591%209.65%2C10.9396974%209.65%2C12.6666667%20L9.649%2C14.583%20L9%2C14.5833333%20L8.89700352%2C14.5903718%20C8.55990511%2C14.6367994%208.29054454%2C14.9079278%208.2541005%2C15.2550139%20L7.624%2C21.25%20L4.775%2C21.25%20L4.1458995%2C15.2550139%20L4.12814397%2C15.1533155%20C4.04676841%2C14.8229084%203.74899419%2C14.5833333%203.4%2C14.5833333%20L2.75%2C14.583%20L2.75%2C12.6666667%20C2.75%2C10.8801468%204.28665405%2C9.41666673%206.2%2C9.41666673%20L6.39003599%2C9.42150275%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.6%2C1.25%20C22.7281683%2C1.25%2023.6652093%2C2.09570502%2023.7445585%2C3.18354707%20L23.75%2C3.33333333%20L23.75%2C14.6666667%20C23.75%2C15.7752741%2022.8620097%2C16.6691795%2021.7525939%2C16.7448147%20L21.6%2C16.75%20L13.2%2C16.75%20C12.7857864%2C16.75%2012.45%2C16.4142136%2012.45%2C16%20C12.45%2C15.6203042%2012.7321539%2C15.306509%2013.0982294%2C15.2568466%20L13.2%2C15.25%20L21.6%2C15.25%20C21.9335897%2C15.25%2022.1978428%2C15.0272126%2022.2431318%2C14.7509728%20L22.25%2C14.6666667%20L22.25%2C3.33333333%20C22.25%2C3.04809641%2022.0160733%2C2.79937841%2021.6978472%2C2.75651429%20L21.6%2C2.75%20L11.8%2C2.75%20C11.3857864%2C2.75%2011.05%2C2.41421356%2011.05%2C2%20C11.05%2C1.62030423%2011.3321539%2C1.30650904%2011.6982294%2C1.25684662%20L11.8%2C1.25%20L21.6%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const An=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});class xn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getAllMessageTypes(){let e=super.getAllMessageTypes();return e.some(e=>e===r.CollaborativeWhiteboardConstants.extension_whiteboard)||e.push(r.CollaborativeWhiteboardConstants.extension_whiteboard),e}getId(){return"collaborativewhiteboard"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.CollaborativeWhiteboardConstants.extension_whiteboard)||o.push(this.getWhiteBoardTemplate(this.theme)),o}getWhiteBoardTemplate(e){return new n.CometChatMessageTemplate({type:r.CollaborativeWhiteboardConstants.extension_whiteboard,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getWhiteboardContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getWhiteboardContentView(e,t){let o=n.DocumentIconAlignment.right,r=this.configuration?.getWhiteboardBubbleStyle(),s={titleFont:r?.titleFont||n.fontHelper(this.theme.typography.text2),titleColor:r?.titleColor||this.theme.palette.getAccent(),subtitleFont:r?.subtitleFont||n.fontHelper(this.theme.typography.subtitle2),subtitleColor:r?.subtitleColor||this.theme.palette.getAccent600(),iconTint:r?.iconTint||this.theme.palette.getAccent700(),buttonTextFont:r?.buttonTextFont||n.fontHelper(this.theme.typography.text2),buttonTextColor:r?.buttonTextColor||this.theme.palette.getPrimary(),buttonBackground:r?.buttonBackground||"transparent",separatorColor:r?.separatorColor||this.theme.palette.getAccent200()};const i=this.getWhiteboardDocument(e),a=n.localize("COLLABORATIVE_WHITEBOARD"),l=n.localize("OPEN_WHITEBOARD"),c=n.localize("DRAW_WHITEBOARD_TOGETHER");return g.jsx(An,{hideSeparator:!1,iconAlignment:o,iconURL:this.configuration?.getIconURL()?this.configuration?.getIconURL():mn,title:a,URL:i,subtitle:c,buttonText:l,documentStyle:s,ccClicked:this.launchCollaborativeWhiteboardDocument})}launchCollaborativeWhiteboardDocument(e){window.open(e,"","fullscreen=yes, scrollbars=auto")}getWhiteboardDocument(e){try{if(e?.getData()){const t=e.getData();if(t?.metadata){const e=t?.metadata;if(r.CometChatUIKitUtility.checkHasOwnProperty(e,"@injected")){const t=e["@injected"];if(t?.extensions){const e=t.extensions;return e[r.CollaborativeWhiteboardConstants.whiteboard]?e[r.CollaborativeWhiteboardConstants.whiteboard].board_url:e[r.CollaborativeWhiteboardConstants.whiteboard].document_url}}}}}catch(e){console.log("error in getting whiteboard details",e)}}getAttachmentOptions(e,t){if(t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle(),i=!!t?.user,a=i?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,l=i?t.user:t.group;const c=super.getAttachmentOptions(e,t);let C=new n.CometChatMessageComposerAction({id:r.CollaborativeWhiteboardConstants.whiteboard,title:n.localize("COLLABORATIVE_WHITEBOARD"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():mn,iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(r.CollaborativeWhiteboardConstants.whiteboard,r.CollaborativeWhiteboardConstants.post,r.CollaborativeWhiteboardConstants.v1_create,{receiver:l,receiverType:a}).then(e=>{},e=>{console.log("error in sending whiteboard",e)})}});return c.push(C),c}}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.CollaborativeWhiteboardConstants.extension_whiteboard&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_WHITEBOARD"):super.getLastConversationMessage(e,t,o)}}class bn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new xn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.whiteboard}}const yn=ye({tagName:"image-moderation",elementClass:r.ImageModeration,react:t,events:{CCShowDialog:"cc-show-dialog"}}),wn=ye({tagName:"cometchat-backdrop",elementClass:o.CometChatBackdrop,react:t}),fn=ye({tagName:"cometchat-confirm-dialog",elementClass:o.CometChatConfirmDialog,react:t,events:{ccCancelClicked:"cc-cancel-clicked",ccConfirmClicked:"cc-confirm-clicked"}}),Dn=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t,events:{ccImageClicked:"cc-image-clicked"}}),En=ye({tagName:"cometchat-full-screen-viewer",elementClass:o.CometChatFullScreenViewer,react:t,events:{ccCloseClicked:"cc-close-clicked"}});class vn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t,s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}).catch(e=>{console.error(e)})}getId(){return"imagemoderation"}getImageMessageContentView(e,t,o){if(void 0!==this.loggedInUser?.getUid()&&this.loggedInUser?.getUid()===e?.getSender()?.getUid())return super.getImageMessageContentView(e,t,o);this.theme=o;let r=e.getMetadata();const s=this.getImageModerationStyle(o);let i=e.getAttachments()[0]?.getUrl()||"";Be.names.includes("thumbnailgeneration")&&r&&"object"==typeof r&&r.hasOwnProperty("@injected")&&r["@injected"].hasOwnProperty("extensions")&&r["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&r["@injected"].extensions["thumbnail-generation"].url_medium&&(i=e.getMetadata()["@injected"].extensions["thumbnail-generation"].url_medium);const a=g.jsx(En,{URL:i,closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",fullScreenViewerStyle:{closeIconTint:"blue"},ccCloseClicked:()=>{n.CometChatUIEvents.ccHideDialog.next()}});return g.jsx(yn,{message:e,imageModerationStyle:s,CCShowDialog:e=>{this.showDialog(e)},children:g.jsx(Dn,{src:i,placeholderImage:"data:image/png;base64,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",ccImageClicked:()=>{n.CometChatUIEvents.ccShowDialog.next({child:a,confirmCallback:null})}})})}showDialog(e){const t=this.getConfirmationModal(e);n.CometChatUIEvents.ccShowDialog.next({confirmCallback:e?.detail?.onConfirm,child:t})}getConfirmationModal(e){let t=this.configuration?.getBackDropStyle(),o=this.configuration?.getConfirmDialogSyle(),r={height:t?.height||"100%",width:t?.width||"100%",background:t?.background||"rgba(0, 0, 0, 0.5)",border:t?.border,borderRadius:t?.borderRadius},s=n.localize("SHOW_UNSAFE_CONTENT"),i=n.localize("YES"),a=n.localize("NO"),l={confirmButtonBackground:o?.confirmButtonBackground||this.theme.palette.getError(),cancelButtonBackground:o?.cancelButtonBackground||this.theme.palette.getSecondary(),confirmButtonTextColor:o?.confirmButtonTextColor||this.theme.palette.getAccent900("light"),confirmButtonTextFont:o?.confirmButtonTextFont||n.fontHelper(this.theme.typography.text2),cancelButtonTextColor:o?.cancelButtonTextColor||this.theme.palette.getAccent900("dark"),cancelButtonTextFont:o?.cancelButtonTextFont||n.fontHelper(this.theme.typography.text2),titleFont:o?.titleFont||n.fontHelper(this.theme.typography.title1),titleColor:o?.titleColor||this.theme.palette.getAccent(),messageTextFont:o?.messageTextFont||n.fontHelper(this.theme.typography.subtitle2),messageTextColor:o?.messageTextColor||this.theme.palette.getAccent600(),background:o?.background||this.theme.palette.getBackground(),height:o?.height||"100%",width:o?.width||"100%",border:o?.border||`1px solid ${this.theme.palette.getAccent100()}`,borderRadius:o?.borderRadius||"8px"};return g.jsx(wn,{backdropStyle:r,children:g.jsx(fn,{title:"",messageText:s,cancelButtonText:a,confirmButtonText:i,confirmDialogStyle:l,ccCancelClicked:this.onCancelClicked,ccConfirmClicked:()=>{this.onConfirmClicked(e)}})})}onConfirmClicked(e){e?.detail?.onConfirm&&e?.detail?.onConfirm(),n.CometChatUIEvents.ccHideDialog.next()}onCancelClicked(){n.CometChatUIEvents.ccHideDialog.next()}getImageModerationStyle(e){let t=this.configuration?.getImageModerationStyle();return{filterColor:t?.filterColor||e.palette.getPrimary(),height:t?.height||"100%",width:t?.width||"100%",border:t?.border||"none",borderRadius:t?.borderRadius||"8px",warningTextColor:t?.warningTextColor||e.palette.getAccent("dark"),warningTextFont:t?.warningTextFont||n.fontHelper(e.typography.title2)}}}class Sn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new vn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.imageModeration}}const In=ye({tagName:"link-preview",elementClass:r.LinkPreview,react:t,events:{ccLinkClicked:"cc-link-clicked"}}),Fn=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t});class kn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getId(){return"linkpreview"}getTextMessageContentView(e,t,o,s){const i=this.getLinkPreview(e);if(i&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember){let n,a={...s,textFormatters:s?.textFormatters&&s?.textFormatters.length?[...s.textFormatters]:this.getAllTextFormatters({theme:o,alignment:t,disableMentions:s.disableMentions})},l=a.textFormatters;if(a&&!a.disableMentions){let s;for(let t=0;t<l.length&&!(l[t]instanceof r.CometChatMentionsFormatter&&(s=l[t],s.setMessage(e),e.getMentionedUsers().length&&s.setCometChatUserGroupMembers(e.getMentionedUsers()),s.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),n))&&!(l[t]instanceof r.CometChatUrlsFormatter&&(n=l[t],s));t++);s||(s=Be.getDataSource().getMentionsTextFormatter({message:e,...a,alignment:t,theme:o}),l.push(s))}else for(let e=0;e<l.length;e++)if(l[e]instanceof r.CometChatUrlsFormatter){n=l[e];break}n||(n=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:t}),l.push(n));for(let n=0;n<l.length;n++)l[n].setMessageBubbleAlignment(t),l[n].setMessage(e);return g.jsx(In,{style:this.getLinkPreviewWrapperStyle(),title:this.getLinkPreviewDetails(i,"title"),description:this.getLinkPreviewDetails(i,"description"),URL:this.getLinkPreviewDetails(i,"url"),image:this.getLinkPreviewDetails(i,"image"),favIconURL:this.getLinkPreviewDetails(i,"favicon"),linkPreviewStyle:this.getLinkPreviewStyle(o),ccLinkClicked:this.openLink,children:g.jsx(Fn,{textStyle:this.getTextMessageStyle(t,o),text:e.getText(),textFormatters:l})})}return super.getTextMessageContentView(e,t,o,s)}getLinkPreviewWrapperStyle(){return{height:"inherit",width:"inherit"}}openLink(e){window.open(e?.detail?.url,"_blank")}getLinkPreviewStyle(e){let t=this.configuration?.getLinkPreviewStyle();return new r.LinkPreviewStyle({titleColor:t?.titleColor||e.palette.getAccent(),titleFont:t?.titleFont||n.fontHelper(e.typography.title2),descriptionColor:t?.descriptionColor||e.palette.getAccent600(),descriptionFont:t?.descriptionFont||n.fontHelper(e.typography.subtitle2),background:t?.background||"transparent",height:t?.height||"100%",width:t?.width||"100%"})}getTextMessageStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900()||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getLinkPreview(e){try{if(!e?.getMetadata())return null;{const t=e.getMetadata()[r.LinkPreviewConstants.injected];if(t&&t?.extensions){const e=t.extensions;if(e&&r.CometChatUIKitUtility.checkHasOwnProperty(e,r.LinkPreviewConstants.link_preview)){const t=e[r.LinkPreviewConstants.link_preview];return t&&r.CometChatUIKitUtility.checkHasOwnProperty(t,r.LinkPreviewConstants.links)&&t[r.LinkPreviewConstants.links].length?t[r.LinkPreviewConstants.links][0]:null}return null}}}catch(e){console.log("error in getting link preview details",e)}}getLinkPreviewDetails(e,t){return Object.keys(e).length>0?e[t]:""}}class Tn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new kn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.linkPreview}}const Mn=ye({tagName:"message-translation-bubble",elementClass:r.MessageTranslationBubble,react:t}),Bn=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t});class Ln extends Ue{constructor(e,t){super(e),this.getTranslationStyle=(e,t)=>{let o=this.configuration?.getMessageTranslationStyle();return e!==n.MessageBubbleAlignment.left?new r.MessageTranslationStyle({translatedTextFont:o?.translatedTextFont||n.fontHelper(t.typography.text3),translatedTextColor:o?.translatedTextColor||t.palette.getAccent("dark"),helpTextColor:o?.helpTextColor||t.palette.getAccent700("dark"),helpTextFont:o?.helpTextFont||n.fontHelper(t.typography.caption2),background:o?.background||"transparent"}):new r.MessageTranslationStyle({translatedTextFont:o?.translatedTextFont||n.fontHelper(t.typography.text3),translatedTextColor:o?.translatedTextColor||t.palette.getAccent(),helpTextColor:o?.helpTextColor||t.palette.getAccent700(),helpTextFont:o?.helpTextFont||n.fontHelper(t.typography.caption2),background:o?.background||"transparent"})},this.newDataSource=e,this.configuration=t}getTextMessageOptions(e,t,o,r){let i=this.configuration?.getOptionStyle(),a=super.getTextMessageOptions(e,t,o,r);if(!this.checkIfOptionExist(a,n.CometChatUIKitConstants.MessageOption.translateMessage)){let e=new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.translateMessage,title:n.localize("TRANSLATE"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FMessage%20Translation%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FMessage-Translation%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.66666667%2C4.91666667%20C7.7672341%2C4.91666667%208.66848034%2C5.77006215%208.74476911%2C6.85121684%20L8.75%2C7%20L8.75%2C9.66666667%20C8.75%2C10.0808802%208.41421356%2C10.4166667%208%2C10.4166667%20C7.62030423%2C10.4166667%207.30650904%2C10.1345128%207.25684662%2C9.76843722%20L7.25%2C9.66666667%20L7.25%2C7%20C7.25%2C6.6778339%206.98883277%2C6.41666667%206.66666667%2C6.41666667%20C6.37671717%2C6.41666667%206.13617677%2C6.62821212%206.09096818%2C6.9053803%20L6.08333333%2C7%20L6.08333333%2C9.66666667%20C6.08333333%2C10.0808802%205.7475469%2C10.4166667%205.33333333%2C10.4166667%20C4.95363757%2C10.4166667%204.63984237%2C10.1345128%204.59017995%2C9.76843722%20L4.58333333%2C9.66666667%20L4.58333333%2C7%20C4.58333333%2C5.84940677%205.51607344%2C4.91666667%206.66666667%2C4.91666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8%2C7.58333333%20C8.41421356%2C7.58333333%208.75%2C7.91911977%208.75%2C8.33333333%20C8.75%2C8.7130291%208.46784612%2C9.02682429%208.10177056%2C9.07648672%20L8%2C9.08333333%20L5.33333333%2C9.08333333%20C4.91911977%2C9.08333333%204.58333333%2C8.7475469%204.58333333%2C8.33333333%20C4.58333333%2C7.95363757%204.86548721%2C7.63984237%205.23156278%2C7.59017995%20L5.33333333%2C7.58333333%20L8%2C7.58333333%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16%2C10.9166667%20C16.3796958%2C10.9166667%2016.693491%2C11.1988205%2016.7431534%2C11.5648961%20L16.75%2C11.6666667%20L16.75%2C13%20C16.75%2C13.4142136%2016.4142136%2C13.75%2016%2C13.75%20C15.6203042%2C13.75%2015.306509%2C13.4678461%2015.2568466%2C13.1017706%20L15.25%2C13%20L15.25%2C11.6666667%20C15.25%2C11.2524531%2015.5857864%2C10.9166667%2016%2C10.9166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M18.6666667%2C12.25%20C19.0808802%2C12.25%2019.4166667%2C12.5857864%2019.4166667%2C13%20C19.4166667%2C13.3796958%2019.1345128%2C13.693491%2018.7684372%2C13.7431534%20L18.6666667%2C13.75%20L13.3333333%2C13.75%20C12.9191198%2C13.75%2012.5833333%2C13.4142136%2012.5833333%2C13%20C12.5833333%2C12.6203042%2012.8654872%2C12.306509%2013.2315628%2C12.2568466%20L13.3333333%2C12.25%20L18.6666667%2C12.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.6218209%2C12.7628292%20C16.7528067%2C12.3698717%2017.1775467%2C12.1575017%2017.5705042%2C12.2884875%20C17.9634616%2C12.4194734%2018.1758316%2C12.8442133%2018.0448458%2C13.2371708%20L17.9816285%2C13.4141354%20L17.8896351%2C13.6471999%20L17.768692%2C13.9296038%20C17.5442054%2C14.4346986%2017.2746722%2C14.9400735%2016.9573711%2C15.4160251%20C15.999232%2C16.8532338%2014.8035437%2C17.75%2013.3333333%2C17.75%20C12.9191198%2C17.75%2012.5833333%2C17.4142136%2012.5833333%2C17%20C12.5833333%2C16.6203042%2012.8654872%2C16.306509%2013.2315628%2C16.2568466%20L13.3333333%2C16.25%20C14.1964563%2C16.25%2015.000768%2C15.6467662%2015.7092956%2C14.5839749%20C15.9753278%2C14.1849265%2016.2057946%2C13.7528014%2016.3979747%2C13.3203962%20L16.4992538%2C13.0842816%20L16.6012322%2C12.8221175%20C16.6092157%2C12.7998646%2016.6160798%2C12.7800523%2016.6218209%2C12.7628292%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.5822706%2C14.8366574%20C15.9262877%2C14.6059518%2016.3921926%2C14.697809%2016.6228982%2C15.0418261%20C17.0961654%2C15.7475396%2017.8695647%2C16.1943066%2018.717337%2C16.2517136%20C19.1306041%2C16.279698%2019.4429375%2C16.6374031%2019.4149531%2C17.0506703%20C19.3869686%2C17.4639375%2019.0292635%2C17.7762708%2018.6159964%2C17.7482864%20C17.3049794%2C17.6595107%2016.1089745%2C16.9686186%2015.3771018%2C15.877285%20C15.1463962%2C15.5332678%2015.2382534%2C15.067363%2015.5822706%2C14.8366574%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M20.6666667%2C8.91666667%20L11.3333333%2C8.91666667%20C10.1827401%2C8.91666667%209.25%2C9.84940677%209.25%2C11%20L9.25%2C17.6666667%20L9.25523089%2C17.8154498%20C9.33151966%2C18.8966045%2010.2327659%2C19.75%2011.3333333%2C19.75%20L15.022%2C19.749%20L18.8030032%2C23.5303301%20L18.8802248%2C23.598293%20C19.3582766%2C23.9666561%2020.0833333%2C23.6330113%2020.0833333%2C23%20L20.083%2C19.749%20L20.6666667%2C19.75%20C21.8172599%2C19.75%2022.75%2C18.8172599%2022.75%2C17.6666667%20L22.75%2C11%20C22.75%2C9.84940677%2021.8172599%2C8.91666667%2020.6666667%2C8.91666667%20Z%20M11.3333333%2C10.4166667%20L20.6666667%2C10.4166667%20C20.9888328%2C10.4166667%2021.25%2C10.6778339%2021.25%2C11%20L21.25%2C17.6666667%20C21.25%2C17.9888328%2020.9888328%2C18.25%2020.6666667%2C18.25%20L19.3333333%2C18.25%20L19.2315628%2C18.2568466%20C18.8654872%2C18.306509%2018.5833333%2C18.6203042%2018.5833333%2C19%20L18.583%2C21.189%20L15.8636634%2C18.4696699%20C15.7230111%2C18.3290176%2015.5322457%2C18.25%2015.3333333%2C18.25%20L11.3333333%2C18.25%20C11.0111672%2C18.25%2010.75%2C17.9888328%2010.75%2C17.6666667%20L10.75%2C11%20C10.75%2C10.6778339%2011.0111672%2C10.4166667%2011.3333333%2C10.4166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.6666667%2C2.25%20C13.7672341%2C2.25%2014.6684803%2C3.10339548%2014.7447691%2C4.18455017%20L14.75%2C4.33333333%20L14.75%2C7%20C14.75%2C7.41421356%2014.4142136%2C7.75%2014%2C7.75%20C13.6203042%2C7.75%2013.306509%2C7.46784612%2013.2568466%2C7.10177056%20L13.25%2C7%20L13.25%2C4.33333333%20C13.25%2C4.04338384%2013.0384545%2C3.80284343%2012.7612864%2C3.75763485%20L12.6666667%2C3.75%20L3.33333333%2C3.75%20C3.04338384%2C3.75%202.80284343%2C3.96154546%202.75763485%2C4.23871364%20L2.75%2C4.33333333%20L2.75%2C11%20C2.75%2C11.2899495%202.96154546%2C11.5304899%203.23871364%2C11.5756985%20L3.33333333%2C11.5833333%20L4.66666667%2C11.5833333%20C5.04636243%2C11.5833333%205.36015763%2C11.8654872%205.40982005%2C12.2315628%20L5.41666667%2C12.3333333%20L5.416%2C14.523%20L6.80300325%2C13.1363366%20C7.06926981%2C12.87007%207.48593349%2C12.845864%207.77954499%2C13.0637184%20L7.86366342%2C13.1363366%20C8.12992998%2C13.4026031%208.15413603%2C13.8192668%207.93628157%2C14.1128783%20L7.86366342%2C14.1969968%20L5.19699675%2C16.8636634%20C4.74939014%2C17.31127%204.00077515%2C17.0344999%203.92321348%2C16.4359943%20L3.91666667%2C16.3333333%20L3.916%2C13.083%20L3.33333333%2C13.0833333%20C2.2327659%2C13.0833333%201.33151966%2C12.2299379%201.25523089%2C11.1487832%20L1.25%2C11%20L1.25%2C4.33333333%20C1.25%2C3.2327659%202.10339548%2C2.33151966%203.18455017%2C2.25523089%20L3.33333333%2C2.25%20L12.6666667%2C2.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:function(){s.CometChat.callExtension("message-translation","POST","v2/translate",{msgId:t.getId(),text:t.getText(),languages:navigator.languages}).then(e=>{if(e&&e.hasOwnProperty("translations")){let o=e.translations?.[0]?.message_translated;if(o&&o.trim()){let e=t.getMetadata()||{};e.translated_message=o,t.setMetadata(e),n.CometChatMessageEvents.ccMessageTranslated.next({message:t,status:n.MessageStatus.success})}}}).catch(e=>{console.log("error",e)})},iconTint:i?.iconTint||o.palette.getAccent600(),titleColor:i?.titleColor||o.palette.getAccent600(),titleFont:i?.titleFont||n.fontHelper(o.typography.subtitle1),backgroundColor:i?.background||"transparent"});a.push(e)}return a}getTextMessageStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900("light")||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getTextMessageContentView(e,t,o,s){const i=e.getMetadata();if(i&&Object.prototype.hasOwnProperty.call(i,"translated_message")&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember){const n=i.translated_message;let a,l={...s,textFormatters:s?.textFormatters&&s?.textFormatters.length?[...s.textFormatters]:this.getAllTextFormatters({theme:o,alignment:t,disableMentions:s.disableMentions})},c=l.textFormatters;if(l&&!l.disableMentions){let n;for(let t=0;t<c.length&&!(c[t]instanceof r.CometChatMentionsFormatter&&(n=c[t],n.setMessage(e),e.getMentionedUsers().length&&n.setCometChatUserGroupMembers(e.getMentionedUsers()),n.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),a))&&!(c[t]instanceof r.CometChatUrlsFormatter&&(a=c[t],n));t++);n||(n=Be.getDataSource().getMentionsTextFormatter({message:e,...l,alignment:t,theme:o}),c.push(n))}else for(let e=0;e<c.length;e++)if(c[e]instanceof r.CometChatUrlsFormatter){a=c[e];break}a||(a=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:t}),c.push(a));for(let n=0;n<c.length;n++)c[n].setMessageBubbleAlignment(t),c[n].setMessage(e);return g.jsx(Mn,{translatedText:n,alignment:t,messageTranslationStyle:this.getTranslationStyle(t,o),textFormatters:c,children:g.jsx(Bn,{textStyle:this.getTextMessageStyle(t,o),text:e.getText(),textFormatters:c})})}return super.getTextMessageContentView(e,t,o,s)}checkIfOptionExist(e,t){return e.some(e=>e.id===t)}getId(){return"messagetranslation"}}class Un extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Ln(e,this.configuration))}getExtensionId(){return r.ExtensionsId.messageTranslation}}const Rn=ye({tagName:"polls-bubble",elementClass:r.PollsBubble,react:t}),Pn=ye({tagName:"create-poll",elementClass:r.CreatePoll,react:t,events:{ccCloseClicked:"cc-close-clicked"}});class On extends Ue{constructor(e,t){super(e),this.loggedInUser=null,this.getLoggedInUser(),this.newDataSource=e,this.configuration=t}async getLoggedInUser(){this.loggedInUser=await s.CometChat.getLoggedinUser()}getId(){return"polls"}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(r.PollsConstants.extension_poll)||e.push(r.PollsConstants.extension_poll),e}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.PollsConstants.extension_poll)||o.push(this.getPollsTemplate(this.theme)),o}getPollsTemplate(e){return new n.CometChatMessageTemplate({type:r.PollsConstants.extension_poll,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getPollsContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getPollsContentView(e,t){let o=this.configuration?.getPollsBubbleStyle(),r={borderRadius:o?.borderRadius||"8px",background:o?.background||"transparent",votePercentTextFont:o?.votePercentTextFont||n.fontHelper(t.typography.subtitle2),votePercentTextColor:o?.votePercentTextColor||t.palette.getAccent600(),pollQuestionTextFont:o?.pollQuestionTextFont||n.fontHelper(t.typography.subtitle1),pollQuestionTextColor:o?.pollQuestionTextColor||t.palette.getAccent(),pollOptionTextFont:o?.pollOptionTextFont||n.fontHelper(t.typography.text2),pollOptionTextColor:o?.pollOptionTextColor||t.palette.getAccent(),pollOptionBackground:o?.pollOptionBackground||"transparent",optionsIconTint:o?.optionsIconTint||t.palette.getAccent600(),totalVoteCountTextFont:o?.totalVoteCountTextFont||n.fontHelper(t.typography.subtitle2),totalVoteCountTextColor:o?.totalVoteCountTextColor||t.palette.getAccent600(),selectedPollOptionBackground:o?.selectedPollOptionBackground||t.palette.getAccent200(),userSelectedOptionBackground:o?.userSelectedOptionBackground||t.palette.getPrimary(),pollOptionBorder:o?.pollOptionBorder||`1px solid ${t.palette.getAccent100()}`,pollOptionBorderRadius:o?.pollOptionBorderRadius||"8px"};return g.jsx(Rn,{pollStyle:r,pollQuestion:this.getPollBubbleData(e,"question"),pollId:this.getPollBubbleData(e,"id"),senderUid:this.getPollBubbleData(e),loggedInUser:this.loggedInUser??void 0,metadata:e?.getMetadata()})}getPollBubbleData(e,t){let n=e.getCustomData();return t?"options"===t?Object.values(n[t]):n[t]:e.getSender().getUid()}getAttachmentOptions(e,t){if(this.theme=e,t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle();const s=super.getAttachmentOptions(e,t);let i=new n.CometChatMessageComposerAction({id:r.PollsConstants.extension_poll,title:n.localize("POLLS"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FPolls%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FPolls%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.779983%2C1.25%20C14.2709124%2C1.25043259%2014.7438187%2C1.42418565%2015.1167078%2C1.73706699%20L15.2516928%2C1.86085235%20L20.4715927%2C7.08218001%20C20.8991636%2C7.51561025%2021.1196388%2C8.11205589%2021.0768145%2C8.71941733%20C21.0476811%2C9.13260508%2020.689109%2C9.44394267%2020.2759212%2C9.41480928%20C19.8971658%2C9.38810367%2019.6039928%2C9.08457801%2019.580201%2C8.71591608%20L19.5805293%2C8.613916%20C19.5905393%2C8.47194719%2019.5513165%2C8.33202895%2019.4730888%2C8.21873863%20L19.4072645%2C8.13914765%20L14.1905599%2C2.92103945%20C14.1031809%2C2.83352807%2013.9908865%2C2.77665655%2013.8706878%2C2.75733888%20L13.7793226%2C2.75%20L4.33297476%2C2.75%20C4.04324415%2C2.75%203.80281908%2C2.96150888%203.75763137%2C3.23870267%20L3.75%2C3.33333333%20L3.75%2C20.6666667%20C3.75%2C20.9566568%203.961452%2C21.1971647%204.2384242%2C21.2423664%20L4.33297476%2C21.25%20L9.6648738%2C21.25%20C10.0790874%2C21.25%2010.4148738%2C21.5857864%2010.4148738%2C22%20C10.4148738%2C22.3796958%2010.1327199%2C22.693491%209.76664435%2C22.7431534%20L9.6648738%2C22.75%20L4.33297476%2C22.75%20C3.23255355%2C22.75%202.33150187%2C21.8965632%202.25522974%2C20.8154444%20L2.25%2C20.6666667%20L2.25%2C3.33333333%20C2.25%2C2.23280908%203.10320728%2C1.33152341%204.18421182%2C1.25523113%20L4.33297476%2C1.25%20L13.779983%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.6637981%2C1.25%20C14.0434938%2C1.25%2014.357289%2C1.53215388%2014.4069515%2C1.89822944%20L14.4137981%2C2%20L14.4137981%2C7.33333333%20C14.4137981%2C7.62332346%2014.6252501%2C7.86383136%2014.9022223%2C7.90903304%20L14.9967728%2C7.91666667%20L20.3286719%2C7.91666667%20C20.7428854%2C7.91666667%2021.0786719%2C8.2524531%2021.0786719%2C8.66666667%20C21.0786719%2C9.04636243%2020.796518%2C9.36015763%2020.4304424%2C9.40982005%20L20.3286719%2C9.41666667%20L14.9967728%2C9.41666667%20C13.8963516%2C9.41666667%2012.9952999%2C8.56322987%2012.9190278%2C7.4821111%20L12.9137981%2C7.33333333%20L12.9137981%2C2%20C12.9137981%2C1.58578644%2013.2495845%2C1.25%2013.6637981%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8.99777572%2C9.420279%20C9.24921801%2C9.09111393%209.71989329%2C9.02810717%2010.0490584%2C9.27954946%20C10.3482993%2C9.50813337%2010.4275748%2C9.91790155%2010.2506031%2C10.2378223%20L10.1897879%2C10.3308321%20L8.25879925%2C12.8586842%20C8.01208284%2C13.1778547%207.64305532%2C13.3791966%207.21567496%2C13.4156509%20C6.86419538%2C13.4339623%206.52012946%2C13.3223779%206.23838713%2C13.0959918%20L6.12161623%2C12.9919845%20L5.12632841%2C11.9608734%20C4.838658%2C11.6628489%204.84705165%2C11.1880493%205.14507615%2C10.9003789%20C5.41600752%2C10.6388603%205.83303397%2C10.6220228%206.1227489%2C10.845033%20L6.20557062%2C10.9191266%20L7.125%2C11.871%20L8.99777572%2C9.420279%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8.99777572%2C15.420279%20C9.24921801%2C15.0911139%209.71989329%2C15.0281072%2010.0490584%2C15.2795495%20C10.3482993%2C15.5081334%2010.4275748%2C15.9179016%2010.2506031%2C16.2378223%20L10.1897879%2C16.3308321%20L8.25879925%2C18.8586842%20C8.01208284%2C19.1778547%207.64305532%2C19.3791966%207.21567496%2C19.4156509%20C6.86419538%2C19.4339623%206.52012946%2C19.3223779%206.23838713%2C19.0959918%20L6.12161623%2C18.9919845%20L5.12632841%2C17.9608734%20C4.838658%2C17.6628489%204.84705165%2C17.1880493%205.14507615%2C16.9003789%20C5.41600752%2C16.6388603%205.83303397%2C16.6220228%206.1227489%2C16.845033%20L6.20557062%2C16.9191266%20L7.125%2C17.871%20L8.99777572%2C15.420279%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.6632602%2C11.9166667%20C16.0774738%2C11.9166667%2016.4132602%2C12.2524531%2016.4132602%2C12.6666667%20C16.4132602%2C13.0463624%2016.1311063%2C13.3601576%2015.7650308%2C13.4098201%20L15.6632602%2C13.4166667%20L12.3308233%2C13.4166667%20C11.9166098%2C13.4166667%2011.5808233%2C13.0808802%2011.5808233%2C12.6666667%20C11.5808233%2C12.2869709%2011.8629772%2C11.9731757%2012.2290528%2C11.9235133%20L12.3308233%2C11.9166667%20L15.6632602%2C11.9166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.1106837%2C10.5779533%20C20.4095395%2C10.5779533%2019.7375424%2C10.8584991%2019.2444627%2C11.3570467%20L12.4669093%2C18.1364079%20C12.3622379%2C18.2411074%2012.2908946%2C18.3744435%2012.2618676%2C18.5196176%20L11.5953802%2C21.8529509%20C11.4904492%2C22.3777472%2011.953163%2C22.8404132%2012.4779485%2C22.7354279%20L15.8103854%2C22.0687612%20C15.9555979%2C22.0397109%2016.0889603%2C21.9683215%2016.1936616%2C21.8635921%20L22.9740599%2C15.0813699%20C23.4695748%2C14.5910412%2023.75%2C13.9189715%2023.75%2C13.2177778%20C23.75%2C12.516584%2023.4695748%2C11.8445143%2022.9711997%2C11.35134%20L22.8310414%2C11.2210775%20C22.3327458%2C10.7984458%2021.7321255%2C10.5779533%2021.1106837%2C10.5779533%20Z%20M21.1106837%2C12.0779533%20C21.3769595%2C12.0779533%2021.6343527%2C12.1724444%2021.8371937%2C12.3440921%20L21.9342889%2C12.4349375%20C22.129767%2C12.628969%2022.25%2C12.9171205%2022.25%2C13.2177778%20L22.242717%2C13.345678%20C22.2137413%2C13.5991981%2022.0992456%2C13.8367894%2021.9161173%2C14.0180067%20L15.293%2C20.642%20L13.287%2C21.043%20L13.688%2C19.035%20L20.3081104%2C12.4147032%20C20.5222805%2C12.1981735%2020.8102464%2C12.0779533%2021.1106837%2C12.0779533%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:(...t)=>{this.onPollsButtonClicked(e,...t)}});return s.push(i),s}}onPollsButtonClicked(e,...t){const[o]=t;let r=o[0],s=o[1],i=this.configuration?.getCreatePollStyle(),a={placeholderTextFont:i?.placeholderTextFont||n.fontHelper(e.typography.subtitle1),placeholderTextColor:i?.placeholderTextColor||e.palette.getAccent600(),deleteIconTint:i?.deleteIconTint||e.palette.getAccent600(),titleFont:i?.titleFont||n.fontHelper(e.typography.title1),titleColor:i?.titleColor||e.palette.getAccent(),closeIconTint:i?.closeIconTint||e.palette.getPrimary(),questionInputBackground:i?.questionInputBackground||e.palette.getAccent100(),optionInputBackground:i?.optionInputBackground||e.palette.getAccent100(),answerHelpTextFont:i?.answerHelpTextFont||n.fontHelper(e.typography.caption1),answerHelpTextColor:i?.answerHelpTextColor||e.palette.getAccent400(),addAnswerIconTint:i?.addAnswerIconTint||e.palette.getPrimary(),createPollButtonTextFont:i?.createPollButtonTextFont||n.fontHelper(e.typography.text2),createPollButtonTextColor:i?.createPollButtonTextColor||e.palette.getAccent("dark"),createPollButtonBackground:i?.createPollButtonBackground||e.palette.getPrimary(),addAnswerTextFont:i?.addAnswerTextFont||n.fontHelper(e.typography.text2),addAnswerTextColor:i?.addAnswerTextColor||e.palette.getPrimary(),errorTextFont:i?.errorTextFont||n.fontHelper(e.typography.subtitle1),errorTextColor:i?.errorTextColor||e.palette.getError(),optionPlaceholderTextFont:i?.optionPlaceholderTextFont||n.fontHelper(e.typography.subtitle1),optionPlaceholderTextColor:i?.optionPlaceholderTextColor||e.palette.getAccent600(),questionInputTextFont:i?.questionInputTextFont||n.fontHelper(e.typography.subtitle2),questionInputTextColor:i?.questionInputTextColor||e.palette.getAccent600(),optionInputTextFont:i?.optionInputTextFont||n.fontHelper(e.typography.subtitle2),optionInputTextColor:i?.optionInputTextColor||e.palette.getAccent600(),width:i?.width||"360px",height:i?.height||"440px",border:i?.border||"",borderRadius:i?.borderRadius||"8px",background:i?.background||e.palette.getAccent900(),position:"absolute",zIndex:1};n.CometChatUIEvents.ccShowModal.next({child:this.getPollView(r,s,a)})}getPollView(e,t,n){return g.jsx("cometchat-backdrop",{children:g.jsx(Pn,{user:e,group:t,ccCloseClicked:this.triggerCloseEvent,createPollStyle:n,deleteIconURL:this.configuration?.getDeleteIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDelete%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDelete%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%223.6363627%22%20x2%3D%2220%22%20y2%3D%223.6363627%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0454545%2C0%20L7.95454545%2C0%20C7.20142989%2C0%206.59090909%2C0.610520639%206.59090909%2C1.36363601%20L6.59090909%2C3.6363627%20L13.4090909%2C3.6363627%20L13.4090909%2C1.36363601%20C13.4090909%2C0.610520639%2012.7985701%2C0%2012.0454545%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%227.95454545%22%20y1%3D%2215.2272688%22%20x2%3D%227.95454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212.0454545%22%20y1%3D%2215.2272688%22%20x2%3D%2212.0454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.2363636%2C18.7454497%20C16.1838968%2C19.4542339%2015.5925391%2C20.0019341%2014.8818182%2C20%20L5.11818182%2C20%20C4.40746088%2C20.0019341%203.81610324%2C19.4542339%203.76363636%2C18.7454497%20L2.5%2C3.6363627%20L17.5%2C3.6363627%20L16.2363636%2C18.7454497%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",closeIconURL:this.configuration?.getCloseIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",addAnswerIconURL:this.configuration?.getAddAnswerIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"})})}triggerCloseEvent(){n.CometChatUIEvents.ccHideModal.next()}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.PollsConstants.extension_poll&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_POLL"):super.getLastConversationMessage(e,t,o)}}class jn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new On(e,this.configuration))}getExtensionId(){return r.ExtensionsId.polls}}const Vn=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}});class Gn extends Ue{constructor(e,t,o){super(e),this.LISTENER_ID="smartreply__listener",this.currentMessage=null,this.configuration=t,this.theme=o||new n.CometChatTheme({}),this.addMessageListener()}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{null!=e&&this.loggedInUser&&this.loggedInUser?.getUid()!=e.getSender().getUid()&&(this.currentMessage=e,e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&null!=this.activeUser?null!==e.getSender()&&null!==e.getSender().getUid()&&this.activeUser.getUid()===e.getSender().getUid()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:e,child:this.getSmartReplyView(e),position:n.PanelAlignment.messageListFooter}):e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&null!=this.activeGroup&&null!==this.activeGroup.getGuid()&&this.activeGroup.getGuid()===e.getReceiverId()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:e,child:this.getSmartReplyView(e),position:n.PanelAlignment.messageListFooter}))}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.activeUser=e.user,this.activeGroup=e.group,this.currentMessage instanceof s.CometChat.TextMessage&&null!==this.currentMessage&&null!==this.currentMessage.getSender()&&null!==this.loggedInUser&&null!==this.currentMessage.getSender().getUid()&&this.currentMessage.getSender().getUid()!==this.loggedInUser.getUid()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:this.getSmartReplyView(this.currentMessage)})}),n.CometChatMessageEvents.ccMessageSent.subscribe(()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null})}getReplies(e){let t=e;const n=t?.metadata?.[r.SmartRepliesConstants.injected]?.extensions?.[r.SmartRepliesConstants.smart_reply];if(n?.reply_positive&&n?.reply_neutral&&n?.reply_negative){const{reply_positive:e,reply_neutral:t,reply_negative:o}=n;return[e,t,o]}return null}getSmartReplyStyle(){const e=this.configuration?.getSmartRepliesStyle();return{replyTextFont:e?.replyTextFont||n.fontHelper(this.theme.typography.caption1),replyTextColor:e?.replyTextColor||this.theme?.palette.getAccent(),replyBackground:e?.replyBackground||"inherit",boxShadow:e?.boxShadow||`0px 0px 1px ${this.theme?.palette.getAccent600()}`,closeIconTint:e?.closeIconTint||this.theme?.palette.getAccent600(),background:e?.background||"inherit",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",display:"flex",justifyContent:"flex-start"}}sendSmartReply(e){let t=this.activeUser?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,o=e?.detail?.reply,i=this.currentMessage;if(o&&o.trim().length>0&&i){let e;if(i.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user)e=new s.CometChat.TextMessage(i.getSender().getUid(),o.trim(),t),e.setReceiver(this.activeUser);else{const n=i.getReceiver();e=new s.CometChat.TextMessage(n.getGuid(),o.trim(),t),e.setReceiver(this.activeGroup)}i.getParentMessageId()>0&&e.setParentMessageId(i.getParentMessageId()),e.setCategory(n.CometChatUIKitConstants.MessageCategory.message),e.setSender(this.loggedInUser),e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMessage(e).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},t=>{e.setMetadata({error:!0}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}}closeSmartReply(){n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null}getSmartReplyButtonStyle(){return{background:"inherit"}}getSmartReplyView(e){return this.getReplies(e)?g.jsx("div",{className:"cc-messagelist__smartreplies",style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"flex-end"},children:g.jsx(Vn,{smartReplyStyle:this.getSmartReplyStyle(),replies:this.getReplies(e)??void 0,ccReplyClicked:t=>{t.msg=e,this.sendSmartReply(t)},ccCloseClicked:this.closeSmartReply})}):null}getId(){return"smartreply"}}class Hn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Gn(e,this.configuration,this.theme))}getExtensionId(){return r.ExtensionsId.smartReply}}const Qn=ye({tagName:"stickers-keyboard",elementClass:r.StickersKeyboard,react:t,events:{ccStickerClicked:"cc-sticker-clicked"}}),Nn=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t});class Kn extends Ue{constructor(e,t){super(e),this.showStickerKeyboard=!1,this.newDataSource=e,this.configuration=t}getDataSource(){return this.newDataSource}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});let o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.StickersConstants.sticker)||o.push(this.getStickerTemplate(this.theme)),o}getAuxiliaryOptions(e,t,n,o){this.id=e,this.user=n,this.group=o;let r=super.getAuxiliaryOptions(e,t,n,o);return r.push(this.getStickerAuxiliaryButton(e,t,n,o)),r}getStickerAuxiliaryButton(e,t,r,s){let i=this.configuration?.getStickersStyle(),a={height:i?.sticketButtonHeight||"24px",width:i?.stickerButtonWidth||"24px",border:"none",borderRadius:"0",buttonIconTint:i?.stickerButtonIconTint||t.palette.getAccent500(),background:"transparent"},l=new o.PopoverStyle({width:i?.width||"300px",height:i?.height||"400px",background:t?.palette?.getBackground(),borderRadius:"12px",boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}),c={width:i?.width||"300px",height:i?.height||"400px",border:i?.border||"none",emptyStateTextFont:i?.emptyStateTextFont||n.fontHelper(t.typography.title1),emptyStateTextColor:i?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:i?.errorStateTextFont||n.fontHelper(t.typography.title1),errorStateTextColor:i?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:i?.loadingIconTint||t.palette.getAccent600(),background:i?.background||t.palette.getBackground(),borderRadius:i?.borderRadius||"12px"},C=this.configuration?.getStickerIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FStickers%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FStickers%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.67349142%2C7.33338221%20C5.86012572%2C7.33338221%206.01142272%2C7.48460989%206.01142272%2C7.67115869%20C6.01142272%2C7.85770748%205.86012572%2C8.00893516%205.67349142%2C8.00893516%20C5.48685711%2C8.00893516%205.33556012%2C7.85770748%205.33556012%2C7.67115869%20C5.33556012%2C7.58157479%205.37116349%2C7.49566003%205.4345379%2C7.43231465%20C5.49791231%2C7.36896927%205.58386646%2C7.33338221%205.67349142%2C7.33338221%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.23283692%2C13.0400269%20C5.36112225%2C15.1816508%207.58282264%2C16.5229567%2010.0043478%2C16.5244579%20C10.2778756%2C16.5227578%2010.5510655%2C16.5049493%2010.8224973%2C16.4711247%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M20%2C9.57337357%20C19.7666207%2C4.11103074%2015.187631%2C-0.151378825%209.72001617%2C0.00412271646%20C4.25240139%2C0.159624258%20-0.0767041446%2C4.67538425%200.00103066029%2C10.1421537%20C0.0787654651%2C15.6089231%204.5345202%2C20%2010.0043478%2C20%20L10.4489943%2C20%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.1831154%2C7.92004661%20C12.559175%2C7.32283168%2013.215699%2C6.96047481%2013.921683%2C6.96047481%20C14.6276671%2C6.96047481%2015.2841911%2C7.32283168%2015.6602507%2C7.92004661%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2220%22%20y1%3D%229.57337357%22%20x2%3D%2210.4489943%22%20y2%3D%2219.9911111%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.4489943%2C19.9911111%20L10.4489943%2C19.1022257%20C10.4588042%2C13.8367116%2014.7320632%2C9.57337357%2020%2C9.57337357%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",d=this.configuration?.getCloseIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";return g.jsxs("cometchat-popover",{placement:n.Placement.top,popoverStyle:JSON.stringify(l),children:[g.jsx("div",{slot:"children",children:g.jsx("cometchat-button",{hoverText:n.localize("STICKER"),iconURL:this.showStickerKeyboard?d:C,buttonStyle:JSON.stringify(a)})}),g.jsx("div",{slot:"content",children:g.jsx(Qn,{stickerStyle:c,ccStickerClicked:e=>this.sendSticker(e)})})]},"stickers-extension-popover")}sendSticker(e){try{let t=e?.detail,o={name:t?.stickerName,URL:t?.stickerURL};const i=this.user?.getUid()||this.group?.getGuid(),a=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,{parentMessageId:l}=this.id,c={sticker_url:o.URL,sticker_name:o.name},C=r.StickersConstants.sticker,g=new s.CometChat.CustomMessage(i,a,C,c);l&&g.setParentMessageId(l),g.setMetadata({incrementUnreadCount:!0}),g.shouldUpdateConversation(!0),g.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),g.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:g,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(g).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},e=>{g.setMetadata({error:!0}),n.CometChatMessageEvents.ccMessageSent.next({message:g,status:n.MessageStatus.error})})}catch(e){console.log("error in sending sticker",e)}}getSticker(e){let t;return r.CometChatUIKitUtility.checkHasOwnProperty(e,r.StickersConstants.data)&&r.CometChatUIKitUtility.checkHasOwnProperty(e.getData(),r.StickersConstants.custom_data)?(t=e.getCustomData(),r.CometChatUIKitUtility.checkHasOwnProperty(t,r.StickersConstants.sticker_url)?t?.sticker_url:""):""}getStickerMessageContentView(e,t){return g.jsx(Nn,{src:this.getSticker(e),imageStyle:{height:"128px",width:"128px",border:"none",borderRadius:"0",background:"transparent"}})}getStickerTemplate(e){return new n.CometChatMessageTemplate({type:r.StickersConstants.sticker,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getStickerMessageContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageCategories(){let e=super.getAllMessageCategories();return e.some(e=>e===n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}getAllMessageTypes(){let e=super.getAllMessageTypes();return e.some(e=>e===r.StickersConstants.sticker)||e.push(r.StickersConstants.sticker),e}getId(){return"stickers"}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.StickersConstants.sticker&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_STICKER"):super.getLastConversationMessage(e,t,o)}}class zn extends gn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Kn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.stickers}}class Jn extends Ue{getId(){return"textmoderator"}getModeratedtext(e){let t=r.CometChatUIKitUtility.getExtensionData(e);return t?.trim()?.length>0?t:e.getText()}getLastConversationMessage(e,t,o){const i=e.getLastMessage();if(i&&!i.getDeletedAt()&&i.getType()===n.CometChatUIKitConstants.MessageTypes.text&&i.getCategory()===n.CometChatUIKitConstants.MessageCategory.message){let t=this.getModeratedtext(i),a=e.getLastMessage(),l={...o,textFormatters:o?.textFormatters&&o?.textFormatters.length?[...o.textFormatters]:[this.getMentionsTextFormatter({theme:o.theme,disableMentions:o.disableMentions})]},c=l.textFormatters;if(l&&!l.disableMentions){let e;for(let t=0;t<c.length&&!(c[t]instanceof r.CometChatMentionsFormatter&&(e=c[t],e.setMessage(a),a.getMentionedUsers().length&&e.setCometChatUserGroupMembers(a.getMentionedUsers()),e.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),e));t++);e||(e=Be.getDataSource().getMentionsTextFormatter({messageObj:a,...l,alignment:null,theme:o.theme}),c.push(e))}if(a&&a instanceof s.CometChat.TextMessage)for(let e=0;e<c.length;e++)t=c[e].getFormattedText(t,{mentionsTargetElement:n.MentionsTargetElement.conversation});return i&&e?.getConversationType()!=s.CometChat.RECEIVER_TYPE.USER&&(t=i?.getSender().getUid()==r.CometChatUIKitLoginListener?.getLoggedInUser()?.getUid()?`${n.localize("YOU")}: ${t}`:`${i?.getSender().getName()}: ${t}`),t}return super.getLastConversationMessage(e,t,o)}getTextMessageContentView(e,t,n,o){let r=this.getModeratedtext(e);return this.getModeratedtext(e)!==e.getText()&&e.setText(r),super.getTextMessageContentView(e,t,n,o)}}class Yn extends gn{addExtension(){Be.enable(e=>new Jn(e))}getExtensionId(){return r.ExtensionsId.profanityFilter}enable(){const e=s.CometChat.isExtensionEnabled(r.ExtensionsId.profanityFilter),t=s.CometChat.isExtensionEnabled(r.ExtensionsId.dataMasking);Promise.all([e,t]).then(e=>{e.includes(!0)&&this.addExtension()}).catch(e=>{})}}class _n extends Ue{getId(){return"thumbnailgeneration"}getImageMessageBubble(e,t,n,o,r,s){if(Be.names.includes("imagemoderation"))return super.getImageMessageBubble(e,t,n,o);{let e=n?.getAttachments()[0]??n.getMetadata(),t=e?.url,r=n.getMetadata();return r&&r.hasOwnProperty("@injected")&&r["@injected"].hasOwnProperty("extensions")&&r["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&r["@injected"].extensions["thumbnail-generation"].url_medium&&(t=r["@injected"].extensions["thumbnail-generation"].url_medium),super.getImageMessageBubble(t,"data:image/png;base64,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",n,o)}}getVideoMessageBubble(e,t,n,o,r,s){let i=t.getMetadata(),a=o;return i&&i.hasOwnProperty("@injected")&&i["@injected"].hasOwnProperty("extensions")&&i["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&i["@injected"].extensions["thumbnail-generation"].url_medium&&(a=i["@injected"].extensions["thumbnail-generation"].url_medium),super.getVideoMessageBubble(e,t,n,a)}}class Wn extends gn{addExtension(){Be.enable(e=>new _n(e))}getExtensionId(){return r.ExtensionsId.thumbnailGeneration}}class Zn{static init(e){if(Zn.uiKitSettings=e,!Zn.checkAuthSettings())return;const t=new s.CometChat.AppSettingsBuilder;e.getRoles()?t.subscribePresenceForRoles(e.getRoles()):"ALL_USERS"===e.getSubscriptionType()?t.subscribePresenceForAllUsers():"FRIENDS"===e.getSubscriptionType()&&t.subscribePresenceForFriends(),t.autoEstablishSocketConnection(e.isAutoEstablishSocketConnection()),t.setRegion(e.getRegion()),t.overrideAdminHost(e.getAdminHost()),t.overrideClientHost(e.getClientHost());const n=t.build();return s.CometChat.setSource&&s.CometChat.setSource("uikit-v4","web","reactjs"),r.CometChatUIKitSharedSettings.uikitSettings=Zn.uiKitSettings,new Promise((t,o)=>{window.CometChatUiKit={name:"@cometchat/chat-uikit-react",version:"4.3.33"},s.CometChat.init(e?.appId,n).then(()=>{s.CometChat.getLoggedinUser().then(e=>(e&&(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),this.initiateAfterLogin()),t(e))).catch(e=>(console.log(e),o(e)))}).catch(e=>o(e))})}static enableCalling(){try{if(r.CometChatUIKitCalls){const e=(new r.CometChatUIKitCalls.CallAppSettingsBuilder).setAppId(Zn.uiKitSettings?.appId).setRegion(Zn.uiKitSettings?.region).build();r.CometChatUIKitCalls.init(e).then(()=>{this.uiKitSettings?.getCallingExtension()?this.uiKitSettings?.getCallingExtension().enable():this.defaultCallingExtension.enable()},e=>{console.log("CometChatCalls initialization failed with error:",e)})}}catch(e){console.log(e)}}static initiateAfterLogin(){if(null!=Zn.uiKitSettings){s.CometChat.getConversationUpdateSettings().then(e=>{this.conversationUpdateSettings=e});let e=this.uiKitSettings?.extensions||this.defaultExtensions;n.ChatSdkEventInitializer.attachListeners(),r.CometChatUIKitLoginListener.attachListener();let t=this.uiKitSettings?.aiFeatures||this.defaultAIFeatures;e.length>0&&e.forEach(e=>{e?.enable()}),t.length>0&&t.forEach(e=>{e.enable()}),this.enableCalling()}}static login(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");Zn.getLoggedinUser()?.then(o=>{if(o)return r.CometChatUIKitLoginListener.setLoggedInUser(o),this.initiateAfterLogin(),t(o);s.CometChat.login(e,Zn.uiKitSettings.authKey).then(e=>(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),r.CometChatUIKitLoginListener.setLoggedInUser(e),this.initiateAfterLogin(),t(e))).catch(e=>n(e))})})}static loginWithAuthToken(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.login(e).then(e=>(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),this.initiateAfterLogin(),t(e))).catch(e=>n(e))})}static getLoggedinUser(){return new Promise((e,t)=>{if(!Zn.checkAuthSettings())return t("uiKitSettings not available");s.CometChat.getLoggedinUser().then(t=>(t&&r.CometChatUIKitLoginListener.setLoggedInUser(t),e(t))).catch(e=>t(e))})}static createUser(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.createUser(e,Zn.uiKitSettings.authKey).then(e=>t(e)).catch(e=>n(e))})}static updateUser(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.updateUser(e,Zn.uiKitSettings.authKey).then(e=>t(e)).catch(e=>n(e))})}static logout(){return new Promise((e,t)=>{if(!Zn.checkAuthSettings()){return t({code:"ERROR_UIKIT_NOT_INITIALISED",message:"UIKItSettings not available"})}s.CometChat.logout().then(t=>(r.CometChatUIKitLoginListener.removeLoggedInUser(),e(t))).catch(e=>t(e))})}static checkAuthSettings(){return null!=Zn.uiKitSettings&&null!=Zn.uiKitSettings.appId}static sendFormMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCardMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCustomInteractiveMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCustomMessage(e){return new Promise((t,o)=>{e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendTextMessage(e){return new Promise((t,o)=>{e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendMediaMessage(e){return e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),new Promise((t,o)=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMediaMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendSchedulerMessage(e,t=!1){return new Promise((o,i)=>{e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let s=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:s,status:n.MessageStatus.success}),o(e)}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),i(o)})})}static getDataSource(){return Be.getDataSource()}}Zn.SoundManager=r.CometChatSoundManager,Zn.Localize=n.CometChatLocalize,Zn.defaultExtensions=[new zn,new Hn,new bn,new hn,new Un,new Yn,new Wn,new Tn,new jn,new Sn],Zn.defaultCallingExtension=new Cn,Zn.defaultAIFeatures=[new Gt,new wt,new kt,new Ct];const Xn=(e,t)=>{let o;return o=t===n.TabAlignment.top||t===n.TabAlignment.left?{top:"0",left:"0"}:t===n.TabAlignment.bottom?{bottom:"2px",left:"2px"}:{top:"0",right:"0"},{...o,position:"absolute",zIndex:"2",height:e?.tabListHeight||"100%",width:e?.tabListWidth||"100%",border:e?.tabListBorder||"0 none",borderRadius:e?.tabListBorderRadius||"0",background:e?.tabListBackground||"transparent",boxShadow:e?.tabListBoxShadow||"0",padding:e?.tabListPadding||"0",boxSizing:"border-box"}};function qn(e){return{height:e?.tabPaneHeight||"100%",width:e?.tabPaneWidth||"100%",display:"flex",position:"absolute",bottom:"0"}}const $n=(e,t,o,r,s)=>{let i=o?.id===t?.id,a=t?.style,l=e===n.TabAlignment.top||e===n.TabAlignment.bottom?"row":"column",c=a?.borderRadius,C="first"===r?`${c} 0 0 ${c}`:"last"===r?`0 ${c} ${c} 0`:"0";i&&a.activeBorderRadius&&(C=a.activeBorderRadius);let g="0";return i&&a?.boxShadow&&(g=a.boxShadow),{display:"flex",flexDirection:l,justifyContent:"center",width:a?.width,height:a?.height,backgroundColor:i?a?.activeBackground??a?.background:a?.background,borderRadius:C,boxShadow:g}},eo=e=>{let{borderRadius:t}=e??{};return{height:"100%",width:"100%",borderRadius:t}};function to(e,t){return e.id!==t?.id?{display:"none"}:{display:"flex",height:"100%",width:"100%"}}const no={tabAlignment:n.TabAlignment.bottom,tabsStyle:{},tabs:[],keepAlive:!1,tabIconAlignment:n.IconButtonAlignment.top},oo=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t,events:{ccButtonClicked:"cc-button-clicked"}}),ro=e=>{const{tabAlignment:n,tabIconAlignment:o,tabsStyle:r,tabs:s,keepAlive:i}={...no,...e},[a,l]=t.useState(null),[c,C]=t.useState(""),d=t.useRef(null),u=t.useCallback(e=>{if(s&&s.length>0){d.current=null;let t=s.findIndex(t=>t.id===e.id);t>-1&&(l(e),C(e.id),d.current=s[t].childView)}},[d,s]);t.useEffect(()=>{if(c){const e=s?.find(e=>e.id===c);e&&u(e)}else{const e=s?.find(e=>e.isActive);e&&u(e)}},[c,u,s]);const p=t.useCallback(e=>{const{style:t,iconURL:n}=e||{},{id:o}=a||{};return((e,t,n)=>({background:"inherit",buttonTextFont:t?e?.activeTitleTextFont??e?.titleTextFont:e?.titleTextFont,buttonTextColor:t?e?.activeTitleTextColor??e?.titleTextColor:e?.titleTextColor,buttonIconTint:t?e?.activeIconTint??e?.iconTint:e?.iconTint,height:"100%",width:"100%",border:e?.border,borderRadius:e?.borderRadius,gap:"8px",padding:"0",justifyContent:n?"":"center"}))(t,o===e?.id,n)},[a]),h=t.useCallback(()=>s?.map((e,t)=>{const r=0===t?"first":t===s.length-1?"last":"";let i=`${e.id}-${Math.floor(10*Math.random()+1)}`;return g.jsx("div",{className:"cc-tab-item",style:$n(n,e,a,r),children:g.jsx(oo,{alignment:o,iconURL:e.iconURL,text:e.title,buttonStyle:p(e),ccButtonClicked:t=>u(e)})},i)}),[a]),m=t.useCallback(()=>i?s.map(e=>g.jsx("div",{className:"cc-tab-pane-content",style:to(e,a),children:e?.childView?g.jsx("div",{className:"cc-tab-pane-content-view",style:eo(r),children:e?.childView}):null},e.id)):d?.current?g.jsx("div",{className:"cc-tab-pane-content",style:eo(r),children:d?.current}):null,[a]);return g.jsxs("div",{className:"cc-tabs",style:(A=r,{height:A?.height||"100%",width:A?.width||"100%",borderRadius:A?.borderRadius||"0",border:A?.border||"0 none",background:A?.background||"transparent",display:"flex",flexDirection:"row",justifyContent:"flex-start",position:"relative"}),children:[g.jsx("div",{className:"cc-tab-list",style:Xn(r,n),children:g.jsx("div",{className:"cc-tab-item__wrapper",style:{display:"flex",justifyContent:"center",height:"100%",width:"100%"},children:h()})}),g.jsx("div",{className:"cc-tab-pane",style:qn(r),children:m()})]});var A};class so{constructor(e){let{style:t,createPollStyle:n,createPollIconURL:o,deleteIconURL:r,closeIconURL:s,optionIconURL:i,addAnswerIconURL:a,optionStyle:l}=e;this.style=t,this.createPollStyle=n,this.createPollIconURL=o,this.deleteIconURL=r,this.closeIconURL=s,this.optionIconURL=i,this.addAnswerIconURL=a,this.optionStyle=l}getPollsBubbleStyle(){return this.style}getCreatePollStyle(){return this.createPollStyle}getCreatePollIconURL(){return this.createPollIconURL}getDeleteIconURL(){return this.deleteIconURL}getCloseIconURL(){return this.closeIconURL}getOptionIconURL(){return this.optionIconURL}getAddAnswerIconURL(){return this.addAnswerIconURL}getOptionStyle(){return this.optionStyle}}const io=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius,padding:"8px",position:"absolute",left:"8px",top:"8px",minHeight:"95px",minWidth:"230px",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"8px",alignItems:"flex-start"}),ao={display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"6px"},lo=e=>({textFont:e?.subtitleTextFont,textColor:e?.subtitleTextColor}),co={width:"100%",marginLeft:"-4px"},Co={position:"relative"},go={display:"flex",gap:"8px",paddingLeft:"8px",paddingRight:"8px"},uo={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"8px 28px"},po=e=>new o.AvatarStyle({borderRadius:"16px",width:"38px",height:"38px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),ho=e=>new r.IncomingCallStyle({width:"fit-content",height:"fit-content",background:e.palette.getAccent800(),border:"none",borderRadius:"8px",titleTextFont:n.fontHelper(e.typography.title2),titleTextColor:e.palette.getAccent("dark"),subtitleTextFont:n.fontHelper(e.typography.subtitle2),subtitleTextColor:e.palette.getAccent("dark"),acceptButtonTextFont:n.fontHelper(e.typography.text2),acceptButtonTextColor:e.palette.getAccent("dark"),acceptButtonBackground:e.palette.getPrimary(),acceptButtonBorderRadius:"8px",acceptButtonBorder:"none",declineButtonTextFont:n.fontHelper(e.typography.text2),declineButtonTextColor:e.palette.getAccent("dark"),declineButtonBackground:e.palette.getError(),declineButtonBorderRadius:"8px",declineButtonBorder:"none"}),mo=(e,t)=>new o.ListItemStyle({height:"100%",width:"100%",background:"transparent",activeBackground:"transparent",borderRadius:"0",titleFont:e?.titleTextFont,titleColor:e?.titleTextColor,border:"none",separatorColor:t.palette.getAccent200(),hoverBackground:"transparent"});function Ao(e,t){const n=e.getInitiator()?.getUid();return!n||n===t?.getUid()}function xo(e,t){const o=e.getStatus(),r=Ao(e,t);if(r&&o===n.CometChatUIKitConstants.calls.unanswered)return!1;const s=[n.CometChatUIKitConstants.calls.unanswered,n.CometChatUIKitConstants.calls.cancelled,n.CometChatUIKitConstants.calls.busy,n.CometChatUIKitConstants.calls.rejected];return!r&&s.includes(o)}function bo(e,t){return e.getInitiator().getUid()===t.getUid()?e.getReceiver():e.getInitiator()}function yo(e,t,o=!1){if(!e||!t)return"";let r="";const s=e.getStatus(),i=Ao(e,t),a="_";if(xo(e,t))r=`MISSED${a}CALL`;else switch(s){case n.CometChatUIKitConstants.calls.initiated:r=i?`OUTGOING${a}CALL`:`INCOMING${a}CALL`;break;case n.CometChatUIKitConstants.calls.ongoing:r=`ONGOING${a}CALL`;break;case n.CometChatUIKitConstants.calls.ended:r=i?`OUTGOING${a}CALL`:`INCOMING${a}CALL`;break;case n.CometChatUIKitConstants.calls.unanswered:r=i?`UNANSWERED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.cancelled:r=i?`CANCELLED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.rejected:r=i?`REJECTED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.busy:r=i?`UNANSWERED${a}CALL`:`MISSED${a}CALL`;break;default:r=`INCOMING${a}CALL`}return n.localize(r)}function wo(e){const t=Math.floor(e/60),n=Math.floor(e%60),o=Math.floor(60*(e-Math.floor(e)));let r="",s="",i="";return t>0&&(r=`${t}h`),n>0&&(s=`${n}m`),o>=0&&(i=`${o}s`),`${r} ${s} ${i}`}function fo(e,t){return{display:"flex",color:t?.callStatusTextColor||e.palette.getAccent600(),font:t?.callStatusTextFont||n.fontHelper(e.typography.caption1),alignItems:"center",gap:"4px"}}function Do(e,t){return new o.AvatarStyle({borderRadius:t?.borderRadius||"24px",width:t?.width||"36px",height:t?.height||"36px",border:t?.border||"none",backgroundColor:t?.backgroundColor||e.palette.getAccent700(),nameTextColor:t?.nameTextColor||e.palette.getAccent900(),backgroundSize:t?.backgroundSize||"cover",nameTextFont:t?.nameTextFont||n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:t?.outerViewBorderWidth||"",outerViewBorderSpacing:t?.outerViewBorderSpacing||"",outerViewBorderColor:t?.outerViewBorderColor||"",outerViewBorderRadius:t?.outerViewBorderRadius||""})}function Eo(e,t,r,s){const i=xo(e,s)?t.palette.getError():t.palette.getAccent();return new o.ListItemStyle({height:r?.height||"50px",width:r?.width||"100%",background:r?.background||t.palette.getBackground(),activeBackground:r?.activeBackground||t.palette.getAccent100(),borderRadius:r?.borderRadius||"0",titleFont:r?.titleFont||n.fontHelper(t.typography.title2),titleColor:r?.titleColor||i,border:r?.border||"none",separatorColor:r?.separatorColor||t.palette.getAccent200(),hoverBackground:r?.hoverBackground||t.palette.getAccent50(),padding:r?.padding||"0"})}function vo(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function So(e,t){return new r.ListStyle({height:"100%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent(),emptyStateTextColor:t?.emptyStateTextColor||e.palette.getAccent600(),emptyStateTextFont:t?.emptyStateTextFont||n.fontHelper(e.typography.caption1),errorStateTextColor:t?.errorStateTextColor||e.palette.getAccent600(),errorStateTextFont:t?.errorStateTextFont||n.fontHelper(e.typography.caption1),loadingIconTint:t?.loadingIconTint||e.palette.getAccent600()})}function Io(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),background:"transparent"}}function Fo(e,t,n,o){let r;return r=xo(e,o)?n?.missedCallIconTint||t.palette.getAccent600():e.getInitiator().getUid()===o.getUid()?n?.outgoingCallIconTint||t.palette.getAccent600():n?.incomingCallIconTint||t.palette.getAccent600(),{height:"18px",width:"18px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:r}}function ko(e,t){return{height:"20px",width:"20px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.infoIconTint||e.palette.getPrimary()}}function To(e,t){return{textFont:t?.dateSeparatorTextFont||n.fontHelper(e.typography.text2),textColor:t?.dateSeparatorTextColor||e.palette.getAccent700(),background:"transparent",padding:"0"}}const Mo={title:n.localize("CALLS"),titleAlignment:n.TitleAlignment.left,listItemView:null,subtitleView:null,tailView:null,emptyStateView:null,errorStateView:null,loadingStateView:null,emptyStateText:n.localize("NO_CALLS_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",incomingAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34856%209.89458C4.64141%2010.1873%205.03856%2010.3518%205.45265%2010.3518C5.86675%2010.3518%206.2639%2010.1873%206.55675%209.89458L7.38496%209.06639C7.45752%208.99388%207.51508%208.90778%207.55435%208.81301C7.59362%208.71825%207.61383%208.61667%207.61383%208.51409C7.61383%208.41151%207.59362%208.30993%207.55435%208.21517C7.51508%208.1204%207.45752%208.0343%207.38496%207.96179L5.77488%206.35123C5.69603%206.27169%205.601%206.21005%205.49623%206.17048C5.39146%206.13091%205.27941%206.11434%205.16767%206.1219C5.05593%206.12945%204.94713%206.16095%204.84864%206.21426C4.75015%206.26757%204.66428%206.34145%204.59686%206.43087C2.90974%208.72127%203.93211%2011.1335%206.00548%2013.2073C8.07886%2015.2812%2010.4927%2016.3025%2012.7847%2014.6154C12.8739%2014.5477%2012.9475%2014.4617%2013.0005%2014.3631C13.0536%2014.2645%2013.0848%2014.1556%2013.092%2014.0439C13.0993%2013.9322%2013.0824%2013.8202%2013.0426%2013.7155C13.0028%2013.6109%2012.9409%2013.516%2012.8612%2013.4374L11.2506%2011.8268C11.1781%2011.7543%2011.092%2011.6967%2010.9972%2011.6574C10.9025%2011.6182%2010.8009%2011.598%2010.6983%2011.598C10.5957%2011.598%2010.4941%2011.6182%2010.3994%2011.6574C10.3046%2011.6967%2010.2185%2011.7543%2010.146%2011.8268L9.31778%2012.655C9.17274%2012.8%209.05768%2012.9722%208.97918%2013.1617C8.90068%2013.3512%208.86028%2013.5543%208.86028%2013.7594C8.86028%2013.9645%208.90068%2014.1676%208.97918%2014.357C9.05768%2014.5465%209.17274%2014.7187%209.31778%2014.8637L9.89039%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.3872%208.82531L15.4626%203.75%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.5105%208.82517H10.3872V5.7019%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",incomingVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.43018%2015.8583C2.56723%2015.8583%201.86768%2015.1588%201.86768%2014.2958V5.70435C1.86768%204.8414%202.56723%204.14185%203.43018%204.14185H12.1884C13.0513%204.14185%2013.7509%204.8414%2013.7509%205.70435V14.2958C13.7509%2015.1588%2013.0513%2015.8583%2012.1884%2015.8583H3.43018Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M14.1571%2011.9541C13.9068%2011.817%2013.7512%2011.5543%2013.7512%2011.2689V8.73246C13.7512%208.44707%2013.9068%208.18437%2014.1571%208.04726L16.9754%206.50343C17.4961%206.21822%2018.132%206.59497%2018.132%207.18861V12.8128C18.132%2013.4064%2017.4961%2013.7832%2016.9754%2013.4979L14.1571%2011.9541Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.41384%2012.5186H5.1875V9.29224%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.3776%207.31396L5.28149%2012.41%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",outgoingAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34854%209.89458C4.64139%2010.1873%205.03853%2010.3518%205.45262%2010.3518C5.86671%2010.3518%206.26385%2010.1873%206.5567%209.89458L7.38488%209.06639C7.45744%208.99388%207.515%208.90778%207.55427%208.81301C7.59354%208.71825%207.61376%208.61667%207.61376%208.51409C7.61376%208.41151%207.59354%208.30993%207.55427%208.21517C7.515%208.1204%207.45744%208.0343%207.38488%207.96179L5.77484%206.35123C5.69599%206.27169%205.60096%206.21005%205.4962%206.17048C5.39143%206.13091%205.27938%206.11434%205.16764%206.1219C5.05591%206.12945%204.9471%206.16095%204.84862%206.21426C4.75013%206.26757%204.66426%206.34145%204.59684%206.43087C2.90976%208.72127%203.93211%2011.1335%206.00544%2013.2073C8.07877%2015.2812%2010.4925%2016.3025%2012.7845%2014.6154C12.8737%2014.5477%2012.9473%2014.4617%2013.0003%2014.3631C13.0534%2014.2645%2013.0846%2014.1556%2013.0918%2014.0439C13.0991%2013.9322%2013.0822%2013.8202%2013.0424%2013.7155C13.0026%2013.6109%2012.9407%2013.516%2012.861%2013.4374L11.2504%2011.8268C11.1779%2011.7543%2011.0918%2011.6967%2010.9971%2011.6574C10.9023%2011.6182%2010.8007%2011.598%2010.6982%2011.598C10.5956%2011.598%2010.494%2011.6182%2010.3992%2011.6574C10.3045%2011.6967%2010.2184%2011.7543%2010.1459%2011.8268L9.31767%2012.655C9.17263%2012.8%209.05757%2012.9722%208.97908%2013.1617C8.90058%2013.3512%208.86018%2013.5543%208.86018%2013.7594C8.86018%2013.9645%208.90058%2014.1676%208.97908%2014.357C9.05757%2014.5465%209.17263%2014.7187%209.31767%2014.8637L9.89027%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M15.4623%203.75L10.387%208.82531%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M12.3391%203.75H15.4624V6.87327%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",outgoingVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.43018%2015.8583C2.56723%2015.8583%201.86768%2015.1588%201.86768%2014.2958V5.70435C1.86768%204.8414%202.56723%204.14185%203.43018%204.14185H12.1884C13.0513%204.14185%2013.7509%204.8414%2013.7509%205.70435V14.2958C13.7509%2015.1588%2013.0513%2015.8583%2012.1884%2015.8583H3.43018Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M14.1571%2011.9541C13.9068%2011.817%2013.7512%2011.5543%2013.7512%2011.2689V8.73246C13.7512%208.44707%2013.9068%208.18437%2014.1571%208.04726L16.9754%206.50343C17.4961%206.21822%2018.132%206.59497%2018.132%207.18861V12.8128C18.132%2013.4064%2017.4961%2013.7832%2016.9754%2013.4979L14.1571%2011.9541Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M7.15111%207.31395H10.3774V10.5403%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M5.18738%2012.5186L10.2834%207.42248%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",missedAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34854%209.89458C4.64139%2010.1873%205.03853%2010.3518%205.45262%2010.3518C5.86671%2010.3518%206.26385%2010.1873%206.5567%209.89458L7.38488%209.06639C7.45744%208.99388%207.515%208.90778%207.55427%208.81301C7.59354%208.71825%207.61376%208.61667%207.61376%208.51409C7.61376%208.41151%207.59354%208.30993%207.55427%208.21517C7.515%208.1204%207.45744%208.0343%207.38488%207.96179L5.77484%206.35123C5.69599%206.27169%205.60096%206.21005%205.4962%206.17048C5.39143%206.13091%205.27938%206.11434%205.16764%206.1219C5.05591%206.12945%204.9471%206.16095%204.84862%206.21426C4.75013%206.26757%204.66426%206.34145%204.59684%206.43087C2.90976%208.72127%203.93211%2011.1335%206.00544%2013.2073C8.07877%2015.2812%2010.4925%2016.3025%2012.7845%2014.6154C12.8737%2014.5477%2012.9473%2014.4617%2013.0003%2014.3631C13.0534%2014.2645%2013.0846%2014.1556%2013.0918%2014.0439C13.0991%2013.9322%2013.0822%2013.8202%2013.0424%2013.7155C13.0026%2013.6109%2012.9407%2013.516%2012.861%2013.4374L11.2504%2011.8268C11.1779%2011.7543%2011.0918%2011.6967%2010.9971%2011.6574C10.9023%2011.6182%2010.8007%2011.598%2010.6982%2011.598C10.5956%2011.598%2010.494%2011.6182%2010.3992%2011.6574C10.3045%2011.6967%2010.2184%2011.7543%2010.1459%2011.8268L9.31767%2012.655C9.17263%2012.8%209.05757%2012.9722%208.97908%2013.1617C8.90058%2013.3512%208.86018%2013.5543%208.86018%2013.7594C8.86018%2013.9645%208.90058%2014.1676%208.97908%2014.357C9.05757%2014.5465%209.17263%2014.7187%209.31767%2014.8637L9.89027%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M15.4622%204.53082L12.3389%207.65409L8.43481%203.75%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.43481%206.09245V3.75H10.7773%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",missedVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M14.1573%2011.9539C13.907%2011.8167%2013.7515%2011.5541%2013.7515%2011.2687V8.73221C13.7515%208.44682%2013.907%208.18413%2014.1573%208.04701L16.9757%206.50318C17.4963%206.21798%2018.1322%206.59473%2018.1322%207.18836V12.8125C18.1322%2013.4061%2017.4963%2013.7829%2016.9757%2013.4977L14.1573%2011.9539Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M11.3834%209.1351L8.17601%2012.3425L4.16675%208.33325%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.16675%2010.7388V8.33325H6.5723%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M3.22925%2015.883C2.3663%2015.883%201.66675%2015.1834%201.66675%2014.3205V5.729C1.66675%204.86606%202.3663%204.1665%203.22925%204.1665H11.9874C12.8503%204.1665%2013.5499%204.86606%2013.5499%205.729V14.3205C13.5499%2015.1834%2012.8503%2015.883%2011.9874%2015.883H3.22925Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",infoIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",callLogRequestBuilder:void 0,onItemClick:void 0,onInfoClick:void 0,onError:e=>{console.log(e)},hideSeparator:!0,activeCall:void 0,datePattern:n.DatePatterns.time,dateSeparatorPattern:n.DatePatterns.DayDate,callLogsStyle:{},avatarStyle:{},listItemStyle:{},outgoingCallConfiguration:{}},Bo=e=>{const{title:i,titleAlignment:a,listItemView:l,subtitleView:c,tailView:C,errorStateView:d,emptyStateView:u,loadingStateView:p,emptyStateText:h,errorStateText:m,loadingIconURL:A,incomingAudioCallIconUrl:x,incomingVideoCallIconUrl:b,outgoingAudioCallIconUrl:y,outgoingVideoCallIconUrl:w,missedAudioCallIconUrl:f,missedVideoCallIconUrl:D,infoIconUrl:E,activeCall:v,callLogRequestBuilder:S,onItemClick:I,onInfoClick:F,onError:T,hideSeparator:B,datePattern:L,dateSeparatorPattern:R,callLogsStyle:P,avatarStyle:O,listItemStyle:j,outgoingCallConfiguration:V}={...Mo,...e},{theme:G}=t.useContext(U),[H,Q]=t.useState([]),[N,K]=t.useState(null),[z,Y]=t.useState(n.States.loading),[_,W]=t.useState(!1),[Z,X]=t.useState(void 0),[q,$]=t.useState(void 0),[ee,te]=t.useState(null),[ne,oe]=t.useState(!1),re="callLogsScreen_"+(new Date).getTime(),se=t.useRef(null),ie=t.useRef(void 0);ie.current=Z;const ae=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)T?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);T?.(n)}},[T]),le=t.useCallback(()=>{try{if(S)return S.build();{const e=N.getAuthToken();return(new r.CometChatUIKitCalls.CallLogRequestBuilder).setLimit(30).setCallCategory("call").setAuthToken(e).build()}}catch(e){ae(e)}},[S,N,ae]),ce=t.useCallback(async()=>{try{return await(se?.current?.fetchNext())}catch(e){throw ae(e),e}},[se,ae]),Ce=t.useCallback(async()=>{try{const e=await ce();e&&e.length?(Q(t=>[...t,...e]),Y(n.States.loaded)):0===H.length&&Y(n.States.empty)}catch(e){0===H.length&&Y(n.States.error),ae(e)}},[ce,H,Q,Y,ae]),ge=t.useCallback(()=>{s.CometChat.rejectCall(q?.getSessionId(),n.CometChatUIKitConstants.calls.cancelled).then(()=>{$(void 0),W(!1),n.CometChatMessageEvents.ccMessageSent.next({message:q,status:n.MessageStatus.success})}).catch(e=>{W(!1),ae(e)})},[q,$,W,ae]),de=t.useCallback((e,t)=>{const o=n.CometChatUIKitConstants.MessageReceiverType.user,r=t;let i="";i=e===s.CometChat.CALL_TYPE.AUDIO?s.CometChat.CALL_TYPE.AUDIO:s.CometChat.CALL_TYPE.VIDEO;const a=new s.CometChat.Call(r,i,o);s.CometChat.initiateCall(a).then(e=>{X(e),$(e),W(!0),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress})}).catch(e=>{ae(e)})},[$,W,ae,X]),ue=t.useCallback(e=>{try{if(I)I(e);else{const t=bo(e,N);t.uid&&de(e?.type,t.uid)}}catch(e){ae(e)}},[I,N,de,ae]),pe=t.useCallback(e=>{try{F&&F(e)}catch(e){ae(e)}},[F,ae]),he=t.useCallback(e=>{try{return!(!v||v.getSessionID()!==e.getSessionID())}catch(e){return ae(e),!1}},[v,ae]),me=t.useCallback(e=>{try{const t=xo(e,N);let n,o=e.getType();return o=e.getType()===s.CometChat.CALL_TYPE.AUDIO?s.CometChat.CALL_TYPE.AUDIO:s.CometChat.CALL_TYPE.VIDEO,n=t?o===s.CometChat.CALL_TYPE.AUDIO?f:D:Ao(e,N)?o===s.CometChat.CALL_TYPE.AUDIO?y:w:o===s.CometChat.CALL_TYPE.AUDIO?x:b,n}catch(e){ae(e)}},[N,f,D,y,w,x,b,ae]),Ae=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){ae(e)}},[ae]),xe=t.useCallback((e,t)=>{try{return 0===t||Ae(H[t-1]?.getInitiatedAt(),e.getInitiatedAt())?g.jsx("div",{style:{margin:"5px 0",display:"flex"},children:g.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:R,dateStyle:JSON.stringify(To(G,P))})}):null}catch(e){return ae(e),null}},[R,P,Ae,H,G,ae]),be=t.useCallback(()=>new r.OutgoingCallStyle({background:V?.outgoingCallStyle?.background||G.palette.getBackground(),border:V?.outgoingCallStyle?.border||"none",borderRadius:V?.outgoingCallStyle?.borderRadius||"8px",declineButtonIconBackground:V?.outgoingCallStyle?.declineButtonIconBackground||G.palette.getError(),declineButtonIconTint:V?.outgoingCallStyle?.declineButtonIconTint||G.palette.getBackground(),declineButtonTextColor:V?.outgoingCallStyle?.declineButtonTextColor||G.palette.getAccent600(),declineButtonTextFont:V?.outgoingCallStyle?.declineButtonTextFont||n.fontHelper(G.typography.caption2),height:V?.outgoingCallStyle?.height||"580px",width:V?.outgoingCallStyle?.width||"320px",subtitleTextColor:V?.outgoingCallStyle?.subtitleTextColor||G.palette.getAccent600(),subtitleTextFont:V?.outgoingCallStyle?.subtitleTextFont||n.fontHelper(G.typography.subtitle1),titleTextColor:V?.outgoingCallStyle?.titleTextColor||G.palette.getAccent(),titleTextFont:V?.outgoingCallStyle?.titleTextFont||n.fontHelper(G.typography.heading)}),[V,G]),ye=t.useCallback(()=>new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:G.palette.getAccent900(),maximizeIconTint:G.palette.getAccent900()}),[G]),we=t.useCallback(e=>{W(!1),$(e),te(e?.getSessionId()),oe(!0)},[W,$,te,oe]),fe=t.useCallback(()=>{try{s.CometChat.addCallListener(re,new s.CometChat.CallListener({onOutgoingCallRejected:e=>{ie.current&&e.getSessionId()==ie.current.getSessionId()&&($(void 0),W(!1),oe(!1),X(void 0))},onOutgoingCallAccepted:e=>{ie.current&&e.getSessionId()==ie.current.getSessionId()&&($(void 0),we(e),W(!1),X(void 0))}}))}catch(e){ae(e)}},[re,we,ae]),De=t.useCallback(()=>{oe(!1),te(null),$(void 0)},[oe,te,$]),Ee=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallEnded.subscribe(()=>{De()});return()=>{try{e?.unsubscribe()}catch(e){ae(e)}}}catch(e){ae(e)}},[De,ae]),ve=t.useCallback(()=>{try{s.CometChat.removeCallListener(re)}catch(e){ae(e)}},[re,ae]),Se=t.useCallback(e=>null!==c?g.jsx(g.Fragment,{children:c(e)}):g.jsx(g.Fragment,{children:g.jsxs("div",{style:fo(G,P),children:[g.jsx("cometchat-icon",{URL:me(e),buttonStyle:JSON.stringify(Fo(e,G,P,N))}),yo(e,N)]})}),[c,P,N,G,me]),Ie=t.useCallback(e=>null!==C?g.jsx(g.Fragment,{children:C(e)}):g.jsx(g.Fragment,{children:g.jsxs("div",{style:{display:"flex",alignItems:"center",marginRight:"5px"},children:[g.jsx("cometchat-date",{dateStyle:JSON.stringify(Io(G,P)),pattern:L,timestamp:e?.getInitiatedAt()}),F?g.jsx(J,{iconURL:E,buttonStyle:ko(G,P),onClick:()=>pe(e)}):null]})}),[C,G,P,L,F,E,pe]),Fe=t.useMemo(()=>function(e,t){return l?l(e):g.jsxs(g.Fragment,{children:[xe(e,t)?xe(e,t):null,g.jsx(M,{title:bo(e,N)?.getName(),avatarURL:bo(e,N)?.avatar||bo(e,N)?.icon,avatarName:bo(e,N)?.getName(),listItemStyle:Eo(e,G,j,N),avatarStyle:Do(G,O),hideSeparator:B,loadingIconURL:A,isActive:he(e),onClick:t=>ue?.(e),subtitleView:Se(e),tailView:Ie(e)})]})},[l,xe,N,G,j,O,B,A,he,Se,Ie,ue]);return function(e,n,o,r,s,i,a,l,c){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)},e=>{c(e)})},[n,c]),t.useEffect(()=>{let t;return e&&(t=a?.(),o.current=r(),s?.(),i?.(),a?.()),()=>{l?.(),t?.()}},[e])}(N,K,se,le,Ce,fe,Ee,ve,ae),g.jsxs("div",{style:vo(G,P),children:[_?g.jsx("cometchat-backdrop",{children:g.jsx(nn,{onCloseClicked:V?.onDeclineButtonClicked||ge,outgoingCallStyle:be(),call:q,avatarStyle:V?.avatarStyle,customSoundForCalls:V?.customSoundForCalls,customView:V?.customView,declineButtonIconURL:V?.declineButtonIconURL,disableSoundForCalls:V?.disableSoundForCalls,onError:V?.onError})}):null,ne&&!v?g.jsx(Qt,{sessionID:ee,callWorkflow:n.CallWorkflow.defaultCalling,ongoingCallStyle:ye()}):null,g.jsx(k,{hideSearch:!0,list:H,onScrolledToBottom:Ce,listItemKey:"getSessionID",listItem:Fe,title:i,titleAlignment:a,loadingIconURL:A,emptyStateText:h,errorStateText:m,emptyStateView:u,errorStateView:d,loadingView:p,listStyle:So(G,P),state:z,showSectionHeader:!1})]})};function Lo(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function Uo(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none",position:"relative"}}function Ro(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}function Po(e,t){const{backgroundColor:r,titleColor:s,titleFont:i}=t;return new o.ListItemStyle({background:r||"transparent",activeBackground:r||"transparent",border:"none",hoverBackground:r||"transparent",titleColor:s||e.palette.getAccent(),borderRadius:"0",titleFont:i||n.fontHelper(e.typography.text1),separatorColor:e.palette.getAccent200()})}class Oo{static getDefaultCallTemplate(e,t,n){return[this.getPrimaryDetailsTemplate(e,t,n),this.getSecondaryDetailsTemplate(e,t,n)]}static getCallButtons(e,t){return g.jsx(sn,{user:e,group:t,callButtonsStyle:{width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent",buttonPadding:"8px 32px",buttonBackground:"RGBA(20, 20, 20, 0.04)",buttonBorder:"0 4px",buttonBorderRadius:"10px"},voiceCallIconText:n.localize("AUDIO_CALL"),videoCallIconText:n.localize("VIDEO_CALL")},"callbuttons")}static getPrimaryDetailsTemplate(e,t,o){return new n.CometChatCallDetailsTemplate({id:"callControls",hideSectionSeparator:!0,options:(n,r)=>this.getPrimaryOptions(n??void 0,r??void 0,e??void 0,t??void 0,o??void 0)})}static getSecondaryDetailsTemplate(e,t,o){return new n.CometChatCallDetailsTemplate({id:"callOptions",hideSectionSeparator:!0,options:()=>this.getSecondaryOptions(e??void 0,o??void 0)})}static getPrimaryOptions(e,t,o,r,s){let i=[];return e&&i.push(new n.CometChatCallDetailsOption({id:"callControls",customView:this.getCallButtons(e,t)})),i.push(new n.CometChatCallDetailsOption({id:"callStatus",customView:this.generateCallDetailsHTML(o,o?.getInitiatedAt(),r,s)})),i}static getSecondaryOptions(e,t){const o=[];if(e?.participants&&e?.participants.length>0){const r=(e?.participants||[])?.length;o.push(new n.CometChatCallDetailsOption({id:"participants",customView:this.generateCallOptionsHTML("Participants",r,t)}))}if(e?.hasRecording){const r=(e?.getRecordings()||[])?.length;o.push(new n.CometChatCallDetailsOption({id:"recordings",customView:this.generateCallOptionsHTML("Recordings",r,t)}))}return o.push(new n.CometChatCallDetailsOption({id:"callHistory",customView:this.generateCallOptionsHTML("History",0,t)})),o}static generateCallDetailsHTML(e,t,r,s){const i=new o.ListItemStyle({height:"auto",width:"100%",background:s?.palette?.getAccent100(),hoverBackground:s?.palette?.getAccent100(),borderRadius:"8px",border:"none",padding:"10px"}),a=new o.DateStyle({textColor:s?.palette?.getAccent600(),textFont:n.fontHelper(s?.typography?.text3),padding:"0px",background:"transparent"}),l=new o.DateStyle({textColor:s?.palette?.getAccent600(),textFont:n.fontHelper(s?.typography?.subtitle2),padding:"0px",background:"transparent"}),c=yo(e,r,!0),C=g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[g.jsx("cometchat-date",{dateStyle:JSON.stringify(a),pattern:n.DatePatterns.DayDate,timestamp:t}),g.jsxs("div",{style:{display:"flex",gap:"5px"},children:[g.jsx("cometchat-date",{dateStyle:JSON.stringify(l),pattern:n.DatePatterns.time,timestamp:t}),g.jsx("div",{style:{font:n.fontHelper(s?.typography?.text2),color:s.palette.getAccent()},children:c})]})]}),d=g.jsx("div",{style:{font:n.fontHelper(s?.typography?.text3),color:s?.palette?.getAccent600(),marginRight:"15px",marginTop:"15px"},children:wo(e?.getTotalDurationInMinutes())});return g.jsx("div",{style:{marginTop:"25px",marginBottom:"25px",width:"100%",paddingLeft:"10px",paddingRight:"10px",boxSizing:"border-box"},children:g.jsx(M,{hideSeparator:!0,listItemStyle:i,subtitleView:C,tailView:d},t)})}static generateCallOptionsHTML(e,t,o){const r={iconHeight:"18px",iconWidth:"18px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:o.palette.getAccent600()},s={margin:"10px",marginBottom:"5px",padding:"10px",boxSizing:"border-box",background:o?.palette?.getAccent100(),borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",width:"100%"},i={font:n.fontHelper(o?.typography?.text2),color:o?.palette?.getAccent()},a={display:"flex",alignItems:"center",gap:"5px",font:n.fontHelper(o?.typography?.text3),color:o?.palette?.getAccent600()};return g.jsxs("div",{style:s,children:[g.jsx("span",{style:i,children:e}),g.jsxs("span",{style:a,children:[t>0?t:"",g.jsx(J,{iconURL:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20height%3D%2224px%22%20width%3D%2224px%22%3E%3Cg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20transform%3D%22matrix%28-1%200%200%20-1%2024%2024%29%22%3E%3Cg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20transform%3D%22matrix%280%201%20-1%200%2024%20-0%29%22%3E%3Ctitle%3EIcons%2F24%2FClose%20Chat%3C%2Ftitle%3E%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cg%20id%3D%22Icons%2F24%2FClose-Chat%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.700000%2C%208.000000%29%22%3E%3Cpath%20d%3D%22M20.625%2C0%20L10.7983333%2C9.82575%20C10.669546%2C9.9547209%2010.4947627%2C10.0271915%2010.3125%2C10.0271915%20C10.1302373%2C10.0271915%209.95545401%2C9.9547209%209.82666667%2C9.82575%20L0%2C0%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:r})]})]})}}function jo(e,t){return{background:"transparent",textColor:t?.dateTextColor||e.palette.getAccent600(),textFont:t?.dateTextFont||n.fontHelper(e.typography.subtitle2)}}function Vo(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function Go(e,t){return{font:t?.callStatusTextFont||n.fontHelper(e.typography.text2),color:t?.callStatusTextColor||e.palette.getAccent()}}function Ho(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function Qo(e,t){return new r.ListStyle({height:"90%",emptyStateTextColor:t?.emptyStateTextColor||e.palette.getAccent600(),emptyStateTextFont:t?.emptyStateTextFont||n.fontHelper(e.typography.caption1),errorStateTextColor:t?.errorStateTextColor||e.palette.getAccent600(),errorStateTextFont:t?.errorStateTextFont||n.fontHelper(e.typography.caption1),loadingIconTint:t?.loadingIconTint||e.palette.getAccent600()})}function No(e,t){return{font:t?.callDurationTextColor||n.fontHelper(e.typography.caption1),color:t?.callDurationTextColor||e.palette.getAccent500()}}function Ko(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function zo(e,t){return{textFont:t?.dateSeparatorTextFont||n.fontHelper(e.typography.text3),textColor:t?.dateSeparatorTextColor||e.palette.getAccent700(),background:"transparent"}}function Jo(e,t){return{height:"1px",width:"100%",background:t?.dividerColor||e.palette.getAccent200()}}function Yo(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const _o={title:n.localize("CALL_HISTORY"),emptyStateText:n.localize("NO_CALLS_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",emptyStateView:null,loadingStateView:null,errorStateView:null,subtitleView:null,tailView:null,callLogRequestBuilder:void 0,callUser:void 0,callGroup:void 0,onItemClick:void 0,onBackClick:void 0,onError:()=>{},datePattern:n.DatePatterns.time,dateSeparatorPattern:n.DatePatterns.DayDate,listItemStyle:{},callLogHistoryStyle:{}},Wo=e=>{const{title:o,emptyStateText:i,errorStateText:a,backIconUrl:l,loadingIconURL:c,emptyStateView:C,errorStateView:d,loadingStateView:u,subtitleView:p,tailView:h,callLogRequestBuilder:m,callUser:A,callGroup:x,onItemClick:b,onBackClick:y,onError:w,datePattern:f,dateSeparatorPattern:D,listItemStyle:E,callLogHistoryStyle:v}={..._o,...e},{theme:S}=t.useContext(U),[I,F]=t.useState([]),[T,B]=t.useState(null),[L,R]=t.useState(n.States.loading),P=t.useRef(null),O=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)w?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);w?.(n)}},[w]),j=t.useCallback(()=>{try{let e;if(m)e=m;else{const t=T.getAuthToken()||"";e=(new r.CometChatUIKitCalls.CallLogRequestBuilder).setLimit(30).setCallCategory("call").setAuthToken(t)}return x?e=e.setGuid(x?.getGuid()):A&&(e=e.setUid(A?.getUid())),e.build()}catch(e){O(e)}},[m,x,A,T,O]),V=t.useCallback(async()=>{try{return await(P?.current?.fetchNext())}catch(e){throw O(e),new Error("Error while fetching call list")}},[P,O]),G=t.useCallback(async()=>{try{const e=await V();e&&e.length>0?(F(t=>[...t,...e]),R(n.States.loaded)):0===I.length&&R(n.States.empty)}catch(e){0===I.length&&R(n.States.error),O(e)}},[V,F,R,I,O]),H=t.useCallback(e=>{try{b&&b(e)}catch(e){O(e)}},[b,O]),Q=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){return O(e),!1}},[O]),N=t.useCallback((e,t)=>{try{return 0===t?g.jsx("div",{style:{margin:"4px 0 0 8px"},children:g.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:D,dateStyle:JSON.stringify(zo(S,v))})}):Q(I[t-1]?.getInitiatedAt(),e.getInitiatedAt())?g.jsxs(g.Fragment,{children:[g.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Jo(S,v))}),g.jsx("div",{style:{margin:"4px 0 0 8px"},children:g.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:D,dateStyle:JSON.stringify(zo(S,v))})})]}):null}catch(e){return O(e),null}},[D,S,v,Q,I,O]),K=t.useCallback(e=>{try{return!!e?.getTotalDurationInMinutes()&&wo(e?.getTotalDurationInMinutes())}catch(e){return O(e),!1}},[O]),z=t.useCallback(e=>p?p(e):g.jsx(g.Fragment,{children:g.jsxs("div",{style:{display:"flex"},children:[g.jsx("cometchat-date",{dateStyle:JSON.stringify(jo(S,v)),pattern:f,timestamp:e?.getInitiatedAt()}),g.jsx("div",{style:Go(S,v),children:yo(e,T,!0)})]})}),[p,S,v,f,T]),Y=t.useCallback(e=>h?h(e):g.jsx(g.Fragment,{children:g.jsx("div",{style:No(S,v),children:K(e)?K(e):"00:00"})}),[h,S,v,K]),_=t.useMemo(()=>function(e,t){return g.jsxs(g.Fragment,{children:[N(e,t)?g.jsx("div",{children:N(e,t)}):null,g.jsx(M,{loadingIconURL:c,listItemStyle:Vo(S,E),onClick:t=>H?.(e),subtitleView:z(e),tailView:Y(e),hideSeparator:!0})]})},[N,c,S,E,z,Y,H]);return function(e,n,o,r,s,i){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{e&&(o.current=r(),s?.())},[e])}(T,B,P,j,G,O),g.jsx(g.Fragment,{children:g.jsxs("div",{style:Ho(S,v),children:[g.jsxs("div",{style:{display:"flex",padding:"10px 30px",alignItems:"center",marginBottom:"10px"},children:[y?g.jsx("div",{style:{marginRight:"15px"},children:g.jsx(J,{iconURL:l,buttonStyle:Ko(S,v),onClick:y?.()})}):null,g.jsx("div",{style:Yo(S,v),children:o})]}),g.jsx(k,{hideSearch:!0,list:I,onScrolledToBottom:G,listItemKey:"getSessionID",listItem:_,loadingIconURL:c,emptyStateText:i,errorStateText:a,loadingView:u,emptyStateView:C,errorStateView:d,listStyle:Qo(S,v),state:L,showSectionHeader:!1})]})})};function Zo(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function Xo(e,t){return new r.ListStyle({height:"90%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent()})}function qo(e,t){return new o.AvatarStyle({borderRadius:t?.borderRadius||"24px",width:t?.width||"36px",height:t?.height||"36px",border:t?.border||"none",backgroundColor:t?.backgroundColor||e.palette.getAccent700(),nameTextColor:t?.nameTextColor||e.palette.getAccent900(),backgroundSize:t?.backgroundSize||"cover",nameTextFont:t?.nameTextFont||n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:t?.outerViewBorderWidth||"",outerViewBorderSpacing:t?.outerViewBorderSpacing||"",outerViewBorderColor:t?.outerViewBorderColor||"",outerViewBorderRadius:t?.outerViewBorderRadius||""})}function $o(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",titleFont:t?.titleFont||n.fontHelper(e.typography.title2),titleColor:t?.titleColor||e.palette.getAccent(),border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function er(e,t){return{display:"flex",color:t?.callStatusColor||e.palette.getAccent600(),font:t?.callStatusFont||n.fontHelper(e.typography.caption1)}}function tr(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),font:t?.dateTextFont||n.fontHelper(e.typography.caption1),color:t?.dateTextColor||e.palette.getAccent500(),background:"transparent",padding:"3px 10px"}}function nr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function or(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const rr={title:n.localize("PARTICIPANTS"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",call:void 0,datePattern:n.DatePatterns.time,avatarStyle:{},listItemStyle:{},callLogParticipantsStyle:{},listItemView:null,subtitleView:null,tailView:null,onBackClick:void 0,onItemClick:void 0},sr=e=>{const{title:o,backIconUrl:r,call:s,datePattern:i,avatarStyle:a,listItemStyle:l,callLogParticipantsStyle:c,listItemView:C,subtitleView:d,tailView:u,onBackClick:p,onItemClick:h}={...rr,...e},{theme:m}=t.useContext(U),A=t.useCallback(e=>{h&&h(e)},[h]),x=t.useCallback(()=>s?.getParticipants(),[s]),b=t.useCallback(()=>s?.getInitiatedAt(),[s]),y=e=>e?.getHasJoined()||e?.getJoinedAt()?wo(e?.getTotalDurationInMinutes()):wo(0),w=t.useCallback(e=>d?d(e):g.jsx(g.Fragment,{children:g.jsx("div",{style:er(m,c),children:y(e)})}),[d,m,c]),f=t.useCallback(e=>u?u(e):g.jsx(g.Fragment,{children:g.jsx("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:g.jsx("cometchat-date",{dateStyle:JSON.stringify(tr(m,c)),pattern:i,timestamp:b()})})}),[u,m,c,i,b]),D=t.useMemo(()=>function(e,t){return C?C(e):g.jsx(g.Fragment,{children:g.jsx(M,{title:e?.getName(),avatarURL:e?.getAvatar(),avatarName:e?.getName(),listItemStyle:$o(m,l),avatarStyle:qo(m,a),hideSeparator:!0,onClick:t=>A?.(e),subtitleView:w(e),tailView:f(e)})})},[C,m,l,a,w,f,A]);return g.jsx(g.Fragment,{children:g.jsxs("div",{style:nr(m,c),children:[g.jsxs("div",{style:{display:"flex",padding:"10px 20px",alignItems:"center",marginBottom:"10px"},children:[p?g.jsx("div",{style:{marginRight:"15px"},children:g.jsx(J,{iconURL:r,buttonStyle:Zo(m,c),onClick:p?.()})}):null,g.jsx("div",{style:or(m,c),children:o})]}),g.jsx(k,{hideSearch:!0,list:x()||[],listItem:D,listItemKey:"getUid",listStyle:Xo(m,c),state:n.States.loaded,showSectionHeader:!1})]})})};function ir(e,t){return new r.ListStyle({height:"90%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent()})}function ar(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",titleFont:t?.titleFont||n.fontHelper(e.typography.title2),titleColor:t?.titleColor||e.palette.getAccent(),border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function lr(e,t){return{display:"flex",color:t?.recordingDurationColor||e.palette.getAccent600(),font:t?.recordingDurationFont||n.fontHelper(e.typography.caption1)}}function cr(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),background:"transparent"}}function Cr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function gr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.downloadIconTint||e.palette.getPrimary()}}function dr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function ur(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const pr={title:n.localize("RECORDING"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",downloadIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDownload%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDownload%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%227.33333333%2013.2%2011%2016.8666667%2014.6666667%2013.2%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211%22%20y1%3D%225.86666667%22%20x2%3D%2211%22%20y2%3D%2216.8666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C11%20C0%2C17.0751322%204.92486775%2C22%2011%2C22%20C17.0751322%2C22%2022%2C17.0751322%2022%2C11%20C22%2C4.92486775%2017.0751322%2C0%2011%2C0%20C4.92486775%2C0%200%2C4.92486775%200%2C11%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hideDownloadButton:!1,call:void 0,datePattern:n.DatePatterns.time,listItemStyle:{},callLogRecordingsStyle:{},onBackClick:void 0,onItemClick:void 0,onDownloadClick:void 0,listItemView:null,subtitleView:null,tailView:null},hr=e=>{const{title:o,backIconUrl:r,downloadIconUrl:s,hideDownloadButton:i,call:a,datePattern:l,listItemStyle:c,callLogRecordingsStyle:C,onBackClick:d,onItemClick:u,onDownloadClick:p,listItemView:h,subtitleView:m,tailView:A}={...pr,...e},{theme:x}=t.useContext(U),b=t.useCallback(e=>{u&&u(e)},[u]),y=t.useCallback(e=>{var t;p?p(e):(t=e?.getRecordingURL(),fetch(t).then(e=>e.blob()).then(e=>{const t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="recording.mp4",document.body.appendChild(n),n.click()}).catch(e=>console.error(e)))},[p]),w=t.useCallback(()=>{try{return a?.getRecordings()}catch(e){console.log(e)}},[a]),f=e=>{try{return e?.getStartTime()}catch(e){console.log(e)}},D=e=>{try{return function(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%3600%60);let r="",s="",i="";return t>0&&(r=`${t}h`),n>0&&(s=`${n}m`),o>=0&&(i=`${o}s`),`${r} ${s} ${i}`}(e?.getDuration())}catch(e){console.log(e)}},E=t.useCallback(e=>m?m(e):g.jsx(g.Fragment,{children:g.jsx("div",{style:lr(x,C),children:D(e)})}),[m,x,C]),v=t.useCallback(e=>A?A(e):g.jsx(g.Fragment,{children:g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[g.jsx("cometchat-date",{dateStyle:JSON.stringify(cr(x,C)),pattern:l,timestamp:f(e)}),i?null:g.jsx(J,{iconURL:s,buttonStyle:gr(x,C),onClick:()=>y(e)})]})}),[A,x,C,l,i,s,y]),S=t.useMemo(()=>function(e,t){return h?h(e):g.jsx(g.Fragment,{children:g.jsx(M,{title:e?.getRid(),listItemStyle:ar(x,c),hideSeparator:!0,onClick:t=>b?.(e),subtitleView:E(e),tailView:v(e)})})},[h,x,c,E,v,b]);return g.jsx(g.Fragment,{children:g.jsxs("div",{style:dr(x,C),children:[g.jsxs("div",{style:{display:"flex",padding:"10px 20px",alignItems:"center",marginBottom:"10px"},children:[d?g.jsx("div",{style:{marginRight:"15px"},children:g.jsx(J,{iconURL:r,buttonStyle:Cr(x,C),onClick:d?.()})}):null,g.jsx("div",{style:ur(x,C),children:o})]}),g.jsx(k,{hideSearch:!0,list:w()||[],listItem:S,listItemKey:"getRid",listStyle:ir(x,C),state:n.States.loaded,showSectionHeader:!1})]})})};const mr={title:n.localize("CALL_DETAIL"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onBackClick:void 0,avatarStyle:{},data:(e,t,n)=>[],callLogHistoryConfiguration:{},callLogParticipantsConfiguration:{},callLogRecordingsConfiguration:{},callLogDetailsStyle:{}},Ar=e=>{const{title:r,backIconUrl:s,call:i,onBackClick:a,avatarStyle:l,data:c,callLogHistoryConfiguration:C,callLogParticipantsConfiguration:d,callLogRecordingsConfiguration:u,callLogDetailsStyle:p}={...mr,...e},{theme:h}=t.useContext(U),[m,A]=t.useState(null),[x,b]=t.useState([]),[y,w]=t.useState(!1),[f,D]=t.useState(!1),[E,v]=t.useState(!1),S=t.useCallback(()=>({...new o.AvatarStyle(I(h)),...l}),[l,h]),I=e=>({borderRadius:"24px",width:"50px",height:"50px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""}),F=t.useCallback(()=>{let e=c?.(i,m,h);e&&e.length||(e=Oo.getDefaultCallTemplate(i,m,h)),b([...e])},[b,i,m,h]),k=t.useCallback(e=>{const{options:t,id:n}=e;let o=[];if(t&&void 0!==n){const e=bo(i,m);o=e?.getUid?t(e,null,n):t(null,e,n)}return o},[i,m]),T=t.useCallback(e=>{if(e?.onClick)e.onClick(i);else switch(e.id){case"participants":w(!0);break;case"recordings":D(!0);break;case"callHistory":v(!0)}},[i,w,D,v]),B=t.useCallback(()=>m&&!y&&!f&&!E,[m,y,f,E]),L=t.useCallback(()=>m&&y&&!f&&!E,[m,y,f,E]),R=t.useCallback(()=>m&&!y&&f&&!E,[m,y,f,E]),P=t.useCallback(()=>m&&!y&&!f&&E,[m,y,f,E]),O=t.useCallback(()=>{w(!1),D(!1),v(!1)},[w,D,v]),j=t.useCallback(()=>{const e=bo(i,m);return e?.getUid?e:void 0},[i,m]),V=t.useCallback(()=>{const e=bo(i,m);return e?.getGuid?e:void 0},[i,m]),G=t.useCallback(()=>g.jsx(g.Fragment,{children:x.map(e=>g.jsxs("div",{children:[k(e).map(t=>{const n={backgroundColor:t.backgroundColor,titleColor:t.titleColor,titleFont:t.titleFont};return g.jsx("div",{children:g.jsx("div",{style:{width:"100%"},className:"cc-call-details__options",children:t.customView?g.jsx("div",{className:"cc-call-details__option-content",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},onClick:()=>T(t),children:t.customView}):g.jsx(M,{title:t.title,avatarURL:t.iconURL,onClick:()=>T(t),listItemStyle:Po(h,n),hideSeparator:e.hideItemSeparator,avatarStyle:new o.AvatarStyle({backgroundColor:t.iconTint}),id:t.id,tailView:t.tail},t.id)},t?.id)})}),e.title]}))}),[x,k,T]);return function(e,n,o,r){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)})},[n]),t.useEffect(()=>{e&&r?.()},[e,o])}(m,A,i,F),g.jsx(g.Fragment,{children:g.jsxs("div",{style:Uo(h,p),children:[B()?g.jsxs("div",{children:[a?g.jsxs("div",{style:{position:"absolute",top:"15px",left:"15px",display:"flex",gap:"8px",justifyContent:"center"},children:[g.jsx(J,{iconURL:s,buttonStyle:Lo(h,p),onClick:a?.()}),g.jsx("div",{style:Ro(h,p),children:r})]}):null,g.jsxs("div",{style:{height:"auto",width:"100%",minHeight:"150px",padding:"16px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",boxSizing:"border-box",gap:"8px"},children:[g.jsx("cometchat-avatar",{avatarStyle:JSON.stringify(S()),image:bo(i,m).avatar,name:bo(i,m).name}),g.jsx("span",{style:((e,t)=>({color:t?.nameTextColor||e.palette.getAccent(),font:t?.nameTextFont||n.fontHelper(e.typography.title1)}))(h,p),children:bo(i,m).name})]}),G()]}):null,L()?g.jsx(sr,{call:i,title:n.localize("PARTICIPANTS"),backIconUrl:d?.backIconUrl||s,avatarStyle:d?.avatarStyle||l,onBackClick:()=>d?.onBackClick||O,onItemClick:d?.onItemClick||void 0,datePattern:d?.datePattern||void 0,listItemStyle:d?.listItemStyle||void 0,callLogParticipantsStyle:d?.callLogParticipantsStyle||void 0,listItemView:d?.listItemView||null,subtitleView:d?.subtitleView||null,tailView:d?.tailView||null}):null,R()?g.jsx(hr,{call:i,title:n.localize("RECORDING"),backIconUrl:u?.backIconUrl||s,onBackClick:()=>u?.onBackClick||O,onItemClick:u?.onItemClick||void 0,datePattern:u?.datePattern||void 0,listItemStyle:u?.listItemStyle||void 0,callLogRecordingsStyle:u?.callLogRecordingsStyle||void 0,downloadIconUrl:u?.downloadIconUrl||void 0,hideDownloadButton:u?.hideDownloadButton||void 0,onDownloadClick:u?.onDownloadClick||void 0,listItemView:u?.listItemView||null,subtitleView:u?.subtitleView||null,tailView:u?.tailView||null}):null,P()?g.jsx(Wo,{callUser:j(),callGroup:V(),title:n.localize("CALL_HISTORY"),backIconUrl:C?.backIconUrl||s,listItemStyle:C?.listItemStyle||void 0,emptyStateView:C?.emptyStateView||null,errorStateView:C?.errorStateView||null,loadingIconURL:C?.loadingIconURL||void 0,loadingStateView:C?.loadingStateView||null,subtitleView:C?.subtitleView||void 0,tailView:C?.tailView||null,callLogRequestBuilder:C?.callLogRequestBuilder||null,onItemClick:C?.onItemClick||void 0,onBackClick:()=>C?.onBackClick||O,datePattern:C?.datePattern||void 0,dateSeparatorPattern:C?.dateSeparatorPattern||void 0,callLogHistoryStyle:C?.callLogHistoryStyle||void 0,onError:C?.onError||void 0}):null]})})};function xr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",border:t?.border||"none",borderRadius:t?.borderRadius||"0px",background:t?.background||e.palette.getBackground(),display:"flex",boxSizing:"border-box",position:"relative"}}function br(e,t){return new o.LabelStyle({background:"transparent",textFont:t?.messageTextFont||n.fontHelper(e.typography.heading),textColor:t?.messageTextColor||e.palette.getAccent700()})}const yr={isMobileView:!1,messageText:n.localize("NO_CALLS_SELECTED"),withDetailsStyle:{},callLogDetailsConfiguration:{},callLogsConfiguration:{}};function wr(e,t){return{position:"relative",width:e?.width||"100%",height:e?.height||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||"none",borderRadius:e?.borderRadius||"0",boxShadow:e?.boxShadow,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:e?.padding||"0",overflow:"hidden"}}function fr(e,t){return new r.UsersStyle({width:"100%",height:"100%",border:"none",borderRadius:"0",background:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.title1),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.title1),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),onlineStatusColor:e?.onlineStatusColor||t.palette.getSuccess(),separatorColor:e?.separatorColor||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent400(),searchBorder:e?.searchBorder||`1px solid ${t.palette.getAccent50()}`,searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent400(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),sectionHeaderTextFont:e?.sectionHeaderTextFont,sectionHeaderTextColor:e?.sectionHeaderTextColor})}function Dr(e,t){return{background:e?.addMembersButtonBackground||t.palette.getPrimary(),buttonTextColor:e?.addMembersButtonTextColor||t.palette.getAccent900(),buttonTextFont:e?.addMembersButtonTextFont||n.fontHelper(t.typography.title2),width:"100%",border:"none",borderRadius:"8px",padding:"16px 0",display:"flex",justifyContent:"center",textAlign:"center"}}function Er(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",left:"19px",top:"19px"}}function vr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",top:"19px",right:"19px"}}var Sr="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",Ir="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Fr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",kr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Tr(e){const{backButtonIconURL:o=Fr,showBackButton:i=!1,onBack:a,title:l=n.localize("ADD_MEMBERS"),titleAlignment:c=n.TitleAlignment.center,hideSearch:C=!1,searchIconURL:d=Sr,searchPlaceholder:u=n.localize("SEARCH"),showSectionHeader:p=!1,sectionHeaderField:h="getName",loadingIconURL:A=Ir,loadingStateView:b,emptyStateText:y=n.localize("NO_USERS_FOUND"),emptyStateView:w,errorStateText:f=n.localize("SOMETHING_WRONG"),errorStateView:D,hideError:E=!1,disableUsersPresence:v=!1,hideSeparator:S=!1,onError:I,menus:F,options:k,selectionMode:T=n.SelectionMode.multiple,onSelect:M,usersRequestBuilder:B,searchRequestBuilder:L,listItemView:R,subtitleView:P,group:O,onAddMembersButtonClick:j=null,buttonText:V=n.localize("ADD_MEMBERS"),closeButtonIconURL:G=kr,onClose:H,statusIndicatorStyle:Q,avatarStyle:N,listItemStyle:K,addMembersStyle:z=null}=e,Y=t.useRef([]),_=t.useRef(T),W=t.useRef(null),Z=m(M),X=m(O),$=m(a),ee=m(j),te=x(I),{theme:ne}=t.useContext(U),oe=t.useCallback(e=>{const t=new s.CometChat.GroupMember(e.getUid(),n.CometChatUIKitConstants.groupMemberScope.participant);return t.setName(e.getName()),t.setGuid(X.current.getGuid()),t},[X]),re=t.useCallback((e,t)=>{if(Z.current)return Z.current(e,t);if(_.current===n.SelectionMode.single)Y.current=[oe(e)];else if(_.current===n.SelectionMode.multiple){const t=e.getUid(),n=[];let o=!1;for(let e=0;e<Y.current.length;e++){const r=Y.current[e];t===r.getUid()?o=!0:n.push(r)}o||n.push(oe(e)),Y.current=n}},[oe,Z]),se=t.useCallback((e,t,o)=>{const i=new s.CometChat.Action(o.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return i.setAction(n.CometChatUIKitConstants.groupMemberAction.ADDED),i.setActionBy(r.CometChatUIKitUtility.clone(t)),i.setActionFor(r.CometChatUIKitUtility.clone(o)),i.setActionOn(r.CometChatUIKitUtility.clone(e)),i.setReceiver(r.CometChatUIKitUtility.clone(o)),i.setSender(r.CometChatUIKitUtility.clone(t)),i.setConversationId("group_"+o.getGuid()),i.setMuid(r.CometChatUIKitUtility.ID()),i.setMessage(`${t.getName()} added ${e.getUid()}`),i.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),i},[]),ie=t.useCallback(async()=>{if(0!==Y.current.length)try{const e=X.current,t=ee.current;if(t)return t(e.getGuid(),Y.current),void(Y.current=[]);const o=new Set,i=await s.CometChat.addMembersToGroup(e.getGuid(),Y.current,[]);if(i)for(const e in i)"success"===i[e]&&o.add(e);const a=[];for(let e=0;e<Y.current.length;e++){const t=Y.current[e];o.has(t.getUid())&&a.push(t)}const l=W.current;if(l){const t=r.CometChatUIKitUtility.clone(e);t.setMembersCount(e.getMembersCount()+a.length),n.CometChatGroupEvents.ccGroupMemberAdded.next({messages:a.map(e=>se(e,l,t)),usersAdded:a,userAddedIn:t,userAddedBy:r.CometChatUIKitUtility.clone(l)})}Y.current=[],$.current?.()}catch(e){te(e)}},[te,se,X,ee,$]);return function(e){const{loggedInUserRef:n,errorHandler:o,selectionMode:r,selectionModeRef:i,membersToAddRef:a}=e;t.useEffect(()=>{i.current!==r&&(i.current=r,a.current=[])},[r,a,i]),t.useEffect(()=>{(async()=>{try{n.current=await s.CometChat.getLoggedinUser()}catch(e){o(e)}})()},[o,n])}({loggedInUserRef:W,errorHandler:te,selectionMode:T,selectionModeRef:_,membersToAddRef:Y}),g.jsxs("div",{className:"cc-add-members",style:wr(z,ne),children:[g.jsx(q,{title:l,tileAlignment:c,hideSearch:C,searchIconURL:d,searchPlaceholderText:u,showSectionHeader:p,sectionHeaderKey:h,loadingIconURL:A,loadingStateView:b,emptyStateText:y,emptyStateView:w,errorStateText:f,errorStateView:D,hideError:E,disableUsersPresence:v,hideSeparator:S,onError:I,menus:F,options:k,selectionMode:T,onSelect:re,usersRequestBuilder:B,searchRequestBuilder:L,listItemView:R,subtitleView:P,statusIndicatorStyle:Q,avatarStyle:N,listItemStyle:K,usersStyle:fr(z,ne),onItemClick:void 0,activeUser:void 0}),g.jsx("div",{className:"cc-add-members__add-btn-wrapper",style:{padding:"16px",boxSizing:"border-box"},children:g.jsx(J,{text:V,buttonStyle:Dr(z,ne),onClick:ie})}),i?g.jsx(J,{iconURL:o,buttonStyle:Er(z,ne),onClick:a}):null,g.jsx(J,{iconURL:G,buttonStyle:vr(z,ne),onClick:H})]})}function Mr(e,t){return{position:"relative",height:e?.height||"100%",width:e?.width||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||"none",borderRadius:e?.borderRadius||"0",boxShadow:e?.boxShadow||"",padding:e?.padding||"0",boxSizing:"border-box"}}function Br(e,t){return new r.ListStyle({width:"100%",height:"100%",background:"inherit",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),separatorColor:e?.separatorColor||t.palette.getAccent400()})}function Lr(e){return{...e||{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function Ur(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"36px",height:e?.height||"36px",border:e?.border||"none",backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Rr(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function Pr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",left:"19px",top:"19px"}}function Or(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",right:"19px",top:"19px"}}function jr(e,t){return{border:"none",borderRadius:"0",buttonIconTint:e?.unbanIconTint||t.palette.getPrimary(),background:"transparent"}}function Vr(e){return new o.MenuListStyle({border:"none",borderRadius:"8px",background:e.palette.getBackground(),moreIconTint:e.palette.getPrimary(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${e.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground()})}var Gr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";class Hr{constructor(e){const{bannedMembersRequestBuilder:t,searchRequestBuilder:n,searchText:o,groupGuid:r,bannedMembersSearchText:i}=e;let a=t||new s.CometChat.BannedMembersRequestBuilder(r).setLimit(30);o&&n?(a=n,a.setSearchKeyword(o)):o&&!n&&t?(a=t,a.setSearchKeyword(o)):!o&&t&&n?(a=t,a.setSearchKeyword(i.current)):o||!t||n?o||t||!n?a.setSearchKeyword(o):a.setSearchKeyword(i.current):(a=t,a.setSearchKeyword(i.current)),this.bannedMembersRequest=a.build()}fetchNext(){return this.bannedMembersRequest.fetchNext()}static createGroupMemberFromUser(e,t){const n=new s.CometChat.GroupMember(e.getUid());return n.setName(e.getName()),n.setAvatar(e.getAvatar()),n.setGuid(t.getGuid()),n}static attachSDKGroupListener(e,t){const n="BannedMembers_GroupListener_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberBanned:(n,o,r,s)=>{e.current.getGuid()===s.getGuid()&&t({type:"addMember",member:Hr.createGroupMemberFromUser(o,e.current)})},onGroupMemberUnbanned:(n,o,r,s)=>{e.current.getGuid()===s.getGuid()&&t({type:"removeBannedMemberIfPresent",bannedMemberUid:o.getUid()})}})),()=>s.CometChat.removeGroupListener(n)}static attachSDKUserListener(e){const t="BannedMembers_UserListener_"+String(Date.now()),n=t=>e({type:"updateMemberStatusIfPresent",member:t});return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:n,onUserOffline:n})),()=>s.CometChat.removeUserListener(t)}}var Qr,Nr="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",Kr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",zr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Jr(e,t){let n=e;const{type:o}=t;switch(o){case"setSearchText":n={...e,searchText:t.searchText};break;case"setFetchState":n={...e,fetchState:t.fetchState};break;case"appendBannedMembers":{const{bannedMembers:o}=t;0!==o.length&&(n={...e,bannedMembers:[...e.bannedMembers,...o]});break}case"setBannedMembers":n={...e,bannedMembers:t.bannedMembers};break;case"removeBannedMemberIfPresent":{const{bannedMembers:o}=e,r=t.bannedMemberUid,s=o.findIndex(e=>e.getUid()===r);s>-1&&(n={...e,bannedMembers:o.filter((e,t)=>t!==s)});break}case"addMember":n={...e,bannedMembers:[...e.bannedMembers,t.member]};break;case"updateMemberStatusIfPresent":{const{member:o}=t,{bannedMembers:r}=e,s=o.getUid(),i=r.findIndex(e=>e.getUid()===s);i>-1&&(n={...e,bannedMembers:r.map((e,t)=>(t===i&&e.setStatus(o.getStatus()),e))});break}}return n}function Yr(e){const{backButtonIconURL:o=zr,showBackButton:r=!1,onBack:i,menus:a=null,title:l=n.localize("BANNED_MEMBERS"),titleAlignment:c=n.TitleAlignment.center,searchPlaceholder:C=n.localize("SEARCH"),searchIconURL:d=Nr,hideSearch:u=!0,loadingIconURL:p=Kr,loadingStateView:h,emptyStateText:A=n.localize("NO_BANNED_MEMBERS_FOUND"),emptyStateView:y,errorStateText:w=n.localize("SOMETHING_WRONG"),errorStateView:f,onError:D,group:E,bannedMembersRequestBuilder:v=null,searchRequestBuilder:S=null,listItemView:I=null,hideSeparator:F=!1,disableUsersPresence:T=!0,closeButtonIconURL:R=Gr,onClose:P,subtitleView:O=null,options:j=null,selectionMode:V=n.SelectionMode.none,unbanIconURL:G=Gr,onItemClick:H=null,onSelect:Q=null,hideError:N=!1,statusIndicatorStyle:K=null,avatarStyle:z=null,bannedMemberStyle:Y=null,listItemStyle:_=null}=e,[W,X]=t.useReducer(Jr,{searchText:"",bannedMembers:[],fetchState:n.States.loading}),q=t.useRef(null),$=t.useRef(""),ee=x(D),te=m(E),{theme:ne}=t.useContext(U),oe=t.useRef(""),re=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(oe.current="",X({type:"setSearchText",searchText:e}))},[X]),se=t.useCallback(async e=>{if(q.current){X({type:"setFetchState",fetchState:n.States.loading});try{const t=await q.current.fetchNext();if(e!==$.current)return;0!==t.length&&X({type:"appendBannedMembers",bannedMembers:t}),X({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===$.current&&(X({type:"setFetchState",fetchState:n.States.error}),ee(t))}}},[ee,X]),ie=t.useCallback(async e=>{try{await s.CometChat.unbanGroupMember(te.current.getGuid(),e.getUid()),X({type:"removeBannedMemberIfPresent",bannedMemberUid:e.getUid()})}catch(e){ee(e)}},[X,ee,te]);function ae(e){let t=(new Z).getUserStatusVisible(e);return T||t?null:Y?.onlineStatusColor||ne.palette.getSuccess()||"rgb(0, 200, 111)"}function le(e){const t=j?.(e);return t?.length?g.jsx(B,{data:t,menuListStyle:Vr(ne),onOptionClick:e=>{const{onClick:t}=e.detail.data;t?.()}}):null}function ce(e){switch(V){case n.SelectionMode.none:return g.jsx(J,{iconURL:G,onClick:()=>ie(e),hoverText:n.localize("UNBAN"),buttonStyle:jr(Y,ne)});case n.SelectionMode.single:return g.jsx(L,{onChange:t=>Q?.(e,t.detail.checked)});case n.SelectionMode.multiple:return g.jsx(b,{onChange:t=>Q?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ne.palette.getPrimary(),uncheckedBackgroundColor:ne.palette.getAccent400()}});default:return null}}return function(e){const{bannedMembersManagerRef:o,groupGuid:r,searchText:s,bannedMembersRequestBuilder:i,searchRequestBuilder:a,dispatch:l,fetchNextAndAppendBannedMembers:c,fetchNextIdRef:C,groupPropRef:g,bannedMembersSearchText:d}=e;t.useEffect(()=>{i?.searchKeyword?d.current=i?.searchKeyword:a?.searchKeyword&&(d.current=a?.searchKeyword)},[]),t.useEffect(()=>{o.current=new Hr({groupGuid:r,bannedMembersRequestBuilder:i,searchRequestBuilder:a,searchText:s,bannedMembersSearchText:d}),l({type:"setBannedMembers",bannedMembers:[]}),c(C.current="initialFetchNext_"+String(Date.now()))},[r,i,a,s,c,l,o,C]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{const{kickedFrom:t,kickedUser:n}=e;t.getGuid()===g.current.getGuid()&&l({type:"addMember",member:Hr.createGroupMemberFromUser(n,t)})}),t=n.CometChatGroupEvents.ccGroupMemberUnbanned.subscribe(e=>{const{unbannedFrom:t,unbannedUser:n}=e;t.getGuid()===g.current.getGuid()&&l({type:"removeBannedMemberIfPresent",bannedMemberUid:n.getUid()})});return()=>{e.unsubscribe(),t.unsubscribe()}},[l,g]),t.useEffect(()=>Hr.attachSDKGroupListener(g,l),[l,g]),t.useEffect(()=>Hr.attachSDKUserListener(l),[l])}({groupGuid:E.getGuid(),searchText:W.searchText,bannedMembersRequestBuilder:v,searchRequestBuilder:S,bannedMembersManagerRef:q,dispatch:X,fetchNextAndAppendBannedMembers:se,fetchNextIdRef:$,groupPropRef:te,bannedMembersSearchText:oe}),g.jsxs("div",{className:"cc-banned-members",style:Mr(Y,ne),children:[g.jsxs("div",{className:"cc-banned-members__list-wrapper",style:{position:"relative",height:"100%"},children:[null===a?null:g.jsx("div",{className:"cc-banned-members__menus",style:{position:"absolute",right:"12px",top:"8px",cursor:"pointer"},children:a}),g.jsx(k,{title:l,titleAlignment:c,searchPlaceholderText:C,searchIconURL:d,searchText:W.searchText,onSearch:re,hideSearch:u,list:W.bannedMembers,listItemKey:"getUid",listItem:I||function(e){return g.jsx(M,{id:e.getUid(),title:e.getName(),avatarURL:e.getAvatar(),avatarName:e.getName(),statusIndicatorColor:ae(e),hideSeparator:F,statusIndicatorStyle:Lr(K),avatarStyle:Ur(z,ne),listItemStyle:Rr(_,Y,ne),subtitleView:O?.(e),subtitleViewClassName:"cc-banned-members__subtitle-view",menuView:le(e),menuViewClassName:"cc-banned-members__options-view",tailView:ce(e),tailViewClassName:"cc-banned-members__tail-view",onClick:t=>H?.(e)})},showSectionHeader:!1,onScrolledToBottom:()=>se($.current="onScrolledToBottom_"+String(Date.now())),state:W.fetchState===n.States.loaded&&0===W.bannedMembers.length?n.States.empty:W.fetchState,loadingIconURL:p,emptyStateText:A,errorStateText:w,loadingView:h,emptyStateView:y,errorStateView:f,hideError:N,listStyle:Br(Y,ne)})]}),r?g.jsx(J,{iconURL:o,buttonStyle:Pr(Y,ne),onClick:i}):null,g.jsx(J,{iconURL:R,buttonStyle:Or(Y,ne),onClick:P})]})}function _r(e,t){return{width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent400()}`,borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),boxShadow:e?.boxShadow||"",position:"relative",boxSizing:"border-box"}}function Wr(e,t){return new o.ConfirmDialogStyle({confirmButtonBackground:e?.confirmButtonBackground||t.palette.getError(),cancelButtonBackground:e?.cancelButtonBackground||t.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||t.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(t.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||t.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(t.typography.text2),titleFont:e?.titleFont||n.fontHelper(t.typography.title1),titleColor:e?.titleColor||t.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(t.typography.subtitle2),messageTextColor:e?.messageTextColor||t.palette.getAccent600(),background:e?.background||t.palette.getBackground(),height:e?.height||"auto",width:e?.width||"auto",border:e?.border||"none",borderRadius:e?.borderRadius||"12px",boxShadow:e?.boxShadow||`0 0 1px 1px ${t.palette.getAccent50()}`})}function Zr(e,t){return new r.ListStyle({background:"inherit",width:"100%",height:"100%",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600()})}function Xr(e,t){return new o.AvatarStyle({width:e?.width||"36px",height:e?.height||"36px",borderRadius:e?.borderRadius||"24px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),backgroundSize:e?.backgroundSize||"cover",outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function qr(e){return{...null!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function $r(e,t,r){return new o.ListItemStyle({height:e?.height||"auto",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),hoverBackground:e?.hoverBackground||r.palette.getAccent50(),padding:e?.padding||"0"})}function es(e,t){return new o.BadgeStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle2),textColor:e?.textColor||t.palette.getAccent("dark"),background:e?.background||t.palette.getPrimary(),borderRadius:e?.borderRadius||"16px",width:e?.width||"24px",height:e?.height||"16px",border:e?.border||"none"})}function ts(e,t){return new o.LabelStyle({background:"transparent",textFont:e?.threadIndicatorTextFont||n.fontHelper(t.typography.caption2),textColor:e?.threadIndicatorTextColor||t.palette.getAccent400()})}function ns(e){return new o.IconStyle({width:"24px",height:"24px",iconTint:e.palette.getAccent400()})}function os(e,t){return new o.ReceiptStyle({waitIconTint:e?.waitIconTint||t.palette.getAccent700(),sentIconTint:e?.sentIconTint||t.palette.getAccent600(),deliveredIconTint:e?.deliveredIconTint||t.palette.getAccent600(),readIconTint:e?.readIconTint||t.palette.getPrimary(),errorIconTint:e?.errorIconTint||t.palette.getError(),height:e?.height||"20px",width:e?.width||"20px",border:e?.border||"none",borderRadius:e?.borderRadius||"inherit",background:e?.background||"inherit"})}function rs(e,t,o,r){const i=e.getConversationWith(),a=i instanceof s.CometChat.User?i.getUid():i.getGuid();return void 0!==t.get(a)?{font:o?.typingIndictorTextFont||n.fontHelper(r.typography.subtitle2),color:o?.typingIndictorTextColor||r.palette.getSuccess()||"",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}:{font:o?.lastMessageTextFont||n.fontHelper(r.typography.subtitle2),color:o?.lastMessageTextColor||r.palette.getAccent600()||"",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}}function ss(e){return new o.MenuListStyle({width:"",height:"",border:"none",borderRadius:"8px",background:"transparent",moreIconTint:"grey",submenuWidth:"70px",submenuHeight:"20px",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground()})}function is(e,t){const r=null!==e?e:{};return{...new o.DateStyle({textFont:e?.textFont||n.fontHelper(t.typography.caption2),textColor:e?.textColor||t.palette.getAccent600(),background:"transparent"}),...r}}function as(e,t){return{width:e?.width||t?.width,height:e?.height||t?.height,background:e?.background||"rgba(0, 0, 0, 0.5)",border:e?.border,borderRadius:e?.borderRadius,position:"absolute"}}class ls{constructor(e){const{conversationsRequestBuilder:t}=e,n=t||(new s.CometChat.ConversationsRequestBuilder).setLimit(Qr.limit);this.conversationsRequest=n.build(),t&&(Qr.conversationType=t.build().getConversationType())}fetchNext(){return this.conversationsRequest.fetchNext()}static attachUserListener(e){const t="ConversationList_User_"+String(Date.now());return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e})),()=>s.CometChat.removeUserListener(t)}static attachGroupListener(e,t){const n="ConversationList_Group_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberJoined:t=>{e(t)},onGroupMemberLeft:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberKicked:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberBanned:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberUnbanned:t=>{e(t)},onMemberAddedToGroup:t=>{e(t)},onGroupMemberScopeChanged:t=>{e(t)}})),()=>s.CometChat.removeGroupListener(n)}static attachMessageReceivedListener(e){const t=n.CometChatMessageEvents.onTextMessageReceived.subscribe(t=>{e(t)}),o=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(t=>{e(t)}),r=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(t=>{e(t)}),s=n.CometChatMessageEvents.onFormMessageReceived.subscribe(t=>{e(t)}),i=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(t=>{e(t)}),a=n.CometChatMessageEvents.onCardMessageReceived.subscribe(t=>{e(t)}),l=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(t=>{e(t)});return()=>{t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe()}}static attachMessageReceiptListener(e){const t=n.CometChatMessageEvents.onMessagesRead.subscribe(t=>{t.getReceiverType()==n.CometChatUIKitConstants.MessageReceiverType.user&&e(t,!0)}),o=n.CometChatMessageEvents.onMessagesDelivered.subscribe(t=>{t.getReceiverType()==n.CometChatUIKitConstants.MessageReceiverType.user&&e(t,!1)}),r=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(t=>{e(t,!1)}),s=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(t=>{e(t,!0)});return()=>{t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe()}}static attachMessageTypingListener(e){const t=n.CometChatMessageEvents.onTypingStarted.subscribe(t=>{e(t,!0)}),o=n.CometChatMessageEvents.onTypingEnded.subscribe(t=>{e(t,!1)});return()=>{t?.unsubscribe(),o?.unsubscribe()}}static attachMessageModifiedListener(e){const t=n.CometChatMessageEvents.onMessageEdited.subscribe(t=>{e(t)}),o=n.CometChatMessageEvents.onMessageDeleted.subscribe(t=>{e(t)});return()=>{t?.unsubscribe(),o?.unsubscribe()}}static attachCallListener(e){const t="ConversationList_Call_"+String(Date.now());return s.CometChat.addCallListener(t,new s.CometChat.CallListener({onIncomingCallReceived:e,onOutgoingCallAccepted:e,onOutgoingCallRejected:e,onIncomingCallCancelled:e})),()=>s.CometChat.removeCallListener(t)}static attachConnestionListener(e){const t="ConversationList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}static shouldIncrementForCustomMessage(e){const t=e?.getMetadata();return e?.willUpdateConversation()||t&&t.hasOwnProperty("incrementUnreadCount")&&t.incrementUnreadCount||Zn.conversationUpdateSettings?.shouldUpdateOnCustomMessages()}}Qr=ls,ls.limit=30,ls.conversationType=void 0,ls.shouldLastMessageAndUnreadCountBeUpdated=e=>{let t=e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom;return!(e?.getParentMessageId()&&!Zn.conversationUpdateSettings?.shouldUpdateOnMessageReplies())&&(t?!!(e?.getParentMessageId()&&Zn.conversationUpdateSettings?.shouldUpdateOnMessageReplies()&&Qr.shouldIncrementForCustomMessage(e))||Qr.shouldIncrementForCustomMessage(e):e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action?e?.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember||Zn.conversationUpdateSettings?.shouldUpdateOnGroupActions():e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call||e?.getType()!==n.CometChatUIKitConstants.MessageTypes.audio&&e?.getType()!==n.CometChatUIKitConstants.MessageTypes.video||Zn.conversationUpdateSettings?.shouldUpdateOnCallActivities())};var cs="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Cs="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",gs="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ds="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.6377%207L9.87922%2016.3095L6%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",us="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ps="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hs="data:image/svg+xml,%3Csvg%20width%3D%2225%22%20height%3D%2224%22%20viewBox%3D%220%200%2025%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.01057%208.04728C8.34753%209.99213%209.53177%2011.3242%2011.6239%2012C13.716%2011.3242%2014.9002%209.99213%2015.2372%208.04728C15.2572%207.91731%2015.2488%207.78455%2015.2125%207.65816C15.1762%207.53177%2015.1129%207.41476%2015.027%207.3152C14.9411%207.21564%2014.8346%207.1359%2014.7149%207.08149C14.5952%207.02707%2014.4651%206.99928%2014.3336%207.00001H8.9142C8.7827%206.99928%208.65261%207.02707%208.5329%207.08149C8.41319%207.1359%208.30671%207.21564%208.2208%207.3152C8.1349%207.41476%208.07161%207.53177%208.03532%207.65816C7.99902%207.78455%207.99058%207.91731%208.01057%208.04728Z%22%20fill%3D%22%23808080%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.91423%2017C8.78279%2017.0007%208.65276%2016.9729%208.5331%2016.9185C8.41343%2016.8642%208.30699%2016.7845%208.22109%2016.685C8.1352%2016.5855%208.0719%2016.4686%208.03556%2016.3423C7.99922%2016.2159%207.9907%2016.0832%208.01059%2015.9533C8.34756%2014.0085%209.5318%2012.6764%2011.6239%2012C13.716%2012.6764%2014.9003%2014.0085%2015.2372%2015.9533C15.2571%2016.0832%2015.2486%2016.2159%2015.2123%2016.3423C15.1759%2016.4686%2015.1126%2016.5855%2015.0267%2016.685C14.9408%2016.7845%2014.8344%2016.8642%2014.7147%2016.9185C14.5951%2016.9729%2014.465%2017.0007%2014.3336%2017H8.91423Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ms="data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E";function As(e){return e instanceof s.CometChat.TextMessage||e instanceof s.CometChat.MediaMessage||e instanceof s.CometChat.CustomMessage||e instanceof s.CometChat.InteractiveMessage||e instanceof s.CometChat.Action||e instanceof s.CometChat.Call}function xs(e,t){let o=e;const{type:i}=t;switch(i){case"appendConversations":if(t.conversations.length>0){let n=[];t.removeOldConversation?(e.conversationList=[],n=t.conversations):n=[...e.conversationList,...t.conversations],o={...e,conversationList:n}}break;case"setConversationList":{const{typingIndicatorMap:n}=e,{conversationList:r}=t,i=new Map;for(let e=0;e<r.length;e++){const t=r[e].getConversationWith(),o=t instanceof s.CometChat.User?t?.getUid():t.getGuid();n.has(o)&&i.set(o,n.get(o))}o={...e,conversationList:r,typingIndicatorMap:i};break}case"setFetchState":o={...e,fetchState:t.fetchState};break;case"setConversationToBeDeleted":o={...e,conversationToBeDeleted:t.conversation};break;case"removeConversation":{const{typingIndicatorMap:n,conversationList:r}=e,i=t.conversation.getConversationId(),a=r.findIndex(e=>e.getConversationId()===i);if(a>-1){const t=r[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;n.has(i)?(l=new Map(n),l.delete(i)):l=n;const c=e.conversationList.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"updateConversationWithUser":{const{user:n}=t,{conversationList:i}=e,a=n.getUid(),l=i.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.User&&t?.getUid()===a});if(l>-1){const t=i.map((e,t)=>{if(t===l){const t=r.CometChatUIKitUtility.clone(e);return t.setConversationWith(n),t}return e});o={...e,conversationList:t}}break}case"fromUpdateConversationListFn":{const{conversation:n}=t,r=n.getConversationId(),s=e.conversationList.filter(e=>e.getConversationId()!==r);o={...e,conversationList:[n,...s]};break}case"setLastMessageReadOrDeliveredAt":{const{conversationList:n}=e,{messageReceipt:s,updateReadAt:i}=t,a=s.getMessageId(),l=n.findIndex(e=>{const t=e.getLastMessage();return!(!As(t)||String(t.getId())!==a)&&(i?!t.getReadAt():!t.getDeliveredAt())});l>-1&&(o={...e,conversationList:n.map((e,t)=>{if(t===l){const t=r.CometChatUIKitUtility.clone(e),n=t.getLastMessage();return As(n)&&(i?(n.setReadAt(s.getReadAt()),t.setUnreadMessageCount(0)):n.setDeliveredAt(s.getDeliveredAt())),t}return e})});break}case"addTypingIndicator":{const{typingIndicator:r}=t,i=r.getSender()?.getUid(),a=r.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group,l=r.getReceiverId();let c;const{conversationList:C,typingIndicatorMap:g}=e;for(let e=0;e<C.length;e++){const t=C[e].getConversationWith();if(a){if(t instanceof s.CometChat.Group&&t.getGuid()===l){c=t.getGuid();break}}else if(t instanceof s.CometChat.User&&t?.getUid()===i){c=t?.getUid();break}}if(void 0!==c){const t=new Map(g);t.set(c,r),o={...e,typingIndicatorMap:t}}break}case"removeTypingIndicator":{const{typingIndicatorMap:r}=e,{typingIndicator:s}=t,i=s.getSender()?.getUid(),a=s.getReceiverId();let l;if(s.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?r.has(i)&&(l=i):r.get(a)?.getSender()?.getUid()===i&&(l=a),void 0!==l){const t=new Map(r);t.delete(l),o={...e,typingIndicatorMap:t}}break}case"updateConversationLastMessage":{const{message:n}=t,s=n?.getId(),{conversationList:i}=e,a=i.findIndex(e=>{const t=e.getLastMessage();return As(t)&&t.getId()===s});a>-1&&(o={...e,conversationList:i.map((e,t)=>{if(t===a){const t=r.CometChatUIKitUtility.clone(e);return t.setLastMessage(n),t}return e})});break}case"updateConversationLastMessageAndGroupAndPlaceAtTheTop":{const{conversationList:n}=e,{group:s,message:i}=t,a=i.getConversationId();if(!ls.shouldLastMessageAndUnreadCountBeUpdated(i))return e;const l=n.findIndex(e=>e.getConversationId()===a);if(l>-1){const t=r.CometChatUIKitUtility.clone(n[l]);t.setConversationWith(s),t.setLastMessage(i),o={...e,conversationList:[t,...n.filter((e,t)=>t!==l)]}}break}case"removeConversationOfTheGroup":{const{conversationList:n,typingIndicatorMap:r}=e,i=t.group.getGuid(),a=n.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.Group&&t.getGuid()===i});if(a>-1){const t=n[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;r.has(i)?(l=new Map(r),l.delete(i)):l=r;const c=n.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"removeConversationOfTheUser":{const{conversationList:n,typingIndicatorMap:r}=e,i=t.user.getUid(),a=n.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.User&&t?.getUid()===i});if(a>-1){const t=n[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;r.has(i)?(l=new Map(r),l.delete(i)):l=r;const c=n.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"updateConversationLastMessageResetUnreadCountAndPlaceAtTheTop":{const{conversationList:n}=e,{message:s,conversation:i}=t,a=s.getConversationId();if(!ls.shouldLastMessageAndUnreadCountBeUpdated(s))return e;const l=n.findIndex(e=>e.getConversationId()===a);if(l>-1){const t=r.CometChatUIKitUtility.clone(n[l]);t.setLastMessage(s),t.setUnreadMessageCount(0);const i=n.filter((e,t)=>t!==l);o={...e,conversationList:[t,...i]}}else{i.setUnreadMessageCount(0);const t=[i,...n];o={...e,conversationList:t}}break}case"resetUnreadCountAndSetReadAtIfLastMessage":{const{conversationList:n}=e,{message:s}=t,i=s.getReadAt()||Date.now(),a=n.findIndex(e=>e.getConversationId()===s.getConversationId());a>-1&&(o={...e,conversationList:n.map((e,t)=>{if(t===a){const t=r.CometChatUIKitUtility.clone(e);return t.setUnreadMessageCount(0),t.getLastMessage()&&t.getLastMessage().setReadAt(i),t}return e})});break}case"updateConversationLastMessageAndPlaceAtTheTop":{const{message:n}=t,s=n?.getId(),{conversationList:i}=e;if(!ls.shouldLastMessageAndUnreadCountBeUpdated(n))return e;const a=i.findIndex(e=>{const t=e.getLastMessage();return As(t)&&t.getId()===s});if(a>-1){const t=r.CometChatUIKitUtility.clone(i[a]);t.setLastMessage(n),o={...e,conversationList:[t,...i.filter((e,t)=>t!==a)]}}break}case"setLoggedInUser":o={...e,loggedInUser:t.loggedInUser};break;case"setIsFirstReload":o={...e,isFirstReload:t.isFirstReload}}return o}function bs(e){const{menus:o=null,title:i=n.localize("CHATS"),titleAlignment:a=n.TitleAlignment.left,conversationsRequestBuilder:l=null,onError:c,listItemView:C=null,subtitleView:d=null,disableUsersPresence:u=!1,hideSeparator:p=!1,activeConversation:h=null,selectionMode:y=n.SelectionMode.none,disableReceipt:w=!1,hideReceipt:f=!1,options:D=null,datePattern:E=n.DatePatterns.DayDateTime,protectedGroupIcon:v=cs,passwordGroupIcon:S,privateGroupIcon:I=us,readIcon:F=gs,deliveredIcon:T=Cs,waitIcon:R=hs,errorIcon:P=ms,sentIcon:O=ds,loadingIconURL:j=ps,loadingStateView:V,emptyStateText:G=n.localize("NO_CHATS_FOUND"),emptyStateView:H,errorStateText:Q=n.localize("SOMETHING_WRONG"),errorStateView:N,hideError:K=!1,onItemClick:z=null,onSelect:J=null,disableSoundForMessages:Y=!1,disableTyping:_=!1,customSoundForMessages:W=null,confirmDialogTitle:X=n.localize("DELETE_CONVERSATION"),confirmDialogMessage:q=n.localize("WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION"),cancelButtonText:$=n.localize("CANCEL"),confirmButtonText:ee=n.localize("DELETE"),conversationsStyle:te=null,deleteConversationDialogStyle:ne=null,avatarStyle:oe=null,statusIndicatorStyle:re=null,listItemStyle:se=null,badgeStyle:ie=null,receiptStyle:ae=null,dateStyle:le=null,backdropStyle:ce=null,disableMentions:Ce=!1,textFormatters:ge=[]}=e,[de,ue]=t.useReducer(xs,{conversationList:[],fetchState:n.States.loading,typingIndicatorMap:new Map,conversationToBeDeleted:null,loggedInUser:null,isFirstReload:!1,unreadMentions:!1}),[pe,he]=A(null),me=t.useRef(null),Ae=t.useRef(""),xe=x(c),be=m(W),{theme:ye}=t.useContext(U),we=t.useRef(!1),fe=t.useRef(!1);de.isFirstReload&&(we.current=!0,de.isFirstReload=!1);const De=t.useCallback(async e=>{const t=me.current;if(!t)return;let o=fe.current?n.States.loaded:n.States.loading;ue({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(0!==o.length&&Ae.current===e){let e=!!fe.current;ue({type:"appendConversations",conversations:o,removeOldConversation:e})}we.current&&de.isFirstReload&&(ls.attachConnestionListener(()=>{me.current=new ls({conversationsRequestBuilder:l}),fe.current=!0,De(Ae.current="initialFetchNext_"+String(Date.now()))}),we.current=!1),fe.current?fe.current=!1:ue({type:"setFetchState",fetchState:n.States.loaded})}catch(e){de.conversationList.length<=0&&ue({type:"setFetchState",fetchState:n.States.error}),xe(e)}},[xe,ue]),Ee=t.useCallback(e=>{const t="getMetadata";let n;return t in e&&"function"==typeof e[t]&&(n=e[t]())&&"object"==typeof n&&"incrementUnreadCount"in n&&Boolean(n.incrementUnreadCount)||e instanceof s.CometChat.CustomMessage&&e.willUpdateConversation()},[]),ve=t.useCallback((e,t)=>{const o=t||e.getLastMessage();if((!l||!l.build().getConversationType()||o.getReceiverType()===l.build().getConversationType())&&As(o)&&ls.shouldLastMessageAndUnreadCountBeUpdated(o)){if(o.getSender().getUid()!==de.loggedInUser?.getUid()&&e.setUnreadMessageCount((e.getUnreadMessageCount()??0)+1),o instanceof s.CometChat.Action&&o.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&e.getConversationType()===n.CometChatUIKitConstants.MessageReceiverType.group){if(o.getReceiver().getGuid()===o.getActionFor().getGuid()){let t=e.getConversationWith();t.setMembersCount(o.getActionFor().getMembersCount()),e.setConversationWith(t)}}e.setLastMessage(o),ue({type:"fromUpdateConversationListFn",conversation:e})}},[ue,de.loggedInUser,Ee]),Se=t.useCallback(async(e,t=!1)=>{try{const n=de.conversationList.findIndex(t=>t.getConversationId()===e.getConversationId());if(n>=0){const o=de.conversationList[n];t?ue({type:"removeConversation",conversation:o}):ve(o,e)}else s.CometChat.CometChatHelper.getConversationFromMessage(e).then(t=>{ve(t,e)})}catch(e){xe(e)}},[xe,ve,de.conversationList]),Ie=t.useCallback(async e=>{if(e.getSender().getUid()!==de.loggedInUser?.getUid()&&!w&&!e.getDeliveredAt())try{s.CometChat.markAsDelivered(e)}catch(e){xe(e)}Y||e.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom&&!Ee(e)||h&&h.getConversationId()===e.getConversationId()||r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessageFromOther,be.current),Se(e)},[w,Y,Se,xe,de.loggedInUser,h,Ee,be]),Fe=t.useCallback((e,t)=>{ue({type:"setLastMessageReadOrDeliveredAt",updateReadAt:t,messageReceipt:e})},[ue]),ke=t.useCallback((e,t)=>{de.loggedInUser?.getUid()!==e.getSender()?.getUid()&&ue(t?{type:"addTypingIndicator",typingIndicator:e}:{type:"removeTypingIndicator",typingIndicator:e})},[de.loggedInUser]);function Te(e){const t=e.getConversationWith();return t instanceof s.CometChat.User?t.getAvatar():t.getIcon()}function Me(e){const t=e.getConversationWith();if(t instanceof s.CometChat.User){let e=(new Z).getUserStatusVisible(t);return u||e?null:te?.onlineStatusColor||ye.palette.getSuccess()||"rgb(0, 200, 111)"}switch(t.getType()){case n.CometChatUIKitConstants.GroupTypes.password:return te?.passwordGroupIconBackground||"rgb(247, 165, 0)";case n.CometChatUIKitConstants.GroupTypes.private:return te?.privateGroupIconBackground||ye.palette.getSuccess()||"rgb(0, 200, 111)";default:return null}}function Le(e){let t="";const o=e.getConversationWith();if(o instanceof s.CometChat.Group)switch(o.getType()){case n.CometChatUIKitConstants.GroupTypes.password:t=S||v;break;case n.CometChatUIKitConstants.GroupTypes.private:t=I}return t}function Ue(e){const t=e.getLastMessage();return As(t)&&t.getParentMessageId()?g.jsxs("div",{className:"cc-conversations__thread-view",style:{display:"flex",columnGap:"4px"},children:[g.jsx("cometchat-label",{text:n.localize("IN_A_THREAD"),labelStyle:JSON.stringify(ts(te,ye))}),g.jsx("cometchat-icon",{URL:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22feather%20feather-corner-right-down%22%3E%3Cpolyline%20points%3D%2210%2015%2015%2020%2020%2015%22%3E%3C%2Fpolyline%3E%3Cpath%20d%3D%22M4%204h7a4%204%200%200%201%204%204v12%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E",iconStyle:JSON.stringify(ns(ye))})]}):null}function Re(e){return function(e){const t=e.getLastMessage(),o=e.getConversationWith(),r=o instanceof s.CometChat.User?o?.getUid():o.getGuid();return!(w||f)&&As(t)&&!t.getDeletedAt()&&t.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&t.getSender()?.getUid()===de.loggedInUser?.getUid()&&void 0===de.typingIndicatorMap.get(r)}(e)?g.jsx("cometchat-receipt",{receipt:r.MessageReceiptUtils.getReceiptStatus(e.getLastMessage()),waitIcon:R,sentIcon:O,errorIcon:P,deliveredIcon:T,readIcon:F,receiptStyle:JSON.stringify(os(ae,ye))}):null}function Pe(e){const t=e.getConversationWith(),o=t instanceof s.CometChat.Group?t.getGuid():t?.getUid(),r=de.typingIndicatorMap.get(o);if(void 0!==r)return t instanceof s.CometChat.Group?`${r.getSender().getName()} ${n.localize("IS_TYPING")}`:n.localize("IS_TYPING");if(de.loggedInUser){let t="";const o=e.getLastMessage();o&&o.getCategory()===n.CometChatUIKitConstants.MessageCategory.call&&(t=(o.getType()===n.CometChatUIKitConstants.MessageTypes.audio?"📞":"📹")+" ");let r=e.getLastMessage(),a=Be.getDataSource().getLastConversationMessage(e,de.loggedInUser,{disableMentions:Ce,theme:ye,mentionsTargetElement:n.MentionsTargetElement.conversation,textFormattersList:ge});return r&&e?.getConversationType()!==s.CometChat.RECEIVER_TYPE.USER&&(a=(r?.getSender().getUid(),de.loggedInUser?.getUid(),`${a}`)),g.jsx("div",{dangerouslySetInnerHTML:{__html:t+(i=a,i.replace(/&(?!amp;|lt;|gt;|quot;|#39;|#\d+;)/g,"&amp;").replace(/&amp;(?!lt;|gt;|quot;|#39;|#\d+;)/g,"&amp;"))},style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})}var i;return""}function Oe(e){return g.jsx("div",{className:"cc-conversations__subtitle-text",style:rs(e,de.typingIndicatorMap,te,ye),children:Pe(e)})}function je(e){return null!==d?g.jsx(g.Fragment,{children:d(e)}):g.jsxs(g.Fragment,{children:[Ue(e),g.jsxs("div",{className:"cc-conversations__subtitle",style:{display:"flex",columnGap:"4px",alignItems:"center"},children:[Re(e),Oe(e)]})]})}function Ve(e){ue({type:"setConversationToBeDeleted",conversation:e})}function Ge(e,t){if(y!==n.SelectionMode.none)return null;let o;if(D)o=D?.(e);else{const s=r.ConversationUtils.getDefaultOptions();for(let o=0;o<s.length;o++)s[o].id===n.CometChatUIKitConstants.ConversationOptions.delete&&(s[o].onClick=()=>Ve(e),s[o].iconTint=t.palette.getAccent600());o=s}return 0===o?.length?null:g.jsx(B,{data:o,menuListStyle:ss(t),onOptionClick:e=>{const{onClick:t}=e.detail.data;t?.()}})}function He(e){switch(y){case n.SelectionMode.none:{const t=e.getLastMessage();return t?g.jsxs("div",{className:"cc-conversations__tail-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[g.jsx("cometchat-date",{timestamp:t.getSentAt(),pattern:E,dateStyle:JSON.stringify(is(le,ye))}),g.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:g.jsx("cometchat-badge",{count:e.getUnreadMessageCount(),badgeStyle:JSON.stringify(es(ie,ye))})})]}):null}case n.SelectionMode.single:return g.jsx("div",{className:"cc-conversations__tail-content",children:g.jsx(L,{onChange:t=>J?.(e,t.detail.checked)})});case n.SelectionMode.multiple:return g.jsx("div",{className:"cc-conversations__tail-content",children:g.jsx(b,{onChange:t=>J?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ye.palette.getPrimary(),uncheckedBackgroundColor:ye.palette.getAccent400()}})});default:return null}}const Qe=e=>{const t=e.getConversationWith();if(t instanceof s.CometChat.User){let e=(new Z).getUserStatusVisible(t);return u||e?null:qr(re)}switch(t.getType()){case n.CometChatUIKitConstants.GroupTypes.private:case n.CometChatUIKitConstants.GroupTypes.password:return qr(re);default:return null}};return function(e){const{conversationsRequestBuilder:o,conversationsManagerRef:i,fetchNextAndAppendConversations:a,fetchNextIdRef:l,dispatch:c,confirmDialogElement:C,conversationToBeDeleted:g,errorHandler:d,refreshSingleConversation:u,onMessageReceived:p,setReceipts:h,setTypingIndicator:m,disableTyping:A,loggedInUser:x,isFirstReload:b}=e;t.useEffect(()=>{c({type:"setIsFirstReload",isFirstReload:!0}),i.current=new ls({conversationsRequestBuilder:o}),c({type:"setConversationList",conversationList:[]}),a(l.current="initialFetchNext_"+String(Date.now()))},[o,a,c,i,l]),t.useEffect(()=>{(async()=>{try{c({type:"setLoggedInUser",loggedInUser:await s.CometChat.getLoggedinUser()})}catch(e){d(e)}})()},[d,c]),t.useEffect(()=>{if(null===C)return;const e="cc-confirm-clicked",t="cc-cancel-clicked";async function o(){if(g){const e=g.getConversationWith(),t=e instanceof s.CometChat.Group?e.getGuid():e.getUid();try{await s.CometChat.deleteConversation(t,g.getConversationType()),n.CometChatConversationEvents.ccConversationDeleted.next(r.CometChatUIKitUtility.clone(g)),c({type:"removeConversation",conversation:g}),c({type:"setConversationToBeDeleted",conversation:null})}catch(e){d(e)}}}function i(){c({type:"setConversationToBeDeleted",conversation:null})}return C.addEventListener(e,o),C.addEventListener(t,i),()=>{C.removeEventListener(e,o),C.removeEventListener(t,i)}},[g,C,d,c]),t.useEffect(()=>ls.attachUserListener(e=>c({type:"updateConversationWithUser",user:e})),[c]),t.useEffect(()=>ls.attachGroupListener(u,x),[u,x]),t.useEffect(()=>ls.attachMessageReceivedListener(p),[p]),t.useEffect(()=>ls.attachMessageModifiedListener(e=>{c({type:"updateConversationLastMessage",message:e})}),[c]),t.useEffect(()=>ls.attachMessageReceiptListener(h),[h]),t.useEffect(()=>{if(!A)return ls.attachMessageTypingListener(m)},[A,m]),t.useEffect(()=>ls.attachCallListener(u),[u]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e.message})}),t=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{const t=e.messages[e.messages.length-1];t&&c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.userAddedIn,message:t})}),i=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.kickedFrom,message:e.message})}),a=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.kickedFrom,message:e.message})}),l=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{c({type:"removeConversationOfTheGroup",group:e})}),C=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{ls.shouldLastMessageAndUnreadCountBeUpdated(e.message)&&c({type:"removeConversationOfTheGroup",group:e.leftGroup})}),g=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{c(o?.includeBlockedUsers?{type:"updateConversationWithUser",user:e}:{type:"removeConversationOfTheUser",user:e})}),d=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{o?.includeBlockedUsers&&c({type:"updateConversationWithUser",user:e})}),u=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{e.status===n.MessageStatus.success&&c({type:"updateConversationLastMessage",message:e.message})}),p=n.CometChatMessageEvents.ccMessageSent.subscribe(e=>{if(e.status===n.MessageStatus.success){if(o&&o.build().getConversationType()&&e.message.getReceiverType()!==o.build().getConversationType())return;s.CometChat.CometChatHelper.getConversationFromMessage(e.message).then(t=>{c({type:"updateConversationLastMessageResetUnreadCountAndPlaceAtTheTop",message:e.message,conversation:t})})}}),h=n.CometChatMessageEvents.ccMessageDeleted.subscribe(e=>{c({type:"updateConversationLastMessage",message:r.CometChatUIKitUtility.clone(e)})}),m=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{c({type:"resetUnreadCountAndSetReadAtIfLastMessage",message:e})}),A=n.CometChatCallEvents.ccCallAccepted.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),x=n.CometChatCallEvents.ccOutgoingCall.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),b=n.CometChatCallEvents.ccCallRejected.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),y=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})});return()=>{e.unsubscribe(),t.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),C.unsubscribe(),g.unsubscribe(),d.unsubscribe(),u.unsubscribe(),p.unsubscribe(),h.unsubscribe(),m.unsubscribe(),A.unsubscribe(),x.unsubscribe(),b.unsubscribe(),y.unsubscribe()}},[c])}({conversationsRequestBuilder:l,conversationsManagerRef:me,fetchNextAndAppendConversations:De,fetchNextIdRef:Ae,dispatch:ue,confirmDialogElement:pe,conversationToBeDeleted:de.conversationToBeDeleted,errorHandler:xe,refreshSingleConversation:Se,onMessageReceived:Ie,setReceipts:Fe,setTypingIndicator:ke,disableTyping:_,loggedInUser:de.loggedInUser,isFirstReload:!1}),g.jsxs("div",{className:"cc-conversations",style:_r(te,ye),children:[null===o?null:g.jsx("div",{className:"cc-conversations__menus",style:{position:"absolute",top:"19px",right:"12px",cursor:"pointer",display:"flex",justifyContent:"flex-end",width:"24px"},children:o}),g.jsx(k,{title:i,titleAlignment:a,hideSearch:!0,list:de.conversationList,listItemKey:"getConversationId",listItem:null!==C?C:function(e){return g.jsx(M,{id:e.getConversationId(),avatarURL:Te(e),avatarName:e.getConversationWith().getName(),title:e.getConversationWith().getName(),statusIndicatorColor:Me(e),statusIndicatorIcon:Le(e),hideSeparator:p,isActive:y===n.SelectionMode.none&&e.getConversationId()===h?.getConversationId(),avatarStyle:Xr(oe,ye),statusIndicatorStyle:Qe(e),listItemStyle:$r(se,te,ye),onClick:t=>z?.(e),subtitleView:je(e),subtitleViewClassName:"cc-conversations__subtitle-view",menuView:Ge(e,ye),menuViewClassName:"cc-conversations__options-view",tailView:He(e),tailViewClassName:"cc-conversations__tail-view"})},onScrolledToBottom:()=>De(Ae.current="onScrolledToBottom_"+String(Date.now())),showSectionHeader:!1,state:de.fetchState===n.States.loaded&&0===de.conversationList.length?n.States.empty:de.fetchState,loadingIconURL:j,loadingView:V,emptyStateText:G,emptyStateView:H,errorStateText:Q,errorStateView:N,hideError:K,listStyle:Zr(te,ye)}),null===de.conversationToBeDeleted?null:g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(as(ce,te)),children:g.jsx("cometchat-confirm-dialog",{ref:he,title:X,messageText:q,cancelButtonText:$,confirmButtonText:ee,confirmDialogStyle:JSON.stringify(Wr(ne,ye))})})]})}const ys={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},ws={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},fs={width:"calc(100% - 280px)",height:"100%"},Ds={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},Es={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},vs={width:"280px",height:"100%",position:"relative"},Ss=(e,t)=>({...ws,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),Is=(e,t,n,o,r)=>n?Fs(o,r):ks(e,t),Fs=(e,t)=>({...e||t?{visibility:"hidden"}:{visibility:"visible"},...Ds,borderRadius:"inherit"}),ks=(e,t)=>{const n=e?.borderRadius||0;return{...vs,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},Ts=(e,t,n,o)=>t?Ms(n,o):Bs(e),Ms=(e,t)=>({...e||t?{visibility:"visible"}:{visibility:"hidden"},...Ds,borderRadius:"inherit"}),Bs=e=>{const t=e?.borderRadius||0;return{...fs,borderRadius:`0 ${t} ${t} 0`}},Ls=(e,t)=>({...ys,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),Us=e=>({width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...e?.conversationsStyle}),Rs=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},Ps=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},Os=(e,t)=>({background:t?.background,...e}),js=(e,t,n)=>{let o={visibility:"hidden"};return t||n||e||(o={visibility:"visible"}),{...Es,...o,width:"calc(100% - 280px)"}},Vs=(e,t)=>({height:t?.backdropStyle?.height||e?.height,width:t?.backdropStyle?.width||e?.width,background:t?.backdropStyle?.background||"rgba(0, 0, 0, 0.5)",border:t?.backdropStyle?.border||"0 none",borderRadius:t?.backdropStyle?.borderRadius||"0"}),Gs=(e,t)=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:e?t.palette.getAccent600():t.palette.getPrimary()});function Hs(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:t?.closeIconTint||e.palette.getPrimary(),background:"transparent",position:"absolute",top:"8px",right:"12px"}}function Qs(e,t){return{background:t?.submitButtonBackground||e.palette.getPrimary(),buttonTextColor:t?.submitButtonTextColor||e.palette.getAccent900(),buttonTextFont:t?.submitButtonTextFont||n.fontHelper(e.typography.title2),height:"100%",width:"100%",border:"none",borderRadius:"8px",padding:"8px",display:"flex",justifyContent:"center",textAlign:"center"}}function Ns(e,t){return{height:"30px",textAlign:"center",font:t?.titleTextFont||n.fontHelper(e.typography.title1),padding:"10px 0px",color:t?.titleTextColor||e.palette.getAccent()}}function Ks(e,t){return{height:t?.height||"94%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),border:t?.border||"none",borderRadius:t?.borderRadius||"none",boxShadow:t?.boxShadow||"0",padding:t?.padding||"0",display:"flex",zIndex:1}}const zs=(e,t,o,r)=>({width:t===n.TabsVisibility.usersAndGroups?"50%":"100%",height:r?.tabHeight||"100%",borderRadius:r?.tabBorderRadius||"0",border:r?.tabBorder||"none",titleTextFont:r?.tabTitleTextFont||n.fontHelper(e.typography.text2),titleTextColor:r?.tabTitleTextColor||e.palette.getAccent(),activeTitleTextFont:r?.activeTabTitleTextFont||n.fontHelper(e.typography.text2),activeTitleTextColor:r?.activeTabTitleTextColor||e.palette.getAccent(),activeBackground:r?.activeTabBackground||e.palette.getBackground(),activeBorderRadius:"8px",background:r?.tabBackground||"#ececec",boxShadow:"0px 3px 8px rgba(20, 20, 20, 0.12), 0 3px 1px rgba(20, 20, 20, 0.04)"});function Js(e,t){return{position:"relative",boxSizing:"border-box",background:e?.background||t.palette.getBackground(),width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent50()}`,borderRadius:e?.borderRadius||"0",overflow:"hidden"}}function Ys(e){return{...void 0!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function _s(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.caption1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Ws(e,t,r){return new o.ListItemStyle({height:e?.height||"auto",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",padding:e?.padding||"0",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent100(),hoverBackground:e?.hoverBackground||r.palette.getAccent50()})}function Zs(e,t){return new r.GroupsStyle({background:"inherit",width:"100%",height:"100%",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600()})}function Xs(e,t){return{font:e?.subTitleTextFont||n.fontHelper(t.typography.subtitle2),color:e?.subTitleTextColor||t.palette.getAccent600()}}class qs{constructor(e){const{searchText:t,groupsRequestBuilder:n,searchRequestBuilder:o,groupsSearchText:r}=e;let s=n||this.getDefaultRequestBuilder();t&&o?(s=o,s.setSearchKeyword(t)):t&&!o&&n?(s=n,s.setSearchKeyword(t)):!t&&n&&o?(s=n,s.setSearchKeyword(r.current)):t||!n||o?t||n||!o?s.setSearchKeyword(t):(s=this.getDefaultRequestBuilder(),s.setSearchKeyword(r.current)):(s=n,s.setSearchKeyword(r.current)),this.groupsRequest=s.build()}fetchNext(){return this.groupsRequest.fetchNext()}getDefaultRequestBuilder(){return(new s.CometChat.GroupsRequestBuilder).setLimit(qs.defaultLimit)}static async getLoggedInUser(){return void 0===this.loggedInUser&&(this.loggedInUser=await s.CometChat.getLoggedinUser()),this.loggedInUser}static createGroupListener(e){return new s.CometChat.GroupListener({onGroupMemberJoined:async(t,n,o)=>{const r=await qs.getLoggedInUser(),s=o.getMembersCount();n.getUid()===r?.getUid()&&o.setHasJoined(!0),e({type:"updateGroupForSDKEvents",group:o,hasJoined:!0,newCount:s})},onGroupMemberLeft:async(t,n,o)=>{const r=o.getMembersCount(),s=await qs.getLoggedInUser();n.getUid()===s?.getUid()&&o.setHasJoined(!1),e({type:"updateGroupForSDKEvents",group:o,hasJoined:!1,newCount:r})},onMemberAddedToGroup:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()&&r.setHasJoined(!0),e({type:"updateGroupForSDKEvents",group:r,hasJoined:!0,newCount:s,addGroup:!0})},onGroupMemberKicked:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()?(r.setHasJoined(!1),e({type:"updateGroupForSDKEvents",group:r,hasJoined:!1,newCount:s})):e({type:"updateGroupForSDKEvents",group:r,newCount:s})},onGroupMemberBanned:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()?e({type:"removeGroup",guid:r.getGuid()}):e({type:"updateGroupForSDKEvents",group:r,newCount:s})},onGroupMemberScopeChanged:async(t,n,o,r,s)=>{const i=await qs.getLoggedInUser(),a=s.getMembersCount();n.getUid()===i?.getUid()&&s.setScope(o),e({type:"updateGroupForSDKEvents",group:s,newScope:o,newCount:a})}})}static attachListeners(e){const t="GroupsList_"+String(Date.now());return s.CometChat.addGroupListener(t,qs.createGroupListener(e)),()=>s.CometChat.removeGroupListener(t)}static attachConnestionListener(e){const t="GroupsList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}}qs.defaultLimit=30;var $s="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ei="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ti="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ni="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",oi=(e,t)=>{let n=e;const{type:o}=t;switch(o){case"appendGroups":if(t.groups.length>0){let o=[];t.removeOldGroups?(e.groupList=[],o=t.groups):o=[...e.groupList,...t.groups],n={...e,groupList:o}}n={...e,groupList:[...e.groupList,...t.groups]};break;case"setGroupList":n={...e,groupList:t.groupList};break;case"setFetchState":n={...e,fetchState:t.fetchState};break;case"updateGroup":{const{groupList:o}=e,{group:r}=t,s=r.getGuid(),i=o.findIndex(e=>e.getGuid()===s);i>-1&&(n={...e,groupList:o.map((e,t)=>t===i?r:e)});break}case"removeGroup":{const{groupList:o}=e,r=t.guid,s=o.findIndex(e=>e.getGuid()===r);s>-1&&(n={...e,groupList:o.filter((e,t)=>t!==s)});break}case"prependGroup":n={...e,groupList:[t.group,...e.groupList]};break;case"setSearchText":n={...e,searchText:t.searchText};break;case"setIsFirstReload":n={...e,isFirstReload:t.isFirstReload};break;case"updateGroupForSDKEvents":{const{groupList:o,searchText:r}=e,{group:s,hasJoined:i,newScope:a,newCount:l,addGroup:c}=t,C=s.getGuid(),g=o.findIndex(e=>e.getGuid()===C);if(c&&r&&r.length>0)return e;if(g>-1){const t=o[g];void 0!==i&&t.setHasJoined(i),void 0!==a&&t.setScope(a),void 0!==l&&t.setMembersCount(l),n={...e,groupList:o.map((e,n)=>n===g?t:e)}}else c&&(void 0!==i&&s.setHasJoined(i),void 0!==a&&s.setScope(a),void 0!==l&&s.setMembersCount(l),n={...e,groupList:[s,...o]});break}}return n};function ri(e){const{menus:o=null,title:i=n.localize("GROUPS"),titleAlignment:a=n.TitleAlignment.left,searchPlaceholderText:l=n.localize("SEARCH"),searchIconURL:c=ti,hideSearch:C=!1,groupsRequestBuilder:d=null,searchRequestBuilder:u=null,onError:p,listItemView:h=null,hideSeparator:m=!1,subtitleView:A=null,options:y=null,selectionMode:w=n.SelectionMode.none,onSelect:f,onItemClick:D,activeGroup:E=null,loadingIconURL:v=ni,loadingStateView:S,emptyStateText:I=n.localize("NO_GROUPS_FOUND"),emptyStateView:F,errorStateText:T=n.localize("SOMETHING_WRONG"),errorStateView:R,hideError:P=!1,passwordGroupIcon:O=$s,privateGroupIcon:j=ei,statusIndicatorStyle:V,avatarStyle:G,listItemStyle:H,groupsStyle:Q}=e,[N,K]=t.useReducer(oi,{searchText:"",groupList:[],fetchState:n.States.loading,isFirstReload:!1}),z=t.useRef(null),J=t.useRef(""),Y=x(p),{theme:_}=t.useContext(U),W=t.useRef(!1),Z=t.useRef(!1),X=t.useRef("");N.searchText!==X.current&&N.searchText.trim().length>0&&N.searchText.trim().length==N.searchText.length&&(X.current=N.searchText),N.isFirstReload&&(W.current=!0,N.isFirstReload=!1);const q=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(X.current="",K({type:"setSearchText",searchText:e}))},[K]),$=t.useCallback(async e=>{const t=z.current;if(!t)return;let o=Z.current?n.States.loaded:n.States.loading;K({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(e!==J.current)return;if(0!==o.length){let e=!!Z.current;K({type:"appendGroups",groups:o,removeOldGroups:e})}K({type:"setFetchState",fetchState:n.States.loaded}),W.current&&(qs.attachConnestionListener(()=>{const e=null===d?(new s.CometChat.GroupsRequestBuilder).setLimit(30):d;z.current=new qs({searchText:X.current,groupsRequestBuilder:e,searchRequestBuilder:u,groupsSearchText:X}),Z.current=!0}),W.current=!1),Z.current?Z.current=!1:K({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===J.current&&N.groupList?.length<=0&&K({type:"setFetchState",fetchState:n.States.error}),Y(t)}},[Y,K]);function ee(e){let t="";switch(e.getType()){case n.CometChatUIKitConstants.GroupTypes.password:t=O;break;case n.CometChatUIKitConstants.GroupTypes.private:t=j}return t}function te(e){if(null!==A)return A(e);const t=e.getMembersCount();return g.jsx("div",{className:"cc-groups__subtitle",style:Xs(Q,_),children:`${t} ${t>1?n.localize("MEMBERS"):n.localize("MEMBER")}`})}function ne(e){let t;return(t=y?.(e))?.length?g.jsx(B,{data:t,onOptionClick:e=>e.detail.data.onClick?.()}):null}function oe(e){switch(w){case n.SelectionMode.none:return null;case n.SelectionMode.single:return g.jsx(L,{onChange:t=>f?.(e,t.detail.checked)});case n.SelectionMode.multiple:return g.jsx(b,{onChange:t=>f?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:_.palette.getPrimary(),uncheckedBackgroundColor:_.palette.getAccent400()}})}}function re(e){switch(e.getType()){case n.CometChatUIKitConstants.GroupTypes.private:return Q?.privateGroupIconBackground||_.palette.getSuccess()||"rgb(0, 200, 111)";case n.CometChatUIKitConstants.GroupTypes.password:return Q?.passwordGroupIconBackground||"rgb(247, 165, 0)";default:return null}}return function(e){const{groupsRequestBuilder:o,searchRequestBuilder:s,searchText:i,fetchNextIdRef:a,groupsManagerRef:l,dispatch:c,fetchNextAndAppendGroups:C,groupsSearchText:g}=e;t.useEffect(()=>{o?.searchKeyword?g.current=o?.searchKeyword:s?.searchKeyword&&(g.current=s?.searchKeyword)},[]),t.useEffect(()=>{c({type:"setIsFirstReload",isFirstReload:!0}),c({type:"setGroupList",groupList:[]}),l.current=new qs({searchText:i,groupsRequestBuilder:o,searchRequestBuilder:s,groupsSearchText:g}),C(a.current="initialFetch_"+String(Date.now()))},[C,o,s,i,c,a,l,g]),t.useEffect(()=>qs.attachListeners(c),[c]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupCreated.subscribe(e=>{c({type:"prependGroup",group:r.CometChatUIKitUtility.clone(e)})}),t=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{c({type:"removeGroup",guid:e.getGuid()})}),o=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{c({type:"updateGroup",group:r.CometChatUIKitUtility.clone(e.joinedGroup)})}),s=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{c({type:"updateGroup",group:r.CometChatUIKitUtility.clone(e.kickedFrom)})}),i=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{e.leftGroup.getType()===n.CometChatUIKitConstants.GroupTypes.private?c({type:"removeGroup",guid:e.leftGroup.getGuid()}):c({type:"updateGroup",group:e.leftGroup})}),a=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{c({type:"updateGroup",group:e.kickedFrom})}),l=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{c({type:"updateGroup",group:e.userAddedIn})}),C=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{c({type:"updateGroup",group:e.group})});return()=>{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),s.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),C.unsubscribe()}},[c])}({searchText:N.searchText,groupsRequestBuilder:d,searchRequestBuilder:u,fetchNextIdRef:J,groupsManagerRef:z,dispatch:K,fetchNextAndAppendGroups:$,groupsSearchText:X}),g.jsxs("div",{className:"cc-groups",style:Js(Q,_),children:[null===o?o:g.jsx("div",{className:"cc-groups__menus",style:{position:"absolute",top:"16px",right:"16px",cursor:"pointer",display:"flex",flexDirection:"row-reverse",width:"24px"},children:o}),g.jsx(k,{title:i,titleAlignment:a,searchPlaceholderText:l,searchIconURL:c,hideSearch:C,searchText:N.searchText,onSearch:q,list:N.groupList,listItem:null!==h?h:function(e){return g.jsx(M,{id:e.getGuid(),avatarURL:e.getIcon(),avatarName:e.getName(),title:e.getName(),statusIndicatorColor:re(e),statusIndicatorIcon:ee(e),hideSeparator:m,isActive:w===n.SelectionMode.none&&E?.getGuid()===e.getGuid(),statusIndicatorStyle:Ys(V),avatarStyle:_s(G,_),listItemStyle:Ws(H,Q,_),subtitleView:te(e),subtitleViewClassName:"cc-groups__subtitle-view",menuView:ne(e),menuViewClassName:"cc-groups__options-view",tailView:oe(e),tailViewClassName:"cc-group__tail-view",onClick:t=>D?.(e)})},onScrolledToBottom:()=>$(J.current="onScrolledToBottom_"+String(Date.now())),listItemKey:"getGuid",showSectionHeader:!1,state:N.fetchState===n.States.loaded&&0===N.groupList.length?n.States.empty:N.fetchState,loadingIconURL:v,loadingView:S,emptyStateText:I,emptyStateView:F,errorStateText:T,errorStateView:R,hideError:P,listStyle:Zs(Q,_)})]})}const si={title:n.localize("NEW_CHAT"),usersTabTitle:n.localize("USERS"),groupsTabTitle:n.localize("GROUPS"),groupsConfiguration:new r.GroupsConfiguration({}),usersConfiguration:new r.UsersConfiguration({}),onError:e=>{console.log(e)},tabVisibility:n.TabsVisibility.usersAndGroups,contactsStyle:{},selectionLimit:5,hideSubmitButton:!0,submitButtonText:"Submit",selectionMode:n.SelectionMode.none},ii=e=>{const[o,r]=t.useState([]),i=t.useRef([]),a=t.useRef([]),[l,c]=t.useState(!0),[C,d]=t.useState(!0),[u,p]=t.useState(!1),h=t.useRef(),m=t.useRef(),{theme:A}=t.useContext(U),{title:x,usersTabTitle:b,groupsTabTitle:y,closeIconURL:w,onClose:f,usersConfiguration:D,groupsConfiguration:E,onItemClick:v,tabVisibility:S,contactsStyle:I,selectionLimit:F,hideSubmitButton:k,submitButtonText:T,selectionMode:M,onSubmitButtonClick:B}={...si,...e};t.useEffect(()=>{const e=(new s.CometChat.UsersRequestBuilder).setLimit(30).hideBlockedUsers(!0),t=(new s.CometChat.UsersRequestBuilder).setLimit(30).hideBlockedUsers(!0),o=(new s.CometChat.GroupsRequestBuilder).setLimit(30).joinedOnly(!0),i=(new s.CometChat.GroupsRequestBuilder).setLimit(30).joinedOnly(!0);h.current=new n.CometChatTabItem({id:"users",title:b,style:zs(A,S,0,I),childView:g.jsx(q,{title:"",activeUser:void 0,hideSearch:D?.hideSearch||!1,searchIconURL:D?.searchIconURL,searchRequestBuilder:D?.searchRequestBuilder||t,onItemClick:D?.onItemClick||L,usersStyle:D?.usersStyle,subtitleView:D?.subtitleView,options:D?.options??void 0,usersRequestBuilder:D?.usersRequestBuilder||e,emptyStateView:D?.emptyStateView,onSelect:D?.onSelect||j,loadingIconURL:D?.loadingIconURL,errorStateView:D?.errorStateView,loadingStateView:D?.loadingStateView,tileAlignment:D?.titleAlignment,showSectionHeader:D?.showSectionHeader,listItemView:D?.listItemView,menus:D?.menu,hideSeparator:D?.hideSeparator,hideError:D?.hideError,selectionMode:M,listItemStyle:D?.listItemStyle,disableUsersPresence:D?.disableUsersPresence,statusIndicatorStyle:D?.statusIndicatorStyle,avatarStyle:D?.avatarStyle}),isActive:l}),m.current=new n.CometChatTabItem({id:"groups",title:y,style:zs(A,S,0,I),childView:g.jsx(ri,{title:"",activeGroup:void 0,hideSearch:E?.hideSearch||!1,searchIconURL:E?.searchIconURL,searchRequestBuilder:E?.searchRequestBuilder||i,onItemClick:E?.onItemClick||R,groupsStyle:E?.groupsStyle,subtitleView:E?.subtitleView,options:E?.options??void 0,privateGroupIcon:E?.privateGroupIcon,passwordGroupIcon:E?.passwordGroupIcon||E?.protectedGroupIcon,groupsRequestBuilder:E?.groupsRequestBuilder||o,emptyStateView:E?.emptyStateView,onSelect:E?.onSelect||O,loadingIconURL:E?.loadingIconURL,errorStateView:E?.errorStateView,loadingStateView:E?.loadingStateView,titleAlignment:E?.titleAlignment,listItemView:E?.listItemView,menus:E?.menu,hideSeparator:E?.hideSeparator,hideError:E?.hideError,selectionMode:M,listItemStyle:E?.listItemStyle}),isActive:u}),r([h.current,m.current])},[]),t.useEffect(()=>{S===n.TabsVisibility.groups?(p(!0),c(!1),r([m.current])):S===n.TabsVisibility.users?(p(!1),c(!0),r([h.current])):S===n.TabsVisibility.usersAndGroups&&(p(!1),c(!0),r([h.current,m.current]))},[S]);const L=e=>{v&&v(e,void 0)},R=e=>{v&&v(void 0,e)},P=()=>{B&&B(a.current,i.current)},O=e=>{var t=i.current.findIndex(t=>t?.getGuid()===e.getGuid());t>=0?i.current.splice(t,1):i.current.push(e),d(a.current.length+i.current.length>F)},j=e=>{var t=a.current.findIndex(t=>t?.getUid()===e.getUid());t>=0?a.current.splice(t,1):a.current.push(e),d(a.current.length+i.current.length>F)};return o.length?g.jsx("div",{className:"cc-contacts-wrapper",style:Ks(A,I),children:g.jsxs("div",{className:"cc-contacts",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column"},children:[g.jsx("div",{className:"cc-contacts-header",style:Ns(A,I),children:x}),g.jsxs("div",{className:"cc-contacts-content",style:{height:"calc(100% - 50px)"},children:[g.jsx(ro,{tabAlignment:n.TabAlignment.right,tabs:o,tabsStyle:{height:"100%",width:"100%",tabListHeight:"30px",tabListBackground:"#ececec",tabListPadding:"2px 2px",tabListBorderRadius:"8px",tabPaneWidth:"100%",tabPaneHeight:"calc(100% - 30px)"},keepAlive:!0}),function(){const e=w&&""!==w?w:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";return g.jsx(J,{iconURL:e,hoverText:n.localize("CLOSE"),buttonStyle:Hs(A,I),onClick:f})}()]}),M===n.SelectionMode.none&&k?g.jsx(g.Fragment,{}):g.jsx("div",{className:"cc-contacts__submit--buttons",style:{boxSizing:"border-box"},children:g.jsx(J,{text:T,buttonStyle:Qs(A,I),disabled:C,onClick:P})})]})}):g.jsx(g.Fragment,{})},ai=(e,t)=>{const n=o.isMobileDevice()?{position:"fixed",bottom:0,left:0,right:0,marginBottom:0,overflow:"hidden"}:{position:"relative"};return{display:"flex",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"0 none",borderRadius:e?.borderRadius||"inherit",background:e?.background||t.palette.getBackground(),...n}},li={position:"absolute",top:"0",left:"0",height:"100%",width:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",maxWidth:"100%",zIndex:"1"},ci={position:"absolute",top:"0",left:"0",height:"100%",width:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",maxWidth:"100%",zIndex:"1",borderRadius:"inherit"},Ci={width:"100%",borderRadius:"inherit"},gi={height:"100%",width:"100%",overflow:"hidden"},di=e=>({border:"0 none",background:"inherit",borderRadius:"inherit",...e?.messageHeaderStyle}),ui=e=>({border:"0 none",background:"inherit",borderRadius:"inherit",...e?.messageListStyle}),pi=e=>({...e?.messageComposerStyle}),hi=(e,t,n)=>({...e?.detailsStyle});function mi(e){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:e.palette.getPrimary(),padding:0}}const Ai={position:"absolute",display:"flex",alignItems:"center",height:"100%",width:"100%",justifyContent:"center",zIndex:1e3,overflow:"hidden"};function xi(e,t){return{boxSizing:"border-box",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),position:"relative",padding:"19px",display:"flex",flexDirection:"column",overflowY:"auto",overflowX:"hidden"}}function bi(e,t){return{background:"inherit",textFont:e?.titleTextFont||n.fontHelper(t.typography.title1),textColor:e?.titleTextColor||t.palette.getAccent()}}function yi(e,t){return{width:"24px",height:"24px",background:"transparent",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary(),position:"absolute",right:"12px"}}function wi(e,t){return{width:e?.width||"100%",height:e?.height||"fit-content",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"transparent",hoverBackground:e?.hoverBackground||"transparent",separatorColor:e?.separatorColor||t.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent()}}function fi(e,t){return{...e??{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function Di(e,t){return{width:e?.width||"36px",height:e?.height||"36px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px",backgroundColor:e?.backgroundColor||t.palette.getAccent700(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"}}function Ei(e,t,o){return{background:"inherit",textFont:t?.subtitleTextFont||n.fontHelper(o.typography.subtitle2),textColor:e?o.palette.getPrimary():t?.subtitleTextColor}}function vi(e){return{background:"inherit",textFont:e.titleFont,textColor:e.titleColor}}function Si(e){return{width:"100%",height:"100%",border:"none",borderRadius:"0",buttonTextFont:e.titleFont,buttonTextColor:e.titleColor,backgroundColor:e.backgroundColor||"inherit",buttonIconTint:e.iconTint,padding:"18px 0 16px 0"}}function Ii(e,t){return{background:"rgba(0, 0, 0, 0.5)",position:"absolute",width:t?.width,height:t?.height,...e}}function Fi(e,t,o){return{confirmButtonBackground:e?.confirmButtonBackground||o.palette.getPrimary(),cancelButtonBackground:e?.cancelButtonBackground||o.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||o.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(o.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||o.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(o.typography.text2),titleFont:e?.titleFont||n.fontHelper(o.typography.title1),titleColor:e?.titleColor||o.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(o.typography.subtitle2),messageTextColor:e?.messageTextColor||o.palette.getAccent600(),background:e?.background||t?.background||o.palette.getBackground(),width:e?.width||"320px",height:e?.height||"100%",border:e?.border||`1px solid ${o.palette.getAccent200()}`,borderRadius:e?.borderRadius||"8px",boxShadow:e?.boxShadow}}function ki(e,t){return{confirmButtonBackground:e?.confirmButtonBackground||t.palette.getError(),cancelButtonBackground:e?.cancelButtonBackground||t.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||t.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(t.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||t.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(t.typography.text2),titleFont:e?.titleFont||n.fontHelper(t.typography.title1),titleColor:e?.titleColor||t.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(t.typography.subtitle2),messageTextColor:e?.messageTextColor||t.palette.getAccent600(),background:e?.background||t.palette.getBackground(),width:e?.width||"320px",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent200()}`,borderRadius:e?.borderRadius||"8px",boxShadow:e?.boxShadow}}function Ti(e,t,n){return{width:"100%",height:(t?"2":"1")+"px",background:e||n.palette.getAccent200()}}const Mi=(e,t)=>{const n=e?.groupMembersStyle;return{background:n?.background||t?.background,...n}},Bi=(e,t)=>{const n=e?.addMembersStyle;return{background:n?.background||t?.background,...n}},Li=(e,t)=>{const n=e?.bannedMembersStyle;return{background:n?.background||t?.background,...n}},Ui=(e,t)=>{const n=e?.transferOwnershipStyle;return{background:n?.background||t?.background,...n}};var Ri="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Pi="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Oi(e,t){return{boxSizing:"border-box",width:e?.width||"max(100%, 360px)",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"8px",background:e?.background||t.palette.getBackground(),display:"flex",flexDirection:"column"}}function ji(e,t,r){const s={height:"14px",width:"14px",border:"none",borderRadius:"4px",background:"inherit"};return r?new o.RadioButtonStyle({...s,labelTextColor:e?.MemberScopeTextColor||t.palette.getAccent600(),labelTextFont:e?.MemberScopeTextFont||n.fontHelper(t.typography.text2)}):new o.LabelStyle({...s,textColor:e?.MemberScopeTextColor||t.palette.getAccent600(),textFont:e?.MemberScopeTextFont||n.fontHelper(t.typography.text2)})}function Vi(e,t){return{width:"100%",background:t.palette.getPrimary(),padding:"16px",buttonTextColor:e?.transferButtonTextColor||t.palette.getAccent900(),buttonTextFont:e?.transferButtonTextFont||n.fontHelper(t.typography.title2),display:"flex",justifyContent:"center",textAlign:"center",border:"none",borderRadius:"8px"}}function Gi(e,t){return{width:"100%",background:"#f1f1f1",padding:"16px",color:e?.cancelButtonTextColor||t.palette.getAccent(),font:e?.cancelButtonTextFont||n.fontHelper(t.typography.title2),display:"flex",justifyContent:"center",textAlign:"center",border:"0 none",borderRadius:"8px"}}function Hi(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"36px",height:e?.height||"36px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Qi(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||r.palette.getBackground(),activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function Ni(e,t){return new r.GroupMembersStyle({height:e?.height||"100%",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"inherit",background:e?.background||"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||"",emptyStateTextColor:e?.emptyStateTextColor||"",errorStateTextFont:e?.errorStateTextFont||"",errorStateTextColor:e?.errorStateTextColor||"",loadingIconTint:e?.loadingIconTint||"",searchIconTint:e?.searchIconTint||"",searchBorder:e?.searchBorder||"",searchBorderRadius:e?.searchBorderRadius||"",searchBackground:e?.searchBackground||"",searchPlaceholderTextFont:e?.searchPlaceholderTextFont||"",searchPlaceholderTextColor:e?.searchPlaceholderTextColor||"",searchTextFont:e?.searchTextFont||"",searchTextColor:e?.searchTextColor||"",onlineStatusColor:e?.onlineStatusColor||t.palette.getSuccess(),backButtonIconTint:e?.backButtonIconTint||t.palette.getPrimary(),closeButtonIconTint:e?.closeButtonIconTint||t.palette.getPrimary(),padding:e?.padding||"0",separatorColor:e?.separatorColor||t.palette.getAccent200(),boxShadow:e?.boxShadow})}var Ki="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",zi="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Ji(e){const{group:o,title:i=n.localize("TRANSFER_OWNERSHIP"),titleAlignment:a=n.TitleAlignment.center,searchIconURL:l=Ki,searchPlaceholder:c=n.localize("SEARCH"),hideSearch:C=!1,groupMembersRequestBuilder:d,searchRequestBuilder:u,loadingIconURL:p=zi,loadingStateView:h,emptyStateText:A=n.localize("NO_USERS_FOUND"),emptyStateView:b,errorStateText:y=n.localize("SOMETHING_WRONG"),errorStateView:w,onError:f,hideSeparator:D=!1,disableUsersPresence:E=!1,closeButtonIconURL:v,onClose:S,listItemView:I,subtitleView:F,transferButtonText:k=n.localize("TRANSFER_OWNERSHIP"),onTransferOwnership:T,cancelButtonText:M=n.localize("CANCEL"),options:B,statusIndicatorStyle:R,avatarStyle:P=null,listItemStyle:O=null,groupMemberStyle:j=null,transferOwnershipStyle:V=null}=e,[G,H]=t.useState(null),[Q,N]=t.useState(!0),K=t.useRef(null),z=x(f),Y=m(T),_=m(o),{theme:W}=t.useContext(U);const Z=t.useCallback(async()=>{const e=K.current;if(e)try{const t=Y.current;if(t)t(e);else{const t=_.current;if(await s.CometChat.transferGroupOwnership(t.getGuid(),e.getUid()),G){const o=r.CometChatUIKitUtility.clone(t);o.setOwner(e.getUid()),n.CometChatGroupEvents.ccOwnershipChanged.next({group:o,newOwner:r.CometChatUIKitUtility.clone(e)}),S&&S()}}K.current=null}catch(e){z(e)}},[z,G,_,Y]);return function(e){const{errorHandler:n,setLoggedInUser:o}=e;t.useEffect(()=>{(async()=>{try{o(await s.CometChat.getLoggedinUser())}catch(e){n(e)}})()},[n,o])}({errorHandler:z,setLoggedInUser:H}),g.jsxs("div",{className:"cc-transfer-ownership",style:Oi(V,W),children:[g.jsx(he,{menus:void 0,hideError:void 0,onItemClick:void 0,dropDownIconURL:void 0,groupScopeStyle:void 0,onBack:void 0,backButtonIconURL:void 0,showBackButton:!1,options:B,group:o,title:i,titleAlignment:a,searchIconURL:l,searchPlaceholder:c,hideSearch:C,groupMemberRequestBuilder:d,searchRequestBuilder:u,loadingIconURL:p,loadingStateView:h,emptyStateText:A,emptyStateView:b,errorStateText:y,errorStateView:w,onError:z,hideSeparator:D,disableUsersPresence:E,closeButtonIconURL:v,onClose:S,selectionMode:n.SelectionMode.none,listItemView:I,subtitleView:F,tailView:function(e){const t=o.getOwner()===e.getUid()?n.CometChatUIKitConstants.groupMemberScope.owner:e.getScope();return o.getOwner()===e.getUid()?g.jsx("cometchat-label",{text:n.localize(t.toUpperCase()),labelStyle:JSON.stringify(ji(V,W,!1))}):g.jsx(L,{labelText:n.localize(t.toUpperCase()),radioButtonStyle:ji(V,W,!0),onChange:()=>function(e){Q&&N(!1),K.current=e}(e)})},statusIndicatorStyle:R,avatarStyle:Hi(P,W),listItemStyle:Qi(O,j,W),groupMembersStyle:Ni(j,W)}),g.jsxs("div",{className:"cc-transfer-ownership__btns-wrapper",style:{flexShrink:"0",display:"flex",flexDirection:"column",rowGap:"8px",padding:"4px 28px 20px 28px",boxSizing:"border-box"},children:[g.jsx(J,{text:k,disabled:Q,buttonStyle:Vi(V,W),onClick:Z}),g.jsx(J,{text:M,buttonStyle:Gi(V,W),onClick:S})]})]})}var Yi="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",_i="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Wi(e){const{user:o,group:i,title:a=n.localize("DETAILS"),closeButtonIconURL:l=Pi,cancelButtonText:c=n.localize("CANCEL"),onClose:C,disableUsersPresence:d=!1,customProfileView:u=null,hideProfile:p=!1,privateGroupIcon:h=_i,protectedGroupIcon:b=Yi,passwordGroupIcon:y,subtitleView:w=null,data:f,onError:D,leaveButtonText:E=n.localize("LEAVE_GROUP"),leaveConfirmDialogMessage:v=n.localize("LEAVE_CONFIRM"),transferButtonText:S=n.localize("TRANSFER_OWNERSHIP"),transferConfirmDialogMessage:I=n.localize("TRANSFER_CONFIRM"),deleteButtonText:F=n.localize("DELETE"),deleteConfirmDialogMessage:k=n.localize("DELETE_CONFIRM"),addMembersConfiguration:T=null,bannedMembersConfiguration:B=null,groupMembersConfiguration:L=null,transferOwnershipConfiguration:R=null,listItemStyle:P=null,statusIndicatorStyle:O=null,avatarStyle:j=null,leaveDialogStyle:V=null,deleteDialogStyle:G=null,backdropStyle:H=null,detailsStyle:Q=null}=e,[N,K]=t.useState("none"),[z,Y]=t.useState(null),[_,W]=t.useState(null),[X,q]=t.useState(void 0),[$,ee]=A(null),[te,ne]=A(null),oe=m(C),re=x(D),{theme:se}=t.useContext(U),ie=t.useCallback((e,t)=>{const o=n.CometChatUIKitConstants.groupMemberAction.LEFT,i=new s.CometChat.Action(e.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return i.setAction(o),i.setActionBy(r.CometChatUIKitUtility.clone(t)),i.setActionFor(r.CometChatUIKitUtility.clone(e)),i.setActionOn(r.CometChatUIKitUtility.clone(t)),i.setReceiver(r.CometChatUIKitUtility.clone(e)),i.setSender(r.CometChatUIKitUtility.clone(t)),i.setConversationId("group_"+e.getGuid()),i.setMuid(r.CometChatUIKitUtility.ID()),i.setMessage(`${t.getName()} ${o} ${t.getUid()}`),i.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),i},[]),ae=t.useCallback(async e=>{if(!(e instanceof s.CometChat.User))if(e.getOwner()===_?.getUid())Y({type:"transferOwnership"});else{Y(null);try{if(_){await s.CometChat.leaveGroup(e.getGuid());const t=r.CometChatUIKitUtility.clone(e);t.setHasJoined(!1),n.CometChatGroupEvents.ccGroupLeft.next({userLeft:r.CometChatUIKitUtility.clone(_),leftGroup:t,message:ie(t,_)}),oe.current?.()}}catch(e){re(e)}}},[_,Y,re,ie,oe]),le=t.useCallback(async e=>{if(!(e instanceof s.CometChat.User)){Y(null);try{await s.CometChat.deleteGroup(e.getGuid()),n.CometChatGroupEvents.ccGroupDeleted.next(r.CometChatUIKitUtility.clone(e)),oe.current?.()}catch(e){re(e)}}},[Y,re,oe]);function ce(e){if(e instanceof s.CometChat.User){let t=(new Z).getUserStatusVisible(e);if(!d&&!t)return Q?.onlineStatusColor||se.palette.getSuccess()||"rgb(0, 200, 111)"}else{const t=e.getType();if(t===n.CometChatUIKitConstants.GroupTypes.private)return Q?.privateGroupIconBackground||"#F7A500";if(t===n.CometChatUIKitConstants.GroupTypes.password)return Q?.passwordGroupIconBackground||"#F7A500"}return null}function Ce(e){let t="";if(e instanceof s.CometChat.Group){const o=e.getType();o===n.CometChatUIKitConstants.GroupTypes.private?t=h:o===n.CometChatUIKitConstants.GroupTypes.password&&(t=y||b)}return t}function ge(e){if(e instanceof s.CometChat.User)return d?"":n.localize(e.getStatus().toUpperCase());const t=e.getMembersCount();return`${t} ${n.localize(t>1?"MEMBERS":"MEMBER")}`}function de(e){if(w)return e instanceof s.CometChat.User?w(e):w(void 0,e);const t=e instanceof s.CometChat.User&&e.getStatus()===n.CometChatUIKitConstants.userStatusType.online;return e instanceof s.CometChat.User&&(e.getBlockedByMe()||e.getHasBlockedMe())?null:g.jsx("cometchat-label",{text:ge(e),labelStyle:JSON.stringify(Ei(t,Q,se))})}function ue(e,t){const{id:o,onClick:i}=e;if(i)i(t);else switch(o){case n.CometChatUIKitConstants.UserOptions.viewProfile:t instanceof s.CometChat.User&&t.getLink()&&window.open(t.getLink(),"_blank");break;case n.CometChatUIKitConstants.UserOptions.block:t instanceof s.CometChat.User&&async function(e){if(!e.getBlockedByMe())try{await s.CometChat.blockUsers([e.getUid()]);const t=r.CometChatUIKitUtility.clone(e);t.setBlockedByMe(!0),n.CometChatUserEvents.ccUserBlocked.next(t),q(t)}catch(e){re(e)}}(t);break;case n.CometChatUIKitConstants.UserOptions.unblock:t instanceof s.CometChat.User&&async function(e){if(e.getBlockedByMe())try{await s.CometChat.unblockUsers([e.getUid()]);const t=r.CometChatUIKitUtility.clone(e);t.setBlockedByMe(!1),n.CometChatUserEvents.ccUserUnblocked.next(t),q(t)}catch(e){re(e)}}(t);break;case n.CometChatUIKitConstants.GroupOptions.viewMembers:t instanceof s.CometChat.Group&&K("groupMembers");break;case n.CometChatUIKitConstants.GroupOptions.addMembers:t instanceof s.CometChat.Group&&K("addMembers");break;case n.CometChatUIKitConstants.GroupOptions.bannedMembers:t instanceof s.CometChat.Group&&K("bannedMembers");break;case n.CometChatUIKitConstants.GroupOptions.leave:if(t instanceof s.CometChat.Group){const e=t.getOwner()===_?.getUid();Y({type:"leaveOrTransferConfirm",buttonText:e?S:E,confirmDialogMessage:e?I:v})}break;case n.CometChatUIKitConstants.GroupOptions.delete:t instanceof s.CometChat.Group&&Y({type:"deleteConfirm",buttonText:F,confirmDialogMessage:k})}}function pe(e,t,n){return t?g.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Ti(t,n,se))}):null}function me(e,t){const{title:n,id:o,hideSectionSeparator:r=!0,sectionSeparatorColor:i,hideItemSeparator:a=!1,itemSeparatorColor:l}=e;let c=null;n&&(c=g.jsx("div",{className:"cc-details__section-header",style:{textAlign:"left"},children:g.jsx("cometchat-label",{text:n.toUpperCase(),labelStyle:JSON.stringify(vi(e))})}));let C=null;const d=function(e,t){const{id:n}=e;if(void 0!==n)return t instanceof s.CometChat.User?e.options?.(t,null,n):e.options?.(null,t,n)}(e,t);return d?.length&&(C=g.jsx("div",{className:"cc-details__options",style:{display:"flex",flexDirection:"column"},children:d.map((e,n)=>function(e,t,n,o){const{id:r,customView:s}=e;if(s)return g.jsx("div",{className:"cc-details__option",children:s},r);const{title:i,tail:a,iconURL:l}=e,c=g.jsx(J,{text:i,iconURL:l,buttonStyle:Si(e),onClick:()=>ue(e,t)});let C=c;return a&&(C=g.jsxs("div",{className:"cc-details__option-content",style:{position:"relative"},children:[c,g.jsx("div",{className:"cc-details__option-tail",style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:a})]})),g.jsxs("div",{className:"cc-details__option",style:{display:"flex",flexDirection:"column"},children:[C,pe(0,o,!1)]},r)}(e,t,0,l))})),g.jsxs("div",{className:"cc-details__section",style:{padding:"16px 0"},children:[c,C,pe(0,i,!0)]},o)}function Ae(){K("none")}function xe(){Y(null)}function be(e){if(e instanceof s.CometChat.User)return null;const t=R?.options;return g.jsx(Ji,{group:e,onTransferOwnership:R?.onTransferOwnership,titleAlignment:R?.titleAlignment,loadingIconURL:R?.loadingIconURL,loadingStateView:R?.loadingStateView,errorStateView:R?.errorStateView,emptyStateView:R?.emptyStateView,onError:R?.onError,hideSearch:R?.hideSearch,searchIconURL:R?.searchIconURL,hideSeparator:R?.hideSeparator,closeButtonIconURL:R?.closeButtonIconURL||Pi,disableUsersPresence:R?.disableUsersPresence,listItemView:R?.listItemView,subtitleView:R?.subtitleView,onClose:R?.onClose??xe,groupMembersRequestBuilder:R?.groupMembersRequestBuilder,searchRequestBuilder:R?.searchRequestBuilder,options:t?(e,n)=>t(n):void 0,statusIndicatorStyle:R?.statusIndicatorStyle,avatarStyle:R?.avatarStyle,listItemStyle:R?.listItemStyle,groupMemberStyle:R?.groupMemberStyle,transferOwnershipStyle:Ui(R,Q)})}return function(e){const{setLoggedInUser:n,errorHandler:o,leaveOrTransferConfirmDialogElement:r,setModalInfo:i,handleLeaveOrTransferConfirmClick:a,deleteConfirmDialogElement:l,handleDeleteConfirmClick:c,userOrGroup:C,user:g,group:d,setUserOrGroup:u}=e;t.useEffect(()=>{g instanceof s.CometChat.User&&(g.getStatus?.()?u(g):s.CometChat.getUser(g.getUid()).then(e=>{u(e)}).catch(e=>o(e))),d instanceof s.CometChat.Group&&(d.getOwner?.()?u(d):s.CometChat.getGroup(d.getGuid()).then(e=>{u(e)}).catch(e=>o(e)))},[g,d,u,o]),t.useEffect(()=>{if(!r)return;const e="cc-confirm-clicked",t=()=>{C&&a(C)};return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[r,a,C]),t.useEffect(()=>{if(!r)return;const e="cc-cancel-clicked",t=()=>i(null);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[r,i]),t.useEffect(()=>{if(!l)return;const e="cc-confirm-clicked",t=()=>{C&&c(C)};return l.addEventListener(e,t),()=>{l.removeEventListener(e,t)}},[l,c,C]),t.useEffect(()=>{if(!l)return;const e="cc-cancel-clicked",t=function(){i(null)};return l.addEventListener(e,t),()=>{l.removeEventListener(e,t)}},[l,i]),t.useEffect(()=>{(async()=>{try{n(await s.CometChat.getLoggedinUser())}catch(e){o(e)}})()},[o,n])}({setLoggedInUser:W,errorHandler:re,leaveOrTransferConfirmDialogElement:$,setModalInfo:Y,handleLeaveOrTransferConfirmClick:ae,deleteConfirmDialogElement:te,handleDeleteConfirmClick:le,userOrGroup:X,user:o,group:i,setUserOrGroup:q}),X?g.jsxs("div",{className:"cc-details",style:xi(Q,se),children:[g.jsxs("div",{className:"cc-details__header",style:{display:"flex",justifyContent:"center",textAlign:"center",width:"100%",paddingBottom:"19px"},children:[g.jsx("cometchat-label",{text:a,labelStyle:JSON.stringify(bi(Q,se))}),g.jsx(J,{iconURL:l,buttonStyle:yi(Q,se),onClick:C})]}),g.jsxs("div",{className:"cc-details__content",style:{flexGrow:"1",display:"flex",flexDirection:"column",overflowY:"auto"},children:[function(e){if(p)return null;let t;return t=u?e instanceof s.CometChat.User?u(e):u(void 0,e):function(e){return g.jsx(M,{avatarName:e.getName(),title:e.getName(),avatarURL:e instanceof s.CometChat.User?e.getAvatar():e.getIcon(),statusIndicatorColor:ce(e),statusIndicatorIcon:Ce(e),listItemStyle:wi(P,se),statusIndicatorStyle:fi(O),avatarStyle:Di(j,se),subtitleViewClassName:"cc-details__subtitle-view",subtitleView:de(e)})}(e),g.jsx("div",{className:"cc-details__profile",style:{overflowX:"auto"},children:t})}(X),function(t){const n=function(){let t;return f&&(t=f),t||(t=r.DetailsUtils.getDefaultDetailsTemplate(_,e?.user,e?.group,se)),t}().map((e,n)=>me(e,t));return 0===n.length?null:g.jsx("div",{className:"cc-details__section-list",style:{flexGrow:"1",overflowY:"auto",display:"flex",flexDirection:"column",padding:"28px 0"},children:n})}(X)]}),function(e){try{let t=null;switch(N){case"addMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=T?.sectionHeaderField,o=T?.options;return g.jsx(Tr,{group:e,selectionMode:T?.selectionMode??n.SelectionMode.multiple,onClose:T?.onClose??C??Ae,onBack:T?.onBack??Ae,backButtonIconURL:T?.backButtonIconURL||Ri,showBackButton:T?.showBackButton??!0,titleAlignment:T?.titleAlignment,hideSearch:T?.hideSearch,searchIconURL:T?.searchIconURL,showSectionHeader:T?.showSectionHeader,sectionHeaderField:(r=t,void 0!==r&&r in new s.CometChat.User("anyString")?t:void 0),loadingIconURL:T?.loadingIconURL,loadingStateView:T?.loadingStateView,emptyStateView:T?.emptyStateView,errorStateView:T?.errorStateView,hideError:T?.hideError,disableUsersPresence:T?.disableUsersPresence,hideSeparator:T?.hideSeparator,onError:T?.onError??void 0,menus:T?.menu,options:o??void 0,onSelect:T?.onSelect,usersRequestBuilder:T?.usersRequestBuilder,searchRequestBuilder:T?.searchRequestBuilder,listItemView:T?.listItemView,subtitleView:T?.subtitleView,onAddMembersButtonClick:T?.onAddMembersButtonClick??void 0,closeButtonIconURL:T?.closeButtonIconURL||Pi,listItemStyle:T?.listItemStyle,statusIndicatorStyle:T?.statusIndicatorStyle,avatarStyle:T?.avatarStyle,addMembersStyle:Bi(T,Q)});var r}(e);break;case"bannedMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=B?.options;return g.jsx(Yr,{group:e,onClose:B?.onClose??C??Ae,onBack:B?.onBack??Ae,backButtonIconURL:B?.backButtonIconURL||Ri,showBackButton:B?.showBackButton||!0,menus:B?.menu,titleAlignment:B?.titleAlignment,hideSearch:B?.hideSearch,searchIconURL:B?.searchIconURL,bannedMembersRequestBuilder:B?.bannedMembersRequestBuilder,searchRequestBuilder:B?.searchRequestBuilder,listItemView:B?.listItemView,subtitleView:B?.subtitleView,hideSeparator:B?.hideSeparator,disableUsersPresence:B?.disableUsersPresence,options:t??void 0,selectionMode:B?.selectionMode,closeButtonIconURL:B?.closeButtonIconURL||Pi,onError:B?.onError??void 0,onSelect:B?.onSelect,emptyStateView:B?.emptyStateView,errorStateView:B?.errorStateView,loadingStateView:B?.loadingStateView,loadingIconURL:B?.loadingIconURL,hideError:B?.hideError,statusIndicatorStyle:B?.statusIndicatorStyle,avatarStyle:B?.avatarStyle,listItemStyle:B?.listItemStyle,bannedMemberStyle:Li(B,Q)})}(e);break;case"groupMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=L?.options;return g.jsx(he,{group:e,onClose:L?.onClose??C??Ae,onBack:L?.onBack??Ae,groupMemberRequestBuilder:L?.groupMembersRequestBuilder,searchRequestBuilder:L?.searchRequestBuilder,listItemView:L?.listItemView,subtitleView:L?.subtitleView,disableUsersPresence:L?.disableUsersPresence,userPresencePlacement:L?.userPresencePlacement,menus:L?.menu,options:t?(e,n)=>t(n):void 0,backButtonIconURL:L?.backButtonIconURL||Ri,closeButtonIconURL:L?.closeButtonIconURL||Pi,showBackButton:L?.showBackButton||!0,hideSeparator:L?.hideSeparator,selectionMode:L?.selectionMode,hideError:L?.hideError,searchIconURL:L?.searchIconURL,dropDownIconURL:L?.dropdownIconURL,hideSearch:L?.hideSearch,onError:L?.onError??void 0,onSelect:L?.onSelect,emptyStateView:L?.emptyStateView,errorStateView:L?.errorStateView,loadingIconURL:L?.loadingIconURL,loadingStateView:L?.loadingStateView,titleAlignment:L?.titleAlignment,statusIndicatorStyle:L?.statusIndicatorStyle,avatarStyle:L?.avatarStyle,groupMembersStyle:Mi(L,Q),groupScopeStyle:L?.groupScopeStyle,listItemStyle:L?.listItemStyle})}(e);break;case"none":break;default:}if(null!==t)return g.jsx("div",{className:"cc-details__page-wrapper",style:{position:"absolute",top:"0",left:"0",boxSizing:"border-box",width:"100%",height:"100%",border:"none",borderRadius:"inherit"},children:t})}catch(e){re(e)}}(X),function(e){if(!z)return null;const{type:t}=z;try{switch(t){case"leaveOrTransferConfirm":return g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Ii(H,Q)),children:g.jsx("cometchat-confirm-dialog",{ref:ee,title:"",cancelButtonText:c,confirmButtonText:z.buttonText,messageText:z.confirmDialogMessage,confirmDialogStyle:JSON.stringify(Fi(V,Q,se))})});case"transferOwnership":return g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Ii(H,Q)),children:be(e)});case"deleteConfirm":return g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Ii(H,Q)),children:g.jsx("cometchat-confirm-dialog",{ref:ne,cancelButtonText:c,confirmButtonText:z.buttonText,messageText:z.confirmDialogMessage,confirmDialogStyle:JSON.stringify(ki(G,se))})});default:}}catch(e){re(e)}}(X)]}):null}function Zi(e,t){return new o.PreviewStyle({height:"100%",width:"100%",border:`1px solid ${t.palette.getAccent200()}`,background:t.palette.getBackground(),previewTitleFont:e?.previewTitleFont||n.fontHelper(t.typography.caption1),previewTitleColor:e?.previewTitleColor||t.palette.getAccent600(),previewSubtitleFont:e?.previewSubtitleFont||n.fontHelper(t.typography.subtitle2),previewSubtitleColor:e?.previewSubtitleColor||t.palette.getAccent400(),closeButtonIconTint:e?.closePreviewTint||t.palette.getAccent600(),borderRadius:"12px"})}function Xi(e,t,o){return{height:"fit-content",width:"fit-content",buttonTextFont:n.fontHelper(t.typography.subtitle2),buttonTextColor:t.palette.getAccent600(),borderRadius:"8px",border:"none",buttonIconTint:t.palette.getAccent600(),padding:"8px",iconHeight:"20px",iconWidth:"20px",iconBackground:"transparent",gap:"5px",...o}}function qi(e,t){const r=o.isMobileDevice()?n.fontHelper(t.typography.name):n.fontHelper(t.typography.text2);return new o.TextInputStyle({height:"100%",width:"100%",maxHeight:e?.maxInputHeight||"150px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||"12px",background:e?.background||`${t.palette.getAccent50()}`,textFont:e?.textFont||r,textColor:e?.textColor||t.palette.getAccent(),dividerColor:e?.dividerTint||t.palette.getAccent100(),inputBorder:e?.inputBorder||"none",inputBorderRadius:e?.inputBorderRadius||"0px",inputBackground:e?.inputBackground||"transparent",placeholderTextColor:t.palette.getAccent500(),placeholderTextFont:n.fontHelper(t.typography.subtitle2)})}function $i(e,t,n=!1){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:n?t.palette.getAccent200():e?.sendIconTint||t.palette.getPrimary(),background:"transparent",padding:"0"}}function ea(e,t,n){return n?e?.emojiIconTint||t.palette.getAccent():e?.emojiIconTint||t.palette.getAccent500()}function ta(e,t,n){return n?e?.voiceRecordingIconTint||t.palette.getAccent():e?.voiceRecordingIconTint||t.palette.getAccent500()}function na(e,t,n){return n?e?.attachIcontint||t.palette.getAccent():e?.attachIcontint||t.palette.getAccent500()}function oa(e,t,n){return n?e?.AIIconTint||t.palette.getAccent():e?.AIIconTint||t.palette.getAccent500()}const ra="244px",sa="275px",ia="12px";function aa(e,t){let n=e?.height,r=e?.width,s="100%"==n||"100%"==r;return new o.PopoverStyle({width:r&&!s?e?.width:sa,height:n&&!s?e?.height:ra,borderRadius:e?.borderRadius||ia,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"})}function la(e={},t){return{width:e?.width||sa,height:e?.height||ra,borderRadius:e?.borderRadius||ia,border:`1px solid ${t.palette.getAccent100()}`,boxSizing:"border-box",overflow:"auto"}}function ca(e,t){return{width:e?.width||sa,height:e?.height||ra,borderRadius:e?.borderRadius||ia,border:`1px solid ${t.palette.getAccent100()}`,boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}}function Ca(e,t){return new o.ActionSheetStyle({width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||ia,background:e?.background||t.palette.getBackground(),layoutModeIconTint:e?.layoutModeIconTint||t.palette.getPrimary(),titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent(),listItemBackground:e?.listItemBackground||"transparent",listItemIconTint:e?.listItemIconTint||t.palette.getAccent700(),listItemIconBackground:e?.listItemIconBackground||"transparent",listItemIconBorderRadius:e?.listItemIconBorderRadius||"0",ActionSheetSeparatorTint:e?.ActionSheetSeparatorTint||`${t.palette.getAccent400()}`})}function ga(e,t){return new o.ActionSheetStyle({width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||ia,background:e?.background||t.palette.getBackground(),listItemBackground:e?.listItemBackground||"transparent",ActionSheetSeparatorTint:e?.optionsSeparatorTint||`${t.palette.getAccent600()}`})}function da(e,t,n){return{height:"24px",width:"24px",border:"none",borderRadius:"0",padding:"0",buttonIconTint:na(e,t,n),background:"transparent"}}function ua(e,t,n){return{height:"24px",width:"24px",border:"none",borderRadius:"0",padding:"0",buttonIconTint:oa(e,t,n),background:"transparent"}}const pa="400px",ha="320px",ma="12px";function Aa(e){return{width:ha,height:pa,borderRadius:ma,border:`1px solid ${e.palette.getAccent100()}`,boxSizing:"border-box"}}function xa(e,t){return new o.EmojiKeyboardStyle({width:"100%",height:"100%",border:"none",borderRadius:ma,background:t.palette.getBackground(),textFont:e?.emojiKeyboardTextFont||n.fontHelper(t.typography.caption1),textColor:e?.emojiKeyboardTextColor||t.palette.getAccent()})}function ba(e,t,n,o=!1){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:ea(e,t,n),background:"transparent",padding:"0"}}const ya="100px",wa="250px",fa="8px";function Da(e,t){return new o.MediaRecorderStyle({...e,background:e?.background||t.palette.getBackground(),border:"1px solid rgba(20, 20, 20, 0.08)",borderRadius:fa,closeIconTint:e?.closeIconTint||t.palette.getAccent600(),submitIconTint:e?.submitIconTint||t.palette.getAccent600(),startIconTint:e?.startIconTint||t.palette.getError(),stopIconTint:e?.stopIconTint||t.palette.getError(),timerTextColor:e?.timerTextColor||t.palette.getAccent400(),timerTextFont:e?.timerTextFont||n.fontHelper(t.typography.text3)})}function Ea(e,t,n,o=!1){const r={};return o&&(r.margin="0px 10px"),{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:ta(e,t,n),background:"transparent",...r}}var va="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%22%20height%3D%22100%22%20xml%3Aspace%3D%22preserve%22%20version%3D%221.1%22%20viewBox%3D%220%200%20100%20100%22%3E%20%20%20%20%3Cimage%20width%3D%22100%22%20height%3D%22100%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAABeZJREFUeF7tnOGx5TQMhbUdQAdQAUsFQAVABSwVLFQAVABUAFTAUgFQAXSwuxVABzAfc81kM7ElJ7KjeyPPvHk%2FrpPI5%2BRIsuz4iWQLhcCTUNakMZKEBHsJkpAkJBgCwcxJhSQhwRAIZk4qJAkJhkAwc1IhSUgwBIKZkwpJQoIhEMycVIiNkLdE5Omt62%2B2S%2Fb1SkJ03N4RkV9FhP%2B0VyLy0e2%2FfnVnjyREBwwyPlx1QyWQ4t6SEB3SfypdhmA35Kb6GO%2BmB7Hjr4q1b4vI394jSULaiD4TkR8qXXBZ7gE%2BCWkT8nIRzNc9%2FxSR91Mh3gjU74cyUEir%2FSgin3ualAp5E80y3%2Fh2Me%2FQ8CYN%2FkZEXnjElGiEMPkCDNJMXAJvH%2F9HNuYXqGGd2u59JnEFuyGqu0UiBGD%2BEBHe0tLIYt71ePMayLTiRDegtwsgg%2FjSnYVFIuSLmzrWIHwpIt%2FtRUa5DlUw8bO0otRSQtGu2ZWFRSLkaxH5amOU%2BGd%2BG9GSkAaqqOD5xu%2FfiwjqGdFwj7jJUqfyegYuC1fb3SIphCzl440RuKeWq2dABs%2F4oBu97Qt%2Bv6XLdx%2FUt4p4DHnIBKwCPor55OY6rarBPuIc%2F7uD%2BNqOSAqhZrTMsIqtDJK60eyGaj5THvqTYfLYZXcUQshc8OW1titj6UJiuzM21bKq3XGiZVcUQmopb7F9ZKbVwqeVhTH5Q0WuLQohrTeRAQ9bEFLQvGT5XXNXBbOz3NblFqgswfNMlWxlf6S2XrWvN0R6tssitaSWZG1nqORSmxxqc48aQWfFEuwpinCZb9QGeKZCWpkVc4%2BtOQnjGFlstCp1WL%2BzCNkqtZdBkt9%2FeqvC1iaKlLZ3lSaGIel04zMIWfvk9VDKnKOloKGb1Zyw3XWb2YRoZKxnv9pMedgOwl1oOlw0kxCNDOLG2hW1XBvDfzilzCKEDIV161YFtRasW3ujCimUMdz3SDm88N23GE0IQZlVQG2BSatV1VYTlwNmgYv7HC6Bd6PoeMEoQiCC1T%2BIqKWvZRgaGaWfhZSyJce96OeIefNW3oTgklhDsBCBYVYyekgpbgxSWK%2B4q%2FT4CCGAXzaWUSBk%2BdW6ynZkgmdRyvItZGZN7YkYgzuDoLAk9RCy3MR2RMGAcTQIW5IEi42zNuNZbPmvj5UQLf20PhA3QjblEXixCbVoy6yabTM242k2%2FP%2B7lRBtRU97IC4D8Eakph5qCVMfm0WIh5uqkQ4hpNZH1ifujhCCN%2BsWWgqrKQWXRWblEVSxhbmHh8sKU6y0KgSgCeoA%2Bp6GuvK7h1o83BRm4kpxx6N32Jsh6yFkfVOCakl9AYi%2FHrKIKailt%2FXGs9e3bzcAvSwueSi0125T%2FyOEbD0Agqg94UYsc5JeUogVlo3XZE7sCUbRYcHfAtCbkOUzIAYANWKspFjIKEQQWzxSa9Nb7dlpJCHYSeAF8K1d7ctxaKRYyEAR3OcuiShgjCakPMcShFEUtad102KGR5Lg%2BZIfutcsQjAyF6gMVM0kxELK%2BtOD1vd%2FD7daCECzCbGQUmbNrbjxkGScRUghZf3FbRE0QZnNCz9XMrSttXeDM7iPLmcopCCTG%2BU23pEzCcGc3q2kwzY5K%2Fq5zIlyPZ8lgxlfts6eeV9qszUg176%2BXb%2B0o7%2FGrYnkcifKWVVCifyMquzlPtixxJKZn0YvlXLJT9oAQNtJctaK3mVPlNPc1lnu6tInykU7OODyJ8rVPj2YOffIE%2BUWEbT2Ne4vt%2FNHRtU%2B8kS5CrJnHM%2BEKXmiXIWQPMDspPJ7zfXkEX%2FBCNnajDe61J4nyimRebkZb9YmtjxRblS65HDfPFHOAcRRt7AcivOwJ8qNAvXofbXv5HedPNoy6uwVw6OAjb7%2BsifKjQZ27%2F0vW37fC9iM6y65QDUD2L3PuNSJcntBmnnd5TY5zAT3yLMe%2FkS5I%2BA87LWZ9gajNglJQoIhEMycVEgSEgyBYOakQpKQYAgEMycVkoQEQyCYOamQJCQYAsHMSYUEI%2BRfzec9dI8XxxgAAAAASUVORK5CYII%3D%22%2F%3E%20%20%3C%2Fsvg%3E",Sa="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ia="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FHeart%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FHeart%22%20fill%3D%22%23000000%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.375%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.3134395%2C18.0459049%20L1.52443954%2C8.87923824%20C-0.0597509272%2C7.29629358%20-0.452349335%2C4.87680895%200.550022872%2C2.87415491%20L0.550022872%2C2.87415491%20C1.29768241%2C1.3792661%202.71831477%2C0.334867269%204.36817344%2C0.0671851901%20C6.01803212%2C-0.200496889%207.69599623%2C0.341168737%208.87793954%2C1.52298824%20L10.3134395%2C2.95757158%20L11.7489395%2C1.52298824%20C12.9308829%2C0.341168737%2014.608847%2C-0.200496889%2016.2587056%2C0.0671851901%20C17.9085643%2C0.334867269%2019.3291967%2C1.3792661%2020.0768562%2C2.87415491%20L20.0768562%2C2.87415491%20C21.0778256%2C4.87595612%2020.6857045%2C7.29366739%2019.1033562%2C8.87648824%20L10.3134395%2C18.0459049%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Fa(e){const{dispatch:i,textInputRef:a,liveReactionBtnElement:l,LiveReactionIconURL:c,mySetAddToMsgInputText:C,actionSheetElement:g,mediaFilePickerRef:d,secondaryBtnElement:u,textMessageEditPreviewElement:p,auxiliaryBtnElement:h,voiceRecordingBtnElement:m,emojiKeyboardElement:A,voiceRecordingElement:x,auxiliaryPopoverElement:b,attachmentPopoverElement:y,text:w,handleSendButtonClick:f,primaryBtnElement:D,onTextChange:E,actionIdToActionOnClick:v,handleTyping:S,errorHandler:I,getReceiverDetails:F,contentToDisplay:k,createPollViewRef:T,handleSendVoiceMessage:M,aiPopoverElement:B,aiBtnElement:L,setSmartRepliesView:U,textFormatters:R,disableMentions:P,textFormatterArray:O,mentionsTextFormatterInstanceRef:j,userMemberWrapperConfiguration:V,setTextFormatters:G,CometChatUIKitLoginListener:H,group:Q,user:N,userMemberWrapperConfig:K,setUserMemberWrapperConfig:z,userPropRef:J,groupPropRef:Y,setShowListForMentions:_,searchMentions:W,mentionsFormatterInstanceId:Z,setUsersRequestBuilder:X,setGroupMembersRequestBuilder:q,setUserMemberListType:$,userMemberWrapperRef:ee,getComposerId:te,parentMessageIdPropRef:ne,isPartOfCurrentChatForUIEvent:oe,propsText:re,triggerClosePreview:se}=e,ie=t.useRef(!1);t.useEffect(()=>{re&&(N?.getUid()||Q?.getGuid())&&i({type:"setAddToMsgInputText",addToMsgInputText:re})},[N?.getUid(),Q?.getGuid(),re,i]),t.useEffect(()=>{const e=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{let t=e?.message?.getParentMessageId();(ne.current&&t&&t===ne.current||!ne.current&&!t)&&oe(e.message)&&(e.status===n.MessageStatus.inprogress&&e.message instanceof s.CometChat.TextMessage&&(ie.current=!0,i({type:"setTextMessageToEdit",textMessageToEdit:e.message}),a.current?.emptyInputField(),C(e.message.getText())),e.status===n.MessageStatus.success&&e.message instanceof s.CometChat.TextMessage||e?.status==n.MessageStatus.cancelled?(i({type:"setTextMessageToEdit",textMessageToEdit:null}),a.current?.emptyInputField(),ie.current=!1):ie.current=!0)}),t=n.CometChatUIEvents.ccComposeMessage.subscribe(e=>{i({type:"setText",text:""}),a.current?.emptyInputField(),C(e)});j.current.setId(Z);const o=n.CometChatUIEvents.ccShowMentionsCountWarning.subscribe(e=>{if(e.id===Z){if(e.showWarning)return void i({type:"setShowMentionsCountWarning",showMentionsCountWarning:!0});i({type:"setShowMentionsCountWarning",showMentionsCountWarning:!1})}});return()=>{e.unsubscribe(),t.unsubscribe(),o.unsubscribe()}},[C,i,a,Z]),t.useEffect(()=>{if(!l)return;async function e(){try{const{receiverId:e,receiverType:t}=F(),o={type:"live_reaction",reaction:"heart"};s.CometChat.sendTransientMessage(new s.CometChat.TransientMessage(e,t,o)),n.CometChatMessageEvents.ccLiveReactionSent.next({composerId:te(),reaction:"heart"})}catch(e){I(e)}}const t="cc-button-clicked";return l.addEventListener(t,e),()=>{l.removeEventListener(t,e)}},[c,l,I,F]),t.useEffect(()=>{if(!g||!d.current)return;function e(e){const{action:t}=e.detail;u?.click(),i({type:"setContentToDisplay",contentToDisplay:"none"});const n=v.current.get(`${t.id}`);"function"==typeof n?n():(d.current.accept=`${t.id}/*`,d.current.click())}const t="cc-actionsheet-clicked";return g.addEventListener(t,e),()=>{g.removeEventListener(t,e)}},[u,g,i,v,d]),t.useEffect(()=>{if(!p)return;function e(){se&&se(),setTimeout(()=>{i({type:"setTextMessageToEdit",textMessageToEdit:null}),i({type:"setText",text:""}),o.isMobileDevice()?a.current?.emptyInputFieldWithoutFocus():a.current?.emptyInputField(),C("")},0)}const t="cc-preview-close-clicked";return p.addEventListener(t,e),()=>{p.removeEventListener(t,e)}},[p,i,a]),t.useEffect(()=>{if(!u)return;function e(){switch(k){case"attachments":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"attachments"})}}function t(){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-button-clicked",o="cc-popover-outside-clicked";return u.addEventListener(n,e),y.addEventListener(o,t),()=>{u.removeEventListener(n,e),y.removeEventListener(o,t)}},[k,u,y,h,m,L,i]),t.useEffect(()=>{if(!L)return;function e(){switch(U(null),k){case"ai":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"ai"})}}function t(){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-button-clicked",o="cc-popover-outside-clicked";return L.addEventListener(n,e),B.addEventListener(o,t),()=>{L.removeEventListener(n,e),B.removeEventListener(o,t)}},[k,L,B,u,h,m,U,i]),t.useEffect(()=>{if(!m)return;function e(){switch(k){case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"emojiKeyboard":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"})}}function t(){switch(k){case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"voiceRecording":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"})}}const n="cc-button-clicked";return h&&h.addEventListener(n,e),m.addEventListener(n,t),()=>{h&&h.removeEventListener(n,e),m.removeEventListener(n,t)}},[k,u,m,h,L,i]),t.useEffect(()=>{if(!A)return;function e(e){const t=e.detail.id;"string"==typeof t&&C(t)}function t(e){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-emoji-clicked",o="cc-popover-outside-clicked";return A.addEventListener(n,e),b.addEventListener(o,t),()=>{A.removeEventListener(n,e),b.removeEventListener(o,t)}},[C,b,A,i]),t.useEffect(()=>{if(!x)return;function e(e){const t=new CustomEvent("cc-button-clicked",{});m?.click(),m?.dispatchEvent(t)}function t(t){const n=t.detail.file;e(),M(n)}const n="cc-media-recorder-closed",o="cc-media-recorder-submitted";return x.addEventListener(n,e),x.addEventListener(o,t),()=>{x.removeEventListener(n,e),x.removeEventListener(o,t)}},[x,m,i,M]),t.useEffect(()=>{if(!D)return;function e(){w&&f(w)}const t="cc-button-clicked";return D.addEventListener(t,e),()=>{D.removeEventListener(t,e)}},[f,w,D]),t.useEffect(()=>{const e=a.current;if(!e)return;function t(e){_(!1);let t=e.detail.value;t=t.replace(/<br\s*\/?>/gi,""),"string"==typeof t&&""!==t.trim()&&f(t)}const n="cc-text-input-entered";return e.addEventListener(n,t),()=>{e.removeEventListener(n,t)}},[f,a]),t.useEffect(()=>{const e=a.current;if(!e)return;function t(e){const t=e.detail.value;"string"!=typeof t&&null!=t||(S(),i({type:"setText",text:t}),C(""),void 0!==E&&E(t))}const n="cc-text-input-changed";return e.addEventListener(n,t),()=>{e.removeEventListener(n,t)}},[E,S,i,a,Q?.getGuid(),N?.getUid()]),t.useEffect(()=>{const e=n.CometChatUIEvents.ccShowModal.subscribe(e=>{i({type:"setShowPoll",showPoll:!0}),T.current=e.child}),t=n.CometChatUIEvents.ccHideModal.subscribe(()=>{i({type:"setShowPoll",showPoll:!1}),T.current=null});return()=>{e.unsubscribe(),t.unsubscribe()}},[T,i]),t.useEffect(()=>{if(!P)if(R.length){let e=!1;for(let t=0;t<O.length;t++)if(O[t]instanceof r.CometChatMentionsFormatter){e=!0;break}e||(j.current.setLoggedInUser(H.getLoggedInUser()),void 0===j.current.getKeyDownCallBack()&&(j.current.setKeyDownCallBack(W),j.current.setKeyUpCallBack(W)),G([...O,j.current]))}else j.current.setLoggedInUser(H.getLoggedInUser()),void 0===j.current.getKeyDownCallBack()&&(j.current.setKeyDownCallBack(W),j.current.setKeyUpCallBack(W)),G([...O,j.current]);let e=j.current;return()=>{e&&e.cleanup()}},[]),t.useEffect(()=>{(J.current&&N&&J.current.getUid()!==N.getUid()||Y.current&&Q&&Y?.current.getGuid()!==Q.getGuid())&&(i({type:"setText",text:""}),C("")),J.current&&_(N&&J.current.getUid()!==N.getUid()),Y.current&&_(Q&&Y?.current.getGuid()!==Q.getGuid());for(let e=0;e<O.length;e++)O[e].setComposerConfig(N,Q,te())},[N,Q,J,Y,i,a,C]),t.useEffect(()=>{if(!P){if(Q){const e=void 0!==V?.userMemberListType?V?.userMemberListType:n.UserMemberListType.groupmembers;$(e);const t=V?.groupMemberRequestBuilder?V?.groupMemberRequestBuilder:new s.CometChat.GroupMembersRequestBuilder(Q.getGuid()).setLimit(15);q(t)}if(N){const e=void 0!==V?.userMemberListType?V?.userMemberListType:n.UserMemberListType.users;$(e);const t=V?.usersRequestBuilder?V?.usersRequestBuilder:(new s.CometChat.UsersRequestBuilder).setLimit(15);X(t)}}},[N,Q,P]),t.useEffect(()=>{const e=e=>{ee.current&&!ee.current.contains(e.target)&&_(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),t.useEffect(()=>{try{setTimeout(()=>{ie.current&&a.current&&(i({type:"setTextMessageToEdit",textMessageToEdit:null}),i({type:"setText",text:""}),a.current?.emptyInputField(),C(""),ie.current=!1)})}catch(e){I(e)}},[N,Q,ne])}var ka="data:image/svg+xml,%3Csvg%20width%3D%2260%22%20height%3D%2260%22%20viewBox%3D%220%200%2060%2060%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.0001%200.666626C46.2004%200.666626%2059.3334%2013.7996%2059.3334%2030C59.3334%2046.2003%2046.2004%2059.3333%2030.0001%2059.3333C13.7997%2059.3333%200.666748%2046.2003%200.666748%2030C0.666748%2013.7996%2013.7997%200.666626%2030.0001%200.666626ZM30.0001%205.99996C16.7452%205.99996%206.00008%2016.7451%206.00008%2030C6.00008%2043.2548%2016.7452%2054%2030.0001%2054C43.2549%2054%2054.0001%2043.2548%2054.0001%2030C54.0001%2016.7451%2043.2549%205.99996%2030.0001%205.99996ZM31.6667%2027.3333C32.219%2027.3333%2032.6667%2027.781%2032.6667%2028.3333V42.3333C32.6667%2042.8856%2032.219%2043.3333%2031.6667%2043.3333H28.3334C27.7811%2043.3333%2027.3334%2042.8856%2027.3334%2042.3333V28.3333C27.3334%2027.781%2027.7811%2027.3333%2028.3334%2027.3333H31.6667ZM30.0001%2019.3333C31.4728%2019.3333%2032.6667%2020.5272%2032.6667%2022C32.6667%2023.4727%2031.4728%2024.6666%2030.0001%2024.6666C28.5273%2024.6666%2027.3334%2023.4727%2027.3334%2022C27.3334%2020.5272%2028.5273%2019.3333%2030.0001%2019.3333Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E",Ta="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FMic%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FMic%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%284%2C%201%29%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%228%22%20y1%3D%2218.3333333%22%20x2%3D%228%22%20y2%3D%2222%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20x%3D%223.5%22%20y%3D%220%22%20width%3D%229%22%20height%3D%2214.9111111%22%20rx%3D%223.91111111%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C8.8%20L0%2C11%20C0%2C15.0500882%203.35786438%2C18.3333333%207.5%2C18.3333333%20L8.5%2C18.3333333%20C12.6421356%2C18.3333333%2016%2C15.0500882%2016%2C11%20L16%2C8.8%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ma="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ba="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%20Rotated%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus-Rotated%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%2845.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",La="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSend%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSend%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.158865921%2C1.85985859%20C-0.108182698%2C1.38202197%20-0.0332622567%2C0.786017075%200.343741637%2C0.389140701%20C0.72074553%2C-0.00773567366%201.31211969%2C-0.113146836%201.80303259%2C0.129025252%20L17.6480326%2C8.17819192%20C17.857662%2C8.28481329%2017.9896898%2C8.50008892%2017.9896898%2C8.73527525%20C17.9896898%2C8.97046158%2017.857662%2C9.18573721%2017.6480326%2C9.29235859%20L1.80303259%2C17.3523586%20C1.31211969%2C17.5945307%200.72074553%2C17.4891195%200.343741637%2C17.0922431%20C-0.0332622567%2C16.6953668%20-0.108182698%2C16.0993619%200.158865921%2C15.6215253%20L4.37386592%2C8.73485859%20L0.158865921%2C1.85985859%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2217.9896993%22%20y1%3D%228.73485859%22%20x2%3D%224.36969925%22%20y2%3D%228.73485859%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ua="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FStipop%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FStipop%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.5%2C1%20C18.2989899%2C1%2023%2C5.70101013%2023%2C11.5%20C23%2C17.2039245%2018.451858%2C21.8455734%2012.7842951%2C21.9962258%20L12.5%2C22%20L6%2C23%20L6.47908443%2C20.1033393%20C3.77065445%2C18.2043706%202%2C15.0589646%202%2C11.5%20C2%2C5.70101013%206.70101013%2C1%2012.5%2C1%20Z%20M12.5%2C2.5%20C7.52943725%2C2.5%203.5%2C6.52943725%203.5%2C11.5%20C3.5%2C14.3705191%204.85206397%2C17.0112175%207.09635804%2C18.6980916%20L7.34021132%2C18.8751453%20L8.11298335%2C19.416961%20L7.817%2C21.202%20L12.3852902%2C20.5%20L12.5%2C20.5%20C17.4705627%2C20.5%2021.5%2C16.4705627%2021.5%2C11.5%20C21.5%2C6.52943725%2017.4705627%2C2.5%2012.5%2C2.5%20Z%20M13.5%2C12.3%20C13.1666667%2C13.9666667%2012.3333333%2C14.8%2011%2C14.8%20C9.66666667%2C14.8%208.83333333%2C13.9666667%208.5%2C12.3%20L13.5%2C12.3%20Z%20M15.0030662%2C6.67300699%20C15.1656001%2C6.92305919%2015.1180007%2C7.24908483%2014.9043132%2C7.44344192%20L14.826993%2C7.50306617%20L13.632%2C8.279%20L14.8086975%2C8.98550424%20C15.0644308%2C9.13894425%2015.1646368%2C9.45281874%2015.0578342%2C9.72120324%20L15.0144958%2C9.80869745%20C14.8610557%2C10.0644308%2014.5471813%2C10.1646368%2014.2787968%2C10.0578342%20L14.1913025%2C10.0144958%20L12.1913025%2C8.81449576%20C11.8402552%2C8.60386734%2011.8048611%2C8.12100565%2012.0939654%2C7.85785853%20L12.173007%2C7.79693383%20L14.173007%2C6.49693383%20C14.4508428%2C6.31634058%2014.8224729%2C6.39517122%2015.0030662%2C6.67300699%20Z%20M8.1%2C6.7%20C8.92842712%2C6.7%209.6%2C7.37157288%209.6%2C8.2%20C9.6%2C9.02842712%208.92842712%2C9.7%208.1%2C9.7%20C7.27157288%2C9.7%206.6%2C9.02842712%206.6%2C8.2%20C6.6%2C7.37157288%207.27157288%2C6.7%208.1%2C6.7%20Z%22%20id%3D%22Oval%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ra="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20height%3D%2224px%22%3E%3Cpath%20d%3D%22M%2012%202%20C%206.477%202%202%206.477%202%2012%20C%202%2017.523%206.477%2022%2012%2022%20C%2017.523%2022%2022%2017.523%2022%2012%20C%2022%206.477%2017.523%202%2012%202%20z%20M%2012%204%20C%2016.411%204%2020%207.589%2020%2012%20C%2020%2016.411%2016.411%2020%2012%2020%20C%207.589%2020%204%2016.411%204%2012%20C%204%207.589%207.589%204%2012%204%20z%20M%208%208%20L%208%2016%20L%2016%2016%20L%2016%208%20L%208%208%20z%22%2F%3E%3C%2Fsvg%3E";const Pa=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t,events:{onClick:"cc-actionsheet-clicked"}}),Oa=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t}),ja=ye({tagName:"cometchat-text-input",elementClass:o.CometChatTextInput,react:t}),Va=ye({tagName:"cometchat-popover",elementClass:o.CometChatPopover,react:t});function Ga(e,t){let n=e;const{type:o}=t;switch(o){case"setText":n={...e,text:t.text};break;case"setAddToMsgInputText":n={...e,addToMsgInputText:t.addToMsgInputText};break;case"setTextMessageToEdit":n={...e,textMessageToEdit:t.textMessageToEdit};break;case"setContentToDisplay":n={...e,contentToDisplay:t.contentToDisplay};break;case"setLoggedInUser":n={...e,loggedInUser:t.loggedInUser};break;case"setShowPoll":n={...e,showPoll:t.showPoll};break;case"setShowMentionsCountWarning":n={...e,showMentionsCountWarning:t.showMentionsCountWarning}}return n}function Ha(e){const{user:a,group:l,text:c="",onTextChange:C,placeHolderText:d=n.localize("ENTER_YOUR_MESSAGE_HERE"),sendButtonIconURL:u=La,sendButtonView:p,onSendButtonClick:h,secondaryButtonView:b,attachmentIconURL:y=Ma,emojiIconURL:w=Ua,AIIconURL:f=va,auxiliaryButtonView:D,auxiliaryButtonAlignment:E=n.AuxiliaryButtonAlignment.right,attachmentOptions:v,hideLayoutMode:S=!1,parentMessageId:I=null,LiveReactionIconURL:F=Ia,hideLiveReaction:k=!0,headerView:T=null,onError:M,disableSoundForMessages:B=!1,customSoundForMessage:L,disableTypingEvents:R=!1,messageComposerStyle:P,hideVoiceRecording:O=!1,actionSheetStyle:j,AIOptionsStyle:V={},mediaRecorderStyle:G,voiceRecordingStartIconURL:H=Ta,voiceRecordingCloseIconURL:Q=Sa,voiceRecordingStopIconURL:N=Ra,voiceRecordingSubmitIconURL:K=La,userMemberWrapperConfiguration:z,textFormatters:J=[],disableMentions:Y=!1,InfoSimpleIcon:_=ka,mentionsWarningText:W,mentionsWarningStyle:Z={}}=e,[X,q]=t.useReducer(Ga,{text:c,addToMsgInputText:c,textMessageToEdit:null,contentToDisplay:"none",loggedInUser:null,showPoll:!1,showMentionsCountWarning:!1}),$=t.useRef(null),ee=t.useRef(null),[te,ne]=A(null),[oe,re]=A(null),[se,ie]=A(null),[ae,le]=A(null),[ce,Ce]=A(null),[ge,de]=A(null),[ue,pe]=A(null),[he,Ae]=A(null),[xe,be]=A(null),[ye,we]=A(null),[fe,De]=A(null),[Ee,ve]=A(null),[Se,Ie]=A(null),[Fe,ke]=A(null),Te=t.useRef(new Map),Me=t.useRef(null),Le=t.useRef(null),Ue=x(M),Re=m(a),Pe=m(l),Oe=m(I),je=m(B),Ve=m(L),Ge=m(h),{theme:He}=t.useContext(U),[Qe,Ne]=t.useState(null),[Ke,ze]=t.useState(J),[Je,Ye]=t.useState(""),_e=t.useRef(""),We=t.useRef(""),[Ze,Xe]=t.useState(!1),qe=t.useRef(Be.getDataSource().getMentionsTextFormatter({theme:He})),[$e,et]=t.useState(0),[tt,nt]=t.useState(z??new r.UserMemberWrapperConfiguration({})),[ot,rt]=t.useState(),[st,it]=t.useState(void 0),[at,lt]=t.useState(void 0),ct=t.useRef(null),Ct="composer_"+Date.now(),gt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType();if(!Oe.current){if(e.getParentMessageId())return!1;if(Re.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&t===Re.current.getUid())return!0}else if(Pe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Pe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===Oe.current)return!0},[]),dt=t.useCallback(()=>{We.current=_e.current,Xe(!1),Ye(""),_e.current=""},[Xe,Ye]),ut=t.useCallback(e=>{if(!e||!e.length)return Ye(""),_e.current="",Xe(!1),void et(1);let t=e.split("@")[1].toLowerCase()?e.split("@")[1].toLowerCase():void 0;t&&We.current&&t.startsWith(We.current.toLowerCase())||t===Je||(Ye(t),_e.current=t,Xe(!0),We.current="",et($e+1))},[Ye,Xe,et]),pt=t.useCallback(()=>{const e=Re.current,t=Pe.current;if(e){const t=e.getBlockedByMe()||e.getHasBlockedMe();return{receiverId:e?.getUid(),receiverType:n.CometChatUIKitConstants.MessageReceiverType.user,isBlocked:t}}if(t)return{receiverId:t?.getGuid(),receiverType:n.CometChatUIKitConstants.MessageReceiverType.group};throw new Error("No user or group object provided. Should at least provide one.")},[Pe,Re]),ht=t.useCallback(()=>{const{receiverId:e,receiverType:t,isBlocked:n}=pt();return n?null:new s.CometChat.TypingIndicator(e,t)},[pt]),mt=t.useCallback(()=>{try{const e=ht();if(!e)return;s.CometChat.startTyping(e)}catch(e){Ue(e)}},[ht,Ue]),At=t.useCallback(()=>{try{s.CometChat.endTyping(ht()),Me.current=null}catch(e){Ue(e)}},[ht,Ue]),xt=t.useCallback(()=>{R||(null!==Me.current?(window.clearTimeout(Me.current),Me.current=null):mt(),Me.current=window.setTimeout(()=>At(),500))},[mt,At,R]);function bt(){const e=Re.current;if(null!=e)return{user:e?.getUid(),group:null,parentMessageId:I};const t=Pe.current;return null!=t?{user:null,group:t?.getGuid(),parentMessageId:I}:{user:null,group:null,parentMessageId:I}}const yt=t.useCallback(function(e){i.flushSync(()=>{q({type:"setAddToMsgInputText",addToMsgInputText:""})}),q({type:"setAddToMsgInputText",addToMsgInputText:e})},[q]),wt=t.useCallback((e,t,o)=>{throw t.setMetadata({error:e}),o?n.CometChatMessageEvents.ccMessageEdited.next({message:t,status:n.MessageStatus.error}):n.CometChatMessageEvents.ccMessageSent.next({message:t,status:n.MessageStatus.error}),e},[]),ft=t.useCallback(()=>{je.current||r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.outgoingMessage,Ve.current)},[Ve,je]),Dt=t.useCallback(e=>{const{receiverId:t,receiverType:n}=pt(),o=new s.CometChat.TextMessage(t,e,n);o.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),o.setMuid(r.CometChatUIKitUtility.ID());const i=Oe.current;return null!==i&&o.setParentMessageId(i),o},[pt,Oe]),Et=t.useCallback(async e=>{try{for(let t=0;t<Ke.length;t++)e=Ke[t].formatMessageForSending(e);const t=await s.CometChat.sendMessage(e);return qe.current.resetCometChatUserGroupMembers(),t}catch(t){console.log(t),wt(t,e,!1)}},[wt]),vt=t.useCallback(async e=>{try{const t=Dt(e);let o=qe.current.getCometChatUserGroupMembers();if(o){let e=[];for(let t=0;t<o.length;t++)e.push(new s.CometChat.User({uid:o[t].getUid(),name:o[t].getName()}));t.setMentionedUsers(e),o=[]}n.CometChatMessageEvents.ccMessageSent.next({message:t,status:n.MessageStatus.inprogress});const r=await Et(t);r&&(n.CometChatMessageEvents.ccMessageSent.next({message:r,status:n.MessageStatus.success}),ft())}catch(e){Ue(e)}},[Dt,ft,Et,Ue]),St=t.useCallback((e,t)=>{const{receiverId:n,receiverType:o}=pt(),r=new s.CometChat.TextMessage(n,e,o);return r.setId(t),r},[pt]),It=t.useCallback(async e=>{try{for(let t=0;t<Ke.length;t++)e=Ke[t].formatMessageForSending(e);const t=await s.CometChat.editMessage(e);return qe.current.resetCometChatUserGroupMembers(),t}catch(t){wt(t,e,!0)}},[wt]),Ft=t.useCallback(async(e,t)=>{try{if(Ge.current)Ge.current(St(e,t.getId()),n.PreviewMessageMode.edit),yt("");else{const o=await It(St(e,t.getId()));yt(""),o&&n.CometChatMessageEvents.ccMessageEdited.next({message:o,status:n.MessageStatus.success})}}catch(e){Ue(e)}},[It,St,Ue]),kt=t.useCallback(async e=>{if(0===(e=e?.trim())?.length||null!==X.textMessageToEdit&&X.textMessageToEdit.getText()===e)return;let t;if("emojiKeyboard"===X.contentToDisplay&&(ue&&ue?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"})),q({type:"setText",text:""}),$.current?.emptyInputField(),null!==X.textMessageToEdit)q({type:"setTextMessageToEdit",textMessageToEdit:null}),await Ft(e,X.textMessageToEdit);else if(t=Ge.current)try{await Promise.all([t(Dt(e),n.PreviewMessageMode.none)])}catch(e){Ue(e)}else await vt(e)},[X.textMessageToEdit,X.contentToDisplay,ue,ge,q,Ft,vt,Ue,Dt,Ge,Re]),Tt=t.useCallback(async(e,t)=>{const n=await function(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=()=>{null!==o.result&&t(new File([o.result],e.name,e))},o.onerror=()=>n(new Error(`Converting the file named "${e.name}" to binary failed`)),o.readAsArrayBuffer(e)})}(e),{receiverId:o,receiverType:i}=pt(),a=new s.CometChat.MediaMessage(o,n,t,i);a.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),a.setMuid(r.CometChatUIKitUtility.ID()),a.setMetadata({file:n});const l=Oe.current;return null!==l&&a.setParentMessageId(l),a},[pt,Oe]),Mt=t.useCallback(async e=>{try{return await s.CometChat.sendMediaMessage(e)}catch(t){wt(t,e,!1)}},[wt]),Bt=t.useCallback(async(e,t)=>{try{const o=await Tt(e,t);n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.inprogress});const r=await Mt(o);r&&(n.CometChatMessageEvents.ccMessageSent.next({message:r,status:n.MessageStatus.success}),ft())}catch(e){Ue(e)}},[Tt,ft,Mt,Ue]),Lt=t.useCallback(async e=>{try{"voiceRecording"===X.contentToDisplay&&(ge?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"}));const t=new File([e],`${function(){const e=new Date,t="audio-recording-yyyyMMddHHmmss",n=e.getFullYear().toString(),o=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0");return t.replace("yyyyMMdd",`${n}${o}${r}`).replace("HHmmss",`${s}${i}${a}`)}()}.wav`,{type:e.type});Bt(t,n.CometChatUIKitConstants.MessageTypes.audio)}catch(e){Ue(e)}},[Bt,Ue]);const Ut=t.useCallback(async()=>{const e=ee.current;if(!e?.files?.length||Re.current?.getBlockedByMe())return;const t=e.files[0];let o=e.accept.slice(0,-2);const r=(e=>{const t=e.type;return t.startsWith("image/")?n.CometChatUIKitConstants.MessageTypes.image:t.startsWith("video/")?n.CometChatUIKitConstants.MessageTypes.video:t.startsWith("audio/")?n.CometChatUIKitConstants.MessageTypes.audio:n.CometChatUIKitConstants.MessageTypes.file})(t);o!==r&&(o=r);const s=Ge.current;if(s)try{await Promise.all([s(await Tt(t,o),n.PreviewMessageMode.none)])}catch(e){Ue(e)}else await Bt(t,o);e.value=""},[Bt,Ue,Tt,Ge,Re]);function Rt(){return!X.text||""===X?.text?.trim()||null!==X.textMessageToEdit&&X.textMessageToEdit.getText()===X.text}function Pt(){return p?p(void 0!==a?a:l,bt()):g.jsx("div",{className:"cc-message-composer__send-btn-wrapper",children:g.jsx("cometchat-button",{ref:ie,iconURL:u,hoverText:n.localize("SEND_MESSAGE"),buttonStyle:JSON.stringify($i(P,He,Rt()))})})}function Ot(){if(b&&(void 0!==a||void 0!==l))return b(void 0!==a?a:l,bt());const e=g.jsx("cometchat-button",{ref:le,hoverText:n.localize("ATTACH"),iconURL:"attachments"===X.contentToDisplay?Ba:y,buttonStyle:JSON.stringify(da(P,He,"attachments"===X.contentToDisplay))});let t;if(v&&v.length>0&&(void 0!==a||void 0!==l)){t=v(a||l,bt())}else t=Be.getDataSource().getAttachmentOptions(He,bt());for(let e=0;e<t.length;e++){const n=t[e],{id:o}=n;if("string"==typeof o){let e=n.onClick;"extension_poll"===o&&(e=()=>{n.onClick?.call(new On(Be.getDataSource(),new so({})),[a,l])}),Te.current.set(o,e||null)}}const o=g.jsx(Oa,{title:n.localize("ADD_TO_CHAT"),ref:ve,hideLayoutMode:S,actions:t,actionSheetStyle:Ca(j,He)});return g.jsxs("cometchat-popover",{ref:be,placement:n.Placement.top,popoverStyle:JSON.stringify(aa(j)),children:[g.jsx("div",{slot:"children",className:"cc-message-composer__secondary-btn-wrapper",children:e}),g.jsx("div",{slot:"content",className:"cc-message-composer__secondary-content",style:la(j,He),children:o})]})}function jt(){const e=g.jsx("cometchat-media-recorder",{ref:re,mediaPlayerStyle:JSON.stringify(Da(G,He)),"cc-media-recorder-submitted":"onVoiceRecordingSubmit",autorecording:"true",recordingType:n.RecordingType.audio,closeIconURL:Q,startIconURL:H,stopIconURL:N,submitButtonIconURL:K,startIconText:"",stopIconText:"",submitButtonIconText:""}),t=g.jsx("cometchat-button",{ref:de,hoverText:n.localize("VOICE_RECORDING"),iconURL:"voiceRecording"===X.contentToDisplay?Ba:H,buttonStyle:JSON.stringify(Ea(P,He,"voiceRecording"===X.contentToDisplay,!1))});return O?null:g.jsxs(Va,{placement:n.Placement.top,popoverStyle:new o.PopoverStyle({width:wa,height:ya,borderRadius:fa,border:"1px solid rgba(20, 20, 20, 0.08)",boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}),closeOnOutsideClick:!1,children:[g.jsx("div",{slot:"children",className:"cc-message-composer__secondary-btn-wrapper",children:t}),g.jsx("div",{slot:"content",className:"cc-message-composer__secondary-content",style:{width:wa,height:ya,borderRadius:fa,boxSizing:"border-box"},children:"voiceRecording"===X.contentToDisplay?e:null})]})}function Vt(){const e=g.jsx("cometchat-button",{ref:Ce,hoverText:n.localize("AI"),iconURL:"ai"===X.contentToDisplay?Ba:f,buttonStyle:JSON.stringify(ua(P,He,"ai"===X.contentToDisplay))});let t;t=Be.getDataSource().getAIOptions(Re?.current||null,Pe?.current||null,He,bt(),V);const r=()=>{ce?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"})},s=()=>{Ne(null)},i=g.jsx(Pa,{ref:Ie,hideLayoutMode:!0,actions:t,actionSheetStyle:ga(V,He),onActionItemClick:e=>{e instanceof n.CometChatMessageComposerAction&&e?.onClick&&(e.onClick(),r()),e instanceof n.CometChatActionsView&&e?.customView&&Ne(e.customView({backAction:s,closePopover:r}))}});return t.length<=0?g.jsx(g.Fragment,{}):g.jsxs("cometchat-popover",{ref:we,placement:n.Placement.top,popoverStyle:JSON.stringify((a=V,new o.PopoverStyle({width:a?.width||sa,height:a?.height||ra,borderRadius:a?.borderRadius||ia,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}))),children:[g.jsx("div",{slot:"children",className:"cc-message-composer__ai-btn-wrapper",children:e}),g.jsx("div",{slot:"content",className:"cc-message-composer__ai-content",style:ca(V,He),children:Qe||i})]});var a}function Gt(){if(D&&(void 0!==a||void 0!==l))return D(void 0!==a?a:l,bt());const e=k&&Rt(),t=Be.getDataSource().getAuxiliaryOptions(bt(),He,a,l),r=o.isMobileDevice()?null:g.jsx("cometchat-button",{ref:pe,hoverText:n.localize("EMOJI"),iconURL:"emojiKeyboard"===X.contentToDisplay?Ba:w,buttonStyle:JSON.stringify(ba(P,He,"emojiKeyboard"===X.contentToDisplay,e))}),s=g.jsx("cometchat-emoji-keyboard",{ref:ne,emojiKeyboardStyle:JSON.stringify(xa(P,He))});return g.jsxs(g.Fragment,{children:[g.jsx(g.Fragment,{children:Vt()}),g.jsx("div",{style:{flex:1,display:"flex",columnGap:"8px"},children:t.map(e=>e)}),g.jsx("div",{className:"cc-message-composer__default-auxiliary-view-wrapper",style:{display:"flex",flex:"1"},children:g.jsxs("cometchat-popover",{ref:Ae,placement:n.Placement.top,popoverStyle:JSON.stringify(new o.PopoverStyle({width:ha,height:pa,borderRadius:ma,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"})),children:[g.jsx("div",{slot:"children",className:"cc-message-composer__auxiliary-btn-wrapper",children:r}),g.jsx("div",{slot:"content",className:"cc-message-composer__auxiliary-content",style:Aa(He),children:s})]})})]})}function Ht(){if(null===X.textMessageToEdit)return null;const e=X.textMessageToEdit;return g.jsx("cometchat-preview",{style:{textAlign:"left"},ref:De,previewSubtitle:(e=>{const t=/<@uid:(.*?)>/g;let n=e.getText(),o=n,s=t.exec(n),i=[],a=e.getMentionedUsers();for(;null!==s;){let e;for(let t=0;t<a.length;t++)s[1]===a[t].getUid()&&(e=a[t]);e&&(o=o.replace(s[0],"@"+e.getName()),i.push(e)),s=t.exec(n)}return qe.current.setCometChatUserGroupMembers(i),qe.current.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),o})(e),closeButtonIconURL:Sa,previewStyle:JSON.stringify(Zi(P,He))})}return Fa({dispatch:q,textInputRef:$,liveReactionBtnElement:Fe,LiveReactionIconURL:F,mySetAddToMsgInputText:yt,actionSheetElement:Ee,secondaryBtnElement:ae,mediaFilePickerRef:ee,textMessageEditPreviewElement:fe,auxiliaryBtnElement:ue,voiceRecordingBtnElement:ge,emojiKeyboardElement:te,voiceRecordingElement:oe,text:X.text,propsText:e.text,handleSendButtonClick:kt,primaryBtnElement:se,onTextChange:C,actionIdToActionOnClick:Te,handleTyping:xt,errorHandler:Ue,getReceiverDetails:pt,contentToDisplay:X.contentToDisplay,createPollViewRef:Le,handleSendVoiceMessage:Lt,auxiliaryPopoverElement:he,attachmentPopoverElement:xe,aiPopoverElement:ye,aiBtnElement:ce,setSmartRepliesView:Ne,textFormatters:J,disableMentions:Y,textFormatterArray:Ke,mentionsTextFormatterInstanceRef:qe,userMemberWrapperConfiguration:z,setTextFormatters:ze,CometChatUIKitLoginListener:r.CometChatUIKitLoginListener,group:l,user:a,setUserMemberWrapperConfig:nt,userMemberWrapperConfig:tt,userPropRef:Re,groupPropRef:Pe,setShowListForMentions:Xe,searchMentions:ut,mentionsFormatterInstanceId:Ct,setUsersRequestBuilder:it,setGroupMembersRequestBuilder:lt,setUserMemberListType:rt,userMemberWrapperRef:ct,getComposerId:bt,parentMessageIdPropRef:Oe,isPartOfCurrentChatForUIEvent:gt,triggerClosePreview:()=>{X.textMessageToEdit&&n.CometChatMessageEvents.ccMessageEdited.next({message:X.textMessageToEdit,status:n.MessageStatus.cancelled})}}),g.jsxs(g.Fragment,{children:[X.showPoll&&Le?.current?Le.current:null,g.jsxs("div",{className:"cc-message-composer",style:(Nt=P,{width:Nt?.width||"100%",height:Nt?.height||"100%",boxSizing:"border-box",padding:"14px 16px",border:"none",borderRadius:"0",background:"transparent",display:"flex",flexDirection:"column",justifyContent:"flex-end"}),children:[Ze&&g.jsx("div",{style:{maxHeight:"196px",overflowY:"hidden",display:"flex !important",flexDirection:"column",justifyContent:"flex-end !important",zIndex:2,height:"auto",minHeight:"45px",padding:"0px 0px 1px 0px",width:"100%"},ref:ct,children:g.jsx(me,{userMemberListType:ot,onItemClick:tt?.onItemClick||(e=>{let t=[e];qe.current.setCometChatUserGroupMembers(t),qe.current.getCometChatUserGroupMembers(),qe.current.reRender(),Xe(!1),et(1),Ye("")}),usersRequestBuilder:st,searchKeyword:Je,subtitleView:tt?.subtitleView,disableUsersPresence:tt?.disableUsersPresence,avatarStyle:tt?.avatarStyle,listItemView:tt?.listItemView,statusIndicatorStyle:tt?.statusIndicatorStyle,userPresencePlacement:tt?.userPresencePlacement,hideSeparator:tt?.hideSeparator,loadingStateView:tt?.loadingStateView,onEmpty:dt,loadingIconUrl:tt?.loadingIconURL,group:l,groupMemberRequestBuilder:at,disableLoadingState:!0,onError:dt})}),X.showMentionsCountWarning&&g.jsx("div",{style:{height:"fit-content",position:"relative",width:"100%",boxSizing:"border-box",left:"50%",transform:"translate(-50%)",zIndex:1,padding:"0px 0px 1px 0px"},children:g.jsx("cometchat-icon-button",{text:W||n.localize("MENTIONS_LIMIT_WARNING_MESSAGE"),iconURL:_,buttonStyle:JSON.stringify(Xi(0,He,Z))})}),g.jsx("input",{ref:ee,type:"file",onChange:Ut,style:{display:"none"}}),g.jsx("div",{className:"cc-message-composer__header",style:{height:"fit-content",position:"relative",width:"100%",boxSizing:"border-box",left:"50%",transform:"translate(-50%)",zIndex:1,padding:"0px 0px 1px 0px"},children:T??Ht()}),g.jsxs(ja,{ref:$,text:X.addToMsgInputText,placeholderText:d,auxiliaryButtonAlignment:E,textInputStyle:qi(P,He),textFormatters:Ke,children:[g.jsx("div",{"data-slot":"primaryView",className:"cc-message-composer__primary-view",style:{display:"flex",gap:"6px"},children:g.jsxs(g.Fragment,{children:[jt(),Rt()?k?g.jsx(g.Fragment,{}):g.jsx("div",{className:"cc-message-composer__live-reaction-btn-wrapper",style:{},children:g.jsx("cometchat-button",{ref:ke,iconURL:F,hoverText:n.localize("LIVE_REACTION"),buttonStyle:JSON.stringify((Qt=P,{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:Qt?.liveReactionIconTint||"red",background:"transparent",padding:"0"}))})}):g.jsx(g.Fragment,{}),k?Pt():Rt()?g.jsx(g.Fragment,{}):Pt()]})}),g.jsx("div",{"data-slot":"secondaryView",className:"cc-message-composer__secondary-view",style:{flex:"1"},children:Ot()}),g.jsx("div",{"data-slot":"auxilaryView",className:"cc-message-composer__auxiliary-view",style:{display:"flex",flexDirection:"row",alignItems:"center",width:"fit-content",gap:"8px",padding:"0",marginRight:"8px"},children:Gt()})]})]},bt()?.group||bt()?.user)]});var Qt,Nt}const Qa=(e,t)=>({width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent50()}`,borderRadius:"inherit",background:t.palette.getBackground(),display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"row",padding:"8px",boxSizing:"border-box",...e}),Na=(e,t,o,r)=>t&&t.current?{textFont:o?.typingIndicatorTextFont||n.fontHelper(r.typography.subtitle2),textColor:o?.typingIndicatorTextColor||r.palette.getPrimary()}:{textFont:o?.subtitleTextFont||n.fontHelper(r.typography.subtitle2),textColor:o?.subtitleTextColor||r.palette.getAccent600()},Ka=e=>({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});const za=e=>({height:"24px",width:"24px",border:"none",borderRadius:"none",background:"transparent",buttonIconTint:e.palette.getPrimary()});var Ja="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";var Ya="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",_a="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Wa=e=>{const{theme:r}=t.useContext(U),{avatarStyle:i={},statusIndicatorStyle:a=null,messageHeaderStyle:l={},listItemStyle:c={},subtitleView:C=null,disableUsersPresence:d=!1,disableTyping:u=!1,protectedGroupIcon:p=Ya,passwordGroupIcon:h,privateGroupIcon:b=_a,menu:y=null,user:w,group:f,backButtonIconURL:D=Ja,hideBackButton:E,listItemView:v=null,onError:S,onBack:I=()=>{}}=e,[F,k]=t.useState(""),[T,M]=t.useState(null),B=m(w),L=m(f),R=m(I),[P,O]=A(null),j=t.useRef(!1),V=x(S),G=t.useCallback(()=>{const e=B.current,t=L.current;if(e)k(n.localize(e.getStatus().toUpperCase()));else if(t){const e=t.getMembersCount(),o=n.localize(e>1?"MEMBERS":"MEMBER");k(`${e} ${o}`)}},[B,L]),H=t.useCallback(e=>{const t=B.current;t&&(t.setStatus(e.getStatus()),k(t.getStatus()))},[B]),Q=t.useCallback(e=>{try{const t=e?.getSender(),o=e?.getReceiverId();if(t?.getUid()===B?.current?.getUid()&&T?.getUid()===o){if((new Z).getUserStatusVisible(B?.current))return;k(n.localize("IS_TYPING"))}L?.current?.getGuid()===o&&k(`${t?.getName()} ${n.localize("IS_TYPING")}`)}catch(e){V(e)}},[B,L,V,T]),N=t.useCallback(()=>{try{const e=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{L?.current?.getGuid()===e?.userAddedIn?.getGuid()&&(e?.usersAdded.length>0&&e?.usersAdded.forEach(e=>{e?.getUid()===T?.getUid()&&L?.current?.setHasJoined(!0)}),L?.current?.setMembersCount(e?.userAddedIn?.getMembersCount()),G())}),t=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{L?.current?.getGuid()===e?.kickedFrom?.getGuid()&&(T?.getUid()===e?.kickedUser?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.kickedFrom?.getMembersCount()),G())}),o=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{L?.current?.getGuid()===e?.joinedGroup?.getGuid()&&(T?.getUid()===e?.joinedUser?.getUid()&&L?.current?.setHasJoined(!0),L?.current?.setMembersCount(e?.joinedGroup?.getMembersCount()),G())}),r=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{L?.current?.getGuid()===e?.kickedFrom?.getGuid()&&(T?.getUid()===e?.kickedUser?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.kickedFrom?.getMembersCount()),G())}),s=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{L?.current?.getGuid()===e?.group?.getGuid()&&(L?.current?.setOwner(e?.group?.getOwner()),G())}),i=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{L?.current?.getGuid()===e?.leftGroup?.getGuid()&&(T?.getUid()===e?.userLeft?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.leftGroup?.getMembersCount()),G())});return()=>{try{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),r.unsubscribe(),s.unsubscribe(),i.unsubscribe()}catch(e){V(e)}}}catch(e){V(e)}},[L,G,V,T]),K=t.useCallback(()=>{const e="userList_"+Date.now(),t="groupsList_"+Date.now(),o="connection_"+Date.now();let r,i;return d||s.CometChat.addUserListener(e,new s.CometChat.UserListener({onUserOnline:e=>{B.current?.getUid()===e.getUid()&&H(e)},onUserOffline:e=>{B.current?.getUid()===e?.getUid()&&H(e)}})),u||(r=n.CometChatMessageEvents.onTypingStarted.subscribe(e=>{j.current=!0,Q(e)}),i=n.CometChatMessageEvents.onTypingEnded.subscribe(e=>{j.current=!1,G()})),s.CometChat.addGroupListener(t,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,n,o,r)=>{L.current?.getGuid()===r?.getGuid()&&t.getUid()===T?.getUid()&&L.current?.setScope(n),G()},onGroupMemberKicked:(e,t,n,o)=>{L.current?.getGuid()===o?.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(o?.getMembersCount()),G())},onMemberAddedToGroup:(e,t,n,o)=>{L.current?.getGuid()===o.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!0),L.current?.setMembersCount(o?.getMembersCount()),G())},onGroupMemberLeft:(e,t,n)=>{L.current?.getGuid()===n.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(n.getMembersCount()),G())},onGroupMemberJoined:(e,t,n)=>{L.current?.getGuid()===n.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!0),L.current?.setMembersCount(n.getMembersCount()),G())},onGroupMemberBanned:(e,t,n,o)=>{L.current?.getGuid()===o.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(o.getMembersCount()),G())}})),s.CometChat.addConnectionListener(o,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener => On Connected")}})),()=>{s.CometChat.removeUserListener(e),s.CometChat.removeGroupListener(t),s.CometChat.removeConnectionListener(o),r?.unsubscribe(),i?.unsubscribe()}},[B,L,H,u,G,Q,T,d]),z=t.useCallback(()=>{let e=(new Z).getUserStatusVisible(B.current);if(B.current){if(!d&&!e)return"#00f300"}else if(L.current){const e=L.current.getType();if(e===n.CometChatUIKitConstants.GroupTypes.private)return"#00f300";if(e===n.CometChatUIKitConstants.GroupTypes.password)return"#F7A500"}return null},[B,L,d]),J=t.useCallback(()=>{let e="";if(L.current)switch(L.current?.getType()){case n.CometChatUIKitConstants.GroupTypes.password:e=h||p;break;case n.CometChatUIKitConstants.GroupTypes.private:e=b;break;default:e=""}return e},[L,p,b,h]),Y=t.useCallback(()=>({...new o.AvatarStyle(Ka(r)),...i}),[i,r]),_=e=>{if(e instanceof s.CometChat.User){let t=(new Z).getUserStatusVisible(e);return d||t?null:function(e){const t=null!==e?e:{};return{...t,border:t?.border||"none",borderRadius:t?.borderRadius||"24px",height:t?.height||"12px",width:t?.width||"12px"}}(a)}return null},W=t.useCallback(()=>((e,t)=>new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||"transparent",borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||"",hoverBackground:e?.hoverBackground||"transparent",padding:e?.padding||"0"}))(c,r),[c,r]),X=t.useCallback(()=>{if(C)return C;return B.current?.getBlockedByMe()||B.current?.getHasBlockedMe()?null:g.jsx("div",{children:g.jsx("cometchat-label",{text:F,labelStyle:JSON.stringify(Na(B.current,j,l,r))})})},[B,C,F,r,l]),q=t.useCallback(()=>{if(v)return v;{let e=B.current||L.current;return g.jsx("cometchat-list-item",{avatarName:B.current?.getName()||L.current?.getName(),avatarURL:B.current?.getAvatar()||L.current?.getIcon(),listItemStyle:JSON.stringify(W()),statusIndicatorColor:z(),statusIndicatorIcon:J(),title:B.current?.getName()||L.current?.getName(),hideSeparator:!0,statusIndicatorStyle:JSON.stringify(_(e)),avatarStyle:JSON.stringify(Y()),style:{width:"100%"},children:g.jsx("div",{slot:"subtitleView",children:X()})})}},[B,L,v,X,Y,_,W,J,z]),$=t.useCallback(()=>y?g.jsx("div",{className:"cc-message-header__menu",style:{width:"fit-content",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:y}):null,[y]);return function(e,n,o,r,i,a,l,c,C,g){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{const t=[];return e&&(t.push(o()),t.push(r())),()=>{for(let e=0;e<t.length;e++)return t[e]()}},[e,r,o]),t.useEffect(()=>{if(!a)return;const e="cc-button-clicked",t=()=>l.current?.();return a.addEventListener(e,t),()=>{a.removeEventListener(e,t)}},[a,l]),t.useEffect(()=>{g()},[c.current,C.current,g])}(T,M,N,K,V,P,R,B,L,G),g.jsxs("div",{className:"cc-message-header__wrapper",style:Qa(l,r),children:[g.jsxs("div",{className:"cc-message-header",style:{display:"flex",alignItems:"center",justifyContent:"flex-start",height:"100%",width:"100%",boxSizing:"border-box",borderRadius:"inherit"},children:[E?null:g.jsx("div",{className:"cc-message-header__back-button",style:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"flex-start"},children:g.jsx("cometchat-button",{iconURL:D,buttonStyle:JSON.stringify(za(r)),ref:O})}),g.jsx("div",{className:"cc-message-header__listitem",style:{height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start"},children:q()})]}),$()]})},Za=ye({tagName:"cometchat-reactions",elementClass:r.CometChatReactions,react:t}),Xa=ye({tagName:"cometchat-emoji-keyboard",elementClass:o.CometChatEmojiKeyboard,events:{onEmojiClick:"cc-emoji-clicked"},react:t}),qa=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t,events:{buttonClick:"cc-button-clicked"}}),$a=ye({tagName:"cometchat-button",elementClass:o.CometChatButton,react:t,events:{buttonClick:"cc-button-clicked"}}),el=ye({tagName:"cometchat-date",elementClass:o.CometChatDate,react:t}),tl=ye({tagName:"cometchat-label",elementClass:o.CometChatLabel,react:t}),nl=ye({tagName:"cometchat-loader",elementClass:o.CometChatLoader,react:t}),ol=ye({tagName:"cometchat-avatar",elementClass:o.CometChatAvatar,react:t}),rl=ye({tagName:"cometchat-receipt",elementClass:o.CometChatReceipt,react:t}),sl=(e,t)=>({height:"100%",width:"100%",flex:"1 1 0",order:"2",position:"relative",display:"flex",flexDirection:"column",border:`1px solid ${t.palette.getAccent50()}`,borderRadius:"inherit",background:t.palette.getBackground(),...e}),il=(e,t,o,r={},s)=>{const i={height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:r.threadReplyIconTint||t.palette.getAccent600(),display:"flex",alignItems:"center",gap:"5px",buttonTextColor:r?.threadReplyTextColor||t.palette.getAccent(),buttonTextFont:r?.threadReplyTextFont||n.fontHelper(t.typography.text2),iconHeight:"15px",iconWidth:"15px"};return e.getSender()&&e.getSender().getUid()!==o?.getUid()||s==n.MessageBubbleAlignment.left?{...i,flexFlow:"row"}:{...i,flexFlow:"row-reverse"}},al=e=>({height:"fit-content",width:"fit-content",background:e.palette.getPrimary(),display:"flex",justifyContent:"center",buttonTextFont:n.fontHelper(e.typography.text2),buttonTextColor:e.palette.getAccent("dark"),border:"none",borderRadius:"12px",padding:"2px 6px"}),ll=(e,t,o,s)=>{const i={background:"transparent",borderRadius:"12px"},a={background:t.palette.getSecondary(),borderRadius:"12px"};return e.getDeletedAt()?{...i}:e?.getType()!==n.CometChatUIKitConstants.calls.meeting||e?.getSender()&&e?.getSender().getUid()!==s?.getUid()?e?.getType()===r.StickersConstants.sticker?i:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.text||e.getSender()&&s?.getUid()!==e.getSender().getUid()?e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.audio?e.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember||e.getCategory()===n.CometChatUIKitConstants.MessageCategory.call?{...i,border:`1px solid ${t.palette.getSecondary()}`}:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.interactive?a:{...a,width:"300px"}:{...a,borderRadius:""}:{...a,background:o===n.MessageListAlignment.left?t.palette.getSecondary():t.palette.getPrimary()}:{...a,background:t.palette.getPrimary(),border:"none"}},cl=(e,t)=>{const r=t?.getType()===n.CometChatUIKitConstants.MessageTypes.text;return new o.ReceiptStyle({waitIconTint:e.palette.getAccent700(),sentIconTint:e.palette.getAccent600(),deliveredIconTint:e.palette.getAccent600(),readIconTint:r?e.palette.getBackground():e.palette.getPrimary(),errorIconTint:e.palette.getError(),height:"11px",width:"12px",background:"none"})},Cl=(e,t,o,r)=>{const s={display:"flex",alignItems:"end",padding:"1px 8px 8px",gap:"4px",marginTop:"0"};return e?{...s,justifyContent:"center",height:"fit-content",borderRadius:"22px",padding:"3px 5px",paddingTop:"2px",position:"relative",marginTop:"-22px",marginRight:"12px",background:t.palette.getAccent500("dark"),width:"fit-content"}:(o?.getType()===n.CometChatUIKitConstants.MessageTypes.text&&(s.padding="0px 8px 8px",s.marginTop=r===n.MessageBubbleAlignment.right?"-6px":"-5px"),s)},gl=e=>{let t="center";return e===n.MessageBubbleAlignment.right?t="flex-end":e===n.MessageBubbleAlignment.left&&(t="flex-start"),{display:"flex",justifyContent:t,width:"100%",boxSizing:"border-box"}},dl=(e,t)=>({textColor:e?.TimestampTextColor||t.palette.getAccent600(),textFont:e?.TimestampTextFont||n.fontHelper(t.typography.caption3),padding:"0",display:"block"}),ul=(e,t)=>{const o={...hl(e),...t};return{textFont:o?.nameTextFont||n.fontHelper(e.typography.caption2),textColor:o?.nameTextColor||e.palette.getAccent600()}},pl=(e,t)=>new o.DateStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle2),textColor:e?.textColor||t.palette.getAccent600(),background:e?.background||"inherit",height:e?.height||"100%",width:e?.width||"100%",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||"8px"}),hl=e=>new r.MessageListStyle({background:e.palette.getBackground(),border:"none",emptyStateTextFont:n.fontHelper(e.typography.title1),emptyStateTextColor:e.palette.getAccent600(),errorStateTextFont:n.fontHelper(e.typography.title1),errorStateTextColor:e.palette.getAccent600(),loadingIconTint:e.palette.getAccent600(),nameTextFont:n.fontHelper(e.typography.caption2),nameTextColor:e.palette.getAccent600(),threadReplyTextFont:n.fontHelper(e.typography.subtitle1),threadReplyIconTint:e.palette.getAccent600(),threadReplyTextColor:e.palette.getAccent600(),TimestampTextFont:n.fontHelper(e.typography.caption2),TimestampTextColor:e.palette.getAccent600()}),ml=(e,t)=>({iconTint:{...hl(t),...e}.loadingIconTint}),Al=(e,t)=>{const n={...hl(t),...e};return{textFont:n.errorStateTextFont,textColor:n.errorStateTextColor}},xl=(e,t)=>({...new o.AvatarStyle({borderRadius:"24px",width:"28px",height:"28px",border:"none",backgroundColor:t.palette.getAccent700(),nameTextColor:t.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:"0",outerViewBorderRadius:"0",outerViewBorderColor:"",outerViewBorderSpacing:"0"}),...e}),bl=e=>{let t="center";return e===n.MessageBubbleAlignment.right?t="flex-end":e===n.MessageBubbleAlignment.left&&(t="flex-start"),{display:"flex",justifyContent:t,width:"100%",marginBottom:"16px"}},yl={padding:"0px 0px 0px 15px",overflow:"hidden",display:"flex",justifyContent:"flex-end",marginRight:"8px",boxSizing:"border-box"},wl=e=>({width:"100%",padding:"5px 0px",boxSizing:"border-box",display:"flex",marginTop:"-9px",justifyContent:e===n.MessageBubbleAlignment.left?"flex-start":"flex-end"});function fl(e){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e.palette.getPrimary(),background:"transparent",position:"absolute",top:"20px",right:"16px"}}const Dl=e=>({height:"1px",width:"100%",background:e.palette.getAccent100()});function El(e){return new o.ReceiptStyle({deliveredIconTint:e.palette.getAccent600(),readIconTint:e.palette.getPrimary(),errorIconTint:e.palette.getError(),height:"20px",width:"20px"})}const vl=(e,t)=>{let r=e;return r={...new o.DateStyle({textFont:n.fontHelper(t.typography.caption2),textColor:t.palette.getAccent600(),background:t.palette.getAccent100(),height:"100%",width:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"8px"}),...r},r.background=r.background||t.palette.getAccent600(),r},Sl={background:"transparent",height:"",width:"",border:"none",borderRadius:"none"},Il={marginLeft:"auto"},Fl={display:"flex"},kl={width:"100%"},Tl=(e,t)=>({...{width:"360px",height:"620px",margin:"0 auto",background:e.palette.getBackground(),borderRadius:"12px",overflow:"hidden",boxSizing:"border-box"},...t}),Ml=e=>({marginTop:"8px",marginBottom:"8px",marginLeft:"10px",fontSize:n.fontHelper(e.typography.subtitle2),fontWeight:"500",color:e.palette.getAccent600(),display:"flex"}),Bl=e=>({marginBottom:"8px",marginLeft:"10px",fontSize:n.fontHelper(e.typography.subtitle2),fontWeight:"500",color:e.palette.getAccent600(),display:"flex"});var Ll="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ul="data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E";const Rl=e=>{const{theme:i}=t.useContext(U),{title:a=n.localize("MESSAGE_INFORMATION"),closeIconURL:l,onClose:c,message:C,bubbleView:d,subtitleView:u=null,listItemView:p=null,messageInformationStyle:h,listItemStyle:m,receiptDatePattern:A,template:x,loadingIconURL:b=Ll,backdropStyle:y=new o.BackdropStyle({})}=e,[w,f]=t.useState(),[D,E]=t.useState(x),[v,S]=t.useState([]),I=t.useRef(null),F=()=>({...new o.ListItemStyle({height:"70px",width:"100%",background:"inherit",borderRadius:"0",titleFont:n.fontHelper(i.typography.title2),titleColor:i.palette.getAccent(),border:"none",separatorColor:i.palette.getAccent200(),hoverBackground:i.palette.getAccent50()}),...m});async function T(e){if(e?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group){let t=await s.CometChat.getMessageReceipts(e?.getId()),n=t.filter(e=>e.getSender().getUid()!==I.current?.getUid());return S(n),t}}t.useEffect(()=>{if(!x){const t=Zn.getDataSource()?.getMessageTemplate(e.message?.getType(),e.message?.getCategory(),i);t&&E(t)}},[e.message,x,i]);const B=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(e=>{L(e)}),t=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(e=>{L(e)});return()=>{try{e?.unsubscribe(),t?.unsubscribe()}catch(e){console.log(e)}}}catch(e){console.log(e)}},[]),L=t.useCallback(e=>{try{C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&T(C)}catch(e){console.log(e)}},[]);t.useEffect(()=>{const e=B();return()=>{e?.()}},[]),t.useEffect(()=>{C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&f(C.getReceiver()),C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&T(C)},[C]);const R=t.useCallback(()=>{if(r.CometChatUIKitLoginListener.getLoggedInUser()&&(I.current=r.CometChatUIKitLoginListener.getLoggedInUser()),C){if(d)return d(C);{if(!D)return g.jsx(g.Fragment,{});const e=(new Z).messageBubbleStyle(C,i,n.MessageBubbleAlignment.right,I.current);return(new Z).getMessageBubble(C,D,e,n.MessageBubbleAlignment.right)}}return null},[C,d,D,i]);function P(e,t){return null!==u&&"function"==typeof u?g.jsx(g.Fragment,{children:u(C)}):g.jsx("div",{style:kl,children:g.jsx("div",{className:"cc-receipts__subtitle",children:O(e,t)})})}function O(e,t){return g.jsxs("div",{className:"cc-message_information__receipt-container",children:[g.jsxs("div",{className:"cc-message_information__receipt",style:Fl,children:[g.jsx("div",{className:"cc-message_information__delivered-receipt",children:g.jsx("cometchat-receipt",{receipt:n.Receipts.delivered,errorIcon:Ul,deliveredIcon:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",receiptStyle:JSON.stringify(El(i))})}),g.jsx("div",{style:j,className:"cc_message-information__subtitle-text",children:void 0!==e&&n.localize("DELIVERED")}),g.jsx("div",{className:"cc_message-information__date",style:Il,children:g.jsx("cometchat-date",{timestamp:e,customDateString:A?A(e):null,pattern:A?null:n.DatePatterns.DateTime,dateStyle:JSON.stringify(vl(Sl,i))})})]}),t&&g.jsxs("div",{className:"cc-message_information__receipt",style:Fl,children:[g.jsx("div",{className:"cc-message_information__read-receipt",children:g.jsx("cometchat-receipt",{receipt:n.Receipts.read,errorIcon:Ul,readIcon:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",receiptStyle:JSON.stringify(El(i))})}),g.jsx("div",{style:j,className:"cc_message-information__subtitle-text",children:void 0!==t&&n.localize("READ")}),void 0!==t&&g.jsx("div",{className:"cc_message-information__date",style:Il,children:g.jsx("cometchat-date",{timestamp:t,customDateString:A?A(t):null,pattern:A?null:n.DatePatterns.DateTime,dateStyle:JSON.stringify(vl(Sl,i))})}),void 0===t&&g.jsx("div",{className:"cc_message-information__date",style:Il,children:"..."})]})]})}const j={font:n.fontHelper(i.typography.subtitle2),color:i.palette.getAccent600()},V=new o.AvatarStyle({borderRadius:"50%",width:"43px",height:"43px"});function G(e){return g.jsx(M,{id:e.getMessageId(),title:e.getSender()?.getName(),avatarURL:e.getSender()?.getAvatar(),avatarName:e.getSender()?.getName(),hideSeparator:!1,isActive:!1,avatarStyle:V,listItemStyle:F(),subtitleView:P(e.getDeliveredAt(),e.getReadAt()),subtitleViewClassName:"cc-message_information__subtitle-view",tailViewClassName:"cc-receipt-details__tail-view"})}return g.jsx("div",{className:"cc__messageinfo__wrapper",style:kl,children:g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify((Q=y,{background:"rgba(0, 0, 0, 0.5)",position:"absolute",width:Q?.width,height:Q?.height,...Q})),children:g.jsxs("div",{className:"cc__messageinfo",style:Tl(i,h),children:[g.jsxs("div",{className:"cc__messageinfo__header",style:{textAlign:"center",fontSize:"22px",fontWeight:"700",padding:"19px 0px",position:"relative"},children:[g.jsxs("div",{className:"cc__messageinfo__title",children:[" ",a," "]}),g.jsx(J,{iconURL:l,hoverText:n.localize("CLOSE"),buttonStyle:fl(i),onClick:c})]}),g.jsxs("div",{className:"cc__messageinfo__content",style:kl,children:[g.jsx("div",{style:Bl(i),children:n.localize("MESSAGE")}),g.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Dl(i))}),g.jsx("div",{className:"cc__messageinfo__bubble-wrapper",style:(H=!d,{height:"fit-content",maxHeight:"182px",overflow:"hidden auto",boxSizing:"border-box",padding:"2px 8px",justifyContent:"flex-end",display:H?"flex":"inherit",paddingRight:H?"16px":"8px"}),children:R()}),g.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Dl(i))}),g.jsx("div",{style:Ml(i),children:n.localize("RECEIPT_INFORMATION")}),g.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Dl(i))}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&void 0!==C.getDeliveredAt()&&g.jsx("div",{children:g.jsx(M,{id:C.getConversationId(),title:w?.getName(),avatarURL:w?.getAvatar(),avatarName:w?.getName(),hideSeparator:!1,isActive:!1,avatarStyle:V,listItemStyle:F(),subtitleView:P(C.getDeliveredAt(),C.getReadAt()),subtitleViewClassName:"cc-message_information__subtitle-view",tailViewClassName:"cc-receipt-details__tail-view"})}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&void 0===C.getDeliveredAt()&&g.jsxs("div",{style:{padding:"2em 0px 0px 0px",fontSize:"18px",textAlign:"center",color:i.palette.getAccent400()},children:[" ",n.localize("NO_RECIPIENT")," "]}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&v.length>0&&g.jsx("div",{children:g.jsx(k,{list:v,listItem:function(e){return g.jsx(g.Fragment,{children:p?p(C,e):G(e)})},state:0===v.length?n.States.loading:n.States.loaded,hideSearch:!0,showSectionHeader:!1,loadingIconURL:b})}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&v.length<=0&&g.jsxs("div",{style:{padding:"2em 0px 0px 0px",fontSize:"18px",textAlign:"center",color:i.palette.getAccent400()},children:[" ",n.localize("NO_RECIPIENTS")," "]})]})]})})});var H,Q};var Pl;class Ol{constructor(e,t,n,o,r){if(this.messagesRequest=null,this.fetchNextMessages=()=>this.messagesRequest?.fetchNext(),this.fetchPreviousMessages=()=>this.messagesRequest?.fetchPrevious(),e){let r;t?(e.guid=void 0,r=e.setUID(t.getUid())):n&&(e.uid=void 0,r=e.setGUID(n.getGuid())),o&&r.setMessageId(o),this.messagesRequest=r.build()}else{const e=(new s.CometChat.MessagesRequestBuilder).setTypes(Be.dataSource.getAllMessageTypes()).setCategories(Be.dataSource.getAllMessageCategories()).hideReplies(!0).setLimit(30);o&&e.setMessageId(o),r&&e.setParentMessageId(r),t?(e.setUID(t.getUid()),e.guid=void 0):n&&(e.setGUID(n.getGuid()),e.uid=void 0),this.messagesRequest=e.build()}}static removeListeners(){s.CometChat.removeGroupListener(this.groupListenerId),s.CometChat.removeConnectionListener(this.connectionListenerId),Be.names.includes("calling")&&s.CometChat.removeCallListener(this.callListenerId)}static attachConnectionListener(e){const t="MessageList_connection_"+String(Date.now());s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}}))}}Pl=Ol,Ol.groupListenerId="group_"+(new Date).getTime(),Ol.callListenerId="call_"+(new Date).getTime(),Ol.connectionListenerId="MessageList_connection_"+String(Date.now()),Ol.attachListeners=e=>{s.CometChat.addGroupListener(Pl.groupListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(t,o,r,s,i)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,i)},onGroupMemberKicked:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberBanned:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberUnbanned:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onMemberAddedToGroup:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberLeft:(t,o,r)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,r)},onGroupMemberJoined:(t,o,r)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,r)}})),Be.names.includes("calling")&&s.CometChat.addCallListener(Pl.callListenerId,new s.CometChat.CallListener({onIncomingCallReceived:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onIncomingCallCancelled:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onOutgoingCallRejected:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onOutgoingCallAccepted:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onCallEndedMessageReceived:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)}}))};const jl={parentMessageId:0,user:void 0,group:void 0,emptyStateText:n.localize("NO_MESSAGES_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),emptyStateView:null,errorStateView:null,loadingStateView:null,disableReceipt:!1,hideReceipt:!1,disableSoundForMessages:!1,customSoundForMessages:"",readIcon:"data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2212%22%20viewBox%3D%220%200%2014%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20opacity%3D%220.8%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.15147%203.15262C9.32528%202.93804%209.29224%202.62319%209.07766%202.44938C8.86308%202.27557%208.54822%202.30861%208.37441%202.52319L3.61414%208.39998L1.626%206.42494C1.4301%206.23032%201.11352%206.23137%200.918901%206.42727C0.724285%206.62318%200.725331%206.93976%200.921238%207.13438L3.30197%209.49942C3.40229%209.59908%203.54012%209.6516%203.68131%209.64398C3.82251%209.63635%203.95388%209.5693%204.04289%209.45942L9.15147%203.15262ZM13.0814%203.16663C13.263%202.95855%2013.2415%202.6427%2013.0334%202.46115C12.8253%202.27961%2012.5095%202.30111%2012.3279%202.50919L7.17358%208.41667L6.74794%207.99934C6.55077%207.80601%206.2342%207.80912%206.04087%208.0063C5.84754%208.20348%205.85066%208.52004%206.04783%208.71337L6.85187%209.50172C6.95016%209.59809%207.08383%209.64968%207.22138%209.64433C7.35892%209.63897%207.48818%209.57715%207.57868%209.47343L13.0814%203.16663Z%22%20fill%3D%22%239C9CA3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deliveredIcon:"data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2212%22%20viewBox%3D%220%200%2014%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20opacity%3D%220.8%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.15147%203.15262C9.32528%202.93804%209.29224%202.62319%209.07766%202.44938C8.86308%202.27557%208.54822%202.30861%208.37441%202.52319L3.61414%208.39998L1.626%206.42494C1.4301%206.23032%201.11352%206.23137%200.918901%206.42727C0.724285%206.62318%200.725331%206.93976%200.921238%207.13438L3.30197%209.49942C3.40229%209.59908%203.54012%209.6516%203.68131%209.64398C3.82251%209.63635%203.95388%209.5693%204.04289%209.45942L9.15147%203.15262ZM13.0814%203.16663C13.263%202.95855%2013.2415%202.6427%2013.0334%202.46115C12.8253%202.27961%2012.5095%202.30111%2012.3279%202.50919L7.17358%208.41667L6.74794%207.99934C6.55077%207.80601%206.2342%207.80912%206.04087%208.0063C5.84754%208.20348%205.85066%208.52004%206.04783%208.71337L6.85187%209.50172C6.95016%209.59809%207.08383%209.64968%207.22138%209.64433C7.35892%209.63897%207.48818%209.57715%207.57868%209.47343L13.0814%203.16663Z%22%20fill%3D%22%239C9CA3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",sentIcon:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2016%2016%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F16%2FMessage%20Sent%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F16%2FMessage-Sent%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M11.1282564%2C3.43708984%20C11.3839897%2C3.0108676%2011.9368239%2C2.87265904%2012.3630462%2C3.12839238%20C12.7564821%2C3.36445393%2012.9045099%2C3.85366653%2012.7238142%2C4.26276853%20L12.6717436%2C4.3631822%20L7.87174363%2C12.3631822%20C7.59058211%2C12.8317847%206.96826751%2C12.9373278%206.54992747%2C12.6127032%20L6.4636039%2C12.5365321%20L3.2636039%2C9.33653212%20C2.91213203%2C8.98506026%202.91213203%2C8.41521177%203.2636039%2C8.06373991%20C3.58578644%2C7.74155737%204.091466%2C7.71470883%204.44423138%2C7.98319428%20L4.5363961%2C8.06373991%20L6.921%2C10.448136%20L11.1282564%2C3.43708984%20Z%22%20id%3D%22Style%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",waitIcon:"data:image/svg+xml,%3Csvg%20width%3D%2225%22%20height%3D%2224%22%20viewBox%3D%220%200%2025%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.01057%208.04728C8.34753%209.99213%209.53177%2011.3242%2011.6239%2012C13.716%2011.3242%2014.9002%209.99213%2015.2372%208.04728C15.2572%207.91731%2015.2488%207.78455%2015.2125%207.65816C15.1762%207.53177%2015.1129%207.41476%2015.027%207.3152C14.9411%207.21564%2014.8346%207.1359%2014.7149%207.08149C14.5952%207.02707%2014.4651%206.99928%2014.3336%207.00001H8.9142C8.7827%206.99928%208.65261%207.02707%208.5329%207.08149C8.41319%207.1359%208.30671%207.21564%208.2208%207.3152C8.1349%207.41476%208.07161%207.53177%208.03532%207.65816C7.99902%207.78455%207.99058%207.91731%208.01057%208.04728Z%22%20fill%3D%22%23808080%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.91423%2017C8.78279%2017.0007%208.65276%2016.9729%208.5331%2016.9185C8.41343%2016.8642%208.30699%2016.7845%208.22109%2016.685C8.1352%2016.5855%208.0719%2016.4686%208.03556%2016.3423C7.99922%2016.2159%207.9907%2016.0832%208.01059%2015.9533C8.34756%2014.0085%209.5318%2012.6764%2011.6239%2012C13.716%2012.6764%2014.9003%2014.0085%2015.2372%2015.9533C15.2571%2016.0832%2015.2486%2016.2159%2015.2123%2016.3423C15.1759%2016.4686%2015.1126%2016.5855%2015.0267%2016.685C14.9408%2016.7845%2014.8344%2016.8642%2014.7147%2016.9185C14.5951%2016.9729%2014.465%2017.0007%2014.3336%2017H8.91423Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",errorIcon:"data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E",loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",alignment:n.MessageListAlignment.standard,showAvatar:!0,datePattern:n.DatePatterns.time,timestampAlignment:n.TimestampAlignment.bottom,DateSeparatorPattern:n.DatePatterns.DayDate,hideDateSeparator:!1,templates:[],messagesRequestBuilder:void 0,newMessageIndicatorText:"",scrollToBottomOnNewMessages:!1,thresholdValue:1e3,onThreadRepliesClick:()=>{},headerView:null,footerView:null,avatarStyle:{borderRadius:"24px",width:"36px",height:"36px"},dateSeparatorStyle:void 0,messageListStyle:{nameTextFont:"600 15px Inter, sans-serif",nameTextColor:"white",TimestampTextFont:"",TimestampTextColor:"",threadReplyTextFont:"",threadReplyIconTint:"",threadReplyTextColor:"",emptyStateTextFont:"700 22px Inter, sans-serif",emptyStateTextColor:"#bcbcbc",errorStateTextFont:"700 22px Inter, sans-serif",errorStateTextColor:"#bcbcbc",loadingIconTint:"grey"},onError:e=>{console.log(e)},hideError:!1,messageInformationConfiguration:new r.MessageInformationConfiguration({}),reactionsConfiguration:new r.ReactionsConfiguration({}),disableReactions:!1,emojiKeyboardStyle:{},threadIndicatorIcon:"data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10800_33104%29%22%3E%3Cpath%20d%3D%22M13.9906%201.69617C13.824%204.12358%2012.7401%206.39667%2010.959%208.05423C9.17776%209.71179%206.83266%2010.6296%204.39955%2010.6215C4.23748%2010.6215%203.84965%2010.6297%203.68799%2010.6215H1.03645%22%20stroke%3D%22%23A1A5AC%22%20stroke-width%3D%221.875%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.2041%207.43042L1.0094%2010.6251L4.2041%2013.8198%22%20stroke%3D%22%23A1A5AC%22%20stroke-width%3D%221.875%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10800_33104%22%3E%3Crect%20width%3D%2215%22%20height%3D%2215%22%20fill%3D%22white%22%20transform%3D%22matrix%28-1%200%200%201%2015%200%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",disableMentions:!1,textFormatters:[],backdropStyle:new o.BackdropStyle({})},Vl=e=>{const{parentMessageId:i,user:a,group:l,emptyStateText:c,errorStateText:C,emptyStateView:d,errorStateView:u,loadingStateView:p,disableReceipt:h,hideReceipt:A,disableSoundForMessages:b,customSoundForMessages:y,readIcon:w,deliveredIcon:f,sentIcon:D,waitIcon:E,errorIcon:v,loadingIconURL:S,alignment:I,showAvatar:F,datePattern:T,timestampAlignment:M,DateSeparatorPattern:B,hideDateSeparator:L,templates:R,messagesRequestBuilder:P,newMessageIndicatorText:O,scrollToBottomOnNewMessages:j,thresholdValue:V,onThreadRepliesClick:G,headerView:H,footerView:Q,avatarStyle:N,dateSeparatorStyle:K,messageListStyle:z,onError:J,hideError:Y,messageInformationConfiguration:_,reactionsConfiguration:Z,disableReactions:X,emojiKeyboardStyle:q,threadIndicatorIcon:$,disableMentions:ee,textFormatters:te,backdropStyle:ne}={...jl,...e},[oe,re]=t.useState([]),[se,ie]=t.useState(!0),[ae,le]=t.useState(n.States.loading),[ce,Ce]=t.useState(!1),[ge,de]=t.useState(!1),[ue,pe]=t.useState(null),[he,me]=t.useState(!1),[Ae,xe]=t.useState(null),[be,ye]=t.useState(!1),[we,fe]=t.useState(!1),[De,Ee]=t.useState(!1),ve=t.useRef(null),Se=t.useRef(null),Ie=t.useRef(!1),Fe=t.useRef({}),ke=t.useRef(null),Te=t.useRef({prevMessageId:0,nextMessageId:0}),Me=t.useRef(0),Le=t.useRef([]),Ue=t.useRef(""),Re=t.useRef(null),Pe=m(a),Oe=m(l),je=m(i),Ve=t.useRef(null),Ge=t.useRef(null),He=t.useRef(!1),Qe=t.useRef(!1),Ne=t.useRef(!1),{theme:Ke}=t.useContext(U),ze=x(J);let Je=!0,Ye=n.TimestampAlignment,_e=!1,We=n.MessageBubbleAlignment.left;const Ze=t.useMemo(()=>p?g.jsx("div",{className:"cc__messagelist__loadingview",children:g.jsx("span",{className:"cc__messagelist__customview--loading",children:p})}):g.jsx("div",{className:"cc__messagelist__loadingview",children:g.jsx(nl,{iconURL:S,loaderStyle:ml(z,Ke)})}),[p,S,z,Ke]),Xe=t.useMemo(()=>u?g.jsx("div",{className:"cc__messagelist__errorview",children:g.jsx("span",{className:"cc__messagelist__customview--error",children:u})}):g.jsx("div",{className:"cc__messagelist__errorview",children:g.jsx(tl,{labelStyle:Al(z,Ke),text:C})}),[u,C,z,Ke]),qe=t.useMemo(()=>d?g.jsx("div",{className:"cc__messagelist__emptyview",children:g.jsx("span",{className:"cc__messagelist__customview--empty",children:d})}):void 0,[d,c,z,Ke]),$e=t.useMemo(()=>R&&R.length>0?R:Be.getDataSource().getAllMessageTemplates(Ke,{disableMentions:ee,textFormatters:te}),[R,Ke]),et=t.useMemo(()=>{let e={};return $e.forEach(t=>{e[t.category+"_"+t.type]=t}),e},[$e]),tt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType();if(!je.current){if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&t===Pe.current.getUid())return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===je.current)return!0},[]),nt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getSender()?.getUid();if(je.current)return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current.getUid()||r===Pe.current.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1},[]),ot=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getSender()?.getUid();if(!je.current){if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current.getUid()||r===Pe.current.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===je.current)return!0},[]),rt=t.useCallback(e=>{if(!e.getParentMessageId())return!1;const t=e?.getReceiverId();if(Pe.current){if(t===Pe.current.getUid())return!0}else if(Oe.current&&t===Oe.current.getGuid())return!0;return!1},[]),st=t.useCallback(e=>{if(!e.getParentMessageId())return!1;const t=e?.getReceiverId(),n=e?.getSender()?.getUid();if(Pe.current){if(t===Pe.current.getUid()||n===Pe.current.getUid())return!0}else if(Oe.current&&t===Oe.current.getGuid())return!0;return!1},[]),it=t.useCallback(e=>{try{return oe.find(t=>t?.getId()?.toString()===e?.toString())}catch(e){ze(e)}},[oe,ze]),at=t.useCallback(e=>{try{Qe.current=!1,ie(!1),G&&G(e,Bn)}catch(e){ze(e)}},[G,ze,Qe]),lt=t.useCallback(e=>{void 0!==e&&(Qe.current=e)},[Qe]),ct=t.useCallback(e=>{try{re(t=>t.map(t=>t.getMuid()===e.getMuid()?e:t))}catch(e){ze(e)}},[ze]),Ct=t.useCallback(e=>{try{ie(!1),re(t=>t.map(t=>t?.getId()===e?.getId()?e:t))}catch(e){ze(e)}},[ze]),gt=t.useCallback(e=>{try{ot(e)&&Ct(e)}catch(e){ze(e)}},[Ct,ze,ot]),dt=t.useCallback((e,t=!1)=>{try{t?(ie(!0),ct(e)):(ie(!1),Ct(e))}catch(e){ze(e)}},[ct,Ct,ze]),ut=t.useCallback((e,t)=>{const n=t?.getId(),o=it(n),i=o?.getReactions()||[],a=i?.find(t=>t?.reaction===e);if(a&&a?.getReactedByMe()){const t=[];i.forEach(n=>{if(n?.getReaction()===e){if(1===n?.getCount())return;n.setCount(n?.getCount()-1),n.setReactedByMe(!1),t.push(n)}else t.push(n)});const a=r.CometChatUIKitUtility.clone(o);a.setReactions(t),dt(a),s.CometChat.removeReaction(n,e).then(e=>{}).catch(e=>{dt(o),console.log(e)})}else{const t=[],a=i.find(t=>t?.getReaction()===e);if(i.forEach(n=>{n?.getReaction()===e?(n.setCount(n?.getCount()+1),n.setReactedByMe(!0),t.push(n)):t.push(n)}),!a){const n=new s.CometChat.ReactionCount(e,1,!0);t.push(n)}const l=r.CometChatUIKitUtility.clone(o);l.setReactions(t),dt(l),s.CometChat.addReaction(n,e).then(()=>{}).catch(e=>{ze(e),dt(o)})}},[it,ze,dt]),pt=t.useCallback(e=>{let t={zIndex:"100"},n=q,r=new o.EmojiKeyboardStyle({width:n?.width||"320px",height:n?.height||"300px",border:n?.border||"1px solid #e0e0e0",borderRadius:n?.borderRadius||"8px",activeIconTint:n?.activeIconTint,background:n?.background,iconTint:n?.iconTint,textColor:n?.textColor,textFont:n?.textFont});const s=it(e);return e=>g.jsx(Xa,{emojiKeyboardStyle:r,style:t,onEmojiClick:t=>{e(t),ut(t?.detail?.id,s)}})},[q,it,ut]),ht=t.useCallback(e=>{try{let t=it(e);if(t){let e=t.getText();!ee&&t.getMentionedUsers()&&t.getMentionedUsers().length&&(e=(e=>{const t=/<@uid:(.*?)>/g;let n=e.getText(),o=e.getText(),r=t.exec(n),s=e.getMentionedUsers();for(;null!==r;){let e;for(let t=0;t<s.length;t++)r[1]===s[t].getUid()&&(e=s[t]);e&&(o=o.replace(r[0],"@"+e.getName())),r=t.exec(n)}return o})(t)),navigator?.clipboard?.writeText(e)}}catch(e){ze(e)}},[it,ze]),mt=t.useCallback(e=>{try{let t=it(e);t&&(Qe.current=!1,ie(!1),pe(t),de(!0))}catch(e){ze(e)}},[ze,Qe,it]),At=t.useCallback(e=>{try{let t=it(e);t&&at(t)}catch(e){ze(e)}},[at,ze,it]),xt=t.useCallback(e=>{try{const t=it(e);if(t){const e=t.getSender();n.CometChatUIEvents.ccOpenChat.next({user:e})}}catch(e){ze(e)}},[it,ze]),bt=t.useCallback(e=>{try{let t=it(e);if(t){const e=t.getId();s.CometChat.deleteMessage(e).then(e=>{gt(e),n.CometChatMessageEvents.ccMessageDeleted.next(e)},e=>{ze(e)})}}catch(e){ze(e)}},[gt,ze,it]),yt=t.useCallback(e=>{try{let t=it(e);t&&n.CometChatMessageEvents.ccMessageEdited.next({message:t,status:n.MessageStatus.inprogress})}catch(e){ze(e)}},[ze,it]),wt=t.useCallback((e,t)=>{try{return e.forEach(e=>{switch(e.id){case n.CometChatUIKitConstants.MessageOption.deleteMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=bt);break;case n.CometChatUIKitConstants.MessageOption.editMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=yt);break;case n.CometChatUIKitConstants.MessageOption.copyMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=ht);break;case n.CometChatUIKitConstants.MessageOption.replyInThread:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=At);break;case n.CometChatUIKitConstants.MessageOption.messageInformation:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=mt);break;case n.CometChatUIKitConstants.MessageOption.sendMessagePrivately:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=xt);break;case n.CometChatUIKitConstants.MessageOption.reactToMessage:e instanceof n.CometChatActionsView&&!e?.customView&&(e.customView=pt(t))}}),e}catch(t){return ze(t),e}},[ze,bt,yt,At,ht,mt,xt,pt]),ft=t.useCallback(e=>X?e.filter(e=>e.id!==n.CometChatUIKitConstants.MessageOption.reactToMessage):e,[X]),Dt=t.useCallback(e=>{let t=[];if(!e.getId())return t;try{return $e&&$e.length>0&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&$e.forEach(n=>{n.type===e.getType()&&n.category===e.getCategory()&&(t=wt(n?.options?.(Se.current,e,Ke,Oe.current),e?.getId()))}),t=ft(t),t}catch(e){return ze(e),t}},[$e,ft,wt,Ke,ze]),Et=t.useCallback(e=>{let t=n.MessageBubbleAlignment.center;try{return t=I===n.MessageListAlignment.left&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember?n.MessageBubbleAlignment.left:e?.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember||e?.getCategory()==n.CometChatUIKitConstants.MessageCategory.call?n.MessageBubbleAlignment.center:!e.getSender()||e?.getSender().getUid()===Se.current?.getUid()&&e?.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember?n.MessageBubbleAlignment.right:n.MessageBubbleAlignment.left,t}catch(e){return ze(e),t}},[I,ze]),vt=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.contentView?et[e?.getCategory()+"_"+e?.getType()]?.contentView(e,t):null}catch(e){return ze(e),null}},[et,ze,Et]),St=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.bottomView?et[e?.getCategory()+"_"+e?.getType()]?.bottomView(e,t):null}catch(e){return ze(e),null}},[et,ze,Et]),It=t.useCallback(e=>{try{let t=null;return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.headerView&&(t=et[e?.getCategory()+"_"+e?.getType()]?.headerView(e)),t}catch(e){return ze(e),null}},[et,ze]),Ft=t.useCallback(e=>{try{let t=null;return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.footerView&&(t=et[e?.getCategory()+"_"+e?.getType()]?.footerView(e)),t}catch(e){return ze(e),null}},[et,ze]),kt=t.useCallback(e=>{let t=null;try{return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()].bubbleView&&(t=et[e?.getCategory()+"_"+e?.getType()].bubbleView(e)),t}catch(e){return ze(e),t}},[et,ze]),Tt=t.useCallback(e=>{s.CometChat.markAsRead(e).then(()=>{n.CometChatMessageEvents.ccMessageRead.next(e)},e=>{ze(e)})},[ze]),Mt=t.useCallback(e=>{h||e.getSender().getUid()===Se.current?.getUid()||Tt(e)},[h,Tt]),Bt=t.useCallback(()=>{Qe.current=!0,ve.current&&ve.current?.click();const e=Le.current[Le.current.length-1];e&&Mt(e),Le.current=[],Ue.current&&(Ue.current=""),be&&ye(!1)},[Mt,be]),Lt=t.useCallback(()=>{try{re(Je?e=>e.slice(-30):e=>e.slice(0,30))}catch(e){ze(e)}},[ze]),Ut=t.useCallback(e=>new Promise((t,o)=>{if(ot(e[0]))try{re(t=>[...e,...t]),Me.current=Me.current+e.length,le(n.States.loaded),Me.current>V&&(Je=!1,Lt()),t(!0)}catch(e){oe?.length<=0&&le(n.States.error),ze(e),o(e)}else 0==oe.length&&le(n.States.loaded),t(!0)}),[oe,V,Lt,ot,ze]),Rt=t.useCallback(()=>new Promise(async(e,t)=>{try{le(n.States.loading);let o=0;if(!Ne.current){if(Ne.current=!0,Pe?.current){const e=await s.CometChat.getUnreadMessageCountForUser(Pe.current?.getUid());o=e[Pe.current?.getUid()]||0}if(Oe?.current){const e=await s.CometChat.getUnreadMessageCountForGroup(Oe.current?.getGuid());o=e[Oe.current?.getGuid()]||0}Ne.current=!1}_e?e(!0):(_e=!0,ke.current.previous||(ke.current.previous=new Ol(P,Pe.current,Oe.current,Te.current.prevMessageId,je.current)),ke?.current.previous.fetchPreviousMessages().then(i=>{if(je.current,i&&i.length>0&&(i=i.map(e=>e.getCategory()===n.CometChatUIKitConstants.MessageCategory.interactive?r.InteractiveMessageUtils.convertInteractiveMessage(e):e)),Ie.current&&(je.current||n.CometChatUIEvents.ccActiveChatChanged.next({user:Pe.current,group:Oe.current,message:i.length>0?i[i.length-1]:void 0,unreadMessageCount:o}),Ie.current=!1,Ol.attachConnectionListener(()=>{He.current=!0,Te.current?.nextMessageId?Ot().then(()=>{jt().then(t=>{e(t),He.current=!1},e=>{t(e)}).catch(e=>{ze(e)})}):He.current=!1})),_e=!1,i&&i.length>0){let o=i[i.length-1],r=o?.getSender().getUid()==Se.current?.getUid();o.getDeliveredAt()||h||r||s.CometChat.markAsDelivered(o).then(()=>{i.forEach(e=>(e?.getId()<=o?.getId()&&!r&&!e.getDeliveredAt()&&e.setDeliveredAt((new Date).getTime()),e))}),o.getReadAt()||r&&o.getCategory()!==s.CometChat.MessageCategory.CALL&&o.getCategory()!==s.CometChat.MessageCategory.ACTION?r||n.CometChatMessageEvents.ccMessageRead.next(o):h?Le.current=[]:s.CometChat.markAsRead(o).then(()=>{i.forEach(e=>(!(e?.getId()<=o?.getId())||r&&e.getCategory()!==s.CometChat.MessageCategory.CALL&&e.getCategory()!==s.CometChat.MessageCategory.ACTION||e.getReadAt()||e.setReadAt((new Date).getTime()),e)),n.CometChatMessageEvents.ccMessageRead.next(o)}),Ut(i).then(t=>{e(t)},e=>{t(e)})}else 0===i.length&&0===Me.current&&le(n.States.empty),e(!0)},e=>{_e=!1,oe?.length<=0&&le(n.States.error),"REQUEST_IN_PROGRESS"!=e.code?(ze(e),t(e)):le(n.States.loading)}))}catch(e){oe?.length<=0&&le(n.States.error),ze(e)}}),[h,ze,Ut]),Pt=t.useCallback(e=>new Promise((t,o)=>{try{re(t=>[...t,...e]),Me.current=Me.current+e.length;let o=e[e.length-1]?.getId();if(o&&Te.current.prevMessageId!==o&&(Te.current.nextMessageId=o),j)setTimeout(()=>{ie(!0),Qe.current=!0},100);else{if(He.current){ie(Qe.current);let t=e[e?.length-1];Qe.current&&t&&t.getSender().getUid()!=Se.current?.getUid()&&!t.getReadAt()&&s.CometChat.markAsRead(t).then(()=>{Le.current=[],n.CometChatMessageEvents.ccMessageRead.next(t)})}else ie(!1);let t=O||(Le.current.length>1?n.localize("NEW_MESSAGES"):n.localize("NEW_MESSAGE"));Le.current.push(...e),Ue.current=" ↓ "+Le.current.length+" "+t,ye(!0)}le(n.States.loaded),Me.current>V&&(Je=!0,Lt()),t(!0)}catch(e){oe?.length<=0&&le(n.States.error),ze(e),o(e)}}),[V,Lt,ze,Qe]),Ot=t.useCallback(()=>new Promise((e,t)=>{let o=(new s.CometChat.MessagesRequestBuilder).setType(n.CometChatUIKitConstants.MessageCategory.message).setCategory(n.CometChatUIKitConstants.MessageCategory.action).setMessageId(Te.current.nextMessageId).setLimit(30);Pe.current?o.setUID(Pe.current.getUid()):Oe.current&&o.setGUID(Oe.current.getGuid()),o.build().fetchNext().then(t=>t&&t.length>0?(t.forEach(e=>{gt(e.getActionOn())}),e(!0)):e(!0)).catch(e=>(ze(e),oe?.length<=0&&le(n.States.error),t(e)))}),[ze]),jt=t.useCallback(()=>new Promise((e,t)=>{try{Te.current.nextMessageId?(ke.current.next||(ke.current.next=new Ol(P,Pe.current,Oe.current,Te.current.nextMessageId,je.current)),le(n.States.loading),ke?.current.next.fetchNextMessages().then(o=>{o&&o.length>0&&(o=o.map(e=>e.getCategory()===n.CometChatUIKitConstants.MessageCategory.interactive?r.InteractiveMessageUtils.convertInteractiveMessage(e):e)),o?0===o.length?(0===Me.current?le(n.States.empty):le(n.States.loaded),e(!0)):Pt(o).then(t=>{e(t)},e=>{t(e)}):e(!0)},e=>{oe?.length<=0&&le(n.States.error),ze(e),t(e)})):e(!0)}catch(e){ze(e)}}),[Pt,ze,oe?.length,P]),Vt=t.useCallback(e=>{try{re(t=>t.map(t=>t?.getId()===e.getParentMessageId()?(t.getReplyCount()?t.setReplyCount(t.getReplyCount()+1):t.setReplyCount(1),t):t))}catch(e){ze(e)}},[ze]),Gt=t.useCallback(e=>{try{re(t=>{let n=[...t],o=n.findIndex(t=>t.getId()===e.getParentMessageId());if(o>-1){const e=n[o];n.splice(o,1,e),t=[...n]}return t})}catch(e){ze(e)}},[ze]),Ht=t.useCallback(e=>{try{Me.current+=1,Me.current>0&&ae!=n.States.loaded&&le(n.States.loaded),re(t=>[...t,e]),e.getSender()&&e.getSender().getUid()!=Se.current?.getUid()||ie(!0),Me.current>V&&(Je=!0,Lt())}catch(e){ze(e)}},[V,ze,se]),Qt=t.useCallback(e=>{try{return r.MessageReceiptUtils.getReceiptStatus(e)}catch(e){ze(e)}},[ze]),Nt=t.useCallback(()=>{try{b||(y?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessage,y):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessage))}catch(e){ze(e)}},[b,y,ze]),Kt=t.useCallback(e=>{if(!Qe.current&&e.getSender()&&e.getSender().getUid()!=Se.current?.getUid()){let t=O||(Le.current.length>1?n.localize("NEW_MESSAGES"):n.localize("NEW_MESSAGE"));Le.current.push(e),Ue.current=" ↓ "+Le.current.length+" "+t,ye(!0)}},[O]),zt=t.useCallback(e=>{try{re(t=>t.map(t=>(parseInt(t?.getId()?.toString())<=parseInt(e.getMessageId())&&t.getSender().getUid()===Se.current?.getUid()&&!t.getDeliveredAt()&&t.setDeliveredAt(e.getDeliveredAt()),t)))}catch(e){ze(e)}},[ze]),Jt=t.useCallback(e=>{try{const t=[];re(o=>{const r=o.map(n=>(parseInt(n?.getId()?.toString())<=parseInt(e.getMessageId())&&n.getSender().getUid()===Se.current?.getUid()&&!n.getReadAt()&&(n.setReadAt(e.getReadAt()),parseInt(n?.getId()?.toString())===parseInt(e.getMessageId())&&t.push(n)),n));return t.forEach(e=>{n.CometChatMessageEvents.ccMessageRead.next(e)}),r})}catch(e){ze(e)}},[ze]),Yt=t.useCallback((e,t)=>{try{t?"delivery"===e.getReceiptType()||"deliveredToAll"===e.getReceiptType()?zt(e):Jt(e):e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&e.getSender().getUid()===Pe.current?.getUid()&&e.getReceiver()===Se.current?.getUid()&&("delivery"===e.getReceiptType()?zt(e):Jt(e))}catch(e){ze(e)}},[zt,Jt,ze]),_t=t.useCallback(e=>{Se.current?.getUid()===e.getSender().getUid()&&re(t=>t.map(t=>{if(String(t.getId())===String(e.getMessageId())){const n=e.getInteractions();return t.setInteractions(n),r.InteractiveMessageUtils.convertInteractiveMessage(t)}return t}))},[]),Wt=t.useCallback((e=!1)=>{(e||j)&&setTimeout(()=>{ie(!0),Qe.current=!0,Le.current=[]},100)},[j]),Zt=t.useCallback(e=>{try{ot(e)?(Ht(e),j?(Wt(),Mt(e)):Qe.current?(Wt(!0),Mt(e)):(ie(!1),Kt(e))):st(e)&&(Vt(e),Gt(e)),Nt()}catch(e){ze(e)}},[ot,st,Nt,Ht,j,Wt,Mt,Kt,Vt,Gt,ze]),Xt=t.useCallback((e,t)=>{try{t?.getGuid()===Oe?.current?.getGuid()&&(Ht(e),Qe.current?Wt(!0):j?Wt():(ie(!1),Kt(e)))}catch(e){ze(e)}},[Ht,j,Wt,Kt,ze]),qt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getReaction()?.getReactedBy()?.getUid(),s=e?.getParentMessageId(),i=s&&String(s);if(i)return s===i;if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current?.getUid()||r===Pe.current?.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current?.getGuid())return!0;return!1},[]),$t=t.useCallback((e,t)=>{if(!qt(e))return!1;re(n=>{const o=n.findIndex(t=>t.getId().toString()===e.getReaction()?.getMessageId().toString());if(-1===o)return n;const i=n[o];let a;a=t?s.CometChat.REACTION_ACTION.REACTION_ADDED:s.CometChat.REACTION_ACTION.REACTION_REMOVED;const l=s.CometChat.CometChatHelper.updateMessageWithReactionInfo(i,e.getReaction(),a);return n.map(e=>e.getId().toString()===l?.getId().toString()?r.CometChatUIKitUtility.clone(l):e)})},[qt]),en=t.useCallback(e=>{try{ot(e)&&Be.names.includes("calling")&&(Ht(e),Qe.current?Wt(!0):j?Wt():(ie(!1),Kt(e)))}catch(e){ze(e)}},[ot,Ht,j,Wt,Kt,ze]),tn=t.useCallback((e="",t,o)=>{try{switch(e){case n.CometChatUIKitConstants.MessageCategory.action:o&&Xt(t,o);break;case n.CometChatUIKitConstants.MessageCategory.call:en(t)}}catch(e){ze(e)}},[Xt,en,ze]),nn=t.useCallback(()=>new Promise((e,t)=>{try{Bt(),ie(!1),ke.current&&ke.current.previous&&(ke.current.previous=null),jt().then(t=>{e(t)},e=>{t(e)})}catch(e){ze(e)}}),[oe,Mt,jt,Bt,ze]),on=t.useCallback(()=>new Promise((e,t)=>{try{ie(!1),Qe.current=!1,ke.current&&ke.current.next&&(ke.current.next=null),Rt().then(t=>{e(t)},e=>{t(e)})}catch(e){ze(e)}}),[Rt,ze,Qe]),rn=t.useCallback(e=>{Fe.current[e.getId()].current?.scrollIntoView({block:"center"})},[]),sn=t.useCallback(()=>{try{Bt(),ie(!0)}catch(e){ze(e)}},[Tt,ze,Bt]),an=t.useCallback(e=>{re(e=>e.map(e=>(e?.getId(),e)))},[]),ln=t.useCallback(()=>{try{const e=n.CometChatUIEvents.ccShowOngoingCall.subscribe(e=>{Ce(!0),xe(e.child)}),t=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{Ce(!1),xe(null),e&&en(e)}),o=n.CometChatCallEvents.ccCallRejected.subscribe(e=>{en(e)}),r=n.CometChatCallEvents.ccOutgoingCall.subscribe(e=>{en(e)}),s=n.CometChatCallEvents.ccCallAccepted.subscribe(e=>{en(e)}),c=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{st(e)&&an(e.getParentMessageId())}),C=n.CometChatUIEvents.ccShowDialog.subscribe(e=>{Re.current=e.child,me(!0)}),g=n.CometChatUIEvents.ccHideDialog.subscribe(()=>{Re.current=null,me(!1)}),d=n.CometChatUIEvents.ccShowPanel.subscribe(e=>{(!e.message||e.message.getParentMessageId()&&i&&e.message.getParentMessageId()==i||!i&&!e.message?.getParentMessageId())&&(e.position===n.PanelAlignment.messageListFooter?(Ve.current&&(Ve.current=null,ye(!1),fe(!1)),setTimeout(()=>{Ve.current=e.child,fe(!0)},0)):e.position===n.PanelAlignment.messageListHeader&&(Ge.current&&(Ge.current=null,Ee(!1)),setTimeout(()=>{Ge.current=e.child,Ee(!0)},0)))}),u=n.CometChatUIEvents.ccHidePanel.subscribe(e=>{e===n.PanelAlignment.messageListFooter?(Ve.current=null,ye(!1),fe(!1)):e===n.PanelAlignment.messageListHeader&&(Ge.current=null,Ee(!1))}),p=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{e.messages.map(t=>{Xt(t,e.userAddedIn)})}),m=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{Xt(e.message,e.kickedFrom)}),A=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{Xt(e.message,e.kickedFrom)}),x=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{Xt(e.message,e.group)}),b=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{Xt(e.message,e.leftGroup)}),y=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{e?.status===n.MessageStatus.success&&tt(e.message)&&dt(e.message,!1)}),w=n.CometChatMessageEvents.ccMessageTranslated.subscribe(e=>{e?.status===n.MessageStatus.success&&ot(e.message)&&(dt(e.message,!1),setTimeout(()=>{rn(e.message)},100))}),f=n.CometChatMessageEvents.ccMessageSent.subscribe(e=>{let{message:t,status:o}=e;switch(o){case n.MessageStatus.inprogress:tt(t)&&Ht(t);break;case n.MessageStatus.success:tt(t)&&dt(t,!0),rt(t)&&Vt(t);break;default:dt(t,!0),rt(t)&&Vt(t)}}),D=n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{Zt(e)}),E=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{Zt(e)}),v=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{Zt(e)}),S=n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{Zt(e)}),I=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{Zt(e)}),F=n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{Zt(e)}),k=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{Zt(e)}),T=n.CometChatMessageEvents.onMessagesDelivered.subscribe(e=>{h||Yt(e)}),M=n.CometChatMessageEvents.onMessagesRead.subscribe(e=>{h||Yt(e)}),B=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(e=>{h||Yt(e,!0)}),L=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(e=>{h||Yt(e,!0)}),U=n.CometChatMessageEvents.onMessageDeleted.subscribe(e=>{gt(e)}),R=n.CometChatMessageEvents.onMessageEdited.subscribe(e=>{gt(e)}),P=n.CometChatMessageEvents.onTransientMessageReceived.subscribe(e=>{let t=e.getData();nt(e)&&"live_reaction"==t.type&&n.CometChatMessageEvents.ccLiveReactionSent.next({composerId:{group:l?.getGuid()||null,user:a?.getUid()||null,parentMessageId:je.current||null},reaction:t.reaction})}),O=n.CometChatMessageEvents.onInteractionGoalCompleted.subscribe(e=>{_t(e)});let j,V;return X||(j=n.CometChatMessageEvents.onMessageReactionAdded.subscribe(e=>{$t(e,!0)}),V=n.CometChatMessageEvents.onMessageReactionRemoved.subscribe(e=>{$t(e,!1)})),()=>{try{y?.unsubscribe(),f?.unsubscribe(),p?.unsubscribe(),m?.unsubscribe(),A?.unsubscribe(),x?.unsubscribe(),b?.unsubscribe(),e?.unsubscribe(),r?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),s?.unsubscribe(),C?.unsubscribe(),g?.unsubscribe(),d?.unsubscribe(),u?.unsubscribe(),w?.unsubscribe(),c?.unsubscribe(),D?.unsubscribe(),E?.unsubscribe(),v?.unsubscribe(),S?.unsubscribe(),I?.unsubscribe(),F?.unsubscribe(),k?.unsubscribe(),T?.unsubscribe(),M?.unsubscribe(),B?.unsubscribe(),L?.unsubscribe(),U?.unsubscribe(),R?.unsubscribe(),P?.unsubscribe(),O?.unsubscribe(),X||(j?.unsubscribe(),V?.unsubscribe())}catch(e){ze(e)}}}catch(e){ze(e)}},[nt,an,X,en,st,dt,Xt,tt,rn,Ht,rt,Vt,ze,we]),cn=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){ze(e)}},[ze]),Cn=t.useCallback(e=>I===n.MessageListAlignment.left||!(!Oe.current||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action||!e?.getSender()||e?.getSender()?.getUid()===Se.current?.getUid()||I!==n.MessageListAlignment.standard),[I]),gn=t.useCallback(e=>e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&F&&Cn(e)?g.jsx(ol,{name:e?.getSender()?.getName(),avatarStyle:xl(N,Ke),image:e?.getSender()?.getAvatar()}):null,[F,N,Cn,Ke]),dn=t.useCallback(e=>g.jsx(g.Fragment,{children:g.jsx(el,{timestamp:e.getSentAt(),dateStyle:dl(z,Ke),pattern:T})}),[z,T,Ke]),un=t.useCallback(e=>g.jsx(g.Fragment,{children:g.jsx(tl,{text:e?.getSender()?.getName(),labelStyle:ul(Ke,z)})}),[Ke]),pn=t.useCallback(e=>It(e)?It(e):e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&(Cn(e)||M===Ye.top)?g.jsxs(g.Fragment,{children:[Cn(e)?un(e):null,M===Ye.top?dn(e):null]}):null,[M,dn,Cn,It,un]),hn=t.useCallback(e=>M===Ye.bottom&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call?g.jsx(el,{timestamp:e.getSentAt(),dateStyle:dl(z,Ke),pattern:T}):null,[M,z,T,Ke]),mn=t.useCallback(e=>h||A||e?.getSender()&&Se.current?.getUid()!==e?.getSender()?.getUid()||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.call?null:g.jsx(rl,{receiptStyle:cl(Ke,e),receipt:Qt(e),waitIcon:E,sentIcon:D,deliveredIcon:f,readIcon:w,errorIcon:v}),[h,E,D,f,w,v,Qt,Ke]),An=t.useCallback(()=>{const e=Z?.reactionListConfiguration||{},t=(e=>new o.AvatarStyle({borderRadius:"50%",width:"35px",height:"35px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:"0",outerViewBorderRadius:"0",outerViewBorderColor:"",outerViewBorderSpacing:"0"}))(Ke),s=(e=>new o.ListItemStyle({background:"transparent",activeBackground:"transparent",hoverBackground:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent(),separatorColor:e.palette.getAccent100()}))(Ke),i=(e=>new r.ReactionListStyle({width:"320px",height:"300px",borderRadius:"12px",background:e.palette.getAccent900(),border:"none",errorIconTint:e.palette.getAccent400(),loadingIconTint:e.palette.getAccent400(),sliderEmojiCountFont:n.fontHelper(e.typography.subtitle2),sliderEmojiFont:n.fontHelper(e.typography.subtitle1),subtitleTextColor:e.palette.getAccent500(),subtitleTextFont:n.fontHelper(e.typography.subtitle2),tailViewFont:n.fontHelper(e.typography.title1),dividerTint:e.palette.getAccent100(),sliderEmojiCountColor:e.palette.getAccent500(),activeEmojiBackground:e.palette.getAccent100()}))(Ke);return new r.ReactionListConfiguration({avatarStyle:{...t,...e?.avatarStyle},errorIconURL:e?.errorIconURL||"",listItemStyle:{...s,...e?.listItemStyle},loadingIconURL:e?.loadingIconURL||"",reactionListStyle:{...i,...e?.reactionListStyle},reactionItemClicked:e?.reactionItemClicked||((e,t)=>{e?.getReactedBy()?.getUid()===Se.current?.getUid()&&ut(e?.getReaction(),t)}),reactionsRequestBuilder:e?.reactionsRequestBuilder||void 0})},[Z,ut,Ke]),xn=t.useCallback(()=>{const e=Z?.reactionInfoConfiguration||{},t=((e,t)=>new r.ReactionInfoStyle({background:t?.reactionInfoStyle?.background||e.palette.getAccent("light"),border:t?.reactionInfoStyle?.border||"none",borderRadius:t?.reactionInfoStyle?.borderRadius||"12px",errorIconTint:t?.reactionInfoStyle?.errorIconTint||e.palette.getBackground("light"),loadingIconTint:t?.reactionInfoStyle?.loadingIconTint||e.palette.getBackground("light"),namesColor:t?.reactionInfoStyle?.namesColor||e.palette.getBackground("light"),namesFont:t?.reactionInfoStyle?.namesFont||n.fontHelper(e.typography.subtitle2),reactedTextColor:t?.reactionInfoStyle?.reactedTextColor||e.palette.getAccent700("dark"),reactedTextFont:t?.reactionInfoStyle?.reactedTextFont||n.fontHelper(e.typography.subtitle2),reactionFontSize:t?.reactionInfoStyle?.reactionFontSize||"37px"}))(Ke,e);return new r.ReactionInfoConfiguration({reactionInfoStyle:t,reactionsRequestBuilder:e?.reactionsRequestBuilder||void 0,errorIconURL:e?.errorIconURL||"",loadingIconURL:e?.loadingIconURL||""})},[Z,Ke]),bn=t.useCallback(e=>{const t=e?.getReactions()||[],o=Et(e);if(t&&t.length>0&&!X){const t=((e={},t)=>new r.ReactionsStyle({height:e?.height||"100%",width:e?.width||"fit-content",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"transparent",activeReactionBackground:e?.activeReactionBackground||t.palette.getPrimary150(),reactionBackground:e?.reactionBackground||t.palette.getAccent100(),reactionBorder:e?.reactionBorder||"none",activeReactionBorder:e?.activeReactionBorder||`1px solid ${t.palette.getPrimary500()}`,reactionBorderRadius:e?.reactionBorderRadius||"20px",activeReactionCountTextColor:e?.activeReactionCountTextColor||t.palette.getAccent(),activeReactionCountTextFont:e?.activeReactionCountTextFont||n.fontHelper(t.typography.caption1),reactionCountTextFont:e?.reactionCountTextFont||n.fontHelper(t.typography.caption1),reactionCountTextColor:e?.reactionCountTextColor||t.palette.getAccent(),reactionBoxShadow:e?.reactionBoxShadow||"rgba(0, 0, 0, 0.1) 0px 4px 12px",reactionEmojiFont:e?.reactionEmojiFont||n.fontHelper(t.typography.subtitle1),baseReactionBackground:e?.baseReactionBackground||t.palette.getBackground()}))(Z?.reactionsStyle,Ke);return g.jsx(Za,{messageObject:e,alignment:o,reactionsStyle:t,hoverDebounceTime:500,reactionClick:(e,t)=>{Z?.reactionClick?Z?.reactionClick(e,t):ut(e?.getReaction(),t)},reactionListConfiguration:An(),reactionInfoConfiguration:xn(),style:wl(o)})}return null},[X,xn,An,ut,Z,Et,Ke]),yn=t.useCallback(e=>Ft(e)?g.jsx("div",{className:"cc-message-bubble__footer",style:gl(Et(e)),children:Ft(e)}):g.jsx("div",{className:"cc-message-bubble__footer",style:gl(Et(e)),children:bn(e)}),[bn,Ft,Et]),wn=t.useCallback(e=>{if(e?.getReplyCount()&&!e?.getDeletedAt()){const t=Et(e),o=$;return g.jsx("div",{className:"cc-message-bubble__thread-replies",children:g.jsx(qa,{text:Mn(e),hoverText:Mn(e),buttonStyle:il(e,Ke,Se.current,z,t),mirrorIcon:t===n.MessageBubbleAlignment.left,iconURL:o,buttonClick:()=>{at(e)}})})}},[Et,$,Ke,z,at]),fn=e=>{const t=e?.getType();return[n.CometChatUIKitConstants.MessageTypes.image,n.CometChatUIKitConstants.MessageTypes.video].includes(t)},Dn=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.statusInfoView?et[e?.getCategory()+"_"+e?.getType()]?.statusInfoView(e,t):e?.getDeletedAt()||e instanceof s.CometChat.Action||e instanceof s.CometChat.Call?null:g.jsx("div",{style:{position:"relative",display:"flex",justifyContent:"flex-end"},children:g.jsxs("div",{className:"cc-message-bubble__statusInfo",style:Cl(fn(e),Ke,e,Et(e)),children:[hn(e),mn(e)]})})}catch(e){return ze(e),null}},[hn,mn,et,ze,Et]),En=t.useCallback((e,t)=>g.jsx(W,{setRef:t=>{Fe.current[e.getId()]=t},leadingView:gn(e),headerView:pn(e),footerView:yn(e),contentView:vt(e),bottomView:St(e),id:e?.getId()||e?.getMuid(),options:Dt(e),messageBubbleStyle:ll(e,Ke,I,Se.current),alignment:Et(e),replyView:null,threadView:wn(e),statusInfoView:Dn(e)}),[gn,pn,yn,vt,I,Et,wn,Dn,Dt,St,Ke]),vn=t.useCallback((e,t)=>0===t||cn(oe[t-1]?.getSentAt(),e?.getSentAt())?g.jsx("div",{className:"cc-message-list__date-container",style:{display:"flex",justifyContent:"center",width:"100%",marginBottom:"16px"},children:g.jsx(el,{timestamp:e.getSentAt(),pattern:B,dateStyle:pl(K,Ke)})},`${e.getId()}-${e.getSentAt()}`):null,[B,oe,K,cn,Ke]),Sn=t.useCallback((e,t)=>{let n=Et(e);return g.jsxs(g.Fragment,{children:[L?g.jsx(g.Fragment,{}):vn(e,t),g.jsx("div",{className:"cc-message-list__bubble",style:bl(n),children:kt(e)?kt(e):En(e,t)},e.getId())]})},[kt,vn,En,Et]),In=t.useCallback((e,t)=>g.jsx(W,{leadingView:gn(e),headerView:pn(e),footerView:null,contentView:vt(e),bottomView:null,statusInfoView:null,id:e?.getId()||e?.getMuid(),options:[],messageBubbleStyle:ll(e,Ke,I,Se.current),alignment:Et(e),replyView:null,threadView:null}),[gn,pn,vt,I,Et,Ke]),Fn=t.useCallback((e,t)=>g.jsx("div",{className:"cc__messagelist__bubble",style:yl,children:kt(e)?kt(e):In(e,t)},e.getId()),[kt,vn,En,In]),kn=t.useCallback(()=>g.jsxs(g.Fragment,{children:[we&&Ve.current?Ve.current:null,Q&&!Ve.current?Q:null]}),[Q,sn,we]),Tn=t.useCallback(()=>g.jsxs(g.Fragment,{children:[De&&Ge.current?Ge.current:null,H&&!Ge.current?H:null]}),[H,De]),Mn=e=>{const t=e?.getReplyCount()||0;return`${t} ${1===t?n.localize("REPLY"):n.localize("REPLIES")}`},Bn=t.useCallback(e=>g.jsx(g.Fragment,{children:kt(e)?kt(e):g.jsx(W,{leadingView:gn(e),headerView:pn(e),footerView:null,contentView:vt(e),bottomView:St(e),statusInfoView:Dn(e),id:e?.getId()||e?.getMuid(),messageBubbleStyle:ll(e,Ke,I,Se.current),alignment:We,replyView:null,threadView:null,options:[]})}),[gn,pn,yn,vt,I,Dt,kt,St,Ke]),Ln=t.useMemo(()=>function(e,t){return Sn(e,t)},[Sn]),Un=t.useCallback(()=>ae,[ae]);return function(e,n,o,i,a,l,c,C,g,d,u,p,h,m,A,x,b){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(t=>{b.current=!0,t&&(e.current=t)},e=>{p(e)})},[l,c,p]),t.useEffect(()=>{let e;return r.CometChatUIKitLoginListener.getLoggedInUser()&&(l||c)&&(n.current={previous:new Ol(a,l,c)},Ol.attachListeners(i),e=C(),h([]),m(!0),x.current=!0,o(),A.current=null),()=>{Ol?.removeListeners?.(),e?.()}},[l,c]),t.useEffect(()=>{d.current=u.length,u?.length>0&&(g.current.prevMessageId=u[0].getId(),g.current.nextMessageId=u[u.length-1].getId())},[u])}(Se,ke,Rt,tn,P,Pe.current,Oe.current,ln,Te,Me,oe,ze,re,ie,Ve,Qe,Ie),g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"cc-message-list__wrapper",style:sl(z,Ke),children:[g.jsx("div",{className:"cc-message-list__header-view",style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",height:"auto"},children:Tn()}),g.jsxs("div",{className:"cc-message-list",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",boxSizing:"border-box"},children:[g.jsx(k,{scrolledUpCallback:lt,title:"",hideSearch:!0,showSectionHeader:!1,list:oe,listItem:Ln,onScrolledToBottom:nn,onScrolledToTop:on,listItemKey:"getMuid",state:Un(),loadingView:Ze,loadingIconURL:S,hideError:Y,errorStateView:Xe,errorStateText:C,emptyStateView:qe,emptyStateText:void 0,scrollToBottom:se,theme:Ke,listStyle:new r.ListStyle({height:"100%",width:"100%",background:"inherit"})}),be&&Le.current&&Le.current.length>0&&!Qe.current?g.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"fit-content",width:"100%"},className:"cc-message-list__message-indicator",children:g.jsx($a,{ref:ve,text:Ue.current,buttonStyle:al(Ke),buttonClick:sn})}):null]}),g.jsx("div",{className:"cc-message-list__footer-view",style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",height:"auto"},children:kn()})]}),ce?Ae:null,he&&Re.current?Re.current:null,ge&&null!==ue&&g.jsx(Rl,{message:ue,bubbleView:_?.bubbleView||Fn,onClose:_?.onClose||(()=>{de(!1)}),template:(Rn=ue,et[Rn?.getCategory()+"_"+Rn?.getType()]),loadingStateView:_?.loadingStateView,errorStateView:_?.errorStateView,listItemStyle:_?.listItemStyle,emptyStateView:_?.emptyStateView,loadingIconURL:_?.loadingIconURL,readIcon:_?.readIcon,deliveredIcon:_?.deliveredIcon,onError:_?.onError,subtitleView:_?.subtitleView,listItemView:_?.listItemView,messageInformationStyle:_?.messageInformationStyle,closeIconURL:_?.closeIconURL||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",receiptDatePattern:_?.receiptDatePattern,backdropStyle:ne})]});var Rn},Gl=e=>({height:"36px",padding:"8px 16px",boxSizing:"border-box",border:`1px solid ${e.palette.getAccent100()}`}),Hl=e=>({height:"100%",width:"100%",border:"0 none",borderRadius:"0",background:`${e.palette.getBackground()}`,buttonTextFont:`${n.fontHelper(e.typography.subtitle1)}`,buttonTextColor:`${e.palette.getAccent600()}`});var Ql="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Nl={width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)",titleColor:"rgba(20, 20, 20)",titleFont:"700 22px Inter",closeIconTint:"#3399FF"},Kl={textFont:"700 22px Inter",textColor:"black",background:"transparent"},zl={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:"#7dbfff"},Jl=e=>{const{parentMessage:o,title:i=n.localize("THREAD"),closeIconURL:a=Ql,bubbleView:l=null,messageActionView:c=null,onError:C,onClose:d=()=>{},threadedMessagesStyle:u=Nl,messageListConfiguration:p=new r.MessageListConfiguration({}),messageComposerConfiguration:h=new r.MessageComposerConfiguration({}),messageComposerView:m,messageListView:A,hideMessageComposer:b}=e,{theme:y}=t.useContext(U),[w,f]=t.useState(o),[D,E]=t.useState(0),v=t.useRef(u);let S=new r.ThreadedMessagesStyle({width:"100%",height:"100%",background:y.palette.getBackground(),borderRadius:"none",border:"none",titleColor:y.palette.getAccent(),titleFont:n.fontHelper(y.typography.title1),closeIconTint:y.palette.getPrimary()});v.current={...S,...u},Kl.textFont=v?.current?.titleFont||n.fontHelper(y.typography.title1),Kl.textColor=v?.current?.titleColor||y.palette.getAccent(),Kl.background="transparent",zl.buttonIconTint=v?.current?.closeIconTint||y.palette.getPrimary();const[I,F]=t.useState(null),k=x(C),T=t.useMemo(()=>{if(I&&o?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user)return o?.getSender()?.getUid()===I?.getUid()?o?.getReceiver():o?.getSender()},[o,I]),M=t.useMemo(()=>{if(I&&o?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group)return o?.getReceiver()},[I,o]),B=w.getId(),L=t.useMemo(()=>(new s.CometChat.MessagesRequestBuilder).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).hideReplies(!0).setLimit(20).setParentMessageId(B),[B]),R=t.useCallback(e=>{try{Number(e?.getMessageId())===B&&(e?.getReadAt()?f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getReadAt()),n}):e?.getDeliveredAt()&&f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getDeliveredAt()),n}))}catch(e){k(e)}},[B,f,k]),P=t.useCallback(e=>{try{B===e?.getId()&&f(t=>r.CometChatUIKitUtility.clone(e))}catch(e){k(e)}},[B,f,k]),O=t.useCallback(()=>{const e=n.CometChatMessageEvents.onMessagesDelivered.subscribe(e=>{R(e)}),t=n.CometChatMessageEvents.onMessagesRead.subscribe(e=>{R(e)}),r=n.CometChatMessageEvents.onMessageDeleted.subscribe(e=>{P(e)}),s=n.CometChatMessageEvents.onMessageEdited.subscribe(e=>{P(e)}),i=n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),a=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),l=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),c=n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),C=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),g=n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),d=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)});return()=>{e?.unsubscribe(),t?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe(),C?.unsubscribe(),g?.unsubscribe(),d?.unsubscribe()}},[R,P,o]),j=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.ccMessageSent.subscribe(({status:e,message:t})=>{e===n.MessageStatus.success&&t?.getParentMessageId()===w?.getId()&&E(e=>e+1)}),t=n.CometChatMessageEvents.ccMessageEdited.subscribe(({status:e,message:t})=>{e===n.MessageStatus.success&&t?.getId()===w?.getId()&&f(e=>r.CometChatUIKitUtility.clone(t))}),o=n.CometChatMessageEvents.ccMessageDeleted.subscribe(e=>{e?.getId()===w?.getId()&&f(t=>r.CometChatUIKitUtility.clone(e))}),s=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{e?.getId()===w?.getId()&&f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getReadAt()),n})});return()=>{try{o?.unsubscribe(),t?.unsubscribe(),s?.unsubscribe(),e?.unsubscribe()}catch(e){k(e)}}}catch(e){k(e)}},[w,f,k]),V=t.useCallback(()=>{d()},[d]),G=t.useCallback(()=>{try{const e=D||0;return`${e} ${1===e?n.localize("REPLY"):n.localize("REPLIES")}`}catch(e){k(e)}},[k,D]),H=t.useCallback(()=>l&&w?l(w):null,[w,l]);return function(e,n,o,r,i,a,l){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{if(e){const e=o(),t=r();return()=>{e(),t()}}},[e,o,r]),t.useEffect(()=>{void 0===a?.getReplyCount()?l(0):l(a?.getReplyCount())},[a,l])}(I,F,O,j,k,o,E),g.jsxs("div",{className:"cc-threaded-messages__wrapper",style:{background:v?.current?.background||y.palette.getBackground(),height:v?.current?.height,width:v?.current?.width,border:v?.current?.border,borderRadius:v?.current?.borderRadius,display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box"},children:[g.jsxs("div",{className:"cc-threaded-messages__header",style:{padding:"16px",width:"100%",display:"flex",boxSizing:"border-box"},children:[g.jsx("div",{className:"cc-threaded-messages__title",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"calc(100% - 24px)"},children:g.jsx("cometchat-label",{text:i,labelStyle:JSON.stringify(Kl)})}),g.jsx("div",{className:"cc-threaded-messages__close",style:{display:"flex",alignItems:"center",width:"24px"},children:g.jsx("cometchat-button",{iconURL:a,buttonStyle:JSON.stringify(zl),onClick:V})})]}),g.jsxs("div",{className:"cc-threaded-messages",style:{width:"100%",height:"calc(100% - 156px)",display:"flex",flexDirection:"column"},children:[g.jsx("div",{className:"cc-threaded-messages__bubbleview",style:{display:"flex",width:"100%",height:"fit-content",padding:"8px 16px",boxSizing:"border-box",maxHeight:"20em",overflow:"hidden scroll"},children:H()}),g.jsx("div",{className:"cc-threaded-messages__actionview",style:Gl(y),children:c||g.jsx("cometchat-button",{text:G(),buttonStyle:JSON.stringify(Hl(y))})}),A?T||M?A(T,M,o):null:g.jsx("div",{className:"cc-threaded-messages__list",style:{height:"100%",overflow:"hidden",width:"100%"},children:g.jsx(Vl,{parentMessageId:w?.getId(),user:T,group:M,emptyStateView:p?.emptyStateView,loadingStateView:p?.loadingStateView,errorStateView:p?.errorStateView,disableReceipt:p?.disableReceipt,hideReceipt:p?.hideReceipt,readIcon:p?.readIcon,deliveredIcon:p?.deliveredIcon,sentIcon:p?.sentIcon,waitIcon:p?.waitIcon,errorIcon:p?.errorIcon,alignment:p?.alignment,showAvatar:p?.showAvatar,datePattern:p?.datePattern,timestampAlignment:p?.timestampAlignment,DateSeparatorPattern:p?.DateSeparatorPattern,templates:p?.templates,messagesRequestBuilder:p?.messagesRequestBuilder||L,thresholdValue:p?.thresholdValue,onThreadRepliesClick:p?.onThreadRepliesClick,headerView:p?.headerView,footerView:p?.footerView,avatarStyle:p?.avatarStyle,dateSeparatorStyle:p?.dateSeparatorStyle,messageListStyle:p?.messageListStyle,onError:p?.onError,disableMentions:p?.disableMentions,hideDateSeparator:p?.hideDateSeparator,reactionsConfiguration:p?.reactionsConfiguration,disableReactions:p?.disableReactions,emojiKeyboardStyle:p?.emojiKeyboardStyle,threadIndicatorIcon:p?.threadIndicatorIcon,textFormatters:p?.textFormatters})})]}),b||m?null:g.jsx("div",{className:"cc-threaded-messages__composer",style:{height:"fit-content",width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",minHeight:"90px"},children:g.jsx(Ha,{sendButtonIconURL:h?.sendButtonIconURL,parentMessageId:w?.getId(),user:T,group:M,text:h?.text,headerView:h?.headerView?h.headerView(T,M):null,onTextChange:h?.onTextChange,attachmentIconURL:h?.attachmentIconURL,attachmentOptions:h?.attachmentOptions,secondaryButtonView:h?.secondaryButtonView,auxiliaryButtonView:h?.auxilaryButtonView,auxiliaryButtonAlignment:h?.auxiliaryButtonsAlignment,sendButtonView:h?.sendButtonView,hideLiveReaction:h?.hideLiveReaction,LiveReactionIconURL:h?.LiveReactionIconURL,messageComposerStyle:h?.messageComposerStyle,onSendButtonClick:h?.onSendButtonClick,onError:h?.onError,hideVoiceRecording:h?.hideVoiceRecording,voiceRecordingStartIconURL:h?.voiceRecordingStartIconURL,voiceRecordingCloseIconURL:h?.voiceRecordingCloseIconURL,voiceRecordingStopIconURL:h?.voiceRecordingStopIconURL,voiceRecordingSubmitIconURL:h?.voiceRecordingSubmitIconURL,AIOptionsStyle:h?.AIOptionsStyle,AIIconURL:h?.AIIconURL,userMemberWrapperConfiguration:h?.userMemberWrapperConfiguration,textFormatters:h?.textFormatters||[],disableMentions:h?.disableMentions,mentionsWarningText:h?.mentionsWarningText,mentionsWarningStyle:h?.mentionsWarningStyle,emojiIconURL:h?.emojiIconURL,hideLayoutMode:h?.hideLayoutMode,actionSheetStyle:h?.actionSheetStyle})}),!b&&m&&(T||M)?m(T,M,o):null]})};const Yl={user:void 0,group:void 0,hideMessageComposer:!1,disableTyping:!1,messageHeaderConfiguration:new r.MessageHeaderConfiguration({}),messageListConfiguration:new r.MessageListConfiguration({}),messageComposerConfiguration:new r.MessageComposerConfiguration({}),threadedMessagesConfiguration:new r.ThreadedMessagesConfiguration({}),detailsConfiguration:new r.DetailsConfiguration({}),customSoundForIncomingMessages:"",customSoundForOutgoingMessages:"",disableSoundForMessages:!1,messagesStyle:new r.MessagesStyle({width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)"}),messageHeaderView:null,messageComposerView:null,messageListView:null,hideMessageHeader:!1,hideDetails:!1,auxiliaryMenu:null},_l=e=>{const{theme:o}=t.useContext(U),{user:r,group:i,hideMessageComposer:a,disableTyping:l,messageHeaderConfiguration:c,messageListConfiguration:C,messageComposerConfiguration:d,threadedMessagesConfiguration:u,detailsConfiguration:p,customSoundForIncomingMessages:h,customSoundForOutgoingMessages:m,disableSoundForMessages:A,messagesStyle:x,messageHeaderView:b,messageComposerView:y,messageListView:w,hideMessageHeader:f,hideDetails:D,auxiliaryMenu:E}={...Yl,...e},[v,S]=t.useState(null),[I,F]=t.useState(r),[k,T]=t.useState(i),M=t.useRef(null),B=t.useRef(null),L=t.useRef(null),[R,P]=t.useState(!1),[O,j]=t.useState(!1),[V,G]=t.useState(!1),[H,Q]=t.useState(!1),N=t.useRef(null);t.useMemo(()=>r?(new s.CometChat.MessagesRequestBuilder).setUID(r.getUid()).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).setLimit(20).hideReplies(!0):i?(new s.CometChat.MessagesRequestBuilder).setGUID(i.getGuid()).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).setLimit(20).hideReplies(!0):void 0,[r,i]);let K=d?.LiveReactionIconURL||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAFAAAAAAnxZisAAACpElEQVQ4Ea1VzUsVURQ/5868UrEg/AMy0NTMRQRBJfIQszKxgh5ByzbVIooiiDbZBwUtXAWJtGgRJW0MQsxnxfhRIbgpsqcQtajoA8uITGfu3Hs6Z+zJU3pq+n4wc+fee87vd+bcM2cQ5mB0Z+0WMuERQNiNgO+UgtYAgs7K7uffM01fVlevyc9391iAo5bsOkT1gPdvlvd4Q5l2mJ68bahdG2rTwvMmB9HV1gKP0WWA3oSWzlc86rsj9qm6mkOuwgsKsMQSgeErxpEYS5oQOpSLp0u7vA9iGwmkdsWLlaGuPKXKJw3TyU4GYizEYG+OFglXAt7gOWomzoRY5TsO+Na+8pEaqpJ97/FeIuFUjX++X+C4jb+ZPBsUi3C0Wvb5OSaRZ0MBi0xY01GxvfYApuprtjkE/ZZAZXeZpkrnczF2Ek9oaKtCi2c4ogXJRUKIFyJP2zmolHLUSZeAGjWXQq4RcpHwMTVxIeCwVEuuIWfGSPGIl/9OcqohnA7QVWUCeMg1PyJ1nCsIl7ZmVIcqqSo97xen6aK8UC4SleZB5VwS7ijs8p7e9sDQLflIlos8R4FPdLs9Gb8rXJEAq5K7YurEpLHeckTEd8rYp77G483QHNXmTOJLuwZ/ukof9I0dWIqI+PjWDFqHEps870c6EzMCslCSfPYVQtzvG9MpDos5E7GZJrc9gfX3buju/5Qml3GWgCyUed7YtwmdYJHrLqqom8r6vyDfT0whsG3bqrzV+6oeD36ZazdvkCN1NYe5nq8xSRHndpYvd14Igca5dZxdn+xtm7WZMZlXQOxe18c3ukQtLLJDc0cUSPsOiJ6AMqfKugdeRItZbgsKiN/Q5s2xwqLCYw7hOWl3/FO5oj+OtVYODwdZeJe2LD+mVDxe/D/efwCuAQs2cnkFkQAAAABJRU5ErkJggg==",z="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const J=t.useCallback(e=>{R?P(!1):(P(!0),setTimeout(()=>{P(!1)},1500))},[R,P]),Y=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.ccLiveReaction.subscribe(e=>{!V&&e&&"heart"===e&&J(e)}),t=n.CometChatMessageEvents.ccLiveReactionSent.subscribe(e=>{const{composerId:t,reaction:n}=e;t?(t&&t.user&&t.user===I?.getUid()||t&&t.group&&t.group===k?.getGuid())&&J(n):J(n)}),o=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{k&&k.getGuid()===i?.getGuid()&&(j(!1),G(!1),T(e))}),r=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{k?.getGuid()===e.leftGroup.getGuid()&&(v?.getUid()===e?.userLeft.getUid()&&(j(!1),G(!1)),T(e.leftGroup))}),s=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{I?.getUid()===e.getUid()&&(e.setBlockedByMe(!0),F(e))}),a=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{I?.getUid()===e.getUid()&&(e.setBlockedByMe(!1),F(e))}),l=n.CometChatUIEvents.ccShowPanel.subscribe(e=>{e.position===n.PanelAlignment.messages&&(N.current=e.child,Q(!0))}),c=n.CometChatUIEvents.ccHidePanel.subscribe(e=>{e===n.PanelAlignment.messages&&(N.current=null,Q(!1))});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe()}catch(e){console.log("error",e)}}}catch(e){console.log("error",e)}},[V,J,j,G,k,I,v,i]),_=(e,t)=>{B.current=e,L.current=t,G(!0)},W=()=>j(!0),Z=()=>{j(!1)},X=()=>{B.current=null,L.current=null,G(!1)};function q(){if(p?.data)return p?.data(r,i)}const $=t.useCallback(()=>{if(c?.menu)return c.menu(I,k);const e=Be.getDataSource().getAuxiliaryHeaderMenu(I,k);return g.jsxs(g.Fragment,{children:[E||e.map(e=>e),D?null:g.jsx("div",{className:"cc-messages__header-menu-wrapper",style:{height:"100%",width:"100%",border:"none",background:"transparent",borderRadius:0,marginLeft:"16px"},children:g.jsx("cometchat-button",{iconURL:z,buttonStyle:JSON.stringify(mi(o)),ref:M,onClick:W})})]})},[c,I,k,E,D,z]);return function(e,n,o,r,i,a,l,c,C,g,d){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)})},[n]),t.useEffect(()=>{const e=r.current;if(!e)return;const t=e=>{i(!0)};return a?.menu?e.removeEventListener("cc-menu-clicked",t):e.addEventListener("cc-menu-clicked",t),()=>{e.removeEventListener("cc-menu-clicked",t)}},[a,r,i]),t.useEffect(()=>{l&&(g(null),c(e=>(e?.getUid()!==l?.getUid()&&(i(!1),d(!1)),l)))},[l,c,g,i,d]),t.useEffect(()=>{C&&(c(null),g(e=>(e?.getGuid()!==C?.getGuid()&&(i(!1),d(!1)),C)))},[C,c,g,i,d]),t.useEffect(()=>{let t;return e&&(t=o()),()=>{t?.()}},[e,o])}(v,S,Y,M,j,C,r??null,F,i??null,T,G),I||k?g.jsxs("div",{className:"cc-messages-wrapper",style:ai(x,o),children:[H&&N.current?g.jsxs("div",{className:"cc-messages-wrapper__panel",style:Ai,children:[N.current," "]}):null,g.jsxs("div",{className:"cc-messages",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",position:"relative",boxSizing:"border-box",justifyContent:"space-between",borderRadius:"inherit"},children:[f?null:g.jsx("div",{className:"cc-messages__header",style:Ci,children:b||g.jsx(Wa,{user:I,group:k,subtitleView:c?.subtitleView?c.subtitleView(I,k):null,disableUsersPresence:c?.disableUsersPresence,protectedGroupIcon:c?.protectedGroupIcon,passwordGroupIcon:c?.passwordGroupIcon,privateGroupIcon:c?.privateGroupIcon,menu:$(),avatarStyle:c?.avatarStyle,statusIndicatorStyle:c?.statusIndicatorStyle,messageHeaderStyle:di(c),listItemStyle:c?.listItemStyle,backButtonIconURL:c?.backButtonIconURL,hideBackButton:c?.hideBackButton,listItemView:c?.listItemView?c.listItemView(I,k):null,onError:c?.onError,onBack:c?.onBack,disableTyping:l})}),w||g.jsx("div",{className:"cc-messages__list",style:gi,children:g.jsx(Vl,{loadingIconURL:C?.loadingIconURL,user:I,group:k,emptyStateView:C?.emptyStateView,errorStateView:C?.errorStateView,loadingStateView:C?.loadingStateView,disableSoundForMessages:A,customSoundForMessages:h,disableReceipt:C?.disableReceipt,hideReceipt:C?.hideReceipt,readIcon:C?.readIcon,deliveredIcon:C?.deliveredIcon,sentIcon:C?.sentIcon,waitIcon:C?.waitIcon,errorIcon:C?.errorIcon,alignment:C?.alignment,showAvatar:C?.showAvatar,scrollToBottomOnNewMessages:C?.scrollToBottomOnNewMessages,datePattern:C?.datePattern,timestampAlignment:C?.timestampAlignment,DateSeparatorPattern:C?.DateSeparatorPattern,templates:C?.templates,messagesRequestBuilder:C?.messagesRequestBuilder,thresholdValue:C?.thresholdValue,onThreadRepliesClick:C?.onThreadRepliesClick||_,headerView:C?.headerView,footerView:C?.footerView,avatarStyle:C?.avatarStyle,dateSeparatorStyle:C?.dateSeparatorStyle,messageListStyle:ui(C),onError:C?.onError,disableMentions:C?.disableMentions,hideDateSeparator:C?.hideDateSeparator,reactionsConfiguration:C?.reactionsConfiguration,disableReactions:C?.disableReactions,emojiKeyboardStyle:C?.emojiKeyboardStyle,threadIndicatorIcon:C?.threadIndicatorIcon,textFormatters:C?.textFormatters,messageInformationConfiguration:C?.messageInformationConfiguration,backdropStyle:C?.backdropStyle,hideError:C?.hideError})}),a?null:y||g.jsx("div",{className:"cc-messages__composer",style:{width:"100%",display:"flex"},children:a?null:g.jsx(Ha,{sendButtonIconURL:d?.sendButtonIconURL,user:I,group:k,text:d?.text,headerView:d?.headerView?d.headerView(I,k):null,onTextChange:d?.onTextChange,attachmentIconURL:d?.attachmentIconURL,attachmentOptions:d?.attachmentOptions,secondaryButtonView:d?.secondaryButtonView,auxiliaryButtonView:d?.auxilaryButtonView,auxiliaryButtonAlignment:d?.auxiliaryButtonsAlignment,sendButtonView:d?.sendButtonView,emojiIconURL:d?.emojiIconURL,hideLiveReaction:d?.hideLiveReaction,LiveReactionIconURL:d?.LiveReactionIconURL,hideLayoutMode:d?.hideLayoutMode,actionSheetStyle:d?.actionSheetStyle,messageComposerStyle:pi(d),onSendButtonClick:d?.onSendButtonClick,onError:d?.onError,disableSoundForMessages:A,customSoundForMessage:m,hideVoiceRecording:d?.hideVoiceRecording,voiceRecordingStartIconURL:d?.voiceRecordingStartIconURL,voiceRecordingCloseIconURL:d?.voiceRecordingCloseIconURL,voiceRecordingStopIconURL:d?.voiceRecordingStopIconURL,voiceRecordingSubmitIconURL:d?.voiceRecordingSubmitIconURL,AIOptionsStyle:d?.AIOptionsStyle,AIIconURL:d?.AIIconURL,userMemberWrapperConfiguration:d?.userMemberWrapperConfiguration,textFormatters:d?.textFormatters||[],disableMentions:d?.disableMentions,mentionsWarningText:d?.mentionsWarningText,mentionsWarningStyle:d?.mentionsWarningStyle,mediaRecorderStyle:d?.mediaRecorderStyle})})]}),V&&B.current?g.jsx("div",{className:"cc-messages__threaded",style:li,children:V&&B.current?g.jsx(Jl,{parentMessage:B.current,onClose:u?.onClose||X,onError:u?.onError,closeIconURL:u?.closeIconURL,bubbleView:u?.bubbleView||L.current,messageActionView:u?.messageActionView?u.messageActionView(B.current):null,messageListConfiguration:u?.messageListConfiguration,messageComposerConfiguration:u?.messageComposerConfiguration,threadedMessagesStyle:u?.threadedMessagesStyle,hideMessageComposer:u?.hideMessageComposer,messageComposerView:u?.messageComposerView,messageListView:u?.messageListView}):null}):null,R?g.jsx("div",{className:"cc-messages__live-reaction",style:{position:"absolute",bottom:"50px",right:"20px",width:"50%",height:"100%"},children:g.jsx("cometchat-live-reaction",{reactionIconURL:K,liveReactionStyle:JSON.stringify({height:"20px",width:"25px",background:d?.messageComposerStyle?.liveReactionIconTint||"red"})})}):null,O?g.jsx("div",{className:"cc-messages__details",style:ci,children:g.jsx(Wi,{user:I,group:k,closeButtonIconURL:p?.closeButtonIconURL||"./assets/close2x.svg",hideProfile:p?.hideProfile,subtitleView:p?.subtitleView,customProfileView:p?.customProfileView,data:q(),disableUsersPresence:p?.disableUsersPresence,privateGroupIcon:p?.privateGroupIcon,protectedGroupIcon:p?.protectedGroupIcon,passwordGroupIcon:p?.passwordGroupIcon,onError:p?.onError,onClose:p?.onClose||Z,leaveDialogStyle:p?.leaveDialogStyle,statusIndicatorStyle:p?.statusIndicatorStyle,avatarStyle:p?.avatarStyle,detailsStyle:hi(p),listItemStyle:p?.listItemStyle,groupMembersConfiguration:p?.groupMembersConfiguration,addMembersConfiguration:p?.addMembersConfiguration,bannedMembersConfiguration:p?.bannedMembersConfiguration,transferOwnershipConfiguration:p?.transferOwnershipConfiguration})}):null]}):null};const Wl={user:void 0,group:void 0,isMobileView:!1,messageText:"",conversationsWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),conversationsConfiguration:new r.ConversationsConfiguration({}),onError:e=>{console.log(e)},startConversationConfiguration:new r.ContactsConfiguration({}),startConversationIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FNew%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FNew%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.9288822%2C11.8990317%20L7.62932866%2C12.3710104%20L8.10043948%2C9.07071466%20L16.5857676%2C0.585763632%20C17.3668205%2C-0.195254544%2018.6331574%2C-0.195254544%2019.4142103%2C0.585763632%20C20.1952632%2C1.36678181%2020.1952632%2C2.63306247%2019.4142103%2C3.41408064%20L10.9288822%2C11.8990317%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2215.6426571%22%20y1%3D%221.52883225%22%20x2%3D%2218.4710998%22%20y2%3D%224.35714926%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16%2C12.0003604%20L16%2C18.6667267%20C16%2C19.4030732%2015.4030369%2C20%2014.6666577%2C20%20L1.33333252%2C20%20C0.596953301%2C20%200%2C19.4030732%200%2C18.6667267%20L0%2C5.33399414%20C0%2C4.59764765%200.596953301%2C4.00072088%201.33333252%2C4.00072088%20L8%2C4.00072088%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"},Zl={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},Xl={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},ql={width:"calc(100% - 280px)",height:"100%"},$l={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},ec={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},tc={width:"280px",height:"100%",position:"relative"},nc=(e,t)=>({...Xl,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),oc=(e,t,n,o)=>n?rc(o):sc(e,t),rc=e=>({...e?{visibility:"hidden"}:{visibility:"visible"},...$l,borderRadius:"inherit"}),sc=(e,t)=>{const n=e?.borderRadius||0;return{...tc,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},ic=(e,t,n)=>t?ac(n):lc(e),ac=e=>({...e?{visibility:"visible"}:{visibility:"hidden"},...$l,borderRadius:"inherit"}),lc=e=>{const t=e?.borderRadius||0;return{...ql,borderRadius:`0 ${t} ${t} 0`}},cc=(e,t)=>({...Zl,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),Cc=e=>{const t=e?.groupsStyle;return{width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...t}},gc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},dc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},uc=(e,t)=>{let n={visibility:"hidden"};return t||e||(n={visibility:"visible"}),{...ec,...n,width:"calc(100% - 280px)"}},pc=e=>e?{...$l,background:"inherit",borderRadius:"inherit"}:{width:"calc(100% - 280px)",background:"inherit",borderRadius:"inherit"},hc=(e,t)=>{const o=e?.joinGroupStyle;return{width:o?.width||"100%",height:o?.height||"100%",boxShadow:o?.boxShadow||"none",background:o?.background||"transparent",border:o?.border||"0",borderRadius:o?.borderRadius||"inherit",titleTextFont:o?.titleTextFont||n.fontHelper(t.typography.heading),titleTextColor:o?.titleTextFont||t.palette.getAccent700(),passwordInputPlaceholderTextFont:o?.passwordInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),passwordInputPlaceholderTextColor:o?.passwordInputPlaceholderTextColor||t.palette.getAccent600(),passwordInputBackground:o?.passwordInputBackground||t.palette.getAccent50(),passwordInputBorder:o?.passwordInputBorder||"none",passwordInputBorderRadius:o?.passwordInputBorderRadius||"8px",passwordInputBoxShadow:o?.passwordInputBoxShadow||`${t.palette.getAccent50()} 0 0 0 1px`,passwordInputTextFont:o?.passwordInputTextFont||n.fontHelper(t.typography.subtitle1),passwordInputTextColor:o?.passwordInputTextColor||t.palette.getAccent(),joinButtonTextFont:o?.joinButtonTextFont||n.fontHelper(t.typography.title2),joinButtonTextColor:o?.joinButtonTextColor||t.palette.getBackground(),joinButtonBackground:o?.joinButtonBackground||t.palette.getPrimary(),joinButtonBorderRadius:o?.joinButtonBorderRadius||"8px",joinButtonBorder:o?.joinButtonBorder||"none",errorTextFont:o?.errorTextFont||n.fontHelper(t.typography.subtitle1),errorTextColor:o?.errorTextFont||t.palette.getError()}},mc=(e,t,o)=>{const r=t?.messageHeaderStyle;return{background:r?.background||"inherit",border:"none",borderRadius:r?.borderRadius||e?.borderRadius||"inherit",onlineStatusColor:r?.onlineStatusColor||o.palette.getSuccess(),privateGroupIconBackground:r?.privateGroupIconBackground||o.palette.getSuccess(),passwordGroupIconBackground:r?.passwordGroupIconBackground||"RGB(247, 165, 0)",backButtonIconTint:r?.backButtonIconTint||o.palette.getPrimary(),subtitleTextColor:r?.subtitleTextColor||o.palette.getAccent600(),subtitleTextFont:r?.subtitleTextFont||n.fontHelper(o.typography.subtitle2),typingIndicatorTextColor:r?.typingIndicatorTextColor||o.palette.getPrimary(),typingIndicatorTextFont:r?.typingIndicatorTextFont||n.fontHelper(o.typography.subtitle1)}},Ac=(e,t)=>{const o=e?.listItemStyle;return{width:o?.width||"100%",height:o?.height||"45px",background:o?.background||"inherit",hoverBackground:o?.hoverBackground||"transparent",activeBackground:o?.activeBackground||"transparent",borderRadius:o?.borderRadius||"0",titleFont:o?.titleFont||n.fontHelper(t.typography.title2),titleColor:o?.titleColor||t.palette.getAccent(),border:o?.border||"none",separatorColor:o?.separatorColor||""}},xc=e=>({height:e?.height,width:e?.width,position:"absolute"}),bc=e=>{if(e)return{...$l,background:"inherit",borderRadius:"inherit"}},yc=(e,t,o)=>{let r="360px",s="500px";o&&(r="100%",s="100%");const i=e?.createGroupStyle;return{width:i?.width||r,height:i?.height||s,border:i?.border||"0 none",borderRadius:i?.borderRadius||"0",background:i?.background||t.palette.getBackground(),boxShadow:i?.boxShadow||`${t.palette.getAccent100()} 4px 16px 32px 4px`,titleTextFont:i?.titleTextFont||n.fontHelper(t.typography.heading),titleTextColor:i?.titleTextColor||t.palette.getAccent(),groupTypeTextFont:i?.groupTypeTextFont||n.fontHelper(t.typography.text3),groupTypeBorder:i?.groupTypeBorder||"0 none",groupTypeBorderRadius:i?.groupTypeBorderRadius||"0px",groupTypeTextColor:i?.groupTypeTextColor||t.palette.getAccent(),groupTypeTextBackground:i?.groupTypeTextBackground||"inherit",groupTypeBackground:i?.groupTypeBackground||t.palette.getAccent100(),groupTypeBoxShadow:i?.groupTypeBoxShadow||"",activeGroupTypeTextFont:i?.activeGroupTypeTextFont||n.fontHelper(t.typography.text3),activeGroupTypeTextColor:i?.activeGroupTypeTextColor||t.palette.getAccent(),activeGroupTypeBackground:i?.activeGroupTypeBackground||t.palette.getAccent900(),activeGroupTypeBoxShadow:i?.activeGroupTypeBoxShadow||`${t.palette.getAccent200()} 0 3px 8px 0`,activeGroupTypeBorderRadius:i?.activeGroupTypeBorderRadius||"8px",activeGroupTypeBorder:i?.activeGroupTypeBorder||"none",groupTypeTextBoxShadow:i?.groupTypeTextBoxShadow||"none",groupTypeTextBorderRadius:i?.groupTypeTextBorderRadius||"7px",closeIconTint:i?.closeIconTint||t.palette.getPrimary(),errorTextFont:i?.errorTextFont||n.fontHelper(t.typography.text2),errorTextBackground:i?.errorTextBackground||t.palette.getError(),errorTextBorderRadius:i?.errorTextBorderRadius||"8px",errorTextBorder:i?.errorTextBorder||"none",errorTextColor:i?.errorTextColor||t.palette.getError(),nameInputPlaceholderTextFont:i?.nameInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),nameInputPlaceholderTextColor:i?.nameInputPlaceholderTextColor||t.palette.getAccent600(),nameInputBackground:i?.nameInputBackground||t.palette.getAccent100(),nameInputTextFont:i?.nameInputTextFont||n.fontHelper(t.typography.subtitle1),nameInputTextColor:i?.nameInputTextColor||t.palette.getAccent(),nameInputBorder:i?.nameInputBorder||"none",nameInputBorderRadius:i?.nameInputBorderRadius||"8px",nameInputBoxShadow:i?.nameInputBoxShadow||`${t.palette.getAccent100()} 0 0 0 1px`,passwordInputPlaceholderTextFont:i?.passwordInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),passwordInputPlaceholderTextColor:i?.passwordInputPlaceholderTextColor||t.palette.getAccent600(),passwordInputBackground:i?.passwordInputBackground||t.palette.getAccent100(),passwordInputBorder:i?.passwordInputBorder||"none",passwordInputBorderRadius:i?.passwordInputBorderRadius||"8px",passwordInputBoxShadow:i?.passwordInputBoxShadow||`${t.palette.getAccent100()} 0 0 0 1px`,passwordInputTextFont:i?.passwordInputTextFont||n.fontHelper(t.typography.subtitle1),passwordInputTextColor:i?.passwordInputTextColor||t.palette.getAccent(),createGroupButtonTextFont:i?.createGroupButtonTextFont||n.fontHelper(t.typography.title2),createGroupButtonTextColor:i?.createGroupButtonTextColor||t.palette.getAccent("dark"),createGroupButtonBackground:i?.createGroupButtonBackground||t.palette.getPrimary(),createGroupButtonBorderRadius:i?.createGroupButtonBorderRadius||"8px",createGroupButtonBorder:i?.createGroupButtonBorder||"none"}},wc=e=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:`${e.palette.getPrimary()}`,padding:"0"});const fc=ye({tagName:"cometchat-create-group",elementClass:o.CometChatCreateGroup,react:t}),Dc={group:void 0,isMobileView:!1,messageText:"",groupsWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),groupsConfiguration:new r.GroupsConfiguration({}),createGroupConfiguration:new r.CreateGroupConfiguration({}),joinGroupConfiguration:new r.JoinGroupConfiguration({}),onError:e=>{console.log(e)}},Ec={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},vc={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},Sc={width:"calc(100% - 280px)",height:"100%"},Ic={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},Fc={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},kc={width:"280px",height:"100%",position:"relative"},Tc=(e,t)=>({...vc,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),Mc=(e,t,n,o)=>n?Bc(o):Lc(e,t),Bc=e=>({...e?{visibility:"hidden"}:{visibility:"visible"},...Ic,borderRadius:"inherit"}),Lc=(e,t)=>{const n=e?.borderRadius||0;return{...kc,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},Uc=(e,t,n)=>t?Rc(n):Pc(e),Rc=e=>({...e?{visibility:"visible"}:{visibility:"hidden"},...Ic,borderRadius:"inherit"}),Pc=e=>{const t=e?.borderRadius||0;return{...Sc,borderRadius:`0 ${t} ${t} 0`}},Oc=(e,t)=>({...Ec,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),jc=e=>{const t=e?.usersStyle;return{width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...t}},Vc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},Gc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},Hc=(e,t)=>{let n={visibility:"hidden"};return t||e||(n={visibility:"visible"}),{...Fc,...n,width:"calc(100% - 280px)"}},Qc=(e,t)=>{const n=e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle.width||"320px",o=e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle.height||"620px";return{...e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle,width:t?"100vw":n,height:t?"100vh":o}};const Nc={user:void 0,isMobileView:!1,messageText:"",usersWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),usersConfiguration:new r.UsersConfiguration({}),onError:e=>{console.log(e)}};class Kc extends r.BaseStyle{constructor(e){super({}),this.tabListHeight="100%",this.tabListWidth="100%",this.tabListBorder="0 none",this.tabListBorderRadius="0",this.tabListBackground="transparent",this.tabListBoxShadow="0",this.tabListPadding="0",this.tabPaneWidth="100%",this.tabPaneHeight="100%",Object.assign(this,e)}}Object.defineProperty(exports,"ActionSheetStyle",{enumerable:!0,get:function(){return o.ActionSheetStyle}}),Object.defineProperty(exports,"AvatarStyle",{enumerable:!0,get:function(){return o.AvatarStyle}}),Object.defineProperty(exports,"BackdropStyle",{enumerable:!0,get:function(){return o.BackdropStyle}}),Object.defineProperty(exports,"BadgeStyle",{enumerable:!0,get:function(){return o.BadgeStyle}}),Object.defineProperty(exports,"ButtonGroupStyle",{enumerable:!0,get:function(){return o.ButtonGroupStyle}}),Object.defineProperty(exports,"CallscreenStyle",{enumerable:!0,get:function(){return o.CallscreenStyle}}),Object.defineProperty(exports,"CardStyle",{enumerable:!0,get:function(){return o.CardStyle}}),Object.defineProperty(exports,"ChangeScopeStyle",{enumerable:!0,get:function(){return o.ChangeScopeStyle}}),Object.defineProperty(exports,"CheckboxStyle",{enumerable:!0,get:function(){return o.CheckboxStyle}}),Object.defineProperty(exports,"CometChatActionItem",{enumerable:!0,get:function(){return o.CometChatActionItem}}),Object.defineProperty(exports,"CometChatActionSheet",{enumerable:!0,get:function(){return o.CometChatActionSheet}}),Object.defineProperty(exports,"CometChatAvatar",{enumerable:!0,get:function(){return o.CometChatAvatar}}),Object.defineProperty(exports,"CometChatBackdrop",{enumerable:!0,get:function(){return o.CometChatBackdrop}}),Object.defineProperty(exports,"CometChatBadge",{enumerable:!0,get:function(){return o.CometChatBadge}}),Object.defineProperty(exports,"CometChatButton",{enumerable:!0,get:function(){return o.CometChatButton}}),Object.defineProperty(exports,"CometChatButtonGroup",{enumerable:!0,get:function(){return o.CometChatButtonGroup}}),Object.defineProperty(exports,"CometChatCallscreenWrapper",{enumerable:!0,get:function(){return o.CometChatCallscreenWrapper}}),Object.defineProperty(exports,"CometChatCard",{enumerable:!0,get:function(){return o.CometChatCard}}),Object.defineProperty(exports,"CometChatChangeScope",{enumerable:!0,get:function(){return o.CometChatChangeScope}}),Object.defineProperty(exports,"CometChatCheckbox",{enumerable:!0,get:function(){return o.CometChatCheckbox}}),Object.defineProperty(exports,"CometChatConfirmDialog",{enumerable:!0,get:function(){return o.CometChatConfirmDialog}}),Object.defineProperty(exports,"CometChatContextMenu",{enumerable:!0,get:function(){return o.CometChatContextMenu}}),Object.defineProperty(exports,"CometChatCreateGroup",{enumerable:!0,get:function(){return o.CometChatCreateGroup}}),Object.defineProperty(exports,"CometChatDate",{enumerable:!0,get:function(){return o.CometChatDate}}),Object.defineProperty(exports,"CometChatDivider",{enumerable:!0,get:function(){return o.CometChatDivider}}),Object.defineProperty(exports,"CometChatDocumentBubble",{enumerable:!0,get:function(){return o.CometChatDocumentBubble}}),Object.defineProperty(exports,"CometChatDraggable",{enumerable:!0,get:function(){return o.CometChatDraggable}}),Object.defineProperty(exports,"CometChatDropdown",{enumerable:!0,get:function(){return o.CometChatDropdown}}),Object.defineProperty(exports,"CometChatEmoji",{enumerable:!0,get:function(){return o.CometChatEmoji}}),Object.defineProperty(exports,"CometChatEmojiKeyboard",{enumerable:!0,get:function(){return o.CometChatEmojiKeyboard}}),Object.defineProperty(exports,"CometChatFullScreenViewer",{enumerable:!0,get:function(){return o.CometChatFullScreenViewer}}),Object.defineProperty(exports,"CometChatIcon",{enumerable:!0,get:function(){return o.CometChatIcon}}),Object.defineProperty(exports,"CometChatIconButton",{enumerable:!0,get:function(){return o.CometChatIconButton}}),Object.defineProperty(exports,"CometChatInput",{enumerable:!0,get:function(){return o.CometChatInput}}),Object.defineProperty(exports,"CometChatJoinGroup",{enumerable:!0,get:function(){return o.CometChatJoinGroup}}),Object.defineProperty(exports,"CometChatLabel",{enumerable:!0,get:function(){return o.CometChatLabel}}),Object.defineProperty(exports,"CometChatListItem",{enumerable:!0,get:function(){return o.CometChatListItem}}),Object.defineProperty(exports,"CometChatLiveReaction",{enumerable:!0,get:function(){return o.CometChatLiveReaction}}),Object.defineProperty(exports,"CometChatLoader",{enumerable:!0,get:function(){return o.CometChatLoader}}),Object.defineProperty(exports,"CometChatMediaRecorder",{enumerable:!0,get:function(){return o.CometChatMediaRecorder}}),Object.defineProperty(exports,"CometChatMenuList",{enumerable:!0,get:function(){return o.CometChatMenuList}}),Object.defineProperty(exports,"CometChatMessageInput",{enumerable:!0,get:function(){return o.CometChatMessageInput}}),Object.defineProperty(exports,"CometChatModal",{enumerable:!0,get:function(){return o.CometChatModal}}),Object.defineProperty(exports,"CometChatPopover",{enumerable:!0,get:function(){return o.CometChatPopover}}),Object.defineProperty(exports,"CometChatPreview",{enumerable:!0,get:function(){return o.CometChatPreview}}),Object.defineProperty(exports,"CometChatQuickView",{enumerable:!0,get:function(){return o.CometChatQuickView}}),Object.defineProperty(exports,"CometChatRadioButton",{enumerable:!0,get:function(){return o.CometChatRadioButton}}),Object.defineProperty(exports,"CometChatReceipt",{enumerable:!0,get:function(){return o.CometChatReceipt}}),Object.defineProperty(exports,"CometChatSearchInput",{enumerable:!0,get:function(){return o.CometChatSearchInput}}),Object.defineProperty(exports,"CometChatSingleSelect",{enumerable:!0,get:function(){return o.CometChatSingleSelect}}),Object.defineProperty(exports,"CometChatStatusIndicator",{enumerable:!0,get:function(){return o.CometChatStatusIndicator}}),Object.defineProperty(exports,"CometChatTextInput",{enumerable:!0,get:function(){return o.CometChatTextInput}}),Object.defineProperty(exports,"ConfirmDialogStyle",{enumerable:!0,get:function(){return o.ConfirmDialogStyle}}),Object.defineProperty(exports,"ContextMenuStyle",{enumerable:!0,get:function(){return o.ContextMenuStyle}}),Object.defineProperty(exports,"CreateGroupStyle",{enumerable:!0,get:function(){return o.CreateGroupStyle}}),Object.defineProperty(exports,"DateStyle",{enumerable:!0,get:function(){return o.DateStyle}}),Object.defineProperty(exports,"DocumentBubbleStyle",{enumerable:!0,get:function(){return o.DocumentBubbleStyle}}),Object.defineProperty(exports,"DropdownStyle",{enumerable:!0,get:function(){return o.DropdownStyle}}),Object.defineProperty(exports,"EmojiKeyboardStyle",{enumerable:!0,get:function(){return o.EmojiKeyboardStyle}}),Object.defineProperty(exports,"Emojis",{enumerable:!0,get:function(){return o.Emojis}}),Object.defineProperty(exports,"FileBubbleStyle",{enumerable:!0,get:function(){return o.FileBubbleStyle}}),Object.defineProperty(exports,"FullScreenViewerStyle",{enumerable:!0,get:function(){return o.FullScreenViewerStyle}}),Object.defineProperty(exports,"IconStyle",{enumerable:!0,get:function(){return o.IconStyle}}),Object.defineProperty(exports,"ImageBubbleStyle",{enumerable:!0,get:function(){return o.ImageBubbleStyle}}),Object.defineProperty(exports,"InputStyle",{enumerable:!0,get:function(){return o.InputStyle}}),Object.defineProperty(exports,"JoinGroupStyle",{enumerable:!0,get:function(){return o.JoinGroupStyle}}),Object.defineProperty(exports,"LabelStyle",{enumerable:!0,get:function(){return o.LabelStyle}}),Object.defineProperty(exports,"ListItemStyle",{enumerable:!0,get:function(){return o.ListItemStyle}}),Object.defineProperty(exports,"LoaderStyle",{enumerable:!0,get:function(){return o.LoaderStyle}}),Object.defineProperty(exports,"MediaRecorderStyle",{enumerable:!0,get:function(){return o.MediaRecorderStyle}}),Object.defineProperty(exports,"MenuListStyle",{enumerable:!0,get:function(){return o.MenuListStyle}}),Object.defineProperty(exports,"MessageInputStyle",{enumerable:!0,get:function(){return o.MessageInputStyle}}),Object.defineProperty(exports,"ModalStyle",{enumerable:!0,get:function(){return o.ModalStyle}}),Object.defineProperty(exports,"PopoverStyle",{enumerable:!0,get:function(){return o.PopoverStyle}}),Object.defineProperty(exports,"PreviewStyle",{enumerable:!0,get:function(){return o.PreviewStyle}}),Object.defineProperty(exports,"QuickViewStyle",{enumerable:!0,get:function(){return o.QuickViewStyle}}),Object.defineProperty(exports,"RadioButtonStyle",{enumerable:!0,get:function(){return o.RadioButtonStyle}}),Object.defineProperty(exports,"ReceiptStyle",{enumerable:!0,get:function(){return o.ReceiptStyle}}),Object.defineProperty(exports,"SearchInputStyle",{enumerable:!0,get:function(){return o.SearchInputStyle}}),Object.defineProperty(exports,"SingleSelectStyle",{enumerable:!0,get:function(){return o.SingleSelectStyle}}),Object.defineProperty(exports,"TextBubbleStyle",{enumerable:!0,get:function(){return o.TextBubbleStyle}}),Object.defineProperty(exports,"TextInputStyle",{enumerable:!0,get:function(){return o.TextInputStyle}}),Object.defineProperty(exports,"auxiliaryButtonAlignmentEnum",{enumerable:!0,get:function(){return o.auxiliaryButtonAlignmentEnum}}),Object.defineProperty(exports,"layoutType",{enumerable:!0,get:function(){return o.layoutType}}),exports.AIAssistBotDecorator=ct,exports.AIAssistBotExtension=Ct,exports.AIConversationStarterDecorator=yt,exports.AIConversationStarterExtension=wt,exports.AIConversationSummaryDecorator=Ft,exports.AIConversationSummaryExtension=kt,exports.AIExtensionDataSource=Le,exports.AISmartRepliesDecorator=Vt,exports.AISmartRepliesExtension=Gt,exports.CallingExtension=Cn,exports.CallingExtensionDecorator=cn,exports.ChatConfigurator=Be,exports.CollaborativeDocumentConfiguration=class{constructor(e){let{style:t,iconURL:n,optionIconURL:o,optionStyle:r}=e;this.style=t,this.iconURL=n,this.optionIconURL=o,this.optionStyle=r}getDocumentBubbleStyle(){return this.style}getIconURL(){return this.iconURL}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.CollaborativeDocumentExtension=hn,exports.CollaborativeDocumentExtensionDecorator=pn,exports.CollaborativeWhiteBoardExtensionDecorator=xn,exports.CollaborativeWhiteboardConfiguration=class{constructor(e){let{style:t,iconURL:n,optionIconURL:o,optionStyle:r}=e;this.style=t,this.iconURL=n,this.optionIconURL=o,this.optionStyle=r}getWhiteboardBubbleStyle(){return this.style}getIconURL(){return this.iconURL}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.CollaborativeWhiteboardExtension=bn,exports.CometChatAddMembers=Tr,exports.CometChatAvatarView=ol,exports.CometChatBannedMembers=Yr,exports.CometChatButtonView=$a,exports.CometChatCallButtons=sn,exports.CometChatCallLogDetails=Ar,exports.CometChatCallLogHistory=Wo,exports.CometChatCallLogParticipants=sr,exports.CometChatCallLogRecordings=hr,exports.CometChatCallLogs=Bo,exports.CometChatCallLogsWithDetails=e=>{const{isMobileView:o,messageText:r,withDetailsStyle:s,callLogDetailsConfiguration:i,callLogsConfiguration:a}={...yr,...e},{theme:l}=t.useContext(U),[c,C]=t.useState(null),d=t.useCallback(e=>{C(e)},[C]),u=t.useCallback(()=>o?{width:"100%",display:c?"none":"block"}:{width:"280px",minWidth:"max(25%, 280px)"},[o,c]),p=t.useCallback(()=>o?{width:"100%",display:c?"block":"none"}:{width:"calc(100% - 280px)"},[o,c]),h=t.useCallback(()=>{C(null)},[C]);return function(e,n,o,r,s){t.useEffect(()=>{if(e.callLogDetailsStyle={...e.callLogDetailsStyle,border:`1px solid ${s?.palette?.getAccent100()}`},r){const t=()=>{o(null)};e.onBackClick=t}},[e,r,o]),t.useEffect(()=>{n.callLogsStyle={...n.callLogsStyle,border:`1px solid ${s?.palette?.getAccent100()}`}},[n])}(i,a,C,o,l),g.jsxs("div",{style:xr(l,s),children:[g.jsx("div",{style:u(),children:g.jsx(Bo,{title:n.localize("CALLS"),onInfoClick:a?.onInfoClick||d,activeCall:c,titleAlignment:a?.titleAlignment,listItemView:a?.listItemView,subtitleView:a?.subtitleView,tailView:a?.tailView,emptyStateView:a?.emptyStateView,errorStateView:a?.errorStateView,loadingIconURL:a?.loadingIconURL,loadingStateView:a?.loadingStateView,callLogRequestBuilder:a?.callLogRequestBuilder,onItemClick:a?.onItemClick||void 0,onError:a?.onError||void 0,listItemStyle:a?.listItemStyle,infoIconUrl:a?.infoIconUrl,datePattern:a?.datePattern,dateSeparatorPattern:a?.dateSeparatorPattern,incomingAudioCallIconUrl:a?.incomingAudioCallIconUrl,incomingVideoCallIconUrl:a?.incomingVideoCallIconUrl,outgoingAudioCallIconUrl:a?.outgoingAudioCallIconUrl,outgoingVideoCallIconUrl:a?.outgoingVideoCallIconUrl,missedAudioCallIconUrl:a?.missedAudioCallIconUrl,missedVideoCallIconUrl:a?.missedVideoCallIconUrl,callLogsStyle:a?.callLogsStyle,avatarStyle:a?.avatarStyle,hideSeparator:a?.hideSeparator,outgoingCallConfiguration:a?.outgoingCallConfiguration})}),g.jsx("div",{style:p(),children:c?g.jsx(Ar,{title:n.localize("CALL_DETAIL"),call:c,onBackClick:()=>i?.onBackClick||h,backIconUrl:i?.backIconUrl,avatarStyle:i?.avatarStyle,data:i?.data||void 0,callLogHistoryConfiguration:i?.callLogHistoryConfiguration,callLogParticipantsConfiguration:i?.callLogParticipantsConfiguration,callLogRecordingsConfiguration:i?.callLogRecordingsConfiguration,callLogDetailsStyle:i?.callLogDetailsStyle}):g.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"},children:g.jsx("cometchat-label",{text:r,labelStyle:JSON.stringify(br(l,s))})})})]})},exports.CometChatContacts=ii,exports.CometChatConversations=bs,exports.CometChatConversationsWithMessages=e=>{const{theme:o}=t.useContext(U),{user:i,group:a,isMobileView:l,messageText:c,conversationsWithMessagesStyle:C,messagesConfiguration:d,conversationsConfiguration:u,startConversationConfiguration:p,onError:h,startConversationIconURL:m}={...Wl,...e},[b,y]=t.useState(null),[w,f]=t.useState(null),[D,E]=t.useState(i??null),[v,S]=t.useState(a??null),[I,F]=t.useState(!1),k=t.useRef(null),T=x(h);k.current=w;const[M,B]=A(null),L=t.useCallback(async()=>{try{let e=D?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,t=D?D?.getUid():v?.getGuid();"string"==typeof t&&f(await s.CometChat.getConversation(t,e))}catch(e){T(e)}},[D,v,f,T]),R=()=>{E(null),S(null),f(null)},P=e=>{try{if(k.current=e,f(e),e.getConversationType()&&e.getConversationType()===n.CometChatUIKitConstants.MessageReceiverType.user)S(null),E(e.getConversationWith());else{if(!e.getConversationType()||e.getConversationType()!==n.CometChatUIKitConstants.MessageReceiverType.group)return;E(null),S(e.getConversationWith())}}catch(e){T(e)}},O=t.useCallback((e,t,n)=>{const o=k.current,r=b||n,i=r?.getUid()===t.getUid(),a=e.getActionFor()instanceof s.CometChat.Group;if(i&&o&&o.getConversationWith()instanceof s.CometChat.Group){let t=o.getConversationWith();if(a){e.getActionFor().getGuid()===t.getGuid()&&(f(null),S(null),E(null))}}},[b,y,D,v,k]),j=t.useCallback(e=>{try{const t=e.getConversationType(),o=e.getConversationWith();if(t===n.CometChatUIKitConstants.MessageReceiverType.user&&D&&D.getUid()===o.getUid())E(null);else{if(t!==n.CometChatUIKitConstants.MessageReceiverType.group||!v||v.getGuid()!==o.getGuid())return;S(null)}}catch(e){T(e)}},[v,S,D,E,T]),V=t.useCallback(()=>{try{const e=n.CometChatConversationEvents.ccConversationDeleted.subscribe(e=>{j(e)}),t=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{v&&v.getGuid()===e.getGuid()&&(f(null),S(null))}),o=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{v&&v.getGuid()===e?.userAddedIn.getGuid()&&S(e?.userAddedIn)}),i=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{v&&v.getGuid()===e?.kickedFrom.getGuid()&&S(e?.kickedFrom)}),a=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{v&&v.getGuid()===e?.joinedGroup.getGuid()&&S(e?.joinedGroup)}),l=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{v&&v.getGuid()===e?.kickedFrom.getGuid()&&S(e?.kickedFrom)}),c=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{v&&v.getGuid()===e?.group.getGuid()&&(S(e?.group),f(t=>{if(t){let n=r.CometChatUIKitUtility.clone(t);return n.setConversationWith(e?.group),n}return t}))}),C=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{v&&v.getGuid()===e?.leftGroup.getGuid()&&b?.getUid()===e?.userLeft?.getUid()&&(S(null),f(null))}),g=n.CometChatUIEvents.ccOpenChat.subscribe(e=>{const t=e.user?.getUid();t&&s.CometChat.getConversation(t,n.CometChatUIKitConstants.MessageReceiverType.user).then(e=>{P(e)})});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe(),C?.unsubscribe(),g?.unsubscribe()}catch(e){T(e)}}}catch(e){T(e)}},[v,f,S,j,T,b]),G=()=>F(!1),H=I?null:g.jsx("cometchat-button",{ref:B,iconURL:m,buttonStyle:JSON.stringify(Gs(I,o)),children:" "}),Q=(e,t)=>{e?(S(null),E(e),G()):t&&(E(null),S(t),G())};return function(e,n,o,r,i,a,l,c,C,g,d,u,p,h){t.useEffect(()=>{let e;s.CometChat.getLoggedinUser().then(t=>(h&&(e=h(t)),n(t),()=>{e&&e()}),e=>{r(e)})},[n,r]),t.useEffect(()=>{let t;return e&&(t=o(),i()),()=>{t?.()}},[e,a,l,i,o]),t.useEffect(()=>{if(!c)return;async function e(){g?d():C()}const t="cc-button-clicked";return c.addEventListener(t,e),()=>{c.removeEventListener(t,e)}},[c,C,d,g]),t.useEffect(()=>{u(a)},[a,u]),t.useEffect(()=>{p(l)},[l,p])}(b,y,V,T,L,i,a,M,()=>F(!0),I,G,E,S,e=>{const t="ConversationWithMessages_Group_"+String(Date.now());return s.CometChat.addGroupListener(t,new s.CometChat.GroupListener({onGroupMemberKicked:(t,n)=>{O(t,n,e)},onGroupMemberBanned:(t,n)=>{O(t,n,e)}})),()=>s.CometChat.removeGroupListener(t)}),g.jsxs("div",{className:"cc-conversations-with-messages__wrapper",style:Ss(C,o),children:[g.jsx("div",{className:"cc-conversations-with-messages__sidebar",style:Is(C,o,l,D,v),children:g.jsx(bs,{activeConversation:w??void 0,onItemClick:u?.onItemClick||P,conversationsStyle:Us(u),subtitleView:u?.subtitleView,options:u?.options??void 0,disableUsersPresence:u?.disableUsersPresence,disableReceipt:u?.disableReceipt,hideReceipt:u?.hideReceipt,disableTyping:u?.disableTyping,deliveredIcon:u?.deliveredIcon,readIcon:u?.readIcon,waitIcon:u?.waitIcon,errorIcon:u?.errorIcon,datePattern:u?.datePattern,receiptStyle:u?.receiptStyle,sentIcon:u?.sentIcon,privateGroupIcon:u?.privateGroupIcon,protectedGroupIcon:u?.protectedGroupIcon,passwordGroupIcon:u?.passwordGroupIcon,customSoundForMessages:u?.customSoundForMessages,conversationsRequestBuilder:u?.conversationsRequestBuilder,emptyStateView:u?.emptyStateView,onSelect:u?.onSelect,loadingIconURL:u?.loadingIconURL,errorStateView:u?.errorStateView,loadingStateView:u?.loadingStateView,titleAlignment:u?.titleAlignment,listItemView:u?.listItemView,menus:u?.menu||H,hideSeparator:u?.hideSeparator,hideError:u?.hideError,selectionMode:u?.selectionMode,disableSoundForMessages:u?.disableSoundForMessages,deleteConversationDialogStyle:u?.deleteConversationDialogStyle,avatarStyle:u?.avatarStyle,statusIndicatorStyle:u?.statusIndicatorStyle,badgeStyle:u?.badgeStyle,dateStyle:u?.dateStyle,listItemStyle:u?.listItemStyle,backdropStyle:Vs(C,u),disableMentions:u?.disableMentions,textFormatters:u?.textFormatters})}),I||!D&&!v?null:g.jsx("div",{className:"cc-conversations-with-messages__main",style:Ts(C,l,D,v),children:g.jsx(_l,{auxiliaryMenu:d?.messageHeaderConfiguration.menu,user:D??void 0,group:v??void 0,messageHeaderConfiguration:{...d?.messageHeaderConfiguration,onBack:d?.messageHeaderConfiguration?.onBack||R,hideBackButton:!l,messageHeaderStyle:{...Rs(C,d,l),...d?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:d?.messageListConfiguration,messageComposerConfiguration:{...d?.messageComposerConfiguration,messageComposerStyle:{...Ps(C,d,l),...d?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:Os(d?.messagesStyle,C),customSoundForIncomingMessages:d?.customSoundForIncomingMessages,customSoundForOutgoingMessages:d?.customSoundForOutgoingMessages,detailsConfiguration:d?.detailsConfiguration,disableSoundForMessages:d?.disableSoundForMessages,disableTyping:d?.disableTyping,hideMessageComposer:d?.hideMessageComposer,hideMessageHeader:d?.hideMessageHeader,messageComposerView:d?.messageComposerView?d?.messageComposerView(D,v):null,messageHeaderView:d?.messageHeaderView?d?.messageHeaderView(D,v):null,messageListView:d?.messageListView?d?.messageListView(D,v):null,hideDetails:d?.hideDetails,threadedMessagesConfiguration:d?.threadedMessageConfiguration})}),I||D||v?null:(()=>{const e=c||n.localize("NO_CHATS_SELECTED");return g.jsx("div",{className:"cc-decorator-message--empty",style:js(l,D,v),children:g.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(Ls(C,o))})})})(),I&&g.jsx(ii,{title:n.localize("NEW_CHAT"),usersTabTitle:n.localize("USERS"),groupsTabTitle:n.localize("GROUPS"),closeIconURL:p?.closeIconURL?p?.closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onItemClick:Q,onClose:p?.onClose?p?.onClose:G,tabVisibility:p?.tabVisibility,usersConfiguration:p?.usersConfiguration,groupsConfiguration:p?.groupsConfiguration,contactsStyle:p?.contactsStyle,hideSubmitButton:p?.hideSubmitButton,selectionLimit:p?.selectionLimit,selectionMode:p?.selectionMode,onSubmitButtonClick:p?.onSubmitButtonClick})]})},exports.CometChatDateView=el,exports.CometChatDetails=Wi,exports.CometChatEmojiKeyboardView=Xa,exports.CometChatGroupMembers=he,exports.CometChatGroups=ri,exports.CometChatGroupsWithMessages=e=>{const{theme:r}=t.useContext(U),{group:i,isMobileView:a,messageText:l,groupsWithMessagesStyle:c,messagesConfiguration:C,groupsConfiguration:d,createGroupConfiguration:u,joinGroupConfiguration:p,onError:h}={...Dc,...e},m=u?.createClick,b=p?.onError,y=p?.joinClick,[w,f]=t.useState(null),[D,E]=A(null),[v,S]=A(null),I=t.useRef(null),[F,k]=t.useState(!1),[T,M]=t.useState(!1),B=t.useRef(void 0),[L,R]=t.useState(i??void 0),[P,O]=t.useState(null),j=x(h),V=ye({tagName:"cometchat-join-group",elementClass:o.CometChatJoinGroup,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),G=t.useCallback(()=>{k(!1)},[]),H=()=>{B.current=void 0,M(!1)},Q=e=>{try{if(O(null),M(!1),e.getHasJoined())return void R(e);if(e.getType()===n.CometChatUIKitConstants.GroupTypes.password)return R(void 0),B.current=e,void M(!0);s.CometChat.joinGroup(e).then(e=>{n.CometChatGroupEvents.ccGroupMemberJoined.next({joinedUser:w,joinedGroup:e}),R(e)},e=>{j(e)})}catch(e){j(e)}},N=t.useCallback(e=>{try{let t=e?.detail?.response;M(!1),B.current=void 0,t&&R(t)}catch(e){j(e)}},[R,B,M,j]),K=t.useCallback(()=>{try{const e=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{L&&L.getGuid()===e.getGuid()&&R(void 0)}),t=n.CometChatGroupEvents.ccGroupCreated.subscribe(e=>{e&&(R(e),k(!1))}),o=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{L&&L.getGuid()===e?.userAddedIn.getGuid()&&(R(e?.userAddedIn),k(!1))}),r=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{L&&L.getGuid()===e?.kickedFrom.getGuid()&&R(e?.kickedFrom)}),s=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{B.current&&B.current.getGuid()===e?.joinedGroup.getGuid()&&(H(),R(e?.joinedGroup))}),i=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{L&&L.getGuid()===e?.kickedFrom.getGuid()&&R(e?.kickedFrom)}),a=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{L&&L.getGuid()===e?.group.getGuid()&&R(e?.group)}),l=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{L&&L.getGuid()===e?.leftGroup.getGuid()&&w?.getUid()===e?.userLeft?.getUid()&&R(void 0)}),c=n.CometChatUIEvents.ccOpenChat.subscribe(e=>{const t=e.user;t&&(R(void 0),O(t))});return()=>{e.unsubscribe(),o.unsubscribe(),r.unsubscribe(),s.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),t.unsubscribe(),c.unsubscribe()}}catch(e){j(e)}},[L,R,B,O,k,j,w]),z=t.useCallback(e=>{if(!a)return null;let t=p?.messageHeaderConfiguration;return g.jsx("div",{slot:"headerView",style:{position:"absolute",top:"0",left:"0"},children:g.jsx(Wa,{group:e,subtitleView:t?.subtitleView?t?.subtitleView(null,e):null,disableUsersPresence:t?.disableUsersPresence,protectedGroupIcon:t?.protectedGroupIcon,passwordGroupIcon:t?.passwordGroupIcon,privateGroupIcon:t?.privateGroupIcon,menu:t?.menu,messageHeaderStyle:mc(c,t,r),backButtonIconURL:t?.backButtonIconURL,hideBackButton:t?.hideBackButton||!1,onError:t?.onError,onBack:t?.onBack||H,listItemStyle:Ac(t,r),statusIndicatorStyle:t?.statusIndicatorStyle,avatarStyle:t?.avatarStyle})})},[c,a,p?.messageHeaderConfiguration,r]),J=()=>g.jsx(fc,{createGroupStyle:yc(u,r,a),closeButtonIconURL:u?.closeButtonIconURL,ref:E,hideCloseButton:u?.hideCloseButton||!1});const Y=t.useCallback(()=>g.jsx("cometchat-icon-button",{iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%229%22%20y1%3D%220%22%20x2%3D%229%22%20y2%3D%2218%22%20id%3D%22Path-10%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%229%22%20x2%3D%2218%22%20y2%3D%229%22%20id%3D%22Path-11%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hoverText:n.localize("CREATE_GROUP"),buttonStyle:JSON.stringify(wc(r)),ref:I}),[r]);return function(e,n,o,r,i,a,l,c,C,g,d,u,p,h,m,A,x,b,y){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{n(e)},e=>{r(e)})},[n,r]),t.useEffect(()=>{if(e)return o()},[e,o]),t.useEffect(()=>{const e=u.current;if(!e)return;const t=()=>{p()};return e.addEventListener("cc-button-clicked",t),()=>{e.removeEventListener("cc-button-clicked",t)}},[p,u]),t.useEffect(()=>{i?(C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.hideBackButton=!1),a?.messageHeaderConfiguration&&(a.messageHeaderConfiguration.hideBackButton=!1)):(C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.hideBackButton=!0),a?.messageHeaderConfiguration&&(a.messageHeaderConfiguration.hideBackButton=!0))},[i,a,C]),t.useEffect(()=>{c(l)},[l,c]),t.useEffect(()=>{C?.messageHeaderConfiguration?.onBack||C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.onBack=g)},[C,g]),t.useEffect(()=>{if(!m)return;const e="cc-joingroup-joined",t=e=>A(e);return m.addEventListener(e,t),()=>{m.removeEventListener(e,t)}},[m,A]),t.useEffect(()=>{if(!d)return;const e="cc-creategroup-close-clicked",t=()=>h();return d.addEventListener(e,t),()=>{d.removeEventListener(e,t)}},[d,h]),t.useEffect(()=>{if(d)return x?(d.createClick=x,()=>{d.createClick=null}):void 0},[x,d]),t.useEffect(()=>{if(m)return y?(m.joinClick=y,()=>{m.joinClick=null}):void 0},[y,m]),t.useEffect(()=>{if(m)return b?(m.onError=b,()=>{m.onError=null}):void 0},[b,m])}(w,f,K,j,a,p,i,R,C,()=>{O(null),R(void 0)},D,I,()=>k(!0),G,v,N,m,b,y),g.jsx(g.Fragment,{children:g.jsxs("div",{className:"cc-groups-with-messages__wrapper",style:nc(c,r),children:[g.jsx("div",{className:"cc-groups-with-messages__sidebar",style:oc(c,r,a,L),children:g.jsx(ri,{activeGroup:L??void 0,hideSearch:d?.hideSearch,searchIconURL:d?.searchIconURL,searchRequestBuilder:d?.searchRequestBuilder,onItemClick:d?.onItemClick||Q,groupsStyle:Cc(d),subtitleView:d?.subtitleView,options:d?.options??void 0,privateGroupIcon:d?.privateGroupIcon,passwordGroupIcon:d?.passwordGroupIcon,groupsRequestBuilder:d?.groupsRequestBuilder,emptyStateView:d?.emptyStateView,onSelect:d?.onSelect,loadingIconURL:d?.loadingIconURL,errorStateView:d?.errorStateView,loadingStateView:d?.loadingStateView,titleAlignment:d?.titleAlignment,listItemView:d?.listItemView,menus:d?.menu||Y(),hideSeparator:d?.hideSeparator,hideError:d?.hideError,selectionMode:d?.selectionMode,listItemStyle:d?.listItemStyle,avatarStyle:d?.avatarStyle,statusIndicatorStyle:d?.statusIndicatorStyle})}),L||P?g.jsx("div",{className:"cc-groups-with-messages__main",style:ic(c,a,L),children:g.jsx(_l,{user:P||void 0,group:L||void 0,messageHeaderConfiguration:{...C?.messageHeaderConfiguration,onBack:C?.messageHeaderConfiguration?.onBack||H,hideBackButton:C?.messageHeaderConfiguration?.hideBackButton||!a,messageHeaderStyle:{...gc(c,C,a),...C?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:C?.messageListConfiguration,messageComposerConfiguration:{...C?.messageComposerConfiguration,messageComposerStyle:{...dc(c,C,a),...C?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:(_=C?.messagesStyle,W=c,{background:W?.background,..._}),customSoundForIncomingMessages:C?.customSoundForIncomingMessages,customSoundForOutgoingMessages:C?.customSoundForOutgoingMessages,detailsConfiguration:C?.detailsConfiguration,disableSoundForMessages:C?.disableSoundForMessages,disableTyping:C?.disableTyping,hideMessageComposer:C?.hideMessageComposer,hideMessageHeader:C?.hideMessageHeader,messageComposerView:C?.messageComposerView?C?.messageComposerView(P,L):null,messageHeaderView:C?.messageHeaderView?C?.messageHeaderView(P,L):null,messageListView:C?.messageListView?C?.messageListView(P,L):null,hideDetails:C?.hideDetails,threadedMessagesConfiguration:C?.threadedMessageConfiguration})}):null,L||P||T||B.current?null:(()=>{const e=l||n.localize("SELECT__GROUP");return g.jsx("div",{className:"cc-decorator-message--empty",style:uc(a,L),children:g.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(cc(c,r))})})})(),T&&!P&&!L&&B.current?g.jsx("div",{className:"cc-withmessages__joingroup",style:pc(a),children:g.jsx(V,{group:B.current,joinGroupStyle:hc(p,r),children:z(B.current)})}):null,F?a?g.jsx("div",{className:"cc-withmessages__creategroup",style:bc(a),children:J()}):g.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(xc(c)),children:J()}):null]})});var _,W},exports.CometChatIconButtonView=qa,exports.CometChatIncomingCall=e=>{const{call:i,disableSoundForCalls:a=!1,customSoundForCalls:l="",onAccept:c,onDecline:C,acceptButtonText:d=n.localize("ACCEPT"),declineButtonText:u=n.localize("DECLINE"),subtitleView:p=null,listItemStyle:h={height:"100%",width:"100%"},avatarStyle:m={borderRadius:"16px",width:"38px",height:"38px"},incomingCallStyle:A={width:"fit-content",height:"fit-content"},onError:x=e=>{console.log(e)},ongoingCallConfiguration:b}=e,{theme:y}=t.useContext(U),[w,f]=t.useState(null),[D,E]=t.useState(!1),[v,S]=t.useState(!1),[I,F]=t.useState(!1),k=t.useRef(null),T=t.useRef(null),M=t.useRef(null),B=t.useRef(null),L=t.useRef(""),R=t.useRef(null),P=t.useRef(null);T.current={...po(y),...m},M.current={...ho(y),...A},k.current={...mo(M?.current,y),...h};const O=t.useRef({});O.current=(e=>({border:e?.acceptButtonBorder,borderRadius:e?.acceptButtonBorderRadius,background:e?.acceptButtonBackground,buttonTextFont:e?.acceptButtonTextFont,buttonTextColor:e?.acceptButtonTextColor,...uo}))(M?.current);const j=t.useRef({});j.current=(e=>({border:e?.declineButtonBorder,borderRadius:e?.declineButtonBorderRadius,background:e?.declineButtonBackground,buttonTextFont:e?.declineButtonTextFont,buttonTextColor:e?.declineButtonTextColor,...uo}))(M?.current);const V=t.useRef({});V.current=((e,t)=>new o.CallscreenStyle({maxHeight:e?.maxHeight||"100%",maxWidth:e?.maxWidth||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"#1c2226",minHeight:e?.minHeight||"400px",minWidth:e?.minWidth||"400px",minimizeIconTint:e?.minimizeIconTint||t.palette.getAccent900(),maximizeIconTint:e?.maximizeIconTint||t.palette.getAccent900()}))(b?.ongoingCallStyle,y);const G=t.useCallback(()=>V.current,[]),H=t.useRef(null);H.current=(e=>({height:"16px",width:"16px",iconTint:e?.subtitleTextColor||"RGBA(20, 20, 20, 0.68)"}))(M?.current);let Q="incomingcall_"+(new Date).getTime(),N=n.localize("INCOMING_CALL");const K=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)x(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);x(n)}},[x]),z=t.useCallback(()=>{try{l?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall,l):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall)}catch(e){K(e)}},[l,K]),J=t.useCallback(e=>{let t=!1;try{if(r.StorageUtils.getItem(n.CometChatUIKitConstants.calls.activecall)){let o=r.StorageUtils.getItem(n.CometChatUIKitConstants.calls.activecall);t=!(!o||o.sessionId!==e.getSessionId())}else t=!1;return t}catch(e){return K(e),t}},[K]),Y=t.useCallback((e=n.CometChatUIKitConstants.calls.rejected)=>{try{r.CometChatSoundManager.pause(),C?C():"string"==typeof B?.current?.getSessionId()&&s.CometChat.rejectCall(B?.current?.getSessionId(),e).then(e=>{r.StorageUtils.setItem(n.CometChatUIKitConstants.calls.activecall,e),n.CometChatCallEvents.ccCallRejected.next(e),E(!1),B.current=null},e=>{K(e)})}catch(e){K(e)}},[C,K]),_=t.useCallback(e=>{try{if(!J(e)&&w?.getUid()!==e?.getSender()?.getUid()&&B.current)a||v||I||setTimeout(()=>{z()},100),v||I?(v||I)&&(r.CometChatSoundManager.pause(),Y(n.CometChatUIKitConstants.calls.busy),n.CometChatCallEvents.ccCallRejected.next(e)):E(!0);else{if(w?.getUid()===e?.getSender()?.getUid())return void r.CometChatSoundManager.pause();r.CometChatSoundManager.pause(),Y(n.CometChatUIKitConstants.calls.busy)}}catch(e){K(e)}},[J,a,z,Y,K,w,v,I]),W=t.useCallback(e=>{if(e?.key===n.CometChatUIKitConstants.calls.activecall&&(e.newValue||e.oldValue)){let t;e.newValue?t=JSON.parse(e.newValue):e.oldValue&&(t=JSON.parse(e.oldValue)),B.current?.getSessionId()===t?.sessionId&&(r.CometChatSoundManager.pause(),B.current=null,E(!1))}},[]),Z=()=>{S(!1),F(!1),B.current=null,L.current=""},X=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{Z()}),t=n.CometChatCallEvents.ccOutgoingCall.subscribe(()=>{F(!0)}),o=n.CometChatCallEvents.ccCallRejected.subscribe(()=>{S(!1),F(!1)});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe()}catch(e){K(e)}}}catch(e){K(e)}},[K]),q=t.useCallback(()=>{try{r.StorageUtils.attachChangeDetection(W),s.CometChat.addCallListener(Q,new s.CometChat.CallListener({onIncomingCallReceived:e=>{B.current?.getSender()?.getUid()!==e.getSender()?.getUid()&&(B.current=e,_(e))},onIncomingCallCancelled:e=>{r.CometChatSoundManager.pause(),B.current=null,E(!1)},onOutgoingCallAccepted:e=>{r.CometChatSoundManager.pause(),e.getSender()?.getUid()===w?.getUid()&&(B.current=null,E(!1))},onOutgoingCallRejected:e=>{r.CometChatSoundManager.pause(),B.current=null,F(!1),S(!1),E(!1)}}))}catch(e){K(e)}},[W,_,K,Q,w]),$=t.useCallback(()=>{try{r.StorageUtils.detachChangeDetection(W),s.CometChat.removeCallListener(Q)}catch(e){K(e)}},[W,K,Q]),ee=t.useCallback(()=>{try{let e=s.CometChat.getActiveCall();return new Promise((t,n)=>{if(!e)return t({success:!0});let o=e?.getSessionId();s.CometChat.endCall(o).then(e=>t(e),e=>n(e))})}catch(e){K(e)}},[K]),te=t.useCallback(()=>{try{r.CometChatSoundManager.pause(),c?c():ee()?.then(e=>{s.CometChat.acceptCall(B.current.getSessionId()).then(e=>{n.CometChatCallEvents.ccCallAccepted.next(e),r.StorageUtils.setItem(n.CometChatUIKitConstants.calls.activecall,e),S(!0),B.current=e,L.current=e?.getSessionId(),E(!1)},e=>{K(e)})},e=>{K(e)})}catch(e){}},[ee,K,c]);return function(e,o,r,i,a,l,c,C,g,d,u,p,h){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&o(e)})},[o]),t.useEffect(()=>{let t;return e&&(t=i(),a()),()=>{l(),t?.()}},[e,a,l,i]),t.useEffect(()=>{r&&(d.current=r,g(d.current))},[r,d,g]),t.useEffect(()=>{const e=c?.current,t=C?.current;if(!e&&!t)return;const o=()=>{u()},r=()=>{p(n.CometChatUIKitConstants.calls.rejected)};return h?(e?.addEventListener("cc-button-clicked",o),t?.addEventListener("cc-button-clicked",r)):(e?.removeEventListener("cc-button-clicked",o),t?.removeEventListener("cc-button-clicked",r)),()=>{e?.removeEventListener("cc-button-clicked",o),t?.removeEventListener("cc-button-clicked",r)}},[h,u,p,c,C])}(w,f,i,X,q,$,P,R,_,B,te,Y,D),g.jsxs(g.Fragment,{children:[B.current&&D?g.jsxs("div",{className:"cc-incomingcall__wrapper",style:io(M?.current),children:[g.jsx("div",{className:"cc-incomingcall__listitem",style:co,children:g.jsxs("cometchat-list-item",{title:B.current?.getSender()?.getName(),listItemStyle:JSON.stringify(k.current),hideSeparator:!0,children:[p?g.jsx("div",{slot:"subtitleView",className:"cc-incomingcall__subtitleview",children:p}):g.jsxs("div",{slot:"subtitleView",className:"cc-incomingcall__subtitleview",style:ao,children:[g.jsx("div",{className:"cc-call__icon",children:g.jsx("cometchat-icon",{iconStyle:JSON.stringify(H.current),URL:B.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio?"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E":"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"})}),g.jsx("cometchat-label",{className:"cc-call__type",text:N,labelStyle:JSON.stringify(lo(M?.current))})]}),g.jsx("div",{slot:"tailView",className:"cc-incomingcall__tailview",style:Co,children:g.jsx("div",{className:"tail__view",children:g.jsx("div",{className:"cc-incomingcall__avatar",children:g.jsx("cometchat-avatar",{avatarStyle:JSON.stringify(T.current),image:B.current?.getSender()?.getAvatar(),name:B.current?.getSender()?.getName()})})})})]})}),g.jsxs("div",{className:"cc-incomingcall-buttons",style:go,children:[g.jsx("cometchat-button",{ref:R,buttonStyle:JSON.stringify(j.current),text:u}),g.jsx("cometchat-button",{ref:P,buttonStyle:JSON.stringify(O.current),text:d})]})]}):null,v&&B.current&&!D?g.jsx(Qt,{ongoingCallStyle:G(),sessionID:L.current,callSettingsBuilder:function(){let e=B.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio;const t=b?.callSettingsBuilder(B.current)||(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e);if(B.current?.getType()!==n.CometChatUIKitConstants.calls.meeting)return t.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{B.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&s.CometChat.endCall(L.current).then(e=>{r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null),Z()}).catch(e=>{})},onCallEndButtonPressed:()=>{s.CometChat.endCall(L.current).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e)}).catch(e=>{})},onError:e=>{K(e)}})),t.build()}(),maximizeIconURL:b?.maximizeIconURL,minimizeIconURL:b?.minimizeIconURL}):null]})},exports.CometChatLabelView=tl,exports.CometChatList=k,exports.CometChatLoaderView=nl,exports.CometChatMessageBubble=W,exports.CometChatMessageComposer=Ha,exports.CometChatMessageHeader=Wa,exports.CometChatMessageInformation=Rl,exports.CometChatMessageList=Vl,exports.CometChatMessages=_l,exports.CometChatOngoingCall=Qt,exports.CometChatOutgoingCall=nn,exports.CometChatReactionsView=Za,exports.CometChatReceiptView=rl,exports.CometChatTabs=ro,exports.CometChatThemeContext=U,exports.CometChatThreadedMessages=Jl,exports.CometChatTransferOwnership=Ji,exports.CometChatUIKit=Zn,exports.CometChatUserMemberWrapper=me,exports.CometChatUsers=q,exports.CometChatUsersWithMessages=e=>{const{theme:o}=t.useContext(U),{user:r,isMobileView:i,messageText:a,usersWithMessagesStyle:l,messagesConfiguration:c,usersConfiguration:C,onError:d}={...Nc,...e},[u,p]=t.useState(r??void 0),h=()=>p(void 0),m=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)d(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);d(n)}},[d]),A=e=>p(e),x=t.useCallback(()=>{try{const e=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{u&&u.getUid()===e.getUid()&&p(e)}),t=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{u&&u.getUid()===e.getUid()&&p(e)});return()=>{try{e?.unsubscribe(),t?.unsubscribe()}catch(e){m(e)}}}catch(e){m(e)}},[u,p,m]);return function(e,n,o){t.useEffect(()=>e(),[e]),t.useEffect(()=>{o(n)},[n,o])}(x,r,p),g.jsxs("div",{className:"cc-users-with-messages__wrapper",style:Tc(l,o),children:[g.jsx("div",{className:"cc-users-with-messages__sidebar",style:Mc(l,o,i,u),children:g.jsx(q,{activeUser:u??void 0,hideSearch:C?.hideSearch,searchIconURL:C?.searchIconURL,searchRequestBuilder:C?.searchRequestBuilder,onItemClick:C?.onItemClick||A,usersStyle:jc(C),subtitleView:C?.subtitleView,options:C?.options??void 0,usersRequestBuilder:C?.usersRequestBuilder,emptyStateView:C?.emptyStateView,onSelect:C?.onSelect,loadingIconURL:C?.loadingIconURL,errorStateView:C?.errorStateView,loadingStateView:C?.loadingStateView,tileAlignment:C?.titleAlignment,showSectionHeader:C?.showSectionHeader,listItemView:C?.listItemView,menus:C?.menu,hideSeparator:C?.hideSeparator,hideError:C?.hideError,selectionMode:C?.selectionMode,listItemStyle:C?.listItemStyle,disableUsersPresence:C?.disableUsersPresence,statusIndicatorStyle:C?.statusIndicatorStyle,avatarStyle:C?.avatarStyle})}),u?g.jsx("div",{className:"cc-users-with-messages__main",style:Uc(l,i,u),children:g.jsx(_l,{user:u,messageHeaderConfiguration:{...c?.messageHeaderConfiguration,onBack:c?.messageHeaderConfiguration?.onBack||h,hideBackButton:c?.messageHeaderConfiguration?.hideBackButton||!i,messageHeaderStyle:{...Vc(l,c,i),...c?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:{...c?.messageListConfiguration,messageInformationConfiguration:{messageInformationStyle:{...Qc(c,i)}}},messageComposerConfiguration:{...c?.messageComposerConfiguration,messageComposerStyle:{...Gc(l,c,i),...c?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:(b=c?.messagesStyle,y=l,{background:y?.background,...b}),customSoundForIncomingMessages:c?.customSoundForIncomingMessages,customSoundForOutgoingMessages:c?.customSoundForOutgoingMessages,detailsConfiguration:c?.detailsConfiguration,disableSoundForMessages:c?.disableSoundForMessages,disableTyping:c?.disableTyping,hideMessageComposer:c?.hideMessageComposer,hideMessageHeader:c?.hideMessageHeader,messageComposerView:c?.messageComposerView?c?.messageComposerView(u):void 0,messageHeaderView:c?.messageHeaderView?c?.messageHeaderView(u):void 0,messageListView:c?.messageListView?c?.messageListView(u):void 0,hideDetails:c?.hideDetails,threadedMessagesConfiguration:c?.threadedMessageConfiguration})}):null,g.jsx(g.Fragment,{children:u?null:(()=>{const e=a||n.localize("SELECT__USER");return g.jsx("div",{className:"cc-decorator-message--empty",style:Hc(i,u),children:g.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(Oc(l,o))})})})()})]});var b,y},exports.DataSource=class{},exports.DataSourceDecorator=Ue,exports.ExtensionsDataSource=gn,exports.ImageModerationConfiguration=class{constructor(e){this.style=e.style,this.confirmDialogStyle=e.confirmDialogStyle,this.backDropStyle=e.backDropStyle}getImageModerationStyle(){return this.style}getConfirmDialogSyle(){return this.confirmDialogStyle}getBackDropStyle(){return this.backDropStyle}},exports.ImageModerationExtension=Sn,exports.ImageModerationExtensionDecorator=vn,exports.LinkPreviewConfiguration=class{constructor(e){this.style=e.style}getLinkPreviewStyle(){return this.style}},exports.LinkPreviewExtension=Tn,exports.LinkPreviewExtensionDecorator=kn,exports.MessageTranslationConfiguration=class{constructor(e){let{style:t,optionIconURL:n,optionStyle:o}=e;this.style=t,this.optionIconURL=n,this.optionStyle=o}getMessageTranslationStyle(){return this.style}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.MessageTranslationExtension=Un,exports.MessageTranslationExtensionDecorator=Ln,exports.MessagesDataSource=Me,exports.PollsConfiguration=so,exports.PollsExtension=jn,exports.PollsExtensionDecorator=On,exports.SmartRepliesConfiguration=class{constructor(e){this.style=e.style}getSmartRepliesStyle(){return this.style}},exports.SmartReplyExtension=Hn,exports.SmartReplyExtensionDecorator=Gn,exports.StickersConfiguration=class{constructor(e){let{style:t,stickerIconURL:n,closeIconURL:o}=e;this.style=t,this.stickerIconURL=n,this.closeIconURL=o}getStickersStyle(){return this.style}getStickerIconURL(){return this.stickerIconURL}getCloseIconURL(){return this.closeIconURL}},exports.StickersExtension=zn,exports.StickersExtensionDecorator=Kn,exports.TabsStyle=Kc,exports.TextModeratorExtension=Yn,exports.TextModeratorExtensionDecorator=Jn,exports.ThumbnailGenerationExtension=Wn,exports.ThumbnailGenerationExtensionDecorator=_n,Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
16
+ const Ae=new Set(["children","localName","ref","style","className"]),xe=new WeakMap,be=(e,t,n,o,r)=>{const s=null==r?void 0:r[t];void 0===s||n===o?null==n&&t in HTMLElement.prototype?e.removeAttribute(t):e[t]=n:((e,t,n)=>{let o=xe.get(e);void 0===o&&xe.set(e,o=new Map);let r=o.get(t);void 0!==n?void 0===r?(o.set(t,r={handleEvent:n}),e.addEventListener(t,r)):r.handleEvent=n:void 0!==r&&(o.delete(t),e.removeEventListener(t,r))})(e,s,n)};function ye(e=window.React,t,n,o,r){let s,i,a;if(void 0===t){const t=e;({tagName:i,elementClass:a,events:o,displayName:r}=t),s=t.react}else s=e,a=n,i=t;const l=s.Component,c=s.createElement,C=new Set(Object.keys(null!=o?o:{}));class d extends l{constructor(){super(...arguments),this.o=null}t(e){if(null!==this.o)for(const t in this.i)be(this.o,t,this.props[t],e?e[t]:void 0,o)}componentDidMount(){var e;this.t(),null===(e=this.o)||void 0===e||e.removeAttribute("defer-hydration")}componentDidUpdate(e){this.t(e)}render(){const{_$Gl:e,...t}=this.props;this.h!==e&&(this.u=t=>{null!==e&&((e,t)=>{"function"==typeof e?e(t):e.current=t})(e,t),this.o=t,this.h=e}),this.i={};const n={ref:this.u};for(const[e,o]of Object.entries(t))Ae.has(e)?n["className"===e?"class":e]=o:C.has(e)||e in a.prototype?this.i[e]=o:n[e]=o;return n.suppressHydrationWarning=!0,c(i,n)}}d.displayName=null!=r?r:a.name;const g=s.forwardRef((e,t)=>c(d,{...e,_$Gl:t},null==e?void 0:e.children));return g.displayName=d.displayName,g}const we=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t}),fe=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t,events:{ccImageClicked:"cc-image-clicked"}}),De=ye({tagName:"cometchat-audio-bubble",elementClass:o.CometChatAudioBubble,react:t}),Ee=ye({tagName:"cometchat-video-bubble",elementClass:o.CometChatVideoBubble,react:t}),ve=ye({tagName:"cometchat-file-bubble",elementClass:o.CometChatFileBubble,react:t}),Ie=ye({tagName:"cometchat-form-bubble",elementClass:r.CometChatFormBubble,react:t,events:{ccSubmitClicked:"cc-submit-clicked"}}),Se=ye({tagName:"cometchat-scheduler-bubble",elementClass:r.CometChatSchedulerBubble,react:t}),Fe=ye({tagName:"cometchat-card-bubble",elementClass:r.CometChatCardBubble,react:t}),ke=ye({tagName:"cometchat-full-screen-viewer",elementClass:o.CometChatFullScreenViewer,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),Te=new n.CometChatTheme({});class Me{constructor(){this.getSchedulerBubbleStyle=e=>{let t=new o.AvatarStyle({borderRadius:"50%",width:"48px",height:"48px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),s=new o.ListItemStyle({height:"auto",width:"100%",background:"inherit",activeBackground:"transparent",borderRadius:"0",titleFont:n.fontHelper(e.typography.text1),titleColor:e.palette.getAccent(),border:"none",separatorColor:"",hoverBackground:"transparent"}),i=new r.CalendarStyle({height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",dateTextFont:n.fontHelper(e.typography.subtitle2),dateTextColor:e.palette.getAccent(),dayTextFont:n.fontHelper(e.typography.text2),dayTextColor:e.palette.getAccent(),monthYearTextFont:n.fontHelper(e.typography.text2),monthYearTextColor:e.palette.getAccent(),defaultDateTextBackground:"transparent",disabledDateTextColor:e.palette.getAccent400(),disabledDateTextFont:n.fontHelper(e.typography.subtitle2),disabledDateTextBackground:"transparent",titleTextFont:n.fontHelper(e.typography.text1),titleTextColor:e.palette.getAccent(),timezoneTextFont:n.fontHelper(e.typography.caption2),timezoneTextColor:e.palette.getAccent(),arrowButtonTextColor:e.palette.getAccent(),arrowButtonTextFont:n.fontHelper(e.typography.title2)}),a=new r.TimeSlotStyle({background:"transparent",height:"fit-content",width:"100%",border:"none",borderRadius:"0",calendarIconTint:e.palette.getAccent(),timezoneIconTint:e.palette.getAccent(),emptySlotIconTint:e.palette.getAccent500(),emptySlotTextColor:e.palette.getAccent500(),emptySlotTextFont:n.fontHelper(e.typography.subtitle1),dateTextColor:e.palette.getAccent(),dateTextFont:n.fontHelper(e.typography.subtitle1),seperatorTint:e.palette.getAccent100(),slotBackground:e.palette.getAccent900(),slotBorder:"none",slotBorderRadius:"8px",slotTextColor:e.palette.getAccent(),slotTextFont:n.fontHelper(e.typography.caption2),timezoneTextColor:e.palette.getAccent(),timezoneTextFont:n.fontHelper(e.typography.caption2),titleTextColor:e.palette.getAccent(),titleTextFont:n.fontHelper(e.typography.text1)}),l=new o.QuickViewStyle({background:e.palette.getAccent50(),height:"fit-content",width:"100%",titleFont:n.fontHelper(e.typography.subtitle2),titleColor:e.palette.getAccent(),subtitleFont:n.fontHelper(e.typography.subtitle2),subtitleColor:e.palette.getAccent600(),leadingBarTint:e.palette.getPrimary(),leadingBarWidth:"4px",borderRadius:"8px"});return new r.SchedulerBubbleStyle({avatarStyle:t,listItemStyle:s,quickViewStyle:l,dateSelectorStyle:i,timeSlotSelectorStyle:a,backButtonIconTint:e.palette.getPrimary(),background:"transparent",height:"100%",width:"100%",border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"8px",loadingIconTint:e.palette.getAccent600(),suggestedTimeBackground:e.palette.getAccent900(),suggestedTimeBorder:`1px solid ${e.palette.getPrimary()}`,suggestedTimeBorderRadius:"8px",suggestedTimeDisabledBackground:e.palette.getAccent50(),suggestedTimeDisabledBorder:`1px solid ${e.palette.getAccent200()}`,suggestedTimeDisabledBorderRadius:"8px",suggestedTimeDisabledTextColor:e.palette.getAccent700(),suggestedTimeDisabledTextFont:n.fontHelper(e.typography.text3),suggestedTimeTextColor:e.palette.getPrimary(),suggestedTimeTextFont:n.fontHelper(e.typography.text3),moreButtonDisabledTextBackground:"transparent",moreButtonDisabledTextBorder:"none",moreButtonDisabledTextBorderRadius:"0",moreButtonDisabledTextColor:e.palette.getAccent600(),moreButtonDisabledTextFont:n.fontHelper(e.typography.caption2),moreButtonTextBackground:"transparent",moreButtonTextBorder:"none",moreButtonTextBorderRadius:"0",moreButtonTextColor:e.palette.getPrimary(),moreButtonTextFont:n.fontHelper(e.typography.caption2),goalCompletionTextColor:e.palette.getAccent(),goalCompletionTextFont:n.fontHelper(e.typography.text3),errorTextColor:e.palette.getError(),errorTextFont:n.fontHelper(e.typography.text3),scheduleButtonStyle:{iconHeight:"16px",iconWidth:"16px",buttonIconTint:e.palette.getAccent(),buttonTextFont:n.fontHelper(e.typography.name),buttonTextColor:e.palette.getAccent("dark"),border:"none",borderRadius:"8px",background:e.palette.getPrimary(),width:"100%",display:"flex",justifyContent:"center",padding:"8px"},seperatorTint:e.palette.getAccent200(),subtitleTextColor:e.palette.getAccent400(),subtitleTextFont:n.fontHelper(e.typography.name),summaryTextColor:e.palette.getAccent(),summaryTextFont:n.fontHelper(e.typography.subtitle1),timezoneTextColor:e.palette.getAccent600(),timezoneTextFont:n.fontHelper(e.typography.caption2),titleTextColor:e.palette.getAccent(),titleTextFont:n.fontHelper(e.typography.title1),timezoneIconTint:e.palette.getAccent(),calendarIconTint:e.palette.getAccent(),clockIconTint:e.palette.getAccent()})}}getEditOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.editMessage,title:n.localize("EDIT"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fediticon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FEdit%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.8666667%2C0.883555287%20C17.2934403%2C0.312679329%2016.5158214%2C-0.00540815756%2015.7068357%2C0%20C14.8978501%2C0.00554734575%2014.1246099%2C0.334135909%2013.5591667%2C0.912721954%20L1.47583333%2C12.9960553%20L0%2C18.750222%20L5.75416667%2C17.2743886%20L17.8375%2C5.19105529%20C18.416086%2C4.6256121%2018.7446746%2C3.8523719%2018.750222%2C3.04338623%20C18.7556301%2C2.23440057%2018.4375426%2C1.45678164%2017.8666667%2C0.883555287%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2213.2133333%22%20y1%3D%221.25855529%22%20x2%3D%2217.4916667%22%20y2%3D%225.53688862%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211.4683333%22%20y1%3D%223.00355529%22%20x2%3D%2215.7466667%22%20y2%3D%227.28188862%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%221.47583333%22%20y1%3D%2212.9960553%22%20x2%3D%225.75833333%22%20y2%3D%2217.270222%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getDeleteOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.deleteMessage,title:n.localize("DELETE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fdeleteicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDelete%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%223.6363627%22%20x2%3D%2220%22%20y2%3D%223.6363627%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0454545%2C0%20L7.95454545%2C0%20C7.20142989%2C0%206.59090909%2C0.610520639%206.59090909%2C1.36363601%20L6.59090909%2C3.6363627%20L13.4090909%2C3.6363627%20L13.4090909%2C1.36363601%20C13.4090909%2C0.610520639%2012.7985701%2C0%2012.0454545%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%227.95454545%22%20y1%3D%2215.2272688%22%20x2%3D%227.95454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212.0454545%22%20y1%3D%2215.2272688%22%20x2%3D%2212.0454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.2363636%2C18.7454497%20C16.1838968%2C19.4542339%2015.5925391%2C20.0019341%2014.8818182%2C20%20L5.11818182%2C20%20C4.40746088%2C20.0019341%203.81610324%2C19.4542339%203.76363636%2C18.7454497%20L2.5%2C3.6363627%20L17.5%2C3.6363627%20L16.2363636%2C18.7454497%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getReactionOption(e){return new n.CometChatActionsView({id:n.CometChatUIKitConstants.MessageOption.reactToMessage,title:n.localize("REACT"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FReactions%20Add%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FReactions-Add%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C1.25%20C13.2547515%2C1.25%2014.4810955%2C1.46534515%2015.6383943%2C1.88154366%20C16.0281686%2C2.02171794%2016.2305095%2C2.45132619%2016.0903352%2C2.84110054%20C15.9501609%2C3.2308749%2015.5205527%2C3.43321574%2015.1307783%2C3.29304146%20C14.1357379%2C2.9351958%2013.0810879%2C2.75%2012%2C2.75%20C6.89136606%2C2.75%202.75%2C6.89136606%202.75%2C12%20C2.75%2C17.1086339%206.89136606%2C21.25%2012%2C21.25%20C17.1086339%2C21.25%2021.25%2C17.1086339%2021.25%2C12%20C21.25%2C11.2729266%2021.1662576%2C10.5573695%2021.0020875%2C9.8629795%20C20.906785%2C9.45987863%2021.1563049%2C9.05584287%2021.5594058%2C8.96054036%20C21.9625066%2C8.86523784%2022.3665424%2C9.11475771%2022.4618449%2C9.51785857%20C22.6527043%2C10.3251362%2022.75%2C11.1565032%2022.75%2C12%20C22.75%2C17.9370611%2017.9370611%2C22.75%2012%2C22.75%20C6.06293894%2C22.75%201.25%2C17.9370611%201.25%2C12%20C1.25%2C6.06293894%206.06293894%2C1.25%2012%2C1.25%20Z%20M17.6586667%2C13.25%20C18.1185754%2C13.25%2018.5498402%2C13.4733153%2018.8153335%2C13.8488361%20C19.0808092%2C14.2243322%2019.1475058%2C14.7053253%2018.9944111%2C15.1383417%20C17.9483179%2C18.1044405%2015.1451634%2C20.0881971%2012%2C20.0881971%20C8.85483662%2C20.0881971%206.05168206%2C18.1044405%205.00578211%2C15.1388889%20C4.85249421%2C14.7053253%204.91919084%2C14.2243322%205.18466653%2C13.8488361%20C5.45015977%2C13.4733153%205.88142461%2C13.25%206.34133333%2C13.25%20L6.34133333%2C13.25%20Z%20M17.558%2C14.695%20L17.538%2C14.749%20L6.461%2C14.749%20L6.50827179%2C14.8734156%20C7.3732069%2C17.0322917%209.42640021%2C18.4853104%2011.750045%2C18.5829516%20L11.750045%2C18.5829516%20L12%2C18.5881971%20C14.5090629%2C18.5881971%2016.7452873%2C17.0056497%2017.5800043%2C14.6388889%20L17.558%2C14.695%20Z%20M8.11422222%2C8.58288148%20C9.2798673%2C8.58288148%2010.3188817%2C9.31776232%2010.7071667%2C10.4168361%20C10.8451443%2C10.8073935%2010.6403879%2C11.2358557%2010.2498306%2C11.3738333%20C9.89181964%2C11.5003128%209.50195808%2C11.3388005%209.33318946%2C11.0101749%20L9.29283333%2C10.9164972%20C9.11634015%2C10.4169182%208.6440609%2C10.0828815%208.11422222%2C10.0828815%20C7.62853677%2C10.0828815%207.19121722%2C10.3635651%206.98575875%2C10.7951488%20L6.93561111%2C10.9164972%20C6.79763351%2C11.3070546%206.36917126%2C11.5118109%205.97861389%2C11.3738333%20C5.58805653%2C11.2358557%205.38330017%2C10.8073935%205.52127778%2C10.4168361%20C5.90956279%2C9.31776232%206.94857714%2C8.58288148%208.11422222%2C8.58288148%20Z%20M15.8857778%2C8.58288148%20C17.0514229%2C8.58288148%2018.0904372%2C9.31776232%2018.4787222%2C10.4168361%20C18.6166998%2C10.8073935%2018.4119435%2C11.2358557%2018.0213861%2C11.3738333%20C17.6633752%2C11.5003128%2017.2735136%2C11.3388005%2017.104745%2C11.0101749%20L17.0643889%2C10.9164972%20C16.8878957%2C10.4169182%2016.4156165%2C10.0828815%2015.8857778%2C10.0828815%20C15.4000923%2C10.0828815%2014.9627728%2C10.3635651%2014.7573143%2C10.7951488%20L14.7071667%2C10.9164972%20C14.5691891%2C11.3070546%2014.1407268%2C11.5118109%2013.7501694%2C11.3738333%20C13.3596121%2C11.2358557%2013.1548557%2C10.8073935%2013.2928333%2C10.4168361%20C13.6811183%2C9.31776232%2014.7201327%2C8.58288148%2015.8857778%2C8.58288148%20Z%20M19.5%2C0.25%20C19.8796958%2C0.25%2020.193491%2C0.532153882%2020.2431534%2C0.898229443%20L20.25%2C1%20L20.25%2C4.25%20L23%2C4.25%20C23.4142136%2C4.25%2023.75%2C4.58578644%2023.75%2C5%20C23.75%2C5.37969577%2023.4678461%2C5.69349096%2023.1017706%2C5.74315338%20L23%2C5.75%20L20.25%2C5.75%20L20.25%2C9%20C20.25%2C9.41421356%2019.9142136%2C9.75%2019.5%2C9.75%20C19.1203042%2C9.75%2018.806509%2C9.46784612%2018.7568466%2C9.10177056%20L18.75%2C9%20L18.75%2C5.75%20L16%2C5.75%20C15.5857864%2C5.75%2015.25%2C5.41421356%2015.25%2C5%20C15.25%2C4.62030423%2015.5321539%2C4.30650904%2015.8982294%2C4.25684662%20L16%2C4.25%20L18.75%2C4.25%20L18.75%2C1%20C18.75%2C0.585786438%2019.0857864%2C0.25%2019.5%2C0.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",customView:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getReplyInThreadOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.replyInThread,title:n.localize("REPLY"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fthreadicon%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FThread%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.6578236%2C0%20C7.2733682%2C-0.00487001799%204.15271669%2C1.82840041%202.50707282%2C4.78828665%20C0.861428952%2C7.74817289%200.949909343%2C11.3686229%202.73817252%2C14.2444485%20L0%2C20%20L5.74989584%2C17.2595575%20C9.11259725%2C19.3520226%2013.4289699%2C19.0910325%2016.5155083%2C16.6086132%20C19.6020468%2C14.1261939%2020.7857069%2C9.9636565%2019.4677154%2C6.22668649%20C18.1497239%2C2.48971647%2014.6174794%2C-0.00681020874%2010.6578236%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226.65936346%22%20y1%3D%226.66667597%22%20x2%3D%2214.6527312%22%20y2%3D%226.66667597%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%225.3271355%22%20y1%3D%229.33334078%22%20x2%3D%2215.9849591%22%20y2%3D%229.33334078%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226.65936346%22%20y1%3D%2212.0000056%22%20x2%3D%2214.6527312%22%20y2%3D%2212.0000056%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getSendMessagePrivatelyOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.sendMessagePrivately,title:n.localize("MESSAGE_PRIVATELY"),iconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M13.8%2015.0099H21V21H13.8V15.0099Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M17.4%2011.4158C16.7635%2011.4158%2016.153%2011.6682%2015.7029%2012.1176C15.2529%2012.5669%2015%2013.1764%2015%2013.8118V15.0099H19.8V13.8118C19.8%2013.1764%2019.5471%2012.5669%2019.0971%2012.1176C18.647%2011.6682%2018.0365%2011.4158%2017.4%2011.4158Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M17.3995%2017.7286C17.3402%2017.7286%2017.2823%2017.7461%2017.2331%2017.7791C17.1838%2017.812%2017.1454%2017.8587%2017.1228%2017.9135C17.1001%2017.9682%2017.0942%2018.0284%2017.1057%2018.0865C17.1173%2018.1446%2017.1458%2018.198%2017.1877%2018.2399C17.2296%2018.2818%2017.283%2018.3103%2017.3411%2018.3218C17.3992%2018.3334%2017.4594%2018.3275%2017.5141%2018.3048C17.5688%2018.2821%2017.6156%2018.2437%2017.6485%2018.1945C17.6814%2018.1452%2017.699%2018.0873%2017.699%2018.0281C17.699%2017.9486%2017.6674%2017.8725%2017.6113%2017.8163C17.5551%2017.7601%2017.4789%2017.7286%2017.3995%2017.7286%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%2010.8503C20.9168%209.57663%2020.5439%208.33868%2019.9096%207.23051C19.2753%206.12235%2018.3962%205.17314%2017.3393%204.45503C16.2824%203.73692%2015.0754%203.26882%2013.8101%203.0863C12.5448%202.90378%2011.2545%203.01164%2010.0372%203.4017C8.81989%203.79176%207.70769%204.45374%206.78512%205.33732C5.86254%206.22091%205.15388%207.30285%204.71298%208.5009C4.27209%209.69895%204.11057%2010.9816%204.24071%2012.2513C4.37084%2013.521%204.78921%2014.7444%205.464%2015.8285L3%2021L8.1768%2018.5368C9.14753%2019.1412%2010.2319%2019.5408%2011.3632%2019.7109%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getCopyOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.copyMessage,title:n.localize("COPY"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCopy%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCopy%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%284.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.6%2C6.00000118%20L15.6%2C3.60000142%20C15.6%2C2.93725978%2015.0627417%2C2.40000154%2014.4%2C2.40000154%20L11.2%2C2.40000154%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.4%2C2.40000154%20L1.2%2C2.40000154%20C0.5372583%2C2.40000154%200%2C2.93725978%200%2C3.60000142%20L0%2C16.8000001%20C0%2C17.4627418%200.5372583%2C18%201.2%2C18%20L6%2C18%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.9368%2C3.18960146%20C10.8549236%2C3.43464248%2010.625558%2C3.59990166%2010.3672%2C3.60000142%20L5.2328%2C3.60000142%20C4.97444201%2C3.59990166%204.74507642%2C3.43464248%204.6632%2C3.18960146%20L3.8632%2C0.789601696%20C3.80186075%2C0.606570139%203.8324564%2C0.405197059%203.94539051%2C0.248643741%20C4.05832463%2C0.0920904237%204.23976415%2C-0.000467229348%204.4328%2C0%20L11.1672%2C0%20C11.3602359%2C-0.000467229348%2011.5416754%2C0.0920904237%2011.6546095%2C0.248643741%20C11.7675436%2C0.405197059%2011.7981392%2C0.606570139%2011.7368%2C0.789601696%20L10.9368%2C3.18960146%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolygon%20id%3D%22Path%22%20points%3D%228.4%208.40000095%2018%208.40000095%2018%2018%208.4%2018%22%3E%3C%2Fpolygon%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2210.8000007%22%20x2%3D%2215.6%22%20y2%3D%2210.8000007%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2213.2000005%22%20x2%3D%2215.6%22%20y2%3D%2213.2000005%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210.8%22%20y1%3D%2215.6000002%22%20x2%3D%2212.6%22%20y2%3D%2215.6000002%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}getMessageInfoOption(e){return new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.messageInformation,title:n.localize("INFO"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:void 0,iconTint:e.palette.getAccent600(),backgroundColor:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent600()})}isSentByMe(e,t){return!t.getSender()||e.getUid()===t.getSender().getUid()}getTextMessageOptions(e,t,o,r){let s=this.isSentByMe(e,t),i=!1;r?.getScope()===n.CometChatUIKitConstants.groupMemberScope.participant&&(i=!0);let a=[];return a.push(this.getReactionOption(o)),t.getParentMessageId()||a.push(this.getReplyInThreadOption(o)),a.push(this.getCopyOption(o)),(s||!i&&r)&&a.push(this.getEditOption(o)),s&&a.push(this.getMessageInfoOption(o)),(s||!i&&r)&&a.push(this.getDeleteOption(o)),r&&!s&&a.push(this.getSendMessagePrivatelyOption(o)),a}getImageMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getVideoMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getAudioMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getFileMessageOptions(e,t,n,o){let r=[];return r=Be.getDataSource().getCommonOptions(e,t,n,o),r}getBottomView(e,t){return null}getTextMessageTemplate(e,t){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.text,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(n,o)=>{let r=n;return null!=r.getDeletedAt()?this.getDeleteMessageBubble(r,e):Be.getDataSource().getTextMessageContentView(r,o,e,t)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getAudioMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.audio,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getAudioMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getVideoMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.video,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getVideoMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getImageMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.image,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getImageMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getGroupActionTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.groupMember,category:n.CometChatUIKitConstants.MessageCategory.action,contentView:(t,n)=>this.getGroupActionBubble(t,e)})}getFileMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.file,category:n.CometChatUIKitConstants.MessageCategory.message,contentView:(t,n)=>{let o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getFileMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getFormMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.form,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getFormMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getSchedulerMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.scheduler,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getSchedulerMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getCardMessageTemplate(e){return new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.card,category:n.CometChatUIKitConstants.MessageCategory.interactive,contentView:(t,n)=>{const o=t;return null!=o.getDeletedAt()?this.getDeleteMessageBubble(t,e):Be.getDataSource().getCardMessageContentView(o,n,e)},options:Be.getDataSource().getMessageOptions,bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getAllMessageTemplates(e,t){let n=e??Te;return t||(t={disableMentions:!1}),[Be.getDataSource().getTextMessageTemplate(n,t),Be.getDataSource().getImageMessageTemplate(n),Be.getDataSource().getVideoMessageTemplate(n),Be.getDataSource().getAudioMessageTemplate(n),Be.getDataSource().getFileMessageTemplate(n),Be.getDataSource().getGroupActionTemplate(n),Be.getDataSource().getFormMessageTemplate(n),Be.getDataSource().getSchedulerMessageTemplate(n),Be.getDataSource().getCardMessageTemplate(n)]}getMessageTemplate(e,t,o,r){let s=o??Te;r||(r={disableMentions:!1});let i=null;if(t!==n.CometChatUIKitConstants.MessageCategory.call)switch(e){case n.CometChatUIKitConstants.MessageTypes.text:i=Be.getDataSource().getTextMessageTemplate(s,r);break;case n.CometChatUIKitConstants.MessageTypes.image:i=Be.getDataSource().getImageMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.video:i=Be.getDataSource().getVideoMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.groupMember:i=Be.getDataSource().getGroupActionTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.file:i=Be.getDataSource().getFileMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.audio:i=Be.getDataSource().getAudioMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.form:i=Be.getDataSource().getFormMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.scheduler:i=Be.getDataSource().getSchedulerMessageTemplate(s);break;case n.CometChatUIKitConstants.MessageTypes.card:i=Be.getDataSource().getCardMessageTemplate(s)}return i}getMessageOptions(e,t,o,r){let s=[];if(t.getCategory()===n.CometChatUIKitConstants.MessageCategory.message)switch(t.getType()){case n.CometChatUIKitConstants.MessageTypes.text:s=Be.getDataSource().getTextMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.image:s=Be.getDataSource().getImageMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.video:s=Be.getDataSource().getVideoMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.groupMember:s=[];break;case n.CometChatUIKitConstants.MessageTypes.file:s=Be.getDataSource().getFileMessageOptions(e,t,o,r);break;case n.CometChatUIKitConstants.MessageTypes.audio:s=Be.getDataSource().getAudioMessageOptions(e,t,o,r);break;default:s=Be.getDataSource().getCommonOptions(e,t,o,r)}else t.getCategory()!=n.CometChatUIKitConstants.MessageCategory.custom&&t.getCategory()!=n.CometChatUIKitConstants.MessageCategory.interactive||(s=Be.getDataSource().getCommonOptions(e,t,o,r));return s}getCommonOptions(e,t,o,r){let s=this.isSentByMe(e,t),i=!1;r?.getScope()===n.CometChatUIKitConstants.groupMemberScope.participant&&(i=!0);let a=[];return a.push(this.getReactionOption(o)),t?.getParentMessageId()||a.push(this.getReplyInThreadOption(o)),s&&a.push(this.getMessageInfoOption(o)),(s||!i&&r)&&a.push(this.getDeleteOption(o)),r?.getGuid()&&!s&&a.push(this.getSendMessagePrivatelyOption(o)),a}getAllMessageTypes(){return[n.CometChatUIKitConstants.MessageTypes.text,n.CometChatUIKitConstants.MessageTypes.image,n.CometChatUIKitConstants.MessageTypes.audio,n.CometChatUIKitConstants.MessageTypes.video,n.CometChatUIKitConstants.MessageTypes.file,n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageTypes.form,n.CometChatUIKitConstants.MessageTypes.scheduler,n.CometChatUIKitConstants.MessageTypes.card]}addList(){return"<Message Utils>"}getAllMessageCategories(){return[n.CometChatUIKitConstants.MessageCategory.message,n.CometChatUIKitConstants.MessageCategory.action,n.CometChatUIKitConstants.MessageCategory.interactive]}getAuxiliaryOptions(e,t,n,o){return[]}getId(){return"messageUtils"}getTextMessageContentView(e,t,n,o){return Be.getDataSource().getTextMessageBubble(e.getText(),e,t,n,void 0,o)}getAudioMessageContentView(e,t,n){return Be.getDataSource().getAudioMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n,e?.getAttachments()[0]?.getName())}getFileMessageContentView(e,t,n){return Be.getDataSource().getFileMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n,e?.getAttachments()[0]?.getName())}getFormMessageContentView(e,t,n){return Be.getDataSource().getFormMessageBubble(e,n)}getSchedulerMessageContentView(e,t,n){return Be.getDataSource().getSchedulerMessageBubble(e,n)}getCardMessageContentView(e,t,n){return Be.getDataSource().getCardMessageBubble(e,n)}getImageMessageContentView(e,t,n){let o=e?.getAttachments()[0]?.getUrl()||"";return Be.getDataSource().getImageMessageBubble(o,"data:image/png;base64,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",e,n)}getVideoMessageContentView(e,t,n){return Be.getDataSource().getVideoMessageBubble(e?.getAttachments()[0]?.getUrl(),e,n)}getActionMessage(e){let t="";if(!1===e.hasOwnProperty("actionBy")||!1===e.hasOwnProperty("actionOn"))return t;if(e.action!==n.CometChatUIKitConstants.groupMemberAction.JOINED&&e.action!==n.CometChatUIKitConstants.groupMemberAction.LEFT&&(!1===e.actionBy.hasOwnProperty("name")||!1===e.actionOn.hasOwnProperty("name")))return t;if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE){if(!e.hasOwnProperty("data")||!e.data.hasOwnProperty("extras"))return t;if(!e.data.extras.hasOwnProperty("scope"))return t;if(!1===e.data.extras.scope.hasOwnProperty("new"))return t}if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE&&!1===e.data.extras.hasOwnProperty("scope"))return t;if(e.action===n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE&&!1===e.data.extras.scope.hasOwnProperty("new"))return t;const o=e.actionBy,r=e.actionOn,s=o.name,i=e.action!==n.CometChatUIKitConstants.groupMemberAction.JOINED&&e.action!==n.CometChatUIKitConstants.groupMemberAction.LEFT?r.name:"";switch(e.action){case n.CometChatUIKitConstants.groupMemberAction.ADDED:t=`${s} ${n.localize("ADDED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.JOINED:t=`${s} ${n.localize("JOINED")}`;break;case n.CometChatUIKitConstants.groupMemberAction.LEFT:t=`${s} ${n.localize("LEFT")}`;break;case n.CometChatUIKitConstants.groupMemberAction.KICKED:t=`${s} ${n.localize("KICKED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.BANNED:t=`${s} ${n.localize("BANNED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.UNBANNED:t=`${s} ${n.localize("UNBANNED")} ${i}`;break;case n.CometChatUIKitConstants.groupMemberAction.SCOPE_CHANGE:{const o=e.data.extras.scope.new;t=`${s} ${n.localize("MADE")} ${i} ${o}`;break}}return t}getDeleteMessageBubble(e,t,o){let r=o,s=n.localize("MESSAGE_IS_DELETED");return r||(r={textFont:n.fontHelper(t.typography.text2),textColor:t.palette.getAccent400()||"",border:`1px dashed ${t.palette.getAccent400()}`,borderRadius:"12px"}),d.jsx(we,{text:s,textStyle:r})}getGroupActionBubble(e,t,o){let r=o,s=this.getActionMessage(e);return r||(r={textFont:n.fontHelper(t.typography.subtitle2),textColor:t.palette.getAccent600()||""}),d.jsx(we,{text:s,textStyle:r})}getTextMessageBubbleStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900("light")||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getFormMessageBubbleStyle(e){const t=new o.InputStyle({width:"100%",height:"30px",border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"6px",padding:"0px 0px 0px 5px",placeholderTextColor:e.palette.getAccent400(),placeholderTextFont:n.fontHelper(e.typography.subtitle2),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),background:e.palette.getBackground()}),s=new o.LabelStyle({textFont:n.fontHelper(e.typography.subtitle1),textColor:e.palette.getAccent(),background:"transparent"}),i=new o.RadioButtonStyle({height:"16px",width:"16px",border:"none",labelTextFont:n.fontHelper(e.typography.subtitle2),labelTextColor:e.palette.getAccent600(),borderRadius:"4px",background:""}),a=new o.CheckboxStyle({height:"16px",width:"16px",border:"none",borderRadius:"4px",background:"",labelTextFont:n.fontHelper(e.typography.subtitle2),labelTextColor:e.palette.getAccent()}),l=new o.DropdownStyle({height:"35px",width:"100%",background:e.palette.getBackground(),border:`1px solid ${e.palette.getAccent100()}`,borderRadius:"6px",activeTextFont:n.fontHelper(e.typography.subtitle2),activeTextColor:e.palette.getAccent(),arrowIconTint:e.palette.getAccent700(),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),optionBackground:e.palette.getBackground(),optionBorder:`1px solid ${e.palette.getAccent100()}`,optionHoverBorder:`1px solid ${e.palette.getAccent100()}`,hoverTextFont:n.fontHelper(e.typography.subtitle2),hoverTextColor:e.palette.getAccent(),hoverTextBackground:e.palette.getAccent100()}),c={height:"40px",width:"100%",background:e.palette.getPrimary(),border:"none",borderRadius:"6px",buttonTextFont:n.fontHelper(e.typography.subtitle2),buttonTextColor:e.palette.getBackground(),justifyContent:"center"},C=new o.SingleSelectStyle({height:"100%",width:"100%",background:e.palette.getBackground(),border:"none",borderRadius:"12px",activeTextFont:n.fontHelper(e.typography.subtitle2),activeTextColor:e.palette.getAccent(),activeTextBackground:e.palette.getAccent100(),textFont:n.fontHelper(e.typography.subtitle2),textColor:e.palette.getAccent(),optionBackground:e.palette.getBackground(),optionBorder:`1px solid ${e.palette.getAccent100()}`,optionBorderRadius:"3px",hoverTextFont:n.fontHelper(e.typography.subtitle2),hoverTextColor:e.palette.getAccent(),hoverTextBackground:e.palette.getAccent100()}),d=new o.QuickViewStyle({background:"transparent",height:"fit-content",width:"100%",titleFont:n.fontHelper(e.typography.subtitle2),titleColor:e.palette.getPrimary(),subtitleFont:n.fontHelper(e.typography.subtitle2),subtitleColor:e.palette.getAccent600(),leadingBarTint:e.palette.getPrimary(),leadingBarWidth:"4px",borderRadius:"8px"});return new r.FormBubbleStyle({width:"300px",height:"fit-content",border:"none",background:"transparent",wrapperBackground:e.palette.getBackground(),borderRadius:"8px",wrapperBorderRadius:"8px",textInputStyle:t,labelStyle:s,radioButtonStyle:i,checkboxStyle:a,dropdownStyle:l,buttonStyle:c,singleSelectStyle:C,quickViewStyle:d,titleColor:e.palette.getAccent(),titleFont:n.fontHelper(e.typography.title1),goalCompletionTextColor:e.palette.getAccent(),goalCompletionTextFont:n.fontHelper(e.typography.subtitle1),wrapperPadding:"2px",datePickerBorder:`1px solid ${e.palette.getAccent100()}`,datePickerBorderRadius:"6px",datePickerFont:n.fontHelper(e.typography.subtitle2),datePickerFontColor:e.palette.getAccent()})}getCardMessageBubbleStyle(e){const t={height:"40px",width:"100%",background:"transparent",border:"none",borderRadius:"0px",buttonTextFont:n.fontHelper(e.typography.subtitle2),buttonTextColor:`${e.palette.getPrimary()}`,justifyContent:"center"};return new r.CardBubbleStyle({background:"transparent",borderRadius:"8px",height:"fit-content",width:"300px",imageHeight:"auto",imageWidth:"100%",imageRadius:"8px",imageBackgroundColor:"transparent",descriptionFontColor:e.palette.getAccent(),descriptionFont:n.fontHelper(e.typography.subtitle2),buttonStyle:t,dividerTintColor:e.palette.getAccent100(),wrapperBackground:e.palette.getBackground(),wrapperBorderRadius:"8px",wrapperPadding:"2px",disabledButtonColor:e.palette.getAccent600()})}getTextMessageBubble(e,t,n,o,s,i){let a,l={...i,textFormatters:i?.textFormatters&&i?.textFormatters.length?[...i.textFormatters]:this.getAllTextFormatters({theme:o,alignment:n,disableMentions:i.disableMentions})},c=l.textFormatters;if(l&&!l.disableMentions){let e;for(let n=0;n<c.length&&!(c[n]instanceof r.CometChatMentionsFormatter&&(e=c[n],e.setMessage(t),t.getMentionedUsers().length&&e.setCometChatUserGroupMembers(t.getMentionedUsers()),e.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),a))&&!(c[n]instanceof r.CometChatUrlsFormatter&&(a=c[n],e));n++);e||(e=Be.getDataSource().getMentionsTextFormatter({message:t,...l,alignment:n,theme:o}),c.push(e))}else for(let e=0;e<c.length;e++)if(c[e]instanceof r.CometChatUrlsFormatter){a=c[e];break}a||(a=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:n}),c.push(a));let C=s;C||(C=this.getTextMessageBubbleStyle(n,o));for(let e=0;e<c.length;e++)c[e].setMessageBubbleAlignment(n),c[e].setMessage(t);return d.jsx(we,{text:e,textStyle:C,textFormatters:c})}getAudioMessageBubble(e,t,n,o,r){return d.jsx(De,{src:e,audioStyle:r})}getFileMessageBubble(e,t,o,r,s){let i=s;return i||(i={titleFont:n.fontHelper(o.typography.subtitle1),titleColor:o.palette.getAccent(),subtitleFont:n.fontHelper(o.typography.subtitle2),subtitleColor:o.palette.getAccent600(),iconTint:o.palette.getPrimary()}),d.jsx(ve,{downloadIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDownload%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDownload%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%227.33333333%2013.2%2011%2016.8666667%2014.6666667%2013.2%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211%22%20y1%3D%225.86666667%22%20x2%3D%2211%22%20y2%3D%2216.8666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C11%20C0%2C17.0751322%204.92486775%2C22%2011%2C22%20C17.0751322%2C22%2022%2C17.0751322%2022%2C11%20C22%2C4.92486775%2017.0751322%2C0%2011%2C0%20C4.92486775%2C0%200%2C4.92486775%200%2C11%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",subtitle:n.localize("SHARED_FILE"),title:r,fileURL:e,fileStyle:i})}getFormMessageBubble(e,t,n,o){let r=n;r||(r=this.getFormMessageBubbleStyle(t));const s=!!o;return d.jsx(Ie,{message:e,formBubbleStyle:r,ccSubmitClicked:e=>{o&&o(e.detail)},hasCustomCallback:s})}getSchedulerMessageBubble(e,t,n,o){let r=n;return r||(r=this.getSchedulerBubbleStyle(t)),d.jsx(Se,{style:this.getSchedulerWrapperStyle(),schedulerMessage:e,schedulerBubbleStyle:r,onScheduleClick:o||void 0})}getSchedulerWrapperStyle(){return{height:"inherit",width:"inherit",display:"block"}}getCardMessageBubble(e,t,n){let o=n;return o||(o=this.getCardMessageBubbleStyle(t)),d.jsx(Fe,{message:e,cardBubbleStyle:o})}getImageMessageBubble(e,t,r,s,i,a){a||(a=new o.ImageBubbleStyle({height:"auto",maxHeight:"500px",maxWidth:"400px",border:"none",borderRadius:"8px",background:"transparent"}));const l=d.jsx(ke,{URL:r?.getAttachments()[0]?.getUrl()??e,closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",fullScreenViewerStyle:{closeIconTint:"blue"},ccCloseClicked:()=>{n.CometChatUIEvents.ccHideDialog.next()}});return d.jsx(fe,{src:e,placeholderImage:t,imageStyle:a,ccImageClicked:()=>{n.CometChatUIEvents.ccShowDialog.next({child:l,confirmCallback:null})}})}getVideoMessageBubble(e,t,n,r,s,i){return i||(i=new o.BaseStyle({height:"130px",width:"100%",border:"none",borderRadius:"8px 8px",background:"transparent"})),d.jsx(Ee,{src:e,poster:r,videoStyle:i})}imageAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.image,title:n.localize("ATTACH_IMAGE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FPhoto%20Library%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FPhoto-Library%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8%2C2.25%20C9.0543618%2C2.25%209.91816512%2C3.06587779%209.99451426%2C4.10073766%20L10%2C4.25%20L10%2C4.749%20L19.25%2C4.75%20C20.3043618%2C4.75%2021.1681651%2C5.56587779%2021.2445143%2C6.60073766%20L21.25%2C6.75%20L21.25%2C8.647%20L21.3090595%2C8.67075883%20C21.560776%2C8.78204037%2021.7890445%2C8.94502905%2021.9776884%2C9.15176047%20L22.0859904%2C9.28098473%20C22.4268417%2C9.7243264%2022.5648157%2C10.2875838%2022.4792305%2C10.8049438%20L20.599742%2C19.7646666%20C20.3801645%2C20.5892111%2019.6644249%2C21.1776759%2018.8253479%2C21.243794%20L18.6666667%2C21.25%20L4.41416667%2C21.25%20C4.34513107%2C21.25%204.27827401%2C21.2406726%204.21478696%2C21.2232093%20L4.198%2C21.217%20L4.13447967%2C21.2119882%20C3.12077897%2C21.0788944%202.34585208%2C20.2581085%202.25808253%2C19.244849%20L2.25%2C19.0833333%20L2.25%2C4.25%20C2.25%2C3.1956382%203.06587779%2C2.33183488%204.10073766%2C2.25548574%20L4.25%2C2.25%20L8%2C2.25%20Z%20M20.5%2C9.9999998%20L8.94041369%2C9.9999998%20C8.7494078%2C9.99989301%208.57810253%2C10.1081415%208.50251018%2C10.2403227%20L8.47304199%2C10.3080169%20L6.50183631%2C19.6519318%20L6.47%2C19.749%20L18.6669246%2C19.7500001%20C18.8652457%2C19.7500001%2019.0419017%2C19.6334019%2019.1157978%2C19.483767%20L19.1409396%2C19.4178635%20L20.9835913%2C10.6286666%20C21.0235655%2C10.4785581%2020.991501%2C10.3183966%2020.8968201%2C10.1952461%20C20.8210754%2C10.0967258%2020.71214%2C10.0308462%2020.5919295%2C10.0084626%20L20.5%2C9.9999998%20Z%20M8%2C3.75%20L4.25%2C3.75%20C4.00454011%2C3.75%203.80039163%2C3.92687516%203.75805567%2C4.16012437%20L3.7499284%2C4.25%20L3.7499284%2C19.0729701%20C3.75450399%2C19.4040804%204.00142215%2C19.6816449%204.32974627%2C19.7247522%20C4.62158992%2C19.7630698%204.89911328%2C19.6058121%205.0118617%2C19.3809093%20L5.04612468%2C19.2936497%20L7.01858631%2C9.94533345%20C7.25034003%2C9.14246197%207.95397669%2C8.57422367%208.77513888%2C8.50674095%20L8.94083333%2C8.5%20L19.75%2C8.5%20L19.75%2C6.75%20C19.75%2C6.50454011%2019.5731248%2C6.30039163%2019.3398756%2C6.25805567%20L19.25%2C6.25%20L9.25%2C6.25%20C8.87030423%2C6.25%208.55650904%2C5.96784612%208.50684662%2C5.60177056%20L8.5%2C5.5%20L8.5%2C4.25%20C8.5%2C4.00454011%208.32312484%2C3.80039163%208.08987563%2C3.75805567%20L8%2C3.75%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.5%2C11.3125%20L10.6157711%2C11.3187346%20C11.1481147%2C11.3764201%2011.5625%2C11.8273176%2011.5625%2C12.375%20C11.5625%2C12.9618025%2011.0868025%2C13.4375%2010.5%2C13.4375%20C9.91319745%2C13.4375%209.4375%2C12.9618025%209.4375%2C12.375%20C9.4375%2C11.8273176%209.85188534%2C11.3764201%2010.3842289%2C11.3187346%20L10.5%2C11.3125%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.7615505%2C13.3341733%20C15.1650281%2C13.339062%2015.5432492%2C13.5206846%2015.7989971%2C13.8261321%20L15.8889717%2C13.9463759%20L18.3148051%2C17.5838759%20C18.5446241%2C17.928486%2018.4515675%2C18.3941527%2018.1069574%2C18.6239717%20C17.7936756%2C18.8328981%2017.3803468%2C18.7749852%2017.1351188%2C18.5038182%20L17.0668616%2C18.4161241%20L14.742%2C14.93%20L13.1806552%2C17.1565514%20C12.9524338%2C17.481881%2012.5156848%2C17.5682521%2012.1842442%2C17.371143%20L12.096698%2C17.3103241%20L11.179%2C16.572%20L9.94871059%2C18.4165154%20C9.73958776%2C18.7296662%209.33567986%2C18.8347993%209.00516806%2C18.6784976%20L8.90848458%2C18.6237106%20C8.59533381%2C18.4145878%208.49020073%2C18.0106799%208.64650244%2C17.6801681%20L8.70128941%2C17.5834846%20L10.0076608%2C15.6272604%20C10.2213273%2C15.3068138%2010.5595979%2C15.0906712%2010.9401624%2C15.0314258%20C11.2731564%2C14.9795861%2011.6118179%2C15.0520295%2011.8942272%2C15.2330124%20L12.0116353%2C15.3171759%20L12.412%2C15.639%20L13.6194632%2C13.9191131%20C13.8512845%2C13.5888451%2014.2147222%2C13.3792001%2014.6114213%2C13.3405523%20L14.7615505%2C13.3341733%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}videoAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.video,title:n.localize("ATTACH_VIDEO"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}audioAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.audio,title:n.localize("ATTACH_AUDIO"),iconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0%29%22%3E%3Cpath%20d%3D%22M1%205C1%203.89543%201.89543%203%203%203H21.5C22.6046%203%2023.5%203.89543%2023.5%205V19C23.5%2020.1046%2022.6046%2021%2021.5%2021H3C1.89543%2021%201%2020.1046%201%2019V5Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%2015.5C9%2015.8978%209.15803%2016.2794%209.43934%2016.5607C9.72064%2016.842%2010.1022%2017%2010.5%2017C10.8978%2017%2011.2794%2016.842%2011.5607%2016.5607C11.842%2016.2794%2012%2015.8978%2012%2015.5C12%2015.1022%2011.842%2014.7206%2011.5607%2014.4393C11.2794%2014.158%2010.8978%2014%2010.5%2014C10.1022%2014%209.72064%2014.158%209.43934%2014.4393C9.15803%2014.7206%209%2015.1022%209%2015.5Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M12%2015V7L14.7141%209.27566C15.3657%209.82133%2015.7957%2010.5251%2015.9433%2011.2871C16.0909%2012.0491%2015.9486%2012.8307%2015.5365%2013.5211%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0%22%3E%3Crect%20width%3D%2224%22%20height%3D%2224%22%20fill%3D%22white%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}fileAttachmentOption(e){return new n.CometChatMessageComposerAction({id:n.CometChatUIKitConstants.MessageTypes.file,title:n.localize("ATTACH_FILE"),iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FAttachment%20File%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FAttachment-File%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.33333333%2C14.6666667%20C9.33333333%2C17.6121853%2011.721148%2C20%2014.6666667%2C20%20C17.6121853%2C20%2020%2C17.6121853%2020%2C14.6666667%20C20%2C11.721148%2017.6121853%2C9.33333333%2014.6666667%2C9.33333333%20C11.721148%2C9.33333333%209.33333333%2C11.721148%209.33333333%2C14.6666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2214.6666667%22%20y1%3D%2212%22%20x2%3D%2214.6666667%22%20y2%3D%2217.3333333%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212%22%20y1%3D%2214.6666667%22%20x2%3D%2217.3333333%22%20y2%3D%2214.6666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6%2C17.3333333%20L1.33333333%2C17.3333333%20C0.596953667%2C17.3333333%200%2C16.7363797%200%2C16%20L0%2C1.33333333%20C0%2C0.596953667%200.596953667%2C0%201.33333333%2C0%20L10.7813333%2C0%20C11.1347086%2C0%2011.4736014%2C0.140428224%2011.7235556%2C0.390222222%20L14.2764444%2C2.94311111%20C14.5262384%2C3.19306523%2014.6666667%2C3.53195804%2014.6666667%2C3.88533333%20L14.6666667%2C6%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:null,iconTint:e.palette.getAccent700(),titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent700(),borderRadius:"8px",background:e.palette.getAccent100()})}getAttachmentOptions(e,t){return[this.imageAttachmentOption(e),this.videoAttachmentOption(e),this.audioAttachmentOption(e),this.fileAttachmentOption(e)]}getLastConversationMessage(e,t,o){let i={...o,textFormatters:o?.textFormatters&&o?.textFormatters.length?[...o.textFormatters]:[this.getMentionsTextFormatter({theme:o.theme,disableMentions:o.disableMentions})]},a=r.ConversationUtils.getLastConversationMessage(e,t,i),l=e.getLastMessage();if(l){let e=i.textFormatters;if(i&&!i.disableMentions){let t;for(let n=0;n<e.length&&(e[n]instanceof r.CometChatMentionsFormatter&&(t=e[n],t.setMessage(l),l.getMentionedUsers().length&&t.setCometChatUserGroupMembers(l.getMentionedUsers()),t.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser())),!t);n++);t||(t=Be.getDataSource().getMentionsTextFormatter({messageObject:l,...i,alignment:null,theme:o.theme}),e.push(t))}if(l&&l instanceof s.CometChat.TextMessage)for(let t=0;t<e.length;t++)a=e[t].getFormattedText(a,{mentionsTargetElement:n.MentionsTargetElement.conversation})}return a}getDefaultDetailsTemplate(e,t,n,o){return r.DetailsUtils.getDefaultDetailsTemplate(e,t,n,o)}getAuxiliaryHeaderMenu(e,t){return[]}getAIOptions(e,t,n,o,r){return[]}getMentionsFormattedText(e,t,o){const r=/<@uid:(.*?)>/g;let s=e.getText(),i=t,a=r.exec(s),l=[],c=e.getMentionedUsers();for(;null!==a;){let e;for(let t=0;t<c.length;t++)a[1]==c[t].getUid()&&(e=c[t]);e&&l.push(e),a=r.exec(s)}let C=this.getMentionsTextFormatter({theme:new n.CometChatTheme({})});return C.setClasses(["cc-mentions"]),C.setCometChatUserGroupMembers(l),i=C.getFormattedText(i,o),i}getAllTextFormatters(e){let t=[];const n=e.disableMentions?null:Be.getDataSource().getMentionsTextFormatter(e),o=Be.getDataSource().getUrlTextFormatter(e);return n&&t.push(n),o&&t.push(o),t}getMentionsTextFormatter(e){let t=new r.CometChatMentionsFormatter;return e&&e.theme&&(t.setComposerMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text2),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text2),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""})),t.setConversationMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""})),t.setRightBubbleMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getTertiary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getTertiary(),mentionTextBackground:""})),t.setLeftBubbleMentionStyle(new r.UserMentionStyle({loggedInUserTextFont:n.fontHelper(e.theme.typography.text3),loggedInUserTextColor:e.theme.palette.getPrimary(),loggedInUserTextBackground:"",mentionTextFont:n.fontHelper(e.theme.typography.text3),mentionTextColor:e.theme.palette.getPrimary(),mentionTextBackground:""}))),t}getUrlTextFormatter(e={}){let t=new r.CometChatUrlsFormatter([/(https?:\/\/[^\s]+)/g]);return e.alignment==n.MessageBubbleAlignment.left?t.setStyle({formattedTextColor:e.theme.palette.getPrimary(),formattedTextFont:n.fontHelper(e.theme.typography.text3)}):t.setStyle({formattedTextColor:e.theme.palette.getTertiary(),formattedTextFont:n.fontHelper(e.theme.typography.text3)}),t}}class Be{static init(e){this.dataSource=e??new Me,e||(this.names=[]),this.names.push(this.dataSource.getId())}static enable(e){let t=e(this.dataSource);this.names.find(e=>e===t.getId())||(this.dataSource=t,this.names.push(this.dataSource.getId()))}static getDataSource(){return this.dataSource}}Be.names=["message utils"];class Le{enable(){s.CometChat.isAIFeatureEnabled(this.getExtensionId()).then(e=>{e&&this.addExtension()})}}class Ue{constructor(e){this.dataSource=e}getTextMessageOptions(e,t,n,o){return(this.dataSource??new Me).getTextMessageOptions(e,t,n,o)}getImageMessageOptions(e,t,n,o){return(this.dataSource??new Me).getImageMessageOptions(e,t,n,o)}getVideoMessageOptions(e,t,n,o){return(this.dataSource??new Me).getVideoMessageOptions(e,t,n,o)}getAudioMessageOptions(e,t,n,o){return(this.dataSource??new Me).getAudioMessageOptions(e,t,n,o)}getFileMessageOptions(e,t,n,o){return(this.dataSource??new Me).getFileMessageOptions(e,t,n,o)}getBottomView(e,t){return(this.dataSource??new Me).getBottomView(e,t)}getTextMessageContentView(e,t,n,o){return(this.dataSource??new Me).getTextMessageContentView(e,t,n,o)}getImageMessageContentView(e,t,n){return(this.dataSource??new Me).getImageMessageContentView(e,t,n)}getVideoMessageContentView(e,t,n){return(this.dataSource??new Me).getVideoMessageContentView(e,t,n)}getAudioMessageContentView(e,t,n){return(this.dataSource??new Me).getAudioMessageContentView(e,t,n)}getFileMessageContentView(e,t,n){return(this.dataSource??new Me).getFileMessageContentView(e,t,n)}getFormMessageContentView(e,t,n){return(this.dataSource??new Me).getFormMessageContentView(e,t,n)}getSchedulerMessageContentView(e,t,n){return(this.dataSource??new Me).getSchedulerMessageContentView(e,t,n)}getCardMessageContentView(e,t,n){return(this.dataSource??new Me).getCardMessageContentView(e,t,n)}getTextMessageTemplate(e,t){return(this.dataSource??new Me).getTextMessageTemplate(e,t)}getImageMessageTemplate(e){return(this.dataSource??new Me).getImageMessageTemplate(e)}getVideoMessageTemplate(e){return(this.dataSource??new Me).getVideoMessageTemplate(e)}getAudioMessageTemplate(e){return(this.dataSource??new Me).getAudioMessageTemplate(e)}getFileMessageTemplate(e){return(this.dataSource??new Me).getFileMessageTemplate(e)}getGroupActionTemplate(e){return(this.dataSource??new Me).getGroupActionTemplate(e)}getFormMessageTemplate(e){return(this.dataSource??new Me).getFormMessageTemplate(e)}getSchedulerMessageTemplate(e){return(this.dataSource??new Me).getSchedulerMessageTemplate(e)}getCardMessageTemplate(e){return(this.dataSource??new Me).getCardMessageTemplate(e)}getAllMessageTemplates(e,t){return(this.dataSource??new Me).getAllMessageTemplates(e,t)}getMessageTemplate(e,t,n){return(this.dataSource??new Me).getMessageTemplate(e,t,n)}getMessageOptions(e,t,n,o){return(this.dataSource??new Me).getMessageOptions(e,t,n,o)}getCommonOptions(e,t,n,o){return(this.dataSource??new Me).getCommonOptions(e,t,n,o)}getAttachmentOptions(e,t){return(this.dataSource??new Me).getAttachmentOptions(e,t)}getAllMessageTypes(){return(this.dataSource??new Me).getAllMessageTypes()}getAllMessageCategories(){return(this.dataSource??new Me).getAllMessageCategories()}getAuxiliaryOptions(e,t,n,o){return(this.dataSource??new Me).getAuxiliaryOptions(e,t,n,o)}getId(){return(this.dataSource??new Me).getId()}getDeleteMessageBubble(e,t,n){return(this.dataSource??new Me).getDeleteMessageBubble(e,t,n)}getGroupActionBubble(e,t,n){return(this.dataSource??new Me).getGroupActionBubble(e,t,n)}getTextMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getTextMessageBubble(e,t,n,o,r,s)}getVideoMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getVideoMessageBubble(e,t,n,o,r,s)}getImageMessageBubble(e,t,n,o,r,s){return(this.dataSource??new Me).getImageMessageBubble(e,t,n,o,r,s)}getAudioMessageBubble(e,t,n,o,r){return(this.dataSource??new Me).getAudioMessageBubble(e,t,n,o,r)}getFileMessageBubble(e,t,n,o,r){return(this.dataSource??new Me).getFileMessageBubble(e,t,n,o,r)}getFormMessageBubble(e,t,n,o){return(this.dataSource??new Me).getFormMessageBubble(e,t,n,o)}getSchedulerMessageBubble(e,t,n,o){return(this.dataSource??new Me).getSchedulerMessageBubble(e,t,n,o)}getCardMessageBubble(e,t,n){return(this.dataSource??new Me).getCardMessageBubble(e,t,n)}getLastConversationMessage(e,t,n){return(this.dataSource??new Me).getLastConversationMessage(e,t,n)}getDefaultDetailsTemplate(e,t,n,o){return(this.dataSource??new Me).getDefaultDetailsTemplate(e,t,n,o)}getAuxiliaryHeaderMenu(e,t){return(this.dataSource??new Me).getAuxiliaryHeaderMenu(e,t)}getAIOptions(e,t,n,o,r){return(this.dataSource??new Me).getAIOptions(e,t,n,o,r)}getAllTextFormatters(e){let t=[];const n=e.disableMentions?null:(this.dataSource??new Me).getMentionsTextFormatter(e),o=(this.dataSource??new Me).getUrlTextFormatter(e);return n&&t.push(n),o&&t.push(o),t}getMentionsTextFormatter(e={}){return(this.dataSource??new Me).getMentionsTextFormatter(e)}getUrlTextFormatter(e={}){return(this.dataSource??new Me).getUrlTextFormatter(e)}getMentionsFormattedText(e,t,n){return(this.dataSource??new Me).getMentionsFormattedText(e,t,n)}}const Re=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t}),Pe=(e,t)=>e.sender.getUid()===t.getUid()?n.MessageBubbleAlignment.right:n.MessageBubbleAlignment.left,Oe=(e,t,o,r)=>{let s={};s=o===n.MessageBubbleAlignment.right?r?.senderMessageBubbleStyle||{}:r?.botMessageBubbleStyle||{};const i={textFont:s?.textFont||n.fontHelper(t.typography.text3)};return o===n.MessageBubbleAlignment.right?i.textColor=s?.textColor||t.palette.getAccent900():i.textColor=s?.textColor||t.palette.getAccent(),d.jsx(Re,{text:e.getText(),textStyle:i})},je=(e,t,o)=>{let r,s=!1;return"send"!==e.getStatus()&&"wait"!==e.getStatus()&&"error"!==e.getStatus()||("wait"===e.getStatus()?r=n.Receipts.wait:"sent"===e.getStatus()?r=n.Receipts.sent:"error"===e.getStatus()&&(r=n.Receipts.error),s=!0),d.jsxs("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[d.jsx("div",{style:{display:"inline-block"},children:d.jsx("cometchat-date",{timestamp:e.getSentAt(),dateStyle:JSON.stringify(qe(o)),pattern:n.DatePatterns.time})}),s?d.jsx("div",{style:{position:"relative",height:"20px",width:"20px"},children:d.jsx("cometchat-receipt",{receipt:r,waitIcon:t?.loadingIconURL,errorIcon:t?.errorIconURL,receiptStyle:JSON.stringify($e(t?.assistBotStyle,o))})}):null]})},Ve=(e,t)=>({display:"flex",width:e?.width||"100%",height:e?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px",background:e?.background||t?.palette?.getBackground(),borderRadius:e?.borderRadius||"8px"}),Ge=(e,t)=>({display:"flex",justifyContent:"space-between",alignItems:"center",font:e?.optionTitleFont||t&&n.fontHelper(t?.typography?.text2),color:e?.optionTitleColor||t?.palette?.getAccent()}),He=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.backIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),Qe=(e,t)=>new o.ActionSheetStyle({ActionSheetSeparatorTint:t?.palette?.getAccent400(),background:e?.buttonBackground||t?.palette?.getBackground(),titleColor:e?.buttonTextColor||t?.palette?.getAccent(),titleFont:e?.buttonTextFont||t&&n.fontHelper(t?.typography?.text2),listItemBackground:"transparent",height:"100%",width:"100%",border:"none"}),Ne=e=>({display:"flex",justifyContent:"flex-end",height:"100%",width:"100%",background:e?.palette?.getAccent600()}),Ke=(e,t)=>({display:"flex",flexDirection:"column",width:"40%",minWidth:"350px",maxWidth:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",background:e?.background||t?.palette.getBackground()}),ze=e=>({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:"40px",padding:"10px",boxSizing:"border-box",background:e?.palette.getAccent200(),marginBottom:"10px"}),Je=(e={},t)=>({font:e.titleFont||n.fontHelper(t.typography.subtitle1),color:e.titleColor||t.palette.getAccent()}),Ye=(e={},t)=>({font:e.subtitleFont||n.fontHelper(t.typography.caption2),color:e.subtitleColor||t.palette.getAccent500()}),_e=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.closeIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),We=(e,t,n,o)=>{if(e.sender.getUid()===n.getUid()){const e=o?.senderMessageBubbleStyle||{};return{background:e.background||t.palette.getPrimary(),borderRadius:e.borderRadius||"12px",border:e.border||"none"}}{const e=o?.botMessageBubbleStyle||{};return{background:e.background||t.palette.getAccent100(),borderRadius:e.borderRadius||"12px",border:e.border||"none"}}},Ze=(e,t)=>e||new o.MessageInputStyle({height:"40px",width:"100%",maxHeight:"40px",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"12px",background:t.palette.getAccent50(),textFont:n.fontHelper(t.typography.text2),textColor:t.palette.getAccent(),dividerColor:t.palette.getAccent100(),inputBorder:"none",inputBorderRadius:"0px",inputBackground:"transparent"}),Xe=(e,t)=>({height:"24px",width:"24px",buttonIconTint:e?.sendIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}),qe=e=>({textColor:e?.palette?.getAccent600(),textFont:n.fontHelper(e?.typography?.caption2),padding:"0px"}),$e=(e,t)=>new o.ReceiptStyle({waitIconTint:e?.loadingIconTint||t?.palette?.getAccent700(),errorIconTint:e?.errorIconTint||t?.palette?.getError()}),et=(e,t)=>{const o=Pe(e,t);return{flex:"1 1 0",display:"flex",flexDirection:"column",borderRadius:"inherit",justifyContent:o===n.MessageBubbleAlignment.left?"flex-start":"flex-end",alignItems:o===n.MessageBubbleAlignment.left?"flex-start":"flex-end",position:"relative"}};var tt="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const nt={title:void 0,bots:void 0,closeCallback:void 0,backCallback:void 0,configuration:void 0},ot=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t,events:{onClick:"cc-actionsheet-clicked"}}),rt=e=>{const{title:n,bots:o,closeCallback:r,backCallback:s,configuration:i}={...nt,...e},{theme:a}=t.useContext(U);return d.jsx("div",{className:"slideable-container",style:Ve(i?.assistBotStyle,a),children:d.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",padding:"10px",boxSizing:"border-box"},children:[d.jsxs("div",{style:Ge(i?.assistBotStyle,a),children:[d.jsx("div",{children:d.jsx("cometchat-button",{iconURL:i?.backIconURL||tt,onClick:()=>s?s():null,buttonStyle:JSON.stringify(He(i?.assistBotStyle,a))})}),d.jsx("div",{children:n}),d.jsx("div",{style:{flex:.2}})]}),d.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100%",height:"100%",boxSizing:"border-box"},children:d.jsx(ot,{actions:o,hideLayoutMode:!0,actionSheetStyle:Qe(i?.assistBotStyle,a),onClick:e=>{const t=e?.detail?.action;t.onClick&&t.onClick(),r&&r()}})})]})})};var st="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const it={bot:void 0,sender:void 0,messageSendCallBack:void 0,closeCallback:void 0,configuration:void 0},at=ye({tagName:"cometchat-text-input",elementClass:o.CometChatTextInput,react:t,events:{ccTextInputChanged:"cc-text-input-changed",ccTextInputEntered:"cc-text-input-entered"}}),lt=e=>{let{bot:i,sender:a,messageSendCallBack:l,closeCallback:c,configuration:C}={...it,...e};const g=t.useRef(!0),u=n.localize("COMETCHAT_ASK_BOT_SUBTITLE"),p=t.useRef(n.localize("COMETCHAT_BOT_FIRST_MESSAGE")),h=t.useRef(null),m=t.useRef(""),[A,x]=t.useState([]),{theme:b}=t.useContext(U);t.useEffect(()=>{y()},[]);const y=t.useCallback(()=>{C?.botFirstMessageText&&(p.current=C.botFirstMessageText(i));const e=new s.CometChat.TextMessage(a.getUid(),p.current,n.CometChatUIKitConstants.MessageReceiverType.user);e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e.setMuid(r.CometChatUIKitUtility.ID()),e.setSender(i),x([e])},[A,x]),w=t.useCallback(e=>{m.current=e},[m]),f=t.useCallback(e=>{l&&l(m.current,i).then(t=>{const o=new s.CometChat.TextMessage(a.getUid(),t,n.CometChatUIKitConstants.MessageReceiverType.user);o.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),o.setMuid(r.CometChatUIKitUtility.ID()),o.setSender(i),o.setStatus("sent"),x(t=>{const n=t.map(t=>(t.getMuid()===e&&t.setStatus("sent"),t));return n.push(o),n})}).catch(t=>{x(t=>t.map(t=>(t.getMuid()===e&&t.setStatus("error"),t)))})},[A,x,m]),D=t.useCallback(()=>{if(!m.current)return;const e=r.CometChatUIKitUtility.ID(),t=new s.CometChat.TextMessage(i.getUid(),m.current,n.CometChatUIKitConstants.MessageReceiverType.user);t.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),t.setMuid(e),t.setSender(a),t.setStatus("wait"),x(e=>[...e,t]),h?.current?.emptyInputField(),f(e)},[A,x,f,m]),E=t.useMemo(()=>function(e,t){return d.jsx("div",{style:et(e,a),children:d.jsx(W,{id:e?.id,messageBubbleStyle:We(e,b,a,C),alignment:Pe(e,a),contentView:Oe(e,b,Pe(e,a),C),footerView:je(e,C,b),leadingView:void 0,headerView:void 0,replyView:void 0,bottomView:void 0,threadView:void 0,statusInfoView:void 0,options:[]})})},[We,Pe,Oe,je]);return d.jsx("div",{style:Ne(b),children:d.jsxs("div",{style:Ke(C?.assistBotStyle,b),children:[d.jsxs("div",{style:ze(b),children:[d.jsxs("div",{style:{display:"flex",gap:"10px",alignItems:"center"},children:[d.jsx("cometchat-avatar",{name:i?.getName(),avatarStyle:JSON.stringify((v=C?.avatarStyle,v||new o.AvatarStyle({borderRadius:"16px",width:"28px",height:"28px"}))),image:i?.getAvatar()}),d.jsxs("div",{children:[d.jsx("div",{style:Je(C?.assistBotStyle,b),children:i?.getName()}),d.jsx("div",{style:Ye(C?.assistBotStyle,b),children:u})]})]}),d.jsx("div",{children:d.jsx("cometchat-button",{iconURL:C?.closeIconURL||st,onClick:()=>{c&&c()},buttonStyle:JSON.stringify(_e(C?.assistBotStyle,b))})})]}),d.jsx(k,{listStyle:{height:"calc(100% - 90px)"},list:A,listItem:E,listItemKey:"getMuid",state:n.States.loaded,hideSearch:!0,showSectionHeader:!1,title:"",scrollToBottom:g?.current}),d.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"40px",padding:"5px",boxSizing:"border-box"},children:[d.jsx(at,{style:{flex:.99},ref:h,textInputStyle:Ze(C?.textInputStyle,b),ccTextInputChanged:e=>w(e?.detail?.value),ccTextInputEntered:()=>D()}),d.jsx("cometchat-button",{iconURL:C?.sendIconURL||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSend%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSend%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.158865921%2C1.85985859%20C-0.108182698%2C1.38202197%20-0.0332622567%2C0.786017075%200.343741637%2C0.389140701%20C0.72074553%2C-0.00773567366%201.31211969%2C-0.113146836%201.80303259%2C0.129025252%20L17.6480326%2C8.17819192%20C17.857662%2C8.28481329%2017.9896898%2C8.50008892%2017.9896898%2C8.73527525%20C17.9896898%2C8.97046158%2017.857662%2C9.18573721%2017.6480326%2C9.29235859%20L1.80303259%2C17.3523586%20C1.31211969%2C17.5945307%200.72074553%2C17.4891195%200.343741637%2C17.0922431%20C-0.0332622567%2C16.6953668%20-0.108182698%2C16.0993619%200.158865921%2C15.6215253%20L4.37386592%2C8.73485859%20L0.158865921%2C1.85985859%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2217.9896993%22%20y1%3D%228.73485859%22%20x2%3D%224.36969925%22%20y2%3D%228.73485859%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:()=>D(),buttonStyle:JSON.stringify(Xe(C?.assistBotStyle,b))})]})]})});var v};class ct extends Ue{constructor(e,t){super(e),this.bots=[],this.theme=new n.CometChatTheme({}),this.onMessageSent=async(e,t)=>new Promise(async(o,r)=>{try{let r,i=this.user?this.user?.getUid():this.group?.getGuid(),a=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(r=await(this.configuration?.apiConfiguration(t,this.user,this.group)));return o(await s.CometChat.askBot(i,a,t.getUid(),e,r||{}))}catch(e){r(e)}}),this.closeChat=()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messages)},this.onOptionClick=e=>{n.CometChatUIEvents.ccShowPanel.next({child:d.jsx(lt,{bot:e,sender:this.loggedInUser,configuration:this.configuration,messageSendCallBack:this.onMessageSent,closeCallback:this.closeChat}),position:n.PanelAlignment.messages})},this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener(),this.getAllBots()},1e3)}getId(){return"aiassistbot"}getAIOptions(e,t,o,r,s){this.user=e,this.group=t;const i=n.localize("COMETCHAT_ASK_AI_BOT"),a=n.localize("COMETCHAT_ASK_BOT"),l=this.bots?.length,c=l>1?i:`${a} ${this.bots[0]?.getName()}`;if(r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.assistBotStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.assistBotStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.assistBotStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);if(1===l){const e=new n.CometChatMessageComposerAction({title:c,onClick:()=>{this.onOptionClick(this.bots[0])},id:"ai-assist-bot",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});a.push(e)}else if(l>1){const e=this.bots.map(e=>new n.CometChatMessageComposerAction({title:e.getName(),onClick:()=>{this.onOptionClick(e)},id:e.getUid()})),t=new n.CometChatActionsView({title:c,customView:t=>d.jsx(rt,{title:c,configuration:this.configuration,backCallback:t?.backAction,closeCallback:t?.closePopover,bots:e}),id:"ai-assist-bot",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});a.push(t)}return a}}getAllBots(){(new s.CometChat.UsersRequestBuilder).setLimit(30).setTags(["aibot"]).build().fetchNext().then(e=>{this.bots=e})}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(()=>{this.closeChat()})}}class Ct extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new ct(e,this.configuration))}getExtensionId(){return"bots"}}const dt={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"hidden"},gt=(e,t)=>({replyTextFont:t?.textFont||n.fontHelper(e.typography.caption1),replyTextColor:t?.textColor||e?.palette.getAccent(),replyBackground:t?.textBackground||"inherit",boxShadow:`0px 0px 1px ${e?.palette.getAccent600()}`,background:t?.background||"inherit",width:t?.width||"100%",height:t?.height||"100%",border:t?.textBorder||"none",borderRadius:t?.textBorderRadius||"8px",display:"flex",justifyContent:"flex-start"});var ut="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20standalone%3D%22no%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%2020010904%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FTR%2F2001%2FREC-SVG-20010904%2FDTD%2Fsvg10.dtd%22%3E%3Csvg%20version%3D%221.0%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22100.000000pt%22%20height%3D%22100.000000pt%22%20viewBox%3D%220%200%20100.000000%20100.000000%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%3E%3Cg%20transform%3D%22translate%280.000000%2C100.000000%29%20scale%280.100000%2C-0.100000%29%22fill%3D%22%23000000%22%20stroke%3D%22none%22%3E%3Cpath%20d%3D%22M375%20847%20c-221%20-73%20-326%20-269%20-254%20-472%20l22%20-62%20-25%20-74%20c-14%20-41-23%20-80%20-21%20-86%206%20-17%2042%20-15%20138%206%2077%2017%2082%2017%20138%20-1%2072%20-22%20199%20-25%20216%20-46%207%209%2021%205%2030%20-5%2013%20-21%2016%20-79%2016%20-44%200%20-98%208%20-136%2019%20-58%2018%20-67%2019%20-123%206-89%20-21%20-88%20-23%20-65%2042%20l20%2058%20-26%2056%20c-52%20116%20-25%20240%2069%20327%2077%2071%20123%2087246%2087%20123%200%20169%20-16%20245%20-86%2064%20-59%2088%20-108%2094%20-199%205%20-68%208%20-75%2028%20-78%2036-5%2048%2038%2033%20118%20-22%20125%20-94%20215%20-218%20273%20-59%2028%20-79%2032%20-167%2034%20-63%202%20-115-2%20-140%20-10z%22%2F%3E%3Cpath%20d%3D%22M687%20313%20c-16%20-15%20-4%20-42%2038%20-83%20l45%20-44%20-45%20-46%20c-47%20-48%20-56%20-74-28%20-84%2011%20-5%2031%208%2064%2040%20l48%2047%2050%20-46%20c54%20-50%2061%20-53%2079%20-35%2018%2018%2015%2025-35%2079%20l-46%2050%2048%2049%20c41%2042%2046%2051%2035%2065%20-19%2023%20-30%2019%20-80%20-30%20l-46%20-45%20-4445%20c-41%2042%20-68%2054%20-83%2038z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",pt="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%22%20height%3D%22100%22%20xml%3Aspace%3D%22preserve%22%20version%3D%221.1%22%20viewBox%3D%220%200%20100%20100%22%3E%20%20%20%20%3Cimage%20width%3D%22100%22%20height%3D%22100%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAABqxJREFUeF7tnY2x5DQMgHUdcBUAFXBUAFQAVABXAVABUAFQAVDBQQVABRwVABUAFcB8MzEsef6RbHmjl9gzO%2B%2FmNnFkfZIs%2F6zzRFYJpYEnoaRZwsgCEswIFpAFJJgGgomzPGQBCaaBYOIsD1lAgmkgmDjLQxaQYBoIJs7ykAUkmAaCifMYPeQVEXlt%2B%2FDvXPlt%2B8%2BXIvJnMJ1XxYkOBMW%2FJyJviMizBoRSQwECID4%2FiciPIgKokCUaECz%2BbRF5dwNR8oBRZQIJMN9vf5NHjdY7fH8UIED4YDKEmrK%2BE5FvRYS%2Fh5YjgWD9hCNAACRCwVM%2B38Ac0vccBeRDEflCRGaFpFG4gPlKRL4crch6%2F72B4Alfb52zVdZ0PZb7101HnauHZADYrw5CTx7zTa%2Bw1vvuBQTlYG2EJ2shMyIrStmRtQPm2WRoGAOft6wCiAhACGXWZ5sfdQ8gVq%2FAA8h%2B6GCBMCOWIxNhk2xOGzaR45MNjlnR2htmA%2FlURD5TCoMnAAFrnAGhJAZg%2BGg9B08HzJQyCwhW90KZPQECaHjDkQWvQQ4NGELo%2BzNC2AwgdKjAIG7XCvEYSzs8998JSSpOBkg7WvK%2F4w3FGwiN%2BEHRGFJKrPGeocnqfchHyL0rFE8gGhh4xfMA4UkLR9smN0%2FxAkKfgWfUwhR9BeEgslfkQNE2vOWjCkUMzQWKFxBi7scVgQlRte%2B1Fnvkda0QRkf%2F5qiAHkBaqS0DKm3qO9qe2fe3oAynxKNAiLG%2FVrRwJhipmS0ohK7uFH4UCDBK6eEZwlTJ1mpQ6CNf7%2B0rR4DUQpVLPJ0dfwbrZ6xFkpIr3aGrF0gtVLllHIMKm3072dfPlQjRFbp6gTDfVJq5ZZxxt%2Bnq2Vpv1M90C%2Bl%2BrtCPAMVUeoDUvAMQALlSITyVxihmL%2BkBUvMOOrPpawbBaBO6SG5y0%2FhmL7ECqT38it6hSYWfWjIuKxDWDViCzZUrekfSQ81QTWMxKxA6sNwOkSt7R8tLCOEYq6pYgGAFfxRqNXdeKuke10W1ZIc5LtVuSQsQBkEMhvbFZAGPS8dmaUsRhIU41ZYiC5BSdrXC1X%2FcSlMqbNoojer%2FR90ChFFpbr2DteVoy7Bm03a6oTRQZH6LbKtZLED%2BXtlVU59cQD%2BbG5OoslAtEDwDD9kXNXlVU85x0VAk0QIpuSLLslE2SkfBWeprVXN8WiClAaG6s4qirTvIUZrbUg0QR4GsDOsh4VKm5Qqk9JAzrwr2OtNdgLBjhJ0l%2B7KAHOQhpT5khaxgQFan%2FhBIKZq4ZlmltPcKmxmsfUlurV29z0CbZZVmMtfAMI8LfdG58xejJRVWraRqgQxPCVjN7KrXW4CUpgRUsfGqCra22wKkNAJdmZZV65XrLUBqU8vdWycd23KKqixAagv5awnXyRwsQHhkaYnSvP%2FISf7TVWMFUlpXRzHLSxzMwwrEdZeeg%2Fynq8IKBAXUfhtxJS8hycFAGfipBn0a6%2BkBcnUv2f8OHxhs9FDtu2pB6QHS8hL1HqSWcEG%2Fzy3Ruk0h9QKpecnZN86VZixUu0paRtYLhHpLI%2FezzwBjcJzDtS%2BHA7nqxuuQQGobi8%2BeaYUEUlrSPXv%2FQZgKCeSq4SokkCuHq5BArhyuQgK5crgKB%2BTq4SocEI9wBVQm5viJA289oPCDH%2FZ4uU3StUbEA9%2BHyrKs4Sq97SC9biLNkOb0wXwQYNie6jJRN6D02q1hgLTCFUrE6pPlo%2FzWyZ6lhtPo28OUPXWLfBygjGwcWa7eM7UJEQZI7dCABMNTcamu9K6PX27WHrQehNLTi2A4jzfnoSiYny1rz4IMM7lYClczIGjqTG%2FO2SsyeaXFOy1LBrkFOrcZCu1sb%2BsoP40CI19j%2FVnF7Uy3et%2BuRgFaIGxuSGecaA%2BvLz0fi%2F795m0H6e06GnlnXdOz%2BxI98HHNDLVAkpuiTCuQW%2BWzXYgG5MIMYNjKn1LhWcrf18urjugfQxQtkNrJabcNQdG3b0LreW1dejMbXqk5GL9HkUlGDKT7BNGeB7fu0QKhnn1nhvJT5pNeuOLqvpvwaRCZMiY8SOulKTwi3%2B1Hm1G19Of%2BvQUID09KQfHa1NNd6K3C9FqjPZxkFDOMY1Zb%2Fq3XCmS6QFd%2FwALSbwFhNsr1N%2BEcd4bcKHcO1fa1IuRGub6mnOOuMHNZ51DneCtKc3qm42BLYqxO3Q4oN0hWHSyjedQCotHSw2vS79AZA6V3L%2FbVtLtrAXFRo18lC4ifLl1qWkBc1OhXyQLip0uXmhYQFzX6VfIP%2BqZ1dOfAgekAAAAASUVORK5CYII%3D%22%2F%3E%20%20%3C%2Fsvg%3E",ht="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20id%3D%22Icons%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20viewBox%3D%220%200%2032%2032%22%20style%3D%22enable-background%3Anew%200%200%2032%2032%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%20.st0%7Bfill%3Anone%3Bstroke%3A%23000000%3Bstroke-width%3A2%3Bstroke-linecap%3Around%3Bstroke-linejoin%3Around%3Bstroke-miterlimit%3A10%3B%7D%3C%2Fstyle%3E%3Cline%20class%3D%22st0%22%20x1%3D%2216%22%20y1%3D%223%22%20x2%3D%2216%22%20y2%3D%228%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%226.8%22%20y1%3D%226.8%22%20x2%3D%2210.3%22%20y2%3D%2210.3%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%223%22%20y1%3D%2216%22%20x2%3D%228%22%20y2%3D%2216%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%226.8%22%20y1%3D%2225.2%22%20x2%3D%2210.3%22%20y2%3D%2221.7%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2216%22%20y1%3D%2229%22%20x2%3D%2216%22%20y2%3D%2224%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2225.2%22%20y1%3D%2225.2%22%20x2%3D%2221.7%22%20y2%3D%2221.7%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2229%22%20y1%3D%2216%22%20x2%3D%2224%22%20y2%3D%2216%22%2F%3E%3Cline%20class%3D%22st0%22%20x1%3D%2225.2%22%20y1%3D%226.8%22%20x2%3D%2221.7%22%20y2%3D%2210.3%22%2F%3E%3C%2Fsvg%3E";const mt={getConversationStarterCallback:void 0,editReplyCallback:void 0,configuration:void 0},At=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}}),xt=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),bt=e=>{const{getConversationStarterCallback:o,editReplyCallback:r,configuration:s}={...mt,...e},[i,a]=t.useState(n.States.loading),[l,c]=t.useState(null),{theme:C}=t.useContext(U),g=n.localize("SOMETHING_WRONG"),u=n.localize("NO_MESSAGES_FOUND"),p=n.localize("GENERATING_ICEBREAKERS");return t.useEffect(()=>{a(n.States.loading),e&&o&&o(C).then(async t=>{t?(a(n.States.loaded),c(await async function(t){return new Promise((n,o)=>{try{let i=s?.customView;if(!i){let o=d.jsx(At,{smartReplyStyle:gt(C,s?.conversationStarterStyle),replies:t,ccReplyClicked:t=>{e&&r&&r(t?.detail?.reply)},closeIconURL:""},"conversation-starter");return n(o)}s?.customView(t).then(e=>n(e)).catch(e=>o(e))}catch(e){o(e)}})}(t))):a(n.States.empty)}).catch(e=>{a(n.States.error)})},[]),d.jsx("div",{className:"slideable-container",style:{...(h=s?.conversationStarterStyle,{display:"flex",overflow:"hidden",width:h?.width||"100%",height:h?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px"}),minHeight:"50px",width:"100%"},children:d.jsx("div",{style:dt,children:d.jsx("div",{style:{height:"100%",width:"100%",marginTop:"12px",overflow:"hidden auto"},children:i===n.States.loaded?l:function(){let e=null;switch(i){case n.States.loading:e=function(){let e=s?.loadingStateView;return d.jsx(xt,{state:n.States.loading,style:s?.conversationStarterStyle,loadingIconURL:s?.loadingIconURL||ht,loadingStateText:p,children:e?d.jsx("div",{slot:"loadingView",children:d.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=s?.errorStateView;return d.jsx(xt,{state:n.States.error,style:s?.conversationStarterStyle,errorIconURL:s?.errorIconURL||pt,errorStateText:g,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=s?.emptyStateView;return d.jsx(xt,{state:n.States.empty,style:s?.conversationStarterStyle,emptyIconURL:s?.emptyIconURL||ut,emptyStateText:u,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();case n.States.loaded:}return e}()})})});var h};class yt extends Ue{constructor(e,t){super(e),this.currentMessage=null,this.theme=new n.CometChatTheme({}),this.getConversationStarter=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getConversationStarter(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aiconversationstarter"}editReply(e){n.CometChatUIEvents.ccComposeMessage.next(e),n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)}closeIfMessageReceived(e){e?.getReceiverId()!==this.loggedInUser?.getUid()||this.currentMessage||n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)}loadConversationStarter(){n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:d.jsx(bt,{configuration:this.configuration,getConversationStarterCallback:this.getConversationStarter,editReplyCallback:this.editReply}),position:n.PanelAlignment.messageListFooter})}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.user=e.user,this.group=e.group,this.currentMessage||this.loadConversationStarter()}),n.CometChatMessageEvents.ccMessageSent.subscribe(()=>{this.currentMessage||(n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null)})}}class wt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new yt(e,this.configuration))}getExtensionId(){return"conversation-starter"}}const ft={width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"hidden"},Dt=(e,t)=>new o.PanelStyle({width:"100%",height:"fit-content",border:`1px solid ${e.palette.getPrimary()}`,borderRadius:"8px",background:e.palette.getBackground(),textColor:t?.textColor||e.palette.getAccent600(),titleColor:t?.titleTextColor||e.palette.getAccent(),textFont:t?.textFont||n.fontHelper(e.typography.text2),titleFont:t?.titleTextFont||n.fontHelper(e.typography.text1)}),Et={getConversationSummaryCallback:void 0,editReplyCallback:void 0,closeCallback:void 0,configuration:void 0};ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}});const vt=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),It=ye({tagName:"cometchat-panel",elementClass:o.CometChatPanel,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),St=e=>{const{getConversationSummaryCallback:o,editReplyCallback:r,closeCallback:s,configuration:i}={...Et,...e},[a,l]=t.useState(n.States.loading),[c,C]=t.useState(null),{theme:g}=t.useContext(U),u=n.localize("SOMETHING_WRONG"),p=n.localize("NO_MESSAGES_FOUND"),h=n.localize("GENERATING_SUMMARY"),m=n.localize("CONVERSATION_SUMMARY");return t.useEffect(()=>{l(n.States.loading),e&&o&&o(g).then(async e=>{e?(l(n.States.loaded),C(await async function(e){return new Promise((t,n)=>{try{let o=i?.customView;if(!o){let n=d.jsx(It,{panelStyle:Dt(g,i?.conversationSummaryStyle),title:m,text:e,closeIconUrl:i?.closeIconURL||st,ccCloseClicked:()=>s()});return t(n)}i?.customView(e,s).then(e=>t(e)).catch(e=>n(e))}catch(e){n(e)}})}(e))):l(n.States.empty)}).catch(e=>{l(n.States.error)})},[]),d.jsx("div",{className:"slideable-container",style:{...(A=i?.conversationSummaryStyle,{display:"flex",overflow:"hidden",width:A?.width||"100%",height:A?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px"}),minHeight:"50px",width:"100%"},children:d.jsx("div",{style:ft,children:d.jsx("div",{style:{height:"100%",width:"95%",marginTop:"12px",overflow:"hidden auto"},children:a===n.States.loaded?c:function(){let e=null;switch(a){case n.States.loading:e=function(){let e=i?.loadingStateView;return d.jsx(vt,{state:n.States.loading,style:i?.conversationSummaryStyle,loadingIconURL:i?.loadingIconURL||ht,loadingStateText:h,children:e?d.jsx("div",{slot:"loadingView",children:d.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=i?.errorStateView;return d.jsx(vt,{state:n.States.error,style:i?.conversationSummaryStyle,errorIconURL:i?.errorIconURL||pt,errorStateText:u,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=i?.emptyStateView;return d.jsx(vt,{state:n.States.empty,style:i?.conversationSummaryStyle,emptyIconURL:i?.emptyIconURL||ut,emptyStateText:p,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();case n.States.loaded:}return e}()})})});var A};class Ft extends Ue{constructor(e,t){super(e),this.currentMessage=null,this.unreadMessageCount=0,this.theme=new n.CometChatTheme({}),this.LISTENER_ID="aiconversationsummary__listener",this.closePanel=()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter)},this.getConversationSummary=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getConversationSummary(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aiconversationsummary"}loadConversationSummary(){n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:d.jsx(St,{configuration:this.configuration,getConversationSummaryCallback:this.getConversationSummary,closeCallback:this.closePanel}),position:n.PanelAlignment.messageListFooter})}getAIOptions(e,t,o,r,s){if(this.user=e,this.group=t,r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.conversationSummaryStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.conversationSummaryStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.conversationSummaryStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);let l=new n.CometChatMessageComposerAction({title:n.localize("CONVERSATION_SUMMARY"),onClick:()=>{this.loadConversationSummary()},id:"ai-conversation-summary",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});return a.push(l),a}}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.user=e.user,this.group=e.group,this.unreadMessageCount=e.unreadMessageCount??0,this.unreadMessageCount>(this.configuration?.unreadMessageThreshold??30)&&this.loadConversationSummary()})}}class kt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Ft(e,this.configuration))}getExtensionId(){return"conversation-summary"}}const Tt=(e,t)=>({display:"flex",width:e?.width||"100%",height:e?.height||"100%",justifyContent:"center",alignItems:"center",minHeight:"50px",background:e?.background||t?.palette.getBackground(),borderRadius:e?.borderRadius||"8px"}),Mt={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",overflow:"auto",height:"100%"},Bt=(e,t)=>({replyTextFont:t?.textFont||n.fontHelper(e.typography.caption1),replyTextColor:t?.textColor||e?.palette.getAccent(),replyBackground:t?.textBackground||"inherit",boxShadow:`0px 0px 1px ${e?.palette.getAccent600()}`,background:t?.background||"inherit",border:t?.textBorder||"none",borderRadius:t?.textBorderRadius||"8px",display:"flex",justifyContent:"flex-start"});function Lt(e,t){return{height:"24px",width:"24px",buttonIconTint:e?.backIconTint||t?.palette.getPrimary()||"",border:"none",borderRadius:"8px",background:"transparent",display:"flex",justifyContent:"flex-start"}}function Ut(e,t){return{display:"flex",justifyContent:"space-between",alignItems:"center",font:e?.titleFont||n.fontHelper(t.typography.text2),color:e?.titleColor||t?.palette.getAccent()}}const Rt={title:n.localize("SUGGEST_A_REPLY"),getSmartRepliesCallback:void 0,editReplyCallback:void 0,closeCallback:void 0,backCallback:void 0,configuration:void 0},Pt=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}}),Ot=ye({tagName:"cometchat-ai-card",elementClass:r.CometChatAICard,react:t}),jt=e=>{const{title:o,getSmartRepliesCallback:r,editReplyCallback:s,closeCallback:i,backCallback:a,configuration:l}={...Rt,...e},[c,C]=t.useState(n.States.loading),[g,u]=t.useState(null),{theme:p}=t.useContext(U),h=n.localize("SOMETHING_WRONG"),m=n.localize("NO_MESSAGES_FOUND"),A=n.localize("GENERATING_REPLIES");return t.useEffect(()=>{C(n.States.loading),e&&r&&r(p).then(async t=>{t?(C(n.States.loaded),u(await async function(t){return new Promise((n,r)=>{try{let c=l?.customView;if(!c){let r=[];Object.keys(t).forEach(e=>{t[e]&&""!==t[e]&&r.push(t[e])});let c=d.jsxs("div",{style:{display:"flex",flexDirection:"column",padding:"10px",boxSizing:"border-box"},children:[d.jsxs("div",{style:Ut(l?.smartRepliesStyle,p),children:[d.jsx("div",{children:d.jsx(J,{iconURL:tt,onClick:()=>a?a():null,buttonStyle:Lt(l?.smartRepliesStyle,p)})}),d.jsx("div",{children:o}),d.jsx("div",{style:{flex:.2}})]}),d.jsx(Pt,{smartReplyStyle:Bt(p,l?.smartRepliesStyle),replies:r,ccReplyClicked:t=>{e&&s&&s(t?.detail?.reply),e&&i&&i()},closeIconURL:""},"smart-replies")]});return n(c)}l?.customView(t,i,a).then(e=>n(e)).catch(e=>r(e))}catch(e){r(e)}})}(t))):C(n.States.empty)}).catch(e=>{C(n.States.error)})},[]),d.jsx("div",{className:"slideable-container",style:Tt(l?.smartRepliesStyle,p),children:d.jsxs("div",{style:Mt,children:[c===n.States.loaded?d.jsx("div",{style:{height:"100%"},children:g}):null,c!==n.States.loaded?function(){let e=null;switch(c){case n.States.loading:e=function(){let e=l?.loadingStateView;return d.jsx(Ot,{state:n.States.loading,style:l?.smartRepliesStyle,loadingIconURL:l?.loadingIconURL||ht,loadingStateText:A,children:e?d.jsx("div",{slot:"loadingView",children:d.jsx(e,{})}):null})}();break;case n.States.error:e=function(){let e=l?.errorStateView;return d.jsx(Ot,{state:n.States.error,style:l?.smartRepliesStyle,errorIconURL:l?.errorIconURL||pt,errorStateText:h,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();break;case n.States.empty:e=function(){let e=l?.emptyStateView;return d.jsx(Ot,{state:n.States.empty,style:l?.smartRepliesStyle,emptyIconURL:l?.emptyIconURL||ut,emptyStateText:m,children:e?d.jsx("div",{slot:"errorView",children:d.jsx(e,{})}):null})}();case n.States.loaded:}return e}():null]})})};class Vt extends Ue{constructor(e,t){super(e),this.theme=new n.CometChatTheme({}),this.isModalClosed=!0,this.childRefCallback=e=>{this.buttonRef=e},this.getSmartReplies=e=>(this.theme=e??new n.CometChatTheme({}),new Promise(async(e,t)=>{try{let t,o=this.user?this.user?.getUid():this.group?.getGuid(),r=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group;this.configuration?.apiConfiguration&&(t=await(this.configuration?.apiConfiguration(this.user,this.group)));return e(await s.CometChat.getSmartReplies(o,r,t||{}))}catch(e){t(e)}})),this.newDataSource=e,this.configuration=t,setTimeout(()=>{this.addMessageListener()},1e3)}getId(){return"aismartreplies"}editReply(e){n.CometChatUIEvents.ccComposeMessage.next(e)}closeIfMessageReceived(e){e?.getReceiverId()===this.loggedInUser?.getUid()&&this.closeCallback&&(this.isModalClosed||(this.closeCallback(),this.isModalClosed=!0))}getAIOptions(e,t,o,r,s){if(this.user=e,this.group=t,r?.parentMessageId)return super.getAIOptions(e,t,o,r,s);{let i;s&&(i={titleColor:this.configuration?.smartRepliesStyle?.buttonTextColor||s?.listItemTextColor,titleFont:this.configuration?.smartRepliesStyle?.buttonTextFont||s?.listItemTextFont,background:this.configuration?.smartRepliesStyle?.buttonBackground||s?.listItemBackground});const a=super.getAIOptions(e,t,o,r,s);let l=new n.CometChatActionsView({title:n.localize("SUGGEST_A_REPLY"),customView:e=>(this.isModalClosed=!1,this.closeCallback=e?.closePopover,d.jsx(jt,{title:n.localize("SUGGEST_A_REPLY"),configuration:this.configuration,getSmartRepliesCallback:this.getSmartReplies,editReplyCallback:this.editReply,closeCallback:e.closePopover,backCallback:e.backAction})),id:"ai-smart-replies",iconURL:"",iconTint:"",titleColor:i?.titleColor,titleFont:i?.titleFont,background:i?.background});return a.push(l),a}}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)}),n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{this.closeIfMessageReceived(e)})}}class Gt extends Le{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Vt(e,this.configuration))}getExtensionId(){return"smart-replies"}}const Ht={resizeIconHoverText:n.localize("RESIZE"),sessionID:"",minimizeIconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M21%203L13.8%2010.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.2%2019.2V13.8H4.80005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.8%204.8V10.2H19.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.2%2013.8L3%2021%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",maximizeIconURL:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M10.2%2013.8L3%2021%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%208.4V3H15.6%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M3%2015.6V21H8.4%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M21%203L13.8%2010.2%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",callSettingsBuilder:void 0,ongoingCallStyle:{maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"grey",minHeight:"400px",minWidth:"400px",minimizeIconTint:"white",maximizeIconTint:"white"},onError:e=>{console.log(e)},callWorkflow:n.CallWorkflow.defaultCalling},Qt=e=>{const[o,i]=t.useState(null),a=t.useRef(null),{resizeIconHoverText:l,sessionID:c,minimizeIconURL:C,maximizeIconURL:g,ongoingCallStyle:u,callSettingsBuilder:p,onError:h,callWorkflow:m}={...Ht,...e},A=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)h?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);h?.(n)}},[h]),x=t.useCallback(()=>{if(p)return p;{let e=!1;return(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e).setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{m===n.CallWorkflow.defaultCalling&&(r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null))},onCallEndButtonPressed:()=>{m===n.CallWorkflow.defaultCalling?s.CometChat.endCall(c).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e)}).catch(e=>{A(e)}):(n.CometChatCallEvents.ccCallEnded.next(null),r.CometChatUIKitCalls.endSession())},onError:e=>{A(e)}})).build()}},[p,m,A,c]),b=t.useCallback(()=>{if(o){const e=o.getAuthToken();r.CometChatUIKitCalls.generateToken(c,e).then(e=>{r.CometChatUIKitCalls.startSession(e?.token,x(),a.current)},e=>{A(e)})}else s.CometChat.getLoggedinUser().then(e=>{const t=e.getAuthToken();r.CometChatUIKitCalls.generateToken(c,t).then(e=>{r.CometChatUIKitCalls.startSession(e?.token,x(),a.current)},e=>{A(e)})})},[c,x,o,A]);return function(e,n,o){t.useEffect(()=>{Zn.getLoggedinUser().then(t=>{t&&e(t)})},[e]),t.useEffect(()=>{""!==n&&o()},[n,o])}(i,c,b),""!==c?d.jsx("cometchat-callscreen-wrapper",{callscreenStyle:JSON.stringify(u),resizeIconHoverText:l,minimizeIconURL:C,maximizeIconURL:g,sessionID:c,children:d.jsx("div",{id:"cc-callscreen_ref",style:{width:"100%",height:"100%",inset:"0"},className:"cc-callscreen__view",ref:a})}):d.jsx(d.Fragment,{})},Nt=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius,display:"flex",justifyContent:"center"}),Kt={width:"360px",height:"581px",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px"},zt={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},Jt=e=>new r.CallButtonsStyle({width:"100%",height:"100%",background:"transparent",border:"none",borderRadius:"0",voiceCallIconTint:e.palette.getPrimary(),videoCallIconTint:e.palette.getPrimary(),voiceCallIconTextFont:n.fontHelper(e.typography.caption1),videoCallIconTextFont:n.fontHelper(e.typography.caption1),voiceCallIconTextColor:e.palette.getPrimary(),videoCallIconTextColor:e.palette.getPrimary(),buttonPadding:"8px 32px",buttonBackground:e.palette.getAccent100(),buttonBorder:"0",buttonBorderRadius:"8px"}),Yt=e=>new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:e.palette.getAccent900(),maximizeIconTint:e.palette.getAccent900()});var _t="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Wt=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius}),Zt=e=>({textFont:e?.subtitleTextFont,textColor:e?.subtitleTextColor}),Xt={height:"fit-content",width:"fit-content",buttonTextFont:"400 12px Inter",buttonTextColor:"RGBA(20, 20, 20, 0.58)",borderRadius:"8px",border:"none",buttonIconTint:"white",background:"",iconBackground:"red"},qt={height:"100%",width:"100%",border:"inherite",borderRadius:"inherite",background:"transparent",titleFont:"700 22px Inter",titleColor:"black"},$t=e=>new o.AvatarStyle({borderRadius:"50%",width:"180px",height:"180px",border:`1px solid ${e.palette.getAccent100()}`,backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),en=e=>new r.OutgoingCallStyle({width:"100%",height:"100%",background:e.palette.getBackground(),border:"none",borderRadius:"0",titleTextFont:n.fontHelper(e.typography.title1),titleTextColor:e.palette.getAccent(),subtitleTextFont:n.fontHelper(e.typography.subtitle1),subtitleTextColor:e.palette.getAccent600(),declineButtonTextFont:n.fontHelper(e.typography.caption1),declineButtonTextColor:e.palette.getAccent600(),declineButtonIconTint:e.palette.getAccent("dark"),declineButtonIconBackground:e.palette.getError()});var tn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const nn=e=>{const{call:i,disableSoundForCalls:a=!1,customSoundForCalls:l="",declineButtonText:c=n.localize("CANCEL"),declineButtonIconURL:C=tn,customView:g=null,onError:u=e=>{console.log(e)},avatarStyle:p=new o.AvatarStyle({borderRadius:"50%",width:"180px",height:"180px"}),outgoingCallStyle:h=new r.OutgoingCallStyle({width:"100%",height:"100%",titleTextFont:"700 22px Inter",titleTextColor:"RGB(20, 20, 20)",subtitleTextFont:"400 15px Inter",subtitleTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonTextFont:"400 12px Inter",declineButtonTextColor:"RGBA(20, 20, 20, 0.58)",declineButtonIconTint:"white",declineButtonIconBackground:"red"}),onCloseClicked:m=()=>{}}=e,{theme:A}=t.useContext(U),x=n.IconButtonAlignment.top,b=t.useRef(p),y=t.useRef(h),w=t.useRef(Xt),f=t.useRef(null),D=t.useRef(null);f.current=i,b.current={...$t(A),...b?.current},y.current={...en(A),...y?.current},w.current=(e=>({height:"fit-content",width:"fit-content",buttonTextFont:e?.declineButtonTextFont,buttonTextColor:e?.declineButtonTextColor,borderRadius:"8px",border:"none",buttonIconTint:e?.declineButtonIconTint,background:"",iconBackground:e?.declineButtonIconBackground}))(y?.current),qt.titleColor=y?.current?.titleTextColor,qt.titleFont=y?.current?.titleTextFont;let E=n.localize("CALLING");const v=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)u(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);u(n)}},[u]),I=t.useCallback(()=>{try{r.CometChatSoundManager.pause(),m&&m()}catch(e){v(e)}},[m,v]),S=t.useCallback(()=>{try{a||(l?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall,l):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall))}catch(e){v(e)}},[a,l,v]);return function(e,n,o,s){t.useEffect(()=>()=>{r.CometChatSoundManager.pause()},[]),t.useEffect(()=>(r.CometChatSoundManager.audio?(r.CometChatSoundManager.pause(),e()):e(),()=>{r.CometChatSoundManager.pause()}),[n,e]),t.useEffect(()=>{const e=s.current;if(e)return e.addEventListener("cc-button-clicked",o),()=>{e.removeEventListener("cc-button-clicked",o)}},[o,s])}(S,i,I,D),d.jsx(d.Fragment,{children:d.jsx("div",{className:"cc-outgoingcall__wrapper",style:Wt(y?.current),children:g?d.jsx("div",{className:"cc-outgoingcall__custom-view",children:g}):f.current?d.jsxs("cometchat-card",{title:f.current?.getReceiver()?.getName(),cardStyle:JSON.stringify(qt),avatarName:f.current?.getReceiver()?.getName(),avatarURL:f.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?f.current?.getReceiver()?.getAvatar():f.current?.getReceiver()?.getIcon(),avatarStyle:JSON.stringify(b?.current),children:[d.jsx("cometchat-label",{slot:"subtitleView",labelStyle:JSON.stringify(Zt(y?.current)),text:E,children:" "}),d.jsx("div",{slot:"bottomView",children:d.jsx("cometchat-icon-button",{ref:D,text:c,iconURL:C,alignment:x,buttonStyle:JSON.stringify(w?.current)})})]}):null})})};var on="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const rn={voiceCallIconURL:_t,voiceCallIconText:n.localize("VOICE_CALL"),voiceCallIconHoverText:n.localize("VOICE_CALL"),videoCallIconURL:on,videoCallIconText:n.localize("VIDEO_CALL"),videoCallIconHoverText:n.localize("VIDEO_CALL"),callButtonsStyle:{width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent"},onVoiceCallClick:void 0,onVideoCallClick:void 0,onError:e=>{console.log(e)},outgoingCallConfiguration:new r.OutgoingCallConfiguration({}),ongoingCallConfiguration:new r.CallScreenConfiguration({})},sn=e=>{const{user:o,group:i,voiceCallIconURL:a,voiceCallIconText:l,voiceCallIconHoverText:c,videoCallIconURL:C,videoCallIconText:g,videoCallIconHoverText:u,callButtonsStyle:p,onVoiceCallClick:h,onVideoCallClick:A,onError:x,outgoingCallConfiguration:b,ongoingCallConfiguration:y}={...rn,...e},{theme:w}=t.useContext(U),[f,D]=t.useState(null),E=t.useRef(null);E.current={...Jt(w),...p};const v=t.useRef(null);var I;v.current=(I=E?.current,{buttonIconTint:I?.voiceCallIconTint??"RGB(51, 153, 255)",buttonTextFont:I?.voiceCallIconTextFont??"400 12px Inter",buttonTextColor:I?.voiceCallIconTextColor??"RGB(51, 153, 255)",padding:I?.buttonPadding??"8px 32px",background:I?.buttonBackground??"transparent",border:I?.border??"none",borderRadius:I?.buttonBorderRadius??"0",...zt});const S=t.useRef(null);S.current=(e=>({buttonIconTint:e?.videoCallIconTint??"RGB(51, 153, 255)",buttonTextFont:e?.videoCallIconTextFont??"400 12px Inter",buttonTextColor:e?.videoCallIconTextColor??"RGB(51, 153, 255)",padding:e?.buttonPadding??"8px 32px",background:e?.buttonBackground??"transparent",border:e?.border??"none",borderRadius:e?.buttonBorderRadius??"0",...zt}))(E?.current);const[F,k]=t.useState(o),[T,M]=t.useState(i),[B,L]=t.useState(!1),[R,P]=t.useState(!1),[O,j]=t.useState(!1),V=t.useRef(null),G=t.useRef(null),H=t.useRef(null),Q=t.useRef(""),N=m(h),K=m(A);let z="callbuttons_"+(new Date).getTime();const J=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)x?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);x?.(n)}},[x]),Y={...y?.ongoingCallStyle,...Yt(w)},_={...b?.outgoingCallStyle,...Kt},W=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallRejected.subscribe(()=>{j(!1)}),t=n.CometChatCallEvents.ccOutgoingCall.subscribe(()=>{j(!0)}),o=n.CometChatCallEvents.ccCallEnded.subscribe(()=>{j(!1),H.current=null,Q.current="",L(!1),P(!1)});return()=>{try{o?.unsubscribe(),e?.unsubscribe(),t?.unsubscribe()}catch(e){J(e)}}}catch(e){J(e)}},[J]),Z=t.useCallback(()=>{try{s.CometChat.addCallListener(z,new s.CometChat.CallListener({onIncomingCallReceived:()=>{j(!0)},onIncomingCallCancelled:()=>{j(!1)},onOutgoingCallRejected:()=>{P(!1),j(!1),H.current=null,Q.current=""},onOutgoingCallAccepted:e=>{if(e.getSender()?.getUid()===f?.getUid()||e.getSessionId()!==H.current?.getSessionId())return P(!1),j(!1),H.current=null,void(Q.current="");Q.current=e.getSessionId(),P(!1),L(!0),j(!0),H.current=e}}))}catch(e){J(e)}},[J,z]),X=t.useCallback(()=>{try{s.CometChat.removeCallListener(z)}catch(e){J(e)}},[J,z]),q=()=>{j(!1),H.current=null,Q.current="",L(!1),P(!1)};const $=t.useCallback(e=>{try{const t=F?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,o=F?F?.getUid():T?.getGuid(),r=new s.CometChat.Call(o,e,t);s.CometChat.initiateCall(r).then(e=>{H.current=e,P(!0),n.CometChatCallEvents.ccOutgoingCall.next(e)},e=>{J(e)})}catch(e){J(e)}},[F,T,J]),ee=t.useCallback(()=>{try{F&&$(n.CometChatUIKitConstants.MessageTypes.audio)}catch(e){J(e)}},[F,$,J]),te=t.useCallback(()=>{try{const e=F?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,t=F?F?.getUid():T?.getGuid(),o=Q.current,i={sessionID:o,sessionId:o,callType:n.CometChatUIKitConstants.MessageTypes.video},a=n.CometChatUIKitConstants.calls.meeting,l=`group_${o}`,c=new s.CometChat.CustomMessage(t,e,a,i);c.setMetadata({incrementUnreadCount:!0}),c.shouldUpdateConversation(!0),c.setSender(f),c.setConversationId(l),c.sentAt=r.CometChatUIKitUtility.getUnixTimestamp(),c.muid=r.CometChatUIKitUtility.ID(),n.CometChatMessageEvents.ccMessageSent.next({message:c,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(c).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},e=>{J(e)})}catch(e){J(e)}},[F,T,f,J]),ne=t.useCallback(()=>{try{F&&$(n.CometChatUIKitConstants.MessageTypes.video),T&&(Q.current=T?.getGuid(),te(),L(!0))}catch(e){J(e)}},[F,T,te,J,$]),oe=t.useCallback(()=>{const e=H.current;if(e)try{r.CometChatSoundManager.pause(),s.CometChat.rejectCall(e.getSessionId(),n.CometChatUIKitConstants.calls.cancelled).then(e=>{j(!1),P(!1),n.CometChatCallEvents.ccCallRejected.next(e),H.current=null},e=>{J(e)}),P(!1)}catch(e){J(e)}},[J]),re=t.useCallback(()=>{if(v.current)return v.current.buttonIconTint=((e,t,n)=>e?n.palette.getAccent600():t?.voiceCallIconTint)(O,E.current??void 0,w),v.current},[O,w]),se=t.useCallback(()=>{if(S.current)return S.current.buttonIconTint=((e,t,n)=>e?n.palette.getAccent600():t?.videoCallIconTint)(O,E.current??void 0,w),S.current},[O,w]);!function(e,n,o,r,i,a,l,c,C,d,g,u,p,h,m,A,x){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)},e=>{a(e)})},[n,a]),t.useEffect(()=>{let t;return e&&(t=i(),l()),()=>{t?.(),c()}},[e,l,c,i]),t.useEffect(()=>{o&&(C(o),d(null))},[o,C,d]),t.useEffect(()=>{r&&(C(null),d(r))},[r,C,d]),t.useEffect(()=>{const e=g.current,t=u.current;if(!e&&!t)return;const n=()=>{const e=A.current;e?e():p()},o=()=>{const e=x.current;e?e():h()};return m?(e?.removeEventListener("cc-button-clicked",n),t?.removeEventListener("cc-button-clicked",o)):(e?.addEventListener("cc-button-clicked",n),t?.addEventListener("cc-button-clicked",o)),()=>{e?.removeEventListener("cc-button-clicked",n),t?.removeEventListener("cc-button-clicked",o)}},[m,p,h,A,x,g,u])}(f,D,o,i,W,J,Z,X,k,M,V,G,ee,ne,O,N,K);const ie=O?{disabled:!0}:{};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"cc-call-buttons__wrapper",style:Nt(E.current),children:d.jsxs("div",{className:"cc-call-buttons",style:{display:"flex",gap:"16px"},children:[F?d.jsx("cometchat-button",{...ie,buttonStyle:JSON.stringify(re()),text:l,hoverText:c,iconURL:a||_t,ref:V}):null,F||T?d.jsx("cometchat-button",{...ie,buttonStyle:JSON.stringify(se()),text:g,hoverText:u,iconURL:C||on,ref:G}):null]})}),B&&null!=Q.current?d.jsx(Qt,{ongoingCallStyle:Y,sessionID:Q.current,callSettingsBuilder:function(){let e=H.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio;const t=y?.callSettingsBuilder?y.callSettingsBuilder(e,o,i):(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e),a=Q.current;return t.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{H.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&(r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null),q())},onCallEndButtonPressed:()=>{H.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?s.CometChat.endCall(a).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e),q()}).catch(e=>{J(e)}):q()},onError:e=>{J(e)}})),t.build()}(),maximizeIconURL:y?.maximizeIconURL,minimizeIconURL:y?.minimizeIconURL}):null,R&&H.current?d.jsx("cometchat-backdrop",{children:d.jsx(nn,{onCloseClicked:b?.onCloseClicked??oe,customSoundForCalls:b?.customSoundForCalls,customView:b?.customView,disableSoundForCalls:b?.disableSoundForCalls,onError:b?.onError,outgoingCallStyle:_,call:H.current})}):null]})};const an=Object.freeze({meeting:"meeting",ongoing:"ongoing",ended:"ended",initiated:"initiated",cancelled:"cancelled",rejected:"rejected",unanswered:"unanswered"}),ln=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t});class cn extends Ue{constructor(e,t){super(e),this.loggedInUser=null,this.configuration=new r.CallingConfiguration({}),this.addLoginListener(),this.getLoggedInUser(),this.configuration=t}addLoginListener(){s.CometChat.addLoginListener("login_listener",new s.CometChat.LoginListener({logoutSuccess:()=>{try{let e=s.CometChat.getActiveCall();e&&s.CometChat.endCall(e.getSessionId())}catch(e){console.log("error in endCall on logout",e)}}}))}async getLoggedInUser(){this.loggedInUser=await s.CometChat.getLoggedinUser()}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(an.meeting)||e.push(an.meeting),e.includes(n.CometChatUIKitConstants.MessageTypes.audio)||e.push(n.CometChatUIKitConstants.MessageTypes.audio),e.includes(n.CometChatUIKitConstants.MessageTypes.video)||e.push(n.CometChatUIKitConstants.MessageTypes.video),e}getId(){return"calling"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.call)||e.push(n.CometChatUIKitConstants.MessageCategory.call),e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateTypeExist(e,t){return e.some(e=>e.type===t)}checkIfTemplateCategoryExist(e,t){return e.some(e=>e.category===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(e,t);return this.checkIfTemplateTypeExist(o,an.meeting)||o.push(this.getDirectCallTemplate(this.theme)),this.checkIfTemplateCategoryExist(o,n.CometChatUIKitConstants.MessageCategory.call)||o.push(...this.getDefaultCallTemplate(this.theme)),o}getDirectCallTemplate(e){return new n.CometChatMessageTemplate({type:an.meeting,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>t.getDeletedAt()?super.getDeleteMessageBubble(t,this.theme):this.getDirectCallMessageBubble(t,n,e),options:(e,t,n,o)=>Be.getDataSource().getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getDefaultCallTemplate(e){return[new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.audio,category:n.CometChatUIKitConstants.MessageCategory.call,contentView:(t,n)=>this.getDefaultAudioCallMessageBubble(t,n,e),bottomView:(e,t)=>super.getBottomView(e,t)}),new n.CometChatMessageTemplate({type:n.CometChatUIKitConstants.MessageTypes.video,category:n.CometChatUIKitConstants.MessageCategory.call,contentView:(t,n)=>this.getDefaultVideoCallMessageBubble(t,n,e),bottomView:(e,t)=>super.getBottomView(e,t)})]}getCallBubbleStyle(e,t){return e===n.MessageBubbleAlignment.left?{titleFont:n.fontHelper(t.typography.text2),titleColor:t.palette.getAccent(),iconTint:t.palette.getPrimary(),buttonTextFont:n.fontHelper(t.typography.text2),buttonTextColor:t.palette.getAccent("dark"),buttonBackground:t.palette.getPrimary(),width:"240px",borderRadius:"12px"}:{titleFont:n.fontHelper(t.typography.text2),titleColor:t.palette.getAccent("dark"),iconTint:t.palette.getAccent("dark"),buttonTextFont:n.fontHelper(t.typography.text2),buttonTextColor:t.palette.getPrimary(),buttonBackground:t.palette.getAccent("dark"),width:"240px",background:t.palette.getPrimary(),borderRadius:"12px"}}getSessionId(e){let t=e.getData();return t?.customData?.sessionID}getCallBubbleTitle(e){return e.getSender()&&e.getSender().getUid()!==this.loggedInUser?.getUid()?`${e.getSender().getName()} ${n.localize("INITIATED_GROUP_CALL")}`:n.localize("YOU_INITIATED_GROUP_CALL")}getDirectCallMessageBubble(e,r,s){let i=n.DocumentIconAlignment.left,a=this.getCallBubbleStyle(r,s),l=this.getSessionId(e),c=this.getCallBubbleTitle(e),C=n.localize("JOIN");const g=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});return d.jsx(g,{hideSeparator:!0,iconAlignment:i,documentStyle:a,URL:l,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",title:c,buttonText:C,ccClicked:()=>{this.startDirectCall(l,e,this.theme||s)}})}startDirectCall(e,t,s){let i;const a=t.getCustomData()?.callType===n.CometChatUIKitConstants.MessageTypes.audio;i=this.configuration?.groupCallSettingsBuilder?this.configuration.groupCallSettingsBuilder(t):(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(a),i.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEndButtonPressed:()=>{n.CometChatUIEvents.ccShowOngoingCall.next({child:null})}}));const l=i.build(),c=new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:s.palette.getAccent900(),maximizeIconTint:s.palette.getAccent900()}),C=d.jsx(Qt,{ongoingCallStyle:c,sessionID:e,callWorkflow:n.CallWorkflow.directCalling,callSettingsBuilder:l});n.CometChatUIEvents.ccShowOngoingCall.next({child:C})}callStatusStyle(e,t){return this.loggedInUser?{buttonTextFont:n.fontHelper(t.typography.subtitle2),buttonTextColor:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?t.palette.getError():t.palette.getAccent600(),borderRadius:"10px",border:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?"1px solid RGBA(255, 59, 48, 0.2)":`1px solid ${t.palette.getAccent100()}`,buttonIconTint:r.CallingDetailsUtils.isMissedCall(e,this.loggedInUser)?t.palette.getError():t.palette.getAccent600(),background:"transparent",iconBackground:"transparent",padding:"2px 12px 2px 0",gap:"0",height:"25px",justifyContent:"center"}:{}}getCallActionMessage(e){return r.CallingDetailsUtils.getCallStatus(e,this.loggedInUser)}getDefaultAudioCallMessageBubble(e,t,n){const o=this.callStatusStyle(e,n),r=this.getCallActionMessage(e);return d.jsx(ln,{disabled:!0,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:o,text:r})}getDefaultVideoCallMessageBubble(e,t,n){const o=this.callStatusStyle(e,n),r=this.getCallActionMessage(e);return d.jsx(ln,{disabled:!0,iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:o,text:r})}getLastConversationMessage(e,t,o){let i="";if(e.getLastMessage()&&e.getLastMessage().category==n.CometChatUIKitConstants.MessageCategory.call){let n=e.getLastMessage();i=r.CallingDetailsUtils.getCallStatus(n,t)}else if(e?.getLastMessage()&&e.getLastMessage().type==n.CometChatUIKitConstants.calls.meeting){let r=e.getLastMessage();i=r.getSender()&&r?.getSender()?.getUid()!=t.getUid()?`${r.getSender().getName()} ${n.localize("INITIATED_GROUP_CALL")}`:n.localize("YOU_INITIATED_GROUP_CALL");let a=e.getLastMessage();a&&a.getMentionedUsers().length&&a instanceof s.CometChat.TextMessage&&o&&!o.disableMentions&&(i=this.getMentionsFormattedText(a,i,o))}else i=super.getLastConversationMessage(e,t,o);return i}getAuxiliaryHeaderMenu(e,t){let n=[];const o={width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent",buttonPadding:"0",buttonBackground:"transparent",buttonBorder:"0 4px",buttonBorderRadius:"8px",...this.configuration?.callButtonsConfiguration?.callButtonsStyle};let r=d.jsx(sn,{user:e,group:t,callButtonsStyle:o,voiceCallIconText:"",videoCallIconText:"",videoCallIconURL:this.configuration?.callButtonsConfiguration?.videoCallIconURL,voiceCallIconURL:this.configuration?.callButtonsConfiguration?.voiceCallIconURL,onError:this.configuration?.callButtonsConfiguration?.onError,outgoingCallConfiguration:this.configuration?.callButtonsConfiguration?.outgoingCallConfiguration,ongoingCallConfiguration:this.configuration?.callButtonsConfiguration?.ongoingCallConfiguration},"callbuttons");return n.push(r),n}}class Cn extends r.CallingExtensionDataSource{constructor(e){super(),this.configuration=e}enable(){Be.enable(e=>new cn(e,this.configuration))}addExtension(){Be.enable((e,t)=>new cn(e,t))}getExtensionId(){return"calling"}}class dn{enable(){s.CometChat.isExtensionEnabled(this.getExtensionId()).then(e=>{e&&this.addExtension()},e=>{})}}var gn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FCollaborative%20Document%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FCollaborative-Document%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.019664%2C11.0497498%20C20.2968766%2C11.0497498%2019.6037718%2C11.3372517%2019.0931699%2C11.8488579%20L11.9722287%2C18.9696649%20C11.8675218%2C19.07437%2011.7961523%2C19.207727%2011.7671152%2C19.3529288%20L11.0671938%2C22.8529288%20C10.9622469%2C23.3777219%2011.4249469%2C23.8404018%2011.9497354%2C23.7354323%20L15.4493424%2C23.0354323%20C15.5945931%2C23.0063789%2015.7279879%2C22.9349647%2015.8327036%2C22.830196%20L22.9504376%2C15.7088627%20C24.0147495%2C14.6469387%2024.0170552%2C12.9221237%2022.9548584%2C11.8566265%20L22.9136114%2C11.8181375%20C22.4355563%2C11.3372517%2021.7424514%2C11.0497498%2021.019664%2C11.0497498%20Z%20M21.019664%2C12.5497498%20C21.2977603%2C12.5497498%2021.5660731%2C12.6445675%2021.7814054%2C12.816289%20L21.9254022%2C12.9466625%20L22.00838%2C13.0404351%20C22.3677898%2C13.4966868%2022.3370963%2C14.2018865%2021.890239%2C14.6477416%20L14.931%2C21.609%20L12.758%2C22.043%20L13.193%2C19.869%20L20.1543459%2C12.9090017%20C20.3840891%2C12.6788071%2020.6952184%2C12.5497498%2021.019664%2C12.5497498%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.3982707%2C1.25%20C18.5339913%2C1.25%2019.463993%2C2.13072139%2019.5427157%2C3.24645803%20L19.5481135%2C3.4%20L19.5481135%2C9.7%20C19.5481135%2C10.1142136%2019.2123271%2C10.45%2018.7981135%2C10.45%20C18.4184177%2C10.45%2018.1046226%2C10.1678461%2018.0549601%2C9.80177056%20L18.0481135%2C9.7%20L18.0481135%2C3.4%20C18.0481135%2C3.07363278%2017.8076479%2C2.80347042%2017.4942955%2C2.75704724%20L17.3982707%2C2.75%20L3.39984279%2C2.75%20C3.07358878%2C2.75%202.80346372%2C2.99049261%202.75704639%2C3.30394351%20L2.75%2C3.4%20L2.75%2C18.8%20C2.75%2C19.1263672%202.99046561%2C19.3965296%203.30381804%2C19.4429528%20L3.39984279%2C19.45%20L8.99921396%2C19.45%20C9.41342753%2C19.45%209.74921396%2C19.7857864%209.74921396%2C20.2%20C9.74921396%2C20.5796958%209.46706008%2C20.893491%209.10098452%2C20.9431534%20L8.99921396%2C20.95%20L3.39984279%2C20.95%20C2.26412221%2C20.95%201.33412057%2C20.0692786%201.25539778%2C18.953542%20L1.25%2C18.8%20L1.25%2C3.4%20C1.25%2C2.26423244%202.13062249%2C1.33412985%203.24630755%2C1.25539838%20L3.39984279%2C1.25%20L17.3982707%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.5985851%2C5.45%20C15.0127987%2C5.45%2015.3485851%2C5.78578644%2015.3485851%2C6.2%20C15.3485851%2C6.57969577%2015.0664313%2C6.89349096%2014.7003557%2C6.94315338%20L14.5985851%2C6.95%20L8.99921396%2C6.95%20C8.5850004%2C6.95%208.24921396%2C6.61421356%208.24921396%2C6.2%20C8.24921396%2C5.82030423%208.53136785%2C5.50650904%208.89744341%2C5.45684662%20L8.99921396%2C5.45%20L14.5985851%2C5.45%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M14.5985851%2C9.65%20C15.0127987%2C9.65%2015.3485851%2C9.98578644%2015.3485851%2C10.4%20C15.3485851%2C10.7796958%2015.0664313%2C11.093491%2014.7003557%2C11.1431534%20L14.5985851%2C11.15%20L6.19952838%2C11.15%20C5.78531482%2C11.15%205.44952838%2C10.8142136%205.44952838%2C10.4%20C5.44952838%2C10.0203042%205.73168226%2C9.70650904%206.09775782%2C9.65684662%20L6.19952838%2C9.65%20L14.5985851%2C9.65%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.1987423%2C13.85%20C13.6129559%2C13.85%2013.9487423%2C14.1857864%2013.9487423%2C14.6%20C13.9487423%2C14.9796958%2013.6665885%2C15.293491%2013.3005129%2C15.3431534%20L13.1987423%2C15.35%20L6.19952838%2C15.35%20C5.78531482%2C15.35%205.44952838%2C15.0142136%205.44952838%2C14.6%20C5.44952838%2C14.2203042%205.73168226%2C13.906509%206.09775782%2C13.8568466%20L6.19952838%2C13.85%20L13.1987423%2C13.85%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const un=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});class pn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(r.CollaborativeDocumentConstants.extension_document)||e.push(r.CollaborativeDocumentConstants.extension_document),e}getId(){return"collaborativedocument"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.CollaborativeDocumentConstants.extension_document)||o.push(this.getDocumentTemplate(this.theme)),o}getDocumentTemplate(e){return new n.CometChatMessageTemplate({type:r.CollaborativeDocumentConstants.extension_document,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getDocumentContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getDocumentContentView(e,t){let o=n.DocumentIconAlignment.right,r=this.configuration?.getDocumentBubbleStyle(),s={titleFont:r?.titleFont||n.fontHelper(this.theme.typography.text2),titleColor:r?.titleColor||this.theme.palette.getAccent(),subtitleFont:r?.subtitleFont||n.fontHelper(this.theme.typography.subtitle2),subtitleColor:r?.subtitleColor||this.theme.palette.getAccent600(),iconTint:r?.iconTint||this.theme.palette.getAccent700(),buttonTextFont:r?.buttonTextFont||n.fontHelper(this.theme.typography.text2),buttonTextColor:r?.buttonTextColor||this.theme.palette.getPrimary(),buttonBackground:r?.buttonBackground||"transparent",separatorColor:r?.separatorColor||this.theme.palette.getAccent200()};const i=this.getDocumentURL(e),a=n.localize("COLLABORATIVE_DOCUMENT"),l=n.localize("OPEN_DOCUMENT"),c=n.localize("DRAW_DOCUMENT_TOGETHER");return d.jsx(un,{iconURL:this.configuration?.getIconURL()?this.configuration?.getIconURL():gn,title:a,URL:i,subtitle:c,buttonText:l,documentStyle:s,hideSeparator:!1,iconAlignment:o,ccClicked:this.launchCollaborativeDocument})}launchCollaborativeDocument(e){window.open(e,"","fullscreen=yes, scrollbars=auto")}getDocumentURL(e){try{if(e?.getData()){const t=e.getData();if(t?.metadata){const e=t?.metadata;if(r.CometChatUIKitUtility.checkHasOwnProperty(e,"@injected")){const t=e["@injected"];if(t?.extensions){const e=t.extensions;return e[r.CollaborativeDocumentConstants.document]?e[r.CollaborativeDocumentConstants.document].document_url:e[r.CollaborativeDocumentConstants.document].board_url}}}}}catch(e){console.log("error in fetching document url",e)}}getAttachmentOptions(e,t){if(t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle(),i=!!t?.user,a=i?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,l=i?t.user:t.group;const c=super.getAttachmentOptions(e,t);let C=new n.CometChatMessageComposerAction({id:r.CollaborativeDocumentConstants.document,title:n.localize("COLLABORATIVE_DOCUMENT"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():gn,iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(r.CollaborativeDocumentConstants.document,r.CollaborativeDocumentConstants.post,r.CollaborativeDocumentConstants.v1_create,{receiver:l,receiverType:a}).then(e=>{},e=>{})}});return c.push(C),c}}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.CollaborativeDocumentConstants.extension_document&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_DOCUMENT"):super.getLastConversationMessage(e,t,o)}}class hn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new pn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.document}}var mn="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FCollaborative%20Whiteboard%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FCollaborative-Whiteboard%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C1.25%20C4.2473527%2C1.25%202.65%2C2.77128829%202.65%2C4.66666667%20C2.65%2C6.56204505%204.2473527%2C8.08333333%206.2%2C8.08333333%20C8.1526473%2C8.08333333%209.75%2C6.56204505%209.75%2C4.66666667%20C9.75%2C2.77128829%208.1526473%2C1.25%206.2%2C1.25%20Z%20M6.2%2C2.75%20C7.3401473%2C2.75%208.25%2C3.61652638%208.25%2C4.66666667%20C8.25%2C5.71680695%207.3401473%2C6.58333333%206.2%2C6.58333333%20C5.0598527%2C6.58333333%204.15%2C5.71680695%204.15%2C4.66666667%20C4.15%2C3.61652638%205.0598527%2C2.75%206.2%2C2.75%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C7.91666667%20C6.57969577%2C7.91666667%206.89349096%2C8.19882055%206.94315338%2C8.56489611%20L6.95%2C8.66666667%20L6.95%2C14%20C6.95%2C14.4142136%206.61421356%2C14.75%206.2%2C14.75%20C5.82030423%2C14.75%205.50650904%2C14.4678461%205.45684662%2C14.1017706%20L5.45%2C14%20L5.45%2C8.66666667%20C5.45%2C8.2524531%205.78578644%2C7.91666667%206.2%2C7.91666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.2%2C7.91666673%20C3.47415406%2C7.91666673%201.25%2C10.0349087%201.25%2C12.6666667%20L1.25%2C15.3333333%20L1.25684662%2C15.4351039%20C1.30650904%2C15.8011795%201.62030423%2C16.0833333%202%2C16.0833333%20L2.725%2C16.083%20L3.3541005%2C22.0783194%20C3.39418895%2C22.4601142%203.71610639%2C22.75%204.1%2C22.75%20L8.3%2C22.75%20L8.40299648%2C22.7429615%20C8.74009489%2C22.6965339%209.00945546%2C22.4254056%209.0458995%2C22.0783194%20L9.674%2C16.083%20L10.4%2C16.0833333%20C10.8142136%2C16.0833333%2011.15%2C15.7475469%2011.15%2C15.3333333%20L11.15%2C12.6666667%20C11.15%2C10.0349087%208.92584594%2C7.91666673%206.2%2C7.91666673%20Z%20M6.39003599%2C9.42150275%20C8.21408216%2C9.514591%209.65%2C10.9396974%209.65%2C12.6666667%20L9.649%2C14.583%20L9%2C14.5833333%20L8.89700352%2C14.5903718%20C8.55990511%2C14.6367994%208.29054454%2C14.9079278%208.2541005%2C15.2550139%20L7.624%2C21.25%20L4.775%2C21.25%20L4.1458995%2C15.2550139%20L4.12814397%2C15.1533155%20C4.04676841%2C14.8229084%203.74899419%2C14.5833333%203.4%2C14.5833333%20L2.75%2C14.583%20L2.75%2C12.6666667%20C2.75%2C10.8801468%204.28665405%2C9.41666673%206.2%2C9.41666673%20L6.39003599%2C9.42150275%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.6%2C1.25%20C22.7281683%2C1.25%2023.6652093%2C2.09570502%2023.7445585%2C3.18354707%20L23.75%2C3.33333333%20L23.75%2C14.6666667%20C23.75%2C15.7752741%2022.8620097%2C16.6691795%2021.7525939%2C16.7448147%20L21.6%2C16.75%20L13.2%2C16.75%20C12.7857864%2C16.75%2012.45%2C16.4142136%2012.45%2C16%20C12.45%2C15.6203042%2012.7321539%2C15.306509%2013.0982294%2C15.2568466%20L13.2%2C15.25%20L21.6%2C15.25%20C21.9335897%2C15.25%2022.1978428%2C15.0272126%2022.2431318%2C14.7509728%20L22.25%2C14.6666667%20L22.25%2C3.33333333%20C22.25%2C3.04809641%2022.0160733%2C2.79937841%2021.6978472%2C2.75651429%20L21.6%2C2.75%20L11.8%2C2.75%20C11.3857864%2C2.75%2011.05%2C2.41421356%2011.05%2C2%20C11.05%2C1.62030423%2011.3321539%2C1.30650904%2011.6982294%2C1.25684662%20L11.8%2C1.25%20L21.6%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const An=ye({tagName:"cometchat-document-bubble",elementClass:o.CometChatDocumentBubble,react:t});class xn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getAllMessageTypes(){let e=super.getAllMessageTypes();return e.some(e=>e===r.CollaborativeWhiteboardConstants.extension_whiteboard)||e.push(r.CollaborativeWhiteboardConstants.extension_whiteboard),e}getId(){return"collaborativewhiteboard"}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.CollaborativeWhiteboardConstants.extension_whiteboard)||o.push(this.getWhiteBoardTemplate(this.theme)),o}getWhiteBoardTemplate(e){return new n.CometChatMessageTemplate({type:r.CollaborativeWhiteboardConstants.extension_whiteboard,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getWhiteboardContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>super.getBottomView(e,t)})}getWhiteboardContentView(e,t){let o=n.DocumentIconAlignment.right,r=this.configuration?.getWhiteboardBubbleStyle(),s={titleFont:r?.titleFont||n.fontHelper(this.theme.typography.text2),titleColor:r?.titleColor||this.theme.palette.getAccent(),subtitleFont:r?.subtitleFont||n.fontHelper(this.theme.typography.subtitle2),subtitleColor:r?.subtitleColor||this.theme.palette.getAccent600(),iconTint:r?.iconTint||this.theme.palette.getAccent700(),buttonTextFont:r?.buttonTextFont||n.fontHelper(this.theme.typography.text2),buttonTextColor:r?.buttonTextColor||this.theme.palette.getPrimary(),buttonBackground:r?.buttonBackground||"transparent",separatorColor:r?.separatorColor||this.theme.palette.getAccent200()};const i=this.getWhiteboardDocument(e),a=n.localize("COLLABORATIVE_WHITEBOARD"),l=n.localize("OPEN_WHITEBOARD"),c=n.localize("DRAW_WHITEBOARD_TOGETHER");return d.jsx(An,{hideSeparator:!1,iconAlignment:o,iconURL:this.configuration?.getIconURL()?this.configuration?.getIconURL():mn,title:a,URL:i,subtitle:c,buttonText:l,documentStyle:s,ccClicked:this.launchCollaborativeWhiteboard})}launchCollaborativeWhiteboard(e){window.open(e+`&username=${r.CometChatUIKitLoginListener.getLoggedInUser()?.getName()}`,"","fullscreen=yes, scrollbars=auto")}getWhiteboardDocument(e){try{if(e?.getData()){const t=e.getData();if(t?.metadata){const e=t?.metadata;if(r.CometChatUIKitUtility.checkHasOwnProperty(e,"@injected")){const t=e["@injected"];if(t?.extensions){const e=t.extensions;return e[r.CollaborativeWhiteboardConstants.whiteboard]?e[r.CollaborativeWhiteboardConstants.whiteboard].board_url:e[r.CollaborativeWhiteboardConstants.whiteboard].document_url}}}}}catch(e){console.log("error in getting whiteboard details",e)}}getAttachmentOptions(e,t){if(t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle(),i=!!t?.user,a=i?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,l=i?t.user:t.group;const c=super.getAttachmentOptions(e,t);let C=new n.CometChatMessageComposerAction({id:r.CollaborativeWhiteboardConstants.whiteboard,title:n.localize("COLLABORATIVE_WHITEBOARD"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():mn,iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:()=>{s.CometChat.callExtension(r.CollaborativeWhiteboardConstants.whiteboard,r.CollaborativeWhiteboardConstants.post,r.CollaborativeWhiteboardConstants.v1_create,{receiver:l,receiverType:a}).then(e=>{},e=>{console.log("error in sending whiteboard",e)})}});return c.push(C),c}}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.CollaborativeWhiteboardConstants.extension_whiteboard&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_WHITEBOARD"):super.getLastConversationMessage(e,t,o)}}class bn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new xn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.whiteboard}}const yn=ye({tagName:"image-moderation",elementClass:r.ImageModeration,react:t,events:{CCShowDialog:"cc-show-dialog"}}),wn=ye({tagName:"cometchat-backdrop",elementClass:o.CometChatBackdrop,react:t}),fn=ye({tagName:"cometchat-confirm-dialog",elementClass:o.CometChatConfirmDialog,react:t,events:{ccCancelClicked:"cc-cancel-clicked",ccConfirmClicked:"cc-confirm-clicked"}}),Dn=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t,events:{ccImageClicked:"cc-image-clicked"}}),En=ye({tagName:"cometchat-full-screen-viewer",elementClass:o.CometChatFullScreenViewer,react:t,events:{ccCloseClicked:"cc-close-clicked"}});class vn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t,s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}).catch(e=>{console.error(e)})}getId(){return"imagemoderation"}getImageMessageContentView(e,t,o){if(void 0!==this.loggedInUser?.getUid()&&this.loggedInUser?.getUid()===e?.getSender()?.getUid())return super.getImageMessageContentView(e,t,o);this.theme=o;let r=e.getMetadata();const s=this.getImageModerationStyle(o);let i=e.getAttachments()[0]?.getUrl()||"";Be.names.includes("thumbnailgeneration")&&r&&"object"==typeof r&&r.hasOwnProperty("@injected")&&r["@injected"].hasOwnProperty("extensions")&&r["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&r["@injected"].extensions["thumbnail-generation"].url_medium&&(i=e.getMetadata()["@injected"].extensions["thumbnail-generation"].url_medium);const a=d.jsx(En,{URL:i,closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",fullScreenViewerStyle:{closeIconTint:"blue"},ccCloseClicked:()=>{n.CometChatUIEvents.ccHideDialog.next()}});return d.jsx(yn,{message:e,imageModerationStyle:s,CCShowDialog:e=>{this.showDialog(e)},children:d.jsx(Dn,{src:i,placeholderImage:"data:image/png;base64,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",ccImageClicked:()=>{n.CometChatUIEvents.ccShowDialog.next({child:a,confirmCallback:null})}})})}showDialog(e){const t=this.getConfirmationModal(e);n.CometChatUIEvents.ccShowDialog.next({confirmCallback:e?.detail?.onConfirm,child:t})}getConfirmationModal(e){let t=this.configuration?.getBackDropStyle(),o=this.configuration?.getConfirmDialogSyle(),r={height:t?.height||"100%",width:t?.width||"100%",background:t?.background||"rgba(0, 0, 0, 0.5)",border:t?.border,borderRadius:t?.borderRadius},s=n.localize("SHOW_UNSAFE_CONTENT"),i=n.localize("YES"),a=n.localize("NO"),l={confirmButtonBackground:o?.confirmButtonBackground||this.theme.palette.getError(),cancelButtonBackground:o?.cancelButtonBackground||this.theme.palette.getSecondary(),confirmButtonTextColor:o?.confirmButtonTextColor||this.theme.palette.getAccent900("light"),confirmButtonTextFont:o?.confirmButtonTextFont||n.fontHelper(this.theme.typography.text2),cancelButtonTextColor:o?.cancelButtonTextColor||this.theme.palette.getAccent900("dark"),cancelButtonTextFont:o?.cancelButtonTextFont||n.fontHelper(this.theme.typography.text2),titleFont:o?.titleFont||n.fontHelper(this.theme.typography.title1),titleColor:o?.titleColor||this.theme.palette.getAccent(),messageTextFont:o?.messageTextFont||n.fontHelper(this.theme.typography.subtitle2),messageTextColor:o?.messageTextColor||this.theme.palette.getAccent600(),background:o?.background||this.theme.palette.getBackground(),height:o?.height||"100%",width:o?.width||"100%",border:o?.border||`1px solid ${this.theme.palette.getAccent100()}`,borderRadius:o?.borderRadius||"8px"};return d.jsx(wn,{backdropStyle:r,children:d.jsx(fn,{title:"",messageText:s,cancelButtonText:a,confirmButtonText:i,confirmDialogStyle:l,ccCancelClicked:this.onCancelClicked,ccConfirmClicked:()=>{this.onConfirmClicked(e)}})})}onConfirmClicked(e){e?.detail?.onConfirm&&e?.detail?.onConfirm(),n.CometChatUIEvents.ccHideDialog.next()}onCancelClicked(){n.CometChatUIEvents.ccHideDialog.next()}getImageModerationStyle(e){let t=this.configuration?.getImageModerationStyle();return{filterColor:t?.filterColor||e.palette.getPrimary(),height:t?.height||"100%",width:t?.width||"100%",border:t?.border||"none",borderRadius:t?.borderRadius||"8px",warningTextColor:t?.warningTextColor||e.palette.getAccent("dark"),warningTextFont:t?.warningTextFont||n.fontHelper(e.typography.title2)}}}class In extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new vn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.imageModeration}}const Sn=ye({tagName:"link-preview",elementClass:r.LinkPreview,react:t,events:{ccLinkClicked:"cc-link-clicked"}}),Fn=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t});class kn extends Ue{constructor(e,t){super(e),this.newDataSource=e,this.configuration=t}getId(){return"linkpreview"}getTextMessageContentView(e,t,o,s){const i=this.getLinkPreview(e);if(i&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember){let n,a={...s,textFormatters:s?.textFormatters&&s?.textFormatters.length?[...s.textFormatters]:this.getAllTextFormatters({theme:o,alignment:t,disableMentions:s.disableMentions})},l=a.textFormatters;if(a&&!a.disableMentions){let s;for(let t=0;t<l.length&&!(l[t]instanceof r.CometChatMentionsFormatter&&(s=l[t],s.setMessage(e),e.getMentionedUsers().length&&s.setCometChatUserGroupMembers(e.getMentionedUsers()),s.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),n))&&!(l[t]instanceof r.CometChatUrlsFormatter&&(n=l[t],s));t++);s||(s=Be.getDataSource().getMentionsTextFormatter({message:e,...a,alignment:t,theme:o}),l.push(s))}else for(let e=0;e<l.length;e++)if(l[e]instanceof r.CometChatUrlsFormatter){n=l[e];break}n||(n=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:t}),l.push(n));for(let n=0;n<l.length;n++)l[n].setMessageBubbleAlignment(t),l[n].setMessage(e);return d.jsx(Sn,{style:this.getLinkPreviewWrapperStyle(),title:this.getLinkPreviewDetails(i,"title"),description:this.getLinkPreviewDetails(i,"description"),URL:this.getLinkPreviewDetails(i,"url"),image:this.getLinkPreviewDetails(i,"image"),favIconURL:this.getLinkPreviewDetails(i,"favicon"),linkPreviewStyle:this.getLinkPreviewStyle(o),ccLinkClicked:this.openLink,children:d.jsx(Fn,{textStyle:this.getTextMessageStyle(t,o),text:e.getText(),textFormatters:l})})}return super.getTextMessageContentView(e,t,o,s)}getLinkPreviewWrapperStyle(){return{height:"inherit",width:"inherit"}}openLink(e){window.open(e?.detail?.url,"_blank")}getLinkPreviewStyle(e){let t=this.configuration?.getLinkPreviewStyle();return new r.LinkPreviewStyle({titleColor:t?.titleColor||e.palette.getAccent(),titleFont:t?.titleFont||n.fontHelper(e.typography.title2),descriptionColor:t?.descriptionColor||e.palette.getAccent600(),descriptionFont:t?.descriptionFont||n.fontHelper(e.typography.subtitle2),background:t?.background||"transparent",height:t?.height||"100%",width:t?.width||"100%"})}getTextMessageStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900()||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getLinkPreview(e){try{if(!e?.getMetadata())return null;{const t=e.getMetadata()[r.LinkPreviewConstants.injected];if(t&&t?.extensions){const e=t.extensions;if(e&&r.CometChatUIKitUtility.checkHasOwnProperty(e,r.LinkPreviewConstants.link_preview)){const t=e[r.LinkPreviewConstants.link_preview];return t&&r.CometChatUIKitUtility.checkHasOwnProperty(t,r.LinkPreviewConstants.links)&&t[r.LinkPreviewConstants.links].length?t[r.LinkPreviewConstants.links][0]:null}return null}}}catch(e){console.log("error in getting link preview details",e)}}getLinkPreviewDetails(e,t){return Object.keys(e).length>0?e[t]:""}}class Tn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new kn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.linkPreview}}const Mn=ye({tagName:"message-translation-bubble",elementClass:r.MessageTranslationBubble,react:t}),Bn=ye({tagName:"cometchat-text-bubble",elementClass:o.CometChatTextBubble,react:t});class Ln extends Ue{constructor(e,t){super(e),this.getTranslationStyle=(e,t)=>{let o=this.configuration?.getMessageTranslationStyle();return e!==n.MessageBubbleAlignment.left?new r.MessageTranslationStyle({translatedTextFont:o?.translatedTextFont||n.fontHelper(t.typography.text3),translatedTextColor:o?.translatedTextColor||t.palette.getAccent("dark"),helpTextColor:o?.helpTextColor||t.palette.getAccent700("dark"),helpTextFont:o?.helpTextFont||n.fontHelper(t.typography.caption2),background:o?.background||"transparent"}):new r.MessageTranslationStyle({translatedTextFont:o?.translatedTextFont||n.fontHelper(t.typography.text3),translatedTextColor:o?.translatedTextColor||t.palette.getAccent(),helpTextColor:o?.helpTextColor||t.palette.getAccent700(),helpTextFont:o?.helpTextFont||n.fontHelper(t.typography.caption2),background:o?.background||"transparent"})},this.newDataSource=e,this.configuration=t}getTextMessageOptions(e,t,o,r){let i=this.configuration?.getOptionStyle(),a=super.getTextMessageOptions(e,t,o,r);if(!this.checkIfOptionExist(a,n.CometChatUIKitConstants.MessageOption.translateMessage)){let e=new n.CometChatActionsIcon({id:n.CometChatUIKitConstants.MessageOption.translateMessage,title:n.localize("TRANSLATE"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FMessage%20Translation%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FMessage-Translation%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M6.66666667%2C4.91666667%20C7.7672341%2C4.91666667%208.66848034%2C5.77006215%208.74476911%2C6.85121684%20L8.75%2C7%20L8.75%2C9.66666667%20C8.75%2C10.0808802%208.41421356%2C10.4166667%208%2C10.4166667%20C7.62030423%2C10.4166667%207.30650904%2C10.1345128%207.25684662%2C9.76843722%20L7.25%2C9.66666667%20L7.25%2C7%20C7.25%2C6.6778339%206.98883277%2C6.41666667%206.66666667%2C6.41666667%20C6.37671717%2C6.41666667%206.13617677%2C6.62821212%206.09096818%2C6.9053803%20L6.08333333%2C7%20L6.08333333%2C9.66666667%20C6.08333333%2C10.0808802%205.7475469%2C10.4166667%205.33333333%2C10.4166667%20C4.95363757%2C10.4166667%204.63984237%2C10.1345128%204.59017995%2C9.76843722%20L4.58333333%2C9.66666667%20L4.58333333%2C7%20C4.58333333%2C5.84940677%205.51607344%2C4.91666667%206.66666667%2C4.91666667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8%2C7.58333333%20C8.41421356%2C7.58333333%208.75%2C7.91911977%208.75%2C8.33333333%20C8.75%2C8.7130291%208.46784612%2C9.02682429%208.10177056%2C9.07648672%20L8%2C9.08333333%20L5.33333333%2C9.08333333%20C4.91911977%2C9.08333333%204.58333333%2C8.7475469%204.58333333%2C8.33333333%20C4.58333333%2C7.95363757%204.86548721%2C7.63984237%205.23156278%2C7.59017995%20L5.33333333%2C7.58333333%20L8%2C7.58333333%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16%2C10.9166667%20C16.3796958%2C10.9166667%2016.693491%2C11.1988205%2016.7431534%2C11.5648961%20L16.75%2C11.6666667%20L16.75%2C13%20C16.75%2C13.4142136%2016.4142136%2C13.75%2016%2C13.75%20C15.6203042%2C13.75%2015.306509%2C13.4678461%2015.2568466%2C13.1017706%20L15.25%2C13%20L15.25%2C11.6666667%20C15.25%2C11.2524531%2015.5857864%2C10.9166667%2016%2C10.9166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M18.6666667%2C12.25%20C19.0808802%2C12.25%2019.4166667%2C12.5857864%2019.4166667%2C13%20C19.4166667%2C13.3796958%2019.1345128%2C13.693491%2018.7684372%2C13.7431534%20L18.6666667%2C13.75%20L13.3333333%2C13.75%20C12.9191198%2C13.75%2012.5833333%2C13.4142136%2012.5833333%2C13%20C12.5833333%2C12.6203042%2012.8654872%2C12.306509%2013.2315628%2C12.2568466%20L13.3333333%2C12.25%20L18.6666667%2C12.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.6218209%2C12.7628292%20C16.7528067%2C12.3698717%2017.1775467%2C12.1575017%2017.5705042%2C12.2884875%20C17.9634616%2C12.4194734%2018.1758316%2C12.8442133%2018.0448458%2C13.2371708%20L17.9816285%2C13.4141354%20L17.8896351%2C13.6471999%20L17.768692%2C13.9296038%20C17.5442054%2C14.4346986%2017.2746722%2C14.9400735%2016.9573711%2C15.4160251%20C15.999232%2C16.8532338%2014.8035437%2C17.75%2013.3333333%2C17.75%20C12.9191198%2C17.75%2012.5833333%2C17.4142136%2012.5833333%2C17%20C12.5833333%2C16.6203042%2012.8654872%2C16.306509%2013.2315628%2C16.2568466%20L13.3333333%2C16.25%20C14.1964563%2C16.25%2015.000768%2C15.6467662%2015.7092956%2C14.5839749%20C15.9753278%2C14.1849265%2016.2057946%2C13.7528014%2016.3979747%2C13.3203962%20L16.4992538%2C13.0842816%20L16.6012322%2C12.8221175%20C16.6092157%2C12.7998646%2016.6160798%2C12.7800523%2016.6218209%2C12.7628292%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.5822706%2C14.8366574%20C15.9262877%2C14.6059518%2016.3921926%2C14.697809%2016.6228982%2C15.0418261%20C17.0961654%2C15.7475396%2017.8695647%2C16.1943066%2018.717337%2C16.2517136%20C19.1306041%2C16.279698%2019.4429375%2C16.6374031%2019.4149531%2C17.0506703%20C19.3869686%2C17.4639375%2019.0292635%2C17.7762708%2018.6159964%2C17.7482864%20C17.3049794%2C17.6595107%2016.1089745%2C16.9686186%2015.3771018%2C15.877285%20C15.1463962%2C15.5332678%2015.2382534%2C15.067363%2015.5822706%2C14.8366574%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M20.6666667%2C8.91666667%20L11.3333333%2C8.91666667%20C10.1827401%2C8.91666667%209.25%2C9.84940677%209.25%2C11%20L9.25%2C17.6666667%20L9.25523089%2C17.8154498%20C9.33151966%2C18.8966045%2010.2327659%2C19.75%2011.3333333%2C19.75%20L15.022%2C19.749%20L18.8030032%2C23.5303301%20L18.8802248%2C23.598293%20C19.3582766%2C23.9666561%2020.0833333%2C23.6330113%2020.0833333%2C23%20L20.083%2C19.749%20L20.6666667%2C19.75%20C21.8172599%2C19.75%2022.75%2C18.8172599%2022.75%2C17.6666667%20L22.75%2C11%20C22.75%2C9.84940677%2021.8172599%2C8.91666667%2020.6666667%2C8.91666667%20Z%20M11.3333333%2C10.4166667%20L20.6666667%2C10.4166667%20C20.9888328%2C10.4166667%2021.25%2C10.6778339%2021.25%2C11%20L21.25%2C17.6666667%20C21.25%2C17.9888328%2020.9888328%2C18.25%2020.6666667%2C18.25%20L19.3333333%2C18.25%20L19.2315628%2C18.2568466%20C18.8654872%2C18.306509%2018.5833333%2C18.6203042%2018.5833333%2C19%20L18.583%2C21.189%20L15.8636634%2C18.4696699%20C15.7230111%2C18.3290176%2015.5322457%2C18.25%2015.3333333%2C18.25%20L11.3333333%2C18.25%20C11.0111672%2C18.25%2010.75%2C17.9888328%2010.75%2C17.6666667%20L10.75%2C11%20C10.75%2C10.6778339%2011.0111672%2C10.4166667%2011.3333333%2C10.4166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.6666667%2C2.25%20C13.7672341%2C2.25%2014.6684803%2C3.10339548%2014.7447691%2C4.18455017%20L14.75%2C4.33333333%20L14.75%2C7%20C14.75%2C7.41421356%2014.4142136%2C7.75%2014%2C7.75%20C13.6203042%2C7.75%2013.306509%2C7.46784612%2013.2568466%2C7.10177056%20L13.25%2C7%20L13.25%2C4.33333333%20C13.25%2C4.04338384%2013.0384545%2C3.80284343%2012.7612864%2C3.75763485%20L12.6666667%2C3.75%20L3.33333333%2C3.75%20C3.04338384%2C3.75%202.80284343%2C3.96154546%202.75763485%2C4.23871364%20L2.75%2C4.33333333%20L2.75%2C11%20C2.75%2C11.2899495%202.96154546%2C11.5304899%203.23871364%2C11.5756985%20L3.33333333%2C11.5833333%20L4.66666667%2C11.5833333%20C5.04636243%2C11.5833333%205.36015763%2C11.8654872%205.40982005%2C12.2315628%20L5.41666667%2C12.3333333%20L5.416%2C14.523%20L6.80300325%2C13.1363366%20C7.06926981%2C12.87007%207.48593349%2C12.845864%207.77954499%2C13.0637184%20L7.86366342%2C13.1363366%20C8.12992998%2C13.4026031%208.15413603%2C13.8192668%207.93628157%2C14.1128783%20L7.86366342%2C14.1969968%20L5.19699675%2C16.8636634%20C4.74939014%2C17.31127%204.00077515%2C17.0344999%203.92321348%2C16.4359943%20L3.91666667%2C16.3333333%20L3.916%2C13.083%20L3.33333333%2C13.0833333%20C2.2327659%2C13.0833333%201.33151966%2C12.2299379%201.25523089%2C11.1487832%20L1.25%2C11%20L1.25%2C4.33333333%20C1.25%2C3.2327659%202.10339548%2C2.33151966%203.18455017%2C2.25523089%20L3.33333333%2C2.25%20L12.6666667%2C2.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onClick:function(){s.CometChat.callExtension("message-translation","POST","v2/translate",{msgId:t.getId(),text:t.getText(),languages:navigator.languages}).then(e=>{if(e&&e.hasOwnProperty("translations")){let o=e.translations?.[0]?.message_translated;if(o&&o.trim()){let e=t.getMetadata()||{};e.translated_message=o,t.setMetadata(e),n.CometChatMessageEvents.ccMessageTranslated.next({message:t,status:n.MessageStatus.success})}}}).catch(e=>{console.log("error",e)})},iconTint:i?.iconTint||o.palette.getAccent600(),titleColor:i?.titleColor||o.palette.getAccent600(),titleFont:i?.titleFont||n.fontHelper(o.typography.subtitle1),backgroundColor:i?.background||"transparent"});a.push(e)}return a}getTextMessageStyle(e,t){return e!==n.MessageBubbleAlignment.left?{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent900("light")||""}:{textFont:n.fontHelper(t.typography.text3),textColor:t.palette.getAccent()||""}}getTextMessageContentView(e,t,o,s){const i=e.getMetadata();if(i&&Object.prototype.hasOwnProperty.call(i,"translated_message")&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember){const n=i.translated_message;let a,l={...s,textFormatters:s?.textFormatters&&s?.textFormatters.length?[...s.textFormatters]:this.getAllTextFormatters({theme:o,alignment:t,disableMentions:s.disableMentions})},c=l.textFormatters;if(l&&!l.disableMentions){let n;for(let t=0;t<c.length&&!(c[t]instanceof r.CometChatMentionsFormatter&&(n=c[t],n.setMessage(e),e.getMentionedUsers().length&&n.setCometChatUserGroupMembers(e.getMentionedUsers()),n.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),a))&&!(c[t]instanceof r.CometChatUrlsFormatter&&(a=c[t],n));t++);n||(n=Be.getDataSource().getMentionsTextFormatter({message:e,...l,alignment:t,theme:o}),c.push(n))}else for(let e=0;e<c.length;e++)if(c[e]instanceof r.CometChatUrlsFormatter){a=c[e];break}a||(a=Be.getDataSource().getUrlTextFormatter({theme:o,alignment:t}),c.push(a));for(let n=0;n<c.length;n++)c[n].setMessageBubbleAlignment(t),c[n].setMessage(e);return d.jsx(Mn,{translatedText:n,alignment:t,messageTranslationStyle:this.getTranslationStyle(t,o),textFormatters:c,children:d.jsx(Bn,{textStyle:this.getTextMessageStyle(t,o),text:e.getText(),textFormatters:c})})}return super.getTextMessageContentView(e,t,o,s)}checkIfOptionExist(e,t){return e.some(e=>e.id===t)}getId(){return"messagetranslation"}}class Un extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Ln(e,this.configuration))}getExtensionId(){return r.ExtensionsId.messageTranslation}}const Rn=ye({tagName:"polls-bubble",elementClass:r.PollsBubble,react:t}),Pn=ye({tagName:"create-poll",elementClass:r.CreatePoll,react:t,events:{ccCloseClicked:"cc-close-clicked"}});class On extends Ue{constructor(e,t){super(e),this.loggedInUser=null,this.getLoggedInUser(),this.newDataSource=e,this.configuration=t}async getLoggedInUser(){this.loggedInUser=await s.CometChat.getLoggedinUser()}getId(){return"polls"}getAllMessageTypes(){const e=super.getAllMessageTypes();return e.includes(r.PollsConstants.extension_poll)||e.push(r.PollsConstants.extension_poll),e}getAllMessageCategories(){const e=super.getAllMessageCategories();return e.includes(n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});const o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.PollsConstants.extension_poll)||o.push(this.getPollsTemplate(this.theme)),o}getPollsTemplate(e){return new n.CometChatMessageTemplate({type:r.PollsConstants.extension_poll,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getPollsContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}getPollsContentView(e,t){let o=this.configuration?.getPollsBubbleStyle(),r={borderRadius:o?.borderRadius||"8px",background:o?.background||"transparent",votePercentTextFont:o?.votePercentTextFont||n.fontHelper(t.typography.subtitle2),votePercentTextColor:o?.votePercentTextColor||t.palette.getAccent600(),pollQuestionTextFont:o?.pollQuestionTextFont||n.fontHelper(t.typography.subtitle1),pollQuestionTextColor:o?.pollQuestionTextColor||t.palette.getAccent(),pollOptionTextFont:o?.pollOptionTextFont||n.fontHelper(t.typography.text2),pollOptionTextColor:o?.pollOptionTextColor||t.palette.getAccent(),pollOptionBackground:o?.pollOptionBackground||"transparent",optionsIconTint:o?.optionsIconTint||t.palette.getAccent600(),totalVoteCountTextFont:o?.totalVoteCountTextFont||n.fontHelper(t.typography.subtitle2),totalVoteCountTextColor:o?.totalVoteCountTextColor||t.palette.getAccent600(),selectedPollOptionBackground:o?.selectedPollOptionBackground||t.palette.getAccent200(),userSelectedOptionBackground:o?.userSelectedOptionBackground||t.palette.getPrimary(),pollOptionBorder:o?.pollOptionBorder||`1px solid ${t.palette.getAccent100()}`,pollOptionBorderRadius:o?.pollOptionBorderRadius||"8px"};return d.jsx(Rn,{pollStyle:r,pollQuestion:this.getPollBubbleData(e,"question"),pollId:this.getPollBubbleData(e,"id"),senderUid:this.getPollBubbleData(e),loggedInUser:this.loggedInUser??void 0,metadata:e?.getMetadata()})}getPollBubbleData(e,t){let n=e.getCustomData();return t?"options"===t?Object.values(n[t]):n[t]:e.getSender().getUid()}getAttachmentOptions(e,t){if(this.theme=e,t?.parentMessageId)return super.getAttachmentOptions(e,t);{let o=this.configuration?.getOptionStyle();const s=super.getAttachmentOptions(e,t);let i=new n.CometChatMessageComposerAction({id:r.PollsConstants.extension_poll,title:n.localize("POLLS"),iconURL:this.configuration?.getOptionIconURL()?this.configuration?.getOptionIconURL():"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FPolls%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FPolls%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.779983%2C1.25%20C14.2709124%2C1.25043259%2014.7438187%2C1.42418565%2015.1167078%2C1.73706699%20L15.2516928%2C1.86085235%20L20.4715927%2C7.08218001%20C20.8991636%2C7.51561025%2021.1196388%2C8.11205589%2021.0768145%2C8.71941733%20C21.0476811%2C9.13260508%2020.689109%2C9.44394267%2020.2759212%2C9.41480928%20C19.8971658%2C9.38810367%2019.6039928%2C9.08457801%2019.580201%2C8.71591608%20L19.5805293%2C8.613916%20C19.5905393%2C8.47194719%2019.5513165%2C8.33202895%2019.4730888%2C8.21873863%20L19.4072645%2C8.13914765%20L14.1905599%2C2.92103945%20C14.1031809%2C2.83352807%2013.9908865%2C2.77665655%2013.8706878%2C2.75733888%20L13.7793226%2C2.75%20L4.33297476%2C2.75%20C4.04324415%2C2.75%203.80281908%2C2.96150888%203.75763137%2C3.23870267%20L3.75%2C3.33333333%20L3.75%2C20.6666667%20C3.75%2C20.9566568%203.961452%2C21.1971647%204.2384242%2C21.2423664%20L4.33297476%2C21.25%20L9.6648738%2C21.25%20C10.0790874%2C21.25%2010.4148738%2C21.5857864%2010.4148738%2C22%20C10.4148738%2C22.3796958%2010.1327199%2C22.693491%209.76664435%2C22.7431534%20L9.6648738%2C22.75%20L4.33297476%2C22.75%20C3.23255355%2C22.75%202.33150187%2C21.8965632%202.25522974%2C20.8154444%20L2.25%2C20.6666667%20L2.25%2C3.33333333%20C2.25%2C2.23280908%203.10320728%2C1.33152341%204.18421182%2C1.25523113%20L4.33297476%2C1.25%20L13.779983%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M13.6637981%2C1.25%20C14.0434938%2C1.25%2014.357289%2C1.53215388%2014.4069515%2C1.89822944%20L14.4137981%2C2%20L14.4137981%2C7.33333333%20C14.4137981%2C7.62332346%2014.6252501%2C7.86383136%2014.9022223%2C7.90903304%20L14.9967728%2C7.91666667%20L20.3286719%2C7.91666667%20C20.7428854%2C7.91666667%2021.0786719%2C8.2524531%2021.0786719%2C8.66666667%20C21.0786719%2C9.04636243%2020.796518%2C9.36015763%2020.4304424%2C9.40982005%20L20.3286719%2C9.41666667%20L14.9967728%2C9.41666667%20C13.8963516%2C9.41666667%2012.9952999%2C8.56322987%2012.9190278%2C7.4821111%20L12.9137981%2C7.33333333%20L12.9137981%2C2%20C12.9137981%2C1.58578644%2013.2495845%2C1.25%2013.6637981%2C1.25%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8.99777572%2C9.420279%20C9.24921801%2C9.09111393%209.71989329%2C9.02810717%2010.0490584%2C9.27954946%20C10.3482993%2C9.50813337%2010.4275748%2C9.91790155%2010.2506031%2C10.2378223%20L10.1897879%2C10.3308321%20L8.25879925%2C12.8586842%20C8.01208284%2C13.1778547%207.64305532%2C13.3791966%207.21567496%2C13.4156509%20C6.86419538%2C13.4339623%206.52012946%2C13.3223779%206.23838713%2C13.0959918%20L6.12161623%2C12.9919845%20L5.12632841%2C11.9608734%20C4.838658%2C11.6628489%204.84705165%2C11.1880493%205.14507615%2C10.9003789%20C5.41600752%2C10.6388603%205.83303397%2C10.6220228%206.1227489%2C10.845033%20L6.20557062%2C10.9191266%20L7.125%2C11.871%20L8.99777572%2C9.420279%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M8.99777572%2C15.420279%20C9.24921801%2C15.0911139%209.71989329%2C15.0281072%2010.0490584%2C15.2795495%20C10.3482993%2C15.5081334%2010.4275748%2C15.9179016%2010.2506031%2C16.2378223%20L10.1897879%2C16.3308321%20L8.25879925%2C18.8586842%20C8.01208284%2C19.1778547%207.64305532%2C19.3791966%207.21567496%2C19.4156509%20C6.86419538%2C19.4339623%206.52012946%2C19.3223779%206.23838713%2C19.0959918%20L6.12161623%2C18.9919845%20L5.12632841%2C17.9608734%20C4.838658%2C17.6628489%204.84705165%2C17.1880493%205.14507615%2C16.9003789%20C5.41600752%2C16.6388603%205.83303397%2C16.6220228%206.1227489%2C16.845033%20L6.20557062%2C16.9191266%20L7.125%2C17.871%20L8.99777572%2C15.420279%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M15.6632602%2C11.9166667%20C16.0774738%2C11.9166667%2016.4132602%2C12.2524531%2016.4132602%2C12.6666667%20C16.4132602%2C13.0463624%2016.1311063%2C13.3601576%2015.7650308%2C13.4098201%20L15.6632602%2C13.4166667%20L12.3308233%2C13.4166667%20C11.9166098%2C13.4166667%2011.5808233%2C13.0808802%2011.5808233%2C12.6666667%20C11.5808233%2C12.2869709%2011.8629772%2C11.9731757%2012.2290528%2C11.9235133%20L12.3308233%2C11.9166667%20L15.6632602%2C11.9166667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M21.1106837%2C10.5779533%20C20.4095395%2C10.5779533%2019.7375424%2C10.8584991%2019.2444627%2C11.3570467%20L12.4669093%2C18.1364079%20C12.3622379%2C18.2411074%2012.2908946%2C18.3744435%2012.2618676%2C18.5196176%20L11.5953802%2C21.8529509%20C11.4904492%2C22.3777472%2011.953163%2C22.8404132%2012.4779485%2C22.7354279%20L15.8103854%2C22.0687612%20C15.9555979%2C22.0397109%2016.0889603%2C21.9683215%2016.1936616%2C21.8635921%20L22.9740599%2C15.0813699%20C23.4695748%2C14.5910412%2023.75%2C13.9189715%2023.75%2C13.2177778%20C23.75%2C12.516584%2023.4695748%2C11.8445143%2022.9711997%2C11.35134%20L22.8310414%2C11.2210775%20C22.3327458%2C10.7984458%2021.7321255%2C10.5779533%2021.1106837%2C10.5779533%20Z%20M21.1106837%2C12.0779533%20C21.3769595%2C12.0779533%2021.6343527%2C12.1724444%2021.8371937%2C12.3440921%20L21.9342889%2C12.4349375%20C22.129767%2C12.628969%2022.25%2C12.9171205%2022.25%2C13.2177778%20L22.242717%2C13.345678%20C22.2137413%2C13.5991981%2022.0992456%2C13.8367894%2021.9161173%2C14.0180067%20L15.293%2C20.642%20L13.287%2C21.043%20L13.688%2C19.035%20L20.3081104%2C12.4147032%20C20.5222805%2C12.1981735%2020.8102464%2C12.0779533%2021.1106837%2C12.0779533%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",iconTint:o?.iconTint||e.palette.getAccent700(),titleColor:o?.titleColor||e.palette.getAccent600(),titleFont:o?.titleFont||n.fontHelper(e.typography.subtitle1),background:o?.background||e.palette.getAccent100(),onClick:(...t)=>{this.onPollsButtonClicked(e,...t)}});return s.push(i),s}}onPollsButtonClicked(e,...t){const[o]=t;let r=o[0],s=o[1],i=this.configuration?.getCreatePollStyle(),a={placeholderTextFont:i?.placeholderTextFont||n.fontHelper(e.typography.subtitle1),placeholderTextColor:i?.placeholderTextColor||e.palette.getAccent600(),deleteIconTint:i?.deleteIconTint||e.palette.getAccent600(),titleFont:i?.titleFont||n.fontHelper(e.typography.title1),titleColor:i?.titleColor||e.palette.getAccent(),closeIconTint:i?.closeIconTint||e.palette.getPrimary(),questionInputBackground:i?.questionInputBackground||e.palette.getAccent100(),optionInputBackground:i?.optionInputBackground||e.palette.getAccent100(),answerHelpTextFont:i?.answerHelpTextFont||n.fontHelper(e.typography.caption1),answerHelpTextColor:i?.answerHelpTextColor||e.palette.getAccent400(),addAnswerIconTint:i?.addAnswerIconTint||e.palette.getPrimary(),createPollButtonTextFont:i?.createPollButtonTextFont||n.fontHelper(e.typography.text2),createPollButtonTextColor:i?.createPollButtonTextColor||e.palette.getAccent("dark"),createPollButtonBackground:i?.createPollButtonBackground||e.palette.getPrimary(),addAnswerTextFont:i?.addAnswerTextFont||n.fontHelper(e.typography.text2),addAnswerTextColor:i?.addAnswerTextColor||e.palette.getPrimary(),errorTextFont:i?.errorTextFont||n.fontHelper(e.typography.subtitle1),errorTextColor:i?.errorTextColor||e.palette.getError(),optionPlaceholderTextFont:i?.optionPlaceholderTextFont||n.fontHelper(e.typography.subtitle1),optionPlaceholderTextColor:i?.optionPlaceholderTextColor||e.palette.getAccent600(),questionInputTextFont:i?.questionInputTextFont||n.fontHelper(e.typography.subtitle2),questionInputTextColor:i?.questionInputTextColor||e.palette.getAccent600(),optionInputTextFont:i?.optionInputTextFont||n.fontHelper(e.typography.subtitle2),optionInputTextColor:i?.optionInputTextColor||e.palette.getAccent600(),width:i?.width||"360px",height:i?.height||"440px",border:i?.border||"",borderRadius:i?.borderRadius||"8px",background:i?.background||e.palette.getAccent900(),position:"absolute",zIndex:1};n.CometChatUIEvents.ccShowModal.next({child:this.getPollView(r,s,a)})}getPollView(e,t,n){return d.jsx("cometchat-backdrop",{children:d.jsx(Pn,{user:e,group:t,ccCloseClicked:this.triggerCloseEvent,createPollStyle:n,deleteIconURL:this.configuration?.getDeleteIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDelete%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDelete%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%223.6363627%22%20x2%3D%2220%22%20y2%3D%223.6363627%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.0454545%2C0%20L7.95454545%2C0%20C7.20142989%2C0%206.59090909%2C0.610520639%206.59090909%2C1.36363601%20L6.59090909%2C3.6363627%20L13.4090909%2C3.6363627%20L13.4090909%2C1.36363601%20C13.4090909%2C0.610520639%2012.7985701%2C0%2012.0454545%2C0%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%227.95454545%22%20y1%3D%2215.2272688%22%20x2%3D%227.95454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2212.0454545%22%20y1%3D%2215.2272688%22%20x2%3D%2212.0454545%22%20y2%3D%228.40908875%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16.2363636%2C18.7454497%20C16.1838968%2C19.4542339%2015.5925391%2C20.0019341%2014.8818182%2C20%20L5.11818182%2C20%20C4.40746088%2C20.0019341%203.81610324%2C19.4542339%203.76363636%2C18.7454497%20L2.5%2C3.6363627%20L17.5%2C3.6363627%20L16.2363636%2C18.7454497%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",closeIconURL:this.configuration?.getCloseIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",addAnswerIconURL:this.configuration?.getAddAnswerIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"})})}triggerCloseEvent(){n.CometChatUIEvents.ccHideModal.next()}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.PollsConstants.extension_poll&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_POLL"):super.getLastConversationMessage(e,t,o)}}class jn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new On(e,this.configuration))}getExtensionId(){return r.ExtensionsId.polls}}const Vn=ye({tagName:"smart-replies",elementClass:r.SmartReplies,react:t,events:{ccReplyClicked:"cc-reply-clicked",ccCloseClicked:"cc-close-clicked"}});class Gn extends Ue{constructor(e,t,o){super(e),this.LISTENER_ID="smartreply__listener",this.currentMessage=null,this.configuration=t,this.theme=o||new n.CometChatTheme({}),this.addMessageListener()}addMessageListener(){s.CometChat.getLoggedinUser().then(e=>{e&&(this.loggedInUser=e)}),n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{null!=e&&this.loggedInUser&&this.loggedInUser?.getUid()!=e.getSender().getUid()&&(this.currentMessage=e,e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&null!=this.activeUser?null!==e.getSender()&&null!==e.getSender().getUid()&&this.activeUser.getUid()===e.getSender().getUid()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:e,child:this.getSmartReplyView(e),position:n.PanelAlignment.messageListFooter}):e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&null!=this.activeGroup&&null!==this.activeGroup.getGuid()&&this.activeGroup.getGuid()===e.getReceiverId()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:e,child:this.getSmartReplyView(e),position:n.PanelAlignment.messageListFooter}))}),n.CometChatUIEvents.ccActiveChatChanged.subscribe(e=>{this.currentMessage=e.message,this.activeUser=e.user,this.activeGroup=e.group,this.currentMessage instanceof s.CometChat.TextMessage&&null!==this.currentMessage&&null!==this.currentMessage.getSender()&&null!==this.loggedInUser&&null!==this.currentMessage.getSender().getUid()&&this.currentMessage.getSender().getUid()!==this.loggedInUser.getUid()&&n.CometChatUIEvents.ccShowPanel.next({configuration:this.configuration,message:this.currentMessage,child:this.getSmartReplyView(this.currentMessage)})}),n.CometChatMessageEvents.ccMessageSent.subscribe(()=>{n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null})}getReplies(e){let t=e;const n=t?.metadata?.[r.SmartRepliesConstants.injected]?.extensions?.[r.SmartRepliesConstants.smart_reply];if(n?.reply_positive&&n?.reply_neutral&&n?.reply_negative){const{reply_positive:e,reply_neutral:t,reply_negative:o}=n;return[e,t,o]}return null}getSmartReplyStyle(){const e=this.configuration?.getSmartRepliesStyle();return{replyTextFont:e?.replyTextFont||n.fontHelper(this.theme.typography.caption1),replyTextColor:e?.replyTextColor||this.theme?.palette.getAccent(),replyBackground:e?.replyBackground||"inherit",boxShadow:e?.boxShadow||`0px 0px 1px ${this.theme?.palette.getAccent600()}`,closeIconTint:e?.closeIconTint||this.theme?.palette.getAccent600(),background:e?.background||"inherit",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",display:"flex",justifyContent:"flex-start"}}sendSmartReply(e){let t=this.activeUser?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,o=e?.detail?.reply,i=this.currentMessage;if(o&&o.trim().length>0&&i){let e;if(i.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user)e=new s.CometChat.TextMessage(i.getSender().getUid(),o.trim(),t),e.setReceiver(this.activeUser);else{const n=i.getReceiver();e=new s.CometChat.TextMessage(n.getGuid(),o.trim(),t),e.setReceiver(this.activeGroup)}i.getParentMessageId()>0&&e.setParentMessageId(i.getParentMessageId()),e.setCategory(n.CometChatUIKitConstants.MessageCategory.message),e.setSender(this.loggedInUser),e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMessage(e).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},t=>{e.setMetadata({error:!0}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}}closeSmartReply(){n.CometChatUIEvents.ccHidePanel.next(n.PanelAlignment.messageListFooter),this.currentMessage=null}getSmartReplyButtonStyle(){return{background:"inherit"}}getSmartReplyView(e){return this.getReplies(e)?d.jsx("div",{className:"cc-messagelist__smartreplies",style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"flex-end"},children:d.jsx(Vn,{smartReplyStyle:this.getSmartReplyStyle(),replies:this.getReplies(e)??void 0,ccReplyClicked:t=>{t.msg=e,this.sendSmartReply(t)},ccCloseClicked:this.closeSmartReply})}):null}getId(){return"smartreply"}}class Hn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Gn(e,this.configuration,this.theme))}getExtensionId(){return r.ExtensionsId.smartReply}}const Qn=ye({tagName:"stickers-keyboard",elementClass:r.StickersKeyboard,react:t,events:{ccStickerClicked:"cc-sticker-clicked"}}),Nn=ye({tagName:"cometchat-image-bubble",elementClass:o.CometChatImageBubble,react:t});class Kn extends Ue{constructor(e,t){super(e),this.showStickerKeyboard=!1,this.newDataSource=e,this.configuration=t}getDataSource(){return this.newDataSource}getAllMessageTemplates(e,t){this.theme=e||new n.CometChatTheme({});let o=super.getAllMessageTemplates(this.theme,t);return this.checkIfTemplateExist(o,r.StickersConstants.sticker)||o.push(this.getStickerTemplate(this.theme)),o}getAuxiliaryOptions(e,t,n,o){this.id=e,this.user=n,this.group=o;let r=super.getAuxiliaryOptions(e,t,n,o);return r.push(this.getStickerAuxiliaryButton(e,t,n,o)),r}getStickerAuxiliaryButton(e,t,r,s){let i=this.configuration?.getStickersStyle(),a={height:i?.sticketButtonHeight||"24px",width:i?.stickerButtonWidth||"24px",border:"none",borderRadius:"0",buttonIconTint:i?.stickerButtonIconTint||t.palette.getAccent500(),background:"transparent"},l=new o.PopoverStyle({width:i?.width||"300px",height:i?.height||"400px",background:t?.palette?.getBackground(),borderRadius:"12px",boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}),c={width:i?.width||"300px",height:i?.height||"400px",border:i?.border||"none",emptyStateTextFont:i?.emptyStateTextFont||n.fontHelper(t.typography.title1),emptyStateTextColor:i?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:i?.errorStateTextFont||n.fontHelper(t.typography.title1),errorStateTextColor:i?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:i?.loadingIconTint||t.palette.getAccent600(),background:i?.background||t.palette.getBackground(),borderRadius:i?.borderRadius||"12px"},C=this.configuration?.getStickerIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FStickers%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FStickers%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M5.67349142%2C7.33338221%20C5.86012572%2C7.33338221%206.01142272%2C7.48460989%206.01142272%2C7.67115869%20C6.01142272%2C7.85770748%205.86012572%2C8.00893516%205.67349142%2C8.00893516%20C5.48685711%2C8.00893516%205.33556012%2C7.85770748%205.33556012%2C7.67115869%20C5.33556012%2C7.58157479%205.37116349%2C7.49566003%205.4345379%2C7.43231465%20C5.49791231%2C7.36896927%205.58386646%2C7.33338221%205.67349142%2C7.33338221%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4.23283692%2C13.0400269%20C5.36112225%2C15.1816508%207.58282264%2C16.5229567%2010.0043478%2C16.5244579%20C10.2778756%2C16.5227578%2010.5510655%2C16.5049493%2010.8224973%2C16.4711247%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M20%2C9.57337357%20C19.7666207%2C4.11103074%2015.187631%2C-0.151378825%209.72001617%2C0.00412271646%20C4.25240139%2C0.159624258%20-0.0767041446%2C4.67538425%200.00103066029%2C10.1421537%20C0.0787654651%2C15.6089231%204.5345202%2C20%2010.0043478%2C20%20L10.4489943%2C20%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.1831154%2C7.92004661%20C12.559175%2C7.32283168%2013.215699%2C6.96047481%2013.921683%2C6.96047481%20C14.6276671%2C6.96047481%2015.2841911%2C7.32283168%2015.6602507%2C7.92004661%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2220%22%20y1%3D%229.57337357%22%20x2%3D%2210.4489943%22%20y2%3D%2219.9911111%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.4489943%2C19.9911111%20L10.4489943%2C19.1022257%20C10.4588042%2C13.8367116%2014.7320632%2C9.57337357%2020%2C9.57337357%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",g=this.configuration?.getCloseIconURL()||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";return d.jsxs("cometchat-popover",{placement:n.Placement.top,popoverStyle:JSON.stringify(l),children:[d.jsx("div",{slot:"children",children:d.jsx("cometchat-button",{hoverText:n.localize("STICKER"),iconURL:this.showStickerKeyboard?g:C,buttonStyle:JSON.stringify(a)})}),d.jsx("div",{slot:"content",children:d.jsx(Qn,{stickerStyle:c,ccStickerClicked:e=>this.sendSticker(e)})})]},"stickers-extension-popover")}sendSticker(e){try{let t=e?.detail,o={name:t?.stickerName,URL:t?.stickerURL};const i=this.user?.getUid()||this.group?.getGuid(),a=this.user?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,{parentMessageId:l}=this.id,c={sticker_url:o.URL,sticker_name:o.name},C=r.StickersConstants.sticker,d=new s.CometChat.CustomMessage(i,a,C,c);l&&d.setParentMessageId(l),d.setMetadata({incrementUnreadCount:!0}),d.shouldUpdateConversation(!0),d.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),d.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:d,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(d).then(e=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success})},e=>{d.setMetadata({error:!0}),n.CometChatMessageEvents.ccMessageSent.next({message:d,status:n.MessageStatus.error})})}catch(e){console.log("error in sending sticker",e)}}getSticker(e){let t;return r.CometChatUIKitUtility.checkHasOwnProperty(e,r.StickersConstants.data)&&r.CometChatUIKitUtility.checkHasOwnProperty(e.getData(),r.StickersConstants.custom_data)?(t=e.getCustomData(),r.CometChatUIKitUtility.checkHasOwnProperty(t,r.StickersConstants.sticker_url)?t?.sticker_url:""):""}getStickerMessageContentView(e,t){return d.jsx(Nn,{src:this.getSticker(e),imageStyle:{height:"128px",width:"128px",border:"none",borderRadius:"0",background:"transparent"}})}getStickerTemplate(e){return new n.CometChatMessageTemplate({type:r.StickersConstants.sticker,category:n.CometChatUIKitConstants.MessageCategory.custom,contentView:(t,n)=>{let o=t;return o.getDeletedAt()?super.getDeleteMessageBubble(o,e):this.getStickerMessageContentView(o,e)},options:(e,t,n,o)=>super.getCommonOptions(e,t,n,o),bottomView:(e,t)=>Be.getDataSource().getBottomView(e,t)})}checkIfTemplateExist(e,t){return e.some(e=>e.type===t)}getAllMessageCategories(){let e=super.getAllMessageCategories();return e.some(e=>e===n.CometChatUIKitConstants.MessageCategory.custom)||e.push(n.CometChatUIKitConstants.MessageCategory.custom),e}getAllMessageTypes(){let e=super.getAllMessageTypes();return e.some(e=>e===r.StickersConstants.sticker)||e.push(r.StickersConstants.sticker),e}getId(){return"stickers"}getLastConversationMessage(e,t,o){const s=e.getLastMessage();return null!=s&&s.getType()===r.StickersConstants.sticker&&s.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom?n.localize("CUSTOM_MESSAGE_STICKER"):super.getLastConversationMessage(e,t,o)}}class zn extends dn{constructor(e){super(),this.configuration=e}addExtension(){Be.enable(e=>new Kn(e,this.configuration))}getExtensionId(){return r.ExtensionsId.stickers}}class Jn extends Ue{getId(){return"textmoderator"}getModeratedtext(e){let t=r.CometChatUIKitUtility.getExtensionData(e);return t?.trim()?.length>0?t:e.getText()}getLastConversationMessage(e,t,o){const i=e.getLastMessage();if(i&&!i.getDeletedAt()&&i.getType()===n.CometChatUIKitConstants.MessageTypes.text&&i.getCategory()===n.CometChatUIKitConstants.MessageCategory.message){let t=this.getModeratedtext(i),a=e.getLastMessage(),l={...o,textFormatters:o?.textFormatters&&o?.textFormatters.length?[...o.textFormatters]:[this.getMentionsTextFormatter({theme:o.theme,disableMentions:o.disableMentions})]},c=l.textFormatters;if(l&&!l.disableMentions){let e;for(let t=0;t<c.length&&!(c[t]instanceof r.CometChatMentionsFormatter&&(e=c[t],e.setMessage(a),a.getMentionedUsers().length&&e.setCometChatUserGroupMembers(a.getMentionedUsers()),e.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),e));t++);e||(e=Be.getDataSource().getMentionsTextFormatter({messageObj:a,...l,alignment:null,theme:o.theme}),c.push(e))}if(a&&a instanceof s.CometChat.TextMessage)for(let e=0;e<c.length;e++)t=c[e].getFormattedText(t,{mentionsTargetElement:n.MentionsTargetElement.conversation});return i&&e?.getConversationType()!=s.CometChat.RECEIVER_TYPE.USER&&(t=i?.getSender().getUid()==r.CometChatUIKitLoginListener?.getLoggedInUser()?.getUid()?`${n.localize("YOU")}: ${t}`:`${i?.getSender().getName()}: ${t}`),t}return super.getLastConversationMessage(e,t,o)}getTextMessageContentView(e,t,n,o){let r=this.getModeratedtext(e);return this.getModeratedtext(e)!==e.getText()&&e.setText(r),super.getTextMessageContentView(e,t,n,o)}}class Yn extends dn{addExtension(){Be.enable(e=>new Jn(e))}getExtensionId(){return r.ExtensionsId.profanityFilter}enable(){const e=s.CometChat.isExtensionEnabled(r.ExtensionsId.profanityFilter),t=s.CometChat.isExtensionEnabled(r.ExtensionsId.dataMasking);Promise.all([e,t]).then(e=>{e.includes(!0)&&this.addExtension()}).catch(e=>{})}}class _n extends Ue{getId(){return"thumbnailgeneration"}getImageMessageBubble(e,t,n,o,r,s){if(Be.names.includes("imagemoderation"))return super.getImageMessageBubble(e,t,n,o);{let e=n?.getAttachments()[0]??n.getMetadata(),t=e?.url,r=n.getMetadata();return r&&r.hasOwnProperty("@injected")&&r["@injected"].hasOwnProperty("extensions")&&r["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&r["@injected"].extensions["thumbnail-generation"].url_medium&&(t=r["@injected"].extensions["thumbnail-generation"].url_medium),super.getImageMessageBubble(t,"data:image/png;base64,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",n,o)}}getVideoMessageBubble(e,t,n,o,r,s){let i=t.getMetadata(),a=o;return i&&i.hasOwnProperty("@injected")&&i["@injected"].hasOwnProperty("extensions")&&i["@injected"].extensions.hasOwnProperty("thumbnail-generation")&&i["@injected"].extensions["thumbnail-generation"].url_medium&&(a=i["@injected"].extensions["thumbnail-generation"].url_medium),super.getVideoMessageBubble(e,t,n,a)}}class Wn extends dn{addExtension(){Be.enable(e=>new _n(e))}getExtensionId(){return r.ExtensionsId.thumbnailGeneration}}class Zn{static init(e){if(Zn.uiKitSettings=e,!Zn.checkAuthSettings())return;const t=new s.CometChat.AppSettingsBuilder;e.getRoles()?t.subscribePresenceForRoles(e.getRoles()):"ALL_USERS"===e.getSubscriptionType()?t.subscribePresenceForAllUsers():"FRIENDS"===e.getSubscriptionType()&&t.subscribePresenceForFriends(),t.autoEstablishSocketConnection(e.isAutoEstablishSocketConnection()),t.setRegion(e.getRegion()),t.overrideAdminHost(e.getAdminHost()),t.overrideClientHost(e.getClientHost());const n=t.build();return s.CometChat.setSource&&s.CometChat.setSource("uikit-v4","web","reactjs"),r.CometChatUIKitSharedSettings.uikitSettings=Zn.uiKitSettings,new Promise((t,o)=>{window.CometChatUiKit={name:"@cometchat/chat-uikit-react",version:"4.3.35"},s.CometChat.init(e?.appId,n).then(()=>{s.CometChat.getLoggedinUser().then(e=>(e&&(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),this.initiateAfterLogin()),t(e))).catch(e=>(console.log(e),o(e)))}).catch(e=>o(e))})}static enableCalling(){try{if(r.CometChatUIKitCalls){const e=(new r.CometChatUIKitCalls.CallAppSettingsBuilder).setAppId(Zn.uiKitSettings?.appId).setRegion(Zn.uiKitSettings?.region).build();r.CometChatUIKitCalls.init(e).then(()=>{this.uiKitSettings?.getCallingExtension()?this.uiKitSettings?.getCallingExtension().enable():this.defaultCallingExtension.enable()},e=>{console.log("CometChatCalls initialization failed with error:",e)})}}catch(e){console.log(e)}}static initiateAfterLogin(){if(null!=Zn.uiKitSettings){s.CometChat.getConversationUpdateSettings().then(e=>{this.conversationUpdateSettings=e});let e=this.uiKitSettings?.extensions||this.defaultExtensions;n.ChatSdkEventInitializer.attachListeners(),r.CometChatUIKitLoginListener.attachListener();let t=this.uiKitSettings?.aiFeatures||this.defaultAIFeatures;e.length>0&&e.forEach(e=>{e?.enable()}),t.length>0&&t.forEach(e=>{e.enable()}),this.enableCalling()}}static login(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");Zn.getLoggedinUser()?.then(o=>{if(o)return r.CometChatUIKitLoginListener.setLoggedInUser(o),this.initiateAfterLogin(),t(o);s.CometChat.login(e,Zn.uiKitSettings.authKey).then(e=>(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),r.CometChatUIKitLoginListener.setLoggedInUser(e),this.initiateAfterLogin(),t(e))).catch(e=>n(e))})})}static loginWithAuthToken(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.login(e).then(e=>(r.CometChatUIKitLoginListener.setLoggedInUser(e),Be.init(),this.initiateAfterLogin(),t(e))).catch(e=>n(e))})}static getLoggedinUser(){return new Promise((e,t)=>{if(!Zn.checkAuthSettings())return t("uiKitSettings not available");s.CometChat.getLoggedinUser().then(t=>(t&&r.CometChatUIKitLoginListener.setLoggedInUser(t),e(t))).catch(e=>t(e))})}static createUser(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.createUser(e,Zn.uiKitSettings.authKey).then(e=>t(e)).catch(e=>n(e))})}static updateUser(e){return new Promise((t,n)=>{if(!Zn.checkAuthSettings())return n("uiKitSettings not available");s.CometChat.updateUser(e,Zn.uiKitSettings.authKey).then(e=>t(e)).catch(e=>n(e))})}static logout(){return new Promise((e,t)=>{if(!Zn.checkAuthSettings()){return t({code:"ERROR_UIKIT_NOT_INITIALISED",message:"UIKItSettings not available"})}s.CometChat.logout().then(t=>(r.CometChatUIKitLoginListener.removeLoggedInUser(),e(t))).catch(e=>t(e))})}static checkAuthSettings(){return null!=Zn.uiKitSettings&&null!=Zn.uiKitSettings.appId}static sendFormMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCardMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCustomInteractiveMessage(e,t=!1){e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let o=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.success})}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error})})}static sendCustomMessage(e){return new Promise((t,o)=>{e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendCustomMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendTextMessage(e){return new Promise((t,o)=>{e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendMediaMessage(e){return e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),new Promise((t,o)=>{n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendMediaMessage(e).then(e=>(n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.success}),t(e))).catch(t=>(e.setMetadata({error:t}),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),o(t)))})}static sendSchedulerMessage(e,t=!1){return new Promise((o,i)=>{e?.getMuid()||e.setMuid(r.CometChatUIKitUtility.ID()),e.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress}),s.CometChat.sendInteractiveMessage(e).then(e=>{let s=r.InteractiveMessageUtils.convertInteractiveMessage(e);t||n.CometChatMessageEvents.ccMessageSent.next({message:s,status:n.MessageStatus.success}),o(e)}).catch(o=>{e.setMetadata({error:o}),t||n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.error}),i(o)})})}static getDataSource(){return Be.getDataSource()}}Zn.SoundManager=r.CometChatSoundManager,Zn.Localize=n.CometChatLocalize,Zn.defaultExtensions=[new zn,new Hn,new bn,new hn,new Un,new Yn,new Wn,new Tn,new jn,new In],Zn.defaultCallingExtension=new Cn,Zn.defaultAIFeatures=[new Gt,new wt,new kt,new Ct];const Xn=(e,t)=>{let o;return o=t===n.TabAlignment.top||t===n.TabAlignment.left?{top:"0",left:"0"}:t===n.TabAlignment.bottom?{bottom:"2px",left:"2px"}:{top:"0",right:"0"},{...o,position:"absolute",zIndex:"2",height:e?.tabListHeight||"100%",width:e?.tabListWidth||"100%",border:e?.tabListBorder||"0 none",borderRadius:e?.tabListBorderRadius||"0",background:e?.tabListBackground||"transparent",boxShadow:e?.tabListBoxShadow||"0",padding:e?.tabListPadding||"0",boxSizing:"border-box"}};function qn(e){return{height:e?.tabPaneHeight||"100%",width:e?.tabPaneWidth||"100%",display:"flex",position:"absolute",bottom:"0"}}const $n=(e,t,o,r,s)=>{let i=o?.id===t?.id,a=t?.style,l=e===n.TabAlignment.top||e===n.TabAlignment.bottom?"row":"column",c=a?.borderRadius,C="first"===r?`${c} 0 0 ${c}`:"last"===r?`0 ${c} ${c} 0`:"0";i&&a.activeBorderRadius&&(C=a.activeBorderRadius);let d="0";return i&&a?.boxShadow&&(d=a.boxShadow),{display:"flex",flexDirection:l,justifyContent:"center",width:a?.width,height:a?.height,backgroundColor:i?a?.activeBackground??a?.background:a?.background,borderRadius:C,boxShadow:d}},eo=e=>{let{borderRadius:t}=e??{};return{height:"100%",width:"100%",borderRadius:t}};function to(e,t){return e.id!==t?.id?{display:"none"}:{display:"flex",height:"100%",width:"100%"}}const no={tabAlignment:n.TabAlignment.bottom,tabsStyle:{},tabs:[],keepAlive:!1,tabIconAlignment:n.IconButtonAlignment.top},oo=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t,events:{ccButtonClicked:"cc-button-clicked"}}),ro=e=>{const{tabAlignment:n,tabIconAlignment:o,tabsStyle:r,tabs:s,keepAlive:i}={...no,...e},[a,l]=t.useState(null),[c,C]=t.useState(""),g=t.useRef(null),u=t.useCallback(e=>{if(s&&s.length>0){g.current=null;let t=s.findIndex(t=>t.id===e.id);t>-1&&(l(e),C(e.id),g.current=s[t].childView)}},[g,s]);t.useEffect(()=>{if(c){const e=s?.find(e=>e.id===c);e&&u(e)}else{const e=s?.find(e=>e.isActive);e&&u(e)}},[c,u,s]);const p=t.useCallback(e=>{const{style:t,iconURL:n}=e||{},{id:o}=a||{};return((e,t,n)=>({background:"inherit",buttonTextFont:t?e?.activeTitleTextFont??e?.titleTextFont:e?.titleTextFont,buttonTextColor:t?e?.activeTitleTextColor??e?.titleTextColor:e?.titleTextColor,buttonIconTint:t?e?.activeIconTint??e?.iconTint:e?.iconTint,height:"100%",width:"100%",border:e?.border,borderRadius:e?.borderRadius,gap:"8px",padding:"0",justifyContent:n?"":"center"}))(t,o===e?.id,n)},[a]),h=t.useCallback(()=>s?.map((e,t)=>{const r=0===t?"first":t===s.length-1?"last":"";let i=`${e.id}-${Math.floor(10*Math.random()+1)}`;return d.jsx("div",{className:"cc-tab-item",style:$n(n,e,a,r),children:d.jsx(oo,{alignment:o,iconURL:e.iconURL,text:e.title,buttonStyle:p(e),ccButtonClicked:t=>u(e)})},i)}),[a]),m=t.useCallback(()=>i?s.map(e=>d.jsx("div",{className:"cc-tab-pane-content",style:to(e,a),children:e?.childView?d.jsx("div",{className:"cc-tab-pane-content-view",style:eo(r),children:e?.childView}):null},e.id)):g?.current?d.jsx("div",{className:"cc-tab-pane-content",style:eo(r),children:g?.current}):null,[a]);return d.jsxs("div",{className:"cc-tabs",style:(A=r,{height:A?.height||"100%",width:A?.width||"100%",borderRadius:A?.borderRadius||"0",border:A?.border||"0 none",background:A?.background||"transparent",display:"flex",flexDirection:"row",justifyContent:"flex-start",position:"relative"}),children:[d.jsx("div",{className:"cc-tab-list",style:Xn(r,n),children:d.jsx("div",{className:"cc-tab-item__wrapper",style:{display:"flex",justifyContent:"center",height:"100%",width:"100%"},children:h()})}),d.jsx("div",{className:"cc-tab-pane",style:qn(r),children:m()})]});var A};class so{constructor(e){let{style:t,createPollStyle:n,createPollIconURL:o,deleteIconURL:r,closeIconURL:s,optionIconURL:i,addAnswerIconURL:a,optionStyle:l}=e;this.style=t,this.createPollStyle=n,this.createPollIconURL=o,this.deleteIconURL=r,this.closeIconURL=s,this.optionIconURL=i,this.addAnswerIconURL=a,this.optionStyle=l}getPollsBubbleStyle(){return this.style}getCreatePollStyle(){return this.createPollStyle}getCreatePollIconURL(){return this.createPollIconURL}getDeleteIconURL(){return this.deleteIconURL}getCloseIconURL(){return this.closeIconURL}getOptionIconURL(){return this.optionIconURL}getAddAnswerIconURL(){return this.addAnswerIconURL}getOptionStyle(){return this.optionStyle}}const io=e=>({height:e?.height,width:e?.width,background:e?.background,border:e?.border,borderRadius:e?.borderRadius,padding:"8px",position:"absolute",left:"8px",top:"8px",minHeight:"95px",minWidth:"230px",zIndex:100,display:"flex",flexDirection:"column",justifyContent:"flex-start",gap:"8px",alignItems:"flex-start"}),ao={display:"flex",alignItems:"center",justifyContent:"flex-start",gap:"6px"},lo=e=>({textFont:e?.subtitleTextFont,textColor:e?.subtitleTextColor}),co={width:"100%",marginLeft:"-4px"},Co={position:"relative"},go={display:"flex",gap:"8px",paddingLeft:"8px",paddingRight:"8px"},uo={height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:"8px 28px"},po=e=>new o.AvatarStyle({borderRadius:"16px",width:"38px",height:"38px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1)}),ho=e=>new r.IncomingCallStyle({width:"fit-content",height:"fit-content",background:e.palette.getAccent800(),border:"none",borderRadius:"8px",titleTextFont:n.fontHelper(e.typography.title2),titleTextColor:e.palette.getAccent("dark"),subtitleTextFont:n.fontHelper(e.typography.subtitle2),subtitleTextColor:e.palette.getAccent("dark"),acceptButtonTextFont:n.fontHelper(e.typography.text2),acceptButtonTextColor:e.palette.getAccent("dark"),acceptButtonBackground:e.palette.getPrimary(),acceptButtonBorderRadius:"8px",acceptButtonBorder:"none",declineButtonTextFont:n.fontHelper(e.typography.text2),declineButtonTextColor:e.palette.getAccent("dark"),declineButtonBackground:e.palette.getError(),declineButtonBorderRadius:"8px",declineButtonBorder:"none"}),mo=(e,t)=>new o.ListItemStyle({height:"100%",width:"100%",background:"transparent",activeBackground:"transparent",borderRadius:"0",titleFont:e?.titleTextFont,titleColor:e?.titleTextColor,border:"none",separatorColor:t.palette.getAccent200(),hoverBackground:"transparent"});function Ao(e,t){const n=e.getInitiator()?.getUid();return!n||n===t?.getUid()}function xo(e,t){const o=e.getStatus(),r=Ao(e,t);if(r&&o===n.CometChatUIKitConstants.calls.unanswered)return!1;const s=[n.CometChatUIKitConstants.calls.unanswered,n.CometChatUIKitConstants.calls.cancelled,n.CometChatUIKitConstants.calls.busy,n.CometChatUIKitConstants.calls.rejected];return!r&&s.includes(o)}function bo(e,t){return e.getInitiator().getUid()===t.getUid()?e.getReceiver():e.getInitiator()}function yo(e,t,o=!1){if(!e||!t)return"";let r="";const s=e.getStatus(),i=Ao(e,t),a="_";if(xo(e,t))r=`MISSED${a}CALL`;else switch(s){case n.CometChatUIKitConstants.calls.initiated:r=i?`OUTGOING${a}CALL`:`INCOMING${a}CALL`;break;case n.CometChatUIKitConstants.calls.ongoing:r=`ONGOING${a}CALL`;break;case n.CometChatUIKitConstants.calls.ended:r=i?`OUTGOING${a}CALL`:`INCOMING${a}CALL`;break;case n.CometChatUIKitConstants.calls.unanswered:r=i?`UNANSWERED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.cancelled:r=i?`CANCELLED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.rejected:r=i?`REJECTED${a}CALL`:`MISSED${a}CALL`;break;case n.CometChatUIKitConstants.calls.busy:r=i?`UNANSWERED${a}CALL`:`MISSED${a}CALL`;break;default:r=`INCOMING${a}CALL`}return n.localize(r)}function wo(e){const t=Math.floor(e/60),n=Math.floor(e%60),o=Math.floor(60*(e-Math.floor(e)));let r="",s="",i="";return t>0&&(r=`${t}h`),n>0&&(s=`${n}m`),o>=0&&(i=`${o}s`),`${r} ${s} ${i}`}function fo(e,t){return{display:"flex",color:t?.callStatusTextColor||e.palette.getAccent600(),font:t?.callStatusTextFont||n.fontHelper(e.typography.caption1),alignItems:"center",gap:"4px"}}function Do(e,t){return new o.AvatarStyle({borderRadius:t?.borderRadius||"24px",width:t?.width||"36px",height:t?.height||"36px",border:t?.border||"none",backgroundColor:t?.backgroundColor||e.palette.getAccent700(),nameTextColor:t?.nameTextColor||e.palette.getAccent900(),backgroundSize:t?.backgroundSize||"cover",nameTextFont:t?.nameTextFont||n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:t?.outerViewBorderWidth||"",outerViewBorderSpacing:t?.outerViewBorderSpacing||"",outerViewBorderColor:t?.outerViewBorderColor||"",outerViewBorderRadius:t?.outerViewBorderRadius||""})}function Eo(e,t,r,s){const i=xo(e,s)?t.palette.getError():t.palette.getAccent();return new o.ListItemStyle({height:r?.height||"50px",width:r?.width||"100%",background:r?.background||t.palette.getBackground(),activeBackground:r?.activeBackground||t.palette.getAccent100(),borderRadius:r?.borderRadius||"0",titleFont:r?.titleFont||n.fontHelper(t.typography.title2),titleColor:r?.titleColor||i,border:r?.border||"none",separatorColor:r?.separatorColor||t.palette.getAccent200(),hoverBackground:r?.hoverBackground||t.palette.getAccent50(),padding:r?.padding||"0"})}function vo(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function Io(e,t){return new r.ListStyle({height:"100%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent(),emptyStateTextColor:t?.emptyStateTextColor||e.palette.getAccent600(),emptyStateTextFont:t?.emptyStateTextFont||n.fontHelper(e.typography.caption1),errorStateTextColor:t?.errorStateTextColor||e.palette.getAccent600(),errorStateTextFont:t?.errorStateTextFont||n.fontHelper(e.typography.caption1),loadingIconTint:t?.loadingIconTint||e.palette.getAccent600()})}function So(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),background:"transparent"}}function Fo(e,t,n,o){let r;return r=xo(e,o)?n?.missedCallIconTint||t.palette.getAccent600():e.getInitiator().getUid()===o.getUid()?n?.outgoingCallIconTint||t.palette.getAccent600():n?.incomingCallIconTint||t.palette.getAccent600(),{height:"18px",width:"18px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:r}}function ko(e,t){return{height:"20px",width:"20px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.infoIconTint||e.palette.getPrimary()}}function To(e,t){return{textFont:t?.dateSeparatorTextFont||n.fontHelper(e.typography.text2),textColor:t?.dateSeparatorTextColor||e.palette.getAccent700(),background:"transparent",padding:"0"}}const Mo={title:n.localize("CALLS"),titleAlignment:n.TitleAlignment.left,listItemView:null,subtitleView:null,tailView:null,emptyStateView:null,errorStateView:null,loadingStateView:null,emptyStateText:n.localize("NO_CALLS_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",incomingAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34856%209.89458C4.64141%2010.1873%205.03856%2010.3518%205.45265%2010.3518C5.86675%2010.3518%206.2639%2010.1873%206.55675%209.89458L7.38496%209.06639C7.45752%208.99388%207.51508%208.90778%207.55435%208.81301C7.59362%208.71825%207.61383%208.61667%207.61383%208.51409C7.61383%208.41151%207.59362%208.30993%207.55435%208.21517C7.51508%208.1204%207.45752%208.0343%207.38496%207.96179L5.77488%206.35123C5.69603%206.27169%205.601%206.21005%205.49623%206.17048C5.39146%206.13091%205.27941%206.11434%205.16767%206.1219C5.05593%206.12945%204.94713%206.16095%204.84864%206.21426C4.75015%206.26757%204.66428%206.34145%204.59686%206.43087C2.90974%208.72127%203.93211%2011.1335%206.00548%2013.2073C8.07886%2015.2812%2010.4927%2016.3025%2012.7847%2014.6154C12.8739%2014.5477%2012.9475%2014.4617%2013.0005%2014.3631C13.0536%2014.2645%2013.0848%2014.1556%2013.092%2014.0439C13.0993%2013.9322%2013.0824%2013.8202%2013.0426%2013.7155C13.0028%2013.6109%2012.9409%2013.516%2012.8612%2013.4374L11.2506%2011.8268C11.1781%2011.7543%2011.092%2011.6967%2010.9972%2011.6574C10.9025%2011.6182%2010.8009%2011.598%2010.6983%2011.598C10.5957%2011.598%2010.4941%2011.6182%2010.3994%2011.6574C10.3046%2011.6967%2010.2185%2011.7543%2010.146%2011.8268L9.31778%2012.655C9.17274%2012.8%209.05768%2012.9722%208.97918%2013.1617C8.90068%2013.3512%208.86028%2013.5543%208.86028%2013.7594C8.86028%2013.9645%208.90068%2014.1676%208.97918%2014.357C9.05768%2014.5465%209.17274%2014.7187%209.31778%2014.8637L9.89039%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.3872%208.82531L15.4626%203.75%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.5105%208.82517H10.3872V5.7019%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",incomingVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.43018%2015.8583C2.56723%2015.8583%201.86768%2015.1588%201.86768%2014.2958V5.70435C1.86768%204.8414%202.56723%204.14185%203.43018%204.14185H12.1884C13.0513%204.14185%2013.7509%204.8414%2013.7509%205.70435V14.2958C13.7509%2015.1588%2013.0513%2015.8583%2012.1884%2015.8583H3.43018Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M14.1571%2011.9541C13.9068%2011.817%2013.7512%2011.5543%2013.7512%2011.2689V8.73246C13.7512%208.44707%2013.9068%208.18437%2014.1571%208.04726L16.9754%206.50343C17.4961%206.21822%2018.132%206.59497%2018.132%207.18861V12.8128C18.132%2013.4064%2017.4961%2013.7832%2016.9754%2013.4979L14.1571%2011.9541Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.41384%2012.5186H5.1875V9.29224%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M10.3776%207.31396L5.28149%2012.41%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",outgoingAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34854%209.89458C4.64139%2010.1873%205.03853%2010.3518%205.45262%2010.3518C5.86671%2010.3518%206.26385%2010.1873%206.5567%209.89458L7.38488%209.06639C7.45744%208.99388%207.515%208.90778%207.55427%208.81301C7.59354%208.71825%207.61376%208.61667%207.61376%208.51409C7.61376%208.41151%207.59354%208.30993%207.55427%208.21517C7.515%208.1204%207.45744%208.0343%207.38488%207.96179L5.77484%206.35123C5.69599%206.27169%205.60096%206.21005%205.4962%206.17048C5.39143%206.13091%205.27938%206.11434%205.16764%206.1219C5.05591%206.12945%204.9471%206.16095%204.84862%206.21426C4.75013%206.26757%204.66426%206.34145%204.59684%206.43087C2.90976%208.72127%203.93211%2011.1335%206.00544%2013.2073C8.07877%2015.2812%2010.4925%2016.3025%2012.7845%2014.6154C12.8737%2014.5477%2012.9473%2014.4617%2013.0003%2014.3631C13.0534%2014.2645%2013.0846%2014.1556%2013.0918%2014.0439C13.0991%2013.9322%2013.0822%2013.8202%2013.0424%2013.7155C13.0026%2013.6109%2012.9407%2013.516%2012.861%2013.4374L11.2504%2011.8268C11.1779%2011.7543%2011.0918%2011.6967%2010.9971%2011.6574C10.9023%2011.6182%2010.8007%2011.598%2010.6982%2011.598C10.5956%2011.598%2010.494%2011.6182%2010.3992%2011.6574C10.3045%2011.6967%2010.2184%2011.7543%2010.1459%2011.8268L9.31767%2012.655C9.17263%2012.8%209.05757%2012.9722%208.97908%2013.1617C8.90058%2013.3512%208.86018%2013.5543%208.86018%2013.7594C8.86018%2013.9645%208.90058%2014.1676%208.97908%2014.357C9.05757%2014.5465%209.17263%2014.7187%209.31767%2014.8637L9.89027%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M15.4623%203.75L10.387%208.82531%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M12.3391%203.75H15.4624V6.87327%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",outgoingVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.43018%2015.8583C2.56723%2015.8583%201.86768%2015.1588%201.86768%2014.2958V5.70435C1.86768%204.8414%202.56723%204.14185%203.43018%204.14185H12.1884C13.0513%204.14185%2013.7509%204.8414%2013.7509%205.70435V14.2958C13.7509%2015.1588%2013.0513%2015.8583%2012.1884%2015.8583H3.43018Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M14.1571%2011.9541C13.9068%2011.817%2013.7512%2011.5543%2013.7512%2011.2689V8.73246C13.7512%208.44707%2013.9068%208.18437%2014.1571%208.04726L16.9754%206.50343C17.4961%206.21822%2018.132%206.59497%2018.132%207.18861V12.8128C18.132%2013.4064%2017.4961%2013.7832%2016.9754%2013.4979L14.1571%2011.9541Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M7.15111%207.31395H10.3774V10.5403%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M5.18738%2012.5186L10.2834%207.42248%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",missedAudioCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M3.78531%209.33083L4.34854%209.89458C4.64139%2010.1873%205.03853%2010.3518%205.45262%2010.3518C5.86671%2010.3518%206.26385%2010.1873%206.5567%209.89458L7.38488%209.06639C7.45744%208.99388%207.515%208.90778%207.55427%208.81301C7.59354%208.71825%207.61376%208.61667%207.61376%208.51409C7.61376%208.41151%207.59354%208.30993%207.55427%208.21517C7.515%208.1204%207.45744%208.0343%207.38488%207.96179L5.77484%206.35123C5.69599%206.27169%205.60096%206.21005%205.4962%206.17048C5.39143%206.13091%205.27938%206.11434%205.16764%206.1219C5.05591%206.12945%204.9471%206.16095%204.84862%206.21426C4.75013%206.26757%204.66426%206.34145%204.59684%206.43087C2.90976%208.72127%203.93211%2011.1335%206.00544%2013.2073C8.07877%2015.2812%2010.4925%2016.3025%2012.7845%2014.6154C12.8737%2014.5477%2012.9473%2014.4617%2013.0003%2014.3631C13.0534%2014.2645%2013.0846%2014.1556%2013.0918%2014.0439C13.0991%2013.9322%2013.0822%2013.8202%2013.0424%2013.7155C13.0026%2013.6109%2012.9407%2013.516%2012.861%2013.4374L11.2504%2011.8268C11.1779%2011.7543%2011.0918%2011.6967%2010.9971%2011.6574C10.9023%2011.6182%2010.8007%2011.598%2010.6982%2011.598C10.5956%2011.598%2010.494%2011.6182%2010.3992%2011.6574C10.3045%2011.6967%2010.2184%2011.7543%2010.1459%2011.8268L9.31767%2012.655C9.17263%2012.8%209.05757%2012.9722%208.97908%2013.1617C8.90058%2013.3512%208.86018%2013.5543%208.86018%2013.7594C8.86018%2013.9645%208.90058%2014.1676%208.97908%2014.357C9.05757%2014.5465%209.17263%2014.7187%209.31767%2014.8637L9.89027%2015.4332%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M15.4622%204.53082L12.3389%207.65409L8.43481%203.75%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.43481%206.09245V3.75H10.7773%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",missedVideoCallIconUrl:"data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M14.1573%2011.9539C13.907%2011.8167%2013.7515%2011.5541%2013.7515%2011.2687V8.73221C13.7515%208.44682%2013.907%208.18413%2014.1573%208.04701L16.9757%206.50318C17.4963%206.21798%2018.1322%206.59473%2018.1322%207.18836V12.8125C18.1322%2013.4061%2017.4963%2013.7829%2016.9757%2013.4977L14.1573%2011.9539Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M11.3834%209.1351L8.17601%2012.3425L4.16675%208.33325%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.16675%2010.7388V8.33325H6.5723%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M3.22925%2015.883C2.3663%2015.883%201.66675%2015.1834%201.66675%2014.3205V5.729C1.66675%204.86606%202.3663%204.1665%203.22925%204.1665H11.9874C12.8503%204.1665%2013.5499%204.86606%2013.5499%205.729V14.3205C13.5499%2015.1834%2012.8503%2015.883%2011.9874%2015.883H3.22925Z%22%20stroke%3D%22black%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",infoIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",callLogRequestBuilder:void 0,onItemClick:void 0,onInfoClick:void 0,onError:e=>{console.log(e)},hideSeparator:!0,activeCall:void 0,datePattern:n.DatePatterns.time,dateSeparatorPattern:n.DatePatterns.DayDate,callLogsStyle:{},avatarStyle:{},listItemStyle:{},outgoingCallConfiguration:{}},Bo=e=>{const{title:i,titleAlignment:a,listItemView:l,subtitleView:c,tailView:C,errorStateView:g,emptyStateView:u,loadingStateView:p,emptyStateText:h,errorStateText:m,loadingIconURL:A,incomingAudioCallIconUrl:x,incomingVideoCallIconUrl:b,outgoingAudioCallIconUrl:y,outgoingVideoCallIconUrl:w,missedAudioCallIconUrl:f,missedVideoCallIconUrl:D,infoIconUrl:E,activeCall:v,callLogRequestBuilder:I,onItemClick:S,onInfoClick:F,onError:T,hideSeparator:B,datePattern:L,dateSeparatorPattern:R,callLogsStyle:P,avatarStyle:O,listItemStyle:j,outgoingCallConfiguration:V}={...Mo,...e},{theme:G}=t.useContext(U),[H,Q]=t.useState([]),[N,K]=t.useState(null),[z,Y]=t.useState(n.States.loading),[_,W]=t.useState(!1),[Z,X]=t.useState(void 0),[q,$]=t.useState(void 0),[ee,te]=t.useState(null),[ne,oe]=t.useState(!1),re="callLogsScreen_"+(new Date).getTime(),se=t.useRef(null),ie=t.useRef(void 0);ie.current=Z;const ae=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)T?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);T?.(n)}},[T]),le=t.useCallback(()=>{try{if(I)return I.build();{const e=N.getAuthToken();return(new r.CometChatUIKitCalls.CallLogRequestBuilder).setLimit(30).setCallCategory("call").setAuthToken(e).build()}}catch(e){ae(e)}},[I,N,ae]),ce=t.useCallback(async()=>{try{return await(se?.current?.fetchNext())}catch(e){throw ae(e),e}},[se,ae]),Ce=t.useCallback(async()=>{try{const e=await ce();e&&e.length?(Q(t=>[...t,...e]),Y(n.States.loaded)):0===H.length&&Y(n.States.empty)}catch(e){0===H.length&&Y(n.States.error),ae(e)}},[ce,H,Q,Y,ae]),de=t.useCallback(()=>{s.CometChat.rejectCall(q?.getSessionId(),n.CometChatUIKitConstants.calls.cancelled).then(()=>{$(void 0),W(!1),n.CometChatMessageEvents.ccMessageSent.next({message:q,status:n.MessageStatus.success})}).catch(e=>{W(!1),ae(e)})},[q,$,W,ae]),ge=t.useCallback((e,t)=>{const o=n.CometChatUIKitConstants.MessageReceiverType.user,r=t;let i="";i=e===s.CometChat.CALL_TYPE.AUDIO?s.CometChat.CALL_TYPE.AUDIO:s.CometChat.CALL_TYPE.VIDEO;const a=new s.CometChat.Call(r,i,o);s.CometChat.initiateCall(a).then(e=>{X(e),$(e),W(!0),n.CometChatMessageEvents.ccMessageSent.next({message:e,status:n.MessageStatus.inprogress})}).catch(e=>{ae(e)})},[$,W,ae,X]),ue=t.useCallback(e=>{try{if(S)S(e);else{const t=bo(e,N);t.uid&&ge(e?.type,t.uid)}}catch(e){ae(e)}},[S,N,ge,ae]),pe=t.useCallback(e=>{try{F&&F(e)}catch(e){ae(e)}},[F,ae]),he=t.useCallback(e=>{try{return!(!v||v.getSessionID()!==e.getSessionID())}catch(e){return ae(e),!1}},[v,ae]),me=t.useCallback(e=>{try{const t=xo(e,N);let n,o=e.getType();return o=e.getType()===s.CometChat.CALL_TYPE.AUDIO?s.CometChat.CALL_TYPE.AUDIO:s.CometChat.CALL_TYPE.VIDEO,n=t?o===s.CometChat.CALL_TYPE.AUDIO?f:D:Ao(e,N)?o===s.CometChat.CALL_TYPE.AUDIO?y:w:o===s.CometChat.CALL_TYPE.AUDIO?x:b,n}catch(e){ae(e)}},[N,f,D,y,w,x,b,ae]),Ae=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){ae(e)}},[ae]),xe=t.useCallback((e,t)=>{try{return 0===t||Ae(H[t-1]?.getInitiatedAt(),e.getInitiatedAt())?d.jsx("div",{style:{margin:"5px 0",display:"flex"},children:d.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:R,dateStyle:JSON.stringify(To(G,P))})}):null}catch(e){return ae(e),null}},[R,P,Ae,H,G,ae]),be=t.useCallback(()=>new r.OutgoingCallStyle({background:V?.outgoingCallStyle?.background||G.palette.getBackground(),border:V?.outgoingCallStyle?.border||"none",borderRadius:V?.outgoingCallStyle?.borderRadius||"8px",declineButtonIconBackground:V?.outgoingCallStyle?.declineButtonIconBackground||G.palette.getError(),declineButtonIconTint:V?.outgoingCallStyle?.declineButtonIconTint||G.palette.getBackground(),declineButtonTextColor:V?.outgoingCallStyle?.declineButtonTextColor||G.palette.getAccent600(),declineButtonTextFont:V?.outgoingCallStyle?.declineButtonTextFont||n.fontHelper(G.typography.caption2),height:V?.outgoingCallStyle?.height||"580px",width:V?.outgoingCallStyle?.width||"320px",subtitleTextColor:V?.outgoingCallStyle?.subtitleTextColor||G.palette.getAccent600(),subtitleTextFont:V?.outgoingCallStyle?.subtitleTextFont||n.fontHelper(G.typography.subtitle1),titleTextColor:V?.outgoingCallStyle?.titleTextColor||G.palette.getAccent(),titleTextFont:V?.outgoingCallStyle?.titleTextFont||n.fontHelper(G.typography.heading)}),[V,G]),ye=t.useCallback(()=>new o.CallscreenStyle({maxHeight:"100%",maxWidth:"100%",border:"none",borderRadius:"0",background:"#1c2226",minHeight:"400px",minWidth:"400px",minimizeIconTint:G.palette.getAccent900(),maximizeIconTint:G.palette.getAccent900()}),[G]),we=t.useCallback(e=>{W(!1),$(e),te(e?.getSessionId()),oe(!0)},[W,$,te,oe]),fe=t.useCallback(()=>{try{s.CometChat.addCallListener(re,new s.CometChat.CallListener({onOutgoingCallRejected:e=>{ie.current&&e.getSessionId()==ie.current.getSessionId()&&($(void 0),W(!1),oe(!1),X(void 0))},onOutgoingCallAccepted:e=>{ie.current&&e.getSessionId()==ie.current.getSessionId()&&($(void 0),we(e),W(!1),X(void 0))}}))}catch(e){ae(e)}},[re,we,ae]),De=t.useCallback(()=>{oe(!1),te(null),$(void 0)},[oe,te,$]),Ee=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallEnded.subscribe(()=>{De()});return()=>{try{e?.unsubscribe()}catch(e){ae(e)}}}catch(e){ae(e)}},[De,ae]),ve=t.useCallback(()=>{try{s.CometChat.removeCallListener(re)}catch(e){ae(e)}},[re,ae]),Ie=t.useCallback(e=>null!==c?d.jsx(d.Fragment,{children:c(e)}):d.jsx(d.Fragment,{children:d.jsxs("div",{style:fo(G,P),children:[d.jsx("cometchat-icon",{URL:me(e),buttonStyle:JSON.stringify(Fo(e,G,P,N))}),yo(e,N)]})}),[c,P,N,G,me]),Se=t.useCallback(e=>null!==C?d.jsx(d.Fragment,{children:C(e)}):d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",marginRight:"5px"},children:[d.jsx("cometchat-date",{dateStyle:JSON.stringify(So(G,P)),pattern:L,timestamp:e?.getInitiatedAt()}),F?d.jsx(J,{iconURL:E,buttonStyle:ko(G,P),onClick:()=>pe(e)}):null]})}),[C,G,P,L,F,E,pe]),Fe=t.useMemo(()=>function(e,t){return l?l(e):d.jsxs(d.Fragment,{children:[xe(e,t)?xe(e,t):null,d.jsx(M,{title:bo(e,N)?.getName(),avatarURL:bo(e,N)?.avatar||bo(e,N)?.icon,avatarName:bo(e,N)?.getName(),listItemStyle:Eo(e,G,j,N),avatarStyle:Do(G,O),hideSeparator:B,loadingIconURL:A,isActive:he(e),onClick:t=>ue?.(e),subtitleView:Ie(e),tailView:Se(e)})]})},[l,xe,N,G,j,O,B,A,he,Ie,Se,ue]);return function(e,n,o,r,s,i,a,l,c){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)},e=>{c(e)})},[n,c]),t.useEffect(()=>{let t;return e&&(t=a?.(),o.current=r(),s?.(),i?.(),a?.()),()=>{l?.(),t?.()}},[e])}(N,K,se,le,Ce,fe,Ee,ve,ae),d.jsxs("div",{style:vo(G,P),children:[_?d.jsx("cometchat-backdrop",{children:d.jsx(nn,{onCloseClicked:V?.onDeclineButtonClicked||de,outgoingCallStyle:be(),call:q,avatarStyle:V?.avatarStyle,customSoundForCalls:V?.customSoundForCalls,customView:V?.customView,declineButtonIconURL:V?.declineButtonIconURL,disableSoundForCalls:V?.disableSoundForCalls,onError:V?.onError})}):null,ne&&!v?d.jsx(Qt,{sessionID:ee,callWorkflow:n.CallWorkflow.defaultCalling,ongoingCallStyle:ye()}):null,d.jsx(k,{hideSearch:!0,list:H,onScrolledToBottom:Ce,listItemKey:"getSessionID",listItem:Fe,title:i,titleAlignment:a,loadingIconURL:A,emptyStateText:h,errorStateText:m,emptyStateView:u,errorStateView:g,loadingView:p,listStyle:Io(G,P),state:z,showSectionHeader:!1})]})};function Lo(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function Uo(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none",position:"relative"}}function Ro(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}function Po(e,t){const{backgroundColor:r,titleColor:s,titleFont:i}=t;return new o.ListItemStyle({background:r||"transparent",activeBackground:r||"transparent",border:"none",hoverBackground:r||"transparent",titleColor:s||e.palette.getAccent(),borderRadius:"0",titleFont:i||n.fontHelper(e.typography.text1),separatorColor:e.palette.getAccent200()})}class Oo{static getDefaultCallTemplate(e,t,n){return[this.getPrimaryDetailsTemplate(e,t,n),this.getSecondaryDetailsTemplate(e,t,n)]}static getCallButtons(e,t){return d.jsx(sn,{user:e,group:t,callButtonsStyle:{width:"100%",height:"100%",border:"none",borderRadius:"0",background:"transparent",buttonPadding:"8px 32px",buttonBackground:"RGBA(20, 20, 20, 0.04)",buttonBorder:"0 4px",buttonBorderRadius:"10px"},voiceCallIconText:n.localize("AUDIO_CALL"),videoCallIconText:n.localize("VIDEO_CALL")},"callbuttons")}static getPrimaryDetailsTemplate(e,t,o){return new n.CometChatCallDetailsTemplate({id:"callControls",hideSectionSeparator:!0,options:(n,r)=>this.getPrimaryOptions(n??void 0,r??void 0,e??void 0,t??void 0,o??void 0)})}static getSecondaryDetailsTemplate(e,t,o){return new n.CometChatCallDetailsTemplate({id:"callOptions",hideSectionSeparator:!0,options:()=>this.getSecondaryOptions(e??void 0,o??void 0)})}static getPrimaryOptions(e,t,o,r,s){let i=[];return e&&i.push(new n.CometChatCallDetailsOption({id:"callControls",customView:this.getCallButtons(e,t)})),i.push(new n.CometChatCallDetailsOption({id:"callStatus",customView:this.generateCallDetailsHTML(o,o?.getInitiatedAt(),r,s)})),i}static getSecondaryOptions(e,t){const o=[];if(e?.participants&&e?.participants.length>0){const r=(e?.participants||[])?.length;o.push(new n.CometChatCallDetailsOption({id:"participants",customView:this.generateCallOptionsHTML("Participants",r,t)}))}if(e?.hasRecording){const r=(e?.getRecordings()||[])?.length;o.push(new n.CometChatCallDetailsOption({id:"recordings",customView:this.generateCallOptionsHTML("Recordings",r,t)}))}return o.push(new n.CometChatCallDetailsOption({id:"callHistory",customView:this.generateCallOptionsHTML("History",0,t)})),o}static generateCallDetailsHTML(e,t,r,s){const i=new o.ListItemStyle({height:"auto",width:"100%",background:s?.palette?.getAccent100(),hoverBackground:s?.palette?.getAccent100(),borderRadius:"8px",border:"none",padding:"10px"}),a=new o.DateStyle({textColor:s?.palette?.getAccent600(),textFont:n.fontHelper(s?.typography?.text3),padding:"0px",background:"transparent"}),l=new o.DateStyle({textColor:s?.palette?.getAccent600(),textFont:n.fontHelper(s?.typography?.subtitle2),padding:"0px",background:"transparent"}),c=yo(e,r,!0),C=d.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[d.jsx("cometchat-date",{dateStyle:JSON.stringify(a),pattern:n.DatePatterns.DayDate,timestamp:t}),d.jsxs("div",{style:{display:"flex",gap:"5px"},children:[d.jsx("cometchat-date",{dateStyle:JSON.stringify(l),pattern:n.DatePatterns.time,timestamp:t}),d.jsx("div",{style:{font:n.fontHelper(s?.typography?.text2),color:s.palette.getAccent()},children:c})]})]}),g=d.jsx("div",{style:{font:n.fontHelper(s?.typography?.text3),color:s?.palette?.getAccent600(),marginRight:"15px",marginTop:"15px"},children:wo(e?.getTotalDurationInMinutes())});return d.jsx("div",{style:{marginTop:"25px",marginBottom:"25px",width:"100%",paddingLeft:"10px",paddingRight:"10px",boxSizing:"border-box"},children:d.jsx(M,{hideSeparator:!0,listItemStyle:i,subtitleView:C,tailView:g},t)})}static generateCallOptionsHTML(e,t,o){const r={iconHeight:"18px",iconWidth:"18px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:o.palette.getAccent600()},s={margin:"10px",marginBottom:"5px",padding:"10px",boxSizing:"border-box",background:o?.palette?.getAccent100(),borderRadius:"8px",display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",width:"100%"},i={font:n.fontHelper(o?.typography?.text2),color:o?.palette?.getAccent()},a={display:"flex",alignItems:"center",gap:"5px",font:n.fontHelper(o?.typography?.text3),color:o?.palette?.getAccent600()};return d.jsxs("div",{style:s,children:[d.jsx("span",{style:i,children:e}),d.jsxs("span",{style:a,children:[t>0?t:"",d.jsx(J,{iconURL:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20height%3D%2224px%22%20width%3D%2224px%22%3E%3Cg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20transform%3D%22matrix%28-1%200%200%20-1%2024%2024%29%22%3E%3Cg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20transform%3D%22matrix%280%201%20-1%200%2024%20-0%29%22%3E%3Ctitle%3EIcons%2F24%2FClose%20Chat%3C%2Ftitle%3E%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cg%20id%3D%22Icons%2F24%2FClose-Chat%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.700000%2C%208.000000%29%22%3E%3Cpath%20d%3D%22M20.625%2C0%20L10.7983333%2C9.82575%20C10.669546%2C9.9547209%2010.4947627%2C10.0271915%2010.3125%2C10.0271915%20C10.1302373%2C10.0271915%209.95545401%2C9.9547209%209.82666667%2C9.82575%20L0%2C0%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E",buttonStyle:r})]})]})}}function jo(e,t){return{background:"transparent",textColor:t?.dateTextColor||e.palette.getAccent600(),textFont:t?.dateTextFont||n.fontHelper(e.typography.subtitle2)}}function Vo(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function Go(e,t){return{font:t?.callStatusTextFont||n.fontHelper(e.typography.text2),color:t?.callStatusTextColor||e.palette.getAccent()}}function Ho(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function Qo(e,t){return new r.ListStyle({height:"90%",emptyStateTextColor:t?.emptyStateTextColor||e.palette.getAccent600(),emptyStateTextFont:t?.emptyStateTextFont||n.fontHelper(e.typography.caption1),errorStateTextColor:t?.errorStateTextColor||e.palette.getAccent600(),errorStateTextFont:t?.errorStateTextFont||n.fontHelper(e.typography.caption1),loadingIconTint:t?.loadingIconTint||e.palette.getAccent600()})}function No(e,t){return{font:t?.callDurationTextColor||n.fontHelper(e.typography.caption1),color:t?.callDurationTextColor||e.palette.getAccent500()}}function Ko(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function zo(e,t){return{textFont:t?.dateSeparatorTextFont||n.fontHelper(e.typography.text3),textColor:t?.dateSeparatorTextColor||e.palette.getAccent700(),background:"transparent"}}function Jo(e,t){return{height:"1px",width:"100%",background:t?.dividerColor||e.palette.getAccent200()}}function Yo(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const _o={title:n.localize("CALL_HISTORY"),emptyStateText:n.localize("NO_CALLS_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",emptyStateView:null,loadingStateView:null,errorStateView:null,subtitleView:null,tailView:null,callLogRequestBuilder:void 0,callUser:void 0,callGroup:void 0,onItemClick:void 0,onBackClick:void 0,onError:()=>{},datePattern:n.DatePatterns.time,dateSeparatorPattern:n.DatePatterns.DayDate,listItemStyle:{},callLogHistoryStyle:{}},Wo=e=>{const{title:o,emptyStateText:i,errorStateText:a,backIconUrl:l,loadingIconURL:c,emptyStateView:C,errorStateView:g,loadingStateView:u,subtitleView:p,tailView:h,callLogRequestBuilder:m,callUser:A,callGroup:x,onItemClick:b,onBackClick:y,onError:w,datePattern:f,dateSeparatorPattern:D,listItemStyle:E,callLogHistoryStyle:v}={..._o,...e},{theme:I}=t.useContext(U),[S,F]=t.useState([]),[T,B]=t.useState(null),[L,R]=t.useState(n.States.loading),P=t.useRef(null),O=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)w?.(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);w?.(n)}},[w]),j=t.useCallback(()=>{try{let e;if(m)e=m;else{const t=T.getAuthToken()||"";e=(new r.CometChatUIKitCalls.CallLogRequestBuilder).setLimit(30).setCallCategory("call").setAuthToken(t)}return x?e=e.setGuid(x?.getGuid()):A&&(e=e.setUid(A?.getUid())),e.build()}catch(e){O(e)}},[m,x,A,T,O]),V=t.useCallback(async()=>{try{return await(P?.current?.fetchNext())}catch(e){throw O(e),new Error("Error while fetching call list")}},[P,O]),G=t.useCallback(async()=>{try{const e=await V();e&&e.length>0?(F(t=>[...t,...e]),R(n.States.loaded)):0===S.length&&R(n.States.empty)}catch(e){0===S.length&&R(n.States.error),O(e)}},[V,F,R,S,O]),H=t.useCallback(e=>{try{b&&b(e)}catch(e){O(e)}},[b,O]),Q=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){return O(e),!1}},[O]),N=t.useCallback((e,t)=>{try{return 0===t?d.jsx("div",{style:{margin:"4px 0 0 8px"},children:d.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:D,dateStyle:JSON.stringify(zo(I,v))})}):Q(S[t-1]?.getInitiatedAt(),e.getInitiatedAt())?d.jsxs(d.Fragment,{children:[d.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Jo(I,v))}),d.jsx("div",{style:{margin:"4px 0 0 8px"},children:d.jsx("cometchat-date",{timestamp:e.getInitiatedAt(),pattern:D,dateStyle:JSON.stringify(zo(I,v))})})]}):null}catch(e){return O(e),null}},[D,I,v,Q,S,O]),K=t.useCallback(e=>{try{return!!e?.getTotalDurationInMinutes()&&wo(e?.getTotalDurationInMinutes())}catch(e){return O(e),!1}},[O]),z=t.useCallback(e=>p?p(e):d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex"},children:[d.jsx("cometchat-date",{dateStyle:JSON.stringify(jo(I,v)),pattern:f,timestamp:e?.getInitiatedAt()}),d.jsx("div",{style:Go(I,v),children:yo(e,T,!0)})]})}),[p,I,v,f,T]),Y=t.useCallback(e=>h?h(e):d.jsx(d.Fragment,{children:d.jsx("div",{style:No(I,v),children:K(e)?K(e):"00:00"})}),[h,I,v,K]),_=t.useMemo(()=>function(e,t){return d.jsxs(d.Fragment,{children:[N(e,t)?d.jsx("div",{children:N(e,t)}):null,d.jsx(M,{loadingIconURL:c,listItemStyle:Vo(I,E),onClick:t=>H?.(e),subtitleView:z(e),tailView:Y(e),hideSeparator:!0})]})},[N,c,I,E,z,Y,H]);return function(e,n,o,r,s,i){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{e&&(o.current=r(),s?.())},[e])}(T,B,P,j,G,O),d.jsx(d.Fragment,{children:d.jsxs("div",{style:Ho(I,v),children:[d.jsxs("div",{style:{display:"flex",padding:"10px 30px",alignItems:"center",marginBottom:"10px"},children:[y?d.jsx("div",{style:{marginRight:"15px"},children:d.jsx(J,{iconURL:l,buttonStyle:Ko(I,v),onClick:y?.()})}):null,d.jsx("div",{style:Yo(I,v),children:o})]}),d.jsx(k,{hideSearch:!0,list:S,onScrolledToBottom:G,listItemKey:"getSessionID",listItem:_,loadingIconURL:c,emptyStateText:i,errorStateText:a,loadingView:u,emptyStateView:C,errorStateView:g,listStyle:Qo(I,v),state:L,showSectionHeader:!1})]})})};function Zo(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function Xo(e,t){return new r.ListStyle({height:"90%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent()})}function qo(e,t){return new o.AvatarStyle({borderRadius:t?.borderRadius||"24px",width:t?.width||"36px",height:t?.height||"36px",border:t?.border||"none",backgroundColor:t?.backgroundColor||e.palette.getAccent700(),nameTextColor:t?.nameTextColor||e.palette.getAccent900(),backgroundSize:t?.backgroundSize||"cover",nameTextFont:t?.nameTextFont||n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:t?.outerViewBorderWidth||"",outerViewBorderSpacing:t?.outerViewBorderSpacing||"",outerViewBorderColor:t?.outerViewBorderColor||"",outerViewBorderRadius:t?.outerViewBorderRadius||""})}function $o(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",titleFont:t?.titleFont||n.fontHelper(e.typography.title2),titleColor:t?.titleColor||e.palette.getAccent(),border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function er(e,t){return{display:"flex",color:t?.callStatusColor||e.palette.getAccent600(),font:t?.callStatusFont||n.fontHelper(e.typography.caption1)}}function tr(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),font:t?.dateTextFont||n.fontHelper(e.typography.caption1),color:t?.dateTextColor||e.palette.getAccent500(),background:"transparent",padding:"3px 10px"}}function nr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function or(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const rr={title:n.localize("PARTICIPANTS"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",call:void 0,datePattern:n.DatePatterns.time,avatarStyle:{},listItemStyle:{},callLogParticipantsStyle:{},listItemView:null,subtitleView:null,tailView:null,onBackClick:void 0,onItemClick:void 0},sr=e=>{const{title:o,backIconUrl:r,call:s,datePattern:i,avatarStyle:a,listItemStyle:l,callLogParticipantsStyle:c,listItemView:C,subtitleView:g,tailView:u,onBackClick:p,onItemClick:h}={...rr,...e},{theme:m}=t.useContext(U),A=t.useCallback(e=>{h&&h(e)},[h]),x=t.useCallback(()=>s?.getParticipants(),[s]),b=t.useCallback(()=>s?.getInitiatedAt(),[s]),y=e=>e?.getHasJoined()||e?.getJoinedAt()?wo(e?.getTotalDurationInMinutes()):wo(0),w=t.useCallback(e=>g?g(e):d.jsx(d.Fragment,{children:d.jsx("div",{style:er(m,c),children:y(e)})}),[g,m,c]),f=t.useCallback(e=>u?u(e):d.jsx(d.Fragment,{children:d.jsx("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:d.jsx("cometchat-date",{dateStyle:JSON.stringify(tr(m,c)),pattern:i,timestamp:b()})})}),[u,m,c,i,b]),D=t.useMemo(()=>function(e,t){return C?C(e):d.jsx(d.Fragment,{children:d.jsx(M,{title:e?.getName(),avatarURL:e?.getAvatar(),avatarName:e?.getName(),listItemStyle:$o(m,l),avatarStyle:qo(m,a),hideSeparator:!0,onClick:t=>A?.(e),subtitleView:w(e),tailView:f(e)})})},[C,m,l,a,w,f,A]);return d.jsx(d.Fragment,{children:d.jsxs("div",{style:nr(m,c),children:[d.jsxs("div",{style:{display:"flex",padding:"10px 20px",alignItems:"center",marginBottom:"10px"},children:[p?d.jsx("div",{style:{marginRight:"15px"},children:d.jsx(J,{iconURL:r,buttonStyle:Zo(m,c),onClick:p?.()})}):null,d.jsx("div",{style:or(m,c),children:o})]}),d.jsx(k,{hideSearch:!0,list:x()||[],listItem:D,listItemKey:"getUid",listStyle:Xo(m,c),state:n.States.loaded,showSectionHeader:!1})]})})};function ir(e,t){return new r.ListStyle({height:"90%",titleTextFont:t?.titleFont||n.fontHelper(e.typography.title1),titleTextColor:t?.titleColor||e.palette.getAccent()})}function ar(e,t){return new o.ListItemStyle({height:t?.height||"45px",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),activeBackground:t?.activeBackground||e.palette.getAccent100(),borderRadius:t?.borderRadius||"0",titleFont:t?.titleFont||n.fontHelper(e.typography.title2),titleColor:t?.titleColor||e.palette.getAccent(),border:t?.border||"none",separatorColor:t?.separatorColor||e.palette.getAccent200(),hoverBackground:t?.hoverBackground||e.palette.getAccent50(),padding:t?.padding||"0"})}function lr(e,t){return{display:"flex",color:t?.recordingDurationColor||e.palette.getAccent600(),font:t?.recordingDurationFont||n.fontHelper(e.typography.caption1)}}function cr(e,t){return{textColor:t?.dateTextColor||e.palette.getAccent500(),textFont:t?.dateTextFont||n.fontHelper(e.typography.caption1),background:"transparent"}}function Cr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.backIconTint||e.palette.getPrimary()}}function dr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:t?.downloadIconTint||e.palette.getPrimary()}}function gr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),borderRadius:t?.borderRadius||"0",border:t?.border||"none"}}function ur(e,t){return{font:t?.titleFont||n.fontHelper(e.typography.text1),color:t?.titleColor||e.palette.getAccent(),background:"transparent"}}const pr={title:n.localize("RECORDING"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",downloadIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FDownload%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FDownload%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%281.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%227.33333333%2013.2%2011%2016.8666667%2014.6666667%2013.2%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2211%22%20y1%3D%225.86666667%22%20x2%3D%2211%22%20y2%3D%2216.8666667%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C11%20C0%2C17.0751322%204.92486775%2C22%2011%2C22%20C17.0751322%2C22%2022%2C17.0751322%2022%2C11%20C22%2C4.92486775%2017.0751322%2C0%2011%2C0%20C4.92486775%2C0%200%2C4.92486775%200%2C11%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hideDownloadButton:!1,call:void 0,datePattern:n.DatePatterns.time,listItemStyle:{},callLogRecordingsStyle:{},onBackClick:void 0,onItemClick:void 0,onDownloadClick:void 0,listItemView:null,subtitleView:null,tailView:null},hr=e=>{const{title:o,backIconUrl:r,downloadIconUrl:s,hideDownloadButton:i,call:a,datePattern:l,listItemStyle:c,callLogRecordingsStyle:C,onBackClick:g,onItemClick:u,onDownloadClick:p,listItemView:h,subtitleView:m,tailView:A}={...pr,...e},{theme:x}=t.useContext(U),b=t.useCallback(e=>{u&&u(e)},[u]),y=t.useCallback(e=>{var t;p?p(e):(t=e?.getRecordingURL(),fetch(t).then(e=>e.blob()).then(e=>{const t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download="recording.mp4",document.body.appendChild(n),n.click()}).catch(e=>console.error(e)))},[p]),w=t.useCallback(()=>{try{return a?.getRecordings()}catch(e){console.log(e)}},[a]),f=e=>{try{return e?.getStartTime()}catch(e){console.log(e)}},D=e=>{try{return function(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),o=Math.floor(e%3600%60);let r="",s="",i="";return t>0&&(r=`${t}h`),n>0&&(s=`${n}m`),o>=0&&(i=`${o}s`),`${r} ${s} ${i}`}(e?.getDuration())}catch(e){console.log(e)}},E=t.useCallback(e=>m?m(e):d.jsx(d.Fragment,{children:d.jsx("div",{style:lr(x,C),children:D(e)})}),[m,x,C]),v=t.useCallback(e=>A?A(e):d.jsx(d.Fragment,{children:d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"5px"},children:[d.jsx("cometchat-date",{dateStyle:JSON.stringify(cr(x,C)),pattern:l,timestamp:f(e)}),i?null:d.jsx(J,{iconURL:s,buttonStyle:dr(x,C),onClick:()=>y(e)})]})}),[A,x,C,l,i,s,y]),I=t.useMemo(()=>function(e,t){return h?h(e):d.jsx(d.Fragment,{children:d.jsx(M,{title:e?.getRid(),listItemStyle:ar(x,c),hideSeparator:!0,onClick:t=>b?.(e),subtitleView:E(e),tailView:v(e)})})},[h,x,c,E,v,b]);return d.jsx(d.Fragment,{children:d.jsxs("div",{style:gr(x,C),children:[d.jsxs("div",{style:{display:"flex",padding:"10px 20px",alignItems:"center",marginBottom:"10px"},children:[g?d.jsx("div",{style:{marginRight:"15px"},children:d.jsx(J,{iconURL:r,buttonStyle:Cr(x,C),onClick:g?.()})}):null,d.jsx("div",{style:ur(x,C),children:o})]}),d.jsx(k,{hideSearch:!0,list:w()||[],listItem:I,listItemKey:"getRid",listStyle:ir(x,C),state:n.States.loaded,showSectionHeader:!1})]})})};const mr={title:n.localize("CALL_DETAIL"),backIconUrl:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onBackClick:void 0,avatarStyle:{},data:(e,t,n)=>[],callLogHistoryConfiguration:{},callLogParticipantsConfiguration:{},callLogRecordingsConfiguration:{},callLogDetailsStyle:{}},Ar=e=>{const{title:r,backIconUrl:s,call:i,onBackClick:a,avatarStyle:l,data:c,callLogHistoryConfiguration:C,callLogParticipantsConfiguration:g,callLogRecordingsConfiguration:u,callLogDetailsStyle:p}={...mr,...e},{theme:h}=t.useContext(U),[m,A]=t.useState(null),[x,b]=t.useState([]),[y,w]=t.useState(!1),[f,D]=t.useState(!1),[E,v]=t.useState(!1),I=t.useCallback(()=>({...new o.AvatarStyle(S(h)),...l}),[l,h]),S=e=>({borderRadius:"24px",width:"50px",height:"50px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""}),F=t.useCallback(()=>{let e=c?.(i,m,h);e&&e.length||(e=Oo.getDefaultCallTemplate(i,m,h)),b([...e])},[b,i,m,h]),k=t.useCallback(e=>{const{options:t,id:n}=e;let o=[];if(t&&void 0!==n){const e=bo(i,m);o=e?.getUid?t(e,null,n):t(null,e,n)}return o},[i,m]),T=t.useCallback(e=>{if(e?.onClick)e.onClick(i);else switch(e.id){case"participants":w(!0);break;case"recordings":D(!0);break;case"callHistory":v(!0)}},[i,w,D,v]),B=t.useCallback(()=>m&&!y&&!f&&!E,[m,y,f,E]),L=t.useCallback(()=>m&&y&&!f&&!E,[m,y,f,E]),R=t.useCallback(()=>m&&!y&&f&&!E,[m,y,f,E]),P=t.useCallback(()=>m&&!y&&!f&&E,[m,y,f,E]),O=t.useCallback(()=>{w(!1),D(!1),v(!1)},[w,D,v]),j=t.useCallback(()=>{const e=bo(i,m);return e?.getUid?e:void 0},[i,m]),V=t.useCallback(()=>{const e=bo(i,m);return e?.getGuid?e:void 0},[i,m]),G=t.useCallback(()=>d.jsx(d.Fragment,{children:x.map(e=>d.jsxs("div",{children:[k(e).map(t=>{const n={backgroundColor:t.backgroundColor,titleColor:t.titleColor,titleFont:t.titleFont};return d.jsx("div",{children:d.jsx("div",{style:{width:"100%"},className:"cc-call-details__options",children:t.customView?d.jsx("div",{className:"cc-call-details__option-content",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"},onClick:()=>T(t),children:t.customView}):d.jsx(M,{title:t.title,avatarURL:t.iconURL,onClick:()=>T(t),listItemStyle:Po(h,n),hideSeparator:e.hideItemSeparator,avatarStyle:new o.AvatarStyle({backgroundColor:t.iconTint}),id:t.id,tailView:t.tail},t.id)},t?.id)})}),e.title]}))}),[x,k,T]);return function(e,n,o,r){t.useEffect(()=>{Zn.getLoggedinUser().then(e=>{n(e)})},[n]),t.useEffect(()=>{e&&r?.()},[e,o])}(m,A,i,F),d.jsx(d.Fragment,{children:d.jsxs("div",{style:Uo(h,p),children:[B()?d.jsxs("div",{children:[a?d.jsxs("div",{style:{position:"absolute",top:"15px",left:"15px",display:"flex",gap:"8px",justifyContent:"center"},children:[d.jsx(J,{iconURL:s,buttonStyle:Lo(h,p),onClick:a?.()}),d.jsx("div",{style:Ro(h,p),children:r})]}):null,d.jsxs("div",{style:{height:"auto",width:"100%",minHeight:"150px",padding:"16px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",boxSizing:"border-box",gap:"8px"},children:[d.jsx("cometchat-avatar",{avatarStyle:JSON.stringify(I()),image:bo(i,m).avatar,name:bo(i,m).name}),d.jsx("span",{style:((e,t)=>({color:t?.nameTextColor||e.palette.getAccent(),font:t?.nameTextFont||n.fontHelper(e.typography.title1)}))(h,p),children:bo(i,m).name})]}),G()]}):null,L()?d.jsx(sr,{call:i,title:n.localize("PARTICIPANTS"),backIconUrl:g?.backIconUrl||s,avatarStyle:g?.avatarStyle||l,onBackClick:()=>g?.onBackClick||O,onItemClick:g?.onItemClick||void 0,datePattern:g?.datePattern||void 0,listItemStyle:g?.listItemStyle||void 0,callLogParticipantsStyle:g?.callLogParticipantsStyle||void 0,listItemView:g?.listItemView||null,subtitleView:g?.subtitleView||null,tailView:g?.tailView||null}):null,R()?d.jsx(hr,{call:i,title:n.localize("RECORDING"),backIconUrl:u?.backIconUrl||s,onBackClick:()=>u?.onBackClick||O,onItemClick:u?.onItemClick||void 0,datePattern:u?.datePattern||void 0,listItemStyle:u?.listItemStyle||void 0,callLogRecordingsStyle:u?.callLogRecordingsStyle||void 0,downloadIconUrl:u?.downloadIconUrl||void 0,hideDownloadButton:u?.hideDownloadButton||void 0,onDownloadClick:u?.onDownloadClick||void 0,listItemView:u?.listItemView||null,subtitleView:u?.subtitleView||null,tailView:u?.tailView||null}):null,P()?d.jsx(Wo,{callUser:j(),callGroup:V(),title:n.localize("CALL_HISTORY"),backIconUrl:C?.backIconUrl||s,listItemStyle:C?.listItemStyle||void 0,emptyStateView:C?.emptyStateView||null,errorStateView:C?.errorStateView||null,loadingIconURL:C?.loadingIconURL||void 0,loadingStateView:C?.loadingStateView||null,subtitleView:C?.subtitleView||void 0,tailView:C?.tailView||null,callLogRequestBuilder:C?.callLogRequestBuilder||null,onItemClick:C?.onItemClick||void 0,onBackClick:()=>C?.onBackClick||O,datePattern:C?.datePattern||void 0,dateSeparatorPattern:C?.dateSeparatorPattern||void 0,callLogHistoryStyle:C?.callLogHistoryStyle||void 0,onError:C?.onError||void 0}):null]})})};function xr(e,t){return{height:t?.height||"100%",width:t?.width||"100%",border:t?.border||"none",borderRadius:t?.borderRadius||"0px",background:t?.background||e.palette.getBackground(),display:"flex",boxSizing:"border-box",position:"relative"}}function br(e,t){return new o.LabelStyle({background:"transparent",textFont:t?.messageTextFont||n.fontHelper(e.typography.heading),textColor:t?.messageTextColor||e.palette.getAccent700()})}const yr={isMobileView:!1,messageText:n.localize("NO_CALLS_SELECTED"),withDetailsStyle:{},callLogDetailsConfiguration:{},callLogsConfiguration:{}};function wr(e,t){return{position:"relative",width:e?.width||"100%",height:e?.height||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||"none",borderRadius:e?.borderRadius||"0",boxShadow:e?.boxShadow,display:"flex",flexDirection:"column",boxSizing:"border-box",padding:e?.padding||"0",overflow:"hidden"}}function fr(e,t){return new r.UsersStyle({width:"100%",height:"100%",border:"none",borderRadius:"0",background:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.title1),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.title1),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),onlineStatusColor:e?.onlineStatusColor||t.palette.getSuccess(),separatorColor:e?.separatorColor||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent400(),searchBorder:e?.searchBorder||`1px solid ${t.palette.getAccent50()}`,searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent400(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),sectionHeaderTextFont:e?.sectionHeaderTextFont,sectionHeaderTextColor:e?.sectionHeaderTextColor})}function Dr(e,t){return{background:e?.addMembersButtonBackground||t.palette.getPrimary(),buttonTextColor:e?.addMembersButtonTextColor||t.palette.getAccent900(),buttonTextFont:e?.addMembersButtonTextFont||n.fontHelper(t.typography.title2),width:"100%",border:"none",borderRadius:"8px",padding:"16px 0",display:"flex",justifyContent:"center",textAlign:"center"}}function Er(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",left:"19px",top:"19px"}}function vr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",top:"19px",right:"19px"}}var Ir="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",Sr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Fr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",kr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Tr(e){const{backButtonIconURL:o=Fr,showBackButton:i=!1,onBack:a,title:l=n.localize("ADD_MEMBERS"),titleAlignment:c=n.TitleAlignment.center,hideSearch:C=!1,searchIconURL:g=Ir,searchPlaceholder:u=n.localize("SEARCH"),showSectionHeader:p=!1,sectionHeaderField:h="getName",loadingIconURL:A=Sr,loadingStateView:b,emptyStateText:y=n.localize("NO_USERS_FOUND"),emptyStateView:w,errorStateText:f=n.localize("SOMETHING_WRONG"),errorStateView:D,hideError:E=!1,disableUsersPresence:v=!1,hideSeparator:I=!1,onError:S,menus:F,options:k,selectionMode:T=n.SelectionMode.multiple,onSelect:M,usersRequestBuilder:B,searchRequestBuilder:L,listItemView:R,subtitleView:P,group:O,onAddMembersButtonClick:j=null,buttonText:V=n.localize("ADD_MEMBERS"),closeButtonIconURL:G=kr,onClose:H,statusIndicatorStyle:Q,avatarStyle:N,listItemStyle:K,addMembersStyle:z=null}=e,Y=t.useRef([]),_=t.useRef(T),W=t.useRef(null),Z=m(M),X=m(O),$=m(a),ee=m(j),te=x(S),{theme:ne}=t.useContext(U),oe=t.useCallback(e=>{const t=new s.CometChat.GroupMember(e.getUid(),n.CometChatUIKitConstants.groupMemberScope.participant);return t.setName(e.getName()),t.setGuid(X.current.getGuid()),t},[X]),re=t.useCallback((e,t)=>{if(Z.current)return Z.current(e,t);if(_.current===n.SelectionMode.single)Y.current=[oe(e)];else if(_.current===n.SelectionMode.multiple){const t=e.getUid(),n=[];let o=!1;for(let e=0;e<Y.current.length;e++){const r=Y.current[e];t===r.getUid()?o=!0:n.push(r)}o||n.push(oe(e)),Y.current=n}},[oe,Z]),se=t.useCallback((e,t,o)=>{const i=new s.CometChat.Action(o.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return i.setAction(n.CometChatUIKitConstants.groupMemberAction.ADDED),i.setActionBy(r.CometChatUIKitUtility.clone(t)),i.setActionFor(r.CometChatUIKitUtility.clone(o)),i.setActionOn(r.CometChatUIKitUtility.clone(e)),i.setReceiver(r.CometChatUIKitUtility.clone(o)),i.setSender(r.CometChatUIKitUtility.clone(t)),i.setConversationId("group_"+o.getGuid()),i.setMuid(r.CometChatUIKitUtility.ID()),i.setMessage(`${t.getName()} added ${e.getUid()}`),i.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),i},[]),ie=t.useCallback(async()=>{if(0!==Y.current.length)try{const e=X.current,t=ee.current;if(t)return t(e.getGuid(),Y.current),void(Y.current=[]);const o=new Set,i=await s.CometChat.addMembersToGroup(e.getGuid(),Y.current,[]);if(i)for(const e in i)"success"===i[e]&&o.add(e);const a=[];for(let e=0;e<Y.current.length;e++){const t=Y.current[e];o.has(t.getUid())&&a.push(t)}const l=W.current;if(l){const t=r.CometChatUIKitUtility.clone(e);t.setMembersCount(e.getMembersCount()+a.length),n.CometChatGroupEvents.ccGroupMemberAdded.next({messages:a.map(e=>se(e,l,t)),usersAdded:a,userAddedIn:t,userAddedBy:r.CometChatUIKitUtility.clone(l)})}Y.current=[],$.current?.()}catch(e){te(e)}},[te,se,X,ee,$]);return function(e){const{loggedInUserRef:n,errorHandler:o,selectionMode:r,selectionModeRef:i,membersToAddRef:a}=e;t.useEffect(()=>{i.current!==r&&(i.current=r,a.current=[])},[r,a,i]),t.useEffect(()=>{(async()=>{try{n.current=await s.CometChat.getLoggedinUser()}catch(e){o(e)}})()},[o,n])}({loggedInUserRef:W,errorHandler:te,selectionMode:T,selectionModeRef:_,membersToAddRef:Y}),d.jsxs("div",{className:"cc-add-members",style:wr(z,ne),children:[d.jsx(q,{title:l,tileAlignment:c,hideSearch:C,searchIconURL:g,searchPlaceholderText:u,showSectionHeader:p,sectionHeaderKey:h,loadingIconURL:A,loadingStateView:b,emptyStateText:y,emptyStateView:w,errorStateText:f,errorStateView:D,hideError:E,disableUsersPresence:v,hideSeparator:I,onError:S,menus:F,options:k,selectionMode:T,onSelect:re,usersRequestBuilder:B,searchRequestBuilder:L,listItemView:R,subtitleView:P,statusIndicatorStyle:Q,avatarStyle:N,listItemStyle:K,usersStyle:fr(z,ne),onItemClick:void 0,activeUser:void 0}),d.jsx("div",{className:"cc-add-members__add-btn-wrapper",style:{padding:"16px",boxSizing:"border-box"},children:d.jsx(J,{text:V,buttonStyle:Dr(z,ne),onClick:ie})}),i?d.jsx(J,{iconURL:o,buttonStyle:Er(z,ne),onClick:a}):null,d.jsx(J,{iconURL:G,buttonStyle:vr(z,ne),onClick:H})]})}function Mr(e,t){return{position:"relative",height:e?.height||"100%",width:e?.width||"100%",background:e?.background||t.palette.getBackground(),border:e?.border||"none",borderRadius:e?.borderRadius||"0",boxShadow:e?.boxShadow||"",padding:e?.padding||"0",boxSizing:"border-box"}}function Br(e,t){return new r.ListStyle({width:"100%",height:"100%",background:"inherit",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),separatorColor:e?.separatorColor||t.palette.getAccent400()})}function Lr(e){return{...e||{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function Ur(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"36px",height:e?.height||"36px",border:e?.border||"none",backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Rr(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function Pr(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.backButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",left:"19px",top:"19px"}}function Or(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary()||"",background:"transparent",position:"absolute",right:"19px",top:"19px"}}function jr(e,t){return{border:"none",borderRadius:"0",buttonIconTint:e?.unbanIconTint||t.palette.getPrimary(),background:"transparent"}}function Vr(e){return new o.MenuListStyle({border:"none",borderRadius:"8px",background:e.palette.getBackground(),moreIconTint:e.palette.getPrimary(),submenuWidth:"100%",submenuHeight:"100%",submenuBorder:`1px solid ${e.palette.getAccent200()}`,submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground()})}var Gr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";class Hr{constructor(e){const{bannedMembersRequestBuilder:t,searchRequestBuilder:n,searchText:o,groupGuid:r,bannedMembersSearchText:i}=e;let a=t||new s.CometChat.BannedMembersRequestBuilder(r).setLimit(30);o&&n?(a=n,a.setSearchKeyword(o)):o&&!n&&t?(a=t,a.setSearchKeyword(o)):!o&&t&&n?(a=t,a.setSearchKeyword(i.current)):o||!t||n?o||t||!n?a.setSearchKeyword(o):a.setSearchKeyword(i.current):(a=t,a.setSearchKeyword(i.current)),this.bannedMembersRequest=a.build()}fetchNext(){return this.bannedMembersRequest.fetchNext()}static createGroupMemberFromUser(e,t){const n=new s.CometChat.GroupMember(e.getUid());return n.setName(e.getName()),n.setAvatar(e.getAvatar()),n.setGuid(t.getGuid()),n}static attachSDKGroupListener(e,t){const n="BannedMembers_GroupListener_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberBanned:(n,o,r,s)=>{e.current.getGuid()===s.getGuid()&&t({type:"addMember",member:Hr.createGroupMemberFromUser(o,e.current)})},onGroupMemberUnbanned:(n,o,r,s)=>{e.current.getGuid()===s.getGuid()&&t({type:"removeBannedMemberIfPresent",bannedMemberUid:o.getUid()})}})),()=>s.CometChat.removeGroupListener(n)}static attachSDKUserListener(e){const t="BannedMembers_UserListener_"+String(Date.now()),n=t=>e({type:"updateMemberStatusIfPresent",member:t});return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:n,onUserOffline:n})),()=>s.CometChat.removeUserListener(t)}}var Qr,Nr="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",Kr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",zr="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Jr(e,t){let n=e;const{type:o}=t;switch(o){case"setSearchText":n={...e,searchText:t.searchText};break;case"setFetchState":n={...e,fetchState:t.fetchState};break;case"appendBannedMembers":{const{bannedMembers:o}=t;0!==o.length&&(n={...e,bannedMembers:[...e.bannedMembers,...o]});break}case"setBannedMembers":n={...e,bannedMembers:t.bannedMembers};break;case"removeBannedMemberIfPresent":{const{bannedMembers:o}=e,r=t.bannedMemberUid,s=o.findIndex(e=>e.getUid()===r);s>-1&&(n={...e,bannedMembers:o.filter((e,t)=>t!==s)});break}case"addMember":n={...e,bannedMembers:[...e.bannedMembers,t.member]};break;case"updateMemberStatusIfPresent":{const{member:o}=t,{bannedMembers:r}=e,s=o.getUid(),i=r.findIndex(e=>e.getUid()===s);i>-1&&(n={...e,bannedMembers:r.map((e,t)=>(t===i&&e.setStatus(o.getStatus()),e))});break}}return n}function Yr(e){const{backButtonIconURL:o=zr,showBackButton:r=!1,onBack:i,menus:a=null,title:l=n.localize("BANNED_MEMBERS"),titleAlignment:c=n.TitleAlignment.center,searchPlaceholder:C=n.localize("SEARCH"),searchIconURL:g=Nr,hideSearch:u=!0,loadingIconURL:p=Kr,loadingStateView:h,emptyStateText:A=n.localize("NO_BANNED_MEMBERS_FOUND"),emptyStateView:y,errorStateText:w=n.localize("SOMETHING_WRONG"),errorStateView:f,onError:D,group:E,bannedMembersRequestBuilder:v=null,searchRequestBuilder:I=null,listItemView:S=null,hideSeparator:F=!1,disableUsersPresence:T=!0,closeButtonIconURL:R=Gr,onClose:P,subtitleView:O=null,options:j=null,selectionMode:V=n.SelectionMode.none,unbanIconURL:G=Gr,onItemClick:H=null,onSelect:Q=null,hideError:N=!1,statusIndicatorStyle:K=null,avatarStyle:z=null,bannedMemberStyle:Y=null,listItemStyle:_=null}=e,[W,X]=t.useReducer(Jr,{searchText:"",bannedMembers:[],fetchState:n.States.loading}),q=t.useRef(null),$=t.useRef(""),ee=x(D),te=m(E),{theme:ne}=t.useContext(U),oe=t.useRef(""),re=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(oe.current="",X({type:"setSearchText",searchText:e}))},[X]),se=t.useCallback(async e=>{if(q.current){X({type:"setFetchState",fetchState:n.States.loading});try{const t=await q.current.fetchNext();if(e!==$.current)return;0!==t.length&&X({type:"appendBannedMembers",bannedMembers:t}),X({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===$.current&&(X({type:"setFetchState",fetchState:n.States.error}),ee(t))}}},[ee,X]),ie=t.useCallback(async e=>{try{await s.CometChat.unbanGroupMember(te.current.getGuid(),e.getUid()),X({type:"removeBannedMemberIfPresent",bannedMemberUid:e.getUid()})}catch(e){ee(e)}},[X,ee,te]);function ae(e){let t=(new Z).getUserStatusVisible(e);return T||t?null:Y?.onlineStatusColor||ne.palette.getSuccess()||"rgb(0, 200, 111)"}function le(e){const t=j?.(e);return t?.length?d.jsx(B,{data:t,menuListStyle:Vr(ne),onOptionClick:e=>{const{onClick:t}=e.detail.data;t?.()}}):null}function ce(e){switch(V){case n.SelectionMode.none:return d.jsx(J,{iconURL:G,onClick:()=>ie(e),hoverText:n.localize("UNBAN"),buttonStyle:jr(Y,ne)});case n.SelectionMode.single:return d.jsx(L,{onChange:t=>Q?.(e,t.detail.checked)});case n.SelectionMode.multiple:return d.jsx(b,{onChange:t=>Q?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ne.palette.getPrimary(),uncheckedBackgroundColor:ne.palette.getAccent400()}});default:return null}}return function(e){const{bannedMembersManagerRef:o,groupGuid:r,searchText:s,bannedMembersRequestBuilder:i,searchRequestBuilder:a,dispatch:l,fetchNextAndAppendBannedMembers:c,fetchNextIdRef:C,groupPropRef:d,bannedMembersSearchText:g}=e;t.useEffect(()=>{i?.searchKeyword?g.current=i?.searchKeyword:a?.searchKeyword&&(g.current=a?.searchKeyword)},[]),t.useEffect(()=>{o.current=new Hr({groupGuid:r,bannedMembersRequestBuilder:i,searchRequestBuilder:a,searchText:s,bannedMembersSearchText:g}),l({type:"setBannedMembers",bannedMembers:[]}),c(C.current="initialFetchNext_"+String(Date.now()))},[r,i,a,s,c,l,o,C]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{const{kickedFrom:t,kickedUser:n}=e;t.getGuid()===d.current.getGuid()&&l({type:"addMember",member:Hr.createGroupMemberFromUser(n,t)})}),t=n.CometChatGroupEvents.ccGroupMemberUnbanned.subscribe(e=>{const{unbannedFrom:t,unbannedUser:n}=e;t.getGuid()===d.current.getGuid()&&l({type:"removeBannedMemberIfPresent",bannedMemberUid:n.getUid()})});return()=>{e.unsubscribe(),t.unsubscribe()}},[l,d]),t.useEffect(()=>Hr.attachSDKGroupListener(d,l),[l,d]),t.useEffect(()=>Hr.attachSDKUserListener(l),[l])}({groupGuid:E.getGuid(),searchText:W.searchText,bannedMembersRequestBuilder:v,searchRequestBuilder:I,bannedMembersManagerRef:q,dispatch:X,fetchNextAndAppendBannedMembers:se,fetchNextIdRef:$,groupPropRef:te,bannedMembersSearchText:oe}),d.jsxs("div",{className:"cc-banned-members",style:Mr(Y,ne),children:[d.jsxs("div",{className:"cc-banned-members__list-wrapper",style:{position:"relative",height:"100%"},children:[null===a?null:d.jsx("div",{className:"cc-banned-members__menus",style:{position:"absolute",right:"12px",top:"8px",cursor:"pointer"},children:a}),d.jsx(k,{title:l,titleAlignment:c,searchPlaceholderText:C,searchIconURL:g,searchText:W.searchText,onSearch:re,hideSearch:u,list:W.bannedMembers,listItemKey:"getUid",listItem:S||function(e){return d.jsx(M,{id:e.getUid(),title:e.getName(),avatarURL:e.getAvatar(),avatarName:e.getName(),statusIndicatorColor:ae(e),hideSeparator:F,statusIndicatorStyle:Lr(K),avatarStyle:Ur(z,ne),listItemStyle:Rr(_,Y,ne),subtitleView:O?.(e),subtitleViewClassName:"cc-banned-members__subtitle-view",menuView:le(e),menuViewClassName:"cc-banned-members__options-view",tailView:ce(e),tailViewClassName:"cc-banned-members__tail-view",onClick:t=>H?.(e)})},showSectionHeader:!1,onScrolledToBottom:()=>se($.current="onScrolledToBottom_"+String(Date.now())),state:W.fetchState===n.States.loaded&&0===W.bannedMembers.length?n.States.empty:W.fetchState,loadingIconURL:p,emptyStateText:A,errorStateText:w,loadingView:h,emptyStateView:y,errorStateView:f,hideError:N,listStyle:Br(Y,ne)})]}),r?d.jsx(J,{iconURL:o,buttonStyle:Pr(Y,ne),onClick:i}):null,d.jsx(J,{iconURL:R,buttonStyle:Or(Y,ne),onClick:P})]})}function _r(e,t){return{width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent400()}`,borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),boxShadow:e?.boxShadow||"",position:"relative",boxSizing:"border-box"}}function Wr(e,t){return new o.ConfirmDialogStyle({confirmButtonBackground:e?.confirmButtonBackground||t.palette.getError(),cancelButtonBackground:e?.cancelButtonBackground||t.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||t.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(t.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||t.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(t.typography.text2),titleFont:e?.titleFont||n.fontHelper(t.typography.title1),titleColor:e?.titleColor||t.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(t.typography.subtitle2),messageTextColor:e?.messageTextColor||t.palette.getAccent600(),background:e?.background||t.palette.getBackground(),height:e?.height||"auto",width:e?.width||"auto",border:e?.border||"none",borderRadius:e?.borderRadius||"12px",boxShadow:e?.boxShadow||`0 0 1px 1px ${t.palette.getAccent50()}`})}function Zr(e,t){return new r.ListStyle({background:"inherit",width:"100%",height:"100%",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600()})}function Xr(e,t){return new o.AvatarStyle({width:e?.width||"36px",height:e?.height||"36px",borderRadius:e?.borderRadius||"24px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),backgroundSize:e?.backgroundSize||"cover",outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function qr(e){return{...null!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function $r(e,t,r){return new o.ListItemStyle({height:e?.height||"auto",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),hoverBackground:e?.hoverBackground||r.palette.getAccent50(),padding:e?.padding||"0"})}function es(e,t){return new o.BadgeStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle2),textColor:e?.textColor||t.palette.getAccent("dark"),background:e?.background||t.palette.getPrimary(),borderRadius:e?.borderRadius||"16px",width:e?.width||"24px",height:e?.height||"16px",border:e?.border||"none"})}function ts(e,t){return new o.LabelStyle({background:"transparent",textFont:e?.threadIndicatorTextFont||n.fontHelper(t.typography.caption2),textColor:e?.threadIndicatorTextColor||t.palette.getAccent400()})}function ns(e){return new o.IconStyle({width:"24px",height:"24px",iconTint:e.palette.getAccent400()})}function os(e,t){return new o.ReceiptStyle({waitIconTint:e?.waitIconTint||t.palette.getAccent700(),sentIconTint:e?.sentIconTint||t.palette.getAccent600(),deliveredIconTint:e?.deliveredIconTint||t.palette.getAccent600(),readIconTint:e?.readIconTint||t.palette.getPrimary(),errorIconTint:e?.errorIconTint||t.palette.getError(),height:e?.height||"20px",width:e?.width||"20px",border:e?.border||"none",borderRadius:e?.borderRadius||"inherit",background:e?.background||"inherit"})}function rs(e,t,o,r){const i=e.getConversationWith(),a=i instanceof s.CometChat.User?i.getUid():i.getGuid();return void 0!==t.get(a)?{font:o?.typingIndictorTextFont||n.fontHelper(r.typography.subtitle2),color:o?.typingIndictorTextColor||r.palette.getSuccess()||"",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}:{font:o?.lastMessageTextFont||n.fontHelper(r.typography.subtitle2),color:o?.lastMessageTextColor||r.palette.getAccent600()||"",width:"100%",overflow:"hidden",textOverflow:"ellipsis"}}function ss(e){return new o.MenuListStyle({width:"",height:"",border:"none",borderRadius:"8px",background:"transparent",moreIconTint:"grey",submenuWidth:"70px",submenuHeight:"20px",submenuBorder:"1px solid #e8e8e8",submenuBorderRadius:"8px",submenuBackground:e.palette.getBackground()})}function is(e,t){const r=null!==e?e:{};return{...new o.DateStyle({textFont:e?.textFont||n.fontHelper(t.typography.caption2),textColor:e?.textColor||t.palette.getAccent600(),background:"transparent"}),...r}}function as(e,t){return{width:e?.width||t?.width,height:e?.height||t?.height,background:e?.background||"rgba(0, 0, 0, 0.5)",border:e?.border,borderRadius:e?.borderRadius,position:"absolute"}}class ls{constructor(e){const{conversationsRequestBuilder:t}=e,n=t||(new s.CometChat.ConversationsRequestBuilder).setLimit(Qr.limit);this.conversationsRequest=n.build(),t&&(Qr.conversationType=t.build().getConversationType())}fetchNext(){return this.conversationsRequest.fetchNext()}static attachUserListener(e){const t="ConversationList_User_"+String(Date.now());return s.CometChat.addUserListener(t,new s.CometChat.UserListener({onUserOnline:e,onUserOffline:e})),()=>s.CometChat.removeUserListener(t)}static attachGroupListener(e,t){const n="ConversationList_Group_"+String(Date.now());return s.CometChat.addGroupListener(n,new s.CometChat.GroupListener({onGroupMemberJoined:t=>{e(t)},onGroupMemberLeft:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberKicked:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberBanned:(n,o)=>{t?.getUid()===o.getUid()?e(n,!0):e(n)},onGroupMemberUnbanned:t=>{e(t)},onMemberAddedToGroup:t=>{e(t)},onGroupMemberScopeChanged:t=>{e(t)}})),()=>s.CometChat.removeGroupListener(n)}static attachMessageReceivedListener(e){const t=n.CometChatMessageEvents.onTextMessageReceived.subscribe(t=>{e(t)}),o=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(t=>{e(t)}),r=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(t=>{e(t)}),s=n.CometChatMessageEvents.onFormMessageReceived.subscribe(t=>{e(t)}),i=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(t=>{e(t)}),a=n.CometChatMessageEvents.onCardMessageReceived.subscribe(t=>{e(t)}),l=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(t=>{e(t)});return()=>{t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe()}}static attachMessageReceiptListener(e){const t=n.CometChatMessageEvents.onMessagesRead.subscribe(t=>{t.getReceiverType()==n.CometChatUIKitConstants.MessageReceiverType.user&&e(t,!0)}),o=n.CometChatMessageEvents.onMessagesDelivered.subscribe(t=>{t.getReceiverType()==n.CometChatUIKitConstants.MessageReceiverType.user&&e(t,!1)}),r=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(t=>{e(t,!1)}),s=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(t=>{e(t,!0)});return()=>{t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe()}}static attachMessageTypingListener(e){const t=n.CometChatMessageEvents.onTypingStarted.subscribe(t=>{e(t,!0)}),o=n.CometChatMessageEvents.onTypingEnded.subscribe(t=>{e(t,!1)});return()=>{t?.unsubscribe(),o?.unsubscribe()}}static attachMessageModifiedListener(e){const t=n.CometChatMessageEvents.onMessageEdited.subscribe(t=>{e(t)}),o=n.CometChatMessageEvents.onMessageDeleted.subscribe(t=>{e(t)});return()=>{t?.unsubscribe(),o?.unsubscribe()}}static attachCallListener(e){const t="ConversationList_Call_"+String(Date.now());return s.CometChat.addCallListener(t,new s.CometChat.CallListener({onIncomingCallReceived:e,onOutgoingCallAccepted:e,onOutgoingCallRejected:e,onIncomingCallCancelled:e})),()=>s.CometChat.removeCallListener(t)}static attachConnestionListener(e){const t="ConversationList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}static shouldIncrementForCustomMessage(e){const t=e?.getMetadata();return e?.willUpdateConversation()||t&&t.hasOwnProperty("incrementUnreadCount")&&t.incrementUnreadCount||Zn.conversationUpdateSettings?.shouldUpdateOnCustomMessages()}}Qr=ls,ls.limit=30,ls.conversationType=void 0,ls.shouldLastMessageAndUnreadCountBeUpdated=e=>{let t=e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom;return!(e?.getParentMessageId()&&!Zn.conversationUpdateSettings?.shouldUpdateOnMessageReplies())&&(t?!!(e?.getParentMessageId()&&Zn.conversationUpdateSettings?.shouldUpdateOnMessageReplies()&&Qr.shouldIncrementForCustomMessage(e))||Qr.shouldIncrementForCustomMessage(e):e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action?e?.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember||Zn.conversationUpdateSettings?.shouldUpdateOnGroupActions():e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call||e?.getType()!==n.CometChatUIKitConstants.MessageTypes.audio&&e?.getType()!==n.CometChatUIKitConstants.MessageTypes.video||Zn.conversationUpdateSettings?.shouldUpdateOnCallActivities())};var cs="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Cs="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ds="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",gs="data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.6377%207L9.87922%2016.3095L6%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",us="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ps="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hs="data:image/svg+xml,%3Csvg%20width%3D%2225%22%20height%3D%2224%22%20viewBox%3D%220%200%2025%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.01057%208.04728C8.34753%209.99213%209.53177%2011.3242%2011.6239%2012C13.716%2011.3242%2014.9002%209.99213%2015.2372%208.04728C15.2572%207.91731%2015.2488%207.78455%2015.2125%207.65816C15.1762%207.53177%2015.1129%207.41476%2015.027%207.3152C14.9411%207.21564%2014.8346%207.1359%2014.7149%207.08149C14.5952%207.02707%2014.4651%206.99928%2014.3336%207.00001H8.9142C8.7827%206.99928%208.65261%207.02707%208.5329%207.08149C8.41319%207.1359%208.30671%207.21564%208.2208%207.3152C8.1349%207.41476%208.07161%207.53177%208.03532%207.65816C7.99902%207.78455%207.99058%207.91731%208.01057%208.04728Z%22%20fill%3D%22%23808080%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.91423%2017C8.78279%2017.0007%208.65276%2016.9729%208.5331%2016.9185C8.41343%2016.8642%208.30699%2016.7845%208.22109%2016.685C8.1352%2016.5855%208.0719%2016.4686%208.03556%2016.3423C7.99922%2016.2159%207.9907%2016.0832%208.01059%2015.9533C8.34756%2014.0085%209.5318%2012.6764%2011.6239%2012C13.716%2012.6764%2014.9003%2014.0085%2015.2372%2015.9533C15.2571%2016.0832%2015.2486%2016.2159%2015.2123%2016.3423C15.1759%2016.4686%2015.1126%2016.5855%2015.0267%2016.685C14.9408%2016.7845%2014.8344%2016.8642%2014.7147%2016.9185C14.5951%2016.9729%2014.465%2017.0007%2014.3336%2017H8.91423Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ms="data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E";function As(e){return e instanceof s.CometChat.TextMessage||e instanceof s.CometChat.MediaMessage||e instanceof s.CometChat.CustomMessage||e instanceof s.CometChat.InteractiveMessage||e instanceof s.CometChat.Action||e instanceof s.CometChat.Call}function xs(e,t){let o=e;const{type:i}=t;switch(i){case"appendConversations":if(t.conversations.length>0){let n=[];t.removeOldConversation?(e.conversationList=[],n=t.conversations):n=[...e.conversationList,...t.conversations],o={...e,conversationList:n}}break;case"setConversationList":{const{typingIndicatorMap:n}=e,{conversationList:r}=t,i=new Map;for(let e=0;e<r.length;e++){const t=r[e].getConversationWith(),o=t instanceof s.CometChat.User?t?.getUid():t.getGuid();n.has(o)&&i.set(o,n.get(o))}o={...e,conversationList:r,typingIndicatorMap:i};break}case"setFetchState":o={...e,fetchState:t.fetchState};break;case"setConversationToBeDeleted":o={...e,conversationToBeDeleted:t.conversation};break;case"removeConversation":{const{typingIndicatorMap:n,conversationList:r}=e,i=t.conversation.getConversationId(),a=r.findIndex(e=>e.getConversationId()===i);if(a>-1){const t=r[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;n.has(i)?(l=new Map(n),l.delete(i)):l=n;const c=e.conversationList.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"updateConversationWithUser":{const{user:n}=t,{conversationList:i}=e,a=n.getUid(),l=i.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.User&&t?.getUid()===a});if(l>-1){const t=i.map((e,t)=>{if(t===l){const t=r.CometChatUIKitUtility.clone(e);return t.setConversationWith(n),t}return e});o={...e,conversationList:t}}break}case"fromUpdateConversationListFn":{const{conversation:n}=t,r=n.getConversationId(),s=e.conversationList.filter(e=>e.getConversationId()!==r);o={...e,conversationList:[n,...s]};break}case"setLastMessageReadOrDeliveredAt":{const{conversationList:n}=e,{messageReceipt:s,updateReadAt:i}=t,a=s.getMessageId(),l=n.findIndex(e=>{const t=e.getLastMessage();return!(!As(t)||String(t.getId())!==a)&&(i?!t.getReadAt():!t.getDeliveredAt())});l>-1&&(o={...e,conversationList:n.map((e,t)=>{if(t===l){const t=r.CometChatUIKitUtility.clone(e),n=t.getLastMessage();return As(n)&&(i?(n.setReadAt(s.getReadAt()),t.setUnreadMessageCount(0)):n.setDeliveredAt(s.getDeliveredAt())),t}return e})});break}case"addTypingIndicator":{const{typingIndicator:r}=t,i=r.getSender()?.getUid(),a=r.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group,l=r.getReceiverId();let c;const{conversationList:C,typingIndicatorMap:d}=e;for(let e=0;e<C.length;e++){const t=C[e].getConversationWith();if(a){if(t instanceof s.CometChat.Group&&t.getGuid()===l){c=t.getGuid();break}}else if(t instanceof s.CometChat.User&&t?.getUid()===i){c=t?.getUid();break}}if(void 0!==c){const t=new Map(d);t.set(c,r),o={...e,typingIndicatorMap:t}}break}case"removeTypingIndicator":{const{typingIndicatorMap:r}=e,{typingIndicator:s}=t,i=s.getSender()?.getUid(),a=s.getReceiverId();let l;if(s.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user?r.has(i)&&(l=i):r.get(a)?.getSender()?.getUid()===i&&(l=a),void 0!==l){const t=new Map(r);t.delete(l),o={...e,typingIndicatorMap:t}}break}case"updateConversationLastMessage":{const{message:n}=t,s=n?.getId(),{conversationList:i}=e,a=i.findIndex(e=>{const t=e.getLastMessage();return As(t)&&t.getId()===s});a>-1&&(o={...e,conversationList:i.map((e,t)=>{if(t===a){const t=r.CometChatUIKitUtility.clone(e);return t.setLastMessage(n),t}return e})});break}case"updateConversationLastMessageAndGroupAndPlaceAtTheTop":{const{conversationList:n}=e,{group:s,message:i}=t,a=i.getConversationId();if(!ls.shouldLastMessageAndUnreadCountBeUpdated(i))return e;const l=n.findIndex(e=>e.getConversationId()===a);if(l>-1){const t=r.CometChatUIKitUtility.clone(n[l]);t.setConversationWith(s),t.setLastMessage(i),o={...e,conversationList:[t,...n.filter((e,t)=>t!==l)]}}break}case"removeConversationOfTheGroup":{const{conversationList:n,typingIndicatorMap:r}=e,i=t.group.getGuid(),a=n.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.Group&&t.getGuid()===i});if(a>-1){const t=n[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;r.has(i)?(l=new Map(r),l.delete(i)):l=r;const c=n.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"removeConversationOfTheUser":{const{conversationList:n,typingIndicatorMap:r}=e,i=t.user.getUid(),a=n.findIndex(e=>{const t=e.getConversationWith();return t instanceof s.CometChat.User&&t?.getUid()===i});if(a>-1){const t=n[a].getConversationWith(),i=t instanceof s.CometChat.User?t?.getUid():t.getGuid();let l;r.has(i)?(l=new Map(r),l.delete(i)):l=r;const c=n.filter((e,t)=>t!==a);o={...e,conversationList:c,typingIndicatorMap:l}}break}case"updateConversationLastMessageResetUnreadCountAndPlaceAtTheTop":{const{conversationList:n}=e,{message:s,conversation:i}=t,a=s.getConversationId();if(!ls.shouldLastMessageAndUnreadCountBeUpdated(s))return e;const l=n.findIndex(e=>e.getConversationId()===a);if(l>-1){const t=r.CometChatUIKitUtility.clone(n[l]);t.setLastMessage(s),t.setUnreadMessageCount(0);const i=n.filter((e,t)=>t!==l);o={...e,conversationList:[t,...i]}}else{i.setUnreadMessageCount(0);const t=[i,...n];o={...e,conversationList:t}}break}case"resetUnreadCountAndSetReadAtIfLastMessage":{const{conversationList:n}=e,{message:s}=t,i=s.getReadAt()||Date.now(),a=n.findIndex(e=>e.getConversationId()===s.getConversationId());a>-1&&(o={...e,conversationList:n.map((e,t)=>{if(t===a){const t=r.CometChatUIKitUtility.clone(e);return t.setUnreadMessageCount(0),t.getLastMessage()&&t.getLastMessage().setReadAt(i),t}return e})});break}case"updateConversationLastMessageAndPlaceAtTheTop":{const{message:n}=t,s=n?.getId(),{conversationList:i}=e;if(!ls.shouldLastMessageAndUnreadCountBeUpdated(n))return e;const a=i.findIndex(e=>{const t=e.getLastMessage();return As(t)&&t.getId()===s});if(a>-1){const t=r.CometChatUIKitUtility.clone(i[a]);t.setLastMessage(n),o={...e,conversationList:[t,...i.filter((e,t)=>t!==a)]}}break}case"setLoggedInUser":o={...e,loggedInUser:t.loggedInUser};break;case"setIsFirstReload":o={...e,isFirstReload:t.isFirstReload}}return o}function bs(e){const{menus:o=null,title:i=n.localize("CHATS"),titleAlignment:a=n.TitleAlignment.left,conversationsRequestBuilder:l=null,onError:c,listItemView:C=null,subtitleView:g=null,disableUsersPresence:u=!1,hideSeparator:p=!1,activeConversation:h=null,selectionMode:y=n.SelectionMode.none,disableReceipt:w=!1,hideReceipt:f=!1,options:D=null,datePattern:E=n.DatePatterns.DayDateTime,protectedGroupIcon:v=cs,passwordGroupIcon:I,privateGroupIcon:S=us,readIcon:F=ds,deliveredIcon:T=Cs,waitIcon:R=hs,errorIcon:P=ms,sentIcon:O=gs,loadingIconURL:j=ps,loadingStateView:V,emptyStateText:G=n.localize("NO_CHATS_FOUND"),emptyStateView:H,errorStateText:Q=n.localize("SOMETHING_WRONG"),errorStateView:N,hideError:K=!1,onItemClick:z=null,onSelect:J=null,disableSoundForMessages:Y=!1,disableTyping:_=!1,customSoundForMessages:W=null,confirmDialogTitle:X=n.localize("DELETE_CONVERSATION"),confirmDialogMessage:q=n.localize("WOULD__YOU_LIKE_TO_DELETE_THIS_CONVERSATION"),cancelButtonText:$=n.localize("CANCEL"),confirmButtonText:ee=n.localize("DELETE"),conversationsStyle:te=null,deleteConversationDialogStyle:ne=null,avatarStyle:oe=null,statusIndicatorStyle:re=null,listItemStyle:se=null,badgeStyle:ie=null,receiptStyle:ae=null,dateStyle:le=null,backdropStyle:ce=null,disableMentions:Ce=!1,textFormatters:de=[]}=e,[ge,ue]=t.useReducer(xs,{conversationList:[],fetchState:n.States.loading,typingIndicatorMap:new Map,conversationToBeDeleted:null,loggedInUser:null,isFirstReload:!1,unreadMentions:!1}),[pe,he]=A(null),me=t.useRef(null),Ae=t.useRef(""),xe=x(c),be=m(W),{theme:ye}=t.useContext(U),we=t.useRef(!1),fe=t.useRef(!1);ge.isFirstReload&&(we.current=!0,ge.isFirstReload=!1);const De=t.useCallback(async e=>{const t=me.current;if(!t)return;let o=fe.current?n.States.loaded:n.States.loading;ue({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(0!==o.length&&Ae.current===e){let e=!!fe.current;ue({type:"appendConversations",conversations:o,removeOldConversation:e})}we.current&&ge.isFirstReload&&(ls.attachConnestionListener(()=>{me.current=new ls({conversationsRequestBuilder:l}),fe.current=!0,De(Ae.current="initialFetchNext_"+String(Date.now()))}),we.current=!1),fe.current?fe.current=!1:ue({type:"setFetchState",fetchState:n.States.loaded})}catch(e){ge.conversationList.length<=0&&ue({type:"setFetchState",fetchState:n.States.error}),xe(e)}},[xe,ue]),Ee=t.useCallback(e=>{const t="getMetadata";let n;return t in e&&"function"==typeof e[t]&&(n=e[t]())&&"object"==typeof n&&"incrementUnreadCount"in n&&Boolean(n.incrementUnreadCount)||e instanceof s.CometChat.CustomMessage&&e.willUpdateConversation()},[]),ve=t.useCallback((e,t)=>{const o=t||e.getLastMessage();if((!l||!l.build().getConversationType()||o.getReceiverType()===l.build().getConversationType())&&As(o)&&ls.shouldLastMessageAndUnreadCountBeUpdated(o)){if(o.getSender().getUid()!==ge.loggedInUser?.getUid()&&e.setUnreadMessageCount((e.getUnreadMessageCount()??0)+1),o instanceof s.CometChat.Action&&o.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&e.getConversationType()===n.CometChatUIKitConstants.MessageReceiverType.group){if(o.getReceiver().getGuid()===o.getActionFor().getGuid()){let t=e.getConversationWith();t.setMembersCount(o.getActionFor().getMembersCount()),e.setConversationWith(t)}}e.setLastMessage(o),ue({type:"fromUpdateConversationListFn",conversation:e})}},[ue,ge.loggedInUser,Ee]),Ie=t.useCallback(async(e,t=!1)=>{try{const n=ge.conversationList.findIndex(t=>t.getConversationId()===e.getConversationId());if(n>=0){const o=ge.conversationList[n];t?ue({type:"removeConversation",conversation:o}):ve(o,e)}else s.CometChat.CometChatHelper.getConversationFromMessage(e).then(t=>{ve(t,e)})}catch(e){xe(e)}},[xe,ve,ge.conversationList]),Se=t.useCallback(async e=>{if(e.getSender().getUid()!==ge.loggedInUser?.getUid()&&!w&&!e.getDeliveredAt())try{s.CometChat.markAsDelivered(e)}catch(e){xe(e)}Y||e.getCategory()===n.CometChatUIKitConstants.MessageCategory.custom&&!Ee(e)||h&&h.getConversationId()===e.getConversationId()||r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessageFromOther,be.current),Ie(e)},[w,Y,Ie,xe,ge.loggedInUser,h,Ee,be]),Fe=t.useCallback((e,t)=>{ue({type:"setLastMessageReadOrDeliveredAt",updateReadAt:t,messageReceipt:e})},[ue]),ke=t.useCallback((e,t)=>{ge.loggedInUser?.getUid()!==e.getSender()?.getUid()&&ue(t?{type:"addTypingIndicator",typingIndicator:e}:{type:"removeTypingIndicator",typingIndicator:e})},[ge.loggedInUser]);function Te(e){const t=e.getConversationWith();return t instanceof s.CometChat.User?t.getAvatar():t.getIcon()}function Me(e){const t=e.getConversationWith();if(t instanceof s.CometChat.User){let e=(new Z).getUserStatusVisible(t);return u||e?null:te?.onlineStatusColor||ye.palette.getSuccess()||"rgb(0, 200, 111)"}switch(t.getType()){case n.CometChatUIKitConstants.GroupTypes.password:return te?.passwordGroupIconBackground||"rgb(247, 165, 0)";case n.CometChatUIKitConstants.GroupTypes.private:return te?.privateGroupIconBackground||ye.palette.getSuccess()||"rgb(0, 200, 111)";default:return null}}function Le(e){let t="";const o=e.getConversationWith();if(o instanceof s.CometChat.Group)switch(o.getType()){case n.CometChatUIKitConstants.GroupTypes.password:t=I||v;break;case n.CometChatUIKitConstants.GroupTypes.private:t=S}return t}function Ue(e){const t=e.getLastMessage();return As(t)&&t.getParentMessageId()?d.jsxs("div",{className:"cc-conversations__thread-view",style:{display:"flex",columnGap:"4px"},children:[d.jsx("cometchat-label",{text:n.localize("IN_A_THREAD"),labelStyle:JSON.stringify(ts(te,ye))}),d.jsx("cometchat-icon",{URL:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20%20%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20class%3D%22feather%20feather-corner-right-down%22%3E%3Cpolyline%20points%3D%2210%2015%2015%2020%2020%2015%22%3E%3C%2Fpolyline%3E%3Cpath%20d%3D%22M4%204h7a4%204%200%200%201%204%204v12%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E",iconStyle:JSON.stringify(ns(ye))})]}):null}function Re(e){return function(e){const t=e.getLastMessage(),o=e.getConversationWith(),r=o instanceof s.CometChat.User?o?.getUid():o.getGuid();return!(w||f)&&As(t)&&!t.getDeletedAt()&&t.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&t.getSender()?.getUid()===ge.loggedInUser?.getUid()&&void 0===ge.typingIndicatorMap.get(r)}(e)?d.jsx("cometchat-receipt",{receipt:r.MessageReceiptUtils.getReceiptStatus(e.getLastMessage()),waitIcon:R,sentIcon:O,errorIcon:P,deliveredIcon:T,readIcon:F,receiptStyle:JSON.stringify(os(ae,ye))}):null}function Pe(e){const t=e.getConversationWith(),o=t instanceof s.CometChat.Group?t.getGuid():t?.getUid(),r=ge.typingIndicatorMap.get(o);if(void 0!==r)return t instanceof s.CometChat.Group?`${r.getSender().getName()} ${n.localize("IS_TYPING")}`:n.localize("IS_TYPING");if(ge.loggedInUser){let t="";const o=e.getLastMessage();o&&o.getCategory()===n.CometChatUIKitConstants.MessageCategory.call&&(t=(o.getType()===n.CometChatUIKitConstants.MessageTypes.audio?"📞":"📹")+" ");let r=e.getLastMessage(),a=Be.getDataSource().getLastConversationMessage(e,ge.loggedInUser,{disableMentions:Ce,theme:ye,mentionsTargetElement:n.MentionsTargetElement.conversation,textFormattersList:de});return r&&e?.getConversationType()!==s.CometChat.RECEIVER_TYPE.USER&&(a=(r?.getSender().getUid(),ge.loggedInUser?.getUid(),`${a}`)),d.jsx("div",{dangerouslySetInnerHTML:{__html:t+(i=a,i.replace(/&(?!amp;|lt;|gt;|quot;|#39;|#\d+;)/g,"&amp;").replace(/&amp;(?!lt;|gt;|quot;|#39;|#\d+;)/g,"&amp;"))},style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})}var i;return""}function Oe(e){return d.jsx("div",{className:"cc-conversations__subtitle-text",style:rs(e,ge.typingIndicatorMap,te,ye),children:Pe(e)})}function je(e){return null!==g?d.jsx(d.Fragment,{children:g(e)}):d.jsxs(d.Fragment,{children:[Ue(e),d.jsxs("div",{className:"cc-conversations__subtitle",style:{display:"flex",columnGap:"4px",alignItems:"center",width:"85%"},children:[Re(e),Oe(e)]})]})}function Ve(e){ue({type:"setConversationToBeDeleted",conversation:e})}function Ge(e,t){if(y!==n.SelectionMode.none)return null;let o;if(D)o=D?.(e);else{const s=r.ConversationUtils.getDefaultOptions();for(let o=0;o<s.length;o++)s[o].id===n.CometChatUIKitConstants.ConversationOptions.delete&&(s[o].onClick=()=>Ve(e),s[o].iconTint=t.palette.getAccent600());o=s}return 0===o?.length?null:d.jsx(B,{data:o,menuListStyle:ss(t),onOptionClick:e=>{const{onClick:t}=e.detail.data;t?.()}})}function He(e){switch(y){case n.SelectionMode.none:{const t=e.getLastMessage();return t?d.jsxs("div",{className:"cc-conversations__tail-content",style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[d.jsx("cometchat-date",{timestamp:t.getSentAt(),pattern:E,dateStyle:JSON.stringify(is(le,ye))}),d.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:d.jsx("cometchat-badge",{count:e.getUnreadMessageCount(),badgeStyle:JSON.stringify(es(ie,ye))})})]}):null}case n.SelectionMode.single:return d.jsx("div",{className:"cc-conversations__tail-content",children:d.jsx(L,{onChange:t=>J?.(e,t.detail.checked)})});case n.SelectionMode.multiple:return d.jsx("div",{className:"cc-conversations__tail-content",children:d.jsx(b,{onChange:t=>J?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:ye.palette.getPrimary(),uncheckedBackgroundColor:ye.palette.getAccent400()}})});default:return null}}const Qe=e=>{const t=e.getConversationWith();if(t instanceof s.CometChat.User){let e=(new Z).getUserStatusVisible(t);return u||e?null:qr(re)}switch(t.getType()){case n.CometChatUIKitConstants.GroupTypes.private:case n.CometChatUIKitConstants.GroupTypes.password:return qr(re);default:return null}};return function(e){const{conversationsRequestBuilder:o,conversationsManagerRef:i,fetchNextAndAppendConversations:a,fetchNextIdRef:l,dispatch:c,confirmDialogElement:C,conversationToBeDeleted:d,errorHandler:g,refreshSingleConversation:u,onMessageReceived:p,setReceipts:h,setTypingIndicator:m,disableTyping:A,loggedInUser:x,isFirstReload:b}=e;t.useEffect(()=>{c({type:"setIsFirstReload",isFirstReload:!0}),i.current=new ls({conversationsRequestBuilder:o}),c({type:"setConversationList",conversationList:[]}),a(l.current="initialFetchNext_"+String(Date.now()))},[o,a,c,i,l]),t.useEffect(()=>{(async()=>{try{c({type:"setLoggedInUser",loggedInUser:await s.CometChat.getLoggedinUser()})}catch(e){g(e)}})()},[g,c]),t.useEffect(()=>{if(null===C)return;const e="cc-confirm-clicked",t="cc-cancel-clicked";async function o(){if(d){const e=d.getConversationWith(),t=e instanceof s.CometChat.Group?e.getGuid():e.getUid();try{await s.CometChat.deleteConversation(t,d.getConversationType()),n.CometChatConversationEvents.ccConversationDeleted.next(r.CometChatUIKitUtility.clone(d)),c({type:"removeConversation",conversation:d}),c({type:"setConversationToBeDeleted",conversation:null})}catch(e){g(e)}}}function i(){c({type:"setConversationToBeDeleted",conversation:null})}return C.addEventListener(e,o),C.addEventListener(t,i),()=>{C.removeEventListener(e,o),C.removeEventListener(t,i)}},[d,C,g,c]),t.useEffect(()=>ls.attachUserListener(e=>c({type:"updateConversationWithUser",user:e})),[c]),t.useEffect(()=>ls.attachGroupListener(u,x),[u,x]),t.useEffect(()=>ls.attachMessageReceivedListener(p),[p]),t.useEffect(()=>ls.attachMessageModifiedListener(e=>{c({type:"updateConversationLastMessage",message:e})}),[c]),t.useEffect(()=>ls.attachMessageReceiptListener(h),[h]),t.useEffect(()=>{if(!A)return ls.attachMessageTypingListener(m)},[A,m]),t.useEffect(()=>ls.attachCallListener(u),[u]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e.message})}),t=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{const t=e.messages[e.messages.length-1];t&&c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.userAddedIn,message:t})}),i=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.kickedFrom,message:e.message})}),a=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{c({type:"updateConversationLastMessageAndGroupAndPlaceAtTheTop",group:e.kickedFrom,message:e.message})}),l=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{c({type:"removeConversationOfTheGroup",group:e})}),C=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{ls.shouldLastMessageAndUnreadCountBeUpdated(e.message)&&c({type:"removeConversationOfTheGroup",group:e.leftGroup})}),d=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{c(o?.includeBlockedUsers?{type:"updateConversationWithUser",user:e}:{type:"removeConversationOfTheUser",user:e})}),g=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{o?.includeBlockedUsers&&c({type:"updateConversationWithUser",user:e})}),u=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{e.status===n.MessageStatus.success&&c({type:"updateConversationLastMessage",message:e.message})}),p=n.CometChatMessageEvents.ccMessageSent.subscribe(e=>{if(e.status===n.MessageStatus.success){if(o&&o.build().getConversationType()&&e.message.getReceiverType()!==o.build().getConversationType())return;s.CometChat.CometChatHelper.getConversationFromMessage(e.message).then(t=>{c({type:"updateConversationLastMessageResetUnreadCountAndPlaceAtTheTop",message:e.message,conversation:t})})}}),h=n.CometChatMessageEvents.ccMessageDeleted.subscribe(e=>{c({type:"updateConversationLastMessage",message:r.CometChatUIKitUtility.clone(e)})}),m=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{c({type:"resetUnreadCountAndSetReadAtIfLastMessage",message:e})}),A=n.CometChatCallEvents.ccCallAccepted.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),x=n.CometChatCallEvents.ccOutgoingCall.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),b=n.CometChatCallEvents.ccCallRejected.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})}),y=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{c({type:"updateConversationLastMessageAndPlaceAtTheTop",message:e})});return()=>{e.unsubscribe(),t.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),C.unsubscribe(),d.unsubscribe(),g.unsubscribe(),u.unsubscribe(),p.unsubscribe(),h.unsubscribe(),m.unsubscribe(),A.unsubscribe(),x.unsubscribe(),b.unsubscribe(),y.unsubscribe()}},[c])}({conversationsRequestBuilder:l,conversationsManagerRef:me,fetchNextAndAppendConversations:De,fetchNextIdRef:Ae,dispatch:ue,confirmDialogElement:pe,conversationToBeDeleted:ge.conversationToBeDeleted,errorHandler:xe,refreshSingleConversation:Ie,onMessageReceived:Se,setReceipts:Fe,setTypingIndicator:ke,disableTyping:_,loggedInUser:ge.loggedInUser,isFirstReload:!1}),d.jsxs("div",{className:"cc-conversations",style:_r(te,ye),children:[null===o?null:d.jsx("div",{className:"cc-conversations__menus",style:{position:"absolute",top:"19px",right:"12px",cursor:"pointer",display:"flex",justifyContent:"flex-end",width:"24px"},children:o}),d.jsx(k,{title:i,titleAlignment:a,hideSearch:!0,list:ge.conversationList,listItemKey:"getConversationId",listItem:null!==C?C:function(e){return d.jsx(M,{id:e.getConversationId(),avatarURL:Te(e),avatarName:e.getConversationWith().getName(),title:e.getConversationWith().getName(),statusIndicatorColor:Me(e),statusIndicatorIcon:Le(e),hideSeparator:p,isActive:y===n.SelectionMode.none&&e.getConversationId()===h?.getConversationId(),avatarStyle:Xr(oe,ye),statusIndicatorStyle:Qe(e),listItemStyle:$r(se,te,ye),onClick:t=>z?.(e),subtitleView:je(e),subtitleViewClassName:"cc-conversations__subtitle-view",menuView:Ge(e,ye),menuViewClassName:"cc-conversations__options-view",tailView:He(e),tailViewClassName:"cc-conversations__tail-view"})},onScrolledToBottom:()=>De(Ae.current="onScrolledToBottom_"+String(Date.now())),showSectionHeader:!1,state:ge.fetchState===n.States.loaded&&0===ge.conversationList.length?n.States.empty:ge.fetchState,loadingIconURL:j,loadingView:V,emptyStateText:G,emptyStateView:H,errorStateText:Q,errorStateView:N,hideError:K,listStyle:Zr(te,ye)}),null===ge.conversationToBeDeleted?null:d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(as(ce,te)),children:d.jsx("cometchat-confirm-dialog",{ref:he,title:X,messageText:q,cancelButtonText:$,confirmButtonText:ee,confirmDialogStyle:JSON.stringify(Wr(ne,ye))})})]})}const ys={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},ws={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},fs={width:"calc(100% - 280px)",height:"100%"},Ds={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},Es={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},vs={width:"280px",height:"100%",position:"relative"},Is=(e,t)=>({...ws,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),Ss=(e,t,n,o,r)=>n?Fs(o,r):ks(e,t),Fs=(e,t)=>({...e||t?{visibility:"hidden"}:{visibility:"visible"},...Ds,borderRadius:"inherit"}),ks=(e,t)=>{const n=e?.borderRadius||0;return{...vs,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},Ts=(e,t,n,o)=>t?Ms(n,o):Bs(e),Ms=(e,t)=>({...e||t?{visibility:"visible"}:{visibility:"hidden"},...Ds,borderRadius:"inherit"}),Bs=e=>{const t=e?.borderRadius||0;return{...fs,borderRadius:`0 ${t} ${t} 0`}},Ls=(e,t)=>({...ys,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),Us=e=>({width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...e?.conversationsStyle}),Rs=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},Ps=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},Os=(e,t)=>({background:t?.background,...e}),js=(e,t,n)=>{let o={visibility:"hidden"};return t||n||e||(o={visibility:"visible"}),{...Es,...o,width:"calc(100% - 280px)"}},Vs=(e,t)=>({height:t?.backdropStyle?.height||e?.height,width:t?.backdropStyle?.width||e?.width,background:t?.backdropStyle?.background||"rgba(0, 0, 0, 0.5)",border:t?.backdropStyle?.border||"0 none",borderRadius:t?.backdropStyle?.borderRadius||"0"}),Gs=(e,t)=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:e?t.palette.getAccent600():t.palette.getPrimary()});function Hs(e,t){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:t?.closeIconTint||e.palette.getPrimary(),background:"transparent",position:"absolute",top:"8px",right:"12px"}}function Qs(e,t){return{background:t?.submitButtonBackground||e.palette.getPrimary(),buttonTextColor:t?.submitButtonTextColor||e.palette.getAccent900(),buttonTextFont:t?.submitButtonTextFont||n.fontHelper(e.typography.title2),height:"100%",width:"100%",border:"none",borderRadius:"8px",padding:"8px",display:"flex",justifyContent:"center",textAlign:"center"}}function Ns(e,t){return{height:"30px",textAlign:"center",font:t?.titleTextFont||n.fontHelper(e.typography.title1),padding:"10px 0px",color:t?.titleTextColor||e.palette.getAccent()}}function Ks(e,t){return{height:t?.height||"94%",width:t?.width||"100%",background:t?.background||e.palette.getBackground(),border:t?.border||"none",borderRadius:t?.borderRadius||"none",boxShadow:t?.boxShadow||"0",padding:t?.padding||"0",display:"flex",zIndex:1}}const zs=(e,t,o,r)=>({width:t===n.TabsVisibility.usersAndGroups?"50%":"100%",height:r?.tabHeight||"100%",borderRadius:r?.tabBorderRadius||"0",border:r?.tabBorder||"none",titleTextFont:r?.tabTitleTextFont||n.fontHelper(e.typography.text2),titleTextColor:r?.tabTitleTextColor||e.palette.getAccent(),activeTitleTextFont:r?.activeTabTitleTextFont||n.fontHelper(e.typography.text2),activeTitleTextColor:r?.activeTabTitleTextColor||e.palette.getAccent(),activeBackground:r?.activeTabBackground||e.palette.getBackground(),activeBorderRadius:"8px",background:r?.tabBackground||"#ececec",boxShadow:"0px 3px 8px rgba(20, 20, 20, 0.12), 0 3px 1px rgba(20, 20, 20, 0.04)"});function Js(e,t){return{position:"relative",boxSizing:"border-box",background:e?.background||t.palette.getBackground(),width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent50()}`,borderRadius:e?.borderRadius||"0",overflow:"hidden"}}function Ys(e){return{...void 0!==e?e:{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function _s(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"28px",height:e?.height||"28px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.caption1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Ws(e,t,r){return new o.ListItemStyle({height:e?.height||"auto",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||r.palette.getAccent100(),borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent(),border:e?.border||"none",padding:e?.padding||"0",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent100(),hoverBackground:e?.hoverBackground||r.palette.getAccent50()})}function Zs(e,t){return new r.GroupsStyle({background:"inherit",width:"100%",height:"100%",border:"none",borderRadius:"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),searchPlaceholderTextFont:e?.searchPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),searchPlaceholderTextColor:e?.searchPlaceholderTextColor||t.palette.getAccent500(),searchTextFont:e?.searchTextFont||n.fontHelper(t.typography.subtitle1),searchTextColor:e?.searchTextColor||t.palette.getAccent(),searchBorder:e?.searchBorder||"none",searchBorderRadius:e?.searchBorderRadius||"8px",searchBackground:e?.searchBackground||t.palette.getAccent50(),searchIconTint:e?.searchIconTint||t.palette.getAccent500(),separatorColor:e?.separatorColor||t.palette.getAccent400(),loadingIconTint:e?.loadingIconTint||t.palette.getAccent600(),emptyStateTextFont:e?.emptyStateTextFont||n.fontHelper(t.typography.heading),emptyStateTextColor:e?.emptyStateTextColor||t.palette.getAccent600(),errorStateTextFont:e?.errorStateTextFont||n.fontHelper(t.typography.heading),errorStateTextColor:e?.errorStateTextColor||t.palette.getAccent600()})}function Xs(e,t){return{font:e?.subTitleTextFont||n.fontHelper(t.typography.subtitle2),color:e?.subTitleTextColor||t.palette.getAccent600()}}class qs{constructor(e){const{searchText:t,groupsRequestBuilder:n,searchRequestBuilder:o,groupsSearchText:r}=e;let s=n||this.getDefaultRequestBuilder();t&&o?(s=o,s.setSearchKeyword(t)):t&&!o&&n?(s=n,s.setSearchKeyword(t)):!t&&n&&o?(s=n,s.setSearchKeyword(r.current)):t||!n||o?t||n||!o?s.setSearchKeyword(t):(s=this.getDefaultRequestBuilder(),s.setSearchKeyword(r.current)):(s=n,s.setSearchKeyword(r.current)),this.groupsRequest=s.build()}fetchNext(){return this.groupsRequest.fetchNext()}getDefaultRequestBuilder(){return(new s.CometChat.GroupsRequestBuilder).setLimit(qs.defaultLimit)}static async getLoggedInUser(){return void 0===this.loggedInUser&&(this.loggedInUser=await s.CometChat.getLoggedinUser()),this.loggedInUser}static createGroupListener(e){return new s.CometChat.GroupListener({onGroupMemberJoined:async(t,n,o)=>{const r=await qs.getLoggedInUser(),s=o.getMembersCount();n.getUid()===r?.getUid()&&o.setHasJoined(!0),e({type:"updateGroupForSDKEvents",group:o,hasJoined:!0,newCount:s})},onGroupMemberLeft:async(t,n,o)=>{const r=o.getMembersCount(),s=await qs.getLoggedInUser();n.getUid()===s?.getUid()&&o.setHasJoined(!1),e({type:"updateGroupForSDKEvents",group:o,hasJoined:!1,newCount:r})},onMemberAddedToGroup:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()&&r.setHasJoined(!0),e({type:"updateGroupForSDKEvents",group:r,hasJoined:!0,newCount:s,addGroup:!0})},onGroupMemberKicked:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()?(r.setHasJoined(!1),e({type:"updateGroupForSDKEvents",group:r,hasJoined:!1,newCount:s})):e({type:"updateGroupForSDKEvents",group:r,newCount:s})},onGroupMemberBanned:async(t,n,o,r)=>{const s=r.getMembersCount(),i=await qs.getLoggedInUser();n.getUid()===i?.getUid()?e({type:"removeGroup",guid:r.getGuid()}):e({type:"updateGroupForSDKEvents",group:r,newCount:s})},onGroupMemberScopeChanged:async(t,n,o,r,s)=>{const i=await qs.getLoggedInUser(),a=s.getMembersCount();n.getUid()===i?.getUid()&&s.setScope(o),e({type:"updateGroupForSDKEvents",group:s,newScope:o,newCount:a})}})}static attachListeners(e){const t="GroupsList_"+String(Date.now());return s.CometChat.addGroupListener(t,qs.createGroupListener(e)),()=>s.CometChat.removeGroupListener(t)}static attachConnestionListener(e){const t="GroupsList_connection_"+String(Date.now());return s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}})),()=>s.CometChat.removeConnectionListener(t)}}qs.defaultLimit=30;var $s="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ei="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",ti="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",ni="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",oi=(e,t)=>{let n=e;const{type:o}=t;switch(o){case"appendGroups":if(t.groups.length>0){let o=[];t.removeOldGroups?(e.groupList=[],o=t.groups):o=[...e.groupList,...t.groups],n={...e,groupList:o}}n={...e,groupList:[...e.groupList,...t.groups]};break;case"setGroupList":n={...e,groupList:t.groupList};break;case"setFetchState":n={...e,fetchState:t.fetchState};break;case"updateGroup":{const{groupList:o}=e,{group:r}=t,s=r.getGuid(),i=o.findIndex(e=>e.getGuid()===s);i>-1&&(n={...e,groupList:o.map((e,t)=>t===i?r:e)});break}case"removeGroup":{const{groupList:o}=e,r=t.guid,s=o.findIndex(e=>e.getGuid()===r);s>-1&&(n={...e,groupList:o.filter((e,t)=>t!==s)});break}case"prependGroup":n={...e,groupList:[t.group,...e.groupList]};break;case"setSearchText":n={...e,searchText:t.searchText};break;case"setIsFirstReload":n={...e,isFirstReload:t.isFirstReload};break;case"updateGroupForSDKEvents":{const{groupList:o,searchText:r}=e,{group:s,hasJoined:i,newScope:a,newCount:l,addGroup:c}=t,C=s.getGuid(),d=o.findIndex(e=>e.getGuid()===C);if(c&&r&&r.length>0)return e;if(d>-1){const t=o[d];void 0!==i&&t.setHasJoined(i),void 0!==a&&t.setScope(a),void 0!==l&&t.setMembersCount(l),n={...e,groupList:o.map((e,n)=>n===d?t:e)}}else c&&(void 0!==i&&s.setHasJoined(i),void 0!==a&&s.setScope(a),void 0!==l&&s.setMembersCount(l),n={...e,groupList:[s,...o]});break}}return n};function ri(e){const{menus:o=null,title:i=n.localize("GROUPS"),titleAlignment:a=n.TitleAlignment.left,searchPlaceholderText:l=n.localize("SEARCH"),searchIconURL:c=ti,hideSearch:C=!1,groupsRequestBuilder:g=null,searchRequestBuilder:u=null,onError:p,listItemView:h=null,hideSeparator:m=!1,subtitleView:A=null,options:y=null,selectionMode:w=n.SelectionMode.none,onSelect:f,onItemClick:D,activeGroup:E=null,loadingIconURL:v=ni,loadingStateView:I,emptyStateText:S=n.localize("NO_GROUPS_FOUND"),emptyStateView:F,errorStateText:T=n.localize("SOMETHING_WRONG"),errorStateView:R,hideError:P=!1,passwordGroupIcon:O=$s,privateGroupIcon:j=ei,statusIndicatorStyle:V,avatarStyle:G,listItemStyle:H,groupsStyle:Q}=e,[N,K]=t.useReducer(oi,{searchText:"",groupList:[],fetchState:n.States.loading,isFirstReload:!1}),z=t.useRef(null),J=t.useRef(""),Y=x(p),{theme:_}=t.useContext(U),W=t.useRef(!1),Z=t.useRef(!1),X=t.useRef("");N.searchText!==X.current&&N.searchText.trim().length>0&&N.searchText.trim().length==N.searchText.length&&(X.current=N.searchText),N.isFirstReload&&(W.current=!0,N.isFirstReload=!1);const q=t.useCallback(e=>{const t=e.trim();(0===e.length||t.length===e.length&&t.length>0)&&(X.current="",K({type:"setSearchText",searchText:e}))},[K]),$=t.useCallback(async e=>{const t=z.current;if(!t)return;let o=Z.current?n.States.loaded:n.States.loading;K({type:"setFetchState",fetchState:o});try{const o=await t.fetchNext();if(e!==J.current)return;if(0!==o.length){let e=!!Z.current;K({type:"appendGroups",groups:o,removeOldGroups:e})}K({type:"setFetchState",fetchState:n.States.loaded}),W.current&&(qs.attachConnestionListener(()=>{const e=null===g?(new s.CometChat.GroupsRequestBuilder).setLimit(30):g;z.current=new qs({searchText:X.current,groupsRequestBuilder:e,searchRequestBuilder:u,groupsSearchText:X}),Z.current=!0}),W.current=!1),Z.current?Z.current=!1:K({type:"setFetchState",fetchState:n.States.loaded})}catch(t){e===J.current&&N.groupList?.length<=0&&K({type:"setFetchState",fetchState:n.States.error}),Y(t)}},[Y,K]);function ee(e){let t="";switch(e.getType()){case n.CometChatUIKitConstants.GroupTypes.password:t=O;break;case n.CometChatUIKitConstants.GroupTypes.private:t=j}return t}function te(e){if(null!==A)return A(e);const t=e.getMembersCount();return d.jsx("div",{className:"cc-groups__subtitle",style:Xs(Q,_),children:`${t} ${t>1?n.localize("MEMBERS"):n.localize("MEMBER")}`})}function ne(e){let t;return(t=y?.(e))?.length?d.jsx(B,{data:t,onOptionClick:e=>e.detail.data.onClick?.()}):null}function oe(e){switch(w){case n.SelectionMode.none:return null;case n.SelectionMode.single:return d.jsx(L,{onChange:t=>f?.(e,t.detail.checked)});case n.SelectionMode.multiple:return d.jsx(b,{onChange:t=>f?.(e,t.detail.checked),checkboxStyle:{height:"24px",width:"24px",border:"none",borderRadius:"4px",checkedBackgroundColor:_.palette.getPrimary(),uncheckedBackgroundColor:_.palette.getAccent400()}})}}function re(e){switch(e.getType()){case n.CometChatUIKitConstants.GroupTypes.private:return Q?.privateGroupIconBackground||_.palette.getSuccess()||"rgb(0, 200, 111)";case n.CometChatUIKitConstants.GroupTypes.password:return Q?.passwordGroupIconBackground||"rgb(247, 165, 0)";default:return null}}return function(e){const{groupsRequestBuilder:o,searchRequestBuilder:s,searchText:i,fetchNextIdRef:a,groupsManagerRef:l,dispatch:c,fetchNextAndAppendGroups:C,groupsSearchText:d}=e;t.useEffect(()=>{o?.searchKeyword?d.current=o?.searchKeyword:s?.searchKeyword&&(d.current=s?.searchKeyword)},[]),t.useEffect(()=>{c({type:"setIsFirstReload",isFirstReload:!0}),c({type:"setGroupList",groupList:[]}),l.current=new qs({searchText:i,groupsRequestBuilder:o,searchRequestBuilder:s,groupsSearchText:d}),C(a.current="initialFetch_"+String(Date.now()))},[C,o,s,i,c,a,l,d]),t.useEffect(()=>qs.attachListeners(c),[c]),t.useEffect(()=>{const e=n.CometChatGroupEvents.ccGroupCreated.subscribe(e=>{c({type:"prependGroup",group:r.CometChatUIKitUtility.clone(e)})}),t=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{c({type:"removeGroup",guid:e.getGuid()})}),o=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{c({type:"updateGroup",group:r.CometChatUIKitUtility.clone(e.joinedGroup)})}),s=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{c({type:"updateGroup",group:r.CometChatUIKitUtility.clone(e.kickedFrom)})}),i=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{e.leftGroup.getType()===n.CometChatUIKitConstants.GroupTypes.private?c({type:"removeGroup",guid:e.leftGroup.getGuid()}):c({type:"updateGroup",group:e.leftGroup})}),a=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{c({type:"updateGroup",group:e.kickedFrom})}),l=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{c({type:"updateGroup",group:e.userAddedIn})}),C=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{c({type:"updateGroup",group:e.group})});return()=>{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),s.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),C.unsubscribe()}},[c])}({searchText:N.searchText,groupsRequestBuilder:g,searchRequestBuilder:u,fetchNextIdRef:J,groupsManagerRef:z,dispatch:K,fetchNextAndAppendGroups:$,groupsSearchText:X}),d.jsxs("div",{className:"cc-groups",style:Js(Q,_),children:[null===o?o:d.jsx("div",{className:"cc-groups__menus",style:{position:"absolute",top:"16px",right:"16px",cursor:"pointer",display:"flex",flexDirection:"row-reverse",width:"24px"},children:o}),d.jsx(k,{title:i,titleAlignment:a,searchPlaceholderText:l,searchIconURL:c,hideSearch:C,searchText:N.searchText,onSearch:q,list:N.groupList,listItem:null!==h?h:function(e){return d.jsx(M,{id:e.getGuid(),avatarURL:e.getIcon(),avatarName:e.getName(),title:e.getName(),statusIndicatorColor:re(e),statusIndicatorIcon:ee(e),hideSeparator:m,isActive:w===n.SelectionMode.none&&E?.getGuid()===e.getGuid(),statusIndicatorStyle:Ys(V),avatarStyle:_s(G,_),listItemStyle:Ws(H,Q,_),subtitleView:te(e),subtitleViewClassName:"cc-groups__subtitle-view",menuView:ne(e),menuViewClassName:"cc-groups__options-view",tailView:oe(e),tailViewClassName:"cc-group__tail-view",onClick:t=>D?.(e)})},onScrolledToBottom:()=>$(J.current="onScrolledToBottom_"+String(Date.now())),listItemKey:"getGuid",showSectionHeader:!1,state:N.fetchState===n.States.loaded&&0===N.groupList.length?n.States.empty:N.fetchState,loadingIconURL:v,loadingView:I,emptyStateText:S,emptyStateView:F,errorStateText:T,errorStateView:R,hideError:P,listStyle:Zs(Q,_)})]})}const si={title:n.localize("NEW_CHAT"),usersTabTitle:n.localize("USERS"),groupsTabTitle:n.localize("GROUPS"),groupsConfiguration:new r.GroupsConfiguration({}),usersConfiguration:new r.UsersConfiguration({}),onError:e=>{console.log(e)},tabVisibility:n.TabsVisibility.usersAndGroups,contactsStyle:{},selectionLimit:5,hideSubmitButton:!0,submitButtonText:"Submit",selectionMode:n.SelectionMode.none},ii=e=>{const[o,r]=t.useState([]),i=t.useRef([]),a=t.useRef([]),[l,c]=t.useState(!0),[C,g]=t.useState(!0),[u,p]=t.useState(!1),h=t.useRef(),m=t.useRef(),{theme:A}=t.useContext(U),{title:x,usersTabTitle:b,groupsTabTitle:y,closeIconURL:w,onClose:f,usersConfiguration:D,groupsConfiguration:E,onItemClick:v,tabVisibility:I,contactsStyle:S,selectionLimit:F,hideSubmitButton:k,submitButtonText:T,selectionMode:M,onSubmitButtonClick:B}={...si,...e};t.useEffect(()=>{const e=(new s.CometChat.UsersRequestBuilder).setLimit(30).hideBlockedUsers(!0),t=(new s.CometChat.UsersRequestBuilder).setLimit(30).hideBlockedUsers(!0),o=(new s.CometChat.GroupsRequestBuilder).setLimit(30).joinedOnly(!0),i=(new s.CometChat.GroupsRequestBuilder).setLimit(30).joinedOnly(!0);h.current=new n.CometChatTabItem({id:"users",title:b,style:zs(A,I,0,S),childView:d.jsx(q,{title:"",activeUser:void 0,hideSearch:D?.hideSearch||!1,searchIconURL:D?.searchIconURL,searchRequestBuilder:D?.searchRequestBuilder||t,onItemClick:D?.onItemClick||L,usersStyle:D?.usersStyle,subtitleView:D?.subtitleView,options:D?.options??void 0,usersRequestBuilder:D?.usersRequestBuilder||e,emptyStateView:D?.emptyStateView,onSelect:D?.onSelect||j,loadingIconURL:D?.loadingIconURL,errorStateView:D?.errorStateView,loadingStateView:D?.loadingStateView,tileAlignment:D?.titleAlignment,showSectionHeader:D?.showSectionHeader,listItemView:D?.listItemView,menus:D?.menu,hideSeparator:D?.hideSeparator,hideError:D?.hideError,selectionMode:M,listItemStyle:D?.listItemStyle,disableUsersPresence:D?.disableUsersPresence,statusIndicatorStyle:D?.statusIndicatorStyle,avatarStyle:D?.avatarStyle}),isActive:l}),m.current=new n.CometChatTabItem({id:"groups",title:y,style:zs(A,I,0,S),childView:d.jsx(ri,{title:"",activeGroup:void 0,hideSearch:E?.hideSearch||!1,searchIconURL:E?.searchIconURL,searchRequestBuilder:E?.searchRequestBuilder||i,onItemClick:E?.onItemClick||R,groupsStyle:E?.groupsStyle,subtitleView:E?.subtitleView,options:E?.options??void 0,privateGroupIcon:E?.privateGroupIcon,passwordGroupIcon:E?.passwordGroupIcon||E?.protectedGroupIcon,groupsRequestBuilder:E?.groupsRequestBuilder||o,emptyStateView:E?.emptyStateView,onSelect:E?.onSelect||O,loadingIconURL:E?.loadingIconURL,errorStateView:E?.errorStateView,loadingStateView:E?.loadingStateView,titleAlignment:E?.titleAlignment,listItemView:E?.listItemView,menus:E?.menu,hideSeparator:E?.hideSeparator,hideError:E?.hideError,selectionMode:M,listItemStyle:E?.listItemStyle}),isActive:u}),r([h.current,m.current])},[]),t.useEffect(()=>{I===n.TabsVisibility.groups?(p(!0),c(!1),r([m.current])):I===n.TabsVisibility.users?(p(!1),c(!0),r([h.current])):I===n.TabsVisibility.usersAndGroups&&(p(!1),c(!0),r([h.current,m.current]))},[I]);const L=e=>{v&&v(e,void 0)},R=e=>{v&&v(void 0,e)},P=()=>{B&&B(a.current,i.current)},O=e=>{var t=i.current.findIndex(t=>t?.getGuid()===e.getGuid());t>=0?i.current.splice(t,1):i.current.push(e),g(a.current.length+i.current.length>F)},j=e=>{var t=a.current.findIndex(t=>t?.getUid()===e.getUid());t>=0?a.current.splice(t,1):a.current.push(e),g(a.current.length+i.current.length>F)};return o.length?d.jsx("div",{className:"cc-contacts-wrapper",style:Ks(A,S),children:d.jsxs("div",{className:"cc-contacts",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column"},children:[d.jsx("div",{className:"cc-contacts-header",style:Ns(A,S),children:x}),d.jsxs("div",{className:"cc-contacts-content",style:{height:"calc(100% - 50px)"},children:[d.jsx(ro,{tabAlignment:n.TabAlignment.right,tabs:o,tabsStyle:{height:"100%",width:"100%",tabListHeight:"30px",tabListBackground:"#ececec",tabListPadding:"2px 2px",tabListBorderRadius:"8px",tabPaneWidth:"100%",tabPaneHeight:"calc(100% - 30px)"},keepAlive:!0}),function(){const e=w&&""!==w?w:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";return d.jsx(J,{iconURL:e,hoverText:n.localize("CLOSE"),buttonStyle:Hs(A,S),onClick:f})}()]}),M===n.SelectionMode.none&&k?d.jsx(d.Fragment,{}):d.jsx("div",{className:"cc-contacts__submit--buttons",style:{boxSizing:"border-box"},children:d.jsx(J,{text:T,buttonStyle:Qs(A,S),disabled:C,onClick:P})})]})}):d.jsx(d.Fragment,{})},ai=(e,t)=>{const n=o.isMobileDevice()?{position:"fixed",bottom:0,left:0,right:0,marginBottom:0,overflow:"hidden"}:{position:"relative"};return{display:"flex",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"0 none",borderRadius:e?.borderRadius||"inherit",background:e?.background||t.palette.getBackground(),...n}},li={position:"absolute",top:"0",left:"0",height:"100%",width:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",maxWidth:"100%",zIndex:"1"},ci={position:"absolute",top:"0",left:"0",height:"100%",width:"100%",maxHeight:"100%",overflowY:"auto",overflowX:"hidden",maxWidth:"100%",zIndex:"1",borderRadius:"inherit"},Ci={width:"100%",borderRadius:"inherit"},di={height:"100%",width:"100%",overflow:"hidden"},gi=e=>({border:"0 none",background:"inherit",borderRadius:"inherit",...e?.messageHeaderStyle}),ui=e=>({border:"0 none",background:"inherit",borderRadius:"inherit",...e?.messageListStyle}),pi=e=>({...e?.messageComposerStyle}),hi=(e,t,n)=>({...e?.detailsStyle});function mi(e){return{height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:e.palette.getPrimary(),padding:0}}const Ai={position:"absolute",display:"flex",alignItems:"center",height:"100%",width:"100%",justifyContent:"center",zIndex:1e3,overflow:"hidden"};function xi(e,t){return{boxSizing:"border-box",width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||t.palette.getBackground(),position:"relative",padding:"19px",display:"flex",flexDirection:"column",overflowY:"auto",overflowX:"hidden"}}function bi(e,t){return{background:"inherit",textFont:e?.titleTextFont||n.fontHelper(t.typography.title1),textColor:e?.titleTextColor||t.palette.getAccent()}}function yi(e,t){return{width:"24px",height:"24px",background:"transparent",border:"none",borderRadius:"0",buttonIconTint:e?.closeButtonIconTint||t.palette.getPrimary(),position:"absolute",right:"12px"}}function wi(e,t){return{width:e?.width||"100%",height:e?.height||"fit-content",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"inherit",activeBackground:e?.activeBackground||"transparent",hoverBackground:e?.hoverBackground||"transparent",separatorColor:e?.separatorColor||t.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent()}}function fi(e,t){return{...e??{},width:e?.width||"12px",height:e?.height||"12px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px"}}function Di(e,t){return{width:e?.width||"36px",height:e?.height||"36px",border:e?.border||"none",borderRadius:e?.borderRadius||"24px",backgroundColor:e?.backgroundColor||t.palette.getAccent700(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"}}function Ei(e,t,o){return{background:"inherit",textFont:t?.subtitleTextFont||n.fontHelper(o.typography.subtitle2),textColor:e?o.palette.getPrimary():t?.subtitleTextColor}}function vi(e){return{background:"inherit",textFont:e.titleFont,textColor:e.titleColor}}function Ii(e){return{width:"100%",height:"100%",border:"none",borderRadius:"0",buttonTextFont:e.titleFont,buttonTextColor:e.titleColor,backgroundColor:e.backgroundColor||"inherit",buttonIconTint:e.iconTint,padding:"18px 0 16px 0"}}function Si(e,t){return{background:"rgba(0, 0, 0, 0.5)",position:"absolute",width:t?.width,height:t?.height,...e}}function Fi(e,t,o){return{confirmButtonBackground:e?.confirmButtonBackground||o.palette.getPrimary(),cancelButtonBackground:e?.cancelButtonBackground||o.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||o.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(o.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||o.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(o.typography.text2),titleFont:e?.titleFont||n.fontHelper(o.typography.title1),titleColor:e?.titleColor||o.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(o.typography.subtitle2),messageTextColor:e?.messageTextColor||o.palette.getAccent600(),background:e?.background||t?.background||o.palette.getBackground(),width:e?.width||"320px",height:e?.height||"100%",border:e?.border||`1px solid ${o.palette.getAccent200()}`,borderRadius:e?.borderRadius||"8px",boxShadow:e?.boxShadow}}function ki(e,t){return{confirmButtonBackground:e?.confirmButtonBackground||t.palette.getError(),cancelButtonBackground:e?.cancelButtonBackground||t.palette.getSecondary(),confirmButtonTextColor:e?.confirmButtonTextColor||t.palette.getAccent900("light"),confirmButtonTextFont:e?.confirmButtonTextFont||n.fontHelper(t.typography.text2),cancelButtonTextColor:e?.cancelButtonTextColor||t.palette.getAccent900("dark"),cancelButtonTextFont:e?.cancelButtonTextFont||n.fontHelper(t.typography.text2),titleFont:e?.titleFont||n.fontHelper(t.typography.title1),titleColor:e?.titleColor||t.palette.getAccent(),messageTextFont:e?.messageTextFont||n.fontHelper(t.typography.subtitle2),messageTextColor:e?.messageTextColor||t.palette.getAccent600(),background:e?.background||t.palette.getBackground(),width:e?.width||"320px",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent200()}`,borderRadius:e?.borderRadius||"8px",boxShadow:e?.boxShadow}}function Ti(e,t,n){return{width:"100%",height:(t?"2":"1")+"px",background:e||n.palette.getAccent200()}}const Mi=(e,t)=>{const n=e?.groupMembersStyle;return{background:n?.background||t?.background,...n}},Bi=(e,t)=>{const n=e?.addMembersStyle;return{background:n?.background||t?.background,...n}},Li=(e,t)=>{const n=e?.bannedMembersStyle;return{background:n?.background||t?.background,...n}},Ui=(e,t)=>{const n=e?.transferOwnershipStyle;return{background:n?.background||t?.background,...n}};var Ri="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Pi="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Oi(e,t,n){const o=document.querySelector(t),r=document.querySelector(e);if(!o||!r)return;const s=r,{width:i,height:a}=o.getBoundingClientRect(),l="undefined"!=typeof window&&window.innerWidth<=768,c=l?i:.8*i,C=l?a:.8*a;s.style.width=`${Math.floor(c)}px`,s.style.height=`${Math.floor(C)}px`,s.style.maxWidth=l?"100%":"360px",s.style.maxHeight=l?"100%":"620px",s.style.minHeight=l?"100%":"300px",s.style.borderRadius=l?n?.borderRadius||"0":n?.borderRadius||"8px"}function ji(e,t){const n=e=>"string"==typeof e&&e.trim().endsWith("%");let o=e?.width,r=e?.height;return!n(o)&&!n(r)&&r&&o||Oi(".cc-transfer-ownership",".cc-details",e),{boxSizing:"border-box",width:e?.width||"max(100%, 360px)",height:e?.height||"90%",border:e?.border||"none",borderRadius:e?.borderRadius||"8px",background:e?.background||t.palette.getBackground(),display:"flex",flexDirection:"column"}}function Vi(e,t,r){const s={height:"14px",width:"14px",border:"none",borderRadius:"4px",background:"inherit"};return r?new o.RadioButtonStyle({...s,labelTextColor:e?.MemberScopeTextColor||t.palette.getAccent600(),labelTextFont:e?.MemberScopeTextFont||n.fontHelper(t.typography.text2)}):new o.LabelStyle({...s,textColor:e?.MemberScopeTextColor||t.palette.getAccent600(),textFont:e?.MemberScopeTextFont||n.fontHelper(t.typography.text2)})}function Gi(e,t){return{width:"100%",background:t.palette.getPrimary(),padding:"16px",buttonTextColor:e?.transferButtonTextColor||t.palette.getAccent900(),buttonTextFont:e?.transferButtonTextFont||n.fontHelper(t.typography.title2),display:"flex",justifyContent:"center",textAlign:"center",border:"none",borderRadius:"8px"}}function Hi(e,t){return{width:"100%",background:"#f1f1f1",padding:"16px",color:e?.cancelButtonTextColor||t.palette.getAccent(),font:e?.cancelButtonTextFont||n.fontHelper(t.typography.title2),display:"flex",justifyContent:"center",textAlign:"center",border:"0 none",borderRadius:"8px"}}function Qi(e,t){return new o.AvatarStyle({borderRadius:e?.borderRadius||"24px",width:e?.width||"36px",height:e?.height||"36px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,backgroundColor:e?.backgroundColor||t.palette.getAccent700(),nameTextColor:e?.nameTextColor||t.palette.getAccent900(),backgroundSize:e?.backgroundSize||"cover",nameTextFont:e?.nameTextFont||n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:e?.outerViewBorderWidth||"0",outerViewBorderRadius:e?.outerViewBorderRadius||"0",outerViewBorderColor:e?.outerViewBorderColor||"",outerViewBorderSpacing:e?.outerViewBorderSpacing||"0"})}function Ni(e,t,r){return new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||r.palette.getBackground(),activeBackground:e?.activeBackground||"",hoverBackground:e?.hoverBackground||"",separatorColor:e?.separatorColor||t?.separatorColor||r.palette.getAccent200(),titleFont:e?.titleFont||n.fontHelper(r.typography.title2),titleColor:e?.titleColor||r.palette.getAccent()})}function Ki(e,t){return new r.GroupMembersStyle({height:e?.height||"100%",width:e?.width||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"inherit",background:e?.background||"inherit",titleTextFont:e?.titleTextFont||n.fontHelper(t.typography.title1),titleTextColor:e?.titleTextColor||t.palette.getAccent(),emptyStateTextFont:e?.emptyStateTextFont||"",emptyStateTextColor:e?.emptyStateTextColor||"",errorStateTextFont:e?.errorStateTextFont||"",errorStateTextColor:e?.errorStateTextColor||"",loadingIconTint:e?.loadingIconTint||"",searchIconTint:e?.searchIconTint||"",searchBorder:e?.searchBorder||"",searchBorderRadius:e?.searchBorderRadius||"",searchBackground:e?.searchBackground||"",searchPlaceholderTextFont:e?.searchPlaceholderTextFont||"",searchPlaceholderTextColor:e?.searchPlaceholderTextColor||"",searchTextFont:e?.searchTextFont||"",searchTextColor:e?.searchTextColor||"",onlineStatusColor:e?.onlineStatusColor||t.palette.getSuccess(),backButtonIconTint:e?.backButtonIconTint||t.palette.getPrimary(),closeButtonIconTint:e?.closeButtonIconTint||t.palette.getPrimary(),padding:e?.padding||"0",separatorColor:e?.separatorColor||t.palette.getAccent200(),boxShadow:e?.boxShadow})}var zi="data:image/svg+xml,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M4.9598%2011.531C5.47958%2012.7541%206.4639%2013.7205%207.69625%2014.2178C8.92859%2014.7151%2010.308%2014.7024%2011.531%2014.1826C12.754%2013.6629%2013.7205%2012.6785%2014.2178%2011.4462C14.715%2010.2139%2014.7024%208.83445%2014.1826%207.61142C13.6629%206.3884%2012.6785%205.42195%2011.4462%204.92467C10.2138%204.4274%208.83444%204.44004%207.61141%204.95981C6.38839%205.47959%205.42194%206.46391%204.92467%207.69626C4.42739%208.9286%204.44003%2010.308%204.9598%2011.531V11.531Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M13.114%2013.1139L17.0001%2017.0005%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.25%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",Ji="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Yi(e){const{group:o,title:i=n.localize("TRANSFER_OWNERSHIP"),titleAlignment:a=n.TitleAlignment.center,searchIconURL:l=zi,searchPlaceholder:c=n.localize("SEARCH"),hideSearch:C=!1,groupMembersRequestBuilder:g,searchRequestBuilder:u,loadingIconURL:p=Ji,loadingStateView:h,emptyStateText:A=n.localize("NO_USERS_FOUND"),emptyStateView:b,errorStateText:y=n.localize("SOMETHING_WRONG"),errorStateView:w,onError:f,hideSeparator:D=!1,disableUsersPresence:E=!1,closeButtonIconURL:v,onClose:I,listItemView:S,subtitleView:F,transferButtonText:k=n.localize("TRANSFER_OWNERSHIP"),onTransferOwnership:T,cancelButtonText:M=n.localize("CANCEL"),options:B,statusIndicatorStyle:R,avatarStyle:P=null,listItemStyle:O=null,groupMemberStyle:j=null,transferOwnershipStyle:V=null}=e,[G,H]=t.useState(null),[Q,N]=t.useState(!0),K=t.useRef(null),z=x(f),Y=m(T),_=m(o),{theme:W}=t.useContext(U);const Z=t.useCallback(async()=>{const e=K.current;if(e)try{const t=Y.current;if(t)t(e);else{const t=_.current;if(await s.CometChat.transferGroupOwnership(t.getGuid(),e.getUid()),G){const o=r.CometChatUIKitUtility.clone(t);o.setOwner(e.getUid()),n.CometChatGroupEvents.ccOwnershipChanged.next({group:o,newOwner:r.CometChatUIKitUtility.clone(e)}),I&&I()}}K.current=null}catch(e){z(e)}},[z,G,_,Y]);return function(e){const{errorHandler:n,setLoggedInUser:o}=e;t.useEffect(()=>{(async()=>{try{o(await s.CometChat.getLoggedinUser())}catch(e){n(e)}})()},[n,o])}({errorHandler:z,setLoggedInUser:H}),d.jsxs("div",{className:"cc-transfer-ownership",style:ji(V,W),children:[d.jsx(he,{menus:void 0,hideError:void 0,onItemClick:void 0,dropDownIconURL:void 0,groupScopeStyle:void 0,onBack:void 0,backButtonIconURL:void 0,showBackButton:!1,options:B,group:o,title:i,titleAlignment:a,searchIconURL:l,searchPlaceholder:c,hideSearch:C,groupMemberRequestBuilder:g,searchRequestBuilder:u,loadingIconURL:p,loadingStateView:h,emptyStateText:A,emptyStateView:b,errorStateText:y,errorStateView:w,onError:z,hideSeparator:D,disableUsersPresence:E,closeButtonIconURL:v,onClose:I,selectionMode:n.SelectionMode.none,listItemView:S,subtitleView:F,tailView:function(e){const t=o.getOwner()===e.getUid()?n.CometChatUIKitConstants.groupMemberScope.owner:e.getScope();return o.getOwner()===e.getUid()?d.jsx("cometchat-label",{text:n.localize(t.toUpperCase()),labelStyle:JSON.stringify(Vi(V,W,!1))}):d.jsx(L,{labelText:n.localize(t.toUpperCase()),radioButtonStyle:Vi(V,W,!0),onChange:()=>function(e){Q&&N(!1),K.current=e}(e)})},statusIndicatorStyle:R,avatarStyle:Qi(P,W),listItemStyle:Ni(O,j,W),groupMembersStyle:Ki(j,W)}),d.jsxs("div",{className:"cc-transfer-ownership__btns-wrapper",style:{flexShrink:"0",display:"flex",flexDirection:"column",rowGap:"8px",padding:"4px 28px 20px 28px",boxSizing:"border-box"},children:[d.jsx(J,{text:k,disabled:Q,buttonStyle:Gi(V,W),onClick:Z}),d.jsx(J,{text:M,buttonStyle:Hi(V,W),onClick:I})]})]})}var _i="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Wi="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function Zi(e){const{user:o,group:i,title:a=n.localize("DETAILS"),closeButtonIconURL:l=Pi,cancelButtonText:c=n.localize("CANCEL"),onClose:C,disableUsersPresence:g=!1,customProfileView:u=null,hideProfile:p=!1,privateGroupIcon:h=Wi,protectedGroupIcon:b=_i,passwordGroupIcon:y,subtitleView:w=null,data:f,onError:D,leaveButtonText:E=n.localize("LEAVE_GROUP"),leaveConfirmDialogMessage:v=n.localize("LEAVE_CONFIRM"),transferButtonText:I=n.localize("TRANSFER_OWNERSHIP"),transferConfirmDialogMessage:S=n.localize("TRANSFER_CONFIRM"),deleteButtonText:F=n.localize("DELETE"),deleteConfirmDialogMessage:k=n.localize("DELETE_CONFIRM"),addMembersConfiguration:T=null,bannedMembersConfiguration:B=null,groupMembersConfiguration:L=null,transferOwnershipConfiguration:R=null,listItemStyle:P=null,statusIndicatorStyle:O=null,avatarStyle:j=null,leaveDialogStyle:V=null,deleteDialogStyle:G=null,backdropStyle:H=null,detailsStyle:Q=null}=e,[N,K]=t.useState("none"),[z,Y]=t.useState(null),[_,W]=t.useState(null),[X,q]=t.useState(void 0),[$,ee]=A(null),[te,ne]=A(null),oe=m(C),re=x(D),{theme:se}=t.useContext(U),ie=t.useCallback((e,t)=>{const o=n.CometChatUIKitConstants.groupMemberAction.LEFT,i=new s.CometChat.Action(e.getGuid(),n.CometChatUIKitConstants.MessageTypes.groupMember,n.CometChatUIKitConstants.MessageReceiverType.group,n.CometChatUIKitConstants.MessageCategory.action);return i.setAction(o),i.setActionBy(r.CometChatUIKitUtility.clone(t)),i.setActionFor(r.CometChatUIKitUtility.clone(e)),i.setActionOn(r.CometChatUIKitUtility.clone(t)),i.setReceiver(r.CometChatUIKitUtility.clone(e)),i.setSender(r.CometChatUIKitUtility.clone(t)),i.setConversationId("group_"+e.getGuid()),i.setMuid(r.CometChatUIKitUtility.ID()),i.setMessage(`${t.getName()} ${o} ${t.getUid()}`),i.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),i},[]),ae=t.useCallback(async e=>{if(!(e instanceof s.CometChat.User))if(e.getOwner()===_?.getUid())Y({type:"transferOwnership"});else{Y(null);try{if(_){await s.CometChat.leaveGroup(e.getGuid());const t=r.CometChatUIKitUtility.clone(e);t.setHasJoined(!1),n.CometChatGroupEvents.ccGroupLeft.next({userLeft:r.CometChatUIKitUtility.clone(_),leftGroup:t,message:ie(t,_)}),oe.current?.()}}catch(e){re(e)}}},[_,Y,re,ie,oe]),le=t.useCallback(async e=>{if(!(e instanceof s.CometChat.User)){Y(null);try{await s.CometChat.deleteGroup(e.getGuid()),n.CometChatGroupEvents.ccGroupDeleted.next(r.CometChatUIKitUtility.clone(e)),oe.current?.()}catch(e){re(e)}}},[Y,re,oe]);function ce(e){if(e instanceof s.CometChat.User){let t=(new Z).getUserStatusVisible(e);if(!g&&!t)return Q?.onlineStatusColor||se.palette.getSuccess()||"rgb(0, 200, 111)"}else{const t=e.getType();if(t===n.CometChatUIKitConstants.GroupTypes.private)return Q?.privateGroupIconBackground||"#F7A500";if(t===n.CometChatUIKitConstants.GroupTypes.password)return Q?.passwordGroupIconBackground||"#F7A500"}return null}function Ce(e){let t="";if(e instanceof s.CometChat.Group){const o=e.getType();o===n.CometChatUIKitConstants.GroupTypes.private?t=h:o===n.CometChatUIKitConstants.GroupTypes.password&&(t=y||b)}return t}function de(e){if(e instanceof s.CometChat.User)return g?"":n.localize(e.getStatus().toUpperCase());const t=e.getMembersCount();return`${t} ${n.localize(t>1?"MEMBERS":"MEMBER")}`}function ge(e){if(w)return e instanceof s.CometChat.User?w(e):w(void 0,e);const t=e instanceof s.CometChat.User&&e.getStatus()===n.CometChatUIKitConstants.userStatusType.online;return e instanceof s.CometChat.User&&(e.getBlockedByMe()||e.getHasBlockedMe())?null:d.jsx("cometchat-label",{text:de(e),labelStyle:JSON.stringify(Ei(t,Q,se))})}function ue(e,t){const{id:o,onClick:i}=e;if(i)i(t);else switch(o){case n.CometChatUIKitConstants.UserOptions.viewProfile:t instanceof s.CometChat.User&&t.getLink()&&window.open(t.getLink(),"_blank");break;case n.CometChatUIKitConstants.UserOptions.block:t instanceof s.CometChat.User&&async function(e){if(!e.getBlockedByMe())try{await s.CometChat.blockUsers([e.getUid()]);const t=r.CometChatUIKitUtility.clone(e);t.setBlockedByMe(!0),n.CometChatUserEvents.ccUserBlocked.next(t),q(t)}catch(e){re(e)}}(t);break;case n.CometChatUIKitConstants.UserOptions.unblock:t instanceof s.CometChat.User&&async function(e){if(e.getBlockedByMe())try{await s.CometChat.unblockUsers([e.getUid()]);const t=r.CometChatUIKitUtility.clone(e);t.setBlockedByMe(!1),n.CometChatUserEvents.ccUserUnblocked.next(t),q(t)}catch(e){re(e)}}(t);break;case n.CometChatUIKitConstants.GroupOptions.viewMembers:t instanceof s.CometChat.Group&&K("groupMembers");break;case n.CometChatUIKitConstants.GroupOptions.addMembers:t instanceof s.CometChat.Group&&K("addMembers");break;case n.CometChatUIKitConstants.GroupOptions.bannedMembers:t instanceof s.CometChat.Group&&K("bannedMembers");break;case n.CometChatUIKitConstants.GroupOptions.leave:if(t instanceof s.CometChat.Group){const e=t.getOwner()===_?.getUid();Y({type:"leaveOrTransferConfirm",buttonText:e?I:E,confirmDialogMessage:e?S:v})}break;case n.CometChatUIKitConstants.GroupOptions.delete:t instanceof s.CometChat.Group&&Y({type:"deleteConfirm",buttonText:F,confirmDialogMessage:k})}}function pe(e,t,n){return t?d.jsx("cometchat-divider",{dividerStyle:JSON.stringify(Ti(t,n,se))}):null}function me(e,t){const{title:n,id:o,hideSectionSeparator:r=!0,sectionSeparatorColor:i,hideItemSeparator:a=!1,itemSeparatorColor:l}=e;let c=null;n&&(c=d.jsx("div",{className:"cc-details__section-header",style:{textAlign:"left"},children:d.jsx("cometchat-label",{text:n.toUpperCase(),labelStyle:JSON.stringify(vi(e))})}));let C=null;const g=function(e,t){const{id:n}=e;if(void 0!==n)return t instanceof s.CometChat.User?e.options?.(_,null,n,t):e.options?.(_,t,n,null)}(e,t);return g?.length&&(C=d.jsx("div",{className:"cc-details__options",style:{display:"flex",flexDirection:"column"},children:g.map((e,n)=>function(e,t,n,o){const{id:r,customView:s}=e;if(s)return d.jsx("div",{className:"cc-details__option",children:s},r);const{title:i,tail:a,iconURL:l}=e,c=d.jsx(J,{text:i,iconURL:l,buttonStyle:Ii(e),onClick:()=>ue(e,t)});let C=c;return a&&(C=d.jsxs("div",{className:"cc-details__option-content",style:{position:"relative"},children:[c,d.jsx("div",{className:"cc-details__option-tail",style:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)"},children:a})]})),d.jsxs("div",{className:"cc-details__option",style:{display:"flex",flexDirection:"column"},children:[C,pe(0,o,!1)]},r)}(e,t,0,l))})),d.jsxs("div",{className:"cc-details__section",style:{padding:"16px 0"},children:[c,C,pe(0,i,!0)]},o)}function Ae(){K("none")}function xe(){Y(null)}function be(e){if(e instanceof s.CometChat.User)return null;const t=R?.options;return d.jsx(Yi,{group:e,onTransferOwnership:R?.onTransferOwnership,titleAlignment:R?.titleAlignment,loadingIconURL:R?.loadingIconURL,loadingStateView:R?.loadingStateView,errorStateView:R?.errorStateView,emptyStateView:R?.emptyStateView,onError:R?.onError,hideSearch:R?.hideSearch,searchIconURL:R?.searchIconURL,hideSeparator:R?.hideSeparator,closeButtonIconURL:R?.closeButtonIconURL||Pi,disableUsersPresence:R?.disableUsersPresence,listItemView:R?.listItemView,subtitleView:R?.subtitleView,onClose:R?.onClose??xe,groupMembersRequestBuilder:R?.groupMembersRequestBuilder,searchRequestBuilder:R?.searchRequestBuilder,options:t?(e,n)=>t(n):void 0,statusIndicatorStyle:R?.statusIndicatorStyle,avatarStyle:R?.avatarStyle,listItemStyle:R?.listItemStyle,groupMemberStyle:R?.groupMemberStyle,transferOwnershipStyle:Ui(R,Q)})}return function(e){const{setLoggedInUser:n,errorHandler:o,leaveOrTransferConfirmDialogElement:r,setModalInfo:i,handleLeaveOrTransferConfirmClick:a,deleteConfirmDialogElement:l,handleDeleteConfirmClick:c,userOrGroup:C,user:d,group:g,setUserOrGroup:u}=e;t.useEffect(()=>{d instanceof s.CometChat.User&&(d.getStatus?.()?u(d):s.CometChat.getUser(d.getUid()).then(e=>{u(e)}).catch(e=>o(e))),g instanceof s.CometChat.Group&&(g.getOwner?.()?u(g):s.CometChat.getGroup(g.getGuid()).then(e=>{u(e)}).catch(e=>o(e)))},[d,g,u,o]),t.useEffect(()=>{if(!r)return;const e="cc-confirm-clicked",t=()=>{C&&a(C)};return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[r,a,C]),t.useEffect(()=>{if(!r)return;const e="cc-cancel-clicked",t=()=>i(null);return r.addEventListener(e,t),()=>{r.removeEventListener(e,t)}},[r,i]),t.useEffect(()=>{if(!l)return;const e="cc-confirm-clicked",t=()=>{C&&c(C)};return l.addEventListener(e,t),()=>{l.removeEventListener(e,t)}},[l,c,C]),t.useEffect(()=>{if(!l)return;const e="cc-cancel-clicked",t=function(){i(null)};return l.addEventListener(e,t),()=>{l.removeEventListener(e,t)}},[l,i]),t.useEffect(()=>{(async()=>{try{n(await s.CometChat.getLoggedinUser())}catch(e){o(e)}})()},[o,n])}({setLoggedInUser:W,errorHandler:re,leaveOrTransferConfirmDialogElement:$,setModalInfo:Y,handleLeaveOrTransferConfirmClick:ae,deleteConfirmDialogElement:te,handleDeleteConfirmClick:le,userOrGroup:X,user:o,group:i,setUserOrGroup:q}),X?d.jsxs("div",{className:"cc-details",style:xi(Q,se),children:[d.jsxs("div",{className:"cc-details__header",style:{display:"flex",justifyContent:"center",textAlign:"center",width:"100%",paddingBottom:"19px"},children:[d.jsx("cometchat-label",{text:a,labelStyle:JSON.stringify(bi(Q,se))}),d.jsx(J,{iconURL:l,buttonStyle:yi(Q,se),onClick:C})]}),d.jsxs("div",{className:"cc-details__content",style:{flexGrow:"1",display:"flex",flexDirection:"column",overflowY:"auto"},children:[function(e){if(p)return null;let t;return t=u?e instanceof s.CometChat.User?u(e):u(void 0,e):function(e){return d.jsx(M,{avatarName:e.getName(),title:e.getName(),avatarURL:e instanceof s.CometChat.User?e.getAvatar():e.getIcon(),statusIndicatorColor:ce(e),statusIndicatorIcon:Ce(e),listItemStyle:wi(P,se),statusIndicatorStyle:fi(O),avatarStyle:Di(j,se),subtitleViewClassName:"cc-details__subtitle-view",subtitleView:ge(e)})}(e),d.jsx("div",{className:"cc-details__profile",style:{overflowX:"auto"},children:t})}(X),function(t){const n=function(){let t;return f&&(t=f),t||(t=r.DetailsUtils.getDefaultDetailsTemplate(_,e?.user,e?.group,se)),t}().map((e,n)=>me(e,t));return 0===n.length?null:d.jsx("div",{className:"cc-details__section-list",style:{flexGrow:"1",overflowY:"auto",display:"flex",flexDirection:"column",padding:"28px 0"},children:n})}(X)]}),function(e){try{let t=null;switch(N){case"addMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=T?.sectionHeaderField,o=T?.options;return d.jsx(Tr,{group:e,selectionMode:T?.selectionMode??n.SelectionMode.multiple,onClose:T?.onClose??C??Ae,onBack:T?.onBack??Ae,backButtonIconURL:T?.backButtonIconURL||Ri,showBackButton:T?.showBackButton??!0,titleAlignment:T?.titleAlignment,hideSearch:T?.hideSearch,searchIconURL:T?.searchIconURL,showSectionHeader:T?.showSectionHeader,sectionHeaderField:(r=t,void 0!==r&&r in new s.CometChat.User("anyString")?t:void 0),loadingIconURL:T?.loadingIconURL,loadingStateView:T?.loadingStateView,emptyStateView:T?.emptyStateView,errorStateView:T?.errorStateView,hideError:T?.hideError,disableUsersPresence:T?.disableUsersPresence,hideSeparator:T?.hideSeparator,onError:T?.onError??void 0,menus:T?.menu,options:o??void 0,onSelect:T?.onSelect,usersRequestBuilder:T?.usersRequestBuilder,searchRequestBuilder:T?.searchRequestBuilder,listItemView:T?.listItemView,subtitleView:T?.subtitleView,onAddMembersButtonClick:T?.onAddMembersButtonClick??void 0,closeButtonIconURL:T?.closeButtonIconURL||Pi,listItemStyle:T?.listItemStyle,statusIndicatorStyle:T?.statusIndicatorStyle,avatarStyle:T?.avatarStyle,addMembersStyle:Bi(T,Q)});var r}(e);break;case"bannedMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=B?.options;return d.jsx(Yr,{group:e,onClose:B?.onClose??C??Ae,onBack:B?.onBack??Ae,backButtonIconURL:B?.backButtonIconURL||Ri,showBackButton:B?.showBackButton||!0,menus:B?.menu,titleAlignment:B?.titleAlignment,hideSearch:B?.hideSearch,searchIconURL:B?.searchIconURL,bannedMembersRequestBuilder:B?.bannedMembersRequestBuilder,searchRequestBuilder:B?.searchRequestBuilder,listItemView:B?.listItemView,subtitleView:B?.subtitleView,hideSeparator:B?.hideSeparator,disableUsersPresence:B?.disableUsersPresence,options:t??void 0,selectionMode:B?.selectionMode,closeButtonIconURL:B?.closeButtonIconURL||Pi,onError:B?.onError??void 0,onSelect:B?.onSelect,emptyStateView:B?.emptyStateView,errorStateView:B?.errorStateView,loadingStateView:B?.loadingStateView,loadingIconURL:B?.loadingIconURL,hideError:B?.hideError,statusIndicatorStyle:B?.statusIndicatorStyle,avatarStyle:B?.avatarStyle,listItemStyle:B?.listItemStyle,bannedMemberStyle:Li(B,Q)})}(e);break;case"groupMembers":t=function(e){if(e instanceof s.CometChat.User)return null;const t=L?.options;return d.jsx(he,{group:e,onClose:L?.onClose??C??Ae,onBack:L?.onBack??Ae,groupMemberRequestBuilder:L?.groupMembersRequestBuilder,searchRequestBuilder:L?.searchRequestBuilder,listItemView:L?.listItemView,subtitleView:L?.subtitleView,disableUsersPresence:L?.disableUsersPresence,userPresencePlacement:L?.userPresencePlacement,menus:L?.menu,options:t?(e,n)=>t(n):void 0,backButtonIconURL:L?.backButtonIconURL||Ri,closeButtonIconURL:L?.closeButtonIconURL||Pi,showBackButton:L?.showBackButton||!0,hideSeparator:L?.hideSeparator,selectionMode:L?.selectionMode,hideError:L?.hideError,searchIconURL:L?.searchIconURL,dropDownIconURL:L?.dropdownIconURL,hideSearch:L?.hideSearch,onError:L?.onError??void 0,onSelect:L?.onSelect,emptyStateView:L?.emptyStateView,errorStateView:L?.errorStateView,loadingIconURL:L?.loadingIconURL,loadingStateView:L?.loadingStateView,titleAlignment:L?.titleAlignment,statusIndicatorStyle:L?.statusIndicatorStyle,avatarStyle:L?.avatarStyle,groupMembersStyle:Mi(L,Q),groupScopeStyle:L?.groupScopeStyle,listItemStyle:L?.listItemStyle})}(e);break;case"none":break;default:}if(null!==t)return d.jsx("div",{className:"cc-details__page-wrapper",style:{position:"absolute",top:"0",left:"0",boxSizing:"border-box",width:"100%",height:"100%",border:"none",borderRadius:"inherit"},children:t})}catch(e){re(e)}}(X),function(e){if(!z)return null;const{type:t}=z;try{switch(t){case"leaveOrTransferConfirm":return d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Si(H,Q)),children:d.jsx("cometchat-confirm-dialog",{ref:ee,title:"",cancelButtonText:c,confirmButtonText:z.buttonText,messageText:z.confirmDialogMessage,confirmDialogStyle:JSON.stringify(Fi(V,Q,se))})});case"transferOwnership":return d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Si(H,Q)),children:be(e)});case"deleteConfirm":return d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(Si(H,Q)),children:d.jsx("cometchat-confirm-dialog",{ref:ne,cancelButtonText:c,confirmButtonText:z.buttonText,messageText:z.confirmDialogMessage,confirmDialogStyle:JSON.stringify(ki(G,se))})});default:}}catch(e){re(e)}}(X)]}):null}function Xi(e,t){return new o.PreviewStyle({height:"100%",width:"100%",border:`1px solid ${t.palette.getAccent200()}`,background:t.palette.getBackground(),previewTitleFont:e?.previewTitleFont||n.fontHelper(t.typography.caption1),previewTitleColor:e?.previewTitleColor||t.palette.getAccent600(),previewSubtitleFont:e?.previewSubtitleFont||n.fontHelper(t.typography.subtitle2),previewSubtitleColor:e?.previewSubtitleColor||t.palette.getAccent400(),closeButtonIconTint:e?.closePreviewTint||t.palette.getAccent600(),borderRadius:"12px"})}function qi(e,t,o){return{height:"fit-content",width:"fit-content",buttonTextFont:n.fontHelper(t.typography.subtitle2),buttonTextColor:t.palette.getAccent600(),borderRadius:"8px",border:"none",buttonIconTint:t.palette.getAccent600(),padding:"8px",iconHeight:"20px",iconWidth:"20px",iconBackground:"transparent",gap:"5px",...o}}function $i(e,t){const r=o.isMobileDevice()?n.fontHelper(t.typography.name):n.fontHelper(t.typography.text2);return new o.TextInputStyle({height:"100%",width:"100%",maxHeight:e?.maxInputHeight||"150px",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||"12px",background:e?.background||`${t.palette.getAccent50()}`,textFont:e?.textFont||r,textColor:e?.textColor||t.palette.getAccent(),dividerColor:e?.dividerTint||t.palette.getAccent100(),inputBorder:e?.inputBorder||"none",inputBorderRadius:e?.inputBorderRadius||"0px",inputBackground:e?.inputBackground||"transparent",placeholderTextColor:t.palette.getAccent500(),placeholderTextFont:n.fontHelper(t.typography.subtitle2)})}function ea(e,t,n=!1){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:n?t.palette.getAccent200():e?.sendIconTint||t.palette.getPrimary(),background:"transparent",padding:"0"}}function ta(e,t,n){return n?e?.emojiIconTint||t.palette.getAccent():e?.emojiIconTint||t.palette.getAccent500()}function na(e,t,n){return n?e?.voiceRecordingIconTint||t.palette.getAccent():e?.voiceRecordingIconTint||t.palette.getAccent500()}function oa(e,t,n){return n?e?.attachIcontint||t.palette.getAccent():e?.attachIcontint||t.palette.getAccent500()}function ra(e,t,n){return n?e?.AIIconTint||t.palette.getAccent():e?.AIIconTint||t.palette.getAccent500()}const sa="244px",ia="275px",aa="12px";function la(e,t){let n=e?.height,r=e?.width,s="100%"==n||"100%"==r;return new o.PopoverStyle({width:r&&!s?e?.width:ia,height:n&&!s?e?.height:sa,borderRadius:e?.borderRadius||aa,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"})}function ca(e={},t){return{width:e?.width||ia,height:e?.height||sa,borderRadius:e?.borderRadius||aa,border:`1px solid ${t.palette.getAccent100()}`,boxSizing:"border-box",overflow:"auto"}}function Ca(e,t){return{width:e?.width||ia,height:e?.height||sa,borderRadius:e?.borderRadius||aa,border:`1px solid ${t.palette.getAccent100()}`,boxSizing:"border-box",overflowY:"auto",overflowX:"hidden"}}function da(e,t){return new o.ActionSheetStyle({width:e?.width||"100%",height:e?.height||"100%",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||aa,background:e?.background||t.palette.getBackground(),layoutModeIconTint:e?.layoutModeIconTint||t.palette.getPrimary(),titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent(),listItemBackground:e?.listItemBackground||"transparent",listItemIconTint:e?.listItemIconTint||t.palette.getAccent700(),listItemIconBackground:e?.listItemIconBackground||"transparent",listItemIconBorderRadius:e?.listItemIconBorderRadius||"0",ActionSheetSeparatorTint:e?.ActionSheetSeparatorTint||`${t.palette.getAccent400()}`})}function ga(e,t){return new o.ActionSheetStyle({width:e?.width||"100%",height:e?.height||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||aa,background:e?.background||t.palette.getBackground(),listItemBackground:e?.listItemBackground||"transparent",ActionSheetSeparatorTint:e?.optionsSeparatorTint||`${t.palette.getAccent600()}`})}function ua(e,t,n){return{height:"24px",width:"24px",border:"none",borderRadius:"0",padding:"0",buttonIconTint:oa(e,t,n),background:"transparent"}}function pa(e,t,n){return{height:"24px",width:"24px",border:"none",borderRadius:"0",padding:"0",buttonIconTint:ra(e,t,n),background:"transparent"}}const ha="400px",ma="320px",Aa="12px";function xa(e){return{width:ma,height:ha,borderRadius:Aa,border:`1px solid ${e.palette.getAccent100()}`,boxSizing:"border-box"}}function ba(e,t){return new o.EmojiKeyboardStyle({width:"100%",height:"100%",border:"none",borderRadius:Aa,background:t.palette.getBackground(),textFont:e?.emojiKeyboardTextFont||n.fontHelper(t.typography.caption1),textColor:e?.emojiKeyboardTextColor||t.palette.getAccent()})}function ya(e,t,n,o=!1){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:ta(e,t,n),background:"transparent",padding:"0"}}const wa="100px",fa="250px",Da="8px";function Ea(e,t){return new o.MediaRecorderStyle({...e,background:e?.background||t.palette.getBackground(),border:"1px solid rgba(20, 20, 20, 0.08)",borderRadius:Da,closeIconTint:e?.closeIconTint||t.palette.getAccent600(),submitIconTint:e?.submitIconTint||t.palette.getAccent600(),startIconTint:e?.startIconTint||t.palette.getError(),stopIconTint:e?.stopIconTint||t.palette.getError(),timerTextColor:e?.timerTextColor||t.palette.getAccent400(),timerTextFont:e?.timerTextFont||n.fontHelper(t.typography.text3)})}function va(e,t,n,o=!1){const r={};return o&&(r.margin="0px 10px"),{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:na(e,t,n),background:"transparent",...r}}var Ia="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%22100%22%20height%3D%22100%22%20xml%3Aspace%3D%22preserve%22%20version%3D%221.1%22%20viewBox%3D%220%200%20100%20100%22%3E%20%20%20%20%3Cimage%20width%3D%22100%22%20height%3D%22100%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAAAXNSR0IArs4c6QAABeZJREFUeF7tnOGx5TQMhbUdQAdQAUsFQAVABSwVLFQAVABUAFTAUgFQAXSwuxVABzAfc81kM7ElJ7KjeyPPvHk%2FrpPI5%2BRIsuz4iWQLhcCTUNakMZKEBHsJkpAkJBgCwcxJhSQhwRAIZk4qJAkJhkAwc1IhSUgwBIKZkwpJQoIhEMycVIiNkLdE5Omt62%2B2S%2Fb1SkJ03N4RkV9FhP%2B0VyLy0e2%2FfnVnjyREBwwyPlx1QyWQ4t6SEB3SfypdhmA35Kb6GO%2BmB7Hjr4q1b4vI394jSULaiD4TkR8qXXBZ7gE%2BCWkT8nIRzNc9%2FxSR91Mh3gjU74cyUEir%2FSgin3ualAp5E80y3%2Fh2Me%2FQ8CYN%2FkZEXnjElGiEMPkCDNJMXAJvH%2F9HNuYXqGGd2u59JnEFuyGqu0UiBGD%2BEBHe0tLIYt71ePMayLTiRDegtwsgg%2FjSnYVFIuSLmzrWIHwpIt%2FtRUa5DlUw8bO0otRSQtGu2ZWFRSLkaxH5amOU%2BGd%2BG9GSkAaqqOD5xu%2FfiwjqGdFwj7jJUqfyegYuC1fb3SIphCzl440RuKeWq2dABs%2F4oBu97Qt%2Bv6XLdx%2FUt4p4DHnIBKwCPor55OY6rarBPuIc%2F7uD%2BNqOSAqhZrTMsIqtDJK60eyGaj5THvqTYfLYZXcUQshc8OW1titj6UJiuzM21bKq3XGiZVcUQmopb7F9ZKbVwqeVhTH5Q0WuLQohrTeRAQ9bEFLQvGT5XXNXBbOz3NblFqgswfNMlWxlf6S2XrWvN0R6tssitaSWZG1nqORSmxxqc48aQWfFEuwpinCZb9QGeKZCWpkVc4%2BtOQnjGFlstCp1WL%2BzCNkqtZdBkt9%2FeqvC1iaKlLZ3lSaGIel04zMIWfvk9VDKnKOloKGb1Zyw3XWb2YRoZKxnv9pMedgOwl1oOlw0kxCNDOLG2hW1XBvDfzilzCKEDIV161YFtRasW3ujCimUMdz3SDm88N23GE0IQZlVQG2BSatV1VYTlwNmgYv7HC6Bd6PoeMEoQiCC1T%2BIqKWvZRgaGaWfhZSyJce96OeIefNW3oTgklhDsBCBYVYyekgpbgxSWK%2B4q%2FT4CCGAXzaWUSBk%2BdW6ynZkgmdRyvItZGZN7YkYgzuDoLAk9RCy3MR2RMGAcTQIW5IEi42zNuNZbPmvj5UQLf20PhA3QjblEXixCbVoy6yabTM242k2%2FP%2B7lRBtRU97IC4D8Eakph5qCVMfm0WIh5uqkQ4hpNZH1ifujhCCN%2BsWWgqrKQWXRWblEVSxhbmHh8sKU6y0KgSgCeoA%2Bp6GuvK7h1o83BRm4kpxx6N32Jsh6yFkfVOCakl9AYi%2FHrKIKailt%2FXGs9e3bzcAvSwueSi0125T%2FyOEbD0Agqg94UYsc5JeUogVlo3XZE7sCUbRYcHfAtCbkOUzIAYANWKspFjIKEQQWzxSa9Nb7dlpJCHYSeAF8K1d7ctxaKRYyEAR3OcuiShgjCakPMcShFEUtad102KGR5Lg%2BZIfutcsQjAyF6gMVM0kxELK%2BtOD1vd%2FD7daCECzCbGQUmbNrbjxkGScRUghZf3FbRE0QZnNCz9XMrSttXeDM7iPLmcopCCTG%2BU23pEzCcGc3q2kwzY5K%2Fq5zIlyPZ8lgxlfts6eeV9qszUg176%2BXb%2B0o7%2FGrYnkcifKWVVCifyMquzlPtixxJKZn0YvlXLJT9oAQNtJctaK3mVPlNPc1lnu6tInykU7OODyJ8rVPj2YOffIE%2BUWEbT2Ne4vt%2FNHRtU%2B8kS5CrJnHM%2BEKXmiXIWQPMDspPJ7zfXkEX%2FBCNnajDe61J4nyimRebkZb9YmtjxRblS65HDfPFHOAcRRt7AcivOwJ8qNAvXofbXv5HedPNoy6uwVw6OAjb7%2BsifKjQZ27%2F0vW37fC9iM6y65QDUD2L3PuNSJcntBmnnd5TY5zAT3yLMe%2FkS5I%2BA87LWZ9gajNglJQoIhEMycVEgSEgyBYOakQpKQYAgEMycVkoQEQyCYOamQJCQYAsHMSYUEI%2BRfzec9dI8XxxgAAAAASUVORK5CYII%3D%22%2F%3E%20%20%3C%2Fsvg%3E",Sa="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Fa="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FHeart%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FHeart%22%20fill%3D%22%23000000%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.375%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.3134395%2C18.0459049%20L1.52443954%2C8.87923824%20C-0.0597509272%2C7.29629358%20-0.452349335%2C4.87680895%200.550022872%2C2.87415491%20L0.550022872%2C2.87415491%20C1.29768241%2C1.3792661%202.71831477%2C0.334867269%204.36817344%2C0.0671851901%20C6.01803212%2C-0.200496889%207.69599623%2C0.341168737%208.87793954%2C1.52298824%20L10.3134395%2C2.95757158%20L11.7489395%2C1.52298824%20C12.9308829%2C0.341168737%2014.608847%2C-0.200496889%2016.2587056%2C0.0671851901%20C17.9085643%2C0.334867269%2019.3291967%2C1.3792661%2020.0768562%2C2.87415491%20L20.0768562%2C2.87415491%20C21.0778256%2C4.87595612%2020.6857045%2C7.29366739%2019.1033562%2C8.87648824%20L10.3134395%2C18.0459049%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";function ka(e){const{dispatch:i,textInputRef:a,liveReactionBtnElement:l,LiveReactionIconURL:c,mySetAddToMsgInputText:C,actionSheetElement:d,mediaFilePickerRef:g,secondaryBtnElement:u,textMessageEditPreviewElement:p,auxiliaryBtnElement:h,voiceRecordingBtnElement:m,emojiKeyboardElement:A,voiceRecordingElement:x,auxiliaryPopoverElement:b,attachmentPopoverElement:y,text:w,handleSendButtonClick:f,primaryBtnElement:D,onTextChange:E,actionIdToActionOnClick:v,handleTyping:I,errorHandler:S,getReceiverDetails:F,contentToDisplay:k,createPollViewRef:T,handleSendVoiceMessage:M,aiPopoverElement:B,aiBtnElement:L,setSmartRepliesView:U,textFormatters:R,disableMentions:P,textFormatterArray:O,mentionsTextFormatterInstanceRef:j,userMemberWrapperConfiguration:V,setTextFormatters:G,CometChatUIKitLoginListener:H,group:Q,user:N,userMemberWrapperConfig:K,setUserMemberWrapperConfig:z,userPropRef:J,groupPropRef:Y,setShowListForMentions:_,searchMentions:W,mentionsFormatterInstanceId:Z,setUsersRequestBuilder:X,setGroupMembersRequestBuilder:q,setUserMemberListType:$,userMemberWrapperRef:ee,getComposerId:te,parentMessageIdPropRef:ne,isPartOfCurrentChatForUIEvent:oe,propsText:re,triggerClosePreview:se}=e,ie=t.useRef(!1);t.useEffect(()=>{re&&(N?.getUid()||Q?.getGuid())&&i({type:"setAddToMsgInputText",addToMsgInputText:re})},[N?.getUid(),Q?.getGuid(),re,i]),t.useEffect(()=>{const e=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{let t=e?.message?.getParentMessageId();(ne.current&&t&&t===ne.current||!ne.current&&!t)&&oe(e.message)&&(e.status===n.MessageStatus.inprogress&&e.message instanceof s.CometChat.TextMessage&&(ie.current=!0,i({type:"setTextMessageToEdit",textMessageToEdit:e.message}),a.current?.emptyInputField(),C(o.processSubtitleContent(e.message.getText()))),e.status===n.MessageStatus.success&&e.message instanceof s.CometChat.TextMessage||e?.status==n.MessageStatus.cancelled?(i({type:"setTextMessageToEdit",textMessageToEdit:null}),a.current?.emptyInputField(),ie.current=!1):ie.current=!0)}),t=n.CometChatUIEvents.ccComposeMessage.subscribe(e=>{i({type:"setText",text:""}),a.current?.emptyInputField(),C(e)});j.current.setId(Z);const r=n.CometChatUIEvents.ccShowMentionsCountWarning.subscribe(e=>{if(e.id===Z){if(e.showWarning)return void i({type:"setShowMentionsCountWarning",showMentionsCountWarning:!0});i({type:"setShowMentionsCountWarning",showMentionsCountWarning:!1})}});return()=>{e.unsubscribe(),t.unsubscribe(),r.unsubscribe()}},[C,i,a,Z]),t.useEffect(()=>{if(!l)return;async function e(){try{const{receiverId:e,receiverType:t}=F(),o={type:"live_reaction",reaction:"heart"};s.CometChat.sendTransientMessage(new s.CometChat.TransientMessage(e,t,o)),n.CometChatMessageEvents.ccLiveReactionSent.next({composerId:te(),reaction:"heart"})}catch(e){S(e)}}const t="cc-button-clicked";return l.addEventListener(t,e),()=>{l.removeEventListener(t,e)}},[c,l,S,F]),t.useEffect(()=>{if(!d||!g.current)return;function e(e){const{action:t}=e.detail;u?.click(),i({type:"setContentToDisplay",contentToDisplay:"none"});const n=v.current.get(`${t.id}`);"function"==typeof n?n():(g.current.accept=`${t.id}/*`,g.current.click())}const t="cc-actionsheet-clicked";return d.addEventListener(t,e),()=>{d.removeEventListener(t,e)}},[u,d,i,v,g]),t.useEffect(()=>{if(!p)return;function e(){se&&se(),setTimeout(()=>{i({type:"setTextMessageToEdit",textMessageToEdit:null}),i({type:"setText",text:""}),o.isMobileDevice()?a.current?.emptyInputFieldWithoutFocus():a.current?.emptyInputField(),C("")},0)}const t="cc-preview-close-clicked";return p.addEventListener(t,e),()=>{p.removeEventListener(t,e)}},[p,i,a]),t.useEffect(()=>{if(!u)return;function e(){switch(k){case"attachments":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"attachments"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"attachments"})}}function t(){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-button-clicked",o="cc-popover-outside-clicked";return u.addEventListener(n,e),y.addEventListener(o,t),()=>{u.removeEventListener(n,e),y.removeEventListener(o,t)}},[k,u,y,h,m,L,i]),t.useEffect(()=>{if(!L)return;function e(){switch(U(null),k){case"ai":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"ai"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"ai"})}}function t(){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-button-clicked",o="cc-popover-outside-clicked";return L.addEventListener(n,e),B.addEventListener(o,t),()=>{L.removeEventListener(n,e),B.removeEventListener(o,t)}},[k,L,B,u,h,m,U,i]),t.useEffect(()=>{if(!m)return;function e(){switch(k){case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"voiceRecording":m?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"emojiKeyboard":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"emojiKeyboard"})}}function t(){switch(k){case"attachments":u?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"emojiKeyboard":h&&h?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"voiceRecording":i({type:"setContentToDisplay",contentToDisplay:"none"});break;case"ai":L?.click(),i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"});break;case"none":i({type:"setContentToDisplay",contentToDisplay:"voiceRecording"})}}const n="cc-button-clicked";return h&&h.addEventListener(n,e),m.addEventListener(n,t),()=>{h&&h.removeEventListener(n,e),m.removeEventListener(n,t)}},[k,u,m,h,L,i]),t.useEffect(()=>{if(!A)return;function e(e){const t=e.detail.id;"string"==typeof t&&C(t)}function t(e){i({type:"setContentToDisplay",contentToDisplay:"none"})}const n="cc-emoji-clicked",o="cc-popover-outside-clicked";return A.addEventListener(n,e),b.addEventListener(o,t),()=>{A.removeEventListener(n,e),b.removeEventListener(o,t)}},[C,b,A,i]),t.useEffect(()=>{if(!x)return;function e(e){const t=new CustomEvent("cc-button-clicked",{});m?.click(),m?.dispatchEvent(t)}function t(t){const n=t.detail.file;e(),M(n)}const n="cc-media-recorder-closed",o="cc-media-recorder-submitted";return x.addEventListener(n,e),x.addEventListener(o,t),()=>{x.removeEventListener(n,e),x.removeEventListener(o,t)}},[x,m,i,M]),t.useEffect(()=>{if(!D)return;function e(){w&&f(w)}const t="cc-button-clicked";return D.addEventListener(t,e),()=>{D.removeEventListener(t,e)}},[f,w,D]),t.useEffect(()=>{const e=a.current;if(!e)return;function t(e){_(!1);let t=e.detail.value;t=t.replace(/<br\s*\/?>/gi,""),"string"==typeof t&&""!==t.trim()&&f(t)}const n="cc-text-input-entered";return e.addEventListener(n,t),()=>{e.removeEventListener(n,t)}},[f,a]),t.useEffect(()=>{const e=a.current;if(!e)return;function t(e){const t=e.detail.value;"string"!=typeof t&&null!=t||(I(),i({type:"setText",text:t}),C(""),void 0!==E&&E(t))}const n="cc-text-input-changed";return e.addEventListener(n,t),()=>{e.removeEventListener(n,t)}},[E,I,i,a,Q?.getGuid(),N?.getUid()]),t.useEffect(()=>{const e=n.CometChatUIEvents.ccShowModal.subscribe(e=>{i({type:"setShowPoll",showPoll:!0}),T.current=e.child}),t=n.CometChatUIEvents.ccHideModal.subscribe(()=>{i({type:"setShowPoll",showPoll:!1}),T.current=null});return()=>{e.unsubscribe(),t.unsubscribe()}},[T,i]),t.useEffect(()=>{if(!P)if(R.length){let e=!1;for(let t=0;t<O.length;t++)if(O[t]instanceof r.CometChatMentionsFormatter){e=!0;break}e||(j.current.setLoggedInUser(H.getLoggedInUser()),void 0===j.current.getKeyDownCallBack()&&(j.current.setKeyDownCallBack(W),j.current.setKeyUpCallBack(W)),G([...O,j.current]))}else j.current.setLoggedInUser(H.getLoggedInUser()),void 0===j.current.getKeyDownCallBack()&&(j.current.setKeyDownCallBack(W),j.current.setKeyUpCallBack(W)),G([...O,j.current]);let e=j.current;return()=>{e&&e.cleanup()}},[]),t.useEffect(()=>{(J.current&&N&&J.current.getUid()!==N.getUid()||Y.current&&Q&&Y?.current.getGuid()!==Q.getGuid())&&(i({type:"setText",text:""}),C("")),J.current&&_(N&&J.current.getUid()!==N.getUid()),Y.current&&_(Q&&Y?.current.getGuid()!==Q.getGuid());for(let e=0;e<O.length;e++)O[e].setComposerConfig(N,Q,te())},[N,Q,J,Y,i,a,C]),t.useEffect(()=>{if(!P){if(Q){const e=void 0!==V?.userMemberListType?V?.userMemberListType:n.UserMemberListType.groupmembers;$(e);const t=V?.groupMemberRequestBuilder?V?.groupMemberRequestBuilder:new s.CometChat.GroupMembersRequestBuilder(Q.getGuid()).setLimit(15);q(t)}if(N){const e=void 0!==V?.userMemberListType?V?.userMemberListType:n.UserMemberListType.users;$(e);const t=V?.usersRequestBuilder?V?.usersRequestBuilder:(new s.CometChat.UsersRequestBuilder).setLimit(15);X(t)}}},[N,Q,P]),t.useEffect(()=>{const e=e=>{ee.current&&!ee.current.contains(e.target)&&_(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),t.useEffect(()=>{try{setTimeout(()=>{ie.current&&a.current&&(i({type:"setTextMessageToEdit",textMessageToEdit:null}),i({type:"setText",text:""}),a.current?.emptyInputField(),C(""),ie.current=!1)})}catch(e){S(e)}},[N,Q,ne])}var Ta="data:image/svg+xml,%3Csvg%20width%3D%2260%22%20height%3D%2260%22%20viewBox%3D%220%200%2060%2060%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M30.0001%200.666626C46.2004%200.666626%2059.3334%2013.7996%2059.3334%2030C59.3334%2046.2003%2046.2004%2059.3333%2030.0001%2059.3333C13.7997%2059.3333%200.666748%2046.2003%200.666748%2030C0.666748%2013.7996%2013.7997%200.666626%2030.0001%200.666626ZM30.0001%205.99996C16.7452%205.99996%206.00008%2016.7451%206.00008%2030C6.00008%2043.2548%2016.7452%2054%2030.0001%2054C43.2549%2054%2054.0001%2043.2548%2054.0001%2030C54.0001%2016.7451%2043.2549%205.99996%2030.0001%205.99996ZM31.6667%2027.3333C32.219%2027.3333%2032.6667%2027.781%2032.6667%2028.3333V42.3333C32.6667%2042.8856%2032.219%2043.3333%2031.6667%2043.3333H28.3334C27.7811%2043.3333%2027.3334%2042.8856%2027.3334%2042.3333V28.3333C27.3334%2027.781%2027.7811%2027.3333%2028.3334%2027.3333H31.6667ZM30.0001%2019.3333C31.4728%2019.3333%2032.6667%2020.5272%2032.6667%2022C32.6667%2023.4727%2031.4728%2024.6666%2030.0001%2024.6666C28.5273%2024.6666%2027.3334%2023.4727%2027.3334%2022C27.3334%2020.5272%2028.5273%2019.3333%2030.0001%2019.3333Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E",Ma="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FMic%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FMic%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%284%2C%201%29%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%228%22%20y1%3D%2218.3333333%22%20x2%3D%228%22%20y2%3D%2222%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20x%3D%223.5%22%20y%3D%220%22%20width%3D%229%22%20height%3D%2214.9111111%22%20rx%3D%223.91111111%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C8.8%20L0%2C11%20C0%2C15.0500882%203.35786438%2C18.3333333%207.5%2C18.3333333%20L8.5%2C18.3333333%20C12.6421356%2C18.3333333%2016%2C15.0500882%2016%2C11%20L16%2C8.8%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ba="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",La="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%20Rotated%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus-Rotated%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%2812.000000%2C%2012.000000%29%20rotate%2845.000000%29%20translate%28-12.000000%2C%20-12.000000%29%20translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2210%22%20y1%3D%226%22%20x2%3D%2210%22%20y2%3D%2214%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%226%22%20y1%3D%2210%22%20x2%3D%2214%22%20y2%3D%2210%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ua="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSend%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSend%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.158865921%2C1.85985859%20C-0.108182698%2C1.38202197%20-0.0332622567%2C0.786017075%200.343741637%2C0.389140701%20C0.72074553%2C-0.00773567366%201.31211969%2C-0.113146836%201.80303259%2C0.129025252%20L17.6480326%2C8.17819192%20C17.857662%2C8.28481329%2017.9896898%2C8.50008892%2017.9896898%2C8.73527525%20C17.9896898%2C8.97046158%2017.857662%2C9.18573721%2017.6480326%2C9.29235859%20L1.80303259%2C17.3523586%20C1.31211969%2C17.5945307%200.72074553%2C17.4891195%200.343741637%2C17.0922431%20C-0.0332622567%2C16.6953668%20-0.108182698%2C16.0993619%200.158865921%2C15.6215253%20L4.37386592%2C8.73485859%20L0.158865921%2C1.85985859%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2217.9896993%22%20y1%3D%228.73485859%22%20x2%3D%224.36969925%22%20y2%3D%228.73485859%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Ra="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%20Extensions%2FStipop%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24-Extensions%2FStipop%22%20fill%3D%22%23000000%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12.5%2C1%20C18.2989899%2C1%2023%2C5.70101013%2023%2C11.5%20C23%2C17.2039245%2018.451858%2C21.8455734%2012.7842951%2C21.9962258%20L12.5%2C22%20L6%2C23%20L6.47908443%2C20.1033393%20C3.77065445%2C18.2043706%202%2C15.0589646%202%2C11.5%20C2%2C5.70101013%206.70101013%2C1%2012.5%2C1%20Z%20M12.5%2C2.5%20C7.52943725%2C2.5%203.5%2C6.52943725%203.5%2C11.5%20C3.5%2C14.3705191%204.85206397%2C17.0112175%207.09635804%2C18.6980916%20L7.34021132%2C18.8751453%20L8.11298335%2C19.416961%20L7.817%2C21.202%20L12.3852902%2C20.5%20L12.5%2C20.5%20C17.4705627%2C20.5%2021.5%2C16.4705627%2021.5%2C11.5%20C21.5%2C6.52943725%2017.4705627%2C2.5%2012.5%2C2.5%20Z%20M13.5%2C12.3%20C13.1666667%2C13.9666667%2012.3333333%2C14.8%2011%2C14.8%20C9.66666667%2C14.8%208.83333333%2C13.9666667%208.5%2C12.3%20L13.5%2C12.3%20Z%20M15.0030662%2C6.67300699%20C15.1656001%2C6.92305919%2015.1180007%2C7.24908483%2014.9043132%2C7.44344192%20L14.826993%2C7.50306617%20L13.632%2C8.279%20L14.8086975%2C8.98550424%20C15.0644308%2C9.13894425%2015.1646368%2C9.45281874%2015.0578342%2C9.72120324%20L15.0144958%2C9.80869745%20C14.8610557%2C10.0644308%2014.5471813%2C10.1646368%2014.2787968%2C10.0578342%20L14.1913025%2C10.0144958%20L12.1913025%2C8.81449576%20C11.8402552%2C8.60386734%2011.8048611%2C8.12100565%2012.0939654%2C7.85785853%20L12.173007%2C7.79693383%20L14.173007%2C6.49693383%20C14.4508428%2C6.31634058%2014.8224729%2C6.39517122%2015.0030662%2C6.67300699%20Z%20M8.1%2C6.7%20C8.92842712%2C6.7%209.6%2C7.37157288%209.6%2C8.2%20C9.6%2C9.02842712%208.92842712%2C9.7%208.1%2C9.7%20C7.27157288%2C9.7%206.6%2C9.02842712%206.6%2C8.2%20C6.6%2C7.37157288%207.27157288%2C6.7%208.1%2C6.7%20Z%22%20id%3D%22Oval%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Pa="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224px%22%20height%3D%2224px%22%3E%3Cpath%20d%3D%22M%2012%202%20C%206.477%202%202%206.477%202%2012%20C%202%2017.523%206.477%2022%2012%2022%20C%2017.523%2022%2022%2017.523%2022%2012%20C%2022%206.477%2017.523%202%2012%202%20z%20M%2012%204%20C%2016.411%204%2020%207.589%2020%2012%20C%2020%2016.411%2016.411%2020%2012%2020%20C%207.589%2020%204%2016.411%204%2012%20C%204%207.589%207.589%204%2012%204%20z%20M%208%208%20L%208%2016%20L%2016%2016%20L%2016%208%20L%208%208%20z%22%2F%3E%3C%2Fsvg%3E";const Oa=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t,events:{onClick:"cc-actionsheet-clicked"}}),ja=ye({tagName:"cometchat-action-sheet",elementClass:o.CometChatActionSheet,react:t}),Va=ye({tagName:"cometchat-text-input",elementClass:o.CometChatTextInput,react:t}),Ga=ye({tagName:"cometchat-popover",elementClass:o.CometChatPopover,react:t});function Ha(e,t){let n=e;const{type:o}=t;switch(o){case"setText":n={...e,text:t.text};break;case"setAddToMsgInputText":n={...e,addToMsgInputText:t.addToMsgInputText};break;case"setTextMessageToEdit":n={...e,textMessageToEdit:t.textMessageToEdit};break;case"setContentToDisplay":n={...e,contentToDisplay:t.contentToDisplay};break;case"setLoggedInUser":n={...e,loggedInUser:t.loggedInUser};break;case"setShowPoll":n={...e,showPoll:t.showPoll};break;case"setShowMentionsCountWarning":n={...e,showMentionsCountWarning:t.showMentionsCountWarning}}return n}function Qa(e){const{user:a,group:l,text:c="",onTextChange:C,placeHolderText:g=n.localize("ENTER_YOUR_MESSAGE_HERE"),sendButtonIconURL:u=Ua,sendButtonView:p,onSendButtonClick:h,secondaryButtonView:b,attachmentIconURL:y=Ba,emojiIconURL:w=Ra,AIIconURL:f=Ia,auxiliaryButtonView:D,auxiliaryButtonAlignment:E=n.AuxiliaryButtonAlignment.right,attachmentOptions:v,hideLayoutMode:I=!1,parentMessageId:S=null,LiveReactionIconURL:F=Fa,hideLiveReaction:k=!0,headerView:T=null,onError:M,disableSoundForMessages:B=!1,customSoundForMessage:L,disableTypingEvents:R=!1,messageComposerStyle:P,hideVoiceRecording:O=!1,actionSheetStyle:j,AIOptionsStyle:V={},mediaRecorderStyle:G,voiceRecordingStartIconURL:H=Ma,voiceRecordingCloseIconURL:Q=Sa,voiceRecordingStopIconURL:N=Pa,voiceRecordingSubmitIconURL:K=Ua,userMemberWrapperConfiguration:z,textFormatters:J=[],disableMentions:Y=!1,InfoSimpleIcon:_=Ta,mentionsWarningText:W,mentionsWarningStyle:Z={}}=e,[X,q]=t.useReducer(Ha,{text:c,addToMsgInputText:c,textMessageToEdit:null,contentToDisplay:"none",loggedInUser:null,showPoll:!1,showMentionsCountWarning:!1}),$=t.useRef(null),ee=t.useRef(null),[te,ne]=A(null),[oe,re]=A(null),[se,ie]=A(null),[ae,le]=A(null),[ce,Ce]=A(null),[de,ge]=A(null),[ue,pe]=A(null),[he,Ae]=A(null),[xe,be]=A(null),[ye,we]=A(null),[fe,De]=A(null),[Ee,ve]=A(null),[Ie,Se]=A(null),[Fe,ke]=A(null),Te=t.useRef(new Map),Me=t.useRef(null),Le=t.useRef(null),Ue=x(M),Re=m(a),Pe=m(l),Oe=m(S),je=m(B),Ve=m(L),Ge=m(h),{theme:He}=t.useContext(U),[Qe,Ne]=t.useState(null),[Ke,ze]=t.useState(J),[Je,Ye]=t.useState(""),_e=t.useRef(""),We=t.useRef(""),[Ze,Xe]=t.useState(!1),qe=t.useRef(Be.getDataSource().getMentionsTextFormatter({theme:He})),[$e,et]=t.useState(0),[tt,nt]=t.useState(z??new r.UserMemberWrapperConfiguration({})),[ot,rt]=t.useState(),[st,it]=t.useState(void 0),[at,lt]=t.useState(void 0),ct=t.useRef(null),Ct="composer_"+Date.now(),dt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType();if(!Oe.current){if(e.getParentMessageId())return!1;if(Re.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&t===Re.current.getUid())return!0}else if(Pe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Pe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===Oe.current)return!0},[]),gt=t.useCallback(()=>{We.current=_e.current,Xe(!1),Ye(""),_e.current=""},[Xe,Ye]),ut=t.useCallback(e=>{if(!e||!e.length)return Ye(""),_e.current="",Xe(!1),void et(1);let t=e.split("@")[1].toLowerCase()?e.split("@")[1].toLowerCase():void 0;t&&We.current&&t.startsWith(We.current.toLowerCase())||t===Je||(Ye(t),_e.current=t,Xe(!0),We.current="",et($e+1))},[Ye,Xe,et]),pt=t.useCallback(()=>{const e=Re.current,t=Pe.current;if(e){const t=e.getBlockedByMe()||e.getHasBlockedMe();return{receiverId:e?.getUid(),receiverType:n.CometChatUIKitConstants.MessageReceiverType.user,isBlocked:t}}if(t)return{receiverId:t?.getGuid(),receiverType:n.CometChatUIKitConstants.MessageReceiverType.group};throw new Error("No user or group object provided. Should at least provide one.")},[Pe,Re]),ht=t.useCallback(()=>{const{receiverId:e,receiverType:t,isBlocked:n}=pt();return n?null:new s.CometChat.TypingIndicator(e,t)},[pt]),mt=t.useCallback(()=>{try{const e=ht();if(!e)return;s.CometChat.startTyping(e)}catch(e){Ue(e)}},[ht,Ue]),At=t.useCallback(()=>{try{s.CometChat.endTyping(ht()),Me.current=null}catch(e){Ue(e)}},[ht,Ue]),xt=t.useCallback(()=>{R||(null!==Me.current?(window.clearTimeout(Me.current),Me.current=null):mt(),Me.current=window.setTimeout(()=>At(),500))},[mt,At,R]);function bt(){const e=Re.current;if(null!=e)return{user:e?.getUid(),group:null,parentMessageId:S};const t=Pe.current;return null!=t?{user:null,group:t?.getGuid(),parentMessageId:S}:{user:null,group:null,parentMessageId:S}}const yt=t.useCallback(function(e){i.flushSync(()=>{q({type:"setAddToMsgInputText",addToMsgInputText:""})}),q({type:"setAddToMsgInputText",addToMsgInputText:e})},[q]),wt=t.useCallback((e,t,o)=>{throw t.setMetadata({error:e}),o?n.CometChatMessageEvents.ccMessageEdited.next({message:t,status:n.MessageStatus.error}):n.CometChatMessageEvents.ccMessageSent.next({message:t,status:n.MessageStatus.error}),e},[]),ft=t.useCallback(()=>{je.current||r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.outgoingMessage,Ve.current)},[Ve,je]),Dt=t.useCallback(e=>{const{receiverId:t,receiverType:n}=pt(),o=new s.CometChat.TextMessage(t,e,n);o.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),o.setMuid(r.CometChatUIKitUtility.ID());const i=Oe.current;return null!==i&&o.setParentMessageId(i),o},[pt,Oe]),Et=t.useCallback(async e=>{try{for(let t=0;t<Ke.length;t++)e=Ke[t].formatMessageForSending(e);const t=await s.CometChat.sendMessage(e);return qe.current.resetCometChatUserGroupMembers(),t}catch(t){console.log(t),wt(t,e,!1)}},[wt]),vt=t.useCallback(async e=>{try{const t=Dt(e);let o=qe.current.getCometChatUserGroupMembers();if(o){let e=[];for(let t=0;t<o.length;t++)e.push(new s.CometChat.User({uid:o[t].getUid(),name:o[t].getName()}));t.setMentionedUsers(e),o=[]}n.CometChatMessageEvents.ccMessageSent.next({message:t,status:n.MessageStatus.inprogress});const r=await Et(t);r&&(n.CometChatMessageEvents.ccMessageSent.next({message:r,status:n.MessageStatus.success}),ft())}catch(e){Ue(e)}},[Dt,ft,Et,Ue]),It=t.useCallback((e,t)=>{const{receiverId:n,receiverType:o}=pt(),r=new s.CometChat.TextMessage(n,e,o);return r.setId(t),r},[pt]),St=t.useCallback(async e=>{try{for(let t=0;t<Ke.length;t++)e=Ke[t].formatMessageForSending(e);const t=await s.CometChat.editMessage(e);return qe.current.resetCometChatUserGroupMembers(),t}catch(t){wt(t,e,!0)}},[wt]),Ft=t.useCallback(async(e,t)=>{try{if(Ge.current)Ge.current(It(e,t.getId()),n.PreviewMessageMode.edit),yt("");else{const o=await St(It(e,t.getId()));yt(""),o&&n.CometChatMessageEvents.ccMessageEdited.next({message:o,status:n.MessageStatus.success})}}catch(e){Ue(e)}},[St,It,Ue]),kt=t.useCallback(async e=>{if(0===(e=e?.trim())?.length||null!==X.textMessageToEdit&&X.textMessageToEdit.getText()===e)return;let t;if("emojiKeyboard"===X.contentToDisplay&&(ue&&ue?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"})),q({type:"setText",text:""}),$.current?.emptyInputField(),null!==X.textMessageToEdit)q({type:"setTextMessageToEdit",textMessageToEdit:null}),await Ft(e,X.textMessageToEdit);else if(t=Ge.current)try{await Promise.all([t(Dt(e),n.PreviewMessageMode.none)])}catch(e){Ue(e)}else await vt(e)},[X.textMessageToEdit,X.contentToDisplay,ue,de,q,Ft,vt,Ue,Dt,Ge,Re]),Tt=t.useCallback(async(e,t)=>{const n=await function(e){return new Promise((t,n)=>{const o=new FileReader;o.onload=()=>{null!==o.result&&t(new File([o.result],e.name,e))},o.onerror=()=>n(new Error(`Converting the file named "${e.name}" to binary failed`)),o.readAsArrayBuffer(e)})}(e),{receiverId:o,receiverType:i}=pt(),a=new s.CometChat.MediaMessage(o,n,t,i);a.setSentAt(r.CometChatUIKitUtility.getUnixTimestamp()),a.setMuid(r.CometChatUIKitUtility.ID()),a.setMetadata({file:n});const l=Oe.current;return null!==l&&a.setParentMessageId(l),a},[pt,Oe]),Mt=t.useCallback(async e=>{try{return await s.CometChat.sendMediaMessage(e)}catch(t){wt(t,e,!1)}},[wt]),Bt=t.useCallback(async(e,t)=>{try{const o=await Tt(e,t);n.CometChatMessageEvents.ccMessageSent.next({message:o,status:n.MessageStatus.inprogress});const r=await Mt(o);r&&(n.CometChatMessageEvents.ccMessageSent.next({message:r,status:n.MessageStatus.success}),ft())}catch(e){Ue(e)}},[Tt,ft,Mt,Ue]),Lt=t.useCallback(async e=>{try{"voiceRecording"===X.contentToDisplay&&(de?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"}));const t=new File([e],`${function(){const e=new Date,t="audio-recording-yyyyMMddHHmmss",n=e.getFullYear().toString(),o=(e.getMonth()+1).toString().padStart(2,"0"),r=e.getDate().toString().padStart(2,"0"),s=e.getHours().toString().padStart(2,"0"),i=e.getMinutes().toString().padStart(2,"0"),a=e.getSeconds().toString().padStart(2,"0");return t.replace("yyyyMMdd",`${n}${o}${r}`).replace("HHmmss",`${s}${i}${a}`)}()}.wav`,{type:e.type});Bt(t,n.CometChatUIKitConstants.MessageTypes.audio)}catch(e){Ue(e)}},[Bt,Ue]);const Ut=t.useCallback(async()=>{const e=ee.current;if(!e?.files?.length||Re.current?.getBlockedByMe())return;const t=e.files[0];let o=e.accept.slice(0,-2);const r=(e=>{const t=e.type;return t.startsWith("image/")?n.CometChatUIKitConstants.MessageTypes.image:t.startsWith("video/")?n.CometChatUIKitConstants.MessageTypes.video:t.startsWith("audio/")?n.CometChatUIKitConstants.MessageTypes.audio:n.CometChatUIKitConstants.MessageTypes.file})(t);o!==r&&(o=r);const s=Ge.current;if(s)try{await Promise.all([s(await Tt(t,o),n.PreviewMessageMode.none)])}catch(e){Ue(e)}else await Bt(t,o);e.value=""},[Bt,Ue,Tt,Ge,Re]);function Rt(){return!X.text||""===X?.text?.trim()||null!==X.textMessageToEdit&&X.textMessageToEdit.getText()===X.text}function Pt(){return p?p(void 0!==a?a:l,bt()):d.jsx("div",{className:"cc-message-composer__send-btn-wrapper",children:d.jsx("cometchat-button",{ref:ie,iconURL:u,hoverText:n.localize("SEND_MESSAGE"),buttonStyle:JSON.stringify(ea(P,He,Rt()))})})}function Ot(){if(b&&(void 0!==a||void 0!==l))return b(void 0!==a?a:l,bt());const e=d.jsx("cometchat-button",{ref:le,hoverText:n.localize("ATTACH"),iconURL:"attachments"===X.contentToDisplay?La:y,buttonStyle:JSON.stringify(ua(P,He,"attachments"===X.contentToDisplay))});let t;if(v&&v.length>0&&(void 0!==a||void 0!==l)){t=v(a||l,bt())}else t=Be.getDataSource().getAttachmentOptions(He,bt());for(let e=0;e<t.length;e++){const n=t[e],{id:o}=n;if("string"==typeof o){let e=n.onClick;"extension_poll"===o&&(e=()=>{n.onClick?.call(new On(Be.getDataSource(),new so({})),[a,l])}),Te.current.set(o,e||null)}}const o=d.jsx(ja,{title:n.localize("ADD_TO_CHAT"),ref:ve,hideLayoutMode:I,actions:t,actionSheetStyle:da(j,He)});return d.jsxs("cometchat-popover",{ref:be,placement:n.Placement.top,popoverStyle:JSON.stringify(la(j)),children:[d.jsx("div",{slot:"children",className:"cc-message-composer__secondary-btn-wrapper",children:e}),d.jsx("div",{slot:"content",className:"cc-message-composer__secondary-content",style:ca(j,He),children:o})]})}function jt(){const e=d.jsx("cometchat-media-recorder",{ref:re,mediaPlayerStyle:JSON.stringify(Ea(G,He)),"cc-media-recorder-submitted":"onVoiceRecordingSubmit",autorecording:"true",recordingType:n.RecordingType.audio,closeIconURL:Q,startIconURL:H,stopIconURL:N,submitButtonIconURL:K,startIconText:"",stopIconText:"",submitButtonIconText:""}),t=d.jsx("cometchat-button",{ref:ge,hoverText:n.localize("VOICE_RECORDING"),iconURL:"voiceRecording"===X.contentToDisplay?La:H,buttonStyle:JSON.stringify(va(P,He,"voiceRecording"===X.contentToDisplay,!1))});return O?null:d.jsxs(Ga,{placement:n.Placement.top,popoverStyle:new o.PopoverStyle({width:fa,height:wa,borderRadius:Da,border:"1px solid rgba(20, 20, 20, 0.08)",boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}),closeOnOutsideClick:!1,children:[d.jsx("div",{slot:"children",className:"cc-message-composer__secondary-btn-wrapper",children:t}),d.jsx("div",{slot:"content",className:"cc-message-composer__secondary-content",style:{width:fa,height:wa,borderRadius:Da,boxSizing:"border-box"},children:"voiceRecording"===X.contentToDisplay?e:null})]})}function Vt(){const e=d.jsx("cometchat-button",{ref:Ce,hoverText:n.localize("AI"),iconURL:"ai"===X.contentToDisplay?La:f,buttonStyle:JSON.stringify(pa(P,He,"ai"===X.contentToDisplay))});let t;t=Be.getDataSource().getAIOptions(Re?.current||null,Pe?.current||null,He,bt(),V);const r=()=>{ce?.click(),q({type:"setContentToDisplay",contentToDisplay:"none"})},s=()=>{Ne(null)},i=d.jsx(Oa,{ref:Se,hideLayoutMode:!0,actions:t,actionSheetStyle:ga(V,He),onActionItemClick:e=>{e instanceof n.CometChatMessageComposerAction&&e?.onClick&&(e.onClick(),r()),e instanceof n.CometChatActionsView&&e?.customView&&Ne(e.customView({backAction:s,closePopover:r}))}});return t.length<=0?d.jsx(d.Fragment,{}):d.jsxs("cometchat-popover",{ref:we,placement:n.Placement.top,popoverStyle:JSON.stringify((a=V,new o.PopoverStyle({width:a?.width||ia,height:a?.height||sa,borderRadius:a?.borderRadius||aa,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"}))),children:[d.jsx("div",{slot:"children",className:"cc-message-composer__ai-btn-wrapper",children:e}),d.jsx("div",{slot:"content",className:"cc-message-composer__ai-content",style:Ca(V,He),children:Qe||i})]});var a}function Gt(){if(D&&(void 0!==a||void 0!==l))return D(void 0!==a?a:l,bt());const e=k&&Rt(),t=Be.getDataSource().getAuxiliaryOptions(bt(),He,a,l),r=o.isMobileDevice()?null:d.jsx("cometchat-button",{ref:pe,hoverText:n.localize("EMOJI"),iconURL:"emojiKeyboard"===X.contentToDisplay?La:w,buttonStyle:JSON.stringify(ya(P,He,"emojiKeyboard"===X.contentToDisplay,e))}),s=d.jsx("cometchat-emoji-keyboard",{ref:ne,emojiKeyboardStyle:JSON.stringify(ba(P,He))});return d.jsxs(d.Fragment,{children:[d.jsx(d.Fragment,{children:Vt()}),d.jsx("div",{style:{flex:1,display:"flex",columnGap:"8px"},children:t.map(e=>e)}),d.jsx("div",{className:"cc-message-composer__default-auxiliary-view-wrapper",style:{display:"flex",flex:"1"},children:d.jsxs("cometchat-popover",{ref:Ae,placement:n.Placement.top,popoverStyle:JSON.stringify(new o.PopoverStyle({width:ma,height:ha,borderRadius:Aa,boxShadow:"0px 0px 0px 1px rgba(20, 20, 20, 0.04), 0px 16px 32px 0px rgba(20, 20, 20, 0.2)"})),children:[d.jsx("div",{slot:"children",className:"cc-message-composer__auxiliary-btn-wrapper",children:r}),d.jsx("div",{slot:"content",className:"cc-message-composer__auxiliary-content",style:xa(He),children:s})]})})]})}function Ht(){if(null===X.textMessageToEdit)return null;const e=X.textMessageToEdit;return d.jsx("cometchat-preview",{style:{textAlign:"left"},ref:De,previewSubtitle:(e=>{const t=/<@uid:(.*?)>/g;let n=e.getText(),o=n,s=t.exec(n),i=[],a=e.getMentionedUsers();for(;null!==s;){let e;for(let t=0;t<a.length;t++)s[1]===a[t].getUid()&&(e=a[t]);e&&(o=o.replace(s[0],"@"+e.getName()),i.push(e)),s=t.exec(n)}return qe.current.setCometChatUserGroupMembers(i),qe.current.setLoggedInUser(r.CometChatUIKitLoginListener.getLoggedInUser()),o})(e),closeButtonIconURL:Sa,previewStyle:JSON.stringify(Xi(P,He))})}return ka({dispatch:q,textInputRef:$,liveReactionBtnElement:Fe,LiveReactionIconURL:F,mySetAddToMsgInputText:yt,actionSheetElement:Ee,secondaryBtnElement:ae,mediaFilePickerRef:ee,textMessageEditPreviewElement:fe,auxiliaryBtnElement:ue,voiceRecordingBtnElement:de,emojiKeyboardElement:te,voiceRecordingElement:oe,text:X.text,propsText:e.text,handleSendButtonClick:kt,primaryBtnElement:se,onTextChange:C,actionIdToActionOnClick:Te,handleTyping:xt,errorHandler:Ue,getReceiverDetails:pt,contentToDisplay:X.contentToDisplay,createPollViewRef:Le,handleSendVoiceMessage:Lt,auxiliaryPopoverElement:he,attachmentPopoverElement:xe,aiPopoverElement:ye,aiBtnElement:ce,setSmartRepliesView:Ne,textFormatters:J,disableMentions:Y,textFormatterArray:Ke,mentionsTextFormatterInstanceRef:qe,userMemberWrapperConfiguration:z,setTextFormatters:ze,CometChatUIKitLoginListener:r.CometChatUIKitLoginListener,group:l,user:a,setUserMemberWrapperConfig:nt,userMemberWrapperConfig:tt,userPropRef:Re,groupPropRef:Pe,setShowListForMentions:Xe,searchMentions:ut,mentionsFormatterInstanceId:Ct,setUsersRequestBuilder:it,setGroupMembersRequestBuilder:lt,setUserMemberListType:rt,userMemberWrapperRef:ct,getComposerId:bt,parentMessageIdPropRef:Oe,isPartOfCurrentChatForUIEvent:dt,triggerClosePreview:()=>{X.textMessageToEdit&&n.CometChatMessageEvents.ccMessageEdited.next({message:X.textMessageToEdit,status:n.MessageStatus.cancelled})}}),d.jsxs(d.Fragment,{children:[X.showPoll&&Le?.current?Le.current:null,d.jsxs("div",{className:"cc-message-composer",style:(Nt=P,{width:Nt?.width||"100%",height:Nt?.height||"100%",boxSizing:"border-box",padding:"14px 16px",border:"none",borderRadius:"0",background:"transparent",display:"flex",flexDirection:"column",justifyContent:"flex-end"}),children:[Ze&&d.jsx("div",{style:{maxHeight:"196px",overflowY:"hidden",display:"flex !important",flexDirection:"column",justifyContent:"flex-end !important",zIndex:2,height:"auto",minHeight:"45px",padding:"0px 0px 1px 0px",width:"100%"},ref:ct,children:d.jsx(me,{userMemberListType:ot,onItemClick:tt?.onItemClick||(e=>{let t=[e];qe.current.setCometChatUserGroupMembers(t),qe.current.getCometChatUserGroupMembers(),qe.current.reRender(),Xe(!1),et(1),Ye("")}),usersRequestBuilder:st,searchKeyword:Je,subtitleView:tt?.subtitleView,disableUsersPresence:tt?.disableUsersPresence,avatarStyle:tt?.avatarStyle,listItemView:tt?.listItemView,statusIndicatorStyle:tt?.statusIndicatorStyle,userPresencePlacement:tt?.userPresencePlacement,hideSeparator:tt?.hideSeparator,loadingStateView:tt?.loadingStateView,onEmpty:gt,loadingIconUrl:tt?.loadingIconURL,group:l,groupMemberRequestBuilder:at,disableLoadingState:!0,onError:gt})}),X.showMentionsCountWarning&&d.jsx("div",{style:{height:"fit-content",position:"relative",width:"100%",boxSizing:"border-box",left:"50%",transform:"translate(-50%)",zIndex:1,padding:"0px 0px 1px 0px"},children:d.jsx("cometchat-icon-button",{text:W||n.localize("MENTIONS_LIMIT_WARNING_MESSAGE"),iconURL:_,buttonStyle:JSON.stringify(qi(0,He,Z))})}),d.jsx("input",{ref:ee,type:"file",onChange:Ut,style:{display:"none"}}),d.jsx("div",{className:"cc-message-composer__header",style:{height:"fit-content",position:"relative",width:"100%",boxSizing:"border-box",left:"50%",transform:"translate(-50%)",zIndex:1,padding:"0px 0px 1px 0px"},children:T??Ht()}),d.jsxs(Va,{ref:$,text:X.addToMsgInputText,placeholderText:g,auxiliaryButtonAlignment:E,textInputStyle:$i(P,He),textFormatters:Ke,children:[d.jsx("div",{"data-slot":"primaryView",className:"cc-message-composer__primary-view",style:{display:"flex",gap:"6px"},children:d.jsxs(d.Fragment,{children:[jt(),Rt()?k?d.jsx(d.Fragment,{}):d.jsx("div",{className:"cc-message-composer__live-reaction-btn-wrapper",style:{},children:d.jsx("cometchat-button",{ref:ke,iconURL:F,hoverText:n.localize("LIVE_REACTION"),buttonStyle:JSON.stringify((Qt=P,{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:Qt?.liveReactionIconTint||"red",background:"transparent",padding:"0"}))})}):d.jsx(d.Fragment,{}),k?Pt():Rt()?d.jsx(d.Fragment,{}):Pt()]})}),d.jsx("div",{"data-slot":"secondaryView",className:"cc-message-composer__secondary-view",style:{flex:"1"},children:Ot()}),d.jsx("div",{"data-slot":"auxilaryView",className:"cc-message-composer__auxiliary-view",style:{display:"flex",flexDirection:"row",alignItems:"center",width:"fit-content",gap:"8px",padding:"0",marginRight:"8px"},children:Gt()})]})]},bt()?.group||bt()?.user)]});var Qt,Nt}const Na=(e,t)=>({width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent50()}`,borderRadius:"inherit",background:t.palette.getBackground(),display:"flex",alignItems:"center",justifyContent:"space-between",flexDirection:"row",padding:"8px",boxSizing:"border-box",...e}),Ka=(e,t,o,r)=>t&&t.current?{textFont:o?.typingIndicatorTextFont||n.fontHelper(r.typography.subtitle2),textColor:o?.typingIndicatorTextColor||r.palette.getPrimary()}:{textFont:o?.subtitleTextFont||n.fontHelper(r.typography.subtitle2),textColor:o?.subtitleTextColor||r.palette.getAccent600()},za=e=>({borderRadius:"24px",width:"36px",height:"36px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorder:"",outerViewBorderSpacing:""});const Ja=e=>({height:"24px",width:"24px",border:"none",borderRadius:"none",background:"transparent",buttonIconTint:e.palette.getPrimary()});var Ya="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2Fbackbutton%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FBack%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.250000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2218.75%22%20y1%3D%228.75%22%20x2%3D%220%22%20y2%3D%228.75%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpolyline%20id%3D%22Path%22%20points%3D%228.75%200%200%208.75%208.75%2017.5%22%3E%3C%2Fpolyline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";var _a="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3ELocked%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Locked%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%23F7A500%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2C3%20C8.1045695%2C3%209%2C3.8954305%209%2C5%20L9.00079851%2C6.00841863%20C9.2437935%2C6.025429%209.36573413%2C6.06795171%209.48842285%2C6.13356635%20C9.65138581%2C6.2207199%209.7792801%2C6.34861419%209.86643365%2C6.51157715%20C9.95358719%2C6.67454011%2010%2C6.83618323%2010%2C7.2819426%20L10%2C9.7180574%20C10%2C10.1638168%209.95358719%2C10.3254599%209.86643365%2C10.4884229%20C9.7792801%2C10.6513858%209.65138581%2C10.7792801%209.48842285%2C10.8664336%20C9.32545989%2C10.9535872%209.16381677%2C11%208.7180574%2C11%20L5.2819426%2C11%20C4.83618323%2C11%204.67454011%2C10.9535872%204.51157715%2C10.8664336%20C4.34861419%2C10.7792801%204.2207199%2C10.6513858%204.13356635%2C10.4884229%20C4.04641281%2C10.3254599%204%2C10.1638168%204%2C9.7180574%20L4%2C7.2819426%20C4%2C6.83618323%204.04641281%2C6.67454011%204.13356635%2C6.51157715%20C4.2207199%2C6.34861419%204.34861419%2C6.2207199%204.51157715%2C6.13356635%20C4.63442137%2C6.06786855%204.7565156%2C6.02532125%205.00012601%2C6.00835408%20L5%2C5%20C5%2C3.8954305%205.8954305%2C3%207%2C3%20Z%20M7%2C4%20C6.48716416%2C4%206.06449284%2C4.38604019%206.00672773%2C4.88337887%20L6%2C5%20L6%2C6%20L8%2C6%20L8%2C5%20C8%2C4.44771525%207.55228475%2C4%207%2C4%20Z%22%20id%3D%22Rectangle-3%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Wa="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2214px%22%20height%3D%2214px%22%20viewBox%3D%220%200%2014%2014%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EPrivate%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Symbols-v2%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Private%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20id%3D%22Rectangle%22%20fill%3D%22%2300C86F%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2214%22%20height%3D%2214%22%20rx%3D%227%22%3E%3C%2Frect%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2C5%20C5.33333333%2C4.66666667%206.33333333%2C4%207%2C3%20C7.66666667%2C4%208.66666667%2C4.66666667%2010%2C5%20L10%2C6.14589803%20C10%2C8.20151331%208.83859819%2C10.0807009%207%2C11%20L7%2C11%20L7%2C11%20C5.16140181%2C10.0807009%204%2C8.20151331%204%2C6.14589803%20L4%2C5%20L4%2C5%20Z%22%20id%3D%22Rectangle%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Za=e=>{const{theme:r}=t.useContext(U),{avatarStyle:i={},statusIndicatorStyle:a=null,messageHeaderStyle:l={},listItemStyle:c={},subtitleView:C=null,disableUsersPresence:g=!1,disableTyping:u=!1,protectedGroupIcon:p=_a,passwordGroupIcon:h,privateGroupIcon:b=Wa,menu:y=null,user:w,group:f,backButtonIconURL:D=Ya,hideBackButton:E,listItemView:v=null,onError:I,onBack:S=()=>{}}=e,[F,k]=t.useState(""),[T,M]=t.useState(null),B=m(w),L=m(f),R=m(S),[P,O]=A(null),j=t.useRef(!1),V=x(I),G=t.useCallback(()=>{const e=B.current,t=L.current;if(e)k(n.localize(e.getStatus().toUpperCase()));else if(t){const e=t.getMembersCount(),o=n.localize(e>1?"MEMBERS":"MEMBER");k(`${e} ${o}`)}},[B,L]),H=t.useCallback(e=>{const t=B.current;t&&(t.setStatus(e.getStatus()),k(t.getStatus()))},[B]),Q=t.useCallback(e=>{try{const t=e?.getSender(),o=e?.getReceiverId();if(t?.getUid()===B?.current?.getUid()&&T?.getUid()===o){if((new Z).getUserStatusVisible(B?.current))return;k(n.localize("IS_TYPING"))}L?.current?.getGuid()===o&&k(`${t?.getName()} ${n.localize("IS_TYPING")}`)}catch(e){V(e)}},[B,L,V,T]),N=t.useCallback(()=>{try{const e=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{L?.current?.getGuid()===e?.userAddedIn?.getGuid()&&(e?.usersAdded.length>0&&e?.usersAdded.forEach(e=>{e?.getUid()===T?.getUid()&&L?.current?.setHasJoined(!0)}),L?.current?.setMembersCount(e?.userAddedIn?.getMembersCount()),G())}),t=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{L?.current?.getGuid()===e?.kickedFrom?.getGuid()&&(T?.getUid()===e?.kickedUser?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.kickedFrom?.getMembersCount()),G())}),o=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{L?.current?.getGuid()===e?.joinedGroup?.getGuid()&&(T?.getUid()===e?.joinedUser?.getUid()&&L?.current?.setHasJoined(!0),L?.current?.setMembersCount(e?.joinedGroup?.getMembersCount()),G())}),r=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{L?.current?.getGuid()===e?.kickedFrom?.getGuid()&&(T?.getUid()===e?.kickedUser?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.kickedFrom?.getMembersCount()),G())}),s=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{L?.current?.getGuid()===e?.group?.getGuid()&&(L?.current?.setOwner(e?.group?.getOwner()),G())}),i=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{L?.current?.getGuid()===e?.leftGroup?.getGuid()&&(T?.getUid()===e?.userLeft?.getUid()&&L?.current?.setHasJoined(!1),L?.current?.setMembersCount(e?.leftGroup?.getMembersCount()),G())});return()=>{try{e.unsubscribe(),t.unsubscribe(),o.unsubscribe(),r.unsubscribe(),s.unsubscribe(),i.unsubscribe()}catch(e){V(e)}}}catch(e){V(e)}},[L,G,V,T]),K=t.useCallback(()=>{const e="userList_"+Date.now(),t="groupsList_"+Date.now(),o="connection_"+Date.now();let r,i;return g||s.CometChat.addUserListener(e,new s.CometChat.UserListener({onUserOnline:e=>{B.current?.getUid()===e.getUid()&&H(e)},onUserOffline:e=>{B.current?.getUid()===e?.getUid()&&H(e)}})),u||(r=n.CometChatMessageEvents.onTypingStarted.subscribe(e=>{j.current=!0,Q(e)}),i=n.CometChatMessageEvents.onTypingEnded.subscribe(e=>{j.current=!1,G()})),s.CometChat.addGroupListener(t,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(e,t,n,o,r)=>{L.current?.getGuid()===r?.getGuid()&&t.getUid()===T?.getUid()&&L.current?.setScope(n),G()},onGroupMemberKicked:(e,t,n,o)=>{L.current?.getGuid()===o?.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(o?.getMembersCount()),G())},onMemberAddedToGroup:(e,t,n,o)=>{L.current?.getGuid()===o.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!0),L.current?.setMembersCount(o?.getMembersCount()),G())},onGroupMemberLeft:(e,t,n)=>{L.current?.getGuid()===n.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(n.getMembersCount()),G())},onGroupMemberJoined:(e,t,n)=>{L.current?.getGuid()===n.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!0),L.current?.setMembersCount(n.getMembersCount()),G())},onGroupMemberBanned:(e,t,n,o)=>{L.current?.getGuid()===o.getGuid()&&(t.getUid()===T?.getUid()&&L.current?.setHasJoined(!1),L.current?.setMembersCount(o.getMembersCount()),G())}})),s.CometChat.addConnectionListener(o,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener => On Connected")}})),()=>{s.CometChat.removeUserListener(e),s.CometChat.removeGroupListener(t),s.CometChat.removeConnectionListener(o),r?.unsubscribe(),i?.unsubscribe()}},[B,L,H,u,G,Q,T,g]),z=t.useCallback(()=>{let e=(new Z).getUserStatusVisible(B.current);if(B.current){if(!g&&!e)return"#00f300"}else if(L.current){const e=L.current.getType();if(e===n.CometChatUIKitConstants.GroupTypes.private)return"#00f300";if(e===n.CometChatUIKitConstants.GroupTypes.password)return"#F7A500"}return null},[B,L,g]),J=t.useCallback(()=>{let e="";if(L.current)switch(L.current?.getType()){case n.CometChatUIKitConstants.GroupTypes.password:e=h||p;break;case n.CometChatUIKitConstants.GroupTypes.private:e=b;break;default:e=""}return e},[L,p,b,h]),Y=t.useCallback(()=>({...new o.AvatarStyle(za(r)),...i}),[i,r]),_=e=>{if(e instanceof s.CometChat.User){let t=(new Z).getUserStatusVisible(e);return g||t?null:function(e){const t=null!==e?e:{};return{...t,border:t?.border||"none",borderRadius:t?.borderRadius||"24px",height:t?.height||"12px",width:t?.width||"12px"}}(a)}return null},W=t.useCallback(()=>((e,t)=>new o.ListItemStyle({height:e?.height||"45px",width:e?.width||"100%",background:e?.background||"inherit",activeBackground:e?.activeBackground||"transparent",borderRadius:e?.borderRadius||"0",titleFont:e?.titleFont||n.fontHelper(t.typography.title2),titleColor:e?.titleColor||t.palette.getAccent(),border:e?.border||"none",separatorColor:e?.separatorColor||"",hoverBackground:e?.hoverBackground||"transparent",padding:e?.padding||"0"}))(c,r),[c,r]),X=t.useCallback(()=>{if(C)return C;return B.current?.getBlockedByMe()||B.current?.getHasBlockedMe()?null:d.jsx("div",{children:d.jsx("cometchat-label",{text:F,labelStyle:JSON.stringify(Ka(B.current,j,l,r))})})},[B,C,F,r,l]),q=t.useCallback(()=>{if(v)return v;{let e=B.current||L.current;return d.jsx("cometchat-list-item",{avatarName:B.current?.getName()||L.current?.getName(),avatarURL:B.current?.getAvatar()||L.current?.getIcon(),listItemStyle:JSON.stringify(W()),statusIndicatorColor:z(),statusIndicatorIcon:J(),title:B.current?.getName()||L.current?.getName(),hideSeparator:!0,statusIndicatorStyle:JSON.stringify(_(e)),avatarStyle:JSON.stringify(Y()),style:{width:"100%"},children:d.jsx("div",{slot:"subtitleView",children:X()})})}},[B,L,v,X,Y,_,W,J,z]),$=t.useCallback(()=>y?d.jsx("div",{className:"cc-message-header__menu",style:{width:"fit-content",display:"flex",alignItems:"center",justifyContent:"flex-end"},children:y}):null,[y]);return function(e,n,o,r,i,a,l,c,C,d){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{const t=[];return e&&(t.push(o()),t.push(r())),()=>{for(let e=0;e<t.length;e++)return t[e]()}},[e,r,o]),t.useEffect(()=>{if(!a)return;const e="cc-button-clicked",t=()=>l.current?.();return a.addEventListener(e,t),()=>{a.removeEventListener(e,t)}},[a,l]),t.useEffect(()=>{d()},[c.current,C.current,d])}(T,M,N,K,V,P,R,B,L,G),d.jsxs("div",{className:"cc-message-header__wrapper",style:Na(l,r),children:[d.jsxs("div",{className:"cc-message-header",style:{display:"flex",alignItems:"center",justifyContent:"flex-start",minWidth:"0",flex:"1 1 0%",height:"100%",boxSizing:"border-box",borderRadius:"inherit"},children:[E?null:d.jsx("div",{className:"cc-message-header__back-button",style:{width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"flex-start"},children:d.jsx("cometchat-button",{iconURL:D,buttonStyle:JSON.stringify(Ja(r)),ref:O})}),d.jsx("div",{className:"cc-message-header__listitem",style:{height:"100%",width:"90%",display:"flex",alignItems:"center",justifyContent:"flex-start"},children:q()})]}),$()]})},Xa=ye({tagName:"cometchat-reactions",elementClass:r.CometChatReactions,react:t}),qa=ye({tagName:"cometchat-emoji-keyboard",elementClass:o.CometChatEmojiKeyboard,events:{onEmojiClick:"cc-emoji-clicked"},react:t}),$a=ye({tagName:"cometchat-icon-button",elementClass:o.CometChatIconButton,react:t,events:{buttonClick:"cc-button-clicked"}}),el=ye({tagName:"cometchat-button",elementClass:o.CometChatButton,react:t,events:{buttonClick:"cc-button-clicked"}}),tl=ye({tagName:"cometchat-date",elementClass:o.CometChatDate,react:t}),nl=ye({tagName:"cometchat-label",elementClass:o.CometChatLabel,react:t}),ol=ye({tagName:"cometchat-loader",elementClass:o.CometChatLoader,react:t}),rl=ye({tagName:"cometchat-avatar",elementClass:o.CometChatAvatar,react:t}),sl=ye({tagName:"cometchat-receipt",elementClass:o.CometChatReceipt,react:t}),il=(e,t)=>({height:"100%",width:"100%",flex:"1 1 0",order:"2",position:"relative",display:"flex",flexDirection:"column",border:`1px solid ${t.palette.getAccent50()}`,borderRadius:"inherit",background:t.palette.getBackground(),...e}),al=(e,t,o,r={},s)=>{const i={height:"100%",width:"100%",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:r.threadReplyIconTint||t.palette.getAccent600(),display:"flex",alignItems:"center",gap:"5px",buttonTextColor:r?.threadReplyTextColor||t.palette.getAccent(),buttonTextFont:r?.threadReplyTextFont||n.fontHelper(t.typography.text2),iconHeight:"15px",iconWidth:"15px"};return e.getSender()&&e.getSender().getUid()!==o?.getUid()||s==n.MessageBubbleAlignment.left?{...i,flexFlow:"row"}:{...i,flexFlow:"row-reverse"}},ll=e=>({height:"fit-content",width:"fit-content",background:e.palette.getPrimary(),display:"flex",justifyContent:"center",buttonTextFont:n.fontHelper(e.typography.text2),buttonTextColor:e.palette.getAccent("dark"),border:"none",borderRadius:"12px",padding:"2px 6px"}),cl=(e,t,o,s)=>{const i={background:"transparent",borderRadius:"12px"},a={background:t.palette.getSecondary(),borderRadius:"12px"};return e.getDeletedAt()?{...i}:e?.getType()!==n.CometChatUIKitConstants.calls.meeting||e?.getSender()&&e?.getSender().getUid()!==s?.getUid()?e?.getType()===r.StickersConstants.sticker?i:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.text||e.getSender()&&s?.getUid()!==e.getSender().getUid()?e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.message||e.getType()!==n.CometChatUIKitConstants.MessageTypes.audio?e.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember||e.getCategory()===n.CometChatUIKitConstants.MessageCategory.call?{...i,border:`1px solid ${t.palette.getSecondary()}`}:e.getDeletedAt()||e.getCategory()!==n.CometChatUIKitConstants.MessageCategory.interactive?a:{...a,width:"300px"}:{...a,borderRadius:""}:{...a,background:o===n.MessageListAlignment.left?t.palette.getSecondary():t.palette.getPrimary()}:{...a,background:t.palette.getPrimary(),border:"none"}},Cl=(e,t)=>{const r=t?.getType()===n.CometChatUIKitConstants.MessageTypes.text;return new o.ReceiptStyle({waitIconTint:e.palette.getAccent700(),sentIconTint:e.palette.getAccent600(),deliveredIconTint:e.palette.getAccent600(),readIconTint:r?e.palette.getBackground():e.palette.getPrimary(),errorIconTint:e.palette.getError(),height:"11px",width:"12px",background:"none"})},dl=(e,t,o,r)=>{const s={display:"flex",alignItems:"end",padding:"1px 8px 8px",gap:"4px",marginTop:"0"};return e?{...s,justifyContent:"center",height:"fit-content",borderRadius:"22px",padding:"3px 5px",paddingTop:"2px",position:"relative",marginTop:"-22px",marginRight:"12px",background:t.palette.getAccent500("dark"),width:"fit-content"}:(o?.getType()===n.CometChatUIKitConstants.MessageTypes.text&&(s.padding="0px 8px 8px",s.marginTop=r===n.MessageBubbleAlignment.right?"-6px":"-5px"),s)},gl=e=>{let t="center";return e===n.MessageBubbleAlignment.right?t="flex-end":e===n.MessageBubbleAlignment.left&&(t="flex-start"),{display:"flex",justifyContent:t,width:"100%",boxSizing:"border-box"}},ul=(e,t)=>({textColor:e?.TimestampTextColor||t.palette.getAccent600(),textFont:e?.TimestampTextFont||n.fontHelper(t.typography.caption3),padding:"0",display:"block"}),pl=(e,t)=>{const o={...ml(e),...t};return{textFont:o?.nameTextFont||n.fontHelper(e.typography.caption2),textColor:o?.nameTextColor||e.palette.getAccent600()}},hl=(e,t)=>new o.DateStyle({textFont:e?.textFont||n.fontHelper(t.typography.subtitle2),textColor:e?.textColor||t.palette.getAccent600(),background:e?.background||"inherit",height:e?.height||"100%",width:e?.width||"100%",border:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:e?.borderRadius||"8px"}),ml=e=>new r.MessageListStyle({background:e.palette.getBackground(),border:"none",emptyStateTextFont:n.fontHelper(e.typography.title1),emptyStateTextColor:e.palette.getAccent600(),errorStateTextFont:n.fontHelper(e.typography.title1),errorStateTextColor:e.palette.getAccent600(),loadingIconTint:e.palette.getAccent600(),nameTextFont:n.fontHelper(e.typography.caption2),nameTextColor:e.palette.getAccent600(),threadReplyTextFont:n.fontHelper(e.typography.subtitle1),threadReplyIconTint:e.palette.getAccent600(),threadReplyTextColor:e.palette.getAccent600(),TimestampTextFont:n.fontHelper(e.typography.caption2),TimestampTextColor:e.palette.getAccent600()}),Al=(e,t)=>({iconTint:{...ml(t),...e}.loadingIconTint}),xl=(e,t)=>{const n={...ml(t),...e};return{textFont:n.errorStateTextFont,textColor:n.errorStateTextColor}},bl=(e,t)=>({...new o.AvatarStyle({borderRadius:"24px",width:"28px",height:"28px",border:"none",backgroundColor:t.palette.getAccent700(),nameTextColor:t.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(t.typography.subtitle1),outerViewBorderWidth:"0",outerViewBorderRadius:"0",outerViewBorderColor:"",outerViewBorderSpacing:"0"}),...e}),yl=e=>{let t="center";return e===n.MessageBubbleAlignment.right?t="flex-end":e===n.MessageBubbleAlignment.left&&(t="flex-start"),{display:"flex",justifyContent:t,width:"100%",marginBottom:"16px"}},wl={padding:"0px 0px 0px 15px",overflow:"hidden",display:"flex",justifyContent:"flex-end",marginRight:"8px",boxSizing:"border-box"},fl=e=>({width:"100%",padding:"5px 0px",boxSizing:"border-box",display:"flex",marginTop:"-9px",justifyContent:e===n.MessageBubbleAlignment.left?"flex-start":"flex-end"});function Dl(e){return{height:"24px",width:"24px",border:"none",borderRadius:"0",buttonIconTint:e.palette.getPrimary(),background:"transparent",position:"absolute",top:"20px",right:"16px"}}const El=e=>({height:"1px",width:"100%",background:e.palette.getAccent100()});function vl(e,t){return new o.ReceiptStyle({deliveredIconTint:t?.deliveredIconTint||e.palette.getAccent600(),readIconTint:t?.readIconTint||e.palette.getPrimary(),errorIconTint:e.palette.getError(),height:"20px",width:"20px"})}const Il=(e,t)=>{let r=e;return r={...new o.DateStyle({textFont:n.fontHelper(t.typography.caption2),textColor:t.palette.getAccent600(),background:t.palette.getAccent100(),height:"100%",width:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"8px"}),...r},r.background=r.background||t.palette.getAccent600(),r},Sl={background:"transparent",height:"",width:"",border:"none",borderRadius:"none"},Fl={marginLeft:"auto"},kl={display:"flex"},Tl={width:"100%"},Ml=(e,t)=>({...{minWidth:"360px",height:"620px",margin:"0 auto",background:e.palette.getBackground(),borderRadius:"12px",overflow:"hidden",boxSizing:"border-box"},...t?Object.fromEntries(Object.entries(t).filter(([e,t])=>void 0!==t&&""!==t&&null!==t)):{}}),Bl=e=>({marginTop:"8px",marginBottom:"8px",marginLeft:"10px",fontSize:n.fontHelper(e.typography.subtitle2),fontWeight:"500",color:e.palette.getAccent600(),display:"flex"}),Ll=e=>({marginBottom:"8px",marginLeft:"10px",fontSize:n.fontHelper(e.typography.subtitle2),fontWeight:"500",color:e.palette.getAccent600(),display:"flex"});var Ul="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",Rl="data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E";const Pl=e=>{const{theme:i}=t.useContext(U),{title:a=n.localize("MESSAGE_INFORMATION"),closeIconURL:l,onClose:c,message:C,bubbleView:g,subtitleView:u=null,listItemView:p=null,messageInformationStyle:h,listItemStyle:m,receiptDatePattern:A,template:x,loadingIconURL:b=Ul,backdropStyle:y=new o.BackdropStyle({})}=e,[w,f]=t.useState(),[D,E]=t.useState(x),[v,I]=t.useState([]),S=t.useRef(null),F=()=>({...new o.ListItemStyle({height:"70px",width:"100%",background:"inherit",borderRadius:"0",titleFont:n.fontHelper(i.typography.title2),titleColor:i.palette.getAccent(),border:"none",separatorColor:i.palette.getAccent200(),hoverBackground:i.palette.getAccent50()}),...m});async function T(e){if(e?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group){let t=await s.CometChat.getMessageReceipts(e?.getId()),n=t.filter(e=>e.getSender().getUid()!==S.current?.getUid());return I(n),t}}t.useEffect(()=>{if(!x){const t=Zn.getDataSource()?.getMessageTemplate(e.message?.getType(),e.message?.getCategory(),i);t&&E(t)}},[e.message,x,i]);const B=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(e=>{L(e)}),t=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(e=>{L(e)});return()=>{try{e?.unsubscribe(),t?.unsubscribe()}catch(e){console.log(e)}}}catch(e){console.log(e)}},[]),L=t.useCallback(e=>{try{C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&T(C)}catch(e){console.log(e)}},[]);t.useEffect(()=>{const e=B();return()=>{e?.()}},[]),t.useEffect(()=>{C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&f(C.getReceiver()),C?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&T(C)},[C]);const R=t.useCallback(()=>{if(r.CometChatUIKitLoginListener.getLoggedInUser()&&(S.current=r.CometChatUIKitLoginListener.getLoggedInUser()),C){if(g)return g(C);{if(!D)return d.jsx(d.Fragment,{});const e=(new Z).messageBubbleStyle(C,i,n.MessageBubbleAlignment.right,S.current);return(new Z).getMessageBubble(C,D,e,n.MessageBubbleAlignment.right)}}return null},[C,g,D,i]);function P(e,t){return null!==u&&"function"==typeof u?d.jsx(d.Fragment,{children:u(C)}):d.jsx("div",{style:Tl,children:d.jsx("div",{className:"cc-receipts__subtitle",children:O(e,t)})})}function O(e,t){return d.jsxs("div",{className:"cc-message_information__receipt-container",children:[d.jsxs("div",{className:"cc-message_information__receipt",style:kl,children:[d.jsx("div",{className:"cc-message_information__delivered-receipt",children:d.jsx("cometchat-receipt",{receipt:n.Receipts.delivered,errorIcon:Rl,deliveredIcon:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",receiptStyle:JSON.stringify(vl(i,h))})}),d.jsx("div",{style:j,className:"cc_message-information__subtitle-text",children:void 0!==e&&n.localize("DELIVERED")}),d.jsx("div",{className:"cc_message-information__date",style:Fl,children:d.jsx("cometchat-date",{timestamp:e,customDateString:A?A(e):null,pattern:A?null:n.DatePatterns.DateTime,dateStyle:JSON.stringify(Il(Sl,i))})})]}),t&&d.jsxs("div",{className:"cc-message_information__receipt",style:kl,children:[d.jsx("div",{className:"cc-message_information__read-receipt",children:d.jsx("cometchat-receipt",{receipt:n.Receipts.read,errorIcon:Rl,readIcon:"data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cline%20y1%3D%22-0.75%22%20x2%3D%2212.5391%22%20y2%3D%22-0.75%22%20transform%3D%22matrix%28-0.641971%200.766729%20-0.836709%20-0.547648%2019%207.38586%29%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%2F%3E%3Cpath%20d%3D%22M16.6377%207L8.87922%2016.3095L5%2013.3697%22%20stroke%3D%22%2339f%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",receiptStyle:JSON.stringify(vl(i,h))})}),d.jsx("div",{style:j,className:"cc_message-information__subtitle-text",children:void 0!==t&&n.localize("READ")}),void 0!==t&&d.jsx("div",{className:"cc_message-information__date",style:Fl,children:d.jsx("cometchat-date",{timestamp:t,customDateString:A?A(t):null,pattern:A?null:n.DatePatterns.DateTime,dateStyle:JSON.stringify(Il(Sl,i))})}),void 0===t&&d.jsx("div",{className:"cc_message-information__date",style:Fl,children:"..."})]})]})}const j={font:n.fontHelper(i.typography.subtitle2),color:i.palette.getAccent600()},V=new o.AvatarStyle({borderRadius:"50%",width:"43px",height:"43px"});function G(e){return d.jsx(M,{id:e.getMessageId(),title:e.getSender()?.getName(),avatarURL:e.getSender()?.getAvatar(),avatarName:e.getSender()?.getName(),hideSeparator:!1,isActive:!1,avatarStyle:V,listItemStyle:F(),subtitleView:P(e.getDeliveredAt(),e.getReadAt()),subtitleViewClassName:"cc-message_information__subtitle-view",tailViewClassName:"cc-receipt-details__tail-view"})}return d.jsx("div",{className:"cc__messageinfo__wrapper",style:Tl,children:d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify((Q=y,{background:"rgba(0, 0, 0, 0.5)",position:"absolute",width:Q?.width,height:Q?.height,...Q})),children:d.jsxs("div",{className:"cc__messageinfo",style:Ml(i,h),children:[d.jsxs("div",{className:"cc__messageinfo__header",style:{textAlign:"center",fontSize:"22px",fontWeight:"700",padding:"19px 0px",position:"relative"},children:[d.jsxs("div",{className:"cc__messageinfo__title",children:[" ",a," "]}),d.jsx(J,{iconURL:l,hoverText:n.localize("CLOSE"),buttonStyle:Dl(i),onClick:c})]}),d.jsxs("div",{className:"cc__messageinfo__content",style:Tl,children:[d.jsx("div",{style:Ll(i),children:n.localize("MESSAGE")}),d.jsx("cometchat-divider",{dividerStyle:JSON.stringify(El(i))}),d.jsx("div",{className:"cc__messageinfo__bubble-wrapper",style:(H=!g,{height:"fit-content",maxHeight:"182px",overflow:"hidden auto",boxSizing:"border-box",padding:"2px 8px",justifyContent:"flex-end",display:H?"flex":"inherit",paddingRight:H?"16px":"8px"}),children:R()}),d.jsx("cometchat-divider",{dividerStyle:JSON.stringify(El(i))}),d.jsx("div",{style:Bl(i),children:n.localize("RECEIPT_INFORMATION")}),d.jsx("cometchat-divider",{dividerStyle:JSON.stringify(El(i))}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&void 0!==C.getDeliveredAt()&&d.jsx("div",{children:d.jsx(M,{id:C.getConversationId(),title:w?.getName(),avatarURL:w?.getAvatar(),avatarName:w?.getName(),hideSeparator:!1,isActive:!1,avatarStyle:V,listItemStyle:F(),subtitleView:P(C.getDeliveredAt(),C.getReadAt()),subtitleViewClassName:"cc-message_information__subtitle-view",tailViewClassName:"cc-receipt-details__tail-view"})}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&void 0===C.getDeliveredAt()&&d.jsxs("div",{style:{padding:"2em 0px 0px 0px",fontSize:"18px",textAlign:"center",color:i.palette.getAccent400()},children:[" ",n.localize("NO_RECIPIENT")," "]}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&v.length>0&&d.jsx("div",{children:d.jsx(k,{list:v,listItem:function(e){return d.jsx(d.Fragment,{children:p?p(C,e):G(e)})},state:0===v.length?n.States.loading:n.States.loaded,hideSearch:!0,showSectionHeader:!1,loadingIconURL:b})}),C.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group&&v.length<=0&&d.jsxs("div",{style:{padding:"2em 0px 0px 0px",fontSize:"18px",textAlign:"center",color:i.palette.getAccent400()},children:[" ",n.localize("NO_RECIPIENTS")," "]})]})]})})});var H,Q};var Ol;class jl{constructor(e,t,n,o,r){if(this.messagesRequest=null,this.fetchNextMessages=()=>this.messagesRequest?.fetchNext(),this.fetchPreviousMessages=()=>this.messagesRequest?.fetchPrevious(),e){let r;t?(e.guid=void 0,r=e.setUID(t.getUid())):n&&(e.uid=void 0,r=e.setGUID(n.getGuid())),o&&r.setMessageId(o),this.messagesRequest=r.build()}else{const e=(new s.CometChat.MessagesRequestBuilder).setTypes(Be.dataSource.getAllMessageTypes()).setCategories(Be.dataSource.getAllMessageCategories()).hideReplies(!0).setLimit(30);o&&e.setMessageId(o),r&&e.setParentMessageId(r),t?(e.setUID(t.getUid()),e.guid=void 0):n&&(e.setGUID(n.getGuid()),e.uid=void 0),this.messagesRequest=e.build()}}static removeListeners(){s.CometChat.removeGroupListener(this.groupListenerId),s.CometChat.removeConnectionListener(this.connectionListenerId),Be.names.includes("calling")&&s.CometChat.removeCallListener(this.callListenerId)}static attachConnectionListener(e){const t="MessageList_connection_"+String(Date.now());s.CometChat.addConnectionListener(t,new s.CometChat.ConnectionListener({onConnected:()=>{console.log("ConnectionListener =>connected"),e&&e()},onDisconnected:()=>{console.log("ConnectionListener => On Disconnected")}}))}}Ol=jl,jl.groupListenerId="group_"+(new Date).getTime(),jl.callListenerId="call_"+(new Date).getTime(),jl.connectionListenerId="MessageList_connection_"+String(Date.now()),jl.attachListeners=e=>{s.CometChat.addGroupListener(Ol.groupListenerId,new s.CometChat.GroupListener({onGroupMemberScopeChanged:(t,o,r,s,i)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,i)},onGroupMemberKicked:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberBanned:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberUnbanned:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onMemberAddedToGroup:(t,o,r,s)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,s)},onGroupMemberLeft:(t,o,r)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,r)},onGroupMemberJoined:(t,o,r)=>{e(n.CometChatUIKitConstants.MessageCategory.action,t,r)}})),Be.names.includes("calling")&&s.CometChat.addCallListener(Ol.callListenerId,new s.CometChat.CallListener({onIncomingCallReceived:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onIncomingCallCancelled:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onOutgoingCallRejected:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onOutgoingCallAccepted:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)},onCallEndedMessageReceived:t=>{e(n.CometChatUIKitConstants.MessageCategory.call,t)}}))};const Vl={parentMessageId:0,user:void 0,group:void 0,emptyStateText:n.localize("NO_MESSAGES_FOUND"),errorStateText:n.localize("SOMETHING_WRONG"),emptyStateView:null,errorStateView:null,loadingStateView:null,disableReceipt:!1,hideReceipt:!1,disableSoundForMessages:!1,customSoundForMessages:"",readIcon:"data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2212%22%20viewBox%3D%220%200%2014%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20opacity%3D%220.8%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.15147%203.15262C9.32528%202.93804%209.29224%202.62319%209.07766%202.44938C8.86308%202.27557%208.54822%202.30861%208.37441%202.52319L3.61414%208.39998L1.626%206.42494C1.4301%206.23032%201.11352%206.23137%200.918901%206.42727C0.724285%206.62318%200.725331%206.93976%200.921238%207.13438L3.30197%209.49942C3.40229%209.59908%203.54012%209.6516%203.68131%209.64398C3.82251%209.63635%203.95388%209.5693%204.04289%209.45942L9.15147%203.15262ZM13.0814%203.16663C13.263%202.95855%2013.2415%202.6427%2013.0334%202.46115C12.8253%202.27961%2012.5095%202.30111%2012.3279%202.50919L7.17358%208.41667L6.74794%207.99934C6.55077%207.80601%206.2342%207.80912%206.04087%208.0063C5.84754%208.20348%205.85066%208.52004%206.04783%208.71337L6.85187%209.50172C6.95016%209.59809%207.08383%209.64968%207.22138%209.64433C7.35892%209.63897%207.48818%209.57715%207.57868%209.47343L13.0814%203.16663Z%22%20fill%3D%22%239C9CA3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deliveredIcon:"data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2212%22%20viewBox%3D%220%200%2014%2012%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20opacity%3D%220.8%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M9.15147%203.15262C9.32528%202.93804%209.29224%202.62319%209.07766%202.44938C8.86308%202.27557%208.54822%202.30861%208.37441%202.52319L3.61414%208.39998L1.626%206.42494C1.4301%206.23032%201.11352%206.23137%200.918901%206.42727C0.724285%206.62318%200.725331%206.93976%200.921238%207.13438L3.30197%209.49942C3.40229%209.59908%203.54012%209.6516%203.68131%209.64398C3.82251%209.63635%203.95388%209.5693%204.04289%209.45942L9.15147%203.15262ZM13.0814%203.16663C13.263%202.95855%2013.2415%202.6427%2013.0334%202.46115C12.8253%202.27961%2012.5095%202.30111%2012.3279%202.50919L7.17358%208.41667L6.74794%207.99934C6.55077%207.80601%206.2342%207.80912%206.04087%208.0063C5.84754%208.20348%205.85066%208.52004%206.04783%208.71337L6.85187%209.50172C6.95016%209.59809%207.08383%209.64968%207.22138%209.64433C7.35892%209.63897%207.48818%209.57715%207.57868%209.47343L13.0814%203.16663Z%22%20fill%3D%22%239C9CA3%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",sentIcon:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2016%2016%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F16%2FMessage%20Sent%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F16%2FMessage-Sent%22%20fill%3D%22%23000000%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M11.1282564%2C3.43708984%20C11.3839897%2C3.0108676%2011.9368239%2C2.87265904%2012.3630462%2C3.12839238%20C12.7564821%2C3.36445393%2012.9045099%2C3.85366653%2012.7238142%2C4.26276853%20L12.6717436%2C4.3631822%20L7.87174363%2C12.3631822%20C7.59058211%2C12.8317847%206.96826751%2C12.9373278%206.54992747%2C12.6127032%20L6.4636039%2C12.5365321%20L3.2636039%2C9.33653212%20C2.91213203%2C8.98506026%202.91213203%2C8.41521177%203.2636039%2C8.06373991%20C3.58578644%2C7.74155737%204.091466%2C7.71470883%204.44423138%2C7.98319428%20L4.5363961%2C8.06373991%20L6.921%2C10.448136%20L11.1282564%2C3.43708984%20Z%22%20id%3D%22Style%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",waitIcon:"data:image/svg+xml,%3Csvg%20width%3D%2225%22%20height%3D%2224%22%20viewBox%3D%220%200%2025%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.01057%208.04728C8.34753%209.99213%209.53177%2011.3242%2011.6239%2012C13.716%2011.3242%2014.9002%209.99213%2015.2372%208.04728C15.2572%207.91731%2015.2488%207.78455%2015.2125%207.65816C15.1762%207.53177%2015.1129%207.41476%2015.027%207.3152C14.9411%207.21564%2014.8346%207.1359%2014.7149%207.08149C14.5952%207.02707%2014.4651%206.99928%2014.3336%207.00001H8.9142C8.7827%206.99928%208.65261%207.02707%208.5329%207.08149C8.41319%207.1359%208.30671%207.21564%208.2208%207.3152C8.1349%207.41476%208.07161%207.53177%208.03532%207.65816C7.99902%207.78455%207.99058%207.91731%208.01057%208.04728Z%22%20fill%3D%22%23808080%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M8.91423%2017C8.78279%2017.0007%208.65276%2016.9729%208.5331%2016.9185C8.41343%2016.8642%208.30699%2016.7845%208.22109%2016.685C8.1352%2016.5855%208.0719%2016.4686%208.03556%2016.3423C7.99922%2016.2159%207.9907%2016.0832%208.01059%2015.9533C8.34756%2014.0085%209.5318%2012.6764%2011.6239%2012C13.716%2012.6764%2014.9003%2014.0085%2015.2372%2015.9533C15.2571%2016.0832%2015.2486%2016.2159%2015.2123%2016.3423C15.1759%2016.4686%2015.1126%2016.5855%2015.0267%2016.685C14.9408%2016.7845%2014.8344%2016.8642%2014.7147%2016.9185C14.5951%2016.9729%2014.465%2017.0007%2014.3336%2017H8.91423Z%22%20stroke%3D%22%23808080%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E",errorIcon:"data:image/svg+xml,%3Csvg%20width%3D%2218%22%20height%3D%2217%22%20viewBox%3D%220%200%2018%2017%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8.99992%2011C8.96695%2011%208.93473%2011.0098%208.90732%2011.0281C8.87992%2011.0464%208.85855%2011.0724%208.84594%2011.1029C8.83332%2011.1333%208.83002%2011.1669%208.83645%2011.1992C8.84289%2011.2315%208.85876%2011.2612%208.88207%2011.2845C8.90538%2011.3078%208.93507%2011.3237%208.9674%2011.3301C8.99973%2011.3366%209.03324%2011.3333%209.0637%2011.3206C9.09415%2011.308%209.12018%2011.2867%209.1385%2011.2593C9.15681%2011.2319%209.16659%2011.1996%209.16659%2011.1667C9.16659%2011.1225%209.14903%2011.0801%209.11777%2011.0488C9.08651%2011.0176%209.04412%2011%208.99992%2011Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M9%209.66667V6%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%20stroke-linecap%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4%209C4%2010.3261%204.52678%2011.5979%205.46447%2012.5355C6.40215%2013.4732%207.67392%2014%209%2014C10.3261%2014%2011.5979%2013.4732%2012.5355%2012.5355C13.4732%2011.5979%2014%2010.3261%2014%209C14%207.67392%2013.4732%206.40215%2012.5355%205.46447C11.5979%204.52678%2010.3261%204%209%204C7.67392%204%206.40215%204.52678%205.46447%205.46447C4.52678%206.40215%204%207.67392%204%209V9Z%22%20stroke%3D%22%23ff3b30%22%20stroke-width%3D%221.2%22%2F%3E%3C%2Fsvg%3E",loadingIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FSpinner%402x%3C%2Ftitle%3E%20%20%20%20%3Cdefs%3E%20%20%20%20%20%20%20%20%3Cpattern%20id%3D%22pattern-1%22%20width%3D%22100%25%22%20height%3D%22100%25%22%20patternUnits%3D%22objectBoundingBox%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cuse%20xlink%3Ahref%3D%22%23image-2%22%3E%3C%2Fuse%3E%20%20%20%20%20%20%20%20%3C%2Fpattern%3E%20%20%20%20%20%20%20%20%3Cimage%20id%3D%22image-2%22%20width%3D%2224%22%20height%3D%2224%22%20xlink%3Ahref%3D%22data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAGAAAAADiNXWtAAACH0lEQVRIDY2SyU0FQQxE57PDlThIAIkDSARARqRAJITACQ5ciYMr%2B1av6TfyDAPCUn27vVS5%2B89qGIaLYK1gvcd4sTGL5%2Bc6Ixe5FY0fQbVVDuBzAUt99kusJ7%2F2l0AdRKxarTWiFCWe%2BP8IcENvgwiEWBWZkKbmk41PVAnadP%2BBBAFFrP2HvIlyg%2FeAg%2BZzQGJNAWt1Yz%2BE6q23G0DCICQ0SZKwGc3kqWNuXwmJWRYvOX4iwCDkFPAKkVeAHGdFIa0wb88owHYmaeIMFCEHkX3EmwWcvRG9cDVQ4IlMSEATeYUSNoKdeGqQbwXbPf7xNMmPAm%2F9EDcKUYSImkskHHYDyPc6EHFzl6x%2BMpzeZjRgtRGxx5YdhoP4%2FQAhyO1L2GI81njYji2r%2Be54wVO9BnfBeXAZHAY%2BYZ1JerRPr18bKikELAD5Q3AfsP1ZP7%2FEXwVHAb3Ojny%2BsyQQAQbBUwfkgFr9D%2FhPTnuO%2FE2PWZzn20CAr0VUIUWeUwec2ZIZyPyK%2BJKIyZ0E1LnRdbDuE3k9PJgLIkyOGn8ecxD6FP7RLnyb2jH1JQHJ8RALl4AMovYE8YokbEtQd5GJAEkhuWLmIXFbBMwrQo0Ze0YBGmimuOTJ0SMRNxAImU%2FYTIEPnsgt9G6tmPlKIoEi%2BLrAt0xusiQgYfV1GHJsLlJ7rC%2FeQGIGiOeDDiPA5vT8doP2uUlY%2FRI5uWr1Bi4x7xm%2BABSc5FGl1EGyAAAAAElFTkSuQmCC%22%3E%3C%2Fimage%3E%20%20%20%20%3C%2Fdefs%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FSpinner%22%20fill%3D%22url%28%23pattern-1%29%22%20fill-rule%3D%22nonzero%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M3.86827202%2C3.86827202%20C4.25879631%2C3.47774772%204.89196129%2C3.47774772%205.28248558%2C3.86827202%20L9.17157288%2C7.75735931%20C9.56209717%2C8.1478836%209.56209717%2C8.78104858%209.17157288%2C9.17157288%20C8.78104858%2C9.56209717%208.1478836%2C9.56209717%207.75735931%2C9.17157288%20L3.86827202%2C5.28248558%20C3.47774772%2C4.89196129%203.47774772%2C4.25879631%203.86827202%2C3.86827202%20Z%20M12%2C0.5%20C12.5522847%2C0.5%2013%2C0.94771525%2013%2C1.5%20L13%2C7%20C13%2C7.55228475%2012.5522847%2C8%2012%2C8%20C11.4477153%2C8%2011%2C7.55228475%2011%2C7%20L11%2C1.5%20C11%2C0.94771525%2011.4477153%2C0.5%2012%2C0.5%20Z%20M20.131728%2C3.86827202%20C20.5222523%2C4.25879631%2020.5222523%2C4.89196129%2020.131728%2C5.28248558%20L16.2426407%2C9.17157288%20C15.8521164%2C9.56209717%2015.2189514%2C9.56209717%2014.8284271%2C9.17157288%20C14.4379028%2C8.78104858%2014.4379028%2C8.1478836%2014.8284271%2C7.75735931%20L18.7175144%2C3.86827202%20C19.1080387%2C3.47774772%2019.7412037%2C3.47774772%2020.131728%2C3.86827202%20Z%20M23.5%2C12%20C23.5%2C12.5522847%2023.0522847%2C13%2022.5%2C13%20L17%2C13%20C16.4477153%2C13%2016%2C12.5522847%2016%2C12%20C16%2C11.4477153%2016.4477153%2C11%2017%2C11%20L22.5%2C11%20C23.0522847%2C11%2023.5%2C11.4477153%2023.5%2C12%20Z%20M20.131728%2C20.131728%20C19.7412037%2C20.5222523%2019.1080387%2C20.5222523%2018.7175144%2C20.131728%20L14.8284271%2C16.2426407%20C14.4379028%2C15.8521164%2014.4379028%2C15.2189514%2014.8284271%2C14.8284271%20C15.2189514%2C14.4379028%2015.8521164%2C14.4379028%2016.2426407%2C14.8284271%20L20.131728%2C18.7175144%20C20.5222523%2C19.1080387%2020.5222523%2C19.7412037%2020.131728%2C20.131728%20Z%20M12%2C23.5%20C11.4477153%2C23.5%2011%2C23.0522847%2011%2C22.5%20L11%2C17%20C11%2C16.4477153%2011.4477153%2C16%2012%2C16%20C12.5522847%2C16%2013%2C16.4477153%2013%2C17%20L13%2C22.5%20C13%2C23.0522847%2012.5522847%2C23.5%2012%2C23.5%20Z%20M3.86827202%2C20.131728%20C3.47774772%2C19.7412037%203.47774772%2C19.1080387%203.86827202%2C18.7175144%20L7.75735931%2C14.8284271%20C8.1478836%2C14.4379028%208.78104858%2C14.4379028%209.17157288%2C14.8284271%20C9.56209717%2C15.2189514%209.56209717%2C15.8521164%209.17157288%2C16.2426407%20L5.28248558%2C20.131728%20C4.89196129%2C20.5222523%204.25879631%2C20.5222523%203.86827202%2C20.131728%20Z%20M0.5%2C12%20C0.5%2C11.4477153%200.94771525%2C11%201.5%2C11%20L7%2C11%20C7.55228475%2C11%208%2C11.4477153%208%2C12%20C8%2C12.5522847%207.55228475%2C13%207%2C13%20L1.5%2C13%20C0.94771525%2C13%200.5%2C12.5522847%200.5%2C12%20Z%22%20id%3D%22Rectangle-2%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",alignment:n.MessageListAlignment.standard,showAvatar:!0,datePattern:n.DatePatterns.time,timestampAlignment:n.TimestampAlignment.bottom,DateSeparatorPattern:n.DatePatterns.DayDate,hideDateSeparator:!1,templates:[],messagesRequestBuilder:void 0,newMessageIndicatorText:"",scrollToBottomOnNewMessages:!1,thresholdValue:1e3,onThreadRepliesClick:()=>{},headerView:null,footerView:null,avatarStyle:{borderRadius:"24px",width:"36px",height:"36px"},dateSeparatorStyle:void 0,messageListStyle:{nameTextFont:"600 15px Inter, sans-serif",nameTextColor:"white",TimestampTextFont:"",TimestampTextColor:"",threadReplyTextFont:"",threadReplyIconTint:"",threadReplyTextColor:"",emptyStateTextFont:"700 22px Inter, sans-serif",emptyStateTextColor:"#bcbcbc",errorStateTextFont:"700 22px Inter, sans-serif",errorStateTextColor:"#bcbcbc",loadingIconTint:"grey"},onError:e=>{console.log(e)},hideError:!1,messageInformationConfiguration:new r.MessageInformationConfiguration({}),reactionsConfiguration:new r.ReactionsConfiguration({}),disableReactions:!1,emojiKeyboardStyle:{},threadIndicatorIcon:"data:image/svg+xml,%3Csvg%20width%3D%2215%22%20height%3D%2215%22%20viewBox%3D%220%200%2015%2015%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cg%20clip-path%3D%22url%28%23clip0_10800_33104%29%22%3E%3Cpath%20d%3D%22M13.9906%201.69617C13.824%204.12358%2012.7401%206.39667%2010.959%208.05423C9.17776%209.71179%206.83266%2010.6296%204.39955%2010.6215C4.23748%2010.6215%203.84965%2010.6297%203.68799%2010.6215H1.03645%22%20stroke%3D%22%23A1A5AC%22%20stroke-width%3D%221.875%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Cpath%20d%3D%22M4.2041%207.43042L1.0094%2010.6251L4.2041%2013.8198%22%20stroke%3D%22%23A1A5AC%22%20stroke-width%3D%221.875%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip0_10800_33104%22%3E%3Crect%20width%3D%2215%22%20height%3D%2215%22%20fill%3D%22white%22%20transform%3D%22matrix%28-1%200%200%201%2015%200%29%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E",disableMentions:!1,textFormatters:[],backdropStyle:new o.BackdropStyle({})},Gl=e=>{const{parentMessageId:i,user:a,group:l,emptyStateText:c,errorStateText:C,emptyStateView:g,errorStateView:u,loadingStateView:p,disableReceipt:h,hideReceipt:A,disableSoundForMessages:b,customSoundForMessages:y,readIcon:w,deliveredIcon:f,sentIcon:D,waitIcon:E,errorIcon:v,loadingIconURL:I,alignment:S,showAvatar:F,datePattern:T,timestampAlignment:M,DateSeparatorPattern:B,hideDateSeparator:L,templates:R,messagesRequestBuilder:P,newMessageIndicatorText:O,scrollToBottomOnNewMessages:j,thresholdValue:V,onThreadRepliesClick:G,headerView:H,footerView:Q,avatarStyle:N,dateSeparatorStyle:K,messageListStyle:z,onError:J,hideError:Y,messageInformationConfiguration:_,reactionsConfiguration:Z,disableReactions:X,emojiKeyboardStyle:q,threadIndicatorIcon:$,disableMentions:ee,textFormatters:te,backdropStyle:ne}={...Vl,...e},[oe,re]=t.useState([]),[se,ie]=t.useState(!0),[ae,le]=t.useState(n.States.loading),[ce,Ce]=t.useState(!1),[de,ge]=t.useState(!1),[ue,pe]=t.useState(null),[he,me]=t.useState(!1),[Ae,xe]=t.useState(null),[be,ye]=t.useState(!1),[we,fe]=t.useState(!1),[De,Ee]=t.useState(!1),ve=t.useRef(null),Ie=t.useRef(null),Se=t.useRef(!1),Fe=t.useRef({}),ke=t.useRef(null),Te=t.useRef({prevMessageId:0,nextMessageId:0}),Me=t.useRef(0),Le=t.useRef([]),Ue=t.useRef(""),Re=t.useRef(null),Pe=m(a),Oe=m(l),je=m(i),Ve=t.useRef(null),Ge=t.useRef(null),He=t.useRef(!1),Qe=t.useRef(!1),Ne=t.useRef(!1),{theme:Ke}=t.useContext(U),ze=x(J);let Je=!0,Ye=n.TimestampAlignment,_e=!1,We=n.MessageBubbleAlignment.left;const Ze=t.useMemo(()=>p?d.jsx("div",{className:"cc__messagelist__loadingview",children:d.jsx("span",{className:"cc__messagelist__customview--loading",children:p})}):d.jsx("div",{className:"cc__messagelist__loadingview",children:d.jsx(ol,{iconURL:I,loaderStyle:Al(z,Ke)})}),[p,I,z,Ke]),Xe=t.useMemo(()=>u?d.jsx("div",{className:"cc__messagelist__errorview",children:d.jsx("span",{className:"cc__messagelist__customview--error",children:u})}):d.jsx("div",{className:"cc__messagelist__errorview",children:d.jsx(nl,{labelStyle:xl(z,Ke),text:C})}),[u,C,z,Ke]),qe=t.useMemo(()=>g?d.jsx("div",{className:"cc__messagelist__emptyview",children:d.jsx("span",{className:"cc__messagelist__customview--empty",children:g})}):void 0,[g,c,z,Ke]),$e=t.useMemo(()=>R&&R.length>0?R:Be.getDataSource().getAllMessageTemplates(Ke,{disableMentions:ee,textFormatters:te}),[R,Ke]),et=t.useMemo(()=>{let e={};return $e.forEach(t=>{e[t.category+"_"+t.type]=t}),e},[$e]),tt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType();if(!je.current){if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&t===Pe.current.getUid())return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===je.current)return!0},[]),nt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getSender()?.getUid();if(je.current)return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current.getUid()||r===Pe.current.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1},[]),ot=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getSender()?.getUid();if(!je.current){if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current.getUid()||r===Pe.current.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current.getGuid())return!0;return!1}if(e.getParentMessageId()===je.current)return!0},[]),rt=t.useCallback(e=>{if(!e.getParentMessageId())return!1;const t=e?.getReceiverId();if(Pe.current){if(t===Pe.current.getUid())return!0}else if(Oe.current&&t===Oe.current.getGuid())return!0;return!1},[]),st=t.useCallback(e=>{if(!e.getParentMessageId())return!1;const t=e?.getReceiverId(),n=e?.getSender()?.getUid();if(Pe.current){if(t===Pe.current.getUid()||n===Pe.current.getUid())return!0}else if(Oe.current&&t===Oe.current.getGuid())return!0;return!1},[]),it=t.useCallback(e=>{try{return oe.find(t=>t?.getId()?.toString()===e?.toString())}catch(e){ze(e)}},[oe,ze]),at=t.useCallback(e=>{try{Qe.current=!1,ie(!1),G&&G(e,Bn)}catch(e){ze(e)}},[G,ze,Qe]),lt=t.useCallback(e=>{void 0!==e&&(Qe.current=e)},[Qe]),ct=t.useCallback(e=>{try{re(t=>t.map(t=>t.getMuid()===e.getMuid()?e:t))}catch(e){ze(e)}},[ze]),Ct=t.useCallback(e=>{try{ie(!1),re(t=>t.map(t=>t?.getId()===e?.getId()?e:t))}catch(e){ze(e)}},[ze]),dt=t.useCallback(e=>{try{ot(e)&&Ct(e)}catch(e){ze(e)}},[Ct,ze,ot]),gt=t.useCallback((e,t=!1)=>{try{t?(ie(!0),ct(e)):(ie(!1),Ct(e))}catch(e){ze(e)}},[ct,Ct,ze]),ut=t.useCallback((e,t)=>{const n=t?.getId(),o=it(n),i=o?.getReactions()||[],a=i?.find(t=>t?.reaction===e);if(a&&a?.getReactedByMe()){const t=[];i.forEach(n=>{if(n?.getReaction()===e){if(1===n?.getCount())return;n.setCount(n?.getCount()-1),n.setReactedByMe(!1),t.push(n)}else t.push(n)});const a=r.CometChatUIKitUtility.clone(o);a.setReactions(t),gt(a),s.CometChat.removeReaction(n,e).then(e=>{}).catch(e=>{gt(o),console.log(e)})}else{const t=[],a=i.find(t=>t?.getReaction()===e);if(i.forEach(n=>{n?.getReaction()===e?(n.setCount(n?.getCount()+1),n.setReactedByMe(!0),t.push(n)):t.push(n)}),!a){const n=new s.CometChat.ReactionCount(e,1,!0);t.push(n)}const l=r.CometChatUIKitUtility.clone(o);l.setReactions(t),gt(l),s.CometChat.addReaction(n,e).then(()=>{}).catch(e=>{ze(e),gt(o)})}},[it,ze,gt]),pt=t.useCallback(e=>{let t={zIndex:"100"},n=q,r=new o.EmojiKeyboardStyle({width:n?.width||"320px",height:n?.height||"300px",border:n?.border||"1px solid #e0e0e0",borderRadius:n?.borderRadius||"8px",activeIconTint:n?.activeIconTint,background:n?.background,iconTint:n?.iconTint,textColor:n?.textColor,textFont:n?.textFont});const s=it(e);return e=>d.jsx(qa,{emojiKeyboardStyle:r,style:t,onEmojiClick:t=>{e(t),ut(t?.detail?.id,s)}})},[q,it,ut]),ht=t.useCallback(e=>{try{let t=it(e);if(t){let e=t.getText();!ee&&t.getMentionedUsers()&&t.getMentionedUsers().length&&(e=(e=>{const t=/<@uid:(.*?)>/g;let n=e.getText(),o=e.getText(),r=t.exec(n),s=e.getMentionedUsers();for(;null!==r;){let e;for(let t=0;t<s.length;t++)r[1]===s[t].getUid()&&(e=s[t]);e&&(o=o.replace(r[0],"@"+e.getName())),r=t.exec(n)}return o})(t)),navigator?.clipboard?.writeText(e)}}catch(e){ze(e)}},[it,ze]),mt=t.useCallback(e=>{try{let t=it(e);t&&(Qe.current=!1,ie(!1),pe(t),ge(!0))}catch(e){ze(e)}},[ze,Qe,it]),At=t.useCallback(e=>{try{let t=it(e);t&&at(t)}catch(e){ze(e)}},[at,ze,it]),xt=t.useCallback(e=>{try{const t=it(e);if(t){const e=t.getSender();n.CometChatUIEvents.ccOpenChat.next({user:e})}}catch(e){ze(e)}},[it,ze]),bt=t.useCallback(e=>{try{let t=it(e);if(t){const e=t.getId();s.CometChat.deleteMessage(e).then(e=>{dt(e),n.CometChatMessageEvents.ccMessageDeleted.next(e)},e=>{ze(e)})}}catch(e){ze(e)}},[dt,ze,it]),yt=t.useCallback(e=>{try{let t=it(e);t&&n.CometChatMessageEvents.ccMessageEdited.next({message:t,status:n.MessageStatus.inprogress})}catch(e){ze(e)}},[ze,it]),wt=t.useCallback((e,t)=>{try{return e.forEach(e=>{switch(e.id){case n.CometChatUIKitConstants.MessageOption.deleteMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=bt);break;case n.CometChatUIKitConstants.MessageOption.editMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=yt);break;case n.CometChatUIKitConstants.MessageOption.copyMessage:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=ht);break;case n.CometChatUIKitConstants.MessageOption.replyInThread:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=At);break;case n.CometChatUIKitConstants.MessageOption.messageInformation:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=mt);break;case n.CometChatUIKitConstants.MessageOption.sendMessagePrivately:e instanceof n.CometChatActionsIcon&&!e.onClick&&(e.onClick=xt);break;case n.CometChatUIKitConstants.MessageOption.reactToMessage:e instanceof n.CometChatActionsView&&!e?.customView&&(e.customView=pt(t))}}),e}catch(t){return ze(t),e}},[ze,bt,yt,At,ht,mt,xt,pt]),ft=t.useCallback(e=>X?e.filter(e=>e.id!==n.CometChatUIKitConstants.MessageOption.reactToMessage):e,[X]),Dt=t.useCallback(e=>{let t=[];if(!e.getId())return t;try{return $e&&$e.length>0&&!e.getDeletedAt()&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&$e.forEach(n=>{n.type===e.getType()&&n.category===e.getCategory()&&(t=wt(n?.options?.(Ie.current,e,Ke,Oe.current),e?.getId()))}),t=ft(t),t}catch(e){return ze(e),t}},[$e,ft,wt,Ke,ze]),Et=t.useCallback(e=>{let t=n.MessageBubbleAlignment.center;try{return t=S===n.MessageListAlignment.left&&e.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember?n.MessageBubbleAlignment.left:e?.getType()===n.CometChatUIKitConstants.MessageTypes.groupMember||e?.getCategory()==n.CometChatUIKitConstants.MessageCategory.call?n.MessageBubbleAlignment.center:!e.getSender()||e?.getSender().getUid()===Ie.current?.getUid()&&e?.getType()!==n.CometChatUIKitConstants.MessageTypes.groupMember?n.MessageBubbleAlignment.right:n.MessageBubbleAlignment.left,t}catch(e){return ze(e),t}},[S,ze]),vt=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.contentView?et[e?.getCategory()+"_"+e?.getType()]?.contentView(e,t):null}catch(e){return ze(e),null}},[et,ze,Et]),It=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.bottomView?et[e?.getCategory()+"_"+e?.getType()]?.bottomView(e,t):null}catch(e){return ze(e),null}},[et,ze,Et]),St=t.useCallback(e=>{try{let t=null;return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.headerView&&(t=et[e?.getCategory()+"_"+e?.getType()]?.headerView(e)),t}catch(e){return ze(e),null}},[et,ze]),Ft=t.useCallback(e=>{try{let t=null;return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.footerView&&(t=et[e?.getCategory()+"_"+e?.getType()]?.footerView(e)),t}catch(e){return ze(e),null}},[et,ze]),kt=t.useCallback(e=>{let t=null;try{return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()].bubbleView&&(t=et[e?.getCategory()+"_"+e?.getType()].bubbleView(e)),t}catch(e){return ze(e),t}},[et,ze]),Tt=t.useCallback(e=>{s.CometChat.markAsRead(e).then(()=>{n.CometChatMessageEvents.ccMessageRead.next(e)},e=>{ze(e)})},[ze]),Mt=t.useCallback(e=>{h||e.getSender().getUid()===Ie.current?.getUid()||Tt(e)},[h,Tt]),Bt=t.useCallback(()=>{Qe.current=!0,ve.current&&ve.current?.click();const e=Le.current[Le.current.length-1];e&&Mt(e),Le.current=[],Ue.current&&(Ue.current=""),be&&ye(!1)},[Mt,be]),Lt=t.useCallback(()=>{try{re(Je?e=>e.slice(-30):e=>e.slice(0,30))}catch(e){ze(e)}},[ze]),Ut=t.useCallback(e=>new Promise((t,o)=>{if(ot(e[0]))try{re(t=>[...e,...t]),Me.current=Me.current+e.length,le(n.States.loaded),Me.current>V&&(Je=!1,Lt()),t(!0)}catch(e){oe?.length<=0&&le(n.States.error),ze(e),o(e)}else 0==oe.length&&le(n.States.loaded),t(!0)}),[oe,V,Lt,ot,ze]),Rt=t.useCallback(()=>new Promise(async(e,t)=>{try{le(n.States.loading);let o=0;if(!Ne.current){if(Ne.current=!0,Pe?.current){const e=await s.CometChat.getUnreadMessageCountForUser(Pe.current?.getUid());o=e[Pe.current?.getUid()]||0}if(Oe?.current){const e=await s.CometChat.getUnreadMessageCountForGroup(Oe.current?.getGuid());o=e[Oe.current?.getGuid()]||0}Ne.current=!1}_e?e(!0):(_e=!0,ke.current.previous||(ke.current.previous=new jl(P,Pe.current,Oe.current,Te.current.prevMessageId,je.current)),ke?.current.previous.fetchPreviousMessages().then(i=>{if(je.current,i&&i.length>0&&(i=i.map(e=>e.getCategory()===n.CometChatUIKitConstants.MessageCategory.interactive?r.InteractiveMessageUtils.convertInteractiveMessage(e):e)),Se.current&&(je.current||n.CometChatUIEvents.ccActiveChatChanged.next({user:Pe.current,group:Oe.current,message:i.length>0?i[i.length-1]:void 0,unreadMessageCount:o}),Se.current=!1,jl.attachConnectionListener(()=>{He.current=!0,Te.current?.nextMessageId?Ot().then(()=>{jt().then(t=>{e(t),He.current=!1},e=>{t(e)}).catch(e=>{ze(e)})}):He.current=!1})),_e=!1,i&&i.length>0){let o=i[i.length-1],r=o?.getSender().getUid()==Ie.current?.getUid();o.getDeliveredAt()||h||r||s.CometChat.markAsDelivered(o).then(()=>{i.forEach(e=>(e?.getId()<=o?.getId()&&!r&&!e.getDeliveredAt()&&e.setDeliveredAt((new Date).getTime()),e))}),o.getReadAt()||r&&o.getCategory()!==s.CometChat.MessageCategory.CALL&&o.getCategory()!==s.CometChat.MessageCategory.ACTION?r||n.CometChatMessageEvents.ccMessageRead.next(o):h?Le.current=[]:s.CometChat.markAsRead(o).then(()=>{i.forEach(e=>(!(e?.getId()<=o?.getId())||r&&e.getCategory()!==s.CometChat.MessageCategory.CALL&&e.getCategory()!==s.CometChat.MessageCategory.ACTION||e.getReadAt()||e.setReadAt((new Date).getTime()),e)),n.CometChatMessageEvents.ccMessageRead.next(o)}),Ut(i).then(t=>{e(t)},e=>{t(e)})}else 0===i.length&&0===Me.current&&le(n.States.empty),e(!0)},e=>{_e=!1,oe?.length<=0&&le(n.States.error),"REQUEST_IN_PROGRESS"!=e.code?(ze(e),t(e)):le(n.States.loading)}))}catch(e){oe?.length<=0&&le(n.States.error),ze(e)}}),[h,ze,Ut]),Pt=t.useCallback(e=>new Promise((t,o)=>{try{re(t=>[...t,...e]),Me.current=Me.current+e.length;let o=e[e.length-1]?.getId();if(o&&Te.current.prevMessageId!==o&&(Te.current.nextMessageId=o),j)setTimeout(()=>{ie(!0),Qe.current=!0},100);else{if(He.current){ie(Qe.current);let t=e[e?.length-1];Qe.current&&t&&t.getSender().getUid()!=Ie.current?.getUid()&&!t.getReadAt()&&s.CometChat.markAsRead(t).then(()=>{Le.current=[],n.CometChatMessageEvents.ccMessageRead.next(t)})}else ie(!1);let t=O||(Le.current.length>1?n.localize("NEW_MESSAGES"):n.localize("NEW_MESSAGE"));Le.current.push(...e),Ue.current=" ↓ "+Le.current.length+" "+t,ye(!0)}le(n.States.loaded),Me.current>V&&(Je=!0,Lt()),t(!0)}catch(e){oe?.length<=0&&le(n.States.error),ze(e),o(e)}}),[V,Lt,ze,Qe]),Ot=t.useCallback(()=>new Promise((e,t)=>{let o=(new s.CometChat.MessagesRequestBuilder).setType(n.CometChatUIKitConstants.MessageCategory.message).setCategory(n.CometChatUIKitConstants.MessageCategory.action).setMessageId(Te.current.nextMessageId).setLimit(30);Pe.current?o.setUID(Pe.current.getUid()):Oe.current&&o.setGUID(Oe.current.getGuid()),o.build().fetchNext().then(t=>t&&t.length>0?(t.forEach(e=>{dt(e.getActionOn())}),e(!0)):e(!0)).catch(e=>(ze(e),oe?.length<=0&&le(n.States.error),t(e)))}),[ze]),jt=t.useCallback(()=>new Promise((e,t)=>{try{Te.current.nextMessageId?(ke.current.next||(ke.current.next=new jl(P,Pe.current,Oe.current,Te.current.nextMessageId,je.current)),le(n.States.loading),ke?.current.next.fetchNextMessages().then(o=>{o&&o.length>0&&(o=o.map(e=>e.getCategory()===n.CometChatUIKitConstants.MessageCategory.interactive?r.InteractiveMessageUtils.convertInteractiveMessage(e):e)),o?0===o.length?(0===Me.current?le(n.States.empty):le(n.States.loaded),e(!0)):Pt(o).then(t=>{e(t)},e=>{t(e)}):e(!0)},e=>{oe?.length<=0&&le(n.States.error),ze(e),t(e)})):e(!0)}catch(e){ze(e)}}),[Pt,ze,oe?.length,P]),Vt=t.useCallback(e=>{try{re(t=>t.map(t=>t?.getId()===e.getParentMessageId()?(t.getReplyCount()?t.setReplyCount(t.getReplyCount()+1):t.setReplyCount(1),t):t))}catch(e){ze(e)}},[ze]),Gt=t.useCallback(e=>{try{re(t=>{let n=[...t],o=n.findIndex(t=>t.getId()===e.getParentMessageId());if(o>-1){const e=n[o];n.splice(o,1,e),t=[...n]}return t})}catch(e){ze(e)}},[ze]),Ht=t.useCallback(e=>{try{Me.current+=1,Me.current>0&&ae!=n.States.loaded&&le(n.States.loaded),re(t=>[...t,e]),e.getSender()&&e.getSender().getUid()!=Ie.current?.getUid()||ie(!0),Me.current>V&&(Je=!0,Lt())}catch(e){ze(e)}},[V,ze,se]),Qt=t.useCallback(e=>{try{return r.MessageReceiptUtils.getReceiptStatus(e)}catch(e){ze(e)}},[ze]),Nt=t.useCallback(()=>{try{b||(y?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessage,y):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingMessage))}catch(e){ze(e)}},[b,y,ze]),Kt=t.useCallback(e=>{if(!Qe.current&&e.getSender()&&e.getSender().getUid()!=Ie.current?.getUid()){let t=O||(Le.current.length>1?n.localize("NEW_MESSAGES"):n.localize("NEW_MESSAGE"));Le.current.push(e),Ue.current=" ↓ "+Le.current.length+" "+t,ye(!0)}},[O]),zt=t.useCallback(e=>{try{re(t=>t.map(t=>(parseInt(t?.getId()?.toString())<=parseInt(e.getMessageId())&&t.getSender().getUid()===Ie.current?.getUid()&&!t.getDeliveredAt()&&t.setDeliveredAt(e.getDeliveredAt()),t)))}catch(e){ze(e)}},[ze]),Jt=t.useCallback(e=>{try{const t=[];re(o=>{const r=o.map(n=>(parseInt(n?.getId()?.toString())<=parseInt(e.getMessageId())&&n.getSender().getUid()===Ie.current?.getUid()&&!n.getReadAt()&&(n.setReadAt(e.getReadAt()),parseInt(n?.getId()?.toString())===parseInt(e.getMessageId())&&t.push(n)),n));return t.forEach(e=>{n.CometChatMessageEvents.ccMessageRead.next(e)}),r})}catch(e){ze(e)}},[ze]),Yt=t.useCallback((e,t)=>{try{t?"delivery"===e.getReceiptType()||"deliveredToAll"===e.getReceiptType()?zt(e):Jt(e):e.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&e.getSender().getUid()===Pe.current?.getUid()&&e.getReceiver()===Ie.current?.getUid()&&("delivery"===e.getReceiptType()?zt(e):Jt(e))}catch(e){ze(e)}},[zt,Jt,ze]),_t=t.useCallback(e=>{Ie.current?.getUid()===e.getSender().getUid()&&re(t=>t.map(t=>{if(String(t.getId())===String(e.getMessageId())){const n=e.getInteractions();return t.setInteractions(n),r.InteractiveMessageUtils.convertInteractiveMessage(t)}return t}))},[]),Wt=t.useCallback((e=!1)=>{(e||j)&&setTimeout(()=>{ie(!0),Qe.current=!0,Le.current=[]},100)},[j]),Zt=t.useCallback(e=>{try{ot(e)?(Ht(e),j?(Wt(),Mt(e)):Qe.current?(Wt(!0),Mt(e)):(ie(!1),Kt(e))):st(e)&&(Vt(e),Gt(e)),Nt()}catch(e){ze(e)}},[ot,st,Nt,Ht,j,Wt,Mt,Kt,Vt,Gt,ze]),Xt=t.useCallback((e,t)=>{try{t?.getGuid()===Oe?.current?.getGuid()&&(Ht(e),Qe.current?Wt(!0):j?Wt():(ie(!1),Kt(e)))}catch(e){ze(e)}},[Ht,j,Wt,Kt,ze]),qt=t.useCallback(e=>{const t=e?.getReceiverId(),o=e?.getReceiverType(),r=e?.getReaction()?.getReactedBy()?.getUid(),s=e?.getParentMessageId(),i=s&&String(s);if(i)return s===i;if(e.getParentMessageId())return!1;if(Pe.current){if(o===n.CometChatUIKitConstants.MessageReceiverType.user&&(t===Pe.current?.getUid()||r===Pe.current?.getUid()))return!0}else if(Oe.current&&o===n.CometChatUIKitConstants.MessageReceiverType.group&&t===Oe.current?.getGuid())return!0;return!1},[]),$t=t.useCallback((e,t)=>{if(!qt(e))return!1;re(n=>{const o=n.findIndex(t=>t.getId().toString()===e.getReaction()?.getMessageId().toString());if(-1===o)return n;const i=n[o];let a;a=t?s.CometChat.REACTION_ACTION.REACTION_ADDED:s.CometChat.REACTION_ACTION.REACTION_REMOVED;const l=s.CometChat.CometChatHelper.updateMessageWithReactionInfo(i,e.getReaction(),a);return n.map(e=>e.getId().toString()===l?.getId().toString()?r.CometChatUIKitUtility.clone(l):e)})},[qt]),en=t.useCallback(e=>{try{ot(e)&&Be.names.includes("calling")&&(Ht(e),Qe.current?Wt(!0):j?Wt():(ie(!1),Kt(e)))}catch(e){ze(e)}},[ot,Ht,j,Wt,Kt,ze]),tn=t.useCallback((e="",t,o)=>{try{switch(e){case n.CometChatUIKitConstants.MessageCategory.action:o&&Xt(t,o);break;case n.CometChatUIKitConstants.MessageCategory.call:en(t)}}catch(e){ze(e)}},[Xt,en,ze]),nn=t.useCallback(()=>new Promise((e,t)=>{try{Bt(),ie(!1),ke.current&&ke.current.previous&&(ke.current.previous=null),jt().then(t=>{e(t)},e=>{t(e)})}catch(e){ze(e)}}),[oe,Mt,jt,Bt,ze]),on=t.useCallback(()=>new Promise((e,t)=>{try{ie(!1),Qe.current=!1,ke.current&&ke.current.next&&(ke.current.next=null),Rt().then(t=>{e(t)},e=>{t(e)})}catch(e){ze(e)}}),[Rt,ze,Qe]),rn=t.useCallback(e=>{Fe.current[e.getId()].current?.scrollIntoView({block:"center"})},[]),sn=t.useCallback(()=>{try{Bt(),ie(!0)}catch(e){ze(e)}},[Tt,ze,Bt]),an=t.useCallback(e=>{re(e=>e.map(e=>(e?.getId(),e)))},[]),ln=t.useCallback(()=>{try{const e=n.CometChatUIEvents.ccShowOngoingCall.subscribe(e=>{Ce(!0),xe(e.child)}),t=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{Ce(!1),xe(null),e&&en(e)}),o=n.CometChatCallEvents.ccCallRejected.subscribe(e=>{en(e)}),r=n.CometChatCallEvents.ccOutgoingCall.subscribe(e=>{en(e)}),s=n.CometChatCallEvents.ccCallAccepted.subscribe(e=>{en(e)}),c=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{st(e)&&an(e.getParentMessageId())}),C=n.CometChatUIEvents.ccShowDialog.subscribe(e=>{Re.current=e.child,me(!0)}),d=n.CometChatUIEvents.ccHideDialog.subscribe(()=>{Re.current=null,me(!1)}),g=n.CometChatUIEvents.ccShowPanel.subscribe(e=>{(!e.message||e.message.getParentMessageId()&&i&&e.message.getParentMessageId()==i||!i&&!e.message?.getParentMessageId())&&(e.position===n.PanelAlignment.messageListFooter?(Ve.current&&(Ve.current=null,ye(!1),fe(!1)),setTimeout(()=>{Ve.current=e.child,fe(!0)},0)):e.position===n.PanelAlignment.messageListHeader&&(Ge.current&&(Ge.current=null,Ee(!1)),setTimeout(()=>{Ge.current=e.child,Ee(!0)},0)))}),u=n.CometChatUIEvents.ccHidePanel.subscribe(e=>{e===n.PanelAlignment.messageListFooter?(Ve.current=null,ye(!1),fe(!1)):e===n.PanelAlignment.messageListHeader&&(Ge.current=null,Ee(!1))}),p=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{e.messages.map(t=>{Xt(t,e.userAddedIn)})}),m=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{Xt(e.message,e.kickedFrom)}),A=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{Xt(e.message,e.kickedFrom)}),x=n.CometChatGroupEvents.ccGroupMemberScopeChanged.subscribe(e=>{Xt(e.message,e.group)}),b=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{Xt(e.message,e.leftGroup)}),y=n.CometChatMessageEvents.ccMessageEdited.subscribe(e=>{e?.status===n.MessageStatus.success&&tt(e.message)&&gt(e.message,!1)}),w=n.CometChatMessageEvents.ccMessageTranslated.subscribe(e=>{e?.status===n.MessageStatus.success&&ot(e.message)&&(gt(e.message,!1),setTimeout(()=>{rn(e.message)},100))}),f=n.CometChatMessageEvents.ccMessageSent.subscribe(e=>{let{message:t,status:o}=e;switch(o){case n.MessageStatus.inprogress:tt(t)&&Ht(t);break;case n.MessageStatus.success:tt(t)&&gt(t,!0),rt(t)&&Vt(t);break;default:gt(t,!0),rt(t)&&Vt(t)}}),D=n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{Zt(e)}),E=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{Zt(e)}),v=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{Zt(e)}),I=n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{Zt(e)}),S=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{Zt(e)}),F=n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{Zt(e)}),k=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{Zt(e)}),T=n.CometChatMessageEvents.onMessagesDelivered.subscribe(e=>{h||Yt(e)}),M=n.CometChatMessageEvents.onMessagesRead.subscribe(e=>{h||Yt(e)}),B=n.CometChatMessageEvents.onMessagesDeliveredToAll.subscribe(e=>{h||Yt(e,!0)}),L=n.CometChatMessageEvents.onMessagesReadByAll.subscribe(e=>{h||Yt(e,!0)}),U=n.CometChatMessageEvents.onMessageDeleted.subscribe(e=>{dt(e)}),R=n.CometChatMessageEvents.onMessageEdited.subscribe(e=>{dt(e)}),P=n.CometChatMessageEvents.onTransientMessageReceived.subscribe(e=>{let t=e.getData();nt(e)&&"live_reaction"==t.type&&n.CometChatMessageEvents.ccLiveReactionSent.next({composerId:{group:l?.getGuid()||null,user:a?.getUid()||null,parentMessageId:je.current||null},reaction:t.reaction})}),O=n.CometChatMessageEvents.onInteractionGoalCompleted.subscribe(e=>{_t(e)});let j,V;return X||(j=n.CometChatMessageEvents.onMessageReactionAdded.subscribe(e=>{$t(e,!0)}),V=n.CometChatMessageEvents.onMessageReactionRemoved.subscribe(e=>{$t(e,!1)})),()=>{try{y?.unsubscribe(),f?.unsubscribe(),p?.unsubscribe(),m?.unsubscribe(),A?.unsubscribe(),x?.unsubscribe(),b?.unsubscribe(),e?.unsubscribe(),r?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),s?.unsubscribe(),C?.unsubscribe(),d?.unsubscribe(),g?.unsubscribe(),u?.unsubscribe(),w?.unsubscribe(),c?.unsubscribe(),D?.unsubscribe(),E?.unsubscribe(),v?.unsubscribe(),I?.unsubscribe(),S?.unsubscribe(),F?.unsubscribe(),k?.unsubscribe(),T?.unsubscribe(),M?.unsubscribe(),B?.unsubscribe(),L?.unsubscribe(),U?.unsubscribe(),R?.unsubscribe(),P?.unsubscribe(),O?.unsubscribe(),X||(j?.unsubscribe(),V?.unsubscribe())}catch(e){ze(e)}}}catch(e){ze(e)}},[nt,an,X,en,st,gt,Xt,tt,rn,Ht,rt,Vt,ze,we]),cn=t.useCallback((e,t)=>{try{let n,o;return n=new Date(1e3*e),o=new Date(1e3*t),n.getDate()!==o.getDate()||n.getMonth()!==o.getMonth()||n.getFullYear()!==o.getFullYear()}catch(e){ze(e)}},[ze]),Cn=t.useCallback(e=>S===n.MessageListAlignment.left||!(!Oe.current||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action||!e?.getSender()||e?.getSender()?.getUid()===Ie.current?.getUid()||S!==n.MessageListAlignment.standard),[S]),dn=t.useCallback(e=>e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&F&&Cn(e)?d.jsx(rl,{name:e?.getSender()?.getName(),avatarStyle:bl(N,Ke),image:e?.getSender()?.getAvatar()}):null,[F,N,Cn,Ke]),gn=t.useCallback(e=>d.jsx(d.Fragment,{children:d.jsx(tl,{timestamp:e.getSentAt(),dateStyle:ul(z,Ke),pattern:T})}),[z,T,Ke]),un=t.useCallback(e=>d.jsx(d.Fragment,{children:d.jsx(nl,{text:e?.getSender()?.getName(),labelStyle:pl(Ke,z)})}),[Ke]),pn=t.useCallback(e=>St(e)?St(e):e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call&&(Cn(e)||M===Ye.top)?d.jsxs(d.Fragment,{children:[Cn(e)?un(e):null,M===Ye.top?gn(e):null]}):null,[M,gn,Cn,St,un]),hn=t.useCallback(e=>M===Ye.bottom&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.action&&e?.getCategory()!==n.CometChatUIKitConstants.MessageCategory.call?d.jsx(tl,{timestamp:e.getSentAt(),dateStyle:ul(z,Ke),pattern:T}):null,[M,z,T,Ke]),mn=t.useCallback(e=>h||A||e?.getSender()&&Ie.current?.getUid()!==e?.getSender()?.getUid()||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.action||e?.getCategory()===n.CometChatUIKitConstants.MessageCategory.call?null:d.jsx(sl,{receiptStyle:Cl(Ke,e),receipt:Qt(e),waitIcon:E,sentIcon:D,deliveredIcon:f,readIcon:w,errorIcon:v}),[h,E,D,f,w,v,Qt,Ke]),An=t.useCallback(()=>{const e=Z?.reactionListConfiguration||{},t=(e=>new o.AvatarStyle({borderRadius:"50%",width:"35px",height:"35px",border:"none",backgroundColor:e.palette.getAccent700(),nameTextColor:e.palette.getAccent900(),backgroundSize:"cover",nameTextFont:n.fontHelper(e.typography.subtitle1),outerViewBorderWidth:"0",outerViewBorderRadius:"0",outerViewBorderColor:"",outerViewBorderSpacing:"0"}))(Ke),s=(e=>new o.ListItemStyle({background:"transparent",activeBackground:"transparent",hoverBackground:"transparent",titleFont:n.fontHelper(e.typography.subtitle1),titleColor:e.palette.getAccent(),separatorColor:e.palette.getAccent100()}))(Ke),i=(e=>new r.ReactionListStyle({width:"320px",height:"300px",borderRadius:"12px",background:e.palette.getAccent900(),border:"none",errorIconTint:e.palette.getAccent400(),loadingIconTint:e.palette.getAccent400(),sliderEmojiCountFont:n.fontHelper(e.typography.subtitle2),sliderEmojiFont:n.fontHelper(e.typography.subtitle1),subtitleTextColor:e.palette.getAccent500(),subtitleTextFont:n.fontHelper(e.typography.subtitle2),tailViewFont:n.fontHelper(e.typography.title1),dividerTint:e.palette.getAccent100(),sliderEmojiCountColor:e.palette.getAccent500(),activeEmojiBackground:e.palette.getAccent100()}))(Ke);return new r.ReactionListConfiguration({avatarStyle:{...t,...e?.avatarStyle},errorIconURL:e?.errorIconURL||"",listItemStyle:{...s,...e?.listItemStyle},loadingIconURL:e?.loadingIconURL||"",reactionListStyle:{...i,...e?.reactionListStyle},reactionItemClicked:e?.reactionItemClicked||((e,t)=>{e?.getReactedBy()?.getUid()===Ie.current?.getUid()&&ut(e?.getReaction(),t)}),reactionsRequestBuilder:e?.reactionsRequestBuilder||void 0})},[Z,ut,Ke]),xn=t.useCallback(()=>{const e=Z?.reactionInfoConfiguration||{},t=((e,t)=>new r.ReactionInfoStyle({background:t?.reactionInfoStyle?.background||e.palette.getAccent("light"),border:t?.reactionInfoStyle?.border||"none",borderRadius:t?.reactionInfoStyle?.borderRadius||"12px",errorIconTint:t?.reactionInfoStyle?.errorIconTint||e.palette.getBackground("light"),loadingIconTint:t?.reactionInfoStyle?.loadingIconTint||e.palette.getBackground("light"),namesColor:t?.reactionInfoStyle?.namesColor||e.palette.getBackground("light"),namesFont:t?.reactionInfoStyle?.namesFont||n.fontHelper(e.typography.subtitle2),reactedTextColor:t?.reactionInfoStyle?.reactedTextColor||e.palette.getAccent700("dark"),reactedTextFont:t?.reactionInfoStyle?.reactedTextFont||n.fontHelper(e.typography.subtitle2),reactionFontSize:t?.reactionInfoStyle?.reactionFontSize||"37px"}))(Ke,e);return new r.ReactionInfoConfiguration({reactionInfoStyle:t,reactionsRequestBuilder:e?.reactionsRequestBuilder||void 0,errorIconURL:e?.errorIconURL||"",loadingIconURL:e?.loadingIconURL||""})},[Z,Ke]),bn=t.useCallback(e=>{const t=e?.getReactions()||[],o=Et(e);if(t&&t.length>0&&!X){const t=((e={},t)=>new r.ReactionsStyle({height:e?.height||"100%",width:e?.width||"fit-content",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"transparent",activeReactionBackground:e?.activeReactionBackground||t.palette.getPrimary150(),reactionBackground:e?.reactionBackground||t.palette.getAccent100(),reactionBorder:e?.reactionBorder||"none",activeReactionBorder:e?.activeReactionBorder||`1px solid ${t.palette.getPrimary500()}`,reactionBorderRadius:e?.reactionBorderRadius||"20px",activeReactionCountTextColor:e?.activeReactionCountTextColor||t.palette.getAccent(),activeReactionCountTextFont:e?.activeReactionCountTextFont||n.fontHelper(t.typography.caption1),reactionCountTextFont:e?.reactionCountTextFont||n.fontHelper(t.typography.caption1),reactionCountTextColor:e?.reactionCountTextColor||t.palette.getAccent(),reactionBoxShadow:e?.reactionBoxShadow||"rgba(0, 0, 0, 0.1) 0px 4px 12px",reactionEmojiFont:e?.reactionEmojiFont||n.fontHelper(t.typography.subtitle1),baseReactionBackground:e?.baseReactionBackground||t.palette.getBackground()}))(Z?.reactionsStyle,Ke);return d.jsx(Xa,{messageObject:e,alignment:o,reactionsStyle:t,hoverDebounceTime:500,reactionClick:(e,t)=>{Z?.reactionClick?Z?.reactionClick(e,t):ut(e?.getReaction(),t)},reactionListConfiguration:An(),reactionInfoConfiguration:xn(),style:fl(o)})}return null},[X,xn,An,ut,Z,Et,Ke]),yn=t.useCallback(e=>Ft(e)?d.jsx("div",{className:"cc-message-bubble__footer",style:gl(Et(e)),children:Ft(e)}):d.jsx("div",{className:"cc-message-bubble__footer",style:gl(Et(e)),children:bn(e)}),[bn,Ft,Et]),wn=t.useCallback(e=>{if(e?.getReplyCount()&&!e?.getDeletedAt()){const t=Et(e),o=$;return d.jsx("div",{className:"cc-message-bubble__thread-replies",children:d.jsx($a,{text:Mn(e),hoverText:Mn(e),buttonStyle:al(e,Ke,Ie.current,z,t),mirrorIcon:t===n.MessageBubbleAlignment.left,iconURL:o,buttonClick:()=>{at(e)}})})}},[Et,$,Ke,z,at]),fn=e=>{const t=e?.getType();return[n.CometChatUIKitConstants.MessageTypes.image,n.CometChatUIKitConstants.MessageTypes.video].includes(t)},Dn=t.useCallback(e=>{try{let t=Et(e);return et[e?.getCategory()+"_"+e?.getType()]&&et[e?.getCategory()+"_"+e?.getType()]?.statusInfoView?et[e?.getCategory()+"_"+e?.getType()]?.statusInfoView(e,t):e?.getDeletedAt()||e instanceof s.CometChat.Action||e instanceof s.CometChat.Call?null:d.jsx("div",{style:{position:"relative",display:"flex",justifyContent:"flex-end"},children:d.jsxs("div",{className:"cc-message-bubble__statusInfo",style:dl(fn(e),Ke,e,Et(e)),children:[hn(e),mn(e)]})})}catch(e){return ze(e),null}},[hn,mn,et,ze,Et]),En=t.useCallback((e,t)=>d.jsx(W,{setRef:t=>{Fe.current[e.getId()]=t},leadingView:dn(e),headerView:pn(e),footerView:yn(e),contentView:vt(e),bottomView:It(e),id:e?.getId()||e?.getMuid(),options:Dt(e),messageBubbleStyle:cl(e,Ke,S,Ie.current),alignment:Et(e),replyView:null,threadView:wn(e),statusInfoView:Dn(e)}),[dn,pn,yn,vt,S,Et,wn,Dn,Dt,It,Ke]),vn=t.useCallback((e,t)=>0===t||cn(oe[t-1]?.getSentAt(),e?.getSentAt())?d.jsx("div",{className:"cc-message-list__date-container",style:{display:"flex",justifyContent:"center",width:"100%",marginBottom:"16px"},children:d.jsx(tl,{timestamp:e.getSentAt(),pattern:B,dateStyle:hl(K,Ke)})},`${e.getId()}-${e.getSentAt()}`):null,[B,oe,K,cn,Ke]),In=t.useCallback((e,t)=>{let n=Et(e);return d.jsxs(d.Fragment,{children:[L?d.jsx(d.Fragment,{}):vn(e,t),d.jsx("div",{className:"cc-message-list__bubble",style:yl(n),children:kt(e)?kt(e):En(e,t)},e.getId())]})},[kt,vn,En,Et]),Sn=t.useCallback((e,t)=>d.jsx(W,{leadingView:dn(e),headerView:pn(e),footerView:null,contentView:vt(e),bottomView:null,statusInfoView:null,id:e?.getId()||e?.getMuid(),options:[],messageBubbleStyle:cl(e,Ke,S,Ie.current),alignment:Et(e),replyView:null,threadView:null}),[dn,pn,vt,S,Et,Ke]),Fn=t.useCallback((e,t)=>d.jsx("div",{className:"cc__messagelist__bubble",style:wl,children:kt(e)?kt(e):Sn(e,t)},e.getId()),[kt,vn,En,Sn]),kn=t.useCallback(()=>d.jsxs(d.Fragment,{children:[we&&Ve.current?Ve.current:null,Q&&!Ve.current?Q:null]}),[Q,sn,we]),Tn=t.useCallback(()=>d.jsxs(d.Fragment,{children:[De&&Ge.current?Ge.current:null,H&&!Ge.current?H:null]}),[H,De]),Mn=e=>{const t=e?.getReplyCount()||0;return`${t} ${1===t?n.localize("REPLY"):n.localize("REPLIES")}`},Bn=t.useCallback(e=>d.jsx(d.Fragment,{children:kt(e)?kt(e):d.jsx(W,{leadingView:dn(e),headerView:pn(e),footerView:null,contentView:vt(e),bottomView:It(e),statusInfoView:Dn(e),id:e?.getId()||e?.getMuid(),messageBubbleStyle:cl(e,Ke,S,Ie.current),alignment:We,replyView:null,threadView:null,options:[]})}),[dn,pn,yn,vt,S,Dt,kt,It,Ke]),Ln=t.useMemo(()=>function(e,t){return In(e,t)},[In]),Un=t.useCallback(()=>ae,[ae]);return function(e,n,o,i,a,l,c,C,d,g,u,p,h,m,A,x,b){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(t=>{b.current=!0,t&&(e.current=t)},e=>{p(e)})},[l,c,p]),t.useEffect(()=>{let e;return r.CometChatUIKitLoginListener.getLoggedInUser()&&(l||c)&&(n.current={previous:new jl(a,l,c)},jl.attachListeners(i),e=C(),h([]),m(!0),x.current=!0,o(),A.current=null),()=>{jl?.removeListeners?.(),e?.()}},[l,c]),t.useEffect(()=>{g.current=u.length,u?.length>0&&(d.current.prevMessageId=u[0].getId(),d.current.nextMessageId=u[u.length-1].getId())},[u])}(Ie,ke,Rt,tn,P,Pe.current,Oe.current,ln,Te,Me,oe,ze,re,ie,Ve,Qe,Se),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"cc-message-list__wrapper",style:il(z,Ke),children:[d.jsx("div",{className:"cc-message-list__header-view",style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",height:"auto"},children:Tn()}),d.jsxs("div",{className:"cc-message-list",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",overflowX:"hidden",boxSizing:"border-box"},children:[d.jsx(k,{scrolledUpCallback:lt,title:"",hideSearch:!0,showSectionHeader:!1,list:oe,listItem:Ln,onScrolledToBottom:nn,onScrolledToTop:on,listItemKey:"getMuid",state:Un(),loadingView:Ze,loadingIconURL:I,hideError:Y,errorStateView:Xe,errorStateText:C,emptyStateView:qe,emptyStateText:void 0,scrollToBottom:se,theme:Ke,listStyle:new r.ListStyle({height:"100%",width:"100%",background:"inherit"})}),be&&Le.current&&Le.current.length>0&&!Qe.current?d.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"fit-content",width:"100%"},className:"cc-message-list__message-indicator",children:d.jsx(el,{ref:ve,text:Ue.current,buttonStyle:ll(Ke),buttonClick:sn})}):null]}),d.jsx("div",{className:"cc-message-list__footer-view",style:{display:"flex",alignItems:"flex-start",justifyContent:"flex-start",width:"100%",height:"auto"},children:kn()})]}),ce?Ae:null,he&&Re.current?Re.current:null,de&&null!==ue&&d.jsx(Pl,{message:ue,bubbleView:_?.bubbleView||Fn,onClose:_?.onClose||(()=>{ge(!1)}),template:(Rn=ue,et[Rn?.getCategory()+"_"+Rn?.getType()]),loadingStateView:_?.loadingStateView,errorStateView:_?.errorStateView,listItemStyle:_?.listItemStyle,emptyStateView:_?.emptyStateView,loadingIconURL:_?.loadingIconURL,readIcon:_?.readIcon,deliveredIcon:_?.deliveredIcon,onError:_?.onError,subtitleView:_?.subtitleView,listItemView:_?.listItemView,messageInformationStyle:_?.messageInformationStyle,closeIconURL:_?.closeIconURL||"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",receiptDatePattern:_?.receiptDatePattern,backdropStyle:ne})]});var Rn},Hl=e=>({height:"36px",padding:"8px 16px",boxSizing:"border-box",border:`1px solid ${e.palette.getAccent100()}`}),Ql=e=>({height:"100%",width:"100%",border:"0 none",borderRadius:"0",background:`${e.palette.getBackground()}`,buttonTextFont:`${n.fontHelper(e.typography.subtitle1)}`,buttonTextColor:`${e.palette.getAccent600()}`});var Nl="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const Kl={width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)",titleColor:"rgba(20, 20, 20)",titleFont:"700 22px Inter",closeIconTint:"#3399FF"},zl={textFont:"700 22px Inter",textColor:"black",background:"transparent"},Jl={height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:"#7dbfff"},Yl=e=>{const{parentMessage:o,title:i=n.localize("THREAD"),closeIconURL:a=Nl,bubbleView:l=null,messageActionView:c=null,onError:C,onClose:g=()=>{},threadedMessagesStyle:u=Kl,messageListConfiguration:p=new r.MessageListConfiguration({}),messageComposerConfiguration:h=new r.MessageComposerConfiguration({}),messageComposerView:m,messageListView:A,hideMessageComposer:b}=e,{theme:y}=t.useContext(U),[w,f]=t.useState(o),[D,E]=t.useState(0),v=t.useRef(u);let I=new r.ThreadedMessagesStyle({width:"100%",height:"100%",background:y.palette.getBackground(),borderRadius:"none",border:"none",titleColor:y.palette.getAccent(),titleFont:n.fontHelper(y.typography.title1),closeIconTint:y.palette.getPrimary()});v.current={...I,...u},zl.textFont=v?.current?.titleFont||n.fontHelper(y.typography.title1),zl.textColor=v?.current?.titleColor||y.palette.getAccent(),zl.background="transparent",Jl.buttonIconTint=v?.current?.closeIconTint||y.palette.getPrimary();const[S,F]=t.useState(null),k=x(C),T=t.useMemo(()=>{if(S&&o?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user)return o?.getSender()?.getUid()===S?.getUid()?o?.getReceiver():o?.getSender()},[o,S]),M=t.useMemo(()=>{if(S&&o?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.group)return o?.getReceiver()},[S,o]),B=w.getId(),L=t.useMemo(()=>(new s.CometChat.MessagesRequestBuilder).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).hideReplies(!0).setLimit(20).setParentMessageId(B),[B]),R=t.useCallback(e=>{try{Number(e?.getMessageId())===B&&(e?.getReadAt()?f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getReadAt()),n}):e?.getDeliveredAt()&&f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getDeliveredAt()),n}))}catch(e){k(e)}},[B,f,k]),P=t.useCallback(e=>{try{B===e?.getId()&&f(t=>r.CometChatUIKitUtility.clone(e))}catch(e){k(e)}},[B,f,k]),O=t.useCallback(()=>{const e=n.CometChatMessageEvents.onMessagesDelivered.subscribe(e=>{R(e)}),t=n.CometChatMessageEvents.onMessagesRead.subscribe(e=>{R(e)}),r=n.CometChatMessageEvents.onMessageDeleted.subscribe(e=>{P(e)}),s=n.CometChatMessageEvents.onMessageEdited.subscribe(e=>{P(e)}),i=n.CometChatMessageEvents.onTextMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),a=n.CometChatMessageEvents.onMediaMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),l=n.CometChatMessageEvents.onCustomMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),c=n.CometChatMessageEvents.onFormMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),C=n.CometChatMessageEvents.onSchedulerMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),d=n.CometChatMessageEvents.onCardMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)}),g=n.CometChatMessageEvents.onCustomInteractiveMessageReceived.subscribe(e=>{e?.getParentMessageId()&&e.getParentMessageId()==o.getId()&&E(e=>e+1)});return()=>{e?.unsubscribe(),t?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe(),C?.unsubscribe(),d?.unsubscribe(),g?.unsubscribe()}},[R,P,o]),j=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.ccMessageSent.subscribe(({status:e,message:t})=>{e===n.MessageStatus.success&&t?.getParentMessageId()===w?.getId()&&E(e=>e+1)}),t=n.CometChatMessageEvents.ccMessageEdited.subscribe(({status:e,message:t})=>{e===n.MessageStatus.success&&t?.getId()===w?.getId()&&f(e=>r.CometChatUIKitUtility.clone(t))}),o=n.CometChatMessageEvents.ccMessageDeleted.subscribe(e=>{e?.getId()===w?.getId()&&f(t=>r.CometChatUIKitUtility.clone(e))}),s=n.CometChatMessageEvents.ccMessageRead.subscribe(e=>{e?.getId()===w?.getId()&&f(t=>{const n=r.CometChatUIKitUtility.clone(t);return n?.setReadAt(e?.getReadAt()),n})});return()=>{try{o?.unsubscribe(),t?.unsubscribe(),s?.unsubscribe(),e?.unsubscribe()}catch(e){k(e)}}}catch(e){k(e)}},[w,f,k]),V=t.useCallback(()=>{g()},[g]),G=t.useCallback(()=>{try{const e=D||0;return`${e} ${1===e?n.localize("REPLY"):n.localize("REPLIES")}`}catch(e){k(e)}},[k,D]),H=t.useCallback(()=>l&&w?l(w):null,[w,l]);return function(e,n,o,r,i,a,l){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{n(e)},e=>{i(e)})},[n,i]),t.useEffect(()=>{if(e){const e=o(),t=r();return()=>{e(),t()}}},[e,o,r]),t.useEffect(()=>{void 0===a?.getReplyCount()?l(0):l(a?.getReplyCount())},[a,l])}(S,F,O,j,k,o,E),d.jsxs("div",{className:"cc-threaded-messages__wrapper",style:{background:v?.current?.background||y.palette.getBackground(),height:v?.current?.height,width:v?.current?.width,border:v?.current?.border,borderRadius:v?.current?.borderRadius,display:"flex",flexDirection:"column",height:"100%",boxSizing:"border-box"},children:[d.jsxs("div",{className:"cc-threaded-messages__header",style:{padding:"16px",width:"100%",display:"flex",boxSizing:"border-box"},children:[d.jsx("div",{className:"cc-threaded-messages__title",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"calc(100% - 24px)"},children:d.jsx("cometchat-label",{text:i,labelStyle:JSON.stringify(zl)})}),d.jsx("div",{className:"cc-threaded-messages__close",style:{display:"flex",alignItems:"center",width:"24px"},children:d.jsx("cometchat-button",{iconURL:a,buttonStyle:JSON.stringify(Jl),onClick:V})})]}),d.jsxs("div",{className:"cc-threaded-messages",style:{width:"100%",height:"calc(100% - 156px)",display:"flex",flexDirection:"column"},children:[d.jsx("div",{className:"cc-threaded-messages__bubbleview",style:{display:"flex",width:"100%",height:"fit-content",padding:"8px 16px",boxSizing:"border-box",maxHeight:"20em",overflow:"hidden scroll"},children:H()}),d.jsx("div",{className:"cc-threaded-messages__actionview",style:Hl(y),children:c||d.jsx("cometchat-button",{text:G(),buttonStyle:JSON.stringify(Ql(y))})}),A?T||M?A(T,M,o):null:d.jsx("div",{className:"cc-threaded-messages__list",style:{height:"100%",overflow:"hidden",width:"100%"},children:d.jsx(Gl,{parentMessageId:w?.getId(),user:T,group:M,emptyStateView:p?.emptyStateView,loadingStateView:p?.loadingStateView,errorStateView:p?.errorStateView,disableReceipt:p?.disableReceipt,hideReceipt:p?.hideReceipt,readIcon:p?.readIcon,deliveredIcon:p?.deliveredIcon,sentIcon:p?.sentIcon,waitIcon:p?.waitIcon,errorIcon:p?.errorIcon,alignment:p?.alignment,showAvatar:p?.showAvatar,datePattern:p?.datePattern,timestampAlignment:p?.timestampAlignment,DateSeparatorPattern:p?.DateSeparatorPattern,templates:p?.templates,messagesRequestBuilder:p?.messagesRequestBuilder||L,thresholdValue:p?.thresholdValue,onThreadRepliesClick:p?.onThreadRepliesClick,headerView:p?.headerView,footerView:p?.footerView,avatarStyle:p?.avatarStyle,dateSeparatorStyle:p?.dateSeparatorStyle,messageListStyle:p?.messageListStyle,onError:p?.onError,disableMentions:p?.disableMentions,hideDateSeparator:p?.hideDateSeparator,reactionsConfiguration:p?.reactionsConfiguration,disableReactions:p?.disableReactions,emojiKeyboardStyle:p?.emojiKeyboardStyle,threadIndicatorIcon:p?.threadIndicatorIcon,textFormatters:p?.textFormatters})})]}),b||m?null:d.jsx("div",{className:"cc-threaded-messages__composer",style:{height:"fit-content",width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-end",minHeight:"90px"},children:d.jsx(Qa,{sendButtonIconURL:h?.sendButtonIconURL,parentMessageId:w?.getId(),user:T,group:M,text:h?.text,headerView:h?.headerView?h.headerView(T,M):null,onTextChange:h?.onTextChange,attachmentIconURL:h?.attachmentIconURL,attachmentOptions:h?.attachmentOptions,secondaryButtonView:h?.secondaryButtonView,auxiliaryButtonView:h?.auxilaryButtonView,auxiliaryButtonAlignment:h?.auxiliaryButtonsAlignment,sendButtonView:h?.sendButtonView,hideLiveReaction:h?.hideLiveReaction,LiveReactionIconURL:h?.LiveReactionIconURL,messageComposerStyle:h?.messageComposerStyle,onSendButtonClick:h?.onSendButtonClick,onError:h?.onError,hideVoiceRecording:h?.hideVoiceRecording,voiceRecordingStartIconURL:h?.voiceRecordingStartIconURL,voiceRecordingCloseIconURL:h?.voiceRecordingCloseIconURL,voiceRecordingStopIconURL:h?.voiceRecordingStopIconURL,voiceRecordingSubmitIconURL:h?.voiceRecordingSubmitIconURL,AIOptionsStyle:h?.AIOptionsStyle,AIIconURL:h?.AIIconURL,userMemberWrapperConfiguration:h?.userMemberWrapperConfiguration,textFormatters:h?.textFormatters||[],disableMentions:h?.disableMentions,mentionsWarningText:h?.mentionsWarningText,mentionsWarningStyle:h?.mentionsWarningStyle,emojiIconURL:h?.emojiIconURL,hideLayoutMode:h?.hideLayoutMode,actionSheetStyle:h?.actionSheetStyle})}),!b&&m&&(T||M)?m(T,M,o):null]})};const _l={user:void 0,group:void 0,hideMessageComposer:!1,disableTyping:!1,messageHeaderConfiguration:new r.MessageHeaderConfiguration({}),messageListConfiguration:new r.MessageListConfiguration({}),messageComposerConfiguration:new r.MessageComposerConfiguration({}),threadedMessagesConfiguration:new r.ThreadedMessagesConfiguration({}),detailsConfiguration:new r.DetailsConfiguration({}),customSoundForIncomingMessages:"",customSoundForOutgoingMessages:"",disableSoundForMessages:!1,messagesStyle:new r.MessagesStyle({width:"100%",height:"100%",background:"white",borderRadius:"none",border:"1px solid rgba(20, 20, 20, 0.1)"}),messageHeaderView:null,messageComposerView:null,messageListView:null,hideMessageHeader:!1,hideDetails:!1,auxiliaryMenu:null},Wl=e=>{const{theme:o}=t.useContext(U),{user:r,group:i,hideMessageComposer:a,disableTyping:l,messageHeaderConfiguration:c,messageListConfiguration:C,messageComposerConfiguration:g,threadedMessagesConfiguration:u,detailsConfiguration:p,customSoundForIncomingMessages:h,customSoundForOutgoingMessages:m,disableSoundForMessages:A,messagesStyle:x,messageHeaderView:b,messageComposerView:y,messageListView:w,hideMessageHeader:f,hideDetails:D,auxiliaryMenu:E}={..._l,...e},[v,I]=t.useState(null),[S,F]=t.useState(r),[k,T]=t.useState(i),M=t.useRef(null),B=t.useRef(null),L=t.useRef(null),[R,P]=t.useState(!1),[O,j]=t.useState(!1),[V,G]=t.useState(!1),[H,Q]=t.useState(!1),N=t.useRef(null);t.useMemo(()=>r?(new s.CometChat.MessagesRequestBuilder).setUID(r.getUid()).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).setLimit(20).hideReplies(!0):i?(new s.CometChat.MessagesRequestBuilder).setGUID(i.getGuid()).setCategories(Be.getDataSource().getAllMessageCategories()).setTypes(Be.getDataSource().getAllMessageTypes()).setLimit(20).hideReplies(!0):void 0,[r,i]);let K=g?.LiveReactionIconURL||"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAUCAYAAACXtf2DAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAGKADAAQAAAABAAAAFAAAAAAnxZisAAACpElEQVQ4Ea1VzUsVURQ/5868UrEg/AMy0NTMRQRBJfIQszKxgh5ByzbVIooiiDbZBwUtXAWJtGgRJW0MQsxnxfhRIbgpsqcQtajoA8uITGfu3Hs6Z+zJU3pq+n4wc+fee87vd+bcM2cQ5mB0Z+0WMuERQNiNgO+UgtYAgs7K7uffM01fVlevyc9391iAo5bsOkT1gPdvlvd4Q5l2mJ68bahdG2rTwvMmB9HV1gKP0WWA3oSWzlc86rsj9qm6mkOuwgsKsMQSgeErxpEYS5oQOpSLp0u7vA9iGwmkdsWLlaGuPKXKJw3TyU4GYizEYG+OFglXAt7gOWomzoRY5TsO+Na+8pEaqpJ97/FeIuFUjX++X+C4jb+ZPBsUi3C0Wvb5OSaRZ0MBi0xY01GxvfYApuprtjkE/ZZAZXeZpkrnczF2Ek9oaKtCi2c4ogXJRUKIFyJP2zmolHLUSZeAGjWXQq4RcpHwMTVxIeCwVEuuIWfGSPGIl/9OcqohnA7QVWUCeMg1PyJ1nCsIl7ZmVIcqqSo97xen6aK8UC4SleZB5VwS7ijs8p7e9sDQLflIlos8R4FPdLs9Gb8rXJEAq5K7YurEpLHeckTEd8rYp77G483QHNXmTOJLuwZ/ukof9I0dWIqI+PjWDFqHEps870c6EzMCslCSfPYVQtzvG9MpDos5E7GZJrc9gfX3buju/5Qml3GWgCyUed7YtwmdYJHrLqqom8r6vyDfT0whsG3bqrzV+6oeD36ZazdvkCN1NYe5nq8xSRHndpYvd14Igca5dZxdn+xtm7WZMZlXQOxe18c3ukQtLLJDc0cUSPsOiJ6AMqfKugdeRItZbgsKiN/Q5s2xwqLCYw7hOWl3/FO5oj+OtVYODwdZeJe2LD+mVDxe/D/efwCuAQs2cnkFkQAAAABJRU5ErkJggg==",z="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FInfo%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FInfo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-information-circle%4024x24%22%20transform%3D%22translate%282.000000%2C%202.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M12%2C14%20L11.3333333%2C14%20C10.5969537%2C14%2010%2C13.4030463%2010%2C12.6666667%20L10%2C9.33333333%20C10%2C8.9651435%209.70152317%2C8.66666667%209.33333333%2C8.66666667%20L8.66666667%2C8.66666667%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M9.66666667%2C5.33333333%20C9.48257175%2C5.33333333%209.33333333%2C5.48257175%209.33333333%2C5.66666667%20C9.33333333%2C5.85076158%209.48257175%2C6%209.66666667%2C6%20C9.85076158%2C6%2010%2C5.85076158%2010%2C5.66666667%20C10%2C5.48257175%209.85076158%2C5.33333333%209.66666667%2C5.33333333%20L9.66666667%2C5.33333333%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%2C10%20C0%2C15.5228475%204.4771525%2C20%2010%2C20%20C15.5228475%2C20%2020%2C15.5228475%2020%2C10%20C20%2C4.4771525%2015.5228475%2C0%2010%2C0%20C4.4771525%2C0%200%2C4.4771525%200%2C10%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";const J=t.useCallback(e=>{R?P(!1):(P(!0),setTimeout(()=>{P(!1)},1500))},[R,P]),Y=t.useCallback(()=>{try{const e=n.CometChatMessageEvents.ccLiveReaction.subscribe(e=>{!V&&e&&"heart"===e&&J(e)}),t=n.CometChatMessageEvents.ccLiveReactionSent.subscribe(e=>{const{composerId:t,reaction:n}=e;t?(t&&t.user&&t.user===S?.getUid()||t&&t.group&&t.group===k?.getGuid())&&J(n):J(n)}),o=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{k&&k.getGuid()===i?.getGuid()&&(j(!1),G(!1),T(e))}),r=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{k?.getGuid()===e.leftGroup.getGuid()&&(v?.getUid()===e?.userLeft.getUid()&&(j(!1),G(!1)),T(e.leftGroup))}),s=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{S?.getUid()===e.getUid()&&(e.setBlockedByMe(!0),F(e))}),a=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{S?.getUid()===e.getUid()&&(e.setBlockedByMe(!1),F(e))}),l=n.CometChatUIEvents.ccShowPanel.subscribe(e=>{e.position===n.PanelAlignment.messages&&(N.current=e.child,Q(!0))}),c=n.CometChatUIEvents.ccHidePanel.subscribe(e=>{e===n.PanelAlignment.messages&&(N.current=null,Q(!1))});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),r?.unsubscribe(),s?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe()}catch(e){console.log("error",e)}}}catch(e){console.log("error",e)}},[V,J,j,G,k,S,v,i]),_=(e,t)=>{B.current=e,L.current=t,G(!0)},W=()=>j(!0),Z=()=>{j(!1)},X=()=>{B.current=null,L.current=null,G(!1)};function q(){if(p?.data)return p?.data(r,i)}const $=t.useCallback(()=>{if(c?.menu)return c.menu(S,k);const e=Be.getDataSource().getAuxiliaryHeaderMenu(S,k);return d.jsxs(d.Fragment,{children:[E||e.map(e=>e),D?null:d.jsx("div",{className:"cc-messages__header-menu-wrapper",style:{height:"100%",width:"100%",border:"none",background:"transparent",borderRadius:0,marginLeft:"16px"},children:d.jsx("cometchat-button",{iconURL:z,buttonStyle:JSON.stringify(mi(o)),ref:M,onClick:W})})]})},[c,S,k,E,D,z]);return function(e,n,o,r,i,a,l,c,C,d,g){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&n(e)})},[n]),t.useEffect(()=>{const e=r.current;if(!e)return;const t=e=>{i(!0)};return a?.menu?e.removeEventListener("cc-menu-clicked",t):e.addEventListener("cc-menu-clicked",t),()=>{e.removeEventListener("cc-menu-clicked",t)}},[a,r,i]),t.useEffect(()=>{l&&(d(null),c(e=>(e?.getUid()!==l?.getUid()&&(i(!1),g(!1)),l)))},[l,c,d,i,g]),t.useEffect(()=>{C&&(c(null),d(e=>(e?.getGuid()!==C?.getGuid()&&(i(!1),g(!1)),C)))},[C,c,d,i,g]),t.useEffect(()=>{let t;return e&&(t=o()),()=>{t?.()}},[e,o])}(v,I,Y,M,j,C,r??null,F,i??null,T,G),S||k?d.jsxs("div",{className:"cc-messages-wrapper",style:ai(x,o),children:[H&&N.current?d.jsxs("div",{className:"cc-messages-wrapper__panel",style:Ai,children:[N.current," "]}):null,d.jsxs("div",{className:"cc-messages",style:{height:"100%",width:"100%",display:"flex",flexDirection:"column",position:"relative",boxSizing:"border-box",justifyContent:"space-between",borderRadius:"inherit"},children:[f?null:d.jsx("div",{className:"cc-messages__header",style:Ci,children:b||d.jsx(Za,{user:S,group:k,subtitleView:c?.subtitleView?c.subtitleView(S,k):null,disableUsersPresence:c?.disableUsersPresence,protectedGroupIcon:c?.protectedGroupIcon,passwordGroupIcon:c?.passwordGroupIcon,privateGroupIcon:c?.privateGroupIcon,menu:$(),avatarStyle:c?.avatarStyle,statusIndicatorStyle:c?.statusIndicatorStyle,messageHeaderStyle:gi(c),listItemStyle:c?.listItemStyle,backButtonIconURL:c?.backButtonIconURL,hideBackButton:c?.hideBackButton,listItemView:c?.listItemView?c.listItemView(S,k):null,onError:c?.onError,onBack:c?.onBack,disableTyping:l})}),w||d.jsx("div",{className:"cc-messages__list",style:di,children:d.jsx(Gl,{loadingIconURL:C?.loadingIconURL,user:S,group:k,emptyStateView:C?.emptyStateView,errorStateView:C?.errorStateView,loadingStateView:C?.loadingStateView,disableSoundForMessages:A,customSoundForMessages:h,disableReceipt:C?.disableReceipt,hideReceipt:C?.hideReceipt,readIcon:C?.readIcon,deliveredIcon:C?.deliveredIcon,sentIcon:C?.sentIcon,waitIcon:C?.waitIcon,errorIcon:C?.errorIcon,alignment:C?.alignment,showAvatar:C?.showAvatar,scrollToBottomOnNewMessages:C?.scrollToBottomOnNewMessages,datePattern:C?.datePattern,timestampAlignment:C?.timestampAlignment,DateSeparatorPattern:C?.DateSeparatorPattern,templates:C?.templates,messagesRequestBuilder:C?.messagesRequestBuilder,thresholdValue:C?.thresholdValue,onThreadRepliesClick:C?.onThreadRepliesClick||_,headerView:C?.headerView,footerView:C?.footerView,avatarStyle:C?.avatarStyle,dateSeparatorStyle:C?.dateSeparatorStyle,messageListStyle:ui(C),onError:C?.onError,disableMentions:C?.disableMentions,hideDateSeparator:C?.hideDateSeparator,reactionsConfiguration:C?.reactionsConfiguration,disableReactions:C?.disableReactions,emojiKeyboardStyle:C?.emojiKeyboardStyle,threadIndicatorIcon:C?.threadIndicatorIcon,textFormatters:C?.textFormatters,messageInformationConfiguration:C?.messageInformationConfiguration,backdropStyle:C?.backdropStyle,hideError:C?.hideError})}),a?null:y||d.jsx("div",{className:"cc-messages__composer",style:{width:"100%",display:"flex"},children:a?null:d.jsx(Qa,{sendButtonIconURL:g?.sendButtonIconURL,user:S,group:k,text:g?.text,headerView:g?.headerView?g.headerView(S,k):null,onTextChange:g?.onTextChange,attachmentIconURL:g?.attachmentIconURL,attachmentOptions:g?.attachmentOptions,secondaryButtonView:g?.secondaryButtonView,auxiliaryButtonView:g?.auxilaryButtonView,auxiliaryButtonAlignment:g?.auxiliaryButtonsAlignment,sendButtonView:g?.sendButtonView,emojiIconURL:g?.emojiIconURL,hideLiveReaction:g?.hideLiveReaction,LiveReactionIconURL:g?.LiveReactionIconURL,hideLayoutMode:g?.hideLayoutMode,actionSheetStyle:g?.actionSheetStyle,messageComposerStyle:pi(g),onSendButtonClick:g?.onSendButtonClick,onError:g?.onError,disableSoundForMessages:A,customSoundForMessage:m,hideVoiceRecording:g?.hideVoiceRecording,voiceRecordingStartIconURL:g?.voiceRecordingStartIconURL,voiceRecordingCloseIconURL:g?.voiceRecordingCloseIconURL,voiceRecordingStopIconURL:g?.voiceRecordingStopIconURL,voiceRecordingSubmitIconURL:g?.voiceRecordingSubmitIconURL,AIOptionsStyle:g?.AIOptionsStyle,AIIconURL:g?.AIIconURL,userMemberWrapperConfiguration:g?.userMemberWrapperConfiguration,textFormatters:g?.textFormatters||[],disableMentions:g?.disableMentions,mentionsWarningText:g?.mentionsWarningText,mentionsWarningStyle:g?.mentionsWarningStyle,mediaRecorderStyle:g?.mediaRecorderStyle})})]}),V&&B.current?d.jsx("div",{className:"cc-messages__threaded",style:li,children:V&&B.current?d.jsx(Yl,{parentMessage:B.current,onClose:u?.onClose||X,onError:u?.onError,closeIconURL:u?.closeIconURL,bubbleView:u?.bubbleView||L.current,messageActionView:u?.messageActionView?u.messageActionView(B.current):null,messageListConfiguration:u?.messageListConfiguration,messageComposerConfiguration:u?.messageComposerConfiguration,threadedMessagesStyle:u?.threadedMessagesStyle,hideMessageComposer:u?.hideMessageComposer,messageComposerView:u?.messageComposerView,messageListView:u?.messageListView}):null}):null,R?d.jsx("div",{className:"cc-messages__live-reaction",style:{position:"absolute",bottom:"50px",right:"20px",width:"50%",height:"100%"},children:d.jsx("cometchat-live-reaction",{reactionIconURL:K,liveReactionStyle:JSON.stringify({height:"20px",width:"25px",background:g?.messageComposerStyle?.liveReactionIconTint||"red"})})}):null,O?d.jsx("div",{className:"cc-messages__details",style:ci,children:d.jsx(Zi,{user:S,group:k,closeButtonIconURL:p?.closeButtonIconURL||"./assets/close2x.svg",hideProfile:p?.hideProfile,subtitleView:p?.subtitleView,customProfileView:p?.customProfileView,data:q(),disableUsersPresence:p?.disableUsersPresence,privateGroupIcon:p?.privateGroupIcon,protectedGroupIcon:p?.protectedGroupIcon,passwordGroupIcon:p?.passwordGroupIcon,onError:p?.onError,onClose:p?.onClose||Z,leaveDialogStyle:p?.leaveDialogStyle,statusIndicatorStyle:p?.statusIndicatorStyle,avatarStyle:p?.avatarStyle,detailsStyle:hi(p),listItemStyle:p?.listItemStyle,groupMembersConfiguration:p?.groupMembersConfiguration,addMembersConfiguration:p?.addMembersConfiguration,bannedMembersConfiguration:p?.bannedMembersConfiguration,transferOwnershipConfiguration:p?.transferOwnershipConfiguration})}):null]}):null};const Zl={user:void 0,group:void 0,isMobileView:!1,messageText:"",conversationsWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),conversationsConfiguration:new r.ConversationsConfiguration({}),onError:e=>{console.log(e)},startConversationConfiguration:new r.ContactsConfiguration({}),startConversationIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FNew%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FNew%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%201.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M10.9288822%2C11.8990317%20L7.62932866%2C12.3710104%20L8.10043948%2C9.07071466%20L16.5857676%2C0.585763632%20C17.3668205%2C-0.195254544%2018.6331574%2C-0.195254544%2019.4142103%2C0.585763632%20C20.1952632%2C1.36678181%2020.1952632%2C2.63306247%2019.4142103%2C3.41408064%20L10.9288822%2C11.8990317%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%2215.6426571%22%20y1%3D%221.52883225%22%20x2%3D%2218.4710998%22%20y2%3D%224.35714926%22%20id%3D%22Path%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M16%2C12.0003604%20L16%2C18.6667267%20C16%2C19.4030732%2015.4030369%2C20%2014.6666577%2C20%20L1.33333252%2C20%20C0.596953301%2C20%200%2C19.4030732%200%2C18.6667267%20L0%2C5.33399414%20C0%2C4.59764765%200.596953301%2C4.00072088%201.33333252%2C4.00072088%20L8%2C4.00072088%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"},Xl={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},ql={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},$l={width:"calc(100% - 280px)",height:"100%"},ec={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},tc={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},nc={width:"280px",height:"100%",position:"relative"},oc=(e,t)=>({...ql,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),rc=(e,t,n,o)=>n?sc(o):ic(e,t),sc=e=>({...e?{visibility:"hidden"}:{visibility:"visible"},...ec,borderRadius:"inherit"}),ic=(e,t)=>{const n=e?.borderRadius||0;return{...nc,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},ac=(e,t,n)=>t?lc(n):cc(e),lc=e=>({...e?{visibility:"visible"}:{visibility:"hidden"},...ec,borderRadius:"inherit"}),cc=e=>{const t=e?.borderRadius||0;return{...$l,borderRadius:`0 ${t} ${t} 0`}},Cc=(e,t)=>({...Xl,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),dc=e=>{const t=e?.groupsStyle;return{width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...t}},gc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},uc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},pc=(e,t)=>{let n={visibility:"hidden"};return t||e||(n={visibility:"visible"}),{...tc,...n,width:"calc(100% - 280px)"}},hc=e=>e?{...ec,background:"inherit",borderRadius:"inherit"}:{width:"calc(100% - 280px)",background:"inherit",borderRadius:"inherit"},mc=(e,t)=>{const o=e?.joinGroupStyle;return{width:o?.width||"100%",height:o?.height||"100%",boxShadow:o?.boxShadow||"none",background:o?.background||"transparent",border:o?.border||"0",borderRadius:o?.borderRadius||"inherit",titleTextFont:o?.titleTextFont||n.fontHelper(t.typography.heading),titleTextColor:o?.titleTextFont||t.palette.getAccent700(),passwordInputPlaceholderTextFont:o?.passwordInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),passwordInputPlaceholderTextColor:o?.passwordInputPlaceholderTextColor||t.palette.getAccent600(),passwordInputBackground:o?.passwordInputBackground||t.palette.getAccent50(),passwordInputBorder:o?.passwordInputBorder||"none",passwordInputBorderRadius:o?.passwordInputBorderRadius||"8px",passwordInputBoxShadow:o?.passwordInputBoxShadow||`${t.palette.getAccent50()} 0 0 0 1px`,passwordInputTextFont:o?.passwordInputTextFont||n.fontHelper(t.typography.subtitle1),passwordInputTextColor:o?.passwordInputTextColor||t.palette.getAccent(),joinButtonTextFont:o?.joinButtonTextFont||n.fontHelper(t.typography.title2),joinButtonTextColor:o?.joinButtonTextColor||t.palette.getBackground(),joinButtonBackground:o?.joinButtonBackground||t.palette.getPrimary(),joinButtonBorderRadius:o?.joinButtonBorderRadius||"8px",joinButtonBorder:o?.joinButtonBorder||"none",errorTextFont:o?.errorTextFont||n.fontHelper(t.typography.subtitle1),errorTextColor:o?.errorTextFont||t.palette.getError()}},Ac=(e,t,o)=>{const r=t?.messageHeaderStyle;return{background:r?.background||"inherit",border:"none",borderRadius:r?.borderRadius||e?.borderRadius||"inherit",onlineStatusColor:r?.onlineStatusColor||o.palette.getSuccess(),privateGroupIconBackground:r?.privateGroupIconBackground||o.palette.getSuccess(),passwordGroupIconBackground:r?.passwordGroupIconBackground||"RGB(247, 165, 0)",backButtonIconTint:r?.backButtonIconTint||o.palette.getPrimary(),subtitleTextColor:r?.subtitleTextColor||o.palette.getAccent600(),subtitleTextFont:r?.subtitleTextFont||n.fontHelper(o.typography.subtitle2),typingIndicatorTextColor:r?.typingIndicatorTextColor||o.palette.getPrimary(),typingIndicatorTextFont:r?.typingIndicatorTextFont||n.fontHelper(o.typography.subtitle1)}},xc=(e,t)=>{const o=e?.listItemStyle;return{width:o?.width||"100%",height:o?.height||"45px",background:o?.background||"inherit",hoverBackground:o?.hoverBackground||"transparent",activeBackground:o?.activeBackground||"transparent",borderRadius:o?.borderRadius||"0",titleFont:o?.titleFont||n.fontHelper(t.typography.title2),titleColor:o?.titleColor||t.palette.getAccent(),border:o?.border||"none",separatorColor:o?.separatorColor||""}},bc=e=>({height:e?.height,width:e?.width,position:"absolute"}),yc=e=>{if(e)return{...ec,background:"inherit",borderRadius:"inherit"}},wc=(e,t,o)=>{let r="360px",s="500px";o&&(r="100%",s="100%");const i=e?.createGroupStyle;return{width:i?.width||r,height:i?.height||s,border:i?.border||"0 none",borderRadius:i?.borderRadius||"0",background:i?.background||t.palette.getBackground(),boxShadow:i?.boxShadow||`${t.palette.getAccent100()} 4px 16px 32px 4px`,titleTextFont:i?.titleTextFont||n.fontHelper(t.typography.heading),titleTextColor:i?.titleTextColor||t.palette.getAccent(),groupTypeTextFont:i?.groupTypeTextFont||n.fontHelper(t.typography.text3),groupTypeBorder:i?.groupTypeBorder||"0 none",groupTypeBorderRadius:i?.groupTypeBorderRadius||"0px",groupTypeTextColor:i?.groupTypeTextColor||t.palette.getAccent(),groupTypeTextBackground:i?.groupTypeTextBackground||"inherit",groupTypeBackground:i?.groupTypeBackground||t.palette.getAccent100(),groupTypeBoxShadow:i?.groupTypeBoxShadow||"",activeGroupTypeTextFont:i?.activeGroupTypeTextFont||n.fontHelper(t.typography.text3),activeGroupTypeTextColor:i?.activeGroupTypeTextColor||t.palette.getAccent(),activeGroupTypeBackground:i?.activeGroupTypeBackground||t.palette.getAccent900(),activeGroupTypeBoxShadow:i?.activeGroupTypeBoxShadow||`${t.palette.getAccent200()} 0 3px 8px 0`,activeGroupTypeBorderRadius:i?.activeGroupTypeBorderRadius||"8px",activeGroupTypeBorder:i?.activeGroupTypeBorder||"none",groupTypeTextBoxShadow:i?.groupTypeTextBoxShadow||"none",groupTypeTextBorderRadius:i?.groupTypeTextBorderRadius||"7px",closeIconTint:i?.closeIconTint||t.palette.getPrimary(),errorTextFont:i?.errorTextFont||n.fontHelper(t.typography.text2),errorTextBackground:i?.errorTextBackground||t.palette.getError(),errorTextBorderRadius:i?.errorTextBorderRadius||"8px",errorTextBorder:i?.errorTextBorder||"none",errorTextColor:i?.errorTextColor||t.palette.getError(),nameInputPlaceholderTextFont:i?.nameInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),nameInputPlaceholderTextColor:i?.nameInputPlaceholderTextColor||t.palette.getAccent600(),nameInputBackground:i?.nameInputBackground||t.palette.getAccent100(),nameInputTextFont:i?.nameInputTextFont||n.fontHelper(t.typography.subtitle1),nameInputTextColor:i?.nameInputTextColor||t.palette.getAccent(),nameInputBorder:i?.nameInputBorder||"none",nameInputBorderRadius:i?.nameInputBorderRadius||"8px",nameInputBoxShadow:i?.nameInputBoxShadow||`${t.palette.getAccent100()} 0 0 0 1px`,passwordInputPlaceholderTextFont:i?.passwordInputPlaceholderTextFont||n.fontHelper(t.typography.subtitle1),passwordInputPlaceholderTextColor:i?.passwordInputPlaceholderTextColor||t.palette.getAccent600(),passwordInputBackground:i?.passwordInputBackground||t.palette.getAccent100(),passwordInputBorder:i?.passwordInputBorder||"none",passwordInputBorderRadius:i?.passwordInputBorderRadius||"8px",passwordInputBoxShadow:i?.passwordInputBoxShadow||`${t.palette.getAccent100()} 0 0 0 1px`,passwordInputTextFont:i?.passwordInputTextFont||n.fontHelper(t.typography.subtitle1),passwordInputTextColor:i?.passwordInputTextColor||t.palette.getAccent(),createGroupButtonTextFont:i?.createGroupButtonTextFont||n.fontHelper(t.typography.title2),createGroupButtonTextColor:i?.createGroupButtonTextColor||t.palette.getAccent("dark"),createGroupButtonBackground:i?.createGroupButtonBackground||t.palette.getPrimary(),createGroupButtonBorderRadius:i?.createGroupButtonBorderRadius||"8px",createGroupButtonBorder:i?.createGroupButtonBorder||"none"}},fc=e=>({height:"24px",width:"24px",border:"none",borderRadius:"0",background:"transparent",buttonIconTint:`${e.palette.getPrimary()}`,padding:"0"});const Dc=ye({tagName:"cometchat-create-group",elementClass:o.CometChatCreateGroup,react:t}),Ec={group:void 0,isMobileView:!1,messageText:"",groupsWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),groupsConfiguration:new r.GroupsConfiguration({}),createGroupConfiguration:new r.CreateGroupConfiguration({}),joinGroupConfiguration:new r.JoinGroupConfiguration({}),onError:e=>{console.log(e)}},vc={height:"100%",width:"100%",background:"transparent",border:"none",borderRadius:"0",textFont:"700 22px Inter, sans-serif",textColor:"rgba(20, 20, 20, 0.33)"},Ic={display:"flex",height:"100%",width:"100%",boxSizing:"border-box",position:"relative"},Sc={width:"calc(100% - 280px)",height:"100%"},Fc={width:"100%",height:"100%",position:"absolute",top:"0",left:"0"},kc={display:"flex",justifyContent:"center",alignItems:"center",background:"inherit",border:"none",borderRadius:"inherit",width:"100%",height:"auto"},Tc={width:"280px",height:"100%",position:"relative"},Mc=(e,t)=>({...Ic,width:"100%",height:"100%",border:`1px solid ${t.palette.getAccent100()}`,borderRadius:"0",background:t.palette.getBackground(),...e}),Bc=(e,t,n,o)=>n?Lc(o):Uc(e,t),Lc=e=>({...e?{visibility:"hidden"}:{visibility:"visible"},...Fc,borderRadius:"inherit"}),Uc=(e,t)=>{const n=e?.borderRadius||0;return{...Tc,borderRight:e?.border||`1px solid ${t.palette.getAccent100()}`,borderRadius:`${n} 0 0 ${n}`}},Rc=(e,t,n)=>t?Pc(n):Oc(e),Pc=e=>({...e?{visibility:"visible"}:{visibility:"hidden"},...Fc,borderRadius:"inherit"}),Oc=e=>{const t=e?.borderRadius||0;return{...Sc,borderRadius:`0 ${t} ${t} 0`}},jc=(e,t)=>({...vc,textFont:e?.messageTextFont||n.fontHelper(t.typography.title1),textColor:e?.messageTextColor||t.palette.getAccent600()}),Vc=e=>{const t=e?.usersStyle;return{width:"100%",height:"100%",border:"0 none",borderRadius:"inherit",background:"inherit",...t}},Gc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`${o} ${o} 0 0`:`0px ${o} 0px 0px`,...t?.messageHeaderConfiguration?.messageHeaderStyle}},Hc=(e,t,n)=>{const o=e?.borderRadius;return{borderRadius:n?`0 0 ${o} ${o}`:`0px 0 ${o} 0px`,...t?.messageComposerConfiguration?.messageComposerStyle}},Qc=(e,t)=>{let n={visibility:"hidden"};return t||e||(n={visibility:"visible"}),{...kc,...n,width:"calc(100% - 280px)"}},Nc=(e,t)=>{const n=e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle.width||"320px",o=e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle.height||"620px";return{...e?.messageListConfiguration?.messageInformationConfiguration.messageInformationStyle,width:t?"100vw":n,height:t?"100vh":o}};const Kc={user:void 0,isMobileView:!1,messageText:"",usersWithMessagesStyle:{},messagesConfiguration:new r.MessagesConfiguration({}),usersConfiguration:new r.UsersConfiguration({}),onError:e=>{console.log(e)}};class zc extends r.BaseStyle{constructor(e){super({}),this.tabListHeight="100%",this.tabListWidth="100%",this.tabListBorder="0 none",this.tabListBorderRadius="0",this.tabListBackground="transparent",this.tabListBoxShadow="0",this.tabListPadding="0",this.tabPaneWidth="100%",this.tabPaneHeight="100%",Object.assign(this,e)}}Object.defineProperty(exports,"ActionSheetStyle",{enumerable:!0,get:function(){return o.ActionSheetStyle}}),Object.defineProperty(exports,"AvatarStyle",{enumerable:!0,get:function(){return o.AvatarStyle}}),Object.defineProperty(exports,"BackdropStyle",{enumerable:!0,get:function(){return o.BackdropStyle}}),Object.defineProperty(exports,"BadgeStyle",{enumerable:!0,get:function(){return o.BadgeStyle}}),Object.defineProperty(exports,"ButtonGroupStyle",{enumerable:!0,get:function(){return o.ButtonGroupStyle}}),Object.defineProperty(exports,"CallscreenStyle",{enumerable:!0,get:function(){return o.CallscreenStyle}}),Object.defineProperty(exports,"CardStyle",{enumerable:!0,get:function(){return o.CardStyle}}),Object.defineProperty(exports,"ChangeScopeStyle",{enumerable:!0,get:function(){return o.ChangeScopeStyle}}),Object.defineProperty(exports,"CheckboxStyle",{enumerable:!0,get:function(){return o.CheckboxStyle}}),Object.defineProperty(exports,"CometChatActionItem",{enumerable:!0,get:function(){return o.CometChatActionItem}}),Object.defineProperty(exports,"CometChatActionSheet",{enumerable:!0,get:function(){return o.CometChatActionSheet}}),Object.defineProperty(exports,"CometChatAvatar",{enumerable:!0,get:function(){return o.CometChatAvatar}}),Object.defineProperty(exports,"CometChatBackdrop",{enumerable:!0,get:function(){return o.CometChatBackdrop}}),Object.defineProperty(exports,"CometChatBadge",{enumerable:!0,get:function(){return o.CometChatBadge}}),Object.defineProperty(exports,"CometChatButton",{enumerable:!0,get:function(){return o.CometChatButton}}),Object.defineProperty(exports,"CometChatButtonGroup",{enumerable:!0,get:function(){return o.CometChatButtonGroup}}),Object.defineProperty(exports,"CometChatCallscreenWrapper",{enumerable:!0,get:function(){return o.CometChatCallscreenWrapper}}),Object.defineProperty(exports,"CometChatCard",{enumerable:!0,get:function(){return o.CometChatCard}}),Object.defineProperty(exports,"CometChatChangeScope",{enumerable:!0,get:function(){return o.CometChatChangeScope}}),Object.defineProperty(exports,"CometChatCheckbox",{enumerable:!0,get:function(){return o.CometChatCheckbox}}),Object.defineProperty(exports,"CometChatConfirmDialog",{enumerable:!0,get:function(){return o.CometChatConfirmDialog}}),Object.defineProperty(exports,"CometChatContextMenu",{enumerable:!0,get:function(){return o.CometChatContextMenu}}),Object.defineProperty(exports,"CometChatCreateGroup",{enumerable:!0,get:function(){return o.CometChatCreateGroup}}),Object.defineProperty(exports,"CometChatDate",{enumerable:!0,get:function(){return o.CometChatDate}}),Object.defineProperty(exports,"CometChatDivider",{enumerable:!0,get:function(){return o.CometChatDivider}}),Object.defineProperty(exports,"CometChatDocumentBubble",{enumerable:!0,get:function(){return o.CometChatDocumentBubble}}),Object.defineProperty(exports,"CometChatDraggable",{enumerable:!0,get:function(){return o.CometChatDraggable}}),Object.defineProperty(exports,"CometChatDropdown",{enumerable:!0,get:function(){return o.CometChatDropdown}}),Object.defineProperty(exports,"CometChatEmoji",{enumerable:!0,get:function(){return o.CometChatEmoji}}),Object.defineProperty(exports,"CometChatEmojiKeyboard",{enumerable:!0,get:function(){return o.CometChatEmojiKeyboard}}),Object.defineProperty(exports,"CometChatFullScreenViewer",{enumerable:!0,get:function(){return o.CometChatFullScreenViewer}}),Object.defineProperty(exports,"CometChatIcon",{enumerable:!0,get:function(){return o.CometChatIcon}}),Object.defineProperty(exports,"CometChatIconButton",{enumerable:!0,get:function(){return o.CometChatIconButton}}),Object.defineProperty(exports,"CometChatInput",{enumerable:!0,get:function(){return o.CometChatInput}}),Object.defineProperty(exports,"CometChatJoinGroup",{enumerable:!0,get:function(){return o.CometChatJoinGroup}}),Object.defineProperty(exports,"CometChatLabel",{enumerable:!0,get:function(){return o.CometChatLabel}}),Object.defineProperty(exports,"CometChatListItem",{enumerable:!0,get:function(){return o.CometChatListItem}}),Object.defineProperty(exports,"CometChatLiveReaction",{enumerable:!0,get:function(){return o.CometChatLiveReaction}}),Object.defineProperty(exports,"CometChatLoader",{enumerable:!0,get:function(){return o.CometChatLoader}}),Object.defineProperty(exports,"CometChatMediaRecorder",{enumerable:!0,get:function(){return o.CometChatMediaRecorder}}),Object.defineProperty(exports,"CometChatMenuList",{enumerable:!0,get:function(){return o.CometChatMenuList}}),Object.defineProperty(exports,"CometChatMessageInput",{enumerable:!0,get:function(){return o.CometChatMessageInput}}),Object.defineProperty(exports,"CometChatModal",{enumerable:!0,get:function(){return o.CometChatModal}}),Object.defineProperty(exports,"CometChatPopover",{enumerable:!0,get:function(){return o.CometChatPopover}}),Object.defineProperty(exports,"CometChatPreview",{enumerable:!0,get:function(){return o.CometChatPreview}}),Object.defineProperty(exports,"CometChatQuickView",{enumerable:!0,get:function(){return o.CometChatQuickView}}),Object.defineProperty(exports,"CometChatRadioButton",{enumerable:!0,get:function(){return o.CometChatRadioButton}}),Object.defineProperty(exports,"CometChatReceipt",{enumerable:!0,get:function(){return o.CometChatReceipt}}),Object.defineProperty(exports,"CometChatSearchInput",{enumerable:!0,get:function(){return o.CometChatSearchInput}}),Object.defineProperty(exports,"CometChatSingleSelect",{enumerable:!0,get:function(){return o.CometChatSingleSelect}}),Object.defineProperty(exports,"CometChatStatusIndicator",{enumerable:!0,get:function(){return o.CometChatStatusIndicator}}),Object.defineProperty(exports,"CometChatTextInput",{enumerable:!0,get:function(){return o.CometChatTextInput}}),Object.defineProperty(exports,"ConfirmDialogStyle",{enumerable:!0,get:function(){return o.ConfirmDialogStyle}}),Object.defineProperty(exports,"ContextMenuStyle",{enumerable:!0,get:function(){return o.ContextMenuStyle}}),Object.defineProperty(exports,"CreateGroupStyle",{enumerable:!0,get:function(){return o.CreateGroupStyle}}),Object.defineProperty(exports,"DateStyle",{enumerable:!0,get:function(){return o.DateStyle}}),Object.defineProperty(exports,"DocumentBubbleStyle",{enumerable:!0,get:function(){return o.DocumentBubbleStyle}}),Object.defineProperty(exports,"DropdownStyle",{enumerable:!0,get:function(){return o.DropdownStyle}}),Object.defineProperty(exports,"EmojiKeyboardStyle",{enumerable:!0,get:function(){return o.EmojiKeyboardStyle}}),Object.defineProperty(exports,"Emojis",{enumerable:!0,get:function(){return o.Emojis}}),Object.defineProperty(exports,"FileBubbleStyle",{enumerable:!0,get:function(){return o.FileBubbleStyle}}),Object.defineProperty(exports,"FullScreenViewerStyle",{enumerable:!0,get:function(){return o.FullScreenViewerStyle}}),Object.defineProperty(exports,"IconStyle",{enumerable:!0,get:function(){return o.IconStyle}}),Object.defineProperty(exports,"ImageBubbleStyle",{enumerable:!0,get:function(){return o.ImageBubbleStyle}}),Object.defineProperty(exports,"InputStyle",{enumerable:!0,get:function(){return o.InputStyle}}),Object.defineProperty(exports,"JoinGroupStyle",{enumerable:!0,get:function(){return o.JoinGroupStyle}}),Object.defineProperty(exports,"LabelStyle",{enumerable:!0,get:function(){return o.LabelStyle}}),Object.defineProperty(exports,"ListItemStyle",{enumerable:!0,get:function(){return o.ListItemStyle}}),Object.defineProperty(exports,"LoaderStyle",{enumerable:!0,get:function(){return o.LoaderStyle}}),Object.defineProperty(exports,"MediaRecorderStyle",{enumerable:!0,get:function(){return o.MediaRecorderStyle}}),Object.defineProperty(exports,"MenuListStyle",{enumerable:!0,get:function(){return o.MenuListStyle}}),Object.defineProperty(exports,"MessageInputStyle",{enumerable:!0,get:function(){return o.MessageInputStyle}}),Object.defineProperty(exports,"ModalStyle",{enumerable:!0,get:function(){return o.ModalStyle}}),Object.defineProperty(exports,"PopoverStyle",{enumerable:!0,get:function(){return o.PopoverStyle}}),Object.defineProperty(exports,"PreviewStyle",{enumerable:!0,get:function(){return o.PreviewStyle}}),Object.defineProperty(exports,"QuickViewStyle",{enumerable:!0,get:function(){return o.QuickViewStyle}}),Object.defineProperty(exports,"RadioButtonStyle",{enumerable:!0,get:function(){return o.RadioButtonStyle}}),Object.defineProperty(exports,"ReceiptStyle",{enumerable:!0,get:function(){return o.ReceiptStyle}}),Object.defineProperty(exports,"SearchInputStyle",{enumerable:!0,get:function(){return o.SearchInputStyle}}),Object.defineProperty(exports,"SingleSelectStyle",{enumerable:!0,get:function(){return o.SingleSelectStyle}}),Object.defineProperty(exports,"TextBubbleStyle",{enumerable:!0,get:function(){return o.TextBubbleStyle}}),Object.defineProperty(exports,"TextInputStyle",{enumerable:!0,get:function(){return o.TextInputStyle}}),Object.defineProperty(exports,"auxiliaryButtonAlignmentEnum",{enumerable:!0,get:function(){return o.auxiliaryButtonAlignmentEnum}}),Object.defineProperty(exports,"layoutType",{enumerable:!0,get:function(){return o.layoutType}}),exports.AIAssistBotDecorator=ct,exports.AIAssistBotExtension=Ct,exports.AIConversationStarterDecorator=yt,exports.AIConversationStarterExtension=wt,exports.AIConversationSummaryDecorator=Ft,exports.AIConversationSummaryExtension=kt,exports.AIExtensionDataSource=Le,exports.AISmartRepliesDecorator=Vt,exports.AISmartRepliesExtension=Gt,exports.CallingExtension=Cn,exports.CallingExtensionDecorator=cn,exports.ChatConfigurator=Be,exports.CollaborativeDocumentConfiguration=class{constructor(e){let{style:t,iconURL:n,optionIconURL:o,optionStyle:r}=e;this.style=t,this.iconURL=n,this.optionIconURL=o,this.optionStyle=r}getDocumentBubbleStyle(){return this.style}getIconURL(){return this.iconURL}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.CollaborativeDocumentExtension=hn,exports.CollaborativeDocumentExtensionDecorator=pn,exports.CollaborativeWhiteBoardExtensionDecorator=xn,exports.CollaborativeWhiteboardConfiguration=class{constructor(e){let{style:t,iconURL:n,optionIconURL:o,optionStyle:r}=e;this.style=t,this.iconURL=n,this.optionIconURL=o,this.optionStyle=r}getWhiteboardBubbleStyle(){return this.style}getIconURL(){return this.iconURL}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.CollaborativeWhiteboardExtension=bn,exports.CometChatAddMembers=Tr,exports.CometChatAvatarView=rl,exports.CometChatBannedMembers=Yr,exports.CometChatButtonView=el,exports.CometChatCallButtons=sn,exports.CometChatCallLogDetails=Ar,exports.CometChatCallLogHistory=Wo,exports.CometChatCallLogParticipants=sr,exports.CometChatCallLogRecordings=hr,exports.CometChatCallLogs=Bo,exports.CometChatCallLogsWithDetails=e=>{const{isMobileView:o,messageText:r,withDetailsStyle:s,callLogDetailsConfiguration:i,callLogsConfiguration:a}={...yr,...e},{theme:l}=t.useContext(U),[c,C]=t.useState(null),g=t.useCallback(e=>{C(e)},[C]),u=t.useCallback(()=>o?{width:"100%",display:c?"none":"block"}:{width:"280px",minWidth:"max(25%, 280px)"},[o,c]),p=t.useCallback(()=>o?{width:"100%",display:c?"block":"none"}:{width:"calc(100% - 280px)"},[o,c]),h=t.useCallback(()=>{C(null)},[C]);return function(e,n,o,r,s){t.useEffect(()=>{if(e.callLogDetailsStyle={...e.callLogDetailsStyle,border:`1px solid ${s?.palette?.getAccent100()}`},r){const t=()=>{o(null)};e.onBackClick=t}},[e,r,o]),t.useEffect(()=>{n.callLogsStyle={...n.callLogsStyle,border:`1px solid ${s?.palette?.getAccent100()}`}},[n])}(i,a,C,o,l),d.jsxs("div",{style:xr(l,s),children:[d.jsx("div",{style:u(),children:d.jsx(Bo,{title:n.localize("CALLS"),onInfoClick:a?.onInfoClick||g,activeCall:c,titleAlignment:a?.titleAlignment,listItemView:a?.listItemView,subtitleView:a?.subtitleView,tailView:a?.tailView,emptyStateView:a?.emptyStateView,errorStateView:a?.errorStateView,loadingIconURL:a?.loadingIconURL,loadingStateView:a?.loadingStateView,callLogRequestBuilder:a?.callLogRequestBuilder,onItemClick:a?.onItemClick||void 0,onError:a?.onError||void 0,listItemStyle:a?.listItemStyle,infoIconUrl:a?.infoIconUrl,datePattern:a?.datePattern,dateSeparatorPattern:a?.dateSeparatorPattern,incomingAudioCallIconUrl:a?.incomingAudioCallIconUrl,incomingVideoCallIconUrl:a?.incomingVideoCallIconUrl,outgoingAudioCallIconUrl:a?.outgoingAudioCallIconUrl,outgoingVideoCallIconUrl:a?.outgoingVideoCallIconUrl,missedAudioCallIconUrl:a?.missedAudioCallIconUrl,missedVideoCallIconUrl:a?.missedVideoCallIconUrl,callLogsStyle:a?.callLogsStyle,avatarStyle:a?.avatarStyle,hideSeparator:a?.hideSeparator,outgoingCallConfiguration:a?.outgoingCallConfiguration})}),d.jsx("div",{style:p(),children:c?d.jsx(Ar,{title:n.localize("CALL_DETAIL"),call:c,onBackClick:()=>i?.onBackClick||h,backIconUrl:i?.backIconUrl,avatarStyle:i?.avatarStyle,data:i?.data||void 0,callLogHistoryConfiguration:i?.callLogHistoryConfiguration,callLogParticipantsConfiguration:i?.callLogParticipantsConfiguration,callLogRecordingsConfiguration:i?.callLogRecordingsConfiguration,callLogDetailsStyle:i?.callLogDetailsStyle}):d.jsx("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",width:"100%"},children:d.jsx("cometchat-label",{text:r,labelStyle:JSON.stringify(br(l,s))})})})]})},exports.CometChatContacts=ii,exports.CometChatConversations=bs,exports.CometChatConversationsWithMessages=e=>{const{theme:o}=t.useContext(U),{user:i,group:a,isMobileView:l,messageText:c,conversationsWithMessagesStyle:C,messagesConfiguration:g,conversationsConfiguration:u,startConversationConfiguration:p,onError:h,startConversationIconURL:m}={...Zl,...e},[b,y]=t.useState(null),[w,f]=t.useState(null),[D,E]=t.useState(i??null),[v,I]=t.useState(a??null),[S,F]=t.useState(!1),k=t.useRef(null),T=x(h);k.current=w;const[M,B]=A(null),L=t.useCallback(async()=>{try{let e=D?n.CometChatUIKitConstants.MessageReceiverType.user:n.CometChatUIKitConstants.MessageReceiverType.group,t=D?D?.getUid():v?.getGuid();"string"==typeof t&&f(await s.CometChat.getConversation(t,e))}catch(e){T(e)}},[D,v,f,T]),R=()=>{E(null),I(null),f(null)},P=e=>{try{if(k.current=e,f(e),e.getConversationType()&&e.getConversationType()===n.CometChatUIKitConstants.MessageReceiverType.user)I(null),E(e.getConversationWith());else{if(!e.getConversationType()||e.getConversationType()!==n.CometChatUIKitConstants.MessageReceiverType.group)return;E(null),I(e.getConversationWith())}}catch(e){T(e)}},O=t.useCallback((e,t,n)=>{const o=k.current,r=b||n,i=r?.getUid()===t.getUid(),a=e.getActionFor()instanceof s.CometChat.Group;if(i&&o&&o.getConversationWith()instanceof s.CometChat.Group){let t=o.getConversationWith();if(a){e.getActionFor().getGuid()===t.getGuid()&&(f(null),I(null),E(null))}}},[b,y,D,v,k]),j=t.useCallback(e=>{try{const t=e.getConversationType(),o=e.getConversationWith();if(t===n.CometChatUIKitConstants.MessageReceiverType.user&&D&&D.getUid()===o.getUid())E(null);else{if(t!==n.CometChatUIKitConstants.MessageReceiverType.group||!v||v.getGuid()!==o.getGuid())return;I(null)}}catch(e){T(e)}},[v,I,D,E,T]),V=t.useCallback(()=>{try{const e=n.CometChatConversationEvents.ccConversationDeleted.subscribe(e=>{j(e)}),t=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{v&&v.getGuid()===e.getGuid()&&(f(null),I(null))}),o=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{v&&v.getGuid()===e?.userAddedIn.getGuid()&&I(e?.userAddedIn)}),i=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{v&&v.getGuid()===e?.kickedFrom.getGuid()&&I(e?.kickedFrom)}),a=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{v&&v.getGuid()===e?.joinedGroup.getGuid()&&I(e?.joinedGroup)}),l=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{v&&v.getGuid()===e?.kickedFrom.getGuid()&&I(e?.kickedFrom)}),c=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{v&&v.getGuid()===e?.group.getGuid()&&(I(e?.group),f(t=>{if(t){let n=r.CometChatUIKitUtility.clone(t);return n.setConversationWith(e?.group),n}return t}))}),C=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{v&&v.getGuid()===e?.leftGroup.getGuid()&&b?.getUid()===e?.userLeft?.getUid()&&(I(null),f(null))}),d=n.CometChatUIEvents.ccOpenChat.subscribe(e=>{const t=e.user?.getUid();t&&s.CometChat.getConversation(t,n.CometChatUIKitConstants.MessageReceiverType.user).then(e=>{P(e)})});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe(),i?.unsubscribe(),a?.unsubscribe(),l?.unsubscribe(),c?.unsubscribe(),C?.unsubscribe(),d?.unsubscribe()}catch(e){T(e)}}}catch(e){T(e)}},[v,f,I,j,T,b]),G=()=>F(!1),H=S?null:d.jsx("cometchat-button",{ref:B,iconURL:m,buttonStyle:JSON.stringify(Gs(S,o)),children:" "}),Q=(e,t)=>{e?(I(null),E(e),G()):t&&(E(null),I(t),G())};return function(e,n,o,r,i,a,l,c,C,d,g,u,p,h){t.useEffect(()=>{let e;s.CometChat.getLoggedinUser().then(t=>(h&&(e=h(t)),n(t),()=>{e&&e()}),e=>{r(e)})},[n,r]),t.useEffect(()=>{let t;return e&&(t=o(),i()),()=>{t?.()}},[e,a,l,i,o]),t.useEffect(()=>{if(!c)return;async function e(){d?g():C()}const t="cc-button-clicked";return c.addEventListener(t,e),()=>{c.removeEventListener(t,e)}},[c,C,g,d]),t.useEffect(()=>{u(a)},[a,u]),t.useEffect(()=>{p(l)},[l,p])}(b,y,V,T,L,i,a,M,()=>F(!0),S,G,E,I,e=>{const t="ConversationWithMessages_Group_"+String(Date.now());return s.CometChat.addGroupListener(t,new s.CometChat.GroupListener({onGroupMemberKicked:(t,n)=>{O(t,n,e)},onGroupMemberBanned:(t,n)=>{O(t,n,e)}})),()=>s.CometChat.removeGroupListener(t)}),d.jsxs("div",{className:"cc-conversations-with-messages__wrapper",style:Is(C,o),children:[d.jsx("div",{className:"cc-conversations-with-messages__sidebar",style:Ss(C,o,l,D,v),children:d.jsx(bs,{activeConversation:w??void 0,onItemClick:u?.onItemClick||P,conversationsStyle:Us(u),subtitleView:u?.subtitleView,options:u?.options??void 0,disableUsersPresence:u?.disableUsersPresence,disableReceipt:u?.disableReceipt,hideReceipt:u?.hideReceipt,disableTyping:u?.disableTyping,deliveredIcon:u?.deliveredIcon,readIcon:u?.readIcon,waitIcon:u?.waitIcon,errorIcon:u?.errorIcon,datePattern:u?.datePattern,receiptStyle:u?.receiptStyle,sentIcon:u?.sentIcon,privateGroupIcon:u?.privateGroupIcon,protectedGroupIcon:u?.protectedGroupIcon,passwordGroupIcon:u?.passwordGroupIcon,customSoundForMessages:u?.customSoundForMessages,conversationsRequestBuilder:u?.conversationsRequestBuilder,emptyStateView:u?.emptyStateView,onSelect:u?.onSelect,loadingIconURL:u?.loadingIconURL,errorStateView:u?.errorStateView,loadingStateView:u?.loadingStateView,titleAlignment:u?.titleAlignment,listItemView:u?.listItemView,menus:u?.menu||H,hideSeparator:u?.hideSeparator,hideError:u?.hideError,selectionMode:u?.selectionMode,disableSoundForMessages:u?.disableSoundForMessages,deleteConversationDialogStyle:u?.deleteConversationDialogStyle,avatarStyle:u?.avatarStyle,statusIndicatorStyle:u?.statusIndicatorStyle,badgeStyle:u?.badgeStyle,dateStyle:u?.dateStyle,listItemStyle:u?.listItemStyle,backdropStyle:Vs(C,u),disableMentions:u?.disableMentions,textFormatters:u?.textFormatters})}),S||!D&&!v?null:d.jsx("div",{className:"cc-conversations-with-messages__main",style:Ts(C,l,D,v),children:d.jsx(Wl,{auxiliaryMenu:g?.messageHeaderConfiguration.menu,user:D??void 0,group:v??void 0,messageHeaderConfiguration:{...g?.messageHeaderConfiguration,onBack:g?.messageHeaderConfiguration?.onBack||R,hideBackButton:!l,messageHeaderStyle:{...Rs(C,g,l),...g?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:g?.messageListConfiguration,messageComposerConfiguration:{...g?.messageComposerConfiguration,messageComposerStyle:{...Ps(C,g,l),...g?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:Os(g?.messagesStyle,C),customSoundForIncomingMessages:g?.customSoundForIncomingMessages,customSoundForOutgoingMessages:g?.customSoundForOutgoingMessages,detailsConfiguration:g?.detailsConfiguration,disableSoundForMessages:g?.disableSoundForMessages,disableTyping:g?.disableTyping,hideMessageComposer:g?.hideMessageComposer,hideMessageHeader:g?.hideMessageHeader,messageComposerView:g?.messageComposerView?g?.messageComposerView(D,v):null,messageHeaderView:g?.messageHeaderView?g?.messageHeaderView(D,v):null,messageListView:g?.messageListView?g?.messageListView(D,v):null,hideDetails:g?.hideDetails,threadedMessagesConfiguration:g?.threadedMessageConfiguration})}),S||D||v?null:(()=>{const e=c||n.localize("NO_CHATS_SELECTED");return d.jsx("div",{className:"cc-decorator-message--empty",style:js(l,D,v),children:d.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(Ls(C,o))})})})(),S&&d.jsx(ii,{title:n.localize("NEW_CHAT"),usersTabTitle:n.localize("USERS"),groupsTabTitle:n.localize("GROUPS"),closeIconURL:p?.closeIconURL?p?.closeIconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FClose%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FClose%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%285.000000%2C%205.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2214%22%20y2%3D%2214%22%20id%3D%22Path-9%22%20transform%3D%22translate%287.000000%2C%207.000000%29%20scale%28-1%2C%201%29%20translate%28-7.000000%2C%20-7.000000%29%20%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",onItemClick:Q,onClose:p?.onClose?p?.onClose:G,tabVisibility:p?.tabVisibility,usersConfiguration:p?.usersConfiguration,groupsConfiguration:p?.groupsConfiguration,contactsStyle:p?.contactsStyle,hideSubmitButton:p?.hideSubmitButton,selectionLimit:p?.selectionLimit,selectionMode:p?.selectionMode,onSubmitButtonClick:p?.onSubmitButtonClick})]})},exports.CometChatDateView=tl,exports.CometChatDetails=Zi,exports.CometChatEmojiKeyboardView=qa,exports.CometChatGroupMembers=he,exports.CometChatGroups=ri,exports.CometChatGroupsWithMessages=e=>{const{theme:r}=t.useContext(U),{group:i,isMobileView:a,messageText:l,groupsWithMessagesStyle:c,messagesConfiguration:C,groupsConfiguration:g,createGroupConfiguration:u,joinGroupConfiguration:p,onError:h}={...Ec,...e},m=u?.createClick,b=p?.onError,y=p?.joinClick,[w,f]=t.useState(null),[D,E]=A(null),[v,I]=A(null),S=t.useRef(null),[F,k]=t.useState(!1),[T,M]=t.useState(!1),B=t.useRef(void 0),[L,R]=t.useState(i??void 0),[P,O]=t.useState(null),j=x(h),V=ye({tagName:"cometchat-join-group",elementClass:o.CometChatJoinGroup,react:t,events:{ccCloseClicked:"cc-close-clicked"}}),G=t.useCallback(()=>{k(!1)},[]),H=()=>{B.current=void 0,M(!1)},Q=e=>{try{if(O(null),M(!1),e.getHasJoined())return void R(e);if(e.getType()===n.CometChatUIKitConstants.GroupTypes.password)return R(void 0),B.current=e,void M(!0);s.CometChat.joinGroup(e).then(e=>{n.CometChatGroupEvents.ccGroupMemberJoined.next({joinedUser:w,joinedGroup:e}),R(e)},e=>{j(e)})}catch(e){j(e)}},N=t.useCallback(e=>{try{let t=e?.detail?.response;M(!1),B.current=void 0,t&&R(t)}catch(e){j(e)}},[R,B,M,j]),K=t.useCallback(()=>{try{const e=n.CometChatGroupEvents.ccGroupDeleted.subscribe(e=>{L&&L.getGuid()===e.getGuid()&&R(void 0)}),t=n.CometChatGroupEvents.ccGroupCreated.subscribe(e=>{e&&(R(e),k(!1))}),o=n.CometChatGroupEvents.ccGroupMemberAdded.subscribe(e=>{L&&L.getGuid()===e?.userAddedIn.getGuid()&&(R(e?.userAddedIn),k(!1))}),r=n.CometChatGroupEvents.ccGroupMemberBanned.subscribe(e=>{L&&L.getGuid()===e?.kickedFrom.getGuid()&&R(e?.kickedFrom)}),s=n.CometChatGroupEvents.ccGroupMemberJoined.subscribe(e=>{B.current&&B.current.getGuid()===e?.joinedGroup.getGuid()&&(H(),R(e?.joinedGroup))}),i=n.CometChatGroupEvents.ccGroupMemberKicked.subscribe(e=>{L&&L.getGuid()===e?.kickedFrom.getGuid()&&R(e?.kickedFrom)}),a=n.CometChatGroupEvents.ccOwnershipChanged.subscribe(e=>{L&&L.getGuid()===e?.group.getGuid()&&R(e?.group)}),l=n.CometChatGroupEvents.ccGroupLeft.subscribe(e=>{L&&L.getGuid()===e?.leftGroup.getGuid()&&w?.getUid()===e?.userLeft?.getUid()&&R(void 0)}),c=n.CometChatUIEvents.ccOpenChat.subscribe(e=>{const t=e.user;t&&(R(void 0),O(t))});return()=>{e.unsubscribe(),o.unsubscribe(),r.unsubscribe(),s.unsubscribe(),i.unsubscribe(),a.unsubscribe(),l.unsubscribe(),t.unsubscribe(),c.unsubscribe()}}catch(e){j(e)}},[L,R,B,O,k,j,w]),z=t.useCallback(e=>{if(!a)return null;let t=p?.messageHeaderConfiguration;return d.jsx("div",{slot:"headerView",style:{position:"absolute",top:"0",left:"0"},children:d.jsx(Za,{group:e,subtitleView:t?.subtitleView?t?.subtitleView(null,e):null,disableUsersPresence:t?.disableUsersPresence,protectedGroupIcon:t?.protectedGroupIcon,passwordGroupIcon:t?.passwordGroupIcon,privateGroupIcon:t?.privateGroupIcon,menu:t?.menu,messageHeaderStyle:Ac(c,t,r),backButtonIconURL:t?.backButtonIconURL,hideBackButton:t?.hideBackButton||!1,onError:t?.onError,onBack:t?.onBack||H,listItemStyle:xc(t,r),statusIndicatorStyle:t?.statusIndicatorStyle,avatarStyle:t?.avatarStyle})})},[c,a,p?.messageHeaderConfiguration,r]),J=()=>d.jsx(Dc,{createGroupStyle:wc(u,r,a),closeButtonIconURL:u?.closeButtonIconURL,ref:E,hideCloseButton:u?.hideCloseButton||!1});const Y=t.useCallback(()=>d.jsx("cometchat-icon-button",{iconURL:"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2224px%22%20height%3D%2224px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FPlus%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FPlus%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%229%22%20y1%3D%220%22%20x2%3D%229%22%20y2%3D%2218%22%20id%3D%22Path-10%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cline%20x1%3D%220%22%20y1%3D%229%22%20x2%3D%2218%22%20y2%3D%229%22%20id%3D%22Path-11%22%3E%3C%2Fline%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E",hoverText:n.localize("CREATE_GROUP"),buttonStyle:JSON.stringify(fc(r)),ref:S}),[r]);return function(e,n,o,r,i,a,l,c,C,d,g,u,p,h,m,A,x,b,y){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{n(e)},e=>{r(e)})},[n,r]),t.useEffect(()=>{if(e)return o()},[e,o]),t.useEffect(()=>{const e=u.current;if(!e)return;const t=()=>{p()};return e.addEventListener("cc-button-clicked",t),()=>{e.removeEventListener("cc-button-clicked",t)}},[p,u]),t.useEffect(()=>{i?(C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.hideBackButton=!1),a?.messageHeaderConfiguration&&(a.messageHeaderConfiguration.hideBackButton=!1)):(C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.hideBackButton=!0),a?.messageHeaderConfiguration&&(a.messageHeaderConfiguration.hideBackButton=!0))},[i,a,C]),t.useEffect(()=>{c(l)},[l,c]),t.useEffect(()=>{C?.messageHeaderConfiguration?.onBack||C?.messageHeaderConfiguration&&(C.messageHeaderConfiguration.onBack=d)},[C,d]),t.useEffect(()=>{if(!m)return;const e="cc-joingroup-joined",t=e=>A(e);return m.addEventListener(e,t),()=>{m.removeEventListener(e,t)}},[m,A]),t.useEffect(()=>{if(!g)return;const e="cc-creategroup-close-clicked",t=()=>h();return g.addEventListener(e,t),()=>{g.removeEventListener(e,t)}},[g,h]),t.useEffect(()=>{if(g)return x?(g.createClick=x,()=>{g.createClick=null}):void 0},[x,g]),t.useEffect(()=>{if(m)return y?(m.joinClick=y,()=>{m.joinClick=null}):void 0},[y,m]),t.useEffect(()=>{if(m)return b?(m.onError=b,()=>{m.onError=null}):void 0},[b,m])}(w,f,K,j,a,p,i,R,C,()=>{O(null),R(void 0)},D,S,()=>k(!0),G,v,N,m,b,y),d.jsx(d.Fragment,{children:d.jsxs("div",{className:"cc-groups-with-messages__wrapper",style:oc(c,r),children:[d.jsx("div",{className:"cc-groups-with-messages__sidebar",style:rc(c,r,a,L),children:d.jsx(ri,{activeGroup:L??void 0,hideSearch:g?.hideSearch,searchIconURL:g?.searchIconURL,searchRequestBuilder:g?.searchRequestBuilder,onItemClick:g?.onItemClick||Q,groupsStyle:dc(g),subtitleView:g?.subtitleView,options:g?.options??void 0,privateGroupIcon:g?.privateGroupIcon,passwordGroupIcon:g?.passwordGroupIcon,groupsRequestBuilder:g?.groupsRequestBuilder,emptyStateView:g?.emptyStateView,onSelect:g?.onSelect,loadingIconURL:g?.loadingIconURL,errorStateView:g?.errorStateView,loadingStateView:g?.loadingStateView,titleAlignment:g?.titleAlignment,listItemView:g?.listItemView,menus:g?.menu||Y(),hideSeparator:g?.hideSeparator,hideError:g?.hideError,selectionMode:g?.selectionMode,listItemStyle:g?.listItemStyle,avatarStyle:g?.avatarStyle,statusIndicatorStyle:g?.statusIndicatorStyle})}),L||P?d.jsx("div",{className:"cc-groups-with-messages__main",style:ac(c,a,L),children:d.jsx(Wl,{user:P||void 0,group:L||void 0,messageHeaderConfiguration:{...C?.messageHeaderConfiguration,onBack:C?.messageHeaderConfiguration?.onBack||H,hideBackButton:C?.messageHeaderConfiguration?.hideBackButton||!a,messageHeaderStyle:{...gc(c,C,a),...C?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:C?.messageListConfiguration,messageComposerConfiguration:{...C?.messageComposerConfiguration,messageComposerStyle:{...uc(c,C,a),...C?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:(_=C?.messagesStyle,W=c,{background:W?.background,..._}),customSoundForIncomingMessages:C?.customSoundForIncomingMessages,customSoundForOutgoingMessages:C?.customSoundForOutgoingMessages,detailsConfiguration:C?.detailsConfiguration,disableSoundForMessages:C?.disableSoundForMessages,disableTyping:C?.disableTyping,hideMessageComposer:C?.hideMessageComposer,hideMessageHeader:C?.hideMessageHeader,messageComposerView:C?.messageComposerView?C?.messageComposerView(P,L):null,messageHeaderView:C?.messageHeaderView?C?.messageHeaderView(P,L):null,messageListView:C?.messageListView?C?.messageListView(P,L):null,hideDetails:C?.hideDetails,threadedMessagesConfiguration:C?.threadedMessageConfiguration})}):null,L||P||T||B.current?null:(()=>{const e=l||n.localize("SELECT__GROUP");return d.jsx("div",{className:"cc-decorator-message--empty",style:pc(a,L),children:d.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(Cc(c,r))})})})(),T&&!P&&!L&&B.current?d.jsx("div",{className:"cc-withmessages__joingroup",style:hc(a),children:d.jsx(V,{group:B.current,joinGroupStyle:mc(p,r),children:z(B.current)})}):null,F?a?d.jsx("div",{className:"cc-withmessages__creategroup",style:yc(a),children:J()}):d.jsx("cometchat-backdrop",{backdropStyle:JSON.stringify(bc(c)),children:J()}):null]})});var _,W},exports.CometChatIconButtonView=$a,exports.CometChatIncomingCall=e=>{const{call:i,disableSoundForCalls:a=!1,customSoundForCalls:l="",onAccept:c,onDecline:C,acceptButtonText:g=n.localize("ACCEPT"),declineButtonText:u=n.localize("DECLINE"),subtitleView:p=null,listItemStyle:h={height:"100%",width:"100%"},avatarStyle:m={borderRadius:"16px",width:"38px",height:"38px"},incomingCallStyle:A={width:"fit-content",height:"fit-content"},onError:x=e=>{console.log(e)},ongoingCallConfiguration:b}=e,{theme:y}=t.useContext(U),[w,f]=t.useState(null),[D,E]=t.useState(!1),[v,I]=t.useState(!1),[S,F]=t.useState(!1),k=t.useRef(null),T=t.useRef(null),M=t.useRef(null),B=t.useRef(null),L=t.useRef(""),R=t.useRef(null),P=t.useRef(null);T.current={...po(y),...m},M.current={...ho(y),...A},k.current={...mo(M?.current,y),...h};const O=t.useRef({});O.current=(e=>({border:e?.acceptButtonBorder,borderRadius:e?.acceptButtonBorderRadius,background:e?.acceptButtonBackground,buttonTextFont:e?.acceptButtonTextFont,buttonTextColor:e?.acceptButtonTextColor,...uo}))(M?.current);const j=t.useRef({});j.current=(e=>({border:e?.declineButtonBorder,borderRadius:e?.declineButtonBorderRadius,background:e?.declineButtonBackground,buttonTextFont:e?.declineButtonTextFont,buttonTextColor:e?.declineButtonTextColor,...uo}))(M?.current);const V=t.useRef({});V.current=((e,t)=>new o.CallscreenStyle({maxHeight:e?.maxHeight||"100%",maxWidth:e?.maxWidth||"100%",border:e?.border||"none",borderRadius:e?.borderRadius||"0",background:e?.background||"#1c2226",minHeight:e?.minHeight||"400px",minWidth:e?.minWidth||"400px",minimizeIconTint:e?.minimizeIconTint||t.palette.getAccent900(),maximizeIconTint:e?.maximizeIconTint||t.palette.getAccent900()}))(b?.ongoingCallStyle,y);const G=t.useCallback(()=>V.current,[]),H=t.useRef(null);H.current=(e=>({height:"16px",width:"16px",iconTint:e?.subtitleTextColor||"RGBA(20, 20, 20, 0.68)"}))(M?.current);let Q="incomingcall_"+(new Date).getTime(),N=n.localize("INCOMING_CALL");const K=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)x(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);x(n)}},[x]),z=t.useCallback(()=>{try{l?r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall,l):r.CometChatSoundManager.play(r.CometChatSoundManager.Sound.incomingCall)}catch(e){K(e)}},[l,K]),J=t.useCallback(e=>{let t=!1;try{if(r.StorageUtils.getItem(n.CometChatUIKitConstants.calls.activecall)){let o=r.StorageUtils.getItem(n.CometChatUIKitConstants.calls.activecall);t=!(!o||o.sessionId!==e.getSessionId())}else t=!1;return t}catch(e){return K(e),t}},[K]),Y=t.useCallback((e=n.CometChatUIKitConstants.calls.rejected)=>{try{r.CometChatSoundManager.pause(),C?C():"string"==typeof B?.current?.getSessionId()&&s.CometChat.rejectCall(B?.current?.getSessionId(),e).then(e=>{r.StorageUtils.setItem(n.CometChatUIKitConstants.calls.activecall,e),n.CometChatCallEvents.ccCallRejected.next(e),E(!1),B.current=null},e=>{K(e)})}catch(e){K(e)}},[C,K]),_=t.useCallback(e=>{try{if(!J(e)&&w?.getUid()!==e?.getSender()?.getUid()&&B.current)a||v||S||setTimeout(()=>{z()},100),v||S?(v||S)&&(r.CometChatSoundManager.pause(),Y(n.CometChatUIKitConstants.calls.busy),n.CometChatCallEvents.ccCallRejected.next(e)):E(!0);else{if(w?.getUid()===e?.getSender()?.getUid())return void r.CometChatSoundManager.pause();r.CometChatSoundManager.pause(),Y(n.CometChatUIKitConstants.calls.busy)}}catch(e){K(e)}},[J,a,z,Y,K,w,v,S]),W=t.useCallback(e=>{if(e?.key===n.CometChatUIKitConstants.calls.activecall&&(e.newValue||e.oldValue)){let t;e.newValue?t=JSON.parse(e.newValue):e.oldValue&&(t=JSON.parse(e.oldValue)),B.current?.getSessionId()===t?.sessionId&&(r.CometChatSoundManager.pause(),B.current=null,E(!1))}},[]),Z=()=>{I(!1),F(!1),B.current=null,L.current=""},X=t.useCallback(()=>{try{const e=n.CometChatCallEvents.ccCallEnded.subscribe(e=>{Z()}),t=n.CometChatCallEvents.ccOutgoingCall.subscribe(()=>{F(!0)}),o=n.CometChatCallEvents.ccCallRejected.subscribe(()=>{I(!1),F(!1)});return()=>{try{e?.unsubscribe(),t?.unsubscribe(),o?.unsubscribe()}catch(e){K(e)}}}catch(e){K(e)}},[K]),q=t.useCallback(()=>{try{r.StorageUtils.attachChangeDetection(W),s.CometChat.addCallListener(Q,new s.CometChat.CallListener({onIncomingCallReceived:e=>{B.current?.getSender()?.getUid()!==e.getSender()?.getUid()&&(B.current=e,_(e))},onIncomingCallCancelled:e=>{r.CometChatSoundManager.pause(),B.current=null,E(!1)},onOutgoingCallAccepted:e=>{r.CometChatSoundManager.pause(),e.getSender()?.getUid()===w?.getUid()&&(B.current=null,E(!1))},onOutgoingCallRejected:e=>{r.CometChatSoundManager.pause(),B.current=null,F(!1),I(!1),E(!1)}}))}catch(e){K(e)}},[W,_,K,Q,w]),$=t.useCallback(()=>{try{r.StorageUtils.detachChangeDetection(W),s.CometChat.removeCallListener(Q)}catch(e){K(e)}},[W,K,Q]),ee=t.useCallback(()=>{try{let e=s.CometChat.getActiveCall();return new Promise((t,n)=>{if(!e)return t({success:!0});let o=e?.getSessionId();s.CometChat.endCall(o).then(e=>t(e),e=>n(e))})}catch(e){K(e)}},[K]),te=t.useCallback(()=>{try{r.CometChatSoundManager.pause(),c?c():ee()?.then(e=>{s.CometChat.acceptCall(B.current.getSessionId()).then(e=>{n.CometChatCallEvents.ccCallAccepted.next(e),r.StorageUtils.setItem(n.CometChatUIKitConstants.calls.activecall,e),I(!0),B.current=e,L.current=e?.getSessionId(),E(!1)},e=>{K(e)})},e=>{K(e)})}catch(e){}},[ee,K,c]);return function(e,o,r,i,a,l,c,C,d,g,u,p,h){t.useEffect(()=>{s.CometChat.getLoggedinUser().then(e=>{e&&o(e)})},[o]),t.useEffect(()=>{let t;return e&&(t=i(),a()),()=>{l(),t?.()}},[e,a,l,i]),t.useEffect(()=>{r&&(g.current=r,d(g.current))},[r,g,d]),t.useEffect(()=>{const e=c?.current,t=C?.current;if(!e&&!t)return;const o=()=>{u()},r=()=>{p(n.CometChatUIKitConstants.calls.rejected)};return h?(e?.addEventListener("cc-button-clicked",o),t?.addEventListener("cc-button-clicked",r)):(e?.removeEventListener("cc-button-clicked",o),t?.removeEventListener("cc-button-clicked",r)),()=>{e?.removeEventListener("cc-button-clicked",o),t?.removeEventListener("cc-button-clicked",r)}},[h,u,p,c,C])}(w,f,i,X,q,$,P,R,_,B,te,Y,D),d.jsxs(d.Fragment,{children:[B.current&&D?d.jsxs("div",{className:"cc-incomingcall__wrapper",style:io(M?.current),children:[d.jsx("div",{className:"cc-incomingcall__listitem",style:co,children:d.jsxs("cometchat-list-item",{title:B.current?.getSender()?.getName(),listItemStyle:JSON.stringify(k.current),hideSeparator:!0,children:[p?d.jsx("div",{slot:"subtitleView",className:"cc-incomingcall__subtitleview",children:p}):d.jsxs("div",{slot:"subtitleView",className:"cc-incomingcall__subtitleview",style:ao,children:[d.jsx("div",{className:"cc-call__icon",children:d.jsx("cometchat-icon",{iconStyle:JSON.stringify(H.current),URL:B.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio?"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FCall%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FCall%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22streamline-icon-phone-actions-voice-mail%4024x24%22%20transform%3D%22translate%283.000000%2C%203.000000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0.0679824131%2C6.18726899%20L1.15322891%2C7.27252708%20C1.71745406%2C7.8368527%202.48276427%2C8.15389548%203.28076591%2C8.15389548%20C4.07876755%2C8.15389548%204.84407776%2C7.8368527%205.40830291%2C7.27252708%20L7.00415829%2C5.67746515%20C7.28631808%2C5.39534955%207.44483777%2C5.01269036%207.44483777%2C4.61368527%20C7.44483777%2C4.21468018%207.28631808%2C3.83202099%207.00415829%2C3.5499054%20L3.90079098%2C0.446504908%20C3.59388219%2C0.136593264%203.16773676%2C-0.025114152%202.73249452%2C0.00317689658%20C2.29725227%2C0.0314679452%201.89562592%2C0.246981102%201.63141818%2C0.594015717%20C-1.61783738%2C5.00961401%200.349222543%2C9.660257%204.34493966%2C13.6552063%20C8.34065677%2C17.6501557%2012.9904395%2C19.6180471%2017.4059906%2C16.3687568%20C17.7530215%2C16.1045463%2017.9685324%2C15.7029156%2017.9968231%2C15.2676687%20C18.0251139%2C14.8324218%2017.8634082%2C14.4062718%2017.5534999%2C14.0993598%20L14.450943%2C10.9959593%20C14.1688305%2C10.7137965%2013.7861754%2C10.5552751%2013.3871745%2C10.5552751%20C12.9881737%2C10.5552751%2012.6055186%2C10.7137965%2012.323406%2C10.9959593%20L10.7275507%2C12.5918317%20C10.1632311%2C13.1560629%209.8461917%2C13.9213813%209.8461917%2C14.7193915%20C9.8461917%2C15.5174016%2010.1632311%2C16.28272%2010.7275507%2C16.8469512%20L11.8249545%2C17.9443668%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E":"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%2024%2024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%3E%20%20%20%20%3Ctitle%3EIcons%2F24%2FVideo%402x%3C%2Ftitle%3E%20%20%20%20%3Cg%20id%3D%22Icons%22%20stroke%3D%22none%22%20stroke-width%3D%221%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Icons%2F24%2FVideo%22%20stroke%3D%22%23000000%22%20stroke-width%3D%221.5%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cg%20id%3D%22Group%22%20transform%3D%22translate%282.000000%2C%206.500000%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M1.79471961%2C-7.25088203e-17%20L11.9552804%2C7.25088203e-17%20C12.5793435%2C-4.21297127e-17%2012.8056439%2C0.0649779267%2013.033792%2C0.186992889%20C13.2619401%2C0.309007852%2013.4409921%2C0.488059851%2013.5630071%2C0.716207995%20C13.6850221%2C0.94435614%2013.75%2C1.1706565%2013.75%2C1.79471961%20L13.75%2C9.20528039%20C13.75%2C9.8293435%2013.6850221%2C10.0556439%2013.5630071%2C10.283792%20C13.4409921%2C10.5119401%2013.2619401%2C10.6909921%2013.033792%2C10.8130071%20C12.8056439%2C10.9350221%2012.5793435%2C11%2011.9552804%2C11%20L1.79471961%2C11%20C1.1706565%2C11%200.94435614%2C10.9350221%200.716207995%2C10.8130071%20C0.488059851%2C10.6909921%200.309007852%2C10.5119401%200.186992889%2C10.283792%20C0.0649779267%2C10.0556439%209.39485689e-17%2C9.8293435%20-1.61693481e-16%2C9.20528039%20L4.83392135e-17%2C1.79471961%20C-2.80864751e-17%2C1.1706565%200.0649779267%2C0.94435614%200.186992889%2C0.716207995%20C0.309007852%2C0.488059851%200.488059851%2C0.309007852%200.716207995%2C0.186992889%20C0.94435614%2C0.0649779267%201.1706565%2C4.21297127e-17%201.79471961%2C-7.25088203e-17%20Z%22%20id%3D%22Rectangle%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M17.2599167%2C8.63041667%20L19.6304167%2C9.81475%20C19.8435282%2C9.92114296%2020.096526%2C9.90964554%2020.299109%2C9.78436146%20C20.5016921%2C9.65907738%2020.625%2C9.43785985%2020.625%2C9.19966667%20L20.625%2C1.80033333%20C20.625%2C1.56214015%2020.5016921%2C1.34092262%2020.299109%2C1.21563854%20C20.096526%2C1.09035446%2019.8435282%2C1.07885704%2019.6304167%2C1.18525%20L17.2599167%2C2.36958333%20C16.7940465%2C2.60259636%2016.4998441%2C3.07885646%2016.4999999%2C3.59975%20L16.4999999%2C7.40025%20C16.4998441%2C7.92114354%2016.7940465%2C8.39740364%2017.2599167%2C8.63041667%20Z%22%20id%3D%22Path%22%3E%3C%2Fpath%3E%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E"})}),d.jsx("cometchat-label",{className:"cc-call__type",text:N,labelStyle:JSON.stringify(lo(M?.current))})]}),d.jsx("div",{slot:"tailView",className:"cc-incomingcall__tailview",style:Co,children:d.jsx("div",{className:"tail__view",children:d.jsx("div",{className:"cc-incomingcall__avatar",children:d.jsx("cometchat-avatar",{avatarStyle:JSON.stringify(T.current),image:B.current?.getSender()?.getAvatar(),name:B.current?.getSender()?.getName()})})})})]})}),d.jsxs("div",{className:"cc-incomingcall-buttons",style:go,children:[d.jsx("cometchat-button",{ref:R,buttonStyle:JSON.stringify(j.current),text:u}),d.jsx("cometchat-button",{ref:P,buttonStyle:JSON.stringify(O.current),text:g})]})]}):null,v&&B.current&&!D?d.jsx(Qt,{ongoingCallStyle:G(),sessionID:L.current,callSettingsBuilder:function(){let e=B.current?.getType()===n.CometChatUIKitConstants.MessageTypes.audio;const t=b?.callSettingsBuilder(B.current)||(new r.CometChatUIKitCalls.CallSettingsBuilder).enableDefaultLayout(!0).setIsAudioOnlyCall(e);if(B.current?.getType()!==n.CometChatUIKitConstants.calls.meeting)return t.setCallListener(new r.CometChatUIKitCalls.OngoingCallListener({onCallEnded:()=>{B.current?.getReceiverType()===n.CometChatUIKitConstants.MessageReceiverType.user&&s.CometChat.endCall(L.current).then(e=>{r.CometChatUIKitCalls.endSession(),s.CometChat.clearActiveCall(),n.CometChatCallEvents.ccCallEnded.next(null),Z()}).catch(e=>{})},onCallEndButtonPressed:()=>{s.CometChat.endCall(L.current).then(e=>{r.CometChatUIKitCalls.endSession(),n.CometChatCallEvents.ccCallEnded.next(e)}).catch(e=>{})},onError:e=>{K(e)}})),t.build()}(),maximizeIconURL:b?.maximizeIconURL,minimizeIconURL:b?.minimizeIconURL}):null]})},exports.CometChatLabelView=nl,exports.CometChatList=k,exports.CometChatLoaderView=ol,exports.CometChatMessageBubble=W,exports.CometChatMessageComposer=Qa,exports.CometChatMessageHeader=Za,exports.CometChatMessageInformation=Pl,exports.CometChatMessageList=Gl,exports.CometChatMessages=Wl,exports.CometChatOngoingCall=Qt,exports.CometChatOutgoingCall=nn,exports.CometChatReactionsView=Xa,exports.CometChatReceiptView=sl,exports.CometChatTabs=ro,exports.CometChatThemeContext=U,exports.CometChatThreadedMessages=Yl,exports.CometChatTransferOwnership=Yi,exports.CometChatUIKit=Zn,exports.CometChatUserMemberWrapper=me,exports.CometChatUsers=q,exports.CometChatUsersWithMessages=e=>{const{theme:o}=t.useContext(U),{user:r,isMobileView:i,messageText:a,usersWithMessagesStyle:l,messagesConfiguration:c,usersConfiguration:C,onError:g}={...Kc,...e},[u,p]=t.useState(r??void 0),h=()=>p(void 0),m=t.useCallback(e=>{if(e instanceof s.CometChat.CometChatException)g(e);else{let t={code:e?.code,name:e?.name,message:e?.message,details:e?.details},n=new s.CometChat.CometChatException(t);g(n)}},[g]),A=e=>p(e),x=t.useCallback(()=>{try{const e=n.CometChatUserEvents.ccUserBlocked.subscribe(e=>{u&&u.getUid()===e.getUid()&&p(e)}),t=n.CometChatUserEvents.ccUserUnblocked.subscribe(e=>{u&&u.getUid()===e.getUid()&&p(e)});return()=>{try{e?.unsubscribe(),t?.unsubscribe()}catch(e){m(e)}}}catch(e){m(e)}},[u,p,m]);return function(e,n,o){t.useEffect(()=>e(),[e]),t.useEffect(()=>{o(n)},[n,o])}(x,r,p),d.jsxs("div",{className:"cc-users-with-messages__wrapper",style:Mc(l,o),children:[d.jsx("div",{className:"cc-users-with-messages__sidebar",style:Bc(l,o,i,u),children:d.jsx(q,{activeUser:u??void 0,hideSearch:C?.hideSearch,searchIconURL:C?.searchIconURL,searchRequestBuilder:C?.searchRequestBuilder,onItemClick:C?.onItemClick||A,usersStyle:Vc(C),subtitleView:C?.subtitleView,options:C?.options??void 0,usersRequestBuilder:C?.usersRequestBuilder,emptyStateView:C?.emptyStateView,onSelect:C?.onSelect,loadingIconURL:C?.loadingIconURL,errorStateView:C?.errorStateView,loadingStateView:C?.loadingStateView,tileAlignment:C?.titleAlignment,showSectionHeader:C?.showSectionHeader,listItemView:C?.listItemView,menus:C?.menu,hideSeparator:C?.hideSeparator,hideError:C?.hideError,selectionMode:C?.selectionMode,listItemStyle:C?.listItemStyle,disableUsersPresence:C?.disableUsersPresence,statusIndicatorStyle:C?.statusIndicatorStyle,avatarStyle:C?.avatarStyle})}),u?d.jsx("div",{className:"cc-users-with-messages__main",style:Rc(l,i,u),children:d.jsx(Wl,{user:u,messageHeaderConfiguration:{...c?.messageHeaderConfiguration,onBack:c?.messageHeaderConfiguration?.onBack||h,hideBackButton:c?.messageHeaderConfiguration?.hideBackButton||!i,messageHeaderStyle:{...Gc(l,c,i),...c?.messageHeaderConfiguration?.messageHeaderStyle}},messageListConfiguration:{...c?.messageListConfiguration,messageInformationConfiguration:{messageInformationStyle:{...Nc(c,i)}}},messageComposerConfiguration:{...c?.messageComposerConfiguration,messageComposerStyle:{...Hc(l,c,i),...c?.messageComposerConfiguration?.messageComposerStyle}},messagesStyle:(b=c?.messagesStyle,y=l,{background:y?.background,...b}),customSoundForIncomingMessages:c?.customSoundForIncomingMessages,customSoundForOutgoingMessages:c?.customSoundForOutgoingMessages,detailsConfiguration:c?.detailsConfiguration,disableSoundForMessages:c?.disableSoundForMessages,disableTyping:c?.disableTyping,hideMessageComposer:c?.hideMessageComposer,hideMessageHeader:c?.hideMessageHeader,messageComposerView:c?.messageComposerView?c?.messageComposerView(u):void 0,messageHeaderView:c?.messageHeaderView?c?.messageHeaderView(u):void 0,messageListView:c?.messageListView?c?.messageListView(u):void 0,hideDetails:c?.hideDetails,threadedMessagesConfiguration:c?.threadedMessageConfiguration})}):null,d.jsx(d.Fragment,{children:u?null:(()=>{const e=a||n.localize("SELECT__USER");return d.jsx("div",{className:"cc-decorator-message--empty",style:Qc(i,u),children:d.jsx("cometchat-label",{text:e,labelStyle:JSON.stringify(jc(l,o))})})})()})]});var b,y},exports.DataSource=class{},exports.DataSourceDecorator=Ue,exports.ExtensionsDataSource=dn,exports.ImageModerationConfiguration=class{constructor(e){this.style=e.style,this.confirmDialogStyle=e.confirmDialogStyle,this.backDropStyle=e.backDropStyle}getImageModerationStyle(){return this.style}getConfirmDialogSyle(){return this.confirmDialogStyle}getBackDropStyle(){return this.backDropStyle}},exports.ImageModerationExtension=In,exports.ImageModerationExtensionDecorator=vn,exports.LinkPreviewConfiguration=class{constructor(e){this.style=e.style}getLinkPreviewStyle(){return this.style}},exports.LinkPreviewExtension=Tn,exports.LinkPreviewExtensionDecorator=kn,exports.MessageTranslationConfiguration=class{constructor(e){let{style:t,optionIconURL:n,optionStyle:o}=e;this.style=t,this.optionIconURL=n,this.optionStyle=o}getMessageTranslationStyle(){return this.style}getOptionIconURL(){return this.optionIconURL}getOptionStyle(){return this.optionStyle}},exports.MessageTranslationExtension=Un,exports.MessageTranslationExtensionDecorator=Ln,exports.MessagesDataSource=Me,exports.PollsConfiguration=so,exports.PollsExtension=jn,exports.PollsExtensionDecorator=On,exports.SmartRepliesConfiguration=class{constructor(e){this.style=e.style}getSmartRepliesStyle(){return this.style}},exports.SmartReplyExtension=Hn,exports.SmartReplyExtensionDecorator=Gn,exports.StickersConfiguration=class{constructor(e){let{style:t,stickerIconURL:n,closeIconURL:o}=e;this.style=t,this.stickerIconURL=n,this.closeIconURL=o}getStickersStyle(){return this.style}getStickerIconURL(){return this.stickerIconURL}getCloseIconURL(){return this.closeIconURL}},exports.StickersExtension=zn,exports.StickersExtensionDecorator=Kn,exports.TabsStyle=zc,exports.TextModeratorExtension=Yn,exports.TextModeratorExtensionDecorator=Jn,exports.ThumbnailGenerationExtension=Wn,exports.ThumbnailGenerationExtensionDecorator=_n,Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});
17
17
  //# sourceMappingURL=index.js.map