movius-chats 1.3.6 → 1.3.7

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.
@@ -11,5 +11,5 @@
11
11
  object-assign
12
12
  (c) Sindre Sorhus
13
13
  @license MIT
14
- */function pe(){if(ee)return J;ee=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return J=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},J}function ve(){if(re)return te;re=1;return te="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function he(){return oe?ne:(oe=1,ne=Function.call.bind(Object.prototype.hasOwnProperty))}function me(){if(le)return ie;le=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=ve(),r={},n=he();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ie=o}function be(){if(ae)return se;ae=1;var e=ye(),t=pe(),r=ve(),n=he(),o=me(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),se=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(l),arrayOf:function(e){return p((function(t,n,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new y("Invalid "+i+" `"+l+"` of type `"+b(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:p((function(e,t,r,n,o){var i=e[t];return s(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:p((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:p((function(e,t,r,n,o){return m(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,s){if("function"!=typeof e)return new y("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=b(a);if("object"!==u)return new y("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return p((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new y("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,n,o,i,l){var s=t[n],a=b(s);if("object"!==a)return new y("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,s,a){var u=o[i],c=b(u);if("object"!==c)return new y("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(n(e,f)&&"function"!=typeof p)return h(l,s,a,f,x(p));if(!p)return new y("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=p(u,f,l,s,a+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,p){if(u=u||c,f=f||s,p!==r){if(a){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+s;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[s]?o?null===l[s]?new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return p((function(t,r,n,o,i,l){var s=t[r];return b(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new y((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},se}function xe(){if(ce)return ue;ce=1;var e=ve();function t(){}function r(){}return r.resetWarningCache=t,ue=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function ge(){if(de)return X.exports;if(de=1,"production"!==process.env.NODE_ENV){var e=ye();X.exports=be()(e.isElement,true)}else X.exports=xe()();return X.exports}var we,je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,ke,Me,Ve,Re=W(ge()),_e=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),Ne=["type"],ze=["style"],$e=["parse","childrenProps"],Le={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Ue=Re.shape(m(m({},t.Text.propTypes),{},{type:Re.oneOf(Object.keys(Le)).isRequired,nonExhaustiveMaxMatchCount:Re.number})),Fe=Re.shape(m(m({},t.Text.propTypes),{},{pattern:Re.oneOfType([Re.string,Re.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Re.number})),Be=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=b(e,Ne);if(t){if(!Le[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Le[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new _e(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=b(n,ze);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=b(n,$e);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();Be.displayName="ParsedText",Be.propTypes=m(m({},t.Text.propTypes),{},{parse:Re.arrayOf(Re.oneOfType([Ue,Fe])),childrenProps:Re.shape(t.Text.propTypes)}),Be.defaultProps={parse:null,childrenProps:{}};var qe,De,He,We,Ye,Xe,Ze,Ke,Ge,Qe,Je,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,yt,pt,vt,ht,mt,bt,xt,gt,wt=function(o){var l,s,a,u,c=o.message,d=o.onMediaPress,f=o.isVideoPlaying,y=o.isCurrentUser,p=I(),v=p.theme,h=p.showMessageStatus,b=p.CustomPlayIcon,x=p.renderCustomVideoBubbleError,j=n.useRef(null),P=g(n.useState(0),2),S=P[0],C=P[1],O=g(n.useState(!1),2),A=O[0],E=O[1],k=g(n.useState(!1),2),M=k[0],V=k[1];return e.jsxs(t.View,{children:[c.image&&e.jsx(t.Pressable,{onPress:function(){return d("image",c.image)},style:r(we||(we=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:c.image},style:r(je||(je=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),c.video&&e.jsxs(t.Pressable,{onPress:function(){return d("video",c.video)},style:r(Pe||(Pe=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:A,children:[e.jsx(i,{source:{uri:c.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){E(!0),V(!1)},onLoad:function(e){C(e.duration),E(!1)},onBuffer:function(e){var t=e.isBuffering;return E(t)},onError:function(){V(!0),E(!1)}}),A?e.jsx(t.View,{style:r(Se||(Se=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(z,{style:r.style("h-12 w-12"),spinning:!0})}):M?x?x():e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:T(r(Oe||(Oe=w(["text-white font-bold"]))),null==v?void 0:v.fontFamily),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ie||(Ie=w(["absolute bg-black/40 rounded-full"]))),children:b?e.jsx(b,{}):e.jsx($,{style:r.style("h-16 w-16"),color:(null==v||null===(l=v.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Ae||(Ae=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Te||(Te=w(["text-white text-xs font-semibold"]))),children:L(S)})})]})]}),c.audio&&e.jsx(t.View,{style:r(Ee||(Ee=w(["my-2"]))),children:e.jsx(H,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:f})}),c.text&&e.jsx(Be,{style:T([r(ke||(ke=w(["pt-1"]))),r(h?Me||(Me=w(["pb-0"])):Ve||(Ve=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},y?null==v||null===(s=v.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==v||null===(a=v.messageStyle)||void 0===a?void 0:a.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:m({color:"blue",textDecorationLine:"underline"},(u=null==v?void 0:v.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},jt=n.memo(wt),Pt=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},St=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},Ct=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,y=I(),p=y.theme,v=y.showMessageStatus;return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(qe||(qe=w(["flex-row items-center"]))),r(d?De||(De=w(["justify-end pb-1 ml-4"])):f?He||(He=w(["absolute right-3 bottom-3"])):We||(We=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:T([r(Ye||(Ye=w(["text-xs"]))),{color:d||f?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==p?void 0:p.fontFamily),children:a}),c&&e.jsxs(t.View,{style:r(Xe||(Xe=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(St,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(Pt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(Pt,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},Ot=n.memo(Ct),It=function(n){var o,i,l,s,a,u,c,d,f=n.message,y=n.isCurrentUser,p=n.isFirstInSequence,v=n.onLongPress,h=I(),b=h.theme,x=h.showAvatars,g=h.showUserNames,j=h.showBubbleTail,S=h.setMediaUrl,C=h.setIsVideoPlaying,O=h.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:v,style:[r(Ze||(Ze=w(["px-2 my-1 max-w-[75%] relative"]))),r(y?Ke||(Ke=w(["self-end mr-3"])):Ge||(Ge=w(["self-start ml-9"]))),r(p?y?Qe||(Qe=w(["bg-green-500 rounded-tr-none"])):Je||(Je=w(["bg-white rounded-tl-none"])):y?et||(et=w(["bg-green-500"])):tt||(tt=w(["bg-white"]))),m({borderRadius:8},y?null==b||null===(o=b.bubbleStyle)||void 0===o?void 0:o.sent:null==b||null===(i=b.bubbleStyle)||void 0===i?void 0:i.received)],children:[!y&&p&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(rt||(rt=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(nt||(nt=w(["w-full h-full rounded-full"]))),null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:T([r(ot||(ot=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:T([r(it||(it=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==b?void 0:b.fontFamily),children:f.senderName})]}),p&&j&&e.jsx(P,{style:r.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(c=b.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(d=b.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(jt,{message:f,isCurrentUser:y,isFirstInSequence:p,onMediaPress:function(e,t){S({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&C(!0)},isVideoPlaying:O}),e.jsx(Ot,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},At=n.memo(It),Tt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},Et=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},kt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},Mt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},Vt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Rt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},_t=function(r){var n=r.fileName,o=r.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:T([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},Nt=n.memo(_t),zt=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,y=r.CustomFileIcon,p=r.CustomImagePreview,v=r.CustomVideoPreview,h=r.inputHeight,m=I(),b=m.theme,x=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12},null==b||null===(l=b.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(x({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:T({fontSize:12,color:"black"},null==b?void 0:b.fontFamily),children:"X"})}),w?p?e.jsx(p,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?v?e.jsx(v,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==b||null===(s=b.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==b||null===(a=b.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:y?e.jsx(y,{}):e.jsx(Rt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==b||null===(u=b.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx(Nt,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},$t=n.memo(zt),Lt="ios"===t.Platform.OS?32:30,Ut="ios"===t.Platform.OS?50:48,Ft="h-6 w-6",Bt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b,x=o.onSendMessage,j=o.onTypingStart,P=o.onTypingEnd,S=o.onAttachmentPress,C=o.onCameraPress,O=o.onAudioRecordStart,E=o.onAudioRecordEnd,k=o.CustomEmojiIcon,M=o.CustomAttachmentIcon,V=o.CustomCameraIcon,R=o.CustomSendIcon,_=o.CustomMicrophoneIcon,N=o.CustomFileIcon,z=o.CustomImagePreview,$=o.CustomVideoPreview,L=g(n.useState(""),2),U=L[0],F=L[1],B=g(n.useState(0),2),q=B[0],D=B[1],H=g(n.useState({height:Lt,isMultiline:!1}),2),W=H[0],Y=H[1],X=I(),Z=X.theme,K=X.currentUserId,G=X.showEmojiButton,Q=X.showAttachmentsButton,J=X.showCameraButton,ee=X.showVoiceRecordButton,te=X.placeholder,re=X.previewData,ne=X.closePreview,oe=null==Z||null===(i=Z.sizes)||void 0===i?void 0:i.inputIconSize,ie=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():A;return r.style(t)}(oe),le="number"==typeof(b=oe)&&b>0?b:24,se={paddingTop:Math.max(0,(Ut-le)/2)},ae=0===U.trim().length&&!W.isMultiline,ue=n.useCallback((function(){Y({height:Lt,isMultiline:!1}),D((function(e){return e+1}))}),[]),ce=n.useCallback((function(e){F(e),0===e.length&&ue()}),[ue]),de=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Lt),118),r=t>Lt;Y({height:r?t:Lt,isMultiline:r})}),[]),fe=n.useCallback((function(){var e=U.trim();(e||re)&&(x({text:e,senderId:K}),F(""),ue())}),[U,x,K,re,ue]);return n.useEffect((function(){U.trim()?null==j||j():null==P||P()}),[U,j,P]),e.jsxs(t.View,{style:r(lt||(lt=w(["w-full px-2"]))),children:[re&&e.jsx($t,{previewData:re,closePreview:ne,CustomFileIcon:N,CustomImagePreview:z,CustomVideoPreview:$,inputHeight:W.height}),e.jsxs(t.View,{style:[r(st||(st=w(["flex-row items-end gap-2"]))),null==Z||null===(l=Z.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(at||(at=w(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Ut,borderRadius:ae?9999:24,alignItems:"flex-start"},null==Z||null===(s=Z.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[G&&e.jsx(t.View,{style:se,children:e.jsx(t.Pressable,{children:k?e.jsx(k,{}):e.jsx(Et,{style:ie,color:(null==Z||null===(a=Z.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:U,onChangeText:ce,placeholder:te||"Message",style:T([r(ut||(ut=w(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?r(ct||(ct=w(["text-[17px]"]))):r(dt||(dt=w(["text-[16px]"]))),{minHeight:Lt,maxHeight:118,paddingVertical:ae?0:8,marginVertical:ae?(Ut-Lt)/2:4},{color:(null==Z||null===(u=Z.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==Z?void 0:Z.fontFamily),placeholderTextColor:(null==Z||null===(c=Z.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:W.isMultiline&&U.length>0?"top":"center",onContentSizeChange:de},"chat-input-".concat(q)),e.jsxs(t.View,{style:[r(ft||(ft=w(["flex-row items-center gap-4"]))),se],children:[Q&&e.jsx(t.Pressable,{onPress:S,children:M?e.jsx(M,{}):e.jsx(Mt,{style:ie,color:(null==Z||null===(d=Z.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),J&&!U.trim()&&e.jsx(t.Pressable,{onPress:C,children:V?e.jsx(V,{}):e.jsx(Tt,{style:ie,color:(null==Z||null===(f=Z.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(yt||(yt=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:Ut,width:Ut},null==Z||null===(y=Z.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:U.trim()||re?fe:O,onLongPress:O,onPressOut:E,children:U.trim()?R?e.jsx(R,{}):e.jsx(Vt,{style:r.style(Ft),color:(null==Z||null===(p=Z.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):ee?_?e.jsx(_,{}):e.jsx(kt,{style:r.style("h-8 w-8"),color:(null==Z||null===(v=Z.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):R?e.jsx(R,{}):e.jsx(Vt,{style:r.style(Ft),color:(null==Z||null===(h=Z.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},qt=n.memo(Bt);function Dt(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Ht,Wt,Yt,Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=I().theme,d=n.useRef(null),f=g(n.useState(!1),2),y=f[0],p=f[1],v=g(n.useState(!1),2),h=v[0],m=v[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(pt||(pt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(vt||(vt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Dt,{style:r(ht||(ht=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(mt||(mt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),m(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){m(!0),p(!1)}}),y&&e.jsx(t.View,{style:r(bt||(bt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(z,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(xt||(xt=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:T(r(gt||(gt=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},sr=n.memo(lr),ar=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,p=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var h=v.slice(0,2),b=v.length-2;return e.jsxs(t.View,{style:r(Ht||(Ht=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Wt||(Wt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Yt||(Yt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:h.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Xt||(Xt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:T([r(Zt||(Zt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),b>0&&e.jsx(t.View,{style:[r(Kt||(Kt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:T([r(Gt||(Gt=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",b]})})]}),p&&e.jsx(P,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(Qt||(Qt=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:y?y():e.jsx(t.View,{style:r(Jt||(Jt=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:T(r(er||(er=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var ur=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaUrl,u=o.setMediaUrl,c=o.setIsVideoPlaying,d=o.typingUsers,f=o.onSendMessage,y=o.onTypingStart,p=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,m=o.onAudioRecordStart,b=o.onCameraPress,x=o.renderCustomInput,j=o.CustomEmojiIcon,P=o.CustomAttachmentIcon,S=o.CustomCameraIcon,C=o.CustomMicrophoneIcon,O=o.CustomSendIcon,A=o.CustomFileIcon,T=o.CustomImagePreview,E=o.CustomVideoPreview,k=o.keyboardVerticalOffset,M=void 0===k?0:k,V=o.disableKeyboardAvoiding,R=void 0!==V&&V,_=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=g(n.useState(0),2),o=r[0],i=r[1];return n.useEffect((function(){if(e){var r="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(r,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!R),N=x?x():e.jsx(qt,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:P,CustomCameraIcon:S,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),z=e.jsxs(t.View,{style:r(tr||(tr=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(rr||(rr=w(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(At,{message:n,isCurrentUser:n.senderId===l,onLongPress:function(){return null==s?void 0:s(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(ar,{typingUsers:d||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!R&&_>0?{marginBottom:_}:void 0,children:N}),e.jsx(sr,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(nr||(nr=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(or||(or=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(ir||(ir=w(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:M,children:z})};module.exports=function(t){return e.jsx(B,{children:e.jsx(O,m(m({},t),{},{children:e.jsx(ur,{})}))})};
14
+ */function pe(){if(ee)return J;ee=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return J=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(n,o){for(var i,l,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),a=1;a<arguments.length;a++){for(var u in i=Object(arguments[a]))t.call(i,u)&&(s[u]=i[u]);if(e){l=e(i);for(var c=0;c<l.length;c++)r.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},J}function ve(){if(re)return te;re=1;return te="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function he(){return oe?ne:(oe=1,ne=Function.call.bind(Object.prototype.hasOwnProperty))}function me(){if(le)return ie;le=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=ve(),r={},n=he();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,l,s,a){if("production"!==process.env.NODE_ENV)for(var u in o)if(n(o,u)){var c;try{if("function"!=typeof o[u]){var d=Error((s||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}c=o[u](i,u,s,l,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in r)){r[c.message]=!0;var f=a?a():"";e("Failed "+l+" type: "+c.message+(null!=f?f:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ie=o}function be(){if(ae)return se;ae=1;var e=ye(),t=pe(),r=ve(),n=he(),o=me(),i=function(){};function l(){return null}return"production"!==process.env.NODE_ENV&&(i=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),se=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:p(l),arrayOf:function(e){return p((function(t,n,o,i,l){if("function"!=typeof e)return new y("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new y("Invalid "+i+" `"+l+"` of type `"+b(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",r);if(u instanceof Error)return u}return null}))},element:p((function(e,t,r,n,o){var i=e[t];return s(i)?null:new y("Invalid "+n+" `"+o+"` of type `"+b(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:p((function(t,r,n,o,i){var l=t[r];return e.isValidElementType(l)?null:new y("Invalid "+o+" `"+i+"` of type `"+b(l)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return p((function(t,r,n,o,i){if(!(t[r]instanceof e)){var l=e.name||c;return new y("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+l+"`.")}var s;return null}))},node:p((function(e,t,r,n,o){return m(e[t])?null:new y("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return p((function(t,o,i,l,s){if("function"!=typeof e)return new y("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=b(a);if("object"!==u)return new y("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(n(a,c)){var d=e(a,c,i,l,s+"."+c,r);if(d instanceof Error)return d}return null}))},oneOf:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),l;return p((function(t,r,n,o,i){for(var l=t[r],s=0;s<e.length;s++)if(f(l,e[s]))return null;var a=JSON.stringify(e,(function(e,t){return"symbol"===x(t)?String(t):t}));return new y("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+n+"`, expected one of "+a+".")}))},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&i("Invalid argument supplied to oneOfType, expected an instance of array."),l;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+g(o)+" at index "+t+"."),l}return p((function(t,o,i,l,s){for(var a=[],u=0;u<e.length;u++){var c=(0,e[u])(t,o,i,l,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&a.push(c.data.expectedType)}return new y("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return p((function(t,n,o,i,l){var s=t[n],a=b(s);if("object"!==a)return new y("Invalid "+i+" `"+l+"` of type `"+a+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var c=e[u];if("function"!=typeof c)return h(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,r);if(d)return d}return null}))},exact:function(e){return p((function(o,i,l,s,a){var u=o[i],c=b(u);if("object"!==c)return new y("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var p=e[f];if(n(e,f)&&"function"!=typeof p)return h(l,s,a,f,x(p));if(!p)return new y("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=p(u,f,l,s,a+"."+f,r);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function y(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function p(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,l,s,u,d,f,p){if(u=u||c,f=f||s,p!==r){if(a){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var h=u+":"+s;!t[h]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+f+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[h]=!0,n++)}}return null==l[s]?o?null===l[s]?new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new y("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(l,s,u,d,f)}var l=o.bind(null,!1);return l.isRequired=o.bind(null,!0),l}function v(e){return p((function(t,r,n,o,i,l){var s=t[r];return b(s)!==e?new y("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,r,n,o){return new y((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function m(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(m);if(null===e||s(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function b(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function x(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function g(e){var t=x(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return y.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},se}function xe(){if(ce)return ue;ce=1;var e=ve();function t(){}function r(){}return r.resetWarningCache=t,ue=function(){function n(t,r,n,o,i,l){if(l!==e){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function ge(){if(de)return X.exports;if(de=1,"production"!==process.env.NODE_ENV){var e=ye();X.exports=be()(e.isElement,true)}else X.exports=xe()();return X.exports}var we,je,Pe,Se,Ce,Oe,Ie,Ae,Te,Ee,ke,Me,Ve,Re=W(ge()),_e=function(){return f((function e(t,r){d(this,e),this.text=t,this.patterns=r||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(r){var n=[],o=r.nonExhaustiveModeMaxMatchCount||0,i=Math.min(Math.max(Number.isInteger(o)?o:0,0)||Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],a=t.children,u=0;for(r.pattern.lastIndex=0;a&&(o=r.pattern.exec(a));){var c=a.substr(0,o.index);if(u=o.index,++l>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,r.pattern.lastIndex=0}s.push({children:a}),n.push.apply(n,s)}})),t=n})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,r,n){var o={};Object.keys(e).forEach((function(r){"pattern"!==r&&"renderText"!==r&&"nonExhaustiveModeMaxMatchCount"!==r&&("function"==typeof e[r]?o[r]=function(){return e[r](t,n)}:o[r]=e[r])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,r)),m(m({},o),{},{children:i,_matched:!0})}}])}(),Ne=["type"],ze=["style"],$e=["parse","childrenProps"],Le={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Ue=Re.shape(m(m({},t.Text.propTypes),{},{type:Re.oneOf(Object.keys(Le)).isRequired,nonExhaustiveMaxMatchCount:Re.number})),Fe=Re.shape(m(m({},t.Text.propTypes),{},{pattern:Re.oneOfType([Re.string,Re.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Re.number})),Be=function(){function r(){return d(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(r,n.Component),f(r,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,r=b(e,Ne);if(t){if(!Le[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Le[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new _e(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,l=n.style,s=b(n,ze);return e.jsx(t.Text,m(m({style:[i,l]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=m({},this.props);n.parse,n.childrenProps;var o=b(n,$e);return e.jsx(t.Text,m(m({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();Be.displayName="ParsedText",Be.propTypes=m(m({},t.Text.propTypes),{},{parse:Re.arrayOf(Re.oneOfType([Ue,Fe])),childrenProps:Re.shape(t.Text.propTypes)}),Be.defaultProps={parse:null,childrenProps:{}};var qe,De,He,We,Ye,Xe,Ze,Ke,Ge,Qe,Je,et,tt,rt,nt,ot,it,lt,st,at,ut,ct,dt,ft,yt,pt,vt,ht,mt,bt,xt,gt,wt=function(o){var l,s,a,u,c=o.message,d=o.onMediaPress,f=o.isVideoPlaying,y=o.isCurrentUser,p=I(),v=p.theme,h=p.showMessageStatus,b=p.CustomPlayIcon,x=p.renderCustomVideoBubbleError,j=n.useRef(null),P=g(n.useState(0),2),S=P[0],C=P[1],O=g(n.useState(!1),2),A=O[0],E=O[1],k=g(n.useState(!1),2),M=k[0],V=k[1];return e.jsxs(t.View,{children:[c.image&&e.jsx(t.Pressable,{onPress:function(){return d("image",c.image)},style:r(we||(we=w(["w-60 h-80 my-2"]))),children:e.jsx(t.Image,{source:{uri:c.image},style:r(je||(je=w(["w-full h-full rounded-lg"]))),resizeMode:"contain"})}),c.video&&e.jsxs(t.Pressable,{onPress:function(){return d("video",c.video)},style:r(Pe||(Pe=w(["w-60 h-80 my-2 justify-center items-center"]))),disabled:A,children:[e.jsx(i,{source:{uri:c.video},ref:j,paused:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative"},resizeMode:"cover",onLoadStart:function(){E(!0),V(!1)},onLoad:function(e){C(e.duration),E(!1)},onBuffer:function(e){var t=e.isBuffering;return E(t)},onError:function(){V(!0),E(!1)}}),A?e.jsx(t.View,{style:r(Se||(Se=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(z,{style:r.style("h-12 w-12"),spinning:!0})}):M?x?x():e.jsx(t.View,{style:r(Ce||(Ce=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:T(r(Oe||(Oe=w(["text-white font-bold"]))),null==v?void 0:v.fontFamily),children:"Failed to load video"})}):e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ie||(Ie=w(["absolute bg-black/40 rounded-full"]))),children:b?e.jsx(b,{}):e.jsx($,{style:r.style("h-16 w-16"),color:(null==v||null===(l=v.colors)||void 0===l?void 0:l.audioPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(Ae||(Ae=w(["absolute bottom-2 left-2 bg-black/50 px-2 py-1 rounded-md"]))),children:e.jsx(t.Text,{style:r(Te||(Te=w(["text-white text-xs font-semibold"]))),children:L(S)})})]})]}),c.audio&&e.jsx(t.View,{style:r(Ee||(Ee=w(["my-2"]))),children:e.jsx(H,{audioUrl:c.audio,audioId:c.id,isVideoPlaying:f})}),c.text&&e.jsx(Be,{style:T([r(ke||(ke=w(["pt-1"]))),r(h?Me||(Me=w(["pb-0"])):Ve||(Ve=w(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},y?null==v||null===(s=v.messageStyle)||void 0===s?void 0:s.sentTextStyle:null==v||null===(a=v.messageStyle)||void 0===a?void 0:a.receivedTextStyle],null==v?void 0:v.fontFamily),parse:[{type:"url",style:m({color:"blue",textDecorationLine:"underline"},(u=null==v?void 0:v.fontFamily,u?{fontFamily:u}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:c.text})]})},jt=n.memo(wt),Pt=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"})})},St=function(t){var r=t.style,n=t.fill;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z",fill:n})})},Ct=function(n){var o,i,l,s,a=n.time,u=n.status,c=n.isCurrentUser,d=n.hasText,f=n.hasAudio,y=I(),p=y.theme,v=y.showMessageStatus;return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(qe||(qe=w(["flex-row items-center"]))),r(d?De||(De=w(["justify-end pb-1 ml-4"])):f?He||(He=w(["absolute right-3 bottom-3"])):We||(We=w(["absolute right-3 bottom-4 bg-black/50 px-2 py-1 rounded-md"])))],children:[e.jsx(t.Text,{style:T([r(Ye||(Ye=w(["text-xs"]))),{color:d||f?(null==p||null===(o=p.colors)||void 0===o?void 0:o.timestamp)||"rgba(107, 114, 128, 0.7)":"white"}],null==p?void 0:p.fontFamily),children:a}),c&&e.jsxs(t.View,{style:r(Xe||(Xe=w(["ml-1 flex-row items-center"]))),children:["sent"===u&&e.jsx(St,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===u&&e.jsx(Pt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.deliveredIconColor)||"#6B7280"}),"read"===u&&e.jsx(Pt,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},Ot=n.memo(Ct),It=function(n){var o,i,l,s,a,u,c,d,f=n.message,y=n.isCurrentUser,p=n.isFirstInSequence,v=n.onLongPress,h=I(),b=h.theme,x=h.showAvatars,g=h.showUserNames,j=h.showBubbleTail,S=h.setMediaUrl,C=h.setIsVideoPlaying,O=h.isVideoPlaying;return e.jsxs(t.Pressable,{onLongPress:v,style:[r(Ze||(Ze=w(["px-2 my-1 max-w-[75%] relative"]))),r(y?Ke||(Ke=w(["self-end mr-3"])):Ge||(Ge=w(["self-start ml-9"]))),r(p?y?Qe||(Qe=w(["bg-green-500 rounded-tr-none"])):Je||(Je=w(["bg-white rounded-tl-none"])):y?et||(et=w(["bg-green-500"])):tt||(tt=w(["bg-white"]))),m({borderRadius:8},y?null==b||null===(o=b.bubbleStyle)||void 0===o?void 0:o.sent:null==b||null===(i=b.bubbleStyle)||void 0===i?void 0:i.received)],children:[!y&&p&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(rt||(rt=w(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:f.senderAvatar?e.jsx(t.Image,{source:{uri:f.senderAvatar},style:[r(nt||(nt=w(["w-full h-full rounded-full"]))),null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:T([r(ot||(ot=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(a=f.senderName)||void 0===a?void 0:a.charAt(0)})}),g&&f.senderName&&e.jsx(t.Text,{style:T([r(it||(it=w(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==b?void 0:b.fontFamily),children:f.senderName})]}),p&&j&&e.jsx(P,{style:r.style("absolute -top-1 w-6 h-6 ",y?"-right-3.5 mt-[1.24px]":"-left-3.5 mt-[1.25px]",{transform:[{rotate:y?"90deg":"180deg"}]}),color:"".concat(y?(null==b||null===(c=b.colors)||void 0===c?void 0:c.sentMessageTailColor)||"rgba(34, 197, 94,1)":(null==b||null===(d=b.colors)||void 0===d?void 0:d.receivedMessageTailColor)||"white")}),e.jsx(jt,{message:f,isCurrentUser:y,isFirstInSequence:p,onMediaPress:function(e,t){S({imageUrl:"image"===e?t:"",videoUrl:"video"===e?t:""}),"video"===e&&C(!0)},isVideoPlaying:O}),e.jsx(Ot,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},At=n.memo(It),Tt=function(t){var r=t.style,n=t.color;return e.jsx(o.Svg,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Circle,{cx:"12",cy:"13",r:"3"}),e.jsx(o.Path,{d:"M9.778 21h4.444c3.121 0 4.682 0 5.803-.735a4.4 4.4 0 0 0 1.226-1.204c.749-1.1.749-2.633.749-5.697s0-4.597-.749-5.697a4.4 4.4 0 0 0-1.226-1.204c-.72-.473-1.622-.642-3.003-.702c-.659 0-1.226-.49-1.355-1.125A2.064 2.064 0 0 0 13.634 3h-3.268c-.988 0-1.839.685-2.033 1.636c-.129.635-.696 1.125-1.355 1.125c-1.38.06-2.282.23-3.003.702A4.4 4.4 0 0 0 2.75 7.667C2 8.767 2 10.299 2 13.364s0 4.596.749 5.697c.324.476.74.885 1.226 1.204C5.096 21 6.657 21 9.778 21Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M19 10h-1"})]})})},Et=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:n,children:[e.jsx(o.Path,{strokeLinecap:"round",strokeWidth:"1.5",d:"M8.913 15.934c1.258.315 2.685.315 4.122-.07s2.673-1.099 3.605-2.001"}),e.jsx(o.Ellipse,{cx:"14.509",cy:"9.774",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 14.51 9.774)"}),e.jsx(o.Ellipse,{cx:"8.714",cy:"11.328",fill:"currentColor",rx:"1",ry:"1.5",transform:"rotate(-15 8.714 11.328)"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"M3.204 14.357c-1.112-4.147-1.667-6.22-.724-7.853s3.016-2.19 7.163-3.3c4.147-1.112 6.22-1.667 7.853-.724s2.19 3.016 3.3 7.163c1.111 4.147 1.667 6.22.724 7.853s-3.016 2.19-7.163 3.3c-4.147 1.111-6.22 1.667-7.853.724s-2.19-3.016-3.3-7.163Z"}),e.jsx(o.Path,{strokeWidth:"1.5",d:"m13 16l.478.974a1.5 1.5 0 1 0 2.693-1.322l-.46-.935"})]})})},kt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"M7 8a5 5 0 0 1 10 0v3a5 5 0 0 1-10 0z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M13.5 8H17m-3.5 3H17M7 8h2m-2 3h2m11-1v1a8 8 0 0 1-8 8m-8-9v1a8 8 0 0 0 8 8m0 0v3",opacity:".5"})]})})},Mt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,fill:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{d:"M17.346 15.539q0 2.271-1.565 3.866T11.952 21t-3.838-1.595t-1.576-3.867v-8.73q0-1.587 1.092-2.697Q8.72 3 10.308 3t2.678 1.11t1.091 2.698v8.269q0 .88-.615 1.517q-.614.637-1.498.637t-1.52-.627t-.636-1.527V6.769h1v8.308q0 .479.327.816q.328.338.807.338t.807-.338t.328-.816V6.789q-.006-1.166-.802-1.977Q11.48 4 10.308 4q-1.163 0-1.966.821q-.804.821-.804 1.987v8.73q-.005 1.853 1.283 3.157Q10.11 20 11.96 20q1.823 0 3.1-1.305t1.287-3.156v-8.77h1z"})})},Vt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:n,children:[e.jsx(o.Path,{d:"m18.636 15.67l1.716-5.15c1.5-4.498 2.25-6.747 1.062-7.934s-3.436-.438-7.935 1.062L8.33 5.364C4.7 6.574 2.885 7.18 2.37 8.067a2.72 2.72 0 0 0 0 2.73c.515.888 2.33 1.493 5.96 2.704c.584.194.875.291 1.119.454c.236.158.439.361.597.597c.163.244.26.535.454 1.118c1.21 3.63 1.816 5.446 2.703 5.962a2.72 2.72 0 0 0 2.731 0c.887-.516 1.492-2.331 2.703-5.962Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"m17.79 6.21l-4.211 4.165",opacity:".5"})]})})},Rt=function(t){var r=t.style,n=t.fill,i=void 0===n?"currentColor":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",children:[e.jsx(o.Path,{fill:i,d:"M13 4H6v16h12V9h-5z",opacity:".3"}),e.jsx(o.Path,{fill:i,d:"m20 8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2zm-2 12H6V4h7v5h5z"})]})},_t=function(r){var n=r.fileName,o=r.style,i=I().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:T([{fontSize:14,fontWeight:"600",color:"black"},o],null==i?void 0:i.fontFamily),children:function(e){var t=e.lastIndexOf(".");if(-1===t)return e;var r=e.slice(0,t),n=e.slice(t);return r.length>40?r.slice(0,40)+"..."+n:r+n}(n)})},Nt=n.memo(_t),zt=function(r){var n,o,l,s,a,u,c,d=r.previewData,f=r.closePreview,y=r.CustomFileIcon,p=r.CustomImagePreview,v=r.CustomVideoPreview,h=r.inputHeight,m=I(),b=m.theme,x=m.setMediaUrl,g=m.setIsVideoPlaying;if(!d)return null;var w=null===(n=d.type)||void 0===n?void 0:n.startsWith("image/"),j=null===(o=d.type)||void 0===o?void 0:o.startsWith("video/");return e.jsxs(t.Pressable,{style:[{position:"absolute",bottom:(null!=h?h:0)+8,zIndex:20,borderRadius:12},null==b||null===(l=b.filePreviewStyle)||void 0===l?void 0:l.root],onPress:function(){(w||j)&&(x({imageUrl:w?d.uri:"",videoUrl:j?d.uri:""}),j&&g(!0))},children:[e.jsx(t.Pressable,{onPress:f,style:{position:"absolute",zIndex:10,height:20,width:20,backgroundColor:"rgba(255, 255, 255, 0.5)",right:0,borderTopRightRadius:8,borderRadius:8,justifyContent:"center",alignItems:"center"},children:e.jsx(t.Text,{style:T({fontSize:12,color:"black"},null==b?void 0:b.fontFamily),children:"X"})}),w?p?e.jsx(p,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(t.Image,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover"})}):j?v?e.jsx(v,{uri:d.uri}):e.jsx(t.View,{style:{width:56,height:56,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:d.uri},style:{width:"100%",height:"100%",borderRadius:12},resizeMode:"cover",muted:!0,repeat:!0,paused:!1})}):e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,height:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==b||null===(s=b.filePreviewStyle)||void 0===s?void 0:s.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==b||null===(a=b.filePreviewStyle)||void 0===a?void 0:a.iconContainer],children:y?e.jsx(y,{}):e.jsx(Rt,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==b||null===(u=b.filePreviewStyle)||void 0===u?void 0:u.nameContainer],children:e.jsx(Nt,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},$t=n.memo(zt),Lt="ios"===t.Platform.OS?32:30,Ut="ios"===t.Platform.OS?50:48,Ft="h-6 w-6",Bt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b,x=o.onSendMessage,j=o.onTypingStart,P=o.onTypingEnd,S=o.onAttachmentPress,C=o.onCameraPress,O=o.onAudioRecordStart,E=o.onAudioRecordEnd,k=o.CustomEmojiIcon,M=o.CustomAttachmentIcon,V=o.CustomCameraIcon,R=o.CustomSendIcon,_=o.CustomMicrophoneIcon,N=o.CustomFileIcon,z=o.CustomImagePreview,$=o.CustomVideoPreview,L=g(n.useState(""),2),U=L[0],F=L[1],B=g(n.useState(0),2),q=B[0],D=B[1],H=g(n.useState({height:Lt,isMultiline:!1}),2),W=H[0],Y=H[1],X=I(),Z=X.theme,K=X.currentUserId,G=X.showEmojiButton,Q=X.showAttachmentsButton,J=X.showCameraButton,ee=X.showVoiceRecordButton,te=X.placeholder,re=X.previewData,ne=X.closePreview,oe=null==Z||null===(i=Z.sizes)||void 0===i?void 0:i.inputIconSize,ie=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():A;return r.style(t)}(oe),le="number"==typeof(b=oe)&&b>0?b:24,se=0===U.trim().length&&!W.isMultiline,ae=Math.max(0,(Ut-le)/2),ue=se?{paddingTop:ae,paddingBottom:ae}:{paddingBottom:ae},ce=n.useCallback((function(){Y({height:Lt,isMultiline:!1}),D((function(e){return e+1}))}),[]),de=n.useCallback((function(e){F(e),0===e.length&&ce()}),[ce]),fe=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Lt),118),r=t>Lt;Y({height:r?t:Lt,isMultiline:r})}),[]),ye=n.useCallback((function(){var e=U.trim();(e||re)&&(x({text:e,senderId:K}),F(""),ce())}),[U,x,K,re,ce]);return n.useEffect((function(){U.trim()?null==j||j():null==P||P()}),[U,j,P]),e.jsxs(t.View,{style:r(lt||(lt=w(["w-full px-2"]))),children:[re&&e.jsx($t,{previewData:re,closePreview:ne,CustomFileIcon:N,CustomImagePreview:z,CustomVideoPreview:$,inputHeight:W.height}),e.jsxs(t.View,{style:[r(st||(st=w(["flex-row items-end gap-2"]))),null==Z||null===(l=Z.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(at||(at=w(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Ut,borderRadius:se?9999:24,alignItems:se?"center":"flex-end"},null==Z||null===(s=Z.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[G&&e.jsx(t.View,{style:ue,children:e.jsx(t.Pressable,{children:k?e.jsx(k,{}):e.jsx(Et,{style:ie,color:(null==Z||null===(a=Z.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:U,onChangeText:de,placeholder:te||"Message",style:T([r(ut||(ut=w(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?r(ct||(ct=w(["text-[17px]"]))):r(dt||(dt=w(["text-[16px]"]))),{minHeight:Lt,maxHeight:118,paddingVertical:se?0:8,marginVertical:se?(Ut-Lt)/2:4},{color:(null==Z||null===(u=Z.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==Z?void 0:Z.fontFamily),placeholderTextColor:(null==Z||null===(c=Z.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:W.isMultiline&&U.length>0?"top":"center",onContentSizeChange:fe},"chat-input-".concat(q)),e.jsxs(t.View,{style:[r(ft||(ft=w(["flex-row items-center gap-4"]))),ue],children:[Q&&e.jsx(t.Pressable,{onPress:S,children:M?e.jsx(M,{}):e.jsx(Mt,{style:ie,color:(null==Z||null===(d=Z.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),J&&!U.trim()&&e.jsx(t.Pressable,{onPress:C,children:V?e.jsx(V,{}):e.jsx(Tt,{style:ie,color:(null==Z||null===(f=Z.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(yt||(yt=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:Ut,width:Ut},null==Z||null===(y=Z.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:U.trim()||re?ye:O,onLongPress:O,onPressOut:E,children:U.trim()?R?e.jsx(R,{}):e.jsx(Vt,{style:r.style(Ft),color:(null==Z||null===(p=Z.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):ee?_?e.jsx(_,{}):e.jsx(kt,{style:r.style("h-8 w-8"),color:(null==Z||null===(v=Z.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):R?e.jsx(R,{}):e.jsx(Vt,{style:r.style(Ft),color:(null==Z||null===(h=Z.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},qt=n.memo(Bt);function Dt(t){var n=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:r.style("h-6 w-6 text-black",n),children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18"})]})}var Ht,Wt,Yt,Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr=function(o){var l=o.imageUrl,s=o.videoUrl,u=o.onClose,c=I().theme,d=n.useRef(null),f=g(n.useState(!1),2),y=f[0],p=f[1],v=g(n.useState(!1),2),h=v[0],m=v[1];return l||s?e.jsx(t.Modal,{visible:!!l||!!s,transparent:!0,children:e.jsxs(t.View,{style:r(pt||(pt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(vt||(vt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Dt,{style:r(ht||(ht=w(["h-8 w-8"])))})}),l&&e.jsx(a,{imageUrls:[{url:l}],enableSwipeDown:!0,onSwipeDown:u,backgroundColor:"rgba(0,0,0,0.8)",enableImageZoom:!0,onSave:function(){return l},renderIndicator:function(){return e.jsx(e.Fragment,{})}}),s&&e.jsxs(t.View,{style:r(mt||(mt=w(["justify-center items-center"]))),children:[e.jsx(i,{source:{uri:s},ref:d,shutterColor:"transparent",controls:!0,style:{width:"100%",height:"100%",borderRadius:8,position:"relative",marginHorizontal:48},controlsStyles:{hideSettingButton:!1,hideNext:!0,hidePrevious:!0},resizeMode:"contain",onLoadStart:function(){p(!0),m(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){m(!0),p(!1)}}),y&&e.jsx(t.View,{style:r(bt||(bt=w(["absolute inset-0 flex items-center justify-center bg-black/40 rounded-full"]))),children:e.jsx(z,{style:r.style("h-12 w-12"),spinning:!0})}),h&&e.jsx(t.View,{style:r(xt||(xt=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:T(r(gt||(gt=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},sr=n.memo(lr),ar=function(n){var o,i,l,s,a=n.typingUsers,u=n.currentUserId,c=I(),d=c.theme,f=c.showAvatars,y=c.renderCustomTyping,p=c.showBubbleTail,v=a.filter((function(e){return e.id!==u}));if(!v.length)return null;var h=v.slice(0,2),b=v.length-2;return e.jsxs(t.View,{style:r(Ht||(Ht=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Wt||(Wt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Yt||(Yt=w(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:h.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(Xt||(Xt=w(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:T([r(Zt||(Zt=w(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(l=d.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),b>0&&e.jsx(t.View,{style:[r(Kt||(Kt=w(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},m({},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:T([r(Gt||(Gt=w(["text-white text-xs font-semibold"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",b]})})]}),p&&e.jsx(P,{style:r.style("w-6 h-6 fill-white mt-[1.25px]",{transform:[{rotate:"180deg"},{translateX:6}]}),color:"".concat((null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white")}),e.jsx(t.View,{style:[r(Qt||(Qt=w(["px-2 my-1 bg-white rounded-tl-none rounded-lg"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingContainerStyle],children:y?y():e.jsx(t.View,{style:r(Jt||(Jt=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:T(r(er||(er=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var ur=function(){var o=I(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaUrl,u=o.setMediaUrl,c=o.setIsVideoPlaying,d=o.typingUsers,f=o.onSendMessage,y=o.onTypingStart,p=o.onTypingEnd,v=o.onAttachmentPress,h=o.onAudioRecordEnd,m=o.onAudioRecordStart,b=o.onCameraPress,x=o.renderCustomInput,j=o.CustomEmojiIcon,P=o.CustomAttachmentIcon,S=o.CustomCameraIcon,C=o.CustomMicrophoneIcon,O=o.CustomSendIcon,A=o.CustomFileIcon,T=o.CustomImagePreview,E=o.CustomVideoPreview,k=o.keyboardVerticalOffset,M=void 0===k?0:k,V=o.disableKeyboardAvoiding,R=void 0!==V&&V,_=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=g(n.useState(0),2),o=r[0],i=r[1];return n.useEffect((function(){if(e){var r="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(r,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!R),N=x?x():e.jsx(qt,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:P,CustomCameraIcon:S,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),z=e.jsxs(t.View,{style:r(tr||(tr=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(rr||(rr=w(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(At,{message:n,isCurrentUser:n.senderId===l,onLongPress:function(){return null==s?void 0:s(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(ar,{typingUsers:d||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!R&&_>0?{marginBottom:_}:void 0,children:N}),e.jsx(sr,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(nr||(nr=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(or||(or=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(ir||(ir=w(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:M,children:z})};module.exports=function(t){return e.jsx(B,{children:e.jsx(O,m(m({},t),{},{children:e.jsx(ur,{})}))})};
15
15
  //# sourceMappingURL=index.js.map