'use strict';let __workerContext=undefined;self['getLanguag'+'eDirection'+'FromLangua'+'ge']=function(v){const U={'MUjbp':'LTR'},V=self['__language'+'DirectionM'+'ap'];return V&&V[v]||U['MUjbp'];},self['g_profanit'+'y_list']={},self['test_76_ge'+'t_caption_'+'render_par'+'ams']=function(){return null;},self['g_caption_'+'last_rende'+'red_params']=null,self['debounce']=function(v){return v;},self['EXPORT_VID'+'EO_FRAMERA'+'TE']=-0x382+0x2464+-0x12*0x1d2,importScripts('../utils/c'+'anvasRound'+'edRect.js'),importScripts('helpers.js');function assertContext(){const v={'nFdZp':function(U,V){return U===V;},'Cthkb':'Caption\x20wo'+'rker\x20not\x20i'+'nitialized'};if(v['nFdZp'](__workerContext,undefined))throw new Error(v['Cthkb']);return __workerContext;}function loadPrefetchedFonts(v){const U={'vocEc':function(B,G){return B||G;},'rnutl':function(B,G){return B===G;}},V=self['fonts'];if(U['vocEc'](!V,!v)||U['rnutl'](v['length'],-0x13*-0x11d+-0xf72+0x1e7*-0x3))return Promise['resolve']();return Promise['all'](v['map'](function(B){const G={'style':B['style'],'weight':B['weight']};B['unicodeRan'+'ge']&&(G['unicodeRan'+'ge']=B['unicodeRan'+'ge']);const W=new FontFace(B['family'],B['dataBuffer'],G);return W['load']()['then'](function(){V['add'](W);});}));}function warmupFonts(v){const U={'UAfVH':function(B,G){return B||G;},'almzJ':function(B,G){return B===G;}},V=self['fonts'];if(U['UAfVH'](!V,!v)||U['almzJ'](v['length'],-0x1cc7+-0x9*0x36d+0x3b9c))return Promise['resolve']();return Promise['allSettled'](v['map'](function(B){return V['load'](B['fontString']);}));}function renderImage(v){const U={'BzuDh':function(T,o){return T-o;},'wBLlf':function(T){return T();},'BUMka':function(T,o,E,c,n,t,d,F,K){return T(o,E,c,n,t,d,F,K);},'WjLua':'image/png'},V=U['wBLlf'](assertContext),B=V['sequenceWi'+'dth'],G=V['sequenceHe'+'ight'],W=V['captionRen'+'derParams'],a=V['formattedC'+'aptionsChu'+'nks'],X=W['language']||'en',A=new OffscreenCanvas(B,G),f=new OffscreenCanvas(B,G),k=new OffscreenCanvas(B,G),j=f['getContext']('2d'),i=k['getContext']('2d'),J={'language':X,'tempTextCtx':j,'tempShadowCtx':i},I=Date['now'](),H=U['BUMka'](test_74_render_captions_by_index,A,v['chunkIndex'],v['wordIndex'],W,v['layer'],a,![],J),M=Date['now']()-I,x=Date['now']();return A['convertToB'+'lob']({'type':U['WjLua']})['then'](function(T){return T['arrayBuffe'+'r']();})['then'](function(T){const o=U['BzuDh'](Date['now'](),x);return{'pngBuffer':T,'boxPosition':H,'drawMs':M,'encodeMs':o};});}function formatWorkerError(v){return{'message':v&&v['message']?v['message']:String(v),'stack':v&&v['stack']};}self['addEventLi'+'stener']('message',function(v){const U={'iKXDc':function(B,G){return B(G);},'FFeBG':'render-ima'+'ge-result','ufYQG':function(B,G){return B===G;},'jFJcd':'init','IaRhm':'render-ima'+'ge','KjArk':function(B,G){return B(G);}},V=v['data'];if(U['ufYQG'](V['type'],'dispose')){__workerContext=undefined;return;}if(V['type']===U['jFJcd']){const B=V['payload'];self['__language'+'DirectionM'+'ap']=B['languageDi'+'rectionMap']||{},self['g_profanit'+'y_list']=B['profanityL'+'ist']||{},U['iKXDc'](loadPrefetchedFonts,B['prefetched'+'Fonts']||[])['then'](function(){return U['iKXDc'](warmupFonts,B['fontWarmup'+'s']||[]);})['then'](function(){__workerContext={'captionRenderParams':B['captionRen'+'derParams'],'formattedCaptionsChunks':B['formattedC'+'aptionsChu'+'nks'],'sequenceWidth':B['sequenceWi'+'dth'],'sequenceHeight':B['sequenceHe'+'ight']},self['postMessag'+'e']({'type':'ready'});})['catch'](function(G){self['postMessag'+'e']({'type':'error',...U['iKXDc'](formatWorkerError,G)});});return;}if(U['ufYQG'](V['type'],U['IaRhm'])){const G=V['payload'];U['KjArk'](renderImage,G)['then'](function(W){self['postMessag'+'e']({'type':U['FFeBG'],'requestId':G['requestId'],'pngBuffer':W['pngBuffer'],'boxPosition':W['boxPositio'+'n'],'drawMs':W['drawMs'],'encodeMs':W['encodeMs']},[W['pngBuffer']]);})['catch'](function(W){self['postMessag'+'e']({'type':'error','requestId':G['requestId'],...U['iKXDc'](formatWorkerError,W)});});}});