movius-chats 1.3.4 → 1.3.5

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.
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),r=require("twrnc"),n=require("react"),o=require("react-native-svg"),i=require("react-native-video"),l=require("react-native-reanimated"),s=require("react-native-sound"),a=require("react-native-image-zoom-viewer");function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,s=[],a=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(a=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var S=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},P=["children"],C=n.createContext(void 0),O=function(t){var r=t.children,o=b(t,P),i=g(n.useState({imageUrl:"",videoUrl:""}),2),l=i[0],s=i[1],a=g(n.useState(!1),2),u=a[0],c=a[1];return e.jsx(C.Provider,{value:m(m({},o),{},{mediaUrl:l,setMediaUrl:s,isVideoPlaying:u,setIsVideoPlaying:c}),children:r})},I=function(){var e=n.useContext(C);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},A="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function T(e,t){return t?[e,{fontFamily:t}]:e}var E,k,M,V,R,_,N,z=function(r){var i=r.style,l=r.spinning,s=void 0!==l&&l,a=n.useRef(new t.Animated.Value(0)).current;n.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},$=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},L=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},U=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},F=n.createContext(void 0),B=function(t){var r=t.children,o=g(n.useState(null),2),i=o[0],l=o[1];return e.jsx(F.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},q={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAiH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},D=function(o){var i,a,u,c,d,f,y,p=o.audioUrl,v=o.audioId,h=o.isVideoPlaying,b=I(),x=b.theme,j=b.CustomPlayIcon,S=b.CustomPauseIcon,P=function(){var e=n.useContext(F);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=P.currentlyPlayingId,O=P.setCurrentlyPlayingId,A=g(n.useState(null),2),z=A[0],B=A[1],D=g(n.useState(!1),2),H=D[0],W=D[1],Y=g(n.useState(0),2),X=Y[0],Z=Y[1],K=g(n.useState(0),2),G=K[0],Q=K[1],J=g(n.useState(!1),2),ee=J[0],te=J[1],re=n.useRef(null),ne=n.useRef(0),oe=n.useRef(0),ie=n.useRef(0),le=l.useSharedValue(0);n.useEffect((function(){var e=!0,t=new s(p,"",(function(r){!r&&e&&Q(t.getDuration())}));return B(t),function(){e=!1,t&&(t.pause(),t.release())}}),[p]),n.useEffect((function(){C&&C!==v&&H&&z&&(z.pause(),W(!1),Z(0),le.value=0)}),[C,v,H,z]),n.useEffect((function(){var e;return H&&z&&!ee&&(e=setInterval((function(){z.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(Z(e),ne.current>0&&G>0)){var t=e/G*ne.current;isNaN(t)||(le.value=l.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[H,z,ee,G]);var se,ae,ue=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){te(!0),ie.current=e.nativeEvent.pageX-le.value},onPanResponderMove:function(e){if(ne.current>0){var t=e.nativeEvent.pageX-ie.current,r=Math.max(0,Math.min(t,ne.current));le.value=r;var n=r/ne.current*G;isNaN(n)||Z(n)}},onPanResponderRelease:function(){if(te(!1),z&&ne.current>0){var e=le.value/ne.current*G;isNaN(e)||z.setCurrentTime(e)}},onPanResponderTerminate:function(){te(!1)}}),ce=l.useAnimatedStyle((se=[new global.Error,-2,-27],(ae=function(){return{transform:[{translateX:le.value}]}}).__closure={knobPosition:le},ae.__workletHash=1935336866997,ae.__initData=q,ae.__stackDetails=se,ae));return n.useEffect((function(){h&&H&&z&&z.pause((function(){W(!1),O(null)}))}),[h]),e.jsxs(t.View,{style:r(E||(E=w(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:r(k||(k=w(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){z&&(H?z.pause((function(){W(!1),O(null)})):(O(v),z.play((function(e){e&&(W(!1),Z(0),le.value=l.withSpring(0),O(null))})),W(!0)))},style:[r(M||(M=w(["bg-black/40 rounded-full p-2"]))),null==x||null===(i=x.messageStyle)||void 0===i?void 0:i.audioPlayButtonStyle],children:H?S?e.jsx(S,{}):e.jsx(U,{style:r.style("h-6 w-6"),color:(null==x||null===(a=x.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx($,{style:r.style("h-6 w-6"),color:(null==x||null===(u=x.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:re,onLayout:function(e){var t,r=e.nativeEvent.layout.width;ne.current=r,null===(t=re.current)||void 0===t||t.measure((function(e,t,r,n,o){oe.current=o}))},style:[r(V||(V=w(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==x||null===(c=x.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[r(R||(R=w(["absolute h-full bg-slate-200"]))),{width:"".concat(G>0?X/G*100:0,"%")},null==x||null===(d=x.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(l.View,m(m({},ue.panHandlers),{},{style:[ce,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},m({},null==x||null===(f=x.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:r(_||(_=w(["px-4 py-1"]))),children:e.jsx(t.Text,{style:T([r(N||(N=w(["text-xs text-gray-500"]))),null==x||null===(y=x.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==x?void 0:x.fontFamily),children:isNaN(X)?"0:00":L(X)})})]})},H=n.memo(D);function W(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y,X={exports:{}},Z={exports:{}},K={};var G,Q,J,ee,te,re,ne,oe,ie,le,se,ae,ue,ce,de,fe={};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react-native"),r=require("twrnc"),n=require("react"),o=require("react-native-svg"),i=require("react-native-video"),l=require("react-native-reanimated"),s=require("react-native-sound"),a=require("react-native-image-zoom-viewer");function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t,r){return t=p(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,v()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,j(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t,r){return(t=j(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(v=function(){return!!e})()}function h(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?h(Object(r),!0).forEach((function(t){y(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function b(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function x(e,t){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},x(e,t)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,s=[],a=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(a=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{if(!a&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function j(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}var P=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 48 48",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",stroke:n,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",d:"M8 9.115c0-1.82 2.235-2.694 3.47-1.356l29.432 31.884c1.182 1.282.273 3.357-1.47 3.357H10a2 2 0 0 1-2-2z",clipRule:"evenodd"})})},S=["children"],C=n.createContext(void 0),O=function(t){var r=t.children,o=b(t,S),i=g(n.useState({imageUrl:"",videoUrl:""}),2),l=i[0],s=i[1],a=g(n.useState(!1),2),u=a[0],c=a[1];return e.jsx(C.Provider,{value:m(m({},o),{},{mediaUrl:l,setMediaUrl:s,isVideoPlaying:u,setIsVideoPlaying:c}),children:r})},I=function(){var e=n.useContext(C);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e},A="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function T(e,t){return t?[e,{fontFamily:t}]:e}var E,k,M,V,R,_,N,z=function(r){var i=r.style,l=r.spinning,s=void 0!==l&&l,a=n.useRef(new t.Animated.Value(0)).current;n.useEffect((function(){s&&t.Animated.loop(t.Animated.timing(a,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[s]);var u=a.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:u}]}:void 0,children:e.jsx(o,{style:i,viewBox:"0 0 1024 1024",children:e.jsx(o.Path,{d:"M988 548c-19.9 0-36-16.1-36-36c0-59.4-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3c.1 19.9-16 36-35.9 36",fill:"white"})})})},$=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:n,d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})})},L=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},U=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:n,fillRule:"evenodd",d:"M6.05 2.75a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0zm4 0a.55.55 0 0 0-1.1 0v9.5a.55.55 0 0 0 1.1 0z",clipRule:"evenodd"})})},F=n.createContext(void 0),B=function(t){var r=t.children,o=g(n.useState(null),2),i=o[0],l=o[1];return e.jsx(F.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:r})},q={code:"function AudioPlayerTsx1(){const{knobPosition}=this.__closure;return{transform:[{translateX:knobPosition.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx",sourceMap:'{"version":3,"names":["AudioPlayerTsx1","knobPosition","__closure","transform","translateX","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/AudioPlayer/AudioPlayer.tsx"],"mappings":"AAiH2C,SAAAA,eAAMA,CAAA,QAAAC,YAAA,OAAAC,SAAA,CACzC,MAAO,CACHC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},D=function(o){var i,a,u,c,d,f,y,p=o.audioUrl,v=o.audioId,h=o.isVideoPlaying,b=I(),x=b.theme,j=b.CustomPlayIcon,P=b.CustomPauseIcon,S=function(){var e=n.useContext(F);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=S.currentlyPlayingId,O=S.setCurrentlyPlayingId,A=g(n.useState(null),2),z=A[0],B=A[1],D=g(n.useState(!1),2),W=D[0],H=D[1],Y=g(n.useState(0),2),X=Y[0],Z=Y[1],K=g(n.useState(0),2),G=K[0],Q=K[1],J=g(n.useState(!1),2),ee=J[0],te=J[1],re=n.useRef(null),ne=n.useRef(0),oe=n.useRef(0),ie=n.useRef(0),le=l.useSharedValue(0);n.useEffect((function(){var e=!0,t=new s(p,"",(function(r){!r&&e&&Q(t.getDuration())}));return B(t),function(){e=!1,t&&(t.pause(),t.release())}}),[p]),n.useEffect((function(){C&&C!==v&&W&&z&&(z.pause(),H(!1),Z(0),le.value=0)}),[C,v,W,z]),n.useEffect((function(){var e;return W&&z&&!ee&&(e=setInterval((function(){z.getCurrentTime((function(e){if("number"==typeof e&&!isNaN(e)&&(Z(e),ne.current>0&&G>0)){var t=e/G*ne.current;isNaN(t)||(le.value=l.withSpring(t,{damping:15,stiffness:100}))}}))}),100)),function(){e&&clearInterval(e)}}),[W,z,ee,G]);var se,ae,ue=t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){te(!0),ie.current=e.nativeEvent.pageX-le.value},onPanResponderMove:function(e){if(ne.current>0){var t=e.nativeEvent.pageX-ie.current,r=Math.max(0,Math.min(t,ne.current));le.value=r;var n=r/ne.current*G;isNaN(n)||Z(n)}},onPanResponderRelease:function(){if(te(!1),z&&ne.current>0){var e=le.value/ne.current*G;isNaN(e)||z.setCurrentTime(e)}},onPanResponderTerminate:function(){te(!1)}}),ce=l.useAnimatedStyle((se=[new global.Error,-2,-27],(ae=function(){return{transform:[{translateX:le.value}]}}).__closure={knobPosition:le},ae.__workletHash=1935336866997,ae.__initData=q,ae.__stackDetails=se,ae));return n.useEffect((function(){h&&W&&z&&z.pause((function(){H(!1),O(null)}))}),[h]),e.jsxs(t.View,{style:r(E||(E=w(["rounded-lg w-56"]))),children:[e.jsxs(t.View,{style:r(k||(k=w(["flex-row items-center gap-2 px-2 pt-2"]))),children:[e.jsx(t.Pressable,{onPress:function(){z&&(W?z.pause((function(){H(!1),O(null)})):(O(v),z.play((function(e){e&&(H(!1),Z(0),le.value=l.withSpring(0),O(null))})),H(!0)))},style:[r(M||(M=w(["bg-black/40 rounded-full p-2"]))),null==x||null===(i=x.messageStyle)||void 0===i?void 0:i.audioPlayButtonStyle],children:W?P?e.jsx(P,{}):e.jsx(U,{style:r.style("h-6 w-6"),color:(null==x||null===(a=x.colors)||void 0===a?void 0:a.audioPauseIconColor)||"white"}):j?e.jsx(j,{}):e.jsx($,{style:r.style("h-6 w-6"),color:(null==x||null===(u=x.colors)||void 0===u?void 0:u.audioPlayIconColor)||"white"})}),e.jsxs(t.View,{ref:re,onLayout:function(e){var t,r=e.nativeEvent.layout.width;ne.current=r,null===(t=re.current)||void 0===t||t.measure((function(e,t,r,n,o){oe.current=o}))},style:[r(V||(V=w(["relative h-1 bg-zinc-400 rounded overflow-visible w-[75%]"]))),null==x||null===(c=x.messageStyle)||void 0===c?void 0:c.progressBarStyle],children:[e.jsx(t.View,{style:[r(R||(R=w(["absolute h-full bg-slate-200"]))),{width:"".concat(G>0?X/G*100:0,"%")},null==x||null===(d=x.messageStyle)||void 0===d?void 0:d.activeProgressBarStyle]}),e.jsx(l.View,m(m({},ue.panHandlers),{},{style:[ce,{position:"absolute",top:-6,width:16,height:16,borderRadius:8,backgroundColor:"white",shadowColor:"#000",shadowOffset:{width:0,height:2},shadowOpacity:.25,shadowRadius:3.84,elevation:5},m({},null==x||null===(f=x.messageStyle)||void 0===f?void 0:f.audioKnobStyle)]}))]})]}),e.jsx(t.View,{style:r(_||(_=w(["px-4 py-1"]))),children:e.jsx(t.Text,{style:T([r(N||(N=w(["text-xs text-gray-500"]))),null==x||null===(y=x.messageStyle)||void 0===y?void 0:y.audioDurationStyle],null==x?void 0:x.fontFamily),children:isNaN(X)?"0:00":L(X)})})]})},W=n.memo(D);function H(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Y,X={exports:{}},Z={exports:{}},K={};var G,Q,J,ee,te,re,ne,oe,ie,le,se,ae,ue,ce,de,fe={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -6,10 +6,10 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */function ye(){return Q||(Q=1,"production"===process.env.NODE_ENV?Z.exports=function(){if(Y)return K;Y=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case n:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case p:case y:case l:return e;default:return f}}case r:return f}}}function g(e){return x(e)===u}return K.AsyncMode=a,K.ConcurrentMode=u,K.ContextConsumer=s,K.ContextProvider=l,K.Element=t,K.ForwardRef=c,K.Fragment=n,K.Lazy=p,K.Memo=y,K.Portal=r,K.Profiler=i,K.StrictMode=o,K.Suspense=d,K.isAsyncMode=function(e){return g(e)||x(e)===a},K.isConcurrentMode=g,K.isContextConsumer=function(e){return x(e)===s},K.isContextProvider=function(e){return x(e)===l},K.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},K.isForwardRef=function(e){return x(e)===c},K.isFragment=function(e){return x(e)===n},K.isLazy=function(e){return x(e)===p},K.isMemo=function(e){return x(e)===y},K.isPortal=function(e){return x(e)===r},K.isProfiler=function(e){return x(e)===i},K.isStrictMode=function(e){return x(e)===o},K.isSuspense=function(e){return x(e)===d},K.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},K.typeOf=x,K}():Z.exports=(G||(G=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var v=e.type;switch(v){case a:case u:case n:case i:case o:case d:return v;default:var h=v&&v.$$typeof;switch(h){case s:case c:case p:case y:case l:return h;default:return f}}case r:return f}}}var g=a,w=u,j=s,S=l,P=t,C=c,O=n,I=p,A=y,T=r,E=i,k=o,M=d,V=!1;function R(e){return x(e)===u}fe.AsyncMode=g,fe.ConcurrentMode=w,fe.ContextConsumer=j,fe.ContextProvider=S,fe.Element=P,fe.ForwardRef=C,fe.Fragment=O,fe.Lazy=I,fe.Memo=A,fe.Portal=T,fe.Profiler=E,fe.StrictMode=k,fe.Suspense=M,fe.isAsyncMode=function(e){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||x(e)===a},fe.isConcurrentMode=R,fe.isContextConsumer=function(e){return x(e)===s},fe.isContextProvider=function(e){return x(e)===l},fe.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},fe.isForwardRef=function(e){return x(e)===c},fe.isFragment=function(e){return x(e)===n},fe.isLazy=function(e){return x(e)===p},fe.isMemo=function(e){return x(e)===y},fe.isPortal=function(e){return x(e)===r},fe.isProfiler=function(e){return x(e)===i},fe.isStrictMode=function(e){return x(e)===o},fe.isSuspense=function(e){return x(e)===d},fe.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},fe.typeOf=x}()),fe)),Z.exports}
9
+ */function ye(){return Q||(Q=1,"production"===process.env.NODE_ENV?Z.exports=function(){if(Y)return K;Y=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case a:case u:case n:case i:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case c:case p:case y:case l:return e;default:return f}}case r:return f}}}function g(e){return x(e)===u}return K.AsyncMode=a,K.ConcurrentMode=u,K.ContextConsumer=s,K.ContextProvider=l,K.Element=t,K.ForwardRef=c,K.Fragment=n,K.Lazy=p,K.Memo=y,K.Portal=r,K.Profiler=i,K.StrictMode=o,K.Suspense=d,K.isAsyncMode=function(e){return g(e)||x(e)===a},K.isConcurrentMode=g,K.isContextConsumer=function(e){return x(e)===s},K.isContextProvider=function(e){return x(e)===l},K.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},K.isForwardRef=function(e){return x(e)===c},K.isFragment=function(e){return x(e)===n},K.isLazy=function(e){return x(e)===p},K.isMemo=function(e){return x(e)===y},K.isPortal=function(e){return x(e)===r},K.isProfiler=function(e){return x(e)===i},K.isStrictMode=function(e){return x(e)===o},K.isSuspense=function(e){return x(e)===d},K.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},K.typeOf=x,K}():Z.exports=(G||(G=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,l=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,a=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,y=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,h=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,b=e?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var v=e.type;switch(v){case a:case u:case n:case i:case o:case d:return v;default:var h=v&&v.$$typeof;switch(h){case s:case c:case p:case y:case l:return h;default:return f}}case r:return f}}}var g=a,w=u,j=s,P=l,S=t,C=c,O=n,I=p,A=y,T=r,E=i,k=o,M=d,V=!1;function R(e){return x(e)===u}fe.AsyncMode=g,fe.ConcurrentMode=w,fe.ContextConsumer=j,fe.ContextProvider=P,fe.Element=S,fe.ForwardRef=C,fe.Fragment=O,fe.Lazy=I,fe.Memo=A,fe.Portal=T,fe.Profiler=E,fe.StrictMode=k,fe.Suspense=M,fe.isAsyncMode=function(e){return V||(V=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(e)||x(e)===a},fe.isConcurrentMode=R,fe.isContextConsumer=function(e){return x(e)===s},fe.isContextProvider=function(e){return x(e)===l},fe.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},fe.isForwardRef=function(e){return x(e)===c},fe.isFragment=function(e){return x(e)===n},fe.isLazy=function(e){return x(e)===p},fe.isMemo=function(e){return x(e)===y},fe.isPortal=function(e){return x(e)===r},fe.isProfiler=function(e){return x(e)===i},fe.isStrictMode=function(e){return x(e)===o},fe.isSuspense=function(e){return x(e)===d},fe.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===u||e===i||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===y||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===v)},fe.typeOf=x}()),fe)),Z.exports}
10
10
  /*
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,Se,Pe,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),S=g(n.useState(0),2),P=S[0],C=S[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(Se||(Se=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(Pe||(Pe=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(P)})})]})]}),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),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,{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"})})},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,{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(Pt,{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(St,{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(St,{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,P=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(S,{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){P({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?22:20,Ut="ios"===t.Platform.OS?48:46,Ft=Ut/2,Bt="h-6 w-6",qt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b=o.onSendMessage,x=o.onTypingStart,j=o.onTypingEnd,S=o.onAttachmentPress,P=o.onCameraPress,C=o.onAudioRecordStart,O=o.onAudioRecordEnd,E=o.CustomEmojiIcon,k=o.CustomAttachmentIcon,M=o.CustomCameraIcon,V=o.CustomSendIcon,R=o.CustomMicrophoneIcon,_=o.CustomFileIcon,N=o.CustomImagePreview,z=o.CustomVideoPreview,$=g(n.useState(""),2),L=$[0],U=$[1],F=g(n.useState({height:Lt,isMultiline:!1}),2),B=F[0],q=F[1],D=I(),H=D.theme,W=D.currentUserId,Y=D.showEmojiButton,X=D.showAttachmentsButton,Z=D.showCameraButton,K=D.showVoiceRecordButton,G=D.placeholder,Q=D.previewData,J=D.closePreview,ee=null==H||null===(i=H.sizes)||void 0===i?void 0:i.inputIconSize,te=function(e,t){if("number"==typeof e&&e>0)return{width:e,height:e};var n="string"==typeof e&&e.trim().length>0?e.trim():A;return r.style(n,t)}(ee),re="number"==typeof ee&&ee>0?ee:24,ne=!B.isMultiline,oe=Z&&!L.trim(),ie=n.useCallback((function(){q({height:Lt,isMultiline:!1})}),[]),le=n.useCallback((function(e){U(e),e.trim()||ie()}),[ie]),se=n.useCallback((function(e){var t=e.nativeEvent.contentSize.height;if(L.trim()){var r=Math.min(Math.max(t,Lt),100);q({height:r,isMultiline:r>Lt+4})}else ie()}),[L,ie]),ae=n.useCallback((function(){var e=L.trim();(e||Q)&&(b({text:e,senderId:W}),U(""),ie())}),[L,b,W,Q,ie]);n.useEffect((function(){L.trim()?null==x||x():null==j||j()}),[L,x,j]);var ue=function(r,n){return e.jsx(t.Pressable,{onPress:n,disabled:!n,style:{width:re,height:re,alignItems:"center",justifyContent:"center"},children:r})};return e.jsxs(t.View,{style:r(lt||(lt=w(["w-full px-2"]))),children:[Q&&e.jsx($t,{previewData:Q,closePreview:J,CustomFileIcon:_,CustomImagePreview:N,CustomVideoPreview:z,inputHeight:ne?Ut:B.height+24}),e.jsxs(t.View,{style:[r(st||(st=w(["flex-row items-end gap-2"]))),null==H||null===(l=H.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(at||(at=w(["flex-1 flex-row items-center bg-white px-2"]))),{minHeight:Ut,borderRadius:ne?Ft:22,paddingVertical:ne?0:8},null==H||null===(s=H.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Y&&ue(E?e.jsx(E,{}):e.jsx(Et,{style:te,color:(null==H||null===(a=H.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})),e.jsx(t.TextInput,{value:L,onChangeText:le,placeholder:G||"Message",style:T([r(ut||(ut=w(["flex-1 bg-transparent"]))),"ios"===t.Platform.OS?r(ct||(ct=w(["text-[17px]"]))):r(dt||(dt=w(["text-[16px]"]))),{minHeight:Lt,maxHeight:B.isMultiline?100:Lt,paddingVertical:ne?"ios"===t.Platform.OS?12:11:8,paddingHorizontal:4,color:(null==H||null===(u=H.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==H?void 0:H.fontFamily),placeholderTextColor:(null==H||null===(c=H.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,scrollEnabled:B.isMultiline,textAlignVertical:"center",onContentSizeChange:se},ne?"input-compact":"input-expanded"),e.jsxs(t.View,{style:r(ft||(ft=w(["flex-row items-center gap-3 pr-1"]))),children:[X&&ue(k?e.jsx(k,{}):e.jsx(Mt,{style:te,color:(null==H||null===(d=H.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"}),S),oe&&ue(M?e.jsx(M,{}):e.jsx(Tt,{style:te,color:(null==H||null===(f=H.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"}),P)]})]}),e.jsx(t.Pressable,{style:[r(yt||(yt=w(["rounded-full bg-green-600 justify-center items-center"]))),m({height:Ut,width:Ut},null==H||null===(y=H.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:L.trim()||Q?ae:C,onLongPress:C,onPressOut:O,children:L.trim()?V?e.jsx(V,{}):e.jsx(Vt,{style:r.style(Bt),color:(null==H||null===(p=H.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):K?R?e.jsx(R,{}):e.jsx(kt,{style:r.style("h-8 w-8"),color:(null==H||null===(v=H.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):V?e.jsx(V,{}):e.jsx(Vt,{style:r.style(Bt),color:(null==H||null===(h=H.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Dt=n.memo(qt);function Ht(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 Wt,Yt,Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr,sr=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(Ht,{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},ar=n.memo(sr),ur=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(Wt||(Wt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Yt||(Yt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Xt||(Xt=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(Zt||(Zt=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(Kt||(Kt=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(Gt||(Gt=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(Qt||(Qt=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(S,{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(Jt||(Jt=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(er||(er=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:T(r(tr||(tr=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var cr=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,S=o.CustomAttachmentIcon,P=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(Dt,{onSendMessage:f,onTypingStart:y,onTypingEnd:p,onAttachmentPress:v,onAudioRecordEnd:h,onAudioRecordStart:m,onCameraPress:b,CustomEmojiIcon:j,CustomAttachmentIcon:S,CustomCameraIcon:P,CustomMicrophoneIcon:C,CustomSendIcon:O,CustomFileIcon:A,CustomImagePreview:T,CustomVideoPreview:E}),z=e.jsxs(t.View,{style:r(rr||(rr=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(nr||(nr=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(ur,{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(ar,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(or||(or=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(ir||(ir=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(lr||(lr=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(cr,{})}))})};
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=H(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,We,He,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,jt,Pt,St=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(W,{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})]})},Ct=n.memo(St),Ot=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"})})},It=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})})},At=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?We||(We=w(["absolute right-3 bottom-3"])):He||(He=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(It,{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(Ot,{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(Ot,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(s=p.colors)||void 0===s?void 0:s.readIconColor)||"#3B82F6"})]})]})})},Tt=n.memo(At),Et=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(Ct,{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(Tt,{time:f.time,status:y?f.status:void 0,isCurrentUser:y,hasText:!!f.text,hasAudio:!!f.audio})]})},kt=n.memo(Et),Mt=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"})]})})},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",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"})]})})},Rt=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"})]})})},_t=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"})})},Nt=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"})]})})},zt=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)})},Lt=n.memo($t),Ut=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(zt,{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(Lt,{fileName:d.name,style:null==b||null===(c=b.filePreviewStyle)||void 0===c?void 0:c.text})})]})]})},Ft=n.memo(Ut),Bt="ios"===t.Platform.OS?32:30,qt="h-6 w-6",Dt=function(o){var i,l,s,a,u,c,d,f,y,p,v,h,b=o.onSendMessage,x=o.onTypingStart,j=o.onTypingEnd,P=o.onAttachmentPress,S=o.onCameraPress,C=o.onAudioRecordStart,O=o.onAudioRecordEnd,E=o.CustomEmojiIcon,k=o.CustomAttachmentIcon,M=o.CustomCameraIcon,V=o.CustomSendIcon,R=o.CustomMicrophoneIcon,_=o.CustomFileIcon,N=o.CustomImagePreview,z=o.CustomVideoPreview,$=g(n.useState(""),2),L=$[0],U=$[1],F=g(n.useState({height:Bt,isMultiline:!1}),2),B=F[0],q=F[1],D=I(),W=D.theme,H=D.currentUserId,Y=D.showEmojiButton,X=D.showAttachmentsButton,Z=D.showCameraButton,K=D.showVoiceRecordButton,G=D.placeholder,Q=D.previewData,J=D.closePreview,ee=function(e,t){if("number"==typeof e&&e>0)return{width:e,height:e};var n="string"==typeof e&&e.trim().length>0?e.trim():A;return r.style(n,t)}(null==W||null===(i=W.sizes)||void 0===i?void 0:i.inputIconSize),te=!B.isMultiline,re=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Bt),118);q({height:t,isMultiline:t>Bt})}),[]),ne=n.useCallback((function(){var e=L.trim();(e||Q)&&(b({text:e,senderId:H}),U(""),q({height:Bt,isMultiline:!1}))}),[L,b,H,Q]);return n.useEffect((function(){L.trim()?null==x||x():null==j||j()}),[L,x,j]),n.useEffect((function(){L.length||q({height:Bt,isMultiline:!1})}),[L]),e.jsxs(t.View,{style:r(lt||(lt=w(["w-full px-2"]))),children:[Q&&e.jsx(Ft,{previewData:Q,closePreview:J,CustomFileIcon:_,CustomImagePreview:N,CustomVideoPreview:z,inputHeight:B.height}),e.jsxs(t.View,{style:[r(st||(st=w(["flex-row items-end gap-2"]))),null==W||null===(l=W.inputStyles)||void 0===l?void 0:l.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(at||(at=w(["flex-1 px-3.5 bg-white flex-row gap-1"]))),r(te?ut||(ut=w(["rounded-full items-center"])):ct||(ct=w(["rounded-3xl items-end"]))),null==W||null===(s=W.inputStyles)||void 0===s?void 0:s.inputContainerStyle],children:[Y&&e.jsx(t.Pressable,{style:r(dt||(dt=w(["justify-center"]))),children:E?e.jsx(E,{}):e.jsx(Vt,{style:ee,color:(null==W||null===(a=W.colors)||void 0===a?void 0:a.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),e.jsx(t.TextInput,{value:L,onChangeText:U,placeholder:G||"Message",style:T([r(ft||(ft=w(["bg-transparent flex-1 pl-2 my-3"]))),"ios"===t.Platform.OS?r(yt||(yt=w(["text-[17px]"]))):r(pt||(pt=w(["text-[16px]"]))),{minHeight:Bt,maxHeight:118},{color:(null==W||null===(u=W.colors)||void 0===u?void 0:u.inputTextColor)||"rgba(247, 247, 247, 0.9)"}],null==W?void 0:W.fontFamily),placeholderTextColor:(null==W||null===(c=W.colors)||void 0===c?void 0:c.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:"center",onContentSizeChange:re}),e.jsxs(t.View,{style:r(vt||(vt=w(["flex-row items-center gap-4"]))),children:[X&&e.jsx(t.Pressable,{onPress:P,children:k?e.jsx(k,{}):e.jsx(_t,{style:ee,color:(null==W||null===(d=W.colors)||void 0===d?void 0:d.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Z&&!L.trim()&&e.jsx(t.Pressable,{onPress:S,children:M?e.jsx(M,{}):e.jsx(Mt,{style:ee,color:(null==W||null===(f=W.colors)||void 0===f?void 0:f.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),e.jsx(t.Pressable,{style:[r(ht||(ht=w(["p-2 rounded-full bg-green-600 justify-center items-center"]))),m({height:"ios"===t.Platform.OS?50:48,width:"ios"===t.Platform.OS?50:48},null==W||null===(y=W.inputStyles)||void 0===y?void 0:y.sendButtonStyle)],onPress:L.trim()||Q?ne:C,onLongPress:C,onPressOut:O,children:L.trim()?V?e.jsx(V,{}):e.jsx(Nt,{style:r.style(qt),color:(null==W||null===(p=W.colors)||void 0===p?void 0:p.sendIconsColor)||"rgba(255,255,255,0.7)"}):K?R?e.jsx(R,{}):e.jsx(Rt,{style:r.style("h-8 w-8"),color:(null==W||null===(v=W.colors)||void 0===v?void 0:v.sendIconsColor)||"rgba(255,255,255,0.7)"}):V?e.jsx(V,{}):e.jsx(Nt,{style:r.style(qt),color:(null==W||null===(h=W.colors)||void 0===h?void 0:h.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Wt=n.memo(Dt);function Ht(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 Yt,Xt,Zt,Kt,Gt,Qt,Jt,er,tr,rr,nr,or,ir,lr,sr,ar=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(mt||(mt=w(["top-0 bottom-0 left-0 right-0 bg-black/80 flex-1 absolute"]))),children:[e.jsx(t.Pressable,{onPress:u,style:r(bt||(bt=w(["absolute right-4 top-4 p-2 rounded-full bg-slate-100/70 z-10"]))),children:e.jsx(Ht,{style:r(xt||(xt=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(gt||(gt=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(wt||(wt=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(jt||(jt=w(["absolute inset-0 flex items-center justify-center bg-red-500/60 p-2"]))),children:e.jsx(t.Text,{style:T(r(Pt||(Pt=w(["text-white font-bold"]))),null==c?void 0:c.fontFamily),children:"Failed to load video"})})]})]})}):null},ur=n.memo(ar),cr=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(Yt||(Yt=w(["my-1 max-w-[75%] self-start flex-row"]))),children:[f&&e.jsxs(t.View,{style:r(Xt||(Xt=w(["flex-row"]))),children:[h.map((function(n,o){var i,l,s;return e.jsx(t.View,{style:[r(Zt||(Zt=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(Kt||(Kt=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(Gt||(Gt=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(Qt||(Qt=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(Jt||(Jt=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(er||(er=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(tr||(tr=w(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:T(r(rr||(rr=w(["text-gray-600"]))),null==d?void 0:d.fontFamily),children:"Typing..."})})})]})};var dr=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(Wt,{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(nr||(nr=w(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(or||(or=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(kt,{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(cr,{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(ur,{imageUrl:a.imageUrl,videoUrl:a.videoUrl,onClose:function(){u({imageUrl:"",videoUrl:""}),c(!1)}})]});return R?e.jsx(t.View,{style:r(ir||(ir=w(["flex-1"]))),children:z}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(lr||(lr=w(["flex-1"]))),children:z}):e.jsx(t.KeyboardAvoidingView,{style:r(sr||(sr=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(dr,{})}))})};
15
15
  //# sourceMappingURL=index.js.map