PageSourceSearch

https://audioboom.com/assets/packs/js/2238-a4e46f953e291e2088e5.chunk.js

js audioboom.com collected 2026-09-24 07:30:05 UTC 48,494 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="216bf8b8-eb11-4f92-95b2-26751287950d",e._sentryDebugIdIdentifier="sentry-dbid-216bf8b8-eb11-4f92-95b2-26751287950d")}catch(e){}}();"use strict";(self.webpackChunkaudioboom_web=self.webpackChunkaudioboom_web||[]).push([[2238],{53605:function(e,t,n){n.d(t,{Vq:function(){return g},hv:function(){return v},YF:function(){return j},LH:function(){return y},dt:function(){return N},XI:function(){return C},aW:function(){return A}});var r=n(45342),i=n(77615),s=n(6730),a=n(79371),l=n(54669),o=n(41410),d=n(40957),c=n(20311),u=n.n(c),m=n(27010),h=n(40961),p=n(94727);async function f(){let e=Date.now(),t=await fetch("/api/tools/time",{headers:{accept:"application/json; version=1"}}),{t1:n,t2:r}=await t.json();return(n-e+(r-Date.now()))/2}let x=null,b=null;function g(e,t,n){return(s,a)=>{let l=a(),o=(0,r.x4)(l,{destinationId:e});b??=f().then(e=>{x=e}).catch(e=>console.error("failed to fetch clock offset",e));let d=(0,i.$R)({destinationId:o.id,episodeNumber:o.newEpisodeNumber,seasonNumber:o.currentSeasonNumber});return s((0,p.uY)({row:d})),t&&s(v(d.rowId,t,n)),d.rowId}}function v(e,t,n){return(r,s)=>{t?(r((0,p.hv)({rowId:e,file:t,error:n||null})),n||(0,i.kL)(e,t,{type:"audio"},t=>r((0,p.zi)({rowId:e,progress:t})))):((0,i.nM)(e,"audio"),r((0,p.hv)({rowId:e,file:null,error:null})))}}function j(e,t,n,s){return(a,l)=>{let o=(0,r.Vq)(l(),e);if(t){a((0,p.YF)({rowId:e,file:t,imageSrc:n?.data||null,error:s}));let r=o.episodeData.id?"local":"s3";s||(0,i.kL)(e,t,{type:"image",target:r},t=>a((0,p.YL)({rowId:e,progress:t})))}else(0,i.nM)(e,"image"),a((0,p.YF)({rowId:e,file:null,imageSrc:null,error:null}))}}function y(e){return(t,n)=>{let s=n(),a=(0,r.Vq)(s,e).publishState===i.w1.complete;(a||!a&&window.confirm("If you discard it you can't get it back… Are you sure?"))&&((0,i.nM)(e,"audio"),(0,i.nM)(e,"image"),t((0,p.LH)({rowId:e})))}}function N(e){return A(e)}let w=new Map;function S(e,t){let n=!1,i=()=>{n=!0,t((t,n)=>{w.get(e)?.abort(),w.delete(e),(0,r.lI)(n(),e)&&t((0,p.mU)({rowId:e}))})};return document.addEventListener("turbo:visit",i,{once:!0}),{get abandoned(){return n},stop:()=>document.removeEventListener("turbo:visit",i)}}let _=e=>e instanceof d.o3&&422===e.response.status,R=e=>!!(e&&e.file&&!e.uploadKey&&e.uploadProgress&&e.uploadProgress.error);function A(e,t){return(n,s)=>{t&&n((0,p.Zj)({rowId:e,attrs:t}));let a=(0,i.m7)(e,"audio");R(a)&&a.upload(t=>n((0,p.zi)({rowId:e,progress:t})));let d=(0,i.m7)(e,"image");R(d)&&d.upload(t=>n((0,p.YL)({rowId:e,progress:t})));let c=new AbortController;w.set(e,c);let m=S(e,n);n((0,p.WO)({rowId:e,submittedAtMs:null===x?null:Date.now()+x}));let h=s(),f=(0,r.Vq)(h,e),b=(0,r.Iw)(h,e,"midroll"),g=b.length?b:void 0;(0,i.q1)(f,{markers:g,signal:c.signal}).then(function({episodeData:t,aborted:i}){if(m.stop(),w.delete(e),(0,r.lI)(s(),e))if(t){if(n((0,p.bu)({rowId:e,episodeData:t})),m.abandoned)return;(0,o.R)()}else u()(i,"missing episodeData, but not aborted?"),n((0,p.mU)({rowId:e}))}).catch(t=>{if(m.stop(),!(0,r.lI)(s(),e))return;let i=_(t);return(0,l.i)(t).then(t=>n((0,p.Qw)({rowId:e,errors:t,validationError:i})))})}}function C(e,t){return(n,d)=>{t&&n((0,p.Zj)({rowId:e,attrs:t}));let c=d(),f=(0,r.Vq)(c,e),x=c.midrollMarkers.episodes[e]&&(0,r.oW)(c,e,"midroll")?(0,r.Iw)(c,e,"midroll"):void 0,b=new AbortController;w.set(e,b);let g=S(e,n);n((0,p.WO)({rowId:e})),(0,i.q1)(f,{markers:x,signal:b.signal}).then(function({episodeData:t,aborted:l,redirect:c}){if(g.stop(),w.delete(e),(0,r.lI)(d(),e))if(t){if((0,i.wB)(e),(0,h.flushSync)(()=>n((0,p.bu)({rowId:e,episodeData:t}))),g.abandoned)return;(0,o.R)(),(0,s.l)("Episode updated!"),m.V.visit(c||(0,a.CJ)(t.id),{action:"replace"})}else u()(l,"missing episodeData, but not aborted?"),console.debug("upload aborted")}).catch(t=>{if(g.stop(),!(0,r.lI)(d(),e))return;let i=_(t);return(0,l.i)(t).then(t=>n((0,p.Qw)({rowId:e,errors:t,validationError:i})))})}}},38754:function(e,t,n){var r=n(74848);n(96540);var i=n(77688),s=n(55329),a=n(46942),l=n.n(a),o=n(79656);let d=e=>{let t="html"in e?{dangerouslySetInnerHTML:{__html:e.html}}:"text"in e?{children:e.text}:{children:e.children};return(0,r.jsx)("div",{...t,style:{maxWidth:400},role:"tooltip"})},c=e=>{let[t,n,a,c]=(0,s.A)();return(0,r.jsxs)("div",{className:"d-inline-flex",children:[(0,r.jsx)("button",{type:"button","aria-label":"Help",className:l()("within-para-button button-emphasise-focus",e.extraClasse
1s),ref:n,onClick:e=>{e.preventDefault(),c(!0)},children:(0,r.jsx)(i.A,{icon:o.APe})}),t((0,r.jsx)(d,{...e}))]})};t.default=c,n.d(t,["l",0,c])},17383:function(e,t,n){var r=n(74848),i=n(46942),s=n.n(i);t.A=function({percentage:e,striped:t,ariaLabel:n="Upload progress"}){let i=Math.min(100,Math.max(0,e));return(0,r.jsx)("div",{className:"progress",children:(0,r.jsx)("div",{className:s()("progress-bar",{"progress-bar-striped progress-bar-animated":t}),role:"progressbar","aria-label":n,style:{width:`${i}%`,transition:"width 300ms ease"},"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100})})}},55329:function(e,t,n){var r=n(74848),i=n(34743),s=n(17663),a=n(96540),l=n(20311),o=n.n(l),d=n(35726);t.A=({startOpen:e=!1,placement:t="bottom",fixedPlacement:n=!1,ignoreLayoutShift:l=!1}={})=>{var h,p,f,x,b,g;let v,[j,y]=(0,a.useState)(e),[N,w]=(0,a.useState)(null),{refs:S,floatingStyles:_,middlewareData:R,placement:A,isPositioned:C}=(0,i.we)((h=t,p=N,f=n,x=l,{..."center"===h?{placement:"top",middleware:[u]}:{placement:h,middleware:[(0,i.cY)(8),f?null:(0,i.UU)({fallbackAxisSideDirection:"start",crossAxis:!1}),(0,i.BN)(),(0,i.UE)({element:p})]},whileElementsMounted:x?m:s.ll})),D=R.arrow,k=(0,a.useCallback)(()=>y(!1),[]);return b=[S.reference.current,S.floating.current],g=k,v=(0,a.useCallback)(e=>{let t=e.target;t instanceof Node&&(b.some(e=>e?.contains(t))||g())},[...b,g]),(0,a.useEffect)(()=>(document.addEventListener("click",v,!0),()=>{document.removeEventListener("click",v,!0)}),[v]),[(0,a.useCallback)(e=>{var n;let i={..._,willChange:void 0},s={position:"absolute",left:D?.x,top:D?.y,margin:0},a=`popover ${(n=A,o()(n in c,`unknown placement ${n}`),c[n])}`,l="center"===t?null:(0,r.jsx)("div",{ref:w,style:s,className:"popover-arrow"});return(0,r.jsx)(d.Nr,{in:j,children:(0,r.jsxs)("div",{ref:S.setFloating,style:i,className:a,children:[l,(0,r.jsx)("div",{className:"popover-body",children:e})]})})},[j,_,S.setFloating,w,t,A,D]),S.setReference,j&&C,y]};let c={top:"bs-popover-top",bottom:"bs-popover-bottom",left:"bs-popover-start",right:"bs-popover-end",center:"bs-popover-top"},u=(0,i.cY)(function({rects:e}){return-e.reference.height/2-e.floating.height/2});function m(e,t,n,r){return(0,s.ll)(e,t,n,{...r,layoutShift:!1})}},32224:function(e,t,n){n.d(t,{A:function(){return u}});var r=n(74848),i=n(77688),s=n(68780),a=e=>{let{imageRatio:t,src:n}=e;t||(t=1);let i={height:0,paddingBottom:100/t+"%"};return(0,r.jsx)("div",{style:i,className:"pos-rel",children:n&&(0,r.jsx)("img",{className:"pos-abs wh-100 object-cover",src:n})})},l=n(20311),o=n.n(l),d=n(15685),c=n(96540),u=function({imageSrc:e=null,imageRatio:t=1,id:n,className:l,onFileDrop:u}){let m=(0,c.useId)(),h=n||m;return(0,r.jsx)(s.A,{chunky:!0,onFileDrop:e=>{let t=e[0];o()(t,"How is it possible to drop zero files?"),u&&u(t)},fileProps:{accept:"image/*"},id:h,className:l,children:(0,r.jsx)("div",{className:"pos-rel",style:{height:0,paddingBottom:100/t+"%"},children:e?(0,r.jsx)(a,{src:e,imageRatio:t}):(0,r.jsx)("div",{className:"l-abs-fill-all l-flex-centre-children-v",children:(0,r.jsxs)("div",{className:"tc mha",children:[(0,r.jsx)(i.A,{icon:d.rwq,className:"fa-2x mvm file-drop-icon"}),(0,r.jsx)("label",{htmlFor:h,className:"db file-drop-text form-label",children:"Add an image"})]})})})})}},35996:function(e,t,n){var r=n(74848),i=n(96540);let s=(0,i.lazy)(()=>Promise.all([n.e(8507),n.e(3094)]).then(n.bind(n,40713))),a=()=>(0,r.jsxs)("div",{className:"border rounded",children:[(0,r.jsx)("div",{className:"border-bottom bg-light",style:{minHeight:38}}),(0,r.jsx)("div",{className:"bg-light-op-30",style:{minHeight:78}})]});t.A=e=>(0,r.jsx)(i.Suspense,{fallback:(0,r.jsx)(a,{}),children:(0,r.jsx)(s,{...e})})},35726:function(e,t,n){n.d(t,{AV:function(){return Y},Nr:function(){return X},e3:function(){return K},QP:function(){return Z},UW:function(){return Q},wY:function(){return V.A},F:function(){return z.A}});var r={};n.r(r),n.d(r,{appear:function(){return c},appearActive:function(){return u},appearDone:function(){return m},duration:function(){return h},enter:function(){return p},enterActive:function(){return f},enterDone:function(){return x},exit:function(){return b},exitActive:function(){return g},exitDone:function(){return v}});var i={};n.r(i),n.d(i,{appear:function(){return j},appearActive:function(){return y},appearDone:function(){return N},"duration-off":function(){return w},"duration-on":function(){return S},enter:function(){return _},enterActive:function(){return R},enterDone:function(){return A},exit:function(){return C},exitActive:function(){return D},exitDone:function(){return k}});var s={};n.r(s),n.d(s,{appear:function(){return E},appearActive:function(){return T},appearDone:function(){return P},duration:function(){return F},enter:function(){return I},enterActive:function(){return U},enterDone:function(){return M},exit:function(){return L},exitActive:function(){return B},exitDone:function(){return W}});var a=n(74848),l=n(96540),o=n(13642),d=n(33495),c="appear__jPPgn",u="appearActive__XrMh8",m="appearDone__d7RF6",h="150ms",p="enter__Zr_nP",f="enterActive__K1XFz",x="enterDone__AaJj9",b="exit__kFmvY",g="exitActive___L2ti",v="exitDone__O9ncH",j="appear__gYbjG",y="appearActive__OpG8C",N="appearDone__ZvPR5",
1w="150ms",S="300ms",_="enter__BO7ZC",R="enterActive__i0nNl",A="enterDone__bLBcg",C="exit__XKZbC",D="exitActive__vYjAX",k="exitDone__ubUtb",E="appear__dx7CV",T="appearActive__Wl4A9",P="appearDone__gc0m8",F="250ms",I="enter__WB5vU",U="enterActive__x8g5f",M="enterDone__jPSw6",L="exit__UwbIX",B="exitActive__KvV32",W="exitDone__Tpr3G",$=n(34435),V=n(6491),z=n(22618);(0,$.cS)(function(){document.body&&document.body.className.match("no-transitions")&&(o.A.disabled=!0)});let q=parseInt(h),O=parseInt(S),G=parseInt(w),H=parseInt(F);function Y(e){let{mountOnEnter:t=!0,unmountOnExit:n=!0,...i}=e;return(0,a.jsx)(d.A,{...i,mountOnEnter:t,unmountOnExit:n,classNames:r,timeout:q})}let X=e=>{let{children:t,className:n,role:r,id:i,...s}=e,o=l.useRef(null);return(0,a.jsx)(Y,{...s,nodeRef:o,children:(0,a.jsx)("div",{ref:o,children:t,className:n,role:r,id:i})})};function Z(e){let{mountOnEnter:t=!0,unmountOnExit:n=!0,...r}=e;return(0,a.jsx)(d.A,{...r,mountOnEnter:t,unmountOnExit:n,classNames:i,timeout:{enter:O,exit:G}})}let K=e=>{let{children:t,className:n,role:r,id:i,...s}=e,o=l.useRef(null);return(0,a.jsx)(Z,{...s,nodeRef:o,children:(0,a.jsx)("div",{ref:o,className:n,id:i,role:r,children:t})})};function Q(e){let{mountOnEnter:t=!0,unmountOnExit:n=!0,children:r,nodeRef:i,onEnter:l,onExit:o,...c}=e;return(0,a.jsx)(d.A,{...c,nodeRef:i,mountOnEnter:t,unmountOnExit:n,classNames:s,timeout:H,onEnter:e=>{let t=i?.current;t&&t.style.setProperty("--slide-height",`${t.scrollHeight}px`),l&&l(e)},onExit:()=>{let e=i?.current;e&&e.style.setProperty("--slide-height",`${e.offsetHeight}px`),o&&o()},children:r})}},81166:function(e,t,n){n.d(t,{A:function(){return g},m:function(){return m}});var r=n(74848),i=n(96540),s=n(40961),a=n(46942),l=n.n(a),o=n(45422);let d=e=>(0,o.DM)(e,"long_date_time");var c=({messageProvider:e=d,label:t="Time",initialValue:n,onChange:s})=>{let a,o,c,u,m,[h,p]=(0,i.useState)((a=n.getFullYear(),o=(n.getMonth()+1).toString().padStart(2,"0"),c=n.getDate().toString().padStart(2,"0"),u=n.getHours().toString().padStart(2,"0"),m=n.getMinutes().toString().padStart(2,"0"),`${a}-${o}-${c}T${u}:${m}`)),f=(0,i.useId)(),x=(e=>{try{let t=Date.parse(e);return isNaN(t)?null:new Date(t)}catch{return null}})(h),b="Invalid time";return x&&(b=e(x)),(0,r.jsxs)("div",{className:"border pam",children:[(0,r.jsx)("label",{className:"form-label",htmlFor:f,children:t}),(0,r.jsx)("input",{id:f,type:"datetime-local",className:"form-control mb-3",onChange:e=>{let t=e.currentTarget.value,n=Date.parse(t),r=isNaN(n)?null:new Date(n);p(t),r&&s(r)},value:h}),b?(0,r.jsx)("p",{className:l()("mbn",{"text-warning":!x}),children:b}):null]})},u=n(35726);function m(e,t,n){return t&&t>n?"published"===e?"Unpublish and schedule":"Schedule episode":"published"===e?"Save changes":"Publish episode"}function h(e){return e.getTime()>Date.now()?null:`Published on ${(0,o.DM)(e,"long_date_time")}`}function p(e){let t=(0,o.DM)(e,"long_date_time");return e.getTime()<=Date.now()?"Publish immediately with this publish date":`Schedule for ${t}`}function f(e){let[t,n]=i.useState(!1),r=i.useRef(null);return i.useEffect(()=>{if(t)return window.addEventListener("scroll",e,!0),()=>window.removeEventListener("scroll",e,!0);function e(){r.current?.querySelector('input[type="datetime-local"]')?.blur()}},[t]),{open:t,nodeRef:r,openField:function(){if((0,s.flushSync)(()=>n(!0)),!e)return;let t=r.current?.querySelector('input[type="datetime-local"]');t?.focus();try{t?.showPicker?.()}catch{}},closeField:()=>n(!1)}}function x({date:e,published:t,changeHandler:n}){let{open:s,nodeRef:a,openField:l}=f(!1),[d]=i.useState(e),[m,b]=i.useState(0),[g]=i.useState(Date.now),v=!!e&&e.getTime()>g,j=!!d&&!!e&&e.getTime()!==d.getTime();return(0,r.jsxs)(r.Fragment,{children:[!s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"l-flex-centre-children-v",children:[(0,r.jsxs)("span",{children:[t?"Published on":"Scheduled for"," ",e&&(0,o.DM)(e)," \xa0"]}),(0,r.jsx)("button",{className:"btn btn-link",type:"button",onClick:l,children:"edit"})]}),(0,r.jsx)("div",{className:"form-text text-muted",children:"Changing this date can affect the order of episodes."})]}),(0,r.jsx)(u.UW,{nodeRef:a,in:s,children:(0,r.jsxs)("div",{ref:a,children:[(0,r.jsx)(c,{label:"Publish date",initialValue:e||new Date,onChange:n,messageProvider:t?h:p},m),t&&j&&(0,r.jsxs)("div",{className:"border border-top-0 pam",children:[v&&e&&(0,r.jsxs)("p",{className:"small text-danger mbn",children:["Saving will unpublish this episode and schedule it for"," ",(0,o.DM)(e,"long_date_time"),"."]}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-link ps-0",onClick:function(){d&&(n(d),b(e=>e+1))},children:v?"Keep episode published":"Reset to saved date"})]})]})})]})}function b({date:e,changeHandler:t}){let[n]=i.useState(!e),{open:s,nodeRef:a,openField:l,closeField:d}=f(n),[m]=i.useState(Date.now),h=e?`Publish date: ${(0,o.DM)(e)}`:"Set a publish date",p=(0,r.jsxs)("div",{ref:a,children:[(0,r.jsx)(c,{label:"Publish date",initialValue:e||new Date,onChange:t,messageProvider:()=>null}),(0,r.jsxs)("div",{className:"border border-top-0 pam bg-light",children:[(0,r.jsx)("p",{className:"small text-muted mbn",children:e?e.getTime()<=m?"Publish immediately with this publish date":"Schedule this episode to publish on this date":"This episode will publish immediately."}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-link ps-0",onClick:function(){t(null),d()},children:e?"Remove date":"Cancel"})]})]});return(0,r.jsxs)(r.Fragment,{children:[!s&&(0,r.jsxs)("button",{type:"button",className:"btn btn-link ps-0",onClick:l,children:[(0,r.jsx)("i",{className:"far fa-calendar-days me-1","aria-hidden":"true"}),h]}),n?s&&p:(0,r.jsx)(u.UW,{nodeRef:a,in:s,children:p})]})}var g=function({date:e,publishState:t,changeHandler:n}){return"draft"===t?(0,r.jsx)(b,{date:e,changeHandler:n}):(0,r.jsx)(x,{date:e,published:"published"===t,changeHandler:n})}},50290:function(e,t,n){n.d(t,{A:function(){return en}});var r=n(74848),i=n(96540),s=n(46942),a=n.n(s),l=n(38754),o=({label:e})=>(0,r.jsx)("code",{className:"small text-muted",children:e}),d=n(35996),c=({onChange:e,htmlDescription:t,summary:n})=>{let s=(0,i.useId)(),a=(0,i.useId)();return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"l-flex-baseline-centre-children-v",children:[(0,r.jsx)("label",{htmlFor:a,className:"form-label",children:"Episode notes"}),(0,r.jsx)("label",{className:"form-label mla",children:(0,r.jsx)(o,{label:"<description>"})})]}),(0,r.jsx)(d.A,{id:a,defaultValue:t||"",onChange:t=>{e({htmlDescription:t})},maxHeight:"500px"})]}),(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"l-flex-baseline-centre-children-v",children:[(0,r.jsxs)("label",{htmlFor:s,className:"form-label",children:[(0,r.jsx)("span",{className:"mrs",children:"Optional summary"}),(0,r.jsx)(l.default,{children:"Summaries can be used by apps such as Apple Podcasts or Overcast to show an episode intro. They should be a brief one-or-two-sentence overview."})]}),(0,r.jsx)("label",{className:"form-label mla",children:(0,r.jsx)(o,{label:"<itunes:summary>"})})]}),(0,r.jsx)("textarea",{id:s,name:"summary",className:"form-control",rows:2,defaultValue:n||"",maxLength:1e3,onChange:t=>{e({summary:t.currentTarget.value})}})]})]})},u=n(20311),m=n.n(u),h=function({currentDestinationId:e,destinations:t,onChange:n}){let s=t.find(t=>
1t.id===e)||t[0];m()(s,"no destination?");let a=t.map(e=>(0,r.jsx)("option",{value:e.id,children:e.title},e.id)),l=(0,i.useCallback)(e=>{let t=e.target.value;n(t?parseInt(t):null)},[n]),o=(0,i.useId)();return t.length<=1?null:(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{className:"form-label",htmlFor:o,children:"Destination"}),(0,r.jsx)("select",{id:o,value:e??"",className:"form-select",onChange:l,children:a})]})};let p=[["full","Full"],["trailer","Trailer"],["bonus","Bonus (with ads)"],["bonus_without_ads","Bonus (without ads)"]],f=[["full","Full"],["trailer","Trailer"],["bonus","Bonus"]];var x=e=>{let{id:t,adsEnabled:n,onChange:i,currentEpisodeType:s}=e,a=`episodeType_${t}`,l=n||"bonus_without_ads"===s?p:f;return(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"l-flex-baseline-centre-children-v",children:[(0,r.jsx)("label",{className:"form-label",htmlFor:a,children:"Episode Type"}),(0,r.jsx)("label",{className:"form-label mla",htmlFor:a,children:(0,r.jsx)(o,{label:"<itunes:episodeType>"})})]}),(0,r.jsx)("select",{id:a,value:s,className:"form-select",onChange:e=>i(e.target.value),children:l.map(function([e,t]){return(0,r.jsx)("option",{value:e,children:t},`episodeType${e}`)})})]})},b=n(81166);function g({explicit:e,onChange:t}){return(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsxs)("div",{className:"form-check l-flex-baseline-centre-children-v",children:[(0,r.jsxs)("label",{className:"form-check-label",children:[(0,r.jsx)("input",{type:"checkbox",className:"form-check-input",checked:e,onChange:e=>t(e.currentTarget.checked)})," ","Contains explicit content"]}),(0,r.jsx)("label",{className:"form-label mla",children:(0,r.jsx)(o,{label:"<itunes:explicit>"})})]})})}var v=n(48632),j=n(15685),y=({children:e,initFunction:t,cancelFunction:n,closePortal:s})=>{let a=(0,i.useRef)(t);return(0,i.useEffect)(()=>{a.current();let e=document.getElementById("page-wrapper");if(e)return e.style.display="none",()=>{e.style.display="block"}},[]),(0,r.jsxs)("div",{className:"l-abs-fill-all",children:[(0,r.jsx)("div",{children:e}),(0,r.jsxs)("div",{className:"l-flex l-flex-space-around pvm",children:[(0,r.jsx)(v.A,{icon:j.QRE,onClick:()=>{s&&s()},className:"btn-lg btn-primary",children:"OK"}),(0,r.jsx)(v.A,{icon:j.s0Q,onClick:()=>{n(),s&&s()},className:"btn-lg btn-danger",children:"Cancel"})]})]})},N=n(71687),w=n(40961);let S=(0,i.lazy)(()=>Promise.all([n.e(8452),n.e(7277),n.e(7560),n.e(9230),n.e(806)]).then(n.bind(n,55353))),_=(0,i.lazy)(()=>Promise.all([n.e(8452),n.e(7277),n.e(7560),n.e(9230),n.e(9413)]).then(n.bind(n,82852))),R={ready:"Choose where dynamic ads can be inserted into this episode's audio",noAudio:"Add audio to this episode, then choose where dynamic ads can be inserted",audioProcessing:"You can place ad points once the audio is ready.",midrollsDisabled:"Midroll ads aren't enabled for this channel.",bonusWithoutAds:"Ad points don't apply to ad-free bonus episodes."},A={noAudio:"Add audio to this episode to edit them.",audioProcessing:"Editable once the audio is ready.",midrollsDisabled:"Midroll ads aren't enabled for this channel.",bonusWithoutAds:"They won't be used while this is an ad-free bonus episode."},C=()=>(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"bg-dark",style:{height:"340px"}}),(0,r.jsx)("div",{className:"bg-primary-subtle",style:{height:"3rem"}}),(0,r.jsx)("div",{className:"bg-light",style:{height:"200px"}})]});var D=e=>{let t,{rowId:n,file:s,serverAudio:a,markers:l,channelHasMidrollsEnabled:o,audioAttached:d,episodeType:c,onMarkerRestore:u,onMarkerSnapshot:m}=e,[h,p]=(0,i.useState)(!1),f=(0,i.useCallback)(()=>p(!0),[p]),x=(0,i.useCallback)(()=>p(!1),[p]),b=!!(s||a);"bonus_without_ads"===c?t="bonusWithoutAds":o?b||(t=d?"audioProcessing":"noAudio"):t="midrollsDisabled";let g=l.length,v=g>0,j=l.reduce((e,t)=>e+t.replacementCount,0),D=`${g} ad point${1===g?"":"s"} \xb7 ${j} midroll${1===j?"":"s"}`+(t?`. ${A[t]}`:"");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"border rounded pam df align-items-center justify-content-between gap-3 flex-wrap",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"fw-medium",children:"Midroll ad points"}),(0,r.jsx)("div",{className:"small text-muted",children:v?D:R[t??"ready"]})]}),(0,r.jsx)("button",{type:"button",className:"btn btn-sm btn-outline-primary text-nowrap",onClick:f,disabled:void 0!==t,children:v?"Edit ad points":"Add ad points"})]}),h?(0,w.createPortal)((0,r.jsxs)(y,{initFunction:()=>m(n,"midroll"),cancelFunction:()=>u(n,"midroll"),closePortal:x,children:[(0,r.jsx)(N.A,{keyName:"Escape",onKey:()=>{u(n,"midroll"),x()}}),(0,r.jsx)(i.Suspense,{fallback:(0,r.jsx)(C,{}),children:s?(0,r.jsx)(S,{rowId:n,file:s}):a?(0,r.jsx)(_,{rowId:n,audioUrl:a.audioUrl,audioSamplesUrl:a.audioSamplesUrl,htmlAudio:a.htmlAudio}):null})]}),document.body):null]})},k=function({id:e,title:t,onChange:n}){let s=i.useRef(null);i.useEffect(()=>{s.current&&s.current.focus()},[]);let a=t||"",l=a.length>255,d=`title_${e}`;return(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"l-flex-baseline-centre-children-v",children:[(0,r.jsx)("label",{htmlFor:d,className:"form-label",children:"Title"}),(0,r.jsx)("label",{htmlFor:d,className:"form-label mla",children:(0,r.jsx)(o,{label:"<title>,<itunes:title>"})})]}),(0,r.jsx)("input",{className:"form-control",value:a,name:"title",id:d,ref:s,onChange:e=>{n(e.currentTarget.value)},required:!0,pattern:".*\\S+.*",maxLength:255,onInvalid:e=>{let t=e.currentTarget;t.validity.patternMismatch?t.setCustomValidity("Title is required"):t.setCustomValidity("")}}),l&&(0,r.jsx)("p",{className:"text-red pam",children:"Title is too long (maximum is 255 characters)"})]})},E=n(32224),T=n(77688),P=e=>(0,r.jsx)("button",{type:"button",className:a()("pos-abs op-40","clearButton__HX5sN"),style:{right:8,top:6},onClick:t=>{t.preventDefault(),e.onClear()},children:(0,r.jsxs)("span",{className:"fa-layers",children:[(0,r.jsx)(T.A,{icon:j.GEE}),(0,r.jsx)(T.A,{icon:j.Jyw,className:"fa-inverse",transform:"shrink-6","aria-label":"Remove"})]})});let F=function(e){let t=i.useId();return(0,r.jsxs)("div",{className:e.className,children:[(0,r.jsx)("label",{htmlFor:t,className:"form-label",children:e.text}),(0,r.jsxs)("div",{className:"pos-rel",children:[(0,r.jsx)("input",{id:t,value:e.value??"",pattern:"[0-9]*",maxLength:6,min:"1",className:"form-control",onChange:t=>{var n,r;return e.changef((r=(n=t.target.value)?parseInt(n):null)&&r>0?r:null)}}),e.value?(0,r.jsx)(P,{onClear:()=>e.changef(null)}):null]})]})},I=i.memo(e=>(0,r.jsxs)("div",{className:"l-flex",children:[(0,r.jsx)(F,{className:"l-flex-aut mrs",text:"Season",value:e.season,changef:t=>e.onSeasonChange(t)}
1),(0,r.jsx)(F,{className:"l-flex-aut mls",text:"Episode",value:e.episode,changef:t=>e.onEpisodeChange(t)})]}));var U=n(79371),M=n(38846),L=n(15590),B=n(79656),W=n(86378);class $ extends Error{}var V=e=>{let t=`transcript_${e.id}`,{value:n,onChange:s}=e,a=(0,i.useCallback)(async e=>{let t=e.currentTarget.files[0];if(!t)return void s(null);console.debug("new transcript: ",e.currentTarget.value,t);try{let e=await new Promise((e,n)=>{let r=new FileReader;r.onload=r=>{let i=r.target.result;if(i.byteLength>512e3)return void n(new $("Transcripts are limited to 512kb"));try{var s,a;let n=function(e){try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{let t=new TextDecoder("ISO-8859-1",{fatal:!0}).decode(e),n=0;for(let e=0;e<t.length;e++)127>=t.charCodeAt(e)&&n++;if(n<.9*t.length)throw Error("transcript doesn't seem to be plain text");return t}}(i),r=(s=t,a=n,s.name.match(/.vtt/)||a.match(/^\uFEFF?WEBVTT/)?"text/vtt":s.name.match(/.srt/)||a.match(/^([0-9][0-9]):([0-9][0-9]):([0-9][0-9]),([0-9]+) --> ([0-9][0-9]):([0-9][0-9]):([0-9][0-9]),([0-9]+)$/m)?"application/x-subrip":"text/plain");e({transcript:n,contentType:r})}catch(e){console.warn(e),n(new $("Please upload a valid plain-text, WebVTT, or SubRip file"))}},r.onerror=e=>alert(e),r.readAsArrayBuffer(t)});s(e)}catch(e){(0,W.zr)(e instanceof $?e.message:"an unknown error occurred",{level:"error"})}},[s]),d=(0,i.useCallback)(()=>s(null),[s]),c=n?.contentType.match(/subrip/)?"transcript.srt":n?.contentType.match(/vtt/)?"transcript.vtt":"transcript.txt";return(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsxs)("div",{className:"l-flex-baseline-centre-children-v",children:[(0,r.jsx)("label",{className:"form-label mrs",htmlFor:t,children:"Transcript file"}),(0,r.jsx)(l.l,{children:(0,r.jsxs)("div",{children:["Upload a transcript file in plain-text (.txt), WebVTT (.vtt), or SubRip (.srt) format.",(0,r.jsx)("br",{}),(0,r.jsx)("a",{href:"https://support.audioboom.com/hc/en-us/articles/4414614631313",target:"_blank",children:"See our help-center article for more details"})]})}),(0,r.jsx)("label",{className:"form-label mla",children:(0,r.jsx)(o,{label:"<podcast:transcript>"})})]}),n?(0,r.jsxs)("div",{className:"pos-rel form-control",children:[(0,r.jsx)(T.A,{icon:B.A4h,label:c}),(0,r.jsx)(P,{onClear:d})]}):(0,r.jsx)("input",{type:"file",className:"form-control",accept:".txt,.text,.srt,.vtt,text/plain,application/x-subrip,application/srt,text/srt,text/vtt",onChange:a,id:t})]})},z=n(68780),q=n(45950),O=n(68590);let G=e=>(0,L.Xe)(e,{precision:2}),H=e=>(0,L.Xe)(e,{precision:0}),Y=({htmlFor:e,videoEnabled:t})=>(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"db form-label",htmlFor:e,children:t?"Upload media file":"Upload audio file"}),(0,r.jsx)("div",{className:"small",children:t?(0,r.jsxs)("p",{className:"text-muted mbn",children:["You can upload files up to ",H(L.a0.video.maxSize),". We recommend a high-quality MP3, M4A, or MP4."]}):(0,r.jsxs)("p",{className:"text-muted mbn",children:["You can upload files up to ",H(L.a0.audio.maxSize),". We recommend a high-quality MP3 or M4A."]})})]}),X=({file:e,existingAudio:t,onChange:n,videoEnabled:s})=>{let a=(0,i.useId)(),l=!e&&t;return(0,r.jsx)(z.A,{id:a,onFileDrop:e=>n(e[0]),className:"w-100",children:(0,r.jsxs)("div",{className:"pam df align-items-center gap-3",children:[(0,r.jsx)("div",{className:"border rounded flex-shrink-0 df align-items-center justify-content-center position-relative",style:{width:80,height:80},children:e||l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(T.A,{icon:j.Wxf,size:"2x"}),(0,r.jsx)("div",{className:"file-drop-replace-hint l-abs-fill-all df align-items-center justify-content-center rounded",children:(0,r.jsx)(T.A,{icon:j.$3Z})})]}):(0,r.jsx)(T.A,{icon:B.qe6,className:"file-drop-icon",size:"lg"})}),e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"db form-label",htmlFor:a,children:e.name}),(0,r.jsx)("div",{className:"small text-muted",children:G(e.size)})]}),(0,r.jsx)("div",{className:"mla small",children:(0,r.jsx)("button",{type:"button",className:"within-para-button link-danger",onClick:e=>{e.preventDefault(),window.confirm("Delete this file?")&&n(null)},children:"Remove"})})]}):l?(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"db form-label",children:t.filename}),(0,r.jsxs)("div",{className:"small text-muted",children:[null==t.byteSize?"Still processing":G(t.byteSize)," ","\xb7 drop a file to replace"]})]}):(0,r.jsx)(Y,{videoEnabled:s,htmlFor:a})]})})},Z=({onChange:e})=>{let[t,n,i]=(0,O.hS)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{type:"button",className:"btn btn-sm icon-link",onClick:e=>{e.preventDefault(),i(!0)},children:[(0,r.jsx)(T.A,{icon:j.A54}),"Record"]}),(0,r.jsx)(t,{centered:!0,options:{backdrop:"static"},...n,children:(0,r.jsx)("div",{className:"phl pvm w-100",children:(0,r.jsx)(q.A,{supported:!0,onFileWasSaved:t=>{i(!1),e(t)},onCancel:()=>i(!1),mode:"popup"})})})]})},K=({file:e,existingAudio:t,onChange:n,videoEnabled:i})=>(0,r.jsxs)("div",{className:"df gap-2 align-items-center",children:[(0,r.jsx)(X,{file:e,existingAudio:t,onChange:n,videoEnabled:i}),e||t?null:(0,r.jsx)("div",{children:(0,r.jsx)(Z,{onChange:n})})]}),Q=({htmlFor:e})=>(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"db form-label",htmlFor:e,children:"Add an image"}),(0,r.jsx)("div",{className:"small",children:(0,r.jsxs)("p",{className:"text-muted mbn",children:["Optional. Your show artwork will be used if you don't upload a custom image."," ",(0,r.jsx)("a",{href:(0,U.cE)(),className:"underline emphasis","data-turbo":!1,target:"_blank",children:"View our image guidelines"})]})})]}),J=({error:e})=>(0,r.jsxs)("p",{className:"text-danger text-break mb-0",children:[(0,r.jsxs)("span",{className:"fw-bold",children:[(0,r.jsx)(T.A,{icon:j.zpE})," "+e.file.name+" "]}),(0,L.VF)(e)]}),ee=({htmlFor:e,upload:t,onRemove:n})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{htmlFor:e,children:t.file.name}),(0,r.jsx)("div",{className:"mla small",children:(0,r.jsx)("button",{className:"within-para-button link-danger mla",onClick:e=>{e.preventDefault(),n()},type:"button",children:"Remove"})})]}),et=({clip:e,onChange:t})=>{let{episodeData:n,imageUpload:s}=e,{imageSrc:a}=n,l=(0,i.useId)();return(0,r.jsx)("div",{className:"df gap-2",children:(0,r.jsx)(z.A,{id:l,className:"w-100",onFileDrop:e=>t(e[0]),fileProps:{accept:"image/*"},children:(0,r.jsxs)("div",{className:"d-flex gap-3 align-items-start pam align-items-center",children:[(0,r.jsx)("div",{className:"border rounded flex-shrink-0 df align-items-center justify-content-center pos-rel of-hid",style:{width:80,height:80},children:a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:a,className:"db square wh-100 object-cover"}),(0,r.jsx)("div",{className:"file-drop-replace-hint l-abs-fill-all df al
1ign-items-center justify-content-center",children:(0,r.jsx)(T.A,{icon:j.$3Z})})]}):(0,r.jsx)(T.A,{icon:j.rwq,className:"fa-lg file-drop-icon"})}),s.clientSideError?(0,r.jsx)(J,{error:s.clientSideError}):s.file?(0,r.jsx)(ee,{htmlFor:l,upload:s,onRemove:()=>t(null)}):(0,r.jsx)(Q,{htmlFor:l})]})})})};function en({clip:e,draftLayout:t,midrollMarkers:n,videoEnabled:i,destinations:s,channelHasMidrollsEnabled:l,serverAudio:o,adsEnabled:d,updateRow:u,onAudioFileChanged:m,onImageFileChanged:p,onMarkerSnapshot:f,onMarkerRestore:v,audioWellRef:y}){let N=e.episodeData,w=N.publishState??"draft",S=l?e.audioUpload.file:void 0,_=N.recordedAtMs?new Date(N.recordedAtMs):null;function R(t){u(e.rowId,t)}let A="published"!==N.publishState&&"scheduled"!==N.publishState&&(l||n.length>0)?(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(D,{rowId:e.rowId,file:S??void 0,serverAudio:l?o:void 0,markers:n,channelHasMidrollsEnabled:l,audioAttached:!!N.existingAudio,episodeType:e.episodeData.episodeType,onMarkerSnapshot:f,onMarkerRestore:v})}):null,C=e.publishState===M.w1.uploading;return(0,r.jsx)("div",{className:"container-fluid_",children:(0,r.jsxs)("fieldset",{disabled:C,inert:C,children:[(0,r.jsxs)("div",{className:t?"row justify-content-center":"row",children:[(0,r.jsxs)("div",{className:t?"col-sm-10":"col-sm-8",children:[(0,r.jsx)(k,{id:e.rowId,title:N.title,onChange:e=>R({title:e})}),t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"mb-3",ref:y,children:[(0,r.jsx)("label",{className:"form-label",children:i?"Audio / Video":"Audio"}),(0,r.jsx)(K,{file:e.audioUpload.file,existingAudio:e.episodeData.existingAudio,onChange:t=>m(e.rowId,t),videoEnabled:i})]}),A,(0,r.jsxs)("div",{className:"mb-3",children:[(0,r.jsx)("label",{className:"form-label",children:"Episode image"}),(0,r.jsx)(et,{clip:e,onChange:t=>p(e.rowId,t)})]})]}):null,(0,r.jsx)(c,{htmlDescription:N.htmlDescription,summary:N.summary,onChange:e=>R(e)}),(0,r.jsx)(g,{explicit:N.explicit,onChange:e=>R({explicit:e})}),(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(I,{season:N.seasonNumber,episode:N.episodeNumber,onSeasonChange:e=>R({seasonNumber:e}),onEpisodeChange:e=>R({episodeNumber:e})})})]}),!t&&(0,r.jsxs)("div",{className:"col-sm-4 mbm imagedropzone",children:[(0,r.jsx)(E.A,{onFileDrop:t=>p(e.rowId,t),imageSrc:N.imageSrc,className:"mbm"}),N.imageSrc&&(0,r.jsx)("a",{href:"#",className:a()("db mbm small",{"text-muted":C}),onClick:t=>{t.preventDefault(),p(e.rowId,null)},children:"Remove image"}),e.imageUpload&&e.imageUpload.clientSideError&&(0,r.jsxs)("p",{className:"text-danger small text-break",children:[(0,r.jsxs)("span",{className:"fw-bold",children:[(0,r.jsx)(T.A,{icon:j.zpE})," "+(e.imageUpload.file?e.imageUpload.file.name:"unknown")+" "]}),(0,L.VF)(e.imageUpload.clientSideError)]}),(0,r.jsx)("a",{href:(0,U.cE)(),className:"small underline emphasis","data-turbo":!1,target:"_blank",children:"View our image guidelines"})]})]}),(0,r.jsx)("div",{className:t?"row justify-content-center":"row",children:(0,r.jsxs)("div",{className:t?"col-sm-10":"col-sm-8",children:[(0,r.jsx)(x,{id:e.rowId,currentEpisodeType:e.episodeData.episodeType,onChange:e=>R({episodeType:e}),adsEnabled:d}),(0,r.jsx)(V,{id:e.rowId,value:e.episodeData.transcription,onChange:e=>R({transcription:e})}),s&&(0,r.jsx)(h,{currentDestinationId:N.destinationId,destinations:s,onChange:e=>R({destinationId:e})}),(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(b.A,{publishState:w,date:_,changeHandler:e=>R({recordedAtMs:e?.getTime()})})}),!t&&A]})})]})})}},45950:function(e,t,n){n.d(t,{A:function(){return f}});var r=n(74848),i=n(96540),s=n(45422),a=n(43657),l=n(30232),o=n(20311),d=n.n(o);class c extends i.Component{htmlRecorder;timer;canvasRef=i.createRef();audioNode=null;state={recorderState:"uninitialised",recorderUrl:null,playTime:0,duration:0,recStartTime:0,isPausedRecord:!1,previousDuration:0};componentDidMount(){let e=new l.A;this.htmlRecorder=e,e.on("gotStream",this._handleGotStream),e.on("recording",this._onRecording),e.on("recording_stopped",this._onRecordingStopped),e.on("gotFile",this._onGotFile),e.on("recording_discarded",this._onRecordingDiscarded),e.start()}componentWillUnmount(){let e=this.htmlRecorder;d()(e,"there must be an instance of htmlRecorder"),e.removeListener("gotStream",this._handleGotStream),e.removeListener("recording",this._onRecording),e.removeListener("recording_stopped",this._onRecordingStopped),e.removeListener("gotFile",this._onGotFile),e.removeListener("recording_discarded",this._onRecordingDiscarded),e.destroy(),this.htmlRecorder=null,window.URL.revokeObjectURL(this.state.recorderUrl)}_handleGotStream=()=>{this.htmlRecorder&&this.canvasRef.current&&(this.htmlRecorder.visualise(this.canvasRef.current),d()(this.htmlRecorder,"there must be an instance of htmlRecorder"),this.htmlRecorder.setColour("#BBB")),this.setState({re
1corderState:"initialised"}),this.props.onInitialised()};_toggleRecording(){(d()(this.htmlRecorder,"there must be an instance of htmlRecorder"),"recording"!==this.state.recorderState)?this.state.duration>this.props.maxRecorderTime||this.htmlRecorder.startRecording():this.htmlRecorder.stopRecording()}_onRecording=()=>{this._startTimer(),this.props.onRecording(),this.htmlRecorder&&this.htmlRecorder.setColour("gradient"),this.setState({recorderState:"recording"})};_onRecordingStopped=()=>{this._pauseTimer(),this.props.onRecordingPaused(),this.htmlRecorder&&this.htmlRecorder.setColour("#BBB"),this.setState({recorderState:"recordingPause"})};_startTimer(){let e=this;var t=0;this.state.isPausedRecord&&(t=this.state.duration),this.setState({recStartTime:new Date().getTime(),isPausedRecord:!1},function(){e.timer=setInterval(function(){var n=(new Date-e.state.recStartTime)/1e3+t;e.setState({duration:n,isPausedRecord:!1},function(){e.props.onSetRecorderTime(n),n>e.props.maxRecorderTime&&e.htmlRecorder?.stopRecording()})},100)})}_pauseTimer(){var e=this.timer;e&&clearInterval(e),this.timer=null,this.setState({isPausedRecord:!0})}_stopTimer(){var e=this.timer;e&&clearInterval(e),this.timer=null,this.setState({isPausedRecord:!1})}_onGotFile=()=>{d()(this.htmlRecorder?.file,"there must be an instance of html recorder");let e=window.URL.createObjectURL(this.htmlRecorder.file);this.setState({recorderState:"recordingDone",recorderUrl:e})};_togglePlaying(){this.state.recorderUrl&&this.audioNode&&("playing"!==this.state.recorderState?this.audioNode.play():this.audioNode.pause())}_onCanPlay=()=>{this.props.onRecordingDone()};_onPlaying=()=>{this.props.onPlaying(),this.setState({recorderState:"playing"})};_onPlayingPaused=()=>{this.props.onPlayingPaused(),this.setState({recorderState:"playingPaused"})};_onPlayEnded=()=>{this.props.onPlayingPaused(),this.setState({recorderState:"playingEnded"})};_onTimeUpdate=e=>{this.audioNode&&this.setState({playTime:this.audioNode.currentTime})};_discardRecording(){d()(this.htmlRecorder,"there must be an instance of html recorder"),"recording"===this.state.recorderState&&this.htmlRecorder.stopRecording(),this.htmlRecorder.discardRecording()}_onRecordingDiscarded=()=>{this._stopTimer(),window.URL.revokeObjectURL(this.state.recorderUrl),this.props.onInitialised(),d()(this.htmlRecorder,"there must be an instance of html recorder"),this.htmlRecorder.setColour("#BBB"),this.setState({recorderState:"initialised",duration:0})};_saveRecording(){this._stopTimer(),d()(this.htmlRecorder,"there must be an instance of html recorder");let e=this.htmlRecorder,{file:t}=e;d()(t,"no file found?"),this.props.onFileWasSaved(t),e.discardRecording(),window.URL.revokeObjectURL(this.state.recorderUrl),this.props.onInitialised(),e.setColour("#BBB")}audioMounted=e=>{this.audioNode?.pause(),this.audioNode=e,e&&e.load()};render(){let{recorderState:e,recorderUrl:t}=this.state,n="block",i="none";("playing"===e||"playingPaused"===e)&&(n="none",i="block");let s="uninitialised"===e,a={height:100};return(0,r.jsxs)("div",{style:{flex:1,minWidth:0,maxWidth:"400px"},children:[s?(0,r.jsx)("div",{style:a,children:(0,r.jsx)("p",{className:"mbn fadeIn small pos-rel dbf v-c",children:"Waiting for microphone access..."})}):null,(0,r.jsx)("canvas",{ref:this.canvasRef,style:{position:s?"absolute":"static",display:n,zIndex:100,width:"100%",...a}}),(0,r.jsx)("div",{style:{display:i,width:"100%",...a},children:(0,r.jsx)("progress",{max:this.state.duration,value:this.state.playTime,className:"pos-rel dbf v-c"})}),t?(0,r.jsx)("audio",{ref:this.audioMounted,src:t,style:{display:"block"},onPlaying:this._onPlaying,onPause:this._onPlayingPaused,onTimeUpdate:this._onTimeUpdate,onCanPlay:this._onCanPlay,onEnded:this._onPlayEnded},t):null]})}}var u=n(77688),m="iconArea__xQCbc",h="svgBtn__tTgwd",p=n(79656),f=function({supported:e,onFileWasSaved:t,onRecorderHasData:n,onCancel:l,mode:o}){let d;o=o||"tab";let f=(0,i.useRef)(null),[x,b]=(0,i.useState)({recordEnabled:!1,playEnabled:!1,saveEnabled:!1,cancelEnabled:!1,hasData:!1,recorderState:"uninitialised",recordermsg:"uninitialised",currentRecorderTime:0});function g(e){b(t=>({...t,...e}))}function v(e){e.preventDefault(),(!x.hasData||window.confirm("Discard your recording?"))&&(f.current?._discardRecording(),n&&n(!1),l&&l())}switch(x.recordermsg){case"playing":case"playPause":case"recording":case"saveerror":d=x.recordermsg;break;default:d="disabled"}let j=e?(0,r.jsx)(c,{ref:f,maxRecorderTime:1800,onInitialised:function(){g({recorderState:"initialised",recordermsg:"ready",recordEnabled:!0,playEnabled:!1,saveEnabled:!1,cancelEnabled:!1,hasData:!1,currentRecorderTime:0})},onRecording:function(){g({recorderState:"recording",recordermsg:"recording",hasData:!0,playEnabled:!1}),n&&n(!0)},onRecordingPaused:function(){g({recorderState:"recordingpaused",recordermsg:"recPaused",playEnabled:!1,saveEnabled:!0,cancelEnabled:!0})},onRecordingDone:function(){g({recorderState:"recorded",recordermsg:"ready",recordEnabled:!0,saveEnabled:!0,playEnabled:!0,cancelEnabled:!0})},onPlaying:function(){g({recorderState:"playing",recordermsg:"playing",recordEnabled:!1})},onPlayingPaused:function(){g({recorderState:"playingpaused",recordermsg:"playPause",recordEnabled:!0})},onSetRecorderTime:e=>g({currentRecorderTime:e}),onFileWasSaved:t}):(0,r.jsx)("div",{children:(0,r.jsx)("p",{className:"text-danger",children:"Sorry, your browser isn't supported"})}),y=e=>(0,r.jsx)("span",{className:"text-nowrap",style:{fontSize:"small"},children:e}),N={width:"44px"};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:`recorderGrid__k8xjL ${d}`,children:[(0,r.jsxs)("div",{className:"d-flex justify-content-center gap-3",children:[(0,r.jsxs)("button",{className:`${h} recordBtn__g5lgJ`,onClick:function(e){e.preventDefault(),f.current?._toggleRecording()},style:N,disabled:!x.recordEnabled,type:"button",children:[(0,r.jsx)("div",{className:m,children:(0,r.jsx)(u.A,{icon:"recording"===x.recordermsg?p.CWE:p.ppD})}),y("recording"===x.recordermsg?"stop":"record")]}),(0,r.jsxs)("button",{className:`${h} playBtn__xUx2j`,onClick:function(e){e.preventDefault(),f.current?._togglePlaying()},style:N,disabled:!x.playEnabled,type:"button",children:[(0,r.jsx)("div",{className:m,children:(0,r.jsx)(u.A,{icon:"playing"===x.recordermsg?p.M6O:p.qtl})}),y("play")]})]}),(0,r.jsxs)("div",{className:"d-flex align-items-center justify-content-center gap-3 w-100",style:{minWidth:0},children:[(0,r.jsx)("span",{className:"text-secondary font-monospace numeric-tabular",style:{pointerEvents:"none"},children:(0,s.fU)(x.currentRecorderTime)}),j,(0,r.jsx)("span",{className:"text-secondary font-monospace numeric-tabular",style:{pointerEvents:"none"},children:(0,s.fU)(1800)})]}),(0,r.jsxs)("div",{className:"d-flex justify-content-center gap-3",children:["tab"===o?(0,r.jsxs)("button",{className:h,onClick:v,style:N,disabled:!x.cancelEnabled,type:"button",children:[(0,r.jsx)("div",{className:m,children:(0,r.jsx)(u.A,{icon:p.bnw})}),y("discard")]}):null,(0,r.jsxs)("button",{className:h,onClick:function(e){e.preventDefault(),f.current?._saveRecording(),n&&n(!1)},style:N,disabled:!x.saveEnabled,type:"button",children:[(0,r.jsx)("div",{className:m,children:(0,r.jsx)(u.A,{icon:p.jkA})}),y("save")]}),"popup"===o?(0,r.jsxs)("button",{className:h,onClick:v,style:N,disabled:!1,type:"button",children:[(0,r.jsx)("div",{className:m,children:(0,r.jsx)(u.A,{icon:p.bnw})}),y("cancel")]}):null]})]}),"saveerror"===x.recorderState&&"error: could not save","saving"===x.recorderState&&(0,r.jsx)(a.Ay,{})]})}},35208:function(e,t,n){n.d(t,{V:function(){return a}});var r=n(74848),i=n(77688),s=n(49456);function a(e){return(0,r.jsx)("button",{type:"button",className:"btn btn-outline-primary",disabled:e.disabled,onClick:e.onClick,children:(0,r.jsx)(i.A,{icon:s.bLf,label:e.saving?"Saving…":"Save draft"})})}},7513:function(e,t,n){n.d(t,{T:function(){return d},f:function(){return o}});var r=n(74848),i=n(96540),s=n(78810),a=n(17383),l=n(94727);function o(e){let t=e.audioUpload.progress,n=e.imageUpload.progress,r=t.loaded+n.loaded,i=t.total+n.total;return Math.round(r/(i*=1.111)*100||0)}function d({rowId:e}){let t=(0,s.G)(t=>{let n=(0,l.lI)(t.episodeEditor,e);return n?o(n):0}),[n]=(0,i.useState)(t>=90);return n?(0,r.jsx)("div",{className:"flex-grow-1",children:(0,r.jsx)("div",{className:"small text-muted",children:"Saving…"})}):(0,r.jsxs)("div",{className:"flex-grow-1",children:[(0,r.jsx)(a.A,{percentage:t}),(0,r.jsx)("div",{className:"small text-muted mt-1",children:"Uploading…"})]})}}
1,77588:function(e,t,n){n.d(t,{t:function(){return r}});function r(e){e&&(e.scrollIntoView({behavior:"smooth",block:"center"}),e.classList.remove("shake-short"),setTimeout(()=>{e.offsetWidth,e.classList.add("shake-short")},400))}},81879:function(e,t,n){n.d(t,{M:function(){return s}});var r=n(78810),i=n(74323);function s(e){let t=(0,r.G)(t=>t.midrollMarkers.episodes[e]);return t?(0,i.Zy)(t.markers,"midroll"):[]}},51451:function(e,t){t.A=class{listeners={};add(e){return this.addListener("*",e)}remove(e){this.removeListener("*",e)}trigger(e){this.emit("*",e)}addListener(e,t){return this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t),()=>this.removeListener(e,t)}removeListener(e,t){this.listeners[e]=this.listeners[e].filter(e=>e!==t)}emit(e,t){(this.listeners[e]||[]).forEach(e=>e(t))}}},30232:function(e,t,n){n.d(t,{y:function(){return o}});var r=n(51451),i=n(20311),s=n.n(i),a=n(86378);let l=window.MediaRecorder;function o(){if(l&&l.isTypeSupported){for(var e=["audio/ogg","audio/webm","audio/mp4"],t=0;t<e.length;t++)if(l.isTypeSupported(e[t]))return e[t]}return null}void 0===navigator.mediaDevices&&(navigator.mediaDevices={}),void 0===navigator.mediaDevices.getUserMedia&&(navigator.mediaDevices.getUserMedia=function(e){let t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return t?new Promise(function(n,r){t.call(navigator,e,n,r)}):(console.warn("Couldn't find mediaDevice support"),Promise.reject(!1===window.isSecureContext?Error("Page needs to be SSL/localhost for getUserMedia"):Error("getUserMedia is not implemented in this browser")))});class d{hasGotStream=!1;destroyed=!1;mediaRecorder=null;file=null;stream=null;chunks=[];canvas=null;loadTimeout=null;eventEmitter=new r.A;start(){this._acquireStream()}destroy(){this.loadTimeout&&clearTimeout(this.loadTimeout),this.destroyed=!0}_acquireStream(){let e=this;s()(navigator.mediaDevices,"mediaDevices must exist"),navigator.mediaDevices.getUserMedia({audio:!0}).then(this._gotStreamHandler.bind(this)).catch(function(t){e.destroyed||(console.error(t),e.loadTimeout=setTimeout(function(){e._acquireStream()},1e3))})}_gotStreamHandler(e){this.stream=e,this.hasGotStream=!0;let t=o();if(!t)return void window.alert("Recorder media mimetype not supported, please contact support");let n=new l(e,{mimeType:t});n.ondataavailable=e=>{e.data.size>0?this.chunks.push(e.data):console.warn(e)},n.onstop=e=>{var n=new File(this.chunks,"recording."+t.split("/")[1],{type:t});this.file=n,this.emit("gotFile")},this.mediaRecorder=n,this.emit("gotStream")}startRecording(){if(this.hasGotStream&&this.mediaRecorder)try{this.mediaRecorder.start(),this.emit("recording")}catch(e){console.warn(e),(0,a.Ay)("Couldn't start recording")}}stopRecording(){this.mediaRecorder&&(this.mediaRecorder.stop(),this.emit("recording_stopped"))}discardRecording(){this.chunks=[],this.emit("recording_discarded")}setColour(e){if(!this.canvas)return;let t=this.canvas.getContext("2d");if(s()(t,"Couldn't get context"),"gradient"===e){let e=t.createLinearGradient(0,0,0,this.canvas.height);e.addColorStop(0,"red"),e.addColorStop(.1,"yellow"),e.addColorStop(.5,"lightGreen"),e.addColorStop(.9,"yellow"),e.addColorStop(1,"red"),t.fillStyle=e}else t.fillStyle=e}visualise(e){this.canvas=e;let{width:t,height:n}=e.getBoundingClientRect();e.width=t*devicePixelRatio,e.height=n*devicePixelRatio,new ResizeObserver(t=>{let{width:n,height:r}=t[0].contentRect;e.width=n*devicePixelRatio,e.height=r*devicePixelRatio}).observe(e);let r=new(window.AudioContext||window.webkitAudioContext),i=r.createAnalyser(),a=r.createMediaStreamSource(this.stream),l=r.createScriptProcessor(2048,1,1);i.smoothingTimeConstant=.3,i.fftSize=1024,a.connect(i),i.connect(l),l.connect(r.destination);let o=e.getContext("2d");s()(o,"Couldn't get context");let d=[];l.onaudioprocess=function(){var t=new Uint8Array(i.frequencyBinCount);i.getByteFrequencyData(t);for(var n=0,r=t.length,s=0;s<r;s++)n+=t[s];var a=n/r;d.unshift(a),d.length>100&&d.pop();var l=e.width,c=e.height,u=l/100;for(o.clearRect(0,0,l,c),s=0;s<d.length;s++)o.fillRect(l-u*(s+1),c/2-d[s]/2,u,d[s])}}on(e,t){this.eventEmitter.addListener(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}emit(e){this.eventEmitter.emit(e)}}t.A=d}}]);

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.