PageSourceSearch

https://songful.com/build/assets/status-C1nmewxg.js

js songful.com collected 2026-10-04 22:33:02 UTC 30,735 bytes, 2 lines download raw bytes

1import{r as S,j as e,L as T,u as se,c as ae}from"./app-DivdtaH4.js";import{d as f}from"./dayjs.min-BtRNl8Rs.js";import{a as B}from"./advancedFormat-hZhRveuV.js";import{d as ne}from"./duration-CVmGXVSh.js";import{U as oe}from"./styles-CgmiyFem.js";import{M as ie}from"./meta-tags-Cqk-bZ4m.js";import{p}from"./index-DfFfZaZX.js";import{A as le,a as ce,b as ue,c as de}from"./accordion-D9S1kN-l.js";import{b as w,B as F}from"./button-D2OrXg2x.js";import{D as W,a as q,b as Y,d as V,c as H}from"./dialog-DkNJoEHl.js";import{S as j}from"./song-D15i2RMX.js";import{B as me,u as fe}from"./base-layout-D2N6pn4n.js";import{c as v,k as K,a as $}from"./utils-By3H3J5f.js";import{A as pe}from"./arrow-right-DNtjS_t8.js";import{M as he}from"./maximize-tuDqcj6b.js";import{I as xe}from"./info-BnjeEPb5.js";import"./index-DLkOAJUo.js";import"./index-Chjiymov.js";import"./chevron-down-DdJXc1Fe.js";import"./index-t1Y70FAT.js";import"./index-BtM6ths2.js";import"./index-DRCSh_Qg.js";import"./index-l6EME1BO.js";import"./tslib.es6-M_FJ09fS.js";import"./index-CmsYJ3mz.js";import"./index-D0ry-UYO.js";/* empty css                   */function J(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function ye(t,a){for(var n=0;n<a.length;n++){var s=a[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function Q(t,a,n){return a&&ye(t.prototype,a),t}function X(t,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(a&&a.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),a&&z(t,a)}function M(t){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},M(t)}function z(t,a){return z=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},z(t,a)}function ge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function ve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function be(t,a){return a&&(typeof a=="object"||typeof a=="function")?a:ve(t)}function Z(t){var a=ge();return function(){var s=M(t),r;if(a){var c=M(this).constructor;r=Reflect.construct(s,arguments,c)}else r=s.apply(this,arguments);return be(this,r)}}function je(t){return Ne(t)||we(t)||Te(t)||Se()}function Ne(t){if(Array.isArray(t))return U(t)}function we(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function Te(t,a){if(t){if(typeof t=="string")return U(t,a);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return U(t,a)}}function U(t,a){(a==null||a>t.length)&&(a=t.length);for(var n=0,s=new Array(a);n<a;n++)s[n]=t[n];return s}function Se(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=String(t);if(a===0)return n;var s=n.match(/(.*?)([0-9]+)(.*)/),r=s?s[1]:"",c=s?s[3]:"",i=s?s[2]:n,u=i.length>=a?i:(je(Array(a)).map(function(){return"0"}).join("")+i).slice(a*-1);return"".concat(r).concat(u).concat(c)}var ee={daysInHours:!1,zeroPadTime:2};function _e(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.now,s=n===void 0?Date.now:n,r=a.precision,c=r===void 0?0:r,i=a.controlled,u=a.offsetTime,d=u===void 0?0:u,h=a.overtime,m;typeof t=="string"?m=new Date(t).getTime():t instanceof Date?m=t.getTime():m=t,i||(m+=d);var y=i?m:m-s(),g=Math.min(20,Math.max(0,c)),N=Math.round(parseFloat(((h?y:Math.max(0,y))/1e3).toFixed(g))*1e3),b=Math.abs(N)/1e3;return{total:N,days:Math.floor(b/(3600*24)),hours:Math.floor(b/3600%24),minutes:Math.floor(b/60%60),seconds:Math.floor(b%60),milliseconds:Number((b%1*1e3).toFixed()),completed:N<=0}}function De(t,a){var n=t.days,s=t.hours,r=t.minutes,c=t.seconds,i=Object.assign(Object.assign({},ee),a),u=i.daysInHours,d=i.zeroPadTime,h=i.zeroPadDays,m=h===void 0?d:h,y=Math.min(2,d),g=u?E(s+n*24,d):E(s,y);return{days:u?"":E(n,m),hours:g,minutes:E(r,y),seconds:E(c,y)}}var te=function(t){X(n,t);var a=Z(n);function n(){var s;return J(this,n),s=a.apply(this,arguments),s.state={count:s.props.count||3},s.startCountdown=function(){s.interval=window.setInterval(function(){var r=s.state.count-1;r===0?(s.stopCountdown(),s.props.onComplete&&s.props.onComplete()):s.setState(function(c){return{count:c.count-1}})},1e3)},s.stopCountdown=function(){clearInterval(s.interval)},s.addTime=function(r){s.stopCountdown(),s.setState(function(c){return{count:c.count+r}},s.startCountdown)},s}
2return Q(n,[{key:"componentDidMount",value:function(){this.startCountdown()}},{key:"componentWillUnmount",value:function(){clearInterval(this.interval)}},{key:"render",value:function(){return this.props.children?S.cloneElement(this.props.children,{count:this.state.count}):null}}]),n}(S.Component);te.propTypes={count:p.number,children:p.element,onComplete:p.func};var G=function(t){X(n,t);var a=Z(n);function n(s){var r;if(J(this,n),r=a.call(this,s),r.mounted=!1,r.initialTimestamp=r.calcOffsetStartTimestamp(),r.offsetStartTimestamp=r.props.autoStart?0:r.initialTimestamp,r.offsetTime=0,r.legacyMode=!1,r.legacyCountdownRef=null,r.tick=function(){var i=r.calcTimeDelta(),u=i.completed&&!r.props.overtime?void 0:r.props.onTick;r.setTimeDeltaState(i,void 0,u)},r.setLegacyCountdownRef=function(i){r.legacyCountdownRef=i},r.start=function(){if(!r.isStarted()){var i=r.offsetStartTimestamp;r.offsetStartTimestamp=0,r.offsetTime+=i?r.calcOffsetStartTimestamp()-i:0;var u=r.calcTimeDelta();r.setTimeDeltaState(u,"STARTED",r.props.onStart),!r.props.controlled&&(!u.completed||r.props.overtime)&&(r.clearTimer(),r.interval=window.setInterval(r.tick,r.props.intervalDelay))}},r.pause=function(){r.isPaused()||(r.clearTimer(),r.offsetStartTimestamp=r.calcOffsetStartTimestamp(),r.setTimeDeltaState(r.state.timeDelta,"PAUSED",r.props.onPause))},r.stop=function(){r.isStopped()||(r.clearTimer(),r.offsetStartTimestamp=r.calcOffsetStartTimestamp(),r.offsetTime=r.offsetStartTimestamp-r.initialTimestamp,r.setTimeDeltaState(r.calcTimeDelta(),"STOPPED",r.props.onStop))},r.isStarted=function(){return r.isStatus("STARTED")},r.isPaused=function(){return r.isStatus("PAUSED")},r.isStopped=function(){return r.isStatus("STOPPED")},r.isCompleted=function(){return r.isStatus("COMPLETED")},s.date){var c=r.calcTimeDelta();r.state={timeDelta:c,status:c.completed?"COMPLETED":"STOPPED"}}else r.legacyMode=!0;return r}return Q(n,[{key:"componentDidMount",value:function(){this.legacyMode||(this.mounted=!0,this.props.onMount&&this.props.onMount(this.calcTimeDelta()),this.props.autoStart&&this.start())}},{key:"componentDidUpdate",value:function(r){this.legacyMode||this.props.date!==r.date&&(this.initialTimestamp=this.calcOffsetStartTimestamp(),this.offsetStartTimestamp=this.initialTimestamp,this.offsetTime=0,this.setTimeDeltaState(this.calcTimeDelta()))}},{key:"componentWillUnmount",value:function(){this.legacyMode||(this.mounted=!1,this.clearTimer())}},{key:"calcTimeDelta",value:function(){var r=this.props,c=r.date,i=r.now,u=r.precision,d=r.controlled,h=r.overtime;return _e(c,{now:i,precision:u,controlled:d,offsetTime:this.offsetTime,overtime:h})}},{key:"calcOffsetStartTimestamp",value:function(){return Date.now()}},{key:"addTime",value:function(r){this.legacyCountdownRef.addTime(r)}},{key:"clearTimer",value:function(){window.clearInterval(this.interval)}},{key:"isStatus",value:function(r){return this.state.status===r}},{key:"setTimeDeltaState",value:function(r,c,i){var u=this;if(this.mounted){var d=r.completed&&!this.state.timeDelta.completed,h=r.completed&&c==="STARTED";d&&!this.props.overtime&&this.clearTimer();var m=function(){i&&i(u.state.timeDelta),u.props.onComplete&&(d||h)&&u.props.onComplete(r,h)};return this.setState(function(y){var g=c||y.status;return r.completed&&!u.props.overtime?g="COMPLETED":!c&&g==="COMPLETED"&&(g="STOPPED"),{timeDelta:r,status:g}},m)}}},{key:"getApi",value:function(){return this.api=this.api||{start:this.start,pause:this.pause,stop:this.stop,isStarted:this.isStarted,isPaused:this.isPaused,isStopped:this.isStopped,isCompleted:this.isCompleted}}},{key:"getRenderProps",value:function(){var r=this.props,c=r.daysInHours,i=r.zeroPadTime,u=r.zeroPadDays,d=this.state.timeDelta;return Object.assign(Object.assign({},d),{api:this.getApi(),props:this.props,formatted:De(d,{daysInHours:c,zeroPadTime:i,zeroPadDays:u})})}},{key:"render",value:function(){if(this.legacyMode){var r=this.props,c=r.count,i=r.children,u=r.onComplete;return S.createElement(te,{ref:this.setLegacyCountdownRef,count:c,onComplete:u},i)}var d=this.props,h=d.className,m=d.overtime,y=d.children,g=d.renderer,N=this.getRenderProps();if(g)return g(N);
2if(y&&this.state.timeDelta.completed&&!m)return S.cloneElement(y,{countdown:N});var b=N.formatted,D=b.days,l=b.hours,o=b.minutes,x=b.seconds;return S.createElement("span",{className:h},N.total<0?"-":"",D,D?":":"",l,":",o,":",x)}}]),n}(S.Component);G.defaultProps=Object.assign(Object.assign({},ee),{controlled:!1,intervalDelay:1e3,precision:0,autoStart:!0});G.propTypes={date:p.oneOfType([p.instanceOf(Date),p.string,p.number]),daysInHours:p.bool,zeroPadTime:p.number,zeroPadDays:p.number,controlled:p.bool,intervalDelay:p.number,precision:p.number,autoStart:p.bool,overtime:p.bool,className:p.string,children:p.element,renderer:p.func,now:p.func,onMount:p.func,onStart:p.func,onPause:p.func,onStop:p.func,onTick:p.func,onComplete:p.func};f.extend(B);const Ce=({date:t})=>e.jsx(G,{zeroPadTime:2,zeroPadDays:2,date:t,renderer:({formatted:{hours:a,minutes:n,days:s},completed:r})=>r?null:e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("div",{className:"rounded-xl border-gray-200 bg-white px-6 py-8 sm:px-16 relative border",children:[e.jsx("div",{className:"top-2 right-2 animate-pulse bg-emerald-400 absolute h-[14px] w-[14px] rounded-full"}),e.jsx("p",{className:"mb-4 text-lg font-medium text-gray-700 text-center",children:"Your song will be ready in..."}),e.jsx("div",{children:e.jsxs("div",{className:"gap-4 flex items-start justify-center",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-5xl font-extrabold text-gray-900",children:s}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"days"})]}),e.jsx("div",{className:"bg-gray-300 h-[52px] w-px"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-5xl font-extrabold text-gray-900",children:a}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"hours"})]}),e.jsx("div",{className:"bg-gray-300 h-[52px] w-px"}),e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-5xl font-extrabold text-gray-900",children:n}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"mins"})]})]})}),e.jsx("div",{className:"mt-8 flex justify-center",children:e.jsxs("p",{className:"px-6 py-1 font-medium text-white rounded-full bg-linear-to-r from-gradient-one to-gradient-two text-center",children:["by ",f(t).format("dddd, Do MMMM h:mma")]})})]})})});f.extend(B);f.extend(ne);function Ie(t){if(t.status==="COMPLETED"&&(t.is_automated||(t==null?void 0:t.delivery_date)&&f().isAfter(f(t.delivery_date).subtract(1,"hour"))))return{label:"Completed",dot:"bg-emerald-500"};switch(t.status){case j.LYRICS_CREATION:return{label:"Approve your lyrics",dot:"bg-amber-500"};case j.GENERATING:return{label:"Creating your song options",dot:"bg-purple-500"};case j.REVIEW:return t.is_automated?{label:"Choose your song",dot:"bg-amber-500"}:{label:"In production",dot:"bg-purple-500"};case j.CANCELLED:return{label:"Cancelled",dot:"bg-neutral-400"};default:return{label:"In production",dot:"bg-purple-500"}}}function I({dot:t,pulse:a,title:n,children:s}){return e.jsx("div",{className:"p-1.5 sm:p-2 rounded-2xl bg-black",children:e.jsxs("div",{className:"p-5 sm:p-8 rounded-xl bg-neutral-900",children:[e.jsxs("h2",{className:"gap-3 text-2xl sm:text-3xl text-white flex items-center font-display",children:[t&&e.jsxs("span",{className:"size-3 relative flex shrink-0","aria-hidden":"true",children:[a&&e.jsx("span",{className:v("animate-ping absolute inline-flex h-full w-full rounded-full opacity-75",t)}),e.jsx("span",{className:v("size-3 relative inline-flex rounded-full",t)})]}),e.jsx("span",{className:"text-balance",children:n})]}),s]})})}const Oe="border-neutral-700 text-white hover:bg-neutral-800";function Ee({currentDeliveryDate:t,songBoostProducts:a,songCode:n}){var l;const[s,r]=S.useState(!1),[c,i]=S.useState(!1),{addCartLineItemWithSongCode:u,cart:d,removeLineItem:h}=fe(),{currency:m}=se().props,y=a.flatMap(o=>o.variants).filter(o=>{var x,_;return(_=(x=o.customFields)==null?void 0:x.deliverySpeed)==null?void 0:_.hours}).sort((o,x)=>{const _=o.customFields.deliverySpeed.hours,C=x.customFields.deliverySpeed.hours;return _-C}),g=a.flatMap(o=>o.variants.map(x=>
2x.sku)),N=((l=d==null?void 0:d.lines)==null?void 0:l.filter(o=>g.includes(o.productVariant.sku)))||[],b=o=>N.some(x=>x.productVariant.id===o),D=async o=>{i(!0);try{for(const x of N)await h({lineItemId:x.id,skipRefetch:!0});await u({variantId:o,songCode:n}),ae.visit("/cart")}catch(x){console.error("Error adding boost to cart:",x),i(!1)}};return e.jsxs(W,{open:s,onOpenChange:r,children:[e.jsx(q,{asChild:!0,children:e.jsx("button",{className:"text-base font-medium mt-4 text-white cursor-pointer underline",children:"Want it sooner?"})}),e.jsxs(Y,{className:"max-w-3xl max-h-[80vh] overflow-y-auto",children:[e.jsx(V,{children:e.jsx(H,{className:"text-2xl text-center",children:"Get your song earlier"})}),e.jsxs("div",{className:"",children:[e.jsxs("p",{className:"text-neutral-600 text-lg text-center",children:["Your current delivery date is ",e.jsx("span",{className:"font-bold",children:f(t).format("dddd Do MMMM h:mma")}),"."]}),e.jsx("p",{className:"text-neutral-600 mb-8 text-lg text-center",children:"You can speed up your delivery by selecting one of the boost options below."}),e.jsx("div",{className:"sm:grid-cols-2 gap-4 grid grid-cols-1",children:y.map(o=>{const x=o.customFields.deliverySpeed.hours,_=o.customFields.deliverySpeed.title,C=f(),O=f(t).diff(C,"hour",!0),P=Math.max(24,O-x),A=C.add(P,"hour"),re=P===24,L=x>O+24,k=b(o.id);return e.jsxs("div",{className:v("rounded-xl border-neutral-200 p-4 flex flex-col border",L?"bg-neutral-100 opacity-60":k?"bg-purple-50 border-purple-300":"bg-neutral-50"),children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-lg font-bold text-neutral-700",children:_}),e.jsxs("p",{className:"text-base font-medium mb-2",children:["Get your song by ",e.jsx("span",{className:"underline",children:A.format("dddd Do MMMM h:mma")}),re&&"*"]}),e.jsx("p",{className:"text-lg font-bold",children:$(o.price,(d==null?void 0:d.currencyCode)||m||"USD")})]}),e.jsx("div",{className:"mt-4",children:e.jsx(F,{variant:"dark",className:"",onClick:()=>D(o.id),disabled:c||L||k,children:c?"Adding...":L?"Not Available":k?"Already Selected":"Select"})})]},o.id)})}),e.jsx("p",{className:"text-neutral-700 text-base mt-6 text-center",children:"* Your delivery time will be shortened to a minimum of 24 hours from the moment your boost purchase is complete."})]})]})]})}function Pe({song:t,customerEmail:a,songBoostProducts:n}){var m;const s=t.status==="COMPLETED"&&(t.is_automated||(t==null?void 0:t.delivery_date)&&f().isAfter(f(t.delivery_date).subtract(1,"hour"))),r=(t==null?void 0:t.status)===j.CANCELLED,c=n.flatMap(y=>y.variants.map(g=>g.sku)),i=(m=t.add_ons)==null?void 0:m.some(y=>c.includes(y.sku)),u=t.delivery_date?f(t.delivery_date).diff(f(),"hour"):null,d=!t.song_remake&&!i&&u!==null&&u>24;if(t.status===j.LYRICS_CREATION)return e.jsxs(I,{dot:"bg-amber-500",pulse:!0,title:"Approve your lyrics",children:[e.jsx("p",{className:"mt-3 text-neutral-400",children:"Click below to review, edit and confirm your lyrics."}),e.jsx(T,{prefetch:!1,href:`/confirm-your-lyrics/${t.song_code}`,className:v(w({variant:"gradient",size:"lg"}),"mt-6 w-full"),children:"Approve my lyrics"})]});if(t.status===j.GENERATING)return e.jsxs(I,{dot:"bg-purple-500",pulse:!0,title:"We’re writing your song options",children:[e.jsx("p",{className:"mt-3 text-neutral-400",children:"You’ll get an email the moment they’re ready to listen to, usually within the hour."}),e.jsx(T,{prefetch:!1,href:`/song/${t.song_code}/select`,className:v(w({variant:"gradient",size:"lg"}),"mt-6 w-full"),children:"Track this order"})]});if(t.status===j.REVIEW&&t.is_automated)return e.jsxs(I,{dot:"bg-amber-500",pulse:!0,title:"Choose your song",children:[e.jsx("p",{className:"mt-3 text-neutral-400",children:"Now for the exciting part! Click below to listen to your song options and choose the one you love the most."}),e.jsx(T,{prefetch:!1,href:`/song/${t.song_code}/select`,className:v(w({variant:"gradient",size:"lg"}),"mt-6 w-full"),children:"Choose my song"})]});if(s)return e.jsxs(I,{dot:"bg-emerald-500",title:"Your song is ready",children:[e.jsx("p",{className:"mt-3 text-neutral-400",children:"Now it’s time to share it with the recipient! Read our song reveal guide to learn how to make your Songful reveal perfect, and how you can get another song for free!"}),e.jsxs("div",{className:"mt-6 gap-3 flex flex-col",children:[e.jsx(T,{href:`/song/${t.song_code}`,className:v(w({variant:"gradient"}),"w-full"),children:"View Song Page"}),e.jsx("a",{href:"/song-reveal-guide",target:"_blank",rel:"noopener noreferrer",className:v(w({variant:"outline"}),Oe,"w-full"),children:"View Reveal Guide"})]})]});if(r)return e.jsx(I,{dot:"bg-neutral-400",title:"Your song has been cancelled",children:e.jsxs("p",{className:"mt-3 text-neutral-400",children:["If you think there has been a mistake, please contact us through our"," ",e.jsx("a",{href:"https://intercom.help/songful/en/",target:"_blank",className:"text-white underline",children:"customer support center"})," ","as soon as possible."]})});const h=()=>t.lyrics_created_at&&t.delivery_speed_hours?f(t.lyrics_created_at).add(t.delivery_speed_hours,"hour").toDate():new Date(f(t.delivery_date).toISOString());return e.jsxs(I,{dot:"bg-purple-500",pulse:!0,title:"Your song is in production",children:[e.jsxs("p",{className:"mt-3 text-neutral-400",children:["Your song details and lyrics are now confirmed and can't be changed. Keep an eye on your inbox, as we'll email your song to"," ",e.jsx("span",{className:"font-semibold text-white",children:K(a||"")})," as soon as it's finished."]}),e.jsx(Ce,{date:h()}),d&&e.jsx("div",{className:"flex justify-center",children:e.jsx(Ee,{currentDeliveryDate:h(),songBoostProducts:n,songCode:t.song_code})})]})}function Ae({song:t,productAddOns:a}){var D;const[n,s]=S.useState(!1),[r,c]=S.useState(null),i=t.status==="COMPLETED"&&(t.is_automated||(t==null?void 0:t.delivery_date)&&f().isAfter(f(t.delivery_date).subtract(1,"hour"))),u=((D=t.add_ons)==null?void 0:D.filter(l=>l.type!=="SONG_FEATURE"))||[],d=l=>l==="MUSIC_VIDEO_PHOTO_SLIDESHOW"?"Once your song is ready you'll be able to create your Photo Slideshow Music Video here.":l!=null&&l.includes("DIGITAL_LYRIC_ART")?"Once your song is ready you'll be able to access and download your Digital Lyrics Art
2work here.":l==="YOUTUBE_STREAMING"?"Once your song is ready we'll upload it to YouTube. You'll be able to access the link here.":"This add-on will be ready as soon as your song is complete. You can come back here to access it then.",h=l=>{c(l||null),s(!0)},m=(l,o)=>e.jsxs("span",{className:"gap-1.5 text-neutral-500 inline-flex items-center",children:[e.jsx("span",{className:v("size-2.5 shrink-0 rounded-full",l)})," ",o]}),y=(l,o)=>{switch(l){case"CREATED":return m("bg-orange-500","Waiting for song");case"IN_PRODUCTION":return o==="MUSIC_VIDEO_PHOTO_SLIDESHOW"?m("bg-purple-500","Action Required"):o!=null&&o.includes("DIGITAL_LYRIC_ART")?m("bg-orange-500","Waiting for song"):m("bg-orange-500","Processing");case"PROCESSING":return m("bg-orange-500","Processing");case"COMPLETED":return i?m("bg-emerald-500","Ready"):m("bg-orange-500","Waiting for song");case"CANCELLED":return m("bg-neutral-400","Cancelled");case"NOT_PURCHASED":return m("bg-neutral-400","Not purchased yet");default:return m("bg-neutral-400","Not Ready")}},g=l=>l.sku==="YOUTUBE_STREAMING"?{url:l.details.youtube_url,text:"View on YouTube",external:!0}:l.sku==="MUSIC_VIDEO_PHOTO_SLIDESHOW"?{url:`/song/${t.song_code}/photo-slideshow`,text:"View Photo Slideshow",external:!1}:l.type==="DIGITAL_ART"?{url:`/song/${t.song_code}/lyrics-art`,text:"View Lyrics Art",external:!1}:null,N=l=>u.find(o=>o.sku===l),b=(l,o,x)=>l?l.sku==="MUSIC_VIDEO_PHOTO_SLIDESHOW"&&l.status==="IN_PRODUCTION"&&i?e.jsx(T,{href:`/song/${t.song_code}/photo-slideshow/editor`,className:w({variant:"default",size:"sm"}),children:"Create Now"}):o&&l.status==="COMPLETED"&&i?o.external?e.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:v(w({variant:"outline",size:"sm"}),"border-neutral-200"),children:"View"}):e.jsx(T,{target:"_blank",href:o.url,className:v(w({variant:"outline",size:"sm"}),"border-neutral-200"),children:"View"}):o?e.jsxs(F,{variant:"outline",size:"sm",className:"gap-1.5 border-neutral-200 text-neutral-500",onClick:()=>h(x),children:[e.jsx(xe,{className:"w-4 h-4"}),"Not ready"]}):null:e.jsx(T,{href:`/song/${t.song_code}/add-ons-purchase`,className:w({variant:"default",size:"sm"}),children:"Purchase"});return e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Your add ons"}),e.jsx("p",{className:"mt-1 text-neutral-500",children:"Extras you can add to this order at any time."}),a.length>0?e.jsxs("div",{className:"gap-4 mt-4 flex flex-col",children:[a.map(l=>{var O;let o=null;for(const P of l.variants){const A=N(P.sku);if(A){o=A;break}}const x=o?o.status:"NOT_PURCHASED",_=o?g(o):null,C=o?o.sku:void 0,R=b(o,_,C);return e.jsxs("div",{className:"border-neutral-200 gap-x-3 sm:gap-x-4 p-4 sm:p-5 rounded-2xl sm:grid-cols-[auto_minmax(0,1fr)_auto] bg-white grid grid-cols-[auto_minmax(0,1fr)] items-center border",children:[((O=l.featuredAsset)==null?void 0:O.preview)&&(l.variants[0].sku.includes("DIGITAL_LYRIC_ART")?e.jsxs("div",{className:"w-12 sm:w-14 relative shrink-0",children:[e.jsx("div",{className:"pointer-events-none absolute right-[2px] bottom-[2px] z-10",children:e.jsx(he,{className:"h-4 w-4 bg-white p-1 text-neutral-600 rounded-full"})}),e.jsx(oe,{zoomMargin:32,children:e.jsx("img",{src:l.featuredAsset.preview,loading:"lazy",className:"h-auto w-full rounded-lg"})})]}):e.jsx("img",{src:l.featuredAsset.preview,loading:"lazy",className:"size-12 sm:size-14 shrink-0 rounded-lg object-cover"})),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"text-lg font-bold truncate",children:l.name}),e.jsx("div",{className:"mt-1 text-sm sm:text-base",children:y(x,C)})]}),R&&e.jsx("div",{className:"mt-3 sm:mt-0 sm:col-start-3 col-start-2",children:R})]},l.id)}),e.jsx(T,{href:`/song/${t.song_code}/add-ons-purchase`,className:v(w({variant:"gradient"}),"w-full"),children:"View & purchase add ons"})]}):e.jsx("p",{className:"text-neutral-500 border-neutral-200 p-6 mt-4 rounded-2xl bg-white border text-center",children:"No add-ons available for this song."}),e.jsx(W,{open:n,onOpenChange:s,children:e.jsxs(Y,{className:"max-w-md",children:[e.jsx(V,{children:e.jsx(H,{className:"text-xl",children:"Waiting for your song"})}),e.jsx("div",{className:"space-y-4",children:e.jsx("p",{children:d(r)})})]})})]})}function ke({song:t,remakePrice:a}){if(!((t==null?void 0:t.delivery_date)&&f().isAfter(f(t.delivery_date).subtract(1,"hour"))))return null;const s=a?$(a.amount*100,a.currency):"$20";return e.jsx("div",{className:"mt-10",children:e.jsx(le,{type:"single",collapsible:!0,className:"border-neutral-200 rounded-2xl bg-white border",children:e.jsxs(ce,{value:"item-1",className:"border-none",children:[e.jsx(ue,{iconSize:"md",className:"px-5 sm:px-6 py-5 text-lg sm:text-xl font-bold items-center",children:"Want to remake your song?"}),e.jsx(de,{className:"px-5 sm:px-6 pb-6",children:e.jsxs("div",{className:"space-y-4 text-base text-neutral-600",children:[e.jsxs("p",{children:["We're really sorry to hear that your song isn't quite right. We can remake it for you, and get it closer to what you were envisaging. There is a small fee of ",s," for remakes, which works out a lot better than ordering an entirely new song. This fee is just to cover our costs, since each song is made from scratch. If you'd like to start the remake process, please click below."]}),e.jsx(T,{href:`/song/${t.song_code}/remake`,className:v(w({variant:"default",size:"sm"})),children:"Remake my song"}),e.jsxs("p",{className:"italic",children:["If you think we made a genuine error with your song, then please"," ",e.jsx("a",{href:"https://tally.so/r/3E6arL",target:"_blank",className:"underline",children:"click here"})," ","so we can make it right, free of charge."]})]})})]})})})}function Me({song:t}){var s;const a=t.status==="COMPLETED"&&(t.is_automated||(t==null?void 0:t.delivery_date)&&f().isAfter(f(t.delivery_date).subtract(1,"hour"))),n=(s=t.add_ons)==null?void 0:s.some(r=>r.sku==="MUSIC_VIDEO_PHOTO_SLIDESHOW"&&r.status==="IN_PRODUCTION");return!a||!n?null:e.jsx("div",{className:"bottom-0 left-0 right-0 bg-neutral-900 text-white p-4 shadow-lg fixed z-50",children:e.jsxs("div",{className:"max-w-3xl mx-auto flex flex-wrap items-center justify-between",children:[e.jsx("div",{className:"gap-3 sm:mb-0 mb-2 flex items-center",children:e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-lg sm:text-left text-center",children:"Action Required"}),e.jsx("p",{className:"text-base sm:text-left text-center",children:"Create your Photo Slideshow Music Video now!"})]})}),e.jsx(T,{href:`/song/${t.song_code}/photo-slideshow/editor`,className:"bg-white text-neutral-900 sm:m-0 px-4 py-2 font-semibold hover:bg-neutral-100 m-auto rounded-md transition-colors",children:"Create Now"})]})})}function Re({orders:t}){const a=[...t].sort((s,r)=>f(r.orderPlacedAt).diff(f(s.orderPlacedAt))),n=s=>s.lines.map(c=>c.productVariant.name).join(", ");return e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Your transactions"}),e.jsxs("div",{className:"gap-4 mt-4 flex flex-col",children:[a.map(s=>{var r;return e.jsxs("div",{className:"border-neutral-200 p-5 sm:p-6 rounded-2xl bg-white border",children:[e.jsxs("div",{className:"gap-3 flex items-baseline justify-between",children:[e.jsx("p",{className:"text-lg font-bold",children:$(s.totalWithTax,s.currencyCode)}),e.jsx("p",{className:"text-sm sm:text-base text-neutral-500 shrink-0",children:f(s.orderPlacedAt).format("D MMM YYYY, h:mma")})]}),e.jsx("p",{className:"mt-1",children:n(s)}),e.jsx("p",{className:"mt-0.5 text-sm text-neutral-500",children:K((r=s==null?void 0:s.customer)==null?void 0:r.emailAddress)}),e.jsx(T,{href:`/order/${s.id}`,className:v(w({variant:"outline",size:"sm"}),"mt-4 border-neutral-200"),children:"View transaction"})]},s.id)}),a.length===0&&e.jsx("p",{className:"text-neutral-500 border-neutral-200 p-6 rounded-2xl bg-white border text-center",children:"No transactions foun
2d."})]})]})}function ut({order:t,song:a,orders_related_to_song:n,product_add_ons:s,song_boost_products:r,remake_product_price:c}){var h,m;const i=(h=t==null?void 0:t.customer)==null?void 0:h.emailAddress,u=Ie(a),d=a.status===j.LYRICS_CREATION||a.status===j.GENERATING||a.status===j.REVIEW&&a.is_automated;return e.jsxs(me,{showCreateYourSong:!1,showCurrency:!1,accountLink:"my-account",children:[e.jsx(ie,{title:"Song Status"}),e.jsx("div",{className:"bg-neutral-50 grow",children:e.jsxs("div",{className:"py-10 px-4 sm:py-14 sm:px-6 max-w-3xl mx-auto w-full",children:[e.jsx("h1",{className:"sm:text-4xl font-display text-[29px]",children:d?"Thanks for your order":"Order Management"}),e.jsxs("div",{className:"gap-3 mt-3 flex flex-wrap items-center",children:[e.jsxs("p",{className:"border-neutral-200 px-4 py-1.5 bg-white rounded-full border",children:["Order ",e.jsx("span",{className:"font-bold",children:a?a.song_code:"N/A"})]}),e.jsxs("p",{className:"gap-1.5 font-bold flex items-center",children:[e.jsx("span",{className:v("size-2.5 shrink-0 rounded-full",u.dot),"aria-hidden":"true"}),u.label]})]}),e.jsx("div",{className:"mt-8",children:e.jsx(Pe,{song:a,customerEmail:i,songBoostProducts:r})}),t.orderPlacedAt&&f().diff(f(t.orderPlacedAt),"minute")<10?e.jsxs("div",{className:"mt-6 rounded-2xl border-neutral-200 px-5 py-5 sm:px-8 bg-white border text-center",children:["✉️ We've sent a confirmation email to ",e.jsx("span",{className:"font-semibold underline",children:(m=t==null?void 0:t.customer)==null?void 0:m.emailAddress}),". If you have not received this within 5 minutes of placing your order, please"," ",e.jsxs(W,{children:[e.jsx(q,{asChild:!0,children:e.jsx("span",{className:"font-medium cursor-pointer underline",children:"click here"})}),e.jsxs(Y,{className:"max-w-md",children:[e.jsx(V,{children:e.jsx(H,{className:"text-xl",children:"Email Delivery Help"})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{children:"We've sent a confirmation email to the email address shown. Please check your spam folder, trash and promotions filter in case it has ended up there by mistake. If it is in your spam folder, please could you mark it as 'Not spam' to ensure you can receive future emails from us."}),e.jsxs("p",{children:["If the email address you entered is not correct, please contact us through our"," ",e.jsx("a",{href:"https://intercom.help/songful/en/",target:"_blank",className:"underline",children:"customer support center"}),"."]})]})]})]}),"."]}):null,a.status!==j.LYRICS_CREATION&&a.status!==j.GENERATING&&a.status!==j.REVIEW&&e.jsxs("div",{children:[e.jsx(Ae,{song:a,productAddOns:s}),!a.is_automated&&e.jsx(ke,{song:a,remakePrice:c}),e.jsx(Re,{orders:n})]}),e.jsxs("a",{href:"https://intercom.help/songful/en/",target:"_blank",rel:"noopener noreferrer",className:"gap-4 p-5 sm:p-6 mt-10 rounded-2xl border-neutral-200 bg-white hover:border-neutral-400 flex cursor-pointer items-center border transition-colors",children:[e.jsx("p",{className:"min-w-0 text-base sm:text-lg font-bold grow",children:"🙋 Got a question? View our Customer Support Center"}),e.jsx(pe,{className:"size-5 shrink-0 text-gradient-one","aria-hidden":"true"})]})]})}),e.jsx(Me,{song:a})]})}export{ut as default};

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.