movius-chats 1.5.0 → 1.5.2

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.
Files changed (62) hide show
  1. package/lib/commonjs/index.js +4 -4
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/module/index.js +4 -4
  4. package/lib/module/index.js.map +1 -1
  5. package/lib/typescript/assets/Icons/CopyIcon.d.ts +5 -0
  6. package/lib/typescript/assets/Icons/EditIcon.d.ts +5 -0
  7. package/lib/typescript/assets/Icons/ForwardIcon.d.ts +5 -0
  8. package/lib/typescript/assets/Icons/ReplyIcon.d.ts +5 -0
  9. package/lib/typescript/assets/Icons/SwitchCameraIcon.d.ts +5 -0
  10. package/lib/typescript/components/CameraScreen/CameraScreen.d.ts +15 -0
  11. package/lib/typescript/components/CameraScreen/constants.d.ts +13 -0
  12. package/lib/typescript/components/CameraScreen/index.d.ts +1 -0
  13. package/lib/typescript/components/CameraScreen/useCameraController.d.ts +26 -0
  14. package/lib/typescript/components/CameraScreen/visionCamera.d.ts +16 -0
  15. package/lib/typescript/components/ChatBubble/types.d.ts +7 -4
  16. package/lib/typescript/components/MessageActions/MessageActionsPopover.d.ts +14 -0
  17. package/lib/typescript/components/MessageActions/MessageActionsSheet.d.ts +25 -0
  18. package/lib/typescript/components/MessageActions/clipboard.d.ts +10 -0
  19. package/lib/typescript/components/MessageActions/index.d.ts +3 -0
  20. package/lib/typescript/components/Reply/InlineReply.d.ts +18 -0
  21. package/lib/typescript/components/Reply/ReplyPreview.d.ts +21 -0
  22. package/lib/typescript/components/Reply/SwipeableMessage.d.ts +12 -0
  23. package/lib/typescript/components/Reply/index.d.ts +3 -0
  24. package/lib/typescript/components/VoiceRecorder/VoiceRecorderFlow/InlineRow.d.ts +6 -0
  25. package/lib/typescript/components/VoiceRecorder/VoiceRecorderFlow/RecordingBar.d.ts +1 -0
  26. package/lib/typescript/components/VoiceRecorder/VoiceRecorderFlow/types.d.ts +16 -0
  27. package/lib/typescript/context/ChatContext.d.ts +24 -1
  28. package/lib/typescript/index.d.ts +5 -1
  29. package/lib/typescript/types/index.d.ts +214 -0
  30. package/package.json +10 -2
  31. package/src/assets/Icons/CopyIcon.tsx +17 -0
  32. package/src/assets/Icons/EditIcon.tsx +17 -0
  33. package/src/assets/Icons/ForwardIcon.tsx +17 -0
  34. package/src/assets/Icons/PauseIcon.tsx +6 -3
  35. package/src/assets/Icons/PlayIcon.tsx +9 -6
  36. package/src/assets/Icons/ReplyIcon.tsx +17 -0
  37. package/src/assets/Icons/SwitchCameraIcon.tsx +17 -0
  38. package/src/components/CameraScreen/CameraScreen.tsx +560 -0
  39. package/src/components/CameraScreen/constants.ts +16 -0
  40. package/src/components/CameraScreen/index.ts +1 -0
  41. package/src/components/CameraScreen/useCameraController.ts +203 -0
  42. package/src/components/CameraScreen/visionCamera.ts +26 -0
  43. package/src/components/ChatBubble/ChatBubble.tsx +106 -3
  44. package/src/components/ChatBubble/MessageContent.tsx +34 -1
  45. package/src/components/ChatBubble/MessageStatus.tsx +28 -3
  46. package/src/components/ChatBubble/types.ts +7 -4
  47. package/src/components/ChatInput/ChatInput.tsx +424 -167
  48. package/src/components/MessageActions/MessageActionsPopover.tsx +256 -0
  49. package/src/components/MessageActions/MessageActionsSheet.tsx +178 -0
  50. package/src/components/MessageActions/clipboard.ts +40 -0
  51. package/src/components/MessageActions/index.ts +3 -0
  52. package/src/components/Reply/InlineReply.tsx +126 -0
  53. package/src/components/Reply/ReplyPreview.tsx +169 -0
  54. package/src/components/Reply/SwipeableMessage.tsx +145 -0
  55. package/src/components/Reply/index.ts +3 -0
  56. package/src/components/VoiceRecorder/VoiceRecorderFlow/InlineRow.tsx +81 -27
  57. package/src/components/VoiceRecorder/VoiceRecorderFlow/RecordingBar.tsx +13 -5
  58. package/src/components/VoiceRecorder/VoiceRecorderFlow/index.tsx +12 -0
  59. package/src/components/VoiceRecorder/VoiceRecorderFlow/types.ts +18 -0
  60. package/src/context/ChatContext.tsx +160 -12
  61. package/src/index.tsx +179 -4
  62. package/src/types/index.ts +260 -0
@@ -1,6 +1,6 @@
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-gesture-handler"),l=require("react-native-reanimated");function s(e,t){this.v=e,this.k=t}function A(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 l=e[i](a),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).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,l,"next",e)}function l(e){c(i,n,o,a,l,"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,P(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function h(e,t,r){return(t=P(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 y(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 g(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(){
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("react-native"),n=require("twrnc"),o=require("react-native-svg"),i=require("react-native-gesture-handler"),a=require("react-native-reanimated"),l=require("react-native-video");function s(e,t){this.v=e,this.k=t}function A(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 l=e[i](a),s=l.value}catch(e){return void r(e)}l.done?t(s):Promise.resolve(s).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,l,"next",e)}function l(e){c(i,n,o,a,l,"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,m()?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 h(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,T(n.key),n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e,t,r){return(t=T(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 m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(m=function(){return!!e})()}function p(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?p(Object(r),!0).forEach((function(t){f(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(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,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof l?n:l,A=Object.create(s.prototype);return E(A,"_invoke",function(r,n,o){var i,l,s,A=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,l=0,s=e,d.n=r,a}};function C(r,n){for(l=r,s=n,t=0;!u&&A&&!o&&t<c.length;t++){var o,i=c[t],C=d.p,f=i[2];r>3?(o=f===n)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=C&&((o=r<2&&C<i[1])?(l=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,l=0))}if(o||r>1)return a;throw u=!0,n}return function(o,c,f){if(A>1)throw TypeError("Generator is already running");for(u&&1===c&&C(c,f),l=c,s=f;(t=l<2?e:s)||!u;){i||(l?l<3?(l>1&&(d.n=-1),C(l,s)):d.n=s:d.v=s);try{if(A=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(u=d.n<0)?s:r.call(n,d))!==a)break}catch(t){i=e,l=1,s=t}finally{A=1}}return{value:t,done:u}}}(r,o,i),!0),A}var a={};function l(){}function s(){}function A(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(E(t={},n,(function(){return this})),t),u=A.prototype=l.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,E(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=A,E(u,"constructor",A),E(A,"constructor",s),s.displayName="GeneratorFunction",E(A,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 S(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 w(x().w(e,t,r,n),o||Promise)}function w(e,t){function r(n,o,i,a){try{var l=e[n](o),A=l.value;return A instanceof s?t.resolve(A.v).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(A).then((function(e){l.value=e,i(l)}),(function(e){return r("throw",e,i,a)}))}catch(e){a(e)}}var n;this.next||(E(w.prototype),E(w.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 k(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 j(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 I(e,t){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},I(e,t)}function O(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,l=[],s=!0,A=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){A=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return A(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)?A(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 _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function P(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,j(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 s(e,t)},AsyncIterator:w,async:function(e,t,r,o,a){return(n(t)?b:S)(i(e),t,r,o,a)},keys:k,values:j}})()}var R=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"})})},T=["children"],G=n.createContext(void 0),V=function(t){var r=t.children,o=g(t,T),i=O(n.useState(null),2),a=i[0],l=i[1],s=O(n.useState(!1),2),A=s[0],c=s[1];return e.jsx(G.Provider,{value:y(y({},o),{},{mediaViewerGallery:a,setMediaViewerGallery:function(e,t){l({items:e,initialIndex:t});var r=e[t];c("video"===(null==r?void 0:r.kind))},clearMediaViewerGallery:function(){l(null),c(!1)},isVideoPlaying:A,setIsVideoPlaying:c}),children:r})},D=function(){var e=n.useContext(G);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 F(e,t){var r,n,o,i,a=K(e),l=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)",s=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 y(y({},{paddingHorizontal:8,paddingVertical:4,borderRadius:6}),{},{backgroundColor:l},s)}function L(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 B(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 H(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 N(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 Y(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 J(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var q,X={exports:{}},$={exports:{}},Z={};var ee,te,re,ne,oe,ie,ae,le,se,Ae,ce,ue,de,Ce,fe,he={};
3
+ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof l?n:l,A=Object.create(s.prototype);return k(A,"_invoke",function(r,n,o){var i,l,s,A=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,l=0,s=e,d.n=r,a}};function C(r,n){for(l=r,s=n,t=0;!u&&A&&!o&&t<c.length;t++){var o,i=c[t],C=d.p,h=i[2];r>3?(o=h===n)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=C&&((o=r<2&&C<i[1])?(l=0,d.v=n,d.n=i[1]):C<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,d.n=h,l=0))}if(o||r>1)return a;throw u=!0,n}return function(o,c,h){if(A>1)throw TypeError("Generator is already running");for(u&&1===c&&C(c,h),l=c,s=h;(t=l<2?e:s)||!u;){i||(l?l<3?(l>1&&(d.n=-1),C(l,s)):d.n=s:d.v=s);try{if(A=2,i){if(l||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(u=d.n<0)?s:r.call(n,d))!==a)break}catch(t){i=e,l=1,s=t}finally{A=1}}return{value:t,done:u}}}(r,o,i),!0),A}var a={};function l(){}function s(){}function A(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(k(t={},n,(function(){return this})),t),u=A.prototype=l.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,A):(e.__proto__=A,k(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return s.prototype=A,k(u,"constructor",A),k(A,"constructor",s),s.displayName="GeneratorFunction",k(A,o,"GeneratorFunction"),k(u),k(u,o,"Generator"),k(u,n,(function(){return this})),k(u,"toString",(function(){return"[object Generator]"})),(x=function(){return{w:i,m:d}})()}function b(e,t,r,n,o){var i=w(e,t,r,n,o);return i.next().then((function(e){return e.done?e.value:i.next()}))}function w(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 l=e[n](o),A=l.value;return A instanceof s?t.resolve(A.v).then((function(e){r("next",e,i,a)}),(function(e){r("throw",e,i,a)})):t.resolve(A).then((function(e){l.value=e,i(l)}),(function(e){return r("throw",e,i,a)}))}catch(e){a(e)}}var n;this.next||(k(S.prototype),k(S.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),k(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 k(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}k=function(e,t,r,n){function i(t,r){k(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))},k(e,t,r,n)}function E(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 j(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 M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(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,l=[],s=!0,A=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){A=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(A)throw o}}return l}}(e,t)||R(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 _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function P(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||R(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(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 R(e,t){if(e){if("string"==typeof e)return A(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)?A(e,t):void 0}}function O(){var e=x(),t=e.m(O),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,j(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(O=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 s(e,t)},AsyncIterator:S,async:function(e,t,r,o,a){return(n(t)?w:b)(i(e),t,r,o,a)},keys:E,values:j}})()}var G=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"})})},F=["children"],V=t.createContext(void 0),D=function(r){var n=r.children,o=y(r,F),i=I(t.useState(null),2),a=i[0],l=i[1],s=I(t.useState(!1),2),A=s[0],c=s[1],u=I(t.useState(null),2),d=u[0],C=u[1],h=I(t.useState(null),2),f=h[0],v=h[1],m=I(t.useState(null),2),p=m[0],x=m[1],b=I(t.useState(!1),2),w=b[0],S=b[1],k=I(t.useState([]),2),E=k[0],j=k[1],M=I(t.useState(null),2),_=M[0],T=M[1],R=I(t.useState(!1),2),O=R[0],G=R[1],D=t.useCallback((function(e,t){l({items:e,initialIndex:t});var r=e[t];c("video"===(null==r?void 0:r.kind))}),[]),K=t.useCallback((function(){l(null),c(!1)}),[]),B=o.onSelectionChange,L=t.useCallback((function(e){null==B||B(e)}),[B]),U=t.useCallback((function(e){var t;C(e),T(null),null===(t=o.onReplyMessage)||void 0===t||t.call(o,e)}),[o]),H=t.useCallback((function(){C(null)}),[]),z=t.useCallback((function(e,t){x(null!=t?t:null),v(e)}),[]),W=t.useCallback((function(){v(null),x(null)}),[]),N=t.useCallback((function(e){S(!0);var t=e?[e.id]:[];j(t),L(t)}),[L]),Q=t.useCallback((function(){S(!1),j([]),L([])}),[L]),Y=t.useCallback((function(e){j((function(t){var r=t.includes(e.id)?t.filter((function(t){return t!==e.id})):[].concat(P(t),[e.id]);return L(r),r}))}),[L]),q=t.useCallback((function(e){return E.includes(e)}),[E]),J=t.useCallback((function(e){T(e),C(null)}),[]),X=t.useCallback((function(){T(null)}),[]),$=t.useCallback((function(){return G(!0)}),[]),Z=t.useCallback((function(){return G(!1)}),[]);return e.jsx(V.Provider,{value:g(g({},o),{},{mediaViewerGallery:a,setMediaViewerGallery:D,clearMediaViewerGallery:K,isVideoPlaying:A,setIsVideoPlaying:c,replyTarget:d,startReply:U,cancelReply:H,actionSheetMessage:f,actionAnchor:p,openActionSheet:z,closeActionSheet:W,selectionMode:w,selectedIds:E,enterSelectionMode:N,exitSelectionMode:Q,toggleSelection:Y,isSelected:q,editingMessage:_,startEdit:J,cancelEdit:X,cameraVisible:O,openCamera:$,closeCamera:Z}),children:n})},K=function(){var e=t.useContext(V);if(!e)throw new Error("useChatContext must be used within a ChatProvider");return e};function B(e){return null==e?void 0:e.colors}function L(e,t){var r,n,o,i,a=B(e),l=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)",s=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:l},s)}function U(e,t){var r,n,o=B(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=B(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 z(e,t){var r,n,o=B(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 W(e,t){var r,n,o=B(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 N(e,t){var r=B(e);return t?null==r?void 0:r.sentMessageTextColor:null==r?void 0:r.receivedMessageTextColor}function Q(e,t){var r=B(e);return t?null==r?void 0:r.sentBubbleBackgroundColor:null==r?void 0:r.receivedBubbleBackgroundColor}function Y(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 q="ios"===r.Platform.OS?"h-6 w-6":"w-6 h-6";function J(e,t){return t?[e,{fontFamily:t}]:e}var X,$,Z,ee=function(t){var r=t.style,n=t.color,i=void 0===n?"#FFFFFF":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:i,d:"M10 9V5l-7 7l7 7v-4.1c5 0 8.5 1.6 11 5.1c-1-5-4-10-11-11"})})},te={code:"function SwipeableMessageTsx1(e){const{isCurrentUser,swipeThreshold,translateX,direction,triggered,runOnJS,triggerReply}=this.__closure;const t=e.translationX;if(isCurrentUser&&t<0||!isCurrentUser&&t>0){const abs=Math.abs(t);const resisted=abs<=swipeThreshold?abs:swipeThreshold+(abs-swipeThreshold)*0.35;translateX.value=direction*resisted;if(abs>=swipeThreshold&&triggered.value===0){triggered.value=1;runOnJS(triggerReply)();}}else{translateX.value=0;}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx1","e","isCurrentUser","swipeThreshold","translateX","direction","triggered","runOnJS","triggerReply","__closure","t","translationX","abs","Math","resisted","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAmBmB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,aAAA,CAAAC,cAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,YAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGT,CAAC,CAACU,YAAY,CAExB,GAAKT,aAAa,EAAIQ,CAAC,CAAG,CAAC,EAAM,CAACR,aAAa,EAAIQ,CAAC,CAAG,CAAE,CAAE,CAEvD,KAAM,CAAAE,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACF,CAAC,CAAC,CACvB,KAAM,CAAAI,QAAQ,CAAGF,GAAG,EAAIT,cAAc,CAChCS,GAAG,CACHT,cAAc,CAAG,CAACS,GAAG,CAAGT,cAAc,EAAI,IAAI,CACpDC,UAAU,CAACW,KAAK,CAAGV,SAAS,CAAGS,QAAQ,CACvC,GAAIF,GAAG,EAAIT,cAAc,EAAIG,SAAS,CAACS,KAAK,GAAK,CAAC,CAAE,CAChDT,SAAS,CAACS,KAAK,CAAG,CAAC,CACnBR,OAAO,CAACC,YAAY,CAAC,CAAC,CAAC,CAC3B,CACJ,CAAC,IACI,CACDJ,UAAU,CAACW,KAAK,CAAG,CAAC,CACxB,CACJ","ignoreList":[]}',version:"3.16.7"},re={code:"function SwipeableMessageTsx2(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx2","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAuCe,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAEbJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},ne={code:"function SwipeableMessageTsx3(){const{translateX,withSpring,triggered,withTiming}=this.__closure;translateX.value=withSpring(0,{damping:20,stiffness:220});triggered.value=withTiming(0,{duration:200});}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx3","translateX","withSpring","triggered","withTiming","__closure","value","damping","stiffness","duration"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AA4CoB,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,UAAA,CAAAC,SAAA,CAAAC,UAAA,OAAAC,SAAA,CAElBJ,UAAU,CAACK,KAAK,CAAGJ,UAAU,CAAC,CAAC,CAAE,CAAEK,OAAO,CAAE,EAAE,CAAEC,SAAS,CAAE,GAAI,CAAC,CAAC,CACjEL,SAAS,CAACG,KAAK,CAAGF,UAAU,CAAC,CAAC,CAAE,CAAEK,QAAQ,CAAE,GAAI,CAAC,CAAC,CACtD","ignoreList":[]}',version:"3.16.7"},oe={code:"function SwipeableMessageTsx4(){const{translateX}=this.__closure;return{transform:[{translateX:translateX.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx4","translateX","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAiDyC,SAAAA,qBAAA,QAAAC,UAAA,OAAAC,SAAA,OAAO,CACxCC,SAAS,CAAE,CAAC,CAAEF,UAAU,CAAEA,UAAU,CAACG,KAAM,CAAC,CAChD,CAAC","ignoreList":[]}',version:"3.16.7"},ie={code:"function SwipeableMessageTsx5(){const{translateX,interpolate,swipeThreshold,Extrapolation}=this.__closure;const abs=Math.abs(translateX.value);const opacity=interpolate(abs,[0,swipeThreshold*0.4,swipeThreshold],[0,0.6,1],Extrapolation.CLAMP);const scale=interpolate(abs,[0,swipeThreshold],[0.6,1],Extrapolation.CLAMP);return{opacity:opacity,transform:[{scale:scale}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx",sourceMap:'{"version":3,"names":["SwipeableMessageTsx5","translateX","interpolate","swipeThreshold","Extrapolation","__closure","abs","Math","value","opacity","CLAMP","scale","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/Reply/SwipeableMessage.tsx"],"mappings":"AAoDuC,SAAAA,oBAAMA,CAAA,QAAAC,UAAA,CAAAC,WAAA,CAAAC,cAAA,CAAAC,aAAA,OAAAC,SAAA,CACrC,KAAM,CAAAC,GAAG,CAAGC,IAAI,CAACD,GAAG,CAACL,UAAU,CAACO,KAAK,CAAC,CACtC,KAAM,CAAAC,OAAO,CAAGP,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAG,GAAG,CAAEA,cAAc,CAAC,CAAE,CAAC,CAAC,CAAE,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAC7G,KAAM,CAAAC,KAAK,CAAGT,WAAW,CAACI,GAAG,CAAE,CAAC,CAAC,CAAEH,cAAc,CAAC,CAAE,CAAC,GAAG,CAAE,CAAC,CAAC,CAAEC,aAAa,CAACM,KAAK,CAAC,CAClF,MAAO,CACHD,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAED,KAAA,CAAAA,KAAM,CAAC,CACzB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},ae=function(t){var o,l,s=t.isCurrentUser,A=t.enabled,c=t.swipeThreshold,u=t.onReply,d=t.iconColor,C=void 0===d?"rgba(255,255,255,0.95)":d,h=t.iconBackground,f=void 0===h?"rgba(0,0,0,0.35)":h,v=t.children,m=a.useSharedValue(0),p=a.useSharedValue(0),g=s?-1:1,y=function(){u()},x=i.Gesture.Pan().enabled(A).activeOffsetX(s?[-12,9999]:[-9999,12]).failOffsetY([-12,12]).onUpdate((o=[new global.Error,-8,-27],l=function(e){var t=e.translationX;if(s&&t<0||!s&&t>0){var r=Math.abs(t),n=r<=c?r:c+.35*(r-c);m.value=g*n,r>=c&&0===p.value&&(p.value=1,a.runOnJS(y)())}else m.value=0},l.__closure={isCurrentUser:s,swipeThreshold:c,translateX:m,direction:g,triggered:p,runOnJS:a.runOnJS,triggerReply:y},l.__workletHash=0x92540fbdb51,l.__initData=te,l.__stackDetails=o,l)).onEnd(function(){var e=[new global.Error,-5,-27],t=function(){m.value=a.withSpring(0,{damping:20,stiffness:220}),p.value=a.withTiming(0,{duration:200})};return t.__closure={translateX:m,withSpring:a.withSpring,triggered:p,withTiming:a.withTiming},t.__workletHash=5306063376371,t.__initData=re,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-5,-27],t=function(){m.value=a.withSpring(0,{damping:20,stiffness:220}),p.value=a.withTiming(0,{duration:200})};return t.__closure={translateX:m,withSpring:a.withSpring,triggered:p,withTiming:a.withTiming},t.__workletHash=9186301204082,t.__initData=ne,t.__stackDetails=e,t}()),b=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateX:m.value}]}};return t.__closure={translateX:m},t.__workletHash=1792634838444,t.__initData=oe,t.__stackDetails=e,t}()),w=a.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=Math.abs(m.value);return{opacity:a.interpolate(e,[0,.4*c,c],[0,.6,1],a.Extrapolation.CLAMP),transform:[{scale:a.interpolate(e,[0,c],[.6,1],a.Extrapolation.CLAMP)}]}};return t.__closure={translateX:m,interpolate:a.interpolate,swipeThreshold:c,Extrapolation:a.Extrapolation},t.__workletHash=6245144246615,t.__initData=ie,t.__stackDetails=e,t}());return A?e.jsxs(r.View,{style:n(X||(X=_(["relative"]))),children:[e.jsx(a.View,{pointerEvents:"none",style:[n($||($=_(["absolute top-0 bottom-0 items-center justify-center"]))),s?{right:8}:{left:8},w],children:e.jsx(r.View,{style:[n(Z||(Z=_(["rounded-full items-center justify-center"]))),{width:36,height:36,backgroundColor:f}],children:e.jsx(ee,{style:{width:19.8,height:19.8},color:C})})}),e.jsx(i.GestureDetector,{gesture:x,children:e.jsx(a.View,{style:b,children:v})})]}):e.jsx(e.Fragment,{children:v})};function le(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var se,Ae={exports:{}},ce={exports:{}},ue={};var de,Ce,he,fe,ve,me,pe,ge,ye,xe,be,we,Se,ke,Ee,je={};
4
4
  /** @license React v16.13.1
5
5
  * react-is.development.js
6
6
  *
@@ -8,10 +8,10 @@ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.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 ve(){return te||(te=1,"production"===process.env.NODE_ENV?$.exports=function(){if(q)return Z;q=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,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=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 y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:switch(e=e.type){case s:case A:case n:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case l:case c:case f:case C:case a:return e;default:return d}}case r:return d}}}function g(e){return y(e)===A}return Z.AsyncMode=s,Z.ConcurrentMode=A,Z.ContextConsumer=l,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 g(e)||y(e)===s},Z.isConcurrentMode=g,Z.isContextConsumer=function(e){return y(e)===l},Z.isContextProvider=function(e){return y(e)===a},Z.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Z.isForwardRef=function(e){return y(e)===c},Z.isFragment=function(e){return y(e)===n},Z.isLazy=function(e){return y(e)===f},Z.isMemo=function(e){return y(e)===C},Z.isPortal=function(e){return y(e)===r},Z.isProfiler=function(e){return y(e)===i},Z.isStrictMode=function(e){return y(e)===o},Z.isSuspense=function(e){return y(e)===u},Z.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===C||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},Z.typeOf=y,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,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=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 y(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var h=e.type;switch(h){case s:case A:case n:case i:case o:case u:return h;default:var v=h&&h.$$typeof;switch(v){case l:case c:case f:case C:case a:return v;default:return d}}case r:return d}}}var g=s,x=A,S=l,b=a,w=t,E=c,k=n,j=f,I=C,O=r,_=i,P=o,M=u,R=!1;function T(e){return y(e)===A}he.AsyncMode=g,he.ConcurrentMode=x,he.ContextConsumer=S,he.ContextProvider=b,he.Element=w,he.ForwardRef=E,he.Fragment=k,he.Lazy=j,he.Memo=I,he.Portal=O,he.Profiler=_,he.StrictMode=P,he.Suspense=M,he.isAsyncMode=function(e){return R||(R=!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.")),T(e)||y(e)===s},he.isConcurrentMode=T,he.isContextConsumer=function(e){return y(e)===l},he.isContextProvider=function(e){return y(e)===a},he.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},he.isForwardRef=function(e){return y(e)===c},he.isFragment=function(e){return y(e)===n},he.isLazy=function(e){return y(e)===f},he.isMemo=function(e){return y(e)===C},he.isPortal=function(e){return y(e)===r},he.isProfiler=function(e){return y(e)===i},he.isStrictMode=function(e){return y(e)===o},he.isSuspense=function(e){return y(e)===u},he.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===f||e.$$typeof===C||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===p||e.$$typeof===m||e.$$typeof===h)},he.typeOf=y}()),he)),$.exports}
11
+ */function Me(){return Ce||(Ce=1,"production"===process.env.NODE_ENV?ce.exports=function(){if(se)return ue;se=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,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=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,h=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,p=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 s:case A:case n:case i:case o:case u:return e;default:switch(e=e&&e.$$typeof){case l:case c:case h:case C:case a:return e;default:return d}}case r:return d}}}function y(e){return g(e)===A}return ue.AsyncMode=s,ue.ConcurrentMode=A,ue.ContextConsumer=l,ue.ContextProvider=a,ue.Element=t,ue.ForwardRef=c,ue.Fragment=n,ue.Lazy=h,ue.Memo=C,ue.Portal=r,ue.Profiler=i,ue.StrictMode=o,ue.Suspense=u,ue.isAsyncMode=function(e){return y(e)||g(e)===s},ue.isConcurrentMode=y,ue.isContextConsumer=function(e){return g(e)===l},ue.isContextProvider=function(e){return g(e)===a},ue.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},ue.isForwardRef=function(e){return g(e)===c},ue.isFragment=function(e){return g(e)===n},ue.isLazy=function(e){return g(e)===h},ue.isMemo=function(e){return g(e)===C},ue.isPortal=function(e){return g(e)===r},ue.isProfiler=function(e){return g(e)===i},ue.isStrictMode=function(e){return g(e)===o},ue.isSuspense=function(e){return g(e)===u},ue.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===C||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===p||e.$$typeof===f)},ue.typeOf=g,ue}():ce.exports=(de||(de=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,l=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,A=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,h=e?Symbol.for("react.lazy"):60116,f=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,p=e?Symbol.for("react.scope"):60119;function g(e){if("object"==typeof e&&null!==e){var d=e.$$typeof;switch(d){case t:var f=e.type;switch(f){case s:case A:case n:case i:case o:case u:return f;default:var v=f&&f.$$typeof;switch(v){case l:case c:case h:case C:case a:return v;default:return d}}case r:return d}}}var y=s,x=A,b=l,w=a,S=t,k=c,E=n,j=h,M=C,I=r,_=i,P=o,T=u,R=!1;function O(e){return g(e)===A}je.AsyncMode=y,je.ConcurrentMode=x,je.ContextConsumer=b,je.ContextProvider=w,je.Element=S,je.ForwardRef=k,je.Fragment=E,je.Lazy=j,je.Memo=M,je.Portal=I,je.Profiler=_,je.StrictMode=P,je.Suspense=T,je.isAsyncMode=function(e){return R||(R=!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.")),O(e)||g(e)===s},je.isConcurrentMode=O,je.isContextConsumer=function(e){return g(e)===l},je.isContextProvider=function(e){return g(e)===a},je.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},je.isForwardRef=function(e){return g(e)===c},je.isFragment=function(e){return g(e)===n},je.isLazy=function(e){return g(e)===h},je.isMemo=function(e){return g(e)===C},je.isPortal=function(e){return g(e)===r},je.isProfiler=function(e){return g(e)===i},je.isStrictMode=function(e){return g(e)===o},je.isSuspense=function(e){return g(e)===u},je.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===A||e===i||e===o||e===u||e===d||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===C||e.$$typeof===a||e.$$typeof===l||e.$$typeof===c||e.$$typeof===v||e.$$typeof===m||e.$$typeof===p||e.$$typeof===f)},je.typeOf=g}()),je)),ce.exports}
12
12
  /*
13
13
  object-assign
14
14
  (c) Sindre Sorhus
15
15
  @license MIT
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,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),s=1;s<arguments.length;s++){for(var A in i=Object(arguments[s]))t.call(i,A)&&(l[A]=i[A]);if(e){a=e(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(l[a[c]]=i[a[c]])}}return l},re}function me(){if(ie)return oe;ie=1;return oe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function ye(){return le?ae:(le=1,ae=Function.call.bind(Object.prototype.hasOwnProperty))}function ge(){if(Ae)return se;Ae=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=me(),r={},n=ye();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,l,s){if("production"!==process.env.NODE_ENV)for(var A in o)if(n(o,A)){var c;try{if("function"!=typeof o[A]){var u=Error((l||"React class")+": "+a+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[A](i,A,l,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((l||"React class")+": type specification of "+a+" `"+A+"` 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=s?s():"";e("Failed "+a+" type: "+c.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},se=o}function xe(){if(ue)return ce;ue=1;var e=ve(),t=pe(),r=me(),n=ye(),o=ge(),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(l,s){var A="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 l=t[n];if(!Array.isArray(l))return new C("Invalid "+i+" `"+a+"` of type `"+m(l)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<l.length;s++){var A=e(l,s,o,i,a+"["+s+"]",r);if(A instanceof Error)return A}return null}))},element:f((function(e,t,r,n,o){var i=e[t];return l(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 `"+(((l=t[r]).constructor&&l.constructor.name?l.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+a+"`.")}var l;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,l){if("function"!=typeof e)return new C("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[o],A=m(s);if("object"!==A)return new C("Invalid "+a+" `"+l+"` of type `"+A+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(n(s,c)){var u=e(s,c,i,a,l+"."+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],l=0;l<e.length;l++)if(d(a,e[l]))return null;var s=JSON.stringify(e,(function(e,t){return"symbol"===y(t)?String(t):t}));return new C("Invalid "+o+" `"+i+"` of value `"+String(a)+"` supplied to `"+n+"`, expected one of "+s+".")}))},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 "+g(o)+" at index "+t+"."),a}return f((function(t,o,i,a,l){for(var s=[],A=0;A<e.length;A++){var c=(0,e[A])(t,o,i,a,l,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&s.push(c.data.expectedType)}return new C("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return f((function(t,n,o,i,a){var l=t[n],s=m(l);if("object"!==s)return new C("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var A in e){var c=e[A];if("function"!=typeof c)return v(o,i,a,A,y(c));var u=c(l,A,o,i,a+"."+A,r);if(u)return u}return null}))},exact:function(e){return f((function(o,i,a,l,s){var A=o[i],c=m(A);if("object"!==c)return new C("Invalid "+l+" `"+s+"` 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,l,s,d,y(f));if(!f)return new C("Invalid "+l+" `"+s+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var h=f(A,d,a,l,s+"."+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,l,A,u,d,f){if(A=A||c,d=d||l,f!==r){if(s){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=A+":"+l;!t[v]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+A+"`. 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[l]?o?null===a[l]?new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `null`."):new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `undefined`."):null:e(a,l,A,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 l=t[r];return m(l)!==e?new C("Invalid "+o+" `"+i+"` of type `"+y(l)+"` 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||l(e))return!0;var t=function(e){var t=e&&(A&&e[A]||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 y(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 g(e){var t=y(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 Se(){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 l=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 l.name="Invariant Violation",l}}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 X.exports;if(fe=1,"production"!==process.env.NODE_ENV){var e=ve();X.exports=xe()(e.isElement,true)}else X.exports=Se()();return X.exports}var we=J(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,l=[],s=t.children,A=0;for(r.pattern.lastIndex=0;s&&(o=r.pattern.exec(s));){var c=s.substr(0,o.index);if(A=o.index,++a>i)break;l.push({children:c}),l.push(e.getMatchedPart(r,o[0],o,A)),s=s.substr(o.index+o[0].length),A+=o[0].length-1,r.pattern.lastIndex=0}l.push({children:s}),n.push.apply(n,l)}})),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)),y(y({},o),{},{children:i,_matched:!0})}}])}(),ke=["type"],je=["style"],Ie=["parse","childrenProps"],Oe={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+/},_e=we.shape(y(y({},t.Text.propTypes),{},{type:we.oneOf(Object.keys(Oe)).isRequired,nonExhaustiveMaxMatchCount:we.number})),Pe=we.shape(y(y({},t.Text.propTypes),{},{pattern:we.oneOfType([we.string,we.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:we.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&&I(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=g(e,ke);if(t){if(!Oe[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Oe[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,l=g(n,je);return e.jsx(t.Text,y(y({style:[i,a]},r.props.childrenProps),l),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var r=this,n=y({},this.props);n.parse,n.childrenProps;var o=g(n,Ie);return e.jsx(t.Text,y(y({ref:function(e){return r._root=e}},o),{},{children:this.getParsedText()}))}}])}();Me.displayName="ParsedText",Me.propTypes=y(y({},t.Text.propTypes),{},{parse:we.arrayOf(we.oneOfType([_e,Pe])),childrenProps:we.shape(t.Text.propTypes)}),Me.defaultProps={parse:null,childrenProps:{}};var Re,Te,Ge,Ve,De,Ke,Fe,Le,Be,He,Ue,Ne=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:"M2 6c0-1.886 0-2.828.586-3.414S4.114 2 6 2s2.828 0 3.414.586S10 4.114 10 6v12c0 1.886 0 2.828-.586 3.414S7.886 22 6 22s-2.828 0-3.414-.586S2 19.886 2 18zm12 0c0-1.886 0-2.828.586-3.414S16.114 2 18 2s2.828 0 3.414.586S22 4.114 22 6v12c0 1.886 0 2.828-.586 3.414S19.886 22 18 22s-2.828 0-3.414-.586S14 19.886 14 18z"})})},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:"M21.409 9.353a2.998 2.998 0 0 1 0 5.294L8.597 21.614C6.534 22.737 4 21.277 4 18.968V5.033c0-2.31 2.534-3.769 4.597-2.648z"})})},Ye=n.createContext(void 0),ze=function(t){var r=t.children,o=O(n.useState(null),2),i=o[0],a=o[1];return e.jsx(Ye.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)},Je=[1,1.5,2],qe=42;function Xe(n){var o,i,a,l,s,A=n.isPlaying,c=n.playbackRate,u=n.onCycleSpeed,d=n.senderAvatar,C=n.senderName,f=n.isCurrentUser,h=n.theme;return A?e.jsx(t.Pressable,{onPress:u,style:[r(Re||(Re=_(["rounded-full items-center justify-center"]))),{width:qe,height:qe,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(Te||(Te=_(["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(Ge||(Ge=_(["rounded-full"]))),{width:qe,height:qe},null==h||null===(a=h.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.View,{style:[r(Ve||(Ve=_(["rounded-full items-center justify-center"]))),{width:qe,height:qe,backgroundColor:f?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(t.Text,{style:Q([r(De||(De=_(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==h?void 0:h.fontFamily),children:(l=C,s=null==l?void 0:l.trim(),s?s.charAt(0).toUpperCase():"?")})})}var $e,Ze,et,tt,rt,nt,ot,it,at=function(o){var a,l,s=o.audioUrl,A=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,g=v.CustomPauseIcon,x=v.showMessageStatus,S=function(){var e=n.useContext(Ye);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),b=S.currentlyPlayingId,w=S.setCurrentlyPlayingId,E=n.useRef(null),k=O(n.useState(!1),2),j=k[0],I=k[1],P=O(n.useState(0),2),M=P[0],R=P[1],T=O(n.useState(0),2),G=T[0],V=T[1],F=O(n.useState(!1),2),L=F[0],B=F[1],H=O(n.useState(1),2),U=H[0],N=H[1],W=O(n.useState(0),2),Y=W[0],z=W[1],J=n.useRef(null),q=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}))}(s,50)}),[s]),X=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),$=X.inactive,Z=X.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=j&&!(c||!!b&&b!==A),oe=G>0?M/G:0,ie=n.useCallback((function(e){var t;(V(e.duration),null!==J.current)&&(null===(t=E.current)||void 0===t||t.seek(J.current),J.current=null)}),[]),ae=n.useCallback((function(e){var t=e.currentTime;L||R(t)}),[L]),le=n.useCallback((function(){var e;I(!1),R(0),null===(e=E.current)||void 0===e||e.seek(0),w(null)}),[w]),se=n.useCallback((function(){ne?(I(!1),w(null)):(w(A),I(!0))}),[ne,A,w]),Ae=n.useCallback((function(){N((function(e){var t=Je.indexOf(e),r=Je[(t+1)%Je.length];return null!=r?r:1}))}),[]),ce=n.useCallback((function(e){var t=Y;if(!(t<=0||G<=0)){var r,n=Math.max(0,Math.min(e/t,1))*G;if(R(n),G>0)null===(r=E.current)||void 0===r||r.seek(n);else J.current=n}}),[G,Y]),ue=n.useMemo((function(){return t.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){B(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return B(!1)},onPanResponderTerminate:function(){return B(!1)}})}),[ce]),de=e.jsx(t.Pressable,{onPress:se,hitSlop:8,style:r(Ke||(Ke=_(["shrink-0 px-0.5"]))),children:ne?g?e.jsx(g,{}):e.jsx(Ne,{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(Xe,{isPlaying:ne,playbackRate:U,onCycleSpeed:Ae,senderAvatar:d,senderName:C,isCurrentUser:u,theme:p}),fe=e.jsx(t.View,{style:[r(Fe||(Fe=_(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return z(e.nativeEvent.layout.width)},children:e.jsx(t.View,y(y({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==p||null===(a=p.messageStyle)||void 0===a?void 0:a.progressBarStyle]},ue.panHandlers),{},{children:q.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(Le||(Le=_(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),h&&x&&r(Be||(Be=_(["pb-4"])))],children:[e.jsx(i,{ref:E,source:{uri:s},paused:!ne,rate:U,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:ae,onEnd:le,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(t.View,{style:r(He||(He=_(["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=_(["text-[11px] mt-1"]))),{color:ee,paddingLeft:u?82:34},null==p||null===(l=p.messageStyle)||void 0===l?void 0:l.audioDurationStyle],null==p?void 0:p.fontFamily),children:Qe(ne?M:G>0?G:M)})]})},lt=n.memo(at),st=function(r){var i=r.style,a=r.spinning,l=void 0!==a&&a,s=n.useRef(new t.Animated.Value(0)).current;n.useEffect((function(){l&&t.Animated.loop(t.Animated.timing(s,{toValue:1,duration:1e3,easing:t.Easing.linear,useNativeDriver:!0})).start()}),[l]);var A=s.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(t.Animated.View,{style:l?{transform:[{rotate:A}]}: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,ct=At,ut=Math.round(176),dt=At-ut-2,Ct=Math.round(159),ft=function(o){var a,l=o.uri,s=o.cellStyle,A=o.roundedStyle,c=D(),u=c.theme,d=c.CustomPlayIcon,C=n.useRef(null),f=O(n.useState(0),2),h=f[0],v=f[1],p=O(n.useState(!0),2),m=p[0],y=p[1],g=O(n.useState(!1),2),x=g[0],S=g[1];return e.jsxs(t.View,{style:[s,A],pointerEvents:"none",children:[e.jsx(i,{source:{uri:l},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[A,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){y(!0),S(!1)},onLoad:function(e){v(e.duration),y(!1)},onError:function(){S(!0),y(!1)}}),m&&e.jsx(t.View,{style:[r($e||($e=_(["absolute inset-0 items-center justify-center bg-black/40"]))),A],children:e.jsx(st,{style:r.style("h-8 w-8"),spinning:!0})}),!m&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Ze||(Ze=_(["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=_(["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=_(["text-white text-[10px] font-semibold"]))),children:ht(h)})})]}),x&&e.jsx(t.View,{style:[r(rt||(rt=_(["absolute inset-0 items-center justify-center bg-red-500/50"]))),A],children:e.jsx(t.Text,{style:Q(r(nt||(nt=_(["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,yt,gt,xt,St,bt,wt,Et,kt,jt,It,Ot,_t,Pt,Mt,Rt,Tt,Gt,Vt,Dt,Kt,Ft,Lt=function(n){var o=n.items,i=n.onOpenGallery,a=t.useWindowDimensions().width,l=Math.min(240,.72*a);if(0===o.length)return null;var s={borderRadius:6,overflow:"hidden"};if(1===o.length){var A=o[0];return e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:l,height:320,marginVertical:8},children:"image"===A.kind?e.jsx(t.Image,{source:{uri:A.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(ft,{uri:A.uri,cellStyle:{width:l,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(l-2)/2;return e.jsx(t.View,{style:{width:l,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:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:r.uri,cellStyle:{width:c,height:ct},roundedStyle:s})},"".concat(r.uri,"-").concat(n))}))})}if(3===o.length){var u=o[0],d=o[1],C=o[2],f=(l-2)/2;return e.jsxs(t.View,{style:{width:l,height:At,marginVertical:8,gap:2},children:[e.jsx(t.Pressable,{onPress:function(){return i(o,0)},style:{width:l,height:ut},children:"image"===u.kind?e.jsx(t.Image,{source:{uri:u.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:u.uri,cellStyle:{width:l,height:ut},roundedStyle:s})}),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:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:d.uri,cellStyle:{width:f,height:dt},roundedStyle:s})},"".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:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:C.uri,cellStyle:{width:f,height:dt},roundedStyle:s})},"".concat(C.uri,"-2"))]})]})}var h=(l-2)/2,v=o.length-4,p=o.slice(0,4);return e.jsx(t.View,{style:{width:l,height:At,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:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(ft,{uri:n.uri,cellStyle:{width:h,height:Ct},roundedStyle:s}),3===a&&v>0&&e.jsx(t.View,{style:r(ot||(ot=_(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(t.Text,{style:r(it||(it=_(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(n.uri,"-").concat(a))}))})},Bt=function(o){var i,a,l,s,A=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 Y(A)}),[A]);return e.jsxs(t.View,{children:[p.length>0&&e.jsx(Lt,{items:p,onOpenGallery:c}),(null!==(i=A.fileAttachments)&&void 0!==i?i:[]).map((function(n,o){var i,a,l,s,A,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=_(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:L(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=_(["text-xs font-semibold"]))),{color:B(f,d)},d?null==f||null===(l=f.messageStyle)||void 0===l?void 0:l.sentFileAttachmentTextStyle:null==f||null===(s=f.messageStyle)||void 0===s?void 0:s.receivedFileAttachmentTextStyle],null==f?void 0:f.fontFamily),numberOfLines:2,children:["📎 ",n.name]}),e.jsx(t.Text,{style:Q([r(mt||(mt=_(["text-[10px] mt-0.5"]))),{color:H(f,d)},d?null==f||null===(A=f.messageStyle)||void 0===A?void 0:A.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))})),A.audio&&e.jsx(lt,{audioUrl:A.audio,audioId:A.id,isVideoPlaying:u,isCurrentUser:d,senderAvatar:A.senderAvatar,senderName:A.senderName,reserveStatusSpace:!A.text}),A.text&&e.jsx(Me,{style:Q([r(yt||(yt=_(["pt-1"]))),r(h?gt||(gt=_(["pb-0"])):xt||(xt=_(["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===(l=f.messageStyle)||void 0===l?void 0:l.receivedTextStyle,N(f,d)?{color:N(f,d)}:void 0],null==f?void 0:f.fontFamily),parse:[{type:"url",style:y({color:"blue",textDecorationLine:"underline"},(s=null==f?void 0:f.fontFamily,s?{fontFamily:s}:void 0)),onPress:function(e){return t.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:A.text})]})},Ht=n.memo(Bt),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"})})},Nt=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,l=n.time,s=n.status,A=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,A):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,A);return e.jsx(e.Fragment,{children:v&&e.jsxs(t.View,{style:[r(St||(St=_(["flex-row items-center"]))),c?r(bt||(bt=_(["justify-end pb-1 ml-4"]))):u?r(wt||(wt=_(["absolute right-3 bottom-2"]))):p?[r(Et||(Et=_(["absolute right-3 bottom-4"]))),F(h,A)]:[r(kt||(kt=_(["absolute right-3 bottom-4"]))),F(h,A)]],children:[e.jsx(t.Text,{style:Q([r(jt||(jt=_(["text-xs"]))),{color:m}],null==h?void 0:h.fontFamily),children:l}),A&&e.jsxs(t.View,{style:r(It||(It=_(["ml-1 flex-row items-center"]))),children:["sent"===s&&e.jsx(Nt,{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"===s&&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"===s&&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"})]})]})})},Yt=n.memo(Wt),zt=function(n){var o,i,a,l,s,A,c,u,d,C,f=n.message,h=n.isCurrentUser,v=n.isFirstInSequence,p=n.onLongPress,m=D(),g=m.theme,x=m.showAvatars,S=m.showUserNames,b=m.showBubbleTail,w=m.setMediaViewerGallery,E=m.isVideoPlaying,k=Y(f),j=(null!==(o=null===(i=f.fileAttachments)||void 0===i?void 0:i.length)&&void 0!==o?o:0)>0&&0===k.length&&!f.text&&!f.audio;return e.jsxs(t.Pressable,{onLongPress:p,style:[r(Ot||(Ot=_(["px-2 my-1 max-w-[75%] relative"]))),r(h?_t||(_t=_(["self-end mr-3"])):Pt||(Pt=_(["self-start ml-9"]))),r(v?h?Mt||(Mt=_(["bg-green-500 rounded-tr-none"])):Rt||(Rt=_(["bg-white rounded-tl-none"])):h?Tt||(Tt=_(["bg-green-500"])):Gt||(Gt=_(["bg-white"]))),y(y({borderRadius:8},W(g,h)?{backgroundColor:W(g,h)}:{}),h?null==g||null===(a=g.bubbleStyle)||void 0===a?void 0:a.sent:null==g||null===(l=g.bubbleStyle)||void 0===l?void 0:l.received)],children:[!h&&v&&x&&e.jsxs(e.Fragment,{children:[e.jsx(t.View,{style:r(Vt||(Vt=_(["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=_(["w-full h-full rounded-full"]))),null==g||null===(s=g.bubbleStyle)||void 0===s?void 0:s.avatarImageStyle],resizeMode:"cover"}):e.jsx(t.Text,{style:Q([r(Kt||(Kt=_(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==g||null===(A=g.bubbleStyle)||void 0===A?void 0:A.avatarTextStyle],null==g?void 0:g.fontFamily),children:null===(c=f.senderName)||void 0===c?void 0:c.charAt(0)})}),S&&f.senderName&&e.jsx(t.Text,{style:Q([r(Ft||(Ft=_(["text-sm text-black font-semibold mt-1 capitalize"]))),null==g||null===(u=g.bubbleStyle)||void 0===u?void 0:u.userNameStyle],null==g?void 0:g.fontFamily),children:f.senderName})]}),v&&b&&e.jsx(R,{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==g||null===(d=g.colors)||void 0===d?void 0:d.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==g||null===(C=g.colors)||void 0===C?void 0:C.receivedMessageTailColor)||"white"}),e.jsx(Ht,{message:f,isCurrentUser:h,isFirstInSequence:v,onGalleryOpen:function(e,t){w(e,t)},isVideoPlaying:E}),e.jsx(Yt,{time:f.time,status:h?f.status:void 0,isCurrentUser:h,hasText:!!f.text,hasAudio:!!f.audio,hasGalleryMedia:k.length>0&&!f.text,hasFileAttachments:j})]})},Qt=n.memo(zt),Jt=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"})]})})},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",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"})]})})},Xt=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"})]})})};function er(){return tr.apply(this,arguments)}function tr(){return(tr=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 rr,nr,or,ir,ar,lr,sr,Ar,cr,ur,dr,Cr,fr,hr,vr,pr,mr,yr,gr,xr,Sr="ios"===t.Platform.OS?50:48,br="#FFFFFF",wr="#E9EDEF",Er=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"})})},kr=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",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M2 16c0-2.828 0-4.243.879-5.121C3.757 10 5.172 10 8 10h8c2.828 0 4.243 0 5.121.879C22 11.757 22 13.172 22 16s0 4.243-.879 5.121C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.879C2 20.243 2 18.828 2 16Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M6 10V8a6 6 0 1 1 12 0v2",opacity:".5"})]})})},jr=function(t){var n=t.width,o=t.bottomOffset,i=t.background,a=t.lockColor,s=t.chevronColor,A=t.lockIconSize,c=t.pillAnimatedStyle,u=t.chevronAnimatedStyle,d=t.styleOverride,C=t.renderLockIcon;return e.jsxs(l.View,{style:[r(rr||(rr=_(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:n,backgroundColor:i,bottom:o,gap:6},d,c],pointerEvents:"none",children:[C?C():e.jsx(kr,{style:{width:A,height:A},color:a}),e.jsx(l.View,{style:u,children:e.jsx(Er,{style:{width:14,height:14},color:s})})]})},Ir=function(n){var o=n.isHold,i=n.duration,s=n.composedGesture,A=n.micWrapperStyle,c=n.slideTextAnimatedStyle,u=n.lockPillAnimatedStyle,d=n.chevronAnimatedStyle,C=n.primaryColor,f=n.microphoneColor,h=n.timerColor,v=n.cancelTextColor,p=n.holdPillBackground,m=n.lockPillBackground,y=n.lockColor,g=n.chevronColor,x=n.iconSize,S=n.lockIconSize,b=n.inputBarHeight,w=n.micSize,E=n.enableLockRecording,k=n.renderInputPill,j=n.renderMicIcon,I=n.renderArrowIcon,O=n.renderLockIcon,P=n.containerStyleOverride,M=n.timerTextStyle,R=n.slideTextStyleOverride,T=n.lockPillStyleOverride,G=n.sendButtonStyle,V={minHeight:b,backgroundColor:p},D={height:w,width:w,backgroundColor:C};return e.jsxs(t.View,{style:[r(nr||(nr=_(["flex-row items-end gap-2 relative"]))),P],pointerEvents:"box-none",children:[o?e.jsxs(t.View,{style:[r(or||(or=_(["flex-1 flex-row items-center px-4 rounded-3xl"]))),V],children:[e.jsx(t.Text,{style:[r(ir||(ir=_(["text-base font-semibold"]))),{color:h,minWidth:42},M],numberOfLines:1,children:Qe(i)}),e.jsxs(l.View,{style:[r(ar||(ar=_(["flex-1 flex-row items-center justify-center gap-1.5"]))),c],children:[I?I():e.jsx(t.Text,{style:[r(lr||(lr=_(["text-base leading-none"]))),{color:v,marginTop:-2}],children:"‹"}),e.jsx(t.Text,{style:[r(sr||(sr=_(["text-sm"]))),{color:v},R],children:"Slide to cancel"})]})]}):null==k?void 0:k(),e.jsxs(t.View,{style:[r(Ar||(Ar=_(["relative items-center justify-center"]))),{height:b,width:b}],children:[E&&o&&e.jsx(jr,{width:w-8,bottomOffset:w+6,background:m,lockColor:y,chevronColor:g,lockIconSize:S,pillAnimatedStyle:u,chevronAnimatedStyle:d,styleOverride:T,renderLockIcon:O}),e.jsx(a.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(cr||(cr=_(["items-center justify-center rounded-full"]))),D,G,A],accessibilityRole:"button",accessibilityLabel:"Tap to record. Long-press and slide left to cancel or up to lock.",children:j?j():e.jsx(Xt,{style:{width:x+6,height:x+6},color:f})})})]})]})},Or=function(t){var r=t.style,n=t.color,i=void 0===n?"#ef4444":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M9.17 4a3.001 3.001 0 0 1 5.66 0",opacity:".5"}),e.jsx(o.Path,{d:"M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9"}),e.jsx(o.Path,{d:"m9.5 11l.5 5m4.5-5l-.5 5",opacity:".5"})]})})},_r=function(n){var o=n.color,i=n.tick,a=n.count;return e.jsx(t.View,{style:r(ur||(ur=_(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,r){return e.jsx(Mr,{index:r,total:a,color:o,tick:i},r)}))})},Pr={code:'function WaveformTsx1(){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.18,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/Waveform.tsx",sourceMap:'{"version":3,"names":["WaveformTsx1","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/Waveform.tsx"],"mappings":"AAQ2C,SAAAA,YAAMA,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"},Mr=function(t){var n,o,i=t.index,a=t.total,s=t.color,A=t.tick,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=A.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,r=Math.sin(i/Math.max(1,a-1)*Math.PI),n=Math.max(.18,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:A,index:i,total:a},o.__workletHash=4276075972187,o.__initData=Pr,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(dr||(dr=_(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},Rr=function(n){var o=n.duration,i=n.isPaused,s=n.composedGesture,A=n.micWrapperStyle,c=n.pausePulseStyle,u=n.recDotStyle,d=n.waveTick,C=n.onCancelPress,f=n.onTogglePause,h=n.backgroundColor,v=n.timerColor,p=n.waveformColor,m=n.deleteIconColor,y=n.pauseIconColor,g=n.primaryColor,x=n.micSize,S=n.iconSize,b=n.inputBarHeight,w=n.waveCount,E=n.enableWaveform,k=n.renderDeleteIcon,j=n.renderPauseIcon,I=n.renderPlayIcon,O=n.renderSendIcon,P=n.renderWaveform,M=n.containerStyleOverride,R=n.barStyleOverride,T=n.timerTextStyle,G=n.waveformStyle,V=n.trashButtonStyle,D=n.sendButtonStyle,K={minHeight:b+50,backgroundColor:h},F={height:x,width:x,backgroundColor:g};return e.jsxs(t.View,{style:[r(Cr||(Cr=_(["w-full rounded-2xl px-4 py-2.5"]))),K,M,R],children:[e.jsxs(t.View,{style:r(fr||(fr=_(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(hr||(hr=_(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:y},u]}),e.jsx(t.Text,{style:[r(vr||(vr=_(["text-base font-semibold"]))),{color:v,minWidth:42},T],numberOfLines:1,children:Qe(o)}),E&&e.jsx(t.View,{style:[r(pr||(pr=_(["flex-1"]))),G],children:P?P():e.jsx(_r,{color:p,tick:d,count:w})})]}),e.jsxs(t.View,{style:r(mr||(mr=_(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(t.Pressable,{onPress:C,hitSlop:12,style:[r(yr||(yr=_(["items-center justify-center rounded-full"]))),{width:x,height:x},V],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(Or,{style:r.style("w-6 h-6"),color:m})}),e.jsx(t.Pressable,{onPress:f,hitSlop:12,style:r(gr||(gr=_(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:i?"Resume recording":"Pause recording",children:i?I?I():e.jsx(We,{style:r.style("w-7 h-7"),color:y}):e.jsx(l.View,{style:c,children:j?j():e.jsx(Ne,{style:r.style("w-7 h-7"),color:y})})}),e.jsx(a.GestureDetector,{gesture:s,children:e.jsx(l.View,{style:[r(xr||(xr=_(["items-center justify-center rounded-full"]))),F,D,A],accessibilityRole:"button",accessibilityLabel:"Send recording",children:O?O():e.jsx(Zt,{style:{width:S,height:S},color:"#FFFFFF"})})})]})]})};function Tr(){t.Vibration.vibrate(15)}var Gr={code:"function useFlowControllerTs1(_e,success){const{runOnJS,fireQuickTap}=this.__closure;if(success)runOnJS(fireQuickTap)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs1","_e","success","runOnJS","fireQuickTap","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA0OmB,QAAC,CAAAA,oBAAgBA,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"},Vr={code:"function useFlowControllerTs2(){const{runOnJS,fireHoldStart}=this.__closure;runOnJS(fireHoldStart)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs2","runOnJS","fireHoldStart","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAiPqB,SAAAA,oBAAMA,CAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEfF,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B","ignoreList":[]}',version:"3.16.7"},Dr={code:"function useFlowControllerTs3(e){const{stateShared,STATE_HOLD,maxLeftShared,maxUpShared,translateX,translateY,enableLockShared,lockFiredShared,lockThresholdShared,runOnJS,fireLock,enableCancelShared,cancelFiredShared,cancelThresholdShared,fireCancel}=this.__closure;if(stateShared.value!==STATE_HOLD)return;const rawTx=Math.max(maxLeftShared.value,Math.min(0,e.translationX));const rawTy=Math.max(maxUpShared.value,Math.min(0,e.translationY));const dominantY=Math.abs(rawTy)>Math.abs(rawTx);translateX.value=dominantY?0:rawTx;translateY.value=dominantY?rawTy:0;if(dominantY&&enableLockShared.value===1&&lockFiredShared.value===0&&rawTy<=lockThresholdShared.value){lockFiredShared.value=1;runOnJS(fireLock)();}if(!dominantY&&enableCancelShared.value===1&&cancelFiredShared.value===0&&rawTx<=cancelThresholdShared.value){cancelFiredShared.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs3","e","stateShared","STATE_HOLD","maxLeftShared","maxUpShared","translateX","translateY","enableLockShared","lockFiredShared","lockThresholdShared","runOnJS","fireLock","enableCancelShared","cancelFiredShared","cancelThresholdShared","fireCancel","__closure","value","rawTx","Math","max","min","translationX","rawTy","translationY","dominantY","abs"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqPuB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,aAAA,CAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,gBAAA,CAAAC,eAAA,CAAAC,mBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,kBAAA,CAAAC,iBAAA,CAAAC,qBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,GAAIf,WAAW,CAACgB,KAAK,GAAKf,UAAU,CAChC,OACJ,KAAM,CAAAgB,KAAK,CAAGC,IAAI,CAACC,GAAG,CAACjB,aAAa,CAACc,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACsB,YAAY,CAAC,CAAC,CACxE,KAAM,CAAAC,KAAK,CAAGJ,IAAI,CAACC,GAAG,CAAChB,WAAW,CAACa,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACwB,YAAY,CAAC,CAAC,CACtE,KAAM,CAAAC,SAAS,CAAGN,IAAI,CAACO,GAAG,CAACH,KAAK,CAAC,CAAGJ,IAAI,CAACO,GAAG,CAACR,KAAK,CAAC,CAGnDb,UAAU,CAACY,KAAK,CAAGQ,SAAS,CAAG,CAAC,CAAGP,KAAK,CACxCZ,UAAU,CAACW,KAAK,CAAGQ,SAAS,CAAGF,KAAK,CAAG,CAAC,CACxC,GAAIE,SAAS,EACTlB,gBAAgB,CAACU,KAAK,GAAK,CAAC,EAC5BT,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BM,KAAK,EAAId,mBAAmB,CAACQ,KAAK,CAAE,CACpCT,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBP,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAI,CAACc,SAAS,EACVb,kBAAkB,CAACK,KAAK,GAAK,CAAC,EAC9BJ,iBAAiB,CAACI,KAAK,GAAK,CAAC,EAC7BC,KAAK,EAAIJ,qBAAqB,CAACG,KAAK,CAAE,CACtCJ,iBAAiB,CAACI,KAAK,CAAG,CAAC,CAC3BP,OAAO,CAACK,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},Kr={code:"function useFlowControllerTs4(){const{lockFiredShared,cancelFiredShared,enableLockShared,translateY,LOCK_ON_RELEASE_DELTA,runOnJS,fireLock,fireHoldEnd}=this.__closure;if(lockFiredShared.value===1||cancelFiredShared.value===1)return;if(enableLockShared.value===1&&translateY.value<-LOCK_ON_RELEASE_DELTA){lockFiredShared.value=1;runOnJS(fireLock)();return;}runOnJS(fireHoldEnd)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs4","lockFiredShared","cancelFiredShared","enableLockShared","translateY","LOCK_ON_RELEASE_DELTA","runOnJS","fireLock","fireHoldEnd","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+QmB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,gBAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,OAAAC,SAAA,CAEb,GAAIR,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BR,iBAAiB,CAACQ,KAAK,GAAK,CAAC,CAC7B,OACJ,GAAIP,gBAAgB,CAACO,KAAK,GAAK,CAAC,EAC5BN,UAAU,CAACM,KAAK,CAAG,CAACL,qBAAqB,CAAE,CAC3CJ,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBJ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACnB,OACJ,CACAD,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC,CAC1B","ignoreList":[]}',version:"3.16.7"},Fr={code:"function useFlowControllerTs5(){const{lockFiredShared,cancelFiredShared,translateX,withSpring,translateY}=this.__closure;if(lockFiredShared.value===0&&cancelFiredShared.value===0){translateX.value=withSpring(0,{damping:18,stiffness:220});translateY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs5","lockFiredShared","cancelFiredShared","translateX","withSpring","translateY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA4RwB,SAAAA,oBAAMA,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"},Lr={code:"function useFlowControllerTs6(){const{stateShared,STATE_HOLD,translateX,translateY,micScale}=this.__closure;const isHold=stateShared.value===STATE_HOLD;return{transform:[{translateX:isHold?translateX.value:0},{translateY:isHold?translateY.value:0},{scale:micScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs6","stateShared","STATE_HOLD","translateX","translateY","micScale","__closure","isHold","value","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAsS6C,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,QAAA,OAAAC,SAAA,CAC3C,KAAM,CAAAC,MAAM,CAAGN,WAAW,CAACO,KAAK,GAAKN,UAAU,CAC/C,MAAO,CACHO,SAAS,CAAE,CACP,CAAEN,UAAU,CAAEI,MAAM,CAAGJ,UAAU,CAACK,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEJ,UAAU,CAAEG,MAAM,CAAGH,UAAU,CAACI,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEE,KAAK,CAAEL,QAAQ,CAACG,KAAM,CAAC,CAEjC,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Br={code:"function useFlowControllerTs7(){const{interpolate,translateX,cancelThresholdShared,Extrapolation,arrowPulse}=this.__closure;const opacity=interpolate(translateX.value,[0,cancelThresholdShared.value],[1,0],Extrapolation.CLAMP);return{opacity:opacity,transform:[{translateX:translateX.value*0.4+arrowPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs7","interpolate","translateX","cancelThresholdShared","Extrapolation","arrowPulse","__closure","opacity","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAgToD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,aAAA,CAAAC,UAAA,OAAAC,SAAA,CAClD,KAAM,CAAAC,OAAO,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,qBAAqB,CAACK,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEJ,aAAa,CAACK,KAAK,CAAC,CAC5G,MAAO,CACHF,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAER,UAAU,CAAEA,UAAU,CAACM,KAAK,CAAG,GAAG,CAAGH,UAAU,CAACG,KAAM,CAAC,CACzE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Hr={code:"function useFlowControllerTs8(){const{interpolate,translateY,lockThresholdShared,Extrapolation}=this.__closure;const lockProgress=interpolate(translateY.value,[0,lockThresholdShared.value],[0,1],Extrapolation.CLAMP);return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs8","interpolate","translateY","lockThresholdShared","Extrapolation","__closure","lockProgress","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAuTmD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,mBAAA,CAAAC,aAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,YAAY,CAAGL,WAAW,CAACC,UAAU,CAACK,KAAK,CAAE,CAAC,CAAC,CAAEJ,mBAAmB,CAACI,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEH,aAAa,CAACI,KAAK,CAAC,CAC/G,MAAO,CACHC,SAAS,CAAE,CACP,CAAEP,UAAU,CAAED,WAAW,CAACK,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAEnE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Ur={code:"function useFlowControllerTs9(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs9","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+TkD,SAAAA,qBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACjDC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},Nr={code:"function useFlowControllerTs10(){const{isPaused,pausePulse}=this.__closure;return{opacity:isPaused?1:pausePulse.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs10","isPaused","pausePulse","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAkU6C,SAAAA,sBAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC5CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,UAAU,CAACG,KACvC,CAAC","ignoreList":[]}',version:"3.16.7"},Wr={code:"function useFlowControllerTs11(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs11","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqUyC,SAAAA,sBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"};var Yr=function(t){var r=t.primaryColor,o=void 0===r?"#16A34A":r,i=t.backgroundColor,s=void 0===i?"#0B141A":i,A=t.holdPillBackground,c=void 0===A?"#1F2C33":A,u=t.timerColor,d=void 0===u?br:u,C=t.microphoneColor,f=void 0===C?br:C,h=t.lockColor,v=void 0===h?wr:h,p=t.waveformColor,m=void 0===p?wr:p,y=t.deleteIconColor,g=void 0===y?"#8696A0":y,x=t.cancelTextColor,S=void 0===x?"rgba(255,255,255,0.6)":x,b=t.chevronColor,w=t.pauseIconColor,E=void 0===w?"#F15C6D":w,k=t.lockPillBackground,j=void 0===k?"#1F2C33":k,I=t.inputBarHeight,_=void 0===I?Sr:I,P=t.micSize,M=t.holdMicScale,R=void 0===M?1.18:M,T=t.iconSize,G=void 0===T?22:T,V=t.lockIconSize,D=void 0===V?18:V,K=t.enableLockRecording,F=void 0===K||K,L=t.enableSlideToCancel,B=void 0===L||L,H=t.enableWaveform,U=void 0===H||H,N=t.lockSlideDistance,W=void 0===N?70:N,Y=t.cancelSlideDistance,z=void 0===Y?90:Y,Q=t.waveCount,J=void 0===Q?32:Q,q=t.renderInputPill,X=t.renderMicIcon,$=t.renderSendIcon,Z=t.renderLockIcon,ee=t.renderArrowIcon,te=t.renderDeleteIcon,re=t.renderPauseIcon,ne=t.renderPlayIcon,oe=t.renderWaveform,ie=t.containerStyle,ae=t.barStyle,le=t.timerTextStyle,se=t.slideTextStyle,Ae=t.waveformStyle,ce=t.lockPillStyle,ue=t.trashButtonStyle,de=t.sendButtonStyle,Ce=null!=P?P:_,fe=null!=b?b:v,he=function(e){var t=e.cancelSlideDistance,r=e.lockSlideDistance,o=e.enableLockRecording,i=e.enableSlideToCancel,s=e.holdMicScale,A=e.onRecordingStart,c=e.onRecordingStop,u=e.onSend,d=e.onDelete,C=e.onLock,f=e.onCancel,h=e.onPauseRecording,v=e.onResumeRecording,p=e.onStateChange,m=-Math.abs(t),y=-Math.abs(r),g=m-30,x=y-20,S=O(n.useState("IDLE"),2),b=S[0],w=S[1],E=O(n.useState(0),2),k=E[0],j=E[1],I=O(n.useState(!1),2),_=I[0],P=I[1],M=n.useRef("IDLE"),R=n.useRef(!1);n.useEffect((function(){M.current=b}),[b]),n.useEffect((function(){R.current=_}),[_]);var T=n.useRef(p);T.current=p,n.useEffect((function(){var e;null===(e=T.current)||void 0===e||e.call(T,b)}),[b]);var G=l.useSharedValue(0);n.useEffect((function(){G.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}}(b)}),[b]);var V=l.useSharedValue(m),D=l.useSharedValue(y),K=l.useSharedValue(g),F=l.useSharedValue(x),L=l.useSharedValue(o?1:0),B=l.useSharedValue(i?1:0);n.useEffect((function(){V.value=m,D.value=y,K.value=g,F.value=x,L.value=o?1:0,B.value=i?1:0}),[m,y,g,x,o,i]);var H=n.useRef(0),U=n.useRef(0),N=n.useRef(0),W=l.useSharedValue(0),Y=l.useSharedValue(0),z=l.useSharedValue(1),Q=l.useSharedValue(0),J=l.useSharedValue(0),q=l.useSharedValue(1),X=l.useSharedValue(0),$=l.useSharedValue(1),Z=l.useSharedValue(0),ee=l.useSharedValue(0);n.useEffect((function(){Q.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),J.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),q.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),X.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1),$.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]),n.useEffect((function(){z.value="RECORDING_HOLD"===b?l.withSpring(s,{damping:14,stiffness:220}):l.withSpring(1,{damping:16,stiffness:220})}),[b,s]),n.useEffect((function(){if(("RECORDING_TAP"===b||"RECORDING_HOLD"===b||"LOCKED_RECORDING"===b)&&!_){var e=setInterval((function(){var e=Date.now()-H.current-U.current;j(e/1e3)}),250);return function(){return clearInterval(e)}}}),[b,_]);var te=n.useRef(A);te.current=A;var re=n.useRef(c);re.current=c;var ne=n.useRef(u);ne.current=u;var oe=n.useRef(d);oe.current=d;var ie=n.useRef(C);ie.current=C;var ae=n.useRef(f);ae.current=f;var le=n.useRef(h);le.current=h;var se=n.useRef(v);se.current=v;var Ae=n.useCallback((function(){var e;H.current=Date.now(),U.current=0,N.current=0,P(!1),j(0),Z.value=0,ee.value=0,W.value=0,Y.value=0,null===(e=te.current)||void 0===e||e.call(te)}),[]),ce=n.useCallback((function(){j(0),P(!1),U.current=0,N.current=0,W.value=0,Y.value=0,w("IDLE")}),[]),ue=n.useCallback((function(){var e,t,r=(Date.now()-H.current-U.current)/1e3;w("SENDING"),null===(e=re.current)||void 0===e||e.call(re),null===(t=ne.current)||void 0===t||t.call(ne,{duration:r}),ce()}),[ce]),de=n.useCallback((function(){var e=M.current;if("IDLE"===e)return w("RECORDING_TAP"),void Ae();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||ue()}),[Ae,ue]),Ce=n.useCallback((function(){"IDLE"===M.current&&(w("RECORDING_HOLD"),Ae())}),[Ae]),fe=n.useCallback((function(){var e;"RECORDING_HOLD"===M.current&&(Tr(),w("LOCKED_RECORDING"),W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}),null===(e=ie.current)||void 0===e||e.call(ie))}),[]),he=n.useCallback((function(){var e,t,r,n=M.current;"RECORDING_HOLD"!==n&&"RECORDING_TAP"!==n&&"LOCKED_RECORDING"!==n||(Tr(),w("CANCELLED"),null===(e=re.current)||void 0===e||e.call(re),null===(t=ae.current)||void 0===t||t.call(ae),null===(r=oe.current)||void 0===r||r.call(oe),ce())}),[ce]),ve=n.useCallback((function(){"RECORDING_HOLD"===M.current&&ue()}),[ue]),pe=n.useCallback((function(){var e,t,r=!R.current;r?(N.current=Date.now(),null===(e=le.current)||void 0===e||e.call(le)):(U.current+=Date.now()-N.current,N.current=0,null===(t=se.current)||void 0===t||t.call(se)),P(r)}),[]),me=n.useRef(de);me.current=de;var ye=n.useRef(Ce);ye.current=Ce;var ge=n.useRef(ve);ge.current=ve;var xe=n.useRef(fe);xe.current=fe;var Se=n.useRef(he);Se.current=he;var be,we,Ee=function(){return me.current()},ke=function(){return ye.current()},je=function(){return ge.current()},Ie=function(){return xe.current()},Oe=function(){return Se.current()},_e=n.useMemo((function(){var e,t,r=a.Gesture.Tap().maxDuration(210).onEnd((e=[new global.Error,-3,-27],(t=function(e,t){t&&l.runOnJS(Ee)()}).__closure={runOnJS:l.runOnJS,fireQuickTap:Ee},t.__workletHash=0xb640de2a90a,t.__initData=Gr,t.__stackDetails=e,t)),n=a.Gesture.Pan().activateAfterLongPress(220).onStart(function(){var e=[new global.Error,-3,-27],t=function(){l.runOnJS(ke)()};return t.__closure={runOnJS:l.runOnJS,fireHoldStart:ke},t.__workletHash=3973713390129,t.__initData=Vr,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(K.value,Math.min(0,e.translationX)),r=Math.max(F.value,Math.min(0,e.translationY)),n=Math.abs(r)>Math.abs(t);W.value=n?0:t,Y.value=n?r:0,n&&1===L.value&&0===ee.value&&r<=D.value&&(ee.value=1,l.runOnJS(Ie)()),!n&&1===B.value&&0===Z.value&&t<=V.value&&(Z.value=1,l.runOnJS(Oe)())}};return t.__closure={stateShared:G,STATE_HOLD:2,maxLeftShared:K,maxUpShared:F,translateX:W,translateY:Y,enableLockShared:L,lockFiredShared:ee,lockThresholdShared:D,runOnJS:l.runOnJS,fireLock:Ie,enableCancelShared:B,cancelFiredShared:Z,cancelThresholdShared:V,fireCancel:Oe},t.__workletHash=0xc932b7db4db,t.__initData=Dr,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-9,-27],t=function(){if(1!==ee.value&&1!==Z.value)return 1===L.value&&Y.value<-12?(ee.value=1,void l.runOnJS(Ie)()):void l.runOnJS(je)()};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,enableLockShared:L,translateY:Y,LOCK_ON_RELEASE_DELTA:12,runOnJS:l.runOnJS,fireLock:Ie,fireHoldEnd:je},t.__workletHash=8222992215978,t.__initData=Kr,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===ee.value&&0===Z.value&&(W.value=l.withSpring(0,{damping:18,stiffness:220}),Y.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,translateX:W,withSpring:l.withSpring,translateY:Y},t.__workletHash=0xb56825c4eba,t.__initData=Fr,t.__stackDetails=e,t}());return a.Gesture.Race(r,n)}),[]),Pe=l.useAnimatedStyle((be=[new global.Error,-6,-27],(we=function(){var e=2===G.value;return{transform:[{translateX:e?W.value:0},{translateY:e?Y.value:0},{scale:z.value}]}}).__closure={stateShared:G,STATE_HOLD:2,translateX:W,translateY:Y,micScale:z},we.__workletHash=0x92736c307cb,we.__initData=Lr,we.__stackDetails=be,we)),Me=l.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){return{opacity:l.interpolate(W.value,[0,V.value],[1,0],l.Extrapolation.CLAMP),transform:[{translateX:.4*W.value+Q.value}]}};return t.__closure={interpolate:l.interpolate,translateX:W,cancelThresholdShared:V,Extrapolation:l.Extrapolation,arrowPulse:Q},t.__workletHash=0xf2b5c2efb9e,t.__initData=Br,t.__stackDetails=e,t}()),Re=l.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=l.interpolate(Y.value,[0,D.value],[0,1],l.Extrapolation.CLAMP);return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={interpolate:l.interpolate,translateY:Y,lockThresholdShared:D,Extrapolation:l.Extrapolation},t.__workletHash=5669890750044,t.__initData=Hr,t.__stackDetails=e,t}()),Te=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:J.value}]}};return t.__closure={chevronPulse:J},t.__workletHash=0xd07d519242c,t.__initData=Ur,t.__stackDetails=e,t}()),Ge=l.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){return{opacity:_?1:q.value}};return t.__closure={isPaused:_,pausePulse:q},t.__workletHash=0xea4d31d5a5c,t.__initData=Nr,t.__stackDetails=e,t}()),Ve=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:$.value}};return t.__closure={recBlink:$},t.__workletHash=0xd511e0063a5,t.__initData=Wr,t.__stackDetails=e,t}());return{state:b,duration:k,isPaused:_,composedGesture:_e,waveTick:X,micWrapperStyle:Pe,slideTextAnimatedStyle:Me,lockPillAnimatedStyle:Re,chevronAnimatedStyle:Te,pausePulseStyle:Ge,recDotStyle:Ve,triggerCancel:he,togglePause:pe}}({cancelSlideDistance:z,lockSlideDistance:W,enableLockRecording:F,enableSlideToCancel:B,holdMicScale:R,onRecordingStart:t.onRecordingStart,onRecordingStop:t.onRecordingStop,onSend:t.onSend,onDelete:t.onDelete,onLock:t.onLock,onCancel:t.onCancel,onPauseRecording:t.onPauseRecording,onResumeRecording:t.onResumeRecording,onStateChange:t.onStateChange});return"RECORDING_TAP"===he.state||"LOCKED_RECORDING"===he.state||"SENDING"===he.state?e.jsx(Rr,{duration:he.duration,isPaused:he.isPaused,composedGesture:he.composedGesture,micWrapperStyle:he.micWrapperStyle,pausePulseStyle:he.pausePulseStyle,recDotStyle:he.recDotStyle,waveTick:he.waveTick,onCancelPress:he.triggerCancel,onTogglePause:he.togglePause,backgroundColor:s,timerColor:d,waveformColor:m,deleteIconColor:g,pauseIconColor:E,primaryColor:o,micSize:Ce,iconSize:G,inputBarHeight:_,waveCount:J,enableWaveform:U,renderDeleteIcon:te,renderPauseIcon:re,renderPlayIcon:ne,renderSendIcon:$,renderWaveform:oe,containerStyleOverride:ie,barStyleOverride:ae,timerTextStyle:le,waveformStyle:Ae,trashButtonStyle:ue,sendButtonStyle:de}):e.jsx(Ir,{isHold:"RECORDING_HOLD"===he.state,duration:he.duration,composedGesture:he.composedGesture,micWrapperStyle:he.micWrapperStyle,slideTextAnimatedStyle:he.slideTextAnimatedStyle,lockPillAnimatedStyle:he.lockPillAnimatedStyle,chevronAnimatedStyle:he.chevronAnimatedStyle,primaryColor:o,microphoneColor:f,timerColor:d,cancelTextColor:S,holdPillBackground:c,lockPillBackground:j,lockColor:v,chevronColor:fe,iconSize:G,lockIconSize:D,inputBarHeight:_,micSize:Ce,enableLockRecording:F,renderInputPill:q,renderMicIcon:X,renderArrowIcon:ee,renderLockIcon:Z,containerStyleOverride:ie,timerTextStyle:le,slideTextStyleOverride:se,lockPillStyleOverride:ce,sendButtonStyle:de})},zr=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"})]})},Qr=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)})},Jr=n.memo(Qr);function qr(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 Xr,$r,Zr,en,tn,rn,nn,on,an,ln,sn,An,cn,un,dn,Cn,fn,hn=function(r){var n,o=r.previews,a=r.closePreview,l=r.onRemoveItem,s=r.CustomFileIcon,A=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=qr(o);if(0===o.length)return null;var m=function(e){0!==p.length&&f(p,e)},y=function(r){var n,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=null===(n=r.type)||void 0===n?void 0:n.startsWith("image/"),s=null===(o=r.type)||void 0===o?void 0:o.startsWith("video/");return l&&A?e.jsx(A,{uri:r.uri}):s&&c?e.jsx(c,{uri:r.uri}):l?e.jsx(t.Image,{source:{uri:r.uri},style:{width:a,height:a,borderRadius:12},resizeMode:"cover"}):s?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},g=function(r,n){return e.jsx(t.Pressable,{onPress:function(){return l?l(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:[y(r),g(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",l=2===n.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(t.Pressable,{onPress:function(){var e=qr(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:[y(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]})}),g(r.uri,l)]})},"".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,l;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:s?e.jsx(s,{}):e.jsx(zr,{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(Jr,{fileName:r.name||"File",style:null==C||null===(l=C.filePreviewStyle)||void 0===l?void 0:l.text})})]}),g(r.uri)]},"".concat(r.uri,"-").concat(n))}(r,n)}))})]})})},vn=n.memo(hn),pn="ios"===t.Platform.OS?32:30,mn="ios"===t.Platform.OS?50:48,yn=function(o){var i,a,l,s,A,c,d,C,f,h,v,p,m=o.onSendMessage,g=o.onTypingStart,x=o.onTypingEnd,S=o.onAttachmentPress,b=o.onCameraPress,w=o.onAudioRecordStart,E=o.onAudioRecordEnd,k=o.CustomEmojiIcon,j=o.CustomAttachmentIcon,I=o.CustomCameraIcon,P=o.CustomSendIcon,R=o.CustomMicrophoneIcon,T=o.CustomFileIcon,G=o.CustomImagePreview,V=o.CustomVideoPreview,K=O(n.useState(""),2),F=K[0],L=K[1],B=O(n.useState(0),2),H=B[0],U=B[1],N=O(n.useState({height:pn,isMultiline:!1}),2),W=N[0],Y=N[1],J=D(),q=J.theme,X=J.currentUserId,$=J.showEmojiButton,Z=J.showAttachmentsButton,ee=J.showCameraButton,te=J.showVoiceRecordButton,re=J.placeholder,ne=J.previewData,oe=J.previewItems,ie=J.closePreview,ae=J.onRemovePreviewItem,le=J.CustomVoiceRecorder,se=n.useMemo((function(){return null!=oe&&oe.length?oe:ne?[ne]:[]}),[oe,ne]),Ae=se.length>0,ce=null==q||null===(i=q.sizes)||void 0===i?void 0:i.inputIconSize,ue=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)}(ce),de="number"==typeof(p=ce)&&p>0?p:24,Ce=0===F.trim().length&&!W.isMultiline,fe=Math.max(0,(mn-de)/2),he=Ce?{paddingTop:fe,paddingBottom:fe}:{paddingBottom:fe},ve=n.useCallback((function(){Y({height:pn,isMultiline:!1}),U((function(e){return e+1}))}),[]),pe=n.useCallback((function(e){L(e),0===e.length&&ve()}),[ve]),me=n.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,pn),118),r=t>pn;Y({height:r?t:pn,isMultiline:r})}),[]),ye=n.useCallback((function(){var e=F.trim();(e||Ae)&&(m({text:e,senderId:X}),L(""),ve())}),[F,m,X,Ae,ve]);n.useEffect((function(){F.trim()?null==g||g():null==x||x()}),[F,g,x]);var ge=!!F.trim()||Ae,xe=null==q?void 0:q.voiceRecorder,Se=null!==(a=null==xe?void 0:xe.ui)&&void 0!==a?a:{},be=null==xe?void 0:xe.styles,we=null==xe?void 0:xe.config,Ee=n.useCallback((function(e){null==E||E(e)}),[E]),ke=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=O(n.useState("idle"),2),l=a[0],s=a[1],A=O(n.useState(0),2),c=A[0],d=A[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 y=n.useCallback((function(){f.current&&(clearInterval(f.current),f.current=null)}),[]),g=n.useCallback((function(e){y(),f.current=setInterval((function(){h.current+=1,d(h.current),h.current>=m.current&&e()}),1e3)}),[y]),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,er();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),s("recording"),g((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]])}))),[g]),S=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(),s("paused"),y()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[y]),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(),s("recording"),g((function(){return E.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[g]),w=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 y(),C.current=null,r=h.current,h.current=0,s("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]])}))),[y]),E=n.useRef(w);E.current=w;var k=n.useCallback((function(){return E.current()}),[]),j=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,y(),C.current=null,h.current=0,s("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]])}))),[y]);return n.useEffect((function(){return function(){y();try{var e;null===(e=C.current)||void 0===e||e.stop()}catch(e){}}}),[y]),{status:l,duration:c,isRecording:"recording"===l,isPaused:"paused"===l,startRecording:x,pauseRecording:S,resumeRecording:b,stopRecording:k,cancelRecording:j}}({maxDuration:null!==(l=null==we?void 0:we.maxDuration)&&void 0!==l?l:300,onRecordStart:w,onRecordEnd:Ee}),je=n.useRef(ke);je.current=ke;var Ie,Oe=n.useCallback((function(){je.current.startRecording()}),[]),_e=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,je.current.stopRecording();case 2:(t=e.sent)&&m({audio:t.uri,senderId:X});case 4:case"end":return e.stop()}}),e)}))),[m,X]),Pe=n.useCallback((function(){je.current.cancelRecording()}),[]),Me=n.useCallback((function(){je.current.pauseRecording()}),[]),Re=n.useCallback((function(){je.current.resumeRecording()}),[]),Te=null==q||null===(s=q.inputStyles)||void 0===s||null===(s=s.sendButtonStyle)||void 0===s?void 0:s.backgroundColor,Ge=null==q||null===(A=q.colors)||void 0===A?void 0:A.sendIconsColor,Ve=null!==(c=Se.recordingSendButtonBackground)&&void 0!==c?c:Te,De=Se.recordingBackground,Ke=null!==(d=Se.timerColor)&&void 0!==d?d:Ge,Fe=null!==(C=Se.longPressMicColor)&&void 0!==C?C:Ge,Le=null!==(f=Se.waveformColor)&&void 0!==f?f:Ge,Be={isRecording:ke.isRecording,isPaused:ke.isPaused,duration:ke.duration,isLocked:!1,slideOffset:{x:0,y:0},waveformData:[],startRecording:ke.startRecording,stopRecording:ke.stopRecording,pauseRecording:ke.pauseRecording,resumeRecording:ke.resumeRecording,cancelRecording:ke.cancelRecording},He=le?le(Be):null,Ue=function(){var n,o,i,a,l,s;return e.jsxs(t.View,{style:[r(Xr||(Xr=_(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:mn,borderRadius:Ce?9999:24,alignItems:Ce?"center":"flex-end"},null==q||null===(n=q.inputStyles)||void 0===n?void 0:n.inputContainerStyle],children:[$&&e.jsx(t.View,{style:he,children:e.jsx(t.Pressable,{children:k?e.jsx(k,{}):e.jsx(qt,{style:ue,color:(null==q||null===(o=q.colors)||void 0===o?void 0:o.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(t.TextInput,{value:F,onChangeText:pe,placeholder:re||"Message",style:Q([r($r||($r=_(["bg-transparent flex-1 pl-2"]))),"ios"===t.Platform.OS?r(Zr||(Zr=_(["text-[17px]"]))):r(en||(en=_(["text-[16px]"]))),{minHeight:pn,maxHeight:118,paddingVertical:Ce?0:8,marginVertical:Ce?(mn-pn)/2:4},{color:(null==q||null===(i=q.colors)||void 0===i?void 0:i.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==q?void 0:q.fontFamily),placeholderTextColor:(null==q||null===(a=q.colors)||void 0===a?void 0:a.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:W.isMultiline&&F.length>0?"top":"center",onContentSizeChange:me},"chat-input-".concat(H)),e.jsxs(t.View,{style:[r(tn||(tn=_(["flex-row items-center gap-4"]))),he],children:[Z&&e.jsx(t.Pressable,{onPress:S,children:j?e.jsx(j,{}):e.jsx($t,{style:ue,color:(null==q||null===(l=q.colors)||void 0===l?void 0:l.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),ee&&!F.trim()&&e.jsx(t.Pressable,{onPress:b,children:I?e.jsx(I,{}):e.jsx(Jt,{style:ue,color:(null==q||null===(s=q.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]})},Ne=function(){var n,o;return e.jsx(t.Pressable,{onPress:ye,style:[r(rn||(rn=_(["rounded-full justify-center items-center"]))),y({height:mn,width:mn,backgroundColor:"#16a34a"},null==q||null===(n=q.inputStyles)||void 0===n?void 0:n.sendButtonStyle)],children:P?e.jsx(P,{}):e.jsx(Zt,{style:r.style("h-6 w-6"),color:(null==q||null===(o=q.colors)||void 0===o?void 0:o.sendIconsColor)||"rgba(255,255,255,0.7)"})})},We=!ge&&te&&!He;return e.jsxs(t.View,{style:r(nn||(nn=_(["w-full px-2"]))),children:[Ae&&e.jsx(vn,{previews:se,closePreview:ie,onRemoveItem:ae,CustomFileIcon:T,CustomImagePreview:G,CustomVideoPreview:V,inputHeight:W.height}),e.jsx(t.View,{style:[r(on||(on=_(["w-full"]))),null==q||null===(h=q.inputStyles)||void 0===h?void 0:h.inputSectionContainerStyle],children:We?e.jsx(Yr,{inputBarHeight:mn,primaryColor:Ve,backgroundColor:De,timerColor:Ke,microphoneColor:Fe,waveformColor:Le,holdPillBackground:Se.holdPillBackground,cancelTextColor:Se.cancelTextColor,chevronColor:Se.chevronIconColor,lockColor:Se.lockIconColor,lockPillBackground:Se.lockPillBackground,deleteIconColor:Se.deleteIconColor,pauseIconColor:Se.pauseIconColor,iconSize:Se.iconSize,lockSlideDistance:Se.lockSlideDistance,waveCount:Se.waveformBarCount,enableLockRecording:null==we?void 0:we.enableLockRecording,enableSlideToCancel:null==we?void 0:we.enableSlideToCancel,enableWaveform:null==we?void 0:we.enableWaveform,timerTextStyle:null!==(v=Se.timerTextStyle)&&void 0!==v?v:null==be?void 0:be.timer,containerStyle:null==be?void 0:be.container,barStyle:null==be?void 0:be.bar,slideTextStyle:null==be?void 0:be.slideText,waveformStyle:null==be?void 0:be.waveform,lockPillStyle:null==be?void 0:be.lockPill,trashButtonStyle:null==be?void 0:be.trashButton,sendButtonStyle:null==be?void 0:be.sendButton,renderInputPill:Ue,renderSendIcon:P?function(){return e.jsx(P,{})}:void 0,renderMicIcon:R?function(){return e.jsx(R,{})}:void 0,onRecordingStart:Oe,onSend:_e,onCancel:Pe,onDelete:Pe,onPauseRecording:Me,onResumeRecording:Re}):e.jsxs(t.View,{style:r(an||(an=_(["flex-row items-end gap-2"]))),children:[Ue(),ge||!te?Ne():He?e.jsx(t.View,{style:{height:mn,width:mn,justifyContent:"center",alignItems:"center"},children:R?e.jsx(R,{}):e.jsx(Xt,{style:r.style("h-8 w-8"),color:(null==q||null===(Ie=q.colors)||void 0===Ie?void 0:Ie.sendIconsColor)||"rgba(255,255,255,0.7)"})}):Ne()]})}),He]})},gn=n.memo(yn);function xn(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 Sn,bn,wn,En,kn,jn,In,On,_n,Pn,Mn,Rn,Tn,Gn,Vn,Dn,Kn,Fn,Ln,Bn=function(o){var i,a=o.gallery,l=o.onClose,s=D(),A=s.theme,c=s.setIsVideoPlaying,u=n.useRef(null),d=null!==(i=null==a?void 0:a.initialIndex)&&void 0!==i?i:0,C=O(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 y=n.useCallback((function(){c(!1),l()}),[l,c]),g=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:y,statusBarTranslucent:!0,children:e.jsxs(t.View,{style:[r(ln||(ln=_(["flex-1 bg-black"]))),{width:p,height:m}],children:[e.jsx(t.Pressable,{onPress:y,style:r(sn||(sn=_(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(xn,{style:r(An||(An=_(["h-8 w-8"])))})}),a.items.length>1&&e.jsx(t.View,{style:r(cn||(cn=_(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(t.Text,{style:Q(r(un||(un=_(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==A?void 0:A.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:g,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(Hn,{item:r,width:p,height:m,isActive:n===f,autoPlayVideo:n===d&&"video"===r.kind})}})]})}):null},Hn=function(o){var a=o.item,l=o.width,s=o.height,A=o.isActive,c=o.autoPlayVideo,u=D().theme,d=n.useRef(null),C=O(n.useState("video"===a.kind),2),f=C[0],h=C[1],v=O(n.useState(!1),2),p=v[0],m=v[1],y="video"===a.kind&&A&&c;return"image"===a.kind?e.jsx(t.View,{style:{width:l,height:s,justifyContent:"center"},children:e.jsx(t.Image,{source:{uri:a.uri},style:{width:l,height:s},resizeMode:"contain"})}):e.jsxs(t.View,{style:{width:l,height:s,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(i,{source:{uri:a.uri},ref:d,controls:!0,paused:!y,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:l-32,height:.55*s,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(dn||(dn=_(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(st,{style:r.style("h-14 w-14"),spinning:!0})}),p&&e.jsx(t.View,{style:r(Cn||(Cn=_(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(t.Text,{style:Q(r(fn||(fn=_(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},Un=n.memo(Bn),Nn=function(n){var o,i,a,l,s,A=n.typingUsers,c=n.currentUserId,u=D(),d=u.theme,C=u.showAvatars,f=u.renderCustomTyping,h=u.showBubbleTail,v=u.typingText,p=A.filter((function(e){return e.id!==c}));if(!p.length)return null;var m=p.slice(0,2),g=p.length-2,x=C?m.length+(g>0?1:0):0,S=x>0?24+14*Math.max(0,x-1):0,b=x>0?S+12:8,w=-(S+12);return e.jsxs(t.View,{style:[r(Sn||(Sn=_(["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:w,flexDirection:"row"},children:[m.map((function(n,o){var i,a,l;return e.jsx(t.View,{style:[r(bn||(bn=_(["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(wn||(wn=_(["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(En||(En=_(["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===(l=n.name)||void 0===l?void 0:l.charAt(0)})},n.id)})),g>0&&e.jsx(t.View,{style:[r(kn||(kn=_(["bg-gray-400 w-6 h-6 rounded-full items-center justify-center"]))),{marginLeft:-10,zIndex:3},y({},null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.additionalTypingUsersContainerStyle)],children:e.jsxs(t.Text,{style:Q([r(jn||(jn=_(["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:["+",g]})})]}),h&&e.jsx(R,{style:r.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white"}),f?f():e.jsx(t.View,{style:r(In||(In=_(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(t.Text,{style:Q([r(On||(On=_(["text-gray-600"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingTextStyle],null==d?void 0:d.fontFamily),children:null!=v?v:"Typing..."})})]})};var Wn,Yn,zn,Qn,Jn,qn,Xn,$n,Zn,eo={code:"function VoiceRecorderTsx1(){const{isPaused,pauseOpacity}=this.__closure;return{opacity:isPaused?1:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx1","isPaused","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAiCgD,SAAAA,kBAAA,QAAAC,QAAA,CAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,YAAY,CAACG,KACzC,CAAC","ignoreList":[]}',version:"3.16.7"},to={code:"function VoiceRecorderTsx2(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx2","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAoCyC,SAAAA,kBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"},ro=function(o){var i=o.color,a=o.count,s=l.useSharedValue(0);return n.useEffect((function(){s.value=l.withRepeat(l.withTiming(1,{duration:4500,easing:l.Easing.linear}),-1,!1)}),[]),e.jsx(t.View,{style:r(Fn||(Fn=_(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,r){return e.jsx(oo,{index:r,total:a,tick:s,color:i},r)}))})},no={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 edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,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/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx3","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/VoiceRecorder.tsx"],"mappings":"AAuF2C,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,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"},oo=function(t){var n,o,i=t.index,a=t.total,s=t.tick,A=t.color,c=l.useAnimatedStyle((n=[new global.Error,-4,-27],(o=function(){var e=s.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,r=Math.sin(i/Math.max(1,a-1)*Math.PI),n=Math.max(.18,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:s,index:i,total:a},o.__workletHash=5267961911334,o.__initData=no,o.__stackDetails=n,o));return e.jsx(l.View,{style:[r(Ln||(Ln=_(["mx-px rounded-full"]))),{width:2,backgroundColor:A},c]})};function io(){t.Vibration.vibrate(15)}var ao,lo,so,Ao,co,uo={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":"AAoDiB,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"},Co={code:"function VoiceRecordingGestureTsx2(e){const{dragX,dragY,lockFired,LOCK_THRESHOLD,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;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","runOnJS","fireLock","cancelFired","CANCEL_THRESHOLD","fireCancel","__closure","x","Math","min","translationX","y","translationY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA2DmB,QAAC,CAAAA,yBAAKA,CAAAC,CAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACc,YAAY,CAAC,CACrC,KAAM,CAAAC,CAAC,CAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACgB,YAAY,CAAC,CACrCf,KAAK,CAACgB,KAAK,CAAGN,CAAC,CACfT,KAAK,CAACe,KAAK,CAAGF,CAAC,CACf,GAAIZ,SAAS,CAACc,KAAK,GAAK,CAAC,EAAIF,CAAC,EAAI,CAACX,cAAc,CAAE,CAC/CD,SAAS,CAACc,KAAK,CAAG,CAAC,CACnBZ,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"},fo={code:"function VoiceRecordingGestureTsx3(){const{lockFired,cancelFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0&&cancelFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:220});dragY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx3","lockFired","cancelFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0EoB,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,WAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAElB,GAAIL,SAAS,CAACM,KAAK,GAAK,CAAC,EAAIL,WAAW,CAACK,KAAK,GAAK,CAAC,CAAE,CAClDJ,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"},ho={code:"function VoiceRecordingGestureTsx4(){const{dragX,CANCEL_THRESHOLD,arrowPulse}=this.__closure;const progress=Math.min(1,Math.abs(dragX.value)/CANCEL_THRESHOLD);return{transform:[{translateX:dragX.value*0.4+arrowPulse.value}],opacity:1-progress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx4","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":"AAiF4C,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,GAAG,CAAGN,UAAU,CAACM,KAAM,CAAC,CAAC,CACjEG,OAAO,CAAE,CAAC,CAAGP,QACjB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},vo={code:"function VoiceRecordingGestureTsx5(){const{dragY,LOCK_THRESHOLD,interpolate}=this.__closure;const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx5","dragY","LOCK_THRESHOLD","interpolate","__closure","lockProgress","Math","min","max","value","transform","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAwF2C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,CAAAC,WAAA,OAAAC,SAAA,CACzC,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,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAER,WAAW,CAACE,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAC3E,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},po={code:"function VoiceRecordingGestureTsx6(){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":["VoiceRecordingGestureTsx6","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA8F0C,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"},mo={code:"function VoiceRecordingGestureTsx7(){const{dragX,dragY,micPulse}=this.__closure;return{transform:[{translateX:dragX.value},{translateY:dragY.value},{scale:micPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx7","dragX","dragY","micPulse","__closure","transform","translateX","value","translateY","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiGsC,SAAAA,0BAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,QAAA,OAAAC,SAAA,OAAO,CACrCC,SAAS,CAAE,CACP,CAAEC,UAAU,CAAEL,KAAK,CAACM,KAAM,CAAC,CAC3B,CAAEC,UAAU,CAAEN,KAAK,CAACK,KAAM,CAAC,CAC3B,CAAEE,KAAK,CAAEN,QAAQ,CAACI,KAAM,CAAC,CAEjC,CAAC","ignoreList":[]}',version:"3.16.7"},yo=function(){var o=D(),i=o.messages,a=o.currentUserId,l=o.onMessageLongPress,s=o.mediaViewerGallery,A=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,y=o.CustomEmojiIcon,g=o.CustomAttachmentIcon,x=o.CustomCameraIcon,S=o.CustomMicrophoneIcon,b=o.CustomSendIcon,w=o.CustomFileIcon,E=o.CustomImagePreview,k=o.CustomVideoPreview,j=o.keyboardVerticalOffset,I=void 0===j?0:j,P=o.disableKeyboardAvoiding,M=void 0!==P&&P,R=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r=O(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),T=m?m():e.jsx(gn,{onSendMessage:u,onTypingStart:d,onTypingEnd:C,onAttachmentPress:f,onAudioRecordEnd:h,onAudioRecordStart:v,onCameraPress:p,CustomEmojiIcon:y,CustomAttachmentIcon:g,CustomCameraIcon:x,CustomMicrophoneIcon:S,CustomSendIcon:b,CustomFileIcon:w,CustomImagePreview:E,CustomVideoPreview:k}),G=e.jsxs(t.View,{style:r(ao||(ao=_(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(t.FlatList,{style:r(lo||(lo=_(["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==l?void 0:l(n)},isFirstInSequence:o===i.length-1||(null===(r=i[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(Nn,{typingUsers:c||[],currentUserId:a}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(t.View,{style:!M&&R>0?{marginBottom:R}:void 0,children:T}),e.jsx(Un,{gallery:s,onClose:A})]});return M?e.jsx(t.View,{style:r(so||(so=_(["flex-1"]))),children:G}):"android"===t.Platform.OS?e.jsx(t.View,{style:r(Ao||(Ao=_(["flex-1"]))),children:G}):e.jsx(t.KeyboardAvoidingView,{style:r(co||(co=_(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:I,children:G})};exports.VoiceRecorder=function(o){var i=o.primaryColor,a=void 0===i?"#16A34A":i,s=o.backgroundColor,A=void 0===s?"#0B141A":s,c=o.waveformColor,u=void 0===c?"#E9EDEF":c,d=o.timerColor,C=void 0===d?"#FFFFFF":d,f=o.sendButtonColor,h=o.deleteIconColor,v=void 0===h?"#8696A0":h,p=o.pauseIconColor,m=void 0===p?"#F15C6D":p,y=o.borderRadius,g=void 0===y?16:y,x=o.sendButtonSize,S=void 0===x?50:x,b=o.waveCount,w=void 0===b?32:b,E=o.renderDeleteIcon,k=o.renderSendIcon,j=o.renderPauseIcon,I=o.renderPlayIcon,P=o.renderWaveform,M=o.onSend,R=o.onDelete,T=o.onPause,G=o.onResume,V=O(n.useState(0),2),D=V[0],K=V[1],F=O(n.useState(!1),2),L=F[0],B=F[1],H=n.useRef(Date.now()),U=n.useRef(0),N=n.useRef(0);n.useEffect((function(){H.current=Date.now()}),[]),n.useEffect((function(){if(!L){var e=setInterval((function(){K((Date.now()-H.current-U.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[L]);var W=l.useSharedValue(1),Y=l.useSharedValue(1);n.useEffect((function(){W.value=l.withRepeat(l.withSequence(l.withTiming(.5,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),Y.value=l.withRepeat(l.withSequence(l.withTiming(.3,{duration:600}),l.withTiming(1,{duration:600})),-1,!1)}),[]);var z,Q,J=l.useAnimatedStyle((z=[new global.Error,-3,-27],(Q=function(){return{opacity:L?1:W.value}}).__closure={isPaused:L,pauseOpacity:W},Q.__workletHash=0xf63a8f6d95,Q.__initData=eo,Q.__stackDetails=z,Q)),q=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:Y.value}};return t.__closure={recBlink:Y},t.__workletHash=6095431465582,t.__initData=to,t.__stackDetails=e,t}()),X={backgroundColor:A,borderTopLeftRadius:g,borderTopRightRadius:g},$=null!=f?f:a;return e.jsxs(t.View,{style:[r(_n||(_n=_(["w-full px-4 py-2.5"]))),X],children:[e.jsxs(t.View,{style:r(Pn||(Pn=_(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(l.View,{style:[r(Mn||(Mn=_(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:m},q]}),e.jsx(t.Text,{style:[r(Rn||(Rn=_(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:Qe(D)}),e.jsx(t.View,{style:r(Tn||(Tn=_(["flex-1"]))),children:P?P():e.jsx(ro,{color:u,count:w})})]}),e.jsxs(t.View,{style:r(Gn||(Gn=_(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(t.Pressable,{onPress:R,hitSlop:12,style:[r(Vn||(Vn=_(["items-center justify-center rounded-full"]))),{width:S,height:S}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:E?E():e.jsx(Or,{style:r.style("w-6 h-6"),color:v})}),e.jsx(t.Pressable,{onPress:function(){B((function(e){var t=!e;return t?(N.current=Date.now(),null==T||T()):(U.current+=Date.now()-N.current,N.current=0,null==G||G()),t}))},hitSlop:12,style:r(Dn||(Dn=_(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:L?"Resume recording":"Pause recording",children:L?I?I():e.jsx(We,{style:r.style("w-7 h-7"),color:m}):e.jsx(l.View,{style:J,children:j?j():e.jsx(Ne,{style:r.style("w-7 h-7"),color:m})})}),e.jsx(t.Pressable,{onPress:M,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[r(Kn||(Kn=_(["items-center justify-center rounded-full"]))),{width:S,height:S,backgroundColor:$}],children:k?k():e.jsx(Zt,{style:r.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=Yr,exports.VoiceRecordingGesture=function(o){var i=o.primaryColor,s=void 0===i?"#16A34A":i,A=o.backgroundColor,c=void 0===A?"#1F2C33":A,u=o.timerColor,d=void 0===u?"#FFFFFF":u,C=o.microphoneColor,f=void 0===C?"#FFFFFF":C,h=o.lockColor,v=void 0===h?"#E9EDEF":h,p=o.lockPillBackground,m=void 0===p?"#1F2C33":p,y=o.cancelTextColor,g=void 0===y?"rgba(255,255,255,0.6)":y,x=o.barHeight,S=void 0===x?48:x,b=o.micSize,w=o.renderMicIcon,E=o.renderLockIcon,k=o.renderArrowIcon,j=o.onCancel,I=o.onLock,P=null!=b?b:S,M=O(n.useState(0),2),R=M[0],T=M[1],G=n.useRef(Date.now());n.useEffect((function(){G.current=Date.now();var e=setInterval((function(){T((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var V=l.useSharedValue(0),D=l.useSharedValue(0),K=l.useSharedValue(0),F=l.useSharedValue(1),L=l.useSharedValue(0),B=l.useSharedValue(0),H=l.useSharedValue(0);n.useEffect((function(){K.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),F.value=l.withRepeat(l.withSequence(l.withTiming(1.18,{duration:700,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(1.12,{duration:700,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1),L.value=l.withRepeat(l.withSequence(l.withTiming(-4,{duration:600,easing:l.Easing.inOut(l.Easing.ease)}),l.withTiming(0,{duration:600,easing:l.Easing.inOut(l.Easing.ease)})),-1,!1)}),[]);var U=n.useRef(j);U.current=j;var N=n.useRef(I);N.current=I;var W,Y,z=function(){var e;io(),null===(e=U.current)||void 0===e||e.call(U)},Q=function(){var e;io(),null===(e=N.current)||void 0===e||e.call(N)},J=a.Gesture.Pan().minDistance(0).onBegin((W=[new global.Error,-5,-27],Y=function(){B.value=0,H.value=0,V.value=0,D.value=0},Y.__closure={cancelFired:B,lockFired:H,dragX:V,dragY:D},Y.__workletHash=9031413480896,Y.__initData=uo,Y.__stackDetails=W,Y)).onUpdate(function(){var e=[new global.Error,-10,-27],t=function(e){var t=Math.min(0,e.translationX),r=Math.min(0,e.translationY);V.value=t,D.value=r,0===H.value&&r<=-70&&(H.value=1,l.runOnJS(Q)()),0===B.value&&t<=-90&&(B.value=1,l.runOnJS(z)())};return t.__closure={dragX:V,dragY:D,lockFired:H,LOCK_THRESHOLD:70,runOnJS:l.runOnJS,fireLock:Q,cancelFired:B,CANCEL_THRESHOLD:90,fireCancel:z},t.__workletHash=0xac60b03bef6,t.__initData=Co,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===H.value&&0===B.value&&(V.value=l.withSpring(0,{damping:18,stiffness:220}),D.value=l.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFired:H,cancelFired:B,dragX:V,withSpring:l.withSpring,dragY:D},t.__workletHash=0x962b8aa90f5,t.__initData=fo,t.__stackDetails=e,t}()),q=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.abs(V.value)/90);return{transform:[{translateX:.4*V.value+K.value}],opacity:1-e}};return t.__closure={dragX:V,CANCEL_THRESHOLD:90,arrowPulse:K},t.__workletHash=2609121094002,t.__initData=ho,t.__stackDetails=e,t}()),X=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.max(0,-D.value/70));return{transform:[{translateY:l.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={dragY:D,LOCK_THRESHOLD:70,interpolate:l.interpolate},t.__workletHash=2770335161610,t.__initData=vo,t.__stackDetails=e,t}()),$=l.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:L.value}]}};return t.__closure={chevronPulse:L},t.__workletHash=0xe2617d14eaa,t.__initData=po,t.__stackDetails=e,t}()),Z=l.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{transform:[{translateX:V.value},{translateY:D.value},{scale:F.value}]}};return t.__closure={dragX:V,dragY:D,micPulse:F},t.__workletHash=0xa3ed9ad56cd,t.__initData=mo,t.__stackDetails=e,t}());return e.jsxs(t.View,{style:r(Wn||(Wn=_(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(t.View,{style:[r(Yn||(Yn=_(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:S,backgroundColor:c}],children:[e.jsx(t.Text,{style:[r(zn||(zn=_(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:Qe(R)}),e.jsxs(l.View,{style:[r(Qn||(Qn=_(["flex-1 flex-row items-center justify-center gap-1.5"]))),q],children:[k?k():e.jsx(t.Text,{style:[r(Jn||(Jn=_(["text-base leading-none"]))),{color:g,marginTop:-2}],children:"‹"}),e.jsx(t.Text,{style:[r(qn||(qn=_(["text-sm"]))),{color:g}],children:"Slide to cancel"})]})]}),e.jsxs(t.View,{style:[r(Xn||(Xn=_(["relative items-center justify-center"]))),{height:S,width:S}],children:[e.jsxs(l.View,{style:[r($n||($n=_(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:P-8,backgroundColor:m,bottom:P+6,gap:6},X],pointerEvents:"none",children:[E?E():e.jsx(kr,{style:{width:18,height:18},color:v}),e.jsx(l.View,{style:$,children:e.jsx(Er,{style:{width:14,height:14},color:v})})]}),e.jsx(a.GestureDetector,{gesture:J,children:e.jsx(l.View,{style:[r(Zn||(Zn=_(["items-center justify-center rounded-full"]))),{width:P,height:P,backgroundColor:s},Z],accessibilityRole:"button",accessibilityLabel:"Hold to record. Slide left to cancel, slide up to lock.",children:w?w():e.jsx(Xt,{style:{width:26,height:26},color:f})})})]})]})},exports.default=function(t){return e.jsx(ze,{children:e.jsx(V,y(y({},t),{},{children:e.jsx(yo,{})}))})};
16
+ */function Ie(){if(fe)return he;fe=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;return he=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,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(n),s=1;s<arguments.length;s++){for(var A in i=Object(arguments[s]))t.call(i,A)&&(l[A]=i[A]);if(e){a=e(i);for(var c=0;c<a.length;c++)r.call(i,a[c])&&(l[a[c]]=i[a[c]])}}return l},he}function _e(){if(me)return ve;me=1;return ve="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Pe(){return ge?pe:(ge=1,pe=Function.call.bind(Object.prototype.hasOwnProperty))}function Te(){if(xe)return ye;xe=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=_e(),r={},n=Pe();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,l,s){if("production"!==process.env.NODE_ENV)for(var A in o)if(n(o,A)){var c;try{if("function"!=typeof o[A]){var u=Error((l||"React class")+": "+a+" type `"+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[A]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}c=o[A](i,A,l,a,null,t)}catch(e){c=e}if(!c||c instanceof Error||e((l||"React class")+": type specification of "+a+" `"+A+"` 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=s?s():"";e("Failed "+a+" type: "+c.message+(null!=d?d:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(r={})},ye=o}function Re(){if(we)return be;we=1;var e=Me(),t=Ie(),r=_e(),n=Pe(),o=Te(),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){}}),be=function(l,s){var A="function"==typeof Symbol&&Symbol.iterator;var c="<<anonymous>>",u={array:f("array"),bigint:f("bigint"),bool:f("boolean"),func:f("function"),number:f("number"),object:f("object"),string:f("string"),symbol:f("symbol"),any:h(a),arrayOf:function(e){return h((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 l=t[n];if(!Array.isArray(l))return new C("Invalid "+i+" `"+a+"` of type `"+p(l)+"` supplied to `"+o+"`, expected an array.");for(var s=0;s<l.length;s++){var A=e(l,s,o,i,a+"["+s+"]",r);if(A instanceof Error)return A}return null}))},element:h((function(e,t,r,n,o){var i=e[t];return l(i)?null:new C("Invalid "+n+" `"+o+"` of type `"+p(i)+"` supplied to `"+r+"`, expected a single ReactElement.")})),elementType:h((function(t,r,n,o,i){var a=t[r];return e.isValidElementType(a)?null:new C("Invalid "+o+" `"+i+"` of type `"+p(a)+"` supplied to `"+n+"`, expected a single ReactElement type.")})),instanceOf:function(e){return h((function(t,r,n,o,i){if(!(t[r]instanceof e)){var a=e.name||c;return new C("Invalid "+o+" `"+i+"` of type `"+(((l=t[r]).constructor&&l.constructor.name?l.constructor.name:c)+"` supplied to `")+n+"`, expected instance of `"+a+"`.")}var l;return null}))},node:h((function(e,t,r,n,o){return m(e[t])?null:new C("Invalid "+n+" `"+o+"` supplied to `"+r+"`, expected a ReactNode.")})),objectOf:function(e){return h((function(t,o,i,a,l){if("function"!=typeof e)return new C("Property `"+l+"` of component `"+i+"` has invalid PropType notation inside objectOf.");var s=t[o],A=p(s);if("object"!==A)return new C("Invalid "+a+" `"+l+"` of type `"+A+"` supplied to `"+i+"`, expected an object.");for(var c in s)if(n(s,c)){var u=e(s,c,i,a,l+"."+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 h((function(t,r,n,o,i){for(var a=t[r],l=0;l<e.length;l++)if(d(a,e[l]))return null;var s=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 "+s+".")}))},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 h((function(t,o,i,a,l){for(var s=[],A=0;A<e.length;A++){var c=(0,e[A])(t,o,i,a,l,r);if(null==c)return null;c.data&&n(c.data,"expectedType")&&s.push(c.data.expectedType)}return new C("Invalid "+a+" `"+l+"` supplied to `"+i+"`"+(s.length>0?", expected one of type ["+s.join(", ")+"]":"")+".")}))},shape:function(e){return h((function(t,n,o,i,a){var l=t[n],s=p(l);if("object"!==s)return new C("Invalid "+i+" `"+a+"` of type `"+s+"` supplied to `"+o+"`, expected `object`.");for(var A in e){var c=e[A];if("function"!=typeof c)return v(o,i,a,A,g(c));var u=c(l,A,o,i,a+"."+A,r);if(u)return u}return null}))},exact:function(e){return h((function(o,i,a,l,s){var A=o[i],c=p(A);if("object"!==c)return new C("Invalid "+l+" `"+s+"` of type `"+c+"` supplied to `"+a+"`, expected `object`.");var u=t({},o[i],e);for(var d in u){var h=e[d];if(n(e,d)&&"function"!=typeof h)return v(a,l,s,d,g(h));if(!h)return new C("Invalid "+l+" `"+s+"` key `"+d+"` supplied to `"+a+"`.\nBad object: "+JSON.stringify(o[i],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var f=h(A,d,a,l,s+"."+d,r);if(f)return f}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 h(e){if("production"!==process.env.NODE_ENV)var t={},n=0;function o(o,a,l,A,u,d,h){if(A=A||c,d=d||l,h!==r){if(s){var f=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 f.name="Invariant Violation",f}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var v=A+":"+l;!t[v]&&n<3&&(i("You are manually calling a React.PropTypes validation function for the `"+d+"` prop on `"+A+"`. 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[l]?o?null===a[l]?new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `null`."):new C("The "+u+" `"+d+"` is marked as required in `"+A+"`, but its value is `undefined`."):null:e(a,l,A,u,d)}var a=o.bind(null,!1);return a.isRequired=o.bind(null,!0),a}function f(e){return h((function(t,r,n,o,i,a){var l=t[r];return p(l)!==e?new C("Invalid "+o+" `"+i+"` of type `"+g(l)+"` 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 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||l(e))return!0;var t=function(e){var t=e&&(A&&e[A]||e["@@iterator"]);if("function"==typeof t)return t}(e);if(!t)return!1;var r,n=t.call(e);if(t!==e.entries){for(;!(r=n.next()).done;)if(!m(r.value))return!1}else for(;!(r=n.next()).done;){var o=r.value;if(o&&!m(o[1]))return!1}return!0;default:return!1}}function p(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=p(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},be}function Oe(){if(ke)return Se;ke=1;var e=_e();function t(){}function r(){}return r.resetWarningCache=t,Se=function(){function n(t,r,n,o,i,a){if(a!==e){var l=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 l.name="Invariant Violation",l}}function o(){return n}n.isRequired=n;var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:t};return i.PropTypes=i,i}}function Ge(){if(Ee)return Ae.exports;if(Ee=1,"production"!==process.env.NODE_ENV){var e=Me();Ae.exports=Re()(e.isElement,true)}else Ae.exports=Oe()();return Ae.exports}var Fe=le(Ge()),Ve=function(){return h((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,l=[],s=t.children,A=0;for(r.pattern.lastIndex=0;s&&(o=r.pattern.exec(s));){var c=s.substr(0,o.index);if(A=o.index,++a>i)break;l.push({children:c}),l.push(e.getMatchedPart(r,o[0],o,A)),s=s.substr(o.index+o[0].length),A+=o[0].length-1,r.pattern.lastIndex=0}l.push({children:s}),n.push.apply(n,l)}})),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})}}])}(),De=["type"],Ke=["style"],Be=["parse","childrenProps"],Le={url:/(https?:\/\/|www\.)[-a-zA-Z0-9@:%._\+~#=]{1,256}\.(xn--)?[a-z0-9-]{2,20}\b([-a-zA-Z0-9@:%_\+\[\],.~#?&\/=]*[-a-zA-Z0-9@:%_\+\]~#?&\/=])*/i,phone:/[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,7}/,email:/\S+@\S+\.\S+/},Ue=Fe.shape(g(g({},r.Text.propTypes),{},{type:Fe.oneOf(Object.keys(Le)).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),He=Fe.shape(g(g({},r.Text.propTypes),{},{pattern:Fe.oneOfType([Fe.string,Fe.instanceOf(RegExp)]).isRequired,nonExhaustiveMaxMatchCount:Fe.number})),ze=function(){function n(){return C(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&&M(e,t)}(n,t.Component),h(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,r=y(e,De);if(t){if(!Le[t])throw new Error("".concat(e.type," is not a supported type"));r.pattern=Le[t]}return r}))}},{key:"getParsedText",value:function(){var t=this;return this.props.parse?"string"!=typeof this.props.children?this.props.children:new Ve(this.props.children,this.getPatterns()).parse().map((function(n,o){var i=t.props.style,a=n.style,l=y(n,Ke);return e.jsx(r.Text,g(g({style:[i,a]},t.props.childrenProps),l),"parsedText-".concat(o))})):this.props.children}},{key:"render",value:function(){var t=this,n=g({},this.props);n.parse,n.childrenProps;var o=y(n,Be);return e.jsx(r.Text,g(g({ref:function(e){return t._root=e}},o),{},{children:this.getParsedText()}))}}])}();ze.displayName="ParsedText",ze.propTypes=g(g({},r.Text.propTypes),{},{parse:Fe.arrayOf(Fe.oneOfType([Ue,He])),childrenProps:Fe.shape(r.Text.propTypes)}),ze.defaultProps={parse:null,childrenProps:{}};var We,Ne,Qe,Ye,qe,Je,Xe,$e,Ze,et,tt,rt=function(t){var r=t.style,n=t.color;return e.jsx(o,{style:r,viewBox:"0 0 12 12",children:e.jsx(o.Path,{fill:"none",stroke:n,strokeLinecap:"round",strokeWidth:"2",d:"M4 2v8m4-8v8"})})},nt=function(t){var r=t.style,n=t.color;return e.jsx(o,{viewBox:"0 0 24 24",style:r,children:e.jsxs(o.G,{fill:"none",fillRule:"evenodd",children:[e.jsx(o.Path,{d:"m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z"}),e.jsx(o.Path,{fill:n,d:"M5.669 4.76a1.47 1.47 0 0 1 2.04-1.177c1.062.454 3.442 1.533 6.462 3.276c3.021 1.744 5.146 3.267 6.069 3.958c.788.591.79 1.763.001 2.356c-.914.687-3.013 2.19-6.07 3.956c-3.06 1.766-5.412 2.832-6.464 3.28c-.906.387-1.92-.2-2.038-1.177c-.138-1.142-.396-3.735-.396-7.237c0-3.5.257-6.092.396-7.235"})]})})},ot=t.createContext(void 0),it=function(r){var n=r.children,o=I(t.useState(null),2),i=o[0],a=o[1];return e.jsx(ot.Provider,{value:{currentlyPlayingId:i,setCurrentlyPlayingId:a},children:n})},at=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r<10?"0":"").concat(r)},lt=[1,1.5,2],st=42;function At(t){var o,i,a,l,s,A=t.isPlaying,c=t.playbackRate,u=t.onCycleSpeed,d=t.senderAvatar,C=t.senderName,h=t.isCurrentUser,f=t.theme;return A?e.jsx(r.Pressable,{onPress:u,style:[n(We||(We=_(["rounded-full items-center justify-center"]))),{width:st,height:st,backgroundColor:h?"rgba(0,0,0,0.22)":"rgba(255,255,255,0.12)"},null==f||null===(o=f.messageStyle)||void 0===o?void 0:o.audioSpeedButtonStyle],children:e.jsx(r.Text,{style:J([n(Ne||(Ne=_(["text-xs font-semibold"]))),{color:W(f,h)},null==f||null===(i=f.messageStyle)||void 0===i?void 0:i.audioSpeedTextStyle],null==f?void 0:f.fontFamily),children:1===c?"1x":"".concat(c,"x")})}):d?e.jsx(r.Image,{source:{uri:d},style:[n(Qe||(Qe=_(["rounded-full"]))),{width:st,height:st},null==f||null===(a=f.bubbleStyle)||void 0===a?void 0:a.avatarImageStyle],resizeMode:"cover"}):e.jsx(r.View,{style:[n(Ye||(Ye=_(["rounded-full items-center justify-center"]))),{width:st,height:st,backgroundColor:h?"rgba(0,0,0,0.2)":"#9ca3af"}],children:e.jsx(r.Text,{style:J([n(qe||(qe=_(["text-base font-semibold capitalize"]))),{color:"#ffffff"}],null==f?void 0:f.fontFamily),children:(l=C,s=null==l?void 0:l.trim(),s?s.charAt(0).toUpperCase():"?")})})}var ct,ut,dt,Ct,ht,ft,vt,mt,pt,gt,yt,xt,bt,wt,St,kt=function(o){var i,a,s=o.audioUrl,A=o.audioId,c=o.isVideoPlaying,u=o.isCurrentUser,d=o.senderAvatar,C=o.senderName,h=o.reserveStatusSpace,f=void 0===h||h,v=K(),m=v.theme,p=v.CustomPlayIcon,y=v.CustomPauseIcon,x=v.showMessageStatus,b=function(){var e=t.useContext(ot);if(!e)throw new Error("useAudio must be used within an AudioProvider");return e}(),w=b.currentlyPlayingId,S=b.setCurrentlyPlayingId,k=t.useRef(null),E=I(t.useState(!1),2),j=E[0],M=E[1],P=I(t.useState(0),2),T=P[0],R=P[1],O=I(t.useState(0),2),G=O[0],F=O[1],V=I(t.useState(!1),2),D=V[0],L=V[1],U=I(t.useState(1),2),H=U[0],z=U[1],W=I(t.useState(0),2),N=W[0],Q=W[1],Y=t.useRef(null),q=t.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}))}(s,50)}),[s]),X=function(e,t){var r,n,o,i,a=B(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)"}}(m,u),$=X.inactive,Z=X.active,ee=function(e,t){var r,n,o,i,a=B(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)"}(m,u),te=function(e,t){var r,n,o=B(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"}(m,u),re=function(e,t){var r,n,o=B(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"}(m,u),ne=j&&!(c||!!w&&w!==A),oe=G>0?T/G:0,ie=t.useCallback((function(e){var t;(F(e.duration),null!==Y.current)&&(null===(t=k.current)||void 0===t||t.seek(Y.current),Y.current=null)}),[]),ae=t.useCallback((function(e){var t=e.currentTime;D||R(t)}),[D]),le=t.useCallback((function(){var e;M(!1),R(0),null===(e=k.current)||void 0===e||e.seek(0),S(null)}),[S]),se=t.useCallback((function(){ne?(M(!1),S(null)):(S(A),M(!0))}),[ne,A,S]),Ae=t.useCallback((function(){z((function(e){var t=lt.indexOf(e),r=lt[(t+1)%lt.length];return null!=r?r:1}))}),[]),ce=t.useCallback((function(e){var t=N;if(!(t<=0||G<=0)){var r,n=Math.max(0,Math.min(e/t,1))*G;if(R(n),G>0)null===(r=k.current)||void 0===r||r.seek(n);else Y.current=n}}),[G,N]),ue=t.useMemo((function(){return r.PanResponder.create({onStartShouldSetPanResponder:function(){return!0},onMoveShouldSetPanResponder:function(){return!0},onPanResponderGrant:function(e){L(!0),ce(e.nativeEvent.locationX)},onPanResponderMove:function(e){return ce(e.nativeEvent.locationX)},onPanResponderRelease:function(){return L(!1)},onPanResponderTerminate:function(){return L(!1)}})}),[ce]),de=e.jsx(r.Pressable,{onPress:se,hitSlop:8,style:n(Je||(Je=_(["shrink-0 px-0.5"]))),children:ne?y?e.jsx(y,{}):e.jsx(rt,{style:n.style("h-6 w-6"),color:re}):p?e.jsx(p,{}):e.jsx(nt,{style:n.style("h-6 w-6"),color:te})}),Ce=e.jsx(At,{isPlaying:ne,playbackRate:H,onCycleSpeed:Ae,senderAvatar:d,senderName:C,isCurrentUser:u,theme:m}),he=e.jsx(r.View,{style:[n(Xe||(Xe=_(["flex-1 min-w-0"]))),{height:36}],onLayout:function(e){return Q(e.nativeEvent.layout.width)},children:e.jsx(r.View,g(g({style:[{flex:1,flexDirection:"row",alignItems:"center"},null==m||null===(i=m.messageStyle)||void 0===i?void 0:i.progressBarStyle]},ue.panHandlers),{},{children:q.map((function(t,n){var o,i=(n+.5)/50<=oe;return e.jsx(r.View,{style:[{flex:1,marginHorizontal:.5,height:Math.max(3,Math.round(36*t)),borderRadius:2,backgroundColor:i?Z:$},i?null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.activeProgressBarStyle:void 0]},n)}))}))});return e.jsxs(r.View,{style:[n($e||($e=_(["min-w-[240px] max-w-[280px] py-1.5 px-1"]))),f&&x&&n(Ze||(Ze=_(["pb-4"])))],children:[e.jsx(l,{ref:k,source:{uri:s},paused:!ne,rate:H,playInBackground:!1,playWhenInactive:!1,onLoad:ie,onProgress:ae,onEnd:le,style:{width:0,height:0},progressUpdateInterval:80}),e.jsx(r.View,{style:n(et||(et=_(["flex-row items-center gap-1.5"]))),children:u?e.jsxs(e.Fragment,{children:[Ce,de,he]}):e.jsxs(e.Fragment,{children:[de,he,Ce]})}),e.jsx(r.Text,{style:J([n(tt||(tt=_(["text-[11px] mt-1"]))),{color:ee,paddingLeft:u?82:34},null==m||null===(a=m.messageStyle)||void 0===a?void 0:a.audioDurationStyle],null==m?void 0:m.fontFamily),children:at(ne?T:G>0?G:T)})]})},Et=t.memo(kt),jt=function(t){var o=t.reply,i=t.fontFamily,a=t.replyStyle,l=t.accentColor,s=t.backgroundColor,A=t.senderNameColor,c=t.previewTextColor,u=function(e){switch(e){case"image":return"📷";case"video":return"🎥";case"audio":return"🎤";case"file":return"📎";default:return null}}(o.mediaKind),d=function(e){if(e.preview)return e.preview;switch(e.mediaKind){case"image":return"Photo";case"video":return"Video";case"audio":return"Audio message";case"file":return"File";default:return"Message"}}(o),C=!!o.thumbnailUri;return e.jsxs(r.View,{style:[n(ct||(ct=_(["flex-row mt-1.5 mb-0.5 rounded-md overflow-hidden"]))),{backgroundColor:s,minHeight:44},null==a?void 0:a.container],children:[e.jsx(r.View,{style:[n(ut||(ut=_(["w-[3px] self-stretch"]))),{backgroundColor:l},null==a?void 0:a.replyBar]}),e.jsxs(r.View,{style:n(dt||(dt=_(["flex-1 flex-row items-center pl-2 pr-2 py-1.5"]))),children:[e.jsxs(r.View,{style:n(Ct||(Ct=_(["flex-1"]))),children:[e.jsx(r.Text,{numberOfLines:1,style:J([n(ht||(ht=_(["text-[13px] font-semibold"]))),{color:A},null==a?void 0:a.senderName],i),children:o.senderName||"Reply"}),e.jsx(r.Text,{numberOfLines:2,style:J([n(ft||(ft=_(["text-[12.5px] mt-0.5"]))),{color:c},null==a?void 0:a.previewText],i),children:u&&!o.preview?"".concat(u," ").concat(d):d})]}),C&&e.jsx(r.Image,{source:{uri:o.thumbnailUri},style:[n(vt||(vt=_(["ml-2"]))),{width:36,height:36,borderRadius:4},null==a?void 0:a.thumbnail],resizeMode:"cover"})]})]})},Mt=function(n){var i=n.style,a=n.spinning,l=void 0!==a&&a,s=t.useRef(new r.Animated.Value(0)).current;t.useEffect((function(){l&&r.Animated.loop(r.Animated.timing(s,{toValue:1,duration:1e3,easing:r.Easing.linear,useNativeDriver:!0})).start()}),[l]);var A=s.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return e.jsx(r.Animated.View,{style:l?{transform:[{rotate:A}]}: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"})})})},It=320,_t=It,Pt=Math.round(176),Tt=It-Pt-2,Rt=Math.round(159),Ot=function(o){var i,a=o.uri,s=o.cellStyle,A=o.roundedStyle,c=K(),u=c.theme,d=c.CustomPlayIcon,C=t.useRef(null),h=I(t.useState(0),2),f=h[0],v=h[1],m=I(t.useState(!0),2),p=m[0],g=m[1],y=I(t.useState(!1),2),x=y[0],b=y[1];return e.jsxs(r.View,{style:[s,A],pointerEvents:"none",children:[e.jsx(l,{source:{uri:a},ref:C,paused:!0,muted:!0,playInBackground:!1,playWhenInactive:!1,pointerEvents:"none",style:[A,{width:"100%",height:"100%"}],resizeMode:"cover",onLoadStart:function(){g(!0),b(!1)},onLoad:function(e){v(e.duration),g(!1)},onError:function(){b(!0),g(!1)}}),p&&e.jsx(r.View,{style:[n(mt||(mt=_(["absolute inset-0 items-center justify-center bg-black/40"]))),A],children:e.jsx(Mt,{style:n.style("h-8 w-8"),spinning:!0})}),!p&&!x&&e.jsxs(e.Fragment,{children:[e.jsx(r.View,{style:n(pt||(pt=_(["pointer-events-none absolute inset-0 items-center justify-center"]))),children:d?e.jsx(d,{}):e.jsx(nt,{style:n.style("h-10 w-10"),color:(null==u||null===(i=u.colors)||void 0===i?void 0:i.videoPlayIconColor)||"white"})}),e.jsx(r.View,{style:n(gt||(gt=_(["pointer-events-none absolute bottom-1 left-1 bg-black/50 px-1.5 py-0.5 rounded"]))),children:e.jsx(r.Text,{style:n(yt||(yt=_(["text-white text-[10px] font-semibold"]))),children:Gt(f)})})]}),x&&e.jsx(r.View,{style:[n(xt||(xt=_(["absolute inset-0 items-center justify-center bg-red-500/50"]))),A],children:e.jsx(r.Text,{style:J(n(bt||(bt=_(["text-white text-xs"]))),null==u?void 0:u.fontFamily),children:"Video"})})]})};function Gt(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 Ft,Vt,Dt,Kt,Bt,Lt,Ut,Ht,zt,Wt,Nt,Qt,Yt,qt,Jt,Xt,$t,Zt,er,tr,rr,nr,or,ir,ar,lr,sr=function(t){var o=t.items,i=t.onOpenGallery,a=r.useWindowDimensions().width,l=Math.min(240,.72*a);if(0===o.length)return null;var s={borderRadius:6,overflow:"hidden"};if(1===o.length){var A=o[0];return e.jsx(r.Pressable,{onPress:function(){return i(o,0)},style:{width:l,height:320,marginVertical:8},children:"image"===A.kind?e.jsx(r.Image,{source:{uri:A.uri},style:{width:"100%",height:"100%",borderRadius:8},resizeMode:"cover"}):e.jsx(Ot,{uri:A.uri,cellStyle:{width:l,height:320},roundedStyle:{borderRadius:8}})})}if(2===o.length){var c=(l-2)/2;return e.jsx(r.View,{style:{width:l,height:_t,flexDirection:"row",gap:2,marginVertical:8},children:o.slice(0,2).map((function(t,n){return e.jsx(r.Pressable,{onPress:function(){return i(o,n)},style:{width:c,height:_t},children:"image"===t.kind?e.jsx(r.Image,{source:{uri:t.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Ot,{uri:t.uri,cellStyle:{width:c,height:_t},roundedStyle:s})},"".concat(t.uri,"-").concat(n))}))})}if(3===o.length){var u=o[0],d=o[1],C=o[2],h=(l-2)/2;return e.jsxs(r.View,{style:{width:l,height:It,marginVertical:8,gap:2},children:[e.jsx(r.Pressable,{onPress:function(){return i(o,0)},style:{width:l,height:Pt},children:"image"===u.kind?e.jsx(r.Image,{source:{uri:u.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Ot,{uri:u.uri,cellStyle:{width:l,height:Pt},roundedStyle:s})}),e.jsxs(r.View,{style:{flexDirection:"row",gap:2,height:Tt},children:[e.jsx(r.Pressable,{onPress:function(){return i(o,1)},style:{width:h,height:Tt},children:"image"===d.kind?e.jsx(r.Image,{source:{uri:d.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Ot,{uri:d.uri,cellStyle:{width:h,height:Tt},roundedStyle:s})},"".concat(d.uri,"-1")),e.jsx(r.Pressable,{onPress:function(){return i(o,2)},style:{width:h,height:Tt},children:"image"===C.kind?e.jsx(r.Image,{source:{uri:C.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Ot,{uri:C.uri,cellStyle:{width:h,height:Tt},roundedStyle:s})},"".concat(C.uri,"-2"))]})]})}var f=(l-2)/2,v=o.length-4,m=o.slice(0,4);return e.jsx(r.View,{style:{width:l,height:It,flexWrap:"wrap",flexDirection:"row",gap:2,marginVertical:8},children:m.map((function(t,a){return e.jsxs(r.Pressable,{onPress:function(){return i(o,a)},style:{width:f,height:Rt,position:"relative"},children:["image"===t.kind?e.jsx(r.Image,{source:{uri:t.uri},style:[s,{width:"100%",height:"100%"}],resizeMode:"cover"}):e.jsx(Ot,{uri:t.uri,cellStyle:{width:f,height:Rt},roundedStyle:s}),3===a&&v>0&&e.jsx(r.View,{style:n(wt||(wt=_(["absolute inset-0 bg-black/55 items-center justify-center"]))),children:e.jsxs(r.Text,{style:n(St||(St=_(["text-white text-lg font-bold"]))),children:["+",v]})})]},"".concat(t.uri,"-").concat(a))}))})},Ar=function(o){var i,a,l,s,A=o.message,c=o.onGalleryOpen,u=o.isVideoPlaying,d=o.isCurrentUser,C=K(),h=C.theme,f=C.showMessageStatus,v=C.onFileAttachmentPress,m=C.replyStyle,p=C.renderInlineReply,y=t.useMemo((function(){return Y(A)}),[A]),x=function(t,r,n,o){if(!A.replyTo)return null;if(p)return p(A.replyTo,d);var i=d?(null==h||null===(t=h.colors)||void 0===t?void 0:t.sentMessageTailColor)||"#a7f3d0":(null==h||null===(r=h.colors)||void 0===r?void 0:r.receivedMessageTailColor)||"#22c55e",a=d?"rgba(255,255,255,0.18)":"rgba(0,0,0,0.06)",l=i,s=d?(null==h||null===(n=h.colors)||void 0===n?void 0:n.sentMessageTextColor)||"rgba(255,255,255,0.9)":(null==h||null===(o=h.colors)||void 0===o?void 0:o.receivedMessageTextColor)||"rgba(0,0,0,0.7)";return e.jsx(jt,{reply:A.replyTo,isCurrentUser:d,fontFamily:null==h?void 0:h.fontFamily,replyStyle:m,accentColor:i,backgroundColor:a,senderNameColor:l,previewTextColor:s})}();return e.jsxs(r.View,{children:[x,y.length>0&&e.jsx(sr,{items:y,onOpenGallery:c}),(null!==(i=A.fileAttachments)&&void 0!==i?i:[]).map((function(t,o){var i,a,l,s,A,c;return e.jsxs(r.Pressable,{onPress:function(){v?v(t):r.Linking.openURL(t.uri.startsWith("http")||t.uri.startsWith("file:")?t.uri:"file://".concat(t.uri))},style:[n(Ft||(Ft=_(["my-1.5 py-2 px-3 rounded-lg max-w-[220px]"]))),{backgroundColor:U(h,d)},d?null==h||null===(i=h.messageStyle)||void 0===i?void 0:i.sentFileAttachmentStyle:null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.receivedFileAttachmentStyle],children:[e.jsxs(r.Text,{style:J([n(Vt||(Vt=_(["text-xs font-semibold"]))),{color:H(h,d)},d?null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.sentFileAttachmentTextStyle:null==h||null===(s=h.messageStyle)||void 0===s?void 0:s.receivedFileAttachmentTextStyle],null==h?void 0:h.fontFamily),numberOfLines:2,children:["📎 ",t.name]}),e.jsx(r.Text,{style:J([n(Dt||(Dt=_(["text-[10px] mt-0.5"]))),{color:z(h,d)},d?null==h||null===(A=h.messageStyle)||void 0===A?void 0:A.sentFileAttachmentSubtitleStyle:null==h||null===(c=h.messageStyle)||void 0===c?void 0:c.receivedFileAttachmentSubtitleStyle],null==h?void 0:h.fontFamily),children:t.type})]},"".concat(t.uri,"-").concat(o))})),A.audio&&e.jsx(Et,{audioUrl:A.audio,audioId:A.id,isVideoPlaying:u,isCurrentUser:d,senderAvatar:A.senderAvatar,senderName:A.senderName,reserveStatusSpace:!A.text}),A.text&&e.jsx(ze,{style:J([n(Kt||(Kt=_(["pt-1"]))),n(f?Bt||(Bt=_(["pb-0"])):Lt||(Lt=_(["pb-2"]))),{wordBreak:"break-word",overflowWrap:"break-word"},d?null==h||null===(a=h.messageStyle)||void 0===a?void 0:a.sentTextStyle:null==h||null===(l=h.messageStyle)||void 0===l?void 0:l.receivedTextStyle,N(h,d)?{color:N(h,d)}:void 0],null==h?void 0:h.fontFamily),parse:[{type:"url",style:g({color:"blue",textDecorationLine:"underline"},(s=null==h?void 0:h.fontFamily,s?{fontFamily:s}:void 0)),onPress:function(e){return r.Linking.openURL(e.startsWith("http")?e:"https://".concat(e))}}],childrenProps:{allowFontScaling:!1},children:A.text})]})},cr=t.memo(Ar),ur=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"})})},dr=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})})},Cr=function(t){var o,i,a,l,s=t.time,A=t.status,c=t.isCurrentUser,u=t.hasText,d=t.hasAudio,C=t.hasGalleryMedia,h=t.hasFileAttachments,f=t.edited,v=K(),m=v.theme,p=v.showMessageStatus,g=v.editedLabel,y=v.editedTextStyle,x=C&&!u&&!d,b=(C||h)&&!u&&!d,w=x?"#ffffff":b?function(e,t){var r,n,o=B(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)"}(m,c):function(e,t){var r,n,o=B(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)"}(m,c),S=x||b?"rgba(255,255,255,0.85)":w;return e.jsx(e.Fragment,{children:p&&e.jsxs(r.View,{style:[n(Ut||(Ut=_(["flex-row items-center"]))),u?n(Ht||(Ht=_(["justify-end pb-1 ml-4"]))):d?n(zt||(zt=_(["absolute right-3 bottom-2"]))):b?[n(Wt||(Wt=_(["absolute right-3 bottom-4"]))),L(m,c)]:[n(Nt||(Nt=_(["absolute right-3 bottom-4"]))),L(m,c)]],children:[f&&e.jsx(r.Text,{style:J([n(Qt||(Qt=_(["text-[11px] mr-1.5"]))),{fontStyle:"italic",color:S,opacity:.85},null==m||null===(o=m.messageStyle)||void 0===o?void 0:o.editedTextStyle,y],null==m?void 0:m.fontFamily),children:null!=g?g:"edited"}),e.jsx(r.Text,{style:J([n(Yt||(Yt=_(["text-xs"]))),{color:w}],null==m?void 0:m.fontFamily),children:s}),c&&e.jsxs(r.View,{style:n(qt||(qt=_(["ml-1 flex-row items-center"]))),children:["sent"===A&&e.jsx(dr,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==m||null===(i=m.colors)||void 0===i?void 0:i.sentIconColor)||"#6B7280"}),"delivered"===A&&e.jsx(ur,{style:n.style("h-4 w-4",{opacity:.7}),fill:(null==m||null===(a=m.colors)||void 0===a?void 0:a.deliveredIconColor)||"#6B7280"}),"read"===A&&e.jsx(ur,{style:n.style("h-4 w-4",{opacity:.9}),fill:(null==m||null===(l=m.colors)||void 0===l?void 0:l.readIconColor)||"#3B82F6"})]})]})})},hr=t.memo(Cr),fr=function(o){var i,a,l,s,A,c,u,d,C,h,f,v,m,p,y=o.message,x=o.isCurrentUser,b=o.isFirstInSequence,w=o.onLongPress,S=K(),k=S.theme,E=S.showAvatars,j=S.showUserNames,M=S.showBubbleTail,I=S.setMediaViewerGallery,P=S.isVideoPlaying,T=S.replyProps,R=S.startReply,O=S.selectionMode,F=S.isSelected,V=S.toggleSelection,D=S.selectionUI,B=t.useRef(null),L=(null===(i=null==T?void 0:T.enableReply)||void 0===i||i)&&!O,U=null!==(a=null==T?void 0:T.swipeThreshold)&&void 0!==a?a:60,H=Y(y),z=(null!==(l=null===(s=y.fileAttachments)||void 0===s?void 0:s.length)&&void 0!==l?l:0)>0&&0===H.length&&!y.text&&!y.audio,W=F(y.id),N=null==D?void 0:D.overlayColor,q=null==D?void 0:D.rowBackgroundColor,X=(null==k||null===(A=k.colors)||void 0===A?void 0:A.sentBubbleBackgroundColor)||(null==k||null===(c=k.colors)||void 0===c?void 0:c.sentMessageTailColor)||"#22c55e",$=N||vr(X,.28),Z=q||vr(X,.12),ee=e.jsxs(r.Pressable,{ref:B,onLongPress:function(){var e;O?V(y):null===(e=B.current)||void 0===e||e.measureInWindow((function(e,t,r,n){null==w||w({x:e,y:t,width:r,height:n,isCurrentUser:x})}))},onPress:function(){O&&V(y)},delayLongPress:250,style:[n(Jt||(Jt=_(["px-2 my-1 max-w-[75%] relative"]))),n(x?Xt||(Xt=_(["self-end mr-3"])):$t||($t=_(["self-start ml-9"]))),n(b?x?Zt||(Zt=_(["bg-green-500 rounded-tr-none"])):er||(er=_(["bg-white rounded-tl-none"])):x?tr||(tr=_(["bg-green-500"])):rr||(rr=_(["bg-white"]))),g(g({borderRadius:8},Q(k,x)?{backgroundColor:Q(k,x)}:{}),x?null==k||null===(u=k.bubbleStyle)||void 0===u?void 0:u.sent:null==k||null===(d=k.bubbleStyle)||void 0===d?void 0:d.received)],children:[!x&&b&&E&&e.jsxs(e.Fragment,{children:[e.jsx(r.View,{style:n(nr||(nr=_(["absolute w-6 h-6 rounded-full top-0 -left-9 flex-row items-center"]))),children:y.senderAvatar?e.jsx(r.Image,{source:{uri:y.senderAvatar},style:[n(or||(or=_(["w-full h-full rounded-full"]))),null==k||null===(C=k.bubbleStyle)||void 0===C?void 0:C.avatarImageStyle],resizeMode:"cover"}):e.jsx(r.Text,{style:J([n(ir||(ir=_(["text-sm text-black font-semibold capitalize rounded-full bg-zinc-300 w-full h-full text-center pt-0.5"]))),null==k||null===(h=k.bubbleStyle)||void 0===h?void 0:h.avatarTextStyle],null==k?void 0:k.fontFamily),children:null===(f=y.senderName)||void 0===f?void 0:f.charAt(0)})}),j&&y.senderName&&e.jsx(r.Text,{style:J([n(ar||(ar=_(["text-sm text-black font-semibold mt-1 capitalize"]))),null==k||null===(v=k.bubbleStyle)||void 0===v?void 0:v.userNameStyle],null==k?void 0:k.fontFamily),children:y.senderName})]}),b&&M&&e.jsx(G,{style:n.style("absolute w-6 h-6",x?"rotate-90 -right-3.5 mt-[1.24px] -top-1":"rotate-180 -left-3.5 mt-[1.5px] -top-[3px]"),color:x?(null==k||null===(m=k.colors)||void 0===m?void 0:m.sentMessageTailColor)||"rgba(34, 197, 94, 1)":(null==k||null===(p=k.colors)||void 0===p?void 0:p.receivedMessageTailColor)||"white"}),e.jsx(cr,{message:y,isCurrentUser:x,isFirstInSequence:b,onGalleryOpen:function(e,t){O?V(y):I(e,t)},isVideoPlaying:P}),e.jsx(hr,{time:y.time,edited:y.edited,status:x?y.status:void 0,isCurrentUser:x,hasText:!!y.text,hasAudio:!!y.audio,hasGalleryMedia:H.length>0&&!y.text,hasFileAttachments:z}),O&&W&&e.jsx(r.View,{pointerEvents:"none",style:[n(lr||(lr=_(["absolute inset-0"]))),{backgroundColor:$,borderRadius:8}]})]}),te=e.jsx(ae,{isCurrentUser:x,enabled:L,swipeThreshold:U,onReply:function(){return R(y)},children:ee});return O&&W?e.jsx(r.View,{style:{backgroundColor:Z},children:te}):te};function vr(e,t){if(e.startsWith("#")){var r=e.slice(1);if(3===r.length&&(r=r.split("").map((function(e){return e+e})).join("")),6===r.length){var n=parseInt(r.slice(0,2),16),o=parseInt(r.slice(2,4),16),i=parseInt(r.slice(4,6),16);return"rgba(".concat(n,", ").concat(o,", ").concat(i,", ").concat(t,")")}}return e.startsWith("rgb(")?e.replace("rgb(","rgba(").replace(")",", ".concat(t,")")):e}var mr,pr,gr,yr,xr,br,wr,Sr=t.memo(fr),kr=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"})]})})},Er=function(t){var r=t.style,n=t.color,i=void 0===n?"#FFFFFF":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:i,d:"M5 19h1.4l8.625-8.625l-1.4-1.4L5 17.6zm-1 2q-.425 0-.712-.288T3 20v-2.825q0-.4.15-.762t.425-.638l10.3-10.3l4.25 4.275l-10.3 10.3q-.275.275-.638.425t-.762.15zM18.025 9.75l-4.25-4.25l1.4-1.4q.575-.575 1.413-.575t1.412.575l1.425 1.425q.575.575.575 1.413t-.575 1.412z"})})},jr=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"})]})})},Mr=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"})]})})},Ir=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"})})},_r=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"})]})})};function Pr(){return Tr.apply(this,arguments)}function Tr(){return(Tr=u(O().mark((function e(){var t;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("android"!==r.Platform.OS){e.next=11;break}return e.prev=1,e.next=4,r.PermissionsAndroid.request(r.PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,{title:"Microphone Permission",message:"This app needs access to your microphone to record audio.",buttonPositive:"OK"});case 4:return t=e.sent,e.abrupt("return",t===r.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 Rr,Or,Gr,Fr,Vr,Dr,Kr,Br,Lr,Ur,Hr,zr,Wr,Nr,Qr,Yr,qr,Jr,Xr,$r,Zr,en=function(t){var i=t.message,a=t.onCancel,l=t.previewMaxLines,s=void 0===l?1:l,A=t.replyStyle,c=t.fontFamily,u=t.accentColor,d=void 0===u?"#22c55e":u,C=t.closeIconColor,h=void 0===C?"rgba(0,0,0,0.5)":C,f=t.backgroundColor,v=void 0===f?"#FFFFFF":f,m=t.senderNameColor,p=t.previewTextColor,g=i.senderName||"You",y=function(e){var t,r,n,o,i,a,l=null===(t=e.mediaItems)||void 0===t?void 0:t[0];return e.text?{text:e.text,thumbnail:null!==(n=e.image)&&void 0!==n?n:"image"===(null==l?void 0:l.kind)||"video"===(null==l?void 0:l.kind)?l.uri:void 0}:e.audio?{text:"🎤 Audio message"}:e.video?{text:"🎥 Video",thumbnail:e.video}:"video"===(null==l?void 0:l.kind)?{text:"🎥 Video",thumbnail:l.uri}:e.image||"image"===(null==l?void 0:l.kind)?{text:"📷 Photo",thumbnail:null!==(o=e.image)&&void 0!==o?o:null==l?void 0:l.uri}:(null!==(r=e.fileAttachments)&&void 0!==r?r:[]).length?{text:"📎 ".concat(null!==(i=null===(a=e.fileAttachments)||void 0===a||null===(a=a[0])||void 0===a?void 0:a.name)&&void 0!==i?i:"File")}:{text:"Message"}}(i),x=y.text,b=y.thumbnail;return e.jsxs(r.View,{style:[n(mr||(mr=_(["flex-row items-stretch mx-2 mb-1 rounded-xl overflow-hidden"]))),{backgroundColor:v,minHeight:56,shadowColor:"#000",shadowOpacity:.06,shadowRadius:4,shadowOffset:{width:0,height:1},elevation:1},null==A?void 0:A.container],children:[e.jsx(r.View,{style:[n(pr||(pr=_(["w-[3px] self-stretch"]))),{backgroundColor:d},null==A?void 0:A.replyBar]}),e.jsxs(r.View,{style:n(gr||(gr=_(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsxs(r.View,{style:n(yr||(yr=_(["flex-1 mr-2"]))),children:[e.jsx(r.Text,{numberOfLines:1,style:J([n(xr||(xr=_(["text-[14px] font-semibold"]))),{color:null!=m?m:d},null==A?void 0:A.senderName],c),children:g}),e.jsx(r.Text,{numberOfLines:s,style:J([n(br||(br=_(["text-[13px] mt-0.5"]))),{color:null!=p?p:"rgba(0,0,0,0.55)"},null==A?void 0:A.previewText],c),children:x})]}),b&&e.jsx(r.Image,{source:{uri:b},style:[{width:36,height:36,borderRadius:4,marginRight:6},null==A?void 0:A.thumbnail],resizeMode:"cover"}),e.jsx(r.Pressable,{onPress:a,hitSlop:10,style:n(wr||(wr=_(["w-7 h-7 items-center justify-center"]))),children:e.jsxs(o,{width:14,height:14,viewBox:"0 0 24 24",children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:h,strokeWidth:2.5,strokeLinecap:"round"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:h,strokeWidth:2.5,strokeLinecap:"round"})]})})]})]})},tn="ios"===r.Platform.OS?50:48,rn="#FFFFFF",nn="#E9EDEF",on=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"})})},an=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",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M2 16c0-2.828 0-4.243.879-5.121C3.757 10 5.172 10 8 10h8c2.828 0 4.243 0 5.121.879C22 11.757 22 13.172 22 16s0 4.243-.879 5.121C20.243 22 18.828 22 16 22H8c-2.828 0-4.243 0-5.121-.879C2 20.243 2 18.828 2 16Z"}),e.jsx(o.Path,{strokeLinecap:"round",d:"M6 10V8a6 6 0 1 1 12 0v2",opacity:".5"})]})})},ln=function(t){var r=t.width,o=t.bottomOffset,i=t.background,l=t.lockColor,s=t.chevronColor,A=t.lockIconSize,c=t.pillAnimatedStyle,u=t.chevronAnimatedStyle,d=t.styleOverride,C=t.renderLockIcon;return e.jsxs(a.View,{style:[n(Rr||(Rr=_(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:r,backgroundColor:i,bottom:o,gap:6},d,c],pointerEvents:"none",children:[C?C():e.jsx(an,{style:{width:A,height:A},color:l}),e.jsx(a.View,{style:u,children:e.jsx(on,{style:{width:14,height:14},color:s})})]})},sn=function(t){var o=t.isHold,l=t.duration,s=t.composedGesture,A=t.micWrapperStyle,c=t.slideTextAnimatedStyle,u=t.lockPillAnimatedStyle,d=t.chevronAnimatedStyle,C=t.primaryColor,h=t.microphoneColor,f=t.timerColor,v=t.cancelTextColor,m=t.holdPillBackground,p=t.lockPillBackground,g=t.lockColor,y=t.chevronColor,x=t.iconSize,b=t.lockIconSize,w=t.inputBarHeight,S=t.micSize,k=t.enableLockRecording,E=t.showSendButton,j=t.onSendPress,M=t.sendButtonBackgroundColor,I=t.sendButtonIconColor,P=t.renderInputPill,T=t.renderMicIcon,R=t.renderSendIcon,O=t.renderArrowIcon,G=t.renderLockIcon,F=t.containerStyleOverride,V=t.timerTextStyle,D=t.slideTextStyleOverride,K=t.lockPillStyleOverride,B=t.sendButtonStyle,L=t.fontFamily,U={minHeight:w,backgroundColor:m},H={height:S,width:S,backgroundColor:C};return e.jsxs(r.View,{style:[n(Or||(Or=_(["flex-row items-end gap-2 relative"]))),F],pointerEvents:"box-none",children:[o?e.jsxs(r.View,{style:[n(Gr||(Gr=_(["flex-1 flex-row items-center px-4 rounded-3xl"]))),U],children:[e.jsx(r.Text,{style:J([n(Fr||(Fr=_(["text-base font-semibold"]))),{color:f,minWidth:42},V],L),numberOfLines:1,children:at(l)}),e.jsxs(a.View,{style:[n(Vr||(Vr=_(["flex-1 flex-row items-center justify-center gap-1.5"]))),c],children:[O?O():e.jsx(r.Text,{style:J([n(Dr||(Dr=_(["text-base leading-none"]))),{color:v,marginTop:-2}],L),children:"‹"}),e.jsx(r.Text,{style:J([n(Kr||(Kr=_(["text-sm"]))),{color:v},D],L),children:"Slide to cancel"})]})]}):null==P?void 0:P(),e.jsxs(r.View,{style:[n(Br||(Br=_(["relative items-center justify-center"]))),{height:w,width:w}],children:[k&&o&&e.jsx(ln,{width:S-8,bottomOffset:S+6,background:p,lockColor:g,chevronColor:y,lockIconSize:b,pillAnimatedStyle:u,chevronAnimatedStyle:d,styleOverride:K,renderLockIcon:G}),E&&!o?e.jsx(r.Pressable,{onPress:j,style:[n(Lr||(Lr=_(["items-center justify-center rounded-full"]))),{height:S,width:S,backgroundColor:null!=M?M:C},B],accessibilityRole:"button",accessibilityLabel:"Send",children:R?R():e.jsx(_r,{style:{width:x,height:x},color:null!=I?I:h})}):e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(a.View,{style:[n(Ur||(Ur=_(["items-center justify-center rounded-full"]))),H,B,A],accessibilityRole:"button",accessibilityLabel:"Tap to record. Long-press and slide left to cancel or up to lock.",children:T?T():e.jsx(Mr,{style:{width:x+6,height:x+6},color:h})})})]})]})},An=function(t){var r=t.style,n=t.color,i=void 0===n?"#ef4444":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsxs(o.G,{fill:"none",stroke:i,strokeLinecap:"round",strokeWidth:"1.5",children:[e.jsx(o.Path,{d:"M9.17 4a3.001 3.001 0 0 1 5.66 0",opacity:".5"}),e.jsx(o.Path,{d:"M20.5 6h-17m15.333 2.5l-.46 6.9c-.177 2.654-.265 3.981-1.13 4.79s-2.195.81-4.856.81h-.774c-2.66 0-3.99 0-4.856-.81c-.865-.809-.953-2.136-1.13-4.79l-.46-6.9"}),e.jsx(o.Path,{d:"m9.5 11l.5 5m4.5-5l-.5 5",opacity:".5"})]})})},cn=function(t){var o=t.color,i=t.tick,a=t.count;return e.jsx(r.View,{style:n(Hr||(Hr=_(["flex-row items-center justify-between h-6"]))),children:Array.from({length:a}).map((function(t,r){return e.jsx(dn,{index:r,total:a,color:o,tick:i},r)}))})},un={code:'function WaveformTsx1(){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.18,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/Waveform.tsx",sourceMap:'{"version":3,"names":["WaveformTsx1","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/Waveform.tsx"],"mappings":"AAQ2C,SAAAA,YAAMA,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"},dn=function(t){var r,o,i=t.index,l=t.total,s=t.color,A=t.tick,c=a.useAnimatedStyle((r=[new global.Error,-4,-27],(o=function(){var e=A.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,r=Math.sin(i/Math.max(1,l-1)*Math.PI),n=Math.max(.18,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:A,index:i,total:l},o.__workletHash=4276075972187,o.__initData=un,o.__stackDetails=r,o));return e.jsx(a.View,{style:[n(zr||(zr=_(["mx-px rounded-full"]))),{width:2,backgroundColor:s},c]})},Cn=function(t){var o=t.duration,l=t.isPaused,s=t.composedGesture,A=t.micWrapperStyle,c=t.pausePulseStyle,u=t.recDotStyle,d=t.waveTick,C=t.onCancelPress,h=t.onTogglePause,f=t.backgroundColor,v=t.timerColor,m=t.waveformColor,p=t.deleteIconColor,g=t.pauseIconColor,y=t.primaryColor,x=t.micSize,b=t.iconSize,w=t.inputBarHeight,S=t.waveCount,k=t.enableWaveform,E=t.renderDeleteIcon,j=t.renderPauseIcon,M=t.renderPlayIcon,I=t.renderSendIcon,P=t.renderWaveform,T=t.containerStyleOverride,R=t.barStyleOverride,O=t.timerTextStyle,G=t.waveformStyle,F=t.trashButtonStyle,V=t.sendButtonStyle,D=t.fontFamily,K={minHeight:w+50,backgroundColor:f},B={height:x,width:x,backgroundColor:y};return e.jsxs(r.View,{style:[n(Wr||(Wr=_(["w-full rounded-2xl px-4 py-2.5"]))),K,T,R],children:[e.jsxs(r.View,{style:n(Nr||(Nr=_(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(a.View,{style:[n(Qr||(Qr=_(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:g},u]}),e.jsx(r.Text,{style:J([n(Yr||(Yr=_(["text-base font-semibold"]))),{color:v,minWidth:42},O],D),numberOfLines:1,children:at(o)}),k&&e.jsx(r.View,{style:[n(qr||(qr=_(["flex-1"]))),G],children:P?P():e.jsx(cn,{color:m,tick:d,count:S})})]}),e.jsxs(r.View,{style:n(Jr||(Jr=_(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(r.Pressable,{onPress:C,hitSlop:12,style:[n(Xr||(Xr=_(["items-center justify-center rounded-full"]))),{width:x,height:x},F],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:E?E():e.jsx(An,{style:n.style("w-6 h-6"),color:p})}),e.jsx(r.Pressable,{onPress:h,hitSlop:12,style:n($r||($r=_(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:l?"Resume recording":"Pause recording",children:l?M?M():e.jsx(nt,{style:n.style("w-7 h-7"),color:g}):e.jsx(a.View,{style:c,children:j?j():e.jsx(rt,{style:n.style("w-7 h-7"),color:g})})}),e.jsx(i.GestureDetector,{gesture:s,children:e.jsx(a.View,{style:[n(Zr||(Zr=_(["items-center justify-center rounded-full"]))),B,V,A],accessibilityRole:"button",accessibilityLabel:"Send recording",children:I?I():e.jsx(_r,{style:{width:b,height:b},color:"#FFFFFF"})})})]})]})};function hn(){r.Vibration.vibrate(15)}var fn={code:"function useFlowControllerTs1(_e,success){const{runOnJS,fireQuickTap}=this.__closure;if(success)runOnJS(fireQuickTap)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs1","_e","success","runOnJS","fireQuickTap","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA0OmB,QAAC,CAAAA,oBAAgBA,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"},vn={code:"function useFlowControllerTs2(){const{runOnJS,fireHoldStart}=this.__closure;runOnJS(fireHoldStart)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs2","runOnJS","fireHoldStart","__closure"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAiPqB,SAAAA,oBAAMA,CAAA,QAAAC,OAAA,CAAAC,aAAA,OAAAC,SAAA,CAEfF,OAAO,CAACC,aAAa,CAAC,CAAC,CAAC,CAC5B","ignoreList":[]}',version:"3.16.7"},mn={code:"function useFlowControllerTs3(e){const{stateShared,STATE_HOLD,maxLeftShared,maxUpShared,translateX,translateY,enableLockShared,lockFiredShared,lockThresholdShared,runOnJS,fireLock,enableCancelShared,cancelFiredShared,cancelThresholdShared,fireCancel}=this.__closure;if(stateShared.value!==STATE_HOLD)return;const rawTx=Math.max(maxLeftShared.value,Math.min(0,e.translationX));const rawTy=Math.max(maxUpShared.value,Math.min(0,e.translationY));const dominantY=Math.abs(rawTy)>Math.abs(rawTx);translateX.value=dominantY?0:rawTx;translateY.value=dominantY?rawTy:0;if(dominantY&&enableLockShared.value===1&&lockFiredShared.value===0&&rawTy<=lockThresholdShared.value){lockFiredShared.value=1;runOnJS(fireLock)();}if(!dominantY&&enableCancelShared.value===1&&cancelFiredShared.value===0&&rawTx<=cancelThresholdShared.value){cancelFiredShared.value=1;runOnJS(fireCancel)();}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs3","e","stateShared","STATE_HOLD","maxLeftShared","maxUpShared","translateX","translateY","enableLockShared","lockFiredShared","lockThresholdShared","runOnJS","fireLock","enableCancelShared","cancelFiredShared","cancelThresholdShared","fireCancel","__closure","value","rawTx","Math","max","min","translationX","rawTy","translationY","dominantY","abs"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqPuB,QAAC,CAAAA,oBAAKA,CAAAC,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,aAAA,CAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,gBAAA,CAAAC,eAAA,CAAAC,mBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,kBAAA,CAAAC,iBAAA,CAAAC,qBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,GAAIf,WAAW,CAACgB,KAAK,GAAKf,UAAU,CAChC,OACJ,KAAM,CAAAgB,KAAK,CAAGC,IAAI,CAACC,GAAG,CAACjB,aAAa,CAACc,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACsB,YAAY,CAAC,CAAC,CACxE,KAAM,CAAAC,KAAK,CAAGJ,IAAI,CAACC,GAAG,CAAChB,WAAW,CAACa,KAAK,CAAEE,IAAI,CAACE,GAAG,CAAC,CAAC,CAAErB,CAAC,CAACwB,YAAY,CAAC,CAAC,CACtE,KAAM,CAAAC,SAAS,CAAGN,IAAI,CAACO,GAAG,CAACH,KAAK,CAAC,CAAGJ,IAAI,CAACO,GAAG,CAACR,KAAK,CAAC,CAGnDb,UAAU,CAACY,KAAK,CAAGQ,SAAS,CAAG,CAAC,CAAGP,KAAK,CACxCZ,UAAU,CAACW,KAAK,CAAGQ,SAAS,CAAGF,KAAK,CAAG,CAAC,CACxC,GAAIE,SAAS,EACTlB,gBAAgB,CAACU,KAAK,GAAK,CAAC,EAC5BT,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BM,KAAK,EAAId,mBAAmB,CAACQ,KAAK,CAAE,CACpCT,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBP,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACvB,CACA,GAAI,CAACc,SAAS,EACVb,kBAAkB,CAACK,KAAK,GAAK,CAAC,EAC9BJ,iBAAiB,CAACI,KAAK,GAAK,CAAC,EAC7BC,KAAK,EAAIJ,qBAAqB,CAACG,KAAK,CAAE,CACtCJ,iBAAiB,CAACI,KAAK,CAAG,CAAC,CAC3BP,OAAO,CAACK,UAAU,CAAC,CAAC,CAAC,CACzB,CACJ","ignoreList":[]}',version:"3.16.7"},pn={code:"function useFlowControllerTs4(){const{lockFiredShared,cancelFiredShared,enableLockShared,translateY,LOCK_ON_RELEASE_DELTA,runOnJS,fireLock,fireHoldEnd}=this.__closure;if(lockFiredShared.value===1||cancelFiredShared.value===1)return;if(enableLockShared.value===1&&translateY.value<-LOCK_ON_RELEASE_DELTA){lockFiredShared.value=1;runOnJS(fireLock)();return;}runOnJS(fireHoldEnd)();}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs4","lockFiredShared","cancelFiredShared","enableLockShared","translateY","LOCK_ON_RELEASE_DELTA","runOnJS","fireLock","fireHoldEnd","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+QmB,SAAAA,oBAAMA,CAAA,QAAAC,eAAA,CAAAC,iBAAA,CAAAC,gBAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,OAAAC,SAAA,CAEb,GAAIR,eAAe,CAACS,KAAK,GAAK,CAAC,EAC3BR,iBAAiB,CAACQ,KAAK,GAAK,CAAC,CAC7B,OACJ,GAAIP,gBAAgB,CAACO,KAAK,GAAK,CAAC,EAC5BN,UAAU,CAACM,KAAK,CAAG,CAACL,qBAAqB,CAAE,CAC3CJ,eAAe,CAACS,KAAK,CAAG,CAAC,CACzBJ,OAAO,CAACC,QAAQ,CAAC,CAAC,CAAC,CACnB,OACJ,CACAD,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC,CAC1B","ignoreList":[]}',version:"3.16.7"},gn={code:"function useFlowControllerTs5(){const{lockFiredShared,cancelFiredShared,translateX,withSpring,translateY}=this.__closure;if(lockFiredShared.value===0&&cancelFiredShared.value===0){translateX.value=withSpring(0,{damping:18,stiffness:220});translateY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs5","lockFiredShared","cancelFiredShared","translateX","withSpring","translateY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA4RwB,SAAAA,oBAAMA,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 useFlowControllerTs6(){const{stateShared,STATE_HOLD,translateX,translateY,micScale}=this.__closure;const isHold=stateShared.value===STATE_HOLD;return{transform:[{translateX:isHold?translateX.value:0},{translateY:isHold?translateY.value:0},{scale:micScale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs6","stateShared","STATE_HOLD","translateX","translateY","micScale","__closure","isHold","value","transform","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAsS6C,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,UAAA,CAAAC,QAAA,OAAAC,SAAA,CAC3C,KAAM,CAAAC,MAAM,CAAGN,WAAW,CAACO,KAAK,GAAKN,UAAU,CAC/C,MAAO,CACHO,SAAS,CAAE,CACP,CAAEN,UAAU,CAAEI,MAAM,CAAGJ,UAAU,CAACK,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEJ,UAAU,CAAEG,MAAM,CAAGH,UAAU,CAACI,KAAK,CAAG,CAAE,CAAC,CAC7C,CAAEE,KAAK,CAAEL,QAAQ,CAACG,KAAM,CAAC,CAEjC,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},xn={code:"function useFlowControllerTs7(){const{interpolate,translateX,cancelThresholdShared,Extrapolation,arrowPulse}=this.__closure;const opacity=interpolate(translateX.value,[0,cancelThresholdShared.value],[1,0],Extrapolation.CLAMP);return{opacity:opacity,transform:[{translateX:translateX.value*0.4+arrowPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs7","interpolate","translateX","cancelThresholdShared","Extrapolation","arrowPulse","__closure","opacity","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAgToD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,qBAAA,CAAAC,aAAA,CAAAC,UAAA,OAAAC,SAAA,CAClD,KAAM,CAAAC,OAAO,CAAGN,WAAW,CAACC,UAAU,CAACM,KAAK,CAAE,CAAC,CAAC,CAAEL,qBAAqB,CAACK,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEJ,aAAa,CAACK,KAAK,CAAC,CAC5G,MAAO,CACHF,OAAO,CAAPA,OAAO,CACPG,SAAS,CAAE,CAAC,CAAER,UAAU,CAAEA,UAAU,CAACM,KAAK,CAAG,GAAG,CAAGH,UAAU,CAACG,KAAM,CAAC,CACzE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},bn={code:"function useFlowControllerTs8(){const{interpolate,translateY,lockThresholdShared,Extrapolation}=this.__closure;const lockProgress=interpolate(translateY.value,[0,lockThresholdShared.value],[0,1],Extrapolation.CLAMP);return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs8","interpolate","translateY","lockThresholdShared","Extrapolation","__closure","lockProgress","value","CLAMP","transform"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAuTmD,SAAAA,oBAAMA,CAAA,QAAAC,WAAA,CAAAC,UAAA,CAAAC,mBAAA,CAAAC,aAAA,OAAAC,SAAA,CACjD,KAAM,CAAAC,YAAY,CAAGL,WAAW,CAACC,UAAU,CAACK,KAAK,CAAE,CAAC,CAAC,CAAEJ,mBAAmB,CAACI,KAAK,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAEH,aAAa,CAACI,KAAK,CAAC,CAC/G,MAAO,CACHC,SAAS,CAAE,CACP,CAAEP,UAAU,CAAED,WAAW,CAACK,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAEnE,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},wn={code:"function useFlowControllerTs9(){const{chevronPulse}=this.__closure;return{transform:[{translateY:chevronPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs9","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AA+TkD,SAAAA,qBAAA,QAAAC,YAAA,OAAAC,SAAA,OAAO,CACjDC,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAEH,YAAY,CAACI,KAAM,CAAC,CAClD,CAAC","ignoreList":[]}',version:"3.16.7"},Sn={code:"function useFlowControllerTs10(){const{isPaused,pausePulse}=this.__closure;return{opacity:isPaused?1:pausePulse.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs10","isPaused","pausePulse","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAkU6C,SAAAA,sBAAA,QAAAC,QAAA,CAAAC,UAAA,OAAAC,SAAA,OAAO,CAC5CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,UAAU,CAACG,KACvC,CAAC","ignoreList":[]}',version:"3.16.7"},kn={code:"function useFlowControllerTs11(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts",sourceMap:'{"version":3,"names":["useFlowControllerTs11","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorderFlow/useFlowController.ts"],"mappings":"AAqUyC,SAAAA,sBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"};var En=function(r){var n=r.primaryColor,o=void 0===n?"#16A34A":n,l=r.backgroundColor,s=void 0===l?"#0B141A":l,A=r.holdPillBackground,c=void 0===A?"#1F2C33":A,u=r.timerColor,d=void 0===u?rn:u,C=r.microphoneColor,h=void 0===C?rn:C,f=r.lockColor,v=void 0===f?nn:f,m=r.waveformColor,p=void 0===m?nn:m,g=r.deleteIconColor,y=void 0===g?"#8696A0":g,x=r.cancelTextColor,b=void 0===x?"rgba(255,255,255,0.6)":x,w=r.chevronColor,S=r.pauseIconColor,k=void 0===S?"#F15C6D":S,E=r.lockPillBackground,j=void 0===E?"#1F2C33":E,M=r.inputBarHeight,_=void 0===M?tn:M,P=r.micSize,T=r.holdMicScale,R=void 0===T?1.18:T,O=r.iconSize,G=void 0===O?22:O,F=r.lockIconSize,V=void 0===F?18:F,D=r.enableLockRecording,K=void 0===D||D,B=r.enableSlideToCancel,L=void 0===B||B,U=r.enableWaveform,H=void 0===U||U,z=r.lockSlideDistance,W=void 0===z?70:z,N=r.cancelSlideDistance,Q=void 0===N?90:N,Y=r.waveCount,q=void 0===Y?32:Y,J=r.showSendButton,X=r.onSendPress,$=r.sendButtonBackgroundColor,Z=r.sendButtonIconColor,ee=r.renderInputPill,te=r.renderMicIcon,re=r.renderSendIcon,ne=r.renderLockIcon,oe=r.renderArrowIcon,ie=r.renderDeleteIcon,ae=r.renderPauseIcon,le=r.renderPlayIcon,se=r.renderWaveform,Ae=r.containerStyle,ce=r.barStyle,ue=r.timerTextStyle,de=r.slideTextStyle,Ce=r.waveformStyle,he=r.lockPillStyle,fe=r.trashButtonStyle,ve=r.sendButtonStyle,me=r.fontFamily,pe=null!=P?P:_,ge=null!=w?w:v,ye=function(e){var r=e.cancelSlideDistance,n=e.lockSlideDistance,o=e.enableLockRecording,l=e.enableSlideToCancel,s=e.holdMicScale,A=e.onRecordingStart,c=e.onRecordingStop,u=e.onSend,d=e.onDelete,C=e.onLock,h=e.onCancel,f=e.onPauseRecording,v=e.onResumeRecording,m=e.onStateChange,p=-Math.abs(r),g=-Math.abs(n),y=p-30,x=g-20,b=I(t.useState("IDLE"),2),w=b[0],S=b[1],k=I(t.useState(0),2),E=k[0],j=k[1],M=I(t.useState(!1),2),_=M[0],P=M[1],T=t.useRef("IDLE"),R=t.useRef(!1);t.useEffect((function(){T.current=w}),[w]),t.useEffect((function(){R.current=_}),[_]);var O=t.useRef(m);O.current=m,t.useEffect((function(){var e;null===(e=O.current)||void 0===e||e.call(O,w)}),[w]);var G=a.useSharedValue(0);t.useEffect((function(){G.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}}(w)}),[w]);var F=a.useSharedValue(p),V=a.useSharedValue(g),D=a.useSharedValue(y),K=a.useSharedValue(x),B=a.useSharedValue(o?1:0),L=a.useSharedValue(l?1:0);t.useEffect((function(){F.value=p,V.value=g,D.value=y,K.value=x,B.value=o?1:0,L.value=l?1:0}),[p,g,y,x,o,l]);var U=t.useRef(0),H=t.useRef(0),z=t.useRef(0),W=a.useSharedValue(0),N=a.useSharedValue(0),Q=a.useSharedValue(1),Y=a.useSharedValue(0),q=a.useSharedValue(0),J=a.useSharedValue(1),X=a.useSharedValue(0),$=a.useSharedValue(1),Z=a.useSharedValue(0),ee=a.useSharedValue(0);t.useEffect((function(){Y.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(-4,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),J.value=a.withRepeat(a.withSequence(a.withTiming(.5,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),X.value=a.withRepeat(a.withTiming(1,{duration:4500,easing:a.Easing.linear}),-1,!1),$.value=a.withRepeat(a.withSequence(a.withTiming(.3,{duration:600}),a.withTiming(1,{duration:600})),-1,!1)}),[]),t.useEffect((function(){Q.value="RECORDING_HOLD"===w?a.withSpring(s,{damping:14,stiffness:220}):a.withSpring(1,{damping:16,stiffness:220})}),[w,s]),t.useEffect((function(){if(("RECORDING_TAP"===w||"RECORDING_HOLD"===w||"LOCKED_RECORDING"===w)&&!_){var e=setInterval((function(){var e=Date.now()-U.current-H.current;j(e/1e3)}),250);return function(){return clearInterval(e)}}}),[w,_]);var te=t.useRef(A);te.current=A;var re=t.useRef(c);re.current=c;var ne=t.useRef(u);ne.current=u;var oe=t.useRef(d);oe.current=d;var ie=t.useRef(C);ie.current=C;var ae=t.useRef(h);ae.current=h;var le=t.useRef(f);le.current=f;var se=t.useRef(v);se.current=v;var Ae=t.useCallback((function(){var e;U.current=Date.now(),H.current=0,z.current=0,P(!1),j(0),Z.value=0,ee.value=0,W.value=0,N.value=0,null===(e=te.current)||void 0===e||e.call(te)}),[]),ce=t.useCallback((function(){j(0),P(!1),H.current=0,z.current=0,W.value=0,N.value=0,S("IDLE")}),[]),ue=t.useCallback((function(){var e,t,r=(Date.now()-U.current-H.current)/1e3;S("SENDING"),null===(e=re.current)||void 0===e||e.call(re),null===(t=ne.current)||void 0===t||t.call(ne,{duration:r}),ce()}),[ce]),de=t.useCallback((function(){var e=T.current;if("IDLE"===e)return S("RECORDING_TAP"),void Ae();"RECORDING_TAP"!==e&&"LOCKED_RECORDING"!==e||ue()}),[Ae,ue]),Ce=t.useCallback((function(){"IDLE"===T.current&&(S("RECORDING_HOLD"),Ae())}),[Ae]),he=t.useCallback((function(){var e;"RECORDING_HOLD"===T.current&&(hn(),S("LOCKED_RECORDING"),W.value=a.withSpring(0,{damping:18,stiffness:220}),N.value=a.withSpring(0,{damping:18,stiffness:220}),null===(e=ie.current)||void 0===e||e.call(ie))}),[]),fe=t.useCallback((function(){var e,t,r,n=T.current;"RECORDING_HOLD"!==n&&"RECORDING_TAP"!==n&&"LOCKED_RECORDING"!==n||(hn(),S("CANCELLED"),null===(e=re.current)||void 0===e||e.call(re),null===(t=ae.current)||void 0===t||t.call(ae),null===(r=oe.current)||void 0===r||r.call(oe),ce())}),[ce]),ve=t.useCallback((function(){"RECORDING_HOLD"===T.current&&ue()}),[ue]),me=t.useCallback((function(){var e,t,r=!R.current;r?(z.current=Date.now(),null===(e=le.current)||void 0===e||e.call(le)):(H.current+=Date.now()-z.current,z.current=0,null===(t=se.current)||void 0===t||t.call(se)),P(r)}),[]),pe=t.useRef(de);pe.current=de;var ge=t.useRef(Ce);ge.current=Ce;var ye=t.useRef(ve);ye.current=ve;var xe=t.useRef(he);xe.current=he;var be=t.useRef(fe);be.current=fe;var we,Se,ke=function(){return pe.current()},Ee=function(){return ge.current()},je=function(){return ye.current()},Me=function(){return xe.current()},Ie=function(){return be.current()},_e=t.useMemo((function(){var e,t,r=i.Gesture.Tap().maxDuration(210).onEnd((e=[new global.Error,-3,-27],(t=function(e,t){t&&a.runOnJS(ke)()}).__closure={runOnJS:a.runOnJS,fireQuickTap:ke},t.__workletHash=0xb640de2a90a,t.__initData=fn,t.__stackDetails=e,t)),n=i.Gesture.Pan().activateAfterLongPress(220).onStart(function(){var e=[new global.Error,-3,-27],t=function(){a.runOnJS(Ee)()};return t.__closure={runOnJS:a.runOnJS,fireHoldStart:Ee},t.__workletHash=3973713390129,t.__initData=vn,t.__stackDetails=e,t}()).onUpdate(function(){var e=[new global.Error,-16,-27],t=function(e){if(2===G.value){var t=Math.max(D.value,Math.min(0,e.translationX)),r=Math.max(K.value,Math.min(0,e.translationY)),n=Math.abs(r)>Math.abs(t);W.value=n?0:t,N.value=n?r:0,n&&1===B.value&&0===ee.value&&r<=V.value&&(ee.value=1,a.runOnJS(Me)()),!n&&1===L.value&&0===Z.value&&t<=F.value&&(Z.value=1,a.runOnJS(Ie)())}};return t.__closure={stateShared:G,STATE_HOLD:2,maxLeftShared:D,maxUpShared:K,translateX:W,translateY:N,enableLockShared:B,lockFiredShared:ee,lockThresholdShared:V,runOnJS:a.runOnJS,fireLock:Me,enableCancelShared:L,cancelFiredShared:Z,cancelThresholdShared:F,fireCancel:Ie},t.__workletHash=0xc932b7db4db,t.__initData=mn,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-9,-27],t=function(){if(1!==ee.value&&1!==Z.value)return 1===B.value&&N.value<-12?(ee.value=1,void a.runOnJS(Me)()):void a.runOnJS(je)()};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,enableLockShared:B,translateY:N,LOCK_ON_RELEASE_DELTA:12,runOnJS:a.runOnJS,fireLock:Me,fireHoldEnd:je},t.__workletHash=8222992215978,t.__initData=pn,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===ee.value&&0===Z.value&&(W.value=a.withSpring(0,{damping:18,stiffness:220}),N.value=a.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFiredShared:ee,cancelFiredShared:Z,translateX:W,withSpring:a.withSpring,translateY:N},t.__workletHash=0xb56825c4eba,t.__initData=gn,t.__stackDetails=e,t}());return i.Gesture.Race(r,n)}),[]),Pe=a.useAnimatedStyle((we=[new global.Error,-6,-27],(Se=function(){var e=2===G.value;return{transform:[{translateX:e?W.value:0},{translateY:e?N.value:0},{scale:Q.value}]}}).__closure={stateShared:G,STATE_HOLD:2,translateX:W,translateY:N,micScale:Q},Se.__workletHash=0x92736c307cb,Se.__initData=yn,Se.__stackDetails=we,Se)),Te=a.useAnimatedStyle(function(){var e=[new global.Error,-6,-27],t=function(){return{opacity:a.interpolate(W.value,[0,F.value],[1,0],a.Extrapolation.CLAMP),transform:[{translateX:.4*W.value+Y.value}]}};return t.__closure={interpolate:a.interpolate,translateX:W,cancelThresholdShared:F,Extrapolation:a.Extrapolation,arrowPulse:Y},t.__workletHash=0xf2b5c2efb9e,t.__initData=xn,t.__stackDetails=e,t}()),Re=a.useAnimatedStyle(function(){var e=[new global.Error,-5,-27],t=function(){var e=a.interpolate(N.value,[0,V.value],[0,1],a.Extrapolation.CLAMP);return{transform:[{translateY:a.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={interpolate:a.interpolate,translateY:N,lockThresholdShared:V,Extrapolation:a.Extrapolation},t.__workletHash=5669890750044,t.__initData=bn,t.__stackDetails=e,t}()),Oe=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:q.value}]}};return t.__closure={chevronPulse:q},t.__workletHash=0xd07d519242c,t.__initData=wn,t.__stackDetails=e,t}()),Ge=a.useAnimatedStyle(function(){var e=[new global.Error,-3,-27],t=function(){return{opacity:_?1:J.value}};return t.__closure={isPaused:_,pausePulse:J},t.__workletHash=0xea4d31d5a5c,t.__initData=Sn,t.__stackDetails=e,t}()),Fe=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:$.value}};return t.__closure={recBlink:$},t.__workletHash=0xd511e0063a5,t.__initData=kn,t.__stackDetails=e,t}());return{state:w,duration:E,isPaused:_,composedGesture:_e,waveTick:X,micWrapperStyle:Pe,slideTextAnimatedStyle:Te,lockPillAnimatedStyle:Re,chevronAnimatedStyle:Oe,pausePulseStyle:Ge,recDotStyle:Fe,triggerCancel:fe,togglePause:me}}({cancelSlideDistance:Q,lockSlideDistance:W,enableLockRecording:K,enableSlideToCancel:L,holdMicScale:R,onRecordingStart:r.onRecordingStart,onRecordingStop:r.onRecordingStop,onSend:r.onSend,onDelete:r.onDelete,onLock:r.onLock,onCancel:r.onCancel,onPauseRecording:r.onPauseRecording,onResumeRecording:r.onResumeRecording,onStateChange:r.onStateChange});return"RECORDING_TAP"===ye.state||"LOCKED_RECORDING"===ye.state||"SENDING"===ye.state?e.jsx(Cn,{duration:ye.duration,isPaused:ye.isPaused,composedGesture:ye.composedGesture,micWrapperStyle:ye.micWrapperStyle,pausePulseStyle:ye.pausePulseStyle,recDotStyle:ye.recDotStyle,waveTick:ye.waveTick,onCancelPress:ye.triggerCancel,onTogglePause:ye.togglePause,backgroundColor:s,timerColor:d,waveformColor:p,deleteIconColor:y,pauseIconColor:k,primaryColor:o,micSize:pe,iconSize:G,inputBarHeight:_,waveCount:q,enableWaveform:H,renderDeleteIcon:ie,renderPauseIcon:ae,renderPlayIcon:le,renderSendIcon:re,renderWaveform:se,containerStyleOverride:Ae,barStyleOverride:ce,timerTextStyle:ue,waveformStyle:Ce,trashButtonStyle:fe,sendButtonStyle:ve,fontFamily:me}):e.jsx(sn,{isHold:"RECORDING_HOLD"===ye.state,duration:ye.duration,composedGesture:ye.composedGesture,micWrapperStyle:ye.micWrapperStyle,slideTextAnimatedStyle:ye.slideTextAnimatedStyle,lockPillAnimatedStyle:ye.lockPillAnimatedStyle,chevronAnimatedStyle:ye.chevronAnimatedStyle,primaryColor:o,microphoneColor:h,timerColor:d,cancelTextColor:b,holdPillBackground:c,lockPillBackground:j,lockColor:v,chevronColor:ge,iconSize:G,lockIconSize:V,inputBarHeight:_,micSize:pe,enableLockRecording:K,showSendButton:J,onSendPress:X,sendButtonBackgroundColor:$,sendButtonIconColor:Z,renderInputPill:ee,renderMicIcon:te,renderSendIcon:re,renderArrowIcon:oe,renderLockIcon:ne,containerStyleOverride:Ae,timerTextStyle:ue,slideTextStyleOverride:de,lockPillStyleOverride:he,sendButtonStyle:ve,fontFamily:me})},jn=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"})]})},Mn=function(t){var n=t.fileName,o=t.style,i=K().theme;return e.jsx(r.Text,{numberOfLines:2,ellipsizeMode:"tail",style:J([{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)})},In=t.memo(Mn);function _n(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 Pn,Tn,Rn,On,Gn,Fn,Vn,Dn,Kn,Bn,Ln,Un,Hn,zn,Wn,Nn,Qn,Yn,qn,Jn,Xn,$n=function(t){var n,o=t.previews,i=t.closePreview,a=t.onRemoveItem,s=t.CustomFileIcon,A=t.CustomImagePreview,c=t.CustomVideoPreview,u=t.inputHeight,d=K(),C=d.theme,h=d.setMediaViewerGallery,f=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/"))})),m=_n(o);if(0===o.length)return null;var p=function(e){0!==m.length&&h(m,e)},g=function(t){var n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,a=null===(n=t.type)||void 0===n?void 0:n.startsWith("image/"),s=null===(o=t.type)||void 0===o?void 0:o.startsWith("video/");return a&&A?e.jsx(A,{uri:t.uri}):s&&c?e.jsx(c,{uri:t.uri}):a?e.jsx(r.Image,{source:{uri:t.uri},style:{width:i,height:i,borderRadius:12},resizeMode:"cover"}):s?e.jsx(r.View,{style:{width:i,height:i,borderRadius:12,overflow:"hidden"},children:e.jsx(l,{source:{uri:t.uri},style:{width:"100%",height:"100%"},resizeMode:"cover",muted:!0,repeat:!0,paused:!1,pointerEvents:"none",playInBackground:!1,playWhenInactive:!1})}):null},y=function(t,n){return e.jsx(r.Pressable,{onPress:function(){return a?a(t):null==i?void 0:i()},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(r.Text,{style:J({fontSize:13,color:"white",fontWeight:"700",lineHeight:14},null==C?void 0:C.fontFamily),children:"×"})})};return e.jsx(r.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(r.View,{style:{gap:8},children:[function(){if(0===f.length)return null;if(1===f.length){var t=f[0];return t?e.jsxs(r.Pressable,{onPress:function(){return p(0)},style:{position:"relative"},children:[g(t),y(t.uri)]}):null}var n=f.slice(0,3),o=f.length>3?f.length-3:0;return e.jsx(r.View,{style:{flexDirection:"row",alignItems:"center",minHeight:68},children:n.map((function(t,i){var a=2===n.length?0===i?"-4deg":"4deg":0===i?"-10deg":1===i?"0deg":"10deg",l=2===n.length?0===i?"4deg":"-4deg":0===i?"10deg":1===i?"0deg":"-10deg";return e.jsx(r.Pressable,{onPress:function(){var e=_n(f).findIndex((function(e){return e.uri===t.uri}));p(e>=0?e:0)},style:{marginLeft:0===i?0:-18,zIndex:i+1,transform:[{rotate:a}],position:"relative"},children:e.jsxs(r.View,{style:{position:"relative"},children:[g(t),2===i&&o>0&&e.jsx(r.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(r.Text,{style:{color:"#fff",fontWeight:"700",fontSize:14},children:["+",o]})}),y(t.uri,l)]})},"".concat(t.uri,"-").concat(i))}))})}(),v.length>0&&e.jsx(r.ScrollView,{scrollEnabled:v.length>3,style:{maxHeight:232},showsVerticalScrollIndicator:v.length>3,contentContainerStyle:{gap:8},nestedScrollEnabled:!0,children:v.map((function(t,n){return function(t,n){var o,i,a,l;return e.jsxs(r.View,{style:{position:"relative"},children:[e.jsxs(r.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(r.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:s?e.jsx(s,{}):e.jsx(jn,{style:{width:40,height:40},fill:"white"})}),e.jsx(r.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(In,{fileName:t.name||"File",style:null==C||null===(l=C.filePreviewStyle)||void 0===l?void 0:l.text})})]}),y(t.uri)]},"".concat(t.uri,"-").concat(n))}(t,n)}))})]})})},Zn=t.memo($n),eo="ios"===r.Platform.OS?32:30,to="ios"===r.Platform.OS?50:48,ro=function(i){var a,l,s,A,c,d,C,h,f,v,m,p,y,x,b,w,S,k=i.onSendMessage,E=i.onTypingStart,j=i.onTypingEnd,M=i.onAttachmentPress,P=i.onCameraPress,T=i.onAudioRecordStart,R=i.onAudioRecordEnd,G=i.CustomEmojiIcon,F=i.CustomAttachmentIcon,V=i.CustomCameraIcon,D=i.CustomSendIcon,B=i.CustomMicrophoneIcon,L=i.CustomFileIcon,U=i.CustomImagePreview,H=i.CustomVideoPreview,z=I(t.useState(""),2),W=z[0],N=z[1],Q=I(t.useState({height:eo,isMultiline:!1}),2),Y=Q[0],X=Q[1],$=t.useRef(null),Z=K(),ee=Z.theme,te=Z.currentUserId,re=Z.showEmojiButton,ne=Z.showAttachmentsButton,oe=Z.showCameraButton,ie=Z.showVoiceRecordButton,ae=Z.placeholder,le=Z.previewData,se=Z.previewItems,Ae=Z.closePreview,ce=Z.onRemovePreviewItem,ue=Z.CustomVoiceRecorder,de=Z.replyTarget,Ce=Z.cancelReply,he=Z.replyProps,fe=Z.replyStyle,ve=Z.renderReplyPreview,me=Z.editingMessage,pe=Z.cancelEdit,ge=Z.onEditMessage,ye=t.useRef(null);t.useEffect((function(){var e;me&&me.id!==ye.current?(ye.current=me.id,N(null!==(e=me.text)&&void 0!==e?e:""),X({height:eo,isMultiline:!1}),requestAnimationFrame((function(){var e;return null===(e=$.current)||void 0===e?void 0:e.focus()}))):me||(ye.current=null)}),[me]);var xe,be=t.useMemo((function(){return null!=se&&se.length?se:le?[le]:[]}),[se,le]),we=be.length>0,Se=null==ee||null===(a=ee.sizes)||void 0===a?void 0:a.inputIconSize,ke=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)}(Se),Ee="number"==typeof(xe=Se)&&xe>0?xe:24,je=0===W.trim().length&&!Y.isMultiline,Me=Math.max(0,(to-Ee)/2),Ie=je?{paddingTop:Me,paddingBottom:Me}:{paddingBottom:Me},_e=!!me,Pe=t.useCallback((function(){X({height:eo,isMultiline:!1})}),[]),Te=t.useCallback((function(e){N(e),0===e.length&&Pe()}),[Pe]),Re=t.useCallback((function(e){var t=Math.min(Math.max(e.nativeEvent.contentSize.height,eo),118),r=t>eo;X({height:r?t:eo,isMultiline:r})}),[]),Oe=t.useCallback((function(){var e,t,r,n,o,i;if(de){var a=null===(e=de.mediaItems)||void 0===e?void 0:e[0];return{messageId:de.id,senderName:de.senderName,preview:null!==(t=de.text)&&void 0!==t?t:de.audio?"🎤 Audio message":de.image?"📷 Photo":de.video?"🎥 Video":null!==(r=de.fileAttachments)&&void 0!==r&&null!==(r=r[0])&&void 0!==r&&r.name?"📎 ".concat(de.fileAttachments[0].name):"",mediaKind:de.audio?"audio":de.video?"video":de.image||(null!==(n=de.mediaItems)&&void 0!==n?n:[]).some((function(e){return"image"===e.kind}))?"image":(null!==(o=de.fileAttachments)&&void 0!==o?o:[]).length?"file":void 0,thumbnailUri:null!==(i=de.image)&&void 0!==i?i:"image"===(null==a?void 0:a.kind)||"video"===(null==a?void 0:a.kind)?a.uri:void 0}}}),[de]),Ge=t.useCallback((function(){var e=W.trim();if(me){if(!e)return;return null==ge||ge(me,e),N(""),Pe(),void pe()}(e||we)&&(k(g({text:e,senderId:te},de?{replyTo:Oe()}:{})),N(""),Pe(),de&&Ce())}),[W,k,te,we,Pe,de,Oe,Ce,me,ge,pe]);t.useEffect((function(){W.trim()?null==E||E():null==j||j()}),[W,E,j]);var Fe=!!W.trim()||we||_e,Ve=null==ee?void 0:ee.voiceRecorder,De=null!==(l=null==Ve?void 0:Ve.ui)&&void 0!==l?l:{},Ke=null==Ve?void 0:Ve.styles,Be=null==Ve?void 0:Ve.config,Le=t.useCallback((function(e){null==R||R(e)}),[R]),Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.maxDuration,n=void 0===r?300:r,o=e.onRecordStart,i=e.onRecordEnd,a=I(t.useState("idle"),2),l=a[0],s=a[1],A=I(t.useState(0),2),c=A[0],d=A[1],C=t.useRef(null),h=t.useRef(null),f=t.useRef(0),v=t.useRef(i);v.current=i;var m=t.useRef(o);m.current=o;var p=t.useRef(n);p.current=n;var g=t.useCallback((function(){h.current&&(clearInterval(h.current),h.current=null)}),[]),y=t.useCallback((function(e){g(),h.current=setInterval((function(){f.current+=1,d(f.current),f.current>=p.current&&e()}),1e3)}),[g]),x=t.useCallback(u(O().mark((function e(){var t,r;return O().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,Pr();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,f.current=0,d(0),s("recording"),y((function(){return k.current()})),null===(r=m.current)||void 0===r||r.call(m)}catch(e){console.warn("[movius-chats] Failed to start recording:",e)}case 15:case"end":return e.stop()}}),e,null,[[0,4]])}))),[y]),b=t.useCallback(u(O().mark((function e(){return O().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(),s("paused"),g()}catch(e){console.warn("[movius-chats] Failed to pause:",e)}case 3:case"end":return e.stop()}}),e)}))),[g]),w=t.useCallback(u(O().mark((function e(){return O().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(),s("recording"),y((function(){return k.current()}))}catch(e){console.warn("[movius-chats] Failed to resume:",e)}case 3:case"end":return e.stop()}}),e)}))),[y]),S=t.useCallback(u(O().mark((function e(){var t,r,n,o,i;return O().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=f.current,f.current=0,s("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]),k=t.useRef(S);k.current=S;var E=t.useCallback((function(){return k.current()}),[]),j=t.useCallback(u(O().mark((function e(){var t,r,n,o;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.current,g(),C.current=null,f.current=0,s("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 t.useEffect((function(){return function(){g();try{var e;null===(e=C.current)||void 0===e||e.stop()}catch(e){}}}),[g]),{status:l,duration:c,isRecording:"recording"===l,isPaused:"paused"===l,startRecording:x,pauseRecording:b,resumeRecording:w,stopRecording:E,cancelRecording:j}}({maxDuration:null!==(s=null==Be?void 0:Be.maxDuration)&&void 0!==s?s:300,onRecordStart:T,onRecordEnd:Le}),He=t.useRef(Ue);He.current=Ue;var ze=t.useCallback((function(){He.current.startRecording()}),[]),We=t.useCallback(u(O().mark((function e(){var t;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,He.current.stopRecording();case 2:(t=e.sent)&&(k(g({audio:t.uri,senderId:te},de?{replyTo:Oe()}:{})),de&&Ce());case 4:case"end":return e.stop()}}),e)}))),[k,te,de,Oe,Ce]),Ne=t.useCallback((function(){He.current.cancelRecording()}),[]),Qe=t.useCallback((function(){He.current.pauseRecording()}),[]),Ye=t.useCallback((function(){He.current.resumeRecording()}),[]),qe=(null==ee||null===(A=ee.inputStyles)||void 0===A||null===(A=A.sendButtonStyle)||void 0===A?void 0:A.backgroundColor)||(null==ee||null===(c=ee.colors)||void 0===c?void 0:c.sentBubbleBackgroundColor)||(null==ee||null===(d=ee.colors)||void 0===d?void 0:d.sentMessageTailColor)||"#22c55e",Je=(null==ee||null===(C=ee.colors)||void 0===C?void 0:C.sendIconsColor)||"rgba(255,255,255,0.95)",Xe=null!==(h=De.recordingSendButtonBackground)&&void 0!==h?h:qe,$e=De.recordingBackground,Ze=null!==(f=De.timerColor)&&void 0!==f?f:Je,et=null!==(v=De.longPressMicColor)&&void 0!==v?v:Je,tt=null!==(m=De.waveformColor)&&void 0!==m?m:Je,rt={isRecording:Ue.isRecording,isPaused:Ue.isPaused,duration:Ue.duration,isLocked:!1,slideOffset:{x:0,y:0},waveformData:[],startRecording:Ue.startRecording,stopRecording:Ue.stopRecording,pauseRecording:Ue.pauseRecording,resumeRecording:Ue.resumeRecording,cancelRecording:Ue.cancelRecording},nt=ue?ue(rt):null,ot=t.useCallback((function(){var t,o,i,a,l,s;return e.jsxs(r.View,{style:[n(Pn||(Pn=_(["flex-1 flex-row bg-white overflow-hidden px-3.5"]))),{minHeight:to,borderRadius:je?9999:24,alignItems:je?"center":"flex-end"},null==ee||null===(t=ee.inputStyles)||void 0===t?void 0:t.inputContainerStyle],children:[re&&e.jsx(r.View,{style:Ie,children:e.jsx(r.Pressable,{children:G?e.jsx(G,{}):e.jsx(jr,{style:ke,color:(null==ee||null===(o=ee.colors)||void 0===o?void 0:o.inputsIconsColor)||"rgba(0,0,0,0.7)"})})}),e.jsx(r.TextInput,{ref:$,value:W,onChangeText:Te,placeholder:ae||"Message",style:J([n(Tn||(Tn=_(["bg-transparent flex-1 pl-2"]))),"ios"===r.Platform.OS?n(Rn||(Rn=_(["text-[17px]"]))):n(On||(On=_(["text-[16px]"]))),{minHeight:eo,maxHeight:118,paddingVertical:je?0:8,marginVertical:je?(to-eo)/2:4},{color:(null==ee||null===(i=ee.colors)||void 0===i?void 0:i.inputTextColor)||"rgba(0, 0, 0, 0.87)"}],null==ee?void 0:ee.fontFamily),placeholderTextColor:(null==ee||null===(a=ee.colors)||void 0===a?void 0:a.placeholderTextColor)||"rgba(0, 0, 0, 0.4)",multiline:!0,textAlignVertical:Y.isMultiline&&W.length>0?"top":"center",onContentSizeChange:Re}),!_e&&e.jsxs(r.View,{style:[n(Gn||(Gn=_(["flex-row items-center gap-4"]))),Ie],children:[ne&&e.jsx(r.Pressable,{onPress:M,children:F?e.jsx(F,{}):e.jsx(Ir,{style:ke,color:(null==ee||null===(l=ee.colors)||void 0===l?void 0:l.inputsIconsColor)||"rgba(0,0,0,0.7)"})}),oe&&!W.trim()&&e.jsx(r.Pressable,{onPress:P,children:V?e.jsx(V,{}):e.jsx(kr,{style:ke,color:(null==ee||null===(s=ee.colors)||void 0===s?void 0:s.inputsIconsColor)||"rgba(0,0,0,0.7)"})})]})]})}),[je,_e,W,Y.isMultiline,Ie,Te,Re,ae,re,ne,oe,M,P,G,F,V,ke,ee]),it=t.useCallback((function(){var t;return e.jsx(r.Pressable,{onPress:Ge,style:[n(Fn||(Fn=_(["rounded-full justify-center items-center"]))),g({height:to,width:to,backgroundColor:qe},null==ee||null===(t=ee.inputStyles)||void 0===t?void 0:t.sendButtonStyle)],children:D?e.jsx(D,{}):e.jsx(_r,{style:n.style("h-6 w-6"),color:Je})})}),[Ge,qe,Je,null==ee||null===(p=ee.inputStyles)||void 0===p?void 0:p.sendButtonStyle,D]),at=ie&&!nt&&!_e,lt=null===(y=null==he?void 0:he.enableReply)||void 0===y||y,st=de&&lt&&!_e?ve?ve(de,Ce):e.jsx(en,{message:de,onCancel:Ce,previewMaxLines:null==he?void 0:he.previewMaxLines,replyStyle:fe,fontFamily:null==ee?void 0:ee.fontFamily,accentColor:qe,senderNameColor:qe,previewTextColor:(null==ee||null===(x=ee.colors)||void 0===x?void 0:x.placeholderTextColor)||"rgba(0,0,0,0.55)",closeIconColor:(null==ee||null===(b=ee.colors)||void 0===b?void 0:b.inputsIconsColor)||"rgba(0,0,0,0.5)",backgroundColor:"#FFFFFF"}):null,At=_e?e.jsxs(r.View,{style:[n(Vn||(Vn=_(["flex-row items-stretch mx-2 mb-1 rounded-xl overflow-hidden"]))),{backgroundColor:"#FFFFFF",minHeight:52,shadowColor:"#000",shadowOpacity:.06,shadowRadius:4,shadowOffset:{width:0,height:1},elevation:1}],children:[e.jsx(r.View,{style:[n(Dn||(Dn=_(["w-[3px] self-stretch"]))),{backgroundColor:qe}]}),e.jsxs(r.View,{style:n(Kn||(Kn=_(["flex-1 flex-row items-center pl-3 pr-2 py-2"]))),children:[e.jsx(r.View,{style:n(Bn||(Bn=_(["mr-3"]))),children:e.jsx(Er,{style:{width:18,height:18},color:qe})}),e.jsxs(r.View,{style:n(Ln||(Ln=_(["flex-1 mr-2"]))),children:[e.jsx(r.Text,{numberOfLines:1,style:J([n(Un||(Un=_(["text-[13.5px] font-semibold"]))),{color:qe}],null==ee?void 0:ee.fontFamily),children:"Edit message"}),e.jsx(r.Text,{numberOfLines:1,style:J([n(Hn||(Hn=_(["text-[12.5px] mt-0.5"]))),{color:"rgba(0,0,0,0.55)"}],null==ee?void 0:ee.fontFamily),children:null==me?void 0:me.text})]}),e.jsx(r.Pressable,{onPress:function(){pe(),N(""),Pe()},hitSlop:10,style:n(zn||(zn=_(["w-7 h-7 items-center justify-center"]))),children:e.jsxs(o,{width:14,height:14,viewBox:"0 0 24 24",children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:"rgba(0,0,0,0.5)",strokeWidth:2.5,strokeLinecap:"round"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:"rgba(0,0,0,0.5)",strokeWidth:2.5,strokeLinecap:"round"})]})})]})]}):null,ct={inputBarHeight:to,primaryColor:Xe,backgroundColor:$e,timerColor:Ze,microphoneColor:et,waveformColor:tt,holdPillBackground:De.holdPillBackground,cancelTextColor:De.cancelTextColor,chevronColor:De.chevronIconColor,lockColor:De.lockIconColor,lockPillBackground:De.lockPillBackground,deleteIconColor:De.deleteIconColor,pauseIconColor:De.pauseIconColor,iconSize:De.iconSize,lockSlideDistance:De.lockSlideDistance,waveCount:De.waveformBarCount,enableLockRecording:null==Be?void 0:Be.enableLockRecording,enableSlideToCancel:null==Be?void 0:Be.enableSlideToCancel,enableWaveform:null==Be?void 0:Be.enableWaveform,timerTextStyle:null!==(w=De.timerTextStyle)&&void 0!==w?w:null==Ke?void 0:Ke.timer,fontFamily:null==ee?void 0:ee.fontFamily,containerStyle:null==Ke?void 0:Ke.container,barStyle:null==Ke?void 0:Ke.bar,slideTextStyle:null==Ke?void 0:Ke.slideText,waveformStyle:null==Ke?void 0:Ke.waveform,lockPillStyle:null==Ke?void 0:Ke.lockPill,trashButtonStyle:null==Ke?void 0:Ke.trashButton,sendButtonStyle:null==Ke?void 0:Ke.sendButton,showSendButton:Fe,onSendPress:Ge,sendButtonBackgroundColor:qe,sendButtonIconColor:Je,renderInputPill:ot,renderSendIcon:D?function(){return e.jsx(D,{})}:void 0,renderMicIcon:B?function(){return e.jsx(B,{})}:void 0,onRecordingStart:ze,onSend:We,onCancel:Ne,onDelete:Ne,onPauseRecording:Qe,onResumeRecording:Ye};return e.jsxs(r.View,{style:n(Wn||(Wn=_(["w-full px-2"]))),children:[At,st,we&&e.jsx(Zn,{previews:be,closePreview:Ae,onRemoveItem:ce,CustomFileIcon:L,CustomImagePreview:U,CustomVideoPreview:H,inputHeight:Y.height}),e.jsx(r.View,{style:[n(Nn||(Nn=_(["w-full"]))),null==ee||null===(S=ee.inputStyles)||void 0===S?void 0:S.inputSectionContainerStyle],children:at?e.jsx(En,g({},ct)):e.jsxs(r.View,{style:n(Qn||(Qn=_(["flex-row items-end gap-2"]))),children:[ot(),Fe||!ie?it():nt?e.jsx(r.View,{style:{height:to,width:to,justifyContent:"center",alignItems:"center"},children:B?e.jsx(B,{}):e.jsx(Mr,{style:n.style("h-8 w-8"),color:Je})}):it()]})}),nt]})},no=t.memo(ro),oo=function(e){var t,r,n,o=null!==(t=null!==(r=e.text)&&void 0!==r?r:null===(n=e.fileAttachments)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.name)&&void 0!==t?t:"";if(!o)return!1;try{var i,a=require("@react-native-clipboard/clipboard"),l=null!==(i=null==a?void 0:a.default)&&void 0!==i?i:a;if(null!=l&&l.setString)return l.setString(o),!0}catch(e){}try{var s,A=require("react-native");if(null!=A&&null!==(s=A.Clipboard)&&void 0!==s&&s.setString)return A.Clipboard.setString(o),!0}catch(e){}return!1},io=function(t){var r=t.style,n=t.color,i=void 0===n?"#FFFFFF":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:i,d:"M9 18q-.825 0-1.412-.587T7 16V4q0-.825.588-1.412T9 2h9q.825 0 1.413.588T20 4v12q0 .825-.587 1.413T18 18zm-4 4q-.825 0-1.412-.587T3 20V7q0-.425.288-.712T4 6t.713.288T5 7v13h10q.425 0 .713.288T16 21t-.288.713T15 22z"})})},ao=function(t){var r=t.style,n=t.color,i=void 0===n?"#FFFFFF":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:i,d:"M14 9V5l7 7l-7 7v-4.1c-5 0-8.5 1.6-11 5.1c1-5 4-10 11-11"})})},lo=function(t){var n=t.style,o=t.color,i=void 0===o?"#111827":o;return e.jsx(r.View,{style:[{width:18,height:18,borderRadius:9,borderWidth:1.5,borderColor:i,alignItems:"center",justifyContent:"center"},n],children:e.jsx(r.View,{style:{width:4,height:4,borderRadius:2,backgroundColor:i}})})};var so,Ao,co,uo,Co,ho,fo,vo,mo,po,go,yo,xo,bo,wo=function(o){var i,a,l,s,A,c,u,d=o.message,C=o.anchor,h=o.visible,f=o.onClose,v=o.flags,m=o.ui,p=o.fontFamily,g=o.onAction,y=t.useMemo((function(){return d?function(e,t){var r,n=!(null===(r=e.text)||void 0===r||!r.trim());return[{id:"reply",label:"Reply",Icon:ee},{id:"forward",label:"Forward",Icon:ao},{id:"copy",label:"Copy",Icon:io},{id:"edit",label:"Edit",Icon:Er},{id:"select",label:"Select",Icon:lo},{id:"delete",label:"Delete",Icon:An,destructive:!0}].filter((function(e){switch(e.id){case"reply":return!1!==(null==t?void 0:t.enableReply);case"copy":return!1!==(null==t?void 0:t.enableCopy);case"edit":return!1!==(null==t?void 0:t.enableEdit)&&n;case"delete":return!1!==(null==t?void 0:t.enableDelete);case"forward":return!1!==(null==t?void 0:t.enableForward);case"select":return!1!==(null==t?void 0:t.enableSelect);default:return!0}}))}(d,v):[]}),[d,v]),x=null!==(i=null==m?void 0:m.width)&&void 0!==i?i:200,b=null!==(a=null==m?void 0:m.borderRadius)&&void 0!==a?a:12,w=null!==(l=null==m?void 0:m.backgroundColor)&&void 0!==l?l:"#FFFFFF",S=null!==(s=null==m?void 0:m.textColor)&&void 0!==s?s:"#111827",k=null!==(A=null==m?void 0:m.iconColor)&&void 0!==A?A:S,E=null!==(c=null==m?void 0:m.destructiveColor)&&void 0!==c?c:"#EF4444",j=null!==(u=null==m?void 0:m.backdropColor)&&void 0!==u?u:"rgba(0,0,0,0.18)",M=t.useMemo((function(){return function(e,t,n,o){var i=r.Dimensions.get("window");if(!e)return{top:i.height/2-n*o/2,left:i.width/2-t/2};var a,l=n*o+12;return a=e.isCurrentUser?e.x+e.width-t:e.x,a=Math.max(8,Math.min(a,i.width-t-8)),{top:i.height-(e.y+e.height)>=l+8?e.y+e.height+6:Math.max(8,e.y-l-6),left:a}}(C,x,48,y.length)}),[C,x,y.length]);return d?e.jsx(r.Modal,{visible:h,transparent:!0,animationType:"fade",onRequestClose:f,statusBarTranslucent:!0,children:e.jsx(r.Pressable,{onPress:f,style:[n(Yn||(Yn=_(["flex-1"]))),{backgroundColor:j}],children:e.jsx(r.Pressable,{onPress:function(){},style:[n(qn||(qn=_(["absolute overflow-hidden"]))),{width:x,borderRadius:b,backgroundColor:w,top:M.top,left:M.left,shadowColor:"#000",shadowOpacity:.16,shadowRadius:16,shadowOffset:{width:0,height:6},elevation:6}],children:y.map((function(t){var o=t.destructive?E:S,i=t.destructive?E:k;return e.jsxs(r.Pressable,{onPress:function(){return g(t.id,d)},android_ripple:{color:"rgba(0,0,0,0.06)"},style:[n(Jn||(Jn=_(["flex-row items-center px-4"]))),{height:48},null==m?void 0:m.rowStyle],children:[e.jsx(r.View,{style:{width:22,height:22,marginRight:14},children:e.jsx(t.Icon,{style:{width:22,height:22},color:i})}),e.jsx(r.Text,{style:J([n(Xn||(Xn=_(["text-[15px] font-medium"]))),{color:o},null==m?void 0:m.rowTextStyle],p),children:t.label})]},t.id)}))})})}):null};function So(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 ko,Eo,jo,Mo,Io,_o,Po,To,Ro,Oo,Go,Fo,Vo=function(o){var i,a=o.gallery,l=o.onClose,s=K(),A=s.theme,c=s.setIsVideoPlaying,u=t.useRef(null),d=null!==(i=null==a?void 0:a.initialIndex)&&void 0!==i?i:0,C=I(t.useState(d),2),h=C[0],f=C[1],v=r.useWindowDimensions(),m=v.width,p=v.height;t.useEffect((function(){if(null!=a&&a.items.length){var e=a.initialIndex;f(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=t.useCallback((function(){c(!1),l()}),[l,c]),y=t.useCallback((function(e){var t=Math.round(e.nativeEvent.contentOffset.x/m);f(t);var r=null==a?void 0:a.items[t];c("video"===(null==r?void 0:r.kind))}),[null==a?void 0:a.items,m,c]);return a&&0!==a.items.length?e.jsx(r.Modal,{visible:!0,transparent:!0,animationType:"fade",onRequestClose:g,statusBarTranslucent:!0,children:e.jsxs(r.View,{style:[n(fo||(fo=_(["flex-1 bg-black"]))),{width:m,height:p}],children:[e.jsx(r.Pressable,{onPress:g,style:n(vo||(vo=_(["absolute right-4 top-12 z-20 p-2 rounded-full bg-slate-100/70"]))),children:e.jsx(So,{style:n(mo||(mo=_(["h-8 w-8"])))})}),a.items.length>1&&e.jsx(r.View,{style:n(po||(po=_(["absolute top-14 left-0 right-0 z-10 items-center"]))),children:e.jsxs(r.Text,{style:J(n(go||(go=_(["text-white/90 text-sm bg-black/40 px-3 py-1 rounded-full"]))),null==A?void 0:A.fontFamily),children:[h+1," / ",a.items.length]})}),e.jsx(r.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:h,getItemLayout:function(e,t){return{length:m,offset:m*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(Do,{item:r,width:m,height:p,isActive:n===h,autoPlayVideo:n===d&&"video"===r.kind})}})]})}):null},Do=function(o){var i=o.item,a=o.width,s=o.height,A=o.isActive,c=o.autoPlayVideo,u=K().theme,d=t.useRef(null),C=I(t.useState("video"===i.kind),2),h=C[0],f=C[1],v=I(t.useState(!1),2),m=v[0],p=v[1],g="video"===i.kind&&A&&c;return"image"===i.kind?e.jsx(r.View,{style:{width:a,height:s,justifyContent:"center"},children:e.jsx(r.Image,{source:{uri:i.uri},style:{width:a,height:s},resizeMode:"contain"})}):e.jsxs(r.View,{style:{width:a,height:s,justifyContent:"center",alignItems:"center",paddingHorizontal:16},children:[e.jsx(l,{source:{uri:i.uri},ref:d,controls:!0,paused:!g,shutterColor:"transparent",playInBackground:!1,playWhenInactive:!1,style:{width:a-32,height:.55*s,backgroundColor:"#000"},resizeMode:"contain",onLoadStart:function(){f(!0),p(!1)},onLoad:function(){return f(!1)},onBuffer:function(e){var t=e.isBuffering;return f(t)},onError:function(){p(!0),f(!1)}}),h&&e.jsx(r.View,{style:n(yo||(yo=_(["absolute inset-0 items-center justify-center"]))),pointerEvents:"none",children:e.jsx(Mt,{style:n.style("h-14 w-14"),spinning:!0})}),m&&e.jsx(r.View,{style:n(xo||(xo=_(["absolute inset-0 items-center justify-center px-6"]))),children:e.jsx(r.Text,{style:J(n(bo||(bo=_(["text-white font-semibold"]))),null==u?void 0:u.fontFamily),children:"Failed to load video"})})]})},Ko=t.memo(Vo),Bo=function(t){var o,i,a,l,s,A=t.typingUsers,c=t.currentUserId,u=K(),d=u.theme,C=u.showAvatars,h=u.renderCustomTyping,f=u.showBubbleTail,v=u.typingText,m=A.filter((function(e){return e.id!==c}));if(!m.length)return null;var p=m.slice(0,2),y=m.length-2,x=C?p.length+(y>0?1:0):0,b=x>0?24+14*Math.max(0,x-1):0,w=x>0?b+12:8,S=-(b+12);return e.jsxs(r.View,{style:[n(ko||(ko=_(["px-2 my-1 bg-white rounded-tl-none rounded-lg relative max-w-[75%] self-start"]))),{marginLeft:w},null==d||null===(o=d.bubbleStyle)||void 0===o?void 0:o.typingContainerStyle],children:[C&&x>0&&e.jsxs(r.View,{style:{position:"absolute",top:0,left:S,flexDirection:"row"},children:[p.map((function(t,o){var i,a,l;return e.jsx(r.View,{style:[n(Eo||(Eo=_(["bg-gray-400 w-6 h-6 rounded-full items-center"]))),{marginLeft:o>0?-10:0,zIndex:p.length+o}],children:t.avatar?e.jsx(r.Image,{source:{uri:t.avatar},style:[n(jo||(jo=_(["w-full h-full object-cover rounded-full"]))),null==d||null===(i=d.bubbleStyle)||void 0===i?void 0:i.avatarImageStyle]}):e.jsx(r.Text,{style:J([n(Mo||(Mo=_(["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===(l=t.name)||void 0===l?void 0:l.charAt(0)})},t.id)})),y>0&&e.jsx(r.View,{style:[n(Io||(Io=_(["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(r.Text,{style:J([n(_o||(_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]})})]}),f&&e.jsx(G,{style:n.style("absolute -top-[3px] w-6 h-6 rotate-180 -left-3.5 mt-[1.5px]"),color:(null==d||null===(l=d.colors)||void 0===l?void 0:l.receivedMessageTailColor)||"white"}),h?h():e.jsx(r.View,{style:n(Po||(Po=_(["flex-row items-center py-3 px-2 justify-center"]))),children:e.jsx(r.Text,{style:J([n(To||(To=_(["text-gray-600"]))),null==d||null===(s=d.bubbleStyle)||void 0===s?void 0:s.typingTextStyle],null==d?void 0:d.fontFamily),children:null!=v?v:"Typing..."})})]})},Lo=function(t){var r=t.style,n=t.color,i=void 0===n?"#FFFFFF":n;return e.jsx(o,{style:r,viewBox:"0 0 24 24",children:e.jsx(o.Path,{fill:i,d:"M8 17q-.825 0-1.412-.587T6 15V9q0-.825.588-1.412T8 7h1l1-1h4l1 1h1q.825 0 1.413.588T18 9v6q0 .825-.587 1.413T16 17zm4-3q.825 0 1.413-.587T14 12t-.587-1.412T12 10t-1.412.588T10 12t.588 1.413T12 14M8.55.5Q9.4.225 10.263.113T12 0q2.35 0 4.438.838t3.7 2.325t2.637 3.5T24 11h-2q-.175-1.8-.95-3.363t-1.988-2.762t-2.787-1.937T12.9 2.05l1.55 1.55l-1.4 1.4zm6.9 23q-.85.275-1.712.388T12 24q-2.35 0-4.437-.837t-3.7-2.325t-2.638-3.5T0 13h2q.2 1.8.963 3.363t1.975 2.762t2.787 1.938t3.375.887L9.55 20.4l1.4-1.4z"})})},Uo="#FFFFFF",Ho="ios"===r.Platform.OS?50:28,zo="ios"===r.Platform.OS?34:18,Wo=null;try{Wo=require("react-native-vision-camera")}catch(e){Wo=null}var No,Qo,Yo,qo,Jo,Xo,$o,Zo,ei,ti,ri,ni,oi,ii,ai,li,si,Ai,ci,ui,di,Ci,hi=null!=Wo,fi=null===(Ro=Wo)||void 0===Ro?void 0:Ro.Camera,vi=null===(Oo=Wo)||void 0===Oo?void 0:Oo.useCameraDevice,mi=null===(Go=Wo)||void 0===Go?void 0:Go.useCameraPermission,pi=null===(Fo=Wo)||void 0===Fo?void 0:Fo.useMicrophonePermission;var gi,yi,xi,bi,wi,Si,ki,Ei,ji,Mi,Ii,_i=function(o){var a=o.visible,l=o.onClose,s=o.onCapture,A=o.cameraProps,c=o.cameraUIProps,u=o.renderCameraScreen,d=o.themePrimary,C=o.fontFamily,h=t.useMemo((function(){return function(e){var t,r,n,o,i,a,l,s;return{enablePhoto:null===(t=null==e?void 0:e.enablePhoto)||void 0===t||t,enableVideo:null===(r=null==e?void 0:e.enableVideo)||void 0===r||r,enableZoom:null===(n=null==e?void 0:e.enableZoom)||void 0===n||n,enableSwitchCamera:null===(o=null==e?void 0:e.enableSwitchCamera)||void 0===o||o,enableAudio:null===(i=null==e?void 0:e.enableAudio)||void 0===i||i,maxVideoDuration:null!==(a=null==e?void 0:e.maxVideoDuration)&&void 0!==a?a:60,maxZoom:null!==(l=null==e?void 0:e.maxZoom)&&void 0!==l?l:8,photoQuality:null!==(s=null==e?void 0:e.photoQuality)&&void 0!==s?s:"balanced",videoQuality:null==e?void 0:e.videoQuality}}(A)}),[A]);return a?e.jsx(r.Modal,{visible:!0,animationType:"slide",transparent:!1,onRequestClose:l,statusBarTranslucent:!0,children:e.jsx(i.GestureHandlerRootView,{style:n(No||(No=_(["flex-1"]))),children:hi?e.jsx(Oi,{config:h,cameraUIProps:c,renderCameraScreen:u,onCapture:s,onClose:l,themePrimary:d,fontFamily:C}):e.jsx(Li,{onClose:l,fontFamily:C})})}):null},Pi={code:"function CameraScreenTsx1(){const{zoomBaseShared,zoomShared}=this.__closure;zoomBaseShared.value=zoomShared.value;}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx",sourceMap:'{"version":3,"names":["CameraScreenTsx1","zoomBaseShared","zoomShared","__closure","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx"],"mappings":"AAyDiB,SAAAA,gBAAMA,CAAA,QAAAC,cAAA,CAAAC,UAAA,OAAAC,SAAA,CAEfF,cAAc,CAACG,KAAK,CAAGF,UAAU,CAACE,KAAK,CAC3C","ignoreList":[]}',version:"3.16.7"},Ti={code:"function CameraScreenTsx2(e){const{config,zoomBaseShared,zoomShared}=this.__closure;const next=Math.max(1,Math.min(config.maxZoom,zoomBaseShared.value*e.scale));zoomShared.value=next;}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx",sourceMap:'{"version":3,"names":["CameraScreenTsx2","e","config","zoomBaseShared","zoomShared","__closure","next","Math","max","min","maxZoom","value","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx"],"mappings":"AA6DmB,QAAC,CAAAA,gBAAKA,CAAAC,CAAA,QAAAC,MAAA,CAAAC,cAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,IAAI,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAED,IAAI,CAACE,GAAG,CAACP,MAAM,CAACQ,OAAO,CAAEP,cAAc,CAACQ,KAAK,CAAGV,CAAC,CAACW,KAAK,CAAC,CAAC,CAClFR,UAAU,CAACO,KAAK,CAAGL,IAAI,CAC3B","ignoreList":[]}',version:"3.16.7"},Ri={code:"function CameraScreenTsx3(){const{runOnJS,ctrl,zoomShared}=this.__closure;runOnJS(ctrl.setZoom)(zoomShared.value);}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx",sourceMap:'{"version":3,"names":["CameraScreenTsx3","runOnJS","ctrl","zoomShared","__closure","setZoom","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx"],"mappings":"AAkEe,SAAAA,gBAAMA,CAAA,QAAAC,OAAA,CAAAC,IAAA,CAAAC,UAAA,OAAAC,SAAA,CAEbH,OAAO,CAACC,IAAI,CAACG,OAAO,CAAC,CAACF,UAAU,CAACG,KAAK,CAAC,CAC3C","ignoreList":[]}',version:"3.16.7"},Oi=function(o){var l,s,A,c,d,C,h,f,v,m,p,g,y,x,b,w=o.config,S=o.cameraUIProps,k=o.renderCameraScreen,E=o.onCapture,j=o.onClose,M=o.themePrimary,P=o.fontFamily,T=function(e){var r=e.config,n=e.onCapture,o=t.useRef(null),i=I(t.useState("back"),2),a=i[0],l=i[1],s=vi(a),A=mi(),c=pi(),d=I(t.useState(!1),2),C=d[0],h=d[1],f=I(t.useState(!1),2),v=f[0],m=f[1],p=I(t.useState(1),2),g=p[0],y=p[1],x=I(t.useState(0),2),b=x[0],w=x[1],S=t.useRef(null);t.useEffect((function(){u(O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,null==A||!A.requestPermission||A.hasPermission){e.next=4;break}return e.next=4,A.requestPermission();case 4:if(!r.enableAudio||null==c||!c.requestPermission||c.hasPermission){e.next=7;break}return e.next=7,c.requestPermission();case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.warn("[movius-chats] camera permission error",e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})))()}),[A,c,r.enableAudio]),t.useEffect((function(){if(v){w(0);var e=Date.now(),t=setInterval((function(){var t=Math.floor((Date.now()-e)/1e3);w(t),t>=r.maxVideoDuration&&j()}),250);return function(){return clearInterval(t)}}}),[v,r.maxVideoDuration]);var k=t.useCallback(u(O().mark((function e(){var t,i,a;return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.current&&r.enablePhoto){e.next=2;break}return e.abrupt("return",null);case 2:return e.prev=2,e.next=5,o.current.takePhoto({qualityPrioritization:r.photoQuality});case 5:return t=e.sent,i=t.path.startsWith("file://")?t.path:"file://".concat(t.path),a={uri:i,type:"image",width:t.width,height:t.height},n(a),e.abrupt("return",a);case 12:return e.prev=12,e.t0=e.catch(2),console.warn("[movius-chats] capturePhoto failed",e.t0),e.abrupt("return",null);case 16:case"end":return e.stop()}}),e,null,[[2,12]])}))),[r.enablePhoto,r.photoQuality,n]),E=t.useCallback(u(O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.current&&r.enableVideo){e.next=2;break}return e.abrupt("return");case 2:m(!0);try{o.current.startRecording({fileType:"mp4",flash:"off",onRecordingFinished:function(e){var t,r={uri:e.path.startsWith("file://")?e.path:"file://".concat(e.path),type:"video",duration:e.duration,width:e.width,height:e.height};m(!1),w(0),n(r),null===(t=S.current)||void 0===t||t.resolve(r),S.current=null},onRecordingError:function(e){var t;console.warn("[movius-chats] recording error",e),m(!1),w(0),null===(t=S.current)||void 0===t||t.resolve(null),S.current=null}})}catch(e){console.warn("[movius-chats] startRecording failed",e),m(!1)}case 4:case"end":return e.stop()}}),e)}))),[r.enableVideo,n]),j=t.useCallback(u(O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o.current){e.next=2;break}return e.abrupt("return",null);case 2:return e.abrupt("return",new Promise((function(e){S.current={resolve:e};try{o.current.stopRecording()}catch(t){console.warn("[movius-chats] stopRecording failed",t),S.current=null,e(null)}})));case 3:case"end":return e.stop()}}),e)}))),[]),M=t.useCallback((function(){r.enableSwitchCamera&&l((function(e){return"back"===e?"front":"back"}))}),[r.enableSwitchCamera]),_=t.useCallback((function(){h(!0)}),[]),P=t.useCallback((function(e){if(r.enableZoom){var t=Math.max(1,Math.min(r.maxZoom,e));y(t)}}),[r.enableZoom,r.maxZoom]);return{cameraRef:o,Camera:fi,device:s,cameraPerm:A,micPerm:c,facing:a,isCameraReady:C,isRecording:v,zoom:g,elapsed:b,onInitialized:_,capturePhoto:k,startRecording:E,stopRecording:j,switchCamera:M,setZoom:P}}({config:w,onCapture:E}),R=I(t.useState(w.enablePhoto?"photo":"video"),2),G=R[0],F=R[1],V=null!==(l=null==S?void 0:S.captureButtonSize)&&void 0!==l?l:72,D=null!==(s=null==S?void 0:S.controlButtonSize)&&void 0!==s?s:40,K=null!==(A=null==S?void 0:S.backgroundColor)&&void 0!==A?A:"#000",B=null!==(c=null==S?void 0:S.captureRingColor)&&void 0!==c?c:Uo,L=null!==(d=null==S?void 0:S.recordingRingColor)&&void 0!==d?d:"#EF4444",U=null!==(C=null==S?void 0:S.recordingIndicatorColor)&&void 0!==C?C:"#EF4444",H=null!==(h=null==S?void 0:S.captureDotColor)&&void 0!==h?h:Uo,z=null!==(f=null!==(v=null==S?void 0:S.activeModeTextColor)&&void 0!==v?v:M)&&void 0!==f?f:"#FFFFFF",W=null!==(m=null==S?void 0:S.inactiveModeTextColor)&&void 0!==m?m:"rgba(255,255,255,0.7)",N=null!==(p=null==S?void 0:S.iconColor)&&void 0!==p?p:"#FFFFFF",Q=a.useSharedValue(1),Y=a.useSharedValue(1);t.useEffect((function(){Q.value=T.zoom,Y.value=T.zoom}),[T.zoom,Q,Y]);var q,X,$,Z,ee,te=i.Gesture.Pinch().enabled(!!w.enableZoom).onStart((q=[new global.Error,-3,-27],X=function(){Y.value=Q.value},X.__closure={zoomBaseShared:Y,zoomShared:Q},X.__workletHash=0xcc3ab6fb08f,X.__initData=Pi,X.__stackDetails=q,X)).onUpdate(function(){var e=[new global.Error,-4,-27],t=function(e){var t=Math.max(1,Math.min(w.maxZoom,Y.value*e.scale));Q.value=t};return t.__closure={config:w,zoomBaseShared:Y,zoomShared:Q},t.__workletHash=0xc08a45e6a7d,t.__initData=Ti,t.__stackDetails=e,t}()).onEnd(function(){var e=[new global.Error,-4,-27],t=function(){a.runOnJS(T.setZoom)(Q.value)};return t.__closure={runOnJS:a.runOnJS,ctrl:T,zoomShared:Q},t.__workletHash=0x918aea49a82,t.__initData=Ri,t.__stackDetails=e,t}()),re=function(){var e=u(O().mark((function e(){return O().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("photo"!==G){e.next=4;break}return e.next=3,T.capturePhoto();case 3:return e.abrupt("return");case 4:if(!T.isRecording){e.next=9;break}return e.next=7,T.stopRecording();case 7:e.next=11;break;case 9:return e.next=11,T.startRecording();case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=null!==(g=null===(y=T.cameraPerm)||void 0===y?void 0:y.hasPermission)&&void 0!==g&&g,oe=!(w.enableAudio&&"video"===G)||null!==(x=null===(b=T.micPerm)||void 0===b?void 0:b.hasPermission)&&void 0!==x&&x;if(k){var ie={isCameraReady:T.isCameraReady,isRecording:T.isRecording,facing:T.facing,zoom:T.zoom,elapsed:T.elapsed,capturePhoto:T.capturePhoto,startRecording:T.startRecording,stopRecording:T.stopRecording,switchCamera:T.switchCamera,setZoom:T.setZoom,close:j};return e.jsx(r.View,{style:[n(Qo||(Qo=_(["flex-1"]))),{backgroundColor:K}],children:k(ie)})}return e.jsxs(r.View,{style:[n(Yo||(Yo=_(["flex-1 relative"]))),{backgroundColor:K}],children:[e.jsx(i.GestureDetector,{gesture:te,children:e.jsx(r.View,{style:n(qo||(qo=_(["flex-1"]))),children:T.device&&ne?e.jsx(T.Camera,{ref:T.cameraRef,style:n(Jo||(Jo=_(["absolute inset-0"]))),device:T.device,isActive:!0,photo:w.enablePhoto,video:w.enableVideo,audio:w.enableAudio,zoom:T.zoom,onInitialized:T.onInitialized}):e.jsx(Bi,{fontFamily:P,cameraGranted:ne,audioGranted:oe})})}),e.jsxs(r.View,{style:[n(Xo||(Xo=_(["absolute left-0 right-0 flex-row justify-between items-center px-4"]))),{top:Ho}],pointerEvents:"box-none",children:[e.jsx(Gi,{size:D,onPress:j,bg:"rgba(0,0,0,0.5)",children:e.jsx(Ki,{size:.55*D,color:N})}),T.isRecording&&e.jsxs(r.View,{style:n($o||($o=_(["flex-row items-center gap-1.5 self-center"]))),children:[e.jsx(r.View,{style:[n(Zo||(Zo=_(["rounded-full"]))),{width:10,height:10,backgroundColor:U}]}),e.jsx(r.Text,{style:J([n(ei||(ei=_(["text-white font-semibold"]))),null==S?void 0:S.timerTextStyle],P),children:($=T.elapsed,Z=Math.floor($/60),ee=$%60,"".concat(Z.toString().padStart(2,"0"),":").concat(ee.toString().padStart(2,"0")))})]}),w.enableSwitchCamera&&!T.isRecording?e.jsx(Gi,{size:D,onPress:T.switchCamera,bg:"rgba(0,0,0,0.5)",children:e.jsx(Lo,{style:{width:.55*D,height:.55*D},color:N})}):e.jsx(r.View,{style:{width:D,height:D}})]}),e.jsxs(r.View,{style:[n(ti||(ti=_(["absolute left-0 right-0 items-center"]))),{bottom:zo}],pointerEvents:"box-none",children:[!T.isRecording&&w.enablePhoto&&w.enableVideo&&e.jsxs(r.View,{style:n(ri||(ri=_(["flex-row mb-5 px-1.5 py-1.5 rounded-full bg-black/40"]))),children:[e.jsx(Fi,{label:"Photo",active:"photo"===G,activeBg:z,inactiveColor:W,fontFamily:P,onPress:function(){return F("photo")}}),e.jsx(Fi,{label:"Video",active:"video"===G,activeBg:z,inactiveColor:W,fontFamily:P,onPress:function(){return F("video")}})]}),e.jsx(Di,{size:V,mode:G,isRecording:T.isRecording,ringColor:B,recRingColor:L,captureDotColor:H,recDotColor:U,onPress:re})]})]})},Gi=function(t){var o=t.size,i=t.onPress,a=t.bg,l=t.children,s=t.style;return e.jsx(r.Pressable,{onPress:i,style:[n(ni||(ni=_(["items-center justify-center"]))),{width:o,height:o,borderRadius:o/2,backgroundColor:a},s],children:l})},Fi=function(t){var o=t.label,i=t.active,a=t.activeBg,l=t.inactiveColor,s=t.fontFamily,A=t.onPress;return e.jsx(r.Pressable,{onPress:A,style:[n(oi||(oi=_(["px-4 py-1.5 rounded-full"]))),i?{backgroundColor:a}:n(ii||(ii=_(["bg-transparent"])))],children:e.jsx(r.Text,{style:J([n(ai||(ai=_(["text-sm font-medium"]))),{color:i?"#000000":l}],s),children:o})})},Vi={code:"function CameraScreenTsx4(){const{scale}=this.__closure;return{transform:[{scale:scale.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx",sourceMap:'{"version":3,"names":["CameraScreenTsx4","scale","__closure","transform","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/CameraScreen/CameraScreen.tsx"],"mappings":"AAiJwC,SAAAA,iBAAA,QAAAC,KAAA,OAAAC,SAAA,OAAO,CACvCC,SAAS,CAAE,CAAC,CAAEF,KAAK,CAAEA,KAAK,CAACG,KAAM,CAAC,CACtC,CAAC","ignoreList":[]}',version:"3.16.7"},Di=function(o){var i=o.size,l=o.mode,s=o.isRecording,A=o.ringColor,c=o.recRingColor,u=o.captureDotColor,d=o.onPress,C=a.useSharedValue(1);t.useEffect((function(){C.value=a.withTiming(s?.55:1,{duration:180})}),[s,C]);var h,f,v=a.useAnimatedStyle((h=[new global.Error,-2,-27],(f=function(){return{transform:[{scale:C.value}]}}).__closure={scale:C},f.__workletHash=1952157967078,f.__initData=Vi,f.__stackDetails=h,f)),m=.78*i,p="video"===l&&s?c:u;return e.jsx(r.Pressable,{onPress:d,children:e.jsx(r.View,{style:[n(li||(li=_(["items-center justify-center"]))),{width:i,height:i,borderRadius:i/2,borderWidth:4,borderColor:s&&"video"===l?c:A}],children:e.jsx(a.View,{style:[v,{width:m,height:m,borderRadius:s&&"video"===l?8:m/2,backgroundColor:p}]})})})},Ki=function(t){var r=t.size,n=t.color;return e.jsxs(o,{width:r,height:r,viewBox:"0 0 24 24",children:[e.jsx(o.Line,{x1:"18",y1:"6",x2:"6",y2:"18",stroke:n,strokeWidth:2,strokeLinecap:"round"}),e.jsx(o.Line,{x1:"6",y1:"6",x2:"18",y2:"18",stroke:n,strokeWidth:2,strokeLinecap:"round"})]})},Bi=function(t){var o=t.fontFamily,i=t.cameraGranted,a=t.audioGranted;return e.jsx(r.View,{style:n(si||(si=_(["flex-1 items-center justify-center px-8"]))),children:e.jsx(r.Text,{style:J([n(Ai||(Ai=_(["text-white text-base text-center"])))],o),children:i?a?"Initializing camera…":"Microphone permission is required to record video.":"Camera permission is required to use this feature."})})},Li=function(t){var o=t.onClose,i=t.fontFamily;return e.jsxs(r.View,{style:n(ci||(ci=_(["flex-1 bg-black items-center justify-center px-8"]))),children:[e.jsx(r.Text,{style:J([n(ui||(ui=_(["text-white text-base text-center mb-4"])))],i),children:"`react-native-vision-camera` is not installed. Install version 4.7.3 and rebuild the app to use the built-in camera, or pass your own `renderCameraScreen` / `onCameraPress` instead."}),e.jsx(r.Pressable,{onPress:o,style:n(di||(di=_(["px-6 py-2.5 rounded-full bg-white/15"]))),children:e.jsx(r.Text,{style:J([n(Ci||(Ci=_(["text-white text-sm font-medium"])))],i),children:"Close"})})]})};var Ui,Hi,zi,Wi,Ni,Qi,Yi,qi,Ji,Xi={code:"function VoiceRecorderTsx1(){const{isPaused,pauseOpacity}=this.__closure;return{opacity:isPaused?1:pauseOpacity.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx1","isPaused","pauseOpacity","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAiCgD,SAAAA,kBAAA,QAAAC,QAAA,CAAAC,YAAA,OAAAC,SAAA,OAAO,CAC/CC,OAAO,CAAEH,QAAQ,CAAG,CAAC,CAAGC,YAAY,CAACG,KACzC,CAAC","ignoreList":[]}',version:"3.16.7"},$i={code:"function VoiceRecorderTsx2(){const{recBlink}=this.__closure;return{opacity:recBlink.value};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx2","recBlink","__closure","opacity","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecorder.tsx"],"mappings":"AAoCyC,SAAAA,kBAAA,QAAAC,QAAA,OAAAC,SAAA,OAAO,CACxCC,OAAO,CAAEF,QAAQ,CAACG,KACtB,CAAC","ignoreList":[]}',version:"3.16.7"},Zi=function(o){var i=o.color,l=o.count,s=a.useSharedValue(0);return t.useEffect((function(){s.value=a.withRepeat(a.withTiming(1,{duration:4500,easing:a.Easing.linear}),-1,!1)}),[]),e.jsx(r.View,{style:n(Mi||(Mi=_(["flex-row items-center justify-between h-6"]))),children:Array.from({length:l}).map((function(t,r){return e.jsx(ta,{index:r,total:l,tick:s,color:i},r)}))})},ea={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 edge=Math.sin(index/Math.max(1,total-1)*Math.PI);const amp=Math.max(0.18,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/VoiceRecorder.tsx",sourceMap:'{"version":3,"names":["VoiceRecorderTsx3","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/VoiceRecorder.tsx"],"mappings":"AAuF2C,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,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"},ta=function(t){var r,o,i=t.index,l=t.total,s=t.tick,A=t.color,c=a.useAnimatedStyle((r=[new global.Error,-4,-27],(o=function(){var e=s.value*Math.PI*2,t=.5*(.55*Math.sin(2*e+.55*i)+.3*Math.sin(4*e+1.3*i)+.4*Math.sin(.9*e+.27*i))+.5,r=Math.sin(i/Math.max(1,l-1)*Math.PI),n=Math.max(.18,Math.min(1,t)*(.35+.65*r));return{height:"".concat(Math.round(100*n),"%")}}).__closure={tick:s,index:i,total:l},o.__workletHash=5267961911334,o.__initData=ea,o.__stackDetails=r,o));return e.jsx(a.View,{style:[n(Ii||(Ii=_(["mx-px rounded-full"]))),{width:2,backgroundColor:A},c]})};function ra(){r.Vibration.vibrate(15)}var na,oa,ia,aa,la,sa={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":"AAoDiB,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"},Aa={code:"function VoiceRecordingGestureTsx2(e){const{dragX,dragY,lockFired,LOCK_THRESHOLD,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;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","runOnJS","fireLock","cancelFired","CANCEL_THRESHOLD","fireCancel","__closure","x","Math","min","translationX","y","translationY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA2DmB,QAAC,CAAAA,yBAAKA,CAAAC,CAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,SAAA,CAAAC,cAAA,CAAAC,OAAA,CAAAC,QAAA,CAAAC,WAAA,CAAAC,gBAAA,CAAAC,UAAA,OAAAC,SAAA,CAEjB,KAAM,CAAAC,CAAC,CAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACc,YAAY,CAAC,CACrC,KAAM,CAAAC,CAAC,CAAGH,IAAI,CAACC,GAAG,CAAC,CAAC,CAAEb,CAAC,CAACgB,YAAY,CAAC,CACrCf,KAAK,CAACgB,KAAK,CAAGN,CAAC,CACfT,KAAK,CAACe,KAAK,CAAGF,CAAC,CACf,GAAIZ,SAAS,CAACc,KAAK,GAAK,CAAC,EAAIF,CAAC,EAAI,CAACX,cAAc,CAAE,CAC/CD,SAAS,CAACc,KAAK,CAAG,CAAC,CACnBZ,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"},ca={code:"function VoiceRecordingGestureTsx3(){const{lockFired,cancelFired,dragX,withSpring,dragY}=this.__closure;if(lockFired.value===0&&cancelFired.value===0){dragX.value=withSpring(0,{damping:18,stiffness:220});dragY.value=withSpring(0,{damping:18,stiffness:220});}}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx3","lockFired","cancelFired","dragX","withSpring","dragY","__closure","value","damping","stiffness"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA0EoB,SAAAA,yBAAMA,CAAA,QAAAC,SAAA,CAAAC,WAAA,CAAAC,KAAA,CAAAC,UAAA,CAAAC,KAAA,OAAAC,SAAA,CAElB,GAAIL,SAAS,CAACM,KAAK,GAAK,CAAC,EAAIL,WAAW,CAACK,KAAK,GAAK,CAAC,CAAE,CAClDJ,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"},ua={code:"function VoiceRecordingGestureTsx4(){const{dragX,CANCEL_THRESHOLD,arrowPulse}=this.__closure;const progress=Math.min(1,Math.abs(dragX.value)/CANCEL_THRESHOLD);return{transform:[{translateX:dragX.value*0.4+arrowPulse.value}],opacity:1-progress};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx4","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":"AAiF4C,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,GAAG,CAAGN,UAAU,CAACM,KAAM,CAAC,CAAC,CACjEG,OAAO,CAAE,CAAC,CAAGP,QACjB,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},da={code:"function VoiceRecordingGestureTsx5(){const{dragY,LOCK_THRESHOLD,interpolate}=this.__closure;const lockProgress=Math.min(1,Math.max(0,-dragY.value/LOCK_THRESHOLD));return{transform:[{translateY:interpolate(lockProgress,[0,1],[0,-22])}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx5","dragY","LOCK_THRESHOLD","interpolate","__closure","lockProgress","Math","min","max","value","transform","translateY"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAwF2C,SAAAA,yBAAMA,CAAA,QAAAC,KAAA,CAAAC,cAAA,CAAAC,WAAA,OAAAC,SAAA,CACzC,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,SAAS,CAAE,CAAC,CAAEC,UAAU,CAAER,WAAW,CAACE,YAAY,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC,CAAE,CAAC,CAC3E,CAAC,CACL","ignoreList":[]}',version:"3.16.7"},Ca={code:"function VoiceRecordingGestureTsx6(){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":["VoiceRecordingGestureTsx6","chevronPulse","__closure","transform","translateY","value"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AA8F0C,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"},ha={code:"function VoiceRecordingGestureTsx7(){const{dragX,dragY,micPulse}=this.__closure;return{transform:[{translateX:dragX.value},{translateY:dragY.value},{scale:micPulse.value}]};}",location:"/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx",sourceMap:'{"version":3,"names":["VoiceRecordingGestureTsx7","dragX","dragY","micPulse","__closure","transform","translateX","value","translateY","scale"],"sources":["/home/eadav/Documents/packages/Movius-Chats/src/components/VoiceRecorder/VoiceRecordingGesture.tsx"],"mappings":"AAiGsC,SAAAA,0BAAA,QAAAC,KAAA,CAAAC,KAAA,CAAAC,QAAA,OAAAC,SAAA,OAAO,CACrCC,SAAS,CAAE,CACP,CAAEC,UAAU,CAAEL,KAAK,CAACM,KAAM,CAAC,CAC3B,CAAEC,UAAU,CAAEN,KAAK,CAACK,KAAM,CAAC,CAC3B,CAAEE,KAAK,CAAEN,QAAQ,CAACI,KAAM,CAAC,CAEjC,CAAC","ignoreList":[]}',version:"3.16.7"},fa=function(){var o,i,a,l,s=K(),A=s.messages,c=s.currentUserId,u=s.onMessageLongPress,d=s.mediaViewerGallery,C=s.clearMediaViewerGallery,h=s.typingUsers,f=s.onSendMessage,v=s.onTypingStart,m=s.onTypingEnd,p=s.onAttachmentPress,g=s.onAudioRecordEnd,y=s.onAudioRecordStart,x=s.onCameraPress,b=s.renderCustomInput,w=s.CustomEmojiIcon,S=s.CustomAttachmentIcon,k=s.CustomCameraIcon,E=s.CustomMicrophoneIcon,j=s.CustomSendIcon,M=s.CustomFileIcon,P=s.CustomImagePreview,T=s.CustomVideoPreview,R=s.keyboardVerticalOffset,O=void 0===R?0:R,G=s.disableKeyboardAvoiding,F=void 0!==G&&G,V=s.startReply,D=s.actionSheetMessage,B=s.actionAnchor,L=s.openActionSheet,U=s.closeActionSheet,H=s.messageActionProps,z=s.messageActionUI,W=s.renderMessageActions,N=s.onCopyMessage,Q=s.onDeleteMessage,Y=s.onForwardMessage,q=s.startEdit,J=s.enterSelectionMode,X=s.cameraVisible,$=s.openCamera,Z=s.closeCamera,ee=s.enableBuiltInCamera,te=s.cameraProps,re=s.cameraUIProps,ne=s.renderCameraScreen,oe=s.onCameraCapture,ie=s.theme,ae=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=I(t.useState(0),2),o=n[0],i=n[1];return t.useEffect((function(){if(e){var t="ios"===r.Platform.OS?"keyboardWillShow":"keyboardDidShow",n="ios"===r.Platform.OS?"keyboardWillHide":"keyboardDidHide",o=r.Keyboard.addListener(t,(function(e){i(e.endCoordinates.height)})),a=r.Keyboard.addListener(n,(function(){return i(0)}));return function(){o.remove(),a.remove()}}i(0)}),[e]),e?o:0}(!F),le=t.useCallback((function(e,t){u?u(e):L(e,t)}),[u,L]),se=t.useCallback((function(e,t){switch(U(),e){case"reply":V(t);break;case"copy":N?N(t):oo(t);break;case"edit":q(t);break;case"delete":null==Q||Q(t);break;case"forward":null==Y||Y(t);break;case"select":J(t)}}),[U,V,N,Q,Y,q,J]),Ae=t.useCallback((function(){x?x():ee&&$()}),[x,ee,$]),ce=b?b():e.jsx(no,{onSendMessage:f,onTypingStart:v,onTypingEnd:m,onAttachmentPress:p,onAudioRecordEnd:g,onAudioRecordStart:y,onCameraPress:Ae,CustomEmojiIcon:w,CustomAttachmentIcon:S,CustomCameraIcon:k,CustomMicrophoneIcon:E,CustomSendIcon:j,CustomFileIcon:M,CustomImagePreview:P,CustomVideoPreview:T}),ue=null!==(o=null!==(i=null==ie||null===(a=ie.inputStyles)||void 0===a||null===(a=a.sendButtonStyle)||void 0===a?void 0:a.backgroundColor)&&void 0!==i?i:null==ie||null===(l=ie.colors)||void 0===l?void 0:l.sentBubbleBackgroundColor)&&void 0!==o?o:void 0,de=D?W?W(D,U,null!=B?B:void 0):e.jsx(wo,{message:D,anchor:B,visible:!0,onClose:U,flags:H,ui:z,fontFamily:null==ie?void 0:ie.fontFamily,onAction:se}):null,Ce=e.jsxs(r.View,{style:n(na||(na=_(["flex-1 px-2 pb-4 gap-2 relative"]))),children:[e.jsx(r.FlatList,{style:n(oa||(oa=_(["flex-1"]))),data:A,keyExtractor:function(e){return e.id},renderItem:function(t){var r,n=t.item,o=t.index;return e.jsx(Sr,{message:n,isCurrentUser:n.senderId===c,onLongPress:function(e){return le(n,e)},isFirstInSequence:o===A.length-1||(null===(r=A[o+1])||void 0===r?void 0:r.senderId)!==n.senderId})},ListHeaderComponent:e.jsx(Bo,{typingUsers:h||[],currentUserId:c}),showsVerticalScrollIndicator:!1,inverted:!0,keyboardShouldPersistTaps:"handled",keyboardDismissMode:"interactive"}),e.jsx(r.View,{style:!F&&ae>0?{marginBottom:ae}:void 0,children:ce}),e.jsx(Ko,{gallery:d,onClose:C}),de,ee&&e.jsx(_i,{visible:X,onClose:Z,onCapture:function(e){Z(),null==oe||oe(e)},cameraProps:te,cameraUIProps:re,renderCameraScreen:ne,themePrimary:ue,fontFamily:null==ie?void 0:ie.fontFamily})]});return F?e.jsx(r.View,{style:n(ia||(ia=_(["flex-1"]))),children:Ce}):"android"===r.Platform.OS?e.jsx(r.View,{style:n(aa||(aa=_(["flex-1"]))),children:Ce}):e.jsx(r.KeyboardAvoidingView,{style:n(la||(la=_(["flex-1"]))),behavior:"padding",keyboardVerticalOffset:O,children:Ce})};exports.CameraScreen=_i,exports.InlineReply=jt,exports.MessageActionsPopover=wo,exports.MessageActionsSheet=function(t){var o=t.message,i=t.visible,a=t.onClose,l=t.flags,s=t.fontFamily,A=t.backgroundColor,c=void 0===A?"#1f2937":A,u=t.textColor,d=void 0===u?"#FFFFFF":u,C=t.iconColor,h=void 0===C?"#FFFFFF":C,f=t.destructiveColor,v=void 0===f?"#ef4444":f,m=t.rowStyle,p=t.rowTextStyle,g=t.onAction;if(!o)return null;var y=function(e){return[{id:"reply",label:"Reply",Icon:ee},{id:"copy",label:"Copy",Icon:io},{id:"edit",label:"Edit",Icon:Er},{id:"forward",label:"Forward",Icon:ao},{id:"delete",label:"Delete",Icon:An,destructive:!0}].filter((function(t){switch(t.id){case"reply":return!1!==(null==e?void 0:e.enableReply);case"copy":return!1!==(null==e?void 0:e.enableCopy);case"edit":return!1!==(null==e?void 0:e.enableEdit);case"delete":return!1!==(null==e?void 0:e.enableDelete);case"forward":return!1!==(null==e?void 0:e.enableForward);default:return!0}}))}(l);return e.jsx(r.Modal,{visible:i,transparent:!0,animationType:"fade",onRequestClose:a,statusBarTranslucent:!0,children:e.jsxs(r.Pressable,{onPress:a,style:n(so||(so=_(["flex-1 bg-black/50 justify-end"]))),children:[e.jsx(r.Pressable,{onPress:function(){},style:[n(Ao||(Ao=_(["mx-3 mb-6 rounded-2xl overflow-hidden"]))),{backgroundColor:c}],children:y.map((function(t,i){var a=t.destructive?v:d,l=t.destructive?v:h;return e.jsxs(r.Pressable,{onPress:function(){g(t.id,o)},style:[n(co||(co=_(["flex-row items-center justify-between px-5 py-4"]))),0!==i?{borderTopWidth:.5,borderTopColor:"rgba(255,255,255,0.08)"}:null,m],children:[e.jsx(r.Text,{style:J([n(uo||(uo=_(["text-[16px] font-medium"]))),{color:a},p],s),children:t.label}),e.jsx(r.View,{style:{width:22,height:22},children:e.jsx(t.Icon,{style:{width:22,height:22},color:l})})]},t.id)}))}),e.jsx(r.Pressable,{onPress:a,style:[n(Co||(Co=_(["mx-3 mb-3 rounded-2xl py-4 items-center"]))),{backgroundColor:c}],children:e.jsx(r.Text,{style:J([n(ho||(ho=_(["text-[16px] font-semibold"]))),{color:d}],s),children:"Cancel"})})]})})},exports.ReplyPreview=en,exports.SwipeableMessage=ae,exports.VoiceRecorder=function(o){var i=o.primaryColor,l=void 0===i?"#16A34A":i,s=o.backgroundColor,A=void 0===s?"#0B141A":s,c=o.waveformColor,u=void 0===c?"#E9EDEF":c,d=o.timerColor,C=void 0===d?"#FFFFFF":d,h=o.sendButtonColor,f=o.deleteIconColor,v=void 0===f?"#8696A0":f,m=o.pauseIconColor,p=void 0===m?"#F15C6D":m,g=o.borderRadius,y=void 0===g?16:g,x=o.sendButtonSize,b=void 0===x?50:x,w=o.waveCount,S=void 0===w?32:w,k=o.renderDeleteIcon,E=o.renderSendIcon,j=o.renderPauseIcon,M=o.renderPlayIcon,P=o.renderWaveform,T=o.onSend,R=o.onDelete,O=o.onPause,G=o.onResume,F=I(t.useState(0),2),V=F[0],D=F[1],K=I(t.useState(!1),2),B=K[0],L=K[1],U=t.useRef(Date.now()),H=t.useRef(0),z=t.useRef(0);t.useEffect((function(){U.current=Date.now()}),[]),t.useEffect((function(){if(!B){var e=setInterval((function(){D((Date.now()-U.current-H.current)/1e3)}),250);return function(){return clearInterval(e)}}}),[B]);var W=a.useSharedValue(1),N=a.useSharedValue(1);t.useEffect((function(){W.value=a.withRepeat(a.withSequence(a.withTiming(.5,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),N.value=a.withRepeat(a.withSequence(a.withTiming(.3,{duration:600}),a.withTiming(1,{duration:600})),-1,!1)}),[]);var Q,Y,q=a.useAnimatedStyle((Q=[new global.Error,-3,-27],(Y=function(){return{opacity:B?1:W.value}}).__closure={isPaused:B,pauseOpacity:W},Y.__workletHash=0xf63a8f6d95,Y.__initData=Xi,Y.__stackDetails=Q,Y)),J=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{opacity:N.value}};return t.__closure={recBlink:N},t.__workletHash=6095431465582,t.__initData=$i,t.__stackDetails=e,t}()),X={backgroundColor:A,borderTopLeftRadius:y,borderTopRightRadius:y},$=null!=h?h:l;return e.jsxs(r.View,{style:[n(gi||(gi=_(["w-full px-4 py-2.5"]))),X],children:[e.jsxs(r.View,{style:n(yi||(yi=_(["flex-row items-center gap-3 px-1 pt-1.5 pb-2"]))),children:[e.jsx(a.View,{style:[n(xi||(xi=_(["w-1.5 h-1.5 rounded-full"]))),{backgroundColor:p},J]}),e.jsx(r.Text,{style:[n(bi||(bi=_(["text-base font-semibold"]))),{color:C,minWidth:42}],numberOfLines:1,children:at(V)}),e.jsx(r.View,{style:n(wi||(wi=_(["flex-1"]))),children:P?P():e.jsx(Zi,{color:u,count:S})})]}),e.jsxs(r.View,{style:n(Si||(Si=_(["flex-row items-center justify-between mt-1"]))),children:[e.jsx(r.Pressable,{onPress:R,hitSlop:12,style:[n(ki||(ki=_(["items-center justify-center rounded-full"]))),{width:b,height:b}],accessibilityRole:"button",accessibilityLabel:"Delete recording",children:k?k():e.jsx(An,{style:n.style("w-6 h-6"),color:v})}),e.jsx(r.Pressable,{onPress:function(){L((function(e){var t=!e;return t?(z.current=Date.now(),null==O||O()):(H.current+=Date.now()-z.current,z.current=0,null==G||G()),t}))},hitSlop:12,style:n(Ei||(Ei=_(["items-center justify-center px-4"]))),accessibilityRole:"button",accessibilityLabel:B?"Resume recording":"Pause recording",children:B?M?M():e.jsx(nt,{style:n.style("w-7 h-7"),color:p}):e.jsx(a.View,{style:q,children:j?j():e.jsx(rt,{style:n.style("w-7 h-7"),color:p})})}),e.jsx(r.Pressable,{onPress:T,hitSlop:6,accessibilityRole:"button",accessibilityLabel:"Send recording",style:[n(ji||(ji=_(["items-center justify-center rounded-full"]))),{width:b,height:b,backgroundColor:$}],children:E?E():e.jsx(_r,{style:n.style("w-6 h-6"),color:"#FFFFFF"})})]})]})},exports.VoiceRecorderFlow=En,exports.VoiceRecordingGesture=function(o){var l=o.primaryColor,s=void 0===l?"#16A34A":l,A=o.backgroundColor,c=void 0===A?"#1F2C33":A,u=o.timerColor,d=void 0===u?"#FFFFFF":u,C=o.microphoneColor,h=void 0===C?"#FFFFFF":C,f=o.lockColor,v=void 0===f?"#E9EDEF":f,m=o.lockPillBackground,p=void 0===m?"#1F2C33":m,g=o.cancelTextColor,y=void 0===g?"rgba(255,255,255,0.6)":g,x=o.barHeight,b=void 0===x?48:x,w=o.micSize,S=o.renderMicIcon,k=o.renderLockIcon,E=o.renderArrowIcon,j=o.onCancel,M=o.onLock,P=null!=w?w:b,T=I(t.useState(0),2),R=T[0],O=T[1],G=t.useRef(Date.now());t.useEffect((function(){G.current=Date.now();var e=setInterval((function(){O((Date.now()-G.current)/1e3)}),250);return function(){return clearInterval(e)}}),[]);var F=a.useSharedValue(0),V=a.useSharedValue(0),D=a.useSharedValue(0),K=a.useSharedValue(1),B=a.useSharedValue(0),L=a.useSharedValue(0),U=a.useSharedValue(0);t.useEffect((function(){D.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.18,{duration:700,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(1.12,{duration:700,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1),B.value=a.withRepeat(a.withSequence(a.withTiming(-4,{duration:600,easing:a.Easing.inOut(a.Easing.ease)}),a.withTiming(0,{duration:600,easing:a.Easing.inOut(a.Easing.ease)})),-1,!1)}),[]);var H=t.useRef(j);H.current=j;var z=t.useRef(M);z.current=M;var W,N,Q=function(){var e;ra(),null===(e=H.current)||void 0===e||e.call(H)},Y=function(){var e;ra(),null===(e=z.current)||void 0===e||e.call(z)},q=i.Gesture.Pan().minDistance(0).onBegin((W=[new global.Error,-5,-27],N=function(){L.value=0,U.value=0,F.value=0,V.value=0},N.__closure={cancelFired:L,lockFired:U,dragX:F,dragY:V},N.__workletHash=9031413480896,N.__initData=sa,N.__stackDetails=W,N)).onUpdate(function(){var e=[new global.Error,-10,-27],t=function(e){var t=Math.min(0,e.translationX),r=Math.min(0,e.translationY);F.value=t,V.value=r,0===U.value&&r<=-70&&(U.value=1,a.runOnJS(Y)()),0===L.value&&t<=-90&&(L.value=1,a.runOnJS(Q)())};return t.__closure={dragX:F,dragY:V,lockFired:U,LOCK_THRESHOLD:70,runOnJS:a.runOnJS,fireLock:Y,cancelFired:L,CANCEL_THRESHOLD:90,fireCancel:Q},t.__workletHash=0xac60b03bef6,t.__initData=Aa,t.__stackDetails=e,t}()).onFinalize(function(){var e=[new global.Error,-6,-27],t=function(){0===U.value&&0===L.value&&(F.value=a.withSpring(0,{damping:18,stiffness:220}),V.value=a.withSpring(0,{damping:18,stiffness:220}))};return t.__closure={lockFired:U,cancelFired:L,dragX:F,withSpring:a.withSpring,dragY:V},t.__workletHash=0x962b8aa90f5,t.__initData=ca,t.__stackDetails=e,t}()),J=a.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.abs(F.value)/90);return{transform:[{translateX:.4*F.value+D.value}],opacity:1-e}};return t.__closure={dragX:F,CANCEL_THRESHOLD:90,arrowPulse:D},t.__workletHash=2609121094002,t.__initData=ua,t.__stackDetails=e,t}()),X=a.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){var e=Math.min(1,Math.max(0,-V.value/70));return{transform:[{translateY:a.interpolate(e,[0,1],[0,-22])}]}};return t.__closure={dragY:V,LOCK_THRESHOLD:70,interpolate:a.interpolate},t.__workletHash=2770335161610,t.__initData=da,t.__stackDetails=e,t}()),$=a.useAnimatedStyle(function(){var e=[new global.Error,-2,-27],t=function(){return{transform:[{translateY:B.value}]}};return t.__closure={chevronPulse:B},t.__workletHash=0xe2617d14eaa,t.__initData=Ca,t.__stackDetails=e,t}()),Z=a.useAnimatedStyle(function(){var e=[new global.Error,-4,-27],t=function(){return{transform:[{translateX:F.value},{translateY:V.value},{scale:K.value}]}};return t.__closure={dragX:F,dragY:V,micPulse:K},t.__workletHash=0xa3ed9ad56cd,t.__initData=ha,t.__stackDetails=e,t}());return e.jsxs(r.View,{style:n(Ui||(Ui=_(["w-full flex-row items-end gap-2 relative"]))),pointerEvents:"box-none",children:[e.jsxs(r.View,{style:[n(Hi||(Hi=_(["flex-1 flex-row items-center px-4 rounded-3xl"]))),{minHeight:b,backgroundColor:c}],children:[e.jsx(r.Text,{style:[n(zi||(zi=_(["text-base font-semibold"]))),{color:d,minWidth:42}],numberOfLines:1,children:at(R)}),e.jsxs(a.View,{style:[n(Wi||(Wi=_(["flex-1 flex-row items-center justify-center gap-1.5"]))),J],children:[E?E():e.jsx(r.Text,{style:[n(Ni||(Ni=_(["text-base leading-none"]))),{color:y,marginTop:-2}],children:"‹"}),e.jsx(r.Text,{style:[n(Qi||(Qi=_(["text-sm"]))),{color:y}],children:"Slide to cancel"})]})]}),e.jsxs(r.View,{style:[n(Yi||(Yi=_(["relative items-center justify-center"]))),{height:b,width:b}],children:[e.jsxs(a.View,{style:[n(qi||(qi=_(["absolute items-center justify-center rounded-2xl py-2.5"]))),{width:P-8,backgroundColor:p,bottom:P+6,gap:6},X],pointerEvents:"none",children:[k?k():e.jsx(an,{style:{width:18,height:18},color:v}),e.jsx(a.View,{style:$,children:e.jsx(on,{style:{width:14,height:14},color:v})})]}),e.jsx(i.GestureDetector,{gesture:q,children:e.jsx(a.View,{style:[n(Ji||(Ji=_(["items-center justify-center rounded-full"]))),{width:P,height:P,backgroundColor:s},Z],accessibilityRole:"button",accessibilityLabel:"Hold to record. Slide left to cancel, slide up to lock.",children:S?S():e.jsx(Mr,{style:{width:26,height:26},color:h})})})]})]})},exports.default=function(t){return e.jsx(it,{children:e.jsx(D,g(g({},t),{},{children:e.jsx(fa,{})}))})},exports.tryCopyMessage=oo;
17
17
  //# sourceMappingURL=index.js.map