import{Ae as I,Qa as h,Z as N,wf as R}from"./chunk-NY4TI4KT.js";import{a as o,b as i,i as _}from"./chunk-IQVXR75E.js";var D=(()=>{let t=class t{warnCacheKey;warnCacheResult;errCacheKey;errCacheResult;buildWarn(n){let{videoId:s,state:E}=n,c=`${s}-${E}`;return this.warnCacheKey===c&&this.warnCacheResult?this.warnCacheResult:(this.warnCacheResult=this._buildWarn(n),this.warnCacheKey=c,this.warnCacheResult);}_buildWarn(n){let{videoId:s,state:E}=n,c="\u4F60\u7684\u89C6\u9891\u6B63\u5728\u5904\u7406\u3002",p="\u8FD9\u53EF\u80FD\u9700\u8981\u4E00\u4E9B\u65F6\u95F4\uFF0C\u5728\u5B8C\u6210\u4E4B\u524D\u67D0\u4E9B\u529F\u80FD\u53EF\u80FD\u4E0D\u53EF\u7528\u3002",d="\u8054\u7CFB\u7BA1\u7406\u5458\u4FEE\u590D\u3002",T="\u4F60\u7684\u6D4F\u89C8\u5668\u53EF\u80FD\u65E0\u6CD5\u64AD\u653E\u3002";switch(E){case I.PUBLISHED:case I.LIVE_ENDED:case I.WAITING_FOR_LIVE:return;case I.TO_TRANSCODE:return{title:"\u6B63\u5728\u8F6C\u7801",manageMain:c,manageSecondary:p,watchMain:T,watchSecondary:""};case I.TO_IMPORT:return{title:"\u6B63\u5728\u5BFC\u5165",manageMain:"\u8FDC\u7A0B\u89C6\u9891\u6B63\u5728\u5BFC\u5165\u3002",manageSecondary:p,watchMain:"\u8FDC\u7A0B\u89C6\u9891\u6B63\u5728\u5BFC\u5165\u4E2D\uFF0C\u5BFC\u5165\u5B8C\u6210\u540E\u5373\u53EF\u4F7F\u7528\u3002",watchSecondary:"",routerLink:{text:"\u68C0\u67E5\u60A8\u7684\u5BFC\u5165",link:["/my-library/video-imports"],queryParams:{videoId:s}}};case I.TO_IMPORT_FAILED:{let m="\u8FDC\u7A0B\u89C6\u9891\u5BFC\u5165\u5931\u8D25\uFF0C\u5C06\u65E0\u6CD5\u4F7F\u7528\u3002";return{title:"\u5BFC\u5165\u5931\u8D25",manageMain:"\u8FDC\u7A0B\u89C6\u9891\u5BFC\u5165\u5931\u8D25\u3002",manageSecondary:"",watchMain:m,watchSecondary:"",routerLink:{text:"\u68C0\u67E5\u60A8\u7684\u5BFC\u5165",link:["/my-library/video-imports"],queryParams:{videoId:s}}};}case I.TO_MOVE_TO_FILE_SYSTEM:return{title:"\u79FB\u52A8\u89C6\u9891\u6587\u4EF6",manageMain:c,manageSecondary:p,watchMain:T,watchSecondary:"\u89C6\u9891\u6B63\u5728\u79FB\u52A8\u5230\u6587\u4EF6\u7CFB\u7EDF\u3002"};case I.TO_MOVE_TO_FILE_SYSTEM_FAILED:{let m="\u65E0\u6CD5\u79FB\u52A8\u89C6\u9891\u6587\u4EF6\u5230\u5E73\u53F0\u6587\u4EF6\u7CFB\u7EDF\u3002";return{title:"\u65E0\u6CD5\u79FB\u52A8\u89C6\u9891\u6587\u4EF6",manageMain:m,manageSecondary:d,watchMain:T,watchSecondary:m};}case I.TO_MOVE_TO_EXTERNAL_STORAGE:return{title:"\u79FB\u52A8\u89C6\u9891\u6587\u4EF6",manageMain:c,manageSecondary:p,watchMain:T,watchSecondary:"\u6B63\u5728\u79FB\u52A8\u89C6\u9891\u5230\u5916\u90E8\u5B58\u50A8\u3002"};case I.TO_MOVE_TO_EXTERNAL_STORAGE_FAILED:{let m="\u65E0\u6CD5\u79FB\u52A8\u89C6\u9891\u6587\u4EF6\u5230\u5916\u90E8\u5B58\u50A8\u3002";return{title:"\u65E0\u6CD5\u79FB\u52A8\u89C6\u9891\u6587\u4EF6",manageMain:m,manageSecondary:d,watchMain:T,watchSecondary:m};}case I.TO_EDIT:return{title:"Studio \u7248\u672C\u5236\u4F5C\u4E2D",manageMain:c,manageSecondary:p,watchMain:T,watchSecondary:""};case I.TRANSCODING_FAILED:return{title:"\u8F6C\u7801\u5931\u8D25",manageMain:"\u89C6\u9891\u6587\u4EF6\u8F6C\u7801\u5931\u8D25",manageSecondary:d,watchMain:T,watchSecondary:""};default:return E;}}buildErr(n){let{videoId:s,blacklisted:E,blacklistedReason:c}=n,p=`${s}-${E}-${R(c)}`;return this.errCacheKey===p&&this.errCacheResult?this.errCacheResult:(this.errCacheResult=this._buildErr(n),this.errCacheKey=p,this.errCacheResult);}_buildErr(n){let{blacklisted:s,blacklistedReason:E}=n;if(s)return{title:"\u89C6\u9891\u88AB\u5C4F\u853D",main:E||"\u60A8\u7684\u89C6\u9891\u5DF2\u88AB\u5E73\u53F0\u5C4F\u853D\u3002"};}};_(t,"\u0275fac",function(s){return new(s||t)();}),_(t,"\u0275prov",N({token:t,factory:t.ɵfac}));let e=t;return e;})();var L=e=>typeof e.id=="string"&&typeof e.from=="number"&&typeof e.to=="number"&&typeof e.text=="string",u=e=>!e||/^\s*$/.test(e),l={ID:"ID",TIME_LINE:"TIME_LINE",TEXT:"TEXT",MULTI_LINE_TEXT:"MULTI_LINE_TEXT",FIN_ENTRY:"FIN_ENTRY",FINISH:"FINISH"},O=e=>{let t=e.split(":"),r,n,s;return t.length===2?[n,s]=t:[r,n,s]=t,parseInt(s.replace(",",""),10)+parseInt(n,10)*60*1e3+(r?parseInt(r,10):0)*60*60*1e3;},y=()=>({start(e){let t=l.ID,r={tokens:e.split(/\n/),pos:0,result:[],current:{}};for(;t!==l.FINISH;){let n=this[t](r);r=n.params,t=n.next;}return r.result;},[l.ID](e){let{tokens:t,pos:r,current:n}=e;if(t.length<=r)return{next:l.FINISH,params:e};if(u(t[r]))return{next:l.ID,params:i(o({},e),{pos:r+1})};let s=t[r].includes("-->");return n.id=s?"":t[r],{next:l.TIME_LINE,params:i(o({},e),{current:n,tokens:t,pos:s?r:r+1})};},[l.TIME_LINE](e){let{tokens:t,pos:r,current:n}=e,s=t[r],[E,c]=s.split("-->");return n.from=O(E),n.to=O(c),{next:l.TEXT,params:i(o({},e),{current:n,pos:r+1})};},[l.TEXT](e){let{tokens:t,pos:r,current:n}=e;return t.length<=r?{next:l.FINISH,params:e}:(n.text=t[r],{next:l.MULTI_LINE_TEXT,params:i(o({},e),{current:n,pos:r+1})});},[l.MULTI_LINE_TEXT](e){let{tokens:t,pos:r,current:n}=e;return t.length<=r||u(t[r])?{next:l.FIN_ENTRY,params:e}:(n.text=`${n.text}
${t[r]}`,{next:l.MULTI_LINE_TEXT,params:i(o({},e),{current:n,pos:r+1})});},[l.FIN_ENTRY](e){let{pos:t,current:r,result:n}=e;if(L(r))n.push(r);else throw new Error(`Parsing error current not complete ${JSON.stringify(r)}`);return{next:l.ID,params:i(o({},e),{current:{},pos:t+1})};},[l.FINISH](e){return{next:l.FINISH,params:e};}}),g=e=>({entries:y().start(e)}),a={HEADER:"HEADER",ID:"ID",TIME_LINE:"TIME_LINE",ID_OR_NOTE_OR_STYLE_OR_REGION:"ID_OR_NOTE_OR_STYLE_OR_REGION",STYLE:"STYLE",NOTE:"NOTE",REGION:"REGION",LEGACY_HEADER:"LEGACY_HEADER",TEXT:"TEXT",MULTI_LINE_TEXT:"MULTI_LINE_TEXT",FIN_ENTRY:"FIN_ENTRY",FINISH:"FINISH"},f=e=>{let t=e.split(":"),r,n,s;return t.length===2?[n,s]=t:[r,n,s]=t,parseInt(s.replace(".",""),10)+parseInt(n,10)*60*1e3+(r?parseInt(r,10):0)*60*60*1e3;},x=()=>({start(e){let t=a.HEADER,r={tokens:e.split(/\n/),pos:0,result:[],current:{}};for(;t!==a.FINISH;){let n=this[t](r);r=n.params,t=n.next;}return r.result;},[a.HEADER](e){return{next:a.LEGACY_HEADER,params:i(o({},e),{pos:e.pos+1})};},[a.LEGACY_HEADER](e){let{tokens:t,pos:r}=e;return t.length<=r?{next:a.FINISH,params:e}:t[r].includes(":")&&!t[r].includes("-->")?{next:a.LEGACY_HEADER,params:i(o({},e),{pos:r+1})}:{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:e};},[a.ID_OR_NOTE_OR_STYLE_OR_REGION](e){let{tokens:t,pos:r}=e;return t.length<=r?{next:a.FINISH,params:e}:u(t[r])?{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:i(o({},e),{pos:r+1})}:t[r].toUpperCase().includes("NOTE")?{next:a.NOTE,params:e}:t[r].toUpperCase().includes("STYLE")?{next:a.STYLE,params:e}:t[r].toUpperCase().includes("REGION")?{next:a.REGION,params:e}:{next:a.ID,params:e};},[a.STYLE](e){let{tokens:t,pos:r}=e;return u(t[r])?{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:i(o({},e),{pos:r+1})}:{next:a.STYLE,params:i(o({},e),{pos:r+1})};},[a.NOTE](e){let{tokens:t,pos:r}=e;return u(t[r])?{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:i(o({},e),{pos:r+1})}:{next:a.STYLE,params:i(o({},e),{pos:r+1})};},[a.REGION](e){let{tokens:t,pos:r}=e;return u(t[r])?{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:i(o({},e),{pos:r+1})}:{next:a.REGION,params:i(o({},e),{pos:r+1})};},[a.ID](e){let{tokens:t,pos:r,current:n}=e;if(t.length<=r)return{next:a.FINISH,params:e};if(u(t[r]))return{next:a.ID,params:i(o({},e),{pos:r+1})};let s=t[r].includes("-->");return n.id=s?"":t[r],{next:a.TIME_LINE,params:i(o({},e),{current:n,tokens:t,pos:s?r:r+1})};},[a.TIME_LINE](e){let{tokens:t,pos:r,current:n}=e,s=t[r],[E,c]=s.split("-->");return n.from=f(E),n.to=f(c),{next:a.TEXT,params:i(o({},e),{current:n,pos:r+1})};},[a.TEXT](e){let{tokens:t,pos:r,current:n}=e;return t.length<=r?{next:a.FINISH,params:e}:(n.text=t[r],{next:a.MULTI_LINE_TEXT,params:i(o({},e),{current:n,pos:r+1})});},[a.MULTI_LINE_TEXT](e){let{tokens:t,pos:r,current:n}=e;return t.length<=r||u(t[r])?{next:a.FIN_ENTRY,params:e}:(n.text=`${n.text}
${t[r]}`,{next:a.MULTI_LINE_TEXT,params:i(o({},e),{current:n,pos:r+1})});},[a.FIN_ENTRY](e){let{pos:t,current:r,result:n}=e;if(L(r))n.push(r);else throw new Error(`Parsing error current not complete ${JSON.stringify(r)}`);return{next:a.ID_OR_NOTE_OR_STYLE_OR_REGION,params:i(o({},e),{current:{},pos:t+1})};},[a.FINISH](e){return{next:a.FINISH,params:e};}}),$=e=>({entries:x().start(e)}),Y=e=>e.startsWith("WEBVTT")?$(e):g(e);var z=(()=>{let t=class t{transform(n){let s=Math.floor(n/3600),E=Math.floor(n%3600/60),c=n%60;if(s>0){let p=""+s+"\u5C0F\u65F6";return E!==0&&(p+=" "+(""+E+"\u5206\u949F")),c!==0&&(p+=" "+(""+c+"\u79D2")),p;}if(E>0){let p=""+E+"\u5206\u949F";return c!==0&&(p+=` ${c}sec`),p;}return""+c+" \u79D2 ";}};_(t,"\u0275fac",function(s){return new(s||t)();}),_(t,"\u0275pipe",h({name:"myTimeDurationFormatter",type:t,pure:!0}));let e=t;return e;})();export{D as a,Y as b,z as c};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-YW3SQGDX.js.map