b1678ab4bb6d60c74bd6230950ad009815a94f8b540161991ade8002ed26aed4

Source Code:

(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{"0888":function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return i}));var n=r("089a"),o=(r("3414"),function(e,t,r){return(r%1==0?r:Math.ceil(r))>1?t:e}),a=function(e){if(e<30)return Object(n.a)("Now");if(e>=30&&e<60)return Object(n.a)("{difference} seconds ago",{difference:30});if(e>=60&&e<3600){var t=Math.round(e/60);return Object(n.a)(o("{difference} minute ago","{difference} minutes ago",t),{difference:t})}if(e>=3600&&e<86400){var r=Math.round(e/60/60);return Object(n.a)(o("{difference} hour ago","{difference} hours ago",r),{difference:r})}if(e>=86400&&e<2592e3){var a=Math.round(e/60/60/24);return Object(n.a)(o("{difference} day ago","{difference} days ago",a),{difference:a})}if(e>=2592e3&&e<31104e3){var i=Math.round(e/60/60/24/30);return Object(n.a)(o("{difference} month ago","{difference} months ago",i),{difference:i})}if(e>=31104e3){var c=Math.round(e/60/60/24/30/12);return Object(n.a)(o("{difference} year ago","{difference} years ago",c),{difference:c})}},i=function(e){var t=Math.floor(e/60),r=Math.floor(e%60);return"number"!=typeof t&&(t=0),"number"!=typeof r&&(r=0),(t<10?"0":"")+t+":"+(r<10?"0":"")+r}},"0aa8":function(e,t,r){e.exports={item:"_2dBx6pn0ArGf",bar:"_2v0JEFP1suUZ",active:"kgbZvCjsMAk3",complete:"_1b9qlheYr7Gz",premium:"wDWd6tqND-Cg"}},"17ae":function(e,t,r){e.exports={content:"_30SX-4OZBEkX",premium:"_8S79KxJW2RLD _30SX-4OZBEkX",premiumTitle:"_2LDs5KNJ-inc",subscribeBtn:"_2-49A4xrDTNo",price:"_2AJErcxg4TeS",info:"_35LkC8ZWulFx",wrapper:"hjKsithLEzc1",paused:"_1tjE2GWsQFFQ",tooltip:"_1c_Vp2inQwXR",tooltipDenied:"_1FMp3mHjS1gf _1c_Vp2inQwXR",alertIcon:"_3R5Au-2XWI-l",transactionFailedHeader:"ByfiXZR_i4Kv",transactionFailedMessage:"_3f4PaoZ5IfjF"}},2140:function(e,t,r){"use strict";var n=r("8af1"),o=r.n(n),a=r("8a2d"),i=r.n(a),c=r("e8c5"),s=r.n(c),u=function(e){var t=e.onClick,r=void 0===t?function(){}:t;return(o.a.createElement("button",{className:s.a["close-button"],role:"button",onClick:r}))},l=r("b912"),p=r.n(l),f=r("608a"),d=r.n(f),m=r("089a"),y=r("b897");function b(e){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function g(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,r){return t&&g(e.prototype,t),r&&g(e,r),e}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=P(e);if(t){var o=P(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return O(this,r)}}function O(e,t){return!t||"object"!==b(t)&&"function"!=typeof t?j(e):t}function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var w=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(r,e);var t=S(r);function r(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(e=t.call(this)).onMouseEnter=e.onMouseEnter.bind(j(e)),e.onMouseLeave=e.onMouseLeave.bind(j(e)),e.handleDocumentClick=e.handleDocumentClick.bind(j(e)),e.containerRef=o.a.createRef(),e}return h(r,null,[{key:"defaultProps",get:function(){return{errorMessage:Object(m.a)("An error occurred, try again."),useIcon:!0}}},{key:"propTypes",get:function(){return{errorMessage:i.a.string,onDismiss:i.a.func,className:i.a.string,timeout:i.a.number,useIcon:i.a.bool}}}]),h(r,[{key:"componentDidMount",value:function(){this.startTimeout(),document.addEventListener("click",this.handleDocumentClick)}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeoutID),document.removeEventListener("click",this.handleDocumentClick)}},{key:"componentDidUpdate",value:function(){this.startTimeout()}},{key:"handleDocumentClick",value:function(e){this.containerRef.current.contains(e.target)||this.props.onDismiss()}},{key:"startTimeout",value:function(){clearTimeout(this.timeoutID),this.props.timeout&&(this.timeoutID=setTimeout(this.props.onDismiss,this.props.timeout))}},{key:"onMouseEnter",value:function(){clearTimeout(this.timeoutID)}},{key:"onMouseLeave",value:function(){this.startTimeout()}},{key:"render",value:function(){return o.a.createElement("div",{ref:this.containerRef,className:p()(d.a["error-tooltip"],this.props.className),onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},this.props.onDismiss&&o.a.createElement(u,{onClick:this.props.onDismiss,"data-testid":"ErrorTooltipCloseButton"}),this.props.useIcon&&o.a.createElement(y.a,{icon:"alert",className:d.a.icon,"data-testid":"ErrorTooltipIcon"}),o.a.createElement("div",{className:d.a.message,dangerouslySetInnerHTML:{__html:this.props.errorMessage}}),o.a.createElement("div",{className:d.a.content},this.props.children))}}]),r}(o.a.PureComponent);t.a=w},"21eb":function(e,t,r){e.exports={warningTooltip:"_2ALk7I7BfP8-"}},"608a":function(e,t,r){e.exports={"error-tooltip":"_1IQHlR_YzBw0",message:"_2ZjfRWvJKLYm",content:"_3Pce-lrLr_oo",icon:"_2cUgVNOf6Fa1"}},c585:function(e,t,r){"use strict";r.r(t);var n=r("8af1"),o=r.n(n),a=r("8a2d"),i=r.n(a),c=r("0a81"),s=r("0b3c"),u=r("78be"),l=r("0e57"),p=s.d.a.withConfig({displayName:"MyStoryStyledes6__Button",componentId:"sc-1slmsm6-0"})(["position:absolute;top:50%;font-size:30px;color:#ffffff;"]),f=Object(s.d)(p).withConfig({displayName:"MyStoryStyledes6__Arrow",componentId:"sc-1slmsm6-1"})(["opacity:0;height:100%;top:0;display:flex;align-items:center;transition:opacity 0.3s;user-select:none;"]),d=Object(s.d)(f).withConfig({displayName:"MyStoryStyledes6__LeftArrow",componentId:"sc-1slmsm6-2"})(["left:-50px;padding-right:20px;"]),m=Object(s.d)(f).withConfig({displayName:"MyStoryStyledes6__RightArrow",componentId:"sc-1slmsm6-3"})(["right:-50px;padding-left:20px;"]),y=s.d.div.withConfig({displayName:"MyStoryStyledes6__Wrapper",componentId:"sc-1slmsm6-4"})(["background:#000000;height:100%;color:#ffffff;min-height:100%;position:relative;&:after{opacity:",";content:'';width:100%;height:100%;position:absolute;top:0;left:0;box-shadow:0 0 50px -5px #f98706;transition:all 0.6s cubic-bezier(0.165,0.84,0.44,1);z-index:1;}&:hover{",",","{opacity:1;}}"],(function(e){return e.isItemPremium?1:0}),d,m),b=s.d.div.withConfig({displayName:"MyStoryStyledes6__ProgressBarWrapper",componentId:"sc-1slmsm6-5"})(["display:flex;width:calc(100% - 20px);height:10px;position:relative;z-index:100;overflow:hidden;margin:10px auto 0;"]),g=Object(s.d)(u.a).withConfig({displayName:"MyStoryStyledes6__StyledOverlay",componentId:"sc-1slmsm6-6"})(["justify-content:start;padding-top:40px;> div{height:100%;margin-bottom:90px;}"]),h=Object(s.d)(l.a).withConfig({displayName:"MyStoryStyledes6__StyledLoader",componentId:"sc-1slmsm6-7"})(["top:0;"]),v=r("0592"),S=r("0aa8"),O=r.n(S),j=r("b912"),P=r.n(j);function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function E(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I(e,t){return(I=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function M(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_(e);if(t){var o=_(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return C(this,r)}}function C(e,t){return!t||"object"!==w(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function x(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&I(e,t)}(i,e);var t,r,n,a=M(i);function i(){return k(this,i),a.apply(this,arguments)}return t=i,(r=[{key:"render",value:function(){var e,t,r=this.props,n=r.isActive,a=r.isPremium,i=r.isComplete,c=r.percentage,s=P()((x(e={},O.a.item,!0),x(e,O.a.active,n),x(e,O.a.premium,a),x(e,O.a.complete,i),e)),u=P()((x(t={},O.a.bar,!0),x(t,O.a.active,n),t));return o.a.createElement("div",{className:s},n&&o.a.createElement("div",{className:u,style:{width:"".concat(c,"%")}}),i&&o.a.createElement("div",{className:O.a.bar}))}}])&&E(t.prototype,r),n&&E(t,n),i}(n.PureComponent);x(N,"defaultProps",{isActive:!1,isPremium:!1,isComplete:!1,percentage:0}),x(N,"propTypes",{isActive:a.bool,isPremium:a.bool,isComplete:a.bool,percentage:a.number});var R=r("dd3c"),B=r.n(R),T=r("0888"),D=s.d.div.withConfig({displayName:"MyStoryPerformerDetailses6__Header",componentId:"sc-1ak8a2s-0"})(["display:flex;position:relative;justify-content:flex-start;align-items:center;z-index:4;"]),A=s.d.img.withConfig({displayName:"MyStoryPerformerDetailses6__Picture",componentId:"sc-1ak8a2s-1"})(["width:30px;height:30px;border-radius:45px;margin:0 0 0 10px;"]),U=s.d.span.withConfig({displayName:"MyStoryPerformerDetailses6__Name",componentId:"sc-1ak8a2s-2"})(["font-size:14px;color:#fff;margin-left:5px;margin-right:5px;"]),L=s.d.span.withConfig({displayName:"MyStoryPerformerDetailses6__TimeAgo",componentId:"sc-1ak8a2s-3"})(["font-size:14px;color:#ffcccc;"]),q=o.a.memo((function(e){var t,r,n=e.profilePictureUrl,a=e.postedAt,i=Object(c.e)((function(e){return e.stories.displayName}));return o.a.createElement(D,{"data-testid":"MyStoryPerformerDetailsHeader"},o.a.createElement(A,{src:n,alt:"".concat(i,"'s profile picture"),"data-testid":"MyStoryPerformerDetailsPicture"}),o.a.createElement(U,{"data-testid":"MyStoryPerformerDetailsName"},i),o.a.createElement(L,{"data-testid":"MyStoryPerformerDetailsTimeAgo"},(t=Math.floor(Date.now()/1e3),r=B()(a)/1e3,Object(T.b)(t-r))))}));q.propTypes={profilePictureUrl:i.a.string.isRequired,postedAt:i.a.string.isRequired};var W=q,F=r("e6c0"),z=r("fbc6");function K(e){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Q(){return(Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function H(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function V(e,t){return(V=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function J(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Y(e);if(t){var o=Y(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return X(this,r)}}function X(e,t){return!t||"object"!==K(t)&&"function"!=typeof t?Z(e):t}function Z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y(e){return(Y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function $(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ee=function(e){var t,r;return r=t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&V(e,t)}(c,t);var r,n,a,i=J(c);function c(){var e;G(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return $(Z(e=i.call.apply(i,[this].concat(r))),"state",{paused:!1,percentage:0}),$(Z(e),"ticker",null),$(Z(e),"timePassed",null),$(Z(e),"unmounted",!1),$(Z(e),"startTicker",(function(){clearInterval(e.ticker),e.ticker=setInterval(e.updatePercentage,e.props.interval)})),$(Z(e),"updatePercentage",(function(){if(!e.unmounted&&!e.state.paused){var t=e.props,r=t.interval,n=t.onPercentageUpdate,o=t.duration;e.timePassed+=r;var a=e.timePassed/o*100;e.setState({percentage:a},(function(){n(e.state.percentage),a>=100&&clearInterval(e.ticker)}))}})),$(Z(e),"startProgression",(function(){e.props.onPercentageUpdate(0),e.setState({loaded:!0,paused:!1,percentage:0},(function(){e.startTicker()}))})),$(Z(e),"pauseProgression",(function(){e.setState({paused:!0})})),$(Z(e),"playProgression",(function(){e.setState({paused:!1})})),$(Z(e),"resetProgression",(function(){e.setState({percentage:0,paused:!0}),e.props.onPercentageUpdate(0),e.timePassed=null})),e}return r=c,(n=[{key:"componentDidUpdate",value:function(e){var t=this;e.itemId!==this.props.itemId&&this.setState({percentage:0},(function(){t.timePassed=null,t.startTicker()}))}},{key:"componentWillUnmount",value:function(){this.unmounted=!0,clearInterval(this.ticker)}},{key:"render",value:function(){return o.a.createElement(e,Q({},this.props,{startProgression:this.startProgression,pauseProgression:this.pauseProgression,playProgression:this.playProgression,resetProgression:this.resetProgression,"data-testid":"WithProgressionWrappedComponent"}))}}])&&H(r.prototype,n),a&&H(r,a),c}(o.a.Component),$(t,"defaultProps",{interval:100,duration:6e3,onPercentageUpdate:function(){}}),r},te=r("d8e5"),re=r("17ae"),ne=r.n(re),oe=r("9ced"),ae=r("089a"),ie=r("4a85"),ce=r("dace"),se=r("a9a1"),ue=r("06af"),le=r("6313"),pe=r("3629"),fe=r("cf69"),de=r("1cab"),me=r("d869"),ye=r.n(me);function be(e){return(be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ve(e,t){return(ve=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pe(e);if(t){var o=Pe(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return Oe(this,r)}}function Oe(e,t){return!t||"object"!==be(t)&&"function"!=typeof t?je(e):t}function je(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pe(e){return(Pe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ke=ye.a.QuickBuyPurchaseStatusCheckerModel.STATUS_ERROR,Ee=ye.a.QuickBuyPurchaseStatusCheckerModel.REASON_TECHNICAL_ERROR,Ie=function(e){v.default.navigate("payment",{trigger:!0,replace:!1,preventNavigateBack:!1})},Me=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ve(e,t)}(i,e);var t,r,n,a=Se(i);function i(){var e;ge(this,i);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return we(je(e=a.call.apply(a,[this].concat(r))),"state",{loading:!1,error:!1,isPopoverOpened:!1}),we(je(e),"routeManagerOptions",{trigger:!0,preventNavigateBack:!1}),we(je(e),"subscribeButtonId","myStorySubscribe"),we(je(e),"unlockContentWithQuickBuy",(function(){se.store.dispatch(Object(ue.purchaseErrorReset)()),e.setState({loading:!0},(function(){e.props.subscribeWithQuickBuy({performerNick:e.props.performerNick})}))})),we(je(e),"subscribeToStory",(function(t){e.setState({loading:!0,isPopoverOpened:!1}),de.default.trackGenericEvent({eventCategory:de.default.CONST.PAGE.MY_STORY,eventAction:de.default.CONST.ACTION.CLICK,eventLabel:"subscribe"}),Object(le.d)(e.props.performerNick).then((function(t){t.success&&e.props.getStories(e.props.performerNick)})).catch((function(t){var r;t.response?r=t.response:t.request?r=503:(r=500,console.error("Error",t.message)),e.setState({loading:!1,error:r,isPopoverOpened:!0})}))})),e}return t=i,(r=[{key:"componentDidMount",value:function(){this.props.startProgression()}},{key:"componentDidUpdate",value:function(e){this.props.purchaseUi.polling&&this.props.purchaseUi.polling!==e.purchaseUi.polling&&this.setState({isPopoverOpened:!1}),"statusDenied"===this.props.purchaseUi.response.purchaseStatus&&this.props.purchaseUi.response.initiator===pe.a&&this.props.purchaseUi.response.success!==e.purchaseUi.response.success&&this.setState({error:{status:"statusDenied"},loading:!1,isPopoverOpened:!0}),this.props.purchaseUi.response.purchaseStatus===ke&&this.props.purchaseUi.response.initiator===pe.a&&this.props.purchaseUi.response.reason===Ee&&this.props.purchaseUi.response.success!==e.purchaseUi.response.success&&this.setState({error:{status:ke},loading:!1,isPopoverOpened:!0}),this.state.isPopoverOpened||this.props.purchaseUi.polling||this.state.loading?this.props.pauseProgression():this.props.playProgression(),this.props.active!==e.active&&(this.props.resetProgression(),this.props.active&&this.props.startProgression())}},{key:"renderTooltipByResponseStatus",value:function(){var e=this;switch(this.state.error.status){case 403:var t="veryQuickBuy"===this.state.error.data.checkpointName,r="buyCredits"===this.state.error.data.checkpointName;if(t)return o.a.createElement("div",{className:ne.a.tooltip},o.a.createElement("div",{className:ne.a["msg-title"]},Object(ae.a)("You need to buy {priceInCredits} credits to subscribe to this performer.",{priceInCredits:this.state.error.data.creditPrice.amount})),o.a.createElement(oe.a,{disabled:!1,onClick:this.unlockContentWithQuickBuy,"data-testid":"MyStoryPremiumLockedButton"},Object(ae.a)("Buy and subscribe")),o.a.createElement("p",{className:ne.a["msg-footer"]},this.state.error.data.realCurrencyPrice.currency," ",this.state.error.data.realCurrencyPrice.amount));if(r)return o.a.createElement("div",{className:ne.a.tooltip},o.a.createElement("div",null,Object(ae.a)("You don't have enough credits to subscribe to this performer.")),o.a.createElement(oe.a,{onClick:Ie,"data-testid":"MyStoryPremiumLockedButton"},Object(ae.a)("Buy Credits")));case 401:return o.a.createElement("div",{className:ne.a.tooltip},o.a.createElement("div",null,Object(ae.a)("Become a Premium Member to subscribe to this performer.")),o.a.createElement(oe.a,{onClick:function(t){return r=t,n=e.routeManagerOptions,r.stopPropagation(),void v.default.navigate("signup",n);var r,n},"data-testid":"MyStoryPremiumLockedButton"},Object(ae.a)("Sign up")),o.a.createElement("a",{href:"#",onClick:function(t){return r=t,n=e.routeManagerOptions,r.stopPropagation(),r.preventDefault(),void v.default.navigate("login",n);var r,n}},Object(ae.a)("or log in")));case 404:case 503:case 500:return o.a.createElement("div",{className:ne.a.tooltip},o.a.createElement("p",null,Object(ae.a)("Currently not available, please try again later.")));case"statusDenied":return o.a.createElement("div",{className:ne.a.tooltipDenied},o.a.createElement(F.a,{className:ne.a.alertIcon,icon:"alert","data-testid":"MyStoryPremiumLockedIcon"}),o.a.createElement("div",{className:ne.a.transactionFailedHeader},Object(ae.a)("Transaction failed")),o.a.createElement("p",{className:ne.a.transactionFailedMessage},Object(ae.a)("Transaction declined by the bank.")),o.a.createElement(fe.a,{href:Object(te.a)("Credit/PaymentOptions"),"data-testid":"MyStoryPremiumLockedAnchorButton"},Object(ae.a)("Try another payment method")));case ke:return o.a.createElement("div",{className:ne.a.tooltipDenied},o.a.createElement(F.a,{className:ne.a.alertIcon,icon:"alert","data-testid":"MyStoryPremiumLockedIcon"}),o.a.createElement("div",{className:ne.a.transactionFailedHeader},Object(ae.a)("Transaction failed")),o.a.createElement("p",{className:ne.a.transactionFailedMessage},Object(ae.a)("Currently not available, please try again later.")))}}},{key:"handleInteraction",value:function(e){this.setState({isPopoverOpened:e})}},{key:"render",value:function(){var e=this,t=this.props,r=t.pauseProgression,n=t.playProgression,a=t.src,i=this.props.stories.price;return o.a.createElement("article",{className:ne.a.wrapper,onMouseDown:r,onMouseUp:n},o.a.createElement("div",{className:ne.a.premium,style:{backgroundImage:"url(".concat(a,")")}},o.a.createElement("div",{className:ne.a.premiumTitle},Object(ae.a)("Don't miss my hottest content!")),o.a.createElement(ie.a,{content:this.renderTooltipByResponseStatus(),interactionKind:ie.b.CLICK,isOpen:this.state.isPopoverOpened,onInteraction:function(t){return e.handleInteraction(t)},position:ce.a.BOTTOM,target:o.a.createElement(oe.a,{id:this.subscribeButtonId,className:ne.a.subscribeBtn,loading:this.state.loading,onClick:this.subscribeToStory,"data-testid":"MyStoryPremiumLockedButton"},Object(ae.a)("Unlock now")),"data-testid":"MyStoryPremiumLockedPopover"}),o.a.createElement("div",{className:ne.a.price},i," ",Object(ae.a)("credits")),o.a.createElement("div",{className:ne.a.info},Object(ae.a)("One week access"))))}}])&&he(t.prototype,r),n&&he(t,n),i}(o.a.PureComponent);we(Me,"defaultProps",{price:3,startProgression:function(){}}),we(Me,"propTypes",{src:a.string.isRequired,performerNick:a.string.isRequired,startProgression:a.func});var Ce=ee(Me);function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ne=function(e,t){return e.stories.items.filter((function(e){return e.id===t}))[0]||null},Re=function(e,t){var r=e.stories;if(!t)return r;var n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(Object(r),!0).forEach((function(t){xe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},r),o=n.items.filter((function(e){return e.id===t}));return o&&(n.items=o),n},Be=r("8270"),Te=r("2140"),De=r("791c"),Ae=function(){v.default.navigate("payment",{trigger:!0,preventNavigateBack:!1})},Ue=function(){v.default.navigate("signup",{trigger:!0,preventNavigateBack:!1})},Le=function(){v.default.navigate("login",{trigger:!0,preventNavigateBack:!1})},qe=function(e){return 0!==e.trim().length},We=r("b897"),Fe=s.d.div.withConfig({displayName:"styledes6__Form",componentId:"sc-18w3qc9-0"})(["position:absolute;bottom:20px;left:20px;right:20px;z-index:2;display:flex;background-color:rgba(0,0,0,0.2);border:1px solid rgba(153,153,153,0.2);border-radius:5px;&.focused{background-color:rgba(0,0,0,0.4);}"]),ze=s.d.input.withConfig({displayName:"styledes6__Input",componentId:"sc-18w3qc9-1"})(["height:40px;margin:0;background:none;color:rgba(255,255,255,0.5);border:none;font-size:14px;padding:11px 15px;box-sizing:border-box;overflow:hidden;flex:1;&:focus{color:#fff;}&::placeholder{color:rgba(255,255,255,0.5);}&:-ms-input-placeholder{color:rgba(255,255,255,0.5);}&::-ms-input-placeholder{color:rgba(255,255,255,0.5);}"]),Ke=s.d.div.withConfig({displayName:"styledes6__ButtonContainer",componentId:"sc-18w3qc9-2"})(["height:40px;padding:10px;box-sizing:border-box;"]),Qe=s.d.button.withConfig({displayName:"styledes6__SendButton",componentId:"sc-18w3qc9-3"})(["padding:0;margin:0 6px 0 0;border:0;background:none;cursor:pointer;color:#fff;font-weight:bold;line-height:19px;&:disabled{opacity:0.4;cursor:default;}"]),Ge=Object(s.d)(oe.a).withConfig({displayName:"styledes6__WarningButton",componentId:"sc-18w3qc9-4"})(["margin:10px 0;"]),He=s.d.a.withConfig({displayName:"styledes6__LoginButton",componentId:"sc-18w3qc9-5"})(["font-size:12px;"]),Ve=s.d.div.withConfig({displayName:"styledes6__GuestTooltipButtonContainer",componentId:"sc-18w3qc9-6"})(["display:flex;flex-direction:column;align-items:center;"]),Je=Object(s.d)(Be.a).withConfig({displayName:"styledes6__Loading",componentId:"sc-18w3qc9-7"})(["width:14px;height:14px;top:0;border-width:3px;margin-right:6px;"]),Xe=Object(s.d)(We.a).withConfig({displayName:"styledes6__SuccessIcon",componentId:"sc-18w3qc9-8"})(["font-size:20px;color:#a2db00;margin-right:6px;"]),Ze=Object(s.d)(We.a).withConfig({displayName:"styledes6__ErrorIcon",componentId:"sc-18w3qc9-9"})(["font-size:20px;color:#da0000;margin-right:6px;"]),Ye=s.d.div.withConfig({displayName:"styledes6__Mask",componentId:"sc-18w3qc9-10"})(["background:rgba(0,0,0,0.5);height:100%;width:100%;position:absolute;top:0;z-index:2;"]),$e=r("be52"),et=r("21eb"),tt=r.n(et);function rt(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(e){return void r(e)}c.done?t(s):Promise.resolve(s).then(n,o)}function nt(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){rt(a,n,o,i,c,"next",e)}function c(e){rt(a,n,o,i,c,"throw",e)}i(void 0)}))}}function ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return at(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return at(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function at(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var it=null,ct=function(e){var t=e.reactionPrice,r=e.storyId,a=e.ownerName,i=e.maxMessageLength,c=e.onBlur,s=e.onFocus,u=e.isLoggedIn,l=e.balances,p=ot(Object($e.a)("draftStory".concat(r),!1),2),f=p[0],d=p[1],m=ot(Object(n.useState)((function(){return f||""})),2),y=m[0],b=m[1],g=ot(Object(n.useState)(!1),2),h=g[0],v=g[1],S=ot(Object(n.useState)(null),2),O=S[0],j=S[1],P=ot(Object(n.useState)(!1),2),w=P[0],k=P[1],E=ot(Object(n.useState)(!1),2),I=E[0],M=E[1],C=ot(Object(n.useState)(!1),2),_=C[0],x=C[1],N=l.freeMessage,R=Object(n.useRef)(null),B=Object(n.useCallback)((function(){h||_||I||(c(y),k(!1))}),[h,_,I,c,y]),T=Object(n.useCallback)((function(){it=setTimeout((function(){c(),B(),j(null)}),2e3)}),[c,B]),D=Object(n.useCallback)((function(){k(!0),s(),R.current.focus()}),[s]),A=Object(n.useCallback)(nt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=2;break}return e.abrupt("return");case 2:if(u){e.next=6;break}return D(),M(!0),e.abrupt("return");case 6:if(qe(y)){e.next=8;break}return e.abrupt("return");case 8:return v(!0),D(),e.prev=10,e.next=13,Object(le.c)({message:y.trim(),storyId:r,ownerName:a});case 13:R.current.blur(),b(""),j(!0),Object($e.b)("draftStory".concat(r)),T(),e.next=34;break;case 20:if(e.prev=20,e.t0=e.catch(10),!e.t0.response){e.next=34;break}D(),e.t1=e.t0.response.status,e.next=401===e.t1?27:403===e.t1?29:31;break;case 27:return M(!0),e.abrupt("break",34);case 29:return x(!0),e.abrupt("break",34);case 31:return j(!1),T(),e.abrupt("break",34);case 34:return e.prev=34,v(!1),e.finish(34);case 37:case"end":return e.stop()}}),e,null,[[10,20,34,37]])}))),[D,h,u,a,T,r,y]),U=Object(n.useCallback)(nt(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:it&&(j(null),clearTimeout(it)),s(y),k(!0);case 3:case"end":return e.stop()}}),e)}))),[y,s]),L=Object(n.useCallback)((function(e){h||(b(e.target.value),d(e.target.value))}),[h,d]),q=Object(n.useCallback)((function(){A()}),[A]),W=Object(n.useCallback)((function(e){13===e.keyCode&&A()}),[A]),F=Object(n.useCallback)((function(){M(!1),D()}),[D]),z=Object(n.useCallback)((function(){x(!1),D()}),[D]);return o.a.createElement(o.a.Fragment,null,w&&o.a.createElement(Ye,{"data-testid":"StoryReplyMask"}),o.a.createElement(Fe,{className:w?"focused":"","data-testid":"StoryReplyForm"},o.a.createElement(Mt.Consumer,{"data-testid":"StoryReplyConsumer"},(function(e){var r=e.toggleStoryNavigation;return(o.a.createElement(ze,{ref:R,type:"text",value:y,maxLength:i,onFocus:function(){U(),r()},onBlur:function(){B(),r()},onChange:L,onKeyDown:W,placeholder:N>0?Object(ae.a)("Send a Free Message - {amount} left",{amount:N}):t>0?Object(ae.a)("Send a message for {price} credits",{price:t}):"","data-testid":"StoryReplyInput"}))})),I&&o.a.createElement(Te.a,{className:tt.a.warningTooltip,timeout:0,useIcon:!1,errorMessage:Object(ae.a)("Join now for Free!"),onDismiss:F,"data-testid":"StoryReplyErrorTooltip"},o.a.createElement(Ve,{"data-testid":"StoryReplyGuestTooltipButtonContainer"},o.a.createElement(Ge,{small:!0,onClick:Ue,"data-testid":"StoryReplyWarningButton"},o.a.createElement(De.a,null,"Sign up")),o.a.createElement(He,{onClick:Le,"data-testid":"StoryReplyLoginButton"},o.a.createElement(De.a,null,"or log in")))),_&&o.a.createElement(Te.a,{className:tt.a.warningTooltip,timeout:0,useIcon:!1,errorMessage:Object(ae.a)("You don't have enough credit to send a message!"),onDismiss:z,"data-testid":"StoryReplyErrorTooltip"},o.a.createElement(Ge,{small:!0,onClick:Ae,"data-testid":"StoryReplyWarningButton"},o.a.createElement(De.a,null,"Buy credits"))),o.a.createElement(Ke,{"data-testid":"StoryReplyButtonContainer"},h?o.a.createElement(Je,{"data-testid":"StoryReplyLoading"}):!0===O?o.a.createElement(Xe,{icon:"check","data-testid":"StoryReplySuccessIcon"}):!1===O?o.a.createElement(Ze,{icon:"close","data-testid":"StoryReplyErrorIcon"}):o.a.createElement(Qe,{onClick:q,disabled:!qe(y),"data-testid":"StoryReplySendButton"},o.a.createElement(De.a,null,"Send")))))};ct.propTypes={ownerName:a.string.isRequired,storyId:a.number.isRequired,isLoggedIn:a.bool.isRequired,reactionPrice:a.number,maxMessageLength:a.number,balances:Object(a.shape)({freePeeks:a.number,freeMessage:a.number,freeVideoCallSecond:a.number}).isRequired,onBlur:a.func,onFocus:a.func},ct.defaultProps={onBlur:function(){},onFocus:function(){},maxMessageLength:250,reactionPrice:0};var st=Object(c.c)((function(e){var t=e.stories,r=t.ownerName,n=t.reactionPrice,o=e.user._user,a=o.type,i=o.balances;return{ownerName:r,reactionPrice:n,isLoggedIn:a!==ye.a.User.GUEST,balances:i}}))(ct);function ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return lt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var pt=Object(s.d)(Be.a).withConfig({displayName:"MyStoryImageItemes6__StyledLoader",componentId:"sc-9be4me-0"})(["position:absolute;top:calc(50% - 19px);left:calc(50% - 19px);"]),ft=function(e){var t=e.src,r=e.startProgression,a=e.resetProgression,i=e.playProgression,c=e.pauseProgression,s=e.itemId,u=e.active,l=ut(Object(n.useState)(!1),2),p=l[0],f=l[1];return Object(n.useEffect)((function(){var e=new Image;e.src=t,e.onload=function(){f(!0)}}),[]),Object(n.useEffect)((function(){p&&u&&r()}),[p,u]),Object(n.useEffect)((function(){p&&!u&&a()}),[u]),p?o.a.createElement("article",{className:ne.a.wrapper,onContextMenu:function(e){return e.preventDefault()}},o.a.createElement("div",{className:ne.a.content,style:{backgroundImage:"url(".concat(t,")")},onMouseDown:c,onMouseUp:i}),o.a.createElement(st,{storyId:s,onFocus:c,onBlur:i,"data-testid":"MyStoryImageItemStoryReply"})):o.a.createElement(pt,{"data-testid":"MyStoryImageItemStyledLoader"})};ft.propTypes={itemId:a.number.isRequired,src:a.string.isRequired,startProgression:a.func,pauseProgression:a.func,playProgression:a.func},ft.defaultProps={startProgression:function(){},playProgression:function(){},pauseProgression:function(){}};var dt=ee(Object(c.c)((function(e,t){var r=t.itemId;return{src:Ne(e,r).media[0].contentUrl}}))(ft)),mt=r("dc64"),yt=r.n(mt);function bt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return gt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ht=s.d.div.withConfig({displayName:"MyStoryVideoItemes6__StyledLoaderWrapper",componentId:"as0vvj-0"})(["position:absolute;top:50%;margin:0 auto;width:100%;text-align:center;margin-top:-25px;"]),vt=function(e){var t=e.src,r=e.itemId,a=e.onPercentageUpdate,i=e.playing,c=bt(Object(n.useState)(!1),2),s=c[0],u=c[1],p=bt(Object(n.useState)(i),2),f=p[0],d=p[1],m=Object(n.useRef)(0),y=Object(n.useRef)(null);Object(n.useEffect)((function(){d(i),i||y.current.seekTo(0)}),[i]);var b=Object(n.useCallback)((function(){return d(!1)}),[d]),g=Object(n.useCallback)((function(){return d(!0)}),[d]);return o.a.createElement(o.a.Fragment,null,o.a.createElement("article",{onMouseDown:b,onMouseUp:g,className:ne.a.wrapper,onContextMenu:function(e){e.preventDefault()}},!s&&i&&o.a.createElement(ht,{"data-testid":"MyStoryVideoItemStyledLoaderWrapper"},o.a.createElement(l.a,{"data-testid":"MyStoryVideoItemLoader"})),o.a.createElement(yt.a,{ref:y,width:"100%",height:"100%",url:t,onReady:function(){return u(!0)},playing:f,onProgress:function(e){var t=e.playedSeconds;f&&i&&a(t/m.current*100)},onDuration:function(e){return m.current=e},progressInterval:100,"data-testid":"MyStoryVideoItemFilePlayer"}),!f&&o.a.createElement("div",{className:ne.a.paused},Object(ae.a)("paused"))),o.a.createElement(st,{storyId:r,onFocus:b,onBlur:g,"data-testid":"MyStoryVideoItemStoryReply"}))};vt.propTypes={itemId:a.number.isRequired,src:a.string.isRequired,onProgress:a.func,onPercentageUpdate:a.func},vt.defaultProps={onProgress:function(){},onPercentageUpdate:function(){}};var St=Object(c.c)((function(e,t){var r=t.itemId,n=Ne(e,r),o=e.stories.isSubscribed;return{src:("premium"===n.privacy&&!o?n.media:n.media.filter((function(e){return"1080_mp4"===e.mediaKey})))[0].contentUrl}}))(vt),Ot=s.d.div.withConfig({displayName:"MyStoryItemes6__Wrapper",componentId:"hao0bo-0"})(["position:absolute;height:100%;width:100%;top:0;z-index:",";opacity:",";"],(function(e){return e.active?3:1}),(function(e){return e.active?1:0})),jt=function(e){var t=e.showPremiumWithDelay,r=e.item,n=e.performerNick,a=e.onPercentageUpdate,i=e.stories,c=e.purchaseUi,s=e.getStories,u=e.subscribeWithQuickBuy,l=e.active;return(o.a.createElement(Ot,{active:l,"data-active":l,"data-testid":"MyStoryItemWrapper"},t?o.a.createElement(Ce,{src:r.media[0].contentUrl,active:l,itemId:r.id,duration:15e3,performerNick:n,onPercentageUpdate:a,stories:i,purchaseUi:c,getStories:s,subscribeWithQuickBuy:u,"data-testid":"MyStoryItemMyStoryPremiumLockedWithProgression"}):o.a.createElement(o.a.Fragment,null,"image"===r.type&&o.a.createElement(dt,{active:l,itemId:r.id,onPercentageUpdate:a,"data-testid":"MyStoryItemMyStoryImageItemWithProgression"}),"video"===r.type&&o.a.createElement(St,{itemId:r.id,playing:l,onPercentageUpdate:a,"data-testid":"MyStoryItemMyStoryVideoItem"}))))};function Pt(){return(Pt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function wt(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var kt=function(e){var t=e.prevItem,r=e.nextItem,n=e.activeItem,a=wt(e,["prevItem","nextItem","activeItem"]);return(o.a.createElement(o.a.Fragment,null,t&&o.a.createElement(jt,Pt({key:"story_".concat(t.id),item:t,active:!1},a,{"data-testid":"MyStoryTrioGroupMyStoryItem"})),o.a.createElement(jt,Pt({key:"story_".concat(n.id),item:n,active:!0},a,{"data-testid":"MyStoryTrioGroupMyStoryItem"})),r&&o.a.createElement(jt,Pt({key:"story_".concat(r.id),item:r,active:!1},a,{"data-testid":"MyStoryTrioGroupMyStoryItem"}))))};function Et(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return It(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return It(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Mt=o.a.createContext({isPlaying:!0,toggleStoryNavigation:function(){}}),Ct=function(e){var t=e.performerNick,r=e.isSubscribed,a=e.stories,i=e.purchaseUi,s=e.profilePictureUrl,u=e.endCallback,l=e.getStories,p=e.subscribeWithQuickBuy,f=Et(Object(n.useState)(!0),2),g=f[0],h=f[1],v=Et(Object(n.useState)((function(){return(window.innerHeight-90)*(9/16)})),2),S=v[0],O=v[1],j=Et(Object(n.useState)(0),2),P=j[0],w=j[1],k=Et(Object(n.useState)(0),2),E=k[0],I=k[1],M=Et(Object(n.useState)({}),2),C=M[0],_=M[1],x=Object(c.d)(),R=Object(c.e)((function(e){return e.stories.reactionPrice})),B=Object(n.useRef)(null),T=a.items[P],D=0!==P?a.items[P-1]:null,A=P!==a.items.length?a.items[P+1]:null,U=function(){var e=B.current.getBoundingClientRect().height;O(e*(9/16))},L=function(e){var t=e.keyCode;if(g)switch(t){case 37:K();break;case 39:Q()}},q=function(){h((function(e){return!e}))},K=function(){if(i.polling)return!1;P>0&&w((function(e){return e-1}))},Q=function(){if(i.polling)return!1;P<a.items.length-1?w(P+1):u()};Object(n.useEffect)((function(){I((function(e){return e>=100?0:e}))}),[E]),Object(n.useEffect)((function(){_({toggleStoryNavigation:q,isKeyBoardEnabled:g})}),[g]);var G=Object(n.useCallback)((function(e){I(e)}),[]);Object(n.useEffect)((function(){return U(),window.addEventListener("resize",U),window.addEventListener("keyup",L),null===R&&x(Object(z.l)(T.id)),function(){window.removeEventListener("resize",U),window.removeEventListener("keyup",L)}}),[]),Object(n.useEffect)((function(){return window.addEventListener("keyup",L),function(){window.removeEventListener("keyup",L)}}),[P]),Object(n.useEffect)((function(){E>=100&&Q()}),[E]);var H="free"!==T.privacy,V=H&&!r;return o.a.createElement(y,{ref:B,isItemPremium:H,isPurchaseInProgress:i.polling,style:{width:S},"data-testid":"MyStoryWrapper"},o.a.createElement(b,{"data-testid":"MyStoryProgressBarWrapper"},a.items.map((function(e,t){return o.a.createElement(N,{key:e.id,item:e,isActive:T===e,isPremium:"free"!==e.privacy,isComplete:P>a.items.indexOf(e),percentage:E,"data-testid":"MyStoryProgressIndicator"})}))),o.a.createElement(W,{profilePictureUrl:s,postedAt:T.createdAt,"data-testid":"MyStoryMyStoryPerformerDetails"}),o.a.createElement(Mt.Provider,{value:C,"data-testid":"MyStoryProvider"},o.a.createElement(kt,{prevItem:D,nextItem:A,activeItem:T,showPremiumWithDelay:V,performerNick:t,onPercentageUpdate:G,stories:a,purchaseUi:i,getStories:l,subscribeWithQuickBuy:p,"data-testid":"MyStoryMyStoryTrioGroup"})),!i.polling&&o.a.createElement(o.a.Fragment,null,a.items.length>1&&P>0&&o.a.createElement(d,{onClick:function(){return K()},"data-testid":"MyStoryLeftArrow"},o.a.createElement(F.a,{icon:"arrow-pager-left","data-testid":"MyStoryIcon"})),a.items.length>1&&o.a.createElement(m,{onClick:function(){return Q()},"data-testid":"MyStoryRightArrow"},o.a.createElement(F.a,{icon:"arrow-pager-right","data-testid":"MyStoryIcon"}))))};Ct.propTypes={performerNick:a.string.isRequired,profilePictureUrl:a.string.isRequired,isSubscribed:a.bool.isRequired,stories:a.object.isRequired,endCallback:a.func},Ct.defaultProps={endCallback:function(){}};var _t=Ct,xt=r("f8a9"),Nt=r("c33b"),Rt=function(e){var t=e.muteApplet,r=e.unMuteApplet,a=e.disableKeyBoard,i=e.enableKeyBoard,c=e.getStories,s=e.disableStories,u=e.enableStories,l=e.resetStories,p=e.subscribeWithQuickBuy,f=e.stories,d=e.stories,m=d.items,y=d.isStoryDisabled,b=d.isSubscribed,S=d.profilePictureUrl,O=e.purchaseUi,j=e.performerNick,P=function(){y?w():c(j).then((function(){y&&u()})).catch((function(e){console.error(e),s(),w()}))},w=Object(n.useCallback)((function(){v.default.navigateBack()}),[]);return Object(n.useEffect)((function(){t(),a(),0===m.length&&P()}),[]),Object(n.useEffect)((function(){return P(),function(){r(),i(),l()}}),[j]),o.a.createElement(g,{closeOnBackgroundClick:!1,onClose:w,usePortal:!1,"data-testid":"MyStoryOverlayStyledOverlay"},m.length?o.a.createElement(o.a.Fragment,null,o.a.createElement(xt.a,{onClick:w,"data-testid":"MyStoryOverlayCloseButton"}),o.a.createElement(_t,{autoPlay:!0,isSubscribed:b,performerNick:j,profilePictureUrl:S,endCallback:w,purchaseUi:O,stories:f,getStories:c,subscribeWithQuickBuy:p,"data-testid":"MyStoryOverlayMyStory"})):o.a.createElement(h,{"data-testid":"MyStoryOverlayStyledLoader"}))},Bt={getStories:z.k,resetStories:z.m,disableStories:z.i,enableStories:z.j,subscribeWithQuickBuy:z.n,muteApplet:Nt.muteApplet,unMuteApplet:Nt.unMuteApplet,enableKeyBoard:Nt.enableKeyBoard,disableKeyBoard:Nt.disableKeyBoard};Rt.propTypes={muteApplet:a.func.isRequired,disableKeyBoard:a.func.isRequired,unMuteApplet:a.func.isRequired,enableKeyBoard:a.func.isRequired,getStories:a.func.isRequired,enableStories:a.func.isRequired,disableStories:a.func.isRequired,subscribeWithQuickBuy:a.func.isRequired,resetStories:a.func.isRequired,stories:Object(a.shape)({items:Object(a.arrayOf)(Object(a.shape)({type:Object(a.oneOf)(["image","video"]),privacy:Object(a.oneOf)(["premium","free"]),createdAt:a.string,duration:a.number,media:Object(a.arrayOf)(Object(a.shape)({type:Object(a.oneOf)(["image","video"]),contentUrl:a.string,dimension:Object(a.shape)({width:a.number,height:a.number})}))})),price:Object(a.oneOfType)([a.bool,a.number]),loading:a.bool,profilePictureUrl:Object(a.oneOfType)([a.bool,a.string]),isSubscribed:a.bool,isStoryDisabled:a.bool}).isRequired,purchaseUi:Object(a.shape)({polling:a.bool,error:a.bool,response:Object(a.shape)()}).isRequired,performerNick:a.string.isRequired,storyId:a.number},Rt.defaultProps={storyId:null};t.default=Object(c.c)((function(e,t){var r=e.stories,n=(e.performer,e.user),o=t.storyId;return{stories:Re({stories:r},o),purchaseUi:n.purchaseUi}}),Bt)(Rt)},e8c5:function(e,t,r){e.exports={"close-button":"Zb-k-EJXh_wK"}}}]);