movius-chats 1.4.13 → 1.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +4 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/components/VoiceRecorder/VoiceRecorder.d.ts +37 -0
- package/lib/typescript/components/VoiceRecorder/VoiceRecorderFlow.d.ts +29 -0
- package/lib/typescript/components/VoiceRecorder/VoiceRecordingGesture.d.ts +25 -0
- package/lib/typescript/index.d.ts +3 -0
- package/package.json +5 -3
- package/src/components/VoiceRecorder/VoiceRecorder.tsx +388 -0
- package/src/components/VoiceRecorder/VoiceRecorderFlow.tsx +910 -0
- package/src/components/VoiceRecorder/VoiceRecordingGesture.tsx +404 -0
- package/src/index.tsx +17 -0
package/lib/commonjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react-native"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});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"),a=require("react-native-reanimated"),s=require("react-native-gesture-handler");function A(e,t){this.v=e,this.k=t}function l(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,n,o,i,a){try{var s=e[i](a),A=s.value}catch(e){return void r(e)}s.done?t(A):Promise.resolve(A).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){c(i,n,o,a,s,"next",e)}function s(e){c(i,n,o,a,s,"throw",e)}a(void 0)}))}}function d(e,t,r){return t=v(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,p()?Reflect.construct(t,r||[],v(e).constructor):t.apply(e,r))}function C(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 h(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 v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(p=function(){return!!e})()}function m(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 g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?m(Object(r),!0).forEach((function(t){h(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):m(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function y(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(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
3
|
-
var e,t,
|
|
3
|
+
var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var A=n&&n.prototype instanceof s?n:s,l=Object.create(A.prototype);return E(l,"_invoke",function(r,n,o){var i,s,A,l=0,c=o||[],u=!1,d={p:0,n:0,v:e,a:C,f:C.bind(e,4),d:function(t,r){return i=t,s=0,A=e,d.n=r,a}};function C(r,n){for(s=r,A=n,t=0;!u&&l&&!o&&t<c.length;t++){var o,i=c[t],C=d.p,f=i[2];r>3?(o=f===n)&&(A=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=C&&((o=r<2&&C<i[1])?(s=0,d.v=n,d.n=i[1]):C<f&&(o=r<3||i[0]>n||n>f)&&(i[4]=r,i[5]=n,d.n=f,s=0))}if(o||r>1)return a;throw u=!0,n}return function(o,c,f){if(l>1)throw TypeError("Generator is already running");for(u&&1===c&&C(c,f),s=c,A=f;(t=s<2?e:A)||!u;){i||(s?s<3?(s>1&&(d.n=-1),C(s,A)):d.n=A:d.v=A);try{if(l=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,A)))throw TypeError("iterator result is not an object");if(!t.done)return t;A=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(A=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(u=d.n<0)?A:r.call(n,d))!==a)break}catch(t){i=e,s=1,A=t}finally{l=1}}return{value:t,done:u}}}(r,o,i),!0),l}var a={};function s(){}function A(){}function l(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(E(t={},n,(function(){return this})),t),u=l.prototype=s.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,E(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return A.prototype=l,E(u,"constructor",l),E(l,"constructor",A),A.displayName="GeneratorFunction",E(l,o,"GeneratorFunction"),E(u),E(u,o,"Generator"),E(u,n,(function(){return this})),E(u,"toString",(function(){return"[object Generator]"})),(x=function(){return{w:i,m:d}})()}function w(e,t,r,n,o){var i=b(e,t,r,n,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function b(e,t,r,n,o){return new S(x().w(e,t,r,n),o||Promise)}function S(e,t){function r(n,o,i,a){try{var s=e[n](o),l=s.value;return l instanceof A?t.resolve(l.v).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(l).then((function(e){s.value=e,i(s)}),(function(e){return r("throw",e,i,a)}))}catch(e){a(e)}}var n;this.next||(E(S.prototype),E(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),E(this,"_invoke",(function(e,o,i){function a(){return new t((function(t,n){r(e,i,t,n)}))}return n=n?n.then(a,a):a()}),!0)}function E(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}E=function(e,t,r,n){function i(t,r){E(e,t,(function(e){return this._invoke(t,r,e)}))}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},E(e,t,r,n)}function _(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function R(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}function I(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,a,s=[],A=!0,l=!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){l=!0,o=e}finally{try{if(!A&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(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)?l(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 O(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+""}function M(){var e=x(),t=e.m(M),r=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function i(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,o[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,R(e),i)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(M=function(){return{wrap:function(t,r,n,o){return e.w(i(t),r,n,o&&o.reverse())},isGeneratorFunction:n,mark:e.m,awrap:function(e,t){return new A(e,t)},AsyncIterator:S,async:function(e,t,r,o,a){return(n(t)?b:w)(i(e),t,r,o,a)},keys:_,values:R}})()}var T=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"})})},V=["children"],P=n.createContext(void 0),G=function(t){var r=t.children,o=y(t,V),i=I(n.useState(null),2),a=i[0],s=i[1],A=I(n.useState(!1),2),l=A[0],c=A[1];return e.jsx(P.Provider,{value:g(g({},o),{},{mediaViewerGallery:a,setMediaViewerGallery:function(e,t){s({items:e,initialIndex:t});var r=e[t];c("video"===(null==r?void 0:r.kind))},clearMediaViewerGallery:function(){s(null),c(!1)},isVideoPlaying:l,setIsVideoPlaying:c}),children:r})},D=function(){var e=n.useContext(P);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function K(e){return null==e?void 0:e.colors}function L(e,t){var r,n,o,i,a=K(e),s=t?null!==(r=null==a?void 0:a.sentMediaTimestampBackground)&&void 0!==r?r:"rgba(0,0,0,0.45)":null!==(n=null==a?void 0:a.receivedMediaTimestampBackground)&&void 0!==n?n:"rgba(0,0,0,0.45)",A=t?null==e||null===(o=e.messageStyle)||void 0===o?void 0:o.sentMediaTimestampContainerStyle:null==e||null===(i=e.messageStyle)||void 0===i?void 0:i.receivedMediaTimestampContainerStyle;return g(g({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:s},A)}function F(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentFileAttachmentBackground)&&void 0!==n?n:"rgba(255, 255, 255, 0.15)":null!==(r=null==o?void 0:o.receivedFileAttachmentBackground)&&void 0!==r?r:"rgba(0, 0, 0, 0.08)"}function H(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentFileAttachmentTextColor)&&void 0!==n?n:"#ffffff":null!==(r=null==o?void 0:o.receivedFileAttachmentTextColor)&&void 0!==r?r:"#1f2937"}function B(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentFileAttachmentSubtitleColor)&&void 0!==n?n:"rgba(255,255,255,0.7)":null!==(r=null==o?void 0:o.receivedFileAttachmentSubtitleColor)&&void 0!==r?r:"rgba(31,41,55,0.65)"}function U(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentAudioSpeedTextColor)&&void 0!==n?n:"#ffffff":null!==(r=null==o?void 0:o.receivedAudioSpeedTextColor)&&void 0!==r?r:"#e5e7eb"}function Y(e,t){var r=K(e);return t?null==r?void 0:r.sentMessageTextColor:null==r?void 0:r.receivedMessageTextColor}function W(e,t){var r=K(e);return t?null==r?void 0:r.sentBubbleBackgroundColor:null==r?void 0:r.receivedBubbleBackgroundColor}function N(e){if(e.mediaItems&&e.mediaItems.length>0)return e.mediaItems;var t=[];return e.image&&t.push({uri:e.image,kind:"image"}),e.video&&t.push({uri:e.video,kind:"video"}),t}var z="ios"===t.Platform.OS?"h-6 w-6":"w-6 h-6";function Q(e,t){return t?[e,{fontFamily:t}]:e}function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J,q={exports:{}},$={exports:{}},Z={};var ee,te,re,ne,oe,ie,ae,se,Ae,le,ce,ue,de,Ce,fe,he={};
|
|
4
4
|
/** @license React v16.13.1
|
|
5
5
|
* react-is.development.js
|
|
6
6
|
*
|
|
@@ -8,10 +8,10 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toS
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/function
|
|
11
|
+
*/function ve(){return te||(te=1,"production"===process.env.NODE_ENV?$.exports=function(){if(J)return Z;J=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,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,A=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case A:case l:case n:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case s:case c:case f:case C:case a:return e;default:return d}}case r:return d}}}function y(e){return g(e)===l}return Z.AsyncMode=A,Z.ConcurrentMode=l,Z.ContextConsumer=s,Z.ContextProvider=a,Z.Element=t,Z.ForwardRef=c,Z.Fragment=n,Z.Lazy=f,Z.Memo=C,Z.Portal=r,Z.Profiler=i,Z.StrictMode=o,Z.Suspense=u,Z.isAsyncMode=function(e){return y(e)||g(e)===A},Z.isConcurrentMode=y,Z.isContextConsumer=function(e){return g(e)===s},Z.isContextProvider=function(e){return g(e)===a},Z.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Z.isForwardRef=function(e){return g(e)===c},Z.isFragment=function(e){return g(e)===n},Z.isLazy=function(e){return g(e)===f},Z.isMemo=function(e){return g(e)===C},Z.isPortal=function(e){return g(e)===r},Z.isProfiler=function(e){return g(e)===i},Z.isStrictMode=function(e){return g(e)===o},Z.isSuspense=function(e){return g(e)===u},Z.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===C||e.$$typeof===a||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},Z.typeOf=g,Z}():$.exports=(ee||(ee=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,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,A=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,d=e?Symbol.for("react.suspense_list"):60120,C=e?Symbol.for("react.memo"):60115,f=e?Symbol.for("react.lazy"):60116,h=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,p=e?Symbol.for("react.responder"):60118,m=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var h=e.type;switch(h){case A:case l:case n:case i:case o:case u:return h;default:var v=h&&h.$$typeof;switch(v){case s:case c:case f:case C:case a:return v;default:return d}}case r:return d}}}var y=A,x=l,w=s,b=a,S=t,E=c,_=n,R=f,k=C,I=r,O=i,j=o,M=u,T=!1;function V(e){return g(e)===l}he.AsyncMode=y,he.ConcurrentMode=x,he.ContextConsumer=w,he.ContextProvider=b,he.Element=S,he.ForwardRef=E,he.Fragment=_,he.Lazy=R,he.Memo=k,he.Portal=I,he.Profiler=O,he.StrictMode=j,he.Suspense=M,he.isAsyncMode=function(e){return T||(T=!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.")),V(e)||g(e)===A},he.isConcurrentMode=V,he.isContextConsumer=function(e){return g(e)===s},he.isContextProvider=function(e){return g(e)===a},he.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},he.isForwardRef=function(e){return g(e)===c},he.isFragment=function(e){return g(e)===n},he.isLazy=function(e){return g(e)===f},he.isMemo=function(e){return g(e)===C},he.isPortal=function(e){return g(e)===r},he.isProfiler=function(e){return g(e)===i},he.isStrictMode=function(e){return g(e)===o},he.isSuspense=function(e){return g(e)===u},he.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===l||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===C||e.$$typeof===a||e.$$typeof===s||e.$$typeof===c||e.$$typeof===v||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},he.typeOf=g}()),he)),$.exports}
|
|
12
12
|
/*
|
|
13
13
|
object-assign
|
|
14
14
|
(c) Sindre Sorhus
|
|
15
15
|
@license MIT
|
|
16
|
-
*/function ye(){if(ne)return te;ne=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return te=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={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,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)}(r),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++)n.call(i,l[c])&&(s[l[c]]=i[l[c]])}}return s},te}function me(){if(oe)return re;oe=1;return re="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ge(){return le?ie:(le=1,ie=Function.call.bind(Object.prototype.hasOwnProperty))}function xe(){if(ae)return se;ae=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=me(),n={},r=ge();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(r(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 n)){n[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&&(n={})},se=o}function be(){if(ce)return ue;ce=1;var e=pe(),t=ye(),n=me(),r=ge(),o=xe(),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){}}),ue=function(s,a){var u="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",d={array:p("array"),bigint:p("bigint"),bool:p("boolean"),func:p("function"),number:p("number"),object:p("object"),string:p("string"),symbol:p("symbol"),any:h(l),arrayOf:function(e){return h((function(t,r,o,i,l){if("function"!=typeof e)return new v("Property `"+l+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[r];if(!Array.isArray(s))return new v("Invalid "+i+" `"+l+"` of type `"+g(s)+"` supplied to `"+o+"`, expected an array.");for(var a=0;a<s.length;a++){var u=e(s,a,o,i,l+"["+a+"]",n);if(u instanceof Error)return u}return null}))},element:h((function(e,t,n,r,o){var i=e[t];return s(i)?null:new v("Invalid "+r+" `"+o+"` of type `"+g(i)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:h((function(t,n,r,o,i){var l=t[n];return e.isValidElementType(l)?null:new v("Invalid "+o+" `"+i+"` of type `"+g(l)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,n,r,o,i){if(!(t[n]instanceof e)){var l=e.name||c;return new v("Invalid "+o+" `"+i+"` of type `"+(((s=t[n]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+r+"`, expected instance of `"+l+"`.")}var s;return null}))},node:h((function(e,t,n,r,o){return m(e[t])?null:new v("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,o,i,l,s){if("function"!=typeof e)return new v("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var a=t[o],u=g(a);if("object"!==u)return new v("Invalid "+l+" `"+s+"` of type `"+u+"` supplied to `"+i+"`, expected an object.");for(var c in a)if(r(a,c)){var d=e(a,c,i,l,s+"."+c,n);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 h((function(t,n,r,o,i){for(var l=t[n],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 v("Invalid "+o+" `"+i+"` of value `"+String(l)+"` supplied to `"+r+"`, 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 "+b(o)+" at index "+t+"."),l}return h((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,n);if(null==c)return null;c.data&&r(c.data,"expectedType")&&a.push(c.data.expectedType)}return new v("Invalid "+l+" `"+s+"` supplied to `"+i+"`"+(a.length>0?", expected one of type ["+a.join(", ")+"]":"")+".")}))},shape:function(e){return h((function(t,r,o,i,l){var s=t[r],a=g(s);if("object"!==a)return new v("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 y(o,i,l,u,x(c));var d=c(s,u,o,i,l+"."+u,n);if(d)return d}return null}))},exact:function(e){return h((function(o,i,l,s,a){var u=o[i],c=g(u);if("object"!==c)return new v("Invalid "+s+" `"+a+"` of type `"+c+"` supplied to `"+l+"`, expected `object`.");var d=t({},o[i],e);for(var f in d){var h=e[f];if(r(e,f)&&"function"!=typeof h)return y(l,s,a,f,x(h));if(!h)return new v("Invalid "+s+" `"+a+"` key `"+f+"` supplied to `"+l+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var p=h(u,f,l,s,a+"."+f,n);if(p)return p}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function v(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function h(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,l,s,u,d,f,h){if(u=u||c,f=f||s,h!==n){if(a){var p=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 p.name="Invariant Violation",p}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=u+":"+s;!t[y]&&r<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[y]=!0,r++)}}return null==l[s]?o?null===l[s]?new v("The "+d+" `"+f+"` is marked as required in `"+u+"`, but its value is `null`."):new v("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 p(e){return h((function(t,n,r,o,i,l){var s=t[n];return g(s)!==e?new v("Invalid "+o+" `"+i+"` of type `"+x(s)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function y(e,t,n,r,o){return new v((e||"React class")+": "+t+" type `"+n+"."+r+"` 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 n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!m(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function g(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=g(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function b(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 v.prototype=Error.prototype,d.checkPropTypes=o,d.resetWarningCache=o.resetWarningCache,d.PropTypes=d,d},ue}function we(){if(fe)return de;fe=1;var e=me();function t(){}function n(){}return n.resetWarningCache=t,de=function(){function r(t,n,r,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 r}r.isRequired=r;var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i}}function je(){if(ve)return X.exports;if(ve=1,"production"!==process.env.NODE_ENV){var e=pe();X.exports=be()(e.isElement,true)}else X.exports=we()();return X.exports}var Ce=K(je()),Se=function(){return v((function e(t,n){f(this,e),this.text=t,this.patterns=n||[]}),[{key:"parse",value:function(){var e=this,t=[{children:this.text}];return this.patterns.forEach((function(n){var r=[],o=n.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)r.push(t);else{var o,s=[],a=t.children,u=0;for(n.pattern.lastIndex=0;a&&(o=n.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(n,o[0],o,u)),a=a.substr(o.index+o[0].length),u+=o[0].length-1,n.pattern.lastIndex=0}s.push({children:a}),r.push.apply(r,s)}})),t=r})),t.forEach((function(e){return delete e._matched})),t.filter((function(e){return!!e.children}))}},{key:"getMatchedPart",value:function(e,t,n,r){var o={};Object.keys(e).forEach((function(n){"pattern"!==n&&"renderText"!==n&&"nonExhaustiveModeMaxMatchCount"!==n&&("function"==typeof e[n]?o[n]=function(){return e[n](t,r)}:o[n]=e[n])}));var i=t;return e.renderText&&"function"==typeof e.renderText&&(i=e.renderText(t,n)),g(g({},o),{},{children:i,_matched:!0})}}])}(),Ae=["type"],Pe=["style"],ke=["parse","childrenProps"],Ie={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+/},Te=Ce.shape(g(g({},t.Text.propTypes),{},{type:Ce.oneOf(Object.keys(Ie)).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Oe=Ce.shape(g(g({},t.Text.propTypes),{},{pattern:Ce.oneOfType([Ce.string,Ce.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Ce.number})),Re=function(){function n(){return f(this,n),d(this,n,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&&k(e,t)}(n,r.Component),v(n,[{key:"setNativeProps",value:function(e){this._root.setNativeProps(e)}},{key:"getPatterns",value:function(){return this.props.parse.map((function(e){var t=e.type,n=x(e,Ae);if(t){if(!Ie[t])throw new Error("".concat(e.type," is not a supported type"));n.pattern=Ie[t]}return n}))}},{key:"getParsedText",value:function(){var n=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Se(this.props.children,this.getPatterns()).parse().map((function(r,o){var i=n.props.style,l=r.style,s=x(r,Pe);return e.jsx(t.Text,g(g({style:[i,l]},n.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var n=this,r=g({},this.props);r.parse,r.childrenProps;var o=x(r,ke);return e.jsx(t.Text,g(g({ref:function(e){return n._root=e}},o),{},{children:this.getParsedText()}))}}])}();Re.displayName="ParsedText",Re.propTypes=g(g({},t.Text.propTypes),{},{parse:Ce.arrayOf(Ce.oneOfType([Te,Oe])),childrenProps:Ce.shape(t.Text.propTypes)}),Re.defaultProps={parse:null,childrenProps:{}};var Me,Ee,Ve,_e,Fe,Be,Le,ze,De,Ne,We,He=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 15 15",children:e.jsx(o.Path,{fill:r,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"})})},$e=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},Ue=r.createContext(void 0),qe=function(t){var n=t.children,o=I(r.useState(null),2),i=o[0],l=o[1];return e.jsx(Ue.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:l},children:n})},Ge=function(e){var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n<10?"0":"").concat(n)},Ke=[1,1.5,2],Ye=42;function Xe(r){var o,i,l,s,a,u=r.isPlaying,c=r.playbackRate,d=r.onCycleSpeed,f=r.senderAvatar,v=r.senderName,h=r.isCurrentUser,p=r.theme;return u?e.jsx(t.Pressable,{onPress:d,style:[n(Me||(Me=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(t.Text,{style:G([n(Ee||(Ee=T(["text-xs font-semibold"]))),{color:W(p,h)},null==p||null===(i=p.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==p?void 0:p.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):f?e.jsx(t.Image,{source:{uri:f},style:[n(Ve||(Ve=T(["rounded-full"]))),{width:Ye,height:Ye},null==p||null===(l=p.bubbleStyle)||void 0===l?void 0:l.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.View,{style:[n(_e||(_e=T(["rounded-full items-center justify-center"]))),{width:Ye,height:Ye,backgroundColor:h?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(t.Text,{style:G([n(Fe||(Fe=T(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==p?void 0:p.fontFamily),children:(s=v,a=null==s?void 0:s.trim(),a?a.charAt(0).toUpperCase():"?")})})}var Qe,Ze,Je,et,tt,nt,rt,ot,it=function(o){var l,s,a=o.audioUrl,u=o.audioId,c=o.isVideoPlaying,d=o.isCurrentUser,f=o.senderAvatar,v=o.senderName,h=o.reserveStatusSpace,p=void 0===h||h,y=F(),m=y.theme,x=y.CustomPlayIcon,b=y.CustomPauseIcon,w=y.showMessageStatus,j=function(){var e=r.useContext(Ue);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),C=j.currentlyPlayingId,S=j.setCurrentlyPlayingId,A=r.useRef(null),P=I(r.useState(!1),2),k=P[0],O=P[1],R=I(r.useState(0),2),M=R[0],E=R[1],V=I(r.useState(0),2),_=V[0],L=V[1],z=I(r.useState(!1),2),D=z[0],N=z[1],W=I(r.useState(1),2),H=W[0],$=W[1],U=I(r.useState(0),2),q=U[0],K=U[1],Y=r.useRef(null),X=r.useMemo((function(){return function(e,t){for(var n=5381,r=0;r<e.length;r++)n=(n<<5)+n+e.charCodeAt(r)|0;return Array.from({length:t},(function(e,t){return n=0|Math.imul(n^n>>>16,73244475+31337*t),n^=n>>>13,.18+Math.abs(n)%100/100*.82}))}(a,50)}),[a]),Q=function(e,t){var n,r,o,i,l=B(e);return t?{inactive:null!==(o=null==l?void 0:l.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==l?void 0:l.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(n=null==l?void 0:l.receivedAudioWaveformColor)&&void 0!==n?n:"rgba(0,0,0,0.20)",active:null!==(r=null==l?void 0:l.receivedAudioWaveformActiveColor)&&void 0!==r?r:"rgba(0,0,0,0.60)"}}(m,d),Z=Q.inactive,J=Q.active,ee=function(e,t){var n,r,o,i,l=B(e);return t?null!==(o=null!==(i=null==l?void 0:l.sentAudioTimestampColor)&&void 0!==i?i:null==l?void 0:l.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(n=null!==(r=null==l?void 0:l.receivedAudioTimestampColor)&&void 0!==r?r:null==l?void 0:l.receivedTimestampColor)&&void 0!==n?n:"rgba(0,0,0,0.45)"}(m,d),te=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==n?n:"#374151"}(m,d),ne=function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==r?r:"#ffffff":null!==(n=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==n?n:"#374151"}(m,d),re=k&&!(c||!!C&&C!==u),oe=_>0?M/_:0,ie=r.useCallback((function(e){var t;(L(e.duration),null!==Y.current)&&(null===(t=A.current)||void 0===t||t.seek(Y.current),Y.current=null)}),[]),le=r.useCallback((function(e){var t=e.currentTime;D||E(t)}),[D]),se=r.useCallback((function(){var e;O(!1),E(0),null===(e=A.current)||void 0===e||e.seek(0),S(null)}),[S]),ae=r.useCallback((function(){re?(O(!1),S(null)):(S(u),O(!0))}),[re,u,S]),ue=r.useCallback((function(){$((function(e){var t=Ke.indexOf(e),n=Ke[(t+1)%Ke.length];return null!=n?n:1}))}),[]),ce=r.useCallback((function(e){var t=q;if(!(t<=0||_<=0)){var n,r=Math.max(0,Math.min(e/t,1))*_;if(E(r),_>0)null===(n=A.current)||void 0===n||n.seek(r);else Y.current=r}}),[_,q]),de=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){N(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return N(!1)},onPanResponderTerminate:function(){return N(!1)}})}),[ce]),fe=e.jsx(t.Pressable,{onPress:ae,hitSlop:8,style:n(Be||(Be=T(["shrink-0 px-0.5"]))),children:re?b?e.jsx(b,{}):e.jsx(He,{style:n.style("h-6 w-6"),color:ne}):x?e.jsx(x,{}):e.jsx($e,{style:n.style("h-6 w-6"),color:te})}),ve=e.jsx(Xe,{isPlaying:re,playbackRate:H,onCycleSpeed:ue,senderAvatar:f,senderName:v,isCurrentUser:d,theme:m}),he=e.jsx(t.View,{style:[n(Le||(Le=T(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return K(e.nativeEvent.layout.width)},children:e.jsx(t.View,g(g({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==m||null===(l=m.messageStyle)||void 0===l?void 0:l.progressBarStyle]},de.panHandlers),{},{children:X.map((function(n,r){var o,i=(r+.5)/50<=oe;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*n)),borderRadius:2,backgroundColor:i?J:Z},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},r)}))}))});return e.jsxs(t.View,{style:[n(ze||(ze=T(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),p&&w&&n(De||(De=T(["pb-4"])))],children:[e.jsx(i,{ref:A,source:{uri:a},paused:!re,rate:H,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:le,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(t.View,{style:n(Ne||(Ne=T(["flex-row items-center gap-1.5"]))),children:d?e.jsxs(e.Fragment,{children:[ve,fe,he]}):e.jsxs(e.Fragment,{children:[fe,he,ve]})}),e.jsx(t.Text,{style:G([n(We||(We=T(["text-[11px] mt-1"]))),{color:ee,paddingLeft:d?82:34},null==m||null===(s=m.messageStyle)||void 0===s?void 0:s.audioDurationStyle],null==m?void 0:m.fontFamily),children:Ge(re?M:_>0?_:M)})]})},lt=r.memo(it),st=function(n){var i=n.style,l=n.spinning,s=void 0!==l&&l,a=r.useRef(new t.Animated.Value(0)).current;r.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"})})})},at=320,ut=at,ct=Math.round(176),dt=at-ct-2,ft=Math.round(159),vt=function(o){var l,s=o.uri,a=o.cellStyle,u=o.roundedStyle,c=F(),d=c.theme,f=c.CustomPlayIcon,v=r.useRef(null),h=I(r.useState(0),2),p=h[0],y=h[1],m=I(r.useState(!0),2),g=m[0],x=m[1],b=I(r.useState(!1),2),w=b[0],j=b[1];return e.jsxs(t.View,{style:[a,u],pointerEvents:"none",children:[e.jsx(i,{source:{uri:s},ref:v,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[u,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){x(!0),j(!1)},onLoad:function(e){y(e.duration),x(!1)},onError:function(){j(!0),x(!1)}}),g&&e.jsx(t.View,{style:[n(Qe||(Qe=T(["absolute inset-0 items-center justify-center bg-black/40"]))),u],children:e.jsx(st,{style:n.style("h-8 w-8"),spinning:!0})}),!g&&!w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(Ze||(Ze=T(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:f?e.jsx(f,{}):e.jsx($e,{style:n.style("h-10 w-10"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.videoPlayIconColor)||"white"})}),e.jsx(t.View,{style:n(Je||(Je=T(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:n(et||(et=T(["text-white text-[10px] font-semibold"]))),children:ht(p)})})]}),w&&e.jsx(t.View,{style:[n(tt||(tt=T(["absolute inset-0 items-center justify-center bg-red-500/50"]))),u],children:e.jsx(t.Text,{style:G(n(nt||(nt=T(["text-white text-xs"]))),null==d?void 0:d.fontFamily),children:"Video"})})]})};function ht(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),n=Math.floor(e%60);return"".concat(t,":").concat(n.toString().padStart(2,"0"))}var pt,yt,mt,gt,xt,bt,wt,jt,Ct,St,At,Pt,kt,It,Tt,Ot,Rt,Mt,Et,Vt,_t,Ft,Bt,Lt,zt=function(r){var o=r.items,i=r.onOpenGallery,l=t.useWindowDimensions().width,s=Math.min(240,.72*l);if(0===o.length)return null;var a={borderRadius:6,overflow:"hidden"};if(1===o.length){var u=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(vt,{uri:u.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:ut,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(n,r){return e.jsx(t.Pressable,{onPress:function(){return i(o,r)},style:{width:c,height:ut},children:"image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:n.uri,cellStyle:{width:c,height:ut},roundedStyle:a})},"".concat(n.uri,"-").concat(r))}))})}if(3===o.length){var d=o[0],f=o[1],v=o[2],h=(s-2)/2;return e.jsxs(t.View,{style:{width:s,height:at,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:ct},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:d.uri,cellStyle:{width:s,height:ct},roundedStyle:a})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:dt},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:dt},children:"image"===f.kind?e.jsx(t.Image,{source:{uri:f.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:f.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(f.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:dt},children:"image"===v.kind?e.jsx(t.Image,{source:{uri:v.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:v.uri,cellStyle:{width:h,height:dt},roundedStyle:a})},"".concat(v.uri,"-2"))]})]})}var p=(s-2)/2,y=o.length-4,m=o.slice(0,4);return e.jsx(t.View,{style:{width:s,height:at,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(r,l){return e.jsxs(t.Pressable,{onPress:function(){return i(o,l)},style:{width:p,height:ft,position:"relative"},children:["image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[a,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(vt,{uri:r.uri,cellStyle:{width:p,height:ft},roundedStyle:a}),3===l&&y>0&&e.jsx(t.View,{style:n(rt||(rt=T(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:n(ot||(ot=T(["text-white text-lg font-bold"]))),children:["+",y]})})]},"".concat(r.uri,"-").concat(l))}))})},Dt=function(o){var i,l,s,a,u=o.message,c=o.onGalleryOpen,d=o.isVideoPlaying,f=o.isCurrentUser,v=F(),h=v.theme,p=v.showMessageStatus,y=v.onFileAttachmentPress,m=r.useMemo((function(){return U(u)}),[u]);return e.jsxs(t.View,{children:[m.length>0&&e.jsx(zt,{items:m,onOpenGallery:c}),(null!==(i=u.fileAttachments)&&void 0!==i?i:[]).map((function(r,o){var i,l,s,a,u,c;return e.jsxs(t.Pressable,{onPress:function(){y?y(r):t.Linking.openURL(r.uri.startsWith("http")||r.uri.startsWith("file:")?r.uri:"file://".concat(r.uri))},style:[n(pt||(pt=T(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:z(h,f)},f?null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.receivedFileAttachmentStyle],children:[e.jsxs(t.Text,{style:G([n(yt||(yt=T(["text-xs font-semibold"]))),{color:D(h,f)},f?null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.sentFileAttachmentTextStyle:null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.receivedFileAttachmentTextStyle],null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",r.name]}),e.jsx(t.Text,{style:G([n(mt||(mt=T(["text-[10px] mt-0.5"]))),{color:N(h,f)},f?null==h||null===(u=h.messageStyle)||void 0===u?void 0:u.sentFileAttachmentSubtitleStyle:null==h||null===(c=h.messageStyle)||void 0===c?void 0:c.receivedFileAttachmentSubtitleStyle],null==h?void 0:h.fontFamily),children:r.type})]},"".concat(r.uri,"-").concat(o))})),u.audio&&e.jsx(lt,{audioUrl:u.audio,audioId:u.id,isVideoPlaying:d,isCurrentUser:f,senderAvatar:u.senderAvatar,senderName:u.senderName,reserveStatusSpace:!u.text}),u.text&&e.jsx(Re,{style:G([n(gt||(gt=T(["pt-1"]))),n(p?xt||(xt=T(["pb-0"])):bt||(bt=T(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},f?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedTextStyle,H(h,f)?{color:H(h,f)}:void 0],null==h?void 0:h.fontFamily),parse:[{type:"url",style:g({color:"blue",textDecorationLine:"underline"},(a=null==h?void 0:h.fontFamily,a?{fontFamily:a}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:u.text})]})},Nt=r.memo(Dt),Wt=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:r,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"})})},Ht=function(t){var n=t.style,r=t.fill;return e.jsx(o,{style:n,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:r})})},$t=function(r){var o,i,l,s=r.time,a=r.status,u=r.isCurrentUser,c=r.hasText,d=r.hasAudio,f=r.hasGalleryMedia,v=r.hasFileAttachments,h=F(),p=h.theme,y=h.showMessageStatus,m=(f||v)&&!c&&!d,g=f&&!c&&!d?"#ffffff":m?function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u):function(e,t){var n,r,o=B(e);return t?null!==(r=null==o?void 0:o.sentTimestampColor)&&void 0!==r?r:"rgba(255, 255, 255, 0.75)":null!==(n=null==o?void 0:o.receivedTimestampColor)&&void 0!==n?n:"rgba(107, 114, 128, 0.85)"}(p,u);return e.jsx(e.Fragment,{children:y&&e.jsxs(t.View,{style:[n(wt||(wt=T(["flex-row items-center"]))),c?n(jt||(jt=T(["justify-end pb-1 ml-4"]))):d?n(Ct||(Ct=T(["absolute right-3 bottom-2"]))):m?[n(St||(St=T(["absolute right-3 bottom-4"]))),L(p,u)]:[n(At||(At=T(["absolute right-3 bottom-4"]))),L(p,u)]],children:[e.jsx(t.Text,{style:G([n(Pt||(Pt=T(["text-xs"]))),{color:g}],null==p?void 0:p.fontFamily),children:s}),u&&e.jsxs(t.View,{style:n(kt||(kt=T(["ml-1 flex-row items-center"]))),children:["sent"===a&&e.jsx(Ht,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(o=p.colors)||void 0===o?void 0:o.sentIconColor)||"#6B7280"}),"delivered"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==p||null===(i=p.colors)||void 0===i?void 0:i.deliveredIconColor)||"#6B7280"}),"read"===a&&e.jsx(Wt,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==p||null===(l=p.colors)||void 0===l?void 0:l.readIconColor)||"#3B82F6"})]})]})})},Ut=r.memo($t),qt=function(r){var o,i,l,s,a,u,c,d,f,v,h=r.message,p=r.isCurrentUser,y=r.isFirstInSequence,m=r.onLongPress,x=F(),b=x.theme,w=x.showAvatars,j=x.showUserNames,C=x.showBubbleTail,S=x.setMediaViewerGallery,A=x.isVideoPlaying,P=U(h),k=(null!==(o=null===(i=h.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===P.length&&!h.text&&!h.audio;return e.jsxs(t.Pressable,{onLongPress:m,style:[n(It||(It=T(["px-2 my-1 max-w-[75%] relative"]))),n(p?Tt||(Tt=T(["self-end mr-3"])):Ot||(Ot=T(["self-start ml-9"]))),n(y?p?Rt||(Rt=T(["bg-green-500 rounded-tr-none"])):Mt||(Mt=T(["bg-white rounded-tl-none"])):p?Et||(Et=T(["bg-green-500"])):Vt||(Vt=T(["bg-white"]))),g(g({borderRadius:8},$(b,p)?{backgroundColor:$(b,p)}:{}),p?null==b||null===(l=b.bubbleStyle)||void 0===l?void 0:l.sent:null==b||null===(s=b.bubbleStyle)||void 0===s?void 0:s.received)],children:[!p&&y&&w&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:n(_t||(_t=T(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:h.senderAvatar?e.jsx(t.Image,{source:{uri:h.senderAvatar},style:[n(Ft||(Ft=T(["w-full h-full rounded-full"]))),null==b||null===(a=b.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:G([n(Bt||(Bt=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==b||null===(u=b.bubbleStyle)||void 0===u?void 0:u.avatarTextStyle],null==b?void 0:b.fontFamily),children:null===(c=h.senderName)||void 0===c?void 0:c.charAt(0)})}),j&&h.senderName&&e.jsx(t.Text,{style:G([n(Lt||(Lt=T(["text-sm text-black font-semibold mt-1 capitalize"]))),null==b||null===(d=b.bubbleStyle)||void 0===d?void 0:d.userNameStyle],null==b?void 0:b.fontFamily),children:h.senderName})]}),y&&C&&e.jsx(M,{style:n.style("absolute w-6 h-6",p?"rotate-90 -right-3.5 mt-[1.24px] -top-1":"rotate-180 -left-3.5 mt-[1.5px] -top-[3px]"),color:p?(null==b||null===(f=b.colors)||void 0===f?void 0:f.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==b||null===(v=b.colors)||void 0===v?void 0:v.receivedMessageTailColor)||"white"}),e.jsx(Nt,{message:h,isCurrentUser:p,isFirstInSequence:y,onGalleryOpen:function(e,t){S(e,t)},isVideoPlaying:A}),e.jsx(Ut,{time:h.time,status:p?h.status:void 0,isCurrentUser:p,hasText:!!h.text,hasAudio:!!h.audio,hasGalleryMedia:P.length>0&&!h.text,hasFileAttachments:k})]})},Gt=r.memo(qt),Kt=function(t){var n=t.style,r=t.color;return e.jsx(o.Svg,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Yt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:r,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"})]})})},Xt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Qt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,fill:r,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"})})},Zt=function(t){var n=t.style,r=t.color;return e.jsx(o,{style:n,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",strokeWidth:"1.5",stroke:r,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"})]})})},Jt={code:"function AnimatedHoldMicTsx1(){const{scale}=this.__closure;return{transform:[{scale:scale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx",sourceMap:'{"version":3,"names":["AnimatedHoldMicTsx1","scale","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx"],"mappings":"AAU2C,SAAAA,oBAAA,QAAAC,KAAA,OAAAC,SAAA,OAAO,CAC1CC,SAAS,CAAE,CAAC,CAAEF,KAAK,CAAEA,KAAK,CAACG,KAAM,CAAC,CACtC,CAAC","ignoreList":[]}',version:"3.16.7"},en=function(t){var n=t.color,o=void 0===n?"#ef4444":n,i=t.size,s=void 0===i?28:i,a=t.style,u=l.useSharedValue(1);r.useEffect((function(){u.value=l.withRepeat(l.withSequence(l.withTiming(1.22,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var c,d,f=l.useAnimatedStyle((c=[new global.Error,-2,-27],(d=function(){return{transform:[{scale:u.value}]}}).__closure={scale:u},d.__workletHash=3539239666849,d.__initData=Jt,d.__stackDetails=c,d));return e.jsx(l.View,{style:[f,a],children:e.jsx(Xt,{style:{width:s,height:s},color:o})})},tn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsx(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},nn=function(t){var n=t.style,r=t.color,i=void 0===r?"#6b7280":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Rect,{x:"5",y:"11",width:"14",height:"10",rx:"2",stroke:i,strokeWidth:"1.5"}),e.jsx(o.Path,{d:"M8 11V7a4 4 0 0 1 8 0v4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})},rn={code:"function LockSlideColumnTsx1(){const{chevronY}=this.__closure;return{transform:[{translateY:chevronY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx1","chevronY","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAoB0C,SAAAA,oBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,QAAQ,CAACI,KAAM,CAAC,CAC9C,CAAC","ignoreList":[]}',version:"3.16.7"},on={code:"function LockSlideColumnTsx2(){const{lockScale}=this.__closure;return{transform:[{scale:lockScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx2","lockScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAuBuC,SAAAA,oBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CACtCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},ln=function(n){var o,i,s,a,u,c,d=n.slideY,f=n.lockSlideDistance,v=n.recordingUIProps,h=n.voiceRecorderStyles,p=null!==(o=null==v?void 0:v.lockPillBackground)&&void 0!==o?o:"rgba(30,30,30,0.88)",y=null!==(i=null==v?void 0:v.lockIconColor)&&void 0!==i?i:"#e5e7eb",m=null!==(s=null==v?void 0:v.chevronIconColor)&&void 0!==s?s:"#9ca3af",g=null!==(a=null==v?void 0:v.lockPillGap)&&void 0!==a?a:8,x=null!==(u=null==v?void 0:v.lockPillMarginBottom)&&void 0!==u?u:10,b=l.useSharedValue(0);r.useEffect((function(){b.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:450,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:450,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var w=l.useSharedValue(.92);r.useEffect((function(){w.value=l.withRepeat(l.withSequence(l.withTiming(1,{duration:550,easing:l.Easing.out(l.Easing.ease)}),l.withTiming(.92,{duration:550,easing:l.Easing.in(l.Easing.ease)})),-1,!1)}),[]);var j,C,S=l.useAnimatedStyle((j=[new global.Error,-2,-27],(C=function(){return{transform:[{translateY:b.value}]}}).__closure={chevronY:b},C.__workletHash=0xfad898b1b5b,C.__initData=rn,C.__stackDetails=j,C)),A=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{scale:w.value}]}};return t.__closure={lockScale:w},t.__workletHash=0xbc18c7930ff,t.__initData=on,t.__stackDetails=e,t}()),P=Math.min(1,Math.max(0,-d/f));return e.jsx(t.View,{style:[{alignItems:"center",marginBottom:x},null==h?void 0:h.lockContainer],pointerEvents:"none",children:e.jsxs(t.View,{style:[{backgroundColor:p,borderRadius:22,paddingVertical:10,paddingHorizontal:14,alignItems:"center",gap:g,opacity:.85+.15*P,borderWidth:P>.85?1.5:0,borderColor:null!==(c=null==v?void 0:v.lockPillActiveBorderColor)&&void 0!==c?c:"#22c55e"},null==h?void 0:h.lockPill],children:[e.jsx(l.View,{style:A,children:e.jsx(nn,{style:{width:20,height:20},color:y})}),e.jsx(l.View,{style:S,children:e.jsx(tn,{style:{width:18,height:18},color:m})})]})})},sn={code:"function LongPressRecordingTsx1(){const{slideTextX,cancelProgress}=this.__closure;return{transform:[{translateX:slideTextX.value}],opacity:1-cancelProgress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx1","slideTextX","cancelProgress","__closure","transform","translateX","value","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAc4C,SAAAA,uBAAA,QAAAC,UAAA,CAAAC,cAAA,OAAAC,SAAA,OAAO,CAC3CC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,UAAU,CAACK,KAAM,CAAC,CAAC,CAC7CC,OAAO,CAAE,CAAC,CAAGL,cACjB,CAAC","ignoreList":[]}',version:"3.16.7"},an=function(n){var o,i,s=n.duration,a=n.slideX,u=n.containerHeight,c=void 0===u?50:u,d=n.fontFamily,f=n.voiceRecorderStyles,v=n.recordingUIProps,h=null!==(o=null==v?void 0:v.cancelTextColor)&&void 0!==o?o:"rgba(107,114,128,1)",p=null!==(i=null==v?void 0:v.timerColor)&&void 0!==i?i:"#374151",y=l.useSharedValue(0);r.useEffect((function(){y.value=l.withRepeat(l.withSequence(l.withTiming(-6,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var m,g,x=Math.min(1,Math.abs(Math.min(0,a))/70),b=l.useAnimatedStyle((m=[new global.Error,-3,-27],(g=function(){return{transform:[{translateX:y.value}],opacity:1-x}}).__closure={slideTextX:y,cancelProgress:x},g.__workletHash=0xbbdd56b2a8f,g.__initData=sn,g.__stackDetails=m,g));return e.jsxs(t.View,{style:[{flex:1,flexDirection:"row",alignItems:"center",minHeight:c,paddingHorizontal:4},null==f?void 0:f.longPressBar],children:[e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:p,minWidth:44,fontFamily:d},null==f?void 0:f.timer,null==v?void 0:v.timerTextStyle],children:Ge(s)}),e.jsx(l.View,{style:[b,{flex:1,alignItems:"center"}],children:e.jsx(t.Text,{style:[{fontSize:14,color:h,fontFamily:d},null==f?void 0:f.slideText],children:"< Slide to cancel"})})]})},un=function(t){var n=t.style,r=t.color,i=void 0===r?"#ef4444":r;return e.jsxs(o,{style:n,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Path,{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx(o.Path,{d:"M10 11v6M14 11v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})};function cn(e,t){return Array.from({length:e},(function(n,r){if(!t)return.3;var o=r/(e-1);return o<.12||o>.88?.08:o<.22||o>.78?.18:.3}))}var dn=function(n){var o=n.isActive,i=n.color,l=void 0===i?"rgba(0,0,0,0.45)":i,s=n.height,a=void 0===s?26:s,u=n.style,c=n.barCount,d=void 0===c?30:c,f=n.showOuterDots,v=void 0!==f&&f,h=I(r.useState((function(){return cn(d,v)})),2),p=h[0],y=h[1];return r.useEffect((function(){y(cn(d,v))}),[d,v]),r.useEffect((function(){if(o){var e=setInterval((function(){return y((function(e){return function(e,t){var n=e.length;return Array.from({length:n},(function(r,o){if(!t)return.15+.85*Math.random();var i=o/(n-1);return i<.12||i>.88?e[o]:i<.22||i>.78?.12+.35*Math.random():.2+.8*Math.random()}))}(e,v)}))}),110);return function(){return clearInterval(e)}}y(cn(d,v))}),[o,d,v]),e.jsx(t.View,{style:[{flexDirection:"row",alignItems:"center",height:a,gap:2},u],children:p.map((function(n,r){var o=Math.max(3,Math.round(n*a)),i=v&&(r/(p.length-1)<.22||r/(p.length-1)>.78);return e.jsx(t.View,{style:{flex:1,height:o,borderRadius:i?o/2:2,backgroundColor:l}},r)}))})};function fn(n){var r=n.color,o=void 0===r?"rgba(255,255,255,0.5)":r,i=n.size,l=void 0===i?26:i;return e.jsx(t.View,{style:{width:l,height:l,borderRadius:l/2,borderWidth:2,borderColor:o,justifyContent:"center",alignItems:"center"},children:e.jsx(t.View,{style:{width:4,height:4,borderRadius:2,backgroundColor:o}})})}var vn=function(n){var r,o,i,l,s,a,u,c,d,f,v=n.isRecording,h=n.isPaused,p=n.duration,y=n.onCancel,m=n.onSend,g=n.onPause,x=n.onResume,b=n.containerHeight,w=void 0===b?50:b,j=n.fontFamily,C=n.sendButtonColor,S=void 0===C?"#16a34a":C,A=n.sendIconColor,P=void 0===A?"#ffffff":A,k=n.enablePauseResume,I=void 0===k||k,T=n.voiceRecorderStyles,O=n.recordingUIProps,R=n.CustomPlayIcon,M=n.CustomPauseIcon,E=null!==(r=null==O?void 0:O.waveformColor)&&void 0!==r?r:"rgba(0,0,0,0.45)",V=null!==(o=null==O?void 0:O.cancelTextColor)&&void 0!==o?o:"#ef4444",_=null!==(i=null==O?void 0:O.timerColor)&&void 0!==i?i:"#374151",F=null!==(l=null==O?void 0:O.recordingBackground)&&void 0!==l?l:"transparent",B=null!==(s=null==O?void 0:O.playPauseIconColor)&&void 0!==s?s:"#ef4444",L=null!==(a=null==O?void 0:O.playPauseIconSize)&&void 0!==a?a:24,z=null!==(u=null==O?void 0:O.waveformBarCount)&&void 0!==u?u:30,D=null===(c=null==O?void 0:O.showWaveformOuterDots)||void 0===c||c,N=null===(d=null==O?void 0:O.showTimerRing)||void 0===d||d,W=null!==(f=null==O?void 0:O.timerRingColor)&&void 0!==f?f:"rgba(0,0,0,0.3)";return e.jsxs(t.View,{style:[{backgroundColor:F,paddingHorizontal:4,gap:4},null==T?void 0:T.normalBar],children:[e.jsxs(t.View,{style:{flexDirection:"row",alignItems:"center",gap:8},children:[e.jsx(t.Text,{style:[{fontSize:14,fontWeight:"600",color:_,minWidth:40,fontFamily:j},null==T?void 0:T.timer,null==O?void 0:O.timerTextStyle],children:Ge(p)}),e.jsx(dn,{isActive:v&&!h,color:E,height:Math.round(.5*w),barCount:z,showOuterDots:D,style:[{flex:1},null==T?void 0:T.waveform]}),N&&e.jsx(fn,{color:W,size:24})]}),e.jsxs(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:w},children:[e.jsx(t.Pressable,{onPress:y,style:[{width:w,height:w,borderRadius:w/2,justifyContent:"center",alignItems:"center",backgroundColor:"".concat(V,"18")},null==T?void 0:T.trashButton],hitSlop:6,children:e.jsx(un,{style:{width:.44*w,height:.44*w},color:V})}),I&&e.jsx(t.Pressable,{onPress:h?x:g,style:[{flex:1,alignItems:"center",justifyContent:"center",height:w},null==T?void 0:T.playPauseButton],hitSlop:8,children:h?R?e.jsx(R,{}):e.jsx($e,{style:{width:L,height:L},color:B}):M?e.jsx(M,{}):e.jsx(He,{style:{width:L,height:L},color:B})}),!I&&e.jsx(t.View,{style:{flex:1}}),e.jsx(t.Pressable,{onPress:m,style:[{width:w,height:w,borderRadius:w/2,backgroundColor:S,justifyContent:"center",alignItems:"center"},null==T?void 0:T.sendButton],hitSlop:4,children:e.jsx(Zt,{style:{width:.44*w,height:.44*w},color:P})})]})]})};function hn(){return pn.apply(this,arguments)}function pn(){return(pn=c(R().mark((function e(){var n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==t.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,t.PermissionsAndroid.request(t.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return n=e.sent,e.abrupt("return",n===t.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var yn=function(t){var n=t.style,r=t.fill,i=void 0===r?"currentColor":r;return e.jsxs(o,{style:n,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"})]})},mn=function(n){var r=n.fileName,o=n.style,i=F().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:G([{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 n=e.slice(0,t),r=e.slice(t);return n.length>40?n.slice(0,40)+"..."+r:n+r}(r)})},gn=r.memo(mn);function xn(e){return e.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var bn,wn,jn,Cn,Sn,An,Pn,kn,In,Tn,On,Rn,Mn,En,Vn,_n,Fn,Bn,Ln,zn,Dn,Nn=function(n){var r,o=n.previews,l=n.closePreview,s=n.onRemoveItem,a=n.CustomFileIcon,u=n.CustomImagePreview,c=n.CustomVideoPreview,d=n.inputHeight,f=F(),v=f.theme,h=f.setMediaViewerGallery,p=o.filter((function(e){var t,n;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(n=e.type)||void 0===n?void 0:n.startsWith("video/"))})),y=o.filter((function(e){var t,n;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(n=e.type)&&void 0!==n&&n.startsWith("video/"))})),m=xn(o);if(0===o.length)return null;var g=function(e){0!==m.length&&h(m,e)},x=function(n){var r,o,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,s=null===(r=n.type)||void 0===r?void 0:r.startsWith("image/"),a=null===(o=n.type)||void 0===o?void 0:o.startsWith("video/");return s&&u?e.jsx(u,{uri:n.uri}):a&&c?e.jsx(c,{uri:n.uri}):s?e.jsx(t.Image,{source:{uri:n.uri},style:{width:l,height:l,borderRadius:12},resizeMode:"cover"}):a?e.jsx(t.View,{style:{width:l,height:l,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:n.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},b=function(n,r){return e.jsx(t.Pressable,{onPress:function(){return s?s(n):null==l?void 0:l()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:r?[{rotate:r}]:void 0},children:e.jsx(t.Text,{style:G({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==v?void 0:v.fontFamily),children:"×"})})};return e.jsx(t.View,{style:[{position:"absolute",bottom:(null!=d?d:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==v||null===(r=v.filePreviewStyle)||void 0===r?void 0:r.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===p.length)return null;if(1===p.length){var n=p[0];return n?e.jsxs(t.Pressable,{onPress:function(){return g(0)},style:{position:"relative"},children:[x(n),b(n.uri)]}):null}var r=p.slice(0,3),o=p.length>3?p.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:r.map((function(n,i){var l=2===r.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",s=2===r.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=xn(p).findIndex((function(e){return e.uri===n.uri}));g(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:l}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[x(n),2===i&&o>0&&e.jsx(t.View,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),b(n.uri,s)]})},"".concat(n.uri,"-").concat(i))}))})}(),y.length>0&&e.jsx(t.ScrollView,{scrollEnabled:y.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:y.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:y.map((function(n,r){return function(n,r){var o,i,l,s;return e.jsxs(t.View,{style:{position:"relative"},children:[e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==v||null===(o=v.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==v||null===(i=v.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:a?e.jsx(a,{}):e.jsx(yn,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==v||null===(l=v.filePreviewStyle)||void 0===l?void 0:l.nameContainer],children:e.jsx(gn,{fileName:n.name||"File",style:null==v||null===(s=v.filePreviewStyle)||void 0===s?void 0:s.text})})]}),b(n.uri)]},"".concat(n.uri,"-").concat(r))}(n,r)}))})]})})},Wn=r.memo(Nn),Hn="ios"===t.Platform.OS?32:30,$n="ios"===t.Platform.OS?50:48,Un="h-6 w-6",qn=function(o){var i,l,s,a,u,d,f,v,h,p,y,m,x,b,w,j,C,S,A,P,k,O,M,E,V,_=o.onSendMessage,B=o.onTypingStart,L=o.onTypingEnd,z=o.onAttachmentPress,D=o.onCameraPress,N=o.onAudioRecordStart,W=o.onAudioRecordEnd,H=o.CustomEmojiIcon,$=o.CustomAttachmentIcon,U=o.CustomCameraIcon,K=o.CustomSendIcon,Y=o.CustomMicrophoneIcon,X=o.CustomFileIcon,Q=o.CustomImagePreview,Z=o.CustomVideoPreview,J=I(r.useState(""),2),ee=J[0],te=J[1],ne=I(r.useState(0),2),re=ne[0],oe=ne[1],ie=I(r.useState({height:Hn,isMultiline:!1}),2),le=ie[0],se=ie[1],ae=F(),ue=ae.theme,ce=ae.currentUserId,de=ae.showEmojiButton,fe=ae.showAttachmentsButton,ve=ae.showCameraButton,he=ae.showVoiceRecordButton,pe=ae.placeholder,ye=ae.previewData,me=ae.previewItems,ge=ae.closePreview,xe=ae.onRemovePreviewItem,be=ae.voiceRecorderProps,we=ae.voiceRecorderStyles,je=ae.recordingUIProps,Ce=ae.renderVoiceRecorder,Se=ae.CustomPlayIcon,Ae=ae.CustomPauseIcon,Pe=r.useMemo((function(){return null!=me&&me.length?me:ye?[ye]:[]}),[me,ye]),ke=Pe.length>0,Ie=null==ue||null===(i=ue.sizes)||void 0===i?void 0:i.inputIconSize,Te=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():q;return n.style(t)}(Ie),Oe="number"==typeof(V=Ie)&&V>0?V:24,Re=0===ee.trim().length&&!le.isMultiline,Me=Math.max(0,($n-Oe)/2),Ee=Re?{paddingTop:Me,paddingBottom:Me}:{paddingBottom:Me},Ve=r.useCallback((function(){se({height:Hn,isMultiline:!1}),oe((function(e){return e+1}))}),[]),_e=r.useCallback((function(e){te(e),0===e.length&&Ve()}),[Ve]),Fe=r.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Hn),118),n=t>Hn;se({height:n?t:Hn,isMultiline:n})}),[]),Be=r.useCallback((function(){var e=ee.trim();(e||ke)&&(_({text:e,senderId:ce}),te(""),Ve())}),[ee,_,ce,ke,Ve]);r.useEffect((function(){ee.trim()?null==B||B():null==L||L()}),[ee,B,L]);var Le=!!ee.trim()||ke,ze=I(r.useState("idle"),2),De=ze[0],Ne=ze[1],We=r.useRef("idle"),He=r.useCallback((function(e){We.current=e,Ne(e)}),[]),$e=null!==(l=null==je?void 0:je.lockSlideDistance)&&void 0!==l?l:72,Ue=r.useRef($e);Ue.current=$e;var qe=I(r.useState(0),2),Ge=qe[0],Ke=qe[1],Ye=I(r.useState(0),2),Xe=Ye[0],Qe=Ye[1],Ze=r.useRef(0),Je=r.useRef(0),et=r.useCallback((function(e){null==W||W(e)}),[W]),tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDuration,n=void 0===t?300:t,o=e.onRecordStart,i=e.onRecordEnd,l=I(r.useState("idle"),2),s=l[0],a=l[1],u=I(r.useState(0),2),d=u[0],f=u[1],v=r.useRef(null),h=r.useRef(null),p=r.useRef(0),y=r.useRef(i);y.current=i;var m=r.useRef(o);m.current=o;var g=r.useRef(n);g.current=n;var x=r.useCallback((function(){h.current&&(clearInterval(h.current),h.current=null)}),[]),b=r.useCallback((function(e){x(),h.current=setInterval((function(){p.current+=1,f(p.current),p.current>=g.current&&e()}),1e3)}),[x]),w=r.useCallback(c(R().mark((function e(){var t,n;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,hn();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),v.current=t,p.current=0,f(0),a("recording"),b((function(){return A.current()})),null===(n=m.current)||void 0===n||n.call(m)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[b]),j=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.stop(),a("paused"),x()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[x]),C=r.useCallback(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(v.current){e.next=2;break}return e.abrupt("return");case 2:try{v.current.start(),a("recording"),b((function(){return A.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[b]),S=r.useCallback(c(R().mark((function e(){var t,n,r,o,i;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current){e.next=3;break}return e.abrupt("return",null);case 3:return x(),v.current=null,n=p.current,p.current=0,a("idle"),f(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,n),mimeType:"audio/wav"},null===(r=y.current)||void 0===r||r.call(y,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[x]),A=r.useRef(S);A.current=S;var P=r.useCallback((function(){return A.current()}),[]),k=r.useCallback(c(R().mark((function e(){var t,n,r,o;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=v.current,x(),v.current=null,p.current=0,a("idle"),f(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(n=e.sent)){e.next=21;break}return e.prev=12,r=require("react-native-fs"),o=n.startsWith("file://")?n.slice(7):n,e.next=17,r.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[x]);return r.useEffect((function(){return function(){x();try{var e;null===(e=v.current)||void 0===e||e.stop()}catch(e){}}}),[x]),{status:s,duration:d,isRecording:"recording"===s,isPaused:"paused"===s,startRecording:w,pauseRecording:j,resumeRecording:C,stopRecording:P,cancelRecording:k}}({maxDuration:null!==(s=null==be?void 0:be.maxDuration)&&void 0!==s?s:300,onRecordStart:N,onRecordEnd:et}),nt=r.useRef(tt);nt.current=tt;var rt=r.useCallback(c(R().mark((function e(){var t;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nt.current.stopRecording();case 2:t=e.sent,He("idle"),t&&_({audio:t.uri,senderId:ce});case 5:case"end":return e.stop()}}),e)}))),[_,ce,He]),ot=r.useCallback((function(){nt.current.cancelRecording(),He("idle"),Ke(0),Qe(0),Ze.current=0,Je.current=0}),[He]),it=r.useRef(rt);it.current=rt;var lt=r.useRef(ot);lt.current=ot;var st=r.useRef(),at=r.useRef(!1),ut=r.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return at.current},onPanResponderGrant:function(){at.current=!1,Ze.current=0,Je.current=0,Ke(0),Qe(0),st.current=setTimeout(c(R().mark((function e(){return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return at.current=!0,e.next=3,nt.current.startRecording();case 3:He("longPress");case 4:case"end":return e.stop()}}),e)}))),500)},onPanResponderMove:function(e,t){at.current&&(Ze.current=t.dx,Je.current=t.dy,Ke(t.dx),Qe(t.dy),!1!==(null==be?void 0:be.enableLockRecording)&&t.dy<=-Ue.current&&"longPress"===We.current&&(He("locked"),Je.current=-Ue.current,Qe(-Ue.current)))},onPanResponderRelease:(e=c(R().mark((function e(t,n){var r;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(st.current),r=at.current,at.current=!1,r){e.next=8;break}return e.next=6,nt.current.startRecording();case 6:return He("normal"),e.abrupt("return");case 8:if("locked"!==We.current){e.next=10;break}return e.abrupt("return");case 10:n.dx<-70?lt.current():it.current();case 11:case"end":return e.stop()}}),e)}))),function(t,n){return e.apply(this,arguments)}),onPanResponderTerminate:function(){clearTimeout(st.current),at.current=!1}});var e}),[]),ct=null!==(a=null!==(u=null==je?void 0:je.recordingSendButtonBackground)&&void 0!==u?u:null==ue||null===(d=ue.inputStyles)||void 0===d||null===(d=d.sendButtonStyle)||void 0===d?void 0:d.backgroundColor)&&void 0!==a?a:"#16a34a",dt=null!==(f=null==ue||null===(v=ue.colors)||void 0===v?void 0:v.sendIconsColor)&&void 0!==f?f:"#ffffff",ft=null!==(h=null!==(p=null==je?void 0:je.longPressMicColor)&&void 0!==p?p:null==ue||null===(y=ue.colors)||void 0===y?void 0:y.sendIconsColor)&&void 0!==h?h:"#ffffff",vt=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.containerBorderTopColor)&&void 0!==n?n:"rgba(0,0,0,0.12)";return g({borderTopWidth:null!==(r=null==t?void 0:t.containerBorderTopWidth)&&void 0!==r?r:1,borderTopColor:o,paddingTop:10,paddingBottom:4},null==e?void 0:e.container)}(we,je);if("idle"!==De){var ht,pt,yt,mt,gt,xt={isRecording:tt.isRecording,isPaused:tt.isPaused,duration:tt.duration,isLocked:"locked"===De,slideOffset:{x:Ge,y:Xe},waveformData:[],startRecording:tt.startRecording,stopRecording:tt.stopRecording,pauseRecording:tt.pauseRecording,resumeRecording:tt.resumeRecording,cancelRecording:ot};return e.jsxs(t.View,{style:n(bn||(bn=T(["w-full px-2"]))),children:[ke&&e.jsx(Wn,{previews:Pe,closePreview:ge,onRemoveItem:xe,CustomFileIcon:X,CustomImagePreview:Q,CustomVideoPreview:Z,inputHeight:le.height}),e.jsx(t.View,{style:vt,children:Ce?Ce(xt):"longPress"===De?e.jsxs(t.View,{style:[n(wn||(wn=T(["flex-row items-end gap-2"]))),null==ue||null===(ht=ue.inputStyles)||void 0===ht?void 0:ht.inputSectionContainerStyle],children:[e.jsx(an,{duration:tt.duration,slideX:Ge,containerHeight:$n,fontFamily:null==ue?void 0:ue.fontFamily,voiceRecorderStyles:we,recordingUIProps:je}),e.jsxs(t.View,{style:{alignItems:"center"},children:[e.jsx(ln,{slideY:Xe,lockSlideDistance:$e,recordingUIProps:je,voiceRecorderStyles:we}),e.jsx(t.View,g(g({},ut.panHandlers),{},{style:[n(jn||(jn=T(["rounded-full justify-center items-center"]))),{height:$n,width:$n,backgroundColor:ct},null==we?void 0:we.holdMicButton,null==ue||null===(pt=ue.inputStyles)||void 0===pt?void 0:pt.sendButtonStyle],children:e.jsx(en,{color:ft,size:null!==(yt=null!==(mt=null==je?void 0:je.recordingIconSize)&&void 0!==mt?mt:null==je?void 0:je.iconSize)&&void 0!==yt?yt:28})}))]})]}):e.jsx(vn,{isRecording:tt.isRecording,isPaused:tt.isPaused,duration:tt.duration,onCancel:ot,onSend:rt,onPause:tt.pauseRecording,onResume:tt.resumeRecording,enablePauseResume:null===(gt=null==be?void 0:be.enablePauseResume)||void 0===gt||gt,containerHeight:$n,fontFamily:null==ue?void 0:ue.fontFamily,sendButtonColor:ct,sendIconColor:dt,voiceRecorderStyles:we,recordingUIProps:je,CustomPlayIcon:Se,CustomPauseIcon:Ae})})]})}return e.jsxs(t.View,{style:n(Cn||(Cn=T(["w-full px-2"]))),children:[ke&&e.jsx(Wn,{previews:Pe,closePreview:ge,onRemoveItem:xe,CustomFileIcon:X,CustomImagePreview:Q,CustomVideoPreview:Z,inputHeight:le.height}),e.jsxs(t.View,{style:[n(Sn||(Sn=T(["flex-row items-end gap-2"]))),null==ue||null===(m=ue.inputStyles)||void 0===m?void 0:m.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[n(An||(An=T(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:$n,borderRadius:Re?9999:24,alignItems:Re?"center":"flex-end"},null==ue||null===(x=ue.inputStyles)||void 0===x?void 0:x.inputContainerStyle],children:[de&&e.jsx(t.View,{style:Ee,children:e.jsx(t.Pressable,{children:H?e.jsx(H,{}):e.jsx(Yt,{style:Te,color:(null==ue||null===(b=ue.colors)||void 0===b?void 0:b.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:ee,onChangeText:_e,placeholder:pe||"Message",style:G([n(Pn||(Pn=T(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?n(kn||(kn=T(["text-[17px]"]))):n(In||(In=T(["text-[16px]"]))),{minHeight:Hn,maxHeight:118,paddingVertical:Re?0:8,marginVertical:Re?($n-Hn)/2:4},{color:(null==ue||null===(w=ue.colors)||void 0===w?void 0:w.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==ue?void 0:ue.fontFamily),placeholderTextColor:(null==ue||null===(j=ue.colors)||void 0===j?void 0:j.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:le.isMultiline&&ee.length>0?"top":"center",onContentSizeChange:Fe},"chat-input-".concat(re)),e.jsxs(t.View,{style:[n(Tn||(Tn=T(["flex-row items-center gap-4"]))),Ee],children:[fe&&e.jsx(t.Pressable,{onPress:z,children:$?e.jsx($,{}):e.jsx(Qt,{style:Te,color:(null==ue||null===(C=ue.colors)||void 0===C?void 0:C.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),ve&&!ee.trim()&&e.jsx(t.Pressable,{onPress:D,children:U?e.jsx(U,{}):e.jsx(Kt,{style:Te,color:(null==ue||null===(S=ue.colors)||void 0===S?void 0:S.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),Le?e.jsx(t.Pressable,{onPress:Be,style:[n(On||(On=T(["rounded-full justify-center items-center"]))),g({height:$n,width:$n,backgroundColor:"#16a34a"},null==ue||null===(A=ue.inputStyles)||void 0===A?void 0:A.sendButtonStyle)],children:K?e.jsx(K,{}):e.jsx(Zt,{style:n.style(Un),color:(null==ue||null===(P=ue.colors)||void 0===P?void 0:P.sendIconsColor)||"rgba(255,255,255,0.7)"})}):he?e.jsx(t.View,g(g({},ut.panHandlers),{},{style:[n(Rn||(Rn=T(["rounded-full justify-center items-center"]))),g({height:$n,width:$n,backgroundColor:"#16a34a"},null==ue||null===(k=ue.inputStyles)||void 0===k?void 0:k.sendButtonStyle)],children:Y?e.jsx(Y,{}):e.jsx(Xt,{style:n.style("h-8 w-8"),color:(null==ue||null===(O=ue.colors)||void 0===O?void 0:O.sendIconsColor)||"rgba(255,255,255,0.7)"})})):e.jsx(t.Pressable,{onPress:Be,style:[n(Mn||(Mn=T(["rounded-full justify-center items-center"]))),g({height:$n,width:$n,backgroundColor:"#16a34a"},null==ue||null===(M=ue.inputStyles)||void 0===M?void 0:M.sendButtonStyle)],children:K?e.jsx(K,{}):e.jsx(Zt,{style:n.style(Un),color:(null==ue||null===(E=ue.colors)||void 0===E?void 0:E.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},Gn=r.memo(qn);function Kn(t){var r=t.style;return e.jsxs(o.Svg,{viewBox:"0 0 24 24",fill:"none",stroke:"black",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:n.style("h-6 w-6 text-black",r),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 Yn,Xn,Qn,Zn,Jn,er,tr,nr,rr,or,ir,lr,sr,ar=function(o){var i,l=o.gallery,s=o.onClose,a=F(),u=a.theme,c=a.setIsVideoPlaying,d=r.useRef(null),f=null!==(i=null==l?void 0:l.initialIndex)&&void 0!==i?i:0,v=I(r.useState(f),2),h=v[0],p=v[1],y=t.useWindowDimensions(),m=y.width,g=y.height;r.useEffect((function(){if(null!=l&&l.items.length){var e=l.initialIndex;p(e);var t=l.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=d.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==l?void 0:l.initialIndex,null==l?void 0:l.items,c]);var x=r.useCallback((function(){c(!1),s()}),[s,c]),b=r.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/m);p(t);var n=null==l?void 0:l.items[t];c("video"===(null==n?void 0:n.kind))}),[null==l?void 0:l.items,m,c]);return l&&0!==l.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:x,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[n(En||(En=T(["flex-1 bg-black"]))),{width:m,height:g}],children:[e.jsx(t.Pressable,{onPress:x,style:n(Vn||(Vn=T(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Kn,{style:n(_n||(_n=T(["h-8 w-8"])))})}),l.items.length>1&&e.jsx(t.View,{style:n(Fn||(Fn=T(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:G(n(Bn||(Bn=T(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==u?void 0:u.fontFamily),children:[h+1," / ",l.items.length]})}),e.jsx(t.FlatList,{ref:d,data:l.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:l.initialIndex,extraData:h,getItemLayout:function(e,t){return{length:m,offset:m*t,index:t}},onMomentumScrollEnd:b,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=d.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var n=t.item,r=t.index;return e.jsx(ur,{item:n,width:m,height:g,isActive:r===h,autoPlayVideo:r===f&&"video"===n.kind})}})]})}):null},ur=function(o){var l=o.item,s=o.width,a=o.height,u=o.isActive,c=o.autoPlayVideo,d=F().theme,f=r.useRef(null),v=I(r.useState("video"===l.kind),2),h=v[0],p=v[1],y=I(r.useState(!1),2),m=y[0],g=y[1],x="video"===l.kind&&u&&c;return"image"===l.kind?e.jsx(t.View,{style:{width:s,height:a,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:l.uri},style:{width:s,height:a},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:s,height:a,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(i,{source:{uri:l.uri},ref:f,controls:!0,paused:!x,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:s-32,height:.55*a,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){p(!0),g(!1)},onLoad:function(){return p(!1)},onBuffer:function(e){var t=e.isBuffering;return p(t)},onError:function(){g(!0),p(!1)}}),h&&e.jsx(t.View,{style:n(Ln||(Ln=T(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(st,{style:n.style("h-14 w-14"),spinning:!0})}),m&&e.jsx(t.View,{style:n(zn||(zn=T(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:G(n(Dn||(Dn=T(["text-white font-semibold"]))),null==d?void 0:d.fontFamily),children:"Failed to load video"})})]})},cr=r.memo(ar),dr=function(r){var o,i,l,s,a,u=r.typingUsers,c=r.currentUserId,d=F(),f=d.theme,v=d.showAvatars,h=d.renderCustomTyping,p=d.showBubbleTail,y=d.typingText,m=u.filter((function(e){return e.id!==c}));if(!m.length)return null;var x=m.slice(0,2),b=m.length-2,w=v?x.length+(b>0?1:0):0,j=w>0?24+14*Math.max(0,w-1):0,C=w>0?j+12:8,S=-(j+12);return e.jsxs(t.View,{style:[n(Yn||(Yn=T(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:C},null==f||null===(o=f.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[v&&w>0&&e.jsxs(t.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[x.map((function(r,o){var i,l,s;return e.jsx(t.View,{style:[n(Xn||(Xn=T(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:x.length+o}],children:r.avatar?e.jsx(t.Image,{source:{uri:r.avatar},style:[n(Qn||(Qn=T(["w-full h-full object-cover rounded-full"]))),null==f||null===(i=f.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(t.Text,{style:G([n(Zn||(Zn=T(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==f||null===(l=f.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==f?void 0:f.fontFamily),children:null===(s=r.name)||void 0===s?void 0:s.charAt(0)})},r.id)})),b>0&&e.jsx(t.View,{style:[n(Jn||(Jn=T(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},g({},null==f||null===(i=f.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:G([n(er||(er=T(["text-white text-xs font-semibold"]))),null==f||null===(l=f.bubbleStyle)||void 0===l?void 0:l.additionalTypingUsersTextStyle],null==f?void 0:f.fontFamily),children:["+",b]})})]}),p&&e.jsx(M,{style:n.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==f||null===(s=f.colors)||void 0===s?void 0:s.receivedMessageTailColor)||"white"}),h?h():e.jsx(t.View,{style:n(tr||(tr=T(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:G([n(nr||(nr=T(["text-gray-600"]))),null==f||null===(a=f.bubbleStyle)||void 0===a?void 0:a.typingTextStyle],null==f?void 0:f.fontFamily),children:null!=y?y:"Typing..."})})]})};var fr=function(){var o=F(),i=o.messages,l=o.currentUserId,s=o.onMessageLongPress,a=o.mediaViewerGallery,u=o.clearMediaViewerGallery,c=o.typingUsers,d=o.onSendMessage,f=o.onTypingStart,v=o.onTypingEnd,h=o.onAttachmentPress,p=o.onAudioRecordEnd,y=o.onAudioRecordStart,m=o.onCameraPress,g=o.renderCustomInput,x=o.CustomEmojiIcon,b=o.CustomAttachmentIcon,w=o.CustomCameraIcon,j=o.CustomMicrophoneIcon,C=o.CustomSendIcon,S=o.CustomFileIcon,A=o.CustomImagePreview,P=o.CustomVideoPreview,k=o.keyboardVerticalOffset,O=void 0===k?0:k,R=o.disableKeyboardAvoiding,M=void 0!==R&&R,E=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=I(r.useState(0),2),o=n[0],i=n[1];return r.useEffect((function(){if(e){var n="ios"===t.Platform.OS?"keyboardWillShow":"keyboardDidShow",r="ios"===t.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=t.Keyboard.addListener(n,(function(e){i(e.endCoordinates.height)})),l=t.Keyboard.addListener(r,(function(){return i(0)}));return function(){o.remove(),l.remove()}}i(0)}),[e]),e?o:0}(!M),V=g?g():e.jsx(Gn,{onSendMessage:d,onTypingStart:f,onTypingEnd:v,onAttachmentPress:h,onAudioRecordEnd:p,onAudioRecordStart:y,onCameraPress:m,CustomEmojiIcon:x,CustomAttachmentIcon:b,CustomCameraIcon:w,CustomMicrophoneIcon:j,CustomSendIcon:C,CustomFileIcon:S,CustomImagePreview:A,CustomVideoPreview:P}),_=e.jsxs(t.View,{style:n(rr||(rr=T(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:n(or||(or=T(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var n,r=t.item,o=t.index;return e.jsx(Gt,{message:r,isCurrentUser:r.senderId===l,onLongPress:function(){return null==s?void 0:s(r)},isFirstInSequence:o===i.length-1||(null===(n=i[o+1])||void 0===n?void 0:n.senderId)!==r.senderId})},ListHeaderComponent:e.jsx(dr,{typingUsers:c||[],currentUserId:l}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&E>0?{marginBottom:E}:void 0,children:V}),e.jsx(cr,{gallery:a,onClose:u})]});return M?e.jsx(t.View,{style:n(ir||(ir=T(["flex-1"]))),children:_}):"android"===t.Platform.OS?e.jsx(t.View,{style:n(lr||(lr=T(["flex-1"]))),children:_}):e.jsx(t.KeyboardAvoidingView,{style:n(sr||(sr=T(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:O,children:_})};module.exports=function(t){return e.jsx(qe,{children:e.jsx(_,g(g({},t),{},{children:e.jsx(fr,{})}))})};
|
|
16
|
+
*/function pe(){if(ne)return re;ne=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return re=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,a,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 l in i=Object(arguments[A]))t.call(i,l)&&(s[l]=i[l]);if(e){a=e(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(s[a[c]]=i[a[c]])}}return s},re}function me(){if(ie)return oe;ie=1;return oe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ge(){return se?ae:(se=1,ae=Function.call.bind(Object.prototype.hasOwnProperty))}function ye(){if(le)return Ae;le=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=me(),r={},n=ge();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,i,a,s,A){if("production"!==process.env.NODE_ENV)for(var l in o)if(n(o,l)){var c;try{if("function"!=typeof o[l]){var u=Error((s||"React class")+": "+a+" type `"+l+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[l]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[l](i,l,s,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((s||"React class")+": type specification of "+a+" `"+l+"` 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 d=A?A():"";e("Failed "+a+" type: "+c.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},Ae=o}function xe(){if(ue)return ce;ue=1;var e=ve(),t=pe(),r=me(),n=ge(),o=ye(),i=function(){};function a(){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){}}),ce=function(s,A){var l="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",u={array:h("array"),bigint:h("bigint"),bool:h("boolean"),func:h("function"),number:h("number"),object:h("object"),string:h("string"),symbol:h("symbol"),any:f(a),arrayOf:function(e){return f((function(t,n,o,i,a){if("function"!=typeof e)return new C("Property `"+a+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var s=t[n];if(!Array.isArray(s))return new C("Invalid "+i+" `"+a+"` of type `"+m(s)+"` supplied to `"+o+"`, expected an array.");for(var A=0;A<s.length;A++){var l=e(s,A,o,i,a+"["+A+"]",r);if(l instanceof Error)return l}return null}))},element:f((function(e,t,r,n,o){var i=e[t];return s(i)?null:new C("Invalid "+n+" `"+o+"` of type `"+m(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:f((function(t,r,n,o,i){var a=t[r];return e.isValidElementType(a)?null:new C("Invalid "+o+" `"+i+"` of type `"+m(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return f((function(t,r,n,o,i){if(!(t[r]instanceof e)){var a=e.name||c;return new C("Invalid "+o+" `"+i+"` of type `"+(((s=t[r]).constructor&&s.constructor.name?s.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+a+"`.")}var s;return null}))},node:f((function(e,t,r,n,o){return p(e[t])?null:new C("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return f((function(t,o,i,a,s){if("function"!=typeof e)return new C("Property `"+s+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var A=t[o],l=m(A);if("object"!==l)return new C("Invalid "+a+" `"+s+"` of type `"+l+"` supplied to `"+i+"`, expected an object.");for(var c in A)if(n(A,c)){var u=e(A,c,i,a,s+"."+c,r);if(u instanceof Error)return u}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."),a;return f((function(t,r,n,o,i){for(var a=t[r],s=0;s<e.length;s++)if(d(a,e[s]))return null;var A=JSON.stringify(e,(function(e,t){return"symbol"===g(t)?String(t):t}));return new C("Invalid "+o+" `"+i+"` of value `"+String(a)+"` 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."),a;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 "+y(o)+" at index "+t+"."),a}return f((function(t,o,i,a,s){for(var A=[],l=0;l<e.length;l++){var c=(0,e[l])(t,o,i,a,s,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&A.push(c.data.expectedType)}return new C("Invalid "+a+" `"+s+"` supplied to `"+i+"`"+(A.length>0?", expected one of type ["+A.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,n,o,i,a){var s=t[n],A=m(s);if("object"!==A)return new C("Invalid "+i+" `"+a+"` of type `"+A+"` supplied to `"+o+"`, expected `object`.");for(var l in e){var c=e[l];if("function"!=typeof c)return v(o,i,a,l,g(c));var u=c(s,l,o,i,a+"."+l,r);if(u)return u}return null}))},exact:function(e){return f((function(o,i,a,s,A){var l=o[i],c=m(l);if("object"!==c)return new C("Invalid "+s+" `"+A+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var u=t({},o[i],e);for(var d in u){var f=e[d];if(n(e,d)&&"function"!=typeof f)return v(a,s,A,d,g(f));if(!f)return new C("Invalid "+s+" `"+A+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(l,d,a,s,A+"."+d,r);if(h)return h}return null}))}};function d(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function C(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function f(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,a,s,l,u,d,f){if(l=l||c,d=d||s,f!==r){if(A){var h=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 h.name="Invariant Violation",h}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=l+":"+s;!t[v]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+l+"`. 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[v]=!0,n++)}}return null==a[s]?o?null===a[s]?new C("The "+u+" `"+d+"` is marked as required in `"+l+"`, but its value is `null`."):new C("The "+u+" `"+d+"` is marked as required in `"+l+"`, but its value is `undefined`."):null:e(a,s,l,u,d)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function h(e){return f((function(t,r,n,o,i,a){var s=t[r];return m(s)!==e?new C("Invalid "+o+" `"+i+"` of type `"+g(s)+"` supplied to `"+n+"`, expected `"+e+"`.",{expectedType:e}):null}))}function v(e,t,r,n,o){return new C((e||"React class")+": "+t+" type `"+r+"."+n+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function p(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(p);if(null===e||s(e))return!0;var t=function(e){var t=e&&(l&&e[l]||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(!p(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!p(o[1]))return!1}return!0;default:return!1}}function m(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 g(e){if(null==e)return""+e;var t=m(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function y(e){var t=g(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return C.prototype=Error.prototype,u.checkPropTypes=o,u.resetWarningCache=o.resetWarningCache,u.PropTypes=u,u},ce}function we(){if(Ce)return de;Ce=1;var e=me();function t(){}function r(){}return r.resetWarningCache=t,de=function(){function n(t,r,n,o,i,a){if(a!==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 be(){if(fe)return q.exports;if(fe=1,"production"!==process.env.NODE_ENV){var e=ve();q.exports=xe()(e.isElement,true)}else q.exports=we()();return q.exports}var Se=X(be()),Ee=function(){return f((function e(t,r){C(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),a=0;t.forEach((function(t){if(t._matched)n.push(t);else{var o,s=[],A=t.children,l=0;for(r.pattern.lastIndex=0;A&&(o=r.pattern.exec(A));){var c=A.substr(0,o.index);if(l=o.index,++a>i)break;s.push({children:c}),s.push(e.getMatchedPart(r,o[0],o,l)),A=A.substr(o.index+o[0].length),l+=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)),g(g({},o),{},{children:i,_matched:!0})}}])}(),_e=["type"],Re=["style"],ke=["parse","childrenProps"],Ie={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+/},Oe=Se.shape(g(g({},t.Text.propTypes),{},{type:Se.oneOf(Object.keys(Ie)).isRequired,nonExhaustiveMaxMatchCount:Se.number})),je=Se.shape(g(g({},t.Text.propTypes),{},{pattern:Se.oneOfType([Se.string,Se.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Se.number})),Me=function(){function r(){return C(this,r),d(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&&k(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=y(e,_e);if(t){if(!Ie[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Ie[t]}return r}))}},{key:"getParsedText",value:function(){var r=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ee(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=r.props.style,a=n.style,s=y(n,Re);return e.jsx(t.Text,g(g({style:[i,a]},r.props.childrenProps),s),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=g({},this.props);n.parse,n.childrenProps;var o=y(n,ke);return e.jsx(t.Text,g(g({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();Me.displayName="ParsedText",Me.propTypes=g(g({},t.Text.propTypes),{},{parse:Se.arrayOf(Se.oneOfType([Oe,je])),childrenProps:Se.shape(t.Text.propTypes)}),Me.defaultProps={parse:null,childrenProps:{}};var Te,Ve,Pe,Ge,De,Ke,Le,Fe,He,Be,Ue,Ye=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"})})},We=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"})})},Ne=n.createContext(void 0),ze=function(t){var r=t.children,o=I(n.useState(null),2),i=o[0],a=o[1];return e.jsx(Ne.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:a},children:r})},Qe=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},Xe=[1,1.5,2],Je=42;function qe(n){var o,i,a,s,A,l=n.isPlaying,c=n.playbackRate,u=n.onCycleSpeed,d=n.senderAvatar,C=n.senderName,f=n.isCurrentUser,h=n.theme;return l?e.jsx(t.Pressable,{onPress:u,style:[r(Te||(Te=O(["rounded-full items-center justify-center"]))),{width:Je,height:Je,backgroundColor:f?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==h||null===(o=h.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(t.Text,{style:Q([r(Ve||(Ve=O(["text-xs font-semibold"]))),{color:U(h,f)},null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==h?void 0:h.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):d?e.jsx(t.Image,{source:{uri:d},style:[r(Pe||(Pe=O(["rounded-full"]))),{width:Je,height:Je},null==h||null===(a=h.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.View,{style:[r(Ge||(Ge=O(["rounded-full items-center justify-center"]))),{width:Je,height:Je,backgroundColor:f?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(t.Text,{style:Q([r(De||(De=O(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==h?void 0:h.fontFamily),children:(s=C,A=null==s?void 0:s.trim(),A?A.charAt(0).toUpperCase():"?")})})}var $e,Ze,et,tt,rt,nt,ot,it,at=function(o){var a,s,A=o.audioUrl,l=o.audioId,c=o.isVideoPlaying,u=o.isCurrentUser,d=o.senderAvatar,C=o.senderName,f=o.reserveStatusSpace,h=void 0===f||f,v=D(),p=v.theme,m=v.CustomPlayIcon,y=v.CustomPauseIcon,x=v.showMessageStatus,w=function(){var e=n.useContext(Ne);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),b=w.currentlyPlayingId,S=w.setCurrentlyPlayingId,E=n.useRef(null),_=I(n.useState(!1),2),R=_[0],k=_[1],j=I(n.useState(0),2),M=j[0],T=j[1],V=I(n.useState(0),2),P=V[0],G=V[1],L=I(n.useState(!1),2),F=L[0],H=L[1],B=I(n.useState(1),2),U=B[0],Y=B[1],W=I(n.useState(0),2),N=W[0],z=W[1],X=n.useRef(null),J=n.useMemo((function(){return function(e,t){for(var r=5381,n=0;n<e.length;n++)r=(r<<5)+r+e.charCodeAt(n)|0;return Array.from({length:t},(function(e,t){return r=0|Math.imul(r^r>>>16,73244475+31337*t),r^=r>>>13,.18+Math.abs(r)%100/100*.82}))}(A,50)}),[A]),q=function(e,t){var r,n,o,i,a=K(e);return t?{inactive:null!==(o=null==a?void 0:a.sentAudioWaveformColor)&&void 0!==o?o:"rgba(255,255,255,0.35)",active:null!==(i=null==a?void 0:a.sentAudioWaveformActiveColor)&&void 0!==i?i:"rgba(255,255,255,0.95)"}:{inactive:null!==(r=null==a?void 0:a.receivedAudioWaveformColor)&&void 0!==r?r:"rgba(0,0,0,0.20)",active:null!==(n=null==a?void 0:a.receivedAudioWaveformActiveColor)&&void 0!==n?n:"rgba(0,0,0,0.60)"}}(p,u),$=q.inactive,Z=q.active,ee=function(e,t){var r,n,o,i,a=K(e);return t?null!==(o=null!==(i=null==a?void 0:a.sentAudioTimestampColor)&&void 0!==i?i:null==a?void 0:a.sentTimestampColor)&&void 0!==o?o:"rgba(255,255,255,0.75)":null!==(r=null!==(n=null==a?void 0:a.receivedAudioTimestampColor)&&void 0!==n?n:null==a?void 0:a.receivedTimestampColor)&&void 0!==r?r:"rgba(0,0,0,0.45)"}(p,u),te=function(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentAudioPlayIconColor)&&void 0!==n?n:"#ffffff":null!==(r=null==o?void 0:o.receivedAudioPlayIconColor)&&void 0!==r?r:"#374151"}(p,u),re=function(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentAudioPauseIconColor)&&void 0!==n?n:"#ffffff":null!==(r=null==o?void 0:o.receivedAudioPauseIconColor)&&void 0!==r?r:"#374151"}(p,u),ne=R&&!(c||!!b&&b!==l),oe=P>0?M/P:0,ie=n.useCallback((function(e){var t;(G(e.duration),null!==X.current)&&(null===(t=E.current)||void 0===t||t.seek(X.current),X.current=null)}),[]),ae=n.useCallback((function(e){var t=e.currentTime;F||T(t)}),[F]),se=n.useCallback((function(){var e;k(!1),T(0),null===(e=E.current)||void 0===e||e.seek(0),S(null)}),[S]),Ae=n.useCallback((function(){ne?(k(!1),S(null)):(S(l),k(!0))}),[ne,l,S]),le=n.useCallback((function(){Y((function(e){var t=Xe.indexOf(e),r=Xe[(t+1)%Xe.length];return null!=r?r:1}))}),[]),ce=n.useCallback((function(e){var t=N;if(!(t<=0||P<=0)){var r,n=Math.max(0,Math.min(e/t,1))*P;if(T(n),P>0)null===(r=E.current)||void 0===r||r.seek(n);else X.current=n}}),[P,N]),ue=n.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){H(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return H(!1)},onPanResponderTerminate:function(){return H(!1)}})}),[ce]),de=e.jsx(t.Pressable,{onPress:Ae,hitSlop:8,style:r(Ke||(Ke=O(["shrink-0 px-0.5"]))),children:ne?y?e.jsx(y,{}):e.jsx(Ye,{style:r.style("h-6 w-6"),color:re}):m?e.jsx(m,{}):e.jsx(We,{style:r.style("h-6 w-6"),color:te})}),Ce=e.jsx(qe,{isPlaying:ne,playbackRate:U,onCycleSpeed:le,senderAvatar:d,senderName:C,isCurrentUser:u,theme:p}),fe=e.jsx(t.View,{style:[r(Le||(Le=O(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return z(e.nativeEvent.layout.width)},children:e.jsx(t.View,g(g({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==p||null===(a=p.messageStyle)||void 0===a?void 0:a.progressBarStyle]},ue.panHandlers),{},{children:J.map((function(r,n){var o,i=(n+.5)/50<=oe;return e.jsx(t.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*r)),borderRadius:2,backgroundColor:i?Z:$},i?null==p||null===(o=p.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},n)}))}))});return e.jsxs(t.View,{style:[r(Fe||(Fe=O(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),h&&x&&r(He||(He=O(["pb-4"])))],children:[e.jsx(i,{ref:E,source:{uri:A},paused:!ne,rate:U,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:ae,onEnd:se,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(t.View,{style:r(Be||(Be=O(["flex-row items-center gap-1.5"]))),children:u?e.jsxs(e.Fragment,{children:[Ce,de,fe]}):e.jsxs(e.Fragment,{children:[de,fe,Ce]})}),e.jsx(t.Text,{style:Q([r(Ue||(Ue=O(["text-[11px] mt-1"]))),{color:ee,paddingLeft:u?82:34},null==p||null===(s=p.messageStyle)||void 0===s?void 0:s.audioDurationStyle],null==p?void 0:p.fontFamily),children:Qe(ne?M:P>0?P:M)})]})},st=n.memo(at),At=function(r){var i=r.style,a=r.spinning,s=void 0!==a&&a,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 l=A.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:s?{transform:[{rotate:l}]}: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"})})})},lt=320,ct=lt,ut=Math.round(176),dt=lt-ut-2,Ct=Math.round(159),ft=function(o){var a,s=o.uri,A=o.cellStyle,l=o.roundedStyle,c=D(),u=c.theme,d=c.CustomPlayIcon,C=n.useRef(null),f=I(n.useState(0),2),h=f[0],v=f[1],p=I(n.useState(!0),2),m=p[0],g=p[1],y=I(n.useState(!1),2),x=y[0],w=y[1];return e.jsxs(t.View,{style:[A,l],pointerEvents:"none",children:[e.jsx(i,{source:{uri:s},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[l,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){g(!0),w(!1)},onLoad:function(e){v(e.duration),g(!1)},onError:function(){w(!0),g(!1)}}),m&&e.jsx(t.View,{style:[r($e||($e=O(["absolute inset-0 items-center justify-center bg-black/40"]))),l],children:e.jsx(At,{style:r.style("h-8 w-8"),spinning:!0})}),!m&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ze||(Ze=O(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:d?e.jsx(d,{}):e.jsx(We,{style:r.style("h-10 w-10"),color:(null==u||null===(a=u.colors)||void 0===a?void 0:a.videoPlayIconColor)||"white"})}),e.jsx(t.View,{style:r(et||(et=O(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(t.Text,{style:r(tt||(tt=O(["text-white text-[10px] font-semibold"]))),children:ht(h)})})]}),x&&e.jsx(t.View,{style:[r(rt||(rt=O(["absolute inset-0 items-center justify-center bg-red-500/50"]))),l],children:e.jsx(t.Text,{style:Q(r(nt||(nt=O(["text-white text-xs"]))),null==u?void 0:u.fontFamily),children:"Video"})})]})};function ht(e){if(!e||Number.isNaN(e))return"0:00";var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r.toString().padStart(2,"0"))}var vt,pt,mt,gt,yt,xt,wt,bt,St,Et,_t,Rt,kt,It,Ot,jt,Mt,Tt,Vt,Pt,Gt,Dt,Kt,Lt,Ft=function(n){var o=n.items,i=n.onOpenGallery,a=t.useWindowDimensions().width,s=Math.min(240,.72*a);if(0===o.length)return null;var A={borderRadius:6,overflow:"hidden"};if(1===o.length){var l=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:320,marginVertical:8},children:"image"===l.kind?e.jsx(t.Image,{source:{uri:l.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(ft,{uri:l.uri,cellStyle:{width:s,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(s-2)/2;return e.jsx(t.View,{style:{width:s,height:ct,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(r,n){return e.jsx(t.Pressable,{onPress:function(){return i(o,n)},style:{width:c,height:ct},children:"image"===r.kind?e.jsx(t.Image,{source:{uri:r.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:r.uri,cellStyle:{width:c,height:ct},roundedStyle:A})},"".concat(r.uri,"-").concat(n))}))})}if(3===o.length){var u=o[0],d=o[1],C=o[2],f=(s-2)/2;return e.jsxs(t.View,{style:{width:s,height:lt,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:s,height:ut},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:u.uri,cellStyle:{width:s,height:ut},roundedStyle:A})}),e.jsxs(t.View,{style:{flexDirection:"row",gap:2,height:dt},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,1)},style:{width:f,height:dt},children:"image"===d.kind?e.jsx(t.Image,{source:{uri:d.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:d.uri,cellStyle:{width:f,height:dt},roundedStyle:A})},"".concat(d.uri,"-1")),e.jsx(t.Pressable,{onPress:function(){return i(o,2)},style:{width:f,height:dt},children:"image"===C.kind?e.jsx(t.Image,{source:{uri:C.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:C.uri,cellStyle:{width:f,height:dt},roundedStyle:A})},"".concat(C.uri,"-2"))]})]})}var h=(s-2)/2,v=o.length-4,p=o.slice(0,4);return e.jsx(t.View,{style:{width:s,height:lt,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:p.map((function(n,a){return e.jsxs(t.Pressable,{onPress:function(){return i(o,a)},style:{width:h,height:Ct,position:"relative"},children:["image"===n.kind?e.jsx(t.Image,{source:{uri:n.uri},style:[A,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:n.uri,cellStyle:{width:h,height:Ct},roundedStyle:A}),3===a&&v>0&&e.jsx(t.View,{style:r(ot||(ot=O(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:r(it||(it=O(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(n.uri,"-").concat(a))}))})},Ht=function(o){var i,a,s,A,l=o.message,c=o.onGalleryOpen,u=o.isVideoPlaying,d=o.isCurrentUser,C=D(),f=C.theme,h=C.showMessageStatus,v=C.onFileAttachmentPress,p=n.useMemo((function(){return N(l)}),[l]);return e.jsxs(t.View,{children:[p.length>0&&e.jsx(Ft,{items:p,onOpenGallery:c}),(null!==(i=l.fileAttachments)&&void 0!==i?i:[]).map((function(n,o){var i,a,s,A,l,c;return e.jsxs(t.Pressable,{onPress:function(){v?v(n):t.Linking.openURL(n.uri.startsWith("http")||n.uri.startsWith("file:")?n.uri:"file://".concat(n.uri))},style:[r(vt||(vt=O(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:F(f,d)},d?null==f||null===(i=f.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.receivedFileAttachmentStyle],children:[e.jsxs(t.Text,{style:Q([r(pt||(pt=O(["text-xs font-semibold"]))),{color:H(f,d)},d?null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.sentFileAttachmentTextStyle:null==f||null===(A=f.messageStyle)||void 0===A?void 0:A.receivedFileAttachmentTextStyle],null==f?void 0:f.fontFamily),numberOfLines:2,children:["📎 ",n.name]}),e.jsx(t.Text,{style:Q([r(mt||(mt=O(["text-[10px] mt-0.5"]))),{color:B(f,d)},d?null==f||null===(l=f.messageStyle)||void 0===l?void 0:l.sentFileAttachmentSubtitleStyle:null==f||null===(c=f.messageStyle)||void 0===c?void 0:c.receivedFileAttachmentSubtitleStyle],null==f?void 0:f.fontFamily),children:n.type})]},"".concat(n.uri,"-").concat(o))})),l.audio&&e.jsx(st,{audioUrl:l.audio,audioId:l.id,isVideoPlaying:u,isCurrentUser:d,senderAvatar:l.senderAvatar,senderName:l.senderName,reserveStatusSpace:!l.text}),l.text&&e.jsx(Me,{style:Q([r(gt||(gt=O(["pt-1"]))),r(h?yt||(yt=O(["pb-0"])):xt||(xt=O(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},d?null==f||null===(a=f.messageStyle)||void 0===a?void 0:a.sentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedTextStyle,Y(f,d)?{color:Y(f,d)}:void 0],null==f?void 0:f.fontFamily),parse:[{type:"url",style:g({color:"blue",textDecorationLine:"underline"},(A=null==f?void 0:f.fontFamily,A?{fontFamily:A}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:l.text})]})},Bt=n.memo(Ht),Ut=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"})})},Yt=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})})},Wt=function(n){var o,i,a,s=n.time,A=n.status,l=n.isCurrentUser,c=n.hasText,u=n.hasAudio,d=n.hasGalleryMedia,C=n.hasFileAttachments,f=D(),h=f.theme,v=f.showMessageStatus,p=(d||C)&&!c&&!u,m=d&&!c&&!u?"#ffffff":p?function(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentTimestampColor)&&void 0!==n?n:"rgba(255, 255, 255, 0.75)":null!==(r=null==o?void 0:o.receivedTimestampColor)&&void 0!==r?r:"rgba(107, 114, 128, 0.85)"}(h,l):function(e,t){var r,n,o=K(e);return t?null!==(n=null==o?void 0:o.sentTimestampColor)&&void 0!==n?n:"rgba(255, 255, 255, 0.75)":null!==(r=null==o?void 0:o.receivedTimestampColor)&&void 0!==r?r:"rgba(107, 114, 128, 0.85)"}(h,l);return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(wt||(wt=O(["flex-row items-center"]))),c?r(bt||(bt=O(["justify-end pb-1 ml-4"]))):u?r(St||(St=O(["absolute right-3 bottom-2"]))):p?[r(Et||(Et=O(["absolute right-3 bottom-4"]))),L(h,l)]:[r(_t||(_t=O(["absolute right-3 bottom-4"]))),L(h,l)]],children:[e.jsx(t.Text,{style:Q([r(Rt||(Rt=O(["text-xs"]))),{color:m}],null==h?void 0:h.fontFamily),children:s}),l&&e.jsxs(t.View,{style:r(kt||(kt=O(["ml-1 flex-row items-center"]))),children:["sent"===A&&e.jsx(Yt,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==h||null===(o=h.colors)||void 0===o?void 0:o.sentIconColor)||"#6B7280"}),"delivered"===A&&e.jsx(Ut,{style:r.style("h-4 w-4",{opacity:.7}),fill:(null==h||null===(i=h.colors)||void 0===i?void 0:i.deliveredIconColor)||"#6B7280"}),"read"===A&&e.jsx(Ut,{style:r.style("h-4 w-4",{opacity:.9}),fill:(null==h||null===(a=h.colors)||void 0===a?void 0:a.readIconColor)||"#3B82F6"})]})]})})},Nt=n.memo(Wt),zt=function(n){var o,i,a,s,A,l,c,u,d,C,f=n.message,h=n.isCurrentUser,v=n.isFirstInSequence,p=n.onLongPress,m=D(),y=m.theme,x=m.showAvatars,w=m.showUserNames,b=m.showBubbleTail,S=m.setMediaViewerGallery,E=m.isVideoPlaying,_=N(f),R=(null!==(o=null===(i=f.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===_.length&&!f.text&&!f.audio;return e.jsxs(t.Pressable,{onLongPress:p,style:[r(It||(It=O(["px-2 my-1 max-w-[75%] relative"]))),r(h?Ot||(Ot=O(["self-end mr-3"])):jt||(jt=O(["self-start ml-9"]))),r(v?h?Mt||(Mt=O(["bg-green-500 rounded-tr-none"])):Tt||(Tt=O(["bg-white rounded-tl-none"])):h?Vt||(Vt=O(["bg-green-500"])):Pt||(Pt=O(["bg-white"]))),g(g({borderRadius:8},W(y,h)?{backgroundColor:W(y,h)}:{}),h?null==y||null===(a=y.bubbleStyle)||void 0===a?void 0:a.sent:null==y||null===(s=y.bubbleStyle)||void 0===s?void 0:s.received)],children:[!h&&v&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Gt||(Gt=O(["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(Dt||(Dt=O(["w-full h-full rounded-full"]))),null==y||null===(A=y.bubbleStyle)||void 0===A?void 0:A.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:Q([r(Kt||(Kt=O(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==y||null===(l=y.bubbleStyle)||void 0===l?void 0:l.avatarTextStyle],null==y?void 0:y.fontFamily),children:null===(c=f.senderName)||void 0===c?void 0:c.charAt(0)})}),w&&f.senderName&&e.jsx(t.Text,{style:Q([r(Lt||(Lt=O(["text-sm text-black font-semibold mt-1 capitalize"]))),null==y||null===(u=y.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==y?void 0:y.fontFamily),children:f.senderName})]}),v&&b&&e.jsx(T,{style:r.style("absolute w-6 h-6",h?"rotate-90 -right-3.5 mt-[1.24px] -top-1":"rotate-180 -left-3.5 mt-[1.5px] -top-[3px]"),color:h?(null==y||null===(d=y.colors)||void 0===d?void 0:d.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==y||null===(C=y.colors)||void 0===C?void 0:C.receivedMessageTailColor)||"white"}),e.jsx(Bt,{message:f,isCurrentUser:h,isFirstInSequence:v,onGalleryOpen:function(e,t){S(e,t)},isVideoPlaying:E}),e.jsx(Nt,{time:f.time,status:h?f.status:void 0,isCurrentUser:h,hasText:!!f.text,hasAudio:!!f.audio,hasGalleryMedia:_.length>0&&!f.text,hasFileAttachments:R})]})},Qt=n.memo(zt),Xt=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"})]})})},Jt=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"})]})})},qt=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"})})},Zt=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"})]})})},er={code:"function AnimatedHoldMicTsx1(){const{scale}=this.__closure;return{transform:[{scale:scale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx",sourceMap:'{"version":3,"names":["AnimatedHoldMicTsx1","scale","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/AnimatedHoldMic.tsx"],"mappings":"AAU2C,SAAAA,oBAAA,QAAAC,KAAA,OAAAC,SAAA,OAAO,CAC1CC,SAAS,CAAE,CAAC,CAAEF,KAAK,CAAEA,KAAK,CAACG,KAAM,CAAC,CACtC,CAAC","ignoreList":[]}',version:"3.16.7"},tr=function(t){var r=t.color,o=void 0===r?"#ef4444":r,i=t.size,s=void 0===i?28:i,A=t.style,l=a.useSharedValue(1);n.useEffect((function(){l.value=a.withRepeat(a.withSequence(a.withTiming(1.22,{duration:700,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:700,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var c,u,d=a.useAnimatedStyle((c=[new global.Error,-2,-27],(u=function(){return{transform:[{scale:l.value}]}}).__closure={scale:l},u.__workletHash=3539239666849,u.__initData=er,u.__stackDetails=c,u));return e.jsx(a.View,{style:[d,A],children:e.jsx(qt,{style:{width:s,height:s},color:o})})},rr=function(t){var r=t.style,n=t.color,i=void 0===n?"#6b7280":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",fill:"none",children:e.jsx(o.Path,{d:"M6 15l6-6 6 6",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},nr=function(t){var r=t.style,n=t.color,i=void 0===n?"#6b7280":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Rect,{x:"5",y:"11",width:"14",height:"10",rx:"2",stroke:i,strokeWidth:"1.5"}),e.jsx(o.Path,{d:"M8 11V7a4 4 0 0 1 8 0v4",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})},or={code:"function LockSlideColumnTsx1(){const{chevronY}=this.__closure;return{transform:[{translateY:chevronY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx1","chevronY","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAoB0C,SAAAA,oBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,QAAQ,CAACI,KAAM,CAAC,CAC9C,CAAC","ignoreList":[]}',version:"3.16.7"},ir={code:"function LockSlideColumnTsx2(){const{lockScale}=this.__closure;return{transform:[{scale:lockScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx",sourceMap:'{"version":3,"names":["LockSlideColumnTsx2","lockScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LockSlideColumn.tsx"],"mappings":"AAuBuC,SAAAA,oBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CACtCC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},ar=function(r){var o,i,s,A,l,c,u=r.slideY,d=r.lockSlideDistance,C=r.recordingUIProps,f=r.voiceRecorderStyles,h=null!==(o=null==C?void 0:C.lockPillBackground)&&void 0!==o?o:"rgba(30,30,30,0.88)",v=null!==(i=null==C?void 0:C.lockIconColor)&&void 0!==i?i:"#e5e7eb",p=null!==(s=null==C?void 0:C.chevronIconColor)&&void 0!==s?s:"#9ca3af",m=null!==(A=null==C?void 0:C.lockPillGap)&&void 0!==A?A:8,g=null!==(l=null==C?void 0:C.lockPillMarginBottom)&&void 0!==l?l:10,y=a.useSharedValue(0);n.useEffect((function(){y.value=a.withRepeat(a.withSequence(a.withTiming(-4,{duration:450,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:450,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var x=a.useSharedValue(.92);n.useEffect((function(){x.value=a.withRepeat(a.withSequence(a.withTiming(1,{duration:550,easing:a.Easing.out(a.Easing.ease)}),a.withTiming(.92,{duration:550,easing:a.Easing.in(a.Easing.ease)})),-1,!1)}),[]);var w,b,S=a.useAnimatedStyle((w=[new global.Error,-2,-27],(b=function(){return{transform:[{translateY:y.value}]}}).__closure={chevronY:y},b.__workletHash=0xfad898b1b5b,b.__initData=or,b.__stackDetails=w,b)),E=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{scale:x.value}]}};return t.__closure={lockScale:x},t.__workletHash=0xbc18c7930ff,t.__initData=ir,t.__stackDetails=e,t}()),_=Math.min(1,Math.max(0,-u/d));return e.jsx(t.View,{style:[{alignItems:"center",marginBottom:g},null==f?void 0:f.lockContainer],pointerEvents:"none",children:e.jsxs(t.View,{style:[{backgroundColor:h,borderRadius:22,paddingVertical:10,paddingHorizontal:14,alignItems:"center",gap:m,opacity:.85+.15*_,borderWidth:_>.85?1.5:0,borderColor:null!==(c=null==C?void 0:C.lockPillActiveBorderColor)&&void 0!==c?c:"#22c55e"},null==f?void 0:f.lockPill],children:[e.jsx(a.View,{style:E,children:e.jsx(nr,{style:{width:20,height:20},color:v})}),e.jsx(a.View,{style:S,children:e.jsx(rr,{style:{width:18,height:18},color:p})})]})})},sr={code:"function LongPressRecordingTsx1(){const{slideTextX,cancelProgress}=this.__closure;return{transform:[{translateX:slideTextX.value}],opacity:1-cancelProgress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx",sourceMap:'{"version":3,"names":["LongPressRecordingTsx1","slideTextX","cancelProgress","__closure","transform","translateX","value","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/LongPressRecording.tsx"],"mappings":"AAc4C,SAAAA,uBAAA,QAAAC,UAAA,CAAAC,cAAA,OAAAC,SAAA,OAAO,CAC3CC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEJ,UAAU,CAACK,KAAM,CAAC,CAAC,CAC7CC,OAAO,CAAE,CAAC,CAAGL,cACjB,CAAC","ignoreList":[]}',version:"3.16.7"},Ar=function(r){var o,i,s=r.duration,A=r.slideX,l=r.containerHeight,c=void 0===l?50:l,u=r.fontFamily,d=r.voiceRecorderStyles,C=r.recordingUIProps,f=null!==(o=null==C?void 0:C.cancelTextColor)&&void 0!==o?o:"rgba(107,114,128,1)",h=null!==(i=null==C?void 0:C.timerColor)&&void 0!==i?i:"#374151",v=a.useSharedValue(0);n.useEffect((function(){v.value=a.withRepeat(a.withSequence(a.withTiming(-6,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var p,m,g=Math.min(1,Math.abs(Math.min(0,A))/70),y=a.useAnimatedStyle((p=[new global.Error,-3,-27],(m=function(){return{transform:[{translateX:v.value}],opacity:1-g}}).__closure={slideTextX:v,cancelProgress:g},m.__workletHash=0xbbdd56b2a8f,m.__initData=sr,m.__stackDetails=p,m));return e.jsxs(t.View,{style:[{flex:1,flexDirection:"row",alignItems:"center",minHeight:c,paddingHorizontal:4},null==d?void 0:d.longPressBar],children:[e.jsx(t.Text,{style:[{fontSize:15,fontWeight:"600",color:h,minWidth:44,fontFamily:u},null==d?void 0:d.timer,null==C?void 0:C.timerTextStyle],children:Qe(s)}),e.jsx(a.View,{style:[y,{flex:1,alignItems:"center"}],children:e.jsx(t.Text,{style:[{fontSize:14,color:f,fontFamily:u},null==d?void 0:d.slideText],children:"< Slide to cancel"})})]})},lr=function(t){var r=t.style,n=t.color,i=void 0===n?"#ef4444":n;return e.jsxs(o,{style:r,viewBox:"0 0 24 24",fill:"none",children:[e.jsx(o.Path,{d:"M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx(o.Path,{d:"M10 11v6M14 11v6",stroke:i,strokeWidth:"1.5",strokeLinecap:"round"})]})};function cr(e,t){return Array.from({length:e},(function(r,n){if(!t)return.3;var o=n/(e-1);return o<.12||o>.88?.08:o<.22||o>.78?.18:.3}))}var ur=function(r){var o=r.isActive,i=r.color,a=void 0===i?"rgba(0,0,0,0.45)":i,s=r.height,A=void 0===s?26:s,l=r.style,c=r.barCount,u=void 0===c?30:c,d=r.showOuterDots,C=void 0!==d&&d,f=I(n.useState((function(){return cr(u,C)})),2),h=f[0],v=f[1];return n.useEffect((function(){v(cr(u,C))}),[u,C]),n.useEffect((function(){if(o){var e=setInterval((function(){return v((function(e){return function(e,t){var r=e.length;return Array.from({length:r},(function(n,o){if(!t)return.15+.85*Math.random();var i=o/(r-1);return i<.12||i>.88?e[o]:i<.22||i>.78?.12+.35*Math.random():.2+.8*Math.random()}))}(e,C)}))}),110);return function(){return clearInterval(e)}}v(cr(u,C))}),[o,u,C]),e.jsx(t.View,{style:[{flexDirection:"row",alignItems:"center",height:A,gap:2},l],children:h.map((function(r,n){var o=Math.max(3,Math.round(r*A)),i=C&&(n/(h.length-1)<.22||n/(h.length-1)>.78);return e.jsx(t.View,{style:{flex:1,height:o,borderRadius:i?o/2:2,backgroundColor:a}},n)}))})};function dr(r){var n=r.color,o=void 0===n?"rgba(255,255,255,0.5)":n,i=r.size,a=void 0===i?26:i;return e.jsx(t.View,{style:{width:a,height:a,borderRadius:a/2,borderWidth:2,borderColor:o,justifyContent:"center",alignItems:"center"},children:e.jsx(t.View,{style:{width:4,height:4,borderRadius:2,backgroundColor:o}})})}var Cr=function(r){var n,o,i,a,s,A,l,c,u,d,C=r.isRecording,f=r.isPaused,h=r.duration,v=r.onCancel,p=r.onSend,m=r.onPause,g=r.onResume,y=r.containerHeight,x=void 0===y?50:y,w=r.fontFamily,b=r.sendButtonColor,S=void 0===b?"#16a34a":b,E=r.sendIconColor,_=void 0===E?"#ffffff":E,R=r.enablePauseResume,k=void 0===R||R,I=r.voiceRecorderStyles,O=r.recordingUIProps,j=r.CustomPlayIcon,M=r.CustomPauseIcon,T=null!==(n=null==O?void 0:O.waveformColor)&&void 0!==n?n:"rgba(0,0,0,0.45)",V=null!==(o=null==O?void 0:O.cancelTextColor)&&void 0!==o?o:"#ef4444",P=null!==(i=null==O?void 0:O.timerColor)&&void 0!==i?i:"#374151",G=null!==(a=null==O?void 0:O.recordingBackground)&&void 0!==a?a:"transparent",D=null!==(s=null==O?void 0:O.playPauseIconColor)&&void 0!==s?s:"#ef4444",K=null!==(A=null==O?void 0:O.playPauseIconSize)&&void 0!==A?A:24,L=null!==(l=null==O?void 0:O.waveformBarCount)&&void 0!==l?l:30,F=null===(c=null==O?void 0:O.showWaveformOuterDots)||void 0===c||c,H=null===(u=null==O?void 0:O.showTimerRing)||void 0===u||u,B=null!==(d=null==O?void 0:O.timerRingColor)&&void 0!==d?d:"rgba(0,0,0,0.3)";return e.jsxs(t.View,{style:[{backgroundColor:G,paddingHorizontal:4,gap:4},null==I?void 0:I.normalBar],children:[e.jsxs(t.View,{style:{flexDirection:"row",alignItems:"center",gap:8},children:[e.jsx(t.Text,{style:[{fontSize:14,fontWeight:"600",color:P,minWidth:40,fontFamily:w},null==I?void 0:I.timer,null==O?void 0:O.timerTextStyle],children:Qe(h)}),e.jsx(ur,{isActive:C&&!f,color:T,height:Math.round(.5*x),barCount:L,showOuterDots:F,style:[{flex:1},null==I?void 0:I.waveform]}),H&&e.jsx(dr,{color:B,size:24})]}),e.jsxs(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:x},children:[e.jsx(t.Pressable,{onPress:v,style:[{width:x,height:x,borderRadius:x/2,justifyContent:"center",alignItems:"center",backgroundColor:"".concat(V,"18")},null==I?void 0:I.trashButton],hitSlop:6,children:e.jsx(lr,{style:{width:.44*x,height:.44*x},color:V})}),k&&e.jsx(t.Pressable,{onPress:f?g:m,style:[{flex:1,alignItems:"center",justifyContent:"center",height:x},null==I?void 0:I.playPauseButton],hitSlop:8,children:f?j?e.jsx(j,{}):e.jsx(We,{style:{width:K,height:K},color:D}):M?e.jsx(M,{}):e.jsx(Ye,{style:{width:K,height:K},color:D})}),!k&&e.jsx(t.View,{style:{flex:1}}),e.jsx(t.Pressable,{onPress:p,style:[{width:x,height:x,borderRadius:x/2,backgroundColor:S,justifyContent:"center",alignItems:"center"},null==I?void 0:I.sendButton],hitSlop:4,children:e.jsx(Zt,{style:{width:.44*x,height:.44*x},color:_})})]})]})};function fr(){return hr.apply(this,arguments)}function hr(){return(hr=u(M().mark((function e(){var r;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==t.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,t.PermissionsAndroid.request(t.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return r=e.sent,e.abrupt("return",r===t.PermissionsAndroid.RESULTS.GRANTED);case 8:return e.prev=8,e.t0=e.catch(1),e.abrupt("return",!1);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}var vr=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"})]})},pr=function(r){var n=r.fileName,o=r.style,i=D().theme;return e.jsx(t.Text,{numberOfLines:2,ellipsizeMode:"tail",style:Q([{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)})},mr=n.memo(pr);function gr(e){return e.filter((function(e){var t,r;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(r=e.type)||void 0===r?void 0:r.startsWith("video/"))})).map((function(e){return{uri:e.uri,kind:e.type.startsWith("video/")?"video":"image"}}))}var yr,xr,wr,br,Sr,Er,_r,Rr,kr,Ir,Or,jr,Mr,Tr,Vr,Pr,Gr,Dr,Kr,Lr,Fr,Hr=function(r){var n,o=r.previews,a=r.closePreview,s=r.onRemoveItem,A=r.CustomFileIcon,l=r.CustomImagePreview,c=r.CustomVideoPreview,u=r.inputHeight,d=D(),C=d.theme,f=d.setMediaViewerGallery,h=o.filter((function(e){var t,r;return(null===(t=e.type)||void 0===t?void 0:t.startsWith("image/"))||(null===(r=e.type)||void 0===r?void 0:r.startsWith("video/"))})),v=o.filter((function(e){var t,r;return!(null!==(t=e.type)&&void 0!==t&&t.startsWith("image/")||null!==(r=e.type)&&void 0!==r&&r.startsWith("video/"))})),p=gr(o);if(0===o.length)return null;var m=function(e){0!==p.length&&f(p,e)},g=function(r){var n,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,s=null===(n=r.type)||void 0===n?void 0:n.startsWith("image/"),A=null===(o=r.type)||void 0===o?void 0:o.startsWith("video/");return s&&l?e.jsx(l,{uri:r.uri}):A&&c?e.jsx(c,{uri:r.uri}):s?e.jsx(t.Image,{source:{uri:r.uri},style:{width:a,height:a,borderRadius:12},resizeMode:"cover"}):A?e.jsx(t.View,{style:{width:a,height:a,borderRadius:12,overflow:"hidden"},children:e.jsx(i,{source:{uri:r.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},y=function(r,n){return e.jsx(t.Pressable,{onPress:function(){return s?s(r):null==a?void 0:a()},style:{position:"absolute",zIndex:50,height:22,width:22,backgroundColor:"rgba(0,0,0,0.55)",right:-6,top:-6,borderRadius:11,justifyContent:"center",alignItems:"center",transform:n?[{rotate:n}]:void 0},children:e.jsx(t.Text,{style:Q({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==C?void 0:C.fontFamily),children:"×"})})};return e.jsx(t.View,{style:[{position:"absolute",bottom:(null!=u?u:0)+8,zIndex:20,borderRadius:12,maxWidth:"92%",alignSelf:"flex-start"},null==C||null===(n=C.filePreviewStyle)||void 0===n?void 0:n.root],children:e.jsxs(t.View,{style:{gap:8},children:[function(){if(0===h.length)return null;if(1===h.length){var r=h[0];return r?e.jsxs(t.Pressable,{onPress:function(){return m(0)},style:{position:"relative"},children:[g(r),y(r.uri)]}):null}var n=h.slice(0,3),o=h.length>3?h.length-3:0;return e.jsx(t.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:n.map((function(r,i){var a=2===n.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",s=2===n.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=gr(h).findIndex((function(e){return e.uri===r.uri}));m(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:a}],position:"relative"},children:e.jsxs(t.View,{style:{position:"relative"},children:[g(r),2===i&&o>0&&e.jsx(t.View,{style:{position:"absolute",top:0,left:0,right:0,bottom:0,borderRadius:12,backgroundColor:"rgba(0,0,0,0.55)",alignItems:"center",justifyContent:"center"},children:e.jsxs(t.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),y(r.uri,s)]})},"".concat(r.uri,"-").concat(i))}))})}(),v.length>0&&e.jsx(t.ScrollView,{scrollEnabled:v.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:v.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:v.map((function(r,n){return function(r,n){var o,i,a,s;return e.jsxs(t.View,{style:{position:"relative"},children:[e.jsxs(t.View,{style:[{backgroundColor:"white",width:240,minHeight:64,borderRadius:12,flexDirection:"row",padding:4,gap:4,alignItems:"center"},null==C||null===(o=C.filePreviewStyle)||void 0===o?void 0:o.container],children:[e.jsx(t.View,{style:[{backgroundColor:"#d1d5db",borderRadius:8,padding:4,justifyContent:"center",alignItems:"center"},null==C||null===(i=C.filePreviewStyle)||void 0===i?void 0:i.iconContainer],children:A?e.jsx(A,{}):e.jsx(vr,{style:{width:40,height:40},fill:"white"})}),e.jsx(t.View,{style:[{backgroundColor:"#f3f4f6",flex:1,borderRadius:8,justifyContent:"center",paddingHorizontal:12},null==C||null===(a=C.filePreviewStyle)||void 0===a?void 0:a.nameContainer],children:e.jsx(mr,{fileName:r.name||"File",style:null==C||null===(s=C.filePreviewStyle)||void 0===s?void 0:s.text})})]}),y(r.uri)]},"".concat(r.uri,"-").concat(n))}(r,n)}))})]})})},Br=n.memo(Hr),Ur="ios"===t.Platform.OS?32:30,Yr="ios"===t.Platform.OS?50:48,Wr="h-6 w-6",Nr=function(o){var i,a,s,A,l,c,d,C,f,h,v,p,m,y,x,w,b,S,E,_,R,k,j,T,V,P=o.onSendMessage,G=o.onTypingStart,K=o.onTypingEnd,L=o.onAttachmentPress,F=o.onCameraPress,H=o.onAudioRecordStart,B=o.onAudioRecordEnd,U=o.CustomEmojiIcon,Y=o.CustomAttachmentIcon,W=o.CustomCameraIcon,N=o.CustomSendIcon,X=o.CustomMicrophoneIcon,J=o.CustomFileIcon,q=o.CustomImagePreview,$=o.CustomVideoPreview,Z=I(n.useState(""),2),ee=Z[0],te=Z[1],re=I(n.useState(0),2),ne=re[0],oe=re[1],ie=I(n.useState({height:Ur,isMultiline:!1}),2),ae=ie[0],se=ie[1],Ae=D(),le=Ae.theme,ce=Ae.currentUserId,ue=Ae.showEmojiButton,de=Ae.showAttachmentsButton,Ce=Ae.showCameraButton,fe=Ae.showVoiceRecordButton,he=Ae.placeholder,ve=Ae.previewData,pe=Ae.previewItems,me=Ae.closePreview,ge=Ae.onRemovePreviewItem,ye=Ae.voiceRecorderProps,xe=Ae.voiceRecorderStyles,we=Ae.recordingUIProps,be=Ae.renderVoiceRecorder,Se=Ae.CustomPlayIcon,Ee=Ae.CustomPauseIcon,_e=n.useMemo((function(){return null!=pe&&pe.length?pe:ve?[ve]:[]}),[pe,ve]),Re=_e.length>0,ke=null==le||null===(i=le.sizes)||void 0===i?void 0:i.inputIconSize,Ie=function(e){if("number"==typeof e&&e>0)return{width:e,height:e};var t="string"==typeof e&&e.trim().length>0?e.trim():z;return r.style(t)}(ke),Oe="number"==typeof(V=ke)&&V>0?V:24,je=0===ee.trim().length&&!ae.isMultiline,Me=Math.max(0,(Yr-Oe)/2),Te=je?{paddingTop:Me,paddingBottom:Me}:{paddingBottom:Me},Ve=n.useCallback((function(){se({height:Ur,isMultiline:!1}),oe((function(e){return e+1}))}),[]),Pe=n.useCallback((function(e){te(e),0===e.length&&Ve()}),[Ve]),Ge=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,Ur),118),r=t>Ur;se({height:r?t:Ur,isMultiline:r})}),[]),De=n.useCallback((function(){var e=ee.trim();(e||Re)&&(P({text:e,senderId:ce}),te(""),Ve())}),[ee,P,ce,Re,Ve]);n.useEffect((function(){ee.trim()?null==G||G():null==K||K()}),[ee,G,K]);var Ke=!!ee.trim()||Re,Le=I(n.useState("idle"),2),Fe=Le[0],He=Le[1],Be=n.useRef("idle"),Ue=n.useCallback((function(e){Be.current=e,He(e)}),[]),Ye=null!==(a=null==we?void 0:we.lockSlideDistance)&&void 0!==a?a:72,We=n.useRef(Ye);We.current=Ye;var Ne=I(n.useState(0),2),ze=Ne[0],Qe=Ne[1],Xe=I(n.useState(0),2),Je=Xe[0],qe=Xe[1],$e=n.useRef(0),Ze=n.useRef(0),et=n.useCallback((function(e){null==B||B(e)}),[B]),tt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.maxDuration,r=void 0===t?300:t,o=e.onRecordStart,i=e.onRecordEnd,a=I(n.useState("idle"),2),s=a[0],A=a[1],l=I(n.useState(0),2),c=l[0],d=l[1],C=n.useRef(null),f=n.useRef(null),h=n.useRef(0),v=n.useRef(i);v.current=i;var p=n.useRef(o);p.current=o;var m=n.useRef(r);m.current=r;var g=n.useCallback((function(){f.current&&(clearInterval(f.current),f.current=null)}),[]),y=n.useCallback((function(e){g(),f.current=setInterval((function(){h.current+=1,d(h.current),h.current>=m.current&&e()}),1e3)}),[g]),x=n.useCallback(u(M().mark((function e(){var t,r;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,t=require("react-native-audio-record").default,e.next=8;break;case 4:return e.prev=4,e.t0=e.catch(0),console.error("[movius-chats] Voice recording requires react-native-audio-record. Install it: yarn add react-native-audio-record"),e.abrupt("return");case 8:return e.next=10,fr();case 10:if(e.sent){e.next=14;break}return console.warn("[movius-chats] Microphone permission denied."),e.abrupt("return");case 14:try{t.init({sampleRate:16e3,channels:1,bitsPerSample:16,audioSource:6,wavFile:"movius_rec_".concat(Date.now(),".wav")}),t.start(),C.current=t,h.current=0,d(0),A("recording"),y((function(){return E.current()})),null===(r=p.current)||void 0===r||r.call(p)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[y]),w=n.useCallback(u(M().mark((function e(){return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.stop(),A("paused"),g()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[g]),b=n.useCallback(u(M().mark((function e(){return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C.current){e.next=2;break}return e.abrupt("return");case 2:try{C.current.start(),A("recording"),y((function(){return E.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[y]),S=n.useCallback(u(M().mark((function e(){var t,r,n,o,i;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current){e.next=3;break}return e.abrupt("return",null);case 3:return g(),C.current=null,r=h.current,h.current=0,A("idle"),d(0),e.prev=9,e.next=12,t.stop();case 12:if(o=e.sent){e.next=15;break}return e.abrupt("return",null);case 15:return i={uri:o.startsWith("file://")?o:"file://".concat(o),duration:Math.max(1,r),mimeType:"audio/wav"},null===(n=v.current)||void 0===n||n.call(v,i),e.abrupt("return",i);case 20:return e.prev=20,e.t0=e.catch(9),console.warn("[movius-chats] Failed to stop recording:",e.t0),e.abrupt("return",null);case 24:case"end":return e.stop()}}),e,null,[[9,20]])}))),[g]),E=n.useRef(S);E.current=S;var _=n.useCallback((function(){return E.current()}),[]),R=n.useCallback(u(M().mark((function e(){var t,r,n,o;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current,g(),C.current=null,h.current=0,A("idle"),d(0),!t){e.next=25;break}return e.prev=7,e.next=10,t.stop();case 10:if(!(r=e.sent)){e.next=21;break}return e.prev=12,n=require("react-native-fs"),o=r.startsWith("file://")?r.slice(7):r,e.next=17,n.unlink(o);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(12);case 21:e.next=25;break;case 23:e.prev=23,e.t1=e.catch(7);case 25:case"end":return e.stop()}}),e,null,[[7,23],[12,19]])}))),[g]);return n.useEffect((function(){return function(){g();try{var e;null===(e=C.current)||void 0===e||e.stop()}catch(e){}}}),[g]),{status:s,duration:c,isRecording:"recording"===s,isPaused:"paused"===s,startRecording:x,pauseRecording:w,resumeRecording:b,stopRecording:_,cancelRecording:R}}({maxDuration:null!==(s=null==ye?void 0:ye.maxDuration)&&void 0!==s?s:300,onRecordStart:H,onRecordEnd:et}),rt=n.useRef(tt);rt.current=tt;var nt=n.useCallback(u(M().mark((function e(){var t;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,rt.current.stopRecording();case 2:t=e.sent,Ue("idle"),t&&P({audio:t.uri,senderId:ce});case 5:case"end":return e.stop()}}),e)}))),[P,ce,Ue]),ot=n.useCallback((function(){rt.current.cancelRecording(),Ue("idle"),Qe(0),qe(0),$e.current=0,Ze.current=0}),[Ue]),it=n.useRef(nt);it.current=nt;var at=n.useRef(ot);at.current=ot;var st=n.useRef(),At=n.useRef(!1),lt=n.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return At.current},onPanResponderGrant:function(){At.current=!1,$e.current=0,Ze.current=0,Qe(0),qe(0),st.current=setTimeout(u(M().mark((function e(){return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return At.current=!0,e.next=3,rt.current.startRecording();case 3:Ue("longPress");case 4:case"end":return e.stop()}}),e)}))),500)},onPanResponderMove:function(e,t){At.current&&($e.current=t.dx,Ze.current=t.dy,Qe(t.dx),qe(t.dy),!1!==(null==ye?void 0:ye.enableLockRecording)&&t.dy<=-We.current&&"longPress"===Be.current&&(Ue("locked"),Ze.current=-We.current,qe(-We.current)))},onPanResponderRelease:(e=u(M().mark((function e(t,r){var n;return M().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(clearTimeout(st.current),n=At.current,At.current=!1,n){e.next=8;break}return e.next=6,rt.current.startRecording();case 6:return Ue("normal"),e.abrupt("return");case 8:if("locked"!==Be.current){e.next=10;break}return e.abrupt("return");case 10:r.dx<-70?at.current():it.current();case 11:case"end":return e.stop()}}),e)}))),function(t,r){return e.apply(this,arguments)}),onPanResponderTerminate:function(){clearTimeout(st.current),At.current=!1}});var e}),[]),ct=null!==(A=null!==(l=null==we?void 0:we.recordingSendButtonBackground)&&void 0!==l?l:null==le||null===(c=le.inputStyles)||void 0===c||null===(c=c.sendButtonStyle)||void 0===c?void 0:c.backgroundColor)&&void 0!==A?A:"#16a34a",ut=null!==(d=null==le||null===(C=le.colors)||void 0===C?void 0:C.sendIconsColor)&&void 0!==d?d:"#ffffff",dt=null!==(f=null!==(h=null==we?void 0:we.longPressMicColor)&&void 0!==h?h:null==le||null===(v=le.colors)||void 0===v?void 0:v.sendIconsColor)&&void 0!==f?f:"#ffffff",Ct=function(e,t){var r,n,o=null!==(r=null==t?void 0:t.containerBorderTopColor)&&void 0!==r?r:"rgba(0,0,0,0.12)";return g({borderTopWidth:null!==(n=null==t?void 0:t.containerBorderTopWidth)&&void 0!==n?n:1,borderTopColor:o,paddingTop:10,paddingBottom:4},null==e?void 0:e.container)}(xe,we);if("idle"!==Fe){var ft,ht,vt,pt,mt,gt={isRecording:tt.isRecording,isPaused:tt.isPaused,duration:tt.duration,isLocked:"locked"===Fe,slideOffset:{x:ze,y:Je},waveformData:[],startRecording:tt.startRecording,stopRecording:tt.stopRecording,pauseRecording:tt.pauseRecording,resumeRecording:tt.resumeRecording,cancelRecording:ot};return e.jsxs(t.View,{style:r(yr||(yr=O(["w-full px-2"]))),children:[Re&&e.jsx(Br,{previews:_e,closePreview:me,onRemoveItem:ge,CustomFileIcon:J,CustomImagePreview:q,CustomVideoPreview:$,inputHeight:ae.height}),e.jsx(t.View,{style:Ct,children:be?be(gt):"longPress"===Fe?e.jsxs(t.View,{style:[r(xr||(xr=O(["flex-row items-end gap-2"]))),null==le||null===(ft=le.inputStyles)||void 0===ft?void 0:ft.inputSectionContainerStyle],children:[e.jsx(Ar,{duration:tt.duration,slideX:ze,containerHeight:Yr,fontFamily:null==le?void 0:le.fontFamily,voiceRecorderStyles:xe,recordingUIProps:we}),e.jsxs(t.View,{style:{alignItems:"center"},children:[e.jsx(ar,{slideY:Je,lockSlideDistance:Ye,recordingUIProps:we,voiceRecorderStyles:xe}),e.jsx(t.View,g(g({},lt.panHandlers),{},{style:[r(wr||(wr=O(["rounded-full justify-center items-center"]))),{height:Yr,width:Yr,backgroundColor:ct},null==xe?void 0:xe.holdMicButton,null==le||null===(ht=le.inputStyles)||void 0===ht?void 0:ht.sendButtonStyle],children:e.jsx(tr,{color:dt,size:null!==(vt=null!==(pt=null==we?void 0:we.recordingIconSize)&&void 0!==pt?pt:null==we?void 0:we.iconSize)&&void 0!==vt?vt:28})}))]})]}):e.jsx(Cr,{isRecording:tt.isRecording,isPaused:tt.isPaused,duration:tt.duration,onCancel:ot,onSend:nt,onPause:tt.pauseRecording,onResume:tt.resumeRecording,enablePauseResume:null===(mt=null==ye?void 0:ye.enablePauseResume)||void 0===mt||mt,containerHeight:Yr,fontFamily:null==le?void 0:le.fontFamily,sendButtonColor:ct,sendIconColor:ut,voiceRecorderStyles:xe,recordingUIProps:we,CustomPlayIcon:Se,CustomPauseIcon:Ee})})]})}return e.jsxs(t.View,{style:r(br||(br=O(["w-full px-2"]))),children:[Re&&e.jsx(Br,{previews:_e,closePreview:me,onRemoveItem:ge,CustomFileIcon:J,CustomImagePreview:q,CustomVideoPreview:$,inputHeight:ae.height}),e.jsxs(t.View,{style:[r(Sr||(Sr=O(["flex-row items-end gap-2"]))),null==le||null===(p=le.inputStyles)||void 0===p?void 0:p.inputSectionContainerStyle],children:[e.jsxs(t.View,{style:[r(Er||(Er=O(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:Yr,borderRadius:je?9999:24,alignItems:je?"center":"flex-end"},null==le||null===(m=le.inputStyles)||void 0===m?void 0:m.inputContainerStyle],children:[ue&&e.jsx(t.View,{style:Te,children:e.jsx(t.Pressable,{children:U?e.jsx(U,{}):e.jsx(Jt,{style:Ie,color:(null==le||null===(y=le.colors)||void 0===y?void 0:y.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:ee,onChangeText:Pe,placeholder:he||"Message",style:Q([r(_r||(_r=O(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?r(Rr||(Rr=O(["text-[17px]"]))):r(kr||(kr=O(["text-[16px]"]))),{minHeight:Ur,maxHeight:118,paddingVertical:je?0:8,marginVertical:je?(Yr-Ur)/2:4},{color:(null==le||null===(x=le.colors)||void 0===x?void 0:x.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==le?void 0:le.fontFamily),placeholderTextColor:(null==le||null===(w=le.colors)||void 0===w?void 0:w.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:ae.isMultiline&&ee.length>0?"top":"center",onContentSizeChange:Ge},"chat-input-".concat(ne)),e.jsxs(t.View,{style:[r(Ir||(Ir=O(["flex-row items-center gap-4"]))),Te],children:[de&&e.jsx(t.Pressable,{onPress:L,children:Y?e.jsx(Y,{}):e.jsx($t,{style:Ie,color:(null==le||null===(b=le.colors)||void 0===b?void 0:b.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),Ce&&!ee.trim()&&e.jsx(t.Pressable,{onPress:F,children:W?e.jsx(W,{}):e.jsx(Xt,{style:Ie,color:(null==le||null===(S=le.colors)||void 0===S?void 0:S.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]}),Ke?e.jsx(t.Pressable,{onPress:De,style:[r(Or||(Or=O(["rounded-full justify-center items-center"]))),g({height:Yr,width:Yr,backgroundColor:"#16a34a"},null==le||null===(E=le.inputStyles)||void 0===E?void 0:E.sendButtonStyle)],children:N?e.jsx(N,{}):e.jsx(Zt,{style:r.style(Wr),color:(null==le||null===(_=le.colors)||void 0===_?void 0:_.sendIconsColor)||"rgba(255,255,255,0.7)"})}):fe?e.jsx(t.View,g(g({},lt.panHandlers),{},{style:[r(jr||(jr=O(["rounded-full justify-center items-center"]))),g({height:Yr,width:Yr,backgroundColor:"#16a34a"},null==le||null===(R=le.inputStyles)||void 0===R?void 0:R.sendButtonStyle)],children:X?e.jsx(X,{}):e.jsx(qt,{style:r.style("h-8 w-8"),color:(null==le||null===(k=le.colors)||void 0===k?void 0:k.sendIconsColor)||"rgba(255,255,255,0.7)"})})):e.jsx(t.Pressable,{onPress:De,style:[r(Mr||(Mr=O(["rounded-full justify-center items-center"]))),g({height:Yr,width:Yr,backgroundColor:"#16a34a"},null==le||null===(j=le.inputStyles)||void 0===j?void 0:j.sendButtonStyle)],children:N?e.jsx(N,{}):e.jsx(Zt,{style:r.style(Wr),color:(null==le||null===(T=le.colors)||void 0===T?void 0:T.sendIconsColor)||"rgba(255,255,255,0.7)"})})]})]})},zr=n.memo(Nr);function Qr(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 Xr,Jr,qr,$r,Zr,en,tn,rn,nn=function(o){var i,a=o.gallery,s=o.onClose,A=D(),l=A.theme,c=A.setIsVideoPlaying,u=n.useRef(null),d=null!==(i=null==a?void 0:a.initialIndex)&&void 0!==i?i:0,C=I(n.useState(d),2),f=C[0],h=C[1],v=t.useWindowDimensions(),p=v.width,m=v.height;n.useEffect((function(){if(null!=a&&a.items.length){var e=a.initialIndex;h(e);var t=a.items[e];c("video"===(null==t?void 0:t.kind)),requestAnimationFrame((function(){try{var t;null===(t=u.current)||void 0===t||t.scrollToIndex({index:e,animated:!1})}catch(e){}}))}}),[null==a?void 0:a.initialIndex,null==a?void 0:a.items,c]);var g=n.useCallback((function(){c(!1),s()}),[s,c]),y=n.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/p);h(t);var r=null==a?void 0:a.items[t];c("video"===(null==r?void 0:r.kind))}),[null==a?void 0:a.items,p,c]);return a&&0!==a.items.length?e.jsx(t.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:g,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[r(Tr||(Tr=O(["flex-1 bg-black"]))),{width:p,height:m}],children:[e.jsx(t.Pressable,{onPress:g,style:r(Vr||(Vr=O(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(Qr,{style:r(Pr||(Pr=O(["h-8 w-8"])))})}),a.items.length>1&&e.jsx(t.View,{style:r(Gr||(Gr=O(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:Q(r(Dr||(Dr=O(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==l?void 0:l.fontFamily),children:[f+1," / ",a.items.length]})}),e.jsx(t.FlatList,{ref:u,data:a.items,horizontal:!0,pagingEnabled:!0,showsHorizontalScrollIndicator:!1,keyExtractor:function(e,t){return"".concat(e.uri,"-").concat(t)},initialScrollIndex:a.initialIndex,extraData:f,getItemLayout:function(e,t){return{length:p,offset:p*t,index:t}},onMomentumScrollEnd:y,onScrollToIndexFailed:function(e){var t=e.index;setTimeout((function(){var e;null===(e=u.current)||void 0===e||e.scrollToIndex({index:t,animated:!1})}),100)},renderItem:function(t){var r=t.item,n=t.index;return e.jsx(on,{item:r,width:p,height:m,isActive:n===f,autoPlayVideo:n===d&&"video"===r.kind})}})]})}):null},on=function(o){var a=o.item,s=o.width,A=o.height,l=o.isActive,c=o.autoPlayVideo,u=D().theme,d=n.useRef(null),C=I(n.useState("video"===a.kind),2),f=C[0],h=C[1],v=I(n.useState(!1),2),p=v[0],m=v[1],g="video"===a.kind&&l&&c;return"image"===a.kind?e.jsx(t.View,{style:{width:s,height:A,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:a.uri},style:{width:s,height:A},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:s,height:A,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(i,{source:{uri:a.uri},ref:d,controls:!0,paused:!g,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:s-32,height:.55*A,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){h(!0),m(!1)},onLoad:function(){return h(!1)},onBuffer:function(e){var t=e.isBuffering;return h(t)},onError:function(){m(!0),h(!1)}}),f&&e.jsx(t.View,{style:r(Kr||(Kr=O(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(At,{style:r.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(t.View,{style:r(Lr||(Lr=O(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:Q(r(Fr||(Fr=O(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},an=n.memo(nn),sn=function(n){var o,i,a,s,A,l=n.typingUsers,c=n.currentUserId,u=D(),d=u.theme,C=u.showAvatars,f=u.renderCustomTyping,h=u.showBubbleTail,v=u.typingText,p=l.filter((function(e){return e.id!==c}));if(!p.length)return null;var m=p.slice(0,2),y=p.length-2,x=C?m.length+(y>0?1:0):0,w=x>0?24+14*Math.max(0,x-1):0,b=x>0?w+12:8,S=-(w+12);return e.jsxs(t.View,{style:[r(Xr||(Xr=O(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:b},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[C&&x>0&&e.jsxs(t.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[m.map((function(n,o){var i,a,s;return e.jsx(t.View,{style:[r(Jr||(Jr=O(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:m.length+o}],children:n.avatar?e.jsx(t.Image,{source:{uri:n.avatar},style:[r(qr||(qr=O(["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:Q([r($r||($r=O(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==d||null===(a=d.bubbleStyle)||void 0===a?void 0:a.avatarTextStyle],null==d?void 0:d.fontFamily),children:null===(s=n.name)||void 0===s?void 0:s.charAt(0)})},n.id)})),y>0&&e.jsx(t.View,{style:[r(Zr||(Zr=O(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},g({},null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:Q([r(en||(en=O(["text-white text-xs font-semibold"]))),null==d||null===(a=d.bubbleStyle)||void 0===a?void 0:a.additionalTypingUsersTextStyle],null==d?void 0:d.fontFamily),children:["+",y]})})]}),h&&e.jsx(T,{style:r.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==d||null===(s=d.colors)||void 0===s?void 0:s.receivedMessageTailColor)||"white"}),f?f():e.jsx(t.View,{style:r(tn||(tn=O(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:Q([r(rn||(rn=O(["text-gray-600"]))),null==d||null===(A=d.bubbleStyle)||void 0===A?void 0:A.typingTextStyle],null==d?void 0:d.fontFamily),children:null!=v?v:"Typing..."})})]})};var An={code:"function VoiceRecorderTsx1(){const{sendScale}=this.__closure;return{transform:[{scale:sendScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx1","sendScale","__closure","transform","scale","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAuC+C,SAAAA,kBAAA,QAAAC,SAAA,OAAAC,SAAA,OAAO,CAC9CC,SAAS,CAAE,CAAC,CAAEC,KAAK,CAAEH,SAAS,CAACI,KAAM,CAAC,CAC1C,CAAC","ignoreList":[]}',version:"3.16.7"},ln={code:"function VoiceRecorderTsx2(){const{pauseOpacity}=this.__closure;return{opacity:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx2","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AA0CgD,SAAAA,kBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEF,YAAY,CAACG,KAC1B,CAAC","ignoreList":[]}',version:"3.16.7"},cn=function(r){var o=r.color,i=r.count,s=r.spacing,A=r.barWidth,l=a.useSharedValue(0);n.useEffect((function(){l.value=a.withRepeat(a.withTiming(1,{duration:4500,easing:a.Easing.linear}),-1,!1)}),[]);var c=Math.min(200,i*A+(i-1)*s);return e.jsx(t.View,{style:[Cn.waveform,{width:c,height:36}],children:Array.from({length:i}).map((function(t,r){return e.jsx(dn,{index:r,total:i,tick:l,color:o,width:A,spacing:s},r)}))})},un={code:'function VoiceRecorderTsx3(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edgeFalloff=Math.sin(index/Math.max(1,total-1)*Math.PI);const amplitude=Math.max(0.15,Math.min(1,combined)*(0.35+0.65*edgeFalloff));return{height:Math.round(amplitude*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx3","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edgeFalloff","max","amplitude","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAqE2C,SAAAA,iBAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,WAAW,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACxE,KAAM,CAAAQ,SAAS,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,WAAW,CAAC,CAAC,CACrF,MAAO,CACHI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,SAAS,CAAG,GAAG,CAAC,IAC1C,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},dn=function(t){var r,n,o=t.index,i=t.total,s=t.tick,A=t.color,l=t.width,c=t.spacing,u=a.useAnimatedStyle((r=[new global.Error,-4,-27],(n=function(){var e=s.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*o)+.3*Math.sin(4*e+1.3*o)+.4*Math.sin(.9*e+.27*o))+.5,r=Math.sin(o/Math.max(1,i-1)*Math.PI),n=Math.max(.15,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:s,index:o,total:i},n.__workletHash=7061037340779,n.__initData=un,n.__stackDetails=r,n));return e.jsx(a.View,{style:[{width:l,marginHorizontal:c/2,backgroundColor:A,borderRadius:l},u]})},Cn=t.StyleSheet.create({container:{width:"100%",paddingHorizontal:18,paddingVertical:14,justifyContent:"center"},row:{flex:1,flexDirection:"row",alignItems:"center"},deleteWrapper:{width:26,height:"100%",justifyContent:"flex-end",alignItems:"flex-start",paddingBottom:2},center:{flex:1,height:"100%",paddingHorizontal:12,justifyContent:"center"},timerRow:{flexDirection:"row",alignItems:"center",gap:12},timer:{fontSize:24,fontWeight:"600",minWidth:50,letterSpacing:.3},waveformWrapper:{flex:1,alignItems:"flex-start",justifyContent:"center"},waveform:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},pauseRow:{flexDirection:"row",justifyContent:"center",alignItems:"center",marginTop:6,gap:4},pauseBar:{width:3,height:12,borderRadius:2,backgroundColor:"#F15C6D"},sendButton:{width:72,height:72,borderRadius:36,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.25,shadowRadius:8,elevation:6}}),fn="rgba(255,255,255,0.55)",hn=72,vn=70;function pn(){t.Vibration.vibrate(20)}var mn={code:"function VoiceRecordingGestureTsx1(){const{cancelFired,lockFired,dragX,dragY}=this.__closure;cancelFired.value=0;lockFired.value=0;dragX.value=0;dragY.value=0;}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx1","cancelFired","lockFired","dragX","dragY","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA4DiB,SAAAA,yBAAMA,CAAA,QAAAC,WAAA,CAAAC,SAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEfJ,WAAW,CAACK,KAAK,CAAG,CAAC,CACrBJ,SAAS,CAACI,KAAK,CAAG,CAAC,CACnBH,KAAK,CAACG,KAAK,CAAG,CAAC,CACfF,KAAK,CAACE,KAAK,CAAG,CAAC,CACnB","ignoreList":[]}',version:"3.16.7"},gn={code:"function VoiceRecordingGestureTsx2(e){const{dragX,dragY,lockFired,LOCK_THRESHOLD,lockHighlight,withTiming,runOnJS,fireLock,cancelFired,CANCEL_THRESHOLD,fireCancel}=this.__closure;const x=Math.min(0,e.translationX);const y=Math.min(0,e.translationY);dragX.value=x;dragY.value=y;if(lockFired.value===0&&y<=-LOCK_THRESHOLD){lockFired.value=1;lockHighlight.value=withTiming(1,{duration:180});runOnJS(fireLock)();}if(cancelFired.value===0&&x<=-CANCEL_THRESHOLD){cancelFired.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx2","e","dragX","dragY","lockFired","LOCK_THRESHOLD","lockHighlight","withTiming","runOnJS","fireLock","cancelFired","CANCEL_THRESHOLD","fireCancel","__closure","x","Math","min","translationX","y","translationY","value","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAmEmB,QAAC,CAAAA,yBAAKA,CAAAC,CAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,aAAA,CAAAC,UAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEf,CAAC,CAACgB,YAAY,CAAC,CACrC,KAAM,CAAAC,CAAC,CAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEf,CAAC,CAACkB,YAAY,CAAC,CACrCjB,KAAK,CAACkB,KAAK,CAAGN,CAAC,CACfX,KAAK,CAACiB,KAAK,CAAGF,CAAC,CACf,GAAId,SAAS,CAACgB,KAAK,GAAK,CAAC,EAAIF,CAAC,EAAI,CAACb,cAAc,CAAE,CAC/CD,SAAS,CAACgB,KAAK,CAAG,CAAC,CACnBd,aAAa,CAACc,KAAK,CAAGb,UAAU,CAAC,CAAC,CAAE,CAAEc,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtDb,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAIC,WAAW,CAACU,KAAK,GAAK,CAAC,EAAIN,CAAC,EAAI,CAACH,gBAAgB,CAAE,CACnDD,WAAW,CAACU,KAAK,CAAG,CAAC,CACrBZ,OAAO,CAACI,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},yn={code:"function VoiceRecordingGestureTsx3(){const{lockFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:180});dragY.value=withSpring(0,{damping:18,stiffness:180});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx3","lockFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAmFe,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAEb,GAAIJ,SAAS,CAACK,KAAK,GAAK,CAAC,CAAE,CACvBJ,KAAK,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAC5DJ,KAAK,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAChE,CACJ","ignoreList":[]}',version:"3.16.7"},xn={code:"function VoiceRecordingGestureTsx4(){const{lockFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:180});dragY.value=withSpring(0,{damping:18,stiffness:180});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx4","lockFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0FoB,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAElB,GAAIJ,SAAS,CAACK,KAAK,GAAK,CAAC,CAAE,CACvBJ,KAAK,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAC5DJ,KAAK,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CAChE,CACJ","ignoreList":[]}',version:"3.16.7"},wn={code:"function VoiceRecordingGestureTsx5(){const{dragX,CANCEL_THRESHOLD,arrowPulse}=this.__closure;const progress=Math.min(1,Math.abs(dragX.value)/CANCEL_THRESHOLD);return{transform:[{translateX:dragX.value*0.55+arrowPulse.value}],opacity:1-progress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx5","dragX","CANCEL_THRESHOLD","arrowPulse","__closure","progress","Math","min","abs","value","transform","translateX","opacity"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiG4C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAC1C,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAACP,KAAK,CAACQ,KAAK,CAAC,CAAGP,gBAAgB,CAAC,CACtE,MAAO,CACHQ,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEV,KAAK,CAACQ,KAAK,CAAG,IAAI,CAAGN,UAAU,CAACM,KAAM,CAAC,CAAC,CAClEG,OAAO,CAAE,CAAC,CAAGP,QACjB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},bn={code:"function VoiceRecordingGestureTsx6(){const{dragY,LOCK_REVEAL_TRAVEL,LOCK_THRESHOLD,interpolate}=this.__closure;const reveal=Math.min(1,Math.max(0,-dragY.value/LOCK_REVEAL_TRAVEL));const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));const rise=interpolate(lockProgress,[0,1],[0,-22]);return{opacity:reveal,transform:[{scale:0.85+reveal*0.15},{translateY:rise}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx6","dragY","LOCK_REVEAL_TRAVEL","LOCK_THRESHOLD","interpolate","__closure","reveal","Math","min","max","value","lockProgress","rise","opacity","transform","scale","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAwG2C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,kBAAA,CAAAC,cAAA,CAAAC,WAAA,OAAAC,SAAA,CACzC,KAAM,CAAAC,MAAM,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACR,KAAK,CAACS,KAAK,CAAGR,kBAAkB,CAAC,CAAC,CAC1E,KAAM,CAAAS,YAAY,CAAGJ,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACR,KAAK,CAACS,KAAK,CAAGP,cAAc,CAAC,CAAC,CAC5E,KAAM,CAAAS,IAAI,CAAGR,WAAW,CAACO,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAC,CACxD,MAAO,CACHE,OAAO,CAAEP,MAAM,CACfQ,SAAS,CAAE,CACP,CAAEC,KAAK,CAAE,IAAI,CAAGT,MAAM,CAAG,IAAK,CAAC,CAC/B,CAAEU,UAAU,CAAEJ,IAAK,CAAC,CAE5B,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Sn={code:"function VoiceRecordingGestureTsx7(){const{dragY,LOCK_THRESHOLD,lockHighlight}=this.__closure;const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{borderWidth:lockProgress>0.85||lockHighlight.value>0?1.5:0};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx7","dragY","LOCK_THRESHOLD","lockHighlight","__closure","lockProgress","Math","min","max","value","borderWidth"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAoH6C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,CAAAC,aAAA,OAAAC,SAAA,CAC3C,KAAM,CAAAC,YAAY,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACP,KAAK,CAACQ,KAAK,CAAGP,cAAc,CAAC,CAAC,CAC5E,MAAO,CACHQ,WAAW,CAAEL,YAAY,CAAG,IAAI,EAAIF,aAAa,CAACM,KAAK,CAAG,CAAC,CAAG,GAAG,CAAG,CACxE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},En={code:"function VoiceRecordingGestureTsx8(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx8","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0H0C,SAAAA,0BAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},_n={code:'function VoiceRecordingGestureTsx9(){const{dragY,LOCK_THRESHOLD}=this.__closure;const progress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{height:Math.round(progress*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx9","dragY","LOCK_THRESHOLD","__closure","progress","Math","min","max","value","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA6HmD,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,QAAQ,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAAC,CAAC,CAAE,CAACN,KAAK,CAACO,KAAK,CAAGN,cAAc,CAAC,CAAC,CACxE,MAAO,CACHO,MAAM,CAAKJ,IAAI,CAACK,KAAK,CAACN,QAAQ,CAAG,GAAG,CAAC,IACzC,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Rn={code:"function VoiceRecordingGestureTsx10(){const{lockHighlight,dragX,dragY,micPulse}=this.__closure;const lockedScale=lockHighlight.value;return{transform:[{translateX:dragX.value},{translateY:dragY.value},{scale:micPulse.value*(1+lockedScale*0.04)}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx10","lockHighlight","dragX","dragY","micPulse","__closure","lockedScale","value","transform","translateX","translateY","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAmIsC,SAAAA,0BAAMA,CAAA,QAAAC,aAAA,CAAAC,KAAA,CAAAC,KAAA,CAAAC,QAAA,OAAAC,SAAA,CACpC,KAAM,CAAAC,WAAW,CAAGL,aAAa,CAACM,KAAK,CACvC,MAAO,CACHC,SAAS,CAAE,CACP,CAAEC,UAAU,CAAEP,KAAK,CAACK,KAAM,CAAC,CAC3B,CAAEG,UAAU,CAAEP,KAAK,CAACI,KAAM,CAAC,CAC3B,CAAEI,KAAK,CAAEP,QAAQ,CAACG,KAAK,EAAI,CAAC,CAAGD,WAAW,CAAG,IAAI,CAAE,CAAC,CAE5D,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},kn=t.StyleSheet.create({wrapper:{width:"100%"},lockPill:{position:"absolute",right:31,bottom:103,width:46,paddingVertical:12,borderRadius:28,backgroundColor:"rgba(20,28,33,0.95)",borderColor:"#22C55E",alignItems:"center",justifyContent:"center",gap:10,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:8},lockProgressTrack:{width:4,height:18,borderRadius:2,backgroundColor:"rgba(255,255,255,0.15)",overflow:"hidden",justifyContent:"flex-end"},lockProgressFill:{width:"100%",borderRadius:2},bar:{width:"100%",height:95,paddingHorizontal:18,borderTopLeftRadius:18,borderTopRightRadius:18,flexDirection:"row",alignItems:"center"},timer:{fontSize:24,fontWeight:"600",minWidth:50,letterSpacing:.3},slideArea:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6},slideArrow:{fontSize:18,lineHeight:18,color:fn,fontWeight:"500",marginTop:-2},slideText:{fontSize:14,color:fn,fontWeight:"500"},micPressable:{width:hn,height:hn,justifyContent:"center",alignItems:"center"},mic:{width:hn,height:hn,borderRadius:36,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:6}});var In=72,On=-120,jn=-100;function Mn(){t.Vibration.vibrate(20)}var Tn,Vn,Pn,Gn,Dn,Kn={code:"function VoiceRecorderFlowTsx1(finished){const{runOnJS,finalizeReset}=this.__closure;if(finished){runOnJS(finalizeReset)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx1","finished","runOnJS","finalizeReset","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAmIgG,SAAAA,qBAAaA,CAAAC,QAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEjG,GAAIH,QAAQ,CAAE,CACVC,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B,CACJ","ignoreList":[]}',version:"3.16.7"},Ln={code:"function VoiceRecorderFlowTsx2(_e,success){const{runOnJS,fireQuickTap}=this.__closure;if(success)runOnJS(fireQuickTap)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx2","_e","success","runOnJS","fireQuickTap","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAkNmB,QAAC,CAAAA,qBAAgBA,CAAAC,EAAA,CAAAC,OAAA,QAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAExB,GAAIH,OAAO,CACPC,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC/B","ignoreList":[]}',version:"3.16.7"},Fn={code:"function VoiceRecorderFlowTsx3(){const{runOnJS,fireHoldStart}=this.__closure;runOnJS(fireHoldStart)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx3","runOnJS","fireHoldStart","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAyNqB,SAAAA,qBAAMA,CAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEfF,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B","ignoreList":[]}',version:"3.16.7"},Hn={code:"function VoiceRecorderFlowTsx4(e){const{stateShared,STATE_HOLD,MAX_LEFT,MAX_UP,translateX,translateY,lockFiredShared,LOCK_THRESHOLD,runOnJS,fireLock,cancelFiredShared,CANCEL_THRESHOLD,fireCancel}=this.__closure;if(stateShared.value!==STATE_HOLD)return;const tx=Math.max(MAX_LEFT,Math.min(0,e.translationX));const ty=Math.max(MAX_UP,Math.min(0,e.translationY));translateX.value=tx;translateY.value=ty;const dominantY=Math.abs(ty)>Math.abs(tx);if(dominantY&&lockFiredShared.value===0&&ty<=LOCK_THRESHOLD){lockFiredShared.value=1;runOnJS(fireLock)();}if(!dominantY&&cancelFiredShared.value===0&&tx<=CANCEL_THRESHOLD){cancelFiredShared.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx4","e","stateShared","STATE_HOLD","MAX_LEFT","MAX_UP","translateX","translateY","lockFiredShared","LOCK_THRESHOLD","runOnJS","fireLock","cancelFiredShared","CANCEL_THRESHOLD","fireCancel","__closure","value","tx","Math","max","min","translationX","ty","translationY","dominantY","abs"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AA6NuB,QAAC,CAAAA,qBAAKA,CAAAC,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,QAAA,CAAAC,MAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,eAAA,CAAAC,cAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,iBAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,GAAIb,WAAW,CAACc,KAAK,GAAKb,UAAU,CAChC,OACJ,KAAM,CAAAc,EAAE,CAAGC,IAAI,CAACC,GAAG,CAACf,QAAQ,CAAEc,IAAI,CAACE,GAAG,CAAC,CAAC,CAAEnB,CAAC,CAACoB,YAAY,CAAC,CAAC,CAC1D,KAAM,CAAAC,EAAE,CAAGJ,IAAI,CAACC,GAAG,CAACd,MAAM,CAAEa,IAAI,CAACE,GAAG,CAAC,CAAC,CAAEnB,CAAC,CAACsB,YAAY,CAAC,CAAC,CACxDjB,UAAU,CAACU,KAAK,CAAGC,EAAE,CACrBV,UAAU,CAACS,KAAK,CAAGM,EAAE,CACrB,KAAM,CAAAE,SAAS,CAAGN,IAAI,CAACO,GAAG,CAACH,EAAE,CAAC,CAAGJ,IAAI,CAACO,GAAG,CAACR,EAAE,CAAC,CAC7C,GAAIO,SAAS,EACThB,eAAe,CAACQ,KAAK,GAAK,CAAC,EAC3BM,EAAE,EAAIb,cAAc,CAAE,CACtBD,eAAe,CAACQ,KAAK,CAAG,CAAC,CACzBN,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAI,CAACa,SAAS,EACVZ,iBAAiB,CAACI,KAAK,GAAK,CAAC,EAC7BC,EAAE,EAAIJ,gBAAgB,CAAE,CACxBD,iBAAiB,CAACI,KAAK,CAAG,CAAC,CAC3BN,OAAO,CAACI,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},Bn={code:"function VoiceRecorderFlowTsx5(){const{runOnJS,fireHoldEnd}=this.__closure;runOnJS(fireHoldEnd)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx5","runOnJS","fireHoldEnd","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAmPmB,SAAAA,qBAAMA,CAAA,QAAAC,OAAA,CAAAC,WAAA,OAAAC,SAAA,CAEbF,OAAO,CAACC,WAAW,CAAC,CAAC,CAAC,CAC1B","ignoreList":[]}',version:"3.16.7"},Un={code:"function VoiceRecorderFlowTsx6(){const{lockFiredShared,cancelFiredShared,translateX,withSpring,translateY}=this.__closure;if(lockFiredShared.value===0&&cancelFiredShared.value===0){translateX.value=withSpring(0,{damping:18,stiffness:180});translateY.value=withSpring(0,{damping:18,stiffness:180});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx6","lockFiredShared","cancelFiredShared","translateX","withSpring","translateY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAuPwB,SAAAA,qBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,OAAAC,SAAA,CAElB,GAAIL,eAAe,CAACM,KAAK,GAAK,CAAC,EAAIL,iBAAiB,CAACK,KAAK,GAAK,CAAC,CAAE,CAC9DJ,UAAU,CAACI,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEJ,UAAU,CAACE,KAAK,CAAGH,UAAU,CAAC,CAAC,CAAE,CAAEI,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACrE,CACJ","ignoreList":[]}',version:"3.16.7"},Yn={code:"function VoiceRecorderFlowTsx7(){const{containerOpacity,containerY}=this.__closure;return{opacity:containerOpacity.value,transform:[{translateY:containerY.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx7","containerOpacity","containerY","__closure","opacity","value","transform","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAiQ4C,SAAAA,sBAAA,QAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC3CC,OAAO,CAAEH,gBAAgB,CAACI,KAAK,CAC/BC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEL,UAAU,CAACG,KAAM,CAAC,CAChD,CAAC","ignoreList":[]}',version:"3.16.7"},Wn={code:"function VoiceRecorderFlowTsx8(){const{stateShared,STATE_HOLD,STATE_IDLE,micPulse,translateX,translateY}=this.__closure;const isHold=stateShared.value===STATE_HOLD;const pulse=stateShared.value===STATE_IDLE?1:micPulse.value;return{transform:[{translateX:isHold?translateX.value:0},{translateY:isHold?translateY.value:0},{scale:pulse}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx8","stateShared","STATE_HOLD","STATE_IDLE","micPulse","translateX","translateY","__closure","isHold","value","pulse","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAqQ4C,SAAAA,qBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,QAAA,CAAAC,UAAA,CAAAC,UAAA,OAAAC,SAAA,CAC1C,KAAM,CAAAC,MAAM,CAAGP,WAAW,CAACQ,KAAK,GAAKP,UAAU,CAC/C,KAAM,CAAAQ,KAAK,CAAGT,WAAW,CAACQ,KAAK,GAAKN,UAAU,CAAG,CAAC,CAAGC,QAAQ,CAACK,KAAK,CACnE,MAAO,CACHE,SAAS,CAAE,CACP,CAAEN,UAAU,CAAEG,MAAM,CAAGH,UAAU,CAACI,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEH,UAAU,CAAEE,MAAM,CAAGF,UAAU,CAACG,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEG,KAAK,CAAEF,KAAM,CAAC,CAExB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Nn={code:"function VoiceRecorderFlowTsx9(){const{interpolate,translateX,CANCEL_THRESHOLD,Extrapolation,arrowPulse}=this.__closure;const opacity=interpolate(translateX.value,[0,CANCEL_THRESHOLD],[1,0],Extrapolation.CLAMP);return{opacity:opacity,transform:[{translateX:translateX.value*0.55+arrowPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx9","interpolate","translateX","CANCEL_THRESHOLD","Extrapolation","arrowPulse","__closure","opacity","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAgR4C,SAAAA,qBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,gBAAA,CAAAC,aAAA,CAAAC,UAAA,OAAAC,SAAA,CAC1C,KAAM,CAAAC,OAAO,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,gBAAgB,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACK,KAAK,CAAC,CACjG,MAAO,CACHF,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAER,UAAU,CAAEA,UAAU,CAACM,KAAK,CAAG,IAAI,CAAGH,UAAU,CAACG,KAAM,CAAC,CAC1E,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},zn={code:"function VoiceRecorderFlowTsx10(){const{interpolate,translateY,LOCK_REVEAL_TRAVEL,Extrapolation,LOCK_THRESHOLD}=this.__closure;const reveal=interpolate(translateY.value,[0,LOCK_REVEAL_TRAVEL],[0,1],Extrapolation.CLAMP);const lockProgress=interpolate(translateY.value,[0,LOCK_THRESHOLD],[0,1],Extrapolation.CLAMP);return{opacity:reveal,transform:[{scale:0.7+reveal*0.3},{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx10","interpolate","translateY","LOCK_REVEAL_TRAVEL","Extrapolation","LOCK_THRESHOLD","__closure","reveal","value","CLAMP","lockProgress","opacity","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAuR2C,SAAAA,sBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,kBAAA,CAAAC,aAAA,CAAAC,cAAA,OAAAC,SAAA,CACzC,KAAM,CAAAC,MAAM,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,kBAAkB,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACK,KAAK,CAAC,CAClG,KAAM,CAAAC,YAAY,CAAGT,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAED,aAAa,CAACK,KAAK,CAAC,CACpG,MAAO,CACHE,OAAO,CAAEJ,MAAM,CACfK,SAAS,CAAE,CACP,CAAEC,KAAK,CAAE,GAAG,CAAGN,MAAM,CAAG,GAAI,CAAC,CAC7B,CAAEL,UAAU,CAAED,WAAW,CAACS,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAEnE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Qn={code:'function VoiceRecorderFlowTsx11(){const{interpolate,translateY,LOCK_THRESHOLD,Extrapolation}=this.__closure;const progress=interpolate(translateY.value,[0,LOCK_THRESHOLD],[0,1],Extrapolation.CLAMP);return{height:Math.round(progress*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx11","interpolate","translateY","LOCK_THRESHOLD","Extrapolation","__closure","progress","value","CLAMP","height","Math","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAkSmD,SAAAA,sBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,cAAA,CAAAC,aAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,QAAQ,CAAGL,WAAW,CAACC,UAAU,CAACK,KAAK,CAAE,CAAC,CAAC,CAAEJ,cAAc,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACI,KAAK,CAAC,CAChG,MAAO,CAAEC,MAAM,CAAKC,IAAI,CAACC,KAAK,CAACL,QAAQ,CAAG,GAAG,CAAC,IAAI,CAAC,CACvD","ignoreList":[]}',version:"3.16.7"},Xn={code:"function VoiceRecorderFlowTsx12(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx12","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAsS0C,SAAAA,uBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACzCC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},Jn={code:"function VoiceRecorderFlowTsx13(){const{pauseOpacity}=this.__closure;return{opacity:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx13","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AAySgD,SAAAA,uBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEF,YAAY,CAACG,KAC1B,CAAC","ignoreList":[]}',version:"3.16.7"},qn=function(r){var n=r.duration,o=r.timerColor,i=r.waveformColor,s=r.deleteIconColor,A=r.waveTick,l=r.pauseAnimatedStyle,c=r.renderDeleteIcon,u=r.renderWaveform,d=r.onDeletePress;return e.jsxs(t.View,{style:ro.screenOneRow,children:[e.jsx(t.Pressable,{onPress:d,hitSlop:10,style:ro.deleteWrapper,accessibilityRole:"button",accessibilityLabel:"Delete recording",children:c?c():e.jsx(lr,{style:{width:26,height:26},color:s})}),e.jsxs(t.View,{style:ro.screenOneCenter,children:[e.jsxs(t.View,{style:ro.timerRow,children:[e.jsx(t.Text,{style:[ro.timer,{color:o}],numberOfLines:1,children:Qe(n)}),e.jsx(t.View,{style:ro.waveformWrapper,children:u?u():e.jsx(Zn,{color:i,tick:A})})]}),e.jsxs(a.View,{style:[ro.pauseRow,l],children:[e.jsx(t.View,{style:ro.pauseBar}),e.jsx(t.View,{style:ro.pauseBar})]})]}),e.jsx(t.View,{style:ro.micSpacer})]})},$n=function(r){var n=r.duration,o=r.timerColor,i=r.slideTextStyle,s=r.renderArrowIcon;return e.jsxs(t.View,{style:ro.screenTwoRow,children:[e.jsx(t.Text,{style:[ro.timer,{color:o}],numberOfLines:1,children:Qe(n)}),e.jsxs(a.View,{style:[ro.slideArea,i],children:[s?s():e.jsx(t.Text,{style:ro.slideArrow,children:"‹"}),e.jsx(t.Text,{style:ro.slideText,children:"Slide to cancel"})]}),e.jsx(t.View,{style:ro.micSpacer})]})},Zn=function(r){var n=r.color,o=r.tick;return e.jsx(t.View,{style:ro.waveform,children:Array.from({length:28}).map((function(t,r){return e.jsx(to,{index:r,total:28,color:n,tick:o},r)}))})},eo={code:'function VoiceRecorderFlowTsx14(){const{tick,index,total}=this.__closure;const t=tick.value*Math.PI*2;const phase1=Math.sin(t*2+index*0.55);const phase2=Math.sin(t*4+index*1.3);const phase3=Math.sin(t*0.9+index*0.27);const combined=(phase1*0.55+phase2*0.3+phase3*0.4)*0.5+0.5;const edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.15,Math.min(1,combined)*(0.35+0.65*edge));return{height:Math.round(amp*100)+"%"};}',location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderFlowTsx14","tick","index","total","__closure","t","value","Math","PI","phase1","sin","phase2","phase3","combined","edge","max","amp","min","height","round"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow.tsx"],"mappings":"AA8U2C,SAAAA,sBAAMA,CAAA,QAAAC,IAAA,CAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA,CAEzC,KAAM,CAAAC,CAAC,CAAGJ,IAAI,CAACK,KAAK,CAAGC,IAAI,CAACC,EAAE,CAAG,CAAC,CAClC,KAAM,CAAAC,MAAM,CAAGF,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC7C,KAAM,CAAAS,MAAM,CAAGJ,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,CAAC,CAAGH,KAAK,CAAG,GAAG,CAAC,CAC5C,KAAM,CAAAU,MAAM,CAAGL,IAAI,CAACG,GAAG,CAACL,CAAC,CAAG,GAAG,CAAGH,KAAK,CAAG,IAAI,CAAC,CAC/C,KAAM,CAAAW,QAAQ,CAAG,CAACJ,MAAM,CAAG,IAAI,CAAGE,MAAM,CAAG,GAAG,CAAGC,MAAM,CAAG,GAAG,EAAI,GAAG,CAAG,GAAG,CAC1E,KAAM,CAAAE,IAAI,CAAGP,IAAI,CAACG,GAAG,CAAER,KAAK,CAAGK,IAAI,CAACQ,GAAG,CAAC,CAAC,CAAEZ,KAAK,CAAG,CAAC,CAAC,CAAII,IAAI,CAACC,EAAE,CAAC,CACjE,KAAM,CAAAQ,GAAG,CAAGT,IAAI,CAACQ,GAAG,CAAC,IAAI,CAAER,IAAI,CAACU,GAAG,CAAC,CAAC,CAAEJ,QAAQ,CAAC,EAAI,IAAI,CAAG,IAAI,CAAGC,IAAI,CAAC,CAAC,CACxE,MAAO,CAAEI,MAAM,CAAKX,IAAI,CAACY,KAAK,CAACH,GAAG,CAAG,GAAG,CAAC,IAAI,CAAC,CAClD","ignoreList":[]}',version:"3.16.7"},to=function(t){var r,n,o=t.index,i=t.total,s=t.color,A=t.tick,l=a.useAnimatedStyle((r=[new global.Error,-4,-27],(n=function(){var e=A.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*o)+.3*Math.sin(4*e+1.3*o)+.4*Math.sin(.9*e+.27*o))+.5,r=Math.sin(o/Math.max(1,i-1)*Math.PI),n=Math.max(.15,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:A,index:o,total:i},n.__workletHash=0xecc749b626f,n.__initData=eo,n.__stackDetails=r,n));return e.jsx(a.View,{style:[{width:3,marginHorizontal:1.5,backgroundColor:s,borderRadius:3},l]})},ro=t.StyleSheet.create({root:{position:"absolute",left:0,right:0,bottom:0},bar:{width:"100%",height:110,paddingHorizontal:18,paddingVertical:14,borderTopLeftRadius:18,borderTopRightRadius:18,flexDirection:"row",alignItems:"center"},buttonAnchor:{position:"absolute",right:18,bottom:19},micPressable:{width:In,height:In,justifyContent:"center",alignItems:"center"},mic:{width:In,height:In,borderRadius:36,justifyContent:"center",alignItems:"center",shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:6},micSpacer:{width:In,height:In},lockPill:{position:"absolute",right:31,bottom:118,width:46,paddingVertical:12,borderRadius:28,backgroundColor:"rgba(20,28,33,0.95)",alignItems:"center",justifyContent:"center",gap:10,shadowColor:"#000",shadowOffset:{width:0,height:4},shadowOpacity:.3,shadowRadius:8,elevation:8},lockProgressTrack:{width:4,height:18,borderRadius:2,backgroundColor:"rgba(255,255,255,0.15)",overflow:"hidden",justifyContent:"flex-end"},lockProgressFill:{width:"100%",borderRadius:2},screenOneRow:{flex:1,flexDirection:"row",alignItems:"center"},screenOneCenter:{flex:1,height:"100%",paddingHorizontal:12,justifyContent:"center"},screenTwoRow:{flex:1,flexDirection:"row",alignItems:"center",height:"100%"},deleteWrapper:{width:26,height:"100%",justifyContent:"flex-end",alignItems:"flex-start",paddingBottom:4},timerRow:{flexDirection:"row",alignItems:"center",gap:12},timer:{fontSize:24,fontWeight:"600",minWidth:50,letterSpacing:.3},waveformWrapper:{flex:1,alignItems:"flex-start",justifyContent:"center"},waveform:{width:200,height:36,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},pauseRow:{flexDirection:"row",justifyContent:"center",alignItems:"center",marginTop:6,gap:4},pauseBar:{width:3,height:12,borderRadius:2,backgroundColor:"#F15C6D"},slideArea:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"center",gap:6},slideArrow:{fontSize:18,lineHeight:18,color:"rgba(255,255,255,0.55)",fontWeight:"500",marginTop:-2},slideText:{fontSize:14,color:"rgba(255,255,255,0.55)",fontWeight:"500"}}),no=function(){var o=D(),i=o.messages,a=o.currentUserId,s=o.onMessageLongPress,A=o.mediaViewerGallery,l=o.clearMediaViewerGallery,c=o.typingUsers,u=o.onSendMessage,d=o.onTypingStart,C=o.onTypingEnd,f=o.onAttachmentPress,h=o.onAudioRecordEnd,v=o.onAudioRecordStart,p=o.onCameraPress,m=o.renderCustomInput,g=o.CustomEmojiIcon,y=o.CustomAttachmentIcon,x=o.CustomCameraIcon,w=o.CustomMicrophoneIcon,b=o.CustomSendIcon,S=o.CustomFileIcon,E=o.CustomImagePreview,_=o.CustomVideoPreview,R=o.keyboardVerticalOffset,k=void 0===R?0:R,j=o.disableKeyboardAvoiding,M=void 0!==j&&j,T=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=I(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)})),a=t.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),a.remove()}}i(0)}),[e]),e?o:0}(!M),V=m?m():e.jsx(zr,{onSendMessage:u,onTypingStart:d,onTypingEnd:C,onAttachmentPress:f,onAudioRecordEnd:h,onAudioRecordStart:v,onCameraPress:p,CustomEmojiIcon:g,CustomAttachmentIcon:y,CustomCameraIcon:x,CustomMicrophoneIcon:w,CustomSendIcon:b,CustomFileIcon:S,CustomImagePreview:E,CustomVideoPreview:_}),P=e.jsxs(t.View,{style:r(Tn||(Tn=O(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(Vn||(Vn=O(["flex-1"]))),data:i,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(Qt,{message:n,isCurrentUser:n.senderId===a,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(sn,{typingUsers:c||[],currentUserId:a}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&T>0?{marginBottom:T}:void 0,children:V}),e.jsx(an,{gallery:A,onClose:l})]});return M?e.jsx(t.View,{style:r(Pn||(Pn=O(["flex-1"]))),children:P}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(Gn||(Gn=O(["flex-1"]))),children:P}):e.jsx(t.KeyboardAvoidingView,{style:r(Dn||(Dn=O(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:k,children:P})};exports.VoiceRecorder=function(r){var o=r.primaryColor,i=void 0===o?"#22C55E":o,s=r.backgroundColor,A=void 0===s?"#0B141A":s,l=r.waveformColor,c=void 0===l?"#E9EDEF":l,u=r.timerColor,d=void 0===u?"#FFFFFF":u,C=r.sendButtonColor,f=r.deleteIconColor,h=void 0===f?"#8696A0":f,v=r.height,p=void 0===v?110:v,m=r.borderRadius,g=void 0===m?18:m,y=r.waveCount,x=void 0===y?28:y,w=r.waveSpacing,b=void 0===w?3:w,S=r.waveWidth,E=void 0===S?3:S,_=r.renderDeleteIcon,R=r.renderSendIcon,k=r.renderWaveform,O=r.onSend,j=r.onDelete,M=I(n.useState(0),2),T=M[0],V=M[1],P=n.useRef(Date.now());n.useEffect((function(){P.current=Date.now();var e=setInterval((function(){V((Date.now()-P.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var G=a.useSharedValue(1),D=a.useSharedValue(1);n.useEffect((function(){G.value=a.withRepeat(a.withSequence(a.withTiming(1.05,{duration:900,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:900,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),D.value=a.withRepeat(a.withSequence(a.withTiming(.45,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var K,L,F=a.useAnimatedStyle((K=[new global.Error,-2,-27],(L=function(){return{transform:[{scale:G.value}]}}).__closure={sendScale:G},L.__workletHash=0xb10ea8440da,L.__initData=An,L.__stackDetails=K,L)),H=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:D.value}};return t.__closure={pauseOpacity:D},t.__workletHash=0xfe959e3782e,t.__initData=ln,t.__stackDetails=e,t}()),B={height:p,backgroundColor:A,borderTopLeftRadius:g,borderTopRightRadius:g},U=null!=C?C:i;return e.jsx(t.View,{style:[Cn.container,B],children:e.jsxs(t.View,{style:Cn.row,children:[e.jsx(t.Pressable,{onPress:j,hitSlop:10,style:Cn.deleteWrapper,accessibilityRole:"button",accessibilityLabel:"Delete recording",children:_?_():e.jsx(lr,{style:{width:26,height:26},color:h})}),e.jsxs(t.View,{style:Cn.center,children:[e.jsxs(t.View,{style:Cn.timerRow,children:[e.jsx(t.Text,{style:[Cn.timer,{color:d}],numberOfLines:1,children:Qe(T)}),e.jsx(t.View,{style:Cn.waveformWrapper,children:k?k():e.jsx(cn,{color:c,count:x,spacing:b,barWidth:E})})]}),e.jsxs(a.View,{style:[Cn.pauseRow,H],children:[e.jsx(t.View,{style:Cn.pauseBar}),e.jsx(t.View,{style:Cn.pauseBar})]})]}),e.jsx(a.View,{style:F,children:e.jsx(t.Pressable,{onPress:O,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[Cn.sendButton,{backgroundColor:U}],children:R?R():e.jsx(Zt,{style:{width:30,height:30},color:"#FFFFFF"})})})]})})},exports.VoiceRecorderFlow=function(r){var o=r.primaryColor,i=void 0===o?"#22C55E":o,A=r.backgroundColor,l=void 0===A?"#0B141A":A,c=r.timerColor,u=void 0===c?"#FFFFFF":c,d=r.microphoneColor,C=void 0===d?"#FFFFFF":d,f=r.lockColor,h=void 0===f?"#E9EDEF":f,v=r.waveformColor,p=void 0===v?"#E9EDEF":v,m=r.deleteIconColor,g=void 0===m?"#8696A0":m,y=r.renderMicIcon,x=r.renderSendIcon,w=r.renderLockIcon,b=r.renderArrowIcon,S=r.renderDeleteIcon,E=r.renderWaveform,_=r.onRecordingStart,R=r.onRecordingStop,k=r.onSend,O=r.onDelete,j=r.onLock,M=r.onCancel,T=I(n.useState("IDLE"),2),V=T[0],P=T[1],G=I(n.useState(0),2),D=G[0],K=G[1],L=n.useRef("IDLE");n.useEffect((function(){L.current=V}),[V]);var F=a.useSharedValue(0);n.useEffect((function(){F.value=function(e){switch(e){case"IDLE":return 0;case"RECORDING_TAP":return 1;case"RECORDING_HOLD":return 2;case"LOCKED_RECORDING":return 3;case"SENDING":return 4;case"CANCELLED":return 5}}(V)}),[V]);var H=n.useRef(0),B=a.useSharedValue(0),U=a.useSharedValue(0),Y=a.useSharedValue(0),W=a.useSharedValue(120),N=a.useSharedValue(1),z=a.useSharedValue(0),Q=a.useSharedValue(0),X=a.useSharedValue(1),J=a.useSharedValue(0),q=a.useSharedValue(0),$=a.useSharedValue(0);n.useEffect((function(){N.value=a.withRepeat(a.withSequence(a.withTiming(1.06,{duration:850,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:850,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),z.value=a.withRepeat(a.withSequence(a.withTiming(-4,{duration:700,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:700,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),Q.value=a.withRepeat(a.withSequence(a.withTiming(-5,{duration:500,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:500,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),X.value=a.withRepeat(a.withSequence(a.withTiming(.45,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),J.value=a.withRepeat(a.withTiming(1,{duration:4500,easing:a.Easing.linear}),-1,!1)}),[]),n.useEffect((function(){if("RECORDING_TAP"===V||"RECORDING_HOLD"===V||"LOCKED_RECORDING"===V){var e=setInterval((function(){K((Date.now()-H.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[V]);var Z=n.useRef(_);Z.current=_;var ee=n.useRef(R);ee.current=R;var te=n.useRef(k);te.current=k;var re=n.useRef(O);re.current=O;var ne=n.useRef(j);ne.current=j;var oe=n.useRef(M);oe.current=M;var ie=n.useCallback((function(){var e;H.current=Date.now(),K(0),q.value=0,$.value=0,B.value=0,U.value=0,Y.value=a.withTiming(1,{duration:280}),W.value=a.withSpring(0,{damping:18,stiffness:180}),null===(e=Z.current)||void 0===e||e.call(Z)}),[]),ae=n.useCallback((function(){K(0),B.value=0,U.value=0,W.value=120,Y.value=0,P("IDLE")}),[]),se=n.useCallback((function(){var e,t;Y.value=a.withTiming(0,{duration:280}),W.value=a.withTiming(120,{duration:280,easing:a.Easing.in(a.Easing.cubic)},(e=[new global.Error,-3,-27],(t=function(e){e&&a.runOnJS(ae)()}).__closure={runOnJS:a.runOnJS,finalizeReset:ae},t.__workletHash=6814982830705,t.__initData=Kn,t.__stackDetails=e,t))}),[ae]),Ae=n.useCallback((function(){var e,t,r=(Date.now()-H.current)/1e3;P("SENDING"),null===(e=ee.current)||void 0===e||e.call(ee),null===(t=te.current)||void 0===t||t.call(te,{duration:r}),se()}),[se]),le=n.useCallback((function(){var e=L.current;if("IDLE"===e)return P("RECORDING_TAP"),void ie();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||Ae()}),[ie,Ae]),ce=n.useCallback((function(){"IDLE"===L.current&&(P("RECORDING_HOLD"),ie())}),[ie]),ue=n.useCallback((function(){var e;"RECORDING_HOLD"===L.current&&(Mn(),P("LOCKED_RECORDING"),B.value=a.withSpring(0,{damping:18,stiffness:180}),U.value=a.withSpring(0,{damping:18,stiffness:180}),null===(e=ne.current)||void 0===e||e.call(ne))}),[]),de=n.useCallback((function(){var e,t,r,n=L.current;"RECORDING_HOLD"!==n&&"RECORDING_TAP"!==n&&"LOCKED_RECORDING"!==n||(Mn(),P("CANCELLED"),null===(e=ee.current)||void 0===e||e.call(ee),null===(t=oe.current)||void 0===t||t.call(oe),null===(r=re.current)||void 0===r||r.call(re),se())}),[se]),Ce=n.useCallback((function(){"RECORDING_HOLD"===L.current&&Ae()}),[Ae]),fe=n.useRef(le);fe.current=le;var he=n.useRef(ce);he.current=ce;var ve=n.useRef(Ce);ve.current=Ce;var pe=n.useRef(ue);pe.current=ue;var me=n.useRef(de);me.current=de;var ge,ye,xe=function(){return fe.current()},we=function(){return he.current()},be=function(){return ve.current()},Se=function(){return pe.current()},Ee=function(){return me.current()},_e=n.useMemo((function(){var e,t,r=s.Gesture.Tap().maxDuration(290).onEnd((e=[new global.Error,-3,-27],(t=function(e,t){t&&a.runOnJS(xe)()}).__closure={runOnJS:a.runOnJS,fireQuickTap:xe},t.__workletHash=0xe487aac71a2,t.__initData=Ln,t.__stackDetails=e,t)),n=s.Gesture.Pan().activateAfterLongPress(300).onStart(function(){var e=[new global.Error,-3,-27],t=function(){a.runOnJS(we)()};return t.__closure={runOnJS:a.runOnJS,fireHoldStart:we},t.__workletHash=5634645742267,t.__initData=Fn,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-14,-27],t=function(e){if(2===F.value){var t=Math.max(-150,Math.min(0,e.translationX)),r=Math.max(-120,Math.min(0,e.translationY));B.value=t,U.value=r;var n=Math.abs(r)>Math.abs(t);n&&0===$.value&&r<=jn&&($.value=1,a.runOnJS(Se)()),!n&&0===q.value&&t<=On&&(q.value=1,a.runOnJS(Ee)())}};return t.__closure={stateShared:F,STATE_HOLD:2,MAX_LEFT:-150,MAX_UP:-120,translateX:B,translateY:U,lockFiredShared:$,LOCK_THRESHOLD:jn,runOnJS:a.runOnJS,fireLock:Se,cancelFiredShared:q,CANCEL_THRESHOLD:On,fireCancel:Ee},t.__workletHash=3774937740471,t.__initData=Hn,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-3,-27],t=function(){a.runOnJS(be)()};return t.__closure={runOnJS:a.runOnJS,fireHoldEnd:be},t.__workletHash=8780501045437,t.__initData=Bn,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===$.value&&0===q.value&&(B.value=a.withSpring(0,{damping:18,stiffness:180}),U.value=a.withSpring(0,{damping:18,stiffness:180}))};return t.__closure={lockFiredShared:$,cancelFiredShared:q,translateX:B,withSpring:a.withSpring,translateY:U},t.__workletHash=0xf5629271812,t.__initData=Un,t.__stackDetails=e,t}());return s.Gesture.Race(r,n)}),[]),Re=a.useAnimatedStyle((ge=[new global.Error,-3,-27],(ye=function(){return{opacity:Y.value,transform:[{translateY:W.value}]}}).__closure={containerOpacity:Y,containerY:W},ye.__workletHash=0xe4a6e44ca8f,ye.__initData=Yn,ye.__stackDetails=ge,ye)),ke=a.useAnimatedStyle(function(){var e=[new global.Error,-7,-27],t=function(){var e=2===F.value,t=0===F.value?1:N.value;return{transform:[{translateX:e?B.value:0},{translateY:e?U.value:0},{scale:t}]}};return t.__closure={stateShared:F,STATE_HOLD:2,STATE_IDLE:0,micPulse:N,translateX:B,translateY:U},t.__workletHash=966893052371,t.__initData=Wn,t.__stackDetails=e,t}()),Ie=a.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){return{opacity:a.interpolate(B.value,[0,On],[1,0],a.Extrapolation.CLAMP),transform:[{translateX:.55*B.value+z.value}]}};return t.__closure={interpolate:a.interpolate,translateX:B,CANCEL_THRESHOLD:On,Extrapolation:a.Extrapolation,arrowPulse:z},t.__workletHash=289901874090,t.__initData=Nn,t.__stackDetails=e,t}()),Oe=a.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){var e=a.interpolate(U.value,[0,-10],[0,1],a.Extrapolation.CLAMP),t=a.interpolate(U.value,[0,jn],[0,1],a.Extrapolation.CLAMP);return{opacity:e,transform:[{scale:.7+.3*e},{translateY:a.interpolate(t,[0,1],[0,-22])}]}};return t.__closure={interpolate:a.interpolate,translateY:U,LOCK_REVEAL_TRAVEL:-10,Extrapolation:a.Extrapolation,LOCK_THRESHOLD:jn},t.__workletHash=7437293893991,t.__initData=zn,t.__stackDetails=e,t}()),je=a.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=a.interpolate(U.value,[0,jn],[0,1],a.Extrapolation.CLAMP);return{height:"".concat(Math.round(100*e),"%")}};return t.__closure={interpolate:a.interpolate,translateY:U,LOCK_THRESHOLD:jn,Extrapolation:a.Extrapolation},t.__workletHash=2643638419470,t.__initData=Qn,t.__stackDetails=e,t}()),Me=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:Q.value}]}};return t.__closure={chevronPulse:Q},t.__workletHash=2094038225597,t.__initData=Xn,t.__stackDetails=e,t}()),Te=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:X.value}};return t.__closure={pauseOpacity:X},t.__workletHash=0xe14e5c18bcc,t.__initData=Jn,t.__stackDetails=e,t}()),Ve="IDLE"!==V,Pe="RECORDING_HOLD"===V,Ge="RECORDING_TAP"===V||"LOCKED_RECORDING"===V||"SENDING"===V;return e.jsxs(t.View,{style:ro.root,pointerEvents:"box-none",children:[Ve&&e.jsx(a.View,{style:[ro.bar,{backgroundColor:l},Re],children:Ge?e.jsx(qn,{duration:D,timerColor:u,waveformColor:p,deleteIconColor:g,waveTick:J,pauseAnimatedStyle:Te,renderDeleteIcon:S,renderWaveform:E,onDeletePress:de}):e.jsx($n,{duration:D,timerColor:u,slideTextStyle:Ie,renderArrowIcon:b})}),Pe&&e.jsxs(a.View,{style:[ro.lockPill,Oe],pointerEvents:"none",children:[w?w():e.jsx(nr,{style:{width:20,height:20},color:h}),e.jsx(t.View,{style:ro.lockProgressTrack,children:e.jsx(a.View,{style:[ro.lockProgressFill,{backgroundColor:i},je]})}),e.jsx(a.View,{style:Me,children:e.jsx(rr,{style:{width:16,height:16},color:h})})]}),e.jsx(t.View,{style:ro.buttonAnchor,pointerEvents:"box-none",children:e.jsx(s.GestureDetector,{gesture:_e,children:e.jsx(a.View,{style:[ro.micPressable,ke],accessibilityRole:"button",accessibilityLabel:Ge?"Send recording":"Tap to record. Long-press and slide left to cancel or up to lock.",children:e.jsx(t.View,{style:[ro.mic,{backgroundColor:i}],children:Ge?x?x():e.jsx(Zt,{style:{width:30,height:30},color:"#FFFFFF"}):y?y():e.jsx(qt,{style:{width:30,height:30},color:C})})})})})]})},exports.VoiceRecordingGesture=function(r){var o=r.primaryColor,i=void 0===o?"#22C55E":o,A=r.backgroundColor,l=void 0===A?"#0B141A":A,c=r.timerColor,u=void 0===c?"#FFFFFF":c,d=r.microphoneColor,C=void 0===d?"#FFFFFF":d,f=r.lockColor,h=void 0===f?"#E9EDEF":f,v=r.renderMicIcon,p=r.renderLockIcon,m=r.renderArrowIcon,g=r.onCancel,y=r.onLock,x=I(n.useState(0),2),w=x[0],b=x[1],S=n.useRef(Date.now());n.useEffect((function(){S.current=Date.now();var e=setInterval((function(){b((Date.now()-S.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var E=a.useSharedValue(0),_=a.useSharedValue(0),R=a.useSharedValue(0),k=a.useSharedValue(1),O=a.useSharedValue(0),j=a.useSharedValue(0),M=a.useSharedValue(0),T=a.useSharedValue(0);n.useEffect((function(){R.value=a.withRepeat(a.withSequence(a.withTiming(-4,{duration:700,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:700,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),k.value=a.withRepeat(a.withSequence(a.withTiming(1.08,{duration:850,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:850,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),O.value=a.withRepeat(a.withSequence(a.withTiming(-5,{duration:500,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:500,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var V=n.useRef(g);V.current=g;var P=n.useRef(y);P.current=y;var G,D,K=function(){var e;pn(),null===(e=V.current)||void 0===e||e.call(V)},L=function(){var e;pn(),null===(e=P.current)||void 0===e||e.call(P)},F=s.Gesture.Pan().minDistance(0).onBegin((G=[new global.Error,-5,-27],D=function(){M.value=0,T.value=0,E.value=0,_.value=0},D.__closure={cancelFired:M,lockFired:T,dragX:E,dragY:_},D.__workletHash=9031413480896,D.__initData=mn,D.__stackDetails=G,D)).onUpdate(function(){var e=[new global.Error,-12,-27],t=function(e){var t=Math.min(0,e.translationX),r=Math.min(0,e.translationY);E.value=t,_.value=r,0===T.value&&r<=-70&&(T.value=1,j.value=a.withTiming(1,{duration:180}),a.runOnJS(L)()),0===M.value&&t<=-90&&(M.value=1,a.runOnJS(K)())};return t.__closure={dragX:E,dragY:_,lockFired:T,LOCK_THRESHOLD:vn,lockHighlight:j,withTiming:a.withTiming,runOnJS:a.runOnJS,fireLock:L,cancelFired:M,CANCEL_THRESHOLD:90,fireCancel:K},t.__workletHash=0x920fdf71852,t.__initData=gn,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-5,-27],t=function(){0===T.value&&(E.value=a.withSpring(0,{damping:18,stiffness:180}),_.value=a.withSpring(0,{damping:18,stiffness:180}))};return t.__closure={lockFired:T,dragX:E,withSpring:a.withSpring,dragY:_},t.__workletHash=0xb14c5cd4e31,t.__initData=yn,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-5,-27],t=function(){0===T.value&&(E.value=a.withSpring(0,{damping:18,stiffness:180}),_.value=a.withSpring(0,{damping:18,stiffness:180}))};return t.__closure={lockFired:T,dragX:E,withSpring:a.withSpring,dragY:_},t.__workletHash=6312451443030,t.__initData=xn,t.__stackDetails=e,t}()),H=a.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.abs(E.value)/90);return{transform:[{translateX:.55*E.value+R.value}],opacity:1-e}};return t.__closure={dragX:E,CANCEL_THRESHOLD:90,arrowPulse:R},t.__workletHash=0xd7ebb4d9e07,t.__initData=wn,t.__stackDetails=e,t}()),B=a.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=Math.min(1,Math.max(0,-_.value/12)),t=Math.min(1,Math.max(0,-_.value/vn));return{opacity:e,transform:[{scale:.85+.15*e},{translateY:a.interpolate(t,[0,1],[0,-22])}]}};return t.__closure={dragY:_,LOCK_REVEAL_TRAVEL:12,LOCK_THRESHOLD:vn,interpolate:a.interpolate},t.__workletHash=4153451354770,t.__initData=bn,t.__stackDetails=e,t}()),U=a.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{borderWidth:Math.min(1,Math.max(0,-_.value/vn))>.85||j.value>0?1.5:0}};return t.__closure={dragY:_,LOCK_THRESHOLD:vn,lockHighlight:j},t.__workletHash=0xedc5d558aef,t.__initData=Sn,t.__stackDetails=e,t}()),Y=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:O.value}]}};return t.__closure={chevronPulse:O},t.__workletHash=2030830631140,t.__initData=En,t.__stackDetails=e,t}()),W=a.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){var e=Math.min(1,Math.max(0,-_.value/vn));return{height:"".concat(Math.round(100*e),"%")}};return t.__closure={dragY:_,LOCK_THRESHOLD:vn},t.__workletHash=0xe54f0ad7c69,t.__initData=_n,t.__stackDetails=e,t}()),N=a.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=j.value;return{transform:[{translateX:E.value},{translateY:_.value},{scale:k.value*(1+.04*e)}]}};return t.__closure={lockHighlight:j,dragX:E,dragY:_,micPulse:k},t.__workletHash=6567433970992,t.__initData=Rn,t.__stackDetails=e,t}()),z={backgroundColor:l};return e.jsxs(t.View,{style:kn.wrapper,pointerEvents:"box-none",children:[e.jsxs(a.View,{style:[kn.lockPill,B,U],pointerEvents:"none",children:[e.jsx(a.View,{children:p?p():e.jsx(nr,{style:{width:20,height:20},color:h})}),e.jsx(t.View,{style:kn.lockProgressTrack,children:e.jsx(a.View,{style:[kn.lockProgressFill,{backgroundColor:i},W]})}),e.jsx(a.View,{style:Y,children:e.jsx(rr,{style:{width:16,height:16},color:h})})]}),e.jsxs(t.View,{style:[kn.bar,z],children:[e.jsx(t.Text,{style:[kn.timer,{color:u}],numberOfLines:1,children:Qe(w)}),e.jsxs(a.View,{style:[kn.slideArea,H],children:[m?m():e.jsx(t.Text,{style:kn.slideArrow,children:"‹"}),e.jsx(t.Text,{style:kn.slideText,children:"Slide to cancel"})]}),e.jsx(s.GestureDetector,{gesture:F,children:e.jsx(a.View,{style:kn.micPressable,accessibilityRole:"button",accessibilityLabel:"Hold to record. Slide left to cancel, slide up to lock.",children:e.jsx(a.View,{style:[kn.mic,{backgroundColor:i},N],children:v?v():e.jsx(qt,{style:{width:30,height:30},color:C})})})})]})]})},exports.default=function(t){return e.jsx(ze,{children:e.jsx(G,g(g({},t),{},{children:e.jsx(no,{})}))})};
|
|
17
17
|
//# sourceMappingURL=index.js.map
|