PageSourceSearch

https://nbyula.com/assets/GigFeedbackComponent--IOf4dKl.js

js nbyula.com collected 2026-10-06 20:43:58 UTC 14,981 bytes, 3 lines download raw bytes

1const __vite__fileDeps=["assets/WriteAFeedbackContainer-_7itB1uA.js","assets/index-QW0Z3Qxf.js","assets/index-DctTeOkX.css","assets/StarRatingContainer-BYMgzw8L.js","assets/ListItemsComponent-CfPiFUql.js","assets/TickOutlineIcon-Bpky-I0A.js","assets/CheckboxContainer-ByRG-WB_.js","assets/TextAreaContainer-CFq-aH-q.js","assets/functions-BNk17N_W.js","assets/SpamWarningMessage-BMaT2494.js","assets/SuccessAnimation-DUbOsSdG.js","assets/CheckIcon-DAs5eYNW.js","assets/FailureAnimation-BqRz6Ofr.js","assets/ScheduleCard-J810N4gQ.js","assets/ClockIcon-iMXQ73ZH.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2import{j as e,B as M,_ as ue,l as ce,an as ve,b as A,r as F,a as me,c as U,A as O,f as u,I as Z,M as fe,$ as pe,am as D,bp as xe,iN as he,R as ge,W as Y}from"./index-QW0Z3Qxf.js";import{E as ee}from"./EditIcon-Ca4hy-V1.js";import{S as ye}from"./ShowMore-Be6J0hM_.js";import{U as be}from"./index-CtcOckPR.js";import{R as oe}from"./RatingComponent-BMkr83g6.js";import{Y as je}from"./YoutubePlayerContainer-C6mDocsM.js";import{A as ie}from"./ArchiveIcon-C0sYKhjH.js";import{D as $e}from"./DropdownContainer-DAAOENLR.js";import{u as we}from"./useWindowDimensions-DmJtiPqB.js";import{P as Ne}from"./ProgressBarContainer-By5CvvZp.js";import{c as le}from"./functions-BNk17N_W.js";import{H as ke}from"./Helmet-D6VBfBsl.js";import"./useDebounceCallback-B3_kUNM7.js";import"./index-cm4_pNFt.js";import"./CarouselContainer-BQr38QdA.js";import"./ArrowIcon-b1xbJvXe.js";import"./index-B5QI388W.js";import"./constants-Dre6kf9O.js";import"./dayjs.min-DKr6pMZN.js";import"./index.esm-BCJsbMEm.js";import"./index-DghppdYS.js";import"./PauseIcon-C3FoVPtc.js";import"./PlayIcon-DEfYCvr1.js";import"./react-select.esm-BrU0Fymq.js";import"./useStateManager-7e1e8489.esm-DByOQtpx.js";import"./use-isomorphic-layout-effect.browser.esm-BTBZIb0h.js";import"./index-LAbZhY8x.js";import"./index-BhHJjVN1.js";function _e({className:x="w-4 h-4"}){return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 32",className:x,children:e.jsx("path",{fill:"currentColor",d:"M28 6H17V4a2 2 0 00-2-2H3v28h2V18h10v2a2 2 0 002 2h11l.115-.006a1 1 0 00.847-1.269L27.039 14l1.923-6.724A1 1 0 0028 6z"})})}function Ae({className:x,rating:v,review:c,subscriber:j,onTimeDelivery:m,outcomeSatisfaction:H,recommendToFriend:$,helpfulCount:f,onHelpfulClick:R,onReportClick:I,createdAt:g,activeUserId:C,isHelpfulForCurrentUser:N=!1,videoLink:w=null,onToggleArchive:l,isArchived:h=!1,isListingMentor:L,isAdminOrModerator:p,isBeingArchived:k=!1}){return e.jsxs("section",{className:`${x} ${h?"opacity-60 bg-gray-50 bg-opacity-50":""}`,children:[h&&e.jsx("div",{className:"mb-2 flex items-center space-x-2",children:e.jsxs("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium bg-gray-100 text-gray-600 rounded-full",children:[e.jsx(ie,{className:"w-3 h-3 mr-1"}),"Only Visible to you"]})}),e.jsxs("section",{className:"flex flex-col items-start space-y-4 space-x-0 w-full md:flex-row md:justify-between md:items-start md:space-y-0 md:space-x-12",children:[e.jsx(be,{gamePlayerIds:[{gamePlayerId:typeof j=="string"?j:j.gamePlayerId}],renderActionItems:()=>null}),e.jsx("section",{className:`inline-flex flex-shrink-0 justify-center items-center space-x-1 ${h?"opacity-50":""}`,children:e.jsx(oe,{rated:Math.round(v)})})]}),e.jsx("section",{className:"flex flex-col justify-between mt-4 mb-6 space-x-0 md:flex-row lg:space-x-16",children:e.jsxs("section",{className:"flex flex-col space-y-2",children:[(w==null?void 0:w.length)>0&&e.jsx(je,{url:w,delay:0}),e.jsx(ye,{text:c||"",className:`text-base break-words ${h?"text-gray-600":"text-space-80"}`})]})}),e.jsx("section",{children:e.jsxs("div",{className:`flex items-center -ml-1 space-x-6 ${h?"opacity-50":""}`,children:[e.jsx(M.Helpful,{onHelpful:R,hasUserVoted:N,variant:"heart",label:f?`Helpful (${f})`:"Helpful",size:"sm"}),C!==j?e.jsx(M,{variant:"text-underline",label:"Report",startIcon:e.jsx(_e,{className:"mr-2 w-4 h-4"}),size:"sm",onClick:I,customContainerClass:"opacity-50"}):null,(L||p)&&e.jsx(M,{variant:"text-underline",label:(h?"Unarchive":"Archive")+(k?" in progress":""),startIcon:k?e.jsx(ue,{className:"mr-2 w-4 h-4"}):e.jsx(ie,{className:"mr-2 w-4 h-4"}),size:"sm",onClick:l,disabled:k})]})})]})}function Ie({className:x,gigSubscriptionId:v,rating:c,review:j,subscriber:m,helpfulCount:H,helpfulForUsers:$,onTimeDelivery:f,outcomeSatisfaction:R,recommendToFriend:I,createdAt:g,videoLink:C,isArchived:N}){const w=ce();let{url:l}=ve();const h=A(i=>{var o,s;return(o=i.user)===null||o===void 0||(s=o.profile)===null||s===void 0?void 0:s._id}),L=A(i=>i.user.isAuthenticated),[p,k]=F.useState($!=null&&$.length?$.includes(h):!1),[S,W]=F.useState($||[]),[T,t]=F.useState(N),[B,y]=F.useState(!1);F.useEffect(()=>{t(N)},[N]);const P=A(i=>{var o,s;return(o=i.user)===null||o===void 0||(s=o.gamePlayerProfile)===null||s===void 0?void 0:s.isApprovedGigProvider}),_=m;A(i=>{var o,s;return i==null||(o=i.user)===null||o===void 0||(s=o.gamePlayerProfile)===null||s===void 0?void 0:s._id});const E=A(i=>{var o,s;return i==null||(o=i.gig)===null||o===void 0||(s=o.listing)===null||s===void 0?void 0:s.id}),q=A(i=>{var o,s;return i==null||(o=i.gig)===null||o===void 0||(s=o.listing)===null||s===void 0?void 0:s.provider}),J=A(i=>{var o,s,r,d,a;return(i==null||(o=i.user)===null||o===void 0?void 0:o.isAuthenticated)&&(i==null||(s=i.user)===null||s===void 0||(r=s.profile)===null||r===void 0?void 0:r._id)&&q&&(i==null||(d=i.user)===null||d===void 0||(a=d.profile)===null||a===void 0?void 0:a._id)===q}),Q=A(i=>{var o,s,r,d,a;return(i==null||(o=i.user)===null||o===void 0?void 0:o.isAuthenticated)&&((i==null||(s=i.user)===null||s===void 0||(r=s.profile)===null||r===void 0?void 0:r.role)==="MODERATOR"||(i==null||(d=i.user)===null||d===void 0||(a=d.profile)===null||a===void 0?void 0:a.role)==="ADMIN")}),se=A(i=>{var o,s,r,d,a;return(i==null||(o=i.user)===null||o===void 0?void 0:o.isAuthenticated)&&(i==null||(s=i.user)===null||s===void 0||(r=s.profile)===null||r===void 0?void 0:r._id)&&_&&(i==null||(d=i.user)===null||d===void 0||(a=d.profile)===null||a===void 0?void 0:a._id)===_}),X=me(),ne=async()=>{try{const de=(await U.get(`${O}/v1/gigs/subscription/feedback/isArchived?listingId=${E}&subscriberId=${_}`)).data,ae=!T;if(T===de){var i,o;const G=await U.patch(`${O}/v1/gigs/subscription/feedback/`,null,{params:{listingId:E,subscriberId:_}}),z=G==null||(i=G.data)===null||i===void 0||(o=i.feedback)===null||o===void 0?void 0:o.isArchived;typeof z=="boolean"?(t(z),z===ae?u.success(`Feedback ${z?"archived":"unarchived"}. This will reflect in 10 minutes.`):u.warning(`Feedback ${z?"archived":"unarchived"} Archival in progress. This will reflect in 10 minutes.`)):u.error("Archive operation completed, but received unexpected response format. Please refresh the page to see the current state.")}else y(!0)}catch(n){var s,r,d,a,b,V;(n==null||(s=n.response)===null||s===void 0?void 0:s.status)===401?u.error("You are not authorized to perform this action. Please log in again."):(n==null||(r=n.response)===null||r===void 0?void 0:r.status)===403?u.error("You don't have permission to archive/unarchive this feedback."):(n==null||(d=n.response)===null||d===void 0?void 0:d.status)===404?u.error("Feedback not found. It may have been deleted or moved."):(n==null||(a=n.response)===null||a===void 0?void 0:a.status)>=500?u.error("Server error occurred while updating feedback. Please try again later."):(n==null?void 0:n.code)==="NETWORK_E
2RROR"||!(n!=null&&n.response)?u.error("Network connection issue. Please check your internet connection and try again."):n!=null&&(b=n.response)!==null&&b!==void 0&&(V=b.data)!==null&&V!==void 0&&V.message?u.error(`Failed to update feedback: ${n.response.data.message}`):u.error("An unexpected error occurred while updating the feedback. Please try again.")}},te=()=>{if(!L){X(Z.showLoginModal(!0,{redirectTo:l,isLoginDismissible:!0}));return}u.dismiss(),U.patch(`${O}/v1/gigs/subscription/feedback/helpful/${v}`).then(i=>{var o,s,r,d,a;const b=(o=i.data)===null||o===void 0||(s=o.message)===null||s===void 0?void 0:s.feedback;k(b!=null&&(r=b.helpful)!==null&&r!==void 0&&(d=r.users)!==null&&d!==void 0&&d.length?b.helpful.users.includes(h):!1),W(b==null||(a=b.helpful)===null||a===void 0?void 0:a.users),u.success("Thank you for your feedback!")}).catch(i=>{var o,s;if((i==null||(o=i.response)===null||o===void 0?void 0:o.status)===304)u.info("Already marked!");else{if((i==null||(s=i.response)===null||s===void 0?void 0:s.status)===401)return w.push(`/login?redirect=${encodeURIComponent(l)}`);u.error("Sorry, that didn't work! Please try again!")}})},re=()=>{if(!L){X(Z.showLoginModal(!0,{redirectTo:l,isLoginDismissible:!0}));return}U.patch(`${O}/v1/gigs/subscription/feedback/report/${v}`,{}).then(i=>{u.success("Thank you for your feedback!")}).catch(i=>{u.error("Sorry, that didn't work! Please try again!")})};return e.jsx(e.Fragment,{children:(J||Q||se||!T)&&e.jsx(Ae,{className:x,rating:c,review:j,onTimeDelivery:f,outcomeSatisfaction:R,recommendToFriend:I,helpfulCount:S==null?void 0:S.length,onHelpfulClick:te,onReportClick:re,createdAt:g,subscriber:m,activeUserId:h,isHelpfulForCurrentUser:p,videoLink:C,onToggleArchive:ne,subscriberId:_,isApprovedGigProvider:P,isArchived:T,isListingMentor:J,isAdminOrModerator:Q,isBeingArchived:B})})}const Ce=fe.lazy(()=>pe(()=>import("./WriteAFeedbackContainer-_7itB1uA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]))),Re=x=>x==null?void 0:x.map((v,c)=>{const{rating:j,onTimeDelivery:m,outcomeSatisfaction:H,recommendToFriend:$,review:f,subscriber:R,gigSubscriptionId:I,helpful:g,createdAt:C,videoLink:N,isArchived:w}=v,l={rating:j,subscriber:R,helpfulCount:(g==null?void 0:g.count)||0,helpfulForUsers:(g==null?void 0:g.users)||[],onTimeDelivery:m,outcomeSatisfaction:H,recommendToFriend:$,review:f,gigSubscriptionId:I,className:"py-8",createdAt:C,videoLink:N,isArchived:w||!1};return e.jsx(Ie,{...l},c)}),K=(x,v,c)=>e.jsxs("div",{className:"flex flex-col justify-between items-start md:flex-row md:items-center",children:[e.jsx("p",{className:"font-serif text-sm font-bold md:text-base md:font-normal text-secondary-dark-300",children:x}),e.jsxs("span",{className:"flex justify-between items-center space-x-4 w-full md:w-1/2",children:[e.jsx(Ne,{variant:v&&c?"tertiary":"secondary",total:c,progress:v,wrapperClass:"h-2 flex-grow",progressClass:"h-2"}),c?e.jsxs("p",{className:"font-serif text-base font-semibold min-w-10 text-tertiary",children:[v?Math.floor(v/c*100):"0","%"]}):null]})]}),ni=({rating:x=0,reviewCount:v=0,reviews:c=[],setAllReviews:j=()=>{},listingData:m,hideModal:H,showWriteReviewModal:$=!1,showOnlyReviews:f,currentPage:R,fetchAllReviews:I,username:g,slug:C,sortOptions:N,sortBy:w,metricData:l,subscribeToAlert:h,loggedInUserId:L,subscriptionData:p})=>{var k;const{width:S}=we();if(!m)return null;const{description:W,type:T,gamePlayer:t}=m,B=()=>{var y,P,_,E;return f?e.jsx(e.Fragment,{children:e.jsx(M,{variant:"text-underline",id:"skylift-write-a-review",label:S>=Y?`${p!=null&&(y=p.feedback)!==null&&y!==void 0&&(P=y.review)!==null&&P!==void 0&&P.length?"Edit your review":"Write a review"}`:"",size:"base",startIcon:e.jsx(ee,{className:`${S>=Y?"mr-2.5":""} h-4 w-4 flex-shrink-0`}),href:"#create"})}):e.jsx("span",{className:"overflow-hidden fixed right-5 bottom-28 rounded-3xl md:relative md:right-auto md:bottom-auto md:rounded-lg",children:e.jsx(M,{id:"skylift-write-a-review",variant:"primary",label:S>=Y?`${p!=null&&(_=p.feedback)!==null&&_!==void 0&&(E=_.review)!==null&&E!==void 0&&E.length?"Edit your review":"Write a review"}`:"",size:"base",startIcon:e.jsx(ee,{className:"flex-shrink-0 my-1.5 ml-0.5 w-8 h-8 md:my-0 md:mr-2 md:w-6 md:h-6"}),href:"#create"})})};return e.jsxs(e.Fragment,{children:[e.jsxs(ke,{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("title",{children:`Nbyula - ${m.description||((k=m.category)===null||k===void 0?void 0:k.name)} by ${t==null?void 0:t.firstName}`}),e.jsx("meta",{name:"description",content:m.description}),e.jsx("meta",{name:"author",content:t==null?void 0:t.firstName}),e.jsx("meta",{property:"og:title",content:`Nbyula - ${m.description} by ${t==null?void 0:t.firstName}`}),e.jsx("meta",{property:"og:description",content:m.description})]}),e.jsxs("div",{className:`mx-auto w-full ${f?"":"mt-7 mb-10 md:mt-18 md:max-w-3xl lg:max-w-5xl"}`,children:[f?null:e.jsxs("div",{className:"flex flex-col justify-between space-y-6 md:flex-row md:space-y-0 md:space-x-8",children:[e.jsxs("div",{className:"w-full lg:w-1/2",children:[e.jsx(D,{to:`/gigs/listings/${t.userName}/${C}`,children:e.jsx("h4",{className:"mb-3 font-sans text-2xl font-bold md:text-3xl text-secondary",children:W})}),e.jsxs("p",{className:"font-serif text-base font-normal text-secondary-dark-300",children:[xe[T]," by"," ",e.jsxs(D,{className:"font-semibold",to:`/profile/${t.userName}`,children:[le(t==null?void 0:t.firstName)," ",le(t==null?void 0:t.lastName)]})]})]}),e.jsx("div",{className:"w-full lg:w-1/2",children:l?e.jsxs("div",{className:"flex flex-col p-4 space-y-4 rounded-lg border border-primary-light-100",children:[K("Delivery on time",l==null?void 0:l.onTimeDelivery,l==null?void 0:l.totalRatingCount),K("Outcome Satisfaction",l==null?void 0:l.outcomeSatisfaction,l==null?void 0:l.totalRatingCount),K("Recommend this Skylift",l==null?void 0:l.recommendToFriend,l==null?void 0:l.totalRatingCount)]}):null})]}),e.jsxs("div",{className:`flex justify-between ${f?v?"mb-6":"":"mb-6 mt-18"}`,children:[e.jsxs("div",{className:"flex items-center space-x-1",children:[((l==null?void 0:l.totalRating)/(l==null?void 0:l.totalRatingCount)).toFixed(1)>
20?e.jsx(oe,{rated:((l==null?void 0:l.totalRating)/(l==null?void 0:l.totalRatingCount)).toFixed(1)}):null,e.jsxs("span",{className:"flex text-xl font-medium text-space",children:[(l==null?void 0:l.totalRating)>0?e.jsx("span",{className:"",children:((l==null?void 0:l.totalRating)/(l==null?void 0:l.totalRatingCount)).toFixed(1)}):""," "]})]}),e.jsxs("div",{className:"flex space-x-4",children:[e.jsx($e,{options:N,onChange:y=>{I(1,y)},className:`w-40 flex-shrink-0 ${f?"hidden":"hidden sm:block"}`,value:w,isSearchable:!1,style:{valueContainer:(y,P)=>({...y,padding:"0.75rem 1rem"}),singleValue:(y,P)=>({...y,fontSize:"1rem",lineHeight:"1.25rem",fontWeight:500,color:"#6E6D7A"})}}),B()]})]}),e.jsx("div",{className:"flex flex-col space-y-2",children:Re(c)}),v>(c==null?void 0:c.length)?e.jsx("section",{className:"mt-4 flex justify-start",children:e.jsx(M,{label:"See more reviews",variant:"text-underline",href:f?`/gigs/feedback/listings/${g}/${C}`:null,onClick:()=>{f||(I(R+1),h(he["REMAINING-SEATS"]))},size:"base"})}):null]}),$?ge.createPortal(e.jsx(F.Suspense,{fallback:e.jsx("div",{}),children:e.jsx(Ce,{hideModal:H,listingData:m,setAllReviews:j,loggedInPlayerFeedback:p==null?void 0:p.feedback})}),document.getElementById("modal")):null]})};export{ni as default};
3//# sourceMappingURL=GigFeedbackComponent--IOf4dKl.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.