(self.webpackChunk_npwd_nui=self.webpackChunk_npwd_nui||[]).push([[1060],{384:function(e,t,n){var r={"./material/app/BANK":[52764,2764],"./material/app/BANK.tsx":[52764,2764],"./material/app/BROWSER":[54525,859],"./material/app/BROWSER.tsx":[54525,859],"./material/app/CALCULATOR":[73183,3183],"./material/app/CALCULATOR.tsx":[73183,3183],"./material/app/CAMERA":[99128,9128],"./material/app/CAMERA.tsx":[99128,9128],"./material/app/CONTACTS":[87440,7440],"./material/app/CONTACTS.tsx":[87440,7440],"./material/app/DARKCHAT":[77032,7032],"./material/app/DARKCHAT.tsx":[77032,7032],"./material/app/DIALER":[95938,5938],"./material/app/DIALER.tsx":[95938,5938],"./material/app/EMAIL":[88165,8165],"./material/app/EMAIL.tsx":[88165,8165],"./material/app/EXAMPLE":[27977,7977],"./material/app/EXAMPLE.tsx":[27977,7977],"./material/app/LOCATION":[32941,2941],"./material/app/LOCATION.tsx":[32941,2941],"./material/app/MARKETPLACE":[69241,9241],"./material/app/MARKETPLACE.tsx":[69241,9241],"./material/app/MATCH":[96554,6554],"./material/app/MATCH.tsx":[96554,6554],"./material/app/MESSAGES":[70659,659],"./material/app/MESSAGES.tsx":[70659,659],"./material/app/NOTES":[38267,8267],"./material/app/NOTES.tsx":[38267,8267],"./material/app/SETTINGS":[68269,8269],"./material/app/SETTINGS.tsx":[68269,8269],"./material/app/TWITTER":[18261,8261],"./material/app/TWITTER.tsx":[18261,8261],"./material/misc/StickyNote":[56898,6898],"./material/misc/StickyNote.tsx":[56898,6898],"./material/svg/BANK":[57569,7569],"./material/svg/BANK.tsx":[57569,7569],"./material/svg/BROWSER":[34460,4460],"./material/svg/BROWSER.tsx":[34460,4460],"./material/svg/CALCULATOR":[4194,4194],"./material/svg/CALCULATOR.tsx":[4194,4194],"./material/svg/CAMERA":[35693,5693],"./material/svg/CAMERA.tsx":[35693,5693],"./material/svg/CONTACTS":[82014,2014],"./material/svg/CONTACTS.tsx":[82014,2014],"./material/svg/DARKCHAT":[21909,1909],"./material/svg/DARKCHAT.tsx":[21909,1909],"./material/svg/DIALER":[4389,4389],"./material/svg/DIALER.tsx":[4389,4389],"./material/svg/EMAIL":[63446,3446],"./material/svg/EMAIL.tsx":[63446,3446],"./material/svg/EXAMPLE":[84088,4088],"./material/svg/EXAMPLE.tsx":[84088,4088],"./material/svg/LOCATION":[76662,6662],"./material/svg/LOCATION.tsx":[76662,6662],"./material/svg/MARKETPLACE":[51967,1967],"./material/svg/MARKETPLACE.tsx":[51967,1967],"./material/svg/MATCH":[28174,8174],"./material/svg/MATCH.tsx":[28174,8174],"./material/svg/MESSAGES":[74299,4299],"./material/svg/MESSAGES.tsx":[74299,4299],"./material/svg/NOTES":[23079,3079],"./material/svg/NOTES.tsx":[23079,3079],"./material/svg/SETTINGS":[48535,8535],"./material/svg/SETTINGS.tsx":[48535,8535],"./material/svg/TWITTER":[69264,9264],"./material/svg/TWITTER.tsx":[69264,9264],"./npwd_icons/app/BANK":[39365,9365],"./npwd_icons/app/BANK.tsx":[39365,9365],"./npwd_icons/app/BROWSER":[18691,8691],"./npwd_icons/app/BROWSER.tsx":[18691,8691],"./npwd_icons/app/CALCULATOR":[36401,6401],"./npwd_icons/app/CALCULATOR.tsx":[36401,6401],"./npwd_icons/app/CAMERA":[84985,4985],"./npwd_icons/app/CAMERA.tsx":[84985,4985],"./npwd_icons/app/CONTACTS":[61429,1429],"./npwd_icons/app/CONTACTS.tsx":[61429,1429],"./npwd_icons/app/DARKCHAT":[53197,3051],"./npwd_icons/app/DARKCHAT.tsx":[53197,3051],"./npwd_icons/app/DIALER":[60038,38],"./npwd_icons/app/DIALER.tsx":[60038,38],"./npwd_icons/app/EMAIL":[61247,1247],"./npwd_icons/app/EMAIL.tsx":[61247,1247],"./npwd_icons/app/EXAMPLE":[75047,5047],"./npwd_icons/app/EXAMPLE.tsx":[75047,5047],"./npwd_icons/app/LOCATION":[24670,4670],"./npwd_icons/app/LOCATION.tsx":[24670,4670],"./npwd_icons/app/MARKETPLACE":[68881,8881],"./npwd_icons/app/MARKETPLACE.tsx":[68881,8881],"./npwd_icons/app/MATCH":[52612,2612],"./npwd_icons/app/MATCH.tsx":[52612,2612],"./npwd_icons/app/MESSAGES":[78706,8706],"./npwd_icons/app/MESSAGES.tsx":[78706,8706],"./npwd_icons/app/NOTES":[96960,6960],"./npwd_icons/app/NOTES.tsx":[96960,6960],"./npwd_icons/app/SETTINGS":[4401,4401],"./npwd_icons/app/SETTINGS.tsx":[4401,4401],"./npwd_icons/app/TWITTER":[18,18],"./npwd_icons/app/TWITTER.tsx":[18,18],"./npwd_icons/svg/BANK":[86643,6643],"./npwd_icons/svg/BANK.tsx":[86643,6643],"./npwd_icons/svg/BROWSER":[38357,8357],"./npwd_icons/svg/BROWSER.tsx":[38357,8357],"./npwd_icons/svg/CALCULATOR":[53488,3098],"./npwd_icons/svg/CALCULATOR.tsx":[53488,3098],"./npwd_icons/svg/CAMERA":[97865,7865],"./npwd_icons/svg/CAMERA.tsx":[97865,7865],"./npwd_icons/svg/CONTACTS":[60208,208],"./npwd_icons/svg/CONTACTS.tsx":[60208,208],"./npwd_icons/svg/DIALER":[76717,6717],"./npwd_icons/svg/DIALER.tsx":[76717,6717],"./npwd_icons/svg/EMAIL":[18155,8155],"./npwd_icons/svg/EMAIL.tsx":[18155,8155],"./npwd_icons/svg/EXAMPLE":[89535,9535],"./npwd_icons/svg/EXAMPLE.tsx":[89535,9535],"./npwd_icons/svg/LOCATION":[38744,8744],"./npwd_icons/svg/LOCATION.tsx":[38744,8744],"./npwd_icons/svg/MATCH":[13821,3821],"./npwd_icons/svg/MATCH.tsx":[13821,3821],"./npwd_icons/svg/MESSAGES":[35495,5495],"./npwd_icons/svg/MESSAGES.tsx":[35495,5495],"./npwd_icons/svg/NOTES":[27929,7929],"./npwd_icons/svg/NOTES.tsx":[27929,7929],"./npwd_icons/svg/SELLOUT":[78788,8788],"./npwd_icons/svg/SELLOUT.tsx":[78788,8788],"./npwd_icons/svg/SETTINGS":[71982,1982],"./npwd_icons/svg/SETTINGS.tsx":[71982,1982],"./npwd_icons/svg/TWITTER":[16132,6132],"./npwd_icons/svg/TWITTER.tsx":[16132,6132]};function a(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],a=t[0];return n.e(t[1]).then((function(){return n(a)}))}a.keys=function(){return Object.keys(r)},a.id=384,e.exports=a},93080:function(e,t,n){"use strict";var r=n(73344),a=n.n(r),o=n(81795),i=n.n(o)()(a());i.push([e.id,".PhoneWrapper {\n width: 100vw;\n height: 100vh;\n position: relative;\n}\n\n.Phone {\n position: absolute;\n right: 0;\n width: 500px;\n height: 1000px;\n background-size: cover;\n}\n\n.PhoneFrame {\n position: absolute;\n z-index: 999;\n width: 500px;\n height: 1000px;\n pointer-events: none;\n}\n\n.PhoneScreen {\n overflow: hidden;\n position: absolute;\n background-color: black;\n bottom: 100px;\n left: 50px;\n right: 50px;\n top: 100px;\n display: flex;\n flex-direction: column;\n background-position: center;\n background-size: cover;\n background-repeat: no-repeat;\n border-radius: 20px;\n}\n\n.PhoneAppContainer {\n height: 90%;\n width: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n* {\n box-sizing: border-box;\n}\n*::-webkit-scrollbar-track {\n box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);\n background-color: #666;\n}\n*::-webkit-scrollbar {\n width: 3px;\n background-color: transparent;\n}\n*::-webkit-scrollbar-thumb {\n background-color: #f5f5f5;\n}\n\n.notistack-SnackbarContainer {\n position: absolute !important;\n top: 0 !important;\n}\n",""]),t.Z=i},24346:function(e,t,n){"use strict";var r=n(73344),a=n.n(r),o=n(81795),i=n.n(o)()(a());i.push([e.id,'/* 00acee is "twitter blue" and we want to use that to override\nsome of the Material UI primary theme settings */\n\n/* override buttons on the tweet modal */\n#twitter-app .MuiButton-containedPrimary {\n background: #00acee !important;\n}\n\n/* override the bottom navigation active color */\n#twitter-app .Mui-selected {\n color: #00acee !important;\n}\n/* override the FAB (action buttons) background when selected */\n#twitter-app .MuiFab-primary {\n background: #00acee !important;\n}\n\n/* override the labels on text fields */\n#twitter-app .MuiInputLabel-formControl.Mui-focused {\n color: #00acee !important;\n}\n\n/* override the underlines of text fields */\n#twitter-app .Mui-focused:after {\n border-bottom-color: #00acee !important;\n}\n\n/* override circular progress on the likes button */\n#twitter-app .MuiCircularProgress-colorPrimary {\n color: #00acee !important;\n}\n\n/* override circular progress on the report button */\n#twitter-report-progress {\n color: #00acee !important;\n}\n\n/*\noverride position of the snackbar so that it appears\nwithin the phone rather than on the game UI */\n#twitter-app .MuiSnackbar-root {\n position: absolute;\n}\n\n.emoji-mart {\n margin: 0px 15px 8px 15px !important;\n width: calc(100% - 30px) !important;\n}\n\n.emoji-mart-bar {\n display: none;\n}\n',""]),t.Z=i},72551:function(e,t,n){"use strict";var r=n(73344),a=n.n(r),o=n(81795),i=n.n(o)()(a());i.push([e.id,"@import url(https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap);"]),i.push([e.id,'/*\n! tailwindcss v3.2.7 | MIT License | https://tailwindcss.com\n*/\n\n/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: \'\';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user\'s configured `sans` font-family by default.\n5. Use the user\'s configured `sans` font-feature-settings by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */ /* 3 */\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 4 */\n -webkit-font-feature-settings: normal;\n font-feature-settings: normal; /* 5 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user\'s configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n font-weight: inherit; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type=\'button\'],\n[type=\'reset\'],\n[type=\'submit\'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type=\'search\'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user\'s configured gray 400 color.\n*/\n\ninput::-webkit-input-placeholder, textarea::-webkit-input-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role="button"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don\'t get the pointer cursor.\n*/\n\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n\n[hidden] {\n display: none;\n}\n\n*, ::before, ::after{\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n::-webkit-backdrop{\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n\n::backdrop{\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.container{\n width: 100%;\n}\n@media (min-width: 640px){\n\n .container{\n max-width: 640px;\n }\n}\n@media (min-width: 768px){\n\n .container{\n max-width: 768px;\n }\n}\n@media (min-width: 1024px){\n\n .container{\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px){\n\n .container{\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px){\n\n .container{\n max-width: 1536px;\n }\n}\n.\\!visible{\n visibility: visible !important;\n}\n.visible{\n visibility: visible;\n}\n.invisible{\n visibility: hidden;\n}\n.static{\n position: static;\n}\n.fixed{\n position: fixed;\n}\n.absolute{\n position: absolute;\n}\n.relative{\n position: relative;\n}\n.sticky{\n position: -webkit-sticky;\n position: sticky;\n}\n.inset-0{\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n}\n.right-5{\n right: 1.25rem;\n}\n.top-0{\n top: 0px;\n}\n.top-5{\n top: 1.25rem;\n}\n.z-0{\n z-index: 0;\n}\n.z-10{\n z-index: 10;\n}\n.mx-auto{\n margin-left: auto;\n margin-right: auto;\n}\n.ml-4{\n margin-left: 1rem;\n}\n.mt-4{\n margin-top: 1rem;\n}\n.mt-6{\n margin-top: 1.5rem;\n}\n.mt-8{\n margin-top: 2rem;\n}\n.block{\n display: block;\n}\n.inline-block{\n display: inline-block;\n}\n.inline{\n display: inline;\n}\n.flex{\n display: flex;\n}\n.grid{\n display: grid;\n}\n.\\!contents{\n display: contents !important;\n}\n.contents{\n display: contents;\n}\n.hidden{\n display: none;\n}\n.h-14{\n height: 3.5rem;\n}\n.h-24{\n height: 6rem;\n}\n.h-5{\n height: 1.25rem;\n}\n.h-6{\n height: 1.5rem;\n}\n.h-full{\n height: 100%;\n}\n.w-24{\n width: 6rem;\n}\n.w-5{\n width: 1.25rem;\n}\n.w-6{\n width: 1.5rem;\n}\n.w-9\\/12{\n width: 75%;\n}\n.w-full{\n width: 100%;\n}\n.min-w-0{\n min-width: 0px;\n}\n.flex-1{\n flex: 1 1 0%;\n}\n.flex-auto{\n flex: 1 1 auto;\n}\n.shrink{\n flex-shrink: 1;\n}\n.grow{\n flex-grow: 1;\n}\n.transform{\n -webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.grid-cols-4{\n grid-template-columns: repeat(4, minmax(0, 1fr));\n}\n.flex-col{\n flex-direction: column;\n}\n.items-center{\n align-items: center;\n}\n.justify-start{\n justify-content: flex-start;\n}\n.justify-center{\n justify-content: center;\n}\n.justify-between{\n justify-content: space-between;\n}\n.gap-x-4{\n -webkit-column-gap: 1rem;\n column-gap: 1rem;\n}\n.space-x-2 > :not([hidden]) ~ :not([hidden]){\n --tw-space-x-reverse: 0;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse));\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.space-x-3 > :not([hidden]) ~ :not([hidden]){\n --tw-space-x-reverse: 0;\n margin-right: calc(0.75rem * var(--tw-space-x-reverse));\n margin-left: calc(0.75rem * calc(1 - var(--tw-space-x-reverse)));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]){\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.divide-y > :not([hidden]) ~ :not([hidden]){\n --tw-divide-y-reverse: 0;\n border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));\n border-bottom-width: calc(1px * var(--tw-divide-y-reverse));\n}\n.divide-neutral-200 > :not([hidden]) ~ :not([hidden]){\n --tw-divide-opacity: 1;\n border-color: rgb(229 229 229 / var(--tw-divide-opacity));\n}\n.overflow-y-auto{\n overflow-y: auto;\n}\n.break-all{\n word-break: break-all;\n}\n.rounded-full{\n border-radius: 9999px;\n}\n.rounded-md{\n border-radius: 0.375rem;\n}\n.border{\n border-width: 1px;\n}\n.border-b{\n border-bottom-width: 1px;\n}\n.border-t{\n border-top-width: 1px;\n}\n.border-gray-200{\n --tw-border-opacity: 1;\n border-color: rgb(229 231 235 / var(--tw-border-opacity));\n}\n.border-neutral-300{\n --tw-border-opacity: 1;\n border-color: rgb(212 212 212 / var(--tw-border-opacity));\n}\n.bg-blue-100{\n --tw-bg-opacity: 1;\n background-color: rgb(219 234 254 / var(--tw-bg-opacity));\n}\n.bg-neutral-100{\n --tw-bg-opacity: 1;\n background-color: rgb(245 245 245 / var(--tw-bg-opacity));\n}\n.bg-neutral-200{\n --tw-bg-opacity: 1;\n background-color: rgb(229 229 229 / var(--tw-bg-opacity));\n}\n.bg-neutral-50{\n --tw-bg-opacity: 1;\n background-color: rgb(250 250 250 / var(--tw-bg-opacity));\n}\n.bg-transparent{\n background-color: transparent;\n}\n.p-2{\n padding: 0.5rem;\n}\n.px-12{\n padding-left: 3rem;\n padding-right: 3rem;\n}\n.px-2{\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3{\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4{\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6{\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.py-1{\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-1\\.5{\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n}\n.py-2{\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-5{\n padding-top: 1.25rem;\n padding-bottom: 1.25rem;\n}\n.pt-4{\n padding-top: 1rem;\n}\n.text-center{\n text-align: center;\n}\n.text-4xl{\n font-size: 2.25rem;\n line-height: 2.5rem;\n}\n.text-base{\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-sm{\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.font-extrabold{\n font-weight: 800;\n}\n.font-medium{\n font-weight: 500;\n}\n.uppercase{\n text-transform: uppercase;\n}\n.lowercase{\n text-transform: lowercase;\n}\n.text-blue-800{\n --tw-text-opacity: 1;\n color: rgb(30 64 175 / var(--tw-text-opacity));\n}\n.text-gray-500{\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / var(--tw-text-opacity));\n}\n.text-neutral-400{\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n.text-neutral-900{\n --tw-text-opacity: 1;\n color: rgb(23 23 23 / var(--tw-text-opacity));\n}\n.text-white{\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity));\n}\n.outline-none{\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n.blur{\n --tw-blur: blur(8px);\n -webkit-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.\\!filter{\n -webkit-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.filter{\n -webkit-filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n.transition{\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.ease-in-out{\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n\nbody {\n font-family: \'Inter\', sans-serif;\n font-size: 20px;\n margin: 0;\n padding: 0;\n width: 100vw;\n height: 100vh;\n overflow: hidden;\n}\n\ncode {\n font-family: \'Inter\', sans-serif;\n}\n\na,\na:visited,\na:hover,\na:active {\n text-decoration: none;\n}\n\n.hover\\:bg-blue-200:hover{\n --tw-bg-opacity: 1;\n background-color: rgb(191 219 254 / var(--tw-bg-opacity));\n}\n\n.hover\\:text-neutral-900:hover{\n --tw-text-opacity: 1;\n color: rgb(23 23 23 / var(--tw-text-opacity));\n}\n\n.focus\\:outline-none:focus{\n outline: 2px solid transparent;\n outline-offset: 2px;\n}\n\n.active\\:scale-95:active{\n --tw-scale-x: .95;\n --tw-scale-y: .95;\n -webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.dark .dark\\:divide-neutral-800 > :not([hidden]) ~ :not([hidden]){\n --tw-divide-opacity: 1;\n border-color: rgb(38 38 38 / var(--tw-divide-opacity));\n}\n\n.dark .dark\\:border-none{\n border-style: none;\n}\n\n.dark .dark\\:border-neutral-700{\n --tw-border-opacity: 1;\n border-color: rgb(64 64 64 / var(--tw-border-opacity));\n}\n\n.dark .dark\\:bg-blue-100{\n --tw-bg-opacity: 1;\n background-color: rgb(219 234 254 / var(--tw-bg-opacity));\n}\n\n.dark .dark\\:bg-neutral-800{\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark .dark\\:bg-neutral-900{\n --tw-bg-opacity: 1;\n background-color: rgb(23 23 23 / var(--tw-bg-opacity));\n}\n\n.dark .dark\\:bg-red-100{\n --tw-bg-opacity: 1;\n background-color: rgb(254 226 226 / var(--tw-bg-opacity));\n}\n\n.dark .dark\\:text-blue-800{\n --tw-text-opacity: 1;\n color: rgb(30 64 175 / var(--tw-text-opacity));\n}\n\n.dark .dark\\:text-neutral-100{\n --tw-text-opacity: 1;\n color: rgb(245 245 245 / var(--tw-text-opacity));\n}\n\n.dark .dark\\:text-neutral-300{\n --tw-text-opacity: 1;\n color: rgb(212 212 212 / var(--tw-text-opacity));\n}\n\n.dark .dark\\:text-neutral-400{\n --tw-text-opacity: 1;\n color: rgb(163 163 163 / var(--tw-text-opacity));\n}\n\n.dark .dark\\:text-red-800{\n --tw-text-opacity: 1;\n color: rgb(153 27 27 / var(--tw-text-opacity));\n}\n\n.dark .dark\\:hover\\:bg-neutral-700:hover{\n --tw-bg-opacity: 1;\n background-color: rgb(64 64 64 / var(--tw-bg-opacity));\n}\n\n.dark .dark\\:hover\\:bg-red-200:hover{\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity));\n}\n\n.dark .hover\\:dark\\:bg-neutral-800:hover{\n --tw-bg-opacity: 1;\n background-color: rgb(38 38 38 / var(--tw-bg-opacity));\n}\n\n.dark .hover\\:dark\\:bg-neutral-800\\/50:hover{\n background-color: rgb(38 38 38 / 0.5);\n}\n\n.dark .hover\\:dark\\:text-neutral-100:hover{\n --tw-text-opacity: 1;\n color: rgb(245 245 245 / var(--tw-text-opacity));\n}\n\n.dark .group:hover .dark\\:group-hover\\:text-neutral-100{\n --tw-text-opacity: 1;\n color: rgb(245 245 245 / var(--tw-text-opacity));\n}\n',""]),t.Z=i},23347:function(e,t,n){"use strict";n.d(t,{S:function(){return l},e:function(){return E}});var r=n(78121),a=n(46236),o=new r.Validator;o.addSchema({id:"/IconSetValue",type:"object",properties:{name:{type:"string"},custom:{type:"boolean"}},required:!0},"/IconSetValue"),o.addSchema({id:"/SettingOptionIconSet",type:"object",properties:{label:{type:"string"},value:{$ref:"/IconSetValue"}},required:!0},"/SettingOptionIconSet");var i={type:"object",properties:{callVolume:{type:"number",required:!0},iconSet:{$ref:"/SettingOptionIconSet",required:!0},language:{$ref:"/SettingOption",required:!0},wallpaper:{$ref:"/SettingOption",required:!0},frame:{$ref:"/SettingOption",required:!0},theme:{$ref:"/SettingOption",required:!0},zoom:{$ref:"/SettingOption",required:!0},streamerMode:{type:"boolean",required:!0},ringtone:{$ref:"/SettingOption",required:!0},notiSound:{$ref:"/SettingOption",required:!0},TWITTER_notiFilter:{$ref:"/SettingOption",required:!0},TWITTER_notiSound:{$ref:"/SettingOption",required:!0},TWITTER_notiSoundVol:{type:"number",required:!0},TWITTER_notifyNewFeedTweet:{type:"boolean",required:!0},MARKETPLACE_notifyNewListing:{type:"boolean",required:!0}}};function l(e){var t=JSON.parse(e);return o.validate(t,i).valid}function E(){var e=localStorage.getItem(a._);if(e)try{var t=JSON.parse(e);return o.validate(t,i).valid}catch(e){console.error("JSON eror encountered while parsing the NPWD localStorage JSON string, using default schema as a fall back.",e)}return!0}o.addSchema({id:"/SettingOption",type:"object",properties:{label:{type:"string"},val:{type:"string"}},required:!0},"/SettingOption")},71060:function(e,t,n){"use strict";n.r(t);var r=n(61250),a=n(53182),o=n.n(a),i=n(72367),l=n.n(i),E=n(72777),s=n(53993),u=n.n(s),c=n(37899),d=n.n(c),T=n(12334),A=n.n(T),p=n(1808),_=n.n(p),I=n(69808),S=n.n(I),f=n(79297),R=n.n(f),O=n(72551),h={};h.styleTagTransform=R(),h.setAttributes=_(),h.insert=A().bind(null,"head"),h.domAPI=d(),h.insertStyleElement=S(),u()(O.Z,h),O.Z&&O.Z.locals&&O.Z.locals;var m,C=n(1640),L=n(83001),N={visibility:(0,L.atom)({key:"phoneVisibility",default:!1}),resourceConfig:(0,L.atom)({key:"resourceConfig",default:null}),phoneTime:(0,L.atom)({key:"phoneTime",default:null}),isPhoneDisabled:(0,L.atom)({key:"isPhoneDisabled",default:!1}),playerSource:(0,L.atom)({key:"playerSource",default:0}),playerIdentifier:(0,L.atom)({key:"playerIdentifier",default:null}),extApps:(0,L.atom)({key:"phoneExtApps",default:[]})};(m||(m={})).PLAY_ALERT="npwd:playAlert";var v=n(9833),y=function(){return(y=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},D=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(k(),1)[0];return(0,a.useMemo)((function(){return(0,C.createTheme)(G[e.theme.value],w)}),[e.theme])},j=function(){return(j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},B=(0,a.createContext)(null),H=function(e){var t=e.children,n=U((0,a.useState)(!1),2),o=n[0],i=n[1],l=U((0,a.useState)(null),2),E=l[0],s=l[1];return(0,r.jsx)(B.Provider,j({value:{alert:E,addAlert:function(e){s(e),i(!0)},handleClose:function(){i(!1)},isOpen:o}},{children:t}))},W=n(93080),V={};V.styleTagTransform=R(),V.setAttributes=_(),V.insert=A().bind(null,"head"),V.domAPI=d(),V.insertStyleElement=S(),u()(W.Z,V),W.Z&&W.Z.locals&&W.Z.locals;var z,K,Y,Z,J=n(94548),q=n(47264),X=function(){return(X=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,[]);return(0,r.jsx)(C.Box,te({display:"flex",justifyContent:"center",alignItems:"center",height:null!==(t=n.height)&&void 0!==t?t:"100%"},n,{children:(0,r.jsx)(C.CircularProgress,{})}))},re=n(72017),ae=function(){return(ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children","paperStyle","backdrop","disableSuspenseHandler","onClickBackdrop"]),s=oe();return(0,r.jsxs)("div",ae({className:"flex flex-col flex-1 bg-neutral-100 dark:bg-neutral-900",style:a?{overflow:"hidden"}:{overflow:"auto"}},{children:[(0,r.jsx)(C.Backdrop,{className:s.backdrop,open:a||!1,onClick:l}),(0,r.jsx)("div",ae({className:(0,re.A)("flex-auto w-full grow",E.className),style:n},{children:i?{children:t}:(0,r.jsx)(o().Suspense,ae({fallback:(0,r.jsx)(ne,{})},{children:t}))}))]}))},le=n(98202),Ee=n(26074),se=n(97325),ue=function(){return(ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children"]);return(0,r.jsx)(C.Tooltip,ue({},n,{children:t}))},de=function(){return(de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],u=Te({backgroundColor:o||Ee.Z[50],color:i||Ee.Z[400]});return(0,r.jsx)(ce,de({arrow:!0,title:s(n),placement:"top",classes:{tooltip:u.tooltip},TransitionComponent:C.Zoom},{children:(0,r.jsx)(C.Button,de({disableTouchRipple:!0,disableRipple:!0,disableFocusRipple:!0,className:u.root},{children:(0,r.jsx)(C.Badge,de({color:"error",badgeContent:null==E?void 0:E.badge,invisible:!E||E.badge<2},{children:a?(0,r.jsx)(a,{className:u.icon,fontSize:"large"}):(0,r.jsx)(C.Avatar,de({className:u.avatar},{children:l||s(n)}))}))}))}),t)},pe=function(){return(pe=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["app","variant"])),o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsx)("div",pe({className:"px-4 py-2 pt-4 bg-neutral-100 dark:bg-neutral-900"},a,{children:(0,r.jsx)("h3",pe({className:"text-4xl font-extrabold text-neutral-900 dark:text-neutral-100"},{children:o(n)}))}))},Ie=n(67973),Se=n(4942),fe=(0,Se.styled)("div")({background:"black",opacity:"0.6",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:5}),Re=n(25877),Oe=n(14540),he=n(18491),me=function(){return(me=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Le=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;at.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n},He=function(e){return(0,v.Z)(Ge.LO.TOGGLE_KEYS,{keepGameFocus:e},{})},We=(0,a.forwardRef)((function(e,t){var n;return(0,r.jsx)(ke.Z,Ue({ref:t},e,{variant:null!==(n=e.variant)&&void 0!==n?n:"standard",onMouseUp:function(t){He(!1),e.onMouseUp&&e.onMouseUp(t)},onBlur:function(t){He(!0),e.onBlur&&e.onBlur(t)}}))})),Ve=(0,a.forwardRef)((function(e,t){return(0,r.jsx)(xe.ZP,Ue({ref:t},e,{onMouseUp:function(t){He(!1),e.onMouseUp&&e.onMouseUp(t)},onBlur:function(t){He(!0),e.onBlur&&e.onBlur(t)}}))})),ze=(0,we.cva)("rounded-md outline-none w-full",{variants:{size:{md:"text-base py-2 px-2"},variant:{primary:"bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-100"}},defaultVariants:{size:"md",variant:"primary"}}),Ke=function(e){var t=e.size,n=e.variant,a=e.className,o=Be(e,["size","variant","className"]);return(0,r.jsx)("input",Ue({},o,{className:(0,Fe.twMerge)(ze({size:t,variant:n,className:a})),onMouseUp:function(e){He(!1),o.onMouseUp&&o.onMouseUp(e)},onBlur:function(e){He(!0),o.onBlur&&o.onBlur(e)}}))},Ye=function(e){var t=Be(e,[]);return(0,r.jsxs)("div",Ue({className:"flex items-center justify-start bg-neutral-200 dark:bg-neutral-800 rounded-md px-2 space-x-2 border dark:border-neutral-700 border-neutral-300"},{children:[(0,r.jsx)(je.Search,{className:"h-5 w-5 dark:text-neutral-400"}),(0,r.jsx)("input",Ue({},t,{className:"w-full text-base dark:text-neutral-100 py-2 bg-transparent outline-none",onMouseUp:function(e){He(!1),t.onMouseUp&&t.onMouseUp(e)},onBlur:function(e){He(!0),t.onBlur&&t.onBlur(e)}}))]}))},Ze=n(15795),Je=function(){return(Je=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rt=(0,q.Z)((function(e){return{cover:{cursor:"pointer",backgroundColor:e.palette.background.default,color:e.palette.getContrastText(e.palette.background.default),visibility:function(e){return e.covered?"visible":"hidden"}}}})),at=function(e){var t=e.children,n=nt(k(),1)[0],o=nt((0,a.useState)(!1),2),i=o[0],l=o[1],E=nt((0,a.useState)(!1),2),s=E[0],u=E[1],c=nt((0,se.useTranslation)(),1)[0],d=rt({covered:i});return(0,a.useEffect)((function(){!0===n.streamerMode&&l(!0),u(!0)}),[n.streamerMode]),(0,r.jsxs)(C.Box,tt({width:"100%",position:"relative"},{children:[(0,r.jsx)(C.Box,tt({onClick:function(){return l(!1)},className:d.cover,width:"100%",height:"100%",position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",top:0,left:0},{children:c("GENERIC_CLICK_TO_REVEAL")})),(0,r.jsx)(C.Box,tt({width:"100%",height:"100%",visibility:s?"visible":"hidden"},{children:t}))]}))},ot=n(85602),it=n(23855),lt=(0,ot.ZP)("div")((function(e){var t=e.theme;return{position:"relative",borderRadius:t.shape.borderRadius,backgroundColor:(0,C.emphasize)(t.palette.background.paper,.21),"&:hover":{backgroundColor:(0,C.emphasize)(t.palette.background.paper,.28)},marginLeft:t.spacing(1),width:"auto"}})),Et=(0,ot.ZP)("div")((function(e){return{padding:e.theme.spacing(0,.7),height:"100%",position:"absolute",pointerEvents:"none",display:"flex",alignItems:"center",justifyContent:"center"}})),st=(0,ot.ZP)(Ve)((function(e){var t=e.theme;return{fontWeight:400,fontSize:18,border:"1px solid",borderColor:t.palette.divider,"& .MuiInputBase-input":{padding:t.spacing(1,4,1,4),transition:t.transitions.create(["width","border"]),width:"16ch","&:focus":{width:"24ch",borderLeft:"2px solid ".concat(t.palette.primary.main," ")}}}})),ut=(0,ot.ZP)(C.Paper)((function(e){return e.theme,{display:"flex",height:"60px",justifyContent:"center",alignItems:"center"}})),ct={onChange:function(){},value:"",placeholder:"Søg..."},dt=function(e){var t=void 0===e?ct:e,n=t.value,a=t.onChange,o=t.placeholder;return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(ut,{children:(0,r.jsxs)(lt,{children:[(0,r.jsx)(Et,{children:(0,r.jsx)(it.Z,{})}),(0,r.jsx)(st,{value:n,onChange:a,placeholder:o,inputProps:{"aria-label":"search"}})]})})})},Tt=function(){return(Tt=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["color","variant","className"]),i=At({color:void 0===t?"info":t});return(0,r.jsx)(C.Button,Tt({variant:n,className:"".concat(i.root," ").concat(i[n]||""," ").concat(a)},o))},_t=function(){return(_t=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["color","size","className"]),i=It({color:void 0===t?"info":t});return(0,r.jsx)(C.IconButton,_t({className:"".concat(i.root," ").concat(a),size:n},o))},ft=n(47203),Rt=function(){return(Rt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(Ct(),2),t=e[0],n=e[1],r=Mt(),o=(0,a.useCallback)((function(e){(0,v.Z)(K.INITIALIZE_CALL,{receiverNumber:e}).then((function(e){"ok"===e.status||console.error(e.errorMsg)}))}),[]),i=(0,a.useCallback)((function(){(0,v.Z)(K.ACCEPT_CALL,{transmitterNumber:t.transmitter})}),[t]),l=(0,a.useCallback)((function(){(0,v.Z)(K.REJECTED,{transmitterNumber:t.transmitter})}),[t]),E=(0,a.useCallback)((function(){(0,v.Z)(K.END_CALL,{transmitterNumber:t.transmitter,isUnavailable:t.isUnavailable,isTransmitter:t.transmitter===r})}),[t,r]),s=(0,a.useCallback)((function(e){(0,v.Z)(K.TOGGLE_MUTE_CALL,{call:t,state:e})}),[t]);return{call:t,setCall:n,acceptCall:i,rejectCall:l,endCall:E,initializeCall:o,muteCall:s}},xt=function(){return(xt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(0),2),o=r[0],i=r[1],l=function(){n.current&&(clearInterval(n.current),n.current=void 0)},E=function(){n.current||(n.current=setInterval((function(){return i((function(e){return e+1}))}),1e3))};return(0,a.useEffect)((function(){return E(),l}),[]),xt(xt({},(t=Math.floor((e=Math.ceil(o))%86400/3600),{seconds:Math.floor(e%60),minutes:Math.floor(e%3600/60),hours:t})),{startTimer:E,resetTimer:function(){l()}})},wt=function(){return(wt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(mt.callModal),2);return{modal:e[0],setModal:e[1]}},Wt=n(98186),Vt=n(93609),zt=function(){return(zt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(!1),2),p=A[0],_=A[1];return(null==s?void 0:s.is_accepted)||(null==s?void 0:s.isTransmitter)?(0,r.jsxs)(C.Box,zt({display:"flex",justifyContent:(null==s?void 0:s.is_accepted)?"space-between":"center",px:2,my:2},{children:[(0,r.jsx)(St,zt({color:"error",size:t?"small":"medium",onClick:function(e){e.stopPropagation(),i(!1),u()},className:t?n.smallIconWrapper:n.iconWrapper},{children:(0,r.jsx)(Bt.Z,{className:n.icon})})),(null==s?void 0:s.is_accepted)&&(0,r.jsx)(St,zt({color:p?"error":"success",size:t?"small":"medium",onClick:function(){_((function(e){return!e})),T(!p)},className:t?n.smallIconWrapper:n.iconWrapper},{children:p?(0,r.jsx)(Wt.Z,{className:n.icon}):(0,r.jsx)(Vt.Z,{className:n.icon})}))]})):(0,r.jsxs)(C.Box,zt({display:"flex",alignItems:"center",justifyContent:"space-between",px:2,my:2},{children:[(0,r.jsx)(St,zt({color:"error",size:t?"small":"medium",onClick:function(e){e.stopPropagation(),i(!1),d()},className:t?n.smallIconWrapper:n.iconWrapper},{children:(0,r.jsx)(Bt.Z,{className:n.icon})})),(0,r.jsx)(St,zt({color:"success",size:t?"small":"medium",onClick:function(e){e.stopPropagation(),o.push("/call"),c()},className:t?n.smallIconWrapper:n.iconWrapper},{children:(0,r.jsx)(Ut.Z,{className:n.icon})}))]}))};(gt=Nt||(Nt={})).ADD_FAILED="CONTACT.FEEDBACK.ADD_FAILED",gt.UPDATE_FAILED="CONTACT.FEEDBACK.UPDATE_FAILED",gt.INVALID_HOST="GENERIC_INVALID_IMAGE_HOST",(Dt=vt||(vt={}))[Dt.avatar=255]="avatar",Dt[Dt.number=20]="number",Dt[Dt.display=255]="display",(Pt=yt||(yt={})).PAY_CONTACT="npwd-contact-pay",Pt.GET_CONTACTS="npwd-contact-getAll",Pt.ADD_CONTACT="npwd-contact-add",Pt.UPDATE_CONTACT="npwd:updateContact",Pt.DELETE_CONTACT="npwd:deleteContact",Pt.ADD_CONTACT_EXPORT="npwd:addContactExport";var Zt,Jt,qt=n(98105),Xt=[{id:1,display:"Rocko",number:"555-15196"},{id:2,display:"Taso",number:"215-8139",avatar:"http://i.tasoagc.dev/i9Ig"},{id:3,display:"Chip",number:"603-275-8373",avatar:"http://i.tasoagc.dev/2QYV"},{id:4,display:"Avarian",number:"444-4444"}],Qt=(0,L.atom)({key:"contactsList",default:(0,L.selector)({key:"contactsListDefault",get:function(){var e,t;return t=function(){var e,t;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),i=r.next();!i.done;i=r.next()){var l=i.value;if(a.test(l.display)&&e.conversationList.includes(l.number))return!0}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return a.test(e.label)}))}}),messages:(0,L.atom)({key:"messages",default:[]}),activeMessageConversation:(0,L.atom)({key:"activeMessageGroup",default:null}),showNewMessageGroup:(0,L.atom)({key:"showNewMessageGroup",default:!1}),createMessageGroupResult:(0,L.atom)({key:"createMessageGroupResult",default:null}),imageModal:(0,L.atom)({key:"useImageModal",default:!1}),unreadMessagesCount:(0,L.atom)({key:"unreadMessagesCount",default:0}),selectedMessage:(0,L.atom)({key:"selectedMessage",default:null}),checkedConversations:(0,L.atom)({key:"checkedConversation",default:[]}),isEditing:(0,L.atom)({key:"messageIsEditing",default:!1})},sn=function(){return(0,L.useSetRecoilState)(En.messages)},un=function(){return(0,L.useRecoilValue)(En.activeMessageConversation)},cn=function(){return(0,L.useRecoilValue)(ln)},dn=function(){return(0,L.useRecoilState)(En.isEditing)},Tn=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},An=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pn=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],t=kt().call,n=_n(),a=n.getDisplayByNumber,o=n.getPictureByNumber,i=function(){return t.isTransmitter?a(null==t?void 0:t.receiver):a(null==t?void 0:t.transmitter)};return(0,r.jsxs)(C.Box,In({display:"flex",alignItems:"center"},{children:[(0,r.jsxs)(C.Box,In({flexGrow:1,overflow:"hidden",textOverflow:"ellipsis"},{children:[(0,r.jsx)(C.Typography,In({variant:"body1"},{children:t.isTransmitter?e("CALLS.MESSAGES.OUTGOING").toUpperCase():e("CALLS.MESSAGES.INCOMING").toUpperCase()})),(0,r.jsx)(C.Typography,In({variant:"h4"},{children:i()}))]})),(0,r.jsx)(C.Avatar,{sx:{ml:1,height:80,width:80},alt:i(),src:o(t.isTransmitter?t.receiver:null==t?void 0:t.transmitter)})]}))},fn=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Rn=function(){var e=fn((0,se.useTranslation)(),1)[0],t=fn((0,a.useState)(e("CALLS.MESSAGES.RINGING")),2),n=t[0],o=t[1],i=fn((0,a.useState)(0),2),l=i[0],E=i[1];return(0,a.useEffect)((function(){var t=setInterval((function(){l<3?(E(l+1),o(n+".")):(o(e("CALLS.MESSAGES.RINGING")),E(0))}),500);return function(){return clearInterval(t)}}),[l,n,e]),(0,r.jsx)(C.Typography,{children:n})},On=n(84782),hn=function(){var e,t=x();return function(e){var t,n,r=On.wallpapers;try{for(var a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),o=a.next();!o.done;o=a.next())if(o.value.value===e)return!0}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}}(t.wallpaper.value)?"url(".concat((e=t.wallpaper.value,"media/backgrounds/".concat(e)),")"):"url(".concat(t.wallpaper.value,")")},mn=function(){return(mn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],c=(0,C.useTheme)(),d=function(e){n(e)},T=(0,a.useCallback)((function(e){return l.length?t(e):e}),[l,t]);return(null==o?void 0:o.length)?(0,r.jsx)(Oe.a,Wn({disablePadding:!0},{children:o.map((function(t){return t.transmitter===e?(0,r.jsxs)(he.H,Wn({divider:!0},{children:[(0,r.jsx)(C.ListItemIcon,{children:(0,r.jsx)(xn.Z,{className:i.callForward})}),(0,r.jsx)(C.ListItemText,{primary:T(t.receiver),secondary:(0,r.jsx)(C.Typography,Wn({style:{color:c.palette.text.secondary}},{children:""})),primaryTypographyProps:{overflow:"hidden",textOverflow:"ellipsis",color:c.palette.text.primary}}),(0,r.jsx)(C.IconButton,Wn({onClick:function(){return d(t.receiver)},size:"large"},{children:(0,r.jsx)(Gn.Z,{})})),T(t.receiver)===t.receiver&&(0,r.jsx)(C.IconButton,Wn({onClick:function(){return s.push("/contacts/-1?addNumber=".concat(t.receiver,"&referal=/phone/contacts"))},size:"large"},{children:(0,r.jsx)(wn.Z,{})}))]}),t.id):(0,r.jsxs)(he.H,Wn({divider:!0},{children:[(0,r.jsx)(C.ListItemIcon,{children:(0,r.jsx)(kn.Z,{className:i.callBack})}),(0,r.jsx)(C.ListItemText,{primary:T(t.transmitter),secondary:(0,r.jsx)(C.Typography,Wn({style:{color:c.palette.text.secondary}},{children:jn()().to(jn().unix(parseInt(t.start)))})),primaryTypographyProps:{overflow:"hidden",textOverflow:"ellipsis",color:c.palette.text.primary}}),(0,r.jsx)(C.IconButton,Wn({onClick:function(){return d(t.transmitter)},size:"large"},{children:(0,r.jsx)(Gn.Z,{})})),T(t.transmitter)===t.transmitter&&(0,r.jsx)(C.IconButton,Wn({onClick:function(){return s.push("/contacts/-1?addNumber=".concat(t.transmitter,"&referal=/phone/contacts"))},size:"large"},{children:(0,r.jsx)(wn.Z,{})}))]}),t.id)}))})):(0,r.jsx)(C.Box,Wn({display:"flex",justifyContent:"center",alignItems:"center",paddingTop:35},{children:(0,r.jsxs)("p",{children:[(0,r.jsx)(C.Typography,Wn({style:{color:c.palette.text.primary}},{children:u("DIALER.NO_HISTORY")})),(0,r.jsx)("span",Wn({role:"img","aria-label":"sad"},{children:"😞"}))]})}))},Kn=(0,a.createContext)(null),Yn=function(){return(Yn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],o=kt().initializeCall,i=(0,a.useContext)(Kn),l=i.inputVal,s=i.set;return(0,r.jsxs)(C.Box,Xn({component:C.Paper,className:e.root},{children:[(0,r.jsx)(Ve,{placeholder:n("DIALER.INPUT_PLACEHOLDER"),className:e.input,value:l,onChange:function(e){return s(e.target.value)}}),(0,r.jsx)(C.IconButton,Xn({color:"primary",className:e.iconBtn,disabled:l<="",onClick:function(){o(l)},size:"large"},{children:(0,r.jsx)(Gn.Z,{fontSize:"large"})})),(0,r.jsx)(C.IconButton,Xn({className:e.iconBtn,onClick:function(){var e;return e=l,void t.push("/contacts/-1/?addNumber=".concat(e,"&referal=/phone/contacts"))},onMouseUp:function(){He(!1)},size:"large"},{children:(0,r.jsx)(wn.Z,{fontSize:"large"})}))]}))},er=n(57637),tr=n.n(er),nr=function(){return(nr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(t||""),2),o=n[0],i=n[1];return(0,r.jsx)("div",ar({className:e.root},{children:(0,r.jsxs)(Kn.Provider,ar({value:{inputVal:o,add:function(e){return i(o+e)},removeOne:function(){return i(o.slice(0,-1))},clear:function(){return i("")},set:function(e){return i(e)}}},{children:[(0,r.jsx)($n,{}),(0,r.jsx)(qn,{})]}))}))},lr=n(3424),Er=n(89351),sr=function(){return(sr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},cr=(0,q.Z)((function(e){return{root:{width:"100%",backgroundColor:e.palette.background.paper},icon:{color:e.palette.primary.main}}})),dr=function(){var e=cr(),t=(0,E.useLocation)().pathname,n=ur((0,a.useState)(t),2),o=n[0],i=n[1],l=ur((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(C.BottomNavigation,sr({value:o,onChange:function(e,t){i(t)},showLabels:!0,className:e.root},{children:[(0,r.jsx)(C.BottomNavigationAction,{label:l("DIALER.NAVBAR_HISTORY"),value:"/phone",component:E.NavLink,icon:(0,r.jsx)(Er.Z,{}),to:"/phone"}),(0,r.jsx)(C.BottomNavigationAction,{label:l("DIALER.NAVBAR_DIAL"),value:"/phone/dial",color:"secondary",component:E.NavLink,icon:(0,r.jsx)(Gn.Z,{}),to:"/phone/dial"}),(0,r.jsx)(C.BottomNavigationAction,{label:l("DIALER.NAVBAR_CONTACTS"),value:"/phone/contacts",color:"secondary",component:E.NavLink,icon:(0,r.jsx)(lr.Z,{}),to:"/phone/contacts"})]}))},Tr=function(e,t){void 0===t&&(t=100);var n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(e),2),r=n[0],o=n[1];return(0,a.useEffect)((function(){var n=setTimeout((function(){o(e)}),t);return function(){clearTimeout(n)}}),[e,t]),r},Ar=function(){return(Ar=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},_r=function(){var e=pr((0,se.useTranslation)(),1)[0],t=(0,L.useSetRecoilState)(en),n=pr((0,a.useState)(""),2),o=n[0],i=n[1],l=Tr(o,500);return(0,a.useEffect)((function(){t(l)}),[l,t]),(0,r.jsx)("div",Ar({className:"w-full py-2 px-4"},{children:(0,r.jsx)(Ye,{onChange:function(e){return i(e.target.value)},placeholder:e("CONTACTS.PLACEHOLDER_SEARCH_CONTACTS"),value:o})}))},Ir=function(){return(Ir=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilValue)((0,L.waitForAll)([En.activeMessageConversation])),1)[0],i=(0,L.useSetRecoilState)(ln),l=(0,L.useSetRecoilState)(En.activeMessageConversation),s=(0,a.useCallback)((function(e){if("hasValue"===n&&r.length)return r&&r.find((function(t){return t.id===e}))}),[r,n]),u=(0,a.useCallback)((function(e){var t=s(e);return l(t),t}),[l,s]),c=(0,a.useCallback)((function(t){(null==t?void 0:t.id)&&e&&(i(t.id),e.push("/messages/conversations/".concat(t.id.toString())))}),[i,e]);return{activeMessageConversation:o,setActiveMessageConversation:u,getMessageConversationById:s,goToConversation:c,conversations:r}},yr=function(){return(0,a.useContext)(B)},gr=function(){var e=yr().addAlert,t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],n=_n(),r=n.addLocalContact,o=n.updateLocalContact,i=n.deleteLocalContact,l=(0,E.useHistory)(),s=(0,a.useCallback)((function(n){var r=n.number,a=n.amount;(0,v.Z)(yt.PAY_CONTACT,{number:r,amount:a}).then((function(n){if("ok"!==n.status)return e({message:t("CONTACTS.FEEDBACK.PAYMENTFAILED"),type:"error"});e({message:t("CONTACTS.FEEDBACK.PAYMENTSENT"),type:"success"})}))}),[e,t]);return{addNewContact:(0,a.useCallback)((function(n,a){var o=n.display,i=n.number,E=n.avatar;(0,v.Z)(yt.ADD_CONTACT,{display:o,number:i,avatar:E}).then((function(n){if("ok"!==n.status)return e({message:t(n.errorMsg),type:"error"});r(n.data),e({message:t("CONTACTS.FEEDBACK.ADD_SUCCESS"),type:"success"}),l.replace(a)}))}),[e,r,l,t]),updateContact:(0,a.useCallback)((function(n){var r=n.id,a=n.display,i=n.number,E=n.avatar;(0,v.Z)(yt.UPDATE_CONTACT,{id:r,display:a,number:i,avatar:E}).then((function(n){if("ok"!==n.status)return e({message:t(n.errorMsg),type:"error"});o({id:r,display:a,number:i,avatar:E}),e({message:t("CONTACTS.FEEDBACK.UPDATE_SUCCESS"),type:"success"}),l.goBack()}))}),[e,l,t,o]),deleteContact:(0,a.useCallback)((function(n){var r=n.id;(0,v.Z)(yt.DELETE_CONTACT,{id:r}).then((function(n){if("ok"!==n.status)return e({message:t("CONTACTS.FEEDBACK.DELETE_FAILED"),type:"error"});l.goBack(),i(r),e({message:t("CONTACTS.FEEDBACK.DELETE_SUCCESS"),type:"success"})}))}),[e,i,l,t]),payContact:s}},Dr=n(34063),Pr=function(){return(Pr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Mr=function(e){var t=e.open,n=e.closeModal,o=e.openContact,i=gr().payContact,l=br((0,se.useTranslation)(),1)[0],E=br((0,a.useState)(500),2),s=E[0],u=E[1];return(0,r.jsx)(Xe,Pr({visible:t,handleClose:n},{children:(0,r.jsx)(Dr.TabContext,Pr({value:"1"},{children:(0,r.jsxs)(Dr.TabPanel,Pr({value:"1"},{children:[(0,r.jsx)(C.Typography,{children:l("CONTACTS.SENDMONEY")}),(0,r.jsx)(C.Box,Pr({mt:2,mb:2},{children:(0,r.jsxs)(C.Box,Pr({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2},{children:[(0,r.jsx)(We,{placeholder:l("CONTACTS.AMOUNT"),value:s,onChange:function(e){u(parseInt(e.currentTarget.value))}}),(0,r.jsx)(Re.z,Pr({onClick:function(){s&&s>0&&(n(),i({number:o,amount:s}))},variant:"outlined",color:"primary"},{children:l("GENERIC.SEND")}))]}))}))]}))}))}))},kr=function(){var e=(0,L.useRecoilValue)(N.visibility),t=(0,L.useRecoilValue)(N.resourceConfig),n=Nn().removeAlerts;return{ResourceConfig:t,closePhone:function(){n(),(0,v.Z)(Ge.LO.CLOSE_PHONE,void 0,{}).catch()},openPhone:function(){(0,v.Z)(Ge.LO.OPEN_PHONE,void 0,{}).catch()},isPhoneOpen:e}},xr=function(){return(xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},wr=(0,q.Z)({root:{height:"100%",width:"100%"},listContainer:{marginTop:30,width:"75%",margin:"0 auto",textAlign:"center"},avatar:{margin:"auto",height:"125px",width:"124px",marginBottom:29},input:{marginBottom:20,margin:"auto",textAlign:"center"},inputProps:{fontSize:22},button:{color:"#000000",backgroundColor:"#838383","&:hover":{backgroundColor:"#6a6a6a"}}}),Fr=function(){var e,t,n,o,i,l,s=wr(),u=(0,E.useHistory)(),c=(0,E.useParams)().id,d=rr({referal:"/contacts"}),T=d.addNumber,A=d.referal,p=d.avatar,_=d.name,I={contactPayModal:(e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)($t),2))[0],setContactPayModal:e[1]},S=I.contactPayModal,f=I.setContactPayModal,R=_n(),O=R.getContact,h=R.findExistingConversation,m=gr(),C=m.updateContact,N=m.addNewContact,v=m.deleteContact,y=kt().initializeCall,g=Mt(),D=vr().goToConversation,P=O(parseInt(c)),b=Gr((0,a.useState)(null!==(t=null==P?void 0:P.display)&&void 0!==t?t:""),2),M=b[0],k=b[1],x=Gr((0,a.useState)(null!==(n=null==P?void 0:P.number)&&void 0!==n?n:""),2),G=x[0],w=x[1],F=Gr((0,a.useState)(null!==(o=null==P?void 0:P.avatar)&&void 0!==o?o:""),2),j=F[0],U=F[1],B=Gr((0,se.useTranslation)(),1)[0],H=kr().ResourceConfig;return(0,a.useEffect)((function(){T&&w(T),p&&U(p),_&&k(_)}),[T,j,p,_]),H?(0,r.jsxs)("div",xr({className:"mx-auto h-full w-full"},{children:[(0,r.jsx)(Mr,{open:S,closeModal:function(){return f(!1)},openContact:G}),(0,r.jsx)("button",xr({onClick:function(){return u.goBack()},className:"mt-4 ml-4 rounded-md px-3 py-1 hover:dark:bg-neutral-800"},{children:(0,r.jsx)(je.ArrowLeft,{className:"h-6 w-6 dark:text-neutral-300"})})),(0,r.jsxs)("div",xr({className:"mx-auto w-9/12"},{children:[(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:j,className:"mx-auto h-24 w-24 rounded-full text-center"})}),(0,r.jsxs)("div",xr({className:"mt-8"},{children:[(0,r.jsx)("div",xr({className:"text-sm font-medium dark:text-neutral-400"},{children:B("CONTACTS.FORM_NAME")})),(0,r.jsx)(Ke,{value:M,onChange:function(e){e.currentTarget.value.length!==vt.display&&k(e.target.value)}})]})),P&&(0,r.jsxs)("div",xr({className:"mt-4 grid w-full grid-cols-4 gap-x-4"},{children:[(0,r.jsx)("button",xr({onClick:function(){var e=G.toString();(0,Un.Z)({action:"Routing to Message",level:1,data:{phoneNumber:e}});var t=h(g,e);if(t)return D(t);u.push("/messages/new?phoneNumber=".concat(e))},className:"group flex items-center justify-center rounded-md py-2 dark:bg-neutral-800 dark:hover:bg-neutral-700"},{children:(0,r.jsx)(je.MessageCircle,{className:"h-6 w-6 dark:text-neutral-400 dark:group-hover:text-neutral-100"})})),(0,r.jsx)("button",xr({onClick:function(){(0,Un.Z)({action:"Emitting `Start Call` to Scripts",level:2,data:!0}),y(G.toString())},className:"group flex items-center justify-center rounded-md py-2 dark:bg-neutral-800 dark:hover:bg-neutral-700"},{children:(0,r.jsx)(je.Phone,{className:"h-6 w-6 dark:text-neutral-400 dark:group-hover:text-neutral-100"})})),(null===(i=null==H?void 0:H.general)||void 0===i?void 0:i.useResourceIntegration)&&(null===(l=null==H?void 0:H.contacts)||void 0===l?void 0:l.frameworkPay)&&(0,r.jsx)("button",xr({onClick:function(){var e,t;(null===(e=null==H?void 0:H.general)||void 0===e?void 0:e.useResourceIntegration)&&(null===(t=null==H?void 0:H.contacts)||void 0===t?void 0:t.frameworkPay)&&f(!0)},className:"group flex items-center justify-center rounded-md py-2 dark:bg-neutral-800 dark:hover:bg-neutral-700"},{children:(0,r.jsx)(je.HelpingHand,{className:"h-6 w-6 dark:text-neutral-400 dark:group-hover:text-neutral-100"})})),(0,r.jsx)("button",xr({onClick:function(){v({id:P.id})},className:"group flex items-center justify-center rounded-md py-2 dark:bg-red-100 dark:hover:bg-red-200"},{children:(0,r.jsx)(je.Trash2,{className:"h-6 w-6 dark:text-red-800"})}))]})),(0,r.jsxs)("div",xr({className:"mt-8 space-y-4"},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",xr({className:"text-sm font-medium dark:text-neutral-400"},{children:B("CONTACTS.FORM_NUMBER")})),(0,r.jsx)(Ke,{value:G,onChange:function(e){e.currentTarget.value.length!==vt.number&&w(e.target.value)}})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",xr({className:"text-sm font-medium dark:text-neutral-400"},{children:B("CONTACTS.FORM_AVATAR")})),(0,r.jsx)(Ke,{value:j,onChange:function(e){e.currentTarget.value.length!==vt.avatar&&U(e.target.value)}})]})]})),(0,r.jsx)("div",xr({className:"mt-8"},{children:P?(0,r.jsx)(Re.D,xr({onClick:function(){C({id:P.id,number:G,avatar:j,display:M})},className:s.button},{children:B("GENERIC.UPDATE")})):(0,r.jsx)(Re.D,xr({onClick:function(){N({display:M,number:G,avatar:j},A)},className:s.button},{children:B("GENERIC.ADD")}))}))]}))]})):null},jr=function(){return(jr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1?Kr(Kr({},e),{num2:e.num2.slice(0,-1)}):Kr(Kr({},e),{num2:""});case"ac":return{value:0,op:"",num1:0,num2:"",num3:""};default:return e}},Jr=function(e){var t=document.createElement("input");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},qr=n(392),Xr=function(){return(Xr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useReducer)(Zr,Yr),2))[0],n=e[1],o=function(e,t){if("2"!==t)return"".concat(e);switch(e){case"/":return function(e,t){return Number(e)/Number(t)};case"*":return function(e,t){return Number(e)*Number(t)};case"+":return function(e,t){return Number(e)+Number(t)};case"-":return function(e,t){return Number(e)-Number(t)}}},i=function(e,t){return{label:e,onClick:function(){return n({type:t,payload:o(e,t)})}}},l=function(e){return i(e,"1")},E=function(e){return i(e,"2")},s=i("C","c"),u=i("AC","ac"),c=i("=","3"),d=l(0),T=l("."),A=E("/"),p=E("*"),_=E("+"),{result:function(){return t.num2?t.num2:t.value},equals:c,clear:s,clearAll:u,divider:A,multiplier:p,substractor:E("-"),adder:_,dot:T,zero:d,one:l(1),two:l(2),three:l(3),four:l(4),five:l(5),six:l(6),seven:l(7),eight:l(8),nine:l(9)}),S=I.result,f=I.equals,R=I.clear,O=I.clearAll,h=I.divider,m=I.multiplier,L=I.substractor,N=I.adder,v=I.dot,y=I.zero,g=I.one,D=I.two,P=I.three,b=I.four,M=I.five,k=I.six,x=I.seven,G=I.eight,w=I.nine,F=yr().addAlert,j=(0,a.useMemo)((function(){return S().toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:4})}),[S]),U=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(C.Box,Qr({display:"flex",flexDirection:"column"},{children:[(0,r.jsxs)(ta,Qr({flexGrow:1,component:C.Paper,p:2,length:j.length},{children:[(0,r.jsx)(ea,Qr({size:"small",onClick:function(){Jr(j),F({message:U("GENERIC.WRITE_TO_CLIPBOARD_MESSAGE",{content:"number"}),type:"success"})}},{children:(0,r.jsx)(qr.Z,{})})),j]})),(0,r.jsx)(C.Box,{children:(0,r.jsxs)(C.Grid,Qr({container:!0,justifyContent:"space-around"},{children:[(0,r.jsx)(na,{buttonOpts:R}),(0,r.jsx)(na,{buttonOpts:O}),(0,r.jsx)(na,{buttonOpts:h}),(0,r.jsx)(na,{buttonOpts:m}),(0,r.jsx)(na,{buttonOpts:x}),(0,r.jsx)(na,{buttonOpts:G}),(0,r.jsx)(na,{buttonOpts:w}),(0,r.jsx)(na,{buttonOpts:L}),(0,r.jsx)(na,{buttonOpts:b}),(0,r.jsx)(na,{buttonOpts:M}),(0,r.jsx)(na,{buttonOpts:k}),(0,r.jsx)(na,{buttonOpts:N}),(0,r.jsx)(na,{buttonOpts:g}),(0,r.jsx)(na,{buttonOpts:D}),(0,r.jsx)(na,{buttonOpts:P}),(0,r.jsx)(na,{buttonOpts:f}),(0,r.jsx)(na,{buttonOpts:v}),(0,r.jsx)(na,{buttonOpts:y,GridProps:{xs:9}})]}))})]}))},aa=function(){var e=lp("CALCULATOR");return(0,r.jsxs)(Ie.O,{children:[(0,r.jsx)(_e,{app:e}),(0,r.jsx)(ie,{children:(0,r.jsx)(ra,{})})]})},oa=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ia=function(e,t){return function(n){return{selected:e.value===n.value,onClick:function(){return t(n)},key:n.value,label:n.label}}},la=function(e){var t=oa((0,a.useState)(!1),2),n=t[0],o=t[1],i=oa((0,a.useState)(e||[]),2),l=i[0],E=i[1],s=function(){return o(!1)};return[function(e){E(e),o(!0)},s,function(){return(0,r.jsx)(ve,{open:n,onClose:s,options:l})},n]},Ea=function(){return(Ea=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(e),2),n=t[0],r=t[1];return[n,function(e,t){r((function(n){var r;return Ea(Ea({},n),((r={})[e]=t,r))}))}]},ca=n(70385),da=function(){return(da=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ca=function(){var e=ma(Oa(),2),t=e[0],n=e[1],o=ma(k(),2),i=o[0],l=o[1],E=ma((0,se.useTranslation)(),1)[0],s=ma((0,a.useState)(i.wallpaper.value?i.wallpaper.value:""),2),u=s[0],c=s[1],d=yr().addAlert,T=function(e){return/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|png|jpeg|gif)/g.test(e)};return(0,r.jsx)(Pe,ha({open:t,handleClose:function(){return n(!1)},onSubmit:function(){var e,t;T(u)?(e={label:E("SETTINGS.OPTIONS.CUSTOM_WALLPAPER.DIALOG_TITLE"),value:u},l(ha(ha({},i),((t={}).wallpaper=e,t))),n(!1)):d({message:E("SETTINGS.OPTIONS.CUSTOM_WALLPAPER.DIALOG_ERROR"),type:"error"})},title:E("SETTINGS.OPTIONS.CUSTOM_WALLPAPER.DIALOG_TITLE"),content:E("SETTINGS.OPTIONS.CUSTOM_WALLPAPER.DIALOG_CONTENT")},{children:(0,r.jsx)(We,{value:u,error:!T(u),onChange:function(e){return c(e.currentTarget.value)},placeholder:E("SETTINGS.OPTIONS.CUSTOM_WALLPAPER.DIALOG_PLACEHOLDER"),fullWidth:!0})}))},La=function(){return(La=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children","title"]);return(0,r.jsx)(C.List,La({subheader:(0,r.jsx)(Na,{text:n})},a,{disablePadding:!0},{children:t}))},ya=n(3635),ga=function(){return(ga=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Pa=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ga=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),E=i.next();!E.done;E=i.next()){var s=E.value;if(s!==a){var u=l(s);return u?u.display:s}}}catch(e){t={error:e}}finally{try{E&&!E.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}),[l]);return{updateLocalConversations:u,removeLocalConversation:(0,a.useCallback)((function(e){"hasValue"===n&&r.length&&o((function(t){return Ga([],xa(t),!1).filter((function(t){return!e.includes(t.id)}))}))}),[o,n,r]),updateLocalMessages:(0,a.useCallback)((function(t){"hasValue"===e&&s===t.conversation_id&&i((function(e){return Ga(Ga([],xa(e),!1),[{message:t.message,conversation_id:t.conversation_id,author:t.author,id:t.id,createdAt:t.createdAt,is_embed:t.is_embed,embed:t.embed}],!1)}))}),[e,i,s]),deleteLocalMessage:(0,a.useCallback)((function(e){i((function(t){return Ga([],xa(t),!1).filter((function(t){return t.id!==e}))}))}),[i]),setMessageReadState:c,getLabelOrContact:d,getConversationParticipant:(0,a.useCallback)((function(e){return l(e.split("+").filter((function(e){return e!==E}))[0])}),[l,E])}},Fa=function(){var e=yr().addAlert,t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],n=wa(),r=n.updateLocalMessages,o=n.deleteLocalMessage,i=n.updateLocalConversations,l=n.removeLocalConversation,s=n.setMessageReadState,u=(0,E.useHistory)(),c=(0,L.useRecoilValueLoadable)(En.messageCoversations),d=c.state,T=c.contents,A=sn(),p=Mt(),_=(0,a.useCallback)((function(n){var a=n.conversationId,o=n.message,i=n.tgtPhoneNumber,l=n.conversationList;(0,v.Z)(Zt.SEND_MESSAGE,{conversationId:a,conversationList:l,message:o,tgtPhoneNumber:i,sourcePhoneNumber:p}).then((function(n){if("ok"!==n.status)return e({message:t("MESSAGES.FEEDBACK.NEW_MESSAGE_FAILED"),type:"error"});r(n.data)}))}),[r,t,e,p]),I=(0,a.useCallback)((function(n){var a=n.conversationId,o=n.embed,i=n.tgtPhoneNumber,l=n.conversationList,E=n.message;(0,v.Z)(Zt.SEND_MESSAGE,{conversationId:a,embed:JSON.stringify(o),is_embed:!0,tgtPhoneNumber:i,conversationList:l,sourcePhoneNumber:p,message:void 0===E?"":E}).then((function(n){if("ok"!==n.status)return e({message:t("MESSAGES.FEEDBACK.NEW_MESSAGE_FAILED"),type:"error"});r(n.data)}))}),[t,r,e,p]),S=(0,a.useCallback)((function(t){(0,v.Z)(Zt.SET_MESSAGE_READ,t).then((function(n){if("ok"!==n.status)return e({message:"Failed to read message",type:"error"});s(t,0)}))}),[e,s]),f=(0,a.useCallback)((function(n){(0,v.Z)(Zt.DELETE_MESSAGE,n).then((function(r){if("ok"!==r.status)return e({message:t("MESSAGES.FEEDBACK.DELETE_MESSAGE_FAILED"),type:"error"});o(n.id)}))}),[o,e,t]),R=(0,a.useCallback)((function(n){"hasValue"===d&&(0,v.Z)(Zt.CREATE_MESSAGE_CONVERSATION,{conversationLabel:n.conversationLabel,participants:n.participants,isGroupChat:n.isGroupChat}).then((function(r){return"ok"!==r.status?(u.push("/messages"),"MESSAGES.FEEDBACK.MESSAGE_CONVERSATION_DUPLICATE"===r.errorMsg?e({message:t("MESSAGES.FEEDBACK.MESSAGE_CONVERSATION_DUPLICATE"),type:"error"}):e({message:t('MESSAGE_CONVERSATION_CREATE_ONE_NUMBER_FAILED"',{number:n.conversationLabel}),type:"error"})):T.find((function(e){return e.conversationList===r.data.conversationList}))?(u.push("/messages"),e({message:t("MESSAGES.FEEDBACK.MESSAGE_CONVERSATION_DUPLICATE"),type:"error"})):(i({participant:r.data.participant,id:r.data.id,conversationList:r.data.conversationList,label:r.data.label,isGroupChat:r.data.isGroupChat,unread:0,unreadCount:0}),void u.push("/messages"))}))}),[u,i,e,t,T,d]);return{sendMessage:_,deleteMessage:f,deleteConversation:(0,a.useCallback)((function(n){(0,v.Z)(Zt.DELETE_CONVERSATION,{conversationsId:n}).then((function(r){if("ok"!==r.status)return e({message:t("MESSAGES.DELETE_CONVERSATION_FAILED"),type:"error"});l(n)}))}),[e,t,l]),addConversation:R,fetchMessages:(0,a.useCallback)((function(n,r){(0,v.Z)(Zt.FETCH_MESSAGES,{conversationId:n,page:r},on).then((function(n){if("ok"!==n.status)return e({message:t("MESSAGES.FEEDBACK.FETCHED_MESSAGES_FAILED"),type:"error"}),u.push("/messages");A(n.data)}))}),[A,e,t,u]),sendEmbedMessage:I,setMessageRead:S}},ja=function(){return(ja=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ba=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a1;(0,a.useEffect)((function(){if(t){var e=T(t)||{display:"",number:t};s((function(t){return Ba(Ba([],Ua(t),!1),[e],!1)}))}}),[t,T]);var S=function(e,t){var n=t.length-1;if("string"==typeof t[n])return t.splice(n,1,{number:t[n]}),void s(t);s(t)},f=l.find((function(e){return e.number===_})),R=!(null==l?void 0:l.length)||I&&!c||!!f;return(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Box,ja({px:2,py:3},{children:(0,r.jsx)(C.Autocomplete,{value:l,freeSolo:!0,disablePortal:!0,PopperComponent:function(e){return(0,r.jsx)(C.Popper,ja({placement:"bottom-start"},e))},multiple:!0,autoHighlight:!0,options:A||[],ListboxProps:{style:{marginLeft:10}},getOptionLabel:function(e){return e.display||e.number},onChange:S,renderInput:function(e){return(0,r.jsx)(We,ja({},e,{fullWidth:!0,label:o("MESSAGES.INPUT_NAME_OR_NUMBER"),inputProps:ja(ja({},e.inputProps),{onKeyPress:function(e){"Enter"===e.key&&e.currentTarget.value&&(e.preventDefault(),S(0,Ba(Ba([],Ua(l),!1),[e.currentTarget.value],!1)))},autoFocus:!0})}))}})})),I&&(0,r.jsx)(C.Box,ja({px:2,py:1},{children:(0,r.jsx)(We,{fullWidth:!0,placeholder:"Conversation label",value:c,onChange:function(e){return d(e.currentTarget.value)}})})),(0,r.jsxs)(C.Box,ja({px:2,py:3},{children:[(0,r.jsx)(C.Button,ja({onClick:function(){var e={conversationLabel:I?c:"",participants:Ba([_],Ua(l.map((function(e){return e.number}))),!1),isGroupChat:I};p(e)},disabled:R,variant:"contained",fullWidth:!0,sx:{mb:1},color:"primary",type:"submit"},{children:o("MESSAGES.NEW_MESSAGE_GROUP_SUBMIT")})),(0,r.jsx)(C.Button,ja({onClick:function(){n.goBack()},variant:"contained",fullWidth:!0,color:"error"},{children:o("GENERIC_CANCEL")}))]}))]})},Wa=function(){return(Wa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r),o=a.next();!o.done;o=a.next()){var l=o.value;if(l!==n)return T(l)||null}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}}),[T,i]),p=(0,a.useCallback)((function(){var e,t=i.label,n=i.participant,r=i.conversationList.split("+");return i.isGroupChat?t:(null===(e=A())||void 0===e?void 0:e.display)||r.filter((function(e){return e!==n}))[0]}),[i,A]),_=(0,C.useTheme)();return(0,r.jsxs)(C.ListItem,Ka({onClick:E?function(){u(i.id)}:l(i),divider:!0,button:!0},{children:[E&&(0,r.jsx)(C.ListItemIcon,{children:(0,r.jsx)(C.Checkbox,{checked:-1!==s.indexOf(i.id),edge:"start",disableRipple:!0})}),(0,r.jsx)(C.ListItemAvatar,{children:(0,r.jsx)(C.Badge,Ka({color:"error",badgeContent:i.unreadCount<=99?i.unreadCount:"99+",invisible:i.unreadCount<=0},{children:i.isGroupChat?(0,r.jsx)(C.Avatar,{alt:i.label}):(0,r.jsx)(C.Avatar,{alt:null!==(n=null===(t=A())||void 0===t?void 0:t.display)&&void 0!==n?n:"",src:null===(o=A())||void 0===o?void 0:o.avatar})}))}),(0,r.jsx)(C.ListItemText,Ka({sx:{overflow:"hidden",color:_.palette.text.primary}},{children:p()}))]}),i.id)},Za=(0,q.Z)((function(e){return{root:{height:"580px",overflowY:"auto"}}})),Ja=n(44089),qa=function(){return(qa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Qa=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a1?RegExp(E.join("|"),"ig"):null}),[E]);return(0,r.jsx)(io.Provider,oo({value:{filter:s,clean:function(e){return l&&s?e.replace(s,(function(e){return"*".repeat(e.length)})):e}}},{children:n}))}var Eo,so,uo,co,To=function(){var e=(0,a.useContext)(io);if(!e)throw Error("useWordFilter must be wrapped by WordFilterProvider");return e},Ao=function(){return(Ao=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},So=function(e){var t=e.messageConversation,n=e.onAddImageClick,o=e.onVoiceClick,i=e.voiceEnabled,l=Io((0,se.useTranslation)(),1)[0],E=Io((0,a.useState)(""),2),s=E[0],u=E[1],c=Fa().sendMessage,d=vr().activeMessageConversation,T=To().clean,A=function(){return po(void 0,void 0,void 0,(function(){return _o(this,(function(e){switch(e.label){case 0:return s.trim()?[4,c({conversationId:t.id,conversationList:d.conversationList,message:T(s),tgtPhoneNumber:t.participant})]:[3,2];case 1:e.sent(),u(""),e.label=2;case 2:return[2]}}))}))};return t.id?(0,r.jsxs)(C.Paper,Ao({variant:"outlined",sx:{display:"flex",alignItems:"center",justifyContent:"space-between"}},{children:[(0,r.jsx)(C.Box,Ao({pt:1,pl:1,pb:1,flexGrow:1},{children:(0,r.jsx)(We,{onKeyPress:function(e){return po(void 0,void 0,void 0,(function(){return _o(this,(function(t){switch(t.label){case 0:return"Enter"!==e.key||e.shiftKey?[3,2]:[4,A()];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},multiline:!0,maxRows:4,"aria-multiline":"true",inputProps:{style:{fontSize:"1.3em"}},value:s,onChange:function(e){u(e.currentTarget.value)},placeholder:l("MESSAGES.NEW_MESSAGE")})})),(0,r.jsx)(C.Box,Ao({pr:1},{children:(0,r.jsxs)(C.ButtonGroup,Ao({size:"small"},{children:[i&&(0,r.jsx)(C.Button,Ao({size:"small",onClick:o},{children:(0,r.jsx)(ro.Z,{})})),(0,r.jsx)(C.Button,Ao({size:"small",onClick:n},{children:(0,r.jsx)(ao.Z,{})})),(0,r.jsx)(C.Button,Ao({size:"small",onClick:A},{children:(0,r.jsx)(no.Z,{})}))]}))}))]})):null},fo=n(24437),Ro=(0,Se.styled)(C.Box)({wordBreak:"break-word",display:"flex",justifyContent:"space-between",alignItems:"center",whiteSpace:"pre-line"}),Oo=(0,Se.styled)(C.Box)({width:"100%",display:"flex",justifyContent:"flex-start",flexDirection:"column"}),ho=Ro,mo=n(60598),Co=n(80724);(uo=Eo||(Eo={})).GENERIC="CAMERA.FAILED_TO_TAKE_PHOTO",uo.INVALID_IMAGE_HOST="GENERIC_INVALID_IMAGE_HOST",(co=so||(so={})).TAKE_PHOTO="npwd:TakePhoto",co.CAMERA_EXITED="npwd:cameraExited",co.NPWD_PHOTO_MODE_STARTED="npwd:PhotoModeStarted",co.NPWD_PHOTO_MODE_ENDED="npwd:PhotoModeEnded",co.TAKE_PHOTO_SUCCESS="npwd:TakePhotoSuccess",co.SAVE_IMAGE="npwd:saveImage",co.UPLOAD_PHOTO="npwd:UploadPhoto",co.FETCH_PHOTOS="npwd:FetchPhotos",co.DELETE_PHOTO="npwd:deletePhoto",co.DELETE_MULTIPLE_PHOTOS="npwd:deleteMultiplePhotos",co.GET_AUTHORISATION_TOKEN="npwd:getAuthToken";var Lo=[{id:1,image:"https://i.imgur.com/7juREyw.png"},{id:2,image:"https://i.imgur.com/ULWUAoY.png"},{id:3,image:"https://i.imgur.com/2UScodu.png"},{id:4,image:"https://i.imgur.com/nNuoTkW.png"}],No={photos:(0,L.atom)({key:"galleryPhotos",default:(0,L.selector)({key:"defaultGalleryPhotos",get:function(){var e,t;return t=function(){var e,t;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},go=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],c=Fa().deleteMessage,d=(t=yr().addAlert,n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],o=Do().saveLocalImage,{saveImage:function(e){(0,v.Z)(so.SAVE_IMAGE,{url:e}).then((function(e){if("ok"!==e.status)return t({type:"error",message:n("CAMERA.FAILED_TO_TAKE_PHOTO")});o(e.data)}))}}).saveImage,T=(0,L.useRecoilValue)(En.selectedMessage),A=(0,a.useCallback)((function(){c(T)}),[c,T]),p=function(){d(s.message)},_=(0,a.useMemo)((function(){return[{label:u("MESSAGES.FEEDBACK.DELETE_MESSAGE"),icon:(0,r.jsx)(Co.Z,{}),onClick:A}]}),[A,u]),I=(0,a.useMemo)((function(){return[{label:"Save image",icon:(0,r.jsx)(mo.Z,{}),onClick:p}]}),[p]);return(0,r.jsx)(ve,{open:i,onClose:l,options:E?I:_})},bo=n(85332),Mo=n(25467),ko=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},xo=function(e){var t=ko((0,a.useState)(!1),2),n=t[0],r=t[1],o=ko((0,a.useState)(null),2),i=o[0],l=o[1],E=(0,a.useRef)(new Audio(e)),s=E.current.duration;return(0,a.useEffect)((function(){E.current&&(E.current.ontimeupdate=function(){l(Math.trunc(E.current.currentTime))})})),{play:function(){var e,t;return t=function(){return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};jn().extend(jo());var Ho,Wo,Vo=function(e){var t=e.isMine,n=e.embed,a=e.openMenu,o=Bo((0,se.useTranslation)(),1)[0],i=(0,E.useHistory)(),l=(0,E.useLocation)().pathname,s=_n().getContactByNumber,u=!t&&!s(null==n?void 0:n.number);return(0,r.jsxs)(ho,{children:[(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Avatar,{src:null==n?void 0:n.avatar}),(0,r.jsx)(C.Typography,{children:null==n?void 0:n.display}),(0,r.jsx)(C.Typography,{children:null==n?void 0:n.number})]}),u&&(0,r.jsx)(C.Box,Uo({pl:1},{children:(0,r.jsx)(C.Button,Uo({fullWidth:!0,variant:"contained",color:"primary",onClick:function(){var e=encodeURIComponent(l);i.push("/contacts/-1?addNumber=".concat(n.number,"&name=").concat(n.display,"&referal=").concat(e))}},{children:o("GENERIC.ADD")}))})),t&&(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:a},{children:(0,r.jsx)(fo.Z,{})}))]})},zo=function(e){var t=e.isMine,n=e.embed,a=e.openMenu,o=Bo((0,se.useTranslation)(),1)[0],i=(0,E.useHistory)(),l=(0,E.useLocation)().pathname;return(0,r.jsxs)(ho,{children:[(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Typography,{children:null==n?void 0:n.title}),(0,r.jsx)(C.Typography,{children:(null==n?void 0:n.content.substring(0,8))+" ..."})]}),(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Tooltip,Uo({title:o("MESSAGES.NOTE_TOOLTIP")},{children:(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:function(){var e=tr().stringify({title:null==n?void 0:n.title,content:null==n?void 0:n.content}),t=encodeURIComponent(l);i.push("/notes/?".concat(e,"&referal=").concat(t))}},{children:(0,r.jsx)(Mo.Z,{})}))})),t&&(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:a},{children:(0,r.jsx)(fo.Z,{})}))]})]})},Ko=function(e){var t=e.isMine,n=e.embed,a=e.message,o=e.openMenu,i=Bo((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(ho,{children:[(0,r.jsx)(C.Box,{children:(0,r.jsx)(C.Typography,{children:null!=a?a:i("MESSAGES.LOCATION_MESSAGE")})}),(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Tooltip,Uo({title:i("MESSAGES.LOCATION_TOOLTIP")},{children:(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:function(){(0,v.Z)(Zt.MESSAGES_SET_WAYPOINT,{coords:n.coords})}},{children:(0,r.jsx)(bo.Z,{})}))})),t&&(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:o},{children:(0,r.jsx)(fo.Z,{})}))]})]})},Yo=function(e){var t=e.isMine,n=e.embed,a=e.openMenu,o=xo(n.url),i=o.play,l=o.pause,E=o.playing,s=o.currentTime,u=o.duration,c=isNaN(u)||u==1/0?0:Math.trunc(s)/Math.trunc(u)*100;return(0,r.jsxs)(Oo,{children:[(0,r.jsxs)(C.Box,Uo({display:"flex",alignItems:"center"},{children:[(0,r.jsx)(C.IconButton,Uo({onClick:E?l:i},{children:E?(0,r.jsx)(wo.Z,{sx:{color:"#232323"}}):(0,r.jsx)(Go.Z,{sx:{color:"#232323"}})})),(0,r.jsx)(C.Box,Uo({sx:{width:"60%"}},{children:!c&&E?(0,r.jsx)(C.LinearProgress,{}):(0,r.jsx)(C.LinearProgress,{variant:"determinate",value:c})})),t&&(0,r.jsx)(C.IconButton,Uo({color:"primary",onClick:a},{children:(0,r.jsx)(fo.Z,{})}))]})),(0,r.jsx)(C.Box,Uo({pl:1},{children:(0,r.jsx)(C.Typography,{children:jn().duration(1e3*s).format("mm:ss")})}))]})},Zo=function(e){var t=e.type,n=e.embed,a=e.isMine,o=e.message,i=e.openMenu,l={contact:(0,r.jsx)(Vo,{embed:n,isMine:a,openMenu:i}),location:(0,r.jsx)(Ko,{embed:n,isMine:a,message:o,openMenu:i}),note:(0,r.jsx)(zo,{embed:n,isMine:a,openMenu:i}),audio:(0,r.jsx)(Yo,{embed:n,isMine:a,openMenu:i})};return(0,r.jsx)(r.Fragment,{children:l[t]})},Jo=function(){return(Jo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(!1),2),d=c[0],T=c[1],A=_n().getContactByNumber,p=(0,L.useSetRecoilState)(En.selectedMessage),_=function(){T(!0),p(s)},I=Mt(),S=s.author===I;(null==s?void 0:s.embed)&&(E=JSON.parse(null==s?void 0:s.embed));var f,R=function(){return A(s.author)},O=(f=s.message,/(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|png|jpeg|gif|webp)/g.test(f));return s.is_embed&&"audio"===E.type?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Box,Jo({display:"flex",ml:1,alignItems:"stretch",justifyContent:S?"flex-end":"flex-start",mt:1},{children:(0,r.jsxs)(C.Paper,Jo({className:S?u.myAudioSms:u.audioSms,variant:"outlined"},{children:[(0,r.jsx)(Zo,{type:E.type,embed:E,isMine:S,message:s.message,openMenu:_}),!S&&(0,r.jsx)(C.Typography,Jo({fontWeight:"bold",fontSize:14,color:"#ddd"},{children:null!==(n=null===(t=R())||void 0===t?void 0:t.display)&&void 0!==n?n:s.author})),(0,r.jsx)(C.Typography,Jo({ml:2,fontSize:12},{children:jn().unix(s.createdAt).fromNow()}))]}))})),(0,r.jsx)(Po,{open:d,handleClose:function(){return T(!1)}})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.Box,Jo({display:"flex",ml:1,alignItems:"stretch",justifyContent:S?"flex-end":"flex-start",mt:1},{children:[S?null:(0,r.jsx)(C.Avatar,{src:null===(o=R())||void 0===o?void 0:o.avatar}),(0,r.jsxs)(C.Paper,Jo({className:S?u.mySms:u.sms,variant:"outlined"},{children:[s.is_embed?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Zo,{type:E.type,embed:E,isMine:S,message:s.message,openMenu:_})}):(0,r.jsxs)(ho,{children:[O?(0,r.jsx)(at,{children:(0,r.jsx)(et,{src:s.message,alt:"message multimedia"})}):(0,r.jsx)(r.Fragment,{children:s.message}),(S||O)&&(0,r.jsx)(C.IconButton,Jo({color:"primary",onClick:_},{children:(0,r.jsx)(fo.Z,{})}))]}),!S&&(0,r.jsx)(C.Typography,Jo({fontWeight:"bold",fontSize:14,color:"#ddd"},{children:null!==(l=null===(i=R())||void 0===i?void 0:i.display)&&void 0!==l?l:s.author})),(0,r.jsx)(C.Typography,Jo({mt:2,fontSize:12},{children:jn().unix(s.createdAt).fromNow()}))]}))]})),(0,r.jsx)(Po,{message:s,isImage:O,open:d,handleClose:function(){return T(!1)}})]})},Qo=n(65348),$o=n.n(Qo),ei=n(41656),ti=n(90408),ni=n(72159),ri=n.n(ni),ai=function(){return(ai=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],c=(0,E.useLocation)(),d=c.pathname,T=c.search,A=Fa().sendMessage,p=(0,a.useCallback)((function(){i(null),s.replace(oi({pathname:d,search:T},"image"))}),[s,d,T,i]),_=vr().activeMessageConversation,I=(0,a.useCallback)((function(e){A({conversationId:t.id,conversationList:_.conversationList,message:e,tgtPhoneNumber:t.participant}),n()}),[A,t,n,_]),S=(0,a.useCallback)((function(e){I(e),p()}),[p,I]);return(0,a.useEffect)((function(){o&&i(o)}),[o,i]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Qe,ii({visible:l,handleClose:p},{children:(0,r.jsxs)(C.Box,ii({py:1},{children:[(0,r.jsx)(C.Typography,ii({paragraph:!0},{children:u("MESSAGES.SHARE_IMAGE_TITLE")})),(0,r.jsx)(et,{src:l,alt:"Share gallery image preview"}),(0,r.jsx)(C.Button,ii({fullWidth:!0,variant:"contained",color:"primary",onClick:function(){return S(l)}},{children:u("GENERIC.SHARE")}))]}))}))})},Ei=function(){return(Ei=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ui=function(e){var t=e.isVisible,n=e.onClose,o=e.messageGroup,i=si((0,se.useTranslation)(),1)[0],l=rn(),E=si((0,a.useState)(null),2),s=E[0],u=E[1],c=Fa().sendEmbedMessage,d=vr().activeMessageConversation;return(0,r.jsxs)(Qe,Ei({visible:t,handleClose:n},{children:[(0,r.jsx)(C.Box,Ei({py:1},{children:(0,r.jsx)(C.Typography,Ei({paragraph:!0},{children:i("MESSAGES.SHARE_CONTACT_TITLE")}))})),(0,r.jsx)(C.Box,Ei({pb:2},{children:(0,r.jsx)(C.Autocomplete,{renderInput:function(e){return(0,r.jsx)(We,Ei({},e,{label:"Choose contact"}))},getOptionLabel:function(e){return e.display},options:l,onChange:function(e,t){return u(t)}})})),(0,r.jsx)(C.Button,Ei({disabled:!s,fullWidth:!0,variant:"contained",color:"primary",onClick:function(){c({conversationId:o.id,conversationList:d.conversationList,embed:Ei({type:"contact"},s),tgtPhoneNumber:o.participant,message:i("MESSAGES.CONTACT_SHARED")}),n()}},{children:i("GENERIC.SHARE")}))]}))};(Wo=Ho||(Ho={})).ADD_NOTE="npwd:addNote",Wo.FETCH_ALL_NOTES="npwd:fetchAllNotes",Wo.DELETE_NOTE="npwd:deleteNote",Wo.UPDATE_NOTE="npwd:updateNote",Wo.ADD_NOTE_EXPORT="npwd:addNoteExport";var ci,di=[{id:1,title:"You suck",content:"Nice note bro"},{id:2,title:"You suck",content:"Nice note bro"},{id:3,title:"You suck",content:"Nice note bro"},{id:4,title:"You suck",content:"Nice note bro"}],Ti=(0,L.atom)({key:"noteItem",default:(0,L.selector)({key:"defaultNoteItems",get:function(){var e,t;return t=function(){var e,t;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],c=(0,E.useLocation)(),d=c.pathname,T=c.search,A=Fa().sendEmbedMessage,p=Si(),_=(0,a.useCallback)((function(){i(null),s.replace(oi({pathname:d,search:T},"note"))}),[s,d,T,i]),I=vr().activeMessageConversation,S=(0,a.useCallback)((function(e){A({conversationId:t.id,conversationList:I.conversationList,embed:fi({type:"note"},e),tgtPhoneNumber:t.participant,message:""}),n()}),[A,t,n,I]),f=(0,a.useCallback)((function(e){S(e),_()}),[_,S]);return(0,a.useEffect)((function(){o&&i(p.filter((function(e){return e.id===Number(o)}))[0])}),[o,p,i]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Qe,fi({visible:l,handleClose:_},{children:(0,r.jsxs)(C.Box,fi({py:1},{children:[(0,r.jsx)(C.Typography,fi({paragraph:!0},{children:u("MESSAGES.SHARE_NOTE_TITLE")})),(0,r.jsx)(C.Typography,{children:null==l?void 0:l.title}),(0,r.jsx)(C.Typography,fi({sx:{marginBottom:2}},{children:(null==l?void 0:l.content.substring(0,25))+" ..."})),(0,r.jsx)(C.Button,fi({fullWidth:!0,variant:"contained",color:"primary",onClick:function(){return f(l)}},{children:u("GENERIC.SHARE")}))]}))}))})},Oi=function(){return(Oi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},mi=function(e){var t=e.isOpen,n=e.onClose,o=e.messageGroup,i=e.image,l=e.note,s=(0,E.useHistory)(),u=hi((0,se.useTranslation)(),1)[0],c=(0,E.useLocation)(),d=c.pathname,T=c.search,A=hi((0,a.useState)(null),2),p=A[0],_=A[1],I=hi((0,a.useState)(null),2),S=I[0],f=I[1],R=hi((0,a.useState)(!1),2),O=R[0],h=R[1],m=Fa().sendEmbedMessage,C=vr().activeMessageConversation,L=(0,a.useMemo)((function(){return[{label:u("MESSAGES.MEDIA_OPTION"),icon:(0,r.jsx)(mo.Z,{}),onClick:function(){return s.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(d+T)})))}},{label:u("MESSAGES.CONTACT_OPTION"),icon:(0,r.jsx)(ei.Z,{}),onClick:function(){return h(!0)}},{label:u("MESSAGES.NOTE_OPTION"),icon:(0,r.jsx)(Mo.Z,{}),onClick:function(){return s.push("/notes?".concat(tr().stringify({referal:encodeURIComponent(d+T)})))}},{label:u("MESSAGES.LOCATION_OPTION"),icon:(0,r.jsx)(ti.Z,{}),onClick:function(){(0,v.Z)(Zt.GET_MESSAGE_LOCATION).then((function(e){var t=e.data;m({conversationId:o.id,conversationList:C.conversationList,embed:Oi({type:"location"},t),tgtPhoneNumber:o.participant,message:u("MESSAGES.LOCATION_MESSAGE")})}))}}]}),[s,d,T,u,m,C,o]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ve,{open:t,onClose:n,options:L}),p||O||S?(0,r.jsx)(fe,{}):void 0,(0,r.jsx)(li,{image:i,imagePreview:p,setImagePreview:_,messageGroup:o,onClose:n}),(0,r.jsx)(Ri,{noteId:l,notePreview:S,setNotePreview:f,messageGroup:o,onClose:n}),(0,r.jsx)(ui,{messageGroup:o,isVisible:O,onClose:function(){return h(!1)}})]})},Ci=n(36714),Li=n(78218),Ni=function(){return(Ni=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yi=function(){var e=vi((0,a.useState)({mediaStream:null,recorder:null,isRecording:!1}),2),t=e[0],n=e[1],r=vi((0,a.useState)(null),2),o=r[0],i=r[1],l=vi((0,a.useState)(null),2),E=l[0],s=l[1];return(0,a.useEffect)((function(){var e=t.recorder,r=[];return t.recorder&&"inactive"===t.recorder.state&&(e.start(),n((function(e){return Ni(Ni({},e),{isRecording:!0})})),e.ondataavailable=function(e){r.push(e.data)},e.onstop=function(){var e=new Blob(r,{type:"audio/ogg"}),t=URL.createObjectURL(e);n((function(e){return Ni(Ni({},e),{isRecording:!1,recorder:null,mediaStream:null})})),i(t),s(e)}),function(){t.recorder&&t.recorder.stream.getAudioTracks().forEach((function(e){return e.stop()}))}}),[t.recorder]),{audio:o,blob:E,recordingState:t,startRecording:function(){var e,t;return t=function(){var e,t;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};jn().extend(jo());var ki=function(e){var t=e.isRecording,n=e.startRecording,a=e.stopRecording;return(0,r.jsx)(C.Box,{children:(0,r.jsxs)(C.ButtonGroup,{children:[(0,r.jsx)(C.Tooltip,Di({title:"Record voice message",placement:"right"},{children:(0,r.jsx)(C.IconButton,Di({disabled:t,color:"error",size:"small",onClick:n},{children:(0,r.jsx)(Ci.Z,{})}))})),t&&(0,r.jsx)(C.IconButton,Di({color:"error",size:"small",onClick:t&&a},{children:(0,r.jsx)(Li.Z,{})}))]})})},xi=function(e){var t=e.playing,n=e.play,a=e.pause;return(0,r.jsx)(C.Box,{children:(0,r.jsx)(C.ButtonGroup,{children:(0,r.jsx)(C.IconButton,Di({size:"small"},{children:t?(0,r.jsx)(wo.Z,{onClick:a}):(0,r.jsx)(Go.Z,{onClick:n})}))})})},Gi=function(e){var t,n,o,i,l,E=e.onClose,s=yi(),u=s.blob,c=s.audio,d=s.recordingState,T=s.startRecording,A=s.stopRecording,p=Mi((0,a.useState)(null),2),_=p[0],I=p[1],S=(t=un(),n=Mt(),o=yr().addAlert,i=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],l=wa().updateLocalMessages,{uploadRecording:function(e,r){var a,E;return E=function(){var a;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ji=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},dl=function(){var e=(0,L.useRecoilValue)(N.visibility),t=cl(k(),1)[0].zoom,n=(0,L.useRecoilValue)(ol),r=cl((0,a.useState)(!1),2),o=r[0],i=r[1],l=Lt()||n.length;return(0,a.useEffect)((function(){i(!(!l||e))}),[l,n,e]),{bottom:(0,a.useMemo)((function(){return e||(0,qt.Id)()?"0px":"".concat(-750*t.value,"px")}),[e,t]),visibility:o||e||(0,qt.Id)()}},Tl=function(){return(Tl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pl=(0,Se.makeStyles)({tooltip:{fontSize:12},modalHide:{display:"none"},groupdisplay:{width:"300px",paddingTop:"8px",fontSize:"24px",whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis"},largeGroupDisplay:{width:"300px",paddingTop:"8px",fontSize:"20px",overflowX:"hidden",textOverflow:"ellipsis"}}),_l=function(){var e=Al((0,se.useTranslation)(),1)[0],t=pl(),n=(0,E.useHistory)(),o=(0,E.useLocation)().pathname,i=(0,E.useParams)().groupId,l=vr(),s=l.activeMessageConversation,u=l.setActiveMessageConversation,c=Fa().fetchMessages,d=wa(),T=d.getLabelOrContact,A=d.getConversationParticipant,p=kt().initializeCall,_=_n().getContactByNumber,I=Al((0,L.useRecoilState)(En.messages),2),S=I[0],f=I[1],R=Al((0,a.useState)(!1),2),O=R[0],h=R[1],m=Al((0,a.useState)(!1),2),N=m[0],v=m[1],y=kr().ResourceConfig,g=Mt();if((0,a.useEffect)((function(){i&&c(i,0)}),[i,c]),(0,a.useEffect)((function(){s&&S?setTimeout((function(){h(!0)}),600):h(!1)}),[s,S]),(0,a.useEffect)((function(){i&&u(parseInt(i,10))}),[i,u]),(0,a.useEffect)((function(){if(O){var e=document.getElementById(Ui);e&&(e.scrollTop=e.scrollHeight)}}),[O]),!s)return(0,r.jsx)("div",{children:(0,r.jsx)(C.CircularProgress,{})});var D=T(s),P="".concat(D.slice(0,80).trim(),"..."),b=(D=D.length>80?P:D).length>30?t.largeGroupDisplay:t.groupdisplay,M=function(e){var t=_(e),r=encodeURIComponent(o);return t?n.push("/contacts/".concat(t.id,"/?referal=").concat(r)):n.push("/contacts/-1/?addNumber=".concat(e,"&referal=").concat(r))},k=s.conversationList.split("+"),x=(k=k.filter((function(e){return e!==g}))).length>0?k[0]:s.participant,G=A(s.conversationList);return(0,r.jsx)(C.Slide,Tl({direction:"left",in:!!s},{children:(0,r.jsxs)(C.Paper,Tl({sx:{height:"100%",width:"100%",display:"flex",flexGrow:1,overflowY:"hidden",flexDirection:"column"}},{children:[(0,r.jsx)(el,{open:N,onClose:function(){v(!1)},conversationList:s.conversationList,addContact:M}),N&&(0,r.jsx)(fe,{}),(0,r.jsxs)(C.Box,Tl({display:"flex",justifyContent:"space-between",component:C.Paper,sx:{borderRadius:0}},{children:[(0,r.jsx)(C.Button,Tl({onClick:function(){f(null),n.push("/messages")}},{children:(0,r.jsx)(eo.Z,{fontSize:"large"})})),(0,r.jsx)(C.Typography,Tl({variant:"h5",className:b},{children:D})),!s.isGroupChat&&(0,r.jsx)(C.Tooltip,Tl({classes:{tooltip:t.tooltip},title:"".concat(e("GENERIC.CALL")," ").concat(x),placement:"bottom"},{children:(0,r.jsx)(C.IconButton,Tl({onClick:function(){return p(x)}},{children:(0,r.jsx)(fa.Call,{fontSize:"medium"})}))})),s.isGroupChat?(0,r.jsx)(C.Button,{children:(0,r.jsx)(to.Z,{onClick:function(){v(!0)},fontSize:"large"})}):s.isGroupChat||G?(s.isGroupChat,null):(0,r.jsx)(C.Button,{children:(0,r.jsx)(wn.Z,{onClick:function(){return M(x)},fontSize:"large"})})]})),O&&s&&y?(0,r.jsx)(Bi,{isVoiceEnabled:y.voiceMessage.enabled,messages:S,activeMessageGroup:s}):(0,r.jsx)(Qi,{})]}))}))},Il=function(){return(Il=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(dn(),2),i=o[0],l=o[1],E=Fa().deleteConversation;return(0,r.jsx)(C.Fab,Il({className:n.root,color:"primary",onClick:i?function(){E(a),l(!1)}:t,onMouseUp:function(){He(!1)}},{children:i?(0,r.jsx)(fa.Delete,{}):(0,r.jsx)(fa.Add,{})}))},Rl=n(20253),Ol=Rl.Z[800],hl=Pn.Z.white,ml=Or({palette:{primary:{main:Ol,dark:Rl.Z[900],light:Rl.Z[100],contrastText:hl}}}),Cl=function(){return(Cl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children"]),n=Ul(),a=Mt(),o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],i=(0,E.useHistory)(),l=kt().initializeCall,s=yr().addAlert;return(0,r.jsxs)(C.Box,jl({justifyContent:"space-between",alignItems:"center"},{children:[(0,r.jsx)("div",jl({style:{float:"left"}},{children:t.number!==a&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ce,jl({title:o("GENERIC.MESSAGE")},{children:(0,r.jsx)(C.Button,jl({onClick:function(){i.push("/messages/new?phoneNumber=".concat(t.number))}},{children:(0,r.jsx)(Fl.Z,{className:n.icon})}))})),(0,r.jsx)(ce,jl({title:"".concat(o("GENERIC.CALL"),": ").concat(t.number)},{children:(0,r.jsx)(C.Button,jl({onClick:function(){l(t.number)}},{children:(0,r.jsx)(Gn.Z,{className:n.icon})}))}))]})})),(0,r.jsx)("div",jl({style:{float:"right"}},{children:t.number===a?(0,r.jsx)(ce,jl({title:o("GENERIC.DELETE")},{children:(0,r.jsx)(C.Button,jl({onClick:function(){(0,v.Z)(Zi.DELETE_LISTING,{id:t.id}).then((function(e){if("ok"!==e.status)return s({message:o("MARKETPLACE.FEEDBACK.DELETE_LISTING_FAILED"),type:"error"});s({message:o("MARKETPLACE.FEEDBACK.DELETE_LISTING_SUCCESS"),type:"success"})}))}},{children:(0,r.jsx)(Co.Z,{})}))})):(0,r.jsx)(ce,jl({title:o("GENERIC.REPORT")},{children:(0,r.jsx)(C.Button,jl({onClick:function(){(0,v.Z)(Zi.REPORT_LISTING,{id:t.id}).then((function(e){if("ok"!==e.status)return s({message:o("MARKETPLACE.FEEDBACK.REPORT_LISTING_FAILED"),type:"error"});s({message:o("MARKETPLACE.FEEDBACK.REPORT_LISTING_SUCCESS"),type:"success"})}))}},{children:(0,r.jsx)(wl.Z,{})}))}))}))]}))},Hl=function(){return(Hl=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["children"]),n=Wl(),a=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsx)(he.H,Hl({className:n.root},{children:(0,r.jsx)("div",Hl({className:n.content},{children:(0,r.jsxs)(C.Paper,Hl({variant:"outlined",className:n.paper},{children:[(0,r.jsxs)("div",Hl({style:{margin:10}},{children:[(0,r.jsx)(C.Typography,Hl({style:{margin:5},variant:"h5"},{children:t.name})),(0,r.jsx)(C.Typography,Hl({variant:"h5",style:{padding:5}},{children:t.title}))]})),t.url?(0,r.jsx)(at,{children:(0,r.jsx)(et,{src:t.url,alt:"".concat(t.name)})}):(0,r.jsxs)(C.Typography,Hl({style:{margin:10}},{children:[a("MARKETPLACE.NO_IMAGE"),(0,r.jsx)("span",Hl({role:"img","aria-label":"emoji"},{children:"🙁"}))]})),(0,r.jsx)(C.Typography,Hl({variant:"body1",className:n.listingContent},{children:t.description})),(0,r.jsx)(Bl,Hl({},t))]}))}))}))},zl=function(){return(zl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(0),2),n=t[0],o=t[1];return(0,r.jsxs)(C.BottomNavigation,Xl({value:n,onChange:function(e,t){o(t)},showLabels:!0,className:e.root},{children:[(0,r.jsx)(C.BottomNavigationAction,{component:E.Link,icon:(0,r.jsx)(Jl.Z,{}),to:"/marketplace"}),(0,r.jsx)(C.BottomNavigationAction,{component:E.Link,icon:(0,r.jsx)(ql.Z,{}),to:"/marketplace/new"})]}))},eE=n(57626),tE=function(){return(tE=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},rE=(0,q.Z)((function(e){return{root:{width:"100%",margin:"auto",textAlign:"center"},input:{marginBottom:25},textFieldInput:{fontSize:22},multilineFieldInput:{fontSize:20},postButton:{display:"block",margin:"auto",color:"white",background:e.palette.primary.main,width:"80%",fontSize:20}}})),aE=function(){var e=rE(),t=nE((0,se.useTranslation)(),1)[0],n=yr().addAlert,o=(0,E.useHistory)(),i=(0,E.useLocation)(),l=i.pathname,s=i.search,u=rr(),c=nE((0,L.useRecoilState)(Gl),2),d=c[0],T=c[1],A=To().clean,p=(0,C.useTheme)(),_=""!==d.title.trim()&&""!==d.description.trim(),I=(0,a.useCallback)((function(){o.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(l+s)})))}),[o,l,s]);return(0,a.useEffect)((function(){(null==u?void 0:u.image)&&(T(tE(tE({},d),{url:u.image})),o.replace(oi({pathname:l,search:s},"image")))}),[null==u?void 0:u.image,o,l,s,T,d]),(0,r.jsxs)("div",tE({className:e.root},{children:[(0,r.jsx)("h1",{children:(0,r.jsx)(C.Typography,tE({style:{color:p.palette.text.primary}},{children:t("MARKETPLACE.NEW_LISTING")}))}),(0,r.jsx)(We,{className:e.input,value:d.title,error:d.title.length>=Ki.title,onChange:function(e){e.currentTarget.value.length!==Ki.title&&T(tE(tE({},d),{title:e.currentTarget.value}))},label:t("GENERIC.REQUIRED"),placeholder:t("MARKETPLACE.FORM_TITLE"),inputProps:{className:e.textFieldInput,maxLength:25},style:{width:"80%"},size:"medium",InputLabelProps:{shrink:!0}}),(0,r.jsxs)(C.Box,tE({display:"flex",alignItems:"center",paddingLeft:5},{children:[(0,r.jsx)("div",{children:(0,r.jsx)(eE.Z,{})}),(0,r.jsx)("div",{children:(0,r.jsx)(C.Button,tE({onClick:I},{children:t("MARKETPLACE.CHOOSE_IMAGE")}))})]})),(0,r.jsx)(We,{className:e.input,placeholder:t("MARKETPLACE.FORM_IMAGE"),value:d.url,error:d.url.length>=Ki.url,onChange:function(e){e.currentTarget.value.length!==Ki.url&&T(tE(tE({},d),{url:e.currentTarget.value}))},inputProps:{className:e.textFieldInput},style:{width:"80%"},size:"medium",variant:"outlined"}),(0,r.jsx)(We,{className:e.input,onChange:function(e){e.currentTarget.value.length!==Ki.description&&T(tE(tE({},d),{description:e.currentTarget.value}))},label:t("GENERIC.REQUIRED"),value:d.description,error:d.description.length>=Ki.description,placeholder:t("MARKETPLACE.FORM_DESCRIPTION"),inputProps:{className:e.multilineFieldInput,maxLength:130},style:{width:"80%"},size:"medium",InputLabelProps:{shrink:!0},multiline:!0,rows:4,variant:"outlined"}),(0,r.jsx)(C.Button,tE({onClick:function(){if(!_)return n({message:t("MARKETPLACE.FEEDBACK.REQUIRED_FIELDS"),type:"error"});(0,v.Z)(Zi.ADD_LISTING,tE(tE({},d),{title:A(d.title),description:A(d.description)})).then((function(e){if("ok"!==e.status)return n({message:t(e.errorMsg),type:"error"});n({message:t("MARKETPLACE.FEEDBACK.CREATE_LISTING_SUCCESS"),type:"success"}),o.push("/marketplace"),T({title:"",description:"",url:""})}))},className:e.postButton,disabled:!_},{children:t("MARKETPLACE.POST_LISTING")}))]}))},oE=function(){return(0,r.jsx)("div",{children:(0,r.jsx)(aE,{})})},iE=n(85942),lE=n.n(iE),EE=(vl=function(e,t){return(vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}vl(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),sE=function(){return(sE=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pE=function(e,t){3===(e=e.replace(/^#/,"")).length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var n,r=AE(e.match(/.{2}/g),3),a=r[0],o=r[1],i=r[2];a=(n=AE([parseInt(a,16)+t,parseInt(o,16)+t,parseInt(i,16)+t],3))[0],o=n[1],i=n[2],a=Math.max(Math.min(255,a),0).toString(16),o=Math.max(Math.min(255,o),0).toString(16),i=Math.max(Math.min(255,i),0).toString(16);var l=(a.length<2?"0":"")+a,E=(o.length<2?"0":"")+o,s=(i.length<2?"0":"")+i;return"#".concat(l).concat(E).concat(s)},_E=lE().div(gl||(gl=dE(["\n height: 100%;\n width: 100%;\n\n color: ",";\n background: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-size: 400% 400%;\n animation: gradient 6s ease infinite;\n\n @keyframes gradient {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n"],["\n height: 100%;\n width: 100%;\n\n color: ",";\n background: ",";\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n background-size: 400% 400%;\n animation: gradient 6s ease infinite;\n\n @keyframes gradient {\n 0% {\n background-position: 0% 50%;\n }\n 50% {\n background-position: 100% 50%;\n }\n 100% {\n background-position: 0% 50%;\n }\n }\n"])),(function(e){var t=e.color;return null!=t?t:"#fff"}),(function(e){var t=e.background;return null!=t?t:"#222"})),IE=lE().div(Dl||(Dl=dE(["\n position: absolute;\n bottom: 0;\n left: 0;\n padding: 2rem;\n"],["\n position: absolute;\n bottom: 0;\n left: 0;\n padding: 2rem;\n"]))),SE=lE().div(Pl||(Pl=dE(["\n svg {\n width: 3.5rem;\n height: 3.5rem;\n }\n\n animation: 3s linear 0.25s infinite alternate breath;\n\n @keyframes breath {\n 0% {\n transform: scale(1);\n }\n\n 100% {\n transform: scale(1.5);\n }\n }\n"],["\n svg {\n width: 3.5rem;\n height: 3.5rem;\n }\n\n animation: 3s linear 0.25s infinite alternate breath;\n\n @keyframes breath {\n 0% {\n transform: scale(1);\n }\n\n 100% {\n transform: scale(1.5);\n }\n }\n"]))),fE=function(e){var t=pE(e,30),n=pE(e,-30);return"linear-gradient(45deg,".concat(t,", ").concat(n,", ").concat(t,", ").concat(n,", ").concat(n,")")},RE=function(e){var t=e.backgroundColor,n=e.icon,a=fE(t);return(0,r.jsxs)(_E,TE({},e,{background:a},{children:[(0,r.jsx)(SE,{children:n}),(0,r.jsx)(IE,{children:(0,r.jsx)(C.CircularProgress,{color:"inherit"})})]}))};function OE(e){return function(t){var n,i=t.children,l=(0,se.useTranslation)().t,E=F(),s=fE(null!==(n=e.backgroundColor)&&void 0!==n?n:"#222"),u=(0,a.useMemo)((function(){return(0,C.createTheme)((0,fr.h)(E,null==e?void 0:e.theme))}),[E]);return(0,r.jsx)(cE,TE({background:s,color:e.color,t:l},{children:(0,r.jsx)(C.StyledEngineProvider,TE({injectFirst:!0},{children:(0,r.jsx)(o().Suspense,TE({fallback:(0,r.jsx)(RE,TE({},e))},{children:(0,r.jsx)(C.ThemeProvider,TE({theme:u},{children:i}))}))}))}))}}var hE,mE,CE=function(){return(CE=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],a=Ii(),o=rr(),i=(0,E.useHistory)(),l=(0,C.useTheme)(),s=o.referal&&decodeURIComponent(o.referal);return e&&e.length?(0,r.jsx)(C.List,gE({disablePadding:!0},{children:e.map((function(e){return(0,r.jsx)(C.ListItem,gE({button:!0,divider:!0,onClick:function(){var n;return n=e,void(s?i.push(vE(yE(s),"note",String(n.id))):(t(n),a(!0)))}},{children:(0,r.jsx)(C.ListItemText,{children:(0,r.jsx)(C.Typography,gE({style:{color:l.palette.text.primary}},{children:e.title}))})}),e.id)}))})):(0,r.jsx)(C.Box,gE({display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",height:"100%"},{children:(0,r.jsx)(C.Typography,gE({color:"inherit",variant:"h6",style:{fontWeight:300,color:l.palette.text.primary}},{children:n("NOTES.FEEDBACK.NO_NOTES")}))}))},PE=(0,q.Z)((function(e){return{modalRoot:{zIndex:20,position:"absolute",height:"99%",width:"100%",background:e.palette.background.default},input:{marginBottom:20},inputPropsTitle:{fontSize:28},inputPropsContent:{fontSize:20,lineHeight:1.2}}})),bE=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ME=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},FE=function(){var e,t,n,o,i,l,s,u,c,d,T=PE(),A=(t=yr().addAlert,n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],i=(e=(0,L.useSetRecoilState)(Ti),o={deleteLocalNote:(0,a.useCallback)((function(t){e((function(e){return ME([],bE(e),!1).filter((function(e){return e.id!==t}))}))}),[e]),addLocalNote:(0,a.useCallback)((function(t){e((function(e){return ME([t],bE(e),!1)}))}),[e]),updateLocalNote:(0,a.useCallback)((function(t){e((function(e){var n=e.findIndex((function(e){return e.id===t.id})),r=ME([],bE(e),!1);return r[n]=t,r}))}),[e])}).addLocalNote,l=o.deleteLocalNote,s=o.updateLocalNote,u=(0,a.useCallback)((function(e){var r=e.title,a=e.content;return kE(void 0,void 0,void 0,(function(){var e;return xE(this,(function(o){switch(o.label){case 0:return[4,(0,v.Z)(Ho.ADD_NOTE,{title:r,content:a})];case 1:return"ok"!==(e=o.sent()).status?[2,t({message:n("NOTES.FEEDBACK.ADD_FAILED"),type:"error"})]:(i(e.data),t({message:n("NOTES.FEEDBACK.ADD_SUCCESS"),type:"success"}),[2])}}))}))}),[t,i,n]),c=(0,a.useCallback)((function(e){return kE(void 0,void 0,void 0,(function(){var r;return xE(this,(function(a){switch(a.label){case 0:return[4,(0,v.Z)(Ho.DELETE_NOTE,e)];case 1:return"ok"!==(r=a.sent()).status?[2,t({message:n("NOTES.FEEDBACK.DELETE_FAILED"),type:"error"})]:(l(r.data.id),t({message:n("NOTES.FEEDBACK.DELETE_SUCCESS"),type:"success"}),[2])}}))}))}),[t,l,n]),d=(0,a.useCallback)((function(e){var r=e.id,a=e.content,o=e.title;return kE(void 0,void 0,void 0,(function(){return xE(this,(function(e){switch(e.label){case 0:return[4,(0,v.Z)(Ho.UPDATE_NOTE,{id:r,content:a,title:o})];case 1:return"ok"!==e.sent().status?[2,t({message:n("NOTES.FEEDBACK.UPDATE_FAILED"),type:"error"})]:(s({id:r,title:o,content:a}),t({message:n("NOTES.FEEDBACK.UPDATE_SUCCESS"),type:"success"}),[2])}}))}))}),[t,n,s]),{addNewNote:u,deleteNote:c,updateNote:d}),p=A.addNewNote,_=A.deleteNote,I=A.updateNote,S=wE((0,L.useRecoilState)(pi),2),f=S[0],R=S[1],O=wE((0,se.useTranslation)(),1)[0],h=wE((0,L.useRecoilState)(Ai),2),m=h[0],N=h[1],y=wE((0,a.useState)(""),2),g=y[0],D=y[1],P=wE((0,a.useState)(""),2),b=P[0],M=P[1],k=(0,C.useTheme)(),x=(0,E.useHistory)(),G=(0,E.useLocation)(),w=!Boolean(null==m?void 0:m.id);(0,a.useEffect)((function(){null!==m&&(M(m.content),D(m.title))}),[m]);var F=function(){R(!1)};return null===m?null:(0,r.jsx)(C.Slide,GE({direction:"left",in:f,mountOnEnter:!0,unmountOnExit:!0,onExited:function(){N(null),G.search&&x.goBack()}},{children:(0,r.jsx)(C.Paper,GE({className:T.modalRoot,square:!0},{children:(0,r.jsx)(C.Container,{children:(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Box,GE({py:2},{children:(0,r.jsx)(C.Button,GE({color:"primary",size:"large",startIcon:(0,r.jsx)(eo.Z,{fontSize:"large"}),onClick:F},{children:O("APPS_NOTES")}))})),(0,r.jsx)(We,{className:T.input,maxRows:1,label:O("GENERIC.TITLE"),inputProps:{className:T.inputPropsTitle,maxLength:25},fullWidth:!0,value:g,onChange:function(e){D(e.target.value)}}),(0,r.jsx)(We,{className:T.input,inputProps:{className:T.inputPropsContent,maxLength:250},label:O("GENERIC.CONTENT"),multiline:!0,fullWidth:!0,rows:16,variant:"outlined",value:b,onChange:function(e){M(e.target.value)}}),(0,r.jsxs)(C.Typography,GE({paragraph:!0},{children:[b.length,"/250"]})),w?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Box,GE({display:"inline",p:1},{children:(0,r.jsx)(C.Button,GE({variant:"contained",disabled:g.length<=0,onClick:function(){p({title:g,content:b}).then((function(){G.search&&x.goBack(),R(!1)})).catch(console.error)}},{children:(0,r.jsx)(C.Typography,GE({style:g.length<=0&&{color:k.palette.text.disabled}||{color:k.palette.text.primary}},{children:O("GENERIC.SAVE")}))}))})),(0,r.jsx)(C.Box,GE({display:"inline",p:1},{children:(0,r.jsx)(pt,GE({color:"error",variant:"contained",onClick:F},{children:(0,r.jsx)(C.Typography,GE({style:{color:k.palette.text.primary}},{children:O("GENERIC.CANCEL")}))}))}))]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Box,GE({display:"inline",p:1},{children:(0,r.jsx)(C.Button,GE({color:"primary",variant:"contained",onClick:function(){I({id:m.id,title:g,content:b}).then((function(){R(!1)})).catch(console.error)},disabled:g.length<=0},{children:(0,r.jsx)(C.Typography,GE({style:g.length<=0&&{color:k.palette.text.disabled}||{color:k.palette.text.primary}},{children:O("GENERIC.UPDATE")}))}))})),(0,r.jsx)(C.Box,GE({display:"inline",p:1},{children:(0,r.jsx)(pt,GE({color:"error",variant:"contained",onClick:function(){_({id:m.id}).then((function(){R(!1)})).catch(console.error)}},{children:(0,r.jsx)(C.Typography,GE({style:{color:k.palette.text.primary}},{children:O("GENERIC.DELETE")}))}))}))]})]})})}))}))},jE=n(52464),UE=(0,q.Z)((function(e){return{backgroundModal:{background:"black",opacity:"0.6",position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:5},absolute:{position:"absolute",right:e.spacing(3),bottom:e.spacing(5)}}})),BE=n(429),HE=BE.Z[800],WE=Pn.Z.white,VE=Pn.Z.white,zE=Or({palette:{primary:{main:HE,dark:BE.Z[900],light:BE.Z[500],contrastText:VE}}}),KE=function(){return(KE=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},XE=function(){var e=ZE(),t=(0,E.useHistory)(),n=rr(),a=(0,L.useRecoilValue)(No.photos),o=qE(vo(),2),i=o[0],l=o[1],s=qE((0,L.useRecoilState)(No.checkedPhotos),2),u=s[0],c=s[1],d=n.referal?decodeURIComponent(n.referal):"/camera/image";return(0,r.jsx)("div",{children:(0,r.jsxs)(C.Box,JE({display:"flex",flexWrap:"wrap",alignContent:"flex-start",className:e.root},{children:[!!a.length&&(0,r.jsx)(C.Box,JE({position:"absolute",top:10,right:3},{children:(0,r.jsx)(C.IconButton,JE({onClick:function(){l((function(e){return!e}))}},{children:(0,r.jsx)(Ja.Z,{})}))})),a.map((function(n){return i?(0,r.jsx)(C.Box,{children:(0,r.jsx)("div",JE({style:{backgroundImage:"url(".concat(n.image,")")},className:e.photo,onClick:function(){var e,t,r;return e=n.id,t=u.indexOf(e),r=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsx)(Qe,es({visible:!!t,handleClose:n},{children:(0,r.jsx)("div",es({className:o.shareModal},{children:(0,r.jsxs)("div",es({className:o.innerShareModal},{children:[(0,r.jsx)("h4",{children:l("CAMERA.COPY_IMAGE")}),(0,r.jsx)(C.Button,es({onClick:function(){Jr(t.image),i.push(a)},variant:"outlined",className:o.button},{children:"Copy image"}))]}))}))}))},ns=function(){return(ns=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},as=function(){var e=rs((0,a.useState)(null),2),t=e[0],n=e[1],o=QE(),i=(0,E.useHistory)(),l=rr(),s=Do().deletePhoto,u=yr().addAlert,c=rs((0,se.useTranslation)(),1)[0],d=l.referal||"/camera",T=(0,a.useMemo)((function(){return{id:parseInt(l.id),image:l.image}}),[l]),A=(0,a.useCallback)((function(){n(T)}),[T]);return T?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ts,{referal:d,meta:t,onClose:function(){return n(null)}}),(0,r.jsxs)(C.Paper,ns({className:o.modal},{children:[(0,r.jsx)("div",{className:t?o.backgroundModal:null}),(0,r.jsx)(C.Button,ns({onClick:function(){i.push(d)}},{children:(0,r.jsx)(eo.Z,{})})),(0,r.jsx)("div",{className:o.image,style:{backgroundImage:"url(".concat(T.image,")")}}),(0,r.jsxs)("div",ns({className:o.actionDiv},{children:[(0,r.jsx)(C.Button,ns({onClick:function(){(0,v.Z)(so.DELETE_PHOTO,{image:T.image}).then((function(e){if("ok"!==e.status)return u({message:c("CAMERA.FAILED_TO_DELETE"),type:"error"});s(T.image),i.goBack()}))}},{children:(0,r.jsx)(Co.Z,{fontSize:"large"})})),(0,r.jsx)(C.Button,ns({onClick:A},{children:(0,r.jsx)($E.Z,{fontSize:"large"})}))]}))]}))]}):null},os=function(){return(os=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},ls=(0,ot.ZP)(C.Fab)((function(e){var t=e.theme;return{position:"absolute",bottom:t.spacing(5),right:t.spacing(3)}})),Es=function(){var e=is(vo(),2),t=e[0],n=e[1],o=is((0,a.useState)(!1),2),i=o[0],l=o[1],E=(0,L.useRecoilValue)(No.checkedPhotos),s=Do(),u=s.takePhoto,c=s.deletePhotos,d=yr().addAlert,T=is((0,se.useTranslation)(),1)[0],A=(0,C.useTheme)();return i?(0,r.jsx)(ls,os({color:"primary",disabled:!0},{children:(0,r.jsx)(C.CircularProgress,{})})):(0,r.jsx)(ls,os({color:"primary",onClick:t?function(){(0,v.Z)(so.DELETE_MULTIPLE_PHOTOS,E).then((function(e){if("ok"!==e.status)return d({message:T("CAMERA.FAILED_TO_DELETE"),type:"error"});c(E),n(!1)}))}:function(){l(!0),(0,v.Z)(so.TAKE_PHOTO).then((function(e){if("ok"!==e.status)return l(!1),d({message:T(e.errorMsg),type:"error"});u(e.data),l(!1)}))}},{children:t?(0,r.jsx)(fa.Delete,{style:{color:A.palette.error.main}}):(0,r.jsx)(fa.Add,{style:{color:A.palette.primary.main}})}))},ss=function(){return(ss=Object.assign||function(e){for(var t,n=1,r=arguments.length;nt.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["id","emitOnOpen","component"]);return(0,r.jsx)(E.Route,ds({},o,{render:function(){return(0,r.jsx)(cs,ds({id:t,emitOnOpen:n},{children:(0,r.jsx)(a,{})}))}}))},As=n(27038),ps=As.Z[500],_s=Pn.Z.white,Is=(Pn.Z.black,As.Z[700],As.Z[200],"#00acee"),Ss=Pn.Z.white,fs="#FE3B73",Rs=Pn.Z.white,Os={palette:{primary:{main:fs,dark:As.Z[700],light:As.Z[300],contrastText:Rs},secondary:{main:"#d32f2f",light:"#eb4242",dark:"#941212",contrastText:Rs},success:{main:"#2196f3",contrastText:Rs}}},hs=function(){return(hs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Cs="BrowserURLBar",Ls={urlInput:"".concat(Cs,"-urlInput"),urlInputFocused:"".concat(Cs,"-urlInputFocused"),root:"".concat(Cs,"-root")},Ns=(0,ot.ZP)(C.Box)((function(e){var t,n=e.theme;return(t={})["& .".concat(Ls.urlInput)]={borderRadius:18,borderWidth:1,borderStyle:"solid",paddingRight:10,paddingLeft:10,marginLeft:5,borderColor:"#787878FF",color:n.palette.text.disabled,transition:"color 0.1s ease"},t["&.".concat(Ls.root)]={},t})),vs=function(e){var t=e.goBack,n=e.reloadPage,o=e.browserHasHistory,i=e.browserUrl,l=e.setBrowser,E=(0,a.useRef)(null),s=ms((0,a.useState)(""),2),u=s[0],c=s[1],d=ms((0,a.useState)(!1),2),T=d[0],A=d[1],p=i.replace(/(^\w+:|^)\/\//,"");return(0,r.jsxs)(Ns,hs({display:"flex",py:1,className:Ls.root,px:1},{children:[(0,r.jsx)(C.IconButton,hs({size:"small",onClick:function(){return n()}},{children:(0,r.jsx)(fa.Cached,{})})),o&&(0,r.jsx)(C.IconButton,hs({size:"small",onClick:function(){return t()}},{children:(0,r.jsx)(fa.KeyboardArrowLeft,{})})),(0,r.jsx)(Ve,{className:Ls.urlInput,ref:E,fullWidth:!0,onChange:function(e){c(e.target.value)},onKeyDown:function(e){"Enter"===e.code&&(l(u),e.currentTarget.blur())},value:T?u:p,classes:{focused:Ls.urlInputFocused},onFocus:function(e){c(i),A(!0)},spellCheck:!1,onBlur:function(e){A(!1),c(i)}})]}))},ys=function(e){return new Promise((function(t){return setTimeout(t,e)}))},gs=function(){return(gs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ps="BrowserApp",bs={iframe:"".concat(Ps,"-iframe"),root:"".concat(Ps,"-root")},Ms=(0,ot.ZP)(Ie.O)((function(){var e;return(e={})["& .".concat(bs.iframe)]={height:"100%",width:"100%",zoom:.5,border:"none"},e["& .".concat(bs.root)]={height:"100%",display:"flex",flexDirection:"column"},e}));(mE=hE||(hE={}))[mE.SET_URL=0]="SET_URL",mE[mE.ADD_HISTORY=1]="ADD_HISTORY",mE[mE.RELOAD=2]="RELOAD";var ks,xs,Gs,ws=function(e,t){switch(t.type){case hE.ADD_HISTORY:return"about:blank"===t.payload?e:gs(gs({},e),{browserHistory:e.browserHistory.concat(t.payload)});case hE.SET_URL:return gs(gs({},e),{browserUrl:t.payload});default:throw Error("Invalid reducer action type")}},Fs=function(){var e=Ds(ua(),1)[0].appSettings,t=Ds((0,a.useReducer)(ws,{browserUrl:e.browserHomePage,browserHistory:[e.browserHomePage]}),2),n=t[0],o=t[1],i=n.browserHistory,l=n.browserUrl,E=(0,a.useRef)(null),s=function(e){var t=e.match(/^(http|https):\/\//)?e:"https://"+e;o({payload:l,type:hE.ADD_HISTORY}),o({payload:t,type:hE.SET_URL})};return(0,r.jsx)(Ms,gs({id:"browser"},{children:(0,r.jsxs)(ie,gs({className:bs.root},{children:[(0,r.jsx)(vs,{browserUrl:l,browserHasHistory:i.length>1,setBrowser:s,goBack:function(){if(!(i.length<=1)){var e=i[i.length-1];e!==l&&s(e)}},reloadPage:function(){var e,t;return t=function(){var e;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],l=xo(a.voiceMessage),E=l.play,s=l.pause,u=l.playing,c=l.currentTime,d=l.duration,T=isNaN(d)||d==1/0?0:Math.trunc(c)/Math.trunc(d)*100,A=(t=a.location,n=a.job,t&&n?"".concat(t," - ").concat(n):t||n||void 0);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.CardContent,Zs({className:o.tags},{children:a.tagList.map((function(e){return(0,r.jsx)(C.Chip,{className:o.tag,label:e,color:"primary"})}))})),(0,r.jsx)(C.CardMedia,{className:o.media,image:a.image||"https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg",title:a.name}),(0,r.jsxs)(C.CardContent,Zs({className:o.content},{children:[(0,r.jsx)(C.Typography,Zs({gutterBottom:!0,variant:"h4",component:"h2"},{children:a.name})),(0,r.jsx)(C.Typography,Zs({gutterBottom:!0,color:"textSecondary",component:"p"},{children:i("MATCH.MESSAGES.PROFILE_LAST_ACTIVE",{lastActive:a.lastActiveFormatted})})),A&&(0,r.jsx)(C.Typography,Zs({gutterBottom:!0,variant:"body1",color:"textSecondary",component:"p"},{children:A})),(0,r.jsx)(C.Typography,Zs({variant:"body2",color:"textSecondary",component:"p"},{children:a.bio})),a.voiceMessage&&(0,r.jsx)(C.Box,{children:(0,r.jsxs)(C.Box,Zs({display:"flex",alignItems:"center"},{children:[(0,r.jsx)(C.IconButton,Zs({onClick:u?s:E},{children:u?(0,r.jsx)(wo.Z,{sx:{color:"#232323"}}):(0,r.jsx)(Go.Z,{sx:{color:"#232323"}})})),(0,r.jsx)(C.Box,Zs({sx:{width:"60%"}},{children:!T&&u?(0,r.jsx)(C.LinearProgress,{}):(0,r.jsx)(C.LinearProgress,{variant:"determinate",value:T})}))]}))})]}))]})},Xs=function(){return(Xs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i};jn().extend(jo());var uu,cu,du=function(e){var t=e.isRecording,n=e.startRecording,a=e.stopRecording;return(0,r.jsx)(C.Box,{children:(0,r.jsxs)(C.ButtonGroup,{children:[(0,r.jsx)(C.Tooltip,iu({title:"Record voice message",placement:"right"},{children:(0,r.jsx)(C.IconButton,iu({disabled:t,color:"error",size:"small",onClick:n},{children:(0,r.jsx)(Ci.Z,{})}))})),t&&(0,r.jsx)(C.IconButton,iu({color:"error",size:"small",onClick:t&&a},{children:(0,r.jsx)(Li.Z,{})}))]})})},Tu=function(e){var t=e.playing,n=e.play,a=e.pause;return(0,r.jsx)(C.Box,{children:(0,r.jsx)(C.ButtonGroup,{children:(0,r.jsx)(C.IconButton,iu({size:"small"},{children:t?(0,r.jsx)(wo.Z,{onClick:a}):(0,r.jsx)(Go.Z,{onClick:n})}))})})},Au=function(e){var t=e.open,n=e.closeModal,o=e.setVoiceMessage,i=yi(),l=i.blob,E=i.audio,s=i.recordingState,u=i.startRecording,c=i.stopRecording,d=su((0,a.useState)(null),2),T=d[0],A=d[1],p=su((0,a.useState)(!1),2),_=p[0],I=p[1],S=(0,a.useRef)(new Audio),f=S.current.duration;return(0,a.useEffect)((function(){S.current.src=E}),[E]),(0,a.useEffect)((function(){S.current&&(S.current.ontimeupdate=function(){A(Math.trunc(S.current.currentTime))})})),(0,r.jsxs)(Qe,iu({visible:t,handleClose:n},{children:[(0,r.jsxs)(C.Box,iu({display:"flex",alignItems:"center",justifyContent:"flex-start",py:1},{children:[(0,r.jsx)(C.Box,iu({pl:1},{children:E&&!s.isRecording?(0,r.jsx)(Tu,{play:function(){return lu(void 0,void 0,void 0,(function(){return Eu(this,(function(e){switch(e.label){case 0:return[4,S.current.play()];case 1:return e.sent(),I(!0),[2]}}))}))},pause:function(){S.current.pause(),I(!1)},playing:_}):(0,r.jsx)(du,{startRecording:function(){return lu(void 0,void 0,void 0,(function(){return Eu(this,(function(e){switch(e.label){case 0:return[4,u()];case 1:return e.sent(),[2]}}))}))},stopRecording:function(){c()},isRecording:s.isRecording})})),E?s.isRecording?(0,r.jsx)(C.Typography,{children:"Recording..."}):E&&!isNaN(f)?(0,r.jsx)(C.Box,{children:(0,r.jsxs)(C.Typography,{children:[jn().duration(1e3*T).format("mm:ss"),f===1/0?null:" - ".concat(jn().duration(1e3*Math.trunc(f)).format("mm:ss"))]})}):(0,r.jsx)(C.Typography,{children:"Click to play voice message"}):(0,r.jsx)(C.Typography,{children:"Record Voice Message"})]})),!s.isRecording&&E&&l&&(0,r.jsx)(C.Button,iu({variant:"contained",onClick:function(){l&&(o(l),n())}},{children:"Save"}))]}))},pu=function(){return(pu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Iu=(0,q.Z)({root:{position:"relative",width:"100%",height:"calc(100% - 40px)",padding:"15px"},card:{position:"absolute",margin:"15px 15px 25px 15px",height:"calc(100% - 80px)",width:"calc(100% - 30px)",overflow:"hidden"},spacer:{height:"8px"}}),Su=function(e){var t=this,n=e.profile,o=e.showPreview,i=Iu(),l=_u((0,se.useTranslation)(),1)[0],s=kr().ResourceConfig,u=yr().addAlert,c=(0,L.useSetRecoilState)(ou.myProfile),d=(0,E.useHistory)(),T=(0,E.useLocation)(),A=T.pathname,p=T.search,_=rr(),I=_u((0,a.useState)((null==n?void 0:n.image)||""),2),S=I[0],f=I[1],R=_u((0,a.useState)((null==n?void 0:n.name)||""),2),O=R[0],h=R[1],m=_u((0,a.useState)((null==n?void 0:n.bio)||""),2),N=m[0],y=m[1],g=_u((0,a.useState)((null==n?void 0:n.job)||""),2),D=g[0],P=g[1],b=_u((0,a.useState)((null==n?void 0:n.location)||""),2),M=b[0],k=b[1],x=_u((0,a.useState)((null==n?void 0:n.tags)||""),2),G=x[0],w=x[1],F=_u((0,a.useState)(null),2),j=F[0],U=F[1],B=_u((0,a.useState)(!1),2),H=B[0],W=B[1],V=xo(n.voiceMessage),z=V.play,K=V.pause,Y=V.playing,Z=V.currentTime,J=V.duration,q=isNaN(J)||J==1/0?0:Math.trunc(Z)/Math.trunc(J)*100,X=(0,a.useCallback)((function(){d.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(A+p)})))}),[d,A,p]),Q=pu(pu({},n),{image:S,name:O,bio:N,location:M,job:D,tagList:G.split(",").map((function(e){return e.trim()}))});return(0,a.useEffect)((function(){(null==_?void 0:_.image)&&(f(_.image),d.replace(oi({pathname:A,search:p},"image")))}),[_,d,f,A,p]),n||s.match.allowEditableProfileName?o?(0,r.jsx)(C.Card,pu({raised:!0,className:i.card},{children:(0,r.jsx)(qs,{profile:Q})})):(0,r.jsxs)("div",pu({className:i.root},{children:[(0,r.jsx)(Au,{open:H,closeModal:function(){W((function(e){return!e}))},setVoiceMessage:function(e){U(e)}}),H&&(0,r.jsx)(fe,{}),(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_IMAGE"),value:Q.image,handleChange:f,allowChange:!0}),(0,r.jsx)(C.Box,pu({mt:1,mb:2},{children:(0,r.jsx)(Re.z,pu({variant:"contained",onClick:X},{children:"Choose image"}))}))]}),(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_NAME"),value:O,handleChange:h,allowChange:s.match.allowEditableProfileName}),(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_BIO"),value:Q.bio,handleChange:y,multiline:!0,maxLength:250}),(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_LOCATION"),value:Q.location,handleChange:k}),(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_JOB"),value:Q.job,handleChange:P,maxLength:50}),(0,r.jsx)(Ys,{label:l("MATCH.EDIT_PROFILE_TAGS"),value:G,handleChange:w}),s&&s.voiceMessage&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Typography,pu({variant:"body2",color:"textSecondary",component:"p",sx:{marginTop:"8px"}},{children:l("MATCH.EDIT_VOICE_MESSAGE")})),(0,r.jsxs)(C.Stack,pu({direction:"row"},{children:[(0,r.jsx)(C.IconButton,pu({onClick:function(){return W(!0)}},{children:(0,r.jsx)(ro.Z,{})})),n.voiceMessage&&(0,r.jsx)(C.Box,pu({sx:{width:"100%"}},{children:(0,r.jsxs)(C.Box,pu({display:"flex",alignItems:"center"},{children:[(0,r.jsx)(C.IconButton,pu({onClick:Y?K:z},{children:Y?(0,r.jsx)(wo.Z,{}):(0,r.jsx)(Go.Z,{})})),(0,r.jsx)(C.Box,pu({sx:{width:"60%"}},{children:!q&&Y?(0,r.jsx)(C.LinearProgress,{}):(0,r.jsx)(C.LinearProgress,{variant:"determinate",value:q})}))]}))}))]}))]}),(0,r.jsx)(ht,{handleClick:function(){var e,r,a;return e=t,a=function(){var e,t,r,a;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ru=function(){var e=fu((0,L.useRecoilState)(ou.myProfile),2),t=e[0],n=e[1],r=fu((0,L.useRecoilState)(ou.noProfileExists),2);return{profile:t,setProfile:n,noProfileExists:r[0],setNoProfileExists:r[1]}},Ou=function(){return(Ou=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},mu=(0,q.Z)({root:{height:"100%",width:"100%"},switch:{marginLeft:"15px"}}),Cu=function(){var e=Ru(),t=e.profile,n=e.noProfileExists,o=mu(),i=hu((0,se.useTranslation)(),1)[0],l=(0,C.useTheme)(),E=hu((0,a.useState)(!1),2),s=E[0],u=E[1];return t||n?(0,r.jsxs)(C.Box,Ou({className:o.root},{children:[(0,r.jsx)(C.Box,Ou({className:o.switch},{children:(0,r.jsx)(C.FormControlLabel,{control:(0,r.jsx)(C.Switch,{checked:s,onChange:function(){u((function(e){return!e}))}}),label:(0,r.jsx)(C.Typography,Ou({style:{color:l.palette.text.primary}},{children:i("MATCH.EDIT_PROFILE_PREVIEW")}))})})),(0,r.jsx)(Su,{showPreview:s,profile:t})]})):(0,r.jsx)(Hs,{})},Lu=n(72203),Nu=n(19465),vu=(Ks=function(e,t){return(Ks=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Ks(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yu=function(e){function t(t,n,r,a){var o=e.call(this,t,n)||this;return o.onMouseMove=function(e){e.preventDefault();var t=e.clientX,n=e.clientY,r=o.deltas(t,n).deltaX;o.onDrag(r),o._onMouseMove(t,n)},o.onMouseUp=function(){o.onDrop(),o._onMouseUp()},o.onDrag=r,o.onDrop=a,o}return vu(t,e),t}((function(e,t){void 0===t&&(t=null);var n=this;this.width=0,this.initialX=0,this.initialY=0,this.mouseDownInitialX=0,this.mouseDownInitialY=0,this.updatedX=0,this.updatedY=0,this.mouseDownX=0,this.mouseDownY=0,this.onMouseDown=function(e){e.preventDefault(),n.mouseDownX=e.clientX,n.mouseDownY=e.clientY,n.mouseDownInitialX=n.mouseDownX,n.mouseDownInitialY=n.mouseDownY,document.onmouseup=n.onMouseUp,document.onmousemove=n.onMouseMove},this.onMouseMove=function(e){e.preventDefault();var t=e.clientX,r=e.clientY;n._onMouseMove(t,r)},this._onMouseMove=function(e,t){if(n.updatedX=n.mouseDownX-e,n.updatedY=n.mouseDownY-t,n.mouseDownX=e,n.mouseDownY=t,n.element.style.top=n.element.offsetTop-n.updatedY+"px",n.element.style.left=n.element.offsetLeft-n.updatedX+"px",n.useRotation){var r=n.deltas(n.mouseDownX,n.mouseDownY).deltaX/n.width,a=-1*n.maxRotationDeg*r;n.element.style.webkitTransform="rotate(".concat(a,"deg)")}},this.onMouseUp=function(e){e.preventDefault(),n._onMouseUp()},this._onMouseUp=function(){n.cleanup(),n.element.style.left="".concat(n.initialX,"px"),n.element.style.top="".concat(n.initialY,"px"),n.useRotation&&(n.element.style.webkitTransform="rotate(0deg)")},this.cleanup=function(){document.onmouseup=null,document.onmousemove=null},this.deltas=function(e,t){return{deltaX:e-n.mouseDownInitialX,deltaY:t-n.mouseDownInitialX}},this.element=e.current,this.width=this.element.clientWidth,this.maxRotationDeg=t,this.useRotation=null!==t,this.element.onmousedown=this.onMouseDown})),gu=function(){return(gu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Gu=(0,q.Z)({root:{position:"relative",margin:"15px 15px 25px 15px",height:"calc(95% - 90px)",width:"calc(100% - 30px)",overflow:"hidden",cursor:"pointer"},media:{height:"60%"},content:{height:"40%"},status:{position:"absolute",zIndex:20,padding:"5px 15px",top:40,fontSize:"28px",fontWeight:"bold"},statusVisible:{transition:"opacity 0.25s ease-in-out"},statusNull:{transition:"opacity 0s"},like:{color:"green",border:"6px solid green",left:30,transform:"rotate(-18deg)"},nope:{color:"red",border:"6px solid red",right:30,transform:"rotate(18deg)"},buttons:{position:"absolute",bottom:70,width:"100%",height:"55px"},button:{margin:"0px 15px"}}),wu=function(e){var t=e.profile,n=e.onSwipe,o=Gu(),i=xu((0,se.useTranslation)(),1)[0],l=xu((0,a.useState)(null),2),E=l[0],s=l[1],u=(0,a.useRef)(null),c=(0,a.useRef)(null);u.current=E,c.current=t.id;var d=!0===E,T=!1===E,A="".concat(o.status," ").concat(d?o.statusVisible:o.statusNull," ").concat(o.like),p="".concat(o.status," ").concat(T?o.statusVisible:o.statusNull," ").concat(o.nope);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Pu,ku({id:"active-profile",onDrag:function(e){var t=null!==E;!t&&e>150?s(!0):!t&&e<-150?s(!1):e>-150&&e<150&&s(null)},onDrop:function(){n(c.current,u.current),s(null)}},{children:(0,r.jsxs)(C.Card,ku({raised:!0,className:o.root},{children:[(0,r.jsx)(Mu,{className:A,text:i("MATCH.MESSAGES.LIKED"),visible:d}),(0,r.jsx)(Mu,{className:p,text:i("MATCH.MESSAGES.NOPE"),visible:T}),(0,r.jsx)(qs,{profile:t})]}))})),(0,r.jsxs)(C.Box,ku({className:o.buttons,display:"flex",justifyContent:"center"},{children:[(0,r.jsx)(ce,ku({title:i("MATCH.DISLIKE"),"aria-label":"dislike"},{children:(0,r.jsx)(C.Fab,ku({size:"large",color:"secondary","aria-label":"dislike",onClick:function(){n(c.current,!1),s(null)},className:o.button},{children:(0,r.jsx)(Lu.Z,{})}))})),(0,r.jsx)(ce,ku({title:i("MATCH.LIKE"),"aria-label":"like"},{children:(0,r.jsx)(C.Fab,ku({size:"large",color:"primary","aria-label":"like",onClick:function(){n(c.current,!0),s(null)},className:o.button},{children:(0,r.jsx)(Nu.Z,{})}))}))]}))]})},Fu=function(){return(Fu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Hu=function(){var e=(0,L.useSetRecoilState)(ou.profiles),t=(0,L.useSetRecoilState)(ou.matches),n=yr().addAlert,r=Bu((0,se.useTranslation)(),1)[0],o=(0,a.useCallback)((function(a,o){e((function(e){return e.map((function(e){return a===e.id?Fu(Fu({},e),{viewed:!0,liked:o}):e}))})),o&&(0,v.Z)(xs.SAVE_LIKES,{id:a,liked:o}).then((function(e){if("ok"!==e.status)return n({message:r("MATCH.FEEDBACK.SAVE_LIKES_FAILED"),type:"error"});e.data&&(n({message:r("MATCH.FEEDBACK.NEW_LIKE_FOUND"),type:"info"}),(0,v.Z)(xs.GET_MATCHES,{page:0}).then((function(e){t(e.data)})))}))}),[e,n,r,t]),i=(0,L.useRecoilCallback)((function(e){var t=e.snapshot,n=e.set;return function(e,r){return ju(void 0,void 0,void 0,(function(){return Uu(this,(function(a){return e.identifier===r.identifier||"hasValue"!==t.getLoadable(ou.profiles).state||n(ou.profiles,(function(t){return function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},zu=(0,q.Z)({root:{height:"100%",width:"100%",overflow:"hidden"}}),Ku=function(){var e=zu(),t=Vu((0,se.useTranslation)(),1)[0],n=function(){var e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(ou.profiles),1)[0],t=(0,L.useRecoilValue)(ou.errorLoadingProfiles),n=e?e.filter((function(e){return!e.viewed})):null;return{profiles:e,activeProfile:e?n[0]:null,error:t}}(),o=n.profiles,i=n.error,l=n.activeProfile,E=Hu().setViewed,s=Vu((0,a.useState)(!1),2),u=s[0],c=s[1];return(0,a.useEffect)((function(){window.setTimeout((function(){c(!0)}),1250)}),[]),i?(0,r.jsx)($s,{text:t("MATCH.FEEDBACK.PROFILES_ERROR")}):u&&o?l?(0,r.jsx)(C.Paper,Wu({className:e.root,square:!0},{children:(0,r.jsx)(wu,{profile:l,onSwipe:function(e,t){null!==t&&E(e,t)}})})):(0,r.jsx)($s,{text:t("MATCH.FEEDBACK.NO_PROFILES")}):(0,r.jsx)(Hs,{})},Yu=n(78271),Zu=function(){return(Zu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},qu=(0,q.Z)({profile:{position:"relative",height:"90%",marginTop:"15px"}}),Xu=function(e){var t=e.match,n=(0,E.useHistory)(),o=qu(),i=Ju((0,se.useTranslation)(),1)[0],l=Ju((0,a.useState)(!1),2),s=l[0],u=l[1],c=i("MATCH.MESSAGES.PROFILE_MATCHED_AT",{matchedAt:t.matchedAtFormatted});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.ListItem,Zu({divider:!0},{children:[(0,r.jsx)(Yu.Z,{primary:t.name,secondary:c}),(0,r.jsx)(C.Button,Zu({onClick:function(){u((function(e){return!e}))}},{children:(0,r.jsx)(lr.Z,{})})),(0,r.jsx)(C.Button,Zu({onClick:function(){n.push("/messages/new?phoneNumber=".concat(t.phoneNumber))}},{children:(0,r.jsx)(Fl.Z,{})}))]})),s&&(0,r.jsx)(C.Box,Zu({className:o.profile},{children:(0,r.jsx)(qs,{profile:t})}))]})},Qu=o().memo((function(e){var t=e.totalCount,n=e.onChange;return(0,r.jsx)(C.Pagination,{defaultPage:1,count:t,onChange:n,color:"primary"})})),$u=function(){return($u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},tc=(0,q.Z)({root:{height:"100%",display:"flex",justifyContent:"space-between",flexDirection:"column"}}),nc=function(){var e=tc(),t=ec((0,se.useTranslation)(),1)[0],n=function(){var e=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(ou.matches),2);return{matches:e[0],setMatches:e[1],error:(0,L.useRecoilValue)(ou.errorLoadingMatches)}}(),o=n.matches,i=n.error,l=Hu().newMatchesPage,E=ec((0,a.useState)(1),2),s=E[0],u=E[1],c=(0,a.useCallback)((function(e,t){u(t)}),[u]);if((0,a.useEffect)((function(){l(s-1)}),[s,l]),i)return(0,r.jsx)($s,{text:t("MATCH.FEEDBACK.MATCHES_ERROR")});if(!o)return(0,r.jsx)(Hs,{});if(0===o.length)return(0,r.jsx)($s,{text:t("MATCH.FEEDBACK.NO_MATCHES")});var d=Math.ceil(o.length/20);return(0,r.jsxs)(C.Box,$u({className:e.root},{children:[(0,r.jsx)(C.Box,{children:o.map((function(e){return(0,r.jsx)(Xu,{match:e},e.id)}))}),(0,r.jsx)(C.Box,$u({mb:2,width:"100%",display:"flex",justifyContent:"center",alignItems:"center"},{children:d>1&&(0,r.jsx)(Qu,{onChange:c,totalCount:d})}))]}))},rc=function(){return(rc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(0),2),s=l[0],u=l[1];return(0,a.useEffect)((function(){o(!t)}),[o,t]),(0,r.jsxs)(Ie.O,{children:[(0,r.jsx)(_e,{app:i}),(0,r.jsx)(ie,{children:n?(0,r.jsx)(Cu,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Route,{path:"/match/",exact:!0,component:Ku}),(0,r.jsx)(E.Route,{path:"/match/matches",exact:!0,component:nc}),(0,r.jsx)(E.Route,{path:"/match/profile",exact:!0,component:Cu})]})}),(0,r.jsx)(oc,{activePage:s,handleChange:function(e,t){return u(t)}})]})},lc=function(){return(lc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},yc=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Mc=function(e){var t=e.tweetId,n=e.isLiked,o=e.likes,i=bc((0,a.useState)(n),2),l=i[0],E=i[1],s=bc((0,a.useState)(!1),2),u=s[0],c=s[1],d=(0,se.useTranslation)().t,T=yr().addAlert,A=Dc().localToggleLike;return u?(0,r.jsx)(C.Button,Pc({disabled:!0},{children:(0,r.jsx)(C.CircularProgress,{size:22})})):(0,r.jsx)(C.Button,Pc({onClick:function(){c(!0),(0,v.Z)(uu.TOGGLE_LIKE,{tweetId:t}).then((function(e){if("ok"!==e.status)return T({message:d("TWITTER.FEEDBACK.LIKE_TWEET_FAILED"),type:"error"});c(!1),E(!l),A(t)}))},startIcon:l?(0,r.jsx)(dc.Z,{color:"primary"}):(0,r.jsx)(cc.Z,{})},{children:(0,r.jsx)(C.Typography,Pc({color:"#bfbfbf",fontSize:"16px"},{children:o}))}))},kc=n(42443),xc=function(){return(xc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(null),2),s=E[0],u=E[1];return t&&n&&0!==n.length?(0,r.jsx)(C.Box,Bc({p:1},{children:n.map((function(e){return(0,r.jsxs)(C.Box,Bc({onClick:function(t){var n,r;return n=t,r=e.id,u(n.currentTarget),void l(r)}},{children:[(0,r.jsx)(Uc,{link:e.link,handleClick:o?function(){return o(e.id)}:null},e.id),(0,r.jsx)(C.Popper,Bc({anchorEl:s,placement:"left",open:i===e.id},{children:(0,r.jsx)(et,{popper:!0,alt:"image",src:e.link})}))]}))}))})):null};Hc.defaultProps={removeImage:null,small:!1};var Wc=Hc,Vc=(0,C.styled)(C.Box)({width:"100%"}),zc=(0,C.styled)("img")({borderRadius:"50%",objectFit:"cover"});function Kc(e){var t=e.avatarUrl,n=e.showInvalidImage,o=e.height,i=e.width,l=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(!1),2),E=l[0],s=l[1],u=kr().ResourceConfig;return u&&u.twitter.enableAvatars?(0,r.jsxs)(Vc,{children:[E&&(0,r.jsx)(zc,{src:n?"media/twitter/invalid.png":Tc,alt:"Invalid avatar",style:{height:o,width:i}}),(0,r.jsx)(zc,{src:t||Tc,alt:"Your profile avatar",onError:function(){return s(!0)},onLoad:function(){return s(!1)},style:{display:E?"none":"block",height:o,width:i}})]}):null}Kc.defaultProps={avatarUrl:null,showInvalidImage:!1,height:"125px",width:"125px"};var Yc=Kc,Zc=function(){return(Zc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},qc=(0,q.Z)((function(e){return{iconFilled:{color:e.palette.primary.main}}})),Xc=function(e){var t=e.tweetId,n=e.isRetweet,o=e.retweetId,i=Jc((0,a.useState)(!1),2),l=i[0],E=i[1],s=Jc((0,a.useState)(!1),2),u=s[0],c=s[1],d=qc(),T=(0,se.useTranslation)().t,A=yr().addAlert;if(u)return(0,r.jsx)(C.Button,Zc({disabled:!0},{children:(0,r.jsx)(C.CircularProgress,{size:22})}));var p=l?d.iconFilled:"";return(0,r.jsx)(C.Button,Zc({onClick:function(){l||(0,v.Z)(uu.RETWEET,{tweetId:n?o:t}).then((function(e){if("ok"!==e.status)return A({message:T(e.errorMsg),type:"error"});window.setTimeout((function(){E(!0),c(!1)}),1250)}))}},{children:(0,r.jsx)(fa.Repeat,{className:p})}))},Qc=(0,C.styled)(C.Box)((function(e){return{color:e.theme.palette.secondary.main,fontSize:"16px",justifyContent:"flex-start",width:"100%",display:"flex",alignItems:"flex-start",paddingBottom:"8px",marginBottom:"6px",marginTop:"-6px"}})),$c=function(e){var t=e.profileName,n=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(Qc,{children:[(0,r.jsx)(fa.Repeat,{})," ",t," ",n("TWITTER.RETWEETED")]})},ed=n(54431),td=function(){return(td=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(!1),2),E=l[0],s=l[1],u=yr().addAlert;return o?(0,r.jsxs)(C.MenuItem,td({onClick:t},{children:[(0,r.jsx)(ed.Z,{}),(0,r.jsx)("span",td({style:{marginLeft:"5px"}},{children:i("TWITTER.REPORTED")}))]})):E?(0,r.jsx)(C.Button,td({disabled:!0},{children:(0,r.jsx)(C.CircularProgress,{id:"twitter-report-progress",size:22})})):(0,r.jsx)(C.MenuItem,td({dense:!0,onClick:function(){s(!0),(0,v.Z)(uu.REPORT,{tweetId:n}).then((function(e){if("ok"!==e.status)return u({message:i("TWITTER.FEEDBACK.REPORT_TWEET_FAILED"),type:"error"});s(!1),t(),u({message:i("TWITTER.FEEDBACK.REPORT_TWEET_SUCCESS"),type:"success"})}))}},{children:i("TWITTER.REPORT")}))},rd=function(){return(rd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(null),2),E=l[0],s=l[1],u=kr().ResourceConfig,c=yr().addAlert;if(Dc().deleteTweet,!u)return null;var d=function(){s(null)},T=u.twitter.allowDeleteTweets&&o,A=u.twitter.allowReportTweets&&!o;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(C.Button,rd({"aria-controls":"simple-menu","aria-haspopup":"true",onClick:T||A?function(e){s(e.currentTarget)}:function(){return null},style:{marginRight:15}},{children:(0,r.jsx)(fo.Z,{})})),(0,r.jsxs)(ad,rd({id:"simple-menu",anchorEl:E,keepMounted:!0,open:Boolean(E),onClose:d},{children:[T&&(0,r.jsx)(C.MenuItem,rd({onClick:function(){(0,v.Z)(uu.DELETE_TWEET,{tweetId:t}).then((function(e){if("ok"!==e.status)return c({message:i("TWITTER.FEEDBACK.DELETE_TWEET_FAILED"),type:"error"});d()}))}},{children:i("GENERIC.DELETE")})),A&&(0,r.jsx)(nd,{handleClose:d,isReported:n,tweetId:t})]}))]})},id=(0,C.styled)(C.ListItem)({overflowX:"hidden",display:"flex",flexFlow:"column nowrap",width:"100%",marginTop:"6px"}),ld=(0,C.styled)(C.Box)({display:"flex",flexFlow:"row nowrap",alignItems:"flex-start",width:"100%"}),Ed=(0,C.styled)(C.Box)({display:"flex",marginTop:"-10px",flexFlow:"column nowrap",width:"100%"}),sd=(0,C.styled)(C.Box)({display:"flex",flexFlow:"row nowrap",width:"100%",alignItems:"flex-end"}),ud=(0,C.styled)(C.Box)((function(e){return{fontSize:"18px",fontWeight:"bold",color:e.theme.palette.text.primary}})),cd=(0,C.styled)(C.Typography)({marginLeft:"10px",fontSize:"14px"}),dd=(0,C.styled)(C.Box)((function(e){return{fontSize:"18px",wordBreak:"break-all",color:e.theme.palette.text.secondary}})),Td=(0,C.styled)(C.Box)({display:"flex",flexFlow:"row nowrap",justifyContent:"space-between",width:"100%",marginLeft:"-20px",marginTop:"3px"}),Ad=function(){return(Ad=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],R=kr().ResourceConfig;if(!R)return null;var O,h,m=R.twitter,L=m.enableAvatars,N=m.enableImages,v=i.replace(/\n\r?/g,"
"),y=uc()(v,{whiteList:{br:[]}}),g=I?u:s,D=g?"@".concat(g):"";return(0,r.jsxs)(id,Ad({divider:!0},{children:[I&&(0,r.jsx)($c,{profileName:s}),(0,r.jsxs)(ld,{children:[L&&(0,r.jsx)(C.ListItemAvatar,{children:(0,r.jsx)(C.Avatar,{children:(0,r.jsx)(Yc,{avatarUrl:I?c:E,height:"40px",width:"40px"})})}),(0,r.jsxs)(Ed,{children:[(0,r.jsxs)(sd,{children:[(0,r.jsx)(ud,{children:D}),(0,r.jsx)(cd,Ad({variant:"body2",color:"textSecondary"},{children:(O=f,(h=T)<60?O("TWITTER.TIME_JUST_NOW"):h<3600?"".concat(Math.floor(h/60)).concat(O("TWITTER.TIME_MINUTES")):h<86400?"".concat(Math.floor(h/3600)).concat(O("TWITTER.TIME_HOURS")):"".concat(Math.floor(h/86400)).concat(O("TWITTER.TIME_DAYS")))}))]}),(0,r.jsx)(dd,{dangerouslySetInnerHTML:{__html:y}}),N&&(0,r.jsx)(Wc,{visible:!0,images:l,open:n,onToggle:a}),(0,r.jsxs)(Td,{children:[(0,r.jsx)(Gc,{profile_name:s}),(0,r.jsx)(Mc,{likes:S,tweetId:o,isLiked:A}),R.twitter.allowRetweet&&!p&&(0,r.jsx)(Xc,{tweetId:o,retweetId:d,isRetweet:I}),(0,r.jsx)(od,{isMine:p,isReported:_,id:o})]})]})]})]}))})),_d=n(13942),Id=function(){return(Id=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},fd=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Dd=function(){var e=gd((0,L.useRecoilState)(mc.showCreateTweetModal),2),t=e[0],n=e[1],r=gd((0,L.useRecoilState)(mc.modalMessage),2);return{modalVisible:t,setModalVisible:n,message:r[0],setMessage:r[1]}},Pd=n(8292),bd=n(69061),Md=(0,a.memo)((function(e){var t=e.visible,n=e.onEmojiClick,a=(0,C.useTheme)();return t?(0,r.jsx)(bd.NimblePicker,{data:Pd,onClick:n,set:"google",theme:a.palette.mode,showPreview:!1}):null})),kd=n(59491),xd=function(){return(xd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],s=(0,E.useHistory)(),u=(0,E.useLocation)(),c=u.pathname,d=u.search,T=rr();(0,a.useEffect)((function(){i.current&&i.current.focus()}),[t]);var A=(0,a.useCallback)((function(e,t){return o(e.target.value,t)}),[o]),p=(0,a.useCallback)((function(){s.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(c+d)})))}),[s,c,d]);return(0,a.useEffect)((function(){(null==T?void 0:T.image)&&(o(T.image,!0),s.replace(oi({pathname:c,search:d},"image")))}),[null==T?void 0:T.image,s,c,d,o]),t?(0,r.jsxs)(C.Box,xd({display:"flex",justifyContent:"space-between",alignItems:"center"},{children:[(0,r.jsx)(Gd,{value:n,inputProps:{style:{fontSize:"18px"}},onChange:function(e){return A(e,!1)},multiline:!0,size:"small",placeholder:l("TWITTER.IMAGE_PLACEHOLDER"),inputRef:i}),(0,r.jsx)(C.Tooltip,xd({placement:"left",title:"Select an image from your gallery"},{children:(0,r.jsx)(C.IconButton,xd({onClick:p},{children:(0,r.jsx)(kd.Z,{})}))}))]})):null}));function Fd(e){return e.split(/\r\n|\r|\n/).length}var jd=(0,C.styled)(We)({flex:"1 1 100%",padding:"10px 15px",marginTop:"15px",overflowY:"auto",maxHeight:"300px"}),Ud=(0,a.memo)((function(e){var t=e.modalVisible,n=e.message,o=e.handleChange,i=e.onEnter,l=(0,a.useRef)(null),E=kr().ResourceConfig,s=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],u=E.twitter,c=u.characterLimit,d=u.newLineLimit;if((0,a.useEffect)((function(){l.current&&l.current.focus()}),[t]),!E)return null;var T=null,A=n.trim().length>c,p="".concat(s("TWITTER.TWEET_MESSAGE_CHAR_LIMIT")," (").concat(c,")"),_=Fd(n)>d,I="".concat(s("TWITTER.TWEET_MESSAGE_NEW_LINE_LIMIT")," (").concat(d,")");return A?T=p:_&&(T=I),(0,r.jsx)(jd,{value:n,inputProps:{style:{fontSize:"18px",paddingTop:"8px"}},onChange:function(e){return o(e.currentTarget.value)},onKeyPress:function(e){_||"Enter"!==e.key||e.shiftKey||i()},multiline:!0,placeholder:s("TWITTER.TWEET_MESSAGE_PLACEHOLDER"),inputRef:l,error:null!==T,helperText:T||null})})),Bd=function(){return(Bd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],l=i(t&&!n?"TWITTER.SUBMIT_IMAGE":"TWITTER.TWEET");return(0,r.jsxs)(Hd,{children:[(0,r.jsx)(C.Button,Bd({variant:"contained",color:"primary",onClick:o},{children:l})),(t||n)&&(0,r.jsx)(pt,Bd({style:{marginLeft:"8px"},variant:"contained",color:"error",onClick:a},{children:i("GENERIC.CLOSE")}))]})},Vd=n(69403),zd=n(4918),Kd=function(){return(Kd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},eT=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)||!((a=e).length>y)&&Fd(a)0?O.map((function(e){return e.link})).join(Ic):""},(0,v.Z)(uu.CREATE_TWEET,n).then((function(e){if("ok"!==e.status)return E({type:"error",message:s("TWITTER.FEEDBACK.CREATE_PROFILE_FAILURE")})})),m()),[2]}}))}))},b=function(){T(!1),_(!p)},M=function(){return Xd(void 0,void 0,void 0,(function(){return Qd(this,(function(e){switch(e.label){case 0:return _(!1),T(!d),[4,He(d)];case 1:return e.sent(),[2]}}))}))};return l?(0,r.jsxs)(Qe,qd({visible:o,handleClose:m},{children:[(0,r.jsx)(Ud,{modalVisible:o,onEnter:P,message:t,handleChange:L}),(0,r.jsx)(wd,{visible:p,value:S,handleChange:C}),(0,r.jsx)(Md,{visible:d,onEmojiClick:function(e,r){n(t.concat(e.native))}}),(0,r.jsx)(Wc,{visible:!d&&O.length>0,images:O,removeImage:function(e){return h(O.filter((function(t){return e!==t.id})))}}),(0,r.jsxs)(tT,{children:[(0,r.jsx)(Jd,{onImageClick:O.length0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},OT=(0,C.styled)(C.Box)({position:"relative",width:"100%",height:"100%",padding:"15px"}),hT=function(){var e=RT((0,se.useTranslation)(),1)[0],t=IT().profile,n=kr().ResourceConfig,o=yr().addAlert,i=(0,E.useHistory)(),l=rr(),s=(0,E.useLocation)(),u=s.pathname,c=s.search,d=Dc().updateLocalProfile,T=RT((0,a.useState)(t.avatar_url||""),2),A=T[0],p=T[1],_=RT((0,a.useState)(t.profile_name||""),2),I=_[0],S=_[1],f=(0,a.useCallback)((function(){i.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(u+c)})))}),[i,u,c]);if((0,a.useEffect)((function(){(null==l?void 0:l.image)&&p(l.image)}),[null==l?void 0:l.image,i,u,c,p]),!n)return null;var R=n.twitter,O=R.enableAvatars,h=R.allowEditableProfileName;return(0,r.jsxs)(OT,{children:[O&&(0,r.jsx)(Yc,{avatarUrl:A,showInvalidImage:!0}),(0,r.jsx)(C.Box,{height:8}),(0,r.jsxs)(C.Box,fT({display:"flex",alignItems:"center"},{children:[(0,r.jsx)("div",{children:(0,r.jsx)(eE.Z,{})}),(0,r.jsx)("div",{children:(0,r.jsx)(C.Button,fT({onClick:f},{children:e("TWITTER.AVATAR_CHOOSE_IMAGE")}))})]})),(0,r.jsx)(Ys,{label:e("TWITTER.EDIT_PROFILE_AVATAR"),value:A,handleChange:p,allowChange:O}),(0,r.jsx)(Ys,{label:e("TWITTER.EDIT_PROFILE_NAME"),value:I,handleChange:S,allowChange:h}),(0,r.jsx)(ST,{handleClick:function(){(0,v.Z)(uu.UPDATE_PROFILE,{avatar_url:A,profile_name:I}).then((function(t){if("ok"!==t.status)return o({message:e(t.errorMsg),type:"error"});d({profile_name:I,avatar_url:A}),o({message:e("TWITTER.FEEDBACK.EDIT_PROFILE_SUCCESS"),type:"success"})}))}})]})},mT=function(){return(mT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},vT=(0,C.styled)(C.Box)({width:"100%"}),yT=(0,C.styled)(C.Box)({padding:"15px"}),gT=(0,C.styled)(We)({width:"100%"}),DT=function(){var e=NT((0,se.useTranslation)(),1)[0],t=NT((0,a.useState)(""),2),n=t[0],o=t[1],i=yr().addAlert,l=NT((0,L.useRecoilState)(mc.filteredTweets),2),E=l[0],s=l[1];return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(vT,{children:[(0,r.jsx)(yT,{children:(0,r.jsx)(gT,{placeholder:e("TWITTER.SEARCH_TWEETS_PLACEHOLDER"),label:e("TWITTER.SEARCH_TWEETS"),value:n,onChange:function(e){return o(e.target.value)},size:"medium",inputRef:function(e){return e&&e.focus()}})}),(E||[]).length>0&&(0,r.jsx)(Rd,{tweets:E})]}),(0,r.jsx)(LT,{handleClick:function(){var t=n.trim();t&&(0,v.Z)(uu.FETCH_TWEETS_FILTERED,{searchValue:t}).then((function(t){if("ok"!==t.status)return i({message:e(t.errorMsg||""),type:"error"});s(t.data.map(Rc))}))}})]})},PT=n(24346),bT={};bT.styleTagTransform=R(),bT.setAttributes=_(),bT.insert=A().bind(null,"head"),bT.domAPI=d(),bT.insertStyleElement=S(),u()(PT.Z,bT),PT.Z&&PT.Z.locals&&PT.Z.locals,n(64161);var MT,kT,xT=n(58261),GT=n(96224),wT=n(19971),FT=function(){return(FT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(UT,{children:[(0,r.jsxs)(GT.Z,FT({className:i.formControl},{children:[(0,r.jsx)(xT.Z,FT({htmlFor:"profile-name"},{children:l("TWITTER.EDIT_DEFAULT_PROFILE_NAME")})),(0,r.jsx)(wT.Z,FT({value:t,onChange:function(e){e.preventDefault(),n(e.target.value)},inputProps:{name:"profileName",id:"profile-name"}},{children:o.map((function(e){return(0,r.jsx)(C.MenuItem,FT({value:e},{children:e}),e)}))}))]})),(0,r.jsx)(ST,{handleClick:a})]})},HT=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},WT=(0,C.styled)(C.Box)({position:"relative",width:"100%",height:"100%",padding:"15px"}),VT=function(){var e=this,t=HT((0,se.useTranslation)(),1)[0],n=IT().profile,o=Lc(),i=(0,L.useRecoilValue)(mc.defaultProfileNames),l=HT((0,a.useState)((null==n?void 0:n.profile_name)||""),2),E=l[0],s=l[1],u=kr().ResourceConfig,c=yr().addAlert,d=function(){var t,n,r;return t=e,r=function(){return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(0),2),n=t[0],o=t[1],i=IT().profile,l=(0,E.useLocation)(),s=!i||!i.profile_name||!i.profile_name.trim(),u=!s&&0===n&&"/twitter"===l.pathname;return(0,r.jsx)(zT,{children:(0,r.jsxs)(Ie.O,YT({id:"twitter-app"},{children:[(0,r.jsx)(lo,{children:(0,r.jsx)(nT,{})}),(0,r.jsx)(KT,{}),(0,r.jsx)(dT,{}),(0,r.jsx)(ie,{children:s?(0,r.jsx)(VT,{}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Route,{path:"/twitter",exact:!0,component:vd}),(0,r.jsx)(E.Route,{path:"/twitter/search",component:DT}),(0,r.jsx)(E.Route,{path:"/twitter/profile",component:hT})]})}),u&&(0,r.jsx)(iT,{openModal:function(){return e(!0)}}),!s&&(0,r.jsx)(_T,{activePage:n,handleChange:function(e,t){return o(t)}})]}))})})),JT=function(){return(JT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},pA=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return{addChannel:function(e){(0,v.Z)(MT.ADD_CHANNEL,{channelIdentifier:e.channelIdentifier,label:e.label}).then((function(e){if("ok"!==e.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.JOIN_CHANNEL_FAILED")});t(e.data)}))},fetchMessages:function(e){(0,v.Z)(MT.FETCH_MESSAGES,{channelId:e},aA).then((function(e){if("ok"!==e.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.FETCH_MESSAGES_FAILED")}),l.push("/darkchat");s(e.data)}))},sendMessage:function(e){(0,v.Z)(MT.SEND_MESSAGE,e).then((function(e){if("ok"!==e.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.SEND_MESSAGE_FAILED")});n(e.data)}))},leaveChannel:function(e){(0,v.Z)(MT.LEAVE_CHANNEL,{channelId:e}).then((function(t){if("ok"!==t.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.LEAVE_CHANNEL_FAILED")});r(e),l.goBack()}))},updateChannelLabel:function(e){(0,v.Z)(MT.UPDATE_CHANNEL_LABEL,e).then((function(t){if("ok"!==t.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.UPDATE_LABEL_FAILED")});a(e)}))},transferOwnership:function(e,t,n){(0,v.Z)(MT.TRANSFER_OWNERSHIP,{userIdentifier:t,channelId:e,newOwnerPhoneNumber:n}).then((function(e){if("ok"!==e.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.TRANSFER_OWNERSHIP_FAILED")});o(e.data),l.push("/darkchat")}))},fetchMembers:function(e){(0,v.Z)(MT.FETCH_MEMBERS,{channelId:e},(0,qt.MH)(rA)).then((function(e){if("ok"!==e.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.FETCH_MEMBERS_FAILED")});i(e.data)}))},deleteChannel:function(e){(0,v.Z)(MT.DELETE_CHANNEL,{channelId:e}).then((function(t){if("ok"!==t.status)return u({type:"error",message:c("DARKCHAT.FEEDBACK.DELETE_CHANNEL_FAILED")});r(e)}))}}},SA=function(){return(SA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},RA=(0,q.Z)((function(e){return{button:{color:e.palette.text.primary,"&:hover":{backgroundColor:e.palette.action.hover}}}})),OA=function(e){var t=e.open,n=e.closeModal,o=fA((0,a.useState)(""),2),i=o[0],l=o[1],E=fA((0,se.useTranslation)(),1)[0],s=IA().addChannel,u=RA((0,C.useTheme)());return(0,r.jsxs)(Qe,SA({visible:t,handleClose:n},{children:[(0,r.jsx)(C.Typography,{children:E("DARKCHAT.NEW_CHANNEL_TITLE")}),(0,r.jsx)(C.Box,SA({mt:3,mb:2},{children:(0,r.jsx)(We,{type:"password",fullWidth:!0,placeholder:E("DARKCHAT.NEW_CHANNEL_INPUT_PLACEHOLDER"),value:i,onChange:function(e){return l(e.currentTarget.value)}})})),(0,r.jsx)(Re.z,SA({variant:"contained",className:u.button,onClick:function(){s({channelIdentifier:i}),n()}},{children:E("DARKCHAT.JOIN_BUTTON")}))]}))},hA=function(){return(hA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(!1),2),n=t[0],o=t[1],i=mA((0,C.useTheme)()),l=function(){o((function(e){return!e}))};return(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(OA,{open:n,closeModal:l}),n&&(0,r.jsx)(fe,{}),(0,r.jsx)(Oe.a,{children:e.map((function(e){return(0,r.jsx)(uA,hA({},e),e.id)}))}),(0,r.jsx)(C.Box,hA({position:"absolute",bottom:20,right:20},{children:(0,r.jsx)(C.Fab,hA({className:i.button,onClick:l},{children:(0,r.jsx)(jE.Z,{})}))}))]})},LA=function(){return(LA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},MA=function(){var e=bA((0,L.useRecoilState)(oA.showUploadMediaModal),2),t=e[0],n=e[1],r=bA((0,L.useRecoilState)(oA.modalMedia),2),a=r[0],o=r[1],i=bA((0,L.useRecoilState)(oA.showOwnerModal),2);return{modalVisible:t,setModalVisible:n,modalMedia:a,setModalMedia:o,ownerModal:i[0],setOwnerModal:i[1]}},kA=function(){return(kA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},GA=function(){var e=xA((0,a.useState)(""),2),t=e[0],n=e[1],o=xA((0,se.useTranslation)(),1)[0],i=IA().sendMessage,l=iA().id,E=Mt(),s=MA().setModalVisible,u=function(){t.trim()&&(i({channelId:l,message:t,phoneNumber:E,type:"text"}),n(""))};return(0,r.jsxs)(C.Paper,kA({variant:"outlined",sx:{display:"flex",alignItems:"center"}},{children:[(0,r.jsx)(C.Box,kA({pl:3,pt:1,pb:1,flexGrow:1},{children:(0,r.jsx)(We,{style:{paddingTop:7,paddingBottom:7},inputProps:{style:{fontSize:18,textIndent:5}},placeholder:o("DARKCHAT.MESSAGE_PLACEHOLDER"),variant:"standard",fullWidth:!0,value:t,maxRows:4,multiline:!0,onChange:function(e){return n(e.currentTarget.value)},onKeyPress:function(e){"Enter"!==e.key||e.shiftKey||(u(),n(""))}})})),(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.Button,kA({color:"secondary",onClick:function(){return s(!0)}},{children:(0,r.jsx)(C.Tooltip,kA({title:o("DARKCHAT.MEDIA_UPLOAD")},{children:(0,r.jsx)(ao.Z,{})}))})),(0,r.jsx)(C.Button,kA({onClick:u,color:"secondary"},{children:(0,r.jsx)(C.Tooltip,kA({title:o("GENERIC.SEND")},{children:(0,r.jsx)(no.Z,{})}))}))]})]}))},wA=n(11034),FA=function(){return(FA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(Xe,FA({visible:t,handleClose:function(){return n(!1)}},{children:[(0,r.jsx)(C.TextField,{placeholder:A("DARKCHAT.MEDIA_PLACEHOLDER"),variant:"standard",value:a,onChange:function(e){return o(e.target.value)}}),(0,r.jsxs)(jA,{children:[(0,r.jsx)(C.Button,FA({variant:"text",color:"secondary",startIcon:(0,r.jsx)(wA.Z,{}),onClick:function(){i.push("/camera?".concat(tr().stringify({referal:encodeURIComponent(s+u)})))}},{children:A("DARKCHAT.MEDIA_GALLERY")})),(0,r.jsx)(C.Button,FA({variant:"text",color:"secondary",startIcon:(0,r.jsx)(no.Z,{}),onClick:function(){var e=a;e.replace("/ /g",""),yd(e).then((function(){c({type:"image",message:a,channelId:d,phoneNumber:T}),n(!1),o("")})).catch(console.error)}},{children:A("GENERIC.SEND")}))]})]}))},BA=n(54464),HA=function(){return(HA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},VA=function(e){var t=e.open,n=e.closeModal,o=WA((0,a.useState)(""),2),i=o[0],l=o[1],s=WA((0,a.useState)("1"),2),u=s[0],c=s[1],d=(0,L.useRecoilValue)(oA.members),T=Mt(),A=d&&d.filter((function(e){return e.phoneNumber!==T})),p=WA((0,se.useTranslation)(),1)[0],_=IA(),I=_.transferOwnership,S=_.deleteChannel,f=(0,E.useHistory)(),R=iA(),O=R.identifier===i,h=R.owner===T;return(0,r.jsx)(Xe,HA({visible:t,handleClose:n},{children:(0,r.jsxs)(Dr.TabContext,HA({value:u},{children:[(0,r.jsxs)(Dr.TabList,HA({indicatorColor:"secondary",textColor:"secondary",onChange:function(e,t){c(t)}},{children:[(0,r.jsx)(C.Tab,{label:p("DARKCHAT.MEMBERS"),value:"1"}),(0,r.jsx)(C.Tab,{label:p("DARKCHAT.DANGER_ZONE"),value:"2"})]})),(0,r.jsx)(Dr.TabPanel,HA({value:"1"},{children:(0,r.jsx)(Oe.a,{children:A&&A.map((function(e){return(0,r.jsx)(he.H,HA({secondaryAction:(0,r.jsx)(ce,HA({title:p("DARKCHAT.TRANSFER_OWNERSHIP"),placement:"left"},{children:(0,r.jsx)(C.IconButton,HA({onClick:function(){var t,r;return t=e.identifier,r=e.phoneNumber,n(),void I(R.id,t,r)},edge:"end","aria-label":"delete"},{children:(0,r.jsx)(BA.Z,{})}))}))},{children:(0,r.jsx)(C.ListItemText,{children:e.phoneNumber})}))}))})})),h&&(0,r.jsxs)(Dr.TabPanel,HA({value:"2"},{children:[(0,r.jsx)(C.Typography,{children:p("DARKCHAT.DELETE_CHANNEL_TITLE")}),(0,r.jsxs)(C.Box,HA({mt:2,mb:2},{children:[(0,r.jsx)(C.Typography,{children:p("DARKCHAT.TYPE_TO_CONFIRM",{identifier:R.identifier})}),(0,r.jsxs)(C.Box,HA({display:"flex",flexDirection:"column",alignItems:"flex-start",gap:2},{children:[(0,r.jsx)(We,{placeholder:p("DARKCHAT.NEW_CHANNEL_INPUT_PLACEHOLDER"),value:i,onChange:function(e){return l(e.currentTarget.value)}}),(0,r.jsx)(Re.z,HA({onClick:function(){n(),S(R.id),f.push("/darkchat")},disabled:!O,variant:"outlined",color:"secondary"},{children:p("GENERIC.DELETE")}))]}))]}))]}))]}))}))},zA=function(){return(zA=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},XA=lE()(C.Paper)((function(e){var t=e.theme;return{backgroundColor:e.background||t.palette.background.default,height:"60px",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:0}})),QA=lE()(C.Button)((function(e){return{color:e.theme.palette.text.primary}})),$A=function(){var e=lp("DARKCHAT").backgroundColor,t=iA(),n=MA().setOwnerModal,o=IA(),i=o.leaveChannel,l=o.updateChannelLabel,s=(0,E.useHistory)().goBack,u=Mt(),c=qA((0,se.useTranslation)(),1)[0],d=qA((0,a.useState)(!1),2),T=d[0],A=d[1],p=qA((0,a.useState)(t.label),2),_=p[0],I=p[1],S=u===t.owner;return(0,r.jsxs)(XA,JA({background:e},{children:[(0,r.jsxs)(C.Box,JA({display:"flex",alignItems:"center",flexDirection:"row",gap:1},{children:[(0,r.jsx)(C.IconButton,JA({onClick:s},{children:(0,r.jsx)(eo.Z,{})})),(0,r.jsxs)(C.Box,JA({display:"flex",gap:2,alignItems:"center"},{children:[T?(0,r.jsx)(We,{inputProps:{style:{fontSize:23}},value:_,onChange:function(e){return I(e.currentTarget.value)}}):(0,r.jsx)(C.Typography,JA({fontSize:26},{children:_})),S&&(0,r.jsx)(C.Box,{children:T?(0,r.jsx)(C.IconButton,JA({disableFocusRipple:!0,disableTouchRipple:!0,onClick:function(){return A(!1),_===t.label?I(t.label):_.trim()?void l({channelId:t.id,label:_}):I(t.label)}},{children:(0,r.jsx)(YA.Z,{})})):(0,r.jsx)(C.IconButton,JA({disableFocusRipple:!0,disableTouchRipple:!0,onClick:function(){return A(!0)}},{children:(0,r.jsx)(Ja.Z,{})}))})]}))]})),(0,r.jsx)(C.Box,JA({pr:2},{children:S?(0,r.jsx)(C.IconButton,JA({onClick:function(){n(!0)}},{children:(0,r.jsx)(ZA.Z,{})})):(0,r.jsx)(QA,JA({onClick:function(){i(t.id)}},{children:c("DARKCHAT.LEAVE")}))}))]}))},ep=function(){return(ep=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},op=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(N.extApps),2),l=i[0],s=i[1],u=(e=function(e){return sp(void 0,void 0,void 0,(function(){return up(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t,n){var r=document.createElement("script");r.src=e,r.type="text/javascript",r.async=!0,document.head.appendChild(r),r.onload=function(){t(!0)},r.onerror=function(e){r.parentElement.removeChild(r),n(e)}}))];case 1:return t.sent(),[2]}}))}))},t=function(t){return sp(void 0,void 0,Promise,(function(){var a,i,l,s,u,c;return up(this,(function(d){switch(d.label){case 0:return d.trys.push([0,5,,6]),a="https://cfx-nui-".concat(t,"/web/dist/remoteEntry.js"),i=t,l="./config",[4,e(a)];case 1:return d.sent(),[4,n.I("default")];case 2:return d.sent(),[4,window[i].init(n.S.default)];case 3:return d.sent(),[4,window[i].get(l)];case 4:return(s=d.sent()().default()).Component=function(e){return o().createElement(s.app,e)},u=OE(s),s.Route=function(e){return(0,r.jsx)(E.Route,Ep({path:s.path},{children:(0,r.jsx)(u,{children:(0,r.jsx)(s.Component,Ep({},e))})}))},s.icon=o().createElement(s.icon),s.NotificationIcon=s.notificationIcon,[2,s];case 5:return c=d.sent(),console.error('Failed to load external app "'.concat(t,'". Make sure it is started before NPWD.')),console.error(c),[2,null];case 6:return[2]}}))}))},{getConfigs:function(e){return void 0===e&&(e=[]),sp(void 0,void 0,void 0,(function(){return up(this,(function(n){switch(n.label){case 0:return[4,Promise.all(e.map((function(e){return sp(void 0,void 0,void 0,(function(){var n;return up(this,(function(r){switch(r.label){case 0:return[4,t(e)];case 1:return(n=r.sent())?[2,n]:[2,null]}}))}))})))];case 1:return[2,n.sent()]}}))}))}}).getConfigs,c=(0,L.useRecoilValue)(N.resourceConfig),d=function(e){"RELOAD"===e.data.type&&u(c.apps).then(s)};return(0,a.useEffect)((function(){return window.addEventListener("message",d),function(){window.removeEventListener("message",d)}}),[]),(0,a.useEffect)((function(){u(null==c?void 0:c.apps).then(s)}),[c]),l.filter((function(e){return e}))},dp=function(){return(dp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Ap=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Np=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yp=function(){var e=(0,fp.useSnackbar)(),t=e.enqueueSnackbar,n=e.closeSnackbar,r=ip().getApp,a=(0,L.useRecoilCallback)((function(e){var n=e.set,a=e.snapshot;return function(e){var o=e.appId,l=e.content,E=e.secondaryTitle,s=e.notisId,u=e.path,c=e.keepOpen,d=void 0!==c&&c,T=e.onClick,A=e.duration;return mp(void 0,void 0,void 0,(function(){var e,c,p;return Cp(this,(function(_){switch(_.label){case 0:return e=r(o),[4,a.getPromise(il)];case 1:return c=_.sent(),p="".concat(s,":").concat(Op()()),c.includes(p)?(console.error("Notification with key: [".concat(p,"] already exists!")),[2]):(n(al(p),{appId:e.id,content:l,path:u,onClick:T,isRead:!1,isActive:!0,keepOpen:d,duration:A,id:p}),n(il,(function(e){return Np(Np([],Lp(e),!1),[p],!1)})),n(ol,(function(e){return Np(Np([],Lp(e),!1),[p],!1)})),n(ll,(function(e){return Np(Np([],Lp(e),!1),[p],!1)})),n(El,(function(e){return Np(Np([],Lp(e),!1),[{id:p,appId:o,path:u}],!1)})),t(l,{variant:"npwdNotification",anchorOrigin:{vertical:"top",horizontal:"center"},persist:d,key:p,onExited:function(){i(p)},onClick:T,secondaryTitle:E,path:u,app:e,autoHideDuration:3e3,disableWindowBlurListener:!0}),[2])}}))}))}})),o=(0,L.useRecoilCallback)((function(e){var t=e.reset,n=e.snapshot,r=e.set;return function(){return mp(void 0,void 0,void 0,(function(){var e,a,o,i,l,E,s;return Cp(this,(function(u){switch(u.label){case 0:return[4,n.getPromise(ol)];case 1:e=u.sent(),u.label=2;case 2:u.trys.push([2,7,8,9]),o=(a=vp(e)).next(),u.label=3;case 3:return o.done?[3,6]:(i=o.value,[4,n.getPromise(al(i))]);case 4:if(!(l=u.sent()))return[3,5];r(al(i),hp(hp({},l),{isActive:!1})),u.label=5;case 5:return o=a.next(),[3,3];case 6:return[3,9];case 7:return E={error:u.sent()},[3,9];case 8:try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(E)throw E.error}return[7];case 9:return t(ol),[2]}}))}))}}),[]),i=(0,L.useRecoilCallback)((function(e){var t=e.set,r=e.snapshot;return function(e){return mp(void 0,void 0,void 0,(function(){var a,o,i;return Cp(this,(function(l){switch(l.label){case 0:return n(e),[4,r.getPromise(ol)];case 1:return a=l.sent(),o=al(e),[4,r.getPromise(o)];case 2:return(i=l.sent())&&(t(o,hp(hp({},i),{isActive:!1})),t(ol,a.filter((function(t){return t!==e})))),[2]}}))}))}}),[n]),l=(0,L.useRecoilCallback)((function(e){var t=e.set,r=e.snapshot;return function(e){return mp(void 0,void 0,void 0,(function(){var a,o,i;return Cp(this,(function(l){switch(l.label){case 0:return a=al(e),[4,r.getPromise(a)];case 1:return i=(o=l.sent()).isActive,o.isRead,t(a,hp(hp({},function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);at.indexOf(r[a])&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(o,["isActive","isRead"])),{isRead:!0,isActive:!1})),i?(n(e),[4,r.getPromise(ol)]):[3,3];case 2:t(ol,l.sent().filter((function(t){return t!==e}))),l.label=3;case 3:return[4,r.getPromise(ll)];case 4:return t(ll,l.sent().filter((function(t){return t!==e}))),[4,r.getPromise(El)];case 5:return t(El,l.sent().filter((function(t){return t.id!==e}))),[2]}}))}))}}),[n]),E=(0,L.useRecoilCallback)((function(e){var t=e.snapshot;return function(){return mp(void 0,void 0,void 0,(function(){var e,n,r,a,o;return Cp(this,(function(i){switch(i.label){case 0:return[4,t.getPromise(ll)];case 1:e=i.sent(),i.label=2;case 2:i.trys.push([2,7,8,9]),r=(n=vp(e)).next(),i.label=3;case 3:return r.done?[3,6]:[4,l(r.value)];case 4:i.sent(),i.label=5;case 5:return r=n.next(),[3,3];case 6:return[3,9];case 7:return a={error:i.sent()},[3,9];case 8:try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(a)throw a.error}return[7];case 9:return[2]}}))}))}})),s=(0,L.useRecoilCallback)((function(e){var t=e.reset,r=e.snapshot;return function(){return mp(void 0,void 0,void 0,(function(){var e,a,o,i,l,E,s;return Cp(this,(function(u){switch(u.label){case 0:return[4,r.getPromise(il)];case 1:e=u.sent(),u.label=2;case 2:u.trys.push([2,7,8,9]),o=(a=vp(e)).next(),u.label=3;case 3:return o.done?[3,6]:(l=al(i=o.value),[4,r.getPromise(l)]);case 4:u.sent().isActive&&n(i),t(l),u.label=5;case 5:return o=a.next(),[3,3];case 6:return[3,9];case 7:return E={error:u.sent()},[3,9];case 8:try{o&&!o.done&&(s=a.return)&&s.call(a)}finally{if(E)throw E.error}return[7];case 9:return t(ll),t(El),t(ol),t(il),[2]}}))}))}}));return{enqueueNotification:a,removeAllActive:o,removeActive:i,markAsRead:l,markAllAsRead:E,clearAllNotifications:s}},gp=function(){return(gp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsx)(C.Box,Pp({width:"100%",py:1,textAlign:"center"},{children:(0,r.jsxs)(C.Typography,Pp({variant:"body2",color:"textSecondary"},{children:["🎉 ",e("NOTIFICATIONS.NO_UNREAD")," 🎉"]}))}))},Mp=function(){return(Mp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,L.useRecoilState)(sl),2),o=n[0],i=n[1],l=ul(),E=(0,L.useRecoilValue)(El),s=yp().markAllAsRead;return(0,a.useEffect)((function(){0===l.length&&i(!1)}),[l,i]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(C.Grid,Mp({className:e.root,container:!0,justifyContent:"space-between",alignItems:"center",wrap:"nowrap",onClick:function(){i((function(e){return!e}))}},{children:[(0,r.jsx)(C.Grid,Mp({container:!0,item:!0,wrap:"nowrap"},{children:E&&E.filter((function(e,t,n){return t===n.findIndex((function(t){return t.appId===e.appId}))})).map((function(e,t){return(0,r.jsx)(xp,{tgtNoti:e},t)}))})),t&&(0,r.jsx)(C.Grid,Mp({item:!0,className:e.item},{children:(0,r.jsx)(C.Typography,Mp({className:e.text,variant:"button"},{children:t}))})),(0,r.jsxs)(C.Grid,Mp({container:!0,item:!0,wrap:"nowrap",justifyContent:"flex-end",alignItems:"center"},{children:[(0,r.jsx)(C.Grid,Mp({item:!0},{children:(0,r.jsx)(_p.Z,{fontSize:"small"})})),(0,r.jsx)(C.Grid,Mp({item:!0,className:e.item},{children:(0,r.jsx)(C.Typography,Mp({className:e.text,variant:"button"},{children:On.cellProvider}))})),(0,r.jsx)(C.Grid,Mp({item:!0},{children:(0,r.jsx)(Ip.Z,{style:{transform:"rotate(90deg)",display:"block"}})}))]}))]})),(0,r.jsx)(C.Slide,Mp({direction:"down",in:o,mountOnEnter:!0,unmountOnExit:!0},{children:(0,r.jsxs)(C.Paper,Mp({square:!0,className:e.drawer},{children:[(0,r.jsxs)(C.Box,Mp({py:1},{children:[0!==(null==l?void 0:l.length)&&(0,r.jsx)(C.Box,Mp({pl:2},{children:(0,r.jsx)(C.Button,Mp({color:"primary",size:"small",onClick:function(){var e,t;return t=function(){return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},zp=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(Ct(),2))[0],n=e[1],o=(r=(0,fp.useSnackbar)()).enqueueSnackbar,i=r.closeSnackbar,l=rn(),E=_n().getDisplayByNumber,s=(0,a.useCallback)((function(e){return l.length?E(e):e}),[l,E]),{enqueueCallNotification:function(e){t||(i("npwd:callNotification"),o("",{variant:"npwdCallNotification",anchorOrigin:{vertical:"top",horizontal:"center"},persist:!0,title:"Call",onExited:function(){n(null)},transmitter:s(e.transmitter),receiver:s(e.receiver),key:"npwd:callNotification"}))},removeNotification:function(){i("npwd:callNotification")}}),T=d.enqueueCallNotification,A=d.removeNotification;(0,Wp.useNuiEvent)("CALL",K.SET_CALL_INFO,(function(e){if(!e)return A();c(e),T(e)})),(0,Wp.useNuiEvent)("CALL",K.END_CALL,u)},Yp=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},Zp=function(){var e=yr().addAlert,t=(0,L.useSetRecoilState)(Hn.history),n=Yp((0,se.useTranslation)(),1)[0],r=(0,L.useRecoilCallback)((function(e){var n=e.snapshot;return function(e){"hasValue"===n.getLoadable(Hn.history).state&&t((function(t){return function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},e_=(0,q.Z)({root:{position:"absolute",width:"auto",bottom:20}}),t_=function(){var e=$p((0,a.useState)(!1),2),t=e[0],n=e[1],o=$p((0,a.useState)(""),2),i=o[0],l=o[1],E=$p((0,a.useState)("info"),2),s=E[0],u=E[1],c=e_();return(0,Wp.useNuiEvent)("PHONE","startRestart",(function(){l("Restarting UI"),n(!0),u("error"),setTimeout((function(){return window.location.reload()}),3e3)})),(0,r.jsx)(C.Snackbar,Qp({open:t,onClose:function(){n(!1)},className:c.root},{children:(0,r.jsx)($,Qp({severity:s},{children:(0,r.jsxs)(C.Typography,Qp({variant:"body1"},{children:["Phone - ",i]}))}))}))},n_=function(){return(n_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(k(),1)[0],a=dl(),o=a.bottom,i=a.visibility,l=hn(),s=(0,E.useLocation)().pathname;return(0,r.jsx)(C.Slide,n_({direction:"up",timeout:{enter:500,exit:500},in:i},{children:(0,r.jsx)("div",n_({className:"PhoneWrapper"},{children:(0,r.jsxs)("div",n_({className:"Phone",style:{position:"fixed",transformOrigin:"right bottom",transform:"scale(".concat(n.zoom.value),bottom:o}},{children:[(0,r.jsx)("div",{className:"PhoneFrame",style:{backgroundImage:"url(media/frames/".concat(n.frame.value,")")}}),(0,r.jsx)("div",n_({id:"phone",className:"PhoneScreen bg-neutral-100 dark:bg-neutral-900",style:{backgroundImage:"/"===s&&l}},{children:t}))]}))}))}))},a_=(JSON.parse('{"PhoneAsItem":{"enabled":false,"exportResource":"my-core-resource","exportFunction":"myCheckerFunction"},"general":{"useResourceIntegration":false,"toggleKey":"f1","toggleCommand":"phone","defaultLanguage":"en"},"contacts":{"frameworkPay":false,"payResource":"my-core-resource","payFunction":"myCheckerFunction"},"profanityFilter":{"enabled":false,"badWords":["esx"]},"database":{"useIdentifierPrefix":false,"playerTable":"users","identifierColumn":"identifier","identifierType":"license","profileQueries":true,"phoneNumberColumn":"phone_number"},"debug":{"level":"error","enabled":true,"sentryEnabled":true},"defaultContacts":[],"disabledApps":[],"apps":["pefcl"],"voiceMessage":{"enabled":false,"authorizationHeader":"PE-Secret","url":"","returnedDataIndexes":["url"]}}'),n(81061)),o_=(tA=function(e,t){return(tA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}tA(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i_=function(){return(i_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(C.Dialog,i_({open:t},{children:[(0,r.jsx)(C.DialogTitle,{children:a("MISC.TOP_LEVEL_ERR_TITLE")}),(0,r.jsxs)(C.DialogContent,{children:[(0,r.jsxs)(C.DialogContentText,{children:[a("MISC.TOP_LEVEL_ERR_MSG"),(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsx)("code",i_({style:{color:"red"}},{children:n}))]}),(0,r.jsx)(C.DialogActions,{children:(0,r.jsx)(C.Button,i_({color:"primary",onClick:function(){return window.location.reload()}},{children:a("MISC.TOP_LEVEL_ERR_ACTION")}))})]})]}))},E_=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={hasError:!1,errorMsg:""},t}return o_(t,e),t.getDerivedStateFromError=function(e){return{hasError:!0,errorMsg:e.message}},t.prototype.componentDidCatch=function(e,t){var n=t.componentStack;(0,a_.Tb)(e,{contexts:{react:{componentStack:n}}})},t.prototype.render=function(){return this.state.hasError?(0,r.jsx)(l_,{isOpen:this.state.hasError,errorMsg:this.state.errorMsg}):this.props.children},t}(o().Component),s_=function(){return(s_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(k(),1)[0],et=(0,C.useTheme)();(0,a.useEffect)((function(){Xe.changeLanguage($e.language.value).catch((function(e){return console.error(e)}))}),[Xe,$e.language]),(0,a.useEffect)((function(){"taso-dark"===$e.theme.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),[$e.theme.value]),t=(0,L.useSetRecoilState)(N.resourceConfig),(0,L.useRecoilValue)(N.resourceConfig),(0,a.useEffect)((function(){if((0,qt.Id)())return t(nl);(0,tl.Q)().then(t)}),[t]),c=(0,E.useHistory)(),d=kr().closePhone,T=kt().call,A=(0,L.useRecoilValue)(T_.ArrowRight),p=(0,L.useRecoilValue)(T_.ArrowLeft),_=(0,L.useRecoilValue)(T_.ArrowUp),I=(0,L.useRecoilValue)(T_.ArrowDown),S=(0,L.useRecoilValue)(T_.Backspace),f=(0,L.useRecoilValue)(T_.Enter),R=(0,L.useRecoilValue)(T_.Escape),O=(0,a.useRef)(new Map),h=(0,L.useSetRecoilState)(T_.Escape),m=(0,L.useSetRecoilState)(T_.Backspace),(0,a.useEffect)((function(){O.current.set("ArrowRight",A),O.current.set("ArrowLeft",p),O.current.set("ArrowUp",_),O.current.set("ArrowDown",I),O.current.set("Backspace",S),O.current.set("Enter",f),O.current.set("Escape",R)}),[I,p,A,_,S,f,R]),(0,a.useEffect)((function(){function e(e){var t,n=e.key,r=O.current.get(n);if(t=n,-1!==A_.indexOf(t)&&r&&r.call)return r(e)}return window.addEventListener("keyup",e),function(){return window.removeEventListener("keyup",e)}}),[]),(0,a.useEffect)((function(){function e(e){"Tab"!==e.key||e.preventDefault()}return window.addEventListener("keydown",e),function(){return window.removeEventListener("keydown",e)}}),[]),v=(0,a.useCallback)((function(e){["input","textarea"].includes(e.target.nodeName.toLowerCase())||T||c.goBack()}),[c,T]),y=function(e){["input","textarea"].includes(e.target.nodeName.toLowerCase())&&e.target.blur(),d()},(0,a.useEffect)((function(){O.current.set("Escape",y),O.current.set("Backspace",v)}),[h,m,c,v,d]),g=ip().getApp,D=yr().addAlert,P=(0,E.useHistory)(),b=(0,L.useSetRecoilState)(N.visibility),M=(0,L.useSetRecoilState)(N.resourceConfig),x=(0,L.useSetRecoilState)(N.phoneTime),G=(0,L.useSetRecoilState)(N.isPhoneDisabled),w=(0,L.useSetRecoilState)(N.playerSource),F=(0,L.useSetRecoilState)(N.playerIdentifier),j=(0,a.useCallback)((function(e){var t=g(e.toUpperCase());if(!t)return console.error('App "'.concat(e,'" is an invalid app id to open'));P.push(t.path)}),[g,P]),rl("PHONE",Ge.LO.ADD_SNACKBAR_ALERT,D),rl("PHONE",Ge.LO.SET_VISIBILITY,b),rl("PHONE",Ge.LO.SET_CONFIG,M),rl("PHONE",Ge.LO.SET_TIME,x),rl("PHONE",Ge.LO.OPEN_APP,j),rl("PHONE",Ge.LO.IS_PHONE_DISABLED,G),rl("PHONE",Ge.LO.SEND_PLAYER_SOURCE,w),rl("PHONE",Ge.LO.SEND_PLAYER_IDENTIFIER,(function(e){F(e)})),n=(0,L.useSetRecoilState)(bt.number),rl("SIMCARD",Ge.LO.SET_NUMBER,n),Mt(),H=yp().enqueueNotification,W=ip().getApp,V=(U="npwd:ext:createNotification",B=function(e){z(e.detail)},(0,a.useEffect)((function(){window.addEventListener(U,B)})),{unsubscribe:function(){return window.removeEventListener(U,B)}}).unsubscribe,(0,a.useEffect)((function(){return function(){V()}})),z=function(e){H({appId:W(e.appId).id,content:e.content,secondaryTitle:e.secondaryTitle,duration:e.duration,keepOpen:e.keepOpen,path:e.path,notisId:e.notisId,onClick:null})},(0,Wp.useNuiEvent)("PHONE",Bp.CREATE_NOTIFICATION,z),Y=(K=(0,fp.useSnackbar)()).enqueueSnackbar,Z=K.closeSnackbar,J=yp().removeActive,q=(0,L.useRecoilCallback)((function(e){var t=e.set,n=e.snapshot;return function(e){var r,a;return a=function(){var r,a,o;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(e),!1),[a],!1)})),Y(e.content,{variant:"npwdSystemNotification",secondaryTitle:e.secondaryTitle,key:e.uniqId,persist:e.keepOpen||!1,autoHideDuration:e.duration||3e3,controls:null!==(o=e.controls)&&void 0!==o&&o,onExited:function(){J(a)}}),[2])}}))},new(r=void 0,r=Promise)((function(e,t){function n(e){try{i(a.next(e))}catch(e){t(e)}}function o(e){try{i(a.throw(e))}catch(e){t(e)}}function i(t){var a;t.done?e(t.value):((a=t.value)instanceof r?a:new r((function(e){e(a)}))).then(n,o)}i((a=a.apply(void 0,[])).next())}))}}),[]),(0,Wp.useNuiEvent)("SYSTEM",Bp.CREATE_SYSTEM_NOTIFICATION,q),(0,Wp.useNuiEvent)("SYSTEM",Bp.REMOVE_SYSTEM_NOTIFICATION,(function(e){Z(e.uniqId)})),o=(0,E.useHistory)(),i=yp().markAsRead,l=(0,L.useRecoilCallback)((function(e){var t=e.snapshot;return function(e){var n,r;return r=function(){var n,r,a,o,l,s;return function(e,t){var n,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(E){return function(l){if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(a=2&l[0]?r.return:l[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,l[1])).done)return a;switch(r=0,a&&(l=[2&l[0],a.value]),l[0]){case 0:case 1:a=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!((a=(a=i.trys).length>0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(n)).next(),u.label=3;case 3:return a.done?[3,6]:(o=a.value,(0,E.matchPath)(e.pathname,{path:o.path,exact:!1})?[4,i(o.id)]:[3,5]);case 4:u.sent(),u.label=5;case 5:return a=r.next(),[3,3];case 6:return[3,9];case 7:return l={error:u.sent()},[3,9];case 8:try{a&&!a.done&&(s=r.return)&&s.call(r)}finally{if(l)throw l.error}return[7];case 9:return[2]}}))},new(n=void 0,n=Promise)((function(e,t){function a(e){try{i(r.next(e))}catch(e){t(e)}}function o(e){try{i(r.throw(e))}catch(e){t(e)}}function i(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n((function(e){e(r)}))).then(a,o)}i((r=r.apply(void 0,[])).next())}))}})),(0,a.useEffect)((function(){return o.listen(l)}),[o,l]),function(){var e=Dc(),t=e.addTweet,n=e.updateTweetLikes,r=e.deleteTweet,o=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}(Cc(),2),i=o[0],l=o[1],s=yp().enqueueNotification,u=(0,E.useLocation)().pathname,c=(0,L.useRecoilValueLoadable)(mc.profile),d=c.state,T=c.contents,A=(0,L.useSetRecoilState)(mc.filteredTweets),p=(0,a.useCallback)((function(e){s({appId:"TWITTER",content:e.message,notisId:"npwd:tweetBroadcast",secondaryTitle:e.profile_name,path:"/twitter",playSound:!0})}),[s]),_=(0,a.useCallback)((function(e){s({appId:"TWITTER",content:"@".concat(e," likede dit tweet!"),notisId:"npwd:tweetBroadcast",path:"/twitter"})}),[s]),I=(0,a.useCallback)((function(e){if("hasValue"===d&&T){i.length>=50&&l((function(e){return e.slice(0,-1)})),u.includes("/twitter")||p(e);var n,r,a,o,E=(r=T,a=Rc(n=e),o=(null==r?void 0:r.identifier)===n.identifier,fc(fc({},a),{isMine:o,isLiked:!1}));t(E)}}),[t,p,T,d,l,i.length,u]),S=(0,a.useCallback)((function(e){var t=e.tweetId,r=e.isAddLike,a=e.likedByProfileName;if(n(t,r),r&&!u.includes("/twitter")){var o=i.find((function(e){return e.id==t}));o.isMine&&o.profile_name!==a&&_(a)}}),[_,n,i]),f=(0,a.useCallback)((function(e){r(e)}),[r]);(0,Wp.useNuiEvent)(Ac,uu.FETCH_TWEETS_FILTERED,(function(e){A(e.map(Rc))})),(0,Wp.useNuiEvent)(Ac,uu.CREATE_TWEET_BROADCAST,I),(0,Wp.useNuiEvent)(Ac,uu.TWEET_LIKED_BROADCAST,S),(0,Wp.useNuiEvent)(Ac,uu.DELETE_TWEET_BROADCAST,f)}(),X=(0,E.useLocation)().pathname,Q=dl().visibility,ee=($=Hu()).addMatchAccount,te=$.addMatchedAccount,ne=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],re=yp().enqueueNotification,oe=(ae=(0,L.useRecoilValueLoadable)(ou.myProfile)).state,ie=ae.contents,le=(0,a.useCallback)((function(e){"hasValue"===oe&&ie&&ee(e,ie)}),[ee,ie,oe]),(0,Wp.useNuiEvent)("MATCH",xs.SAVE_LIKES_BROADCAST,(function(e){var t=e.name;Q&&X.includes("/match/")||(re({appId:"MATCH",content:t,secondaryTitle:ne("MATCH.MESSAGES.NEW_MATCH"),notisId:"npwd:matchBroadcast",path:"/match",keepOpen:!1,duration:3e3}),te())})),(0,Wp.useNuiEvent)("MATCH",xs.CREATE_MATCH_ACCOUNT_BROADCAST,le),ce=(Ee=(0,L.useSetRecoilState)(xl),ue={deleteListing:(0,L.useRecoilCallback)((function(e){var t=e.snapshot;return function(e){var n=t.getLoadable(xl),r=n.state,a=n.contents;"hasValue"===r&&a.length&&Ee((function(t){return zp([],Vp(t),!1).filter((function(t){return!e.includes(t.id)}))}))}}),[]),addListing:(0,L.useRecoilCallback)((function(e){var t=e.snapshot;return function(e){"hasValue"===t.getLoadable(xl).state&&Ee((function(t){return zp([e],Vp(t),!1)}))}}),[Ee])}).addListing,de=ue.deleteListing,Te=yp().enqueueNotification,Ae=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],pe=(0,a.useCallback)((function(e){ce(e.listing),Te({appId:"MARKETPLACE",notisId:"npwd:marketplace:newListingBroadcast",content:e.listing.description,secondaryTitle:Ae("MARKETPLACE.NEW_LISTING")})}),[ce,Te]),_e=(0,a.useCallback)((function(e){de(e)}),[de]),(0,Wp.useNuiEvent)("MARKETPLACE",Zi.BROADCAST_ADD,pe),(0,Wp.useNuiEvent)("MARKETPLACE",Zi.BROADCAST_DELETE,_e),Se=(Ie=wa()).updateLocalMessages,fe=Ie.updateLocalConversations,Re=Ie.setMessageReadState,Oe=(0,E.useLocation)().pathname,he=un(),me=dl().visibility,Ce=yp().enqueueNotification,Le=_n().getDisplayByNumber,ve=(Ne=vr()).getMessageConversationById,ye=Ne.goToConversation,ge=(0,a.useCallback)((function(e,t,n){var r,a=ve(n);Ce({appId:"MESSAGES",notisId:"npwd:messages:messageBroadcast",content:e,onClick:function(){return ye(a)},secondaryTitle:null!==(r=Le(t))&&void 0!==r?r:t,path:"/messages/conversations/".concat(n)})}),[Ce]),De=(0,a.useCallback)((function(e){e.conversation_id===(null==he?void 0:he.id)&&Se(e)}),[Se,he]),Pe=(0,a.useCallback)((function(e){fe({participant:e.participant,isGroupChat:e.isGroupChat,id:e.id,conversationList:e.conversationList,label:e.label,unread:0})}),[fe]),(0,Wp.useNuiEvent)("MESSAGES",Zt.CREATE_MESSAGE_BROADCAST,(function(e){var t=e.conversationName,n=e.conversation_id,r=e.message;me&&Oe.includes("/messages/conversations/".concat(n))||(Re(n,1),ge(r,t,n))})),(0,Wp.useNuiEvent)("MESSAGES",Zt.SEND_MESSAGE_SUCCESS,De),(0,Wp.useNuiEvent)("MESSAGES",Zt.CREATE_MESSAGE_CONVERSATION_SUCCESS,Pe),be=_n().getContactByNumber,Me=(0,E.useHistory)(),ke=ip().getApp,xe=(0,a.useCallback)((function(e){var t,n,r=be(e.number),a=ke("CONTACTS").path,o=tr().stringify({addNumber:e.number.slice(0,vt.number),name:null===(t=e.name)||void 0===t?void 0:t.slice(0,vt.display),avatar:null===(n=e.avatar)||void 0===n?void 0:n.slice(0,vt.avatar)});if(!r)return Me.push({pathname:"".concat(a,"/-1"),search:"?".concat(o)});Me.push({pathname:"".concat(a,"/").concat(r.id),search:"?".concat(o)})}),[ke,be,Me]),rl("CONTACTS",yt.ADD_CONTACT_EXPORT,xe),we=ip().getApp,Fe=(0,E.useHistory)(),je=(0,a.useCallback)((function(e){var t=we("NOTES").path,n=tr().stringify(e);Fe.push({pathname:t,search:"?".concat(n)})}),[Fe,we]),rl("NOTES",Ho.ADD_NOTE_EXPORT,je),Kp(),Zp(),Be=(Ue=_A()).addLocalMessage,He=Ue.updateLocalChannelLabel,We=Ue.localTransferOwner,Ve=Ue.leaveLocalChannel,ze=iA(),Ke=(0,a.useCallback)((function(e){ze.id===e.channelId&&Be(e)}),[ze,Be]),Ye=(0,a.useCallback)((function(e){ze.id===e.channelId&&He(e)}),[ze,Be]),Ze=(0,a.useCallback)((function(e){We(e)}),[We]),Je=(0,a.useCallback)((function(e){Ve(e.channelId)}),[Ve]),rl("DARKCHAT",MT.BROADCAST_MESSAGE,Ke),rl("DARKCHAT",MT.BROADCAST_LABEL_UPDATE,Ye),rl("DARKCHAT",MT.TRANSFER_OWNERSHIP_SUCCESS,Ze),rl("DARKCHAT",MT.DELETE_CHANNEL_SUCCESS,Je),s=yr().addAlert,u=(0,se.useTranslation)().t,(0,a.useEffect)((function(){(0,d_.e)()||s({message:u("SETTINGS.MESSAGES.INVALID_SETTINGS"),type:"error"})}),[]);var tt=cp(),nt=Ht().modal;return(0,r.jsx)("div",{children:(0,r.jsxs)(E_,{children:[(0,r.jsx)(t_,{}),(0,r.jsxs)(r_,{children:[(0,r.jsx)(wp,{}),(0,r.jsxs)("div",__({className:"PhoneAppContainer",id:"notificationAppContainer",ref:qe},{children:[(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.Route,{exact:!0,path:"/",component:pp}),nt&&(0,r.jsx)(E.Route,{exact:!0,path:"/call",component:Ln}),Qe.map((function(e){return(0,r.jsx)(a.Fragment,{children:!e.isDisabled&&(0,r.jsx)(e.Route,{},e.id)},e.id)})),tt.map((function(e){return(0,r.jsx)(a.Fragment,{children:(0,r.jsx)(e.Route,{settings:$e,i18n:Xe,theme:et})},e.id)}))]}),(0,r.jsx)(Xp,{}),(0,r.jsx)(c_,{})]})),(0,r.jsx)(jp,{})]})]})})},S_=function(){return(S_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0],c=(0,E.useHistory)();return(0,r.jsxs)(R_,S_({onClick:function(){l&&!s?c.push(l):s(),n(e.id.toString())},ref:t,style:{minWidth:"370px"}},{children:[(0,r.jsxs)(C.Box,S_({display:"flex",alignItems:"center",color:"white",width:"100%",mb:.7},{children:[(0,r.jsx)(C.Box,S_({p:"5px",borderRadius:30,bgcolor:a.backgroundColor,display:"flex",justifyContent:"center",alignItems:"center"},{children:(0,r.jsx)(a.NotificationIcon,{fontSize:"inherit"})})),(0,r.jsx)(C.Box,S_({color:"#bfbfbf",fontWeight:400,paddingLeft:1,flexGrow:1,fontSize:16},{children:u(a.nameLocale)})),(0,r.jsx)(C.Box,{children:(0,r.jsx)(C.Typography,S_({color:"#bfbfbf"},{children:i}))})]})),(0,r.jsx)(f_,{children:o})]}))})),h_=function(){return(h_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&a[a.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!a||l[1]>a[0]&&l[1]0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,se.useTranslation)(),1)[0];return(0,r.jsxs)(P_,y_({onClick:function(){i(e.id)},style:{minWidth:"370px"},ref:t},{children:[(0,r.jsxs)(C.Box,y_({display:"flex",alignItems:"center",color:"white",width:"100%",mb:.7},{children:[(0,r.jsx)(C.Box,y_({p:"5px",borderRadius:30,bgcolor:l.backgroundColor,display:"flex",justifyContent:"center",alignItems:"center"},{children:(0,r.jsx)(l.NotificationIcon,{fontSize:"inherit"})})),(0,r.jsx)(C.Box,y_({color:"#bfbfbf",fontWeight:400,paddingLeft:1,flexGrow:1,fontSize:16},{children:E("APPS_SYSTEM")})),(0,r.jsx)(C.Box,{children:(0,r.jsx)(C.Typography,y_({color:"#bfbfbf"},{children:n}))})]})),(0,r.jsx)(b_,{children:a}),o&&(0,r.jsxs)(C.Box,{children:[(0,r.jsx)(C.IconButton,y_({size:"small",onClick:function(){return g_(void 0,void 0,void 0,(function(){return D_(this,(function(t){switch(t.label){case 0:return[4,(0,v.Z)("npwd:onNotificationConfirm",e.id)];case 1:return t.sent(),[2]}}))}))}},{children:(0,r.jsx)(N_.Z,{})})),(0,r.jsx)(C.IconButton,y_({size:"small",onClick:function(){return g_(void 0,void 0,void 0,(function(){return D_(this,(function(t){switch(t.label){case 0:return[4,(0,v.Z)("npwd:onNotificationCancel",e.id)];case 1:return t.sent(),[2]}}))}))}},{children:(0,r.jsx)(v_.Z,{})}))]})]}))})),k_=function(){return(k_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i},B_=function(e,t,n){if(n||2===arguments.length)for(var r,a=0,o=t.length;a0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(0),2),o=n[0],i=n[1];return(0,Wp.useNuiEvent)("PHONE",Ge.LO.UNLOAD_CHARACTER,(function(){i((function(e){return e+1}))})),(0,r.jsxs)(L.RecoilRoot,{children:[(0,r.jsx)(W_,{}),t]},o)}),{children:(0,r.jsx)((function(e){var t=e.children,n=(0,L.useRecoilSnapshot)();return(0,a.useEffect)((function(){var e,t;if(On.debug.shouldShowAtomDebug){console.debug("The following atoms were modified:");try{for(var r=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(n.getNodes_UNSTABLE({isModified:!0})),a=r.next();!a.done;a=r.next()){var o=a.value;console.debug(o.key,n.getLoadable(o))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}}}),[n]),(0,r.jsx)(r.Fragment,{children:t})}),{children:(0,r.jsx)((function(){var e=F(),t=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,a,o=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)i.push(r.value)}catch(e){a={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(a)throw a.error}}return i}((0,a.useState)(),2),n=t[0],o=t[1],i=x_();return(0,r.jsx)(C.StyledEngineProvider,k_({injectFirst:!0},{children:(0,r.jsx)(C.ThemeProvider,k_({theme:e},{children:(0,r.jsx)(b,{children:(0,r.jsx)(fp.SnackbarProvider,k_({classes:{containerRoot:i.rootOverride},autoHideDuration:3e3,maxSnack:2,Components:{npwdNotification:O_,npwdCallNotification:L_,npwdSystemNotification:M_},disableWindowBlurListener:!0,anchorOrigin:{horizontal:"center",vertical:"top"},domRoot:n},{children:(0,r.jsx)(H,{children:(0,r.jsx)(I_,{notiRefCB:o})})}))})}))}))}),{})})})}))}))}),document.getElementById("root"))},98105:function(e,t,n){"use strict";n.d(t,{Id:function(){return r},MH:function(){return o},Yj:function(){return a}});var r=function(){return!1},a=function(){return window.GetParentResourceName?null==window?void 0:window.GetParentResourceName():"npwd"},o=function(e,t,n){return{data:e,status:t,errorMsg:n}}},84782:function(e){"use strict";e.exports=JSON.parse('{"cellProvider":"3","defaultLanguage":"da","wallpapers":[{"label":"Minimal","value":"minimal.jpg"},{"label":"Surf","value":"surf.jpg"},{"label":"Waves","value":"waves.jpg"},{"label":"Project Error","value":"projecterror.jpg"},{"label":"NPWD 2020","value":"npwd2020.png"},{"label":"Default","value":"default.jpg"}],"frames":[{"label":"Default","value":"default.png"},{"label":"Blå","value":"blue.png"},{"label":"Guld","value":"gold.png"},{"label":"Minimal","value":"minimal.png"},{"label":"Pink","value":"pink.png"},{"label":"Hvid","value":"white.png"}],"zoomOptions":[{"label":"150%","value":1.5},{"label":"100%","value":1},{"label":"90%","value":0.9},{"label":"80%","value":0.8},{"label":"70%","value":0.7}],"languages":[{"label":"Dansk","value":"da"},{"label":"English","value":"en"},{"label":"Español","value":"es"},{"label":"Français","value":"fr"},{"label":"Norsk","value":"no"},{"label":"Polski","value":"pl"},{"label":"Bosanski","value":"ba"},{"label":"Português","value":"pt"},{"label":"Hungarian","value":"hu"},{"label":"Čeština","value":"cs"},{"label":"Nederlands","value":"nl"},{"label":"Deutsch","value":"de"},{"label":"Finnish","value":"fi"},{"label":"Italian","value":"it"},{"label":"Indonesia","value":"id"},{"label":"简体中文","value":"zhcn"},{"label":"繁體中文","value":"zhtw"},{"label":"Русский","value":"ru"},{"label":"Svenska","value":"sv"},{"label":"Türkçe","value":"tr"},{"label":"Lietuvių","value":"lt"}],"ringtones":[{"label":"iFruit","value":"PHONE_GENERIC_RING_01"},{"label":"Desk Phone","value":"PHONE_GENERIC_RING_02"},{"label":"Rotary Phone","value":"PHONE_GENERIC_RING_03"}],"notiSounds":[{"label":"Online","value":"Phone_SoundSet_Default"},{"label":"Michael","value":"Phone_SoundSet_Michael"},{"label":"Trevor","value":"Phone_SoundSet_Trevor"},{"label":"Franklin","value":"Phone_SoundSet_Franklin"}],"notiFilters":[{"label":"Alle Tweets","value":"all"},{"label":"Kun mentions","value":"mentions"}],"defaultSettings":{"language":{"label":"Dansk","value":"da"},"callVolume":50,"iconSet":{"label":"Material","value":{"custom":false,"name":"material"}},"wallpaper":{"label":"Minimal","value":"minimal.jpg"},"customWallpaper":"","frame":{"label":"Default","value":"default.png"},"theme":{"label":"Dark","value":"taso-dark"},"zoom":{"label":"90%","value":0.9},"streamerMode":false,"ringtone":{"label":"iFruit","value":"PHONE_GENERIC_RING_01"},"notiSound":{"label":"Online","value":"Phone_SoundSet_Default"},"TWITTER_notiFilter":{"label":"Alle Tweets","value":"all"},"TWITTER_notiSound":{"label":"Online","value":"online"},"TWITTER_notiSoundVol":25,"TWITTER_notifyNewFeedTweet":true,"MARKETPLACE_notifyNewListing":true},"appSettings":{"browserHomePage":"https://google.com"},"iconSet":[{"label":"NPWD Icons","value":{"custom":true,"name":"npwd_icons"}},{"label":"Material","value":{"custom":false,"name":"material"}}],"themes":[{"label":"Dark","value":"taso-dark"},{"label":"Light","value":"default-light"}],"debug":{"printDebugLogs":false,"logLevel":1,"shouldShowAtomDebug":false},"SentryErrorMetrics":false}')}}]);