PageSourceSearch

https://wavevisual.com/_next/static/chunks/pages/checkout-d2f4a82326f73fee.js

js wavevisual.com collected 2026-10-04 13:32:12 UTC 87,671 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2222],{7957:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/checkout",function(){return r(11029)}])},36540:function(e,t,r){"use strict";r.d(t,{L:function(){return n},Q:function(){return m}});var i,n,o=r(52322);r(2784);var a=r(42670),s=r(47857),d=r(15644),l=r(61367),c=r(52745),u=r(64907),p=r(42307);(i=n||(n={})).hidden="Hidden",i.signin="Signin",i.register="Register",i.forgotPassword="ForgotPassword",i.emailVerification="EmailVerification";let m=e=>{let{authModalState:t,setAuthModalState:r,withHeader:i,withGoogle:n,onHide:m,className:h,dataTestId:_,disableCloseButton:f}=e;function v(){r("Hidden"),m&&m()}let g="Hidden"!==t,x=h||"md:w-96 md:h-auto",E=g?(0,o.jsx)(a.Z,{id:"".concat(t,"Panel.Title")}):null,N=(()=>{switch(t){case"Signin":return(0,o.jsx)(u._,{switchToRegister:()=>r("Register"),switchToForgotPassword:()=>r("ForgotPassword"),close:v,withHeader:i,withGoogle:n});case"ForgotPassword":return(0,o.jsx)(c.J,{switchToLogin:()=>r("Signin")});case"EmailVerification":return(0,o.jsx)(l.U,{});case"Hidden":return null;default:return(0,o.jsx)(p.K,{switchToLogin:()=>r("Signin"),switchToVerification:v,close:v,withHeader:i,withGoogle:n})}})();return f?(0,o.jsx)(s.Q,{open:g,onClose:v,className:x,dataTestId:_,disableCloseButton:!0,header:E,children:N}):(0,o.jsxs)(d.Q,{open:g,onClose:v,className:x,dataTestId:_,children:[g&&(0,o.jsx)("div",{className:"flex items-center w-full text-lg font-semibold mb-4",children:E}),N]})}},47857:function(e,t,r){"use strict";r.d(t,{Q:function(){return u}});var i=r(52322),n=r(2784),o=r(55048),a=r(28316),s=r(99127),d=r(12524),l=r.n(d);function c(e){let{header:t,disableCloseButton:r,onClose:n,children:o}=e;return void 0!==t?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"flex flex-row items-center h-12 p-4 md:px-6",children:[(0,i.jsx)("div",{className:"flex items-center w-full text-lg font-semibold",children:t}),!r&&(0,i.jsx)("button",{type:"button",className:"flex rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:n,"aria-label":"Close",children:(0,i.jsx)(s.oHP,{className:"h-6 w-6","aria-hidden":"true"})})]}),(0,i.jsx)("hr",{className:"border-gray-300"}),(0,i.jsx)("div",{className:"p-4 md:px-6",children:o})]}):(0,i.jsxs)(i.Fragment,{children:[o,!r&&(0,i.jsx)("div",{className:"absolute top-0 right-0 pt-4 pr-4 block",children:(0,i.jsxs)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2",onClick:n,children:[(0,i.jsx)("span",{className:"sr-only",children:"Close"}),(0,i.jsx)(s.oHP,{className:"h-6 w-6","aria-hidden":"true"})]})})]})}function u(e){let{open:t,onClose:r,children:s,className:d,dataTestId:u,disableCloseButton:p,header:m}
1=e,[h,_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=()=>{},r=document.querySelector("body");if(t&&r){let t=r.style.overflowY;e="hidden"===r.style.overflowY?()=>{}:()=>{r.style.overflowY=t},r.style.overflowY="hidden"}else e();return e},[t]),(0,n.useEffect)(()=>{_("undefined"!=typeof document)},[]);let f=l()("relative overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 w-full",!m&&"px-4 pt-5 pb-4 sm:p-6",d),v=(0,i.jsx)(o.u.Root,{show:t,as:n.Fragment,children:(0,i.jsxs)("div",{className:"relative z-50","aria-modal":"true",role:"dialog",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,i.jsx)("div",{className:"fixed inset-0 bg-gray-500/75 transition-opacity","aria-hidden":!0,onClick:e=>e.stopPropagation()})}),(0,i.jsx)("div",{className:"fixed inset-0 z-50 overflow-y-auto p-4","data-testid":u,onClick:e=>e.stopPropagation(),children:(0,i.jsx)("div",{className:"flex min-h-full items-center justify-center px-4",children:(0,i.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:(0,i.jsx)("div",{className:f,children:(0,i.jsx)(c,{header:m,disableCloseButton:p,onClose:r,children:s})})})})})]})});return h&&"undefined"!=typeof document?a.createPortal(v,document.body):v}},6127:function(e,t,r){"use strict";r.d(t,{Q:function(){return l}});var i=r(52322),n=r(2784),o=r(99127),a=r(49942),s=r(3741),d=r(90583);let l=e=>{var t;let{variant:r="default"}=e,[l,c]=n.useState(!1),{coupon:u}=s.featureFlags;if(!u.enabled||l)return null;if("checkout"===r){let e=((null===(t=u.checkoutBannerText)||void 0===t?void 0:t.trim())?u.checkoutBannerText.trim():"Save ".concat(u.discount,"% with code ").concat(u.code).concat(u.validUntil?" \xb7 ends ".concat(u.validUntil):"")).split(u.code);return(0,i.jsx)("div",{className:"bg-violet-600",children:(0,i.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 sm:gap-3 sm:px-5",children:[(0,i.jsx)("span",{className:"flex shrink-0 rounded-lg bg-violet-500 p-1.5 text-white sm:p-2",children:(0,i.jsx)(a.UdJ,{className:"h-4 w-4 sm:h-5 sm:w-5","aria-hidden":"true"})}),(0,i.jsxs)("p",{className:"min-w-0 flex-1 text-left text-sm font-medium leading-snug text-white sm:text-sm",children:[e[0],(0,i.jsx)("span",{className:"rounded bg-white/20 px-1 py-0.5 font-bold tracking-wide",children:u.code}),e[1]]})]})})}return(0,i.jsx)("div",{className:"bg-violet-500",children:(0,i.jsxs)("div",{className:"flex flex-wrap items-center justify-between py-2 lg:py-1 ".concat(d.kt),children:[(0,i.jsxs)("div",{className:"flex w-0 flex-1 items-center",children:[(0,i.jsx)("span",{className:"flex rounded-lg p-2",children:(0,i.jsx)(a.UdJ,{className:"h-6 w-6 text-white","aria-hidden":"true",fontSize:20})}),(0,i.jsx)("p",{className:"ml-3 font-medium text-white",children:u.bannerMessage?u.bannerMessage?u.bannerMessage:"".concat(u.label," is here! Use coupon code ").concat(u.code," to get ").concat(u.discount,"% off on all digital orders and subscriptions. ").concat(u.validUntil?" Valid through ".concat(u.validUntil,"."):""):(0,i.jsxs)(i.Fragment,{children:["".concat(u.label," is here! Use coupon code")," ",(0,i.jsx)("span",{className:"font-bold",children:u.code})," ","to get ".concat(u.discount,"% off on all digital orders and subscriptions. "),"".concat(u.validUntil?" Valid through ".concat(u.validUntil,"."):"")]})})]}),(0,i.jsx)("div",{className:"order-2 shrink-0 sm:order-3 sm:ml-3",children:(0,i.jsxs)("button",{type:"button",className:"-mr-1 flex rounded-md p-2 hover:bg-indigo-500 focus:outline-none focus:ring-2 focus:ring-white sm:-mr-2 touch-manipulation",onClick:()=>c(!0),children:[(0,i.jsx)("span",{className:"sr-only",children:"Dismiss"}),(0,i.jsx)(o.oHP,{className:"h-6 w-6 text-white","aria-hidden":"true"})]})})]})})}},605:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var i=r(18997),n=r(67201);function o(e,t){let{stage:r,productId:o,designId:a,videoProjectId:s,checkoutId:d,httpStatus:l,errorCode:c,errorMessage:u,errorSource:p,retryCount:m,paddleSdkVersion:h}=t,_=null!=p?p:(0,n.Rc)(e),f=(0,n.N6)(null!=u?u:e instanceof Error?e.message:String(null!=e?e:"Unknown checkout error")),v={checkout_error_stage:r,error_source:_,...c?{error_code:c}:{},...o?{product_id:o}:{},...a?{design_id:a}:{},...s?{video_project_id:s}:{},...d?{checkout_id:d}:{},...null!=l?{http_status:l}:{},...null!=m?{retry_count:m}:{}};(0,i.ee)(e,v),(0,i.Kz)("paddle_checkout_error",{checkout_error_stage:r,error_source:_,error_message:f,product_id:o,design_id:a,...s?{video_project_id:s}:{},checkout_id:d,...c?{error_code:c}:{},...null!=l?{http_status:l}:{},...null!=m?{retry_count:m}:{},...h?{paddle_sdk_version:h}:{}}).catch(()=>void 0)}},67201:function(e,t,r){"use strict";function i(e){return e.length<=500?e:"".concat(e.slice(0,499),"…")}function n(e){var t,r,n,o,a;let s=null!=e?e:{},d=null!==(a=null!==(o=s.error)&&void 0!==o?o:null===(t=s.checkout)||void 0===t?void 0:t.error)&&void 0!==a?a:{},l=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];let i=t.find(e=>"string"==typeof e&&""!==e.trim()||"number"==typeof e&&Number.isFinite(e));return null==i?void 0:String(i)}(d.code,d.error_code,d.type,s.error_code,s.code,null===(r=s.checkout)||void 0===r?void 0:r.error_code),c=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.find(e=>"string"==typeof e&&""!==e.trim())}("string"==typeof d?d:void 0,d.message,d.error_message,d.detail,d.description,s.error_message,s.message,null===(n=s.checkout)||void 0===n?void 0:n.error_message);if(l||c)return{errorCode:l,errorMessage:c?i(c):void 0,errorSource:"paddle_sdk"};let u=Object.keys(s);return{errorMessage:i(u.length>0?"Unrecognised Paddle Checkout.Error payload; keys: ".concat(u.sort().join(",")):"Paddle Checkout.Error fired with an empty payload"),errorSource:"unknown"}}function o(e){let t=e instanceof Error?e.message:String(null!=e?e:"");
1return/network|fetch|timeout|ECONN|Failed to fetch|Load failed/i.test(t)?"network":"our_code"}r.d(t,{N6:function(){return i},Rc:function(){return o},rv:function(){return n}})},19613:function(e,t,r){"use strict";r.d(t,{Dv:function(){return s},FH:function(){return l},ak:function(){return a},rc:function(){return d}});var i=r(6993);let n=e=>"design-preview:".concat(e);function o(e){return e.startsWith("blob:")}function a(e){return e.startsWith("data:")||o(e)}function s(e,t){i.t8(n(e),t)}function d(e){if(function(){if("undefined"==typeof performance)return!1;let e=performance.getEntriesByType("navigation")[0];return(null==e?void 0:e.type)==="reload"}()){l(e);return}let t=i.U2(n(e));if(t&&"string"==typeof t){if(o(t)){i.Od(n(e));return}return t}}function l(e){i.Od(n(e))}},92141:function(e,t,r){"use strict";r.d(t,{j:function(){return l}});var i=r(23083),n=r(18997),o=r(605),a=r(6993),s=r(40258),d=r(61189);let l=async(e,t,r,l)=>{var c;let u=(0,n.yo)(),p=null!==(c=null==l?void 0:l.videoProjectId)&&void 0!==c?c:r,m="pay-code-".concat((0,s.Z)(new Date,"yyyy-MM-dd"),"-").concat(e,"-").concat(t,"-").concat(p,"-").concat(null!=u?u:"anon");if(!(null==l?void 0:l.forceRefresh)&&a.e$(m))return a.U2(m);let h=await d.E.fetchQuery({queryKey:[m],queryFn:()=>(0,i.H6)(e,r,null==l?void 0:l.videoProjectId,u),retry:3,retryDelay:500});if(!h){(0,o.Z)(Error("payCode fetch failed for product: ".concat(e)),{stage:"paycode_null",productId:e,designId:r,videoProjectId:null==l?void 0:l.videoProjectId});return}return a.t8(m,h),h}},3486:function(e,t,r){"use strict";r.d(t,{M:function(){return o}});var i=r(52322);r(2784);var n=r(40581);let o=e=>{let{starOnly:t=!1,textClassName:r,noLink:o=!1}=e;return(0,i.jsxs)("a",{className:"text-xs flex items-start font-medium gap-2",target:"_blank",rel:"noopener noreferrer",...o?{}:{href:"https://bit.ly/trust-wavevisual"},children:[(0,i.jsxs)("div",{className:"inline-flex items-center gap-1",children:[(0,i.jsx)(n.M2b,{className:"text-white bg-green-500 p-1 w-5 h-5"}),(0,i.jsx)(n.M2b,{className:"text-white bg-green-500 p-1 w-5 h-5"}),(0,i.jsx)(n.M2b,{className:"text-white bg-green-500 p-1 w-5 h-5"}),(0,i.jsx)(n.M2b,{className:"text-white bg-green-500 p-1 w-5 h-5"}),(0,i.jsxs)("div",{className:"relative w-5 h-5",children:[(0,i.jsxs)("div",{className:"absolute inset-0 flex",children:[(0,i.jsx)("div",{className:"w-2/3 bg-green-500"}),(0,i.jsx)("div",{className:"w-1/3 bg-slate-200"})]}),(0,i.jsx)(n.M2b,{className:"relative text-white p-1 w-5 h-5"})]})]}),!t&&(0,i.jsxs)("span",{className:["flex gap-1 items-center",r].filter(Boolean).join(" "),children:[(0,i.jsxs)("p",{className:"",children:[4.6," out of 5"]}),(0,i.jsx)(n.M2b,{className:"text-green-500 w-5 h-5"}),"Trustpilot"]})]})}},11029:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return e0}});var i=r(52322),n=r(2784),o=r(61189),a=r(5632),s=r(75803),d=r(42670),l=r(82066),c=r(40457),u=r(18064),p=r(47857),m=r(75590),h=r(36540),_=r(21353),f=r(7355),v=r(83112),g=r(39097),x=r.n(g),E=r(75822),N=r(91891),y=r(3486);let A=e=>{let{requiresAccount:t}=e,r=(0,f.aC)(),[o,a]=(0,n.useState)(h.L.hidden),s=(0,v.Z)();(0,n.useEffect)(()=>{!r.isLoggedIn&&r.isFetched&&t&&a(h.L.register)},[r.isFetched,r.isLoggedIn,r.status,t]);let l=(0,i.jsx)("nav",{"aria-label":"Checkout progress",children:(0,i.jsxs)("ol",{className:"flex items-center justify-center gap-2 text-xs font-medium text-gray-500 md:text-sm",children:[(0,i.jsxs)("li",{className:"flex items-center gap-1.5 text-emerald-600",children:[(0,i.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-emerald-600 text-white","aria-hidden":!0,children:(0,i.jsx)(E.dZ6,{className:"h-3.5 w-3.5",strokeWidth:2.75})}),(0,i.jsx)("span",{children:"Design"})]}),(0,i.jsx)("li",{className:"text-gray-300","aria-hidden":!0,children:"—"}),(0,i.jsxs)("li",{className:"flex items-center gap-1.5 text-violet-700",children:[(0,i.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-violet-600 text-xs font-bold leading-none text-white","aria-current":"step",children:"2"}),(0,i.jsx)("span",{children:"Checkout"})]}
1),(0,i.jsx)("li",{className:"text-gray-300","aria-hidden":!0,children:"—"}),(0,i.jsxs)("li",{className:"flex items-center gap-1.5 text-gray-400",children:[(0,i.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-full border border-gray-300 bg-white text-xs font-semibold leading-none text-gray-500",children:"3"}),(0,i.jsx)("span",{children:"Download"})]})]})});return(0,i.jsxs)("header",{id:"header",className:"z-30 w-full border-b border-violet-100 bg-white text-gray-900 shadow-sm",children:[(0,i.jsx)("div",{className:"mx-auto max-w-6xl px-4 py-2 sm:px-6 md:py-2.5",children:(0,i.jsx)("div",{className:"mx-auto w-full max-w-5xl",children:(0,i.jsxs)("div",{className:"flex w-full flex-col gap-1.5 md:flex-row md:items-center md:justify-between md:gap-4",children:[(0,i.jsxs)("div",{className:"flex w-full items-center justify-between md:contents",children:[(0,i.jsx)("div",{className:"flex shrink-0 items-center justify-start",children:(0,i.jsx)(x(),{href:"/",prefetch:!1,className:"shrink-0 text-violet-600 hover:text-violet-700","aria-label":"WaveVisual Homepage",children:(0,i.jsx)(N.u,{title:"WaveVisual — ",compact:!0,narrow:!0})})}),(0,i.jsx)("div",{className:"hidden min-w-0 flex-1 justify-center md:flex",children:l}),(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-2 md:ml-0 lg:w-auto",children:[(0,i.jsx)("div",{"data-checkout-section":"trustpilot",className:"min-w-0 text-gray-950 [&_a]:font-medium [&_a]:text-gray-950 [&_a:hover]:text-violet-700 [&_a]:text-[11px] md:[&_a]:text-xs",children:(0,i.jsx)(y.M,{textClassName:"hidden md:flex"})}),!r.isLoggedIn&&r.isFetched&&(0,i.jsx)(_.z,{theme:"monochrome-light",rounded:!0,onClick:()=>a(h.L.register),"aria-label":s.formatMessage({id:"Auth.Register"}),"data-testid":"register-button",size:"small",className:"!border-violet-300 !text-sm !font-medium !text-violet-900 hover:!border-violet-400 hover:!bg-violet-50",children:(0,i.jsx)(d.Z,{id:"Auth.Register"})})]})]}),(0,i.jsx)("div",{className:"flex justify-center pt-1.5 md:hidden",children:l})]})})}),(0,i.jsx)(h.Q,{authModalState:o,setAuthModalState:a,disableCloseButton:t,withGoogle:!0})]})};var I=r(18997),b=r(605),C=r(86767),T=r(22581),R=r(19613),w=r(92141),j=r(74304),P=r(14067);async function S(e,t,r){let i=await fetch(e,{method:"POST",headers:{authorization:"Bearer ".concat(await (0,P.getIdToken)()),"Content-Type":"application/json"},body:JSON.stringify(t)});if(204===i.status)return(0,C.setTimeoutPromise)(()=>S(e,t,r),250);if(200!==i.status)throw Error("".concat(r," for paddleCheckoutId ").concat(t.paddleCheckoutId));return i.json()}let{apiURL:O}=j.feconfig;async function M(e,t){return S("".concat(O,"/designs/").concat(e,"/payment/paddle"),{paddleCheckoutId:t},"validatePaddlePaymentRequest failed")}let{apiURL:k}=j.feconfig;async function L(e,t){return S("".concat(k,"/video-projects/").concat(e,"/payment/paddle"),{paddleCheckoutId:t},"validateVideoProjectPaddlePaymentRequest failed")}let{apiURL:D}=j.feconfig;async function F(e){return S("".concat(D,"/payment/paddle"),{paddleCheckoutId:e},"validatePaddleSubscriptionRequest failed")}let{apiURL:U}=j.feconfig;async function G(e){return S("".concat(U,"/payment/paddle/credit-pack"),{paddleCheckoutId:e},"validateCreditPackPaymentRequest failed")}var B=r(53665),H=r(84309),W=r(3438),V=r(19458),J=r(70082),q=r(34444);let z=new Set(Object.values(V.AspectRatio));var X=r(72282),Z=r(54935);let Y=(0,n.createContext)({});function K(){return(0,n.useContext)(Y)}var Q=r(96577),$=r.n(Q),ee=r(12524),et=r.n(ee),er=r(26140),ei=r(9223);let en=(e,t)=>{let r=0;switch(t){case V.AspectRatio["2/1"]:r=e/2;break;case V.AspectRatio["2/3"]:r=e/2*3;break;case V.AspectRatio["3/1"]:r=e/3;break;case V.AspectRatio["3/2"]:r=e/3*2;break;case V.AspectRatio["4/5"]:r=e/4*5;break;case V.AspectRatio["5/4"]:r=e/5*4;break;case V.AspectRatio["16/9"]:r=9*e/16;break;case V.AspectRatio["9/16"]:r=16*e/9;break;case V.AspectRatio["11/14"]:r=14*e/11;break;case V.AspectRatio["1/2"]:r=2*e;break;case V.AspectRatio["4/3"]:r=3*e/4;break;case V.AspectRatio["27/35"]:r=e/27*35;break;case V.AspectRatio["297/210"]:r=e/297*210;break;case V.AspectRatio["210/297"]:r=e/210*297;break;case V.AspectRatio["22/17"]:r=e/22*17;break;case V.AspectRatio["17/22"]:r=e/17*22;break;case V.AspectRatio["1/1"]:default:r=e}return Math.floor(r)},eo=e=>{let t=e.split("/");if(2!==t.length)return!1;let r=Number(t[0]),i=Number(t[1]);return!!(Number.isFinite(r)&&Number.isFinite(i))&&0!==i&&r<i};var ea=r(49177);let es=e=>{var t,r,n,o,a,s;let{displayProduct:d}=e,l=d&&(null==d?void 0:null===(r=d.price)||void 0===r?void 0:null===(t=r.discounts)||void 0===t?void 0:t.length)>0,c=(null==d?void 0:d.recurringPrice)&&d.price.currency===d.recurringPrice.currency&&Math.round(100*Number(d.price.line_price.gross_after_discount))===Math.round(100*Number(d.recurringPrice.line_price.gross_after_discount));return d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("h3",{className:"flex text-2xl font-semibold text-gray-900",children:(0,i.jsxs)("span",{children:[(0,i.jsx)("span",{className:et()({"text-green-500":l}),children:(0,i.jsx)(ea.BK,{value:Number(d.price.line_price.gross_after_discount),currency:d.price.currency,style:"currency"})}),l&&d.price.line_price.gross_discount&&(0,i.jsx)("span",{className:"ml-2 text-lg text-gray-600 line-through",children:(0,i.jsx)(ea.BK,{value:Number(d.price.line_price.gross),currency:d.price.currency,style:"currency"})}),d.recurringPrice&&(0,i.jsxs)("span",{className:"ml-2 text-sm text-gray-500",children:["/ ",null===(n=d.recurringPrice)||void 0===n?void 0:n.period]}),(0,i.jsx)("span",{className:"ml-2 text-sm font-normal text-gray-500",children:"incl. taxes"})]})}),d.recurringPrice&&!c&&(0,i.jsxs)("div",{className:"",children:["After that",(0,i.jsx)("span",{className:"ml-2 text-base text-gray-600",children:(0,i.jsx)(ea.BK,{value:Number(null===(o=d.recurringPrice)||void 0===o?void 0:o.line_price.gross_after_discount),currency:null===(a=d.recurringPrice)||void 0===a?void 0:a.currency,style:"currency"})}),(0,i.jsxs)("span",{className:"ml-2 text-xs",children:["/ ",null===(s=d.recurringPrice)||void 0===s?void 0:s.period]}),(0,i.jsx)("span",{className:"ml-2 text-xs text-gray-500",children:"incl. taxes"})]})]}):(0,i.jsx)("div",{className:"w-20 mt-4 bg-gray-300 h-7 animate-pulse rounded-md lg:mx-0"})};var ed=r(49909),el=r(29188),ec=r.n(el),eu=r(2877);let ep=e=>{var t,r;let{designId:n,designData:o,offlineProduct:a,aspectRatio:s,localPreviewURL:d}=e,{displayProduct:l}=K(),c=Number((0,eu.U)().product.price.amount),u=Number(a.price.amount),p=null!=a.creditPack?{perDesign:(0,ed.iQ)((0,ed.NV)({packPrice:u,creditCount:a.creditPack})),showVolumeTag:(0,ed.ZC)({packPrice:u,creditCount:a.creditPack,singleDesignPrice:c})>0}:null,m=null!=s?s:V.AspectRatio["3/2"],h=en(720,m),_=n||a.iconPath,f=!!(n||d),v=f&&eo(m),g=!!(_&&a.iconPath&&!f),N=o&&"name"in o&&o.name||(null!==(t=null==l?void 0:l.productName)&&void 0!==t?t:a.name);return(0,i.jsx)("div",{className:et()(ec().checkoutSectionCard,"p-4 sm:p-5"),children:(0,i.jsxs)("div",{className:et()(g||v?"flex flex-row items-start gap-4":"flex flex-col gap-4 sm:gap-5"),children:[_&&(0,i.jsx)("div",{className:et()({"w-[132px] shrink-0":g,"w-[min(44%,180px)] shrink-0":v,"mx-auto w-full max-w-xl sm:max-w-2xl":f&&!v}),children:(0,i.jsxs)("div",{className:et()("overflow-hidden rounded-xl bg-violet-50/40 shadow",g?"border-0":"border border-gray-200"),children:[d&&(0,i.jsx)($(),{src:d,width:720,height:h,unoptimized:(0,R.ak)(d),alt:n?"Preview of design ".concat(n):a.name,"data-testid":"checkout-image",style:{maxWidth:"100%",height:"auto",objectFit:"contain"}}),!d&&n&&(0,i.jsx)($(),{loader:er.Ww,src:"/img/d/".concat(n,".jpg?cb=").concat(null==o?void 0:o.updatedAt),width:720,height:h,alt:n?"Preview of design ".concat(n):a.name,"data-testid":"checkout-image",style:{maxWidth:"100%",height:"auto",objectFit:"contain"}}),a.iconPath&&(0,i.jsx)($(),{loader:ei._,src:a.iconPath,width:300,height:300,alt:a.name,"data-testid":"checkout-image",style:{maxWidth:"100%",height:"auto",objectFit:"contain"}})]})}),(0,i.jsxs)("div",{className:et()("min-w-0",{"flex-1":g||v,"w-full":!(g||v)}),children:[(0,i.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-violet-600",children:a.subscription?"Subscription":null!=a.creditPack?"Credit pack":null!==(r=a.checkoutTypeLabel)&&void 0!==r?r:"Sound wave art \xb7 Digital"}),(0,i.jsx)("h2",{className:"mt-1 text-lg font-semibold leading-snug text-gray-900",children:N}),n&&(0,i.jsxs)(x(),{href:"/editor?id=".concat(n),prefetch:!1,className:"mt-2 inline-flex items-center gap-1 text-xs font-normal text-violet-500 hover:text-violet-700 sm:gap-1.5 sm:text-sm",children:[(0,i.jsx)(E._vs,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4","aria-hidden":!0}),"Edit design"]}),(0,i.jsxs)("div",{className:"mt-3 border-t border-gray-100 pt-3",children:[l?(0,i.jsx)(es,{displayProduct:l}):(0,i.jsx)("div",{className:"h-7 w-20 animate-pulse rounded-md bg-gray-200"}),null!=p&&(0,i.jsxs)("p",{className:"mt-2 text-sm text-gray-500",children:[p.perDesign," per design",p.showVolumeTag?" \xb7 volume discount":""]})]})]})]})})};var em=r(67201);let eh=["begin_checkout","paddle_form_loaded","customer_details_entered","purchase"],{paddle:e_}=j.feconfig,ef=e=>{let t=(0,f.aC)();return(0,i.jsx)(ev,{...e,auth:t,children:e.children})};class ev extends n.Component{get isAccountRequiredProduct(){return(0,T.ou)(this.props.offlineProduct)}get paddleSdkVersion(){var e;if("undefined"==typeof document)return;let t=document.querySelector('script[src*="paddle.com"]');return null!==(e=null==t?void 0:t.src)&&void 0!==e?e:void 0}setPaddleCheckoutLoading(e){this.mounted&&this.setState({isPaddleCheckoutLoading:e})}async loadPayCode(e){let{offlineProduct:t,designId:r,videoProjectId:i}=this.props;try{var n,o;let a=e||i?{...e,videoProjectId:i}:void 0,d=await (0,w.j)(t.productId,null!==(o=null===(n=this.props.auth.userDetails)||void 0===n?void 0:n.uid)&&void 0!==o?o:"",r,a);if(!d){(0,b.Z)(Error("CheckoutPage:fetchPayCode:payCode is null"),{stage:"paycode_null",productId:t.productId,designId:r,videoProjectId:i}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1);return}return d}catch(e){(0,b.Z)(e,{stage:"paycode_fetch",productId:t.productId,designId:r}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1)}}loadPaddleForm(e){if(!H.B.isPaddleReady()){setTimeout(()=>{this.loadPaddleForm(e)},100);return}if(this.loadPaddleFormInProgress){(0,I.Kz)("checkout_load_paddle_form_skipped",{reason:"reentrant"});return}let{designId:t,offlineProduct:r}=this.props,{userDetails:i}=this.props.auth;if(!r){(0,b.Z)(Error("CheckoutPage:loadPaddleForm:offlineProduct not found"),{stage:"paddle_open",designId:t}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1);return}if(this.isAccountRequiredProduct&&!(null==i?void 0:i.uid)){(0,I.Kz)("checkout_load_paddle_form_blocked",{reason:"anonymous_account_required",productId:r.productId});return}if(r.subscription&&!(null==i?void 0:i.email)){setTimeout(()=>{this.loadPaddleForm(e)},100);return}let n=Date.now();this.loadPaddleFormInProgress=!0,this.paddleOpenAttempts+=1,this.paddleCheckoutUserId=null==i?void 0:i.uid,console.debug("[Checkout] loadPaddleForm: opening Paddle",{userId:null==i?void 0:i.uid,productId:r.productId});try{H.B.open({method:"inline",frameTarget:"paddle-container",frameInitialHeight:432,frameStyle:"width:100%; min-width:312px; background-color: transparent; border: none",allowQuantity:!1,product:r.productId,email:(null==i?void 0:i.email)||void 0,customData:{userId:null==i?void 0:i.uid,designId:t},passthrough:e,successCallback:this.paymentSuccessCallback(r,t),loadCallback:()=>{this.loadPaddleFormInProgress=!1,this.setPaddleCheckoutLoading(!1),(0,I.Kz)("payment_provider_loaded",{transaction_id:t,paddleLoadTime:Date.now()-n})}})}catch(e){this.loadPaddleFormInProgress=!1,(0,b.Z)(e,{stage:"paddle_open",productId:r.productId,designId:t}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1)}}paymentSuccessCallback(e,t){return async r=>{let{id:i}=r.checkout,{videoProjectId:n}=this.props;try{let r;this.props.setPaymentStatus(s.b.processingPayment),(r=(0,T.wM)(e)?await G(i):!e.subscription&&n?await L(n,i):!e.subscription&&t?await M(t,i):await F(i)).success?(this.abandonment.markStage("purchase"),this.props.setPaymentStatus(s.b.successful)):(this.props.setPaymentStatus(s.b.errored),(0,b.Z)(Error(r.message||"Payment validation failed"),{stage:"payment_validation_failed",productId:e.productId,designId:t,checkoutId:i}))}catch(r){this.props.setPaymentStatus(s.b.errored),(0,b.Z)(r,{stage:"payment_validation",productId:e.productId,designId:t,checkoutId:i})}try{if(!H.B.isPaddleReady()){(0,b.Z)(Error("CheckoutPage:successCallback:paddle not defined"),{stage:"analytics_post_success",productId:e.productId,designId:t,checkoutId:i});return}let{displayProduct:r}=this.state;this.props.auth.refetchUserDetails(Z.sX.AccountPage),setTimeout(()=>{var n;null===(n=window.Paddle)||void 0===n||n.Order.details(i,i=>{var n,o,a,s,d,l,c,u,p;let m=null!==(c=null!==(l=null!==(d=this.checkoutDetails.email)&&void 0!==d?d:null==i?void 0:null===(o=i.order)||void 0===o?void 0:null===(n=o.customer)||void 0===n?void 0:n.email)&&void 0!==l?l:null===(a=this.props.auth.userDetails)||void 0===a?void 0:a.email)&&void 0!==c?c:"",h=null!==(p=null!==(u=this.checkoutDetails.countryCode)&&void 0!==u?u:null===(s=this.props.auth.userDetails)||void 0===s?void 0:s.countryCode)&&void 0!==p?p:"US";!function(e){var t,r;let{offlineProduct:i,designId:n,displayProduct:o,email:a,countryCode:s,selectedSource:d,captionTracking:l=J.aB,aspectRatio:c,landingPath:u}=e,p={totalValue:0,discount:0,currency:""};if(!o){(0,I.H)("CheckoutPage:paymentSuccessCallback:displayProduct not found");return}if(p.totalValue=Number(null===(t=o.price)||void 0===t?void 0:t.line_price.gross_after_discount),p.discount=Number(null===(r=o.price)||void 0===r?void 0:r.line_price.gross_discount),p.currency=o.price.currency,p.coupon=o.coupon,n){let e="string"==typeof c&&z.has(c)?(0,q.v)({aspectRatio:c,audioSource:d,landingPath:u}):void 0;W.e_({productId:i.productId,designId:n,selectedSource:d,...l,event_category:"Checkout",shipping:0,value:p.totalValue,currency:p.currency,user_country:s,user_email:a,...e&&{resolved_intent:e.intent,intent_score:e.score,intent_source:e.source},ecommerce:{currency:p.currency,value:Number(p.totalValue),coupon:p.coupon,items:[{coupon:p.coupon,item_id:i.productId,item_name:i.name,item_category:"digital_download",price:Number(p.totalValue),quantity:1,discount:Number(p.discount)}]}})}else W.pI({productId:i.productId,selectedSource:d,...l,event_category:"Checkout",shipping:0,value:p.totalValue,currency:p.currency,user_country:s,user_email:a,ecommerce:{currency:p.currency,value:Number(p.totalValue),coupon:p.coupon,items:[{coupon:p.coupon,item_id:i.productId,item_name:i.name,item_category:"digital_download",price:Number(p.totalValue),quantity:1,discount:Number(p.discount)}]}})}({offlineProduct:e,designId:t,displayProduct:r,email:m,countryCode:h,selectedSource:this.props.selectedSource,captionTracking:this.props.captionTracking,aspectRatio:this.props.aspectRatio,landingPath:(0,X.Uy)()})},!1)},5e3)}catch(r){(0,b.Z)(r,{stage:"analytics_post_success",productId:e.productId,designId:t,checkoutId:i})}}}async ensurePaddleLoaded(){return!H.B.isPaddleReady()&&this.triedPaddle
1<100?(this.triedPaddle++,await (0,C.wait)(100),this.ensurePaddleLoaded()):(await H.B.setup({vendorId:e_.vendorId,sandbox:B.isDevEnvironment}),this.triedPaddle=0,Promise.resolve())}async setup(){let{offlineProduct:e,designId:t}=this.props;if(!H.B.isPaddleReady()||!window.paddleEmitter){(0,b.Z)(Error("CheckoutPage:setup:paddle not defined"),{stage:"paddle_setup",productId:e.productId,designId:t}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1);return}H.B.onEvent(r=>{var i,n,o,a,d,l,c,u,p,m,h,_,f,v,g,x,E,N,y,A,C;if(!this.mounted)return;if("string"==typeof r.event&&this.abandonment.recordPaddleEvent(r.event),"Checkout.Error"===r.event){let i=(0,em.rv)(r.eventData);this.abandonment.markError(),(0,b.Z)(Error(null!==(A=i.errorMessage)&&void 0!==A?A:"Paddle Checkout.Error"),{stage:"paddle_sdk_checkout_error",productId:e.productId,designId:t,checkoutId:null===(y=r.eventData)||void 0===y?void 0:null===(N=y.checkout)||void 0===N?void 0:N.id,errorCode:i.errorCode,errorMessage:i.errorMessage,errorSource:i.errorSource,retryCount:Math.max(0,this.paddleOpenAttempts-1),paddleSdkVersion:this.paddleSdkVersion}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1);return}if("Checkout.Loaded"===r.event){console.log("[Checkout] Checkout.Loaded fired",r),this.abandonment.markStage("paddle_form_loaded"),this.setPaddleCheckoutLoading(!1);return}"Checkout.Customer.Details"===r.event&&(null===(i=r.eventData)||void 0===i?void 0:i.user)&&(this.checkoutDetails.email=r.eventData.user.email,this.checkoutDetails.countryCode=r.eventData.user.country,this.abandonment.markStage("customer_details_entered"),(0,I.Kz)("customer_details_entered",{transaction_id:this.props.designId,email:this.checkoutDetails.email,countryCode:this.checkoutDetails.countryCode})),"Checkout.Coupon.Applied"===r.event&&(0,I.Kz)("checkout_coupon_applied",{transaction_id:this.props.designId});let T=Number(null===(d=r.eventData)||void 0===d?void 0:null===(a=d.checkout)||void 0===a?void 0:null===(o=a.prices)||void 0===o?void 0:null===(n=o.customer)||void 0===n?void 0:n.total),R=null===(u=r.eventData)||void 0===u?void 0:null===(c=u.checkout)||void 0===c?void 0:null===(l=c.prices)||void 0===l?void 0:l.customer.currency;if(void 0===T||Number.isNaN(T)||!R)return;let{checkout:w,product:j}=r.eventData,P={productId:this.props.offlineProduct.productId,productName:j.name,coupon:null!==(C=null===(p=w.coupon)||void 0===p?void 0:p.coupon_code)&&void 0!==C?C:void 0,price:null===(f=w.prices)||void 0===f?void 0:null===(_=f.customer)||void 0===_?void 0:null===(h=_.items)||void 0===h?void 0:null===(m=h[0])||void 0===m?void 0:m.display_price,recurringPrice:null===(E=w.recurring_prices)||void 0===E?void 0:null===(x=E.customer)||void 0===x?void 0:null===(g=x.items)||void 0===g?void 0:null===(v=g[0])||void 0===v?void 0:v.display_recurring_price};this.setState({displayProduct:P})});let r=this.props.designId&&(0,R.rc)(this.props.designId);r&&this.setState({localPreviewURL:r}),window.addEventListener("beforeunload",()=>{this.props.designId&&(0,R.FH)(this.props.designId)})}async componentDidMount(){if(this.abandonment.start(),this.isAccountRequiredProduct&&!this.props.auth.isLoggedIn){console.debug("[Checkout] init blocked: account-required product, anonymous",this.props.offlineProduct.productId),(0,I.Kz)("checkout_init_blocked",{reason:"anonymous_account_required",productId:this.props.offlineProduct.productId}),await H.B.setup({vendorId:e_.vendorId,sandbox:B.isDevEnvironment}).then(()=>this.setup());return}this.setPaddleCheckoutLoading(!0);try{let[,e]=await Promise.all([H.B.setup({vendorId:e_.vendorId,sandbox:B.isDevEnvironment}).then(()=>this.setup()),this.loadPayCode()]);e?this.loadPaddleForm(e):this.setPaddleCheckoutLoading(!1)}catch(e){(0,b.Z)(e,{stage:"paddle_setup",productId:this.props.offlineProduct.productId,designId:this.props.designId}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1)}}async componentDidUpdate(e){var t,r,i;(null===(t=this.props.designData)||void 0===t?void 0:t.isPaid)&&this.abandonment.markStage("purchase");let n=null===(r=e.auth.userDetails)||void 0===r?void 0:r.uid,o=null===(i=this.props.auth.userDetails)||void 0===i?void 0:i.uid;if(n!==o){if((0,I.Kz)("checkout_auth_transition",{previous_uid:n,current_uid:o,transaction_id:this.props.designId,productId:this.props.offlineProduct.productId,stale_session_uid:this.paddleCheckoutUserId}),H.B.isPaddleReady()&&(H.B.close(),this.paddleCheckoutUserId=void 0),this.isAccountRequiredProduct&&!o){this.setPaddleCheckoutLoading(!1);return}this.setPaddleCheckoutLoading(!0);try{let e=await this.loadPayCode({forceRefresh:this.isAccountRequiredProduct});e?this.loadPaddleForm(e):this.setPaddleCheckoutLoading(!1)}catch(e){(0,b.Z)(e,{stage:"paddle_auth_transition",productId:this.props.offlineProduct.productId,designId:this.props.designId}),this.props.setPaymentStatus(s.b.errored),this.setPaddleCheckoutLoading(!1)}}}componentWillUnmount(){this.mounted=!1,this.abandonment.stop(),window.paddleEmitter&&window.paddleEmitter.clear()}render(){var e;let{designId:t,designData:r,offlineProduct:n,aspectRatio:o}=this.props,{displayProduct:a,localPreviewURL:s,isPaddleCheckoutLoading:d}=this.state;return(0,i.jsx)(Y.Provider,{value:{displayProduct:a,localPreviewURL:s,isPaddleCheckoutLoading:d},children:null!==(e=this.props.children)&&void 0!==e?e:(0,i.jsx)("div",{className:"p-4",children:(0,i.jsx)(ep,{designId:t,designData:r,offlineProduct:n,aspectRatio:o,localPreviewURL:s})})})}constructor(e){var t;super(e),this.mounted=!0,this.triedPaddle=0,this.checkoutDetails={},this.loadPaddleFormInProgress=!1,this.paddleOpenAttempts=0,this.state={},this.abandonment=function(e){let t;let r=Date.now(),i=0,n=!1,o=!1,a=!1,s=0,d=()=>Math.round((Date.now()-r)/1e3),l=()=>{o||"purchase"===eh[i]||(o=!0,(0,I.Kz)("checkout_abandoned",{last_completed_stage:eh[i],seconds_in_checkout:d(),reached_paddle_form:i>=eh.indexOf("paddle_form_loaded"),saw_checkout_error:n,last_paddle_event:t,paddle_event_count:s,productId:e.productId,designId:e.designId}).catch(()=>void 0))},c=()=>l(),u=()=>{"hidden"===document.visibilityState&&l()};return{markStage(e){i=Math.max(i,eh.indexOf(e))},markError(){n=!0},recordPaddleEvent(r){s+=1,t=r,(0,I.Kz)("paddle_checkout_event",{paddle_event:r,sequence:s,seconds_in_checkout:d(),productId:e.productId,designId:e.designId}).catch(()=>void 0)},start(){a||(a=!0,window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",u))},stop(){a&&(window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",u),a=!1),l()}}}({productId:null===(t=e.offlineProduct)||void 0===t?void 0:t.productId,designId:e.designId})}}let{products:eg}
1=(0,T.il)(B.isDevEnvironment),ex=e=>eg.find(t=>t.productId===e);var eE=r(92670),eN=r(23083),ey=r(50249),eA=r(97729),eI=r.n(eA),eb=r(15644),eC=r(99127),eT=r(49942);let eR=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function ew(e){let{onClick:t}=e;return(0,i.jsx)("button",{type:"button",onClick:t,"aria-label":"Close",className:"rounded-full p-1.5 text-gray-400 transition-colors hover:bg-violet-50 hover:text-gray-600",children:(0,i.jsx)(eC.oHP,{className:"h-4 w-4","aria-hidden":"true"})})}let ej=e=>{let{open:t,onClose:r,productName:o,productId:a,productCategory:s,designId:d}=e,{userDetails:l}=(0,f.aC)(),[c,u]=(0,n.useState)(""),[p,h]=(0,n.useState)(null),[_,v]=(0,n.useState)(!1),[g,x]=(0,n.useState)(!1),N=(0,n.useRef)(null),y=(0,n.useRef)(!1),A=function(e){let{productName:t,productId:r,productCategory:i,designId:n}=e;return{...t?{product_name:t}:{},...r?{product_id:r}:{},...i?{product_category:i}:{},...n?{design_id:n}:{}}}(e);(0,n.useEffect)(()=>{if(!t){var e;y.current=!1,h(null),v(!1),x(!1),u(null!==(e=null==l?void 0:l.email)&&void 0!==e?e:"");return}u(e=>e||(null==l?void 0:l.email)||""),y.current||(y.current=!0,(0,I.sO)().then(e=>e.capture("checkout_discount_prompt_shown",{...o?{product_name:o}:{},...a?{product_id:a}:{},...s?{product_category:s}:{},...d?{design_id:d}:{}})));let r=window.requestAnimationFrame(()=>{var e;return null===(e=N.current)||void 0===e?void 0:e.focus()});return()=>window.cancelAnimationFrame(r)},[t,null==l?void 0:l.email,o,a,s,d]);let b=()=>{g||(0,I.sO)().then(e=>e.capture("checkout_discount_prompt_dismissed",A)),r()},C=async e=>{e.preventDefault();let t=c.trim();if(!eR.test(t)){h("Enter a valid email address.");return}h(null),v(!0);try{await (0,eN.sh)({email:t,contactConditions:{discount:!0},source:"checkout_hesitation_price",...(null==l?void 0:l.uid)?{userId:l.uid}:{},...d?{designId:d}:{},...a?{productId:a}:{},...s?{productCategory:s}:{}}),(0,I.sO)().then(e=>e.capture("checkout_discount_prompt_submitted",A)),x(!0)}catch(e){h("Could not save that email. Try again.")}finally{v(!1)}};return(0,i.jsx)(eb.Q,{open:t,onClose:b,disableCloseButton:!0,className:"my-auto max-w-md !rounded-2xl border border-violet-200/80 shadow-2xl sm:!p-8",dataTestId:"checkout-discount-notify-dialog",children:g?(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,i.jsx)("span",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-violet-100 text-violet-700",children:(0,i.jsx)(E.dZ6,{className:"h-8 w-8","aria-hidden":"true"})}),(0,i.jsx)(ew,{onClick:r})]}),(0,i.jsx)(m.$N,{className:"mt-5 text-xl font-semibold tracking-tight text-gray-900",children:"You're on the list"}),(0,i.jsx)("p",{className:"mt-2 text-sm leading-6 text-gray-600",children:"We'll email you when this is on sale."}),(0,i.jsx)("button",{type:"button",onClick:r,className:"mt-6 w-full rounded-xl bg-violet-600 px-4 py-3 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-violet-700",children:"Got it"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,i.jsx)("span",{className:"flex h-14 w-14 items-center justify-center rounded-2xl bg-violet-100 text-violet-700",children:(0,i.jsx)(eT.UdJ,{className:"h-7 w-7","aria-hidden":"true"})}),(0,i.jsx)(ew,{onClick:b})]}),(0,i.jsx)(m.$N,{className:"mt-5 text-xl font-semibold tracking-tight text-gray-900",children:"Want a heads-up on a discount?"}),(0,i.jsx)("p",{className:"mt-2 text-sm leading-6 text-gray-600",children:"Too expensive right now? Leave your email and we'll let you know 
1when this is on sale."})]}),(0,i.jsxs)("form",{className:"mt-6",onSubmit:C,noValidate:!0,children:[(0,i.jsx)("label",{className:"block text-sm font-medium text-gray-800",htmlFor:"checkout-discount-email",children:"Email"}),(0,i.jsx)("input",{ref:N,id:"checkout-discount-email",type:"email",autoComplete:"email",value:c,onChange:e=>{u(e.target.value),p&&h(null)},placeholder:"[email protected]","aria-invalid":!!p,className:et()("mt-1.5 w-full rounded-xl border bg-white px-3.5 py-3 text-sm text-gray-900 shadow-sm placeholder:text-gray-400","focus:outline-none focus:ring-2 focus:ring-violet-200",p?"border-red-300 focus:border-red-400 focus:ring-red-100":"border-violet-200 focus:border-violet-400")}),p&&(0,i.jsx)("p",{className:"mt-2 text-sm text-red-600",role:"alert",children:p}),(0,i.jsx)("button",{type:"submit",disabled:_,className:"mt-5 w-full rounded-xl bg-violet-600 px-4 py-3 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-violet-700 disabled:opacity-60",children:_?"Saving…":"Notify me"}),(0,i.jsx)("button",{type:"button",onClick:b,className:"mt-3 w-full rounded-xl px-4 py-2.5 text-sm font-medium text-gray-500 transition-colors hover:bg-violet-50 hover:text-gray-700",children:"No thanks"})]})]})})},eP=!1,eS=[{id:"price",label:"Too expensive"},{id:"unsure",label:"Not sure what I'm getting"},{id:"browsing",label:"Just browsing"},{id:"technical",label:"Technical issue"},{id:"other",label:"Something else"}],eO={technical:{placeholder:"What's happening? e.g. checkout won't load, card error, page feels stuck",helper:"Tell us what's broken so we can investigate this checkout session."},other:{placeholder:"Want to tell us more? (optional)",helper:"A little context helps us improve the checkout experience."}};function eM(e){let{productName:t,productId:r,productCategory:i,designId:n}=e;return{...t?{product_name:t}:{},...r?{product_id:r}:{},...i?{product_category:i}:{},...n?{design_id:n}:{}}}let ek=e=>{let{rootClassName:t}=e,[r,o]=(0,n.useState)(null),[a,s]=(0,n.useState)(""),[d,l]=(0,n.use
1State)(!1),[c,u]=(0,n.useState)(!1),p=(0,n.useRef)(null),m=(0,n.useRef)(!1),h=eM(e),_=eS.find(e=>e.id===r),f=r?eO[r]:void 0;(0,n.useEffect)(()=>{if(eP)return;eP=!0;let t=eM({productName:e.productName,productId:e.productId,productCategory:e.productCategory,designId:e.designId});(0,I.sO)().then(e=>e.capture("checkout_survey_shown",t))},[e.designId,e.productCategory,e.productId,e.productName]),(0,n.useEffect)(()=>{var e;f&&!d&&(null===(e=p.current)||void 0===e||e.focus())},[d,f]);let v=async e=>{o(e.id),s(""),l(!1),m.current=!1,"price"===e.id&&u(!0),(await (0,I.sO)()).capture("checkout_survey_answered",{reason:e.label.toLowerCase(),reason_id:e.id,...h})},g=async e=>{s(e),_&&!m.current&&0!==e.length&&(m.current=!0,(await (0,I.sO)()).capture("checkout_survey_freetext_drafted",{reason_id:_.id,reason:_.label.toLowerCase(),...h}))},x=async()=>{let e=a.trim();e&&_&&((await (0,I.sO)()).capture("checkout_survey_freetext_submitted",{text:e,reason_id:_.id,reason:_.label.toLowerCase(),...h}),l(!0))};return(0,i.jsxs)("div",{className:et()("mx-auto mt-0 mb-2 w-full max-w-lg px-0",t),children:[(0,i.jsx)("p",{className:"text-sm font-medium text-gray-500 mb-3",children:"Not sure yet?"}),(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:eS.map(e=>(0,i.jsx)("button",{type:"button",onClick:()=>v(e),className:["px-3 py-1 rounded-full border text-xs transition-colors",r===e.id?"border-gray-400 text-gray-600 bg-gray-50":"border-gray-300 text-gray-400 bg-transparent hover:border-gray-400 hover:text-gray-500"].join(" "),children:e.label},e.id))}),f&&!d&&(0,i.jsxs)("div",{className:"mt-3",children:[(0,i.jsx)("p",{className:"mb-2 text-xs text-gray-800",children:f.helper}),(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)("textarea",{ref:p,value:a,onChange:e=>g(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),x())},placeholder:f.placeholder,rows:2,className:"min-h-[2.5rem] flex-1 resize-none rounded border border-gray-300 bg-transparent px-3 py-1.5 text-xs text-gray-500 placeholder:text-gray-500 focus:border-gray-400 focus:outline-none"}),(0,i.jsx)("button",{type:"button",onClick:x,className:"rounded border border-gray-600 px-3 py-1.5 text-xs text-gray-800 transition-colors hover:border-gray-400 hover:text-gray-500",children:"Send"})]})]}),r&&(0,i.jsx)("p",{className:"mt-2 text-xs text-gray-500",children:"Thanks — this helps us improve."}),(0,i.jsx)(ej,{open:c,onClose:()=>u(!1),productName:e.productName,productId:e.productId,productCategory:e.productCategory,designId:e.designId})]})},eL=new Set(Object.values(V.AspectRatio)),eD=new Set(Object.values(V.SourceType));function eF(e){let t=Array.isArray(e)?e[0]:e;if(t&&eD.has(t))return t}function eU(e){return e.subscription?"subscription":(0,T.wM)(e)?"credit_pack":"digital_download"}var eG=r(3741),eB=r(6127),eH=r(99904),eW=r(78422),eV=r(16572);function eJ(e){let{icon:t,title:r,children:n}=e;return(0,i.jsxs)("div",{className:"flex gap-3 py-3",children:[(0,i.jsx)("span",{className:"mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-violet-100 text-violet-700",children:t}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("p",{className:"text-sm font-semibold text-gray-900",children:r}),(0,i.jsx)("p",{className:"mt-0.5 text-sm leading-relaxed text-gray-600",children:n})]})]})}function eq(e){let{children:t}=e;return(0,i.jsx)("div",{className:"divide-y divide-gray-100 ",children:t})}let ez=()=>(0,i.jsxs)("a",{href:"https://help.wavevisual.com/subscriptions/7a5a3a46-b292-41fd-a5b7-4b773d48d8da/how-can-i-use-credits-to-purchase-a-design/14c116de-bd53-4017-bc8e-175fd4ac8503",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-flex items-center text-sm font-medium text-violet-600 hover:text-violet-700",children:["How credits work",(0,i.jsx)(eC.ocf,{className:"ml-1 text-lg","aria-hidden":!0})]}),eX=e=>{let{product:t,subscriptions:r=[]}=e,n=(0,eV.Di)(r);return t.creditPack?(0,i.jsxs)("div",{className:"space-y-4",children:[n&&(0,i.jsx)("div",{className:"rounded-xl border border-amber-200 bg-amber-50 p-4",children:(0,i.jsxs)("div",{className:"flex gap-2",children:[(0,i.jsx)(eC.SR5,{className:"mt-0.5 shrink-0 text-amber-600 text-lg"}),(0,i.jsxs)("p",{className:"text-sm text-amber-900",children:[(0,i.jsx)("strong",{children:"Note:"})," Your unlimited subscription already includes designs and exports while it's active. You can still buy this pack if you prefer prepaid credits."]})]})}
1),(0,i.jsxs)(eq,{children:[(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yAi,{className:"text-lg","aria-hidden":!0}),title:"".concat(t.creditPack," credits"),children:"Use on digital orders; credits never expire."}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yW5,{className:"text-lg","aria-hidden":!0}),title:"Flexible",children:"Apply credits when you checkout — see how they work below."})]}),(0,i.jsx)(ez,{})]}):t.subscription?t.subscription.name===eW.SubscriptionPlan.unlimited?(0,i.jsxs)(eq,{children:[(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yAi,{className:"text-lg","aria-hidden":!0}),title:"Unlimited digital exports",children:"Create and export sound wave designs while your subscription is active (fair-use limits apply — see pricing)."}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yW5,{className:"text-lg","aria-hidden":!0}),title:"All file formats",children:"Images, vectors, and 1080p video exports at 60fps included where your plan allows."}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.jox,{className:"text-lg","aria-hidden":!0}),title:"Billing",children:"Renews at the interval shown above. Cancel anytime from your account."})]}):(0,i.jsxs)("div",{children:[(0,i.jsxs)(eq,{children:[(0,i.jsxs)(eJ,{icon:(0,i.jsx)(c.yAi,{className:"text-lg","aria-hidden":!0}),title:"Subscription credits",children:["Includes ",t.subscription.credit," credits per ",t.subscription.interval," for digital orders while your subscription stays active."]}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yW5,{className:"text-lg","aria-hidden":!0}),title:"Support",children:"Questions? We're on live chat."})]}),(0,i.jsx)(ez,{})]}):(0,i.jsxs)(eq,{children:[(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yAi,{className:"text-lg","aria-hidden":!0}),title:"Instant download",children:"1080p videos at 60fps and print-quality images — we'll email a link right after purchase."}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.yW5,{className:"text-lg","aria-hidden":!0}),title:"30-day peace of mind",children:"Not happy with your order? Message us and we'll make it right."}),(0,i.jsx)(eJ,{icon:(0,i.jsx)(c.jox,{className:"text-lg","aria-hidden":!0}),title:"Edit for 3 days",children:"Tweak colors and layout in the editor; we keep your design available during that window."})]})},eZ=e=>{let{messageId:t,className:r}=e;return(0,i.jsxs)("div",{className:"flex flex-col items-center gap-5 py-4 ".concat(null!=r?r:""),"aria-busy":"true","aria-live":"polite",children:[(0,i.jsx)("p",{className:"text-center text-base font-medium text-gray-800 sm:text-lg",children:(0,i.jsx)(d.Z,{id:t})}),(0,i.jsxs)("div",{className:"relative flex size-[5.25rem] items-center justify-center","aria-hidden":!0,children:[(0,i.jsx)("span",{className:"absolute inset-0 rounded-full border-[3px] border-violet-100"}),(0,i.jsx)("span",{className:"absolute inset-0 rounded-full border-[3px] border-transparent border-t-violet-600 border-r-violet-600/30 motion-safe:animate-spin motion-reduce:animate-none motion-reduce:border-t-gray-400 motion-reduce:border-r-gray-400/40"}),(0,i.jsx)(eC.dx5,{className:"relative z-10 size-10 shrink-0 text-violet-500/90"})]})]})},eY=n.useLayoutEffect;function eK(){return(0,i.jsx)("section",{"data-checkout-section":"help",className:"border-t border-violet-200/50 pt-4 text-center",children:(0,i.jsx)("button",{type:"button",onClick:()=>(0,eH.k)(),className:"text-sm font-medium text-violet-700 hover:text-violet-900",children:"Need help? Chat with us"})})}let eQ=e=>{var t,r;let{designId:o,designData:a,aspectRatio:d,offlineProduct:l,paymentStatus:c,hesitationSurveySlot:u,paddleErrorSlot:p,paddleProcessingSlot:m}=e,h=(0,f.aC)(),{localPreviewURL:_,isPaddleCheckoutLoading:v}=K(),g=!!v&&c===s.b.initial,x=eG.featureFlags.coupon.enabled,{ready:N,lg:y}=function(){let[e,t]=(0,n.useState)(()=>({ready:!1,lg:!1}));return eY(()=>{let e=window.matchMedia("(min-width: 1024px)"),r=()=>t({ready:!0,lg:e.matches});return r(),e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}(),A=(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("section",{"data-checkout-section":"payment",children:(0,i.jsxs)("div",{className:et()(ec().checkoutSectionCard,"pb-4 lg:sticky lg:top-4"),children:[x?(0,i.jsx)("div",{"data-checkout-section":"coupon",className:"rounded-t-xl overflow-hidden",children:(0,i.jsx)(eB.Q,{variant:"checkout"})}):null,(0,i.jsxs)("div",{className:"p-3",children:[c===s.b.errored&&(0,i.jsx)("div",{className:"mt-4",children:p}),c===s.b.processingPayment&&(0,i.jsx)("div",{className:"mt-4",children:m}),(0,i.jsxs)("div",{className:et()("relative min-h-[432px]",c===s.b.processingPayment&&"pointer-events-none opacity-40"),children:[g?(0,i.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center rounded-xl bg-white","data-testid":"paddle-checkout-loading-overlay",children:(0,i.jsx)(eZ,{messageId:"Checkout.LoadingPaddle"})}):null,(0,i.jsx)("div",{className:"paddle-container pt-1"})]}),(0,i.jsxs)("p",{className:"mt-4 flex flex-wrap items-center justify-center gap-1 text-center text-xs text-gray-500",children:[(0,i.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,i.jsx)(E.eW7,{className:"size-3.5 shrink-0","aria-hidden":!0}),"SSL encrypted"]}
1),(0,i.jsx)("span",{"aria-hidden":!0,className:"text-gray-400",children:"\xb7"}),(0,i.jsx)("span",{children:"PCI DSS compliant \xb7 Powered by Paddle"})]})]})]})})}),I=(0,i.jsx)("section",{"data-checkout-section":"product-summary",children:(0,i.jsx)(ep,{designId:o,designData:a,offlineProduct:l,aspectRatio:d,localPreviewURL:_})}),b=null!==(r=null===(t=h.userDetails)||void 0===t?void 0:t.subscriptions)&&void 0!==r?r:[],C=(0,i.jsxs)("section",{"data-checkout-section":"features",children:[(0,i.jsx)("h3",{className:"sr-only",children:"What you get"}),(0,i.jsx)("div",{className:et()(ec().checkoutSectionCard,"px-4 py-2 sm:px-5"),children:(0,i.jsx)(eX,{product:l,subscriptions:b})})]}),T=(0,i.jsx)("section",{"data-checkout-section":"hesitation",children:u}),R=(0,i.jsxs)("div",{"data-checkout-layout":"narrow-stack",className:"flex flex-col gap-6",children:[I,(0,i.jsx)("div",{className:"flex flex-col gap-6 sm:gap-8",children:A}),C,T,(0,i.jsx)(eK,{})]}),w=(0,i.jsxs)("div",{"data-checkout-layout":"two-column-row",className:"flex flex-col gap-10",children:[(0,i.jsxs)("div",{className:"flex flex-row items-start gap-x-8",children:[(0,i.jsxs)("div",{className:"flex min-w-0 flex-[1_1_0] flex-col gap-8",children:[I,C,T]}),(0,i.jsx)("div",{className:"flex min-w-0 flex-[1_1_0] flex-col gap-8",children:A})]}),(0,i.jsx)(eK,{})]});return(0,i.jsx)("div",{className:"mx-auto w-full max-w-5xl",children:N&&y?w:R})},e$=()=>{var e,t,r,h,_,f;let v=(0,a.useRouter)(),g=null===(e=v.query.did)||void 0===e?void 0:e.toString(),x=null===(t=v.query.vpid)||void 0===t?void 0:t.toString(),[E,N]=(0,n.useState)(s.b.initial),y=null===(r=v.query.aspectRatio)||void 0===r?void 0:r.toString(),I=v.query.pid?ex(null===(h=v.query.pid)||void 0===h?void 0:h.toString()):void 0,{data:b,isError:C,isLoading:R}=(0,l.useQuery)(["designData",g],()=>g?(0,eN.rT)(g,u.Pm.BARE_MIN):void 0,{enabled:!!g,refetchOnWindowFocus:!0,refetchInterval:e=>(null==e||!e.isPaid)&&4e3}),w=!!(null==I?void 0:I.subscription);(0,ey.u)("CheckoutPage");let j=null===(_=v.query.returnTo)||void 0===_?void 0:_.toString();if((0,n.useEffect)(()=>{var e,t,r;if(!v.isReady||!I||g&&R||(null==b?void 0:b.isPaid))return;let i=null===(e=v.query.pid)||void 0===e?void 0:e.toString();if(!i)return;let n="wv_begin_checkout:".concat(i,":").concat(null!=g?g:"");try{if("undefined"!=typeof sessionStorage&&sessionStorage.getItem(n))return;"undefined"!=typeof sessionStorage&&sessionStorage.setItem(n,"1")}catch(e){}let o=eF(v.query.audioSource),a=null!==(t=function(e){let t=Array.isArray(e)?e[0]:e;if(!t||"string"!=typeof t)return;let r=t.trim();if(r)return r.slice(0,200)}(v.query.screenName))&&void 0!==t?t:"CheckoutPage",s=null!==(r=(0,J.SQ)(v.query))&&void 0!==r?r:J.aB,d=function(e,t){var r,i;let n=Number(e.price.amount),o=e.price.currencyCode,a=eU(e),s=null!==(r=t.screenName)&&void 0!==r?r:"CheckoutPage",d="digital_download"===a&&"string"==typeof(i=t.aspectRatio)&&eL.has(i)?(0,q.v)({aspectRatio:t.aspectRatio,audioSource:t.selectedSource,landingPath:t.landingPath}):void 0;return{designId:t.designId,productId:e.productId,selectedSource:t.selectedSource,eventParam
1s:{event_category:"Checkout",tax:0,shipping:0,currency:o,value:n,screen_name:s,...d&&{resolved_intent:d.intent,intent_score:d.score,intent_source:d.source}},ecommerce:{currency:o,value:n,items:[{item_id:e.productId,item_name:e.name,item_category:a,price:n,quantity:1}]}}}(I,{designId:g,selectedSource:o,screenName:a,aspectRatio:y,landingPath:(0,X.Uy)()});(0,W.eD)({...d,eventParams:{...d.eventParams,...s}}).catch(()=>void 0)},[y,null==b?void 0:b.isPaid,g,R,I,v.isReady,v.query.audioSource,v.query.pid,v.query.screenName,v.query.hasCaptions,v.query.captionCueCount]),(0,n.useEffect)(()=>{let e=()=>{j?v.push(j):!w&&x?v.push("/video-editor?id=".concat(x)):!w&&g?v.push("/editor?id=".concat(g)):v.push("/editor")};if(E===s.b.successful){e();return}if(null==b?void 0:b.isPaid){let t=setTimeout(e,3e3);return()=>clearTimeout(t)}},[null==b?void 0:b.isPaid,g,w,E,j,v,x]),!v.query.pid)return null;let P=E===s.b.errored?(0,i.jsxs)("div",{className:"flex gap-3 rounded-lg border border-amber-200 bg-amber-50 p-4 text-amber-900",children:[(0,i.jsx)(c.Hfo,{className:"mt-0.5 shrink-0 text-amber-500",size:20}),(0,i.jsx)("p",{className:"text-sm leading-relaxed",children:(0,i.jsx)(d.Z,{id:"Paddle.UnknownError"})})]}):null,S=E===s.b.processingPayment?(0,i.jsx)(eZ,{messageId:"Checkout.Finalising"}):null;return(0,i.jsxs)(o.g,{children:[(0,i.jsx)(eE.H,{title:"Checkout",path:"/checkout",description:"Checkout",images:g?[(0,er.Ww)({src:"/img/d/".concat(g,".jpg"),width:720})]:[],noIndex:!0,type:"other"}),(0,i.jsx)(eI(),{children:(0,i.jsx)("link",{rel:"preconnect",href:"https://cdn.paddle.com",crossOrigin:"anonymous"})}),(0,i.jsxs)("div",{className:"min-h-screen bg-violet-100/75",children:[(0,i.jsx)(A,{requiresAccount:!!(I&&(0,T.ou)(I))}),(0,i.jsx)("main",{className:"mx-auto max-w-6xl px-4 pb-12 pt-6 sm:px-6 lg:pb-16 lg:pt-8",children:I&&(0,i.jsx)(ef,{designId:g,videoProjectId:x,offlineProduct:I,setPaymentStatus:N,aspectRatio:y,designData:b,selectedSource:eF(v.query.audioSource),captionTracking:null!==(f=(0,J.SQ)(v.query))&&void 0!==f?f:J.aB,children:(0,i.jsx)(eQ,{designId:g,designData:b,aspectRatio:y,offlineProduct:I,paymentStatus:E,paddleErrorSlot:P,paddleProcessingSlot:S,hesitationSurveySlot:(0,i.jsx)("div",{className:"rounded-xl border border-dashed border-gray-200 bg-white/70 p-4 sm:px-5",children:(0,i.jsx)(ek,{designId:g,productCategory:eU(I),productId:I.productId,productName:I.name,rootClassName:"mx-auto mt-0 mb-0 max-w-none px-0"})})})})})]}),(0,i.jsx)(p.Q,{open:!I||C,onClose:()=>null,disableCloseButton:!0,className:"h-64 translate-y-20 md:w-80",dataTestId:"alread-paid-modal",header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(c.CjJ,{className:"mr-2"}),"Unknown error"]}),children:(0,i.jsx)("p",{className:"p-4",children:"We have encountered an unknown error. This probably happens because the URL of this page is malformed."})}),(0,i.jsxs)(eb.Q,{onClose:()=>null,dataTestId:"alread-paid-modal",className:"translate-y-20 md:w-80",open:!!(null==b?void 0:b.isPaid),disableCloseButton:!0,children:[(0,i.jsxs)(m.$N,{as:"h3",className:"flex items-center text-base font-semibold leading-6 text-gray-900",children:[(0,i.jsx)(c.C4o,{className:"mr-2"}),"Already purchased"]}),(0,i.jsx)("p",{className:"pt-4",children:"This design is already purchased. You will be redirected to the download page shortly."})]})]})};var e0=()=>(0,i.jsx)(o.g,{children:(0,i.jsx)(e$,{})})},61189:function(e,t,r){"use strict";r.d(t,{E:function(){return o},g:function(){return a}});var i=r(52322);r(2784);var n=r(82066);let o=new n.QueryClient({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:3,retryDelay:500}}});function a(e){let{children:t}=e;return(0,i.jsx)(n.QueryClientProvider,{client:o,children:t})}},2431:function(e,t,r){"use strict";let i,n;r.d(t,{G9:function(){return _},IH:function(){return v},YZ:function(){return y},sA:function(){return f},u0:function(){return g},um:function(){return m}});var o=r(43841),a=r(40381),s=r(25139),d=r(92333),l=r(18997),c=r(14067);let u="designs",p="jobs",m="EXPORT_JOB_CLIENT_TIMEOUT";function h(e,t){let r=Error("Timeout waiting for job ".concat(e," to complete"));return r.code=m,r.timeoutMs=t,r}let _="EXPORT_JOB_SERVER_FAILED",f="EXPORT_JOB_SERVER_TIMEOUT",v="EXPORT_JOB_CANCELLED",g=54e5;async function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;try{let r=await (0,c.getFirestoreSubcollection)(t,e,p);return await (0,c.queryFirestoreCollection)(r,{orderBy:{field:"createdAt",direction:"desc"}})}catch(e){return console.error("❌ Error loading design jobs:",e),(0,l.H)(e),{}}}async function E(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u,i=arguments.length>3?arguments[3]:void 0;try{let n=await (0,c.getFirestoreSubcollection)(r,e,p);return await (0,c.subscribeToFirestoreCollection)(n,t,{orderBy:{field:"createdAt",direction:"desc"},onError:i})}catch(e){return console.error("❌ Error setting up jobs subscription:",e),(0,l.H)(e),null==i||i(e),()=>{}}}function N(e,t){return"".concat(t,"/").concat(e)}let y=(0,o.U)((e,t)=>({designJobs:{},isLoading:!1,jobsSubscriptionError:null,clearJobsSubscriptionError:()=>e({jobsSubscriptionError:null}),subscribeToDesignJobs:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,o=N(t,r);if(i&&n!==o&&(i(),i=void 0),n===o&&i)return i;n=o,e({isLoading:!0,jobsSubscriptionError:null});let a=t=>{(0,l.H)(t),e({jobsSubscriptionError:"permission-denied"===(t&&"object"==typeof t&&"code"in t?String(t.code):"")?"Sign in to see export progress and recent exports for this project.":"Could not load export jobs. Try refreshing or signing in again.",isLoading:!1})};return x(t,r).then(t=>{e({designJobs:t,isLoading:!1,jobsSubscriptionError:null})}).catch(e=>{a(e)}),E(t,t=>{e({designJobs:t,isLoading:!1,jobsSubscriptionError:null})},r,a).then(e=>{i=e}).catch(e=>{a(e)}),()=>{i&&(i(),i=void 0),n===o&&(n=void 0),e({designJobs:{},isLoading:!1})}},unsubscribeFromDesignJobs:()=>
1{i&&(i(),i=void 0),n=void 0,e({designJobs:{},isLoading:!1})},getDesignJobs:async function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;if(!t)return{};try{let i=await x(t,r);return n===N(t,r)&&e({designJobs:i}),i}catch(e){return(0,l.H)(e),{}}},waitForDesignJobCompletion:function(r,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e5,c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:u;return new Promise((u,p)=>{let m,g,E,A,I;let b=Date.now(),C=!1,T=e=>{g&&(clearTimeout(g),g=void 0);let t=e.updatedAt||e.createdAt;if(!t){I=Date.now(),g=setTimeout(()=>{j(),p(h(r,o))},o);return}let i=new Date(t).getTime(),n=o-(Date.now()-i),a=n>0?n:o;I=i,g=setTimeout(()=>{j(),p(h(r,o))},a)},R=e=>{if(C)return!1;let t=e.exitedAt?new Date(e.exitedAt).getTime():void 0;return!!(void 0!==t&&t<b-2e3||e.startedAt&&void 0!==t&&new Date(e.startedAt).getTime()>t)},w=e=>{let t=e[r];if(t){let{status:e}=t;switch(e){case a.E.inprogress:{C=!0;let e=t.updatedAt||t.createdAt;if(e){let r=new Date(e).getTime();(!I||r>I)&&T(t)}return}case a.E.completed:if(R(t))return;t.result&&(j(),u(t));return;case a.E.errored:if(R(t))return;j(),p(function(e,t){let r=t?e.startsWith(s.A9)?(0,d.sanitizeTranscriptionJobStoredResult)(t):t:void 0,i=Error(r?"Job ".concat(e," failed: ").concat(r):"Job ".concat(e," failed with error status"));return i.code=_,i.jobName=e,r&&(i.serverError=r),i}(r,"string"==typeof t.result&&t.result?t.result:void 0));return;case a.E.cancelled:if(R(t))return;j(),p(Object.assign(Error("Job ".concat(r," was cancelled")),{code:v}));return;case a.E.queued:case a.E.notstarted:C=!0;return;case a.E.timedout:if(R(t))return;
1j(),p(Object.assign(Error("Job ".concat(r," timed out")),{code:f}))}}},j=()=>{m&&(m(),m=void 0),E&&(clearInterval(E),E=void 0),A&&(clearInterval(A),A=void 0),g&&(clearTimeout(g),g=void 0)},P=()=>{try{m=y.subscribe(e=>{w(e.designJobs)}),i&&(E=setInterval(async()=>{try{let t=await x(i,c);n===N(i,c)&&e({designJobs:t}),w(t)}catch(e){}},2e3))}catch(e){j(),(0,l.H)(e),p(e)}};(async()=>{try{i&&(t().subscribeToDesignJobs(i,c),await t().getDesignJobs(i,c))}catch(e){j(),(0,l.H)(e),p(e);return}let e=t();if(!e.designJobs[r]&&i){let e=0;A=setInterval(()=>{let i=t();i.designJobs[r]?(A&&(clearInterval(A),A=void 0),w(i.designJobs)):(e+=1)>=10&&A&&(clearInterval(A),A=void 0)},500),g=setTimeout(()=>{j(),p(h(r,o))},o)}else{let t=e.designJobs[r];t?T(t):g=setTimeout(()=>{j(),p(h(r,o))},o),w(e.designJobs)}P()})()})}}))},70082:function(e,t,r){"use strict";r.d(t,{B8:function(){return m},Gx:function(){return l},HS:function(){return h},SQ:function(){return u},aB:function(){return d},ng:function(){return c},wP:function(){return p}});var i=r(21977),n=r(40568),o=r(11242),a=r(2431),s=r(33065);let d={has_captions:!1,caption_cue_count:0};function l(e){let t=(0,n.captionsConfigCueCount)(e);return{has_captions:t>0,caption_cue_count:t}}function c(e){let t=(0,o.Qo)(null!=e?e:void 0);return{has_captions:t>0,caption_cue_count:t}}function u(e){let t=function(e){let t=Array.isArray(e)?e[0]:e;return"1"===t||"true"===t||"0"!==t&&"false"!==t&&void 0}(e.hasCaptions),r=function(e){let t=Array.isArray(e)?e[0]:e;if(void 0===t||""===t)return;let r=Number.parseInt(t,10);return Number.isFinite(r)&&r>=0?r:void 0}(e.captionCueCount);if(void 0===t&&void 0===r)return;let i=null!=r?r:0;return{has_captions:null!=t?t:i>0,caption_cue_count:i}}function p(e,t){e.set("hasCaptions",t.has_captions?"1":"0"),e.set("captionCueCount",String(t.caption_cue_count))}function m(e){var t;if(e&&"object"==typeof e&&"code"in e){let{code:t}=e;if("string"==typeof t&&t.length>0)return t}return e instanceof Error&&/save the (design|project)/i.test(e.message)?"save_required":null!==(t=(0,s.R2)(e))&&void 0!==t?t:"unknown"}function h(e){return e&&"object"==typeof e?e instanceof i.ApiRequestError?{http_status:e.httpStatus,...e.serverMessage?{server_error:e.serverMessage}:{}}:e.code===a.G9?{...e.serverError?{server_error:e.serverError}:{},...e.jobName?{job_name:e.jobName}:{}}:(e.code===a.um||e.code===a.sA||e.code===a.IH)&&e.jobName?{job_name:e.jobName}:{}:{}}},49909:function(e,t,r){"use strict";function i(e){let{packPrice:t,creditCount:r}=e;return Number.isFinite(t)&&Number.isFinite(r)&&!(r<=0)?t/r:0}function n(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}function o(e){let{packPrice:t,creditCount:r,singleDesignPrice:i}=e;if(!Number.isFinite(t)||!Number.isFinite(r)||!Number.isFinite(i)||r<=0||i<=0)return 0;let n=t/r;return n>=i?0:Math.round((i-n)/i*100)}r.d(t,{NV:function(){return i},ZC:function(){return o},iQ:function(){return n}})},45947:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return i._}});var i=r(9223)},33065:function(e,t,r){"use strict";r.d(t,{P8:function(){return s},R2:function(){return a}});var i=r(21977),n=r(43328),o=r(2431);function a(e){if(e instanceof i.ApiRequestError){var t;let r=null!==(t=e.serverMessage)&&void 0!==t?t:"";return r.includes(":audio-not-found:")?"audio_missing":r.includes(":audio-not-downloadable:spotify:")?"audio_unsupported_spotify":r.includes(":audio-not-downloadable:youtube:")?"audio_unsupported_youtube":r.includes(":design-not-found:")||r.includes(":project-doesnt-exist:")?"design_not_found":r.includes(":not-authorized:")?"not_authorized":"http_".concat(e.httpStatus)}return e instanceof Error&&"No id token"===e.message?"not_signed_in":e instanceof TypeError?"network":void 0}function s(e){var t;let r=a(e);return(r?function(e){switch(e){case"audio_missing":return"Your audio is not saved yet. Wait for the upload to finish, save, and try again.";case"audio_unsupported_spotify":case"audio_unsupported_youtube":return"Spotify and YouTube tracks cannot be transcribed. Upload an audio or video file instead.";case"not_signed_in":case"not_authorized":return"We could not confirm your session. Reload the page and try again.";case"network":return"We could not reach the server. Check your connection and try again.";default:return}}(r):void 0)||((null==e?void 0:e.code)===o.G9?(0,n.Zd)(null!==(t=e.serverError)&&void 0!==t?t:e.message):(0,n.Zd)(void 0))}},84309:function(e,t,r){"use strict";let i;r.d(t,{B:function(){return o}});let n=!1,o={setup:async function(e){let{vendorId:t,sandbox:r}=e;return new Promise((e,o)=>{if(n){e();return}if(!window.paddleEmitter){let e;window.paddleEmitter=(e=[],{on(t){e.push(t)}
1,emit(t){e.forEach(e=>e(t))},clear(){e=[]}})}(i=document.createElement("script")).src="https://cdn.paddle.com/paddle/paddle.js",i.async=!0,i.onload=()=>{(function(e){let{vendorId:t,sandbox:r}=e;if(!window.Paddle)throw Error("Paddle script not loaded");if(!window.paddleEmitter)throw Error("Paddle emitter not loaded");r&&window.Paddle.Environment.set("sandbox"),window.Paddle.Setup({vendor:t,eventCallback:window.paddleEmitter.emit}),n=!0})({vendorId:t,sandbox:r}),e()},i.onerror=o,document.body.appendChild(i)})},isPaddleReady:function(){return n},onEvent:function(e){var t;return null===(t=window.paddleEmitter)||void 0===t?void 0:t.on(e)},open:function(e){if(!window.Paddle)throw Error("Paddle script not loaded");window.Paddle.Checkout.open(e)},close:function(){var e;window.Paddle&&"function"==typeof(null===(e=window.Paddle.Checkout)||void 0===e?void 0:e.close)&&window.Paddle.Checkout.close()},getPaddle:function(){return window.Paddle},orderDetails:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!window.Paddle)throw Error("Paddle script not loaded");window.Paddle.Order.details(...t)}}},19458:function(e,t,r){"use strict";var i,n,o,a,s,d,l,c,u,p,m,h,_,f,v,g,x,E,N,y;Object.defineProperty(t,"__esModule",{value:!0}),t.QRDestination=t.QRCodeState=t.ExportMethod=t.AspectRatio=t.ExportFileType=t.SourceType=t.EditorStatus=t.ExportSize=t.Unit=t.SoundWaveStyle=void 0,r(38986),(m=i||(t.SoundWaveStyle=i={})).horizontal_simple="horizontal",m.horizontal_one_sided="horizontal_one_sided",m.circle_simple="circle_simple",m.circle_smooth="circle_smooth",m.horizontal_bezier="horizontal_bezier",m.dotted_bars="dotted_bars",m.dotted_bars_mirrored="dotted_bars_mirrored",(h=n||(t.Unit=n={})).pixel="px",h.cm="cm",h.inch="in",(_=o||(t.ExportSize=o={})).optimized="opt",_["720p"]="720p",_["1080p"]="1080p",_.max1200="max1200",_.lowres="lr",_.small="sm",_.medium="md",_.large="lg",(f=a||(t.EditorStatus=a={})).INITIAL="init",f.READY="ready",f.LOADING="loading",f.LOADED="loaded",(v=s||(t.SourceType=s={})).SAMPLE="sample",v.AUDIO="audio",v.SPOTIFY="spotify",v.SEARCH="search",v.STOCK="stock",(g=d||(t.ExportFileType=d={})).JPG="jpg",g.PNG="png",g.SVG="svg",g.PDF="pdf",g.MP4="mp4",g.GIF="gif",g.WEBM="webm",g.MOV="mov",g.MOV_PRORES="mov-prores",(x=l||(t.AspectRatio=l={}))["3/1"]="3/1",x["3/2"]="3/2",x["2/1"]="2/1",x["16/9"]="16/9",x["5/4"]="5/4",x["4/3"]="4/3",x["1/2"]="1/2",x["1/1"]="1/1",x["4/5"]="4/5",x["9/16"]="9/16",x["2/3"]="2/3",x["11/14"]="11/14",x["27/35"]="27/35",x["297/210"]="297/210",x["210/297"]="210/297",x["17/22"]="17/22",x["22/17"]="22/17",(E=c||(t.ExportMethod=c={})).v10="v10",E.v11="v11",E.SmallPDFAndSelfConvert="v11",(N=u||(t.QRCodeState=u={}))[N.initial=0]="initial",N[N.loading=1]="loading",N[N.success=2]="success",N[N.errored=3]="errored",(y=p||(t.QRDestination=p={})).design="design",y.audio="audio",y.spotify="spotify",y.custom="custom_qr_dest"},40381:function(e,t){"use strict";var r,i;t.E=void 0,(i=r||(t.E=r={})).errored="errored",i.inprogress="inprogress",i.completed="completed",i.notstarted="notstarted",i.timedout="timedout",i.cancelled="cancelled",i.queued="queued"},75803:function(e,t){"use strict";var r,i;t.b=void 0,(i=r||(t.b=r={})).initial="init",i.loading="loading",i.inProgress="in-progress",i.processingPayment="processing",i.successful="success",i.errored="err"},38986:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_HORIZONTAL_BAR_SPACE=t.MAX_HORIZONTAL_BAR_THICKNESS=t.MAX_HEIGHT_MULTIPLIER=t.MIN_HEIGHT_MULTIPLIER=t.DEFAULT_HEIGHT_MULTIPLIER=t.MAX_HORIZONTAL_BAR_HEIGHT=t.MIN_HORIZONTAL_BAR_HEIGHT=t.DEFAULT_HEIGHT=t.DEFAULT_SPACE=t.DEFAULT_DOTTED_BAR_THICKNESS=t.MIN_DOTTED_BAR_THICKNESS=t.DEFAULT_THICKNESS=t.CUSTOM_BG_IMAGE_CONVERTED_PNG_FILE_ID=t.CUSTOM_BG_IMAGE_FILE_ID=t.STEM_ANALYSIS_FILE_ID=t.AUDIO_CONVERTED_MP3_FILE_ID=t.AUDIO_ORIGINAL_FILE_ID=t.ARROW_KEY_MOVEMENT_STEP=t.WAVEFORM_NODE_PREFIX=t.MAX_WAVEFORMS=t.BOTTOM_RECT_OBJECT_NAME=t.TOP_RECT_OBJECT_NAME=t.RIGHT_RECT_OBJECT_NAME=t.LEFT_RECT_OBJECT_NAME=t.FRAME_OBJECT_NAME=t.CAMERA_SHAKE_GROUP_NAME=t.CONTENT_GROUP_NAME=t.WRAPPER_GROUP_NAME=t.BG_COLOR_OBJECT_NAME=t.BG_IMAGE_OBJECT_NAME=t.TEXT_NODE_OBJECT_NAME_PREFIX=t.QRCODE_OBJECT_NAME=t.SOURCE_VIDEO_LAYER_OBJECT_NAME=t.IMAGE_LAYER_OBJECT_NAME_PREFIX=t.CIRCLE_CENTER_IMAGE_ZOOM_MAX=t.CIRCLE_CENTER_IMAGE_ZOOM_MIN=t.CIRCLE_CENTER_IMAGE_ZOOM_DEFAULT=t.CIRCLE_SOUNDWAVE_FRAME_RECT_NAME=t.CIRCLE_CENTER_IMAGE_BITMAP_NAME=t.CIRCLE_CENTER_IMAGE_CLIP_GROUP_NAME=t.CIRCLE_SOUNDWAVE_WRAPPER_NAME=t.RECORDER_SINE_POLYGON_NAME=t.SOUNDWAVE_OBJECT_NAME=t.DEFAULT_EDITOR_HEIGHT=t.DEFAULT_EDITOR_WIDTH=t.SOUNDWAVE_CIRCLE_REFERENCE_HEIGHT=t.SOUNDWAVE_REFERENCE_HEIGHT=t.SOUNDWAVE_REFERENCE_WIDTH=t.SAMPLE_HEIGHT=t.SOUNDWAVE_DEFAULT_RATIO=void 0,t.GELATO_FRAMED_POSTER_ID_START=t.GELATO_CANVAS_ID_START=t.GELATO_POSTER_ID_START=t.MAX_CIRCLE_BAR_SPACE=t.MAX_CIRCLE_BAR_THICKNESS=t.MAX_CIRCLE_BAR_LENGTH=t.MIN_CIRCLE_BAR_LENGTH=t.DEFAULT_CIRCLE_SPACE=t.DEFAULT_CIRCLE_THICKNESS=t.DEFAULT_CIRCLE_BAR_HEIGHT=t.MAX_ROTATION_ANGLE_RADIUS=t.MAX_CIRCLE_RADIUS=t.MIN_ROTATION_ANGLE_RADIUS=t.MIN_CIRCLE_RADIUS=t.DEFAULT_CIRCLE_RADIUS=t.MIN_SOUNDWAVE_GLOW_BLUR=t.MAX_SOUNDWAVE_GLOW_BLUR=t.DEFAULT_SOUNDWAVE_GLOW_COLOR=t.DEFAULT_SOUNDWAVE_GLOW_BLUR=void 0,t.SOUNDWAVE_DEFAULT_RATIO=.8,t.SAMPLE_HEIGHT=512,t.SOUNDWAVE_REFERENCE_WIDTH=720,t.SOUNDWAVE_REFERENCE_HEIGHT=360,t.SOUNDWAVE_CIRCLE_REFERENCE_HEIGHT=600,t.DEFAULT_EDITOR_WIDTH=400,t.DEFAULT_EDITOR_HEIGHT=200,t.SOUNDWAVE_OBJECT_NAME="soundwave",t.RECORDER_SINE_POLYGON_NAME="recorder-sine-wave",t.CIRCLE_SOUNDWAVE_WRAPPER_NAME="circle-soundwave-wrapper",t.CIRCLE_CENTER_IMAGE_CLIP_GROUP_NAME="circle-center-image-clip",t.CIRCLE_CENTER_IMAGE_BITMAP_NAME="circle-center-image-bitmap",t.C
1IRCLE_SOUNDWAVE_FRAME_RECT_NAME="circle-soundwave-frame",t.CIRCLE_CENTER_IMAGE_ZOOM_DEFAULT=1,t.CIRCLE_CENTER_IMAGE_ZOOM_MIN=1,t.CIRCLE_CENTER_IMAGE_ZOOM_MAX=4,t.IMAGE_LAYER_OBJECT_NAME_PREFIX="image-layer-",t.SOURCE_VIDEO_LAYER_OBJECT_NAME="image-layer-source-video",t.QRCODE_OBJECT_NAME="qrcode",t.TEXT_NODE_OBJECT_NAME_PREFIX="text-node-",t.BG_IMAGE_OBJECT_NAME="background-image",t.BG_COLOR_OBJECT_NAME="background-color",t.WRAPPER_GROUP_NAME="wrapper",t.CONTENT_GROUP_NAME="content",t.CAMERA_SHAKE_GROUP_NAME="camera-shake",t.FRAME_OBJECT_NAME="out-of-canvas",t.LEFT_RECT_OBJECT_NAME="__left-rect",t.RIGHT_RECT_OBJECT_NAME="__right-rect",t.TOP_RECT_OBJECT_NAME="__top-rect",t.BOTTOM_RECT_OBJECT_NAME="__bottom-rect",t.MAX_WAVEFORMS=6,t.WAVEFORM_NODE_PREFIX="waveform_",t.ARROW_KEY_MOVEMENT_STEP=2,t.AUDIO_ORIGINAL_FILE_ID="audio_original",t.AUDIO_CONVERTED_MP3_FILE_ID="audio_converted_mp3",t.STEM_ANALYSIS_FILE_ID="stem_analysis_json",t.CUSTOM_BG_IMAGE_FILE_ID="background_image_original",t.CUSTOM_BG_IMAGE_CONVERTED_PNG_FILE_ID="background_image_converted-png",t.DEFAULT_THICKNESS=2,t.MIN_DOTTED_BAR_THICKNESS=4,t.DEFAULT_DOTTED_BAR_THICKNESS=7,t.DEFAULT_SPACE=1,t.DEFAULT_HEIGHT=t.SAMPLE_HEIGHT,t.MIN_HORIZONTAL_BAR_HEIGHT=256,t.MAX_HORIZONTAL_BAR_HEIGHT=1024,t.DEFAULT_HEIGHT_MULTIPLIER=1,t.MIN_HEIGHT_MULTIPLIER=.3,t.MAX_HEIGHT_MULTIPLIER=2,t.MAX_HORIZONTAL_BAR_THICKNESS=20,t.MAX_HORIZONTAL_BAR_SPACE=12,t.DEFAULT_SOUNDWAVE_GLOW_BLUR=13,t.DEFAULT_SOUNDWAVE_GLOW_COLOR="#B9B6B6",t.MAX_SOUNDWAVE_GLOW_BLUR=50,t.MIN_SOUNDWAVE_GLOW_BLUR=0,t.DEFAULT_CIRCLE_RADIUS=100,t.MIN_CIRCLE_RADIUS=0,t.MIN_ROTATION_ANGLE_RADIUS=-180,t.MAX_CIRCLE_RADIUS=180,t.MAX_ROTATION_ANGLE_RADIUS=180,t.DEFAULT_CIRCLE_BAR_HEIGHT=120,t.DEFAULT_CIRCLE_THICKNESS=2,t.DEFAULT_CIRCLE_SPACE=0,t.MIN_CIRCLE_BAR_LENGTH=20,t.MAX_CIRCLE_BAR_LENGTH=160,t.MAX_CIRCLE_BAR_THICKNESS=8,t.MAX_CIRCLE_BAR_SPACE=9,t.GELATO_POSTER_ID_START="flat_",t.GELATO_CANVAS_ID_START="canvas_",t.GELATO_FRAMED_POSTER_ID_START="framed_poster_"},18064:function(e,t){"use strict";var r,i,n,o;t.Pm=t.f2=void 0,(n=r||(t.f2=r={})).all="all",n.paid="paid",n.draft="draft",n.trash="trash",(o=i||(t.Pm=i={})).FULL="FULL",o.BASIC="BASIC",o.BARE_MIN="BARE_MIN"},25139:function(e,t){"use strict";var r,i;t.A9=t.es=t.du=void 0,(i=r||(t.du=r={})).CONVERT_AUDIO="CONVERT_AUDIO",i.TRANSCRIBE="TRANSCRIBE",i.ANALYZE_STEMS="ANALYZE_STEMS",t.es="convert-audio-job-",t.A9="transcription-job-"},72384:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clampCueWindow=function(e,t,r,i){var n;let o=r?r.endMs:0,a=i?Math.max(o,i.startMs):Number.POSITIVE_INFINITY,s=void 0===t.startMs?Math.max(0,e.startMs):Math.min(a,Math.max(o,t.startMs)),d=Math.max(s,null!==(n=t.endMs)&&void 0!==n?n:e.endMs);return void 0===t.startMs&&void 0===t.endMs?{startMs:s,endMs:d}:{startMs:s,endMs:Math.min(Math.max(s,a),d)}}},40568:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LEGACY_ASR_CAPTION_SLOT_NAME=t.DEFAULT_CAPTION_TRACK_ID=t.DEFAULT_CAPTION_LAYOUT_ID=void 0,t.emptyCaptionsConfig=function(){return{layouts:[{id:t.DEFAULT_CAPTION_LAYOUT_ID,textNodeName:i.CAPTION_TEXT_NODE_NAME}],tracks:[{id:t.DEFAULT_CAPTION_TRACK_ID,layoutId:t.DEFAULT_CAPTION_LAYOUT_ID,cues:[]}]}},t.captionsConfigsMatch=function(e,t){return JSON.stringify(null!=e?e:null)===JSON.stringify(null!=t?t:null)},t.isCaptionsKaraokeModeEnabled=function(e){return(null==e?void 0:e.karaokeMode)!==!1},t.captionsFontSizeMode=a,t.isCaptionsFontSizeStable=function(e){return"stable"===a(e)},t.updateCaptionsConfigOptions=function(e,t){return{...e,...t}},t.replaceCaptionsConfigCues=function(e,t){let{karaokeMode:r,fontSizeMode:i,...n}=t;return{...n,...(null==e?void 0:e.karaokeMode)!==void 0&&{karaokeMode:e.karaokeMode},...(null==e?void 0:e.fontSizeMode)!==void 0&&{fontSizeMode:e.fontSizeMode}}},t.normalizeCaptionsConfigLayouts=function(e){var r;return{...e,layouts:(null!==(r=e.layouts)&&void 0!==r?r:[]).map(e=>({...e,textNodeName:e.textNodeName===t.LEGACY_ASR_CAPTION_SLOT_NAME?i.CAPTION_TEXT_NODE_NAME:e.textNodeName}))}},t.captionsConfigCueCount=s,t.isCaptionSlotLayerName=d,t.shouldKeepEmptyCaptionTextNode=function(e,t){return 0!==s(t)&&d(e,t)},t.listCaptionsConfigCues=l,t.addCaptionsConfigCue=function(e){var r,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;if(!(null==e?void 0:null===(r=e.tracks)||void 0===r?void 0:r.length))return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;return{layouts:[{id:t.DEFAULT_CAPTION_LAYOUT_ID,textNodeName:i.CAPTION_TEXT_NODE_NAME}],tracks:[{id:t.DEFAULT_CAPTION_TRACK_ID,layoutId:t.DEFAULT_CAPTION_LAYOUT_ID,cues:[{startMs:0,endMs:e||3e3,text:""}]}]}}(o);let a=e.tracks[0].cues.reduce((e,t)=>
1Math.max(e,t.endMs),0),s={startMs:a,endMs:Math.max(a+1e3,o||a+1e3),text:""};return{layouts:(null===(n=e.layouts)||void 0===n?void 0:n.length)>0?e.layouts:[{id:t.DEFAULT_CAPTION_LAYOUT_ID,textNodeName:i.CAPTION_TEXT_NODE_NAME}],tracks:e.tracks.map((e,t)=>0===t?{...e,cues:[...e.cues,s]}:e)}},t.removeCaptionsConfigCue=function(e,t,r){let i=e.tracks.map(e=>e.id!==t?e:{...e,cues:e.cues.filter((e,t)=>t!==r)});return{...e,tracks:i}},t.clearCaptionsConfigCues=function(e){return{...e,tracks:e.tracks.map(e=>({...e,cues:[]}))}},t.captionsConfigCuesMissingWordTimingsCount=function(e){var t;return(null==e?void 0:null===(t=e.tracks)||void 0===t?void 0:t.length)?e.tracks.reduce((e,t)=>e+t.cues.filter(e=>{var t;return""!==e.text.trim()&&!(null===(t=e.wordTimings)||void 0===t?void 0:t.length)}).length,0):0},t.updateCaptionsConfigCue=function(e,t,r,i){let a=e.tracks.map(e=>{if(e.id!==t)return e;let a=e.cues.map((t,a)=>{if(a!==r)return t;let{startMs:s,endMs:d}=(0,n.clampCueWindow)(t,i,e.cues[a-1],e.cues[a+1]);if(void 0!==i.text&&i.text!==t.text)return{startMs:s,endMs:d,text:i.text,fadeInMs:t.fadeInMs,fadeOutMs:t.fadeOutMs};let l=(0,o.retimeCueWordTimings)(t.wordTimings,t,{startMs:s,endMs:d});return{...t,...i,startMs:s,endMs:d,...l?{wordTimings:l}:{}}});return{...e,cues:a}});return{...e,tracks:a}},t.previewCaptionsConfigCueAtTime=c,t.previewCaptionsConfigCueText=function(e){var t,r;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return null!==(r=null===(t=c(e,i))||void 0===t?void 0:t.text)&&void 0!==r?r:""},t.resolveCaptionKaraokePreviewCue=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=l(e);return null!=r?i[r]:c(e,t)};let i=r(11080),n=r(72384),o=r(53026);function a(e){return(null==e?void 0:e.fontSizeMode)==="stable"?"stable":"adaptive"}function s(e){var t;return(null==e?void 0:null===(t=e.tracks)||void 0===t?void 0:t.length)?e.tracks.reduce((e,t)=>e+t.cues.length,0):0}function d(e,r){var n;return!!e&&(e===i.CAPTION_TEXT_NODE_NAME||e===t.LEGACY_ASR_CAPTION_SLOT_NAME||(null!==(n=null==r?void 0:r.layouts)&&void 0!==n?n:[]).some(t=>t.textNodeName===e))}function l(e){var t;return(null==e?void 0:null===(t=e.tracks)||void 0===t?void 0:t.length)?e.tracks.flatMap(e=>e.cues.map((t,r)=>({...t,trackId:e.id,cueIndex:r}))):[]}function c(e,t){return l(e).find(e=>(0,i.isCueActiveAtTime)(e,t))}t.DEFAULT_CAPTION_LAYOUT_ID="caption-layout-default",t.DEFAULT_CAPTION_TRACK_ID="caption-track-1",t.LEGACY_ASR_CAPTION_SLOT_NAME="Caption"},34444:function(e,t,r){"use strict";t.v=function(e){var t,r,s,d;if(null==e.audioSource||e.audioSource===i.SourceType.SPOTIFY||e.audioSource===i.SourceType.SEARCH)return{intent:"still",score:null,source:"veto"};let l=(null==(s=(t=e).landingPath)?a["/editor"]:null!==(d=a[s])&&void 0!==d?d:a["/editor"])+n[t.aspectRatio]+(null!=t.audioSource&&null!==(r=o[t.audioSource])&&void 0!==r?r:0),c="unknown";return l>=3?c="motion":l<=-2&&(c="still"),{intent:c,score:l,source:"weighted"}};let i=r(19458),n={[i.AspectRatio["9/16"]]:7,[i.AspectRatio["16/9"]]:4,[i.AspectRatio["4/5"]]:3,[i.AspectRatio["2/1"]]:2,[i.AspectRatio["1/1"]]:0,[i.AspectRatio["2/3"]]:0,[i.AspectRatio["5/4"]]:0,[i.AspectRatio["3/2"]]:0,[i.AspectRatio["1/2"]]:0,[i.AspectRatio["3/1"]]:-1,[i.AspectRatio["297/210"]]:-3,[i.AspectRatio["210/297"]]:-3,[i.AspectRatio["17/22"]]:-3,[i.AspectRatio["22/17"]]:-3,[i.AspectRatio["11/14"]]:-3,[i.AspectRatio["27/35"]]:-3,[i.AspectRatio["4/3"]]:-3},o={[i.SourceType.AUDIO]:1,[i.SourceType.SAMPLE]:-3},a={"/audiogram-maker":3,"/waveform-video-for-youtube":3,"/sound-wave-video":3,"/audio-waveform-generator":2,"/music-visualizer":2,"/editor":0,"/":-1,"/soundviz-alternative":-5}},53026:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.retimeCueWordTimings=function(e,t,r){if(!(null==e?void 0:e.length)||t.startMs===r.startMs&&t.endMs===r.endMs)return e;let i=t.endMs-t.startMs,n=r.endMs-r.startMs;if(i<=0){let t=n/e.length;return e.map((e,i)=>({...e,startMs:Math.round(r.startMs+t*i),endMs:Math.round(r.startMs+t*(i+1))}))}let o=e=>{let o=Math.min(1,Math.max(0,(e-t.startMs)/i));
1return Math.round(r.startMs+o*n)};return e.map(e=>({...e,startMs:o(e.startMs),endMs:o(e.endMs)}))}},11080:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CAPTION_TEXT_NODE_NAME=t.CAPTIONS_CLIP_ID=t.PRIMARY_CLIP_ID=void 0,t.isClipWindowActive=n,t.isUntimedWaveformPlaceholder=o,t.isCueActiveAtTime=a,t.findClipById=s,t.findClipForLayerId=d,t.isObjectVisibleAtTime=function(e,r,a){let l=d(e,r);if(l){let e=l.layers.find(e=>e.id===r);return(null==e||!e.hidden)&&(!!o(l,null!=e?e:{})||n(l,a))}if((function(e){let r=new Set([t.CAPTION_TEXT_NODE_NAME]);return Object.values(e).forEach(e=>{e.textNodeName&&r.add(e.textNodeName)}),r})(e.captionTracks).has(r)){let r=s(e,t.CAPTIONS_CLIP_ID);if(!r)return;return n(r,a)}if(r===i.SOURCE_VIDEO_LAYER_OBJECT_NAME){let r=s(e,t.PRIMARY_CLIP_ID);if(!r)return;return n(r,a)}},t.visibleAtTime=function(e,t){let r=[],i=[];return e.tracks.forEach(e=>{e.clips.forEach(e=>{if(!n(e,t)){e.layers.forEach(t=>{o(e,t)&&i.push(t.id)});return}r.push(e.id),e.layers.forEach(e=>{e.hidden||i.push(e.id)})})}),{clipIds:r,layerIds:i,cameraShake:c(e,t)}},t.activeCameraShakeEffectAtTime=l,t.cameraShakeActiveAtTime=c,t.frameTimeMs=function(e,t){return t>0?e/t*1e3:0},t.activeCaptionCueFromTracks=u,t.activeCaptionCueAtTime=function(e,t){return u(e.captionTracks,t)},t.cameraShakeConfigAtTime=function(e,t){var r;let i=l(e,t);if(i)return{enabled:!0,intensity:i.intensity,frequency:i.frequency,audioReactive:i.audioReactive,seed:null!==(r=i.seed)&&void 0!==r?r:42}};let i=r(38986);function n(e,t){return!e.muted&&e.durationMs>0&&t>=e.startMs&&t<e.startMs+e.durationMs}function o(e,t){return"waveform"===t.type&&!t.hidden&&!e.muted&&!(e.durationMs>0)}function a(e,t){return t>=e.startMs&&t<e.endMs}function s(e,t){return e.tracks.flatMap(e=>e.clips).find(e=>e.id===t)}function d(e,t){return e.tracks.flatMap(e=>e.clips).find(e=>e.layers.some(e=>e.id===t))}function l(e,t){for(let r of e.effectTracks)if(!r.muted){for(let e of r.clips)if(!e.muted&&"cameraShake"===e.effect.type&&n(e,t))return e.effect}return null}function c(e,t){return null!==l(e,t)}function u(e,t){if(e)return Object.values(e).flatMap(e=>e.cues).find(e=>a(e,t))}t.PRIMARY_CLIP_ID="clip-primary",t.CAPTIONS_CLIP_ID="clip-captions",t.CAPTION_TEXT_NODE_NAME="c
1aption-track-default"},43328:function(e,t,r){"use strict";t.Zd=function(e){var t;return null!==(t=function(e){var t;if(!e)return e;let r=/^Job \S+ failed: ([\s\S]+)$/.exec(e),n=null!==(t=null==r?void 0:r[1])&&void 0!==t?t:e;return(0,i.sanitizeTranscriptionJobStoredResult)(n)}(e))&&void 0!==t?t:i.TRANSCRIPTION_FAILED_GENERIC_MESSAGE};let i=r(92333)},92333:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSCRIPTION_FAILED_GENERIC_MESSAGE=t.TRANSCRIPTION_AUDIO_EMPTY_MESSAGE=t.TRANSCRIPTION_AUDIO_DOWNLOAD_FAILED_MESSAGE=void 0,t.isTranscriptionUserFacingFailureMessage=i,t.toTranscriptionJobUserFacingResult=function(e){let t=e.message.trim();return i(t)?t:(t&&n(t),o(t))},t.sanitizeTranscriptionJobStoredResult=function(e){if(!(null==e?void 0:e.trim()))return t.TRANSCRIPTION_FAILED_GENERIC_MESSAGE;let r=e.trim();return i(r)?r:(n(r),o(r))},t.TRANSCRIPTION_AUDIO_DOWNLOAD_FAILED_MESSAGE="We could not access your audio for transcription. Re-upload the file and try again.",t.TRANSCRIPTION_AUDIO_EMPTY_MESSAGE="The audio file looks empty. Upload a longer clip and try again.",t.TRANSCRIPTION_FAILED_GENERIC_MESSAGE="Transcription failed. Try again after your audio is uploaded.";let r=new Set([t.TRANSCRIPTION_AUDIO_DOWNLOAD_FAILED_MESSAGE,t.TRANSCRIPTION_AUDIO_EMPTY_MESSAGE,t.TRANSCRIPTION_FAILED_GENERIC_MESSAGE]);function i(e){return!!(e&&r.has(e))}function n(e){return!!(e.includes("transcribe.py exited with code")||e.includes("urllib.error")||e.includes("Traceback (most recent call last)")||e.includes('File "/')||e.includes("storage.googleapis.com")||e.includes("X-Goog-"))||e.length>280}function o(e){let r=e.toLowerCase();return r.includes("http 403")||r.includes("forbidden")||r.includes("accessdenied")||r.includes("[accessdenied]")||r.includes("failed to download audio")||r.includes("timed out downloading audio")?t.TRANSCRIPTION_AUDIO_DOWNLOAD_FAILED_MESSAGE:r.includes("downloaded audio")&&r.includes("empty")?t.TRANSCRIPTION_AUDIO_EMPTY_MESSAGE:r.includes("invalid audio url")?t.TRANSCRIPTION_AUDIO_DOWNLOAD_FAILED_MESSAGE:t.TRANSCRIPTION_FAILED_GENERIC_MESSAGE}},11242:function(e,t,r){"use strict";t.QL=void 0,t.FG=function(e){var r;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.QL;if(!(null==e?void 0:null===(r=e.tracks)||void 0===r?void 0:r.length))return{};let o=(0,i.normalizeCaptionsConfigLayouts)(e),a={};return o.tracks.forEach((e,t)=>{var r,i,s;let d=null===(r=o.layouts)||void 0===r?void 0:r.find(t=>t.id===e.layoutId),l=e.id||"caption-track-".concat(t+1);a[l]={id:l,groupId:null!==(i=e.groupId)&&void 0!==i?i:"default",defaultText:e.cues.map(e=>e.text).filter(Boolean).join(" "),textNodeName:null!==(s=null==d?void 0:d.textNodeName)&&void 0!==s?s:n,cues:e.cues.map((e,t)=>({id:"".concat(l,"-cue-").concat(t),startMs:e.startMs,endMs:e.endMs,text:e.text,fadeInMs:e.fadeInMs,fadeOutMs:e.fadeOutMs}))}}),a},t.Qo=function(e){return e?Object.values(e).reduce((e,t)=>e+t.cues.length,0):0};let i=r(40568);t.QL="caption-track-default"},29188:function(e){e.exports={checkoutSectionCard:"CheckoutPage_checkoutSectionCard__djddG"}},49177:function(e,t,r){"use strict";r.d(t,{Ji:function(){return m},BK:function(){return h}});var i,n,o,a,s=r(22970),d=r(2784),l=r(83112);(i=o||(o={})).formatDate="FormattedDate",i.formatTime="FormattedTime",i.formatNumber="FormattedNumber",i.formatList="FormattedList",i.formatDisplayName="FormattedDisplayName",(n=a||(a={})).formatDate="FormattedDateParts",n.formatTime="FormattedTimeParts",n.formatNumber="FormattedNumberParts",n.formatList="FormattedListParts";var c=function(e){var t=(0,l.Z)(),r=e.value,i=e.children,n=(0,s._T)(e,["value","children"]);return i(t.formatNumberToParts(r,n))};function u(e){var t=function(t){var r=(0,l.Z)(),i=t.value,n=t.children,o=(0,s._T)(t,["value","children"]),a="string"==typeof i?new Date(i||0):i;return n("formatDate"===e?r.formatDateToParts(a,o):r.formatTimeToParts(a,o))};return t.displayName=a[e],t}function p(e){var t=function(t){var r=(0,l.Z)(),i=t.value,n=t.children,o=(0,s._T)(t,["value","children"]),a=r[e](i,o);if("function"==typeof n)return n(a);var c=r.textComponent||d.Fragment;return d.createElement(c,null,a)};return t.displayName=o[e],t}c.displayName="FormattedNumberParts",c.displayName="FormattedNumberParts";var m=p("formatDate");p("formatTime");var h=p("formatNumber");p("formatList"),p("formatDisplayName"),u("formatDate"),u("formatTime")},7896:function(e,t,r){"use strict";function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e}).apply(null,arguments)}r.d(t,{Z:function(){return i}})}},function(e){e.O(0,[648,509,4738,4321,8391,4232,8638,4358,6577,2066,6438,3955,258,5340,227,5141,2888,9774,179],function(){return e(e.s=7957)}),_N_E=e.O()}]);

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.