/*! VERSION | 10.78.9 */"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[2745],{38901:(e,t,l)=>{l.d(t,{u:()=>c});var i=l(66813),s=l(27378),n=l(10642),r=l(17473),o=l(99748),a=l(95654),d=l(63256);let c=({model:e,children:t,isHiddenImage:l,isViewcam:c,modelData:u,isTranslucent:m})=>{var h;let p=(0,a.C)(d.FOC),g=(0,a.C)(d.h69),E=(0,a.C)(d.cV7),v=(0,s.useRef)(),y=null,_=!1;if(!l){let{url:t,isSnapshot:l}=(0,i.iJ)({model:e,modelData:u,snapshotUrlTemplate:p,hasWebpSupport:g,isBlur:!0});y=t,_=!l}let[b,C]=(0,s.useState)(null),[N,S]=(0,s.useState)(!1),f=(0,s.useCallback)((e,t)=>{v.current&&v.current.cancelFetching();try{v.current=new i.hc(e,t,1e3*E,(e,t)=>{C(e),S(t||!1)},n.ZP)}catch(e){n.ZP.error(e)}},[E]);return(0,s.useEffect)(()=>{var t,l;return!_&&y&&(null==e?void 0:null===(t=e.profile)||void 0===t?void 0:t.avatarUrl)?f(y,null==e?void 0:null===(l=e.profile)||void 0===l?void 0:l.avatarUrl):(y!==b&&C(y),_!==N&&S(_)),()=>{var e;return null===(e=v.current)||void 0===e?void 0:e.cancelFetching()}},[y,b,_,N,null==e?void 0:null===(h=e.profile)||void 0===h?void 0:h.avatarUrl,v,f,l]),s.createElement("div",{className:(0,o.AK)("non-nude-shutter-background",m&&"non-nude-shutter-background--translucent")},b&&!m&&s.createElement("div",{className:(0,o.AK)("non-nude-shutter-background__wrap",N&&"non-nude-shutter-background__wrap--blur",c&&"non-nude-shutter-background__wrap--viewcam")},s.createElement("img",{src:b,className:"non-nude-shutter-background__image",alt:"Background"})),m&&s.createElement(r.M,null),s.createElement("div",{className:"non-nude-shutter-background__content"},t))}},28865:(e,t,l)=>{l.d(t,{R:()=>b});var i=l(27378),s=l(86611),n=l(57174),r=l(51573),o=l(99748),a=l(56509),d=l(20717),c=l(94380),u=l(36886),m=l(14151);let h={root:"NonNudeShutterWithTeasing#sc",videoWrapper:"NonNudeShutterWithTeasing__videoWrapper#cg",content:"NonNudeShutterWithTeasing__content#GX",button:"NonNudeShutterWithTeasing__button#HJ",header:"NonNudeShutterWithTeasing__header#eE",fire:"NonNudeShutterWithTeasing__fire#M1",title:"NonNudeShutterWithTeasing__title#pZ",description:"NonNudeShutterWithTeasing__description#zS",timeHint:"NonNudeShutterWithTeasing__timeHint#AA",voltageIcon:"NonNudeShutterWithTeasing__voltageIcon#CC",timeHintText:"NonNudeShutterWithTeasing__timeHintText#tB",landscape:"NonNudeShutterWithTeasing__landscape#Dr",portrait:"NonNudeShutterWithTeasing__portrait#Lz"},p=({triggerSource:e,teaser:t,className:l})=>{let p=(0,c.T)(),g=(0,u.t)(),E=(0,i.useRef)(null),v=(0,d.jz)("common/components/ui/PromoBanner/assets/common/promo-icon-placeholder.svg"),y=(0,d.jz)("cams/components/ui/NonNudeShutterProfile/assets/voltage.png"),{aspectRatio:_}=t;(0,i.useLayoutEffect)(()=>{E.current&&(_<=1?(E.current.style.width="100%",E.current.style.height="auto"):(E.current.style.height="100%",E.current.style.width="auto"),E.current.style.aspectRatio=`1 / ${_}`)},[_]);let b=_<=1?"landscape":"portrait";return i.createElement("div",{className:(0,o.AK)("NonNudeShutterWithTeasing#sc",h[b],l)},i.createElement("div",{className:"NonNudeShutterWithTeasing__videoWrapper#cg",ref:E},i.createElement(s.Z,{key:t.url,canPlay:!0,isAutoPlay:!0,duration:t.duration,isShowBuffering:!0,muted:!0,loop:!0,isKeysEnabled:!0,isShowControlsOnClickMobile:!0,type:"native",poster:t.fullCoverUrl,videoUrl:t.url,theme:m.kB,isServerRenderOrHydration:!g})),i.createElement("div",{className:"NonNudeShutterWithTeasing__content#GX"},i.createElement("div",{className:"NonNudeShutterWithTeasing__header#eE"},i.createElement("img",{src:v,className:"NonNudeShutterWithTeasing__fire#M1",alt:"fire"}),i.createElement("div",{className:"NonNudeShutterWithTeasing__title#pZ"},(0,a.dW)("viewCam.nonNudeShutter.title"))),i.createElement("div",{className:"NonNudeShutterWithTeasing__description#zS"},(0,a.dW)("viewCam.nonNudeShutter.descriptionViewcam")),i.createElement(n.ZP,{style:"blue-2",size:"large",className:"NonNudeShutterWithTeasing__button#HJ",onClick:()=>{p((0,r.WL)(e))}},(0,a.dW)("viewCam.nonNudeShutter.button")),i.createElement("div",{className:"NonNudeShutterWithTeasing__timeHint#AA"},i.createElement("img",{src:y,className:"NonNudeShutterWithTeasing__voltageIcon#CC",alt:"Voltage icon"}),i.createElement("span",{className:"NonNudeShutterWithTeasing__timeHintText#tB"},(0,a.dW)("viewCam.nonNudeShutter.timeHint")))))};var g=l(33914),E=l(98391),v=l(95654),y=l(63256);let _=e=>e?"viewCam.nonNudeShutter.descriptionViewcam":"viewCam.nonNudeShutter.descriptionProfile",b=({isBig:e,isForceWhiteText:t,isViewcam:l,triggerSource:s,className:u})=>{let m=(0,c.T)(),h=(0,v.C)(g.zO),b=(0,v.C)(y.ouq),C=(0,v.C)(g.Xv),N=(0,d.jz)("common/components/ui/PromoBanner/assets/common/promo-icon-placeholder.svg"),S=(0,d.jz)("cams/components/ui/NonNudeShutterProfile/assets/voltage.png"),f=(0,o.AK)("non-nude-shutter-profile",u,{"non-nude-shutter-profile--big":e,"non-nude-shutter-profile--force-white-text":t}),I=b&&l;return I&&!h?i.createElement("div",{className:"non-nude-shutter-profile__loader"}):I&&C?i.createElement(E.a,null,i.createElement(p,{className:u,teaser:C,triggerSource:s})):i.createElement("div",{className:f},i.createElement("div",null,i.createElement("img",{src:N,className:"non-nude-shutter-profile__icon",alt:"icon"})),i.createElement("div",{className:"non-nude-shutter-profile__title"},(0,a.dW)("viewCam.nonNudeShutter.title")),i.createElement("div",{className:"non-nude-shutter-profile__description"},(0,a.dW)(_(l))),i.createElement(n.ZP,{style:"blue-2",size:"large",className:"non-nude-shutter-profile__button",onClick:()=>{m((0,r.WL)(s))}},(0,a.dW)("viewCam.nonNudeShutter.button")),i.createElement("div",{className:"non-nude-shutter-profile__time-hint"},i.createElement("img",{src:S,className:"non-nude-shutter-profile__voltage-icon",alt:"Voltage icon"}),i.createElement("span",{className:"non-nude-shutter-profile__time-hint-text"},(0,a.dW)("viewCam.nonNudeShutter.timeHint"))))}},58042:(e,t,l)=>{l.d(t,{$:()=>n});var i=l(27378);let s=e=>{e.preventDefault()},n=e=>i.createElement("img",{...e,onContextMenu:s})},54690:(e,t,l)=>{l.d(t,{x:()=>g});var i=l(27378),s=l(38768),n=l(94380),r=l(95654),o=l(1948),a=l(99382),d=l(21313),c=l(56509);let u=({isOpen:e,uploadInputPhotosToServer:t})=>i.createElement(d.Z,{open:e,closeIconPosition:"rightHeader",isCloseOnClickOutside:!1,contentClassName:"model-dc-sync-with-myclub",onClose:()=>t()},i.createElement("div",{className:"sync-with-myclub-modal"},i.createElement("div",{className:"sync-with-myclub-modal__title"},(0,c.dW)("gallery.albums.syncMyClubModal.title")),i.createElement("div",{className:"sync-with-myclub-modal__controllers"},i.createElement(a.ZP,{style:"default-outline",type:"button",size:"medium",onClick:()=>t()},(0,c.dW)("button.skip")),i.createElement(a.ZP,{style:"default-filled",type:"button",size:"medium",onClick:()=>t({isUploadToMyClub:1})},(0,c.dW)("gallery.albums.syncMyClubModal.button"))),i.createElement("div",{className:"sync-with-myclub-modal__link"},i.createElement(o.Z,{href:"/settings#myclub"},(0,c.dW)("gallery.albums.syncMyClubModal.link")))));var m=l(94057),h=l(88342),p=l(60963);let g=e=>{let t=(0,i.forwardRef)((t,l)=>{let o=(0,i.useRef)(null),a=(0,n.T)(),d=(0,r.C)(p.gz),[c,g]=(0,i.useState)(!1),[E,v]=(0,i.useState)(!1),[y,_]=(0,i.useState)(),b=e=>{var t;g(!1),(null==o?void 0:null===(t=o.current)||void 0===t?void 0:t.files)&&y&&(v(!0),a((0,m.IH)([...o.current.files],y.id.toString(),e)).finally(()=>{v(!1),o.current&&(o.current.value="")}))},C={...t,addPhotos:e=>{var t,l;_(e),null===(l=o.current)||void 0===l||null===(t=l.click)||void 0===t||t.call(l)},isPhotosLoading:E};return i.createElement(i.Fragment,null,i.createElement(u,{isOpen:c,uploadInputPhotosToServer:b}),i.createElement("input",{multiple:!0,className:"hidden",accept:s.KX,onChange:()=>{var e,t;(null===(t=o.current)||void 0===t?void 0:null===(e=t.files)||void 0===e?void 0:e.length)&&(d&&(null==y?void 0:y.accessMode)!==h.ALBUMS_ACCESS_MODES.UNPUBLISHED?g(!0):b())},ref:o,type:"file"}),i.createElement(e,{ref:l,...C}))});return t.displayName="WithPhotosUploader",t}},17473:(e,t,l)=>{l.d(t,{M:()=>n});var i=l(27378),s=l(99748);let n=({mode:e=""})=>i.createElement("div",{className:(0,s.AK)("strip-backdrop",e)})},78121:(e,t,l)=>{l.d(t,{Z:()=>L});var i,s=l(18775),n=l(64489),r=l(37051),o=l(27378),a=l(48204),d=l(77382),c=l(1017),u=l(54690),m=l(80936),h=l(59593),p=l(99748),g=l(64696),E=l(80176),v=l(15720),y=l(62182),_=l(94057),b=l(19806),C=l(88342),N=l(21044),S=l(10634),f=l(81326),I=l(66483),M=l(50538),P=l(58042),A=l(29413),D=l(85353),k=l(56509),w=l(49217),T=l(64182),O=l(16556);let W=o.memo(({hasAccesOverlay:e,addPhotoClickHandler:t,isMyPhotosPending:l,item:i,showMoreClickHandler:s,currentDraggingPhotoId:n,onDragStart:a,onDragEnter:d,onDragEnd:c,imageClickHandler:u,isInProgress:m,shouldShowReviewNotification:h,renderPhotoOverlay:g,handleSelect:E=r.Z,handleSelectById:v=r.Z,handleCancelEditing:y,hiddenItemsCount:_,isEditMode:b=!1,isSelected:C=!1,isAlbumSelected:N,index:S,album:f,itemsInRowCount:I,user:W})=>{let{id:R}=i,Z=()=>{C&&f&&v(String(f.id),!1),E()};if(S>=I&&_>0)return null;let H=i.urlThumb||i.urlThumbMicro,U=o.createElement(P.$,{alt:(0,k.B)("seo.modelPhotos.alt",{seoExtra:!1,username:W.username,albumname:null==f?void 0:f.name,count:S?` ${S+1}`:""}),className:"photos-gallery-item-v2__image",src:H&&!m?H:void 0});return R===T.NX?o.createElement("li",{className:(0,p.AK)("photos-gallery-item-v2","plus",{"is-updating":l,selected:N}),key:"plus",onClick:()=>{t(),null==y||y()}},l&&o.createElement(D.Z,{size:80,isCentered:!0}),o.createElement(A.Z,{img:"plus-unframed",size:26})):S===I-1&&_>0?o.createElement("li",{className:(0,p.AK)("photos-gallery-item-v2 is-clickable show-more",{selected:C}),key:"show-more",onClick:s},U,o.createElement("div",{className:"photos-gallery-item-v2__counter"},"+",_+1,!e&&o.createElement("div",{className:"photos-gallery-item-v2__see-more"},(0,k.dW)("button.seeMore")))):b&&!l?o.createElement("li",{"data-photo-id":R,draggable:!0,onDragStart:a,onDragEnter:d,onDragEnd:c,key:R,className:(0,p.AK)("photos-gallery-item-v2 in-edit-mode",{selected:C,"is-dragging":n===R}),onClick:Z},U,!n&&o.createElement("div",{className:"photos-gallery-item-v2__controls",onClick:e=>e.stopPropagation()},o.createElement(M.Z,{handleSelect:Z,isSelected:C,id:String(R)}))):o.createElement("li",{className:(0,p.AK)("is-clickable photos-gallery-item-v2"),draggable:"false",onClick:u,key:R,"data-photo-id":R},U,e&&o.createElement(w.Z,{variant:0===S?"cover":"lock",isOwnProfile:!1,modifier:"gallery",album:f}),null==g?void 0:g(),m&&o.createElement(D.Z,{size:80,isCentered:!0}),h&&o.createElement(O.Z,{tooltipHeader:(0,k.dW)("gallery.notReviewedPhoto.tooltipTitle"),tooltipBody:(0,k.dW)("gallery.notReviewedPhoto.tooltipDescription")}))});var R=l(55363);let Z=e=>{var t,l;return o.createElement(R.Z,{id:`${null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.albumId}-${null==e?void 0:null===(l=e.item)||void 0===l?void 0:l.id}`},({isEditMode:t,isSelected:l,handleSelect:i,handleSelectById:s,handleCancelEditing:n})=>o.createElement(W,{...e,isEditMode:t,isSelected:l,handleSelect:i,handleSelectById:s,handleCancelEditing:n}))};class H extends(i=o.Component){componentDidMount(){(0,g.Z)(this.propsUpdateToActionsMap,{},this.props),this.updateGalleryWidth()}componentDidUpdate(e){(0,g.Z)(this.propsUpdateToActionsMap,e,this.props),this.updateGalleryWidth()}render(){let{albumPhotos:e,isAlbumAccessGranted:t,isEditMode:l,isOwnProfile:i,selectedAlbum:s,isAlbumOwnerModel:n,className:r,user:a,isPhotosLoading:d,shouldShowAddToFavorites:u,shouldHideEditButton:m}=this.props,{itemsInRowCount:h}=this.state,g=this.addControlItems(e);return o.createElement("div",{className:(0,p.AK)("photos-gallery-v2",r,{"gallery-access-restricted":!t,"is-edit-mode":l,"is-pending":d})},o.createElement("ul",{className:(0,p.AK)("photos-gallery-list-v2",`photos-gallery-list-v2--${g.length}-items-layout`),style:{"--itemsInRowCount":h},ref:this.galleryRef},g.map((e,t,l)=>this.renderGalleryPhoto(e,t,l))),o.createElement("div",{className:"photos-gallery-list-v2__controls"},n&&o.createElement(S.Z,{albumId:null==s?void 0:s.id,userId:null==s?void 0:s.userId,isClickable:!0,isLongFormat:!0}),u&&o.createElement(b.Z,{tooltipPlacement:"left",album:s,showForGuests:!0,owner:a,compact:!0})),i&&!m&&o.createElement(c.Z,{className:"photos-gallery-edit-button"}))}constructor(e){super(e),(0,s._)(this,"galleryRef",o.createRef()),(0,s._)(this,"propsUpdateToActionsMap",[{update:[y.oC,y.Xd],action:()=>{this.throttledResizeHandler()}}]),(0,s._)(this,"throttledResizeHandler",(0,n.Z)(()=>this.updateGalleryWidth(),h.nl,{leading:!1,trailing:!0})),(0,s._)(this,"addControlItems",e=>{let{isOwnProfile:t}=this.props;return[...t?[{id:-1}]:[],...e]}),(0,s._)(this,"updateGalleryWidth",()=>{this.galleryRef.current&&(0,v.Tz)(this,{galleryWidth:this.galleryRef.current.offsetWidth,itemsInRowCount:Math.max(Math.floor(this.galleryRef.current.offsetWidth/200)+1,this.props.maxPhotosPerLine||5)})}),(0,s._)(this,"showMoreClickHandler",()=>{this.setState({expanded:!0})}),(0,s._)(this,"imageClickHandler",e=>{let{photoId:t}=e.currentTarget.dataset,{selectedAlbum:l,user:i,shouldUpdateUrl:s,albumPhotos:n}=this.props;if(e.preventDefault(),s&&i&&l){let e;e=(null==i?void 0:i.isModel)?`/${i.username}/photos/${l.id}-${t}`:i.isStudio?`/studio/${i.username}/photos/${l.id}-${t}`:`/user/${i.username}/photos/${l.id}-${t}`,this.props.routerPush(e)}else this.props.showModal(h.MODAL_TYPES.UNIVERSAL_MEDIA_VIEWER,{selectedItemId:Number(t),userPhotos:n,user:i,selectedAlbum:l,likeMode:h.mK.NONE,bookmarkMode:h.HY.NONE})}),(0,s._)(this,"addPhotoClickHandler",()=>{let{selectedAlbum:e}=this.props;e&&this.props.addPhotos(e)}),(0,s._)(this,"onDragEnterThrottled",(0,n.Z)(e=>{e.preventDefault();let{currentDraggingPhotoId:t}=this.props;if(!(e.target instanceof HTMLImageElement))return;let l=Number(e.target.dataset.photoId);t&&l!==t&&(this.props.handleChangeOrder(),this.props.swapPhotoOrder(t,l))},500)),(0,s._)(this,"onDragEnter",e=>{e.persist(),this.onDragEnterThrottled(e)}),(0,s._)(this,"onDragEnd",e=>{e.preventDefault(),this.state.dragImage&&(this.state.dragImage.remove(),this.setState({dragImage:null})),this.props.setDraggingPhotoId(null)}),(0,s._)(this,"onDragStart",e=>{if(!h.BROWSER_CAPABILITIES.desktop)return;let{target:t}=e,l=Number(t.dataset.photoId);this.props.setDraggingPhotoId(l);let i=t.style.backgroundImage.match(/\(['"]?([^)"']+)/).pop(),{height:s}=t.style,{x:n,y:r}=t.getBoundingClientRect(),{clientX:o,clientY:a}=e,d=document.createElement("img");d.setAttribute("src",i),d.style.height=s,document.body.appendChild(d),e.dataTransfer.setDragImage(d,o-n,a-r),this.setState({dragImage:d}),e.dataTransfer.setData("text/plain","anything")}),(0,s._)(this,"renderGalleryPhoto",(e,t,l)=>{let{currentDraggingPhotoId:i,isLoggedIn:s,isOwnProfile:n,photosInProgress:a,user:d,modelData:c,isEditable:u,renderPhotoOverlay:m,selectedAlbum:h,isAlbumAccessGranted:p,isPhotosLoading:g,isAlbumSelected:E}=this.props,{itemsInRowCount:v,expanded:y}=this.state,{status:_,urlThumb:b,isUnderPreModeration:S}=e,f=!!n&&a.includes(b),I=_===N.$q.NOT_REVIEWED,M=!f&&I&&!(null==c?void 0:c.isApprovedModel)&&s,P=(null==h?void 0:h.accessMode)!==C.ALBUMS_ACCESS_MODES.UNPUBLISHED,A={index:t,user:d,itemsInRowCount:v,addPhotoClickHandler:this.addPhotoClickHandler,isMyPhotosPending:g,item:e,hiddenItemsCount:y?0:Math.max(0,l.length-v),showMoreClickHandler:this.showMoreClickHandler,currentDraggingPhotoId:i,onDragStart:this.onDragStart,onDragEnter:this.onDragEnter,onDragEnd:this.onDragEnd,imageClickHandler:this.imageClickHandler,renderPhotoOverlay:u?r.Z:m,album:h,hasAccesOverlay:!p&&!n,isInProgress:f,isAlbumSelected:E,shouldShowReviewNotification:n&&P&&(S||M)},D=u?Z:W;return o.createElement(D,{key:e.id,...A})}),this.state={galleryWidth:null,itemsInRowCount:9,expanded:!1}}}(0,s._)(H,"defaultProps",{className:"",isEditable:!1,isAlbumOwnerModel:!1,shouldShowAddToFavorites:!0,renderPhotoOverlay:null,handleChangeOrder:r.Z,currentDraggingPhotoId:void 0,maxPhotosPerLine:5,shouldUpdateUrl:!0});let U={setDraggingPhotoId:_.oJ,showModal:d.K4,swapPhotoOrder:_.hG,routerPush:E.J5},L=(0,m.y)("windowWidth","windowHeight")((0,u.x)((0,a.$j)((e,t)=>{let{auth:{currentUser:l,isLoggedIn:i,isLoggingOut:s},myPhotos:{currentDraggingPhotoId:n,inProgress:r},users:{isPending:o},ui:{windowOrientation:a}}=e;return{currentDraggingPhotoId:n,currentUser:l,isAlbumAccessGranted:t.isAlbumAccessGranted||t.selectedAlbum&&(0,f.CI)(t.selectedAlbum),isAlbumOwnerModel:(null==t?void 0:t.selectedAlbum)&&(0,I.Sw)(e,t.selectedAlbum.userId),isLoggedIn:i&&!s,isUsersPending:o,photosInProgress:r,windowOrientation:a}},U)(H)))},19806:(e,t,l)=>{l.d(t,{Z:()=>C});var i=l(18775),s=l(27378),n=l(48204),r=l(77382),o=l(29413),a=l(3034),d=l(91090),c=l(59593),u=l(99748),m=l(56509),h=l(16023),p=l(70527),g=l(16074),E=l(27494),v=l(81326),y=l(31640);let _={addAlbum:g.kI,addVideo:g.cN,deleteAlbum:g.mV,deleteVideo:g.FM,togglePostPhotoToBookmark:g.eT,showAuthModal:r.vf};class b extends s.Component{renderTooltip(){let{isInCollection:e,htmlId:t,tooltipPlacement:l="top"}=this.props;return s.createElement(a.Z,{isForceVisible:!1,isMobileRelative:!1,placement:l,targetId:t},(0,m.dW)(e?"feed.removeFromMyCollection":"feed.addToMyCollection"))}render(){let{currentUser:e,isLoggedIn:t,owner:l,showForGuests:i}=this.props;if(!t&&!i||!(null==l?void 0:l.isModel)||(null==e?void 0:e.id)===l.id||e&&c.Gv.some(t=>e[t]))return null;let{album:n,className:r,isInCollection:a,video:d,compact:h,htmlId:p}=this.props,g=n?!n.preview:!!(d&&!d.videoUrl);if(g&&!a)return null;let[E,v]=a?["bookmark-filled","feed.savedToMyCollection"]:["bookmark","feed.addToMyCollection"];return s.createElement("div",{className:(0,u.AK)("toggle-collection-button",{added:a,compact:h,disabled:this.state.isPending},r),id:p,onClick:this.clickHandler},s.createElement(o.Z,{img:E}),!h&&s.createElement("span",{className:"toggle-collection-button__text"},(0,m.dW)(v)),!!h&&this.renderTooltip())}constructor(e){super(e),(0,i._)(this,"clickHandler",()=>{var e,t;let l;let{isLoggedIn:i,owner:s,messageKind:n,messageId:r}=this.props;if(!i){this.props.showAuthModal({action:{backgroundImage:(null===(t=s.profile)||void 0===t?void 0:t.avatarUrl)||void 0,user:s,shouldBypassActionPrefix:!0,type:"createFreeAccount"},component:"SignUp",className:"auth-modal-signup",amplParams:{triggerSource:d.Dt.MODELS_CONTENT_ADD_TO_MY_COLLECTION}});return}let{album:o,isInCollection:a,video:c,postPhoto:u}=this.props;this.setState({isPending:!0}),u?l=this.props.togglePostPhotoToBookmark([{postId:u.postId,recordId:u.id}],!a):o&&a?l=this.props.deleteAlbum(o.id,s.id):o&&!a?l=this.props.addAlbum(o.id,s.id):c&&a?l=this.props.deleteVideo(c.id,s.id,{video:c,username:s.username}):c&&!a&&(l=this.props.addVideo({username:s.username,userId:s.id,messageKind:n,messageId:r,video:c})),null===(e=l)||void 0===e||e.finally(()=>{this.setState({isPending:!1})})}),this.state={isPending:!1}}}let C=(0,n.$j)((e,t)=>{var l,i,s;let n,r;let{auth:{isLoggedIn:o,currentUser:a},myCollection:{actionSymbol:d}}=e,{album:c,postRecordId:u,postPhoto:m,video:g,compact:_}=t,b=!1,C=(0,h.Kx)(e);if(c){if(n="album",r=c.id,C){let l=(0,p.fM)(e,c.id,t.owner.id);b=!!(null==l?void 0:l.isInCollection)}else b=u?(0,E.YP)(e,u):!!(0,v.HO)(e,t)}else if(g){if(r=g.id,n="video",C){let l=(0,p.l8)(e,g.id,t.owner.id);b=!!(null==l?void 0:l.isInCollection)}else b=u?(0,E.YP)(e,u):!!(null===(l=t.video)||void 0===l?void 0:l.isInCollection)}else if(m){if(r=m.postId,n="post",(0,h.Cd)(e)&&(b=!!(null===(i=(0,y.X)(e,m.postId,m.id))||void 0===i?void 0:i.isInCollection)),C){let l=(0,p.d9)(e,m.postId,t.owner.id);b=!!(null==l?void 0:l.isInCollection)}else b=!!(null===(s=(0,E.up)(e,m.postId,m.id))||void 0===s?void 0:s.isInCollection)}return{actionSymbol:d,currentUser:a,htmlId:`toggle_collection_${n}_${r}${_?"_compact":""}`,isInCollection:b,isLoggedIn:o,type:n}},_)(b)},64182:(e,t,l)=>{l.d(t,{NX:()=>ee,W_:()=>et,ZP:()=>es});var i=l(18775),s=l(64489),n=l(5774),r=l(60389),o=l(62129),a=l(25655),d=l(98064),c=l(32367),u=l(37051),m=l(23615),h=l.n(m),p=l(27378),g=l(48204),E=l(77382),v=l(62668),y=l(83550),_=l(1017),b=l(80936),C=l(1948),N=l(82362),S=l(99382),f=l(30486),I=l(29413),M=l(21313),P=l(38487),A=l(59593),D=l(99748),k=l(56509),w=l(64696),T=l(80176),O=l(22407),W=l(15720),R=l(16023),Z=l(62182),H=l(94057),U=l(88342),L=l(21044),B=l(10634),$=l(81326),z=l(60963),F=l(20243),x=l(65103),G=l(66483),K=l(32284),V=l(50538),Y=l(85353),j=l(38768),X=l(16556);let J=p.memo(({addPhotoClickHandler:e,isMyPhotosPending:t,fileInputChangeHandler:l,item:i,fileInputRef:s,showMoreClickHandler:n,style:r,isInDraggingMode:o,onDragStart:a,onDragEnter:d,onDragEnd:c,imageClickHandler:u,isInProgress:m,shouldShowReviewNotification:h,renderPhotoOverlay:g,handleSelect:E,handleCancelEditing:v,isEditMode:y=!1,isSelected:_=!1})=>{let{id:b}=i;return b===ee?p.createElement("li",{className:(0,D.AK)("plus",{"is-updating":t}),key:"plus",onClick:()=>{e(),null==v||v()},style:r},t&&p.createElement(Y.Z,{size:80,isCentered:!0}),p.createElement(I.Z,{img:"plus",size:44}),p.createElement("form",null,p.createElement("input",{multiple:!0,accept:j.KX,onChange:l,ref:s,type:"file"}))):b===et?p.createElement("li",{className:"is-clickable show-more",key:"show-more",onClick:n,style:r},(0,k.dW)("button.showMore")):y&&!t?p.createElement("li",{"data-photo-id":b,draggable:!0,onDragStart:a,onDragEnter:d,onDragEnd:c,key:b,style:r,className:(0,D.AK)("photos-gallery-item in-edit-mode",{selected:_}),onClick:()=>E()},!o&&p.createElement("div",{className:"photos-gallery-item-controls",onClick:e=>e.stopPropagation()},p.createElement(V.Z,{handleSelect:E,isSelected:_,id:String(b)}))):p.createElement("li",{className:"is-clickable",draggable:"false",onClick:u,key:b,style:r,"data-photo-id":b},null==g?void 0:g(),m&&p.createElement(Y.Z,{size:80,isCentered:!0}),h&&p.createElement(X.Z,{tooltipHeader:(0,k.dW)("gallery.notReviewedPhoto.tooltipTitle"),tooltipBody:(0,k.dW)("gallery.notReviewedPhoto.tooltipDescription")}))});var q=l(55363);let Q=e=>{var t;return p.createElement(q.Z,{id:null==e?void 0:null===(t=e.item)||void 0===t?void 0:t.id},({isEditMode:t,isSelected:l,handleSelect:i,handleCancelEditing:s})=>p.createElement(J,{...e,isEditMode:t,isSelected:l,handleSelect:i,handleCancelEditing:s}))},ee=-1,et=-2;class el extends p.Component{componentDidMount(){(0,w.Z)(this.propsUpdateToActionsMap,{},this.props),this.componentDidRender()}componentDidUpdate(e){(0,w.Z)(this.propsUpdateToActionsMap,e,this.props),this.componentDidRender()}componentDidRender(){this.updateGalleryWidth()}renderSocket(){if(!this.props.isLoggedIn)return null;let{currentUser:e}=this.props;return p.createElement(N.Z,{eventsWithCallbacks:[{subscriptionKey:`imageUpload:${e.id}`,callback:this.imageUploadEventHandler},{subscriptionKey:`newNotification:${e.id}`,callback:this.newNotificationEventHandler}]})}render(){let{albumPhotos:e,isAlbumAccessGranted:t,isEditMode:l,isMyPhotosPending:i,isOwnProfile:s,isScrollable:n,selectedAlbum:r,isAlbumOwnerModel:o}=this.props,{galleryWidth:a}=this.state,d=this.addControlItems(e),c=(0,D.AK)("photos-gallery",this.props.className,{"gallery-access-restricted":!s&&!t,"is-edit-mode":l,"is-pending":i}),u=p.createElement("ul",{className:"photos-gallery-list",ref:this.galleryRefHandler},a>0&&this.alignGalleryItems(d,a).map(this.renderItem));return p.createElement("div",{className:c},this.renderSocket(),!s&&!t&&this.renderAlbumAccessMode(),n?p.createElement(P.Z,{isAlwaysVisible:!0},u):u,o&&p.createElement("div",{className:"likes-counter-wrapper"},p.createElement(B.Z,{albumId:r.id,userId:r.userId,isClickable:!0,isLongFormat:!0})),this.renderWithMyClubSyncModal(),s&&p.createElement(_.Z,{className:"photos-gallery-edit-button"}))}constructor(...e){super(...e),(0,i._)(this,"state",{galleryWidth:null,limit:50,isOpenMyClubSync:!1}),(0,i._)(this,"propsUpdateToActionsMap",[{update:[Z.oC,Z.Xd],action:()=>{this.throttledResizeHandler()}}]),(0,i._)(this,"throttledResizeHandler",(0,s.Z)(()=>this.windowResizeHandler(),A.nl,{leading:!1,trailing:!0})),(0,i._)(this,"addControlItems",e=>{let{isOwnProfile:t}=this.props,{limit:l}=this.state;return t?[{id:ee,aspectRatio:1.2},...e]:!t&&(0,n.Z)(e)>l?[...(0,r.Z)(e,0,l),{id:et,aspectRatio:1.2}]:e}),(0,i._)(this,"imageUploadEventHandler",({name:e,thumbName:t})=>{e===A.Wh.THUMB&&this.props.removeFromInProgress(t)}),(0,i._)(this,"newNotificationEventHandler",({notification:e})=>{e.type===L.PERSONAL_NOTIFICATION_TYPES.USER_PHOTO_DECLINED&&this.props.loadPhotos()}),(0,i._)(this,"galleryRefHandler",e=>{this.galleryRef=e}),(0,i._)(this,"windowResizeHandler",()=>{this.updateGalleryWidth()}),(0,i._)(this,"updateGalleryWidth",()=>{this.galleryRef&&(0,W.Tz)(this,{galleryWidth:this.galleryRef.offsetWidth})}),(0,i._)(this,"getPxValue",e=>`${e.toFixed(2)}px`),(0,i._)(this,"alignGalleryItems",(e,t)=>{let l=e=>{let l=function(e,t){return e&&e.length?(0,a.Z)(e,(0,o.Z)(t,2)):0}(e,"width"),i=t-1*e.length;return Math.min(i/l,1)},i=(e,t)=>{let l=e.map(e=>({...e,height:e.height*t,width:e.width*t})),i=(0,d.Z)(l);return i.width-=1,l},s=(0,c.Z)(e,({itemsAligned:e,rowItems:t},s)=>{t.push({...s,height:150,width:150*s.aspectRatio});let n=l(t);return n<1&&(e.push(...i(t,n)),t.length=0),{itemsAligned:e,rowItems:t}},{itemsAligned:[],rowItems:[]}),{itemsAligned:n,rowItems:r}=s;return r.length&&n.push(...i(r,l(r))),n}),(0,i._)(this,"showMoreClickHandler",()=>{this.setState({limit:9999})}),(0,i._)(this,"imageClickHandler",e=>{let{currentTarget:{dataset:{photoId:t}}}=e,{albumPhotos:l,selectedAlbum:i,user:s,isFeedPhotos:n,isOwnProfile:r,isMyCollectionPage:o,isBroadcastPage:a,isAlbumOwnerModel:d,modalShowOnly:c,currentUser:u}=this.props;e.preventDefault(),r||o||a||!d||c?this.props.showModal(A.MODAL_TYPES.UNIVERSAL_MEDIA_VIEWER,{selectedItemId:Number(t),userPhotos:l,user:c?(0,K.T$)(u):(0,K.T$)(s),selectedAlbum:i,likeMode:n||c?A.mK.NONE:A.mK.ALBUM,bookmarkMode:A.HY.NONE}):this.props.routerPush(`/${s.username}/profile/album/${i.id}/${t}`)}),(0,i._)(this,"addPhotoClickHandler",()=>{this.fileInputRef.click()}),(0,i._)(this,"fileInputChangeHandler",()=>{let{syncContentEnabled:e,selectedAlbum:t}=this.props;this.fileInputRef.files.length&&(e&&t.accessMode!==U.ALBUMS_ACCESS_MODES.UNPUBLISHED?this.setState({isOpenMyClubSync:!0}):this.uploadInputPhotosToServer())}),(0,i._)(this,"uploadInputPhotosToServer",e=>{this.setState({isOpenMyClubSync:!1}),this.props.addPhotos([...this.fileInputRef.files],void 0,e).then(()=>{this.fileInputRef&&this.fileInputRef.form.reset()})}),(0,i._)(this,"buyAlbumClickHandler",()=>{let{user:e,selectedAlbum:t}=this.props;this.props.emitButtonEvent(A.FO.USER_GALLERY_BUY_ALBUM,{userId:e.id,albumId:t.id})}),(0,i._)(this,"handleSubscribeOnFanClub",()=>{this.props.emitJoinFanClubButtonEvent()}),(0,i._)(this,"goToSettingsClickHandler",()=>{this.props.emitButtonEvent(A.FO.USER_GALLERY_GO_TO_SETTINGS)}),(0,i._)(this,"signUpClickHandler",()=>{let{user:e}=this.props;this.props.emitButtonEvent(A.FO.USER_GALLERY_ALBUM_REGISTERED_SIGNUP,{user:e})}),(0,i._)(this,"renderWithMyClubSyncModal",()=>{let{isOpenMyClubSync:e}=this.state;return p.createElement(M.Z,{open:e,closeIconPosition:"rightHeader",isCloseOnClickOutside:!1,contentClassName:"model-dc-sync-with-myclub",onClose:()=>this.uploadInputPhotosToServer()},p.createElement("div",{className:"sync-with-myclub-modal"},p.createElement("div",{className:"sync-with-myclub-modal__title"},(0,k.dW)("gallery.albums.syncMyClubModal.title")),p.createElement("div",{className:"sync-with-myclub-modal__controllers"},p.createElement(S.ZP,{style:"default-outline",type:"button",size:"medium",onClick:()=>this.uploadInputPhotosToServer()},(0,k.dW)("button.skip")),p.createElement(S.ZP,{style:"default-filled",type:"button",size:"medium",onClick:()=>this.uploadInputPhotosToServer({isUploadToMyClub:1})},(0,k.dW)("gallery.albums.syncMyClubModal.button"))),p.createElement("div",{className:"sync-with-myclub-modal__link"},p.createElement(C.Z,{href:"/settings#myclub"},(0,k.dW)("gallery.albums.syncMyClubModal.link")))))}),(0,i._)(this,"renderAlbumAccessMode",()=>{let e,t,l,i;let{currentUser:s,selectedAlbum:n,isLoggedIn:r,isCurrentUserModelOrStudio:o,user:a,isUserWithoutEmail:d}=this.props,{accessMode:c}=n;if(c===U.ALBUMS_ACCESS_MODES.FRIENDS)e="users-in-circle",l=(0,k.dW)("gallery.albums.accessModeDescription.friends.title"),i=p.createElement(f.Z,{messageId:"gallery.albums.accessModeDescription.friends.description",elements:{albumOwnerUsername:p.createElement("strong",null,a.username)}});else if(c===U.ALBUMS_ACCESS_MODES.PAID||c===U.ALBUMS_ACCESS_MODES.PAID_DELETED)e="lock-in-circle",l=p.createElement(f.Z,{choiceParameter:"cost",elements:{amount:p.createElement("strong",null,n.cost)},messageId:"gallery.albums.accessModeDescription.paid.title",parameters:{cost:n.cost}}),i=p.createElement(f.Z,{messageId:"gallery.albums.accessModeDescription.paid.description",elements:{albumName:p.createElement("strong",null,n.name)}}),t=p.createElement(S.ZP,{style:"apply-alter",size:"medium",onClick:this.buyAlbumClickHandler},(0,k.dW)("gallery.albums.accessModeDescription.paid.buttonTitle"));else if(c===U.ALBUMS_ACCESS_MODES.PAID&&o)e="error",l=(0,k.dW)("gallery.albums.accessModeDescription.studioOrModel.title"),i=p.createElement(f.Z,{messageId:"gallery.albums.accessModeDescription.studioOrModel.description",elements:{albumOwnerUsername:p.createElement("strong",null,a.username)}}),t=null;else if(c===U.ALBUMS_ACCESS_MODES.FAN_CLUB)o?(e="error",l=(0,k.dW)("gallery.albums.accessModeDescription.studioOrModel.title"),i=p.createElement(f.Z,{messageId:"gallery.albums.accessModeDescription.studioOrModelForFanClub.description",elements:{albumOwnerUsername:p.createElement("strong",null,a.username)}}),t=null):(e="diamond-circle",t=p.createElement(S.ZP,{style:"apply-alter",size:"medium",onClick:this.handleSubscribeOnFanClub},(0,k.dW)("gallery.albums.accessModeDescription.fanClub.buttonTitle")),l=p.createElement(f.Z,{elements:{accent:p.createElement("strong",null)},messageId:"gallery.albums.accessModeDescription.fanClub.title"}));else if(c===U.ALBUMS_ACCESS_MODES.UNPUBLISHED)e="spy-off",l=(0,k.dW)("gallery.albums.accessModes.unpublished");else if(c===U.ALBUMS_ACCESS_MODES.VERIFIED_USERS){let n="";if(r){if(s.isEmailVerified)return null;n="verified"}else n="registered";let o="registered"===n;e=r?"mail":"user-verified-in-circle",l=o?(0,k.dW)(`gallery.albums.accessModeDescription.${n}.title`):"",i=p.createElement(f.Z,{messageId:`gallery.albums.accessModeDescription.${n}.${d?"addEmailDescription":"description"}`,elements:{strong:p.createElement("strong",null)}}),t=p.createElement(S.ZP,{size:"medium",style:o?"signup":"default",onClick:o?this.signUpClickHandler:this.goToSettingsClickHandler},(0,k.dW)(`gallery.albums.accessModeDescription.${n}.${d?"addEmailButtonTitle":"buttonTitle"}`))}return p.createElement("div",{className:"album-access-mode-wrapper"},p.createElement("div",{className:"access-mode-inner"},p.createElement("div",{className:"access-mode-icon"},p.createElement(I.Z,{img:e})),p.createElement("div",{className:"access-mode-title"},l),p.createElement("div",{className:"access-mode-description"},i),p.createElement("div",{className:"access-mode-action"},t)))}),(0,i._)(this,"onDragEnterThrottled",(0,s.Z)(e=>{e.preventDefault();let{currentDraggingPhotoId:t}=this.props,l=Number(e.target.dataset.photoId);t&&l!==t&&(this.props.handleChangeOrder(),this.props.swapPhotoOrder(t,l))},500)),(0,i._)(this,"onDragEnter",e=>{e.persist(),this.onDragEnterThrottled(e)}),(0,i._)(this,"onDragEnd",e=>{e.preventDefault(),this.state.dragImage&&(this.state.dragImage.remove(),this.setState({dragImage:null})),this.props.setDraggingPhotoId(null)}),(0,i._)(this,"onDragStart",e=>{if(!A.BROWSER_CAPABILITIES.desktop)return;let{target:t}=e,l=Number(t.dataset.photoId);this.props.setDraggingPhotoId(l);let i=t.style.backgroundImage.match(/\(['"]?([^)"']+)/).pop(),{height:s}=t.style,{x:n,y:r}=t.getBoundingClientRect(),{clientX:o,clientY:a}=e,d=document.createElement("img");d.setAttribute("src",i),d.style.height=s,document.body.appendChild(d),e.dataTransfer.setDragImage(d,o-n,a-r),this.setState({dragImage:d}),e.dataTransfer.setData("text/plain","anything")}),(0,i._)(this,"renderItem",e=>{let{currentDraggingPhotoId:t,currentUser:l,isLoggedIn:i,isMyPhotosPending:s,isOwnProfile:n,photosInProgress:r,user:o,isEditable:a,renderPhotoOverlay:d,selectedAlbum:c}=this.props,{height:u,width:m,id:h,status:g,urlThumb:E,urlThumbMicro:v,isUnderPreModeration:y}=e,_=!!n&&r.includes(E),b=g===L.$q.NOT_REVIEWED,C=(null==c?void 0:c.accessMode)!==U.ALBUMS_ACCESS_MODES.UNPUBLISHED,N=C&&n&&(y||!_&&b&&!o.isApprovedModel&&i),S=E||v,f={backgroundImage:S&&!_?`url(${S})`:void 0,height:this.getPxValue(u),width:this.getPxValue(m),opacity:t===h?0:1},I={key:e.id,addPhotoClickHandler:this.addPhotoClickHandler,isMyPhotosPending:s,fileInputChangeHandler:this.fileInputChangeHandler,item:e,fileInputRef:e=>{this.fileInputRef=e},showMoreClickHandler:this.showMoreClickHandler,style:f,isInDraggingMode:!!t,onDragStart:this.onDragStart,onDragEnter:this.onDragEnter,onDragEnd:this.onDragEnd,imageClickHandler:this.imageClickHandler,isInProgress:_,shouldShowReviewNotification:N};return a?p.createElement(Q,I):p.createElement(J,{...I,renderPhotoOverlay:d})})}}let ei={addPhotos:H.IH,emitButtonEvent:y.d2,emitJoinFanClubButtonEvent:v.FY,loadPhotos:H.zD,removeFromInProgress:H.Bn,setDraggingPhotoId:H.oJ,showModal:E.K4,swapPhotoOrder:H.hG,routerPush:T.J5};el.propTypes={albumPhotos:h().arrayOf(h().shape({id:h().number,createdAt:h().string,isDeleted:h().bool,aspectRatio:h().string,order:h().number,status:h().string,reason:h().string})),className:h().string,currentUser:h().object,isUserWithoutEmail:h().bool.isRequired,isBroadcastPage:h().bool,isCurrentUserModelOrStudio:h().bool,isLoggedIn:h().bool,isUsersPending:h().bool,isMyPhotosPending:h().bool,isOwnProfile:h().bool,isScrollable:h().bool,photosInProgress:h().arrayOf(h().string),selectedAlbum:h().object.isRequired,modalShowOnly:h().bool,user:h().object,isAlbumOwnerModel:h().bool,handleChangeOrder:h().func,isEditable:h().bool,renderPhotoOverlay:h().func,...(0,O.d)(ei)},el.defaultProps={isScrollable:!0,isEditable:!1,isAlbumOwnerModel:!1,renderPhotoOverlay:null,handleChangeOrder:u.Z,modalShowOnly:!1};let es=(0,b.y)("windowWidth","windowHeight")((0,g.$j)((e,t)=>{let{auth:{currentUser:l,isLoggedIn:i,isLoggingOut:s},myPhotos:{currentDraggingPhotoId:n,inProgress:r,isPending:o},users:{isPending:a},ui:{windowOrientation:d}}=e,c=(0,G.ly)(e);return{albumPhotos:t.albumPhotos||(t.isOwnProfile?(0,F.S9)(e):(0,F.rj)(e,t)),currentDraggingPhotoId:n,currentUser:l,isUserWithoutEmail:(0,x.vE)(e),isAlbumAccessGranted:t.isAlbumAccessGranted||(0,$.CI)(t.selectedAlbum),isCurrentUserModelOrStudio:c,isAlbumOwnerModel:(null==t?void 0:t.selectedAlbum)&&(0,G.Sw)(e,t.selectedAlbum.userId),isLoggedIn:i&&!s,isMyPhotosPending:o,isUsersPending:a,photosInProgress:r,windowOrientation:d,isMyCollectionPage:(0,R.Cd)(e),isBroadcastPage:(0,R.B2)(e),syncContentEnabled:(0,z.gz)(e)}},ei)(el))},16556:(e,t,l)=>{l.d(t,{Z:()=>o});var i=l(27378),s=l(29413),n=l(56322);let r=i.memo(({tooltipBody:e,tooltipHeader:t})=>{let l=(0,i.useRef)(null);return i.createElement("div",{className:"photo-review-pending-icon-wrapper"},i.createElement("span",{ref:l},i.createElement(s.Z,{img:"hourglass",size:60})),i.createElement(n.Z,{className:"photo-review-pending-tooltip",isMobileRelative:!1,targetRef:l,placement:"top"},i.createElement("div",null,i.createElement("div",{className:"tooltip-header"},t),i.createElement("div",{className:"tooltip-description"},e))))}),o=r},25655:(e,t,l)=>{l.d(t,{Z:()=>i});let i=function(e,t){for(var l,i=-1,s=e.length;++i<s;){var n=t(e[i]);void 0!==n&&(l=void 0===l?n:l+n)}return l}}}]);