"use strict";(self.webpackChunkbongacams=self.webpackChunkbongacams||[]).push([[733],{63294:function(e,n,i){i.d(n,{o:function(){return r}});var t=i(74848),o=i(96540),s=i(20206),a=i(83375),r=(0,o.forwardRef)(function(e,n){var i,o,r=e.btnClassName,l=e.children,c=e.type,u=e.wrapClassName,d=e.onClick;return(0,t.jsx)("div",{ref:n,className:(0,a.n)((i={btn_smile_wrp:!0},i[u]=u,i)),children:(0,t.jsx)("button",{className:(0,a.n)((o={"btn_smile smileButton":!0},o[s.U_]=!0,o[r]=r,o)),type:c||"button",onClick:d,children:l})})})},56551:function(e,n,i){i.d(n,{i:function(){return s}});var t=i(74848),o=i(83375),s=function(e){var n=e.isChecked,i=e.onClick;return(0,t.jsx)("button",{className:(0,o.n)({bc_switcher:!0,__checked:n}),onClick:i})}},46264:function(e,n,i){i.d(n,{W:function(){return o}});var t=i(74848),o=function(e){var n=e.message;return n?(0,t.jsx)("span",{className:"bc_text_error",children:n}):null}},76480:function(e,n,i){i.d(n,{V:function(){return h}});var t=i(74848),o=i(96540),s=i(13839),a=i(63294),r=i(26580),l=i(20206),c=i(46264),u=i(47885),d=i(83375),v=i(46517),f=i(40172),p=i(99948),m=i(41669),h=(0,o.memo)(function(e){var n=e.id,i=e.className,h=e.classNameLabel,b=e.classNameSmileButton,_=e.classNameTextarea,C=e.iconSimileButton,N=e.label,x=e.limit,j=e.placeholder,g=e.smilePanelOptions,S=e.dontSendMessageByEnter,y=e.errorMessage,E=e.isNotSendMessageChat,k=e.isPreventNewLine,w=e.isRemainCharTextEnabled,P=e.onBlur,A=e.onChange,O=e.onFocus,U=function(e){var n=(0,o.useRef)(null),i=(0,v.d4)(f.oI),t=(0,v.d4)(f.UQ);return(0,o.useEffect)(function(){var i=n.current;return i&&t&&m(i).initSmilePanel(e),function(){i&&t&&m(i).destroySmilePanel()}},[e,t]),{refs:{smileyTextareaWrapperRef:n},actions:{handleSmileysButtonClick:function(){t||(0,p.a)()}},states:{isMobile:i}}}(g),R=U.refs.smileyTextareaWrapperRef,H=U.actions.handleSmileysButtonClick,F=U.states.isMobile;return(0,t.jsxs)("div",{className:(0,d.jc)("bc_textarea_smileys",i),children:[N&&(0,t.jsx)("p",{className:(0,d.jc)("tas_label",h),children:N}),(0,t.jsxs)("div",{ref:R,className:"tas_comment",children:[(0,t.jsx)(s.X,{id:n,className:(0,d.jc)("tas_textarea",l.Y8,_),classNameWrp:"tas_input",dontSendMessageByEnter:S,maxLength:x,placeholder:j||__("Enter message text"),isMobile:F,isNotSendMessageChat:E,isPreventNewLine:k,isRemainCharTextEnabled:w,onBlur:P,onChange:A,onFocus:O}),(0,t.jsx)(c.W,{message:y}),(0,t.jsxs)(a.o,{wrapClassName:(0,d.jc)("tas_smile_wrp",b),onClick:H,children:[C,!C&&(0,t.jsx)(r.A,{group:"tas_sb_icon",icon:"#svg_ch_smile",url:u.g5})]})]})]})})},75015:function(e,n,i){i.d(n,{y:function(){return v}});var t=i(74848),o=i(96540),s=i(15215),a=i(40961),r=i(836),l=i(83375),c=i(39992),u=(0,o.memo)(function(e){var n,r=e.className,u=e.content,d=function(e){var n=e.rootRef,t=e.options,a=t.flip,r=t.offset,l=void 0===r?10:r,u=t.placement,d=void 0===u?"bottom-start":u,v=t.shift,f=t.strategy,p=t.isOutsideCloseClickDisabled,m=t.isToggleDisabled,h=e.onClose,b=(0,o.useRef)(null);return(0,c.j)({ref:b,callback:function(e){var i,t=null===(i=n.current)||void 0===i?void 0:i.contains(e.target);!m&&t&&(e.preventDefault(),e.stopPropagation()),h()},isEnabled:!p}),(0,o.useEffect)(function(){return window.addEventListener("resize",h),function(){window.removeEventListener("resize",h)}},[h]),(0,o.useEffect)(function(){(0,s.sH)(void 0,void 0,void 0,function(){var e,t,o,r,c,u;return(0,s.YH)(this,function(s){switch(s.label){case 0:return[4,i.e(258).then(i.bind(i,7315))];case 1:return e=s.sent(),t=e.computePosition,o=e.flip,r=e.offset,c=e.shift,b.current&&n.current&&(b.current.style.display="block",u=[r(l),o(a),c(v)],t(n.current,b.current,{middleware:u,placement:d,strategy:f}).then(function(e){b.current&&Object.assign(b.current.style,{transform:"translate(".concat(Math.round((null==e?void 0:e.x)||0),"px, ").concat(Math.round((null==e?void 0:e.y)||0),"px)")})})),[2]}})})},[n,d,l,v,a,f]),{refs:{popoverRef:b}}}(e).refs.popoverRef;return(0,a.createPortal)((0,t.jsx)("div",{ref:d,className:(0,l.n)((n={popover_simple:!0},n[String(r)]=Boolean(r),n)),style:{display:"none"},children:u}),document.body)}),d=(0,o.memo)(function(e){var n=e.isOpen,i=(0,s.Tt)(e,["isOpen"]);return(0,t.jsx)(r.T,{isAvailable:!!i.content&&n,children:(0,t.jsx)(u,(0,s.Cl)({},i))})}),v=function(e){var n=e.className,i=e.content,a=e.options,r=void 0===a?{}:a,l=e.trigger,c=function(e){var n=e.options,i=void 0===n?{}:n,t=e.onBeforeOpen,a=e.onClose,r=(0,o.useState)(!1),l=r[0],c=r[1];return{actions:{handleClosePopover:function(){null==a||a(),c(!1)},handleOpenPopover:function(){return(0,s.sH)(void 0,void 0,void 0,function(){var e,n;return(0,s.YH)(this,function(o){switch(o.label){case 0:return e=!0,t?[4,t()]:[3,2];case 1:e=o.sent(),o.label=2;case 2:return e?(n=i.isToggleDisabled,c(function(e){return!!n||!e}),[2]):[2]}})})}},refs:{childRef:(0,o.useRef)(null)},states:{isOpenState:l}}}(e),u=c.refs.childRef,v=c.actions,f=v.handleClosePopover,p=v.handleOpenPopover,m=c.states.isOpenState;return(0,t.jsxs)(t.Fragment,{children:[(0,o.cloneElement)(l,{ref:u,onClick:p}),i&&(0,t.jsx)(d,{rootRef:u,className:n,content:"function"==typeof i?i({isOpen:m,setPopoverClose:f}):i,options:r,isOpen:m,onClose:f})]})}},91196:function(e,n,i){i.d(n,{o:function(){return w},t:function(){return f}});var t=i(15215),o=i(96540),s=i(46517),a=i(99525),r=i(85424),l=i(64641),c=i(57933),u=i(63861),d=i(10346),v=i(85340),f=function(e){var n=e.modelUsername,i=e.isSubscribedForEmail,f=void 0!==i&&i,p=e.isSubscribedForPush,m=void 0!==p&&p,h=(0,v.f)().sendRequest,b=(0,s.d4)(function(e){return e.isAuthenticated}),_=(0,s.d4)(d.tP),C=(0,o.useMemo)(function(){return(0,t.Cl)((0,t.Cl)({},_[n]),{modelUsername:n})},[_,n]),N=(0,o.useMemo)(function(){var e,n;return(null===(e=null==C?void 0:C.subscribe)||void 0===e?void 0:e.isSubscribedForPush)||(null===(n=null==C?void 0:C.subscribe)||void 0===n?void 0:n.isSubscribedForEmail)},[C]),x=function(){return(0,t.sH)(void 0,void 0,void 0,function(){var e,i,o,s,l,v;return(0,t.YH)(this,function(t){switch(t.label){case 0:return C.isPopoverOpen?[2,!1]:(e="".concat((0,u.ip)("@api_follower_online_notifications_popup"),"?username=").concat(n),b?[3,2]:(i=null===(l=window.Notification)||void 0===l?void 0:l.permission)&&"granted"===i?[4,r.NotificationWidget.pushNotificationInstance.subscribe()]:[3,2]);case 1:(o=t.sent())&&(e="".concat(e).concat(o?"&hash=".concat(o):"")),t.label=2;case 2:return s={modelUsername:n},(null===(v=null==_?void 0:_[n])||void 0===v?void 0:v.popoverContent)?s.isPopoverOpen=!0:s.isPopoverContentLoading=!0,[4,a.A.dispatch(d.ij)(s)];case 3:return t.sent(),[4,h(e).then(function(e){if(e.status===c.O6.SUCCESS){var i={modelUsername:n,popoverContent:e.data};a.A.dispatch(d.sq)(i),a.A.dispatch(d.ij)({modelUsername:n,isSubscribedForEmail:e.data.emailNotification.activity.checked,isSubscribedForPush:e.data.siteNotification.activity.checked})}})];case 4:return t.sent(),[2,!0]}})})};return(0,o.useEffect)(function(){C.isPopoverContentLoading&&C.popoverContent&&a.A.dispatch(d.ij)({modelUsername:n,isPopoverContentLoading:!1,isPopoverOpen:!0})},[C,n]),(0,o.useEffect)(function(){n&&!(null==_?void 0:_[n])&&a.A.dispatch(d.ij)({modelUsername:n,isSubscribedForEmail:f,isSubscribedForPush:m})},[n,_,f,m]),(0,o.useEffect)(function(){var e;n&&(null===(e=null==_?void 0:_[n])||void 0===e?void 0:e.isPopoverOpen)&&a.A.dispatch(d.ij)({modelUsername:n,isPopoverOpen:!1})},[n]),{actions:{handleClickNotificationButton:x,handleCloseNotificationPopup:function(){return(0,t.sH)(void 0,void 0,void 0,function(){return(0,t.YH)(this,function(e){switch(e.label){case 0:return[4,a.A.dispatch(d.ij)({modelUsername:n,isPopoverContentLoading:!1,isPopoverOpen:!1})];case 1:return e.sent(),[2]}})})},handleGetNotificationWithModernWrapper:function(){return(0,t.sH)(void 0,void 0,void 0,function(){return(0,t.YH)(this,function(e){switch(e.label){case 0:return[4,(0,l.Wb)()];case 1:return e.sent(),[2,x()]}})})}},states:{contentPopoverNotificationData:C,isAnyNotificationSubscriptionActive:N}}},p=i(74848),m=i(95141),h=i(836),b=i(22078),_=i(26580),C=i(56551),N=i(40682),x=i(53336),j=i(42338),g=i(2597),S=i(1606),y=i(41669),E=(0,o.memo)(function(e){var n,i,l,u,f,m,h,E=e.data,k=function(e){var n=e.data,i=e.onSubscriptionChangeEmail,l=e.onSubscriptionChangePush,u=(0,v.h)().sendApiRequest,f=(0,s.d4)(function(e){return e.isAuthenticated}),p=(0,s.d4)(function(e){return e.user.membership}),m=(0,o.useState)(!1),h=m[0],_=m[1];return{actions:{handleChangeEmailNotification:function(){return(0,t.sH)(void 0,void 0,void 0,function(){var e,o,s,r,l,v,m,h,C,N,x;return(0,t.YH)(this,function(t){switch(t.label){case 0:return(0,b.j)(null===(C=null==n?void 0:n.popoverContent)||void 0===C?void 0:C.emailNotification)?(e=n.modelUsername,o=n.popoverContent.emailNotification,f||!y.signupEvent?[3,1]:(y.signupEvent.call(this),[3,5])):[3,5];case 1:return p!==g.A.FREE?[3,2]:((0,j.q)({isBuyTokens:!0}),[3,5]);case 2:return o.setupEmail?(_(!0),[3,5]):[3,3];case 3:return s=(null===(N=o.activity)||void 0===N?void 0:N.checked)||!1,(null==(r=s?o.unsubscribeApiUrl:o.subscribeApiUrl)?void 0:r.url)?(l=JSON.stringify(r.body),[4,u(r.url,{body:l})]):[2];case 4:(null==(v=t.sent())?void 0:v.status)===c.O6.SUCCESS&&e&&(m=!(null===(x=o.activity)||void 0===x?void 0:x.checked),h={modelUsername:e,isEmailActive:m},a.A.dispatch(d.jl)(h),null==i||i(m)),t.label=5;case 5:return[2]}})})},handleChangeSiteNotification:function(){return(0,t.sH)(void 0,void 0,void 0,function(){var e,i,o,s,v,p,m,h,_,C,N,x;return(0,t.YH)(this,function(t){switch(t.label){case 0:return(0,b.j)(null===(C=null==n?void 0:n.popoverContent)||void 0===C?void 0:C.siteNotification)?(e=n.modelUsername,i=n.popoverContent.siteNotification,o=(null===(N=i.activity)||void 0===N?void 0:N.checked)||!1,(null==(s=o?i.unsubscribeApiUrl:i.subscribeApiUrl)?void 0:s.url)?(v=null,f?[3,2]:[4,r.NotificationWidget.pushNotificationInstance.subscribe()]):[2]):[3,4];case 1:if(!(v=t.sent()))return y.signupEvent.call(this),[2];s.body.hash=v,t.label=2;case 2:return p=JSON.stringify(s.body),[4,u(s.url,{body:p})];case 3:(null==(m=t.sent())?void 0:m.status)===c.O6.SUCCESS&&(o&&v&&S.w.instance.removeHash(),!o&&v&&S.w.instance.setHash(v),e&&(h=!(null===(x=i.activity)||void 0===x?void 0:x.checked),_={modelUsername:e,isNotificationActive:h},a.A.dispatch(d.jl)(_),null==l||l(h))),t.label=4;case 4:return[2]}})})}},states:{isEmailNotSetupState:h}}}(e).actions,w=k.handleChangeEmailNotification,P=k.handleChangeSiteNotification;if(!(null==E?void 0:E.popoverContent))return null;var A=E.popoverContent,O=A.emailNotification,U=A.header,R=A.siteNotification,H=(null===(n=null==O?void 0:O.activity)||void 0===n?void 0:n.checked)||!1,F=(null===(i=null==R?void 0:R.activity)||void 0===i?void 0:i.checked)||!1,M=null===(l=null==O?void 0:O.email)||void 0===l?void 0:l.value,B=null===(u=null==O?void 0:O.setupEmail)||void 0===u?void 0:u.text,T=null===(f=null==O?void 0:O.setupEmail)||void 0===f?void 0:f.attributes;return T&&(T.link=(0,t.Cl)((0,t.Cl)({},T.link),{class:"ponc_link"})),(0,p.jsxs)(p.Fragment,{children:[(0,b.j)(U)&&(0,p.jsxs)("div",{className:"pon_header bc_flex bc_flex_items_center",children:[(0,p.jsx)("div",{className:"ponh_icon_wrp bc_flex bc_flex_full_center",children:(0,p.jsx)(_.A,{group:"ponh_icon",icon:"#svg_btna_notify",url:x.MQ})}),(0,p.jsx)(N.E,{className:"ponh_title",html:__(U.caption.text,{modelName:{class:"ponh_name pon_accent"}}),tagName:"p"})]}),(0,p.jsxs)("div",{className:"pon_controll",children:[(0,b.j)(O)&&(0,p.jsx)(p.Fragment,{children:(0,p.jsxs)("div",{className:"ponc_row",children:[(0,p.jsxs)("div",{className:"ponc_row_inner bc_flex bc_flex_justify_s_between bc_flex_items_center",children:[(0,p.jsx)("div",{className:"ponc_label",children:null===(m=O.activity)||void 0===m?void 0:m.label}),(0,p.jsx)("div",{className:"ponc_group bc_flex bc_flex_justify_f_end bc_flex_items_center",children:(0,p.jsx)(C.i,{isChecked:H,onClick:w})})]}),M&&H&&(0,p.jsx)("div",{className:"ponc_email_wrp bc_flex",children:(0,p.jsx)(N.E,{className:"ponc_email",html:__(M),tagName:"div"})}),B&&(0,p.jsx)("div",{className:"ponc_error_wrp bc_flex",children:(0,p.jsx)(N.E,{className:"ponc_error",html:__(B,T),tagName:"div"})})]})}),(0,b.j)(R)&&(0,p.jsxs)("div",{className:"ponc_row bc_flex bc_flex_justify_s_between bc_flex_items_center",children:[(0,p.jsx)("div",{className:"ponc_label",children:null===(h=R.activity)||void 0===h?void 0:h.label}),(0,p.jsx)(C.i,{isChecked:F,onClick:P})]})]})]})}),k=(0,o.memo)(function(e){var n=e.data,i=e.onCloseClick,t=e.onSubscriptionChangeEmail,o=e.onSubscriptionChangePush;return(0,p.jsx)(m.A3,{onClose:i,children:(0,p.jsx)(E,{data:n,onSubscriptionChangeEmail:t,onSubscriptionChangePush:o})})}),w=(0,o.memo)(function(e){var n,i,o,s=!(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.isPopoverOpen)&&!(null===(i=e.data.popoverContent)||void 0===i?void 0:i.emailNotification)&&!(null===(o=e.data.popoverContent)||void 0===o?void 0:o.siteNotification);return(0,p.jsx)(h.T,{isAvailable:!s,children:(0,p.jsx)(k,(0,t.Cl)({},e))})})}}]);